Source code for workfrontapi_plus.tools
"""Copyright 2017, Integrated Device Technologies, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Authors: Roshan Bal, Craig Lathrop
"""
from datetime import datetime
import collections
import re
import hashlib
import hmac
[docs]class Tools(object):
[docs] @staticmethod
def parse_workfront_date(date_string):
"""
Converts from the Workfront datetime format into a Python datetime object
:param date_string: The workfront date string. Example "2017-01-01T01:01:00.000-0800"
:return: A datetime object
"""
return datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S:%f%z")
[docs] def flatten_response(self, data, sep=":", pretty=False):
"""
Flattens out nested dict
This method will take a Workfront API response and "flatten out" certain nested dicts.
For example, here is a response for a task
[{'ID': 'abc123...',
'name': 'test task',
'project': {'ID': 'cde456',
'name': 'My Proj'}
}]
would be converted to
[{'ID': 'abc123...',
'name': 'test task',
'project:ID': 'cde456',
'project:name': 'My Proj'
}]
:param data:
:param skip_keys:
:param use_keys:
:param pretty: Removes the project:name style notation. Example:
with pretty set to true
[{'ID': 'abc123...',
'Name': 'test task',
'Project ID': 'cde456',
'Project Name': 'My Proj'
}]
:return: A processed list or dict
"""
output = []
for item in data:
output.append(self.flatten_dict(item, sep=sep, pretty=pretty))
return output
[docs] def flatten_dict(self, data, parent_key='', sep=":", pretty=False):
items = []
for key, value in data.items():
new_key = parent_key + sep + key if parent_key else key
if pretty:
new_key = self.pretty_keys(new_key)
if isinstance(value, collections.MutableMapping):
items.extend(self.flatten_dict(data=value, parent_key=new_key, sep=sep, pretty=pretty).items())
else:
items.append((new_key, value))
return dict(items)
[docs] def pretty_keys(self, key):
# todo Finish this, still a bit buggy.
key = key[:1].title()+key[1:]
res = re.findall('[A-Z][^A-Z]*', key)
output = ''
for item in res:
output = '{0} {1}'.format(output, item)
return output.strip()
[docs] @staticmethod
def text_mode(text):
"""
Converts Workfront "Text Mode" into a parameter string.
:param text: A string containing Workfront text mode parameters
:return: A dict version of the passed in parameters
"""
output = {}
for line in text.splitlines():
key, value = line.split("=")
# key = key_pair[0].strip()
# value = key_pair[1].strip()
if "\t" in value:
# It's a list
value_list = value.split("\t")
output[key] = value_list
else:
output[key] = value
return output
[docs] @staticmethod
def make_config_file():
"""
Makes a config file to hold sub domain and API Key
"""
code = '''
class WorkfrontConfig(object):
"""
This file holds path and credential information for the workfront API
This file is designed to help keep your authentication data safe and out of your
repository. To use this file when instantiating the Workfront Api:
1 from wfconfig import WorkfrontConfig
2
3 api = Api(subdomain=WorkfrontConfig.subdomain,
4 api_key=WorkfrontConfig.api_key,
5 env='preview',
6 api_version='6.0')
"""
# Enter your API key here. This can be found in the Workfront interface under
# setup->Customer Info.
api_key = '{api_key}'
# The sub domain is the prefix to the URL you use to access Workfront. For example
# https://xxx.my.workfront.com, xxx would be the sub domain.
subdomain = '{sub_domain}'
'''
api_key = input("Enter your API key: ")
sub_domain = input("Enter your subdomain: ")
output = code.format(api_key=api_key, sub_domain=sub_domain)
config_file = open("wfconfig.py", "w")
config_file.write(output)
config_file.close()
[docs] @staticmethod
def make_signature(message, key):
key = bytes(key, 'UTF-8')
message = bytes(message, 'UTF-8')
digester = hmac.new(key, message, hashlib.sha1)
signature1 = digester.hexdigest()
return signature1


Most communication with 1-Wire devices, especially iButtons, is accomplished through some sort of temporary contact. Since this contact is temporary the underlying design philosophy of any 1-Wire device application is 'try and try again'. It must be assumed at any time the user of the application will break contact temporarily or permanently with the 1-Wire device. With this in mind, TMEX provides a wide variety of application programming interface (API) calls to verify which 1-Wire device is being communicated with and the results of that communication.
Each 1-Wire device has a guaranteed unique serial number (ROM). TMEX provides API calls that read these CRC verified serial numbers. Since each serial number is unique, multiple 1-Wire devices can be communicated with on the same communication channel. This channel is referred to as a 1-Wire since communication is done over 1 wire and ground. Each data-oriented API call to a 1-Wire device is preceded by the unique serial number thus preventing any ambiguity.
To facilitate data integrity in the 1-Wire device, all data is stored in a structure that contains a length, data, and an inverted CRC-16 of that length and data. This structure is referred to as the Universal Data Packet (UDP). Since the Microsoft Windows environment is multi-tasking, TMEX provides the ability for several applications to communicate on the same 1-Wire network. This is accomplished through the use of semaphore functions that provide a 'session_handle' that gives exclusive use of that 1-Wire network. The time that this 'session_handle' is valid is referred to as a Session. To be 'friendly' to other applications the duration of a Session should be as small as possible. Each application running in Microsoft Windows may have a different state so each call to the TMEX API must provide a buffer for state variables.
All of the TMEX API calls are designed such that if their operation is interrupted no data corruption occurs. An interruption would most likely occur due to intermittent contact. To complete an interrupted function, simply call it again. If the device does not return to the 1-Wire network then that call was not done and the 1-Wire device has not been changed.
There is one exception to the rule that API calls can be interrupted, programming EPROMs. Any EPROM programming is destructive, meaning it uses up data space. To get around this TMEX has two special API calls, TMCreateProgramJob and TMDoProgramJob. TMCreateProgramJob sets up a buffer that keeps track of any writes to the EPROM without actually doing the write. TMDoProgramJob then proceeds to transfer the buffered changes to the EPROM device. TMDoProgramJob MUST complete successfully for the data integrity of the EPROM device to remain. TMDoProgramJob is set up such that if it returns an ERROR it can be called again to complete the operation. Programming EPROMs requires special hardware. For the PC COM port this hardware is a DS9097E PC Serial Port Adapter with an optional but recommended external power supply.
Here is a possible 1-Wire Session. Note that all TMEX API calls are prefixed with 'TM'.
TMExtendedStartSession - get permission to communicate on the 1-Wire network.
TMSetup - called only once at the beginning of the application to verify that the 1-Wire network exists.
TMFirst,TMNext,TMStrongAccess,TMRom... - get the unique registration number of the 1-Wire device to communicate with.
TMCreateProgramJob - called only if the 1-Wire device is an EPROM device AND a write operation is going to be attempted.
TMFirstFile,TMChangeDirectory,TMDeleteFile,TMFormat... - do a file operation.
TMDoProgramJob - called only if TMCreateProgramJob was called. Keep calling until it returns success. If the 1-Wire device loses contact, have the application force the user to make contact again.
TMClose - called only once at the end of the application to power down the 1-Wire network. (not always applicable, but always callable)
TMEndSession - relinquish use of the 1-Wire network.
See Also


