Click the + button in the bottom left corner of the window.
Enter something in the Find field, pick a category, specify a region, click the Search button.
Click the Filter button in the upper right corner to start setting up your filters. Before typing anything in the filter fields, hold down the option key. You'll notice the + buttons change to … Click the … button in the "Any" row, then let go of the option key.
After following the previous step, you should end up here. Now you can start to customize your filters. First, change Any to All. Second, change All to None. Third, change Title to Date, then enter "2" in the number of days field.
You should now see something like this screen. It may not make much sense yet, but we're about to take care of that. You now want to drag the Date filter up to be the first one in the list. Click inside the red circle, then without letting go drag up to where the red arrow is. You'll see a grey bar as you're dragging to help let you know where to drop the Date step.
This is what you should now be looking at. From here, enter text you want to eliminate from the results. If there is more than one thing you want to filter out, click the + button at the end of the Title filter to add another one. You can add as many filters lines as you need.
As you can see, I have added several filter steps. Now the list of filters has scroll bars on the right hand side. Notice also that I have filtered out hundreds of items. My list of items should now much more accurately reflect what I'm interested in, while at the same time limiting the results to only the past two days.


Please enable javascript to use this app.
Chrome instructions
Firefox instructions
Edge instructions


This part of the Jinja documentaton is meant for template designers.
The Jinja template language is designed to strike a balance between content and application logic. Nevertheless you can use a python like statement language. You don’t have to know how Python works to create Jinja templates, but if you know it you can use some additional statements you may know from Python.
Here is a small example template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>My Webpage</title>

{% for item in navigation %}

{{ item.caption|e }}

{% endfor %}

My Webpage

{{ variable }}

This covers the default settings. The application developer might have changed the syntax from {% foo %} to <% foo %> or something similar. This documentation just covers the default values.
A variable looks like {{ foobar }} where foobar is the variable name. Inside of statements ({% some content here %}) variables are just normal names without the braces around it. In fact {{ foobar }} is just an alias for the statement {% print foobar %}.
Variables are coming from the context provided by the application. Normally there should be a documentation regarding the context contents but if you want to know the content of the current context, you can add this to your template:

{{ debug()|e }}

A context isn’t flat which means that each variable can has subvariables, as long as it is representable as python data structure. You can access attributes of a variable using the dot and bracket operators. The following examples show this:
{{ user.username }}
is the same as
{{ user['username'] }}
you can also use a variable to access an attribute:
{{ users[current_user].username }}
If you have numerical indices you have to use the [] syntax:
{{ users[0].username }}
In the examples above you might have noticed the pipe symbols. Pipe symbols tell the engine that it has to apply a filter on the variable. Here is a small example:
{{ variable|replace('foo', 'bar')|escape }}
If you want, you can also put whitespace between the filters.
This will look for a variable variable, pass it to the filter replace with the arguments 'foo' and 'bar', and pass the result to the filter escape that automatically XML-escapes the value. The e filter is an alias for escape. Here is the complete list of supported filters:
[[list_of_filters]]
note
Filters have a pretty low priority. If you want to add fitered values you have to put them into parentheses. The same applies if you want to access attributes:
correct:
{{ (foo|filter) + (bar|filter) }}
wrong:
{{ foo|filter + bar|filter }}
correct:
{{ (foo|filter).attribute }}
wrong:
{{ foo|filter.attribute }}
You can use the is operator to perform tests on a value:
{{ 42 is numeric }} -> true
{{ "foobar" is numeric }} -> false
{{ 'FOO' is upper }} -> true
These tests are especially useful when used in if conditions.
[[list_of_tests]]
Test functions and filter functions live in their own namespace. Global functions not. They behave like normal objects in the context. Beside the functions added by the application or framewhere there are two functions available per default:
range
Works like the python range function just that it doesn’t support ranges greater than 1000000.
debug
Function that outputs the contents of the context.
To iterate over a sequence, you can use the for loop. It basically looks like a normal Python for loop and works pretty much the same:

Members

{% for user in users %}

{{ loop.index }} / {{ loop.length }} - {{ user.username|escape }}

{% else %}

no users found

{% endfor %}

Important Contrary to Python is the optional else block only executed if there was no iteration because the sequence was empty.
Inside of a for loop block you can access some special variables:
| Variable | Description |
|---|---|
| loop.index | The current iteration of the loop. |
| loop.index0 | The current iteration of the loop, starting counting by 0. |
| loop.revindex | The number of iterations from the end of the loop. |
| loop.revindex0 | The number of iterations from the end of the loop, starting counting by 0. |
| loop.first | True if first iteration. |
| loop.last | True if last iteration. |
| loop.even | True if current iteration is even. |
| loop.odd | True if current iteration is odd. |
| loop.length | Total number of items in the sequence. |
| loop.parent | The context of the parent loop. |
Loops also support recursion. Let’s assume you have a sitemap where each item might have a number of child items. A template for that could look like this:

Sitemap

{% for item in sitemap recursive %}

{{ item.title|e }}
{% if item.children %}
{{ loop(item.children) }}
{% endif %}

{% endfor %}

What happens here? Basically the first thing that is different to a normal loop is the additional recursive modifier in the for-loop declaration. It tells the template engine that we want recursion. If recursion is enabled the special loop variable is callable. If you call it with a sequence it will automatically render the loop at that position with the new sequence as argument.
Sometimes you might want to have different text snippets for each row in a list, for example to have alternating row colors. You can easily do this by using the {% cycle %} tag:

{% for message in messages %}

{{ message|e }}

{% endfor %}

Each time Jinja encounters a cycle tag it will cycle through the list of given items and return the next one. If you pass it one item jinja assumes that this item is a sequence from the context and uses this:

...

Jinja supports Python-like if / elif / else constructs:
{% if user.active %}
user {{ user.name|e }} is active.
{% elif user.deleted %}
user {{ user.name|e }} was deleted some time ago.
{% else %}
i don't know what's wrong with {{ user.username|e }}
{% endif %}
If the user is active the first block is rendered. If not and the user was deleted the second one, in all other cases the third one.
You can also use comparison operators:
{% if amount < 0 %}
{{ amount }}
{% else %}
{{ amount }}
{% endif %}
Note
Of course you can use or / and and parentheses to create more complex conditions, but usually the logic is already handled in the application and you don’t have to create such complex constructs in the template code. However in some situations it might be a good thing to have the abilities to create them.
Inside {{ variable }} blocks, if conditions and many other parts you can can use expressions. In expressions you can use any of the following operators:
+ add the right operand to the left one. {{ 1 + 2 }} would return 3. - subtract the right operand from the left one. {{ 1 - 1 }} would return 0. / divide the left operand by the right one. {{ 1 / 2 }} would return 0.5. * multiply the left operand with the right one. {{ 2 * 2 }} would return 4. ** raise the left operand to the power of the right operand. {{ 2**3 }} would return 8. in perform sequence membership test. {{ 1 in [1,2,3] }} would return true. is perform a test on the value. See the section about tests for more information. | apply a filter on the value. See the section about filters for more information. and return true if the left and the right operand is true. or return true if the left or the right operand is true. not negate a statement (see below) () call a callable: {{ user.get_username() }}. Inside of the parentheses you can use variables: {{ user.get(username) }}.
Note that there is no support for any bit operations or something similar.
In If-Conditions Jinja performs a boolean check. All empty values (eg: empty lists [], empty dicts {} etc) evaluate to false. Numbers that are equal to 0/0.00 are considered false too. The boolean value of other objects depends on the behavior the application developer gave it. Usually items are true.
Here some examples that should explain it:
{% if [] %}
will always be false because it's an empty list
{% if {} %}
false too.
{% if ['foo'] %}
this is true. Because the list is not empty.
{% if "foobar" %}
this is also true because the string is not empty.
Some objects support slicing operations. For example lists:
{% for item in items[:5] %}
This will only iterate over the first 5 items of the list
{% for item in items[5:10] %}
This will only iterate from item 5 to 10.
{% for item in items[:10:2] %}
This will only yield items from start to ten and only returing
even items.
For more informations about slicing have a look at the slicing chapter in the “Dive into Python” e-book.
If you want to use a partial template in more than one place, you might want to create a macro from it:
{% macro show_user user %}

{{ user.name|e }}

{{ user.description }}

{% endmacro %}
Now you can use it from everywhere in the code by passing it an item:
{% for user in users %}
{{ show_user(user) }}
{% endfor %}
You can also specify more than one value:
{% macro show_dialog title, text %}

{{ title|e }}

{{ text|e }}

{% endmacro %}
{{ show_dialog('Warning', 'something went wrong i guess') }}
The most powerful part of Jinja is template inheritance. Template inheritance allows you to build a base “skeleton” template that contains all the common elements of your site and defines blocks that child templates can override.
Sounds complicated but is very basic. It’s easiest to understand it by starting with an example.
This template, which we’ll call base.html, defines a simple HTML skeleton document that you might use for a simple two-column page. It’s the job of “child” templates to fill the empty blocks with content:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<link rel="stylesheet" href="style.css" />
<title>{% block title %}{% endblock %} - My Webpage</title>
{% block html_head %}{% endblock %}

{% block content %}{% endblock %}

{% block footer %}
© Copyright 2006 by myself.
{% endblock %}

In this example, the {% block %} tags define four blocks that child templates can fill in. All the block tag does is to tell the template engine that a child template may override those portions of the template.
A child template might look like this:
{% extends "base.html" %}
{% block title %}Index{% endblock %}
{% block html_head %}

{% endblock %}
{% block content %}

Index

Welcome on my awsome homepage.

{% endblock %}
The {% extends %} tag is the key here. It tells the template engine that this template “extends” another template. When the template system evaluates this template, first it locates the parent.
The filename of the template depends on the template loader. For example the FileSystemLoader allows you to access other templates by giving the filename. You can access templates in subdirectories with an slash:
{% extends "layout/default.html" %}
But this behavior can depend on the application using Jinja.
Note that since the child template didn’t define the footer block, the value from the parent template is used instead.
Note
You can’t define multiple {% block %} tags with the same name in the same template. This limitation exists because a block tag works in “both” directions. That is, a block tag doesn’t just provide a hole to fill - it also defines the content that fills the hole in the parent. If there were two similarly-named {% block %} tags in a template, that template’s parent wouldn’t know which one of the blocks’ content to use.
You can load another template at a given position using {% include %}. Usually it’s a better idea to use inheritance but if you for example want to load macros, include works better than extends:
{% include "myhelpers.html" %}
{{ my_helper("foo") }}
If you define a macro called my_helper in myhelpers.html, you can now use it from the template as shown above.
Sometimes it could be a good idea to filter a complete block of text. For example, if you want to escape some html code:
{% filter escape %}

goes here

