--- layout: post tags: [Dependency Injection, Software Design, Design Patterns] date: 2011-04-27 12:14:52 UTC title: "Provider is not a pattern" description: "In order for something to be a design pattern, it must be the result of parallel evolution. .NET providers are an invention, not a discovery." --- {% include JB/setup %}
Developers exposed to ASP.NET are likely to be familiar with the so-called Provider pattern. You see it a lot in that part of the BCL: Role Provider, Membership Provider, Profile Provider, etc. Lots of text has already been written about Providers, but the reason I want to add yet another blog post on the topic is because once in a while I get the question on how it relates to Dependency Injection (DI).
Is Provider a proper way to do DI?
No, it has nothing to do with DI, but as it tries to mimic loose coupling I can understand the confusion.
First things first. Let's start with the name. Is it a pattern at all? Regular readers of this blog may get the impression that I'm fond of calling everything and the kitchen sink an anti-pattern. That's not true because I only make that claim when I'm certain I can hold that position, so I'm not going to denounce Provider as an anti-pattern. On the contrary I will make the claim that Provider is not a pattern at all.
A design pattern is not invented - it's discovered as a repeated solution to a commonly recurring problem. Providers, on the other hand, were invented by Microsoft, and I've rarely seen them used outside their original scope. Secondly I'd also dispute that they solve anything.
That aside, however, I want to explain why Provider is bad design:
In the rest of this post I will explain each point in detail, but before I do that we need an example to look at. The old OrderProcessor example suffices, but instead of injecting IOrderValidator, IOrderCollector, and IOrderShipper this variation uses Providers to provide instances of the Services:
public SuccessResult Process(Order order) { IOrderValidator validator = ValidatorProvider.Validator; bool isValid = validator.Validate(order); if (isValid) { CollectorProvider.Collector.Collect(order); ShipperProvider.Shipper.Ship(order); } return this.CreateStatus(isValid); }
The ValidatorProvider uses the configuration system to create and return an instance of IOrderValidator:
public static IOrderValidator Validator { get { var section = OrderValidationConfigurationSection .GetSection(); var typeName = section.ValidatorTypeName; var type = Type.GetType(typeName, true); var obj = Activator.CreateInstance(type); return (IOrderValidator)obj; } }
There are lots of details I omitted here. I could have saved the reference for later use instead of creating a new instance each time the property is accessed. In that case I would also have had to make the code thread-safe, so I decided to skip that complexity. The code could also be more defensive, but I'm sure you get the picture.
The type name is defined in the app.config file like this:
<orderValidation type="Ploeh.Samples.OrderModel.UnitTest.TrueOrderValidator, Ploeh.Samples.OrderModel.UnitTest" />
Obviously, CollectorProvider and ShipperProvider follow the same… blueprint.
This should be well-known to most .NET developers, so what's wrong with this model?
In my book's chapter on DI anti-patterns I describe the Constrained Construction anti-pattern. Basically it occurs every time there's an implicit constraint on the constructor of an implementer. In the case of Providers the constraint is that each implementer must have a default constructor. In the example the culprit is this line of code:
var obj = Activator.CreateInstance(type);
This constrains any implementation of IOrderValidator to have a default constructor, which obviously means that the most fundamental DI pattern Constructor Injection is out of the question.
Variations of the Provider idiom is to supply an Initialize method with a context, but this creates a temporal coupling while still not enabling us to inject arbitrary Services into our implementations. I'm not going to repeat six pages of detailed description of Constrained Construction here, but the bottom line is that you can't fix it - you have to refactor towards true DI - preferably Constructor Injection.
Providers hide the complexity of their implementations. This is not the same as encapsulation. Rather it's a dishonest API and the problem is that it just postpones the moment when you discover how complex the implementation really is.
When you implement a client and use code like the following everything looks deceptively simple:
IOrderValidator validator = ValidatorProvider.Validator;
However, if this is the only line of code you write it will fail, but you will not notice until run-time. Check back to the implementation of the Validator property if you need to refresh the implementation: there's a lot of things that can go wrong here:
I'm sure I even forgot a thing or two, but the above list is sufficient for me. None of these problems are caught by the compiler, so you don't discover these issues until you run an integration test. So much for rapid feedback.
I don't like APIs that lie about their complexity.
Hiding complexity does not make an API easier to use; it makes it harder.
An API that hides necessary complexity makes it impossible to discover problems at compile time. It simply creates more friction.
A Provider exerts too much control over the instances it creates. This is a variation of the Control Freak anti-pattern (also from my book). In the current implementation the Validator property totally violates the Principle of least surprise since it returns a new instance every time you invoke the getter. I did this to keep the implementation simple (this is, after all, example code), but a more normal implementation would reuse the same instance every time.
However, reusing the same instance every time may be problematic in a multi-threaded context (such as a web application) because you'll need to make sure that the implementation is thread-safe. Often, we'd much prefer to scope the lifetime of the Service to each HTTP request.
HTTP request scoping can be built into the Provider, but then it would only work in web applications. That's not very flexible.
What's even more problematic is that once we move away from the Singleton lifestyle (not to be confused with the Singleton design pattern) we may have a memory leak at hand, since the implementation may implement IDisposable. This can be solved by adding a Release method to each Provider, but now we are moving so far into DI Container territory that I find it far more reasonable to just use proper DI instead of trying to reinvent the wheel.
Furthermore, the fact that each Provider owns the lifetime of the Service it controls makes it impossible to share resources. What if the implementation we want to use implements several Role Interfaces each served up by a different Provider? We might want to use that common implementation to share or coordinate state across different Services, but that's not possible because we can't share an instance across multiple providers.
Even if we configure all Providers with the same concrete class, each will instantiate and serve its own separate instance.
The Control Freak also impacts testability. Since a Provider creates instances of interfaces based on XML configuration and Activator.CreateInstance, there's no way to inject a dynamic mock.
It is possible to use hard-coded Test Doubles such as Stubs or Fakes because we can configure the XML with their type names, but even a Spy is problematic because we'll rarely have an object reference to the Test Double.
In short, the Provider idiom is not a good approach to loose coupling. Although Microsoft uses it in some of their products, it only leads to problems, so there's no reason to mimic it. Instead, use Constructor Injection to create loosely coupled components and wire them in the application's Composition Root using the Register Resolve Release pattern.
Comments
When used correctly as a bridge pattern, the provider does actually solve reoccuring problems very eloquently. It decouples the interface from the implementation so that the implementation details are hidden from the client. You can extend the implementation by building on existing implementations to reduce the complexity. Complexity is only introduced as a by-product of bad design.
The notion that the provider interfers with testability is incorrect. Each individual implementation should be designed from the beginning to be testable. The bridge is not the entry point for testing the implementor. The bridge should only be responsible for forwarding client requests to its implementor. (Therefore the bridge should be testable as well.) I am not stating that there aren't providers out there that violate this priciple. I'm merely stating that providers which do this are poorly designed.
This goes way beyond what the Bridge pattern describes, so I hardly think you can equate the two.
Especially the part about being created by a static factory which can only read from the configuration system is testability poison.
I realize this is a year late, but I just found your article a few days ago via a reference on scott hanselmans blog (in comments). Here is my rebuttal.
http://candordeveloper.com/2012/06/26/provider-model-is-a-solid-pattern/
"A design pattern is not invented - it's discovered as a repeated solution to a commonly recurring problem."
The design pattern concept does not provide an opinion on how they were arrived upon. I am always delighted when programming terminology gives me new insight into words. Kinda like "abstraction" -- I don't think I would even know the term if I were not a programmer, at least, not as well as I do.
However, programming has little to teach us about the words "design" and "pattern" that we do not already know. There is nothing mysterous or supernatural about them, even when combined. A pattern is anything that repeats in a predictable fashion.. and that's really all there is to it.
Whether or not the service provider is a good pattern, I am not sure, but I can be certain that it is, in fact, a pattern. Isn't the neuance you're describing subjective, anyway? Suppose that you invented it, and then I used it. Suppose also that a third developer "discovered" our usage. What then, does the universe unwind? My example is trivial, but scale it up and it makes a little more sense.
But, I do love your blog, thank you for the discussion.
Luke, thank you for writing. Obviously, you are free to have your own opinions, and interpretation of various words. However, if we want to be able to discuss our trade in a concise manner, we need as precise a vocabulary as possible.
On this blog (and elsewhere), I strive to use a consistent and well-known jargon. Thus, when I use the term design pattern, I refer to it in a way that's compatible with the original description in Design Patterns. In the introduction (on page 2), Gamma et al. write:
(Emphasis mine.) The point is that, using the established vocabulary, a design pattern most certainly implies that the pattern is a result of parallel evolution, and subsequently discovered and described as a common solution to a particular type of problem.Although I grant that it's partially subjective, there's still an implicit value judgement in cataloguing a design pattern. While most patterns come with a set of known disadvantages, but those disadvantages tend to not outweigh the benefits. If they did, it wouldn't be a design pattern, but rather an anti-pattern. This, too, is a well-defined term:
This definition differs from a 'proper' design pattern because a design pattern has mostly beneficial consequences.I appreciate your effort to maintain consistent jargon and termonology. I have had dozens of heated arguments with my co-workers about individual words in our interfaces, all the while they're staring back at me with a look that says "omg dude, its just a word." I gather that you and I have that common.
Personally, I'm against the concept of jargon all together because it, by its nature, can only create confusion. By that I mean, if it is consistent with the English language, then its not jargon, its just English. Conversely, if it contradicts or conflicts with the English language, then its bad jargon anyway, and can only lead to confusion. I tend to err on the side of verbosity, and might have described the pattern as not being a "Beneficial Design Pattern".
In reading the paragraph you quoted from, I did not get the impression that the author gave an opinion on the origin of a pattern as a contributor to its validity. I think he is simply trying to disclaim the notion that the patterns described within the book are original ideas, and effort was made to only include patterns that have been implemented in the wild, and by more than one implementor. i.e. I did not write a book about my own patterns, or the clever things my co-workers have done.
The service pattern certainly has been implemented by more than one implementor, sometimes identified by a different name, sometimes in such a way that provides more benefit than otherwise, and very likely before Microsoft introduced it to the world at-large.
My critique of your article was based solely on the language used and only because of provocativeness of your statement. It seemed intentionally unintuitive.
With all of that said, though, I concede my point. I do that mostly because you obviously have a superior understanding of design patterns than I do (by multitudes). Your blog is one of resources that first got me interested in the study of design patterns, and I've learned a great deal from it. I think it would be rather foolish for me to try to "take you on", as I'd certainly be embarrassed.
Besides that, I could not formulate an opinion on the supporting arguments you put forth as I reread the blog. I have not programmed in .NET in a very long time and I have trouble understanding if we're even referring to the same things. I fear that I am a bit out of my league.
My [perhaps misguided] interpretation of the "Service Pattern" comes from places wholy unrelated to .NET. I've seen the term used to describe a pattern akin to the "Adapter Pattern", where the term "Adapter" is replaced by "Service", and "Adaptee" is replaced by "Provider".
i.e.
Thank you for your thoughtful response.
At the risk of coming across as a pedant, did you mean Provider when you wrote "Service Pattern"? At least, I'm not aware of any Service Pattern in the most commonly accepted pattern literature, but perhaps there's a book I should read.
The Provider design isn't the same as the Adapter pattern. The difference is, among others, that Providers rely on the .NET configuration system, as well as the Constrained Construction anti-pattern. Particularly its reliance on the .NET configuration system is what excludes it from being a proper pattern, because you couldn't possibly discover it on a different platform.
The Adapter pattern describes how to adapt one API to another API; while it's a useful pattern, it has a different concern than Provider. It also doesn't prescribe any particular method of initialization.