Maserati Prototype Hiding Lots Of Naughty Secrets
Test mule is said to be developing a completely new powertrain package.
by Noah JosephMaserati has something completely new coming. It told us so when the Italian automaker announced last week the forthcoming new model will debut next May. But the vehicle itself, it turns out, won't be the only new development. It'll also usher in a new family of engines.
The Trident marque released these images of a test mule running around its home town of Modena. And its purpose is to develop a completely new powertrain "entirely developed and built in Maserati," paving the way for "a new family of engines integrated exclusively on the vehicles of the Brand."
That by itself will mark a significant departure for Maserati, which has relied heavily on its FCA sister companies to develop its engines. The current Ghibli, Quattroporte, and Levante all use a 3.0-liter twin-turbo V6 (designated F160) and 3.8-liter twin-turbo V8 (F154) developed by Ferrari. They also offer (in some markets) a 3.0-liter V6 turbodiesel furnished by VM Motori, another FCA division that also provides the diesels for various Jeep, Ram, and Chrysler models. And the recently discontinued GranTurismo employed a 4.2- or 4.7-liter naturally aspirated V8 from Ferrari's previous F136 architecture that also motivated the F430, 458, California, and Alfa Romeo 8C.
With Ferrari now spun off into its own entity, Maserati is apparently now undertaking its own powertrain development. But just what kind of powertrain that will be remains a mystery at the moment. The Modenese manufacturer is anticipated to roll out a series of electric vehicles, and this prototype could be testing their powertrain components. Or it could be developing a new internal-combustion engine. The automaker said "the engine is 100% Maserati," but otherwise referred more ambiguously to an unspecified "powertrain."
Whatever it's testing, the prototype looks like a modified Alfa Romeo 4C, which is something Maserati has previously considered. Whether the finished product will ultimately look anything like this, we'll have to wait another six months or so to find out.


Akshith R Kandakatla
I'm a Masters in Computer Information Systems from Boston University and am a Data Analytics/Science enthusiast.
While pursuing my Masters, during the summer break of 2015 I enrolled in the Udacity's Data Analyst Nanodegree MOOC. I interacted with similar enthusiasts from across the globe through udacity's blog and worked on several Analytics projects as well as helped others overcome their obstacles analyzing data. I look forward to pursue my career as a Data Analyst/Scientist. Here are some of my projects.


|
|
| UITest (EntityMap map, ContentManager content) |
| |
| override void | Initialize () |
| | Initialize this scene and loads all resources. Runs logic to execute during the Initializing state. Set state to None to end. More...
|
| |
| override void | HandleInput () |
| | Handles all input for the scene More...
|
| |
| override void | Update () |
| | Updates game logic and changes scene state. More...
|
| |
| override void | Draw (SpriteBatch spriteBatch, SpriteBatch uiSpriteBatch) |
| | Draws entities and UI elements to the specfied SpriteBatches More...
|
| |
| override void | Exit () |
| | Runs logic to execute while the scene is in the Exiting state. Set state to Null to end. More...
|
| |
| override void | Pause () |
| | Runs logic to execute while the scene is in the Pausing state. Set state to None to end. More...
|
| |
| override void | Resume () |
| | Runs logic to execute while the scene is in the Resuming state. Set state to None to end. More...
|
| |
| | Scene (EntityMap gameObjects, ContentManager content) |
| | Initializes a new instance of the T:MidnightBlue.Engine.Scenes.Scene class with a pre-existing EntityMap More...
|
| |
|
void | UpdateTransition () |
| |
| void | Cleanup () |
| | Cleans up the scene and unloads content. More...
|
| |
§ Draw()
| override void MidnightBlue.Engine.Testing.UITest.Draw |
( |
SpriteBatch |
spriteBatch, |
|
|
SpriteBatch |
uiSpriteBatch |
|
) |
| |
|
inlinevirtual |
Draws entities and UI elements to the specfied SpriteBatches
- Parameters
-
| spriteBatch | World-coordinate based sprite batch. |
| uiSpriteBatch | Camera-based User Interface sprite batch. |
Implements MidnightBlue.Engine.Scenes.Scene.
§ Exit()
| override void MidnightBlue.Engine.Testing.UITest.Exit |
( |
| ) |
|
|
inlinevirtual |
§ HandleInput()
| override void MidnightBlue.Engine.Testing.UITest.HandleInput |
( |
| ) |
|
|
inlinevirtual |
§ Initialize()
| override void MidnightBlue.Engine.Testing.UITest.Initialize |
( |
| ) |
|
|
inlinevirtual |
Initialize this scene and loads all resources. Runs logic to execute during the Initializing state. Set state to None to end.
Implements MidnightBlue.Engine.Scenes.Scene.
§ Pause()
| override void MidnightBlue.Engine.Testing.UITest.Pause |
( |
| ) |
|
|
inlinevirtual |
§ Resume()
| override void MidnightBlue.Engine.Testing.UITest.Resume |
( |
| ) |
|
|
inlinevirtual |
§ Update()
| override void MidnightBlue.Engine.Testing.UITest.Update |
( |
| ) |
|
|
inlinevirtual |
The documentation for this class was generated from the following file:
- Shared/src/Engine/Test/UITest.cs