{% endfilter %}
Of course you can chain filters too:
{% filter lower|escape %}
SOME TEXT
{% endfilter %}
returns "some text".
You can also define variables in the namespace using the {% set %} tag:
{% set foo = 'foobar' %}
{{ foo }}
This should ouput foobar.
Jinja has multiple scopes. A scope is something like a new transparent foil on a stack of foils. You can only write to the outermost foil but read all of them since you can look through them. If you remove the top foil all data on that foil disappears. Some tags in Jinja add a new layer to the stack. Currently these are block, for, macro and filter. This means that variables and other elements defined inside a macro, loop or some of the other tags listed above will be only available in that block. Here an example:
{% macro angryhello name %}
{% set angryname = name|upper %}
Hello {{ name }}. Hello {{ name }}!
HELLO {{ angryname }}!!!!!!111
{% endmacro %}
The variable angryname just exists inside the macro, not outside it.
Defined macros appear on the context as variables. Because of this, they are affected by the scoping too. A macro defined inside of a macro is just available in those two macros (the macro itself and the macro it’s defined in). For set and macro two additional rules exist: If a macro is defined in an extended template but outside of a visible block (thus outside of any block) will be available in all blocks below. This allows you to use include statements to load often used macros at once.
If you have already worked with python you probably know about the fact that undefined variables raise an exception. This is different in Jinja. There is a special value called undefined that represents values that do not exist.
This special variable works complete different from any variables you maybe know. If you print it using {{ variable }} it will not appear because it’s literally empty. If you try to iterate over it, it will work. But no items are returned. Comparing this value to any other value results in false. Even if you compare it to itself:
{{ undefined == undefined }}
will return false. Not even undefined is undefined :)
Use `is defined` / `is not defined`:
{{ undefined is not defined }}
will return true.
There are also some additional rules regarding this special value. Any mathematical operators (+, -, *, /) return the operand as result:
{{ undefined + "foo" }}
returns "foo"
{{ undefined - 42 }}
returns 42. Note: not -42!
In any expression undefined evaluates to false. It has no length, all attribute calls return undefined, calling too:
{{ undefined.attribute().attribute_too[42] }}
still returns `undefined`.
Sometimes you might want to add Jinja syntax elements into the template without executing them. In that case you have quite a few possibilities.
For small parts this might be a good way:
{{ "{{ foo }} is variable syntax and {% foo %} is block syntax" }}
When you have multiple elements you can use the raw block:
{% raw %}
Filtering blocks works like this in Jinja:
{% filter escape %}

goes here