Restoration of Abandoned Church Connects Man, Nature, and God
- Written by Dima Stouhi
- 2 days
Changtteul Church, is an old place of worship in Gyeonggi-do, South Korea, that gets its name from the term "changtteul", meaning "a frame containing a window", in Korean. As its name suggests, the building's character lies in its series of windows, giving the visitors both outside and inside a unique experience of light and scenery.
Designers Hanyoung Jang and Hanjin Jang of studio minorormajor utilized the windows of Changtteul as a metaphorical motif for their design concept: the first being the 'window between man and God', and the second being ‘the window between man and nature’, immersing the abandoned religious facility with dramatic experiences.
The 108.58 sqm building consists of three floors: the communication lounge on the first floor, the contemplation space on the second floor, and the implementation of a "boundary-less" space on the roof.
Visitors can experience the 'window between man and nature' on the first floor, due to the removal of the front and back walls. The walls are replaced with clear glass, creating an illusion that the land is extending from the outside into the inside. As for the tangible experience, a low bench is installed to give visitors the ability to feel the land beneath their feet.
On the second floor, specially machined stainless steel panels (mirror-like finish) are installed on the ceiling, giving the visitors the metaphorical sense of 'window between man and God'. The feeling of "someone watching over" is further experienced with the reflective glass windows all around the space.
Upon reaching the rooftop, visitors are met with heavenly-like emotions, seeing the world beyond bound spaces. Reflective panels are installed on all four sides (both indoors and outdoors), giving the spectators on the inside a sense of emancipation, and those outside a vivid silhouette of the structure as it camouflages with its surrounding. The designers also chose to install an uneven, "flowy ground" to give the visitors a sense of illusory. Looking up above, visitors standing on the rooftop level see nothing but the sky.