This document describes the eight ecocomDP tables and their contents. Four tables are required (observation, location, taxon, and dataset_summary). Each main table (observation, location, taxon) has an optional ancillary table for additional information. These are included because primary research typically contains related measurements which may be of interest during analysis. The dataset_summary table is populated from the observation table contents, and the variable_mapping table holds URIs and labels for external measurement dictionaries.
An example ecocomDP dataset is here and a graphic showing all tables and their relationships is available here.
| table name | required? | references tables | unique constraints |
|---|---|---|---|
| observation | yes | location, taxon, dataset_summary | observation_id |
| location | yes | NA | location_id |
| taxon | yes | NA | taxon_id |
| dataset_summary | yes | NA | package_id |
| observation_ancillary | no | observation | observation_id, variable_name |
| location_ancillary | no | location | location_id, datetime, variable_name |
| taxon_ancillary | no | taxon | taxon_id, variable_name |
| variable_mapping | no | observation, observation_ancillary, location_ancillary, taxon_ancillary | table_name, variable_name |
Description: This is the core table, which holds the observations being analyzed (e.g. organism abundance or density). Observations must be linked to a taxon and to a location. Linking to ancillary observations is optional.
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| observation_id | character | yes | NA | Identifier assigned to each unique observation. | 4161 |
| event_id | character | yes | NA | Identifier assigned to each unique sampling event. | 2009mar03_dive1 |
| package_id | character | yes | /dataset_summary/package_id | Identifier of this data package. | edi.100001.1 |
| location_id | character | yes | /location/location_id | A reference to a location. | sbc_ABUR_1 |
| datetime | datetime | yes | NA | Date and time of the observation in ISO-8601 format. | 2017-08-01, 2017-08-01 14:30:00 |
| taxon_id | character | yes | /taxon/taxon_id | A reference to a taxon. | sbclter_MAPY |
| variable_name | character | yes | NA | Name of the measured variable. | count |
| value | float | yes | NA | Value of the measured variable. | 7 |
| unit | character | yes | NA | Unit of the measured variable. | number |
Description: Identifying information about a place (longitude, latitude, elevation). The table is self-referencing so that sites can be nested.
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| location_id | character | yes | NA | Identifier assigned to each unique location. | sbclter_abur_I |
| location_name | character | no | NA | Sampling location full name. | Arroyo Burro Reef, transect I |
| latitude | float | no | NA | Latitude in decimal degrees. Latitudes south of the equator are negative. | 34.400275 |
| longitude | float | no | NA | Longitude in decimal degrees. Longitudes west of the prime meridian are negative. | -119.7445915 |
| elevation | float | no | NA | Sampling location elevation in meters relative to sea level. Above sea level is positive. Below sea level is negative. | -15 |
| parent_location_id | character | no | NA | Sampling location identifier from this table for the parent of this sampling location. Presence indicates nested locations. | sbclter_abur_I |
Description: Identifying information about a taxon (e.g. name, id, and system).
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| taxon_id | character | yes | NA | Identifier assigned to each unique organism. | sbclter_MAPY |
| taxon_rank | character | no | NA | Taxonomic rank of the organism. | species |
| taxon_name | character | yes | NA | Taxonomic name of the organism. | Macrocystis pyrifera |
| authority_system | character | no | NA | Name of the system assigning the authority_taxon_id. | ITIS |
| authority_taxon_id | character | no | NA | Identifier in the authority system corresponding to the taxon_name. | 11274 |
Description: Summary info about the dataset.
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| package_id | character | yes | NA | Identifier of this data package. | edi.100001.1 |
| original_package_id | character | no | NA | Identifier of source data package. | knb-lter-sbc.21.17 |
| length_of_survey_years | integer | yes | NA | Number of years the study has been ongoing. | 17 |
| number_of_years_sampled | integer | yes | NA | Number of years within the period of the study that samples were taken. | 17 |
| std_dev_interval_betw_years | float | yes | NA | Standard deviation of the interval between sampling events. | 1.1 |
| max_num_taxa | integer | yes | NA | Number of unique values in the taxon table. | 10 |
| geo_extent_bounding_box_m2 | float | no | NA | Area of the study location. | 40 |
Description: Ancillary information about an observational event for context. These are very often environmental driver data in analyses (e.g. water depth, height of a tower, temperature of medium).
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| observation_ancillary_id | character | yes | NA | Identifier of the observation ancillary information. | TBE01JUN05 |
| observation_id | character | yes | /observation/observation_id | A reference to an observation. References the observation_id field of the observation table. | 4161 |
| variable_name | character | yes | NA | Name of the measured variable. | sample_z |
| value | character | no | NA | Value of the measured variable. | 5 |
| unit | character | no | NA | Unit of the measured variable. | meter |
Description: Additional information about a place that does not change frequently (e.g. lake area or depth, experimental treatment). Features that change frequently are more closely related to the observational event, and are thus kept in the observation_ancillary table. Ancillary observations are linked through the location_id, and one location_id may have many ancillary observations about it.
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| location_ancillary_id | character | yes | NA | Identifier of the location ancillary information. | |
| location_id | character | yes | /location/location_id | A reference to a location. References the location_id field of the location table. | sbclter_ABUR_1 |
| datetime | datetime | no | NA | Date and time of the ancillary information in ISO-8601 format. | 2017-08-01, 2017-08-01 14:30:00 |
| variable_name | character | yes | NA | Name of the measured variable. | treatment |
| value | character | yes | NA | Value of the measured variable. | kelp removal |
| unit | character | no | NA | Unit of the measured variable. |
Description: Additional info about an organism that does not change frequently (e.g. trophic level). Features that change frequently are probably observations. Ancillary observations are linked through the taxon_id, which may have many ancillary observations about it.
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| taxon_ancillary_id | character | yes | NA | Identifier of the taxon ancillary information. | |
| taxon_id | character | yes | /taxon/taxon_id | A reference to a taxon. References the taxon_id field of the taxon table. | |
| datetime | datetime | no | NA | Date and time of the ancillary information in ISO-8601 format. | 2017-08-01, 2017-08-01 14:30:00 |
| variable_name | character | yes | NA | Name of the measured variable. | trophic_level |
| value | character | yes | NA | Value of the measured variable. | primary producer |
| unit | character | no | NA | Unit of the measured variable. | |
| author | character | no | NA | Author associated with identification of the taxon. |
Description: Information linking a variable_name used in a table to an external definition.
This optional table holds mappings (or relations) between variable names in the data tables and measurement definitions external to the data package. This table has multiple uses:
| column name | type | not NULL required? | references | description | example |
|---|---|---|---|---|---|
| variable_mapping_id | character | yes | NA | Identifier of the variable mapping information. | 1 |
| table_name | character | yes | NA | Name of the table containing this variable. | my_observation |
| variable_name | character | yes | /table/variable_name | Name of the measured variable in another table. | sample_z |
| mapped_system | character | no | NA | System defining variable_name. | NERC |
| mapped_id | character | no | NA | Identifier of the definition in mapped_system. | SDN:P07::CFSN0721 |
| mapped_label | character | no | NA | Label for variable_name in mapped_system. | depth |
Figure 1: The optional tables are partly transparent. The primary key for each table is the id (column named “table_name_id”, with a green background. Columns that (as a group) should be unique within the table, have a yellow background. Many:many relationships are shown with dotted lines (side note: if this model were implemented in a relational database, each many:many relationship would require an intermediate table).


In this post we will start to describe a framework for image processing with hexagonal pixels introduced by Sheridan.
Here are the notes for the seminar I gave today at the Séminaire de Théorie du Contrôle de Toulon.
I'm a fan of Python and of numpy, but when it comes to doing a lot of computations it has its shortcomings.
I've heard a lot of good about cython and I plan to check it out real soon.
However I'm currently working at porting a fortran program to python, so it makes a lot more sense to simply compile the computationally heavy part from the fortran code in a python module.
F2PY does exactly this and I'm writing this post as a reminder on how it works.
Just a quick one.
Today I needed to change variables inside a PDE.

So, what better than have a software do all the hard work?
In this post I collect some notes regarding the reading of this paper.


The 2030 Water Resources Group estimates that if we continue to consume water as per the current rate, India will have only half the water it needs by 2030—a flashpoint that’s only ten years away.
This is an unusually large water footprint for agriculture. China and South Africa use approximately 64 percent and 62 percent of their renewable freshwater resources for agriculture. Groundwater accounts for 90 percent of the drinking water requirements in rural India and nearly 50 percent in urban areas.
Fifty-four percent of India’s 141.4 million hectares of cultivable land is under water-intensive crops—rice, wheat, sugarcane, and cotton. Farmers are incentivised to grow water-intensive crops as they are eligible for the government’s minimum support price (MSP), which protects them from the risk of fluctuating prices.
For instance, for every 1000 litres of water, China produces 0.46 kilograms of rice and 1.08 kilograms of cereal. For that amount of water, India produces only 0.23 kilograms of rice and 0.36 kilograms of cereal.
Until 1960, Indian farmers accessed a few tens of thousands of mechanical pumps using diesel or electricity to pump water. As of 2009, for every four cultivator households, one owned a tube well and two purchased groundwater from tube well owners. A combination of incentives (such as MSP for water-intensive crops) and subsidies (such as free electricity) have encouraged large-scale extraction of groundwater.
Created with Mobirise html theme


The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:
| GroupId | ArtifactId | Version | Type | License |
|---|---|---|---|---|
| au.gov.amsa.risky | ais | 0.5.25 | jar | The Apache License, Version 2.0 |
| au.gov.amsa.risky | formats | 0.5.25 | jar | The Apache License, Version 2.0 |
| au.gov.amsa.risky | geo-analyzer | 0.5.25 | jar | The Apache License, Version 2.0 |
| au.gov.amsa.risky | streams | 0.5.25 | jar | The Apache License, Version 2.0 |
| com.netflix.rxjava | rxjava-swing | 0.20.7 | jar | The Apache Software License, Version 2.0 |
| io.reactivex | rxjava | 1.3.7 | jar | The Apache Software License, Version 2.0 |
| log4j | log4j | 1.2.17 | jar | The Apache Software License, Version 2.0 |
| org.geotools | gt-epsg-hsql | 18.1 | jar | Lesser General Public License (LGPL)-EPSG database distribution license-BSD License for HSQL |
| org.geotools | gt-shapefile | 18.1 | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-swing | 18.1 | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-wms | 18.1 | jar | Lesser General Public License (LGPL) |
| org.slf4j | slf4j-api | 1.7.12 | jar | MIT License |
| org.slf4j | slf4j-log4j12 | 1.7.12 | jar | MIT License |
The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:
| GroupId | ArtifactId | Version | Type | License |
|---|---|---|---|---|
| junit | junit | 4.12 | jar | Eclipse Public License 1.0 |
| org.openjdk.jmh | jmh-core | 1.3.3 | jar | GNU General Public License (GPL), version 2, with the Classpath exception |
The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.
The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:
| GroupId | ArtifactId | Version | Classifier | Type | License |
|---|---|---|---|---|---|
| au.gov.amsa.risky | behaviour-detector | 0.5.25 | - | jar | The Apache License, Version 2.0 |
| au.gov.amsa.risky | geotools-extras | 0.5.25 | - | jar | The Apache License, Version 2.0 |
| au.gov.amsa.risky | ihs-reader | 0.5.25 | - | jar | The Apache License, Version 2.0 |
| au.gov.amsa.risky | risky-util | 0.5.25 | - | jar | The Apache License, Version 2.0 |
| c3p0 | c3p0 | <IP_ADDRESS> | - | jar | GNU LESSER GENERAL PUBLIC LICENSE |
| com.github.davidmoten | grumpy-core | 0.2.3 | - | jar | The Apache Software License, Version 2.0 |
| com.github.davidmoten | guava-mini | 0.1.1 | - | jar | The Apache Software License, Version 2.0 |
| com.github.davidmoten | rtree | 0.8.4 | - | jar | The Apache Software License, Version 2.0 |
| com.github.davidmoten | rxjava-extras | <IP_ADDRESS> | - | jar | The Apache Software License, Version 2.0 |
| com.github.davidmoten | rxjava-slf4j | 0.6.12 | - | jar | The Apache Software License, Version 2.0 |
| com.google.guava | guava | 19.0 | - | jar | The Apache Software License, Version 2.0 |
| com.google.protobuf | protobuf-java | 2.5.0 | - | jar | New BSD license |
| com.googlecode.efficient-java-matrix-library | core | 0.26 | - | jar | The Apache Software License, Version 2.0 |
| com.googlecode.json-simple | json-simple | 1.1 | - | jar | The Apache Software License, Version 2.0 |
| com.miglayout | miglayout | 3.7 | swing | jar | BSD |
| com.netflix.rxjava | rxjava-core | 0.20.7 | - | jar | The Apache Software License, Version 2.0 |
| com.sleepycat | je | 4.0.92 | - | jar | Sleepycat License |
| com.sun.jna | jna | 3.0.9 | - | jar | null |
| com.vividsolutions | jts-core | 1.14.0 | - | jar | GNU Lesser General Public License, Version 2.1 |
| com.vividsolutions | jts-example | 1.14.0 | - | jar | GNU Lesser General Public License, Version 2.1 |
| com.vividsolutions | jts-io | 1.14.0 | - | jar | GNU Lesser General Public License, Version 2.1 |
| commons-codec | commons-codec | 1.2 | - | jar | - |
| commons-httpclient | commons-httpclient | 3.1 | - | jar | Apache License |
| commons-io | commons-io | 1.3.2 | - | jar | The Apache Software License, Version 2.0 |
| commons-lang | commons-lang | 2.6 | - | jar | The Apache Software License, Version 2.0 |
| commons-logging | commons-logging | 1.0.4 | - | jar | /LICENSE.txt |
| commons-pool | commons-pool | 1.5.4 | - | jar | The Apache Software License, Version 2.0 |
| edu.ucar | netcdf | 4.3.23 | - | jar | (MIT-style) netCDF C library license |
| edu.ucar | udunits | 4.3.23 | - | jar | (MIT-style) netCDF C library license |
| io.reactivex | rxjava-math | 1.0.0 | - | jar | The Apache Software License, Version 2.0 |
| io.reactivex | rxjava-string | 0.22.0 | - | jar | The Apache Software License, Version 2.0 |
| it.geosolutions.imageio-ext | imageio-ext-geocore | 1.1.18 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.imageio-ext | imageio-ext-streams | 1.1.18 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.imageio-ext | imageio-ext-tiff | 1.1.18 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.imageio-ext | imageio-ext-utilities | 1.1.18 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.affine | jt-affine | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.algebra | jt-algebra | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.bandcombine | jt-bandcombine | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.bandmerge | jt-bandmerge | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.bandselect | jt-bandselect | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.binarize | jt-binarize | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.border | jt-border | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.buffer | jt-buffer | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.classifier | jt-classifier | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.colorconvert | jt-colorconvert | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.colorindexer | jt-colorindexer | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.crop | jt-crop | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.errordiffusion | jt-errordiffusion | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.format | jt-format | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.imagefunction | jt-imagefunction | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.iterators | jt-iterators | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.lookup | jt-lookup | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.mosaic | jt-mosaic | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.nullop | jt-nullop | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.orderdither | jt-orderdither | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.piecewise | jt-piecewise | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.rescale | jt-rescale | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.rlookup | jt-rlookup | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.scale | jt-scale | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.stats | jt-stats | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.translate | jt-translate | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.utilities | jt-utilities | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.vectorbin | jt-vectorbin | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.warp | jt-warp | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| it.geosolutions.jaiext.zonal | jt-zonal | 1.0.16 | - | jar | Lesser General Public License (LGPL) |
| javax.media | jai_codec | 1.1.3 | - | jar | - |
| javax.media | jai_core | 1.1.3 | - | jar | JDL (Java Distribution License) |
| javax.media | jai_imageio | 1.1 | - | jar | - |
| jgridshift | jgridshift | 1.0 | - | jar | - |
| joda-time | joda-time | 2.7 | - | jar | Apache 2 |
| net.java.dev.jsr-275 | jsr-275 | 1.0-beta-2 | - | jar | BSD License |
| net.jcip | jcip-annotations | 1.0 | - | jar | - |
| net.sf.ehcache | ehcache-core | 2.6.2 | - | jar | src/assemble/EHCACHE-CORE-LICENSE.txt |
| net.sf.geographiclib | GeographicLib-Java | 1.44 | - | jar | The MIT License(MIT) |
| org.apache.commons | commons-collections4 | 4.1 | - | jar | Apache License, Version 2.0 |
| org.apache.commons | commons-lang3 | 3.4 | - | jar | Apache License, Version 2.0 |
| org.apache.commons | commons-math3 | 3.3 | - | jar | The Apache Software License, Version 2.0 |
| org.apache.xml | xml-commons-resolver | 1.2 | - | jar | - |
| org.functionaljava | functionaljava | 4.2-beta-1 | - | jar | The BSD3 License |
| org.geotools | gt-api | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-coverage | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-cql | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-data | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-epsg-wkt | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-geojson | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-main | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-metadata | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-opengis | 18.1 | - | jar | OGC copyright-Lesser General Public License (LGPL) |
| org.geotools | gt-referencing | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-render | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.geotools | gt-xml | 18.1 | - | jar | Lesser General Public License (LGPL) |
| org.hsqldb | hsqldb | 2.3.0 | - | jar | HSQLDB License, a BSD open source license |
| org.jaitools | jt-utils | 1.4.0 | - | jar | Simplified BSD |
| org.jaitools | jt-zonalstats | 1.4.0 | - | jar | Simplified BSD |
| org.jdom | jdom | 1.1.3 | - | jar | Similar to Apache License but with the acknowledgment clause removed |
| org.jdom | jdom2 | 2.0.4 | - | jar | Similar to Apache License but with the acknowledgment clause removed |
| org.mapdb | mapdb | 1.0.3 | - | jar | The Apache Software License, Version 2.0 |
| org.quartz-scheduler | quartz | 2.1.1 | - | jar | Apache 2.0 |
The following is a list of runtime dependencies for this project. These dependencies are required to run the application:
| GroupId | ArtifactId | Version | Type | License |
|---|---|---|---|---|
| org.slf4j | jcl-over-slf4j | 1.7.5 | jar | MIT License |
The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:
| GroupId | ArtifactId | Version | Type | License |
|---|---|---|---|---|
| net.sf.jopt-simple | jopt-simple | 4.6 | jar | The MIT License |
| org.hamcrest | hamcrest-core | 1.3 | jar | New BSD License |
Unamed: JNA
(MIT-style) netCDF C library license: NetCDF-Java Library, udunits
GNU LESSER GENERAL PUBLIC LICENSE: c3p0:JDBC DataSources/Resource Pools
The Apache License, Version 2.0: ais, animator, behaviour-detector, formats, geo-analyzer, geotools-extras, ihs-reader, risky-util, streams
Apache 2.0: Quartz Enterprise Job Scheduler
Eclipse Public License 1.0: JUnit
MIT License: JCL 1.1.1 implemented over SLF4J, SLF4J API Module, SLF4J LOG4J-12 Binding
New BSD License: Hamcrest Core
Apache 2: Joda-Time
OGC copyright: Open GIS Interfaces
Similar to Apache License but with the acknowledgment clause removed: JDOM
BSD: MiGLayout
Unknown: "Java Concurrency in Practice" book annotations, Codec, jai_codec, jai_imageio, jgridshift, xml-commons-resolver
New BSD license: Protocol Buffer Java API
BSD License: jsr-275
Lesser General Public License (LGPL): API interfaces, DataStore Support, EPSG Authority Service using HSQL database, EPSG Authority Service using WKT file, GeoJSON Support, Grid Coverage module, Image I/O-Extensions - Custom Streams, Image I/O-Extensions - GeoCore, Image I/O-Extensions - utilities classes and methods, Improved TIFF Plugin, Main module, Metadata, OGC CQL to Filter parser, Open GIS Interfaces, Referencing services, Render, Shapefile module, Swing widgets, Web Map Server client, XML Parsing Support, jt-affine, jt-algebra, jt-bandcombine, jt-bandmerge, jt-bandselect, jt-binarize, jt-border, jt-buffer, jt-classifier, jt-colorconvert, jt-colorindexer, jt-crop, jt-errordiffusion, jt-format, jt-imagefunction, jt-iterators, jt-lookup, jt-mosaic, jt-nullop, jt-orderdither, jt-piecewise, jt-rescale, jt-rlookup, jt-scale, jt-stats, jt-translate, jt-utilities, jt-vectorbin, jt-warp, jt-zonal
The MIT License: JOpt Simple
Apache License, Version 2.0: Apache Commons Collections, Apache Commons Lang
JDL (Java Distribution License): Java Advanced Imaging
GNU General Public License (GPL), version 2, with the Classpath exception: JMH Core
Simplified BSD: Support and utility classes, ZonalStats operator
GNU Lesser General Public License, Version 2.1: com.vividsolutions:jts-core, com.vividsolutions:jts-example, com.vividsolutions:jts-io
HSQLDB License, a BSD open source license: HyperSQL Database
Apache License: HttpClient
The MIT License(MIT): Java implementation of GeographicLib
BSD License for HSQL: EPSG Authority Service using HSQL database
EPSG database distribution license: EPSG Authority Service using HSQL database
The BSD3 License: Functional Java
Sleepycat License: Berkeley DB Java Edition
The Apache Software License, Version 2.0: Apache Commons Math, Apache Log4j, Commons IO, Commons Lang, Commons Pool, EJML, Ehcache Core, Guava: Google Core Libraries for Java, JSON.simple, Logging, grumpy-core, guava-mini, mapdb, rtree, rxjava, rxjava-core, rxjava-extras, rxjava-math, rxjava-slf4j, rxjava-string, rxjava-swing


Source code for pygraphc.anomaly.AnomalyScore
import csv
from pygraphc.abstraction.ClusterAbstraction import ClusterAbstraction
from pygraphc.clustering.ClusterUtility import ClusterUtility
[docs]class AnomalyScore(object):
"""A class to calculate anomaly score in a cluster.
"""
def __init__(self, graph, clusters, filename):
"""The constructor of class AnomalyScore.
Parameters
----------
graph : graph
A graph to be analyzed for its anomaly.
clusters : dict[list]
Dictionary of list containing node identifier for each clusters.
filename : str
Filename for anomaly detection result.
"""
self.graph = graph
self.clusters = clusters
self.filename = filename
self.property = {}
self.abstraction = {}
[docs] def write_property(self):
"""Write cluster property to a file.
"""
# get cluster abstraction and its properties
self.abstraction = ClusterAbstraction.dp_lcs(self.graph, self.clusters)
self.property = ClusterUtility.get_cluster_property(self.graph, self.clusters)
# write to csv
f = open(self.filename + '_anomaly.csv', 'wt')
writer = csv.writer(f)
# set header
header = ('cluster_id', 'cluster_abstraction') + tuple(self.property[0].keys())
writer.writerow(header)
# write data
for cluster_id, abstract in self.abstraction.iteritems():
row = (cluster_id, abstract) + tuple(self.property[cluster_id].values())
writer.writerow(row)


{title:'REST method execution statistics', created:'8.1.3', updated:'9.0.0'}
{@link oajr.annotation.Rest}-annotated classes get automated timing and error statistic information for all
If you extend from {@link oajr.servlet.BasicRestServlet} or {@link oajr.servlet.BasicRestObject}, then the statics are made available through the REST interface via the following method:
Rendered in a browser, it looks like this:
The default REST configuration provides a link to the stats in the navlinks section of the page:
The exception hash shown is the same hash that is shown in the log file and provides a quick way of locating the exception in the logs.
Programmatic access to the statistics are provided via the following methods:


UCR does not tolerate sexual violence in any form. That includes sexual assault, domestic violence, dating violence, stalking and rape. If you have been assaulted, you will be supported. If you know someone who has been assaulted, we will connect you to resources that will help.
UCR is committed to protecting students, empowering survivors, and responding quickly and compassionately to all reports of sexual violence.
UCR Campus Advocacy Resources & Education (CARE) advocates can explain your options in an unbiased, confidential, safe environment. They can help with everything from filing police reports to obtaining safe housing. Contact a CARE advocate.
Survivors of sexual violence and sexual assault have many rights, including the right
to have their disclosures treated seriously.  Learn more.
The Title IX/Sexual Harassment Office is UCR's central office for filing reports of sexual violence. Contact Title IX.
| Emergency Services | 911 |
| UCR Police |<PHONE_NUMBER> (911 on campus) |
| UCR Counseling Center |<PHONE_NUMBER> |
| Riverside County Regional Medical Center |<PHONE_NUMBER> |
| Riverside Area Rape Crisis Center |<PHONE_NUMBER> |
| Alternatives to Domestic Violence |<PHONE_NUMBER> |
| National Sexual Assault Network Helpline | 800-656-HOPE (4673) |
| Emergency Services | 911 |
| UC Police Department |<PHONE_NUMBER> |
| CARE Advocate |<PHONE_NUMBER> |
| Title IX/Sexual Harassment Office |<PHONE_NUMBER> |
| Student Affairs Case Manager |<PHONE_NUMBER> |
| Student Health Services |<PHONE_NUMBER> |
| Counseling Center |<PHONE_NUMBER> (24 hours) |
| Women's Resource Center |<PHONE_NUMBER> |
| Women’s Resource Center Survivors’ Support Group |<PHONE_NUMBER> |
| Lesbian Gay Bisexual Transgender Resource Center |<PHONE_NUMBER> |
| Assistant Director of Residence Life, Judicial |<PHONE_NUMBER> or 4252 |
| Student Conduct & Academic Integrity Programs |<PHONE_NUMBER> |
| Office of the Ombudsman |<PHONE_NUMBER> |
| Vice Chancellor of Diversity |<PHONE_NUMBER> or 6223 |
| Vice Provost for Academic Personnel |<PHONE_NUMBER> |
| Faculty and Staff Assistance Program Academic Personnel |<PHONE_NUMBER> |
| Riverside County Regional Medical Center |<PHONE_NUMBER> (24 hours) |
| Riverside Area Rape Crisis Center |<PHONE_NUMBER> (24 hours) |
| Alternatives to Domestic Violence |<PHONE_NUMBER> (24 hours) |
| National Sexual Assault Network Helpline | 800-656-HOPE (4673)(24 hours) |
• If you are in immediate danger, call 911.
• If you are not in immediate danger, contact the CARE advocate at<PHONE_NUMBER>.
• After hours, contact the Riverside Area Rape Crisis Center at<PHONE_NUMBER> or Alternatives to Domestic Violence (ADV) at<PHONE_NUMBER>.
UC Riverside: It's On Us
It's on us to stop sexual assault at UC Riverside. Join us! Take the pledge.


Managing App's Lifecycle using "Lifecycle Aware components" (Part 1)
Posted on August 12, 2017 in Development
This covers using ViewModel component to persist Activity configuration data across screen rotations.
Managing App's Lifecycle using "Lifecycle Aware components" (ViewModel)
Introduction
This post is first part of 3 parts series about recently introduced architecture components. This covers using ViewModel component to persist Activity configuration data across screen rotations.
This sample demonstrate how an app's lifecycle can be managed using recently introduced lifecycle aware components. Classes that can work with Lifecyle are known as lifecycle aware components.
These components helps app to : * Survive configuration changes. * Avoid memory leaks. * Easy data loading into app's UI.
Above is achieved using these libraries: * LiveData: LiveData is a data holder that keeps a value and allows it to be observed with in a specified lifecycle.
-
ViewModel: ViewModel class helps to store and manage data related to UI. Keeping UI related data in a separate ViewModel class helps to survive activity configuration data across screen rotation. Basically, ViewModel class prepares and provide data for/to UI.
-
LifecycleOwner: It's a class that has an Android Life cycle. Your Fragment/Activity may want to extend on of its subclasses like LifecycleFragment/LifecycleActivity to incorporate automatic handling of Lifecycle events.
-
LifecycleObserver: Marks a class as a LifecycleObserver.
Useful links: * Importing architecture components to your project
Set up
I'm using Android Studio 3.0 Beta1.
build.gradle
dependencies for ViewModel, Lifecycle and LiveData:
dependencies {
compile "android.arch.lifecycle:runtime:1.0.0-alpha5"
compile "android.arch.lifecycle:extensions:1.0.0-alpha5"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha5"
}
Using ViewModel to retain data across lifecylce of Activity/Fragment
I've a sample app with a simple TextView
. This textView displays a text
'Hello Random Number: onCreate()
method.
Before (Regular implementation)
Every time screen is rotated, onCreate()
method is called and generates
a new random number. This is how HelloRandomNumberActivity
looks like:
public class HelloRandomNumberActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_random_number);
TextView textView = findViewById(R.id.helloRandomNumber);
double randomNumber = Math.random();
textView.setText("Hello Random Number: " + randomNumber);
}
}
Feel free to try and run this code in action. You'll see every time you rotate your device's screen, a new random number is generated and displayed.
Checkout this video to see how screen rotation will re-generate new number again
After (Using ViewModel to retain Activity config data)
I'll be using ViewModel component to achieve the data persistence across screen rotations.
Here's is ViewModel to keep track of random number generated:
public class RandomNumberViewModel extends ViewModel {
@Nullable
private Double randomNumber;
@Nullable
public Double getRandomNumber() {
return randomNumber;
}
public void setRandomNumber(Double randomNumber) {
this.randomNumber = randomNumber;
}
}
This is how HelloRandomNumberActivity
looks like now:
public class HelloRandomNumberActivity extends LifecycleActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_random_number);
//ViewModelStore provides a new ViewModel or one previously created.
RandomNumberViewModel randomNumberViewModel =
ViewModelProviders.of(this).get(RandomNumberViewModel.class);
TextView textView = findViewById(R.id.helloRandomNumber);
String text = "Hello Random Number: ";
if (randomNumberViewModel.getRandomNumber() == null) {
double randomNumber = Math.random();
//assigning value to ViewModel
randomNumberViewModel.setRandomNumber(randomNumber);
textView.setText(text + randomNumber);
} else {
//display data from previous retained ViewModel
textView.setText(text + randomNumberViewModel.getRandomNumber());
}
}
}
Note: You may noticed that 'AppCompatActivity' is replaced with 'LifecycleActivity'. This is because lifecycle classes are not not supported in support libraries. Once Lifecycle classes are release, then it'll be available in Support library and so in 'AppCompatActivity'.
Try the code now ! There's no change in number every time screen is rotated.
Checkout this video to see how introducing ViewModel helps retaining the Activity configuration data
That's all you have to know to get started with using ViewModel architecture components in order to write better and maintainable android apps !
Checkout the source code at Github
I'll cover LiveData architecture component in next post.
Happy exploring !


