A rotten fruit will decompose in the soil, and provides the soil nutritions. Therefore other plants will have better growth. Every fruit has a nutrition value of n, where n is a positive integer. The process of decomposition yields to the following:
1- A fruit piece has nutrition value of n will decompose into two smaller fruit pieces having nutrition values of m and n/m, where m is n’s smallest prime factor with m is strictly less than n. So now there’re 2 fruit pieces after decomposition.
2- Keep decomposing the fruit pieces as many as possible, until no more fruit piece can be decomposed into smaller pieces.
Return the sum of nutrition value of all final fruit pieces that cannot be further decomposed.
(*Note: You can always re-decompose a decomposed fruit piece, as long as it meets the decomposition requirements)
Input 1: n = 12
Output 1: 7
Explanation 1: Initially, the fruit has nutrition value of 12, it can decompose into pieces of 2 and 6, for the first piece, it cannot be decomposed again, but for the second piece, it can be further decomposed into pieces of 2 and 3, note both of these two pieces are not possible to re-decompose, so the final fruit pieces we cannot decompose further are with nutrition value of 2,2,3, and 2+2+3 = 7, therefore yield 7.
Input 2: n = 32
Output 2: 10
Number of Testcases: 15
Specification: Every testcase consists one line, each line has a single number n, output the sum of nutrition value of all final fruit pieces that cannot be further decomposed
Input:
6
100
396
899
1024
1309
6208
6930
25920
38891
209981
6720101
33554432
998137982
4294967295
Time Complexity: O(n) ~ O(nlogn)
Space Complexity: O(1)
Fun Fact: This problem can be solved using an advanced algorithm with time complexity of O(n^0.25)
4


Correct answers:
Wrong answers:
Unanswered:
START GAME
Time left :
Java script is a :
Coffe drink
Programing Language
Data base
Tesla model
None of the above
Function in a object its called :
Microsoft
Jquery
Variable
Method
None of the above
I tunes is owned by :
Blackberry
Srawberry
Apple
Pear
None of the above
∫e
x
dx=?
e
x
x
e
1
None of the above
Albert Einstein discovres:
Theory of relativity
The law of gravity
Magnetic induction
Nuclear forces
None of the above
Black mirror series is on:
Netflix
Amazon
Hullu
HBO
None of the above
React is developed by:
Facebook
Google
Yahoo
Twiter
None of the above
READY


method of static class JsNgram
Description
Custom log function with verbose level.
Example
JsNgram.log.v1('level 1 debugging message: ', x);
Usage
log.v0(obj1[, obj2, ... ]);
log.v1(obj1[, obj2, ... ]);
log.v2(obj1[, obj2, ... ]);
log.v3(obj1[, obj2, ... ]);
When verbose = 1
, log.v0
and log.v1
act as console.log
.
On the other hand log.v2
and log.v3
do nothing.
The log.v0
is always as same as console.log
.
Inner Class Log
The log
method is an instance of inner class Log
.
It has methods v0
, v1
, v2
and v3
.
The class is initialized with verbose level.
And the instance will have fixed rolls on these four methods.
When property verbose
changed
A new instance of the inner class Log
is generated with the new verbose level.
This new instance is set as the method log
.


 I craft custom digital marketing solutions so you can have maximum impact online.
With the diversity of devices accessing the web, its crucial your site looks great in any screen format. I create fluid, responsive designs that will scale from small to large screens with ease.


Timeline
Domain collections available: May 1
Topics available to participants: June 1
Runs due from participants: Aug 1
Evaluation results returned: Sep 15
TREC 2015 notebook paper deadline: October
TREC 2015 conference: November 17-20, 2015


A collection of functions to compute the Rao-Stirling diversity index (Porter and Rafols, 2009) <doi:10.1007/s11192-008-2197-2> and its extension to acknowledge missing data (i.e., uncategorized references) by calculating its interval of uncertainty using mathematical optimization as proposed in Calatrava et al. (2016) <doi:10.1007/s11192-016-1842-4>. The Rao-Stirling diversity index is a well-established bibliometric indicator to measure the interdisciplinarity of scientific publications. Apart from the obligatory dataset of publications with their respective references and a taxonomy of disciplines that categorizes references as well as a measure of similarity between the disciplines, the Rao-Stirling diversity index requires a complete categorization of all references of a publication into disciplines. Thus, it fails for a incomplete categorization; in this case, the robust extension has to be used, which encodes the uncertainty caused by missing bibliographic data as an uncertainty interval. Classification / ACM - 2012: Information systems ~ Similarity measures, Theory of computation ~ Quadratic programming, Applied computing ~ Digital libraries and archives.
| Version: | 1.0-3 |
| Depends: | R (≥ 3.2.3) |
| Imports: | doParallel (≥ 1.0.10), gmp (≥ 0.5-12), iterpc (≥ 0.3.0), quadprog (≥ 1.5-5), igraph (≥ 1.0.1), foreach (≥ 1.4.3) |
| Published: | 2017-08-14 |
| Author: | María del Carmen Calatrava Moreno [aut, cre], Thomas Auzinger [aut] |
| Maintainer: | María del Carmen Calatrava Moreno <mc.calatrava.moreno at gmail.com> |
| License: | GPL-3 |
| URL: | https://gitlab.com/mc.calatrava.moreno/robustrao.git |
| NeedsCompilation: | no |
| Citation: | robustrao citation info |
| In views: | MissingData |
| CRAN checks: | robustrao results |
| Reference manual: | robustrao.pdf |
| Package source: | robustrao_1.0-3.tar.gz |
| Windows binaries: | r-devel: robustrao_1.0-3.zip, r-release: robustrao_1.0-3.zip, r-oldrel: robustrao_1.0-3.zip |
| OS X binaries: | r-release: robustrao_1.0-3.tgz, r-oldrel: robustrao_1.0-3.tgz |
| Old sources: | robustrao archive |
Please use the canonical form https://CRAN.R-project.org/package=robustrao to link to this page.


JavaScript Code can be called by using: /10
Which of the following is not considered as an error in JavaScript? /10
A function definition expression can be called: /10
The property of a primary expression is: /10
JavaScript is a _______________ language. /10
Your Total Marks


section demo
this is a section paragraph
article demo
this is an article paragraph
HTML
|
XHTML
|
HTML5
|
CSS
|
header demo
this is a header demo
figure demo
Fig1. - The Pulpit Pock, Norway.


3D HSV color picker
Rgb
Hex
Hsv
You can zoom and rotate the color picker with the help of the mouse cursor while it is inside the picker's bounding box.
Click on the cone's top pane to choose color hue.
Click on the cone's cut panes to pick a color.


Jenny Xue<EMAIL_ADDRESS>I modified the height and the width of the video and made it bigger.
The changes made to this example is at the top of the tinyCodeExample.html file.


Enter some text:
Public link
Public links always link to the latest version of a file.
Public links look like:
https://${username}.files.fission.name/p/${path_to_file}
Archival Link
Archival links permanently link to one version of the file.
When you update a file, the content identifier (root CID) for the user's filesystem gets updated. You can use
the root CID and the file path to get a permanent link to the content.
These links look like
https://ipfs.runfission.com/ipfs/${rootCid}/p/${path_to_file}
Older Versions
Webnative keeps
Versions
of each file. You can link to older versions of the file by version CID.
These links look like
https://ipfs.runfission.com/ipfs/${version.cid}/userland


| nchain {coda} | R Documentation |
These functions give the dimensions of an MCMC object
returns the number of iterations.
returns the number of variables.
returns the number of parallel chains.
niter(x) nvar(x) nchain(x)
x |
An |
A numeric vector of length 1:


Student Form First Name : Last Name : Email : PassWord Course Java Python c++ HTML&CSS Gender Male Female Submit Clear The Form


cupcakes.html Example File
webengine/recipebrowser/resources/pages/cupcakes.html<!doctype html>   <meta charset="utf-8"> <title>Cupcakes</title> <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css"> <link rel="stylesheet" type="text/css" href="assets/custom.css">

  Cupcakes ============= ### Ingredients * 300 g caster sugar * 150 ml sunflower oil * 1 teaspoon vanilla extract * 500 g dairy-free soya yoghurt * 2 teaspoons cider vinegar * 350 g plain flour * 1 teaspoon bicarbonate of soda * 1½ teaspoons baking powder #### For the vegan vanilla icing * 200 g dairy-free soya spread , chilled * 660 g icing sugar * ½ teaspoon vanilla extract ### Instructions 1. Preheat the oven to 170°C fan/375°F/gas 5. 2. Place the sugar, oil and vanilla extract in a large bowl, then beat with an electric mixer for 1 to 2 minutes, until well combined. 3. Mix the yoghurt and vinegar together in a bowl, then add to the mixture and beat for 1 to 2 minutes. 4. Add the remaining cupcake ingredients and 1 teaspoon of fine sea salt, then whisk until smooth and just combined. 5. Fill the paper cases two-thirds full with mixture, but don’t bother to smooth it out. 6. Bake for 20 minutes, or until they spring back when touched. Leave to cool, transferring to a wire cooling rack after 5 minutes. 7. Meanwhile, make the icing. Beat the soya spread with an electric mixer for 1 to 2 minutes, or until smooth. 8. Sift the icing sugar into a large bowl, then add to the soya spread in two stages, beating well between each. 9. Add the vanilla extract and a small splash of water, then whisk for a further few minutes, or until silky smooth – if it’s too stiff, add a splash more water to loosen. 10. Once the cupcakes are cool, decorate them with the icing and add a few sprinkles too if you like – whatever takes your fancy – then enjoy. **Enjoy!**


-
Vada pav at JJ garden
One of the oldest and most famous vada-pav stalls in town, this one is a must-try if you haven’t had it yet. Slightly expensive than your usual ones, but the size justifies the price. Don’t forget to ask for some churra on the side.
Where: 948, And 949, Bootee Street, Camp
When: 9 am to 10 pm -
Misal Pav at bedekar
In the bylanes of Narayan Peth, there is an iconic spot that serves a mouth-watering misal. If you don’t like your misal too spicy, here you have an option to choose milder gravy. Mashed potatoes with pohe chivda, topped off with onions and coriander; this one is a crowd favourite.
Where: 418 Munjabacha Bol, Narayan Peth8
When: 8 am to 7 pm -
Bhakarwadi At Chitale Bandhu
No one leaves Pune without trying the absolutely delish Bhakarvadis from Chitale Bandhu. No one!
Where: 759/54, Deccan Gymkhana, Opp Gharware Chowk
When: 9 am to 8:30 pm. Closed on Mondays.