{% extends "base.html" %} {% block content %}
Submit an image of your artwork to get featured in the slideshow!


A study on Climate Change factors for the leading 20 countries CO2 Emissions (2015).
This pie chart represents the top 20 countries with the highest C02 emission (in kilotons).
This bar chart reprsents the top 20 countries with the highest renewable energy consumption (% of total
final energy consumption).
This bar chart represents the top 20 countries with the highest gross domestic product (GDP per capita
growth (annual %)).
Correlations Discovered Between CO2 Emissions, Renewable Energy (%), and GDP
China and America make up more than ½ of CO2 emissions than the next 18 leading countries. China also
has the 2nd largest gross domestic product in 2015, with clear indications that higher GDP results in
higher CO2 emissions. Brazil, Indonesia, and India lead the charge in renewable
energy as more than one-third of their energy is sourced sustainably.


Link Skimmer
Start Test
Stop Test Early
Start page
Enter the full url including http(s)://
Links to skim
Only links containing this text will be skimmed; you can select your whole domain, a subdomain or just a single term
Links to ignore
Links containing this text will be ignored
Errors or terms to look for
Enter some values for Link Skimmer to look for on the pages, eg. 404 or stack trace. This is not case sensitive
Maximum number of URLs to skim
The skimmer will stop after this many pages, even if it finds more links
Results


Travel
-
Map
FIND YOUR WAY
Use our interactive map to learn more about the local area. Find the best transport routes, while learning to navigate like a local.
-
By Car & Motorbike
ADVICE FOR MOTORISTS
Find the best routes into the office and where to park once you arrive. Unfortunately we can't guarantee you a stress free trip.
-
By Public Transport or Foot
THE COMMUTE
Learn about local public transport routes in and out of the office. This section covers getting to the office by bus, train or on foot.
-
By Bike
EARLY MORNING RACE
Information about the cyclist friendly facilities and benefits that the IPO has to offer. Two wheels are better than four!


Percentage split of entries across rural and urban for different durations of UFO sightings
Rural
Urban


Snookes1516.github.io
Buy my revision guides: GCSE English Language paperback eu/fqqLiH2 GCSE English Language eBook com/product/mr-bruffs-guide-to. Home. Mrbruff is the law that we mrbruff by and that we also invite you to try out. Starting year 10 Starting year 11 Starting year 12 Creative writing scaffold. English, Creative Writing Option Department of English. The undergraduate English major with emphasis in creative writing combines a range of workshops in verse, short story, novel, and creative non-fiction or expository.  Mrbruff Creative Writing (old exam: resit only) 4 Tips for A Descriptive Writing Buy my revision.
Mrbruff creative writing rzeczownik.
Mr Bruff Creative Writing : Websites Revision Guides https.
A range of resources and stimuli to generate fantastic creative writing, famous art work, a collection of classic opening lines, an exploration of famous fictional.
Welcome from Mr Bruff. This site is the official home of English teacher Andrew Bruff. The eBooks below have been written to accompany the YouTube videos which. Mr Bruff Creative Writing - Mrbruff creative writing. Sujet: Mrbruff Creative Writing – 835760 Mentions Légales - site Web Passa Varet Avocats. On the week of GCSE results, Mr Bruff received over 1, messages of mrbruff from students, parents and teachers. (old exam: resit only) 4 Tips for A Descriptive Writing. Miss Rigarlsford marked it as to-read Jul mrbruff. Home Creative writing teacher salary Creative writing landscape A website writing Mrbruff creative writing - Essays dissertations written by high class writers. Give your papers to the most talented writers. Enjoy the merits of qualified writing. Imaginative / Creative Writing by johncallaghan - Teaching.


Here are some people to watch on Twitch:
- firedragon764 (Twitch link) - A cool guy who streams Super Mario Sunshine.
- QaziTV (Twitch link) - A nice guy who works on his game Skyhook and draws stuff.
- 360chrism (Twitch link) - A guy who does stuff.
- BobRoss (Twitch link) - Twitch has mini-marathons of Bob Ross's show The Joy of Painting, and does a full marathon every year on his birthday.


I am Computer Science student finishing up school this fall. A full stack developer experienced in many different technologies and frameworks. Programming is a passion I have committed to myself to learning about and doing everyday.
A front end React application meant for the user that works with the aforementioned app. It currently allows for the user to post new student information and retrieve data about all the students as well as delete student information. Using firebase to host pictures.
Built a backend restful API with accompanying mongo database meant for managing students at a martial arts academy.
A team project for Software engineering class. Main goals were using agile and test driven development. JUnit framework was used for unit testing. Implemented UI design and was responsible for much of the Observer and Strategy patterns implementation in the game.
Compared the usability of the two login schemes, by calculating descriptive statistics and producing graphs.
Aside from Programming one of my other passions is the Martials Arts. Currently training in Brazilian Jiu Jitsu, Paradel Seray, MMA, Wrestling and boxing. I've competed at an amateur level in Brazilian jiu jitsu in which I currently hold my blue blet in and Muay thai.
Also enjoy exploring nature and hiking. Love taking up new hobbies and learning new skils whether its programming or learning to swim or boulder.


Auto Filler allows you to automatically fill in a form with dummy or preset data with full customisation.
Below, you can find all of the settings for Auto Filler.
You can add a new or edit an existing Auto Filler rule here.
Use the following key combinations to activate Auto Filler.
Please note that Auto Filler only activates when you are focused on a field.
| Key Combination | Action |
|---|---|
| CTRLSHIFTF | Fill in the current form using your settings |
| CTRLSHIFTH | Fill in the current element using your settings |
To customise your key combinations, head over to chrome://extensions/ and find "Keyboard shortcuts" at the bottom of the page
Saved!