Manager / Hire team login
Login successful.
You have logged in as {{loggedUser.firstName}} {{loggedUser.lastName}} ({{loggedUser.shortKey}})
System will redirect you to home page after 1 second...
Oops! Something wrong during your logging in...
{{errCode}}
Reason: {{errMessage}}
Logout successful.
Redirect to home page after 1 second...


Microservice architectural paradigm allows you to develop a single application as a set of loosely coupled, collaborating services.
Each service implements a set of narrowly, related functions and communicates with lightweight mechanisms, such as an REST API.
So instead of having a single codebase that handles all of the entities, now you have different services that are being deployed and scaled independently from each other.
Create Gateway and MicroService Projects
Let’s imagine that you are building an e-commerce application that have product catalog, takes orders from customers, and ships them.
The application consists of several components including the front-end, along with some backend services for customer registration, product catalog, and shipping orders.
Design MicroServices Domain
Now create the JPA diagram in MicroService project to design domain model.
Design Product MicroService Domain
Design Customer MicroService Domain
Generate Gateway
ECartGateway is an API gateway that provides a single, unified API entry point across one or more internal services like Product or Customer services etc.
Rather than invoking different services, clients simply talk to the gateway.
The API gateway is responsible for request routing. All requests from clients first go through the API Gateway, it then routes requests to the appropriate microservice.
To generate API Gateway, right click on any existing domain diagram (product, customer or any new empty diagram) :
Select the Gateway option and then select the project in which API Gateway source code will be generated, here we selected the ECartGateway project :
In the following screen, you can configure the angular module and application title :
Generate Product MicroService
In the previous section, we generated the API Gateway, Now we will generate the first microservice.
Right click on the Product diagram > Generate Source Code or (ctrl + G)
Make sure the front-end configuration (e.g angular here) should match with the API Gateway configuration because fontend code will be generated in ECartGateway Project.
Generate Customer and other MicroService
Similar to Product microservice; Customer, Order and other microservices can be generated.
Deploy :
Check docker environment
Deploy Registry
First start the consul, for registry service. docker run -d --name=consul -p 8500:8500 consul
Now, Consul should be available on${docker_ip}:8500
Deploy Gateway
Install all the dependencies listed within package.json :
yarn install yarn prettier:format
Copy the mvn command from source generation console of ECartGateway Project :
Set registry url for Service Discovery
Both system properties and environment variables can be used for configuration.
Similar to Product microservice deployment; Customer, Order and other microservices can be deployed, only make sure new port is assigned.
mvn install -P dev,docker -DskipTests -Dweb.host="http://<IP_ADDRESS>" -Dweb.port="8082" -Ddb.port="3308" -Dregistry.url="http://<IP_ADDRESS>:8500"


