public class RatingVector extends java.lang.Object implements Cloneable, TextParsable, java.io.Serializable
Rating
class contains following important information relevant to the event a user rates on an item
Rating.value
is a float number that a user rates on an item.Rating.ratedDate
. Of course it contains year, month, day, hour, minute, second, etc.Rating.contexts
. Context is additional information related to user's rating, for example, place that user makes a rating,
companion indicating the persons with whom user makes a rating such as alone, friends, girlfriend/boyfriend, family, co-workers. rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.
Note that rating does not specify user identification (user ID) and item identification (item ID). This aspect is very important, which derives two kinds of rating vector such as user rating vector and item rating vector.
If this class is user rating vector, it contains all ratings of the same user on many items and so the internal variable id
is user identification (user ID).
If this class is item rating vector, it contains all ratings of many users on the same item and so the internal variable id
is item identification (item ID).
As a convention, the internal variable id
is known as ID of rating vector.| Modifier and Type | Field and Description |
|---|---|
protected int |
id
If this class is user rating vector which contains all ratings of the same user on many items then, this internal variable is user identification (user ID).
|
protected java.util.Map<java.lang.Integer,Rating> |
ratedMap
This map contains all ratings of this rating vector.
|
| Constructor and Description |
|---|
RatingVector()
Default constructor.
|
RatingVector(boolean sequence)
Constructor with the additional parameter
sequence . |
RatingVector(int id)
Default constructor with specified identification (ID).
|
RatingVector(int id,
boolean sequence)
Constructor with ID and additional parameter
sequence . |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assign(java.util.Map<java.lang.Integer,Rating> ratedMap)
The internal variable
ratedMap of this rating vector is replaced by the specified map of ratings. |
void |
clear()
Clearing this vector, which means that all ratings are removed from this vector.
|
java.lang.Object |
clone()
Any class that implements this interface must define this method to clone itself.
|
static java.util.Map<java.lang.Integer,Rating> |
clone(java.util.Map<java.lang.Integer,Rating> map)
Deep cloning the specified map of ratings.
|
static java.util.Map<java.lang.Integer,RatingVector> |
clone2(java.util.Map<java.lang.Integer,RatingVector> map)
Deep cloning the specified map of rating vectors.
|
void |
compact()
Removing ratings which are not rated from this vector.
|
boolean |
contains(int fieldId)
Checking whether this vector contains the rating associated with specified field ID.
|
float |
corr(RatingVector that)
Calculating the correlation coefficient of this rating vector and the specified rating vector according to their values.
|
float |
cosine(RatingVector that)
Calculating the cosine of this rating vector and the specified rating vector according to their values.
|
int |
count(boolean rated)
Counting for ratings which are rated or unrated according the parameter
rated . |
static int |
count(float[] row,
boolean rated)
Given a row of rating values specified by the parameter
row , this method counts for ratings which are rated or unrated according the parameter rated . |
float |
distance(RatingVector that)
Calculating Euclidean distance of this rating vector and the specified rating vector according to their values.
|
java.util.Set<java.lang.Integer> |
fieldIds()
Getting a set of all field ID (s) of this vector.
|
java.util.Set<java.lang.Integer> |
fieldIds(boolean rated)
Getting a set of field ID (s) whose associated ratings are rated or not rated according to the specified parameter
rated . |
java.util.Set<java.lang.Integer> |
fieldIds(float ratingValue)
Getting a set of field ID (s) whose associated ratings have values that are equal to specified value.
|
void |
fillForUnrated(float fillValue)
For ratings which are unrated, this method sets their values by specified filling value.
|
Rating |
get(int fieldId)
Method is used to get rating at specified field ID.
|
java.util.Collection<Rating> |
gets()
Getting all ratings in this vector.
|
int |
id()
Getting the ID of this rating vector.
|
boolean |
isRated(int fieldId)
Testing whether the rating associated with specified field ID is rated.
|
boolean |
isRatedAll(java.util.Collection<java.lang.Integer> fieldIds)
Testing whether all ratings associated with field ID (s) in specified collection are rated.
|
float |
mean()
Calculating the mean value (average value) over all values of ratings in this vector.
|
RatingVector |
newInstance()
Creating a new rating vector so that this rating vector plays a role of template.
|
RatingVector |
newInstance(boolean sequence)
Creating a new rating vector so that this rating vector plays a role of template.
|
void |
parseText(java.lang.String spec)
Converting text into TextParsable object.
|
void |
put(int fieldId,
float ratingValue)
Putting a rating into this vector by its specified field ID and specified value.
|
void |
put(int fieldId,
Rating rating)
Method is used to put a specified rating identified by a specified field ID.
|
void |
put(RatingVector vRating)
Putting all ratings of other rating vector into this rating vector.
|
void |
remove(java.util.Collection<java.lang.Integer> fieldIds)
Removing all ratings associated with field ID (s) of specified collection.
|
void |
remove(int fieldId)
To remove rating at specified field ID.
|
void |
retain(java.util.Collection<java.lang.Integer> fieldIds)
Keeping only ratings whose associated field ID (s) are in the specified collection.
|
RatingVector |
select(ContextList contexts)
Every rating specified by
Rating has a context list. |
static java.util.Map<java.lang.Integer,RatingVector> |
select(java.util.Map<java.lang.Integer,RatingVector> map,
ContextList contexts)
Every rating specified by
Rating has a context list. |
void |
setId(int id)
Setting the ID of this rating vector.
|
int |
size()
Returning the size of this rating vector which is the number of ratings.
|
float |
sum()
Calculating the sum of all values of ratings in this vector.
|
RatingVector |
toRoundValues()
In case that ratings values are real numbers, this method make round of these values.
|
java.lang.String |
toText()
Converting TextParsable object into text.
|
java.util.List<java.lang.Float> |
toValueList(java.util.List<java.lang.Integer> fieldPattern)
Given a list of field ID (s) as a pattern, this method returns a list of values whose ratings are associated with such pattern.
|
static java.util.Map<java.lang.Integer,RatingVector> |
transfer(Fetcher<RatingVector> fetcher,
boolean sequence,
boolean autoClose)
This static method iterates all ratings via the fetcher of ratings and put such ratings to a new map.
|
void |
unrate(java.util.Collection<java.lang.Integer> fields)
This method makes ratings associated with the field ID (s) in the specified collection to be not rated.
|
protected int id
protected java.util.Map<java.lang.Integer,Rating> ratedMap
Rating
class.
If this class is user rating vector which contains all ratings of the same user on many items then, key is item identification (item ID).
If this class is item rating vector which contains all ratings of many users on the same item then, key is user identification (user ID).
As a convention, such key is called field id indicating both user id and item id, which is distinguished with regard that this rating vector is user rating vector or item rating vector.
Therefore, every rating is associated with a field ID.public RatingVector()
public RatingVector(int id)
id
- specified ID of rating vector.public RatingVector(boolean sequence)
sequence
.
If this parameter sequence
of is true
then, the internal variable ratedMap
containing all ratings will have built-in mechanism of sequence as a list.sequence
- additional parameter guiding how to create the internal variable ratedMap
. If it is true
then, such internal variable containing all ratings will have built-in mechanism of sequence as a list.public RatingVector(int id, boolean sequence)
sequence
.
If this parameter sequence
of is true
then, the internal variable ratedMap
containing all ratings will have built-in mechanism of sequence as a list.id
- specified ID of rating vector.sequence
- additional parameter guiding how to create the internal variable ratedMap
. If it is true
then, such internal variable containing all ratings will have built-in mechanism of sequence as a list.public int id()
public void setId(int id)
id
- ID of rating vector. If this rating vector is user rating vector, it is user ID. Otherwise, it is item ID.public int size()
public Rating get(int fieldId)
fieldId
- If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public java.util.Collection<Rating> gets()
public void put(int fieldId, Rating rating)
fieldId
- if this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.rating
- specified rating that is put into this vector.public void put(int fieldId, float ratingValue)
fieldId
- if this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.ratingValue
- specified rating value.public void put(RatingVector vRating)
vRating
- other rating vector.public boolean isRated(int fieldId)
rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.fieldId
- If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public boolean isRatedAll(java.util.Collection<java.lang.Integer> fieldIds)
rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.fieldIds
- specified collection of field IDs. If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public void remove(int fieldId)
fieldId
- If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public void remove(java.util.Collection<java.lang.Integer> fieldIds)
fieldIds
- specified collection of field IDs. If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public void retain(java.util.Collection<java.lang.Integer> fieldIds)
fieldIds
- specified collection of field ID (s). If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.protected void assign(java.util.Map<java.lang.Integer,Rating> ratedMap)
ratedMap
of this rating vector is replaced by the specified map of ratings.
This method makes a reference assignment as follows:
this.ratedMap = ratedMap;
ratedMap
- specified map of ratings.public java.util.Set<java.lang.Integer> fieldIds()
public java.util.Set<java.lang.Integer> fieldIds(float ratingValue)
ratingValue
- specified rating value.public java.util.Set<java.lang.Integer> fieldIds(boolean rated)
rated
.
As a definition, a rating is called rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.rated
- whether or not a rating is rated.rated
. If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public java.util.List<java.lang.Float> toValueList(java.util.List<java.lang.Integer> fieldPattern)
fieldPattern.
- If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.List
of rating values according to pattern.public boolean contains(int fieldId)
fieldId
- specified field ID. If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public float sum()
public float mean()
public float distance(RatingVector that)
that
- specified rating vectorpublic float corr(RatingVector that)
that
- specified rating vector.public float cosine(RatingVector that)
that
- specified rating vector.public void unrate(java.util.Collection<java.lang.Integer> fields)
rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.fields
- specified collection of field ID (s). If this rating vector is user rating vector, the field ID is item ID. Otherwise, it is user ID.public void compact()
rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.public void fillForUnrated(float fillValue)
rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.fillValue
- specified filling value which is used to fill in unrated ratings.public RatingVector select(ContextList contexts)
Rating
has a context list. Context is additional information related to user's rating, for example, place that user makes a rating,
companion indicating the persons with whom user makes a rating such as alone, friends, girlfriend/boyfriend, family, co-workers.
Context A can be inferred from context B if:
contexts
- specified context list.public RatingVector toRoundValues()
public void clear()
public java.lang.Object clone()
Cloneable
clone
in class java.lang.Object
public RatingVector newInstance(boolean sequence)
sequence
- additional parameter guiding how to create the internal variable ratedMap
. If it is true
then, such internal variable containing all ratings will have built-in mechanism of sequence as a list.public RatingVector newInstance()
public int count(boolean rated)
rated
.
As a definition, a rating is called rated
(user rated an item) if its rating value is not Constants.UNUSED
; otherwise such rating is called unrated
.rated
- if true, the method returns the number of rated ratings. Otherwise, the method returns the number of unrated ratings.rated
.public static int count(float[] row, boolean rated)
row
, this method counts for ratings which are rated or unrated according the parameter rated
.
As a definition, a rating value is called rated
if it is not Constants.UNUSED
; otherwise it is call unrated
.row
- a row of rating values.rated
- if true, the static method returns the number of rated value. Otherwise, the method returns the number of unrated values.rated
.public void parseText(java.lang.String spec)
TextParsable
parseText
in interface TextParsable
spec
- Specified text.public java.lang.String toText()
TextParsable
toText
in interface TextParsable
public static final java.util.Map<java.lang.Integer,Rating> clone(java.util.Map<java.lang.Integer,Rating> map)
map
- specified map of ratings.public static java.util.Map<java.lang.Integer,RatingVector> transfer(Fetcher<RatingVector> fetcher, boolean sequence, boolean autoClose)
fetcher
- specified fetcher of ratings, represented by Fetcher
interface.sequence
- additional parameter guiding how to create the new map of ratings. If it is true
then, such new map containing all ratings will have built-in mechanism of sequence as a list.autoClose
- if true, the specified fetcher is closed after the transference is finished.public static java.util.Map<java.lang.Integer,RatingVector> clone2(java.util.Map<java.lang.Integer,RatingVector> map)
map
- specified map of rating vectors.public static java.util.Map<java.lang.Integer,RatingVector> select(java.util.Map<java.lang.Integer,RatingVector> map, ContextList contexts)
Rating
has a context list. Context is additional information related to user's rating, for example, place that user makes a rating,
companion indicating the persons with whom user makes a rating such as alone, friends, girlfriend/boyfriend, family, co-workers.
Context A can be inferred from context B if:
map
- specified map of rating vectorscontexts
- specified context list.