Distressing dashcam footage shows lorry plough into cars as driver jailed after horror crash
Police said David Price, 65, of Chapel Lane, Manby, Lincolnshire, was on Thursday sentenced to 18 months in prison for causing serious injury by dangerous driving
by James Rodger, https://www.facebook.com/jamesrodgerjournalistA lorry driver has been jailed after causing serious injury in a crash, with dashcam footage showing his vehicle smashing into the back of one car before colliding with others.
Police said David Price, 65, of Chapel Lane, Manby, Lincolnshire, was on Thursday sentenced to 18 months in prison for causing serious injury by dangerous driving.
Price pleaded guilty and was also handed a 29-month driving ban when he appeared at Nottingham Crown Court.
Nottinghamshire Police on Sunday released dashcam footage of the crash on June 8 2018, which shows Price driving on the A17 at Newark and failing to react in time to the queuing traffic ahead.
In the footage, his lorry smashed into the back of a Renault Clio, causing a chain reaction as the Clio collided into the back an Audi A1 which was launched forward into the back of another lorry.
The driver of the Clio suffered serious injuries including a bleed on her brain, a broken back, broken neck, broken arm, broken ribs and a broken nose.
The Leeds University student needed a number of operations for her injuries and had to withdraw from university, police said.
The driver of the Audi also suffered significant injuries, police added.
Police said as Price approached the queuing traffic he was driving at about 55mph and collided with the back of the Clio at 49mph.
Newark and Sherwood Police Inspector Heather Sutton said police released the dashcam footage to warn drivers to pay attention when behind the wheel.
"Price's dangerous driving caused catastrophic life-changing injuries within the space of a few seconds," she said in a statement.
"It could all have been avoided if he had paid attention when behind the wheel.
"Now he has time to reflect on the consequences of his actions in prison."


Rails redirect_to Hashes
I ran across a surprise when using a Rails method a few days ago:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
The redirect_to
method accepts two parameters. The first is the options
object, which will be itself an options Hash, a URL String, or the symbol :back
. The second is the response_status_and_flash
object, which may either be omitted or may be a Hash containing a status
key and optional :alert
, :notice
, and :flash
keys.
An options
hash may contain a :status
key which will be used in lieu of the response_status_and_flash
hash :status
if present, but it will not supercede the flash keys. Here are some valid calls:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Did the last two surprise you? When options
is a Hash and you would like to set the response flash, the call must be constructed with
parentheses and curly braces to correctly pack in all of the arguments. It took a little experimentation and some helpful folks on IRC for me to tease out the correct syntax. And if you accidentally place a flash option inside of the options
hash, then the call will succeed with an additional query parameter in the redirect url.
I’m sure I’ll mess these up again at some point, so I’ll just leave this here for future reference.


June 2018 Humble Monthly
Spring Sale Encore
Hacknet - Delux
Humble Hooked on Multiplayer 2018 Bundle
Humble Book Bundle: Web Design & Development by O'Reilly
HUMBLE BOOK BUNDLE: COSPLAY 2.0
HUMBLE BOOK BUNDLE: SUMMER READING LIST BY BOOM! STUDIOS
DESTINY 2 - EXPANSION PASS
DESTINY 2 - EXPANSION PASS
JUST CAUSE™ 3 XL EDITION
DARK SOULS™ III
TOM CLANCY'S GHOST RECON® WILDLANDS
PLANET COASTER
DARK SOULS™ REMASTERED
FALLOUT® 4: SEASON PASS
FALLOUT® 4
FALLOUT® 4
TALES OF BERSERIA™
DYING LIGHT: THE FOLLOWING - ENHANCED EDITION
DARK SOULS™ II: SCHOLAR OF THE FIRST SIN
TOM CLANCY'S GHOST RECON® WILDLANDS - GOLD EDITION
BORDERLANDS 2: GAME OF THE YEAR
TOM CLANCY'S RAINBOW SIX® SIEGE
GRIM DAWN
ASSASSIN'S CREED® ORIGINS - GOLD EDITION
DOOM®
RISE OF THE TOMB RAIDER: 20 YEAR CELEBRATION
ELITE DANGEROUS: COMMANDER DELUXE EDITION
GRIM DAWN - ASHES OF MALMOUTH EXPANSION
CALL OF DUTY®: BLACK OPS III - ZOMBIES CHRONICLES EDITION
SLAY THE SPIRE
ELEX
SNIPER ELITE 4 DIGITAL DELUXE EDITION


Here are examples of different kinds of validations:
Angular version of validation component which is implemented by using .component() method introduced since Angular1.5.
| Attributes:Bindings | Accept value | Note |
|---|---|---|
pattern: < |
|
The type of validations. |
regex: < |
|
Regex is used to transfer userDefined regex.When either of the two parameters(Regex and pattern) are both not undefined.Regex has priority over pattern. |
| Interaction | Keystrokes | Notes |
|---|---|---|
| focus | Tab/Shift+Tab | move focus |
angular.module('wf.ng.demo', ['wf.angular.validation']).controller('ValidationController', ValidationController);
function ValidationController() {
var self = this;
self.ip_address = {};
self.ip_address.pattern ="ip_address";
self.regex =/^[1-9]{3}d*$/;
}