Authentication lends a measure of security to a distributed system by verifying the identity of components as they connect to the system. All components use the same authentication mechanism.
How Authentication Works
When a component initiates a connection to the distributed system,
the SecurityManager.authenticate
method is invoked.
The component provides its credentials in the form of properties
as a parameter to the authenticate
method.
The credential is presumed to be the two properties
security-username
and security-password
.
The authenticate
method is expected to either return an object
representing a principal or throw an AuthenticationFailedException
.
A well-designed authenticate
method will have a set of known user and password pairs that can be
compared to the credential presented or will have a way of obtaining those pairs.
How a Server Sets Its Credential
In order to connect with a locator that does authentication,
a server will need to set its credential, composed of the two properties
security-username
and security-password
.
There are two ways of accomplishing this:
Set the
security-username
andsecurity-password
in the server’sgfsecurity.properties
file that will be read upon server start up, as in the examplesecurity-username=admin security-password=xyz1234
The user name and password are stored in the clear, so the
gfsecurity.properties
file must be protected by restricting access with file system permissions.Implement the
getCredentials
method of theAuthInitialize
interface for the server. This callback’s location is defined in the propertysecurity-peer-auth-init
, as in the examplesecurity-peer-auth-init=com.example.security.MyAuthInitialize
The implementation of
getCredentials
may then acquire values for the propertiessecurity-username
andsecurity-password
in whatever way it wishes. It might look up values in a database or another external resource.
Gateway senders and receivers communicate as a component of their server member. Therefore, the credential of the server become those of the gateway sender or receiver.
How a Cache Client Sets Its Credential
In order to connect with a locator or a server that does authentication,
a client will need to set its credential, composed of the two properties
security-username
and security-password
.
To accomplish this:
Implement the
getCredentials
method of theAuthInitialize
interface for the client. This callback’s location is defined in the propertysecurity-client-auth-init
, as in the examplesecurity-client-auth-init=com.example.security.ClientAuthInitialize
The implementation of
getCredentials
may then acquire values for the propertiessecurity-username
andsecurity-password
in whatever way it wishes. It might look up values in a database or another external resource, or it might prompt for values.
How Other Components Set Their Credentials
gfsh
prompts for the user name and password upon invocation of
agfsh connect
command.
Pulse prompts for the user name and password upon start up.
Due to the stateless nature of the REST API,
a web application or other component that speaks to a server or locator
via the REST API goes through authentication on each request.
The header of the request needs to include attributes that define values for
security-username
and security-password
.
Implement SecurityManager Interface
Complete these items to implement authentication done by either a locator or a server.
- Decide upon an authentication algorithm.
The Authentication Example
stores a set of user name and
password pairs that represent the identities of components
that will connect to the system.
This simplistic algorithm returns the user name as a principal
if the user name and password passed to the
authenticate
method are a match for one of the stored pairs. - Define the
security-manager
property. See Enable Security with Property Definitions for details about this property. - Implement the
authenticate
method of theSecurityManager
interface. - Define any extra resources that the implemented authentication algorithm needs in order to make a decision.