{{ "comments" | translate }}
{{comment.author}}
{{ comment.timestamp | date: 'd MMMM y'}}{{comment.comment}}


Emacs align-regexp explained in detail with examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emacs comes with powerful and useful functions to align text to a specific column, by regexp.
Align is a simplified align-regexp with some predefined rules applying to current major mode. Sometimes it doesn't work well. So we focus on align-regexp here.
== Example ==
Take the following unreasonable code as an example.
#define A 0x41 #define WHAT_EVER 0x1BADB002 #define ABCDE 0xabcde
We want it aligned as follows:
#define A 0x41 #define WHAT_EVER 0x1BADB002 #define ABCDE 0xabcde
== Howto ==
0. Recommended settings before start:
(setq align-to-tab-stop nil)
C-x C-e if you want tabs treated the same as spaces.
(defalias 'ar 'align-regexp)
C-x C-e to help type align-regexp easily.
Or just put them in your emacs init file.
1. Select the target lines.
2. C-u M-x align-regexp
RET, then choose
\(\s-*\)␣[A-Z]
,
1
,
0
,
n
3. Select again and: C-u M-x align-regexp
RET, then choose
\(\s-*\)␣0
,
1
,
0
,
n
Or the previous two steps done in just one command:
C-u M-x align-regexp
RET, then choose
\(\s-*\)␣[A-Z0]
,
1
,
0
,
y
Even more simple one:
C-u M-x align-regexp
RET, then choose
\(\s-*\)␣
,
1
,
0
,
y
Note: ␣
means exactly one space.
== Explain ==
First let's look at the function prototype of align-regexp.
C-h f align-regexp
RET
(align-regexp BEG END REGEXP &optional GROUP SPACING REPEAT)
When used interactively, this function need 4 args entered by the user in the minibuffer:
- REGEXP:
\(\s-*\) [A-Z], 1, 0, n
- GROUP:
\(\s-*\) [A-Z], 1, 0, n
- SPACING:
\(\s-*\) [A-Z], 1, 0, n
- REPEAT:
\(\s-*\) [A-Z], 1, 0, n
REGEXP is the field matched to align with. The character need to be aligned is indicated by this REGEXP. Read on to find out how it works.
In our example, the pattern \(\s-*\)␣[A-Z]
matches the as follows:
#define A 0x41
#define WHAT_EVER 0x1BADB002
#define ABCDE 0xabcde
The subexpression \(\s-*\)
is entered automatically by emacs when we invoke align-regexp with prefix C-u. The matched place in \(\)
is where to insert or truncate characters to fulfill the alignment, and this is usually space field. \s-
means whitespace(space or tab), same as \s␣
and ␣
(if we have no tabs). \s-*
means zero or more spaces.
So \(\s-*\)
matches the lighter background part(space field), and ␣[A-Z]
matches the darker part(a space along with an UPPER character).
Now let's talk about align. Align means make the first character exactly after the \(\)
subexpression aligned at the same column.
In our case, this character is the SPACE before the UPPER character. So these spaces on different lines are to be aligned.
The second arg GROUP is parenthesis group to modify. When invoked interactively there is usually exactly one parenthesis group \(\)
. So just leave default value 1. In some case, we need this to be -1, we will talk about it later when we do a right-alignment.
The third arg SPACING means the amount of spaces we want in the space field. In our case we need all the spaces in the parenthesis group to be deleted, so we provide 0.
The fourth arg REPEAT means whether we want repeating the match and alignment. If we need exactly one match and alignment, then we provide n. See the next section to get more on REPEAT.
== Get a deep understanding of \(\) ==
Let's get a deep understanding of \(\)
. Use the following REGEXP pattern varient to get the alignments done.
C-u M-x align-regexp
RET,
\(\s-+\)[A-Z0]
,
1
,
1
,
y
Note there is no space between ) and [ this time.
\s-+
means 1 or more whitespaces, equals to \s-*␣
if no tabs. This REGEXP matches as follows:
#define A 0x41
#define WHAT_EVER 0x1BADB002
#define ABCDE 0xabcde
The difference is the space field matched and the character chosen to be aligned. All spaces are now in the \(\)
group, and we need one space in the final result, so the third arg SPACING need to be 1 instead of 0. If you need more spaces just provide the value you want. The REGEXP matches two columns and both need aligned, so REPEAT=y.
After understanding how align works, the REGEXP can be simplified:
C-u M-x align-regexp
RET,
\(\s-+\)
,
1
,
1
,
y
This means make whatever character immediately after the last space aligned.
The regexp matches as follows. Notice the subtile difference of the matched part.
#define A 0x41
#define WHAT_EVER 0x1BADB002
#define ABCDE 0xabcde
== Align to the right ==
Now let's talk about alignment to the right side. Say we need the following alignment.
#define A 0x01 #define WHAT_EVER 0x1BADB002 #define ABCDE 0xabcde
We can do it like this:
C-u M-x align-regexp
RET,
\(\s-+[A-Z_]+\)
,
-1
,
1
,
n
.
\s-+
means 1 or more spaces. [A-Z_]+
matches the UPPER and UPPER_WORD.
So this regexp matches as follows(the part in box on each line):
#define A 0x41 #define WHAT_EVER 0x1BADB002 #define ABCDE 0xabcde
Now we set arg GROUP to -1 which means justify. According to the source code docs, justify means DO NOT delete non-whitespace characters in the group and only insert or delete spaces of the initial spaces in the group. The character after the last UPPER is chosen to be the alignment character(the char exactly after \(\)
), i.e. the space in darker background. With GROUP = -1, spaces are inserted or deleted at the left side of the first UPPER to fulfill the alignment. In this way we get right-aligned.
We can match more characters before \(\)
, e.g. .*␣\(\s-*[A-Z_]+\)
, but this is not necessary in our case. If the REGEXP matches more fields and not all them are our target fields, the REGEXP should be changed to match more characters to distinguish the fields.
Post: use
C-u M-x align-regexp
RET,
\(\s-*\)0x
,
1
,
4
,
n
to do a left side alignment for the 0x
part. Or
C-u M-x align-regexp
RET,
\(\s-*0x\)
,
-1
,
4
,
n
to do a right side alignment for the 0x
part.
== More practice ==
①
struct stat64 { unsigned long long st_dev; /* Device. */ unsigned long long st_ino; /* File serial number. */ unsigned int st_mode; /* File mode. */ unsigned int st_nlink; /* Link count. */ unsigned int st_uid; /* User ID of the file's owner. */ unsigned int st_gid; /* Group ID of the file's group. */ unsigned long long st_rdev; /* Device number, if device. */ unsigned long long __pad1; long long st_size; /* Size of file, in bytes. */ int st_blksize; /* Optimal block size for I/O. */ int __pad2; long long st_blocks; /* Number 512-byte blocks allocated. */ int st_atime; /* Time of last access. */ unsigned int st_atime_nsec; int st_mtime; /* Time of last modification. */ unsigned int st_mtime_nsec; int st_ctime; /* Time of last status change. */ unsigned int st_ctime_nsec; unsigned int __unused4; unsigned int __unused5; };
Mark all the lines inside {} before aligh-regexp. (Tips: if you use Evil, vi{
; if you use expand-region, M-x er/mark-inside-pairs
.)
C-u M-x align-regexp
RET,
\(\s-*\)␣[s_]
,
1
,
0
,
n
C-u M-x align-regexp
RET,
\(\s-*\)␣/
,
1
,
4
,
n
struct stat64 { unsigned long long st_dev; /* Device. */ unsigned long long st_ino; /* File serial number. */ unsigned int st_mode; /* File mode. */ unsigned int st_nlink; /* Link count. */ unsigned int st_uid; /* User ID of the file's owner. */ unsigned int st_gid; /* Group ID of the file's group. */ unsigned long long st_rdev; /* Device number, if device. */ unsigned long long __pad1; long long st_size; /* Size of file, in bytes. */ int st_blksize; /* Optimal block size for I/O. */ int __pad2; long long st_blocks; /* Number 512-byte blocks allocated. */ int st_atime; /* Time of last access. */ unsigned int st_atime_nsec; int st_mtime; /* Time of last modification. */ unsigned int st_mtime_nsec; int st_ctime; /* Time of last status change. */ unsigned int st_ctime_nsec; unsigned int __unused4; unsigned int __unused5; };
--------------------------------------------------------------------------------
②
my @primes = ( 1,2,3,5,7, 11,13,17,19,23, 29,31,37,41,43, );
C-u M-x align-regexp
RET,
,\(\s-*\)[0-9]
,
1
,
1
,
y
my @primes = ( 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, );
C-u M-x align-regexp
RET,
\([0-9]+,\)
,
-1
,
1
,
y
my @primes = ( 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, );
--------------------------------------------------------------------------------
③
California 423,970 km² Taiwan 36,008 km² Japan 377,944 km² Germany 357,021 km² Iraq 438,317 km² Iran 1,648,195 km² Korea (North+South) 219,140 km² Mexico 1,964,375 km²
C-u M-x align-regexp
RET,
\(\s-*␣[0-9,]+\)
,
-1
,
1
,
n
Or
C-u M-x align-regexp
RET,
\(\s-+[[:digit:],]+\)
,
-1
,
1
,
n
Or
C-u M-x align-regexp
RET,
.*␣\(\s-*[0-9,]+\)
,
-1
,
0
,
n
Or
C-u M-x align-regexp
RET,
.*\(\s-*␣[0-9,]+\s-*\).*
,
-1
,
1
,
n
California 423,970 km² Taiwan 36,008 km² Japan 377,944 km² Germany 357,021 km² Iraq 438,317 km² Iran 1,648,195 km² Korea (North+South) 219,140 km² Mexico 1,964,375 km²


Google Sites adds support for right-to-left languages for new sites
by Damien WildeGoogle Sites is now adding support for several right-to-left languages, giving webmasters around the globe far more content management options.
Announced over on the official G Suite update blog, Google has added support for Sites in four new languages: Arabic, Farsi, Hebrew, and Urdu. For websites and institutions that have visitors and users in multiple global regions, this will make localization efforts that much easier.
To access the new right-to-left languages, a site editor simply has to set their language to one of the above. This will adjust the site editing experience and places the editing sidebars and menus on the left-hand side of the screen — rather than the usual left side.
Once a site is published, those viewing or using the site will have navigation elements and accessibility features reversed. Making sites usable for global audiences is, therefore, far easier.
This new update will be available for rapid release and scheduled release domains starting today and is available to all G Suite editions. As a default inclusion, the right-to-left language feature will become a default option for all Google Sites.
More on GSuite:
- Google Calendar on the web adds ‘meeting.new’ shortcut
- Gmail dark theme for Android and iOS officially rolling out
- Google Tasks 1.7 adds dark theme and homecreen widgets
FTC: We use income earning auto affiliate links. More.


My Team
Reynaldo
Manager
- ID: 1
- email<EMAIL_ADDRESS>- Office #: 10
Engineer: John
Engineer
- ID: 2
- email<EMAIL_ADDRESS>- Github: johnyes
Engineer: Mary
Engineer
- ID: 3
- email<EMAIL_ADDRESS>- Github: mary
Larry
Intern
- ID: 4
- email<EMAIL_ADDRESS>- School: UC Davis


Delhi sees haze-filled Friday morning, air quality in 'severe' zone at 425
At 6:30 am, Delhi's overall air quality index (AQI) was 425, according to SAFAR India. Gurgaon, Faridabad, Noida and Ghaziabad too recorded 'severe' overall air quality
by BS Web TeamDelhi's air quality continues to suffer as SAFAR recorded the capital's overall air quality index at a 'severe' 425 on Friday morning. The air quality was a tad better on Thursday when the AQI stood at 410. Today marks the fourth day of consecutive drop in the city and the adjoining areas.
At 6:30 am. the city's overall air quality index (AQI) was 425, according to SAFAR India (System of Air Quality and Weather Forecasting And Research). Gurgaon, Faridabad, Noida and Ghaziabad too recorded "severe" overall air quality.
An AQI between 0-50 is considered good, 51-100 satisfactory, 101-200 moderate, 201-300 poor, 301-400 very poor, and 401-500 severe. Above 500 is a severe-plus emergency category.
The AQI of four places in and around Delhi has been provided in the table given below.
| Place | PM2.5 | PM10 |
|---|---|---|
| Noida | 514 | 540 |
| Gurugram | 421 | 315 |
| Dwarka | 482 | 381 |
| Anand Vihar | 468 | 458 |
Central Pollution Control Board (CPCB) said that the air quality was likely to improve today, but it would remain in severe to upper-end of very poor category.
Delhi's air quality took a hit after Diwali night due to a combination of firecracker emissions, stubble burning and unfavourable meteorological conditions. Since then, pollution levels have been rising.
According to the Ministry of Earth Sciences' air quality monitor, SAFAR, the share of stubble burning in Delhi's pollution stood at 27 per cent on Thursday, with farm fires continuing to rage in Haryana and Punjab.
According to data from Punjab and the CPCB, the state has recorded a whopping increase of 7,842 fires -- from 12,027 on Sunday to 19,869 on Wednesday.
A number of social media users shared pictures of the haze enveloping Delhi and criticising the rise in air pollution. The pictures show the city encapsulated in a thick haze due to the heavy load of smoke from stubble burning in Haryana and Punjab.
"Does not the pollution smog make a case for shifting Indian capital to a better place from Delhi," wrote one Twitter user.


| Name: mr.satyanarayana | Reg No: 06-6SMHC19 |
|---|---|
| Age / Sex:38/m | Contact No:9538208451 |
| Marital Status:ml- 7 yrs | Date:07/6/19 |
| Occupation:telelcom airtel | Dr. pjfp |
Address: Native of hyd. In blore since 6 yrs |
DIAGNOSIS- |
Circular eruptions, itching. Since 6 months. <peanuts,coffee, tea,
If eats chapathi also sleepless. First started on the left thigh medial side. More groins region. Occasional milk also is becoming aggravated.
Scratches after bleeding also. Feels nice.
After treatment lower extremeties are reduced.
Teeth sensitivity.
Family:
Mom : dm.
1 elder and 1 younger : a &H
Past h/o:
Accident on the nose-2005
Root canal- 2 years back.
Mental generals:
Constant thinking. Angers a lot.
Wants to be close to nature, likes nature. feels for his mentality. Wants peace is his feeling.
Rx:
Teucrium 1m – mng 4 pills b/food.
Bac 1m – 1 dose stat
Rhus tox 200 – 4-4-4 b/food.
Rub 15 – 1 tab night b/food.


three.js
- BufferGeometry Compression
Octahedron and Quantization encoding methods from Tarek Sherif


org.apache.hadoop.fs.FileSystem
The abstract FileSystem
class is the original class to access Hadoop filesystems; non-abstract subclasses exist for all Hadoop-supported filesystems.
All operations that take a Path to this interface MUST support relative paths. In such a case, they must be resolved relative to the working directory defined by setWorkingDirectory()
.
For all clients, therefore, we also add the notion of a state component PWD: this represents the present working directory of the client. Changes to this state are not reflected in the filesystem itself: they are unique to the instance of the client.
Implementation Note: the static FileSystem get(URI uri, Configuration conf)
method MAY return a pre-existing instance of a filesystem client class—a class that may also be in use in other threads. The implementations of FileSystem
shipped with Apache Hadoop do not make any attempt to synchronize access to the working directory field.
All the requirements of a valid FileSystem are considered implicit preconditions and postconditions: all operations on a valid FileSystem MUST result in a new FileSystem that is also valid.
HDFS has the notion of Protected Directories, which are declared in the option fs.protected.directories
. Any attempt to delete or rename such a directory or a parent thereof raises an AccessControlException
. Accordingly, any attempt to delete the root directory SHALL, if there is a protected directory, result in such an exception being raised.
boolean exists(Path p)
def exists(FS, p) = p in paths(FS)
boolean isDirectory(Path p)
def isDirectory(FS, p)= p in directories(FS)
boolean isFile(Path p)
def isFile(FS, p) = p in files(FS)
FileStatus getFileStatus(Path p)
Get the status of a path
if not exists(FS, p) : raise FileNotFoundException
result = stat: FileStatus where: if isFile(FS, p) : stat.length = len(FS.Files[p]) stat.isdir = False stat.blockSize > 0 elif isDir(FS, p) : stat.length = 0 stat.isdir = True elif isSymlink(FS, p) : stat.length = 0 stat.isdir = False stat.symlink = FS.Symlinks[p] stat.hasAcl = hasACL(FS, p) stat.isEncrypted = inEncryptionZone(FS, p) stat.isErasureCoded = isErasureCoded(FS, p)
The returned FileStatus
status of the path additionally carries details on ACL, encryption and erasure coding information. getFileStatus(Path p).hasAcl()
can be queried to find if the path has an ACL. getFileStatus(Path p).isEncrypted()
can be queried to find if the path is encrypted. getFileStatus(Path p).isErasureCoded()
will tell if the path is erasure coded or not.
YARN’s distributed cache lets applications add paths to be cached across containers and applications via Job.addCacheFile()
and Job.addCacheArchive()
. The cache treats world-readable resources paths added as shareable across applications, and downloads them differently, unless they are declared as encrypted.
To avoid failures during container launching, especially when delegation tokens are used, filesystems and object stores which not implement POSIX access permissions for both files and directories, MUST always return true
to the isEncrypted()
predicate. This can be done by setting the encrypted
flag to true when creating the FileStatus
instance.
msync()
Synchronize metadata state of the client with the latest state of the metadata service of the FileSystem.
In highly available FileSystems standby service can be used as a read-only metadata replica. This call is essential to guarantee consistency of reads from the standby replica and to avoid stale reads.
It is currently only implemented for HDFS and others will just throw UnsupportedOperationException
.
This call internally records the state of the metadata service at the time of the call. This guarantees consistency of subsequent reads from any metadata replica. It assures the client will never access the state of the metadata that preceded the recorded state.
HDFS supports msync()
in HA mode by calling the Active NameNode and requesting its latest journal transaction ID. For more details see HDFS documentation Consistent Reads from HDFS Observer NameNode
Path getHomeDirectory()
The function getHomeDirectory
returns the home directory for the FileSystem and the current user account.
For some FileSystems, the path is ["/", "users", System.getProperty("user-name")]
.
However, for HDFS, the username is derived from the credentials used to authenticate the client with HDFS. This may differ from the local user account name.
It is the responsibility of the FileSystem to determine the actual home directory of the caller.
result = p where valid-path(FS, p)
There is no requirement that the path exists at the time the method was called, or, if it exists, that it points to a directory. However, code tends to assume that not isFile(FS, getHomeDirectory())
holds to the extent that follow-on code may fail.
FTPFileSystem
queries this value from the remote filesystem and may fail with a RuntimeException
or subclass thereof if there is a connectivity problem. The time to execute the operation is not bounded.FileStatus[] listStatus(Path path, PathFilter filter)
Lists entries under a path, path
.
If path
refers to a file and the filter accepts it, then that file’s FileStatus
entry is returned in a single-element array.
If the path refers to a directory, the call returns a list of all its immediate child paths which are accepted by the filter —and does not include the directory itself.
A PathFilter
filter
is a class whose accept(path)
returns true iff the path path
meets the filter’s conditions.
Path path
must exist:
if not exists(FS, path) : raise FileNotFoundException
if isFile(FS, path) and filter.accept(path) : result = [ getFileStatus(path) ] elif isFile(FS, path) and not filter.accept(P) : result = [] elif isDir(FS, path): result = [ getFileStatus(c) for c in children(FS, path) if filter.accepts(c) ]
Implicit invariant: the contents of a FileStatus
of a child retrieved via listStatus()
are equal to those from a call of getFileStatus()
to the same path:
forall fs in listStatus(path) : fs == getFileStatus(fs.path)
Ordering of results: there is no guarantee of ordering of the listed entries. While HDFS currently returns an alphanumerically sorted list, neither the Posix readdir()
nor Java’s File.listFiles()
API calls define any ordering of returned values. Applications which require a uniform sort order on the results must perform the sorting themselves.
Null return: Local filesystems prior to 3.0.0 returned null upon access error. It is considered erroneous. Expect IOException upon access error.
By the time the listStatus()
operation returns to the caller, there is no guarantee that the information contained in the response is current. The details MAY be out of date, including the contents of any directory, the attributes of any files, and the existence of the path supplied.
The state of a directory MAY change during the evaluation process.
After an entry at path P
is created, and before any other changes are made to the filesystem, listStatus(P)
MUST find the file and return its status.
After an entry at path P
is deleted, and before any other changes are made to the filesystem, listStatus(P)
MUST raise a FileNotFoundException
.
After an entry at path P
is created, and before any other changes are made to the filesystem, the result of listStatus(parent(P))
SHOULD include the value of getFileStatus(P)
.
After an entry at path P
is created, and before any other changes are made to the filesystem, the result of listStatus(parent(P))
SHOULD NOT include the value of getFileStatus(P)
.
This is not a theoretical possibility, it is observable in HDFS when a directory contains many thousands of files.
Consider a directory "/d"
with the contents:
a part-0000001 part-0000002 ... part-9999999
If the number of files is such that HDFS returns a partial listing in each response, then, if a listing listStatus("/d")
takes place concurrently with the operation rename("/d/a","/d/z"))
, the result may be one of:
[a, part-0000001, ... , part-9999999] [part-0000001, ... , part-9999999, z] [a, part-0000001, ... , part-9999999, z] [part-0000001, ... , part-9999999]
While this situation is likely to be a rare occurrence, it MAY happen. In HDFS these inconsistent views are only likely when listing a directory with many children.
Other filesystems may have stronger consistency guarantees, or return inconsistent data more readily.
FileStatus[] listStatus(Path path)
This is exactly equivalent to listStatus(Path, DEFAULT_FILTER)
where DEFAULT_FILTER.accept(path) = True
for all paths.
The atomicity and consistency constraints are as for listStatus(Path, DEFAULT_FILTER)
.
FileStatus[] listStatus(Path[] paths, PathFilter filter)
Enumerate all files found in the list of directories passed in, calling listStatus(path, filter)
on each one.
As with listStatus(path, filter)
, the results may be inconsistent. That is: the state of the filesystem changed during the operation.
There are no guarantees as to whether paths are listed in a specific order, only that they must all be listed, and, at the time of listing, exist.
All paths must exist. There is no requirement for uniqueness.
forall p in paths : exists(fs, p) else raise FileNotFoundException
The result is an array whose entries contain every status element found in the path listings, and no others.
result = [listStatus(p, filter) for p in paths]
Implementations MAY merge duplicate entries; and/or optimize the operation by recoginizing duplicate paths and only listing the entries once.
The default implementation iterates through the list; it does not perform any optimizations.
The atomicity and consistency constraints are as for listStatus(Path, PathFilter)
.
RemoteIterator<FileStatus> listStatusIterator(Path p)
Return an iterator enumerating the FileStatus
entries under a path. This is similar to listStatus(Path)
except the fact that rather than returning an entire list, an iterator is returned. The result is exactly the same as listStatus(Path)
, provided no other caller updates the directory during the listing. Having said that, this does not guarantee atomicity if other callers are adding/deleting the files inside the directory while listing is being performed. Different filesystems may provide a more efficient implementation, for example S3A does the listing in pages and fetches the next pages asynchronously while a page is getting processed.
Note that now since the initial listing is async, bucket/path existence exception may show up later during next() call.
Callers should prefer using listStatusIterator over listStatus as it is incremental in nature.
FileStatus[] listStatus(Path[] paths)
Enumerate all files found in the list of directories passed in, calling listStatus(path, DEFAULT_FILTER)
on each one, where the DEFAULT_FILTER
accepts all path names.
RemoteIterator[LocatedFileStatus] listLocatedStatus(Path path, PathFilter filter)
Return an iterator enumerating the LocatedFileStatus
entries under a path. This is similar to listStatus(Path)
except that the return value is an instance of the LocatedFileStatus
subclass of a FileStatus
, and that rather than return an entire list, an iterator is returned.
This is actually a protected
method, directly invoked by listLocatedStatus(Path path)
. Calls to it may be delegated through layered filesystems, such as FilterFileSystem
, so its implementation MUST be considered mandatory, even if listLocatedStatus(Path path)
has been implemented in a different manner. There are open JIRAs proposing making this method public; it may happen in future.
There is no requirement for the iterator to provide a consistent view of the child entries of a path. The default implementation does use listStatus(Path)
to list its children, with its consistency constraints already documented. Other implementations may perform the enumeration even more dynamically. For example fetching a windowed subset of child entries, so avoiding building up large data structures and the transmission of large messages. In such situations, changes to the filesystem are more likely to become visible.
Callers MUST assume that the iteration operation MAY fail if changes to the filesystem take place between this call returning and the iteration being completely performed.
Path path
must exist:
exists(FS, path) : raise FileNotFoundException
The operation generates a set of results, resultset
, equal to the result of listStatus(path, filter)
:
if isFile(FS, path) and filter.accept(path) : resultset = [ getLocatedFileStatus(FS, path) ] elif isFile(FS, path) and not filter.accept(path) : resultset = [] elif isDir(FS, path) : resultset = [ getLocatedFileStatus(FS, c) for c in children(FS, path) where filter.accept(c) ]
The operation getLocatedFileStatus(FS, path: Path): LocatedFileStatus
is defined as a generator of a LocatedFileStatus
instance ls
where:
fileStatus = getFileStatus(FS, path) bl = getFileBlockLocations(FS, path, 0, fileStatus.len) locatedFileStatus = new LocatedFileStatus(fileStatus, bl)
The ordering in which the elements of resultset
are returned in the iterator is undefined.
The atomicity and consistency constraints are as for listStatus(Path, PathFilter)
.
RemoteIterator[LocatedFileStatus] listLocatedStatus(Path path)
The equivalent to listLocatedStatus(path, DEFAULT_FILTER)
, where DEFAULT_FILTER
accepts all path names.
RemoteIterator[LocatedFileStatus] listFiles(Path path, boolean recursive)
Create an iterator over all files in/under a directory, potentially recursing into child directories.
The goal of this operation is to permit large recursive directory scans to be handled more efficiently by filesystems, by reducing the amount of data which must be collected in a single RPC call.
exists(FS, path) else raise FileNotFoundException
The outcome is an iterator, whose output from the sequence of iterator.next()
calls can be defined as the set iteratorset
:
if not recursive: iteratorset == listStatus(path) else: iteratorset = [ getLocatedFileStatus(FS, d) for d in descendants(FS, path) ]
The function getLocatedFileStatus(FS, d)
is as defined in listLocatedStatus(Path, PathFilter)
.
The atomicity and consistency constraints are as for listStatus(Path, PathFilter)
.
ContentSummary getContentSummary(Path path)
Given a path return its content summary.
getContentSummary()
first checks if the given path is a file and if yes, it returns 0 for directory count and 1 for file count.
exists(FS, path) else raise FileNotFoundException
Returns a ContentSummary
object with information such as directory count and file count for a given path.
The atomicity and consistency constraints are as for listStatus(Path, PathFilter)
.
BlockLocation[] getFileBlockLocations(FileStatus f, int s, int l)
if s < 0 or l < 0 : raise {HadoopIllegalArgumentException, InvalidArgumentException}
HadoopIllegalArgumentException
for an invalid offset or length; this extends IllegalArgumentException
.If the filesystem is location aware, it must return the list of block locations where the data in the range [s:s+l]
can be found.
if f == null : result = null elif f.getLen() <= s: result = [] else result = [ locations(FS, b) for b in blocks(FS, p, s, s+l)]
Where
def locations(FS, b) = a list of all locations of a block in the filesystem def blocks(FS, p, s, s + l) = a list of the blocks containing data(FS, path)[s:s+l]
Note that that as length(FS, f)
is defined as 0
if isDir(FS, f)
, the result of getFileBlockLocations()
on a directory is []
If the filesystem is not location aware, it SHOULD return
[ BlockLocation(["localhost:9866"] , ["localhost"], ["/default/localhost"] 0, f.getLen()) ] ;
*A bug in Hadoop 1.0.3 means that a topology path of the same number of elements as the cluster topology MUST be provided, hence Filesystems SHOULD return that "/default/localhost"
path. While this is no longer an issue, the convention is generally retained.
BlockLocation[] getFileBlockLocations(Path P, int S, int L)
if p == null : raise NullPointerException if not exists(FS, p) : raise FileNotFoundException
result = getFileBlockLocations(getFileStatus(FS, P), S, L)
long getDefaultBlockSize()
Get the “default” block size for a filesystem. This is often used during split calculations to divide work optimally across a set of worker processes.
result = integer > 0
Although there is no defined minimum value for this result, as it is used to partition work during job submission, a block size that is too small will result in badly partitioned workload, or even the JobSubmissionClient
and equivalent running out of memory as it calculates the partitions.
Any FileSystem that does not actually break files into blocks SHOULD return a number for this that results in efficient processing. A FileSystem MAY make this user-configurable (the object store connectors usually do this).
long getDefaultBlockSize(Path p)
Get the “default” block size for a path –that is, the block size to be used when writing objects to a path in the filesystem.
result = integer >= 0
The outcome of this operation is usually identical to getDefaultBlockSize()
, with no checks for the existence of the given path.
Filesystems that support mount points may have different default values for different paths, in which case the specific default value for the destination path SHOULD be returned.
It is not an error if the path does not exist: the default/recommended value for that part of the filesystem MUST be returned.
long getBlockSize(Path p)
This method is exactly equivalent to querying the block size of the FileStatus
structure returned in getFileStatus(p)
. It is deprecated in order to encourage users to make a single call to getFileStatus(p)
and then use the result to examine multiple attributes of the file (e.g. length, type, block size). If more than one attribute is queried, This can become a significant performance optimization —and reduce load on the filesystem.
if not exists(FS, p) : raise FileNotFoundException
if len(FS, P) > 0: getFileStatus(P).getBlockSize() > 0 result == getFileStatus(P).getBlockSize()
getFileStatus(P).getBlockSize()
.boolean mkdirs(Path p, FsPermission permission)
Create a directory and all its parents.
The path must either be a directory or not exist
if exists(FS, p) and not isDir(FS, p) : raise [ParentNotDirectoryException, FileAlreadyExistsException, IOException]
No ancestor may be a file
forall d = ancestors(FS, p) : if exists(FS, d) and not isDir(FS, d) : raise [ParentNotDirectoryException, FileAlreadyExistsException, IOException]
FS' where FS'.Directories' = FS.Directories + [p] + ancestors(FS, p) result = True
The condition exclusivity requirement of a FileSystem’s directories, files and symbolic links must hold.
The probe for the existence and type of a path and directory creation MUST be atomic. The combined operation, including mkdirs(parent(F))
MAY be atomic.
The return value is always true—even if a new directory is not created (this is defined in HDFS).
FSDataOutputStream create(Path, ...)
FSDataOutputStream create(Path p, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException;
The file must not exist for a no-overwrite create:
if not overwrite and isFile(FS, p) : raise FileAlreadyExistsException
Writing to or overwriting a directory must fail.
if isDir(FS, p) : raise {FileAlreadyExistsException, FileNotFoundException, IOException}
No ancestor may be a file
forall d = ancestors(FS, p) : if exists(FS, d) and not isDir(FS, d) : raise [ParentNotDirectoryException, FileAlreadyExistsException, IOException]
FileSystems may reject the request for other reasons, such as the FS being read-only (HDFS), the block size being below the minimum permitted (HDFS), the replication count being out of range (HDFS), quotas on namespace or filesystem being exceeded, reserved names, etc. All rejections SHOULD be IOException
or a subclass thereof and MAY be a RuntimeException
or subclass. For instance, HDFS may raise an InvalidPathException
.
FS' where : FS'.Files'[p] == [] ancestors(p) is-subset-of FS'.Directories' result = FSDataOutputStream
A zero byte file MUST exist at the end of the specified path, visible to all.
The updated (valid) FileSystem MUST contain all the parent directories of the path, as created by mkdirs(parent(p))
.
The result is FSDataOutputStream
, which through its operations may generate new filesystem states with updated values of FS.Files[p]
The behavior of the returned stream is covered in Output.
Some implementations split the create into a check for the file existing from the actual creation. This means the operation is NOT atomic: it is possible for clients creating files with overwrite==true
to fail if the file is created by another client between the two tests.
The S3A and potentially other Object Stores connectors not currently change the FS
state until the output stream close()
operation is completed. This is a significant difference between the behavior of object stores and that of filesystems, as it allows >1 client to create a file with overwrite=false
, and potentially confuse file/directory logic. In particular, using create()
to acquire an exclusive lock on a file (whoever creates the file without an error is considered the holder of the lock) may not not a safe algorithm to use when working with object stores.
Object stores may create an empty file as a marker when a file is created. However, object stores with overwrite=true
semantics may not implement this atomically, so creating files with overwrite=false
cannot be used as an implicit exclusion mechanism between processes.
The Local FileSystem raises a FileNotFoundException
when trying to create a file over a directory, hence it is listed as an exception that MAY be raised when this precondition fails.
Not covered: symlinks. The resolved path of the symlink is used as the final path argument to the create()
operation
FSDataOutputStreamBuilder createFile(Path p)
Make a FSDataOutputStreamBuilder
to specify the parameters to create a file.
The behavior of the returned stream is covered in Output.
createFile(p)
returns a FSDataOutputStreamBuilder
only and does not make change on filesystem immediately. When build()
is invoked on the FSDataOutputStreamBuilder
, the builder parameters are verified and create(Path p)
is invoked on the underlying filesystem. build()
has the same preconditions and postconditions as create(Path p)
.
create(Path p)
, files are overwritten by default, unless specify builder.overwrite(false)
.create(Path p)
, missing parent directories are not created by default, unless specify builder.recursive()
.FSDataOutputStream append(Path p, int bufferSize, Progressable progress)
Implementations without a compliant call SHOULD throw UnsupportedOperationException
.
if not exists(FS, p) : raise FileNotFoundException if not isFile(FS, p) : raise [FileAlreadyExistsException, FileNotFoundException, IOException]
FS' = FS result = FSDataOutputStream
Return: FSDataOutputStream
, which can update the entry FS.Files[p]
by appending data to the existing list.
The behavior of the returned stream is covered in Output.
FSDataOutputStreamBuilder appendFile(Path p)
Make a FSDataOutputStreamBuilder
to specify the parameters to append to an existing file.
The behavior of the returned stream is covered in Output.
appendFile(p)
returns a FSDataOutputStreamBuilder
only and does not make change on filesystem immediately. When build()
is invoked on the FSDataOutputStreamBuilder
, the builder parameters are verified and append()
is invoked on the underlying filesystem. build()
has the same preconditions and postconditions as append()
.
FSDataInputStream open(Path f, int bufferSize)
Implementations without a compliant call SHOULD throw UnsupportedOperationException
.
if not isFile(FS, p)) : raise [FileNotFoundException, IOException]
This is a critical precondition. Implementations of some FileSystems (e.g. Object stores) could shortcut one round trip by postponing their HTTP GET operation until the first read()
on the returned FSDataInputStream
. However, much client code does depend on the existence check being performed at the time of the open()
operation. Implementations MUST check for the presence of the file at the time of creation. This does not imply that the file and its data is still at the time of the following read()
or any successors.
result = FSDataInputStream(0, FS.Files[p])
The result provides access to the byte array defined by FS.Files[p]
; whether that access is to the contents at the time the open()
operation was invoked, or whether and how it may pick up changes to that data in later states of FS is an implementation detail.
The result MUST be the same for local and remote callers of the operation.
HDFS MAY throw UnresolvedPathException
when attempting to traverse symbolic links
HDFS throws IOException("Cannot open filename " + src)
if the path exists in the metadata, but no copies of any its blocks can be located; -FileNotFoundException
would seem more accurate and useful.
FSDataInputStreamBuilder openFile(Path path)
See openFile().
FSDataInputStreamBuilder openFile(PathHandle)
See openFile().
PathHandle getPathHandle(FileStatus stat, HandleOpt... options)
Implementations without a compliant call MUST throw UnsupportedOperationException
let stat = getFileStatus(Path p) let FS' where: (FS.Directories', FS.Files', FS.Symlinks') p' in paths(FS') where: exists(FS, stat.path) implies exists(FS', p')
The referent of a FileStatus
instance, at the time it was resolved, is the same referent as the result of getPathHandle(FileStatus)
. The PathHandle
may be used in subsequent operations to ensure invariants hold between calls.
The options
parameter specifies whether a subsequent call e.g., open(PathHandle)
will succeed if the referent data or location changed. By default, any modification results in an error. The caller MAY specify relaxations that allow operations to succeed even if the referent exists at a different path and/or its data are changed.
An implementation MUST throw UnsupportedOperationException
if it cannot support the semantics specified by the caller. The default set of options are as follows.
| Unmoved | Moved | |
|---|---|---|
| Unchanged | EXACT | CONTENT |
| Changed | PATH | REFERENCE |
Changes to ownership, extended attributes, and other metadata are not required to match the PathHandle
. Implementations can extend the set of HandleOpt
parameters with custom constraints.
A client specifies that the PathHandle
should track the entity across renames using REFERENCE
. The implementation MUST throw an UnsupportedOperationException
when creating the PathHandle
unless failure to resolve the reference implies the entity no longer exists.
A client specifies that the PathHandle
should resolve only if the entity is unchanged using PATH
. The implementation MUST throw an UnsupportedOperationException
when creating the PathHandle
unless it can distinguish between an identical entity located subsequently at the same path.
result = PathHandle(p')
The referent of a PathHandle
is the namespace when the FileStatus
instance was created, not its state when the PathHandle
is created. An implementation MAY reject attempts to create or resolve PathHandle
instances that are valid, but expensive to service.
Object stores that implement rename by copying objects MUST NOT claim to support CONTENT
and REFERENCE
unless the lineage of the object is resolved.
It MUST be possible to serialize a PathHandle
instance and reinstantiate it in one or more processes, on another machine, and arbitrarily far into the future without changing its semantics. The implementation MUST refuse to resolve instances if it can no longer guarantee its invariants.
HDFS does not support PathHandle
references to directories or symlinks. Support for CONTENT
and REFERENCE
looks up files by INode. INodes are not unique across NameNodes, so federated clusters SHOULD include enough metadata in the PathHandle
to detect references from other namespaces.
FSDataInputStream open(PathHandle handle, int bufferSize)
Implementaions without a compliant call MUST throw UnsupportedOperationException
let fd = getPathHandle(FileStatus stat) if stat.isdir : raise IOException let FS' where: (FS.Directories', FS.Files', FS.Symlinks') p' in FS.Files' where: FS.Files'[p'] = fd if not exists(FS', p') : raise InvalidPathHandleException
The implementation MUST resolve the referent of the PathHandle
following the constraints specified at its creation by getPathHandle(FileStatus)
.
Metadata necessary for the FileSystem
to satisfy this contract MAY be encoded in the PathHandle
.
result = FSDataInputStream(0, FS.Files'[p'])
The stream returned is subject to the constraints of a stream returned by open(Path)
. Constraints checked on open MAY hold to hold for the stream, but this is not guaranteed.
For example, a PathHandle
created with CONTENT
constraints MAY return a stream that ignores updates to the file after it is opened, if it was unmodified when open(PathHandle)
was resolved.
An implementation MAY check invariants either at the server or before returning the stream to the client. For example, an implementation may open the file, then verify the invariants in the PathHandle
using getFileStatus(Path)
to implement CONTENT
. This could yield false positives and it requires additional RPC traffic.
boolean delete(Path p, boolean recursive)
Delete a path, be it a file, symbolic link or directory. The recursive
flag indicates whether a recursive delete should take place —if unset then a non-empty directory cannot be deleted.
Except in the special case of the root directory, if this API call completed successfully then there is nothing at the end of the path. That is: the outcome is desired. The return flag simply tells the caller whether or not any change was made to the state of the filesystem.
Note: many uses of this method surround it with checks for the return value being false, raising exception if so. For example
if (!fs.delete(path, true)) throw new IOException("Could not delete " + path);
This pattern is not needed. Code SHOULD just call delete(path, recursive)
and assume the destination is no longer present —except in the special case of root directories, which will always remain (see below for special coverage of root directories).
A directory with children and recursive == False
cannot be deleted
if isDir(FS, p) and not recursive and (children(FS, p) != {}) : raise IOException
(HDFS raises PathIsNotEmptyDirectoryException
here.)
If the file does not exist the filesystem state does not change
if not exists(FS, p): FS' = FS result = False
The result SHOULD be False
, indicating that no file was deleted.
A path referring to a file is removed, return value: True
if isFile(FS, p) : FS' = (FS.Directories, FS.Files - [p], FS.Symlinks) result = True
recursive == False
Deleting an empty root does not change the filesystem state and may return true or false.
if isRoot(p) and children(FS, p) == {} : FS ' = FS result = (undetermined)
There is no consistent return code from an attempt to delete the root directory.
Implementations SHOULD return true; this avoids code which checks for a false return value from overreacting.
Object Stores: see Object Stores: root directory deletion.
recursive == False
Deleting an empty directory that is not root will remove the path from the FS and return true.
if isDir(FS, p) and not isRoot(p) and children(FS, p) == {} : FS' = (FS.Directories - [p], FS.Files, FS.Symlinks) result = True
Deleting a root path with children and recursive==True
can generally have three outcomes:
The POSIX model assumes that if the user has the correct permissions to delete everything, they are free to do so (resulting in an empty filesystem).
if isDir(FS, p) and isRoot(p) and recursive : FS' = ({["/"]}, {}, {}, {}) result = True
HDFS never permits the deletion of the root of a filesystem; the filesystem must be taken offline and reformatted if an empty filesystem is desired.
if isDir(FS, p) and isRoot(p) and recursive : FS' = FS result = False
Object Stores: see Object Stores: root directory deletion.
This specification does not recommend any specific action. Do note, however, that the POSIX model assumes that there is a permissions model such that normal users do not have the permission to delete that root directory; it is an action which only system administrators should be able to perform.
Any filesystem client which interacts with a remote filesystem which lacks such a security model, MAY reject calls to delete("/", true)
on the basis that it makes it too easy to lose data.
Some of the object store based filesystem implementations always return false when deleting the root, leaving the state of the store unchanged.
if isRoot(p) : FS ' = FS result = False
This is irrespective of the recursive flag status or the state of the directory.
This is a simplification which avoids the inevitably non-atomic scan and delete of the contents of the store. It also avoids any confusion about whether the operation actually deletes that specific store/container itself, and adverse consequences of the simpler permissions models of stores.
Deleting a non-root path with children recursive==true
removes the path and all descendants
if isDir(FS, p) and not isRoot(p) and recursive : FS' where: not isDir(FS', p) and forall d in descendants(FS, p): not isDir(FS', d) not isFile(FS', d) not isSymlink(FS', d) result = True
Deleting a file MUST be an atomic action.

A recursive delete of a directory tree MUST be atomic.
delete()
as recursive listing and entry-by-entry delete operation. This can break the expectations of client applications for O(1) atomic directory deletion, preventing the stores’ use as drop-in replacements for HDFS.boolean rename(Path src, Path d)
In terms of its specification, rename()
is one of the most complex operations within a filesystem.
In terms of its implementation, it is the one with the most ambiguity regarding when to return false versus raising an exception.
Rename includes the calculation of the destination path. If the destination exists and is a directory, the final destination of the rename becomes the destination + the filename of the source path.
let dest = if (isDir(FS, d) and d != src) : d + [filename(src)] else : d
All checks on the destination path MUST take place after the final dest
path has been calculated.
Source src
must exist:
exists(FS, src) else raise FileNotFoundException
dest
cannot be a descendant of src
:
if isDescendant(FS, src, dest) : raise IOException
This implicitly covers the special case of isRoot(FS, src)
.
dest
must be root, or have a parent that exists:
isRoot(FS, dest) or exists(FS, parent(dest)) else raise IOException
The parent path of a destination must not be a file:
if isFile(FS, parent(dest)) : raise IOException
This implicitly covers all the ancestors of the parent.
There must not be an existing file at the end of the destination path:
if isFile(FS, dest) : raise FileAlreadyExistsException, IOException
Renaming a directory onto itself is no-op; return value is not specified.
In POSIX the result is False
; in HDFS the result is True
.
if isDir(FS, src) and src == dest : FS' = FS result = (undefined)
Renaming a file to itself is a no-op; the result is True
.
if isFile(FS, src) and src == dest : FS' = FS result = True
Renaming a file where the destination is a directory moves the file as a child of the destination directory, retaining the filename element of the source path.
if isFile(FS, src) and src != dest: FS' where: not exists(FS', src) and exists(FS', dest) and data(FS', dest) == data (FS, source) result = True
If src
is a directory then all its children will then exist under dest
, while the path src
and its descendants will no longer exist. The names of the paths under dest
will match those under src
, as will the contents:
if isDir(FS, src) and isDir(FS, dest) and src != dest : FS' where: not exists(FS', src) and dest in FS'.Directories and forall c in descendants(FS, src) : not exists(FS', c)) and forall c in descendants(FS, src) where isDir(FS, c): isDir(FS', dest + childElements(src, c) and forall c in descendants(FS, src) where not isDir(FS, c): data(FS', dest + childElements(s, c)) == data(FS, c) result = True
not exists(FS, parent(dest))
There is no consistent behavior here.
HDFS
The outcome is no change to FileSystem state, with a return value of false.
FS' = FS; result = False
Local Filesystem
The outcome is as a normal rename, with the additional (implicit) feature that the parent directories of the destination also exist.
exists(FS', parent(dest))
S3A FileSystem
The outcome is as a normal rename, with the additional (implicit) feature that the parent directories of the destination then exist: exists(FS', parent(dest))
There is a check for and rejection if the parent(dest)
is a file, but no checks for any other ancestors.
Other Filesystems
Other filesystems strictly reject the operation, raising a FileNotFoundException
The core operation of rename()
—moving one entry in the filesystem to another—MUST be atomic. Some applications rely on this as a way to coordinate access to data.
Some FileSystem implementations perform checks on the destination FileSystem before and after the rename. One example of this is ChecksumFileSystem
, which provides checksummed access to local data. The entire sequence MAY NOT be atomic.
Files open for reading, writing or appending
The behavior of rename()
on an open file is unspecified: whether it is allowed, what happens to later attempts to read from or write to the open stream
Renaming a directory onto itself
The return code of renaming a directory onto itself is unspecified.
Destination exists and is a file
Renaming a file atop an existing file is specified as failing, raising an exception.
Local FileSystem : the rename succeeds; the destination file is replaced by the source file.
HDFS : The rename fails, no exception is raised. Instead the method call simply returns false.
Missing source file
If the source file src
does not exist, FileNotFoundException
should be raised.
HDFS fails without raising an exception; rename()
merely returns false.
FS' = FS result = false
The behavior of HDFS here should not be considered a feature to replicate. FileContext
explicitly changed the behavior to raise an exception, and the retrofitting of that action to the DFSFileSystem
implementation is an ongoing matter for debate.
void concat(Path p, Path sources[])
Joins multiple blocks together to create a single file. This is a little-used operation currently implemented only by HDFS.
Implementations without a compliant call SHOULD throw UnsupportedOperationException
.
if not exists(FS, p) : raise FileNotFoundException if sources==[] : raise IllegalArgumentException
All sources MUST be in the same directory:
for s in sources: if parent(S) != parent(p) raise IllegalArgumentException
All block sizes must match that of the target:
for s in sources: getBlockSize(FS, S) == getBlockSize(FS, p)
No duplicate paths:
not (exists p1, p2 in (sources + [p]) where p1 == p2)
HDFS: All source files except the final one MUST be a complete block:
for s in (sources[0:length(sources)-1] + [p]): (length(FS, s) mod getBlockSize(FS, p)) == 0
FS' where: (data(FS', T) = data(FS, T) + data(FS, sources[0]) + ... + data(FS, srcs[length(srcs)-1])) and for s in srcs: not exists(FS', S)
HDFS’s restrictions may be an implementation detail of how it implements concat
by changing the inode references to join them together in a sequence. As no other filesystem in the Hadoop core codebase implements this method, there is no way to distinguish implementation detail from specification.
boolean truncate(Path p, long newLength)
Truncate file p
to the specified newLength
.
Implementations without a compliant call SHOULD throw UnsupportedOperationException
.
if not exists(FS, p) : raise FileNotFoundException if isDir(FS, p) : raise [FileNotFoundException, IOException] if newLength < 0 || newLength > len(FS.Files[p]) : raise HadoopIllegalArgumentException
HDFS: The source file MUST be closed. Truncate cannot be performed on a file, which is open for writing or appending.
FS' where: len(FS.Files[p]) = newLength
Return: true
, if truncation is finished and the file can be immediately opened for appending, or false
otherwise.
HDFS: HDFS returns false
to indicate that a background process of adjusting the length of the last block has been started, and clients should wait for it to complete before they can proceed with further file updates.
If an input stream is open when truncate() occurs, the outcome of read operations related to the part of the file being truncated is undefined.
boolean copyFromLocalFile(boolean delSrc, boolean overwrite, Path src, Path dst)
The source file or directory at src
is on the local disk and is copied into the file system at destination dst
. If the source must be deleted after the move then delSrc
flag must be set to TRUE. If destination already exists, and the destination contents must be overwritten then overwrite
flag must be set to TRUE.
Source and destination must be different
if src = dest : raise FileExistsException
Destination and source must not be descendants one another
if isDescendant(src, dest) or isDescendant(dest, src) : raise IOException
The source file or directory must exist locally:
if not exists(LocalFS, src) : raise FileNotFoundException
Directories cannot be copied into files regardless to what the overwrite flag is set to:
if isDir(LocalFS, src) and isFile(FS, dst) : raise PathExistsException
For all cases, except the one for which the above precondition throws, the overwrite flag must be set to TRUE for the operation to succeed if destination exists. This will also overwrite any files / directories at the destination:
if exists(FS, dst) and not overwrite : raise PathExistsException
Given a base path on the source base
and a child path child
where base
is in ancestors(child) + child
:
def final_name(base, child, dest): is base = child: return dest else: return dest + childElements(base, child)
isFile(LocalFS, src)
For a file, data at destination becomes that of the source. All ancestors are directories.
if isFile(LocalFS, src) and (not exists(FS, dest) or (exists(FS, dest) and overwrite)): FS' = FS where: FS'.Files[dest] = LocalFS.Files[src] FS'.Directories = FS.Directories + ancestors(FS, dest) LocalFS' = LocalFS where not delSrc or (delSrc = true and delete(LocalFS, src, false)) else if isFile(LocalFS, src) and isDir(FS, dest): FS' = FS where: let d = final_name(src, dest) FS'.Files[d] = LocalFS.Files[src] LocalFS' = LocalFS where: not delSrc or (delSrc = true and delete(LocalFS, src, false))
There are no expectations that the file changes are atomic for both local LocalFS
and remote FS
.
isDir(LocalFS, src)
if isDir(LocalFS, src) and (isFile(FS, dest) or isFile(FS, dest + childElements(src))): raise FileAlreadyExistsException else if isDir(LocalFS, src): if exists(FS, dest): dest' = dest + childElements(src) if exists(FS, dest') and not overwrite: raise PathExistsException else: dest' = dest FS' = FS where: forall c in descendants(LocalFS, src): not exists(FS', final_name(c)) or overwrite and forall c in descendants(LocalFS, src) where isDir(LocalFS, c): FS'.Directories = FS'.Directories + (dest' + childElements(src, c)) and forall c in descendants(LocalFS, src) where isFile(LocalFS, c): FS'.Files[final_name(c, dest')] = LocalFS.Files[c] LocalFS' = LocalFS where not delSrc or (delSrc = true and delete(LocalFS, src, true))
There are no expectations of operation isolation / atomicity. This means files can change in source or destination while the operation is executing. No guarantees are made for the final state of the file or directory after a copy other than it is best effort. E.g.: when copying a directory, one file can be moved from source to destination but there’s nothing stopping the new file at destination being updated while the copy operation is still in place.
The default HDFS implementation, is to recurse through each file and folder, found at src
, and copy them sequentially to their final destination (relative to dst
).
Object store based file systems should be mindful of what limitations arise from the above implementation and could take advantage of parallel uploads and possible re-ordering of files copied into the store to maximize throughput.
RemoteIterator
The RemoteIterator
interface is used as a remote-access equivalent to java.util.Iterator
, allowing the caller to iterate through a finite sequence of remote data elements.
The core differences are
Iterator
’s optional void remove()
method is not supported.IOException
exceptions may be raised.public interface RemoteIterator<E> { boolean hasNext() throws IOException; E next() throws IOException; }
The basic view of the interface is that hasNext()
being true implies that next()
will successfully return the next entry in the list:
while hasNext(): next()
Equally, a successful call to next()
implies that had hasNext()
been invoked prior to the call to next()
, it would have been true.
boolean elementAvailable = hasNext(); try { next(); assert elementAvailable; } catch (NoSuchElementException e) { assert !elementAvailable }
The next()
operator MUST iterate through the list of available results, even if no calls to hasNext()
are made.
That is, it is possible to enumerate the results through a loop which only terminates when a NoSuchElementException
exception is raised.
try { while (true) { process(iterator.next()); } } catch (NoSuchElementException ignored) { // the end of the list has been reached }
The output of the iteration is equivalent to the loop
while (iterator.hasNext()) { process(iterator.next()); }
As raising exceptions is an expensive operation in JVMs, the while(hasNext())
loop option is more efficient. (see also Concurrency and the Remote Iterator for a dicussion on this topic).
Implementors of the interface MUST support both forms of iterations; authors of tests SHOULD verify that both iteration mechanisms work.
The iteration is required to return a finite sequence; both forms of loop MUST ultimately terminate. All implementations of the interface in the Hadoop codebase meet this requirement; all consumers assume that it holds.
boolean hasNext()
Returns true if-and-only-if a subsequent single call to next()
would return an element rather than raise an exception.
result = True ==> next() will succeed. result = False ==> next() will raise an exception
Multiple calls to hasNext()
, without any intervening next()
calls, MUST return the same value.
boolean has1 = iterator.hasNext(); boolean has2 = iterator.hasNext(); assert has1 == has2;
E next()
Return the next element in the iteration.
hasNext() else raise java.util.NoSuchElementException
result = the next element in the iteration
Repeated calls to next()
return subsequent elements in the sequence, until the entire sequence has been returned.
The primary use of RemoteIterator
in the filesystem APIs is to list files on (possibly remote) filesystems. These filesystems are invariably accessed concurrently; the state of the filesystem MAY change between a hasNext()
probe and the invocation of the next()
call.
During iteration through a RemoteIterator
, if the directory is deleted on remote filesystem, then hasNext()
or next()
call may throw FileNotFoundException
.
Accordingly, a robust iteration through a RemoteIterator
would catch and discard NoSuchElementException
exceptions raised during the process, which could be done through the while(true)
iteration example above, or through a hasNext()/next()
sequence with an outer try/catch
clause to catch a NoSuchElementException
alongside other exceptions which may be raised during a failure (for example, a FileNotFoundException
)
try { while (iterator.hasNext()) { process(iterator.next()); } } catch (NoSuchElementException ignored) { // the end of the list has been reached }
It is notable that this is not done in the Hadoop codebase. This does not imply that robust loops are not recommended —more that the concurrency problems were not considered during the implementation of these loops.
StreamCapabilities
The StreamCapabilities
provides a way to programmatically query the capabilities that OutputStream
, InputStream
, or other FileSystem class supports.
public interface StreamCapabilities { boolean hasCapability(String capability); }
boolean hasCapability(capability)
Return true iff the OutputStream
, InputStream
, or other FileSystem class has the desired capability.
The caller can query the capabilities of a stream using a string value. Here is a table of possible string values:
| String | Constant | Implements | Description |
|---|---|---|---|
| hflush | HFLUSH | Syncable | Flush out the data in client’s user buffer. After the return of this call, new readers will see the data. |
| hsync | HSYNC | Syncable | Flush out the data in client’s user buffer all the way to the disk device (but the disk may have it in its cache). Similar to POSIX fsync. |
| in:readahead | READAHEAD | CanSetReadahead | Set the readahead on the input stream. |
| dropbehind | DROPBEHIND | CanSetDropBehind | Drop the cache. |
| in:unbuffer | UNBUFFER | CanUnbuffer | Reduce the buffering on the input stream. |
EtagSource
FileSystem implementations MAY support querying HTTP etags from FileStatus
entries. If so, the requirements are as follows
getFileStatus()
calls.That is: when adding etag support, all operations which return FileStatus
or ListLocatedStatus
entries MUST return subclasses which are instances of EtagSource
.
To support etags, they MUST BE to be provided in both getFileStatus()
and list calls.
Implementors note: the core APIs which MUST BE overridden to achieve this are as follows:
FileStatus getFileStatus(Path) FileStatus[] listStatus(Path) RemoteIterator<FileStatus> listStatusIterator(Path) RemoteIterator<LocatedFileStatus> listFiles([Path, boolean)
The value of EtagSource.getEtag()
MUST be the same for list* queries which return etags for calls of getFileStatus()
for the specific object.
((EtagSource)getFileStatus(path)).getEtag() == ((EtagSource)listStatus(path)[0]).getEtag()
Similarly, the same value MUST BE returned for listFiles()
, listStatusIncremental()
of the path and when listing the parent path, of all files in the listing.
Two different arrays of data written to the same path MUST have different etag values when probed. This is a requirement of the HTTP specification.
After a file is renamed, the value of ((EtagSource)getFileStatus(dest)).getEtag()
SHOULD be the same as the value of ((EtagSource)getFileStatus(source)).getEtag()
was before the rename took place.
This is an implementation detail of the store; it does not hold for AWS S3.
If and only if the store consistently meets this requirement, the filesystem SHOULD declare in hasPathCapability()
that it supports fs.capability.etags.preserved.in.rename
Directory entries MAY return etags in listing/probe operations; these entries MAY be preserved across renames.
Equally, directory entries MAY NOT provide such entries, MAY NOT preserve them acrosss renames, and MAY NOT guarantee consistency over time.
Note: special mention of the root path “/”. As that isn’t a real “directory”, nobody should expect it to have an etag.
FileStatus
subclass MUST BE Serializable
; MAY BE Writable
The base FileStatus
class implements Serializable
and Writable
and marshalls its fields appropriately.
Subclasses MUST support java serialization (Some Apache Spark applications use it), preserving the etag. This is a matter of making the etag field non-static and adding a serialVersionUID
.
The Writable
support was used for marshalling status data over Hadoop IPC calls; in Hadoop 3 that is implemented through org/apache/hadoop/fs/protocolPB/PBHelper.java
and the methods deprecated. Subclasses MAY override the deprecated methods to add etag marshalling. However -but there is no expectation of this and such marshalling is unlikely to ever take place.
hasPathCapability(path, "fs.capability.etags.available")
MUST return true iff the filesystem returns valid (non-empty etags) on file status/listing operations.hasPathCapability(path, "fs.capability.etags.consistent.across.rename")
MUST return true if and only if etags are preserved across renames.FileSystem.getFileChecksum(Path)
returns a checksum value related to the etag of an object, if any value is returned.


Anfünfte | Llegadas | Arrivées | Arrivals
Local Time:
All Train | Tren | Zug || Scheduled Arrivals
Train | Tren | Zug
Destination
Frequency (min)
Next Arrival
Arrives In (min)
Add a New Train
Train | Tren | Zug (Alias)
Destination
First Train Time
(HH:mm | Military)
Frequency - (mins)
Add Train
Your browser does not support the audio element.


Latest Posts
-
Lampserver
The idea: how could I establish a cloud database and build an android application to write data to that server?
-
An 8-bit Virtual Architecture
I decided it might be fun to build a virtual architecture to calculate fibonacci numbers. I’m pretty excited about it; I’ve always wondered how hard it could be to design your own architecture entirely from scratch.


Simple inputText
Notes:
Works in Opera.
Simple DateTime type:
DateTime type with steps:
DateTime type with min and max:
Date type with min max and steps:
Time type with min max and steps:
Month type with min max and steps:
Week type with min max and steps:
Date type with min, max, steps and notInRangeMessage set:


| Modifier and Type | Method and Description |
|---|---|
CheckRule |
AbstractPsystemFactory.getCheckRule() |
CheckRule |
IPsystemFactory.getCheckRule()
Gets a CheckRule object to check if the P-system complies with the model
conditions, according to the specific model to give support
|
| Modifier and Type | Method and Description |
|---|---|
CheckRule |
RulesSet.getCheckRule()
Returns the CheckRule object for this RulesSet
|
| Modifier and Type | Method and Description |
|---|---|
void |
RulesSet.setCheckRule(CheckRule cr)
Set the CheckRule object for this RulesSet
|
| Constructor and Description |
|---|
DecoratorCheckRule(CheckRule cr)
Creates a new DecoratorCheckRule instance, which wraps cr as stated
by Decorator pattern.
|
| Constructor and Description |
|---|
Constant(CheckRule cr)
Creates a new Constant instance, which wraps cr as stated by decorator
pattern.
|
MultiEnvironment(CheckRule cr) |
NoCharges(CheckRule cr) |
NoConstant(CheckRule cr)
Creates a new NoConstant instance, which wraps cr as stated
by Decorator pattern.
|
NoCooperation(CheckRule cr)
Creates a new NoCooperation instance, which wraps cr as stated
by Decorator pattern.
|
NoCooperationWithDivision(CheckRule cr)
Creates a new NoEvolution instance, which wraps cr as stated
by Decorator pattern.
|
NoCreation(CheckRule cr)
Creates a new NoCreation instance, which wraps cr as stated
by Decorator pattern.
|
NoDifferentMainLabels(CheckRule cr) |
NoDissolution(CheckRule cr)
Creates a new NoDissolution instance, which wraps cr as stated
by Decorator pattern.
|
NoDivision(CheckRule cr)
Creates a new NoDivision instance, which wraps cr as stated
by Decorator pattern.
|
NoEmptyLeftMultiSet(CheckRule cr)
Creates a new NoEmptyLeftMultiSet instance, which wraps cr as stated
by Decorator pattern.
|
NoEvolution(CheckRule cr)
Creates a new NoEvolution instance, which wraps cr as stated
by Decorator pattern.
|
NoGeneStrings(CheckRule cr)
Creates a new NoGeneStrings instance, which wraps cr as stated
by Decorator pattern.
|
NoLeftExternalMultiSet(CheckRule cr)
Creates a new NoLeftExternalMultiSet instance, which wraps cr as stated
by Decorator pattern.
|
NoLeftExternalMultiSetWithCreation(CheckRule cr)
Creates a new NoLeftExternalMultiSetWithCreation instance, which wraps cr as stated
by Decorator pattern.
|
NoLeftExternalMultiSetWithDissolution(CheckRule cr)
Creates a new NoLeftExternalMultiSetWithDissolution instance, which wraps cr as stated
by Decorator pattern.
|
NoLeftExternalMultiSetWithDivision(CheckRule cr)
Creates a new NoLeftExternalMultiSetWithDivision instance, which wraps cr as stated
by Decorator pattern.
|
NoLeftInnerMembranes(CheckRule cr)
Creates a new NoLeftInnerMembranes instance, which wraps cr as stated
by Decorator pattern.
|
NoLeftRepeatedLabels(CheckRule cr)
Creates a new NoLeftRepeatedLabels instance, which wraps cr as stated
by Decorator pattern.
|
NoMultipleProduction(CheckRule cr)
Creates a new NoMultipleProduction instance, which wraps cr as stated
by Decorator pattern.
|
NoMultipleProductionWithDivision(CheckRule cr)
Creates a new NoEvolution instance, which wraps cr as stated
by Decorator pattern.
|
NoPriority(CheckRule cr)
Creates a new NoPriority instance, which wraps cr as stated
by Decorator pattern.
|
NoRepeatedLabels(CheckRule cr)
Creates a new NoRepeatedLabels instance, which wraps cr as stated
by Decorator pattern.
|
NoRightExternalMultiSet(CheckRule cr)
Creates a new NoRightExternalMultiSet instance, which wraps cr as stated
by Decorator pattern.
|
NoRightInnerMembranes(CheckRule cr)
Creates a new NoRightInnerMembranes instance, which wraps cr as stated
by Decorator pattern.
|
NoRightRepeatedLabels(CheckRule cr)
Creates a new NoRightRepeatedLabels instance, which wraps cr as stated
by Decorator pattern.
|
NotAllEmptyMultiSet(CheckRule cr)
Creates a new NotAllEmptyMultiSet instance, which wraps cr as stated
by Decorator pattern.
|
Ratio(CheckRule cr)
Creates a new Ratio instance, which wraps cr as stated
by Decorator pattern.
|
SymmetricCommunication(CheckRule cr)
Creates a new SimetricCommunication instance, which wraps cr as stated
by Decorator pattern.
|


About Me:
Hello! My name is Amber Kim. As you can see in my education and experience below, I took a bit of a round-a-bout way towards my journey as a Web Developer.
After graduating from the University of Washington, I moved with my husband to his next station duty in Camp Lejeune, NC. From there I tried to build a business doing photography and videography but it did not quite work because of all the deployments and relocation.
Before my second child was born and before my husband left the military, I was introduced by another military wife to working online for small businesses helping them remotely with whatever tech and marketing help they needed. Eventually I honed in to the tasks I really enjoyed which was building websites and web pages with WordPress using design tools but eventually I wanted to learn more and have more freedom to design websites from the ground up as a Full Stack Web Developer.
Education:
University of Washington: BA Comparative Literature, Cinema Studies
Experience:
2 years Web Design and Digital Marketing for Small Businesses.
Languages and Markups:
- JavaScript
- CSS3
- HTML
Tools and Platforms:
- Github
- Atom
- WordPress
- Divi
- ClickFunnels
- MemberPress
- WooCommerce
Some fun. Top Ten On My Goals:
- Work remotely from home - or anywhere in the world.
- Work with a company that cares about making a difference in the lives of their employees, families, and community.
- Adopt kids who just want to have a loving family to come home to
- Give the option to my husband to be a stay-at-home dad.
- Be able to freely visit loved ones in other states and countries.
- Build my own usefull web app.
- Monetize my own web app.
- Make a difference in my community.
- Help others provide for themselves and their own families.
- Build a big house for my family and all the kids we adopt.


--- layout: post authors: ["Aleksandra Pawlik"] title: "Feedback from the bootcamp at Istituto Nazionale di Fisica Nucleare in Pisa" date: 2014-06-30 time: "23:00:00" tags: ["Bootcamps"] ---
At the beginning of June (3-6) Software Carpentry supported the leaning tower of Pisa. Well, no really. We actually supported the students at Istituto Nazionale di Fisica Nucleare at the University of Pisa in becomming more effective using their computational skills. The instructors were Rémi Emonet and Aleksandra Pawlik. The main organisers and hosts were Chiara Roda and Luca Baldini. Needless to say, running a bootcamp early June in Tuscany does have its perks. The memories of gelati and focaccine di ceci are still very vivid. How can you not love being a Software Carpentry instructor?
The bootcamp in Pisa was not restricted to just the students of the University of Pisa and we even had one attendee who came all the way from Turin. Judging from the pre-bootcamp questionnaire the audience knowledge was on approximately the same level (and it was an advanced level!). All participants had a good grasp of programming concepts and many had extensive experience as programmers using more than one language. What was interesting however was the fact that their skills in using command line varied quite significantly. A few participants were almost completely unfamiliar with shell, others used it but if a rather limited scope and some were clearly very knowledgeable and comfortable with commands and scripting. This meant that Rémi had a particularly difficult task teaching command line trying to accommodate for the varied audience. Managing expectations was the key thing in this situation and we explicitly said that Software Carpentry pitches at the level of the least advanced part of the audience. The more advanced participants could progress further working with the additional material which was linked to the bootcamp website.
The version control module was easier to teach for two reasons: firstly, the vast majority of the audience did not know it hence everyone had the same starting point and secondly, it turned out that everyone was a LaTeX user which quickly helped to demonstrate usefulness of version control not only for source code but also for collaborative paper writing. The most exciting and engaging part of the version control module was, as usual, the final exercise when the students paired up to work on one shared repository on GitHub.
The bootcamp then continued with programming with Python. The (fairly) new materials which start with data analysis using NumPy rather than a plain introduction to concepts such as a variable or a loop fitted the audience in Pisa very well. As mentioned, all of them had programming experience and a very basic introduction would simply be boring for them. Using NumPy for data analysis was far more engaging and convincing.
The second day of the bootcamp started with more programming with Python. Rémi covered a more detailed module focusing on NumPy and SciPy. Then Aleksandra taught introduction to testing. The bootcamp finished with an exercise during which the attendees had to fork a repository containing an IPython Notebook file which contained code that needed to be fixed and developed further. Once the task was completed the students had to send a pull request and some of them!
It's worth to mention that the bootcamp in Pisa started with an extra day. The morning included introductions and a lecture "Track trigger and applications beside particle physics" In the afternoon the students could consult their setup settings with the instructors. Having these extra few hours the day before the actual bootcamp kicked off to make sure that everything has been correctly installed saved us the usual issues with "something not working" over the next two days.
Teaching at Software Carpentry bootcamps is usually very rewarding when students leave positive feedback. The good side of teaching more advanced audience is that they can often immediately see the application and the benefit of using the skills which they learn during the bootcamp. Just like one of the participants in Pisa tweeted: I still can't figure out how I managed to write all the thousands lines of code without Git. Huge thanks to @swcarpentry!!


A legend may be displayed with the YUI Charts Control by setting a few simple styles. This example shows you how.
Please note: The YUI Charts Control requires Flash Player 9.0.45 or higher. The latest version of Flash Player is available at the Adobe Flash Player Download Center.


The creation was intended to ensure that environmental matters are adequately mainstreamed into all developmental activities. In line with the above and in consonance with the administration’s policy thrust of Environmental Renewal and Development Initiative (ERDI), the Ministry has the following mandate to The conservation of natural resources and sustainable development and scientific and technological activities affecting the environment and natural resources. Promote cooperation in environmental science and conservation technology with similar bodies in other countries and with international bodies connected with the protection of the environment and the conservation of natural resources.
Cooperate with Federal and State Ministries, Local Government, statutory bodies and research agencies on matters and facilities relating to the protection of the environment and the conservation of natural resources. Prescribe standards for and make regulations on water quality, effluent limitations, air quality, atmospheric protection, ozone protection, noise control as well as the removal and control of hazardous substances, and Monitor and enforce environmental protection measures.The creation was intended to ensure that environmental matters are adequately mainstreamed into all developmental activities. In line with the above and in consonance with the administration’s policy thrust of Environmental Renewal and Development Initiative (ERDI), the Ministry has the following mandate to The conservation of natural resources and sustainable development and scientific and technological activities affecting the environment and natural resources. Promote cooperation in environmental science and conservation technology with similar bodies in other countries and with international bodies connected with the protection of the environment and the conservation of natural resources.
Cooperate with Federal and State Ministries, Local Government, statutory bodies and research agencies on matters and facilities relating to the protection of the environment and the conservation of natural resources. Prescribe standards for and make regulations on water quality, effluent limitations, air quality, atmospheric protection, ozone protection, noise control as well as the removal and control of hazardous substances, and Monitor and enforce environmental protection measures.The creation was intended to ensure that environmental matters are adequately mainstreamed into all developmental activities. In line with the above and in consonance with the administration’s policy thrust of Environmental Renewal and Development Initiative (ERDI), the Ministry has the following mandate to The conservation of natural resources and sustainable development and scientific and technological activities affecting the environment and natural resources. Promote cooperation in environmental science and conservation technology with similar bodies in other countries and with international bodies connected with the protection of the environment and the conservation of natural resources.
Cooperate with Federal and State Ministries, Local Government, statutory bodies and research agencies on matters and facilities relating to the protection of the environment and the conservation of natural resources. Prescribe standards for and make regulations on water quality, effluent limitations, air quality, atmospheric protection, ozone protection, noise control as well as the removal and control of hazardous substances, and Monitor and enforce environmental protection measures.


I decided to join this course on January 4th and it's been a wild ride!
So far I've learned how to use:
And we've only just begun! I wanted to start learning how to write code to challenge myself
and rise above anything I have ever accomplished. Follow along as I learn by watching my Github Account.


See use case #1 for a description of this requirement.
We use two pages for this use case. This is page #2 of the example. See Page #1 for full explanation.
If you clicked the link to this page from Page #1, you should see page performance results show up below. It may take a while if this is the first time you're doing the test since testing your bandwidth takes about 6 seconds. You can also click the link to Page #1 to see the same output on Page #1.
The latest code and docs is available on github.com/yahoo/boomerang