FixedFrameLineSegment2DBasics
, FrameLineSegment2DBasics
, FrameLineSegment2DReadOnly
, LineSegment2DBasics
FrameLineSegment2D
, LineSegment2D
public interface LineSegment2DReadOnly
A line segment 2D is a finite-length line defined in the XY-plane by its two 2D endpoints.
| Modifier and Type | Method | Description |
|---|---|---|
default boolean |
containsNaN() |
Tests if this line segment contains
Double.NaN . |
default us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics |
direction(boolean normalize) |
Computes the vector going from the first to the second endpoint of this line segment.
|
default void |
direction(boolean normalize,
us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics directionToPack) |
Computes the vector going from the first to the second endpoint of this line segment.
|
default double |
distance(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point) |
Returns the minimum distance between a point and this given line segment.
|
default double |
distanceSquared(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point) |
Returns the square of the minimum distance between a point and this given line segment.
|
default double |
dotProduct(LineSegment2DReadOnly other) |
Computes the dot product of this line segment with the other line segment such that:
this ·
other = Math.cos( α) * this.length() * other.length() where α is the angle from this to the other line segment. |
default boolean |
epsilonEquals(LineSegment2DReadOnly other,
double epsilon) |
Tests on a per-component basis on both endpoints if this line segment is equal to
other
with the tolerance epsilon . |
default boolean |
equals(LineSegment2DReadOnly other) |
Tests on a per component basis, if this line segment 2D is exactly equal to
other . |
default boolean |
firstEndpointContainsNaN() |
Test if the first endpoint of this line segment contains
Double.NaN . |
default LineSegment2D |
flipDirectionCopy() |
Returns a copy of this line segment with the endpoints swapped.
|
default boolean |
geometricallyEquals(LineSegment2DReadOnly other,
double epsilon) |
Compares
this to other to determine if the two line segments are geometrically
similar. |
default void |
get(us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstEndpointToPack,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondEndpointToPack) |
Gets the endpoints defining this line segment by storing their coordinates in the given
arguments.
|
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly |
getFirstEndpoint() |
Gets the read-only reference to the first endpoint of this line segment.
|
default double |
getFirstEndpointX() |
Gets the x-coordinate of the first endpoint defining this line segment.
|
default double |
getFirstEndpointY() |
Gets the y-coordinate of the first endpoint defining this line segment.
|
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly |
getSecondEndpoint() |
Gets the read-only reference to the second endpoint of this line segment.
|
default double |
getSecondEndpointX() |
Gets the x-coordinate of the second endpoint defining this line segment.
|
default double |
getSecondEndpointY() |
Gets the y-coordinate of the second endpoint defining this line segment.
|
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics[] |
intersectionWith(ConvexPolygon2DReadOnly convexPolygon) |
Computes the coordinates of the possible intersection(s) between a given line segment 2D and this
convex polygon 2D.
|
default int |
intersectionWith(ConvexPolygon2DReadOnly convexPolygon,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack) |
Computes the coordinates of the possible intersection(s) between this line segment and the given
convex polygon 2D.
|
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics |
intersectionWith(Line2DReadOnly line) |
Calculates the coordinates of the intersection between this line segment and the given line and
returns the result.
|
default boolean |
intersectionWith(Line2DReadOnly line,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack) |
Calculates the coordinates of the intersection between this line segment and the given line and
stores the result in
intersectionToPack . |
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics |
intersectionWith(LineSegment2DReadOnly other) |
Computes the intersection between this line segment and the given line segment and returns the
result.
|
default boolean |
intersectionWith(LineSegment2DReadOnly other,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack) |
Computes the intersection between this line segment and the given line segment and stores the
result in
intersectionToPack . |
default boolean |
isBetweenEndpoints(double x,
double y,
double epsilon) |
Tests whether the projection of the given point onto this line segment is located between the two
endpoints with a given conservative tolerance
epsilon :
if epsilon > 0 , the point has to be between the endpoints and at a minimum distance
of epsilon * this.length() from the closest endpoint. |
default boolean |
isBetweenEndpoints(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point) |
Tests whether the projection of the given point onto this line segment is located between the two
endpoints or exactly on an endpoint.
|
default boolean |
isBetweenEndpoints(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
double epsilon) |
Tests whether the projection of the given point onto this line segment is located between the two
endpoints with a given conservative tolerance
epsilon :
if epsilon > 0 , the point has to be between the endpoints and at a minimum distance
of epsilon * this.length() from the closest endpoint. |
default boolean |
isPointOnLeftSideOfLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point) |
Returns a boolean value, stating whether a 2D point is on the left or right side of this line
segment.
|
default boolean |
isPointOnLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point) |
Tests if the given is located on this line segment.
|
default boolean |
isPointOnLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
double epsilon) |
Tests if the given is located on this line segment.
|
default boolean |
isPointOnRightSideOfLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point) |
Returns a boolean value, stating whether a 2D point is on the left or right side of this line
segment.
|
default double |
length() |
Computes the length of this line segment.
|
default double |
lengthSquared() |
Computes the squared value of the length of this line segment.
|
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics |
midpoint() |
Computes and returns the coordinates of the point located exactly at the middle of this line
segment.
|
default void |
midpoint(us.ihmc.euclid.tuple2D.interfaces.Point2DBasics midpointToPack) |
Computes the coordinates of the point located exactly at the middle of this line segment.
|
default boolean |
orthogonalProjection(us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointToProject) |
Computes the orthogonal projection of a 2D point on this 2D line segment.
|
default boolean |
orthogonalProjection(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack) |
Computes the orthogonal projection of a 2D point on this 2D line segment.
|
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics |
orthogonalProjectionCopy(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject) |
Computes the orthogonal projection of a 2D point on this 2D line segment.
|
default double |
percentageAlongLineSegment(double x,
double y) |
Computes a percentage along the line segment representing the location of the given point once
projected onto this line segment.
|
default double |
percentageAlongLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point) |
Computes a percentage along the line segment representing the location of the given point once
projected onto this line segment.
|
default void |
perpendicular(boolean normalize,
us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics perpendicularVectorToPack) |
Computes the vector perpendicular to the direction of this line segment.
|
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics |
pointBetweenEndpointsGivenPercentage(double percentage) |
Computes the coordinates of the point located at a given percentage on this line segment:
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage) |
default void |
pointBetweenEndpointsGivenPercentage(double percentage,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointToPack) |
Computes the coordinates of the point located at a given percentage on this line segment:
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage) |
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics |
pointOnLineGivenPercentage(double percentage) |
Computes the coordinates of the point located on the line this line segment is lying on:
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage) |
default void |
pointOnLineGivenPercentage(double percentage,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointToPack) |
Computes the coordinates of the point located on the line this line segment is lying on:
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage) |
default boolean |
secondEndpointContainsNaN() |
Test if the second endpoint of this line segment contains
Double.NaN . |
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly getFirstEndpoint()
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly getSecondEndpoint()
default void get(us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstEndpointToPack, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondEndpointToPack)
firstEndpointToPack
- point in which the coordinates of this line segment's first endpoint
are stored. Modified.secondEndpointToPack
- point in which the coordinates of this line segment's second endpoint
are stored. Modified.default double getFirstEndpointX()
default double getFirstEndpointY()
default double getSecondEndpointX()
default double getSecondEndpointY()
default boolean firstEndpointContainsNaN()
Double.NaN
.true
if getFirstEndpoint()
contains Double.NaN
, false
otherwise.default boolean secondEndpointContainsNaN()
Double.NaN
.true
if getSecondEndpoint()
contains Double.NaN
, false
otherwise.default boolean containsNaN()
Double.NaN
.true
if getFirstEndpoint()
and/or getSecondEndpoint()
contains
Double.NaN
, false
otherwise.default void midpoint(us.ihmc.euclid.tuple2D.interfaces.Point2DBasics midpointToPack)
midpointToPack
- point in which the mid-point of this line segment is stored. Modified.default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics midpoint()
WARNING: This method generates garbage.
default double length()
default double lengthSquared()
default boolean isBetweenEndpoints(double x, double y, double epsilon)
epsilon
:
epsilon > 0
, the point has to be between the endpoints and at a minimum distance
of epsilon * this.length()
from the closest endpoint.
epsilon < 0
, the point has to be between the endpoints or at a maximum distance of
-epsilon * this.length()
from the closest endpoint.
epsilon = 0
, the point has to be between the endpoints or equal to one of the
endpoints.
x
- the x-coordinate of the query point.y
- the y-coordinate of the query point.z
- the z-coordinate of the query point.epsilon
- the tolerance to use.true
if the projection of the point is between the endpoints of this line
segment, false
otherwise.default boolean isBetweenEndpoints(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point)
point
- the query. Not modified.true
if the projection of the point is between the endpoints of this line
segment, false
otherwise.default boolean isBetweenEndpoints(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, double epsilon)
epsilon
:
epsilon > 0
, the point has to be between the endpoints and at a minimum distance
of epsilon * this.length()
from the closest endpoint.
epsilon < 0
, the point has to be between the endpoints or at a maximum distance of
-epsilon * this.length()
from the closest endpoint.
epsilon = 0
, the point has to be between the endpoints or equal to one of the
endpoints.
point
- the query. Not modified.epsilon
- the tolerance to use.true
if the projection of the point is between the endpoints of this line
segment, false
otherwise.default boolean isPointOnLeftSideOfLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point)
For instance, given the this.firstEndpoint = (0, 0)
and
this.secondEndpoint = (0, 1)
:
false
if the point is on this line.point
- the coordinates of the query point.true
if the point is on the left side of this line segment, false
if the
point is on the right side or exactly on this line segment.default us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics direction(boolean normalize)
WARNING: This method generates garbage.
normalize
- whether the direction vector is to be normalized.default void direction(boolean normalize, us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics directionToPack)
normalize
- whether the direction vector is to be normalized.directionToPack
- vector in which the direction is stored. Modified.default double distance(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point)
Edge cases:
this.lengthSquared() <
EuclidGeometryTools.ONE_TRILLIONTH
, this method
returns the distance between firstEndpoint
and the given point
.
point
- 3D point to compute the distance from this line segment. Not modified.default double distanceSquared(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point)
Edge cases:
this.lengthSquared() <
EuclidGeometryTools.ONE_TRILLIONTH
, this method
returns the distance between firstEndpoint
and the given point
.
point
- 3D point to compute the distance from this line segment. Not modified.default LineSegment2D flipDirectionCopy()
WARNING: This method generates garbage.
default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics[] intersectionWith(ConvexPolygon2DReadOnly convexPolygon)
WARNING: This method generates garbage.
Edge cases:
null
.
null
.
convexPolygon
- the polygon this line segment may intersect. Not modified.OutdatedPolygonException
- if ConvexPolygon2D.update()
has not been called since last time this
polygon's vertices were edited.default int intersectionWith(ConvexPolygon2DReadOnly convexPolygon, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Edge cases:
0
and the two intersection-to-pack
arguments remain unmodified.
1
and the coordinates of the
only intersection are stored in firstIntersectionToPack
. secondIntersectionToPack
remains unmodified.
convexPolygon
- the convex polygon this line segment may intersect. Not modified.firstIntersectionToPack
- point in which the coordinates of the first intersection. Can be
null
. Modified.secondIntersectionToPack
- point in which the coordinates of the second intersection. Can be
null
. Modified.OutdatedPolygonException
- if the convex polygon is not up-to-date.default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionWith(Line2DReadOnly line)
Edge cases:
lineSegmentStart
.
true
and the endpoint is the intersection.
WARNING: This method generates garbage.
line
- the line that may intersect this line segment. Not modified.null
otherwise.default boolean intersectionWith(Line2DReadOnly line, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
intersectionToPack
.
Edge cases:
lineSegmentStart
.
true
and the endpoint is the intersection.
line
- the line that may intersect this line segment. Not modified.intersectionToPack
- the 2D point in which the result is stored. Can be null
.
Modified.true
if the line intersects this line segment, false
otherwise.default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionWith(LineSegment2DReadOnly other)
Edge cases:
null
.
null
.
WARNING: This method generates garbage.
other
- the other line segment that may intersect this line segment. Not modified.null
otherwise.default boolean intersectionWith(LineSegment2DReadOnly other, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
intersectionToPack
.
Edge cases:
true
only if the two
line segments overlap or have at least one common endpoint.
other
- the other line segment that may intersect this line segment. Not modified.intersectionToPack
- the 2D point in which the result is stored. Modified.true
if the two lines intersects, false
otherwise.default boolean isPointOnLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point)
More precisely, the point is assumed to be on this line segment if it is located at a distance
less than 1.0e-8
from it.
point
- the coordinates of the query. Not modified.true
if the point is located on this line segment, false
otherwise.default boolean isPointOnLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, double epsilon)
More precisely, the point is assumed to be on this line segment if it is located at a distance
less than epsilon
from it.
point
- the coordinates of the query. Not modified.epsilon
- the tolerance used for this test.true
if the point is located on this line segment, false
otherwise.default boolean isPointOnRightSideOfLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point)
For instance, given the this.firstEndpoint = (0, 0)
and
this.secondEndpoint = (0, 1)
:
false
if the point is on this line.point
- the coordinates of the query point.true
if the point is on the right side of this line segment, false
if the
point is on the left side or exactly on this line segment.default double percentageAlongLineSegment(double x, double y)
0.0
representing firstEndpoint
, and 1.0
representing
secondEndpoint
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of this line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point3D projection = new Point3D();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
this.lengthSquared() <
EuclidGeometryTools.ONE_TRILLIONTH
, this method fails and
returns 0.0
.
x
- the x-coordinate of the query point.y
- the y-coordinate of the query point.z
- the z-coordinate of the query point.default double percentageAlongLineSegment(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point)
0.0
representing firstEndpoint
, and 1.0
representing
secondEndpoint
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of this line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point3D projection = new Point3D();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
this.lengthSquared() <
EuclidGeometryTools.ONE_TRILLIONTH
, this method fails and
returns 0.0
.
point
- the query point. Not modified.default double dotProduct(LineSegment2DReadOnly other)
this
·
other = Math.cos(
α) * this.length() * other.length()
other
- the other line segment used to compute the dot product. Not modified.default boolean orthogonalProjection(us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointToProject)
Edge cases:
this.lengthSquared() <
EuclidGeometryTools.ONE_TRILLIONTH
, this method returns
firstEndpoint
.
pointToProject
- the point to project on this line segment. Modified.default boolean orthogonalProjection(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
this.lengthSquared() <
EuclidGeometryTools.ONE_TRILLIONTH
, this method returns
firstEndpoint
.
pointToProject
- the point to compute the projection of. Not modified.projectionToPack
- point in which the projection of the point onto this line segment is
stored. Modified.default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics orthogonalProjectionCopy(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject)
Edge cases:
this.lengthSquared() <
EuclidGeometryTools.ONE_TRILLIONTH
, this method returns
firstEndpoint
.
pointToProject
- the point to compute the projection of. Not modified.null
if the method failed.default void perpendicular(boolean normalize, us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics perpendicularVectorToPack)
normalize
- whether the perpendicular vector is to be normalized.perpendicularVectorToPack
- vector in which the perpendicular vector components are stored.
Modified.default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointBetweenEndpointsGivenPercentage(double percentage)
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage)
WARNING: This method generates garbage.
percentage
- the percentage along this line segment of the point. Must be in [0, 1].default void pointBetweenEndpointsGivenPercentage(double percentage, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointToPack)
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage)
percentage
- the percentage along this line segment of the point. Must be in [0, 1].pointToPack
- where the result is stored. Modified.default us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointOnLineGivenPercentage(double percentage)
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage)
WARNING: This method generates garbage.
percentage
- the percentage along this line segment of the point.default void pointOnLineGivenPercentage(double percentage, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics pointToPack)
pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage)
percentage
- the percentage along this line segment of the point.pointToPack
- where the result is stored. Modified.default boolean epsilonEquals(LineSegment2DReadOnly other, double epsilon)
other
with the tolerance epsilon
.other
- the query. Not modified.epsilon
- the tolerance to use.true
if the two line segments are equal, false
otherwise.default boolean equals(LineSegment2DReadOnly other)
other
.other
- the other line segment 2D to compare against this. Not modified.true
if the two line segments are exactly equal component-wise, false
otherwise.default boolean geometricallyEquals(LineSegment2DReadOnly other, double epsilon)
this
to other
to determine if the two line segments are geometrically
similar.
The comparison is based on comparing the line segments' endpoints. Two line segments are considered geometrically equal even if they are defined with opposite direction.
other
- the line segment to compare to. Not modified.epsilon
- the tolerance of the comparison.true
if the two line segments represent the same geometry, false
otherwise.