{% endfilter %}
{% endraw %}
Jinja has some keywords you cannot use a variable names. This limitation exists to make look coherent. Syntax highlighters won’t mess things up and you will don’t have unexpected output.
The following keywords exist and cannot be used as identifiers:
and, block, cycle, elif, else, endblock, endfilter, endfor, endif, endmacro, endraw, endtrans, extends, filter, for, if, in, include, is, macro, not, or, pluralize, raw, recursive, set, trans
If you want to use such a name you have to prefix or suffix it or use alternative names:
{% for macro_ in macros %}
{{ macro_('foo') }}
{% endfor %}
If future Jinja releases add new keywords those will be “light” keywords which means that they won’t raise an error for several releases but yield warnings on the application side. But it’s very unlikely that new keywords will be added.
If the application is configured for i18n, you can define translatable blocks for translators using the trans tag or the special underscore function:
{% trans %}
this is a translatable block
{% endtrans %}
{% trans "This is a translatable string" %}
{{ _("This is a translatable string") }}
The latter one is useful if you want translatable arguments for filters etc.
If you want to have plural forms too, use the pluralize block:
{% trans users=users %}
One user found.
{% pluralize %}
{{ users }} users found.
{% endtrans %}
{% trans first=(users|first).username|escape, user=users|length %}
one user {{ first }} found.
{% pluralize users %}
{{ users }} users found, the first one is called {{ first }}.
{% endtrans %}
If you have multiple arguments, the first one is assumed to be the indicator (the number that is used to determine the correct singular or plural form. If you don’t have the indicator variable on position 1 you have to tell the pluralize tag the correct variable name.
Inside translatable blocks you cannot use blocks or expressions (however you can still use the raw block which will work as expected). The variable print syntax ({{ variablename }}) is the only way to insert the variables defined in the trans header. Filters must be applied in the header.
note
Please make sure that you always use pluralize blocks where required. Many languages have more complex plural forms than the English language.
Never try to workaround that issue by using something like this:
{% if count != 1 %}
{{ count }} users found.
{% else %}
one user found.
{% endif %}


Proxy object which allow you to call JSON-RPC methods as if it was Obj-C method. More...
#import <JSONRPCService.h>
Properties | |
| JSONRPCService * | service |
| the service the proxy acts for |
Proxy object which allow you to call JSON-RPC methods as if it was Obj-C method.
Use the JSONRPCService::proxy méthod to get a proxy object to a JSON-RPC WebService instead of creating it yourself.
Using the proxy object allows you to directly call a JSON-RPC method on a WebService as if it was an Objective-C method like this:
// service is an JSONRPCService object [service.proxy getUsersList]; // equivalent to [service callMethodWithName:@"getUsersList" parameters:nil] [service.proxy echo:mkArray(@"Hello")]; // equivalent to [service callMethodWithName:@"echo" parameters:mkArray(@"Hello")]
It is a nice way to have a somewhat transparent way to manipulate the WebService's API, but has the drawback that it will generate warnings on compilation such as "xxx may not respond to selector yyy" (as the message you will call on this proxy object are not declared but instead automatically forwarded using forwardInvocation:)


BEAUTIFUL THING A film review by James Berardinelli Copyright 1997 James Berardinelli
RATING (0 TO 10): 7.0 Alternative Scale: *** out of ****
United Kingdom, 1996 U.S. Release Date: variable (limited) Running Length: 1:30 MPAA Classification: R (Profanity, mature themes) Theatrical Aspect Ratio: 1.66:1
Cast: Glen Berry, Scott Neal, Linda Henry, Tameka Empson, Ben Daniels Director: Hettie Macdonald Producers: Tony Garnett and Bill Shapter Screenplay: Jonathan Harvey Cinematography: Chris Seagar Music: The Mamas and Papas U.S. Distributor: Sony Pictures Classics
For better or for worse, most gay-themed motion pictures have a political ax to grind. And, while that might appeal to those who enjoy movies that espouse a cause, it doesn't always make for the most entertaining time in a theater. In may ways, therefore, Hettie Macdonald's feature debut, BEAUTIFUL THING, is a breath of fresh air. Instead of politicizing the issue of two adolescent boys' homosexuality, it keeps the story intimate, and, even on those occasions when the tale strays into over-familiar dramatic territory, BEAUTIFUL THING remains steadfastly faithful to the characters it has created.
BEAUTIFUL THING tells of two teenage boys, Jamie (Glen Berry) and Ste (Scott Neal), who live next door to each other in southeast London's Thamesmead Estate. When Ste's chronically abusive father and older brother apply a fresh beating to him, he goes to Jamie's mother, Sandra (Linda Henry), for sanctuary. Ste ends up spending several nights in Jamie's room, and, as the days pass, the boys recognize a burgeoning attraction. However, each of them is apprehensive not only about acting upon it, but about even admitting it. Nevertheless, as others begin to notice the changing dynamic in their relationship, Jamie, the less popular of the two, becomes the target of his schoolmates' derision.
The central story is handled with warmth and intelligence by Macdonald, who is directing from a script adapted by Jonathan Harvey from his play (which she directed on stage, as well). The relationship between Jamie and Ste comes across as surprisingly heartfelt yet unsentimental.  But this is also a case of first love for both of the principals, each of whom, in addition to facing their homosexuality, must struggle with the distress and rapture of a passionate adolescent infatuation. Macdonald, with more than a little help from two skilled young actors, Glen Berry and Scott Neal, manages to capture the nuances of the situation, exploring the emotional complexity of the circumstances without resorting to melodrama.
Unfortunately, BEAUTIFUL THING has a plethora of subplots, none of which comes close to the main story in terms of richness or sensitivity.  The same is true for Ste's interaction with his father and brother. A neighborhood girl, Leah (Tameka Empson), initially looks like she might play an important part in the film, but she ends up in a supporting role, offering occasional comic relief and providing much of the soundtrack as a result of her obsession with Mama Cass (of the Mamas and Papas). Despite having the potential to be BEAUTIFUL THING's most interesting character, she remains severely underdeveloped and underused.
The acting, as we have come to expect from British films, is solid from top to bottom. Berry and Neal effectively convey their characters' situation to the audience, allowing us to share in the complicated web of wonder and pain that they experience as they come to terms with their identity. Tameka Empson is delightful as the off-the-wall druggie Leah.
BEAUTIFUL THING uses numerous conventions of urban dramas and forbidden love stories in its framework, but, because Macdonald keeps the focus intimately on Jamie and Ste, the result is still satisfying. Only the ending, which gives a false sense of closure to an otherwise well-balanced narrative, feels wrong.
- James Berardinelli e-mail<EMAIL_ADDRESS>ReelViews web site: http://www.cybernex.net/~berardin
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


| GEOS SDK TechDocs
|
| 2.1 Setting Up the File Selector
| 2.3 Messages to Handle
To use the File Selector as shown in A Basic File Selector
, your application must have some object (which may be the Process object) that can handle all the cases that may arise from a user's interaction with the dialog box. All of these cases are listed below:
-
The user clicks once on an entry in the File Selector's list.
When this happens, the File Selector highlights the selected entry and sends its notification message to its destination object. With the message will come a record of flags indicating the action was a single click.
-
The user double-clicks on an entry in the File Selector's list.
This action causes the File Selector to send its notification message to its destination object. The default action for the dialog box containing the File Selector will also occur (e.g. the default action is what happens when the "Insert" trigger is pressed). If the current selection is a directory, the application does not need to do anything; the File Selector will open the directory automatically. If the current selection is a file, the application must deal with the file properly and then close the dialog box containing the File Selector.
-
The user clicks on the "Insert" trigger.
This action causes the trigger to send its notification message to its destination object. In most cases, the trigger with be an IC_OK trigger that will cause the File Selector to act as if a double-click had occurred. If the current selected entry in the list is a directory, the application should instruct the File Selector to open the directory and display its file list. If the current selection is a file, the application is responsible for dealing properly with the file; additionally, the application should then close the dialog box containing the File Selector.
The above list describes the basics of File Selector support. Different File Selectors (such as SaveAs dialogs that allow the user to type in a file name) can easily be defined by adding other gadgetry to the controller. All other actions possible are internal to the file selector (e.g. the "Go To Document" button is a feature of the File Selector which is invisible to the application).
| GEOS SDK TechDocs
|
| 2.1 Setting Up the File Selector
| 2.3 Messages to Handle


To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video


Javalanche report for class:
org.joda.time.YearMonth
1: /*
2: * Copyright 2001-2010 Stephen Colebourne
3: *
4: * Licensed under the Apache License, Version 2.0 (the "License");
5: * you may not use this file except in compliance with the License.
6: * You may obtain a copy of the License at
7: *
8: * http://www.apache.org/licenses/LICENSE-2.0
9: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.joda.time;
17:
18: import java.io.Serializable;
19: import java.util.Calendar;
20: import java.util.Date;
21: import java.util.Locale;
22:
23: import org.joda.convert.FromString;
24: import org.joda.convert.ToString;
25: import org.joda.time.base.BasePartial;
26: import org.joda.time.chrono.ISOChronology;
27: import org.joda.time.field.AbstractPartialFieldProperty;
28: import org.joda.time.field.FieldUtils;
29: import org.joda.time.format.DateTimeFormat;
30: import org.joda.time.format.DateTimeFormatter;
31: import org.joda.time.format.ISODateTimeFormat;
32:
33: /**
34: * YearMonth is an immutable partial supporting the year and monthOfYear fields.
35: *

36: * NOTE: This class only supports the two fields listed above.
37: * It is impossible to query any other fields, such as dayOfWeek or centuryOfEra.
38: *

39: * Calculations on YearMonth are performed using a {@link Chronology}.
40: * This chronology is set to be in the UTC time zone for all calculations.
41: *

42: * One use case for this class is to store a credit card expiry date, as that only
43: * references the year and month.
44: * This class can be used as the gYearMonth type in XML Schema.
45: *

46: * Each individual field can be queried in two ways:
47: *

48: *
getMonthOfYear()
49: *
monthOfYear().get()
50: *

51: * The second technique also provides access to other useful methods on the
52: * field:
53: *

54: *
numeric value - monthOfYear().get()
55: *
text value - monthOfYear().getAsText()
56: *
short text value - monthOfYear().getAsShortText()
57: *
maximum/minimum values - monthOfYear().getMaximumValue()
58: *
add/subtract - monthOfYear().addToCopy()
59: *
set - monthOfYear().setCopy()
60: *

61: *

62: * YearMonth is thread-safe and immutable, provided that the Chronology is as well.
63: * All standard Chronology classes supplied are thread-safe and immutable.
64: *
65: * @author Stephen Colebourne
66: * @since 2.0
67: */
68: public final class YearMonth
69: extends BasePartial
70: implements ReadablePartial, Serializable {
71:
72: /** Serialization version */
73: private static final long serialVersionUID =<PHONE_NUMBER>96179L;
74: /** The singleton set of field types */
75: private static final DateTimeFieldType[] FIELD_TYPES = new DateTimeFieldType[] {
76: DateTimeFieldType.year(),
77: DateTimeFieldType.monthOfYear(),
78: };
79:
80: /** The index of the year field in the field array */
81: public static final int YEAR = 0;
82: /** The index of the monthOfYear field in the field array */
83: public static final int MONTH_OF_YEAR = 1;
84:
85: //-----------------------------------------------------------------------
86: /**
87: * Obtains a {@code YearMonth} set to the current system millisecond time
88: * using ISOChronology in the default time zone.
89: * The resulting object does not use the zone.
90: *
91: * @return the current year-month, not null
92: * @since 2.0
93: */
94: public static YearMonth now() {
95: return new YearMonth();
96: }
97:
98: /**
99: * Obtains a {@code YearMonth} set to the current system millisecond time
100: * using ISOChronology in the specified time zone.
101: * The resulting object does not use the zone.
102: *
103: * @param zone the time zone, not null
104: * @return the current year-month, not null
105: * @since 2.0
106: */
107: public static YearMonth now(DateTimeZone zone) {
108: if (zone == null) {
109: throw new NullPointerException("Zone must not be null");
110: }
111: return new YearMonth(zone);
112: }
113:
114: /**
115: * Obtains a {@code YearMonth} set to the current system millisecond time
116: * using the specified chronology.
117: * The resulting object does not use the zone.
118: *
119: * @param chronology the chronology, not null
120: * @return the current year-month, not null
121: * @since 2.0
122: */
123: public static YearMonth now(Chronology chronology) {
124: if (chronology == null) {
125: throw new NullPointerException("Chronology must not be null");
126: }
127: return new YearMonth(chronology);
128: }
129:
130: //-----------------------------------------------------------------------
131: /**
132: * Parses a {@code YearMonth} from the specified string.
133: *

134: * This uses {@link ISODateTimeFormat#localDateParser()}.
135: *
136: * @param str the string to parse, not null
137: * @since 2.0
138: */
139: @FromString
140: public static YearMonth parse(String str) {
141: return parse(str, ISODateTimeFormat.localDateParser());
142: }
143:
144: /**
145: * Parses a {@code YearMonth} from the specified string using a formatter.
146: *
147: * @param str the string to parse, not null
148: * @param formatter the formatter to use, not null
149: * @since 2.0
150: */
151: public static YearMonth parse(String str, DateTimeFormatter formatter) {
152: LocalDate date = formatter.parseLocalDate(str);
153: return new YearMonth(date.getYear(), date.getMonthOfYear());
154: }
155:
156: //-----------------------------------------------------------------------
157: /**
158: * Constructs a YearMonth from a java.util.Calendar
159: * using exactly the same field values avoiding any time zone effects.
160: *

161: * Each field is queried from the Calendar and assigned to the YearMonth.
162: *

163: * This factory method ignores the type of the calendar and always
164: * creates a YearMonth with ISO chronology. It is expected that you
165: * will only pass in instances of GregorianCalendar however
166: * this is not validated.
167: *
168: * @param calendar the Calendar to extract fields from
169: * @return the created YearMonth, never null
170: * @throws IllegalArgumentException if the calendar is null
171: * @throws IllegalArgumentException if the year or month is invalid for the ISO chronology
172: */
173: public static YearMonth fromCalendarFields(Calendar calendar) {
174: if (calendar == null) {
175: throw new IllegalArgumentException("The calendar must not be null");
176: }
177: return new YearMonth(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1);
178: }
179:
180: /**
181: * Constructs a YearMonth from a java.util.Date
182: * using exactly the same field values avoiding any time zone effects.
183: *

184: * Each field is queried from the Date and assigned to the YearMonth.
185: *

186: * This factory method always creates a YearMonth with ISO chronology.
187: *
188: * @param date the Date to extract fields from
189: * @return the created YearMonth, never null
190: * @throws IllegalArgumentException if the calendar is null
191: * @throws IllegalArgumentException if the year or month is invalid for the ISO chronology
192: */
193: @SuppressWarnings("deprecation")
194: public static YearMonth fromDateFields(Date date) {
195: if (date == null) {
196: throw new IllegalArgumentException("The date must not be null");
197: }
198: return new YearMonth(date.getYear() + 1900, date.getMonth() + 1);
199: }
200:
201: //-----------------------------------------------------------------------
202: /**
203: * Constructs a YearMonth with the current year-month, using ISOChronology in
204: * the default zone to extract the fields.
205: *

206: * The constructor uses the default time zone, resulting in the local time
207: * being initialised. Once the constructor is complete, all further calculations
208: * are performed without reference to a time-zone (by switching to UTC).
209: *
210: * @see #now()
211: */
212: public YearMonth() {
213: super();
214: }
215:
216: /**
217: * Constructs a YearMonth with the current year-month, using ISOChronology in
218: * the specified zone to extract the fields.
219: *

220: * The constructor uses the specified time zone to obtain the current year-month.
221: * Once the constructor is complete, all further calculations
222: * are performed without reference to a time-zone (by switching to UTC).
223: *
224: * @param zone the zone to use, null means default zone
225: * @see #now(DateTimeZone)
226: */
227: public YearMonth(DateTimeZone zone) {
228: super(ISOChronology.getInstance(zone));
229: }
230:
231: /**
232: * Constructs a YearMonth with the current year-month, using the specified chronology
233: * and zone to extract the fields.
234: *

235: * The constructor uses the time zone of the chronology specified.
236: * Once the constructor is complete, all further calculations are performed
237: * without reference to a time-zone (by switching to UTC).
238: *
239: * @param chronology the chronology, null means ISOChronology in the default zone
240: * @see #now(Chronology)
241: */
242: public YearMonth(Chronology chronology) {
243: super(chronology);
244: }
245:
246: /**
247: * Constructs a YearMonth extracting the partial fields from the specified
248: * milliseconds using the ISOChronology in the default zone.
249: *

250: * The constructor uses the default time zone, resulting in the local time
251: * being initialised. Once the constructor is complete, all further calculations
252: * are performed without reference to a time-zone (by switching to UTC).
253: *
254: * @param instant the milliseconds from 1970-01-01T00:00:00Z
255: */
256: public YearMonth(long instant) {
257: super(instant);
258: }
259:
260: /**
261: * Constructs a YearMonth extracting the partial fields from the specified
262: * milliseconds using the chronology provided.
263: *

264: * The constructor uses the time zone of the chronology specified.
265: * Once the constructor is complete, all further calculations are performed
266: * without reference to a time-zone (by switching to UTC).
267: *
268: * @param instant the milliseconds from 1970-01-01T00:00:00Z
269: * @param chronology the chronology, null means ISOChronology in the default zone
270: */
271: public YearMonth(long instant, Chronology chronology) {
272: super(instant, chronology);
273: }
274:
275: /**
276: * Constructs a YearMonth from an Object that represents some form of time.
277: *

278: * The recognised object types are defined in
279: * {@link org.joda.time.convert.ConverterManager ConverterManager} and
280: * include ReadableInstant, String, Calendar and Date.
281: * The String formats are described by {@link ISODateTimeFormat#localDateParser()}.
282: *

283: * The chronology used will be derived from the object, defaulting to ISO.
284: *
285: * @param instant the date-time object, null means now
286: * @throws IllegalArgumentException if the instant is invalid
287: */
288: public YearMonth(Object instant) {
289: super(instant, null, ISODateTimeFormat.localDateParser());
290: }
291:
292: /**
293: * Constructs a YearMonth from an Object that represents some form of time,
294: * using the specified chronology.
295: *

296: * The recognised object types are defined in
297: * {@link org.joda.time.convert.ConverterManager ConverterManager} and
298: * include ReadableInstant, String, Calendar and Date.
299: * The String formats are described by {@link ISODateTimeFormat#localDateParser()}.
300: *

301: * The constructor uses the time zone of the chronology specified.
302: * Once the constructor is complete, all further calculations are performed
303: * without reference to a time-zone (by switching to UTC).
304: * The specified chronology overrides that of the object.
305: *
306: * @param instant the date-time object, null means now
307: * @param chronology the chronology, null means ISO default
308: * @throws IllegalArgumentException if the instant is invalid
309: */
310: public YearMonth(Object instant, Chronology chronology) {
311: super(instant, DateTimeUtils.getChronology(chronology), ISODateTimeFormat.localDateParser());
312: }
313:
314: /**
315: * Constructs a YearMonth with specified year and month
316: * using ISOChronology.
317: *

318: * The constructor uses the no time zone initialising the fields as provided.
319: * Once the constructor is complete, all further calculations
320: * are performed without reference to a time-zone (by switching to UTC).
321: *
322: * @param year the year
323: * @param monthOfYear the month of the year
324: */
325: public YearMonth(int year, int monthOfYear) {
326: this(year, monthOfYear, null);
327: }
328:
329: /**
330: * Constructs an instance set to the specified year and month
331: * using the specified chronology, whose zone is ignored.
332: *

333: * If the chronology is null, ISOChronology is used.
334: *

335: * The constructor uses the time zone of the chronology specified.
336: * Once the constructor is complete, all further calculations are performed
337: * without reference to a time-zone (by switching to UTC).
338: *
339: * @param year the year
340: * @param monthOfYear the month of the year
341: * @param chronology the chronology, null means ISOChronology in the default zone
342: */
343: public YearMonth(int year, int monthOfYear, Chronology chronology) {
344: super(new int[] {year, monthOfYear}, chronology);
345: }
346:
347: /**
348: * Constructs a YearMonth with chronology from this instance and new values.
349: *
350: * @param partial the partial to base this new instance on
351: * @param values the new set of values
352: */
353: YearMonth(YearMonth partial, int[] values) {
354: super(partial, values);
355: }
356:
357: /**
358: * Constructs a YearMonth with values from this instance and a new chronology.
359: *
360: * @param partial the partial to base this new instance on
361: * @param chrono the new chronology
362: */
363: YearMonth(YearMonth partial, Chronology chrono) {
364: super(partial, chrono);
365: }
366:
367: /**
368: * Handle broken serialization from other tools.
369: * @return the resolved object, not null
370: */
371: private Object readResolve() {
372: if (DateTimeZone.UTC.equals(getChronology().getZone()) == false) {
373: return new YearMonth(this, getChronology().withUTC());
374: }
375: return this;
376: }
377:
378: //-----------------------------------------------------------------------
379: /**
380: * Gets the number of fields in this partial, which is two.
381: * The supported fields are Year and MonthOfYear.
382: * Note that only these fields may be queried.
383: *
384: * @return the field count, two
385: */
386: public int size() {
387: return 2;
388: }
389:
390: /**
391: * Gets the field for a specific index in the chronology specified.
392: *

393: * This method must not use any instance variables.
394: *
395: * @param index the index to retrieve
396: * @param chrono the chronology to use
397: * @return the field, never null
398: */
399: protected DateTimeField getField(int index, Chronology chrono) {
400: switch (index) {
401: case YEAR:
402: return chrono.year();
403: case MONTH_OF_YEAR:
404: return chrono.monthOfYear();
405: default:
406: throw new IndexOutOfBoundsException("Invalid index: " + index);
407: }
408: }
409:
410: /**
411: * Gets the field type at the specified index.
412: *
413: * @param index the index to retrieve
414: * @return the field at the specified index, never null
415: * @throws IndexOutOfBoundsException if the index is invalid
416: */
417: public DateTimeFieldType getFieldType(int index) {
418: return FIELD_TYPES[index];
419: }
420:
421: /**
422: * Gets an array of the field type of each of the fields that this partial supports.
423: *

424: * The fields are returned largest to smallest, Year, Month.
425: *
426: * @return the array of field types (cloned), largest to smallest, never null
427: */
428: public DateTimeFieldType[] getFieldTypes() {
429: return (DateTimeFieldType[]) FIELD_TYPES.clone();
430: }
431:
432: //-----------------------------------------------------------------------
433: /**
434: * Returns a copy of this year-month with the specified chronology.
435: * This instance is immutable and unaffected by this method call.
436: *

437: * This method retains the values of the fields, thus the result will
438: * typically refer to a different instant.
439: *

440: * The time zone of the specified chronology is ignored, as YearMonth
441: * operates without a time zone.
442: *
443: * @param newChronology the new chronology, null means ISO
444: * @return a copy of this year-month with a different chronology, never null
445: * @throws IllegalArgumentException if the values are invalid for the new chronology
446: */
447: public YearMonth withChronologyRetainFields(Chronology newChronology) {
448: newChronology = DateTimeUtils.getChronology(newChronology);
449: newChronology = newChronology.withUTC();
450: if (newChronology == getChronology()) {
451: return this;
452: } else {
453: YearMonth newYearMonth = new YearMonth(this, newChronology);
454: newChronology.validate(newYearMonth, getValues());
455: return newYearMonth;
456: }
457: }
458:
459: /**
460: * Returns a copy of this year-month with the specified field set to a new value.
461: *

462: * For example, if the field type is monthOfYear then the month
463: * would be changed in the returned instance.
464: *

465: * These three lines are equivalent:
466: *

467: * YearMonth updated = ym.withField(DateTimeFieldType.monthOfYear(), 6);
468: * YearMonth updated = ym.monthOfYear().setCopy(6);
469: * YearMonth updated = ym.property(DateTimeFieldType.monthOfYear()).setCopy(6);
470: *

471: *
472: * @param fieldType the field type to set, not null
473: * @param value the value to set
474: * @return a copy of this instance with the field set, never null
475: * @throws IllegalArgumentException if the value is null or invalid
476: */
477: public YearMonth withField(DateTimeFieldType fieldType, int value) {
478: int index = indexOfSupported(fieldType);
479: if (value == getValue(index)) {
480: return this;
481: }
482: int[] newValues = getValues();
483: newValues = getField(index).set(this, index, newValues, value);
484: return new YearMonth(this, newValues);
485: }
486:
487: /**
488: * Returns a copy of this year-month with the value of the specified field increased.
489: *

490: * If the addition is zero, then this is returned.
491: *

492: * These three lines are equivalent:
493: *

494: * YearMonth added = ym.withFieldAdded(DurationFieldType.months(), 6);
495: * YearMonth added = ym.plusMonths(6);
496: * YearMonth added = ym.monthOfYear().addToCopy(6);
497: *

498: *
499: * @param fieldType the field type to add to, not null
500: * @param amount the amount to add
501: * @return a copy of this instance with the field updated, never null
502: * @throws IllegalArgumentException if the value is null or invalid
503: * @throws ArithmeticException if the new date-time exceeds the capacity
504: */
505: public YearMonth withFieldAdded(DurationFieldType fieldType, int amount) {
506: int index = indexOfSupported(fieldType);
507: if (amount == 0) {
508: return this;
509: }
510: int[] newValues = getValues();
511: newValues = getField(index).add(this, index, newValues, amount);
512: return new YearMonth(this, newValues);
513: }
514:
515: /**
516: * Returns a copy of this year-month with the specified period added.
517: *

518: * If the addition is zero, then this is returned.
519: * Fields in the period that aren't present in the partial are ignored.
520: *

521: * This method is typically used to add multiple copies of complex
522: * period instances. Adding one field is best achieved using methods
523: * like {@link #withFieldAdded(DurationFieldType, int)}
524: * or {@link #plusYears(int)}.
525: *
526: * @param period the period to add to this one, null means zero
527: * @param scalar the amount of times to add, such as -1 to subtract once
528: * @return a copy of this instance with the period added, never null
529: * @throws ArithmeticException if the new date-time exceeds the capacity
530: */
531: public YearMonth withPeriodAdded(ReadablePeriod period, int scalar) {
532: if (period == null || scalar == 0) {
533: return this;
534: }
535: int[] newValues = getValues();
536: for (int i = 0; i < period.size(); i++) {
537: DurationFieldType fieldType = period.getFieldType(i);
538: int index = indexOf(fieldType);
539: if (index >= 0) {
540: newValues = getField(index).add(this, index, newValues,
541: FieldUtils.safeMultiply(period.getValue(i), scalar));
542: }
543: }
544: return new YearMonth(this, newValues);
545: }
546:
547: //-----------------------------------------------------------------------
548: /**
549: * Returns a copy of this year-month with the specified period added.
550: *

551: * If the amount is zero or null, then this is returned.
552: *

553: * This method is typically used to add complex period instances.
554: * Adding one field is best achieved using methods
555: * like {@link #plusYears(int)}.
556: *
557: * @param period the duration to add to this one, null means zero
558: * @return a copy of this instance with the period added, never null
559: * @throws ArithmeticException if the new year-month exceeds the capacity
560: */
561: public YearMonth plus(ReadablePeriod period) {
562: return withPeriodAdded(period, 1);
563: }
564:
565: //-----------------------------------------------------------------------
566: /**
567: * Returns a copy of this year-month plus the specified number of years.
568: *

569: * This year-month instance is immutable and unaffected by this method call.
570: *

571: * The following three lines are identical in effect:
572: *

573: * YearMonth added = ym.plusYears(6);
574: * YearMonth added = ym.plus(Period.years(6));
575: * YearMonth added = ym.withFieldAdded(DurationFieldType.years(), 6);
576: *

577: *
578: * @param years the amount of years to add, may be negative
579: * @return the new year-month plus the increased years, never null
580: */
581: public YearMonth plusYears(int years) {
582: return withFieldAdded(DurationFieldType.years(), years);
583: }
584:
585: /**
586: * Returns a copy of this year-month plus the specified number of months.
587: *

588: * This year-month instance is immutable and unaffected by this method call.
589: *

590: * The following three lines are identical in effect:
591: *

592: * YearMonth added = ym.plusMonths(6);
593: * YearMonth added = ym.plus(Period.months(6));
594: * YearMonth added = ym.withFieldAdded(DurationFieldType.months(), 6);
595: *

596: *
597: * @param months the amount of months to add, may be negative
598: * @return the new year-month plus the increased months, never null
599: */
600: public YearMonth plusMonths(int months) {
601: return withFieldAdded(DurationFieldType.months(), months);
602: }
603:
604: //-----------------------------------------------------------------------
605: /**
606: * Returns a copy of this year-month with the specified period taken away.
607: *

608: * If the amount is zero or null, then this is returned.
609: *

610: * This method is typically used to subtract complex period instances.
611: * Subtracting one field is best achieved using methods
612: * like {@link #minusYears(int)}.
613: *
614: * @param period the period to reduce this instant by
615: * @return a copy of this instance with the period taken away, never null
616: * @throws ArithmeticException if the new year-month exceeds the capacity
617: */
618: public YearMonth minus(ReadablePeriod period) {
619: return withPeriodAdded(period, -1);
620: }
621:
622: //-----------------------------------------------------------------------
623: /**
624: * Returns a copy of this year-month minus the specified number of years.
625: *

626: * This year-month instance is immutable and unaffected by this method call.
627: *

628: * The following three lines are identical in effect:
629: *

630: * YearMonth subtracted = ym.minusYears(6);
631: * YearMonth subtracted = ym.minus(Period.years(6));
632: * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.years(), -6);
633: *

634: *
635: * @param years the amount of years to subtract, may be negative
636: * @return the new year-month minus the increased years, never null
637: */
638: public YearMonth minusYears(int years) {
639: return withFieldAdded(DurationFieldType.years(), FieldUtils.safeNegate(years));
640: }
641:
642: /**
643: * Returns a copy of this year-month minus the specified number of months.
644: *

645: * This year-month instance is immutable and unaffected by this method call.
646: *

647: * The following three lines are identical in effect:
648: *

649: * YearMonth subtracted = ym.minusMonths(6);
650: * YearMonth subtracted = ym.minus(Period.months(6));
651: * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6);
652: *

653: *
654: * @param months the amount of months to subtract, may be negative
655: * @return the new year-month minus the increased months, never null
656: */
657: public YearMonth minusMonths(int months) {
658: return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months));
659: }
660:
661: //-----------------------------------------------------------------------
662: /**
663: * Converts this object to a LocalDate with the same year-month and chronology.
664: *
665: * @param dayOfMonth the day of month to use, valid for chronology, such as 1-31 for ISO
666: * @return a LocalDate with the same year-month and chronology, never null
667: */
668: public LocalDate toLocalDate(int dayOfMonth) {
669: return new LocalDate(getYear(), getMonthOfYear(), dayOfMonth, getChronology());
670: }
671:
672: //-----------------------------------------------------------------------
673: /**
674: * Converts this object to an Interval representing the whole month.
675: *

676: * The interval will use the chronology of the year-month in the default zone.
677: *

678: * This instance is immutable and unaffected by this method call.
679: *
680: * @return an interval over the month, never null
681: */
682: public Interval toInterval() {
683: return toInterval(null);
684: }
685:
686: /**
687: * Converts this object to an Interval representing the whole month.
688: *

689: * The interval will use the chronology of the year-month in the specified zone.
690: *

691: * This instance is immutable and unaffected by this method call.
692: *
693: * @param zone the zone to get the Interval in, null means default
694: * @return an interval over the month, never null
695: */
696: public Interval toInterval(DateTimeZone zone) {
697: zone = DateTimeUtils.getZone(zone);
698: DateTime start = toLocalDate(1).toDateTimeAtStartOfDay(zone);
699: DateTime end = plusMonths(1).toLocalDate(1).toDateTimeAtStartOfDay(zone);
700: return new Interval(start, end);
701: }
702:
703: //-----------------------------------------------------------------------
704: /**
705: * Get the year field value.
706: *
707: * @return the year
708: */
709: public int getYear() {
710: return getValue(YEAR);
711: }
712:
713: /**
714: * Get the month of year field value.
715: *
716: * @return the month of year
717: */
718: public int getMonthOfYear() {
719: return getValue(MONTH_OF_YEAR);
720: }
721:
722: //-----------------------------------------------------------------------
723: /**
724: * Returns a copy of this year-month with the year field updated.
725: *

726: * YearMonth is immutable, so there are no set methods.
727: * Instead, this method returns a new instance with the value of
728: * year changed.
729: *
730: * @param year the year to set
731: * @return a copy of this object with the field set, never null
732: * @throws IllegalArgumentException if the value is invalid
733: */
734: public YearMonth withYear(int year) {
735: int[] newValues = getValues();
736: newValues = getChronology().year().set(this, YEAR, newValues, year);
737: return new YearMonth(this, newValues);
738: }
739:
740: /**
741: * Returns a copy of this year-month with the month of year field updated.
742: *

743: * YearMonth is immutable, so there are no set methods.
744: * Instead, this method returns a new instance with the value of
745: * month of year changed.
746: *
747: * @param monthOfYear the month of year to set
748: * @return a copy of this object with the field set, never null
749: * @throws IllegalArgumentException if the value is invalid
750: */
751: public YearMonth withMonthOfYear(int monthOfYear) {
752: int[] newValues = getValues();
753: newValues = getChronology().monthOfYear().set(this, MONTH_OF_YEAR, newValues, monthOfYear);
754: return new YearMonth(this, newValues);
755: }
756:
757: //-----------------------------------------------------------------------
758: /**
759: * Gets the property object for the specified type, which contains
760: * many useful methods.
761: *
762: * @param type the field type to get the property for
763: * @return the property object
764: * @throws IllegalArgumentException if the field is null or unsupported
765: */
766: public Property property(DateTimeFieldType type) {
767: return new Property(this, indexOfSupported(type));
768: }
769:
770: //-----------------------------------------------------------------------
771: /**
772: * Get the year field property which provides access to advanced functionality.
773: *
774: * @return the year property
775: */
776: public Property year() {
777: return new Property(this, YEAR);
778: }
779:
780: /**
781: * Get the month of year field property which provides access to advanced functionality.
782: *
783: * @return the month of year property
784: */
785: public Property monthOfYear() {
786: return new Property(this, MONTH_OF_YEAR);
787: }
788:
789: //-----------------------------------------------------------------------
790: /**
791: * Output the year-month in ISO8601 format (yyyy-MM).
792: *
793: * @return ISO8601 time formatted string.
794: */
795: @ToString
796: public String toString() {
797: return ISODateTimeFormat.yearMonth().print(this);
798: }
799:
800: /**
801: * Output the year-month using the specified format pattern.
802: *
803: * @param pattern the pattern specification, null means use toString
804: * @see org.joda.time.format.DateTimeFormat
805: */
806: public String toString(String pattern) {
807: if (pattern == null) {
808: return toString();
809: }
810: return DateTimeFormat.forPattern(pattern).print(this);
811: }
812:
813: /**
814: * Output the year-month using the specified format pattern.
815: *
816: * @param pattern the pattern specification, null means use toString
817: * @param locale Locale to use, null means default
818: * @see org.joda.time.format.DateTimeFormat
819: */
820: public String toString(String pattern, Locale locale) throws IllegalArgumentException {
821: if (pattern == null) {
822: return toString();
823: }
824: return DateTimeFormat.forPattern(pattern).withLocale(locale).print(this);
825: }
826:
827: //-----------------------------------------------------------------------
828: /**
829: * The property class for YearMonth.
830: *

831: * This class binds a YearMonth to a DateTimeField.
832: *
833: * @author Stephen Colebourne
834: * @since 2.0
835: */
836: public static class Property extends AbstractPartialFieldProperty implements Serializable {
837:
838: /** Serialization version */
839: private static final long serialVersionUID =<PHONE_NUMBER>190224363L;
840:
841: /** The partial */
842: private final YearMonth iBase;
843: /** The field index */
844: private final int iFieldIndex;
845:
846: /**
847: * Constructs a property.
848: *
849: * @param partial the partial instance
850: * @param fieldIndex the index in the partial
851: */
852: Property(YearMonth partial, int fieldIndex) {
853: super();
854: iBase = partial;
855: iFieldIndex = fieldIndex;
856: }
857:
858: /**
859: * Gets the field that this property uses.
860: *
861: * @return the field
862: */
863: public DateTimeField getField() {
864: return iBase.getField(iFieldIndex);
865: }
866:
867: /**
868: * Gets the partial that this property belongs to.
869: *
870: * @return the partial
871: */
872: protected ReadablePartial getReadablePartial() {
873: return iBase;
874: }
875:
876: /**
877: * Gets the partial that this property belongs to.
878: *
879: * @return the partial
880: */
881: public YearMonth getYearMonth() {
882: return iBase;
883: }
884:
885: /**
886: * Gets the value of this field.
887: *
888: * @return the field value
889: */
890: public int get() {
891: return iBase.getValue(iFieldIndex);
892: }
893:
894: //-----------------------------------------------------------------------
895: /**
896: * Adds to the value of this field in a copy of this YearMonth.
897: *

898: * The value will be added to this field. If the value is too large to be
899: * added solely to this field then it will affect larger fields.
900: * Smaller fields are unaffected.
901: *

902: * If the result would be too large, beyond the maximum year, then an
903: * IllegalArgumentException is thrown.
904: *

905: * The YearMonth attached to this property is unchanged by this call.
906: * Instead, a new instance is returned.
907: *
908: * @param valueToAdd the value to add to the field in the copy
909: * @return a copy of the YearMonth with the field value changed
910: * @throws IllegalArgumentException if the value isn't valid
911: */
912: public YearMonth addToCopy(int valueToAdd) {
913: int[] newValues = iBase.getValues();
914: newValues = getField().add(iBase, iFieldIndex, newValues, valueToAdd);
915: return new YearMonth(iBase, newValues);
916: }
917:
918: /**
919: * Adds to the value of this field in a copy of this YearMonth wrapping
920: * within this field if the maximum value is reached.
921: *

922: * The value will be added to this field. If the value is too large to be
923: * added solely to this field then it wraps within this field.
924: * Other fields are unaffected.
925: *

926: * For example,
927: * 2004-12 addWrapField one month returns 2004-01.
928: *

929: * The YearMonth attached to this property is unchanged by this call.
930: * Instead, a new instance is returned.
931: *
932: * @param valueToAdd the value to add to the field in the copy
933: * @return a copy of the YearMonth with the field value changed
934: * @throws IllegalArgumentException if the value isn't valid
935: */
936: public YearMonth addWrapFieldToCopy(int valueToAdd) {
937: int[] newValues = iBase.getValues();
938: newValues = getField().addWrapField(iBase, iFieldIndex, newValues, valueToAdd);
939: return new YearMonth(iBase, newValues);
940: }
941:
942: //-----------------------------------------------------------------------
943: /**
944: * Sets this field in a copy of the YearMonth.
945: *

946: * The YearMonth attached to this property is unchanged by this call.
947: * Instead, a new instance is returned.
948: *
949: * @param value the value to set the field in the copy to
950: * @return a copy of the YearMonth with the field value changed
951: * @throws IllegalArgumentException if the value isn't valid
952: */
953: public YearMonth setCopy(int value) {
954: int[] newValues = iBase.getValues();
955: newValues = getField().set(iBase, iFieldIndex, newValues, value);
956: return new YearMonth(iBase, newValues);
957: }
958:
959: /**
960: * Sets this field in a copy of the YearMonth to a parsed text value.
961: *

962: * The YearMonth attached to this property is unchanged by this call.
963: * Instead, a new instance is returned.
964: *
965: * @param text the text value to set
966: * @param locale optional locale to use for selecting a text symbol
967: * @return a copy of the YearMonth with the field value changed
968: * @throws IllegalArgumentException if the text value isn't valid
969: */
970: public YearMonth setCopy(String text, Locale locale) {
971: int[] newValues = iBase.getValues();
972: newValues = getField().set(iBase, iFieldIndex, newValues, text, locale);
973: return new YearMonth(iBase, newValues);
974: }
975:
976: /**
977: * Sets this field in a copy of the YearMonth to a parsed text value.
978: *

979: * The YearMonth attached to this property is unchanged by this call.
980: * Instead, a new instance is returned.
981: *
982: * @param text the text value to set
983: * @return a copy of the YearMonth with the field value changed
984: * @throws IllegalArgumentException if the text value isn't valid
985: */
986: public YearMonth setCopy(String text) {
987: return setCopy(text, null);
988: }
989: }
990:
991: }
| ID | Line | Type | Detected |
|---|
| 9956 | 108 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 9957 | 124 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 9958 | 141 | Remove method call | |
| 9959 | 141(1) | Remove method call | |
| 9960 | 152 | Remove method call | |
| 9961 | 153 | Remove method call | |
| 9962 | 153(1) | Remove method call | |
| 9963 | 174 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 9964 | 177 | Replace a constant (Replace 1 with 2(INT)) | |
| 9965 | 177 | Replace a constant (Replace 1 with 0(INT)) | |
| 9968 | 177(1) | Replace a constant (Replace 2 with 1(INT)) | |
| 9967 | 177(1) | Replace a constant (Replace 2 with 3(INT)) | |
| 9969 | 177(1) | Replace a constant (Replace 2 with 0(INT)) | |
| 9972 | 177(2) | Replace a constant (Replace 1 with 0(INT)) | |
| 9971 | 177(2) | Replace a constant (Replace 1 with 2(INT)) | |
| 9973 | 177 | Replace arithmetic operator (Replace IADD with ISUB) | |
| 9966 | 177 | Remove method call | |
| 9970 | 177(1) | Remove method call | |
| 9974 | 195 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 9977 | 198 | Replace a constant (Replace 1900 with 1899(INT)) | |
| 9976 | 198 | Replace a constant (Replace 1900 with 0(INT)) | |
| 9978 | 198 | Replace a constant (Replace 1900 with 1901(INT)) | |
| 9982 | 198(1) | Replace a constant (Replace 1 with 0(INT)) | |
| 9981 | 198(1) | Replace a constant (Replace 1 with 2(INT)) | |
| 9979 | 198 | Replace arithmetic operator (Replace IADD with ISUB) | |
| 9983 | 198(1) | Replace arithmetic operator (Replace IADD with ISUB) | |
| 9975 | 198 | Remove method call | |
| 9980 | 198(1) | Remove method call | |
| 9986 | 344 | Replace a constant (Replace 2 with 0(INT)) | |
| 9984 | 344 | Replace a constant (Replace 2 with 3(INT)) | |
| 9985 | 344 | Replace a constant (Replace 2 with 1(INT)) | |
| 9988 | 344(1) | Replace a constant (Replace 0 with -1(INT)) | |
| 9987 | 344(1) | Replace a constant (Replace 0 with 1(INT)) | |
| 9990 | 344(2) | Replace a constant (Replace 1 with 0(INT)) | |
| 9989 | 344(2) | Replace a constant (Replace 1 with 2(INT)) | |
| 9994 | 372 | Negate jump condition (Replace IFNE with IFEQ) | |
| 9991 | 372 | Remove method call | |
| 9992 | 372(1) | Remove method call | |
| 9993 | 372(2) | Remove method call | |
| 9995 | 373 | Remove method call | |
| 9996 | 373(1) | Remove method call | |
| 9999 | 387 | Replace a constant (Replace 2 with 0(INT)) | |
| 9998 | 387 | Replace a constant (Replace 2 with 1(INT)) | |
| 9997 | 387 | Replace a constant (Replace 2 with 3(INT)) | |
| 10000 | 402 | Remove method call | |
| 10001 | 404 | Remove method call | |
| 10002 | 406 | Remove method call | |
| 10003 | 406(1) | Remove method call | |
| 10004 | 406(2) | Remove method call | |
| 10005 | 429 | Remove method call | |
| 10006 | 448 | Remove method call | |
| 10007 | 449 | Remove method call | |
| 10009 | 450 | Negate jump condition (Replace IF_ACMPNE with IF_ACMPEQ) | |
| 10008 | 450 | Remove method call | |
| 10010 | 454 | Remove method call | |
| 10011 | 454(1) | Remove method call | |
| 10012 | 478 | Remove method call | |
| 10014 | 479 | Negate jump condition (Replace IF_ICMPNE with IF_ICMPEQ) | |
| 10013 | 479 | Remove method call | |
| 10015 | 482 | Remove method call | |
| 10016 | 483 | Remove method call | |
| 10017 | 483(1) | Remove method call | |
| 10018 | 506 | Remove method call | |
| 10019 | 507 | Negate jump condition (Replace IFNE with IFEQ) | |
| 10020 | 510 | Remove method call | |
| 10021 | 511 | Remove method call | |
| 10022 | 511(1) | Remove method call | |
| 10023 | 532 | Negate jump condition (Replace IFNULL with IFNONNULL) | |
| 10024 | 532(1) | Negate jump condition (Replace IFNE with IFEQ) | |
| 10025 | 535 | Remove method call | |
| 10026 | 536 | Replace a constant (Replace 0 with 1(INT)) | |
| 10027 | 536 | Replace a constant (Replace 0 with -1(INT)) | |
| 10029 | 536 | Negate jump condition (Replace IF_ICMPGE with IF_ICMPLT) | |
| 10028 | 536 | Remove method call | |
| 10030 | 537 | Remove method call | |
| 10031 | 538 | Remove method call | |
| 10032 | 539 | Negate jump condition (Replace IFLT with IFGE) | |
| 10033 | 540 | Remove method call | |
| 10034 | 540(1) | Remove method call | |
| 10035 | 540(2) | Remove method call | |
| 10036 | 540(3) | Remove method call | |
| 10037 | 562 | Replace a constant (Replace 1 with 2(INT)) | |
| 10038 | 562 | Replace a constant (Replace 1 with 0(INT)) | |
| 10039 | 562 | Remove method call | |
| 10040 | 582 | Remove method call | |
| 10041 | 582(1) | Remove method call | |
| 10042 | 601 | Remove method call | |
| 10043 | 601(1) | Remove method call | |
| 10044 | 619 | Replace a constant (Replace -1 with 0(INT)) | |
| 10045 | 619 | Replace a constant (Replace -1 with -2(INT)) | |
| 10046 | 619 | Remove method call | |
| 10047 | 639 | Remove method call | |
| 10048 | 639(1) | Remove method call | |
| 10049 | 639(2) | Remove method call | |
| 10050 | 658 | Remove method call | |
| 10051 | 658(1) | Remove method call | |
| 10052 | 658(2) | Remove method call | |
| 10053 | 669 | Remove method call | |
| 10054 | 669(1) | Remove method call | |
| 10055 | 669(2) | Remove method call | |
| 10056 | 683 | Remove method call | |
| 10057 | 697 | Remove method call | |
| 10058 | 698 | Replace a constant (Replace 1 with 2(INT)) | |
| 10059 | 698 | Replace a constant (Replace 1 with 0(INT)) | |
| 10060 | 698 | Remove method call | |
| 10061 | 698(1) | Remove method call | |
| 10062 | 699 | Replace a constant (Replace 1 with 2(INT)) | |
| 10063 | 699 | Replace a constant (Replace 1 with 0(INT)) | |
| 10065 | 699(1) | Replace a constant (Replace 1 with 2(INT)) | |
| 10066 | 699(1) | Replace a constant (Replace 1 with 0(INT)) | |
| 10064 | 699 | Remove method call | |
| 10067 | 699(1) | Remove method call | |
| 10068 | 699(2) | Remove method call | |
| 10069 | 710 | Replace a constant (Replace 0 with 1(INT)) | |
| 10070 | 710 | Replace a constant (Replace 0 with -1(INT)) | |
| 10071 | 710 | Remove method call | |
| 10073 | 719 | Replace a constant (Replace 1 with 0(INT)) | |
| 10072 | 719 | Replace a constant (Replace 1 with 2(INT)) | |
| 10074 | 719 | Remove method call | |
| 10075 | 735 | Remove method call | |
| 10078 | 736 | Replace a constant (Replace 0 with 1(INT)) | |
| 10079 | 736 | Replace a constant (Replace 0 with -1(INT)) | |
| 10076 | 736 | Remove method call | |
| 10077 | 736(1) | Remove method call | |
| 10080 | 736(2) | Remove method call | |
| 10081 | 752 | Remove method call | |
| 10084 | 753 | Replace a constant (Replace 1 with 2(INT)) | |
| 10085 | 753 | Replace a constant (Replace 1 with 0(INT)) | |
| 10082 | 753 | Remove method call | |
| 10083 | 753(1) | Remove method call | |
| 10086 | 753(2) | Remove method call | |
| 10087 | 767 | Remove method call | |
| 10089 | 777 | Replace a constant (Replace 0 with -1(INT)) | |
| 10088 | 777 | Replace a constant (Replace 0 with 1(INT)) | |
| 10091 | 786 | Replace a constant (Replace 1 with 0(INT)) | |
| 10090 | 786 | Replace a constant (Replace 1 with 2(INT)) | |
| 10092 | 797 | Remove method call | |
| 10093 | 797(1) | Remove method call | |
| 10094 | 807 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 10095 | 808 | Remove method call | |
| 10096 | 810 | Remove method call | |
| 10097 | 810(1) | Remove method call | |
| 10098 | 821 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 10099 | 822 | Remove method call | |
| 10100 | 824 | Remove method call | |
| 10101 | 824(1) | Remove method call | |
| 10102 | 824(2) | Remove method call | |
| 21984 | 864 | Remove method call | |
| 21985 | 891 | Remove method call | |
| 21986 | 913 | Remove method call | |
| 21987 | 914 | Remove method call | |
| 21988 | 914(1) | Remove method call | |
| 21989 | 937 | Remove method call | |
| 21990 | 938 | Remove method call | |
| 21991 | 938(1) | Remove method call | |
| 21992 | 954 | Remove method call | |
| 21993 | 955 | Remove method call | |
| 21994 | 955(1) | Remove method call | |
| 21995 | 971 | Remove method call | |
| 21996 | 972 | Remove method call | |
| 21997 | 972(1) | Remove method call | |
| 21998 | 987 | Remove method call | |