| Package | Description |
|---|---|
| org.springframework.context |
This package builds on the beans package to add support for
message sources and for the Observer design pattern, and the
ability for application objects to obtain resources using a
consistent API.
|
| org.springframework.context.annotation |
Annotation support for the Application Context, including JSR-250 "common"
annotations, component-scanning, and Java-based metadata for creating
Spring-managed objects.
|
| org.springframework.context.event |
Support classes for application events, like standard context events.
|
| org.springframework.context.support |
Classes supporting the org.springframework.context package,
such as abstract base classes for ApplicationContext
implementations and a MessageSource implementation.
|
| org.springframework.format.datetime |
Formatters for
java.util.Date properties. |
| org.springframework.format.datetime.joda |
Integration with Joda-Time for formatting Joda date and time types as well as standard JDK Date types.
|
| org.springframework.format.datetime.standard |
Integration with the JSR-310
java.time package in JDK 8. |
| org.springframework.format.number |
Formatters for
java.lang.Number properties. |
| org.springframework.format.number.money |
Integration with the JSR-354
javax.money package. |
| org.springframework.format.support |
Support classes for the formatting package,
providing common implementations as well as adapters.
|
| org.springframework.scheduling.annotation |
Java 5 annotation for asynchronous method execution.
|
| org.springframework.scripting.support |
Support classes for Spring's scripting package.
|
| org.springframework.ui.context |
Contains classes defining the application context subinterface
for UI applications.
|
| org.springframework.ui.context.support |
Classes supporting the org.springframework.ui.context package.
|
| org.springframework.validation |
Provides data binding and validation functionality,
for usage in business and/or UI layers.
|
| org.springframework.validation.beanvalidation |
Support classes for integrating a JSR-303 Bean Validation provider
(such as Hibernate Validator) into a Spring ApplicationContext
and in particular with Spring's data binding and validation APIs.
|
| Class and Description |
|---|
| ApplicationContext
Central interface to provide configuration for an application.
|
| ApplicationEvent
Class to be extended by all application events.
|
| ApplicationEventPublisher
Interface that encapsulates event publication functionality.
|
| ApplicationListener
Interface to be implemented by application event listeners.
|
| ConfigurableApplicationContext
SPI interface to be implemented by most if not all application contexts.
|
| Lifecycle
A common interface defining methods for start/stop lifecycle control.
|
| MessageSource
Strategy interface for resolving messages, with support for the parameterization
and internationalization of such messages.
|
| MessageSourceResolvable
Interface for objects that are suitable for message resolution in a
MessageSource . |
| NoSuchMessageException
Exception thrown when a message can't be resolved.
|
| Phased
Interface for objects that may participate in a phased
process such as lifecycle management.
|
| Class and Description |
|---|
| ApplicationContext
Central interface to provide configuration for an application.
|
| ApplicationEventPublisher
Interface that encapsulates event publication functionality.
|
| ConfigurableApplicationContext
SPI interface to be implemented by most if not all application contexts.
|
| EnvironmentAware
Interface to be implemented by any bean that wishes to be notified
of the
Environment that it runs in. |
| Lifecycle
A common interface defining methods for start/stop lifecycle control.
|
| MessageSource
Strategy interface for resolving messages, with support for the parameterization
and internationalization of such messages.
|
| ResourceLoaderAware
Interface to be implemented by any object that wishes to be notified of the
ResourceLoader (typically the ApplicationContext) that it runs in. |
| Class and Description |
|---|
| ApplicationContext
Central interface to provide configuration for an application.
|
| ApplicationContextAware
Interface to be implemented by any object that wishes to be notified
of the
ApplicationContext that it runs in. |
| ApplicationEvent
Class to be extended by all application events.
|
| ApplicationEventPublisher
Interface that encapsulates event publication functionality.
|
| ApplicationEventPublisherAware
Interface to be implemented by any object that wishes to be notified
of the ApplicationEventPublisher (typically the ApplicationContext)
that it runs in.
|
| ApplicationListener
Interface to be implemented by application event listeners.
|
| Class and Description |
|---|
| ApplicationContext
Central interface to provide configuration for an application.
|
| ApplicationContextAware
Interface to be implemented by any object that wishes to be notified
of the
ApplicationContext that it runs in. |
| ApplicationEvent
Class to be extended by all application events.
|
| ApplicationEventPublisher
Interface that encapsulates event publication functionality.
|
| ApplicationListener
Interface to be implemented by application event listeners.
|
| ConfigurableApplicationContext
SPI interface to be implemented by most if not all application contexts.
|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| EnvironmentAware
Interface to be implemented by any bean that wishes to be notified
of the
Environment that it runs in. |
| HierarchicalMessageSource
Sub-interface of MessageSource to be implemented by objects that
can resolve messages hierarchically.
|
| Lifecycle
A common interface defining methods for start/stop lifecycle control.
|
| LifecycleProcessor
Strategy interface for processing Lifecycle beans within the ApplicationContext.
|
| MessageSource
Strategy interface for resolving messages, with support for the parameterization
and internationalization of such messages.
|
| MessageSourceResolvable
Interface for objects that are suitable for message resolution in a
MessageSource . |
| NoSuchMessageException
Exception thrown when a message can't be resolved.
|
| ResourceLoaderAware
Interface to be implemented by any object that wishes to be notified of the
ResourceLoader (typically the ApplicationContext) that it runs in. |
| Class and Description |
|---|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| Class and Description |
|---|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| Class and Description |
|---|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| Class and Description |
|---|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| Class and Description |
|---|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| Class and Description |
|---|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| Class and Description |
|---|
| ApplicationContext
Central interface to provide configuration for an application.
|
| ApplicationContextAware
Interface to be implemented by any object that wishes to be notified
of the
ApplicationContext that it runs in. |
| ApplicationListener
Interface to be implemented by application event listeners.
|
| EmbeddedValueResolverAware
Interface to be implemented by any object that wishes to be notified of a
StringValueResolver for the resolution of embedded definition values. |
| Class and Description |
|---|
| ResourceLoaderAware
Interface to be implemented by any object that wishes to be notified of the
ResourceLoader (typically the ApplicationContext) that it runs in. |
| Class and Description |
|---|
| MessageSource
Strategy interface for resolving messages, with support for the parameterization
and internationalization of such messages.
|
| Class and Description |
|---|
| ApplicationContext
Central interface to provide configuration for an application.
|
| MessageSource
Strategy interface for resolving messages, with support for the parameterization
and internationalization of such messages.
|
| Class and Description |
|---|
| MessageSourceResolvable
Interface for objects that are suitable for message resolution in a
MessageSource . |
| Class and Description |
|---|
| ApplicationContext
Central interface to provide configuration for an application.
|
| ApplicationContextAware
Interface to be implemented by any object that wishes to be notified
of the
ApplicationContext that it runs in. |
| MessageSource
Strategy interface for resolving messages, with support for the parameterization
and internationalization of such messages.
|
| MessageSourceResolvable
Interface for objects that are suitable for message resolution in a
MessageSource . |


An image classification or image recognition model simply detect the probability of an object in an image. In contrast to this, object localization refers to identifying the location of an object in the image. An object localization algorithm will output the coordinates of the location of an object with respect to the image. In computer vision, the most popular way to localize an object in an image is to represent its location with the help of bounding boxes.
Shows an example of a bounding box.
A bounding box can be initialized using the following parameters:


Does love have a limit?
Well, I like to separate "love" into two: fake and genuine.
In the fake one, absolutely yes.
For the animals, the degenerates, that's an implicit condition.
For them, love is a mere desire to enjoy an object.
That is the goal, and the limit.
Once the goal is reached, the desire, and thus the "love", goes away.
I was told some even end up hating each other.
That's why I call it fake.
On the other hand, there is genuine Love.

A good characteristic of the noble, refined and virtuous hearts.
In this one, Love is not generated by desire, but reason.
Love has the simple goal of two becoming one: the merging of two spirits.
Because this can only take place on a spiritual level, we use the sights, the hearing, the imagination.

We smell each other's heartbeats; taste each other's smell; listen to each other's touch.
There's the erotic, the intensity, the climax, the glance into each other's eyes.
We want to become one.
Physically.
In reality.
At each moment.

Your goal can never be reached.
Your desire is never stopped.
You can never settle down after achieving something - you always want more.
You are never satisfied.
You have extreme cold, and intense heat.
You are crying, then laughing, then crying and laughing.
You see without eyes; hear without ears; yell without mouth; fly without wings.
Genuine Love has no limits.
Genuine Love is always reciprocal - it is impossible to be faked.
Genuine Love sets you free.


| Task: Sprint Review Meeting |
| |
|
| Each sprint concludes with a Sprint Review where the team demonstrates a potentially shippable product increment. |
| Disciplines: Scrum Activities |
|
Relationships
| Roles | Primary Performer:
| Additional Performers:
|
| Inputs | Mandatory:
| Optional:
|
| Outputs |
|
Main Description
At the end of each sprint a sprint review meeting is held. During this meeting the Scrum team shows what they accomplished
during the sprint. Typically this takes the form of a demo of the new features.
Participants in the sprint review typically include the Product Owner, the Scrum team, the ScrumMaster, management,
customers, and engineers from other projects.
During the sprint review the project is assessed against the sprint goal determined during the Sprint planning meeting.
Ideally the team has completed each product backlog item brought into the sprint, but it is more important that they
achieve the overall goal of the sprint. |
Key Considerations
The sprint review meeting is intentionally kept very informal, typically with rules forbidding the use of PowerPoint slides
and allowing no more than two hours of preparation time for the meeting. A sprint review meeting should not become a
distraction or significant detour for the team; rather, it should be a natural result of the sprint.
|
This program and the accompanying materials are made available under the
Eclipse Public License v1.0 which
accompanies this distribution.
Copyright © 1998--2008 Mountain Goat Software. All rights reserved.
Copyright © 2008 ATSC. All rights reserved.
|
|


@InterfaceAudience.Public @InterfaceStability.Evolving public interface ExecutionEngine
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Perform any cleanup operation
|
void |
explain(LogicalPlan lp,
PigContext pc,
PrintStream ps,
String format,
boolean verbose,
File dir,
String suffix)
This method handles the backend processing of the Explain command.
|
Properties |
getConfiguration()
Returns the Properties representation of the ExecutionEngine
configuration.
|
DataStorage |
getDataStorage()
Returns the DataStorage the ExecutionEngine is using.
|
ExecutableManager |
getExecutableManager()
Returns the ExecutableManager to be used in Pig Streaming.
|
void |
init()
This method is responsible for the initialization of the ExecutionEngine.
|
PigStats |
instantiatePigStats()
Creates a PigStats object which will be accessible as a ThreadLocal
variable inside the PigStats class.
|
ScriptState |
instantiateScriptState()
Creates a ScriptState object which will be accessible as a ThreadLocal
variable inside the ScriptState class.
|
void |
kill()
This method is called when user requests to kill all jobs
associated with the execution engine
|
void |
killJob(String jobID)
This method is called when a user requests to kill a job associated with
the given job id.
|
PigStats |
launchPig(LogicalPlan lp,
String grpName,
PigContext pc)
This method is responsible for the actual execution of a LogicalPlan.
|
void |
setConfiguration(Properties newConfiguration)
Responsible for updating the properties for the ExecutionEngine.
|
void |
setProperty(String property,
String value)
Responsible for setting a specific property and value.
|
void init() throws ExecException
ExecException
void setConfiguration(Properties newConfiguration) throws ExecException
newConfiguration
- -- Properties object holding all configuration valsExecException
void setProperty(String property, String value)
property
- to updatevalue
- to set for propertyProperties getConfiguration()
PigStats launchPig(LogicalPlan lp, String grpName, PigContext pc) throws FrontendException, ExecException
lp
- -- plan to compilegrpName
- -- group name for submissionpc
- -- context for executionExecException
FrontendException
void explain(LogicalPlan lp, PigContext pc, PrintStream ps, String format, boolean verbose, File dir, String suffix) throws PlanException, VisitorException, IOException
lp
- -- plan to explainpc
- -- context for explain processingps
- -- print stream to write all output to (if dir param is null)format
- -- format to print explainverbose
- dir
- -- directory to write output to. if not null, write to filessuffix
- -- if writing to files, suffix to be used for each filePlanException
VisitorException
IOException
DataStorage getDataStorage()
ScriptState instantiateScriptState()
PigStats instantiatePigStats()
ExecutableManager getExecutableManager()
void kill() throws BackendException
BackendException
void killJob(String jobID) throws BackendException
BackendException
void destroy()
Copyright © 2007-2017 The Apache Software Foundation