This file contains common utility functions used by the apps. More...
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdint.h>
#include <ti/csl/hw_types.h>
#include <ti/csl/soc.h>
#include <ti/csl/cslr_synctimer.h>
#include "app_utils.h"
#include "uartStdio.h"
Macros | |
| #define | APPUTILS_CFG_COUNTER_ID ((CounterType) 0x0U) |
| #define | APPUTILS_CFG_COUNTER_FREQ (32000U) |
| #define | APPUTILS_COUNTER_MAX_COUNT (0xFFFFFFFFU) |
| #define | DRM_SUSPEND_CTRL1 (0x200U + (1U * 4U)) |
| Offset of DRM SUSPEND_CTRL1 register. | |
| #define | DRM_SUSPEND_CTRL_DCAN1 (SOC_I_DRM_BASE + DRM_SUSPEND_CTRL1) |
| DRM_SUSPEND_CTRL1 is mapped to DCAN1 Suspend Output line. | |
| #define | DRM_SUSPEND_CTRL2 (0x200U + (2U * 4U)) |
| Offset of DRM SUSPEND_CTRL2 register. | |
| #define | DRM_SUSPEND_CTRL_DCAN2 (SOC_I_DRM_BASE + DRM_SUSPEND_CTRL2) |
| DRM_SUSPEND_CTRL2 is mapped to DCAN2 Suspend Output line. | |
| #define | DRM_SUSPEND_CTRL31 (0x200U + (31 * 4U)) |
| Offset of DRM SUSPEND_CTRL31 register. | |
| #define | DRM_SUSPEND_CTRL_32KTIMER (SOC_I_DRM_BASE + DRM_SUSPEND_CTRL31) |
| DRM_SUSPEND_CTRL31 is mapped to 32Ktimer Suspend Output line. | |
Typedefs | |
| typedef int16_t | CounterType |
| Counters related typedefs. | |
Functions | |
| int32_t | GetCounterValue (CounterType CounterID, TickRefType Value) |
| Return current count value for OS timer. More... | |
| int32_t | GetElapsedValue (CounterType CounterID, TickRefType Value, TickRefType ElapsedValue) |
| Return current count value for OS timer. More... | |
| uint32_t | AppUtils_GetSiliconPackageType (void) |
| This function gets the silicon package type of the SoC. More... | |
This file contains common utility functions used by the apps.
| #define APPUTILS_CFG_COUNTER_FREQ (32000U) |
brief Counter frequency
| #define APPUTILS_CFG_COUNTER_ID ((CounterType) 0x0U) |
brief Counter ID - 0U for Counter 32Khz
| #define APPUTILS_COUNTER_MAX_COUNT (0xFFFFFFFFU) |
brief Overflow count value for 32bit counter
| uint32_t AppUtils_GetSiliconPackageType | ( | void | ) |
This function gets the silicon package type of the SoC.
| None |
| int32_t GetCounterValue | ( | CounterType | CounterID, |
| TickRefType | Value | ||
| ) |
Return current count value for OS timer.
| CounterID | Counter ID. |
| Value | Pointer to variable to return count value. |
| 0U | Counter read is successful. |
| int32_t GetElapsedValue | ( | CounterType | CounterID, |
| TickRefType | Value, | ||
| TickRefType | ElapsedValue | ||
| ) |
Return current count value for OS timer.
| CounterID | Counter ID. |
| Value | Reference value to which current value is compated to get elapsed count. |
| ElapsedValue | Pointer to variable to return elapsed count value. |
| 0U | Counter read is successful. |