Item 4.11.10.c. The average Polsby-Popper score of New Jersey's congressional districts is 0.20 while the average Polsby-Popper score of Pennsylvania's congressional districts is 0.33, thus Pennsylvania is more compact.


Ecosystem
Increasingly, packages are being built on top of pandas to address specific needs in data preparation, analysis and visualization. This is encouraging because it means pandas is not only helping users to handle their data tasks but also that it provides a better starting point for developers to build powerful and more focused data tools. The creation of libraries that complement pandas' functionality also allows pandas development to remain focused around its original requirements.
This is an inexhaustive list of projects that build on pandas in order to provide tools in the PyData space. For a list of projects that depend on pandas, see the libraries.io usage page for pandas or search pypi for pandas.
We'd like to make it easier for users to find these projects, if you know of other substantial projects that you feel should be on this list, please let us know.
Statistics and machine learning
Statsmodels
Statsmodels is the prominent Python "statistics and econometrics library" and it has a long-standing special relationship with pandas. Statsmodels provides powerful statistics, econometrics, analysis and modeling functionality that is out of pandas' scope. Statsmodels leverages pandas objects as the underlying data container for computation.
sklearn-pandas
Use pandas DataFrames in your scikit-learn ML pipeline.
Featuretools
Featuretools is a Python library for automated feature engineering built on top of pandas. It excels at transforming temporal and relational datasets into feature matrices for machine learning using reusable feature engineering "primitives". Users can contribute their own primitives in Python and share them with the rest of the community.
Compose
Compose is a machine learning tool for labeling data and prediction engineering. It allows you to structure the labeling process by parameterizing prediction problems and transforming time-driven relational data into target values with cutoff times that can be used for supervised learning.
Visualization
Altair
Altair is a declarative statistical visualization library for Python. With Altair, you can spend more time understanding your data and its meaning. Altair's API is simple, friendly and consistent and built on top of the powerful Vega-Lite JSON specification. This elegant simplicity produces beautiful and effective visualizations with a minimal amount of code. Altair works with Pandas DataFrames.
Bokeh
Bokeh is a Python interactive visualization library for large datasets that natively uses the latest web technologies. Its goal is to provide elegant, concise construction of novel graphics in the style of Protovis/D3, while delivering high-performance interactivity over large data to thin clients.
Pandas-Bokeh provides a high level API for Bokeh that can be loaded as a native Pandas plotting backend via
pd.set_option("plotting.backend", "pandas_bokeh")
It is very similar to the matplotlib plotting backend, but provides interactive web-based charts and maps.
seaborn
Seaborn is a Python visualization library based on matplotlib. It provides a high-level, dataset-oriented interface for creating attractive statistical graphics. The plotting functions in seaborn understand pandas objects and leverage pandas grouping operations internally to support concise specification of complex visualizations. Seaborn also goes beyond matplotlib and pandas with the option to perform statistical estimation while plotting, aggregating across observations and visualizing the fit of statistical models to emphasize patterns in a dataset.
plotnine
Hadley Wickham's ggplot2 is a foundational exploratory visualization package for the R language. Based on "The Grammar of Graphics" it provides a powerful, declarative and extremely general way to generate bespoke plots of any kind of data. Various implementations to other languages are available. A good implementation for Python users is has2k1/plotnine.
IPython Vega
IPython Vega leverages Vega to create plots within Jupyter Notebook.
Plotly
Plotly's Python API enables interactive figures and web shareability. Maps, 2D, 3D, and live-streaming graphs are rendered with WebGL and D3.js. The library supports plotting directly from a pandas DataFrame and cloud-based collaboration. Users of matplotlib, ggplot for Python, and Seaborn can convert figures into interactive web-based plots. Plots can be drawn in IPython Notebooks , edited with R or MATLAB, modified in a GUI, or embedded in apps and dashboards. Plotly is free for unlimited sharing, and has cloud, offline, or on-premise accounts for private use.
QtPandas
Spun off from the main pandas library, the qtpandas library enables DataFrame visualization and manipulation in PyQt4 and PySide applications.
IDE
IPython
IPython is an interactive command shell and distributed computing environment. IPython tab completion works with Pandas methods and also attributes like DataFrame columns.
Jupyter Notebook / Jupyter Lab
Jupyter Notebook is a web application for creating Jupyter notebooks. A
Jupyter notebook is a JSON document containing an ordered list of
input/output cells which can contain code, text, mathematics, plots and
rich media. Jupyter notebooks can be converted to a number of open
standard output formats (HTML, HTML presentation slides, LaTeX, PDF,
ReStructuredText, Markdown, Python) through 'Download As' in the web
interface and jupyter convert
in a shell.
Pandas DataFrames implement _repr_html_
and _repr_latex
methods which
are utilized by Jupyter Notebook for displaying (abbreviated) HTML or
LaTeX tables. LaTeX output is properly escaped. (Note: HTML tables may
or may not be compatible with non-HTML Jupyter output formats.)
See Options and Settings <options>
and
Available Options <options.available>
for pandas display.
settings.
quantopian/qgrid
qgrid is "an interactive grid for sorting and filtering DataFrames in IPython Notebook" built with SlickGrid.
Spyder
Spyder is a cross-platform PyQt-based IDE combining the editing, analysis, debugging and profiling functionality of a software development tool with the data exploration, interactive execution, deep inspection and rich visualization capabilities of a scientific environment like MATLAB or Rstudio.
Its Variable
Explorer allows
users to view, manipulate and edit pandas Index
, Series
, and
DataFrame
objects like a "spreadsheet", including copying and
modifying values, sorting, displaying a "heatmap", converting data
types and more. Pandas objects can also be renamed, duplicated, new
columns added, copyed/pasted to/from the clipboard (as TSV), and
saved/loaded to/from a file. Spyder can also import data from a variety
of plain text and binary files or the clipboard into a new pandas
DataFrame via a sophisticated import wizard.
Most pandas classes, methods and data attributes can be autocompleted in Spyder's Editor and IPython Console, and Spyder's Help pane can retrieve and render Numpydoc documentation on pandas objects in rich text with Sphinx both automatically and on-demand.
API
pandas-datareader
pandas-datareader
is a remote data access library for pandas
(PyPI:pandas-datareader
). It is based on functionality that was
located in pandas.io.data
and pandas.io.wb
but was split off in
v0.19. See more in the pandas-datareader
docs:
The following data feeds are available:
- Google Finance
- Tiingo
- Morningstar
- IEX
- Robinhood
- Enigma
- Quandl
- FRED
- Fama/French
- World Bank
- OECD
- Eurostat
- TSP Fund Data
- Nasdaq Trader Symbol Definitions
- Stooq Index Data
- MOEX Data
quandl/Python
Quandl API for Python wraps the Quandl REST API to return Pandas DataFrames with timeseries indexes.
pydatastream
PyDatastream is a Python interface to the Thomson Dataworks Enterprise (DWE/Datastream) SOAP API to return indexed Pandas DataFrames with financial data. This package requires valid credentials for this API (non free).
pandaSDMX
pandaSDMX is a library to retrieve and acquire statistical data and metadata disseminated in SDMX 2.1, an ISO-standard widely used by institutions such as statistics offices, central banks, and international organisations. pandaSDMX can expose datasets and related structural metadata including data flows, code-lists, and data structure definitions as pandas Series or MultiIndexed DataFrames.
fredapi
fredapi is a Python interface to the Federal Reserve Economic Data (FRED) provided by the Federal Reserve Bank of St. Louis. It works with both the FRED database and ALFRED database that contains point-in-time data (i.e. historic data revisions). fredapi provides a wrapper in Python to the FRED HTTP API, and also provides several convenient methods for parsing and analyzing point-in-time data from ALFRED. fredapi makes use of pandas and returns data in a Series or DataFrame. This module requires a FRED API key that you can obtain for free on the FRED website.
Domain specific
Geopandas
Geopandas extends pandas data objects to include geographic information which support geometric operations. If your work entails maps and geographical coordinates, and you love pandas, you should take a close look at Geopandas.
xarray
xarray brings the labeled data power of pandas to the physical sciences by providing N-dimensional variants of the core pandas data structures. It aims to provide a pandas-like and pandas-compatible toolkit for analytics on multi-dimensional arrays, rather than the tabular data for which pandas excels.
Out-of-core
Blaze
Blaze provides a standard API for doing computations with various in-memory and on-disk backends: NumPy, Pandas, SQLAlchemy, MongoDB, PyTables, PySpark.
Dask
Dask is a flexible parallel computing library for analytics. Dask
provides a familiar DataFrame
interface for out-of-core, parallel and
distributed computing.
Dask-ML
Dask-ML enables parallel and distributed machine learning using Dask alongside existing machine learning libraries like Scikit-Learn, XGBoost, and TensorFlow.
Koalas
Koalas provides a familiar pandas DataFrame interface on top of Apache Spark. It enables users to leverage multi-cores on one machine or a cluster of machines to speed up or scale their DataFrame code.
Odo
Odo provides a uniform API for moving data between different formats. It
uses pandas own read_csv
for CSV IO and leverages many existing
packages such as PyTables, h5py, and pymongo to move data between non
pandas formats. Its graph based approach is also extensible by end users
for custom formats that may be too specific for the core of odo.
Ray
Pandas on Ray is an early stage DataFrame library that wraps Pandas and transparently distributes the data and computation. The user does not need to know how many cores their system has, nor do they need to specify how to distribute the data. In fact, users can continue using their previous Pandas notebooks while experiencing a considerable speedup from Pandas on Ray, even on a single machine. Only a modification of the import statement is needed, as we demonstrate below. Once you've changed your import statement, you're ready to use Pandas on Ray just like you would Pandas.
# import pandas as pd
import ray.dataframe as pd
Vaex
Increasingly, packages are being built on top of pandas to address specific needs in data preparation, analysis and visualization. Vaex is a python library for Out-of-Core DataFrames (similar to Pandas), to visualize and explore big tabular datasets. It can calculate statistics such as mean, sum, count, standard deviation etc, on an N-dimensional grid up to a billion (10^9^) objects/rows per second. Visualization is done using histograms, density plots and 3d volume rendering, allowing interactive exploration of big data. Vaex uses memory mapping, zero memory copy policy and lazy computations for best performance (no memory wasted).
vaex.from_pandas
vaex.to_pandas_df
Data cleaning and validation
pyjanitor
Pyjanitor provides a clean API for cleaning data, using method chaining.
Engarde
Engarde is a lightweight library used to explicitly state your assumptions about your datasets and check that they're actually true.
Extension data types
Pandas provides an interface for defining
extension types <extending.extension-types>
to extend NumPy's type system. The following libraries
implement that interface to provide types not found in NumPy or pandas,
which work well with pandas' data containers.
cyberpandas
Cyberpandas provides an extension type for storing arrays of IP Addresses. These arrays can be stored inside pandas' Series and DataFrame.
Pandas-Genomics
Pandas-Genomics provides an extension type and extension array for working
with genomics data. It also includes genomics
accessors for many useful properties
and methods related to QC and analysis of genomics data.
Pint-Pandas
Pint-Pandas provides an extension type for storing numeric arrays with units. These arrays can be stored inside pandas' Series and DataFrame. Operations between Series and DataFrame columns which use pint's extension array are then units aware.
Accessors
A directory of projects providing
extension accessors <extending.register-accessors>
. This is for users to discover new accessors and for library
authors to coordinate on the namespace.
| Library | Accessor | Classes |
|---|---|---|
| cyberpandas | ip |
Series |
| pdvega | vgplot |
Series , DataFrame |
| pandas-genomics | genomics |
Series , DataFrame |
| pandas_path | path |
Index , Series |
| pint-pandas | pint |
Series , DataFrame |
| composeml | slice |
DataFrame |


Profile
About me
I'm a code geek interested more on mobile app development.
What I do
Working as a senior IT consultant.
My Hobbies
Reading books watching movies and playing all sports