Casablanca, Morocco
'Tire Lion'
The rubbery beast is sculpted from recycled materials.
by Max CortesiIn the middle of Terminal 1 at Casablanca’s own Mohammed V Airport is a black sculpture of a lion. Close inspection will reveal that the sculpture is entirely made of used tires and other recycled materials.
The artist behind the Tyre Lion is Lahcen Iwi, whose talent rests in using recycled materials to create amazing sculptures. Iwi familiarised himself with this form of art at and early age, while observing his father turning used tires into jars and buckets.
After completing his baccalaureate, Iwi began working in a carpentry shop. It was here that he started exploring the possibility of covering common furniture with strips of recycled tires to create a new object whose main attractiveness was its artistic merit rather than its functionality.
The use of wood is still in place in Iwi’s art, albeit hidden. Animal figures dominate his output, but he’s equally comfortable creating sculptures of imaginary creatures, human figures, and motorbikes. But underneath all the tires that make these sculptures so striking is a frame made of wood.
Visit Morocco with Atlas Obscura Trips
Morocco: Mountains, Desert & Berber Culture
From the Atlas Mountains to the Sahara, experience Morocco's Berber culture
Learn More »
Community Discussion
-
No Comments Yet
Start the discussion.
forum Visit our forums.


“Anger, despair, ferocity, hunger, terror—all were depicted upon those awful faces. Through the cracked glass, deadly fumes began to steal, my room seemed cloudy, I was as if transfixed, unable to move, to call, to reach the lights, to do aught but stand staring, tremblingly. The faces pressed closer and yet closer; they reached the glass, it cracked again, and more fumes poured in; long arms (there seemed hundreds of them) reached wildly up, skinny hands, like those of skeletons, were held out as if to grasp.” — Bessie Kyffin-Taylor, From Out Of The Silence


60,000+ capacity Anfield on horizon as Liverpool set to announce plans
by Biscan's BootsLiverpool will present their plans for Anfield ‘s latest capacity increase to local residents and businesses at the end of this month.
Neil Jones of Goal has written today that the club wants Anfield to grow to at least 60,000, due to the enormous current demand for tickets that far outweighs the 54,000 seats we have now.
Many Liverpool members will agree that the ticketing system right now is a mess and it is very hard to watch home games – even when a loyal fan.
According to Jones, Liverpool will set up ‘an online hub,’ where fans can respond to the plans – which will be first announced at the Kop Bar in Anfield on Friday November 29 (4pm-8pm).
Liverpool right now wouldn’t struggle to sell out a 90,000 seater – so the 60,000 should be the least we’re aiming for.
With extra bodies though comes a need for better transport links. Labour’s West Derby MP Ian Byrne has already discussed plans for a train station by the ground to help this – so perhaps we’ll hear more about this at the first meeting, too.


Google Suggestions
Search!
Tag List
Google Suggestion Tool Uses Google Suggest Feature To Generate Keywords


Your Password has been reset.Please check the new password below one.
User Name:
[[${user.userName}]]
Password:
[[${newPassword}]]
[[${currentYear}]] © Indian Ealge Pvt. Ltd.


YasH
Home
(current)
Songs
Songs
Download any thing you want
K.K Songs
Tu Jo Mila (Bajrangi Bhaijaan)
Zara Se (Jannat)
Kya Mujhe Pyar Hai (Woh Lamhe)
Dil Kyun Yeh Mera (Kites)
Zindagi Do Pal Ki (Kites)
Tu Hi Meri Shab Hai (Gangster)
Ajab Si (Om Shanti Om)
Labon Ko (Bhool Bhulaiyaa)
Piya Aaye Na (Aashiqui )
Kabhi Aayine Pe (Hate Story )
I Am In Love (OUATIM)
Make Some Noise (Desi Boyz)
Next


Voyage: Persisting Objects in Document Databases
Tips and Tricks
This chapter contains some tips and tricks that people collected over the years. It was written by Sabina Manaa.
How to query for an object by id?
If you know the _id value, you initialize an OID with this and query for it.
Note that both are equivalent:
Or you have an instance (in this example of Person
) which is in a root collection, then you ask it for its voyageId and use it in your query. The following assumes that you have a Trips
root collection and a Persons
root collection. The trip has an embedded receipts
collection. Receipts have a description
. The query asks for all trips of the given person with at least one receipt with the description aString
.
Not yet supported mongo commands
Indexes
It is not yet possible to create and remove indexes from voyage, but you can use OSProcess.
Assume you have a database named myDB
with a collection named Trips
.
The trips have an embedded collection with receipts. The receipts have an attribute named description
.
Then you can create an index on description with
Remove all indexes on the Trips collection with:
Backup
It is not yet possible to create backup from voyage, so use
Please see the mongo documentation for mongo commands, especially the --eval
command.
Useful mongo commands
Use “.explain()” in the mongo console to ensure that your query indeed uses the index.
Example:
Create an index on an embedded attribute (description
):
Query for it and call explain. We see, that only 2 documents were scanned. > db.Trips.find({"receipts.description":"a"}).explain("executionStats") { "cursor" : "BtreeCursor receipts.receiptDescription_1", "isMultiKey" : true, "n" : 2, "nscannedObjects" : 2, "nscanned" : 2, "nscannedObjectsAllPlans" : 2, "nscannedAllPlans" : 2, "scanAndOrder" : false, "indexOnly" : false, "nYields" : 0, "nChunkSkips" : 0, "millis" : 0, "indexBounds" : { "receipts.receiptDescription" : [ [ "a", "a" ] ] }, "allPlans" : [ { "cursor" : "BtreeCursor receipts.receiptDescription_1", "n" : 2, "nscannedObjects" : 2, "nscanned" : 2, "indexBounds" : { "receipts.receiptDescription" : [ [ "a", "a" ] ] } } ], "server" : "MacBook-Pro-Sabine.local:27017" } ]]]
Now, remove the index
Query again, all documents were scanned.
Storing instances of Date in Mongo
A known issue of mongo is Mongo that it does not difference between Date
and DateAndTime
, so even if you commit a Date
, you will get back a DateAndTime
. You have to transform it back to Date
manually when materializing the object.
Database design
Often you objects do not form a simple tree but a graph with cycles. For example you could have persons which are pointing to their trips and each trip knows about its person (Person <->>Trip
). If you create a root Collection with Persons and a Root collection with Trips, you avoid endless loops to be generated (see chapter 1.2).
This is an example for a trip
pointing to a person
which is in another root collection and another root collection, paymentMethod
. Note that the receipt also points back to the trip, which does not create a loop.
The corresponding person
points to all its trips
and to its company
.
If your domain has strictly delimited areas, e.g. clients, you could think about creating one repository per area (client).
Retrieving data
One question is if it possible to retrieve data from Mongo collection even if the database was not created via Voyage. Yes it is possible. Here is the solution.
First we create a class MyClass
with two class side methods:
Also, to properly read the data one should add instance variables depending on what is in the database.
For example if we have the following information stored in the database:
In this case MyClass
should have instanceVariables: item
, qty
and tags
and accessors.
Then we define the following description on the class side
After that one can connect to database and get the information.


Choose your coverage type:
Bronze
- up to $20,000 coverage
- up to $20,000 coverage
Gold
- up to $150,000 coverage
- up to $150,000 coverage
- up to $150,000 coverage
- up to $150,000 coverage
- up to $150,000 coverage
Silver
- up to $50,000 coverage
- up to $50,000 coverage
- up to $50,000 coverage
- up to $50,000 coverage