{% extends 'base.html' %} {% load static %} {% block css %} {{ block.super }} {% endblock css %} {% block header %} Leaderboard # Player Type Games Wins Loses Draws {% for player in players %} {{ forloop.counter }} {{ player.username }} {{ player.type }} {{ player.count_games }} {{ player.count_wins }} {{ player.count_loses }} {{ player.count_draws }} {% endfor %} {% endblock header %} {% block javascript %} {{ block.super }} {% endblock javascript %}


{% extends 'layout-side-nav.html' %} {% import '_vars-the-bureau.html' as vars with context %} {% set active_nav_id = 'about-deputy-director' %} {% set breadcrumb_items = vars.breadcrumb_items %} {% block title -%} About Meredith Fuchs {%- endblock %} {% block desc -%} About Meredith Fuchs {%- endblock %} {% block content_main_modifiers -%} {{ super() }} content__flush-bottom {%- endblock %} {% block content_main %} {% import 'molecules/social-media.html' as social_media %}
Meredith Fuchs currently serves as the Acting Deputy Director as well as the General Counsel at the Consumer Financial Protection Bureau (CFPB).
Meredith Fuchs serves as acting Deputy Director and as the General Counsel for the Consumer Financial Protection Bureau (CFPB). She previously served as CFPB’s Chief of Staff after coming to the Bureau as the Principal Deputy General Counsel. She came to the CFPB from the United States House of Representatives, where she served as Chief Investigative Counsel of the Committee on Energy and Commerce.
Previously, she served as Vice President and General Counsel of the National Security Archive at George Washington University. Fuchs is a former litigation partner in private practice. Fuchs has served as an officer on the D.C. Bar Board of Governors. She is the recipient of the American Library Association’s James Madison Award. Fuchs served as a law clerk for Judge Patricia M. Wald on the D.C. Circuit Court of Appeals and Judge Paul L. Friedman on the U.S. District Court for the District of Columbia. She is a graduate of the New York University School of Law and the London School of Economics and Political Science.
{{ social_media.render() }}