Definition 6.2.3. Credit Score.
A credit score is a number, used in the United States and a number of other countries, which assigns a number (between 300 and 850) to a person's credit risk. Higher numbers indicate lower risk.
A credit score is a number, used in the United States and a number of other countries, which assigns a number (between 300 and 850) to a person's credit risk. Higher numbers indicate lower risk.


pymatgen.analysis.defects.utils module¶
-
class
ChargeDensityAnalyzer
(chgcar)[source]¶ Bases:
object
Analyzer to find potential interstitial sites based on charge density. The total charge density is used.
Initialization.
Parameters: chgcar (pmg.Chgcar) – input Chgcar object. -
charge_distribution_df
¶
-
cluster_nodes
(tol=0.2)[source]¶ Cluster nodes that are too close together using a tol.
Parameters: tol (float) – A distance tolerance. PBC is taken into account.
-
extrema_df
¶
-
get_local_extrema
(find_min=True, threshold_frac=None, threshold_abs=None)[source]¶ Get all local extrema fractional coordinates in charge density, searching for local minimum by default. Note that sites are NOT grouped symmetrically.
Parameters: - find_min (bool) – True to find local minimum else maximum, otherwise find local maximum.
- threshold_frac (float) –
optional fraction of extrema shown, which returns threshold_frac * tot_num_extrema extrema fractional coordinates based on highest/lowest intensity.
E.g. set 0.2 to show the extrema with 20% highest or lowest intensity. Value range: 0 <= threshold_frac <= 1
Note that threshold_abs and threshold_frac should not set in the same time.
- threshold_abs (float) –
optional filter. When searching for local minima, intensity <= threshold_abs returns; when searching for local maxima, intensity >= threshold_abs returns.
Note that threshold_abs and threshold_frac should not set in the same time.
Returns: - list of fractional coordinates corresponding
to local extrema.
Return type: extrema_coords (list)
-
get_structure_with_nodes
(find_min=True, min_dist=0.5, tol=0.2, threshold_frac=None, threshold_abs=None)[source]¶ Get the modified structure with the possible interstitial sites added. The species is set as a DummySpecie X.
Parameters: - find_min (bool) – True to find local minimum else maximum, otherwise find local maximum.
- min_dist (float) – The minimum distance (in Angstrom) that a predicted site needs to be from existing atoms. A min_dist with value <= 0 returns all sites without distance checking.
- tol (float) – A distance tolerance of nodes clustering that sites too closed to other predicted sites will be merged. PBC is taken into account.
- threshold_frac (float) –
optional fraction of extrema, which returns threshold_frac * tot_num_extrema extrema fractional coordinates based on highest/lowest intensity.
E.g. set 0.2 to insert DummySpecie atom at the extrema with 20% highest or lowest intensity. Value range: 0 <= threshold_frac <= 1
Note that threshold_abs and threshold_frac should not set in the same time.
- threshold_abs (float) –
optional filter. When searching for local minima, intensity <= threshold_abs returns; when searching for local maxima, intensity >= threshold_abs returns.
Note that threshold_abs and threshold_frac should not set in the same time.
Returns: structure (Structure)
-
remove_collisions
(min_dist=0.5)[source]¶ Remove predicted sites that are too close to existing atoms in the structure.
Parameters: min_dist (float) – The minimum distance (in Angstrom) that a predicted site needs to be from existing atoms. A min_dist with value <= 0 returns all sites without distance checking.
-
-
class
QModel
(beta=1.0, expnorm=0.0, gamma=1.0)[source]¶ Bases:
monty.json.MSONable
Model for the defect charge distribution. A combination of exponential tail and gaussian distribution is used (see Freysoldt (2011), DOI: 10.1002/pssb.201046289 ) q_model(r) = q [x exp(-r/gamma) + (1-x) exp(-r^2/beta^2)]
without normalization constantsBy default, gaussian distribution with 1 Bohr width is assumed. If defect charge is more delocalized, exponential tail is suggested.
Parameters: - beta – Gaussian decay constant. Default value is 1 Bohr. When delocalized (eg. diamond), 2 Bohr is more appropriate.
- expnorm – Weight for the exponential tail in the range of [0-1]. Default is 0.0 indicating no tail . For delocalized charges ideal value is around 0.54-0.6.
- gamma – Exponential decay constant
-
rho_rec
(g2)[source]¶ Reciprocal space model charge value for input squared reciprocal vector. :param g2: Square of reciprocal vector
Returns: Charge density at the reciprocal vector magnitude
-
rho_rec_limit0
¶ Reciprocal space model charge value close to reciprocal vector 0 . rho_rec(g->0) -> 1 + rho_rec_limit0 * g^2
-
class
StructureMotifInterstitial
(struct, inter_elem, motif_types=('tetrahedral', 'octahedral'), op_threshs=(0.3, 0.5), dl=0.2, doverlap=1, facmaxdl=1.01, verbose=False)[source]¶ Bases:
object
Generate interstitial sites at positions where the interstitialcy is coordinated by nearest neighbors in a way that resembles basic structure motifs (e.g., tetrahedra, octahedra). The algorithm is called InFiT (Interstitialcy Finding Tool), it was introducted by Nils E. R. Zimmermann, Matthew K. Horton, Anubhav Jain, and Maciej Haranczyk (Front. Mater., 4, 34, 2017), and it is used by the Python Charged Defect Toolkit (PyCDT: D. Broberg et al., Comput. Phys. Commun., in press, 2018).
Generates symmetrically distinct interstitial sites at positions where the interstitial is coordinated by nearest neighbors in a pattern that resembles a supported structure motif (e.g., tetrahedra, octahedra).
Parameters: - struct (Structure) – input structure for which symmetrically distinct interstitial sites are to be found.
- inter_elem (string) – element symbol of desired interstitial.
- motif_types ([string]) – list of structure motif types that are to be considered. Permissible types are: tet (tetrahedron), oct (octahedron).
- op_threshs ([float]) – threshold values for the underlying order parameters to still recognize a given structural motif (i.e., for an OP value >= threshold the coordination pattern match is positive, for OP < threshold the match is negative.
- dl (float) – grid fineness in Angstrom. The input structure is divided into a grid of dimension a/dl x b/dl x c/dl along the three crystallographic directions, with a, b, and c being the lengths of the three lattice vectors of the input unit cell.
- doverlap (float) – distance that is considered to flag an overlap between any trial interstitial site and a host atom.
- facmaxdl (float) – factor to be multiplied with the maximum grid width that is then used as a cutoff distance for the clustering prune step.
- verbose (bool) – flag indicating whether (True) or not (False; default) to print additional information to screen.
-
enumerate_defectsites
()[source]¶ Get all defect sites.
Returns: - list of periodic sites
- representing the interstitials.
Return type: defect_sites ([PeriodicSite])
-
get_coordinating_elements_cns
(i)[source]¶ Get element-specific coordination numbers of defect with index i.
Returns: - dictionary storing the coordination numbers (int)
- with string representation of elements as keys. (i.e., {elem1 (string): cn1 (int), …}).
Return type: elem_cn (dict)
-
get_defectsite_multiplicity
(n)[source]¶ Returns the symmtric multiplicity of the defect site at the index.
-
get_motif_type
(i)[source]¶ Get the motif type of defect with index i (e.g., “tet”).
Returns: motif type. Return type: motif (string)
-
get_op_value
(i)[source]¶ Get order-parameter value of defect with index i.
Returns: OP value. Return type: opval (float)
-
make_supercells_with_defects
(scaling_matrix)[source]¶ Generate a sequence of supercells in which each supercell contains a single interstitial, except for the first supercell in the sequence which is a copy of the defect-free input structure.
Parameters: scaling_matrix (3x3 integer array) – scaling matrix to transform the lattice vectors. Returns: sequence of supercells. Return type: scs ([Structure])
-
class
TopographyAnalyzer
(structure, framework_ions, cations, tol=0.0001, max_cell_range=1, check_volume=True, constrained_c_frac=0.5, thickness=0.5)[source]¶ Bases:
object
This is a generalized module to perform topological analyses of a crystal structure using Voronoi tessellations. It can be used for finding potential interstitial sites. Applications including using these sites for inserting additional atoms or for analyzing diffusion pathways.
Note that you typically want to do some preliminary postprocessing after the initial construction. The initial construction will create a lot of points, especially for determining potential insertion sites. Some helper methods are available to perform aggregation and elimination of nodes. A typical use is something like:
a = TopographyAnalyzer(structure, ["O"], ["P"]) a.cluster_nodes() a.remove_collisions()
Init.
Parameters: - structure (Structure) – An initial structure.
- framework_ions ([str]) – A list of ions to be considered as a framework. Typically, this would be all anion species. E.g., [“O”, “S”].
- cations ([str]) – A list of ions to be considered as non-migrating cations. E.g., if you are looking at Li3PS4 as a Li conductor, Li is a mobile species. Your cations should be [ “P”]. The cations are used to exclude polyhedra from diffusion analysis since those polyhedra are already occupied.
- tol (float) – A tolerance distance for the analysis, used to determine if something are actually periodic boundary images of each other. Default is usually fine.
- max_cell_range (int) – This is the range of periodic images to construct the Voronoi tesselation. A value of 1 means that we include all points from (x +- 1, y +- 1, z+- 1) in the voronoi construction. This is because the Voronoi poly extends beyond the standard unit cell because of PBC. Typically, the default value of 1 works fine for most structures and is fast. But for really small unit cells with high symmetry, you may need to increase this to 2 or higher.
- check_volume (bool) – Set False when ValueError always happen after tuning tolerance.
- constrained_c_frac (float) – Constraint the region where users want to do Topology analysis the default value is 0.5, which is the fractional coordinate of the cell
- thickness (float) – Along with constrained_c_frac, limit the thickness of the regions where we want to explore. Default is 0.5, which is mapping all the site of the unit cell.
-
cluster_nodes
(tol=0.2)[source]¶ Cluster nodes that are too close together using a tol.
Parameters: tol (float) – A distance tolerance. PBC is taken into account.
-
get_structure_with_nodes
()[source]¶ Get the modified structure with the voronoi nodes inserted. The species is set as a DummySpecie X.
-
class
VoronoiPolyhedron
(lattice, frac_coords, polyhedron_indices, all_coords, name=None)[source]¶ Bases:
object
Convenience container for a voronoi point in PBC and its associated polyhedron.
-
coordination
¶
-
volume
¶
-
-
closestsites
(struct_blk, struct_def, pos)[source]¶ Returns closest site to the input position for both bulk and defect structures :param struct_blk: Bulk structure :param struct_def: Defect structure :param pos: Position
Return: (site object, dist, index)
-
eV_to_k
(energy)[source]¶ Convert energy to reciprocal vector magnitude k via hbar*k^2/2m :param a: Energy in eV.
Returns: (double) Reciprocal vector magnitude (units of 1/Bohr).
-
generate_reciprocal_vectors_squared
(a1, a2, a3, encut)[source]¶ Generate reciprocal vector magnitudes within the cutoff along the specied lattice vectors. :param a1: Lattice vector a (in Bohrs) :param a2: Lattice vector b (in Bohrs) :param a3: Lattice vector c (in Bohrs) :param encut: Reciprocal vector energy cutoff
Returns: [[g1^2], [g2^2], …] Square of reciprocal vectors (1/Bohr)^2 determined by a1, a2, a3 and whose magntidue is less than gcut^2.


{% extends "site_base.html" %} {% load i18n %} {% block head_title %}Feral Cat Tracker{% endblock %} {% block body_class %}home{% endblock %} {% block body_base %} {% block content %} Feral Cat Tracker::Colonies::{{ catcolony.colony_name }} Back to Colonies This is the Colony that holds all cats not associated with a real colony Member Cats: {% for cat in cats %} {{ cat.cat_name }} {% endfor %} {% endblock %} {% endblock %}
This is the Colony that holds all cats not associated with a real colony


Copyright © {{ site.time | date: "%Y" }} - {{ site.author.name }}
Blog content licensed under the Creative Commons CC BY 4.0
| Unless otherwise stated or granted, code samples licensed under the MIT license.
| Site design based on the Hyde theme under the MIT license


Flink Forward 2016: Announcing Schedule, Keynotes, and Panel Discussion
August 24, 2016 -An update for the Flink community: the Flink Forward 2016 schedule is now available online. This year's event will include 2 days of talks from stream processing experts at Google, MapR, Alibaba, Netflix, Cloudera, and more. Following the talks is a full day of hands-on Flink training.
Ted Dunning has been announced as a keynote speaker at the event. Ted is the VP of Incubator at Apache Software Foundation, the Chief Application Architect at MapR Technologies, and a mentor on many recent projects. He'll present "How Can We Take Flink Forward?" on the second day of the conference.
Following Ted's keynote there will be a panel discussion on "Large Scale Streaming in Production". As stream processing systems become more mainstream, companies are looking to empower their users to take advantage of this technology. We welcome leading stream processing experts Xiaowei Jiang (Alibaba), Monal Daxini (Netflix), Maxim Fateev (Uber), and Ted Dunning (MapR Technologies) on stage to talk about the challenges they have faced and the solutions they have discovered while implementing stream processing systems at very large scale. The panel will be moderated by Jamie Grier (data Artisans).
The welcome keynote on Monday, September 12, will be presented by data Artisans' co-founders Kostas Tzoumas and Stephan Ewen. They will talk about "The maturing data streaming ecosystem and Apache Flink’s accelerated growth". In this talk, Kostas and Stephan discuss several large-scale stream processing use cases that the data Artisans team has seen over the past year.
And one more recent addition to the program: Maxim Fateev of Uber will present "Beyond the Watermark: On-Demand Backfilling in Flink". Flink’s time-progress model is built around a single watermark, which is incompatible with Uber’s business need for generating aggregates retroactively. Maxim's talk covers Uber's solution for on-demand backfilling.
We hope to see many community members at Flink Forward 2016. Registration is available online: flink-forward.org/registration


Changelog
[+] Added [-] Deleted [^] Upgraded [#] Fixed
Handy Menu v0.0.1 (13 Jul 2015)
0.0.1 (pre-alpha)
- Plugin for replacing browsers native contextual menu with customizable Handy Menu
- Project Setup
- Basic features
- Menu Icons
- Menu Description
- Active/inactive menu items
- Hide/show menu items
- Dividers and Menu group title
- RTL support


AppleInsider.com Privacy Policy and Affiliate Link Disclosure
Internet user privacy is of paramount importance to AppleInsider.com and its related sites. The success of our business depends upon our ability to maintain the trust of our users. Below is information regarding AppleInsider's commitment to protect the privacy of users and to ensure the integrity of the internet.
User Information
During your visit to the site, AppleInsider may collect your browser type and the IP address that your ISP designates to your machine (which, usually changes periodically depending on your type of internet connection) in order to statistically evaluate how we can design the site to best serve your needs. Any additional information may be specifically volunteered when you create an account through the AppleInsider discussion forums or article comment system. However, even then, AppleInsider does not use that stored information for any purpose other than to allow you to log in and post messages.
Cookies
Along with countless other websites, AppleInsider uses cookies to enhance your experience. Cookies are used in the AppleInsider discussion forums to keep track of which messages have been posted since your last visit, enhancing the navigation of the forums. Cookies can also store your username and password so that you do not have to log in each time you want to post a message or comment on an article, though you must specifically request that this feature be turned on. Other user settings such as preferred site display options are also managed by cookies.
Cookie data is not stored on the server, and therefore, not available for viewing by AppleInsider staff. However, it is possible that security flaws exist in some browsers that would allow other site administrators to write malicious scripts that would collect this data without AppleInsider's knowledge, though this is quite unlikely.
When shopping through AppleInsider's Price Guides or through third-party links in posts, the corresponding merchant, website, or network may use cookies. Please refer to that specific site's privacy policy for more information.
If you would like to opt-out of Non Personally Identifiable Information (PII) cookie tracking, please visit the NAI opt-out page here:
http://www.networkadvertising.org/choices/.
Affiliate Link Disclosure
Posts on AppleInsider.com and the corresponding Price Guides (prices.appleinsider.com) may include affiliate links, meaning AppleInsider may earn commission on purchases made through those links.
Any commissions received as a result of AppleInsider's promotional efforts will not impact opinions on a product. If, through research and/or use, a product proves to be of benefit to the end-user, we will promote it. If not, we do not offer it.
Affiliate referrals may utilize cookies, which are subject to the privacy policy of the corresponding merchant and/or affiliate network.
Third-party Service Providers
A portion of the advertisements displayed on the AppleInsider Network are served by third-party advertisement providers, including Oath, Adblade, Conversant Media, Datonics, Exponential Interactive and Google. These companies may use information about your visits to this and other websites in order to provide advertisements on this site and other sites about goods and services that may be of interest to you.
Exponential Interactive, Inc, as our partner, have a legitimate interest to collect and profile personal data in the form of IP address and cookie ID from users on our website in order to provide targeted online advertising and ad measurement. For more details including opt-out requests, access requests or complaints, please review their
privacy policy or contact their data protection officer via
<EMAIL_ADDRESS>AppleInsider also periodically hosts product giveaways powered by Gleam or Rafflecopter. By entering the giveaway, participants agree to Gleam's privacy policy located here:
https://gleam.io/privacy and Rafflecopter's Privacy Policy located here:
http://www.rafflecopter.com/rafl/privacy/. No purchase is necessary to enter a giveaway hosted on AppleInsider.com. Giveaways are open to U.S. residents only.
Please visit the National Advertising Initiative's opt-out management page for further information or to opt-out of behavioral advertising from many providers.
We are committed to continuing to protect the privacy of our readers. If you have any additional questions, please contact us at<EMAIL_ADDRESS>We recommend that you review this Privacy Statement / Affiliate Link Disclosure periodically, as AppleInsider may update it from time to time without notice to its users.
This page was last updated on May 25, 2018.


I obtained a 100mg baggie of 2c-d from a online vendor literally a week before the huge RC bust happened. I did not have a milligram scale but I wanted to try a RC just because I am up for trying pretty much anything once. Previous experience w/ pyscadelics include good expereince with shrooms and salvia and a little experience with dxm, dramamine, and baby woodrose seeds (lsa). Of all of the different RC's I chose 2c-d because I do not have access to a milligram scale. Because the doses of 2c-d are substancially higher than other RC's, I thought that it would be a ok idea to eye out the dosage. How wrong I was.
I have no idea how much mg of powder was in the baggie to begin with.  I am guessing that the dosage that I eyed out was much more than the intended dosage (50mg) which means that the baggie had more than 100mg in it to begin with.
So my friend and I split a bag of what we thought was 100mg of 2c-d. we made 2 equal sized lines of the powder and then proceeded to put these lines into two different cups of water. we each drank a cup. it tasted awful... like chemical backwash. Our plan was to watch a movie and see where our minds took us. We pop in the DVD and begin watching it. The 2c-d was ingested on a empty stomach. 20 minutes later we both began to feel a weird type of nausea and knew we were coming up. However, unlike with other substances, there was no euphoria at all. the nausea would not go away.
Throught the whole trip the same chemical backwash taste was in my mouth. I could TELL that I was on a chemical drug. Unlike MDMA, another chemical drug, while rolling I do not get the slightest feeling that I am fucekd up on chemicals, it actually feels somewhat natural. While I was on 2c-d I felt like my whole body was being processed by a chemical waste company.
After I came up, I looked at my skin and like on many other psycadelics, I was getting patterns and shapes forming on it. My friend and I got bored of my house, still with an intense amount of nausea we decided to drive to a baseball field that is a few blocks away.
[Erowid Note: Driving while intoxicated or tripping is dangerous and irresponsible because it endangers other people. Don't do it!] Unlike on other psycadelics, I felt like I had total control of everything I did.  We got to the field and sat down on some bleachers. We looked at the ground and both commented on how the ground was 'cratering' before us... or turning into little craters. It was from here that stuff went for a awful turn for the worse...
that nausea that I was talking about never went away the whole trip. It stayed there and just intensified as I began to trip harder. However, the visuals went away. It was purly a mind trip. We were both tweaking out really bad.   I had no clue what was going on. The chemical was playing serious tricks with my brain. I was hearing things that werent there, thought everyone was looking at me, thought people were calling my name, and thought that everyone was out to kill me.
We left the mall 10 mins after we got in and just sat in the car and talked. We could only think of the worst. We were talking to each other about different good friends who we both shared and about how we hated them so much. The drug made us only think about the bad in everyone in the world.
Now came the weirdest part. My friend began to punch himself. He realized that he could punch himself as hard as he wanted and not feel a single thing. I then tried it myself. I punched myself in the upper leg. I relized I felt nothing at all. I then began absolutely whaling my chest and my legs. Not feeling a single thing. My friend began punching himself in the face repeatedly until I convinced him to stop. This was at the peak of our 2c-d experience.
It seemed to just get worse and worse and we both tried to fight it.  We needed to do something, anything, to escape this trip. We thus decided to smoke weed.
My friend and I at the time (and currently still are but not to the same degree) huge potheads. At the time of our 2c-d trip we had smoked every day for atleast 3 or 4 weeks probably more. We both loved weed and everything about it. Weed could not fail on us now. It had to make things better. My friend was not tweaking out as much as I was at this time so he only took 3-5 hits. I on the other hand smoked probably .7g to my head trying desperately to kill the confusion of 2c-d and 'get back to normal' which was high on weed for us.
And... it made stuff better. Weed had once again done me good. I have always relied on weed to get me out of sketchy drug situations.  While smoking a good deal of pot to my head in a short amount of time did not totally dissipate the effects of 2c-d, it made shit a ton better.
Just like on shrooms, smoking pot on 2c-d made the visuals come back again... not as intense as in the beginning of the trip but they were definetly noticable again. However, I was still thinking about the bad parts of everyone... even myself. We were just aimlessly driving around and we pulled into a supermarket parking lot because I had to go to the bathroom. I looked at myself in the mirror and all I can think about was how much of a druggie I had become and how I was absolutey destroying myself (even though the only drug I was doing in the past few months was pot and occasionally shrooms)... the mirror began transforming a little and changing shapes and I just merely sighed and went back into the car.... this was approximatly 4 hours after the 2c-d was initially injested.
After I left the supermarket, we both finally felt ourselves returning to normal. The peak of the drug was over. We drove around listening to music for the next hour, not really saying anything to one another. We finally got back to my house around 6 hours after we left... finally sober. My head ached and I was incredibly mellow and very pissed off about what just happened to me. Later that night I went to a party and got shitfaced just so I could forget about the events earlier in the day.
So whats the moral of this story? ALWAYS use a milligram scale when using RC's... Regardless of the RC. I thought that I would be fine eyeing out 2c-d because of the high dosage of it. I was very very wrong...
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


<canvas> elements named canvasInput1, canvasInput2 and canvasOutput have been prepared.
The code of <textarea> will be executed when <input> element named trackbar value changes.
You can change the code in the <textarea> to investigate more.


🎭 Arya's Art Manager 🎭
Wines Movies NPR Tiny Desks TV Shows Books GitHub ->
Working
Robert A. Caro
I devoured this book in one day. I literally can't
stop wanting to read Caro's prose.  In terms of lessons to takeaway, I think
his justification for conducting exhaustive research
was compelling, I think the way he writes is
interesting (condensing key ideas, outlining,
hand-writing, editing, typing), I also want to start
using his word count idea. I love the way he writes.
Like really, really love the way he writes.