A MONTH BY THE LAKE A film review by Mark R. Leeper Copyright 1995 Mark R. Leeper
Capsule: There is less going on in A MONTH BY THE LAKE than meets the eye. This is a very slight story set in 1937, the last summer of peace, in the resort area of Lake Como, Italy. It tells of the romantic conflict of an English woman and an American who want the same fatuous man. Not every British period piece film is a HOWARDS END. Rating: 0 (-4 to +4)
Miss Bentley (played by Vanessa Redgrave) has been coming to Lake Como for vacation since she was a little girl. When she was young, many English vacationed in Lake Como, but of late there are few other English vacationing here. This year she is the only person from home until a new mystery man arrives. Major Paul Winslow (Edward Fox) is more boy than man, but Miss Bentley is interested in the dashing- looking Englishman. But then so is Miss Beaumont (Uma Thurman), the newly arrived American nanny for an Italian family. The two compete for Winslow's attentions, Beaumont with her youth and a seemingly effortless flirtation, Bentley with what might almost be called a campaign. Against the background of the pleasant Italian scenery the two play out their game.
This all sounds like it could be done very broadly and could be quite funny. Or it could just bask in the sunshine and lovely natural setting and somehow end up being magical like ENCHANTED APRIL was. Neither is really the case. Trevor Bentham`s screenplay, based on the novelette by H. E. Bates leans more toward understatement.  Beaumont is young and attractive, but empty and shallow. The only strong emotion in the film is Bentley's desperation for the man who may be her last chance ever to marry. Perhaps buried in this film is an allegory about the effortless brashness of America and a more serious and more conflict-bound Europe, but if so, there is not much to the metaphor. More likely this is just an effort to tell a leisurely story in a leisurely setting. If the latter it true, it is a little too much leisure, and the viewer starts looking for the political conflict that must be present in 1937 Italy. In fact, for 1937 Italy, the Lake Como area must be among the least interesting places to be in the country. When Bentley sees a Fascist parade and nearly gets into serious trouble for photographing it, the film seems to perk up a bit in the hope that something of some import will happen. But the moment is quickly fleeting and the story returns from a battle of ideas to a battle of flirtations. It is not surprising that more is not made of the pre-war politics since the original Bates story was set around 1960, or so I have been told.
Director John Irvin is best know recently for his WIDOWS' PEAK, a film that I found even more predictable than A MONTH BY THE LAKE, but at least it had a story to predict. Vanessa Redgrave does what she can with the silly woman she plays, but it cannot have been one of her favorite roles. I know there are people in the world someplace who think that Uma Thurman is talented and very attractive just like I know there are people who think liver and onions is delicious. It is hard for me to be keen on either. Going back to A ROOM WITH A VIEW, we have seen quite a few prestige British period pieces playing the art house circuit. H. E. Bates is unfortunately no E. M. Forster and A MONTH BY THE LAKE is no ROOM WITH A VIEW. Rate it a 0 on the -4 to +4 scale.
Mark R. Leeper<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Enter location:
Enter Landmarks:
Enter the Time of Year You Visited.
Enter notes.
Add
Landmarks:
Time of year visited:
Notes:


BREAKING Woman dies after taking early-morning swim in the sea
We'll be bringing you the very latest updates, pictures and video on this breaking news story
by Abigail O'LearyA woman has died after taking an early-morning swim in the sea.
The woman is understood to have been one of two swimmers who had entered the water this morning off the coast of Ballycastle, Northern Ireland.
Emergency services were called to the scene at 8.28am with a Coastguard helicopter from Prestwick and the Air Ambulance as well as Coastguard crews, police, Fire Service and Ambulance Service personnel rushing to the scene.
We'll be bringing you the very latest updates, pictures and video on this breaking news story.
Please check back regularly for updates on this developing story here at Mirror.co.uk .
For the latest news and breaking news visit Mirror.co.uk/news .
Get all the big headlines, pictures, analysis, opinion and video on the stories that matter to you.
Follow us on Twitter @DailyMirror - the official Daily Mirror & Mirror Online Twitter account - real news in real time.
We're also on Facebook /dailymirror - your must-see news, features, videos and pictures throughout the day from the Daily Mirror, Sunday Mirror and Mirror Online.


class: center, middle, inverse, title-slide # 08 Dual methods ### STAT 535A ### Daniel J. McDonald ### Last modified - 2021-02-06 --- ## Last time $$ \newcommand{\R}{\mathbb{R}} \newcommand{\argmin}[1]{\underset{#1}{\textrm{argmin}}} \newcommand{\norm}[1]{\left\lVert #1 \right\rVert} \newcommand{\indicator}{1} \renewcommand{\bar}{\overline} \renewcommand{\hat}{\widehat} \newcommand{\tr}[1]{\mbox{tr}(#1)} \newcommand{\Set}[1]{\left\{#1\right\}} \newcommand{\dom}[1]{\textrm{dom}\left(#1\right)} \newcommand{\st}{\;\;\textrm{ s.t. }\;\;} $$ .pull-left[ $$ `\begin{aligned} \min_x &\quad f(x)\\ \textrm{s.t} &\quad Ax-b=0\\ &\quad h_i(x)\leq 0 \end{aligned}` $$ 1. Stationarity: `\(0 \in \partial_x \left(f(x)+v^\top h(x)+u^\top (Ax-b)\right)\)` Means: for some pair `\((u,v)\)`, `\(x\)` minimizes the Lagrangian 2. Complementary slackness: `\(v_ih_i(x)=0 \,\,\, , \forall i\)` 3. Primal feasibility: `\(h_i(x) \le 0 \,\,,\,\, Ax=b\)` 4. Dual feasibility: `\(v \ge 0\)` ] -- .pull-right[ **Nice properties of the dual** `$$\begin{aligned}\max_{u,v} &\quad g(u,v)\\ \textrm{s.t.} &\quad v \geq 0\end{aligned}$$` - Dual problem is always convex (dual function is always concave) - The primal and dual optimal values satisfy `\(f^* \geq g^*\)` (weak duality) - Slater's condition: convex primal and feasible `\(x\)` such that any (non-affine) inequalities are strict, then `\(f^*=g^*\)` ] --- ## Today 1. First-order methods for the dual 2. Decomposability 3. Alternating direction method of multipliers 4. Coordinate descent --- ## Dual (sub)gradient ascent/descent .pull-left[ **Primal problem:** `$$\min_x f(x) \st Ax=b.$$` ] .pull-right[ **Dual problem:** `$$\max_u g(u) = -f^*(-A^\top u)-b^\top u,$$` where `\(f^*\)` is the __conjugate__ of `\(f\)`. ] --- - The subdifferential is given by `$$\partial g(u)= A\partial f^*(-A^\top u)-b^\top u,$$` - But recall (properties of conjugates), `\(x\in\arg\min_z f(z) + u^\top (Ax-b)\)` then `\(\partial g(u)={Ax-b}\)`. - We may solve this as follows: 1. guess initial `\(u^{(0)}\)` 2. choose `\(x^{(k)}\in\arg\min_x f(x) + (u^{(k-1)})^\top Ax\)` 3. Update `\(u^{(k)} = u^{(k-1)} + \gamma\left(Ax^{(k)}-b\right)\)` --- ## Why? Assume `\(g\)` differentiable: `$$\nabla g(u) = \frac{\partial}{\partial u} \min_x L(x,u) = A x^{*} - b$$` Then we do Gradient Ascent on `\(g\)` (we just need `\(x^*\)` first). We can choose `\(\gamma\)` as before and apply proximal methods (or acceleration). -- * If `\(g\)` is not differentiable, `\(Ax - b\)` is then the subgradient of `\(-g\)` `\(\Longrightarrow\)` *dual subgradient ascent* * Under conditions (non-trivial), both `\(x^{(k)}\)` and `\(u^{(k)}\)` converge to the primal/dual optimzers. --- ## Decomposable dual `$$\min_x \sum_{i=1}^m f_i(x_i) \st Ax=b$$` Lagrangian can separate: `$$x^+\in\arg\min_{x}\sum_{i=1}^m f_i(x_i) + u^\top Ax \quad\Longleftrightarrow\quad x^+_i\in\arg\min_{x_i} f_i(x_i) + u^\top A_i x_i$$` -- So we can iterate: $$ `\begin{aligned} x_i^{(k)}&\in\arg\min_{x_i}f_i(x_i)+(u^{(k-1)})^\top A_i x_i\\ u^{(k)} &= u^{(k-1)}+\gamma\left(A x^{(k)}-b \right) \end{aligned}` $$ * The first is done individually * The second gathers the results, and then broadcasts `\(u\)` back to the workers --- `$$\min_x \sum_{i=1}^m f_i(x_i) \st Ax=b$$` So we can iterate: $$ `\begin{aligned} x_i^{(k)}&\in\arg\min_{x_i}f_i(x_i)+(u^{(k-1)})^\top A_i x_i\\ u^{(k)} &= u^{(k-1)}+\gamma\left(A x^{(k)}-b \right) \end{aligned}` $$ - Strong duality holds in this particular example since we have no inequality constraints. - If the constraints are inequalities, i.e. `\(Ax\leq b\)`, then use `$$u^{(k)} = \left(u^{(k-1)}+\gamma\left(A x^{(k)}-b \right)\right)_+$$` --- ## Augmented Lagrangian - For for dual ascent to work ( `\(\to g^*\)` ), we need `\(f\)` "nice" - To achieve strong duality (primal optimality) the program must also satisfy one of the conditions mentioned earlier (e.g. Slater's condition). We can alter the problem to enforce strong convexity - Use `\(\min_x f(x)+\frac{\rho}{2}||Ax-b||_2^2 \st Ax=b\)`. - The objective is strongly convex if `\(A\)` has full column rank. - Dual gradient ascent then becomes `$$\begin{aligned} x^{(k)}&=\arg\min_x f(x)+(u^{(k-1)})^\top Ax+\frac{\rho}{2}\norm{Ax-b}_2^2\\ u^{(k)} &= u^{(k-1)}+\rho(Ax^{(k-1)}-b) \end{aligned}$$` -- - Replacing the step size `\(\gamma\)` with `\(\rho\)` gives better convergence properties than the original DGA. - But introducing the norm kills decomposability (if we had it), no parallelization - `\(\rho\)` balances primal feasibility with a small objective - larger `\(\rho\)` deemphasizes objective but forces `\(x^{(k)}\)` toward primal feasiblity --- ## Alternating Direction Method of Multipliers (ADMM) * **Goal:** Combine decomposibility of dual ascent with convergence benefits of AL * Start with `$$\min_{x,z}f(x)+g(z) \st Ax+Bz=c$$` * Add `\(\frac{\rho}{2}\norm{Ax+Bz-c}_2^2\)` to the objective, penalizing infeasibility: `$$L_\rho(x,z,u)=f(x)+g(z)+u^T(Ax+Bz-c) + \frac{\rho}{2}\norm{Ax+Bz-c}_2^2$$` Iteratively update: `$$\begin{aligned} x^{(k)}&=\arg\min_x L_\rho(x,z^{(k-1)},u^{(k-1)})\\ z^{(k)}&=\arg\min_z L_\rho(x^{(k)},z,u^{(k-1)})\\ u^{(k)} &= u^{(k-1)}+\rho(Ax^{(k)}+Bz^{(k)}-c)\\ \end{aligned}$$` --- ## Properties Properties of ADMM (some of which do not require `\(A\)` and `\(B\)` to be full rank): 1. `\(Ax^{(k)}+Bz^{(k)}-c\to 0\)` as `\(k\to\infty\)` (primal feasibility) 2. `\(f^{(k)}+g^{(k)}\to f^*+g^*\)` (primal optimality) 3. `\(u^{(k)}\to u^*\)` (dual solution) 4. doesn't necessarily give `\(x^{(k)}\to x^*\)` and `\(z^{(k)}\to z^*\)` The exact convergence rate is unknown, but empirically seems close to `\(O(1/\epsilon)\)`. -- Stopping criteria: Primal residual: `\(\norm{Ax^{(k)}+Bz^{(k)}-c} \leq \epsilon\)` Dual residual: `\(\rho \norm{A^\top B (z^{(k)}-z^{(k-1)})} \leq \epsilon\)` --- ## Scaled form `$$L_\rho(x,z,u)=f(x)+g(z)+u^T(Ax+Bz-c) + \frac{\rho}{2}\norm{Ax+Bz-c}_2^2$$` * Expand out the quadratic in the AL, and combine with the linear part * Redefine `\(w = u/\rho\)` and simplify `$$L_\rho(x,z,w)=f(x)+g(z)+\frac{\rho}{2}\norm{Ax+Bz-c+w}_2^2-\frac{\rho}{2}\norm{w}_2^2$$` -- Updates become: `$$\begin{aligned} x^{(k)}&=\arg\min_x f(x) + \frac{\rho}{2}\norm{Ax+Bz^{(k-1)}-c+w^{(k-1)}}_2^2\\ z^{(k)}&=\arg\min_z g(z) + \frac{\rho}{2}\norm{Ax^{(k)}+Bz-c+w^{(k-1)}}_2^2\\ w^{(k)} &= w^{(k-1)} + Ax^{(k)} + Bz^{(k)} - c\\ \end{aligned}$$` --- ## Connection to proximal operator The above is the "standard" version, but the intuition is as follows: 1. Start with `\(\min_x f(x)\)`. 2. Add new variables that "split" `\(f\)`: `\(\min_{y,z} h(y) + g(z) \quad \textrm{s.t.}\quad y=z\)`. 3. Iteratively update (scaled form) `$$\begin{aligned} y^{(k)}&=\arg\min_y h(y) + \frac{\rho}{2}\norm{y-z^{(k-1)} + w^{(k-1)}}_2^2\\ z^{(k)}&=\arg\min_z g(z) + \frac{\rho}{2}\norm{y^{(k)} - z + w^{(k-1)}}_2^2\\ w^{(k)} &= w^{(k-1)}+y^{(k)}-z^{(k)}\\ \end{aligned}$$` -- Done this way, with the split(s) corresponding to an identity `$$\begin{aligned} y^{(k)}&=\textrm{prox}_{f,1/\rho}(z^{(k-1)} - w^{(k-1)})\\ z^{(k)}&=\textrm{prox}_{g,1/\rho}(y^{(k)} + w^{(k-1)})\\ w^{(k)} &= w^{(k-1)}+y^{(k)}-z^{(k)}\\ \end{aligned}$$` This is called "Douglas-Rachford Splitting" --- ## Example (LASSO) `$$\min_{\beta,\alpha} \frac{1}{2n}\norm{y-X\beta}_2^2 +\lambda\norm{\alpha}_1 \st \alpha=\beta$$` ADMM update (compare with ridge regression): `$$\begin{aligned} \beta^{(k)}&=\left(\frac{1}{n}X^\top X+\rho I\right)^{-1}\left(\frac{1}{n}X^\top y+\rho(\alpha^{(k-1)}-w^{(k-1)})\right)\\ \alpha^{(k)}&=S_{\lambda/\rho}(\beta^{(k)}+w^{(k-1)})\\ w^{(k)}&=w^{(k-1)}+\beta^{(k)}-\alpha^{(k)}\\\end{aligned}$$` - There's an "equivalence" between `\(\beta\)` and `\(\alpha\)`. You use `\(\alpha\)` as the solution. - Received wisdom: ADMM can make hard problems "easy". Issues with ADMM: - How to choose `\(\rho\)`. There are good heuristics. See [Boyd, et al. "Distributed optimization and Statistical Learning via ADMM"](https://doi.org/10.1561/2200000016) - For problems like DR, it seems like `\(\rho=\lambda\)` works well. - Different ADMM formulations of the problem may have different convergence properties. --- ## Coordinate descent - Works well with LASSO (and other penalized regression-type problems). - If `\(f(x)=g(x)+\sum_{i=1}^nh_i(x_i)\)` where `\(g\)` is convex and differentiable, `\(h\)` merely convex Then: 1. Choose `\(x^{(0)}\)`. 2. Update according to: `$$\begin{aligned} x_1^{(k)}&\in \arg\min_{x_1} f(x_1,x_2^{(k-1)},...,x_n^{(k-1)})\\ x_2^{(k)}&\in \arg\min_{x_2} f(x_1^{(k)},x_2,...,x_n^{(k-1)})\\ &\quad \vdots\\ x_n^{(k)}&\in \arg\min_{x_2} f(x_1^{(k)},x_2^{(k)},...,x_n) \end{aligned}$$` 3. Repeat **2** until convergence. --- ## Example (LASSO) This is what `glmnet` does (+ more bells and whistles) $$\min_\beta \frac{1}{2n}\norm{y-X\beta}_2^2 +\lambda\norm{\beta}_1 $$ - `\(\norm{\beta}_1 = \sum_{i=1}^p |\beta_i|\)` - Iterate over `\(p\)` `$$\beta_i\leftarrow S_{\lambda/\frac{1}{n}\norm{X_i}_2^2}\left(\frac{X_i^T(y-X_{-i}\beta_{-i})}{X_i^\top X_i}\right)$$` - Comes from taking derivative of objective wrt `\(\beta_i\)` - This works because the univariate update is closed-form, exact -- Most coefficients are usually zero, so most of the coordinates stay zero always Talking with people who "do" optimization, using CD is often baffling. Historically, it took almost 15 years to realize that CD was the "way" to solve this problem


How to say hello in multiple languages.
How to say goodbye in multiple languages.
Basic webpage for the best chocolate chip cookie recipe.
Website for the fake "Salvador Deli" restaurant.
Website about a fictional cat named Fido.
Vacation website advertising a fake private island
Webpage of cupcake shop's featured items.
Basic website about another fictional cat.
Basic page testing class elements.
Resume test webpage.
Webpage for The Wiggles testing sidebars.
Fake tree blog testing box elements.
Website for a fake interior design company.
Animal shelter webpage testing columns.
Hawaii webpage testing Bootstrap layouts.
Attempt at copying Wikipedia layout in Bootstrap.
Coming soon!


WITNESS LIST Nominations Committee April 28, 2003 - 3:00P Parks and Wildlife Commission FOR: Holmes, Ned (Self) Ramos, Donato (Self) Rising, Kelly (Self) Texas Alcoholic Beverage Commission FOR: Seliger, Kelton Gray (Self) Texas Building and Procurement Commission FOR: Beard, Tom (Self) Coleman, Stuart (Self) Fernandez, Noe (Self) Texas State Board of Public Accountancy FOR: Baker, Coalter (Self) Donadio, Marcela (Self) Duree, David (Self) Madrid, Jr., Carlos (Self) Mentor, Paula Martina (Self) Mills Jr., Orville (Self) Richardson, Joseph (Self) Stenberg, John (Self) Thompson, Melanie (Self) Walton, John (Self) Registering, but not testifying: On: Atkinson, Billy (Board of Accountancy Appointees) Treacy, William (Texas State Board of Public Accountancy) 408th Judicial District Court, Bexar County FOR: Simmons, Rebecca (Self)


The story is pretty simple: the Kneser-Ney smoothing strategy was a state-of-the-art way for processing data, but it had an heavy computational cost.
We introduce a new smoothing method, dubbed Stupid Backoff, that is inexpensive to train on large data sets and approaches the quality of Kneser-Ney Smoothing as the amount of training data increases.
In 2007 Thorsten Brants developed a new smoothing algorithm, simpler than the Kneser-Ney one, which was very lean and appliable to large amounts of data.
The result?
These algorithms were heavily used in machine translations, and you can already figure out what happened: with small datasets the backoff was generating less-accurate translations but, as the amount of data analized growed, it was able to extract more valid translations, eventually beating Kneser-Ney’s score1.


Hi everybody, my name is Phuc Nguyen. This is my first assignment in Integrify.
Make a portfolio implementation is only using HTML and CSS, try to use as many types of HTMLs tages as possible.
| Skills | Level before Integrify | Level after Integrify |
|---|---|---|
| HTML | 7 | 9 |
| CSS | 8 | 9 |
| Javascript | 6 | 8 |
| React | 1 | 4 |
| Redux | 0 | 4 |
| Nodejs | 2 | 5 |
| MongoDB | 1 | 3 |
I learn HTML,CSS for a long time.
It is my language program, I use most
I've just learned it
See at Github: Click here
Our story Lorem ipsum dolor sit amet consectetur adipisicing elit. Saepe, culpa!
Our story Lorem . Ipsa praesentium error, tempore harum natus necessitatibus dolorem optio iste vel. Nisi?


Signature Support
The CBOR library contains support for {@link CBORSigner Creating}
and {@link CBORValidator Validating}
signatures using a specific scheme called
"CBOR Signature Format" (CSF).
Note that unlike COSE
[RFC 8152], CSF
leverages Deterministic Encoding,
enabling constructs like the following:
{
1: {
1: "Space Shop",
2: "435.00",
3: "USD"
},
2: "spaceshop.com",
3: "FR7630002111110020050014382",
4: "https://banknet2.org",
5: "05768401",
6: "2022-09-29T09:34:08-05:00",
7: {
1: 38.8882,
2: 77.0199
},
/ Enveloped signature object /
-1: {
/ Signature algorithm = ES256 /
1: -7,
/ Public key descriptor in COSE format /
4: {
/ kty = EC /
1: 2,
/ crv = P-256 /
-1: 1,
/ x /
-2: h'e812b1a6dcbc708f9ec43cc2921fa0a14e9d5eadcc6dc63471dd4b680c6236b5',
/ y /
-3: h'9826dcbd4ce6e388f72edd9be413f2425a10f75b5fd83d95fa0cde53159a51d8'
},
/ Signature value /
6: h'5f21112b9f5c1a93743409596421e673f88e59cf34610d53a7cd00f4017327c8f603ea7344a9286db26c52c2a661dff6e4fabc0f2384fe7d1de6c0a23a3f5c21'
}
}
The same object expressed as hex-encoded CBOR:
a801a3016a53706163652053686f7002663433352e30300363555344026d737061636573686f702e636f6d03781b465237363330303032313131313130303230303530303134333832047468747470733a2f2f62616e6b6e6574322e6f726705683035373638343031067819323032322d30392d32395430393a33343a30382d30353a303007a201fb404371b089a0275202fb405341460aa64c3020a3012604a401022001215820e812b1a6dcbc708f9ec43cc2921fa0a14e9d5eadcc6dc63471dd4b680c6236b52258209826dcbd4ce6e388f72edd9be413f2425a10f75b5fd83d95fa0cde53159a51d80658405f21112b9f5c1a93743409596421e673f88e59cf34610d53a7cd00f4017327c8f603ea7344a9286db26c52c2a661dff6e4fabc0f2384fe7d1de6c0a23a3f5c21
Explanation:
Labels 1
-7
represent application data
(which must be supplied in a CBOR map
),
while the application-specific label -1
holds an associated enveloped signature.
Note that the application-specific labels (including the one holding the
signature object), may be of any CBOR type. The only requirement is that
they are unique.
Signatures must for compatibility with CSF,
be provided as a CBOR map
having a fixed set of labels
according to the following table:
| Label | Name | Argument | Description |
1 | algorithm |
integer | Signature algorithm using COSE identifiers.
|
3 | keyId |
"Any" | Optional key identifier using any valid CBOR object.
Note that keyId must not be used together with
publicKey or certificatePath .
A compliant keyId must uniquely identify a specific signature key.
|
4 | publicKey |
map |
Optional public key in COSE format.
Note that ECDSA public keys must be supplied with a value parameter
for the y-coordinate as well.
|
5 | certificatePath |
array | Optional certificate path supplied
as an array of byte string objects holding X.509 certificates in DER format,
where the first object must be the signature certificate.
Signature objects must not contain both certificatePath and publicKey elements.
|
6 | signatureValue |
byte string | Signature value.
|
CSF signatures are validated by running the signature validation
algorithm over the CBOR binary representation of
the map
holding the application data including the enveloped signature object,
with the highlighted signatureValue
(label 6
) and
its associated argument as the sole exception. Note that the length
of the signature object map
must
be updated (to reflect the removal of an element) during validation.
The sample was signed using the following COSE private key (here in diagnostic notation):
{
1: 2,
-1: 1,
-2: h'e812b1a6dcbc708f9ec43cc2921fa0a14e9d5eadcc6dc63471dd4b680c6236b5',
-3: h'9826dcbd4ce6e388f72edd9be413f2425a10f75b5fd83d95fa0cde53159a51d8',
-4: h'e97c4c15785c613e5037dc394c88366922ac6dc8fea63e019d990aed93ade01f'
}
Tagged and Custom Signature Data
The CSF container can be enhanced through a couple of options
described in Crypto Options.
Such options are included in the data to be signed.
Signature Algorithms
Currently supported signature algorithms:
| Name | Identifier | Compatibility |
HS256 | 5 | COSE, JOSE |
HS384 | 6 | COSE, JOSE |
HS512 | 7 | COSE, JOSE |
Ed25519 | -8 | FIDO, PKIX [1] |
Ed448 | -9 | PKIX [2] |
ES256 | -7 | COSE, JOSE |
ES384 | -35 | COSE, JOSE |
ES512 | -36 | COSE, JOSE |
PS256 | -37 | COSE, JOSE |
PS384 | -38 | COSE, JOSE |
PS512 | -39 | COSE, JOSE |
RS256 | -257 | COSE, JOSE |
RS384 | -258 | COSE, JOSE |
RS512 | -259 | COSE, JOSE |
[1] Unfortunately, different standards groups did not in due time realize that
existing cryptographic APIs only rarely accept "EdDSA" as a valid signature algorithm.
In current FIDO alliance specifications the COSE EdDSA
algorithm identifier has
therefore been redefined to rather mean EdDSA with an Ed25519 key which is also what CSF follows.
PKIX' RFC 8410 makes the same distinction.
[2] CSF extends the scheme used for Ed25519
to Ed448
as well.
Test Vectors
An extensive set of test vectors is currently available at:
https://github.com/cyberphone/openkeystore/tree/master/testdata/cbor-signatures
.
Use {@link org.webpki.tools.CBORPrinter} to list contents in a human-friendly way.
Using the Signature API
The following section outlines how the signature API is supposed to be used.
Sample program:
The resulting signed object in diagnostic notation:
#sample.program.diagnostic#
The resulting signed object expressed in hexadecimal:
#sample.program.hex#


Index¶
Shwirl is a custom standalone Python program to visualise spectral data cubes with ray-tracing volume rendering. The program has been developed to investigate transfer functions and graphics shaders as enablers for scientific visualisation of astronomical data. Details about the transfer functions and shaders developed and implemented in shwirl can be found in a full length article by Vohl, Fluke, Barnes & Hassan (2017).
Disclaimer: While the software is available for download and ready to visualise data, this is not intended as a full software release just yet.
Shwirl is licensed under the terms of the (new) BSD license.


--- layout: archive title: Zulip Chat Archive permalink: /stream/144837-PR-reviews/topic/.23431.20recursive.20to_additive.html ---
@Simon Hudon this currently fails. Do you know why? Maybe we need a way to have recursive optional?
I have kept working on this PR. It has proved harder than I had expected. I'm going to try wrapping it up neatly and quickly
Great
Now that I think on it, this was probably the project that urged me to add Lean support for sccache. Compiling can be pretty long
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Loading...
Your cartogram was unable to be generated due to an error. You may make use of this barchart instead, or refresh the page and try again.
Error:
To continue, please refresh this page.
Additional Information: When reporting this error, please include the information below.
Download this Map
Download this Cartogram


Code of Conduct
Boston Python events are intended for networking and collaboration in the developer community.
We value the participation of each member of the Python community and want all attendees to have an enjoyable and fulfilling experience. Accordingly, all attendees are expected to show respect and courtesy to other attendees at all Boston Python events, whether officially sponsored by Boston Python or not.
To make clear what is expected, all staff, attendees, speakers, exhibitors, organizers, and volunteers at any Boston Python event are required to conform to the following Code of Conduct. Organizers will enforce this code throughout the event.
Our Standards
Boston Python is dedicated to providing a positive experience for everyone, regardless of age, gender identity and expression, sexual orientation, disability, physical appearance, body size, ethnicity, nationality, race, or religion (or lack thereof), education, or socio-economic status.
Examples of behaviors that contribute to creating a positive environment include:
- Being kind to others
- Behaving professionally
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- Harassment of event participants in any form
- Deliberate intimidation, stalking, or following
- Violent threats or language directed against another person
- Sexual language and imagery in any event venue, including talks
- Insults or put downs
- Sexist, racist, homophobic, transphobic, ableist, or exclusionary jokes
- Excessive swearing
- Unwelcome sexual attention or advances
- Unwelcome physical contact
- Sustained disruption of talks or other events
- Other conduct that is inappropriate for a professional audience including people of many different backgrounds
Participants asked to stop any inappropriate behavior are expected to comply immediately.
If a participant engages in behavior that violates this code of conduct, the event organizers may take any action they deem appropriate, including warning the offender or expulsion from the event with no refund.
Thank you for helping make Boston Python a welcoming, friendly group for all.
Weapons Policy
No weapons are allowed at event venues, including but not limited to explosives (including fireworks), guns, and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon.
Attendees are further expected to comply with all state and local laws on this matter.
Scope
All Boston Python attendees are subject to the Code of Conduct. This includes staff and volunteers, as well as attendees of events, presentations, project nights, after-event gatherings, receptions, and all sponsored or unofficial events.
Communication outside of events are also subject to the Code of Conduct, including email, online postings, chat messages, and any other communication under the auspices of Boston Python.
Contact Information
If you believe that someone is violating the code of conduct, or have any other concerns, please contact a member of the Boston Python staff immediately.
Incident reporting: send email to<EMAIL_ADDRESS>In case of a conflict of interest, you can individually contact one of the organizers:
- Ned Batchelder<EMAIL_ADDRESS>- Brian Rutledge<EMAIL_ADDRESS>- Michelle Fullwood<EMAIL_ADDRESS>Boston Python staff will be happy to help participants contact venue security or local law enforcement, provide escorts, or otherwise assist any attendee to feel safe for the duration of any event. We value your attendance.
Procedure for Handling Incidents
License
This Code of Conduct was forked from the PyCon US Code of Conduct, which details the sources of its language.
This Code of Conduct is licensed under a Creative Commons Attribution 3.0 Unported License.


Download More Speed Now!
Yes, this is totally legit! Please click the button below.
Download More Speed


Welcome to TSBackup
Today's recycle date is {{recycle_date}}
{% for topic in topics %}
- {% if topic.url %}{{topic.title}}{% else %}{{topic.title}}{% endif %}
- {{ topic.body|safe }}
{% endfor %}
- Tech Support Tools
- This is a package containing a bunch of usefull shell scripts for tech support purposes. The main ones of interest are
ts_network_backup
which automates the network backup process and ts_identify_backups
which is used in conjunction with it (given a ticket number it will identify the directory it was backed up to.
The latest stable version is packaged as a deb in the Free Geek archive so you should be able to install it using apt-get apt-get install fg_tstools
The current version is {{current_version}}
Bug reports are welcome via email to<EMAIL_ADDRESS>(or the bugs queue in RT). Please include any output/error messages and the version you were using, thank you.
History
{% for version in versions %}
- {{version.number}}
- {{ version.content|safe }}
{% endfor %}
background image:
Royal Bluebells - Charlotte Pass, Peter Kent, Flickr. Some rights reserved.
{% endblock %}


HANGMAN GAME
Guess the 80s Video Game!


PSALMS 137
1 When we had been taken to Babylonia far from Jerusalem,
we sat down by the rivers there,
and we cried when we thought about the temple on Mount Zion in Jerusalem.
2 On the willow trees alongside the rivers we hung our harps
because we did not want to play them anymore and because we were very sad.
3 The soldiers who had captured us and taken us to Babylonia forced us to sing for them;
they told us to entertain them; they said,
"Sing for us one of the songs that you previously sang in Jerusalem!"
4 But we thought to ourselves,
"We are sad because we have been punished by Yahweh and brought to this foreign land;
we cannot sing songs about Yahweh while we are here!"
5 If I forget about Jerusalem, I hope that my right hand will wither
so that I will be unable to play my harp!
6 I hope that I will not be able to sing again
if I forget about Jerusalem,
if I do not consider that Jerusalem causes me to be more joyful than anything else does.
7 Yahweh, punish the people of the Edom people group
for what they did on the day that the army of Babylon captured Jerusalem.
Do not forget that they said,
"Tear down all the buildings! Destroy them completely! Leave only the foundations!"
8 You people of Babylon, you will certainly be destroyed!
How fortunate are those who punish you for what you did to us;
9 How fortunate are those who take your babies
and smash them to pieces on the rocks.


Remember my session
Submit
Remember password?
Invalid username and password.
You have been logged out.


| Module | ActiveSupport::CoreExtensions::DateTime::Conversions |
| In: |
vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb
|
Converting datetimes to formatted strings, dates, and times.
Returns the utc_offset as an +HH:MM formatted string. Examples:
datetime = DateTime.civil(2000, 1, 1, 0, 0, 0, Rational(-6, 24)) datetime.formatted_offset # => "-06:00" datetime.formatted_offset(false) # => "-0600"
# File vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb, line 58 58: def formatted_offset(colon = true, alternate_utc_string = nil) 59: utc? && alternate_utc_string || utc_offset.to_utc_offset_s(colon) 60: end
Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000"
# File vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb, line 63 63: def readable_inspect 64: to_s(:rfc822) 65: end
Converts self to a Ruby Date object; time portion is discarded
# File vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb, line 68 68: def to_date 69: ::Date.new(year, month, day) 70: end
To be able to keep Times, Dates and DateTimes interchangeable on conversions
# File vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb, line 79 79: def to_datetime 80: self 81: end
Converts self to a floating-point number of seconds since the Unix epoch
# File vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb, line 89 89: def to_f 90: days_since_unix_epoch = self - ::DateTime.civil(1970) 91: (days_since_unix_epoch * 86_400).to_f 92: end
Convert to a formatted string. See Time::DATE_FORMATS for predefined formats.
This method is aliased to to_s.
datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 datetime.to_formatted_s(:db) # => "2007-12-04 00:00:00" datetime.to_s(:db) # => "2007-12-04 00:00:00" datetime.to_s(:number) # => "20071204000000" datetime.to_formatted_s(:short) # => "04 Dec 00:00" datetime.to_formatted_s(:long) # => "December 04, 2007 00:00" datetime.to_formatted_s(:long_ordinal) # => "December 4th, 2007 00:00" datetime.to_formatted_s(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000"
DateTime formats are shared with Time. You can add your own to the Time::DATE_FORMATS hash. Use the format name as the hash key and either a strftime string or Proc instance that takes a time or datetime argument as the value.
# config/initializers/time_formats.rb Time::DATE_FORMATS[:month_and_year] = "%B %Y" Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") }
# File vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb, line 48 48: def to_formatted_s(format = :default) 49: return to_default_s unless formatter = ::Time::DATE_FORMATS[format] 50: formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter) 51: end
Attempts to convert self to a Ruby Time object; returns self if out of range of Ruby Time class If self has an offset other than 0, self will just be returned unaltered, since there‘s no clean way to map it to a Time
# File vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb, line 74 74: def to_time 75: self.offset == 0 ? ::Time.utc_time(year, month, day, hour, min, sec) : self 76: end


0 ? 'success' : 'danger'"
badgePosition="bottom right"
[picture]="'./assets/images/people/' + order.person + '.jpg'"
nbTooltip="Color indicates how good is the buyers base offer, notification badge shows how many deals or rejections you have made with the buyer."
>


Org To Jupyter Notebook
I've grown to really like org-mode, particularly with ob-ipython, but there are times when a real Jupyter notebook is better - if you want to render it on github or use the %matplotlib notebook
feature, for instance. I found a blog post the Kitchin Research Group site announcing the creation of an exporter and this is some documentation about how to set it up.
Download
When I originally set this up it was only available from a link on the blog-post, but it has since been added to a much larger github repository called scimax. I'm assuming this is where the latest version will be kept. Unfortunately there's no license so I don't think you can fork the repository, even more importantly, I can't get it to work, so skip it for now and grab the old one.
cd ~/.emacs.d mkdir lisp wget http://kitchingroup.cheme.cmu.edu/media/ox-ipynb.el
Install
Make sure that the lisp folder is in the emacs path by putting this line in init.el
.
(add-to-list 'load-path "~/.emacs.d/lisp")
Also make sure that it's loaded by putting this in init.el
.
(require 'ox-ipynb)
Use
In your org-mode file use the export-ipython
function to export it to an ipynb
file.
M-x export-ipynb-buffer
Note that this will only work if you have ob-ipython installed and at least one ipython code block in the org-file.
#+BEGIN_SRC ipython :session
print("a")
#+END_SRC


Source code for torch.distributed.elastic.multiprocessing.errors
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
Each host in a distributed PyTorch job runs with a single TorchElastic agent,
and multiple workers (as children processes of the TorchElastic agent).
Since the workers are user-provided (your PyTorch script/job), TorchElastic
has a way to propagate errors on the trainers through the agent and up to the
scheduler, which ultimately informs the end-user about the state of the job
and applies any retry policies.
TorchElastic categorizes errors into 3 categories:
+----------------+----------------+--------------------------------------------------------------+
| Category | Sub-Category | Description |
+================+================+==============================================================+
| User Error | Input Error | invalid inputs to TorchElastic APIs (e.g. min > max nodes) |
| +----------------+--------------------------------------------------------------+
| | Worker Failure | any failures on the worker child process |
+----------------+----------------+--------------------------------------------------------------+
| Platform Error | n/a | failures caused by the agent |
+----------------+----------------+--------------------------------------------------------------+
| Infra Error | n/a | failures outside the domain of the agent and workers |
| | | (e.g. host failures) |
+----------------+----------------+--------------------------------------------------------------+
All errors other than "Worker Failure" are either raised canonically from the
agent process or implicitly or explicitly crash the agent process. So the
standard language (python) provided exception handling strategies apply.
Worker Failures are special because the exception/failure originates on a different
process from the agent so the error needs to be propagated inter-process
(e.g. the agent cannot simply ``try-catch`` an exception raised on the worker process).
TorchElastic agents use :func:`torch.distributed.elastic.multiprocessing.start_processes`
to launch the workers which has a simple file based inter-process error propagation
built-in.
Any function or binary entrypoint decorated with :func:`record`
will write uncaught exceptions (with the trace information) to a file specified by the
environment variable ``TORCHELASTIC_ERROR_FILE``. The parent process (e.g. agent)
sets this env var on each child it launches, then aggregates the error files for all
children, and propagates the one with the **smallest** timestamp (e.g. the **first** error).
"""
import json
import os
import signal
import socket
import time
import warnings
from dataclasses import dataclass, field
from datetime import datetime
from functools import wraps
from string import Template
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar
from torch.distributed.elastic.utils.logging import get_logger
from .error_handler import ErrorHandler # noqa: F401
from .handlers import get_error_handler # noqa: F401
log = get_logger()
JSON = Dict
_EMPTY_ERROR_DATA = {"message": "<NONE>"}
_NOT_AVAILABLE = "<N/A>"
T = TypeVar("T")
[docs]@dataclass
class ProcessFailure:
"""
Represents the failed process result. When the worker process fails,
it may record failure root cause into the file.
Tries to read the failure timestamp from the provided ``error_file``,
if the ``error_file`` does not exist, the timestamp is the current
timestamp (seconds since epoch).
The ``message`` field is a concise explanation of the failure. If
the error file exists then the message is obtained from the error file.
Otherwise one is generated based on the failure signature.
.. note:: It is assumed that the ``error_file`` is written by
``torch.distributed.elastic.multiprocessing.errors.error_handler.ErrorHandler``.
Otherwise the behavior is undefined.
"""
local_rank: int
pid: int
exitcode: int
error_file: str
error_file_data: JSON = field(init=False)
message: str = field(init=False)
timestamp: int = field(init=False)
def __post_init__(self):
self.error_file_data = _EMPTY_ERROR_DATA
if os.path.isfile(self.error_file):
try:
with open(self.error_file, "r") as fp:
self.error_file_data = json.load(fp)
log.debug(
f"User process failed with error data: {json.dumps(self.error_file_data, indent=2)}"
)
self.message, self.timestamp = self._get_error_data(
self.error_file_data
)
except Exception:
log.exception(f"Failed to parse reply file: {self.error_file}")
raise
else:
self._set_no_reply_file()
# make up an informative message if not already present
if not self.message:
# signals typically do not generate an error file message
if self.exitcode < 0:
self.message = (
f"Signal {-self.exitcode} ({self.signal_name()})"
f" received by PID {self.pid}"
)
else:
self.message = "To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html"
def _get_error_data(self, error_file_data: Dict[str, Any]) -> Tuple[str, int]:
message = error_file_data["message"]
if isinstance(message, str):
timestamp = int(error_file_data.get("timestamp", 0))
else:
timestamp = int(message["extraInfo"]["timestamp"])
return (message, timestamp)
def _set_no_reply_file(self):
self.error_file = _NOT_AVAILABLE
self.error_file_data = _EMPTY_ERROR_DATA
self.message = ""
self.timestamp = int(time.time())
def signal_name(self) -> str:
if self.exitcode < 0:
return signal.Signals(-self.exitcode).name
else:
return _NOT_AVAILABLE
def timestamp_isoformat(self):
"""
Returns timestamp in ISO format (YYYY-MM-DD_HH:MM:SS)
"""
return datetime.fromtimestamp(self.timestamp).isoformat(sep="_")
GlobalRank = int
_FAILURE_FORMAT_TEMPLATE = """[${idx}]:
time : ${time}
host : ${hostname}
rank : ${rank} (local_rank: ${local_rank})
exitcode : ${exitcode} (pid: ${pid})
error_file: ${error_file}
traceback : ${message}"""
# extra new lines before and after are intentional
_MSG_FORMAT_TEMPLATE = """
${boarder}
${title}
${section}
Failures:
${other_failures}
${section}
Root Cause (first observed failure):
${root_failure}
${boarder}"""
[docs]class ChildFailedError(Exception):
"""
Special exception type that can be raised from a function annotated with the
``@record`` decorator to have the child process' (root exception) propagate
up the stack as-is (e.g. without being wrapped in the parent's traceback).
Useful in cases where the parent is a simple nanny process
and the child (worker) processes are actually doing meaningful compute.
In this case, errors typically occur on the child process as the parent
is not doing anything non-trivial, and child errors should be propagated
to the scheduler for accurate root cause diagnostics.
.. note:: The propagation relies on error files rather than exception handling to
support both function and binary launches.
Example:
::
# process tree on a host (container)
0: scheduler-init-process:
|- 1: torchelastic_agent:
|- 2: trainer_0 (ok)
|- 3: trainer_1 (fail) -> error.json
|- ...
|- n+2: trainer_n (ok)
|- n+3: other processes
|- ...
In the example above, trainer 1's failure (written into error.json) is
the root cause and should be reported to the scheduler's init process.
The torchelastic agent raises a ``ChildFailedError("trainer", {1: "trainer_1/error.json"})``
upon detecting trainer 1's failure which would propagate the contents
of trainer 1's error file to the scheduler's init process.
"""
def __init__(self, name: str, failures: Dict[GlobalRank, ProcessFailure]):
self.name = name
self.failures = failures
assert (
self.failures
) # does not make sense to create a ChildFaileError with no failures
super().__init__(self.format_msg())
def get_first_failure(self) -> Tuple[GlobalRank, ProcessFailure]:
rank = min(self.failures.keys(), key=lambda r: self.failures[r].timestamp)
return rank, self.failures[rank]
def format_msg(self, boarder_delim="=", section_delim="-"):
title = f"{self.name} FAILED"
root_rank, root_failure = self.get_first_failure()
root_failure_fmt: str = ""
other_failures_fmt: List[str] = []
width = len(title)
for idx, (rank, failure) in enumerate(self.failures.items()):
fmt, w = self._format_failure(idx, rank, failure)
width = max(width, w)
if rank == root_rank:
root_failure_fmt = fmt
else:
other_failures_fmt.append(fmt)
# upper boundary on width
width = min(width, 60)
return Template(_MSG_FORMAT_TEMPLATE).substitute(
boarder=boarder_delim * width,
title=title,
section=section_delim * width,
root_failure=root_failure_fmt,
other_failures="\n".join(other_failures_fmt or [" <NO_OTHER_FAILURES>"]),
)
def _format_failure(
self, idx: int, rank: int, failure: ProcessFailure
) -> Tuple[str, int]:
# failure.message is either a str (when the failure does not generate a traceback - e.g. signals)
# or a dict (json) of the form
# {"message": $ERROR_MSG, "extraInfo": {"py_callstack": $TRACEBACK, timestamp: $TS}}
# so the display logic is:
# 1. if failure.message is not a dict (it is a str) just show it as is
# 2. else try to get the traceback (py_callstack)
# 3. if the traceback is not there, use the message
# 4. if the message is not there show <N/A>
msg = failure.message
if isinstance(failure.message, dict):
msg = (
failure.message.get("extraInfo", {})
.get("py_callstack", failure.message.get("message", "<N/A>"))
.replace("\n", "\n ") # to properly indent the traceback
)
fmt = Template(_FAILURE_FORMAT_TEMPLATE).substitute(
idx=idx,
time=failure.timestamp_isoformat(),
hostname=socket.getfqdn(),
rank=rank,
local_rank=failure.local_rank,
exitcode=failure.exitcode,
pid=failure.pid,
error_file=failure.error_file,
message=msg,
)
width = 0
for line in fmt.split("\n"):
width = max(width, len(line))
return fmt, width
[docs]def record(
fn: Callable[..., T], error_handler: Optional[ErrorHandler] = None
) -> Callable[..., T]:
"""
Syntactic sugar to record errors/exceptions that happened in the decorated
function using the provided ``error_handler``.
Using this decorator is equivalent to:
::
error_handler = get_error_handler()
error_handler.initialize()
try:
foobar()
except ChildFailedError as e:
_, failure = e.get_first_failure()
error_handler.dump_error_file(failure.error_file, failure.exitcode)
raise
except Exception as e:
error_handler.record(e)
raise
.. important:: use this decorator once per process at the top level method,
typically this is the main method.
Example
::
@record
def main():
pass
if __name__=="__main__":
main()
"""
if not error_handler:
error_handler = get_error_handler()
def wrap(f):
@wraps(f)
def wrapper(*args, **kwargs):
assert error_handler is not None # assertion for mypy type checker
error_handler.initialize()
try:
return f(*args, **kwargs)
except ChildFailedError as e:
rank, failure = e.get_first_failure()
if failure.error_file != _NOT_AVAILABLE:
error_handler.dump_error_file(failure.error_file, failure.exitcode)
else:
log.info(
(
f"local_rank {rank} FAILED with no error file."
f" Decorate your entrypoint fn with @record for traceback info."
f" See: https://pytorch.org/docs/stable/elastic/errors.html"
)
)
raise
except Exception as e:
error_handler.record_exception(e)
raise
return wrapper
return wrap(fn)


Details of the project.
You can embed images and style text using html.
You can tilt the camera using pitch.
Summary can zoom back to the original view.
Details of the project.
Details of the project.
You can embed images and style text using html.
You can tilt the camera using pitch.
Summary can zoom back to the original view.
Details of the project.
Details of the project.
You can embed images and style text using html.
You can tilt the camera using pitch.
Summary can zoom back to the original view.
Details of the project.
Details of the project.
You can embed images and style text using html.
You can tilt the camera using pitch.
Summary can zoom back to the original view.
Details of the project.
Details of the project.
You can embed images and style text using html.
You can tilt the camera using pitch.
Summary can zoom back to the original view.
Details of the project.
Details of the project.
Details of the project.


{% extends "layout.html" %} {% block page_title %} GOV.UK prototype kit {% endblock %} {% block content %} Digital Marketplace {{data["title"]}} Description of work What must the suppliers be able to provide Digital outcomes Digital specialists User research participants Cloud hosting Cloud software Cloud support {% endblock %}


Who Says What, When?
Analysing Twitter Content Trends During the 2019 Superbowl
I recently revisited my Twitter streaming project and I added some really nice features. I further improved the bandwidth and stability of the data stream. I also added functionality to upload the data directly into a database, which made the data a lot less cumbersome to worth with.
I was pretty excited to take the thing out for a spin, and decided that the 2019 Superbowl would be a good opportunity. Ultimately, I collected ~900,000 tweets containing either #rams or # patriots. It worked great!
As I was looking at the text body of all the tweets, it sort of became apparent that everyone was, more or less, talking about the same thing. The same action. Reading the tweets one after another almost feels like a tide. First a few people mention something, then a few more, and suddenly vritually everyone is talking about the thing that just happened.
In an effort to illustrate these 'tides' of speech, I created a 'tide chart'. On the x-axis is time, in PST. The game started around 3:30 and last around 3 1/2 hours until 7:30. On the y-axis is rate in tweet per minute. The values are bucketed into 3 minute intervals.
The results, in my opinion, are really beautiful. I'm fond of the title wave of Patriots fans uttering 'shit' when Brady threw the early interception. I like that Maroon 5 was seemingly not mentioned in the first half, spiked during the half time show, and then lingered in the conversation for the rest of the game. I like the gradual crescendo of 'fuck's as fans got rowdier towards the end of the game. I like the wave of 'shit's as Rams fans realized their impending doom. In a game that was filled with punts, I like that Hekker's record breaking effort stands out. And I really love that both sets of fans were talking about the touchdown to seal the result of the game, knowing that the context that surrounded their conversations were so different.
It's beautiful, isn't it?


Posted by Shinelw on April 8, 2016
Posted by Shinelw on April 4, 2016
Posted by Shinelw on February 28, 2016
Posted by Shinelw on October 10, 2015
Posted by Shinelw on October 3, 2015
Posted by Shinelw on September 10, 2015
Posted by Shinelw on September 3, 2015
好好学习天天向上。


class: center, middle ### W4995 Applied Machine Learning # Clustering and Mixture Models 03/21/18 Andreas C. Müller ??? FIXME - see inline fixmes VB GMM: explain better? better example? or leave out? --- class: center, middle # Clustering ??? --- .center[ ![:scale 70%](images/cluster_intro_1.png) ] ??? --- .center[ ![:scale 70%](images/cluster_intro_2.png) ] ??? --- .center[ ![:scale 70%](images/cluster_intro_3.png) ] ??? --- .center[ ![:scale 70%](images/cluster_intro_4.png) ] ??? Group into 4 clusters --- # Clustering - Group data into a partitioning: - Identify groups by assigning “cluster labels” to each data point. - Points within a cluster should be “similar”. - Points in different cluster should be “different”. - Number of clusters might be pre-specified. - Notations of “similar” and “different” depend on algorithm or user specified metrics. ??? --- # Goals of Clustering - Data Exploration - Are there coherent groups ? - How many groups are there ? - Data Partitioning - Divide data by group before further processing - Unsupervised feature extraction - Derive features from clusters or cluster distances ??? --- class: center, middle # Clustering Algorithms ??? --- class: center, middle # K-Means ??? --- # K-Means Algorithm .wide-left-column[ .center[ ![:scale 100%](images/kmeans.png) ] ] .narrow-right-column[ .smaller[ - Pick number of clusters k. - Pick k random points as “cluster center” - While cluster centers change: 1. Assign each data point to it’s closest cluster center 2. Recompute cluster centers as the mean of the assigned points. ] ] ??? --- class: spacious # Objective function for K-Means
`$$\Large \min_{\mathbf{c}_j \in \mathbf{R}^p, j=1,..,k} \sum_i ||\mathbf{x}_i - \mathbf{c}_{x_i}||^2 $$` $\mathbf{c}_{x_i}$ is the cluster center $c_j$ closest to $x_i$ ??? - Finds a local minimum of minimizing squared distances (exact solution is NP hard): - New data points can be assigned cluster membership based on existing clusters. --- # K-Means API .narrow-right-column[ .center[ ![:scale 100%](images/kmeans_api.png) ] ] .wide-left-column[ .smaller[ ```python X, y = make_blobs(centers=4, random_state=1) km = KMeans(n_clusters=5, random_state=0) km.fit(X) print(km.cluster_centers_.shape) print(km.labels_.shape) # predict is the same as labels_ on training data # but can be applied to new data print(km.predict(X).shape) plt.scatter(X[:, 0], X[:, 1], c=km.labels_) plt.gca().set_aspect("equal") ``` (5, 2) (100,) (100,) ] ] ??? --- # Restriction of Cluster Shapes .left-column[ ![:scale 85%](images/cluster_shapes_1.png) ] .right-column[ ![:scale 100%](images/cluster_shapes_2.png) ] .reset-column[ Clusters are Voronoi-diagrams of centers ] ??? - Clusters are always convex in space --- # Limitations of K-Means .center[ ![:scale 60%](images/kmeans_limitations_1.png) ] - Cluster boundaries equidistant to centers ??? --- # Limitations of K-Means .center[ ![:scale 60%](images/kmeans_limitations_2.png) ] - Can’t model covariances well ??? --- # Limitations of K-Means .center[ ![:scale 60%](images/kmeans_limitations_3.png) ] - Only simple cluster shapes ??? --- # Computational Properties - Naive implementation: - Each iteration computes n_cluster * n_samples distances. - Fast exact algorithms: - Elkans, Ying-Yang (compute cluster distances and use triangle inequality) - Many approximate algorithms, in particular minibatch K-Means: Much faster, online version (partial_fit) ??? --- # Initialization - Random centers fast but not great. - K-means++ (default): Greedily add “furthest way” point - By default K-means in sklearn does 10 random restarts with different initializations. - For large datasets, K-means++ initialization may take much longer than clustering. - Consider using random, in particular for MiniBatchKMeans ??? --- # Feature Extraction using K-Means - Cluster membership → categorical feature - Cluster distanced → continuous feature - Examples: - Partitioning low-dimensional space (similar to using basis functions) - Extracting features from high-dimensional spaces, for image patches, see http://ai.stanford.edu/~acoates/papers/coatesleeng_aistats_2011.pdf ??? --- class: center, middle # Agglomerative Clustering ??? --- # Agglomerative Clustering - Start with all points in their own cluster. - Greedily merge the two most similar clusters. .center[ ![:scale 80%](images/agglomerative_clustering.png) ] ??? - Creates a hierarchical clustering from with cluster sizes from n_samples to single cluster. --- class: spacious # Dendograms .left-column[ ![:scale 100%](images/dendograms_1.png) ] .left-column[ ![:scale 80%](images/dendograms_2.png) ] ??? --- # Merging (Linkage) Criteria - Complete Link - Smallest maximum distance - Average Linkage - Smallest average distance between all pairs in the clusters - Single Link - Smallest minimum distance - Ward (default in sklearn) - Smallest increase in within-cluster variance - Leads to more equally sized clusters. ??? --- # Linkage Criteria .center[ ![:scale 100%](images/merging_criteria.png) ] ``` average : [82 9 7 1 1] complete : [50 24 14 11 1] ward : [31 30 20 10 9] ``` ??? --- # Pros and Cons - Can restrict to input “topology” given by any graph, for example neighborhood graph. - Fast with sparse connectivity, otherwise O(log(n) n ** 2 ) - Some linkage criteria an lead to very imbalanced cluster sized (can be pro or con) - Hierarchical clustering gives more holistic view, can help with picking the number of clusters. ??? --- class: center, middle # DBSCAN ??? --- # Algorithm .left-column[ .smaller[ - Clusters are formed by “core samples” - Sample is “core sample” if more than min_samples is within epsilon - “dense region” - Start with a core sample - Recursively walk neighbors that are core-samples and add to cluster. - Also add samples within epsilon that are not core samples (but don’t recurse) - If can’t reach any more points, pick another core sample, start new cluster. - Remaining points are labeled outliers ] ] .right-column[ .center[ ![:scale 80%](images/dbscan_algo.png) ] ] ??? FIXME horrible slide --- # Illustration .center[ ![:scale 70%](images/dbscan_illustration.png) ] ??? --- # Pros and Cons - Can learn arbitrary cluster shapes - Can detect outliers - Needs two parameters to adjust .center[ ![:scale 50%](images/dbscan_pro_con.png) ] ??? eps is related to number of clusters, so not much worse than kmeans or agglomerative --- class: center, middle # (Gaussian) Mixture Models ??? --- # Mixture Models - Generative model – find p(X). - Assume form of data generating process - Mixture model assumption: - Data is mixture of small number of known distributions. - Each mixture component distribution can be learned "simply" - Each point comes from one particular component - We learn the component parameters and weights of components ` $$ p(\mathbf{x}) = \sum_{j=1}^k \pi_k p_k(\mathbf{x} | \theta) $$ ` ??? --- # Gaussian Mixture Models `$$ p(\mathbf{x}) = \sum_{j=1}^k \pi_k \mathcal{N}(\mathbf{x}, \mu_k, \Sigma_k) $$` `$$ k \sim \text{Mult}(\pi), x \sim \mathcal{N}(\mathbf{x}, \mu_k, \Sigma_k)$$` - Non-convex optimization. - Alternately assign points to components and compute mean and variance (EM algorithm). - Initialized with K-means, random restarts ??? - Each component is created by a Gaussian distribution. - There is a multinomial distribution over the components FIXME algorithm deserves a bit more explanation? --- `$$ p(\mathbf{x}) = \sum_{j=1}^k \pi_k \mathcal{N}(\mathbf{x}, \mu_k, \Sigma_k) $$` .center[ ![:scale 40%](images/gmm1.png) ] .center[ ![:scale 40%](images/gmm2.png) ] ??? --- class: spacious # Why Mixture Models?
- Clustering (components are clusters) - Parametric density model ??? - Create parametric density model. - Allows for testing how “likely” a new point is. - Clustering (each components is one cluster). - Feature Extraction --- # Examples .wide-left-column[ .smaller[ ```python from sklearn.mixture import GaussianMixture gmm = GaussianMixture(n_components=3) gmm.fit(X) print(gmm.means_) print(gmm.covariances_) ``` ``` [[-2.286 -4.674] [-0.377 6.947] [ 8.685 5.206]] [[[ 6.651 2.066] [ 2.066 13.759]] [[ 5.467 -3.341] [ -3.341 4.666]] [[ 1.481 -1.1 ] [ -1.1 4.191]]] ``` ] ] .narrow-right-column[ .center[ ![:scale 80%](images/mm_examples_1.png) ] .center[ ![:scale 80%](images/mm_examples_2.png) ] ] ??? FIXME need captions! --- # Probability Estimates .left-column[ .smaller[ ```python gmm.predict_proba(X) ``` ``` array([[ 1. , 0. , 0. ], [ 0. , 0. , 1. ], ..., [ 1. , 0. , 0. ], [ 0.001, 0.999, 0. ]]) ``` .center[ ![:scale 60%](images/prob_est1.png) ] ] ] .right-column[ .smaller[ ```python # log probability under the model print(gmm.score(X)) print(gmm.score_samples(X).shape) ``` ``` -5.508 (500,) ``` .center[ ![:scale 60%](images/prob_est2.png) ] ] ] ??? --- class: spacious # Notes - In high dimensions, covariance=”full” might not work. - Try covariance=”diagonal”, covariance=”tied”. - Restart with different initializations (default=1) ??? FIXME examples --- class:center # GMM vs KMeans ![:scale 47%](images/gmm_vs_kmeans_1.png)
![:scale 47%](images/gmm_vs_kmeans_2.png) ??? GMM can be more unstable, is more expensive to compute. --- # Bayesian Infinite Mixtures - Bayesian treatment: - Add priors on mixture coefficients and Gaussians. - Can “unselect” components if they don’t contribute. - Possibly more robust - Infinite Mixtures: - Replace Dirichlet Prior over mixture coefficients by Dirichlet Process. - “automatically” finds number of components (based on parameter of the prior). - Both implemented in BayesianGaussianMixture - Use variational inference (as opposed to gibbs sampling) - In practice: need to specify upper limit of components ??? --- .center[ ![:scale 100%](images/bim_1.png) ] ??? --- .center[ ![:scale 95%](images/bim_2.png) .smaller[ http://scikit-learn.org/dev/auto_examples/cluster/plot_cluster_comparison.html] ] ??? --- class: middle # Questions ?