[gecode-users] Number of solutions
Christian Schulte
cschulte at kth.se
Thu Jan 19 15:36:28 CET 2017
What? That is a real luxury complaint...
You know how much work it is to write a coherent 500 page document? That's
not that easy to do as html.
And searching in PDF is not that hard...
Christian
--
Christian Schulte, www.gecode.org/~schulte
Professor of Computer Science, KTH, cschulte at kth.se
Expert Researcher, RISE ICT/SICS, cschulte at sics.se
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Johannes Waldmann
Sent: Thursday, January 19, 2017 15:19
To: users at gecode.org
Subject: Re: [gecode-users] Number of solutions
> ... you should read MPG, really
Seconded. But - (Downloading and) opening a 500 page PDF is rather heavy. Is
there a HTML version, on the web somewhere, with URLs for sections, so that
it's easy to refer to?
I know there is "online HTML" doc at
http://www.gecode.org/documentation.html
but this refers to the C++ API only (?)
E.g., when I search for "command line"
(expecting to find something towards the answer you gave, "commandline
-solutions 0 -mode stat"), this is not really helpful:
http://www.gecode.org/doc-latest/reference/search.php?query=command+line
- J.W.
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4623 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20170119/ed3755ad/attachment.bin>
More information about the users
mailing list


| AtomicKVDatabase (34%) |
| AtomicKVStore (N/A) |
| Lock (84%) |
| LockManager (90%) |
| LockOwner (100%) |
| MutableView (76%) |
| Mutations (N/A) |
| Reads (35%) |
| SnapshotKVDatabase (0%) |
| SnapshotKVTransaction (0%) |
| SnapshotRefs (0%) |
| SnapshotVersion (0%) |
| Writes (67%) |
| package-info (N/A) |


DEPRECATED by ``resultSet.deserialize(session, data)``
| def cheshire3.resultSet.SimpleResultSet.deserialize |
( |
|
self, |
|
|
|
session, |
|
|
|
data |
|
) |
| |
Deserialize XML in ``data`` to return the populated ResultSet.
| def cheshire3.resultSet.SimpleResultSet.order |
( |
|
self, |
|
|
|
session, |
|
|
|
spec, |
|
|
|
ascending = None , |
|
|
|
missing = None , |
|
|
|
case = None , |
|
|
|
accents = None |
|
) |
| |
Re-order based on the given specification (spec) and arguments.
spec can be: index, xpath, workflow, item attribute
clause is a CQL clause with sort attributes on the relation
sort args:
missingHigh (1), missingLow (-1), missingOmit (0)
missingValue=(str) ascending=1/0
Not handling yet:
case=1/0, accents=1/0
locale=VALUE, unicodeCollate[=VALUE]
| def cheshire3.resultSet.SimpleResultSet.serialise |
( |
|
self, |
|
|
|
session, |
|
|
|
pickleOk = 1 |
|
) |
| |
Serialize and this ResultSet as XML, return a string (utf-8).
DEPRECATED by ``resultSet.serialize(session, pickleOk)``
| def cheshire3.resultSet.SimpleResultSet.serialize |
( |
|
self, |
|
|
|
session, |
|
|
|
pickleOk = 1 |
|
) |
| |
Serialize and this ResultSet as XML, return a string (utf-8).
The documentation for this class was generated from the following file:


[§576E-19] Wilful violations; penalties. Unless otherwise provided herein, any person who knowingly, intentionally or wilfully violates any section of this chapter shall be guilty of a petty misdemeanor. [L 1990, c 176, pt of §1]


[gecode-users] Identifying an IntVar
Guido Tack
tack at ps.uni-sb.de
Mon Mar 17 19:30:22 CET 2008
David Rijsman wrote:
> I am building my own somewhat generic tracing for certain search
> operators and for this I have created my own branching to create my
> own tracing in a Branching::commit. This in itself is no problem but
> now I would like to map the variable(s), on which tell operation(s)
> will be executed in the commit, back to variables in for example an
> array in my derived Space (for example the variable we execute a tell
> on is the third variable in the array in my space). As the IntVar
> instances have no identifier attributes this seems impossible. Am I
> missing some possibilities? And if I would like to add an identifier
> attribute to for example an IntVar I should do this in IntVarImp?
I'm not sure I understand every detail of what you're trying to do,
let me try to summarize: you have an array of IntVars in your space,
and tracing means that you output what's happening during a commit.
And of course you want to say something like "variable no. 3 was
modified", where 3 is the index in the global array?
Our generic solution for this is a VarMap, which belongs to the new
reflection API. You can find a small tutorial on reflection here:
http://www.gecode.org/gecode-doc-latest/PageReflection.html
Cheers,
Guido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2436 bytes
Desc: not available
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080317/1faeb960/attachment.bin>
More information about the gecode-users
mailing list


[1]
Media player not tech savvy person would love to sd card with your songs.
[2]
otherwise no Media player not tech savvy person would love to sd card with your songs.


It's always good time for sweet! Made with care and prepared with love, our
sweet are all you might need
to make every day special. Find your favorite now.
It's always good time for sweet! Made with care and prepared with love, our
sweet are all you might need
to make every day special. Find your favorite now.
It's always good time for sweet! Made with care and prepared with love, our
sweet are all you might need
to make every day special. Find your favorite now.
It's always good time for sweet! Made with care and prepared with love, our
sweet are all you might need
to make every day special. Find your favorite now.
If there's no chocolate in Heaven, I'm not going.
We know that
Truffle is a art
It's always good time for sweet! Made with care and prepared with love, our
sweet are all you might need
to make every day special.


---
title: OBORCHAIN - Blockchain Solutions for One Belt & One Road Project Member Countries
pagina: Home
---
{% include head.html %}
{% include header.html %}
{% include about.html %}
{% include info.html %}
{% include steps.html %}
{% include roadmap.html %}
{% include team.html %}
{% include partners.html %}
{% include supporters.html %}
{% include news.html %}
{% include footer.html %}
{% include scripts.html %}