The purpose of this library is to allow the easy setup of MarkLogic clusters on EC2.
Clone this git repository to a local directory - myDir say, using git clone https://github.com/mustard57/MarkLogicEC2ClusterSetup.git myDir
Make sure you have python 2.6. 2.7 does not work with boto ( see below ) - something to do with unicode. Python 3.0 and above does not work due to substantial syntactical refactoring.
You will need boto, your interface to EC2. More about it here - http://docs.pythonboto.org. You will find the python install in the lib directory - boto.2.3.0.tar.gz. Do
gunzip boto.2.3.0.tar.gz ; tar xvf boto.2.3.0.tar ; cd boto.2.3.0 ; python setup.py
to install. You can also download from http://code.google.com/p/boto/downloads/detail?name=boto-2.3.0.tar.gz&can=2&q=. Following install, you should be able to do 'import boto' in python.
Other versions may work, this is the one I used.
You will need rsa, a cryptographic library. I used version 3.1.1. You can find it in the lib directory - rsa-3.1.1.tar.gz. Do
gunzip rsa-3.1.1.tar.gz ; tar xvf rsa-3.1.1.tar ; cd rsa-3.1.1 ; python setup.py
to install. You can also download from http://pypi.python.org/pypi/rsa. This package is used if creating Windows instances. I recommend you don't - and if so you can comment out the rsa related stuff should you choose.
You need an EC2 account, funded by a credit card.
You need to set up a security group in EC2. This is a system of firewall rules. You're using MarkLogic so make sure ports 7998 - 8002 are open plus any port numbers you use for application servers. If using RedHat, open 22 for ssh. If using windows, open 3389 ( RDP ), 5985 for PowerShell, port 445 to mount remote directories and port 88 for active directory. Give your security group a name. This URL gives you the appropriate editor : https://console.aws.amazon.com/ec2/home?region=us-east-1#s=SecurityGroups
You need to set up a key pair. https://console.aws.amazon.com/ec2/home?region=us-east-1#s=KeyPairs. Your private key should probably be in your ~/.ssh directory.
Finally, in ~/.boto add your Amazon EC2 access keys. You get these from https://portal.aws.amazon.com/gp/aws/securityCredentials#access\_credentials
The file format can be seen here under the heading 'Example' http://code.google.com/p/boto/wiki/BotoConfig
If creating Windows instances you will need Windows Powershell on your machine, and you will need to run the refresh and setup commands at least from DOS as administrator.
All the config is in config.ini. You need to specify ( in the Configuration section )
RSA_PRIVATE_KEY - the file where your private key is. You only need to specify this if using Windows instances, for decrypting the Windows password using rsa.
HOST_COUNT - the number of hosts you want in your cluster
ADMIN_USER_NAME - the name of your MarkLogic admin user
ADMIN_PASSWORD - your MarkLogic admin password
CLUSTER_NAME - the name you would like your cluster to be given
USE_ELASTIC_IP - set to TRUE or FALSE. Elastic IPs are permanent IPS which means you can 'save' your cluster. Without them, once you stop your cluster, you will loose all your data.
MSTSC_PASSWORD - set this if you are using Windows. It is the password you will use when logging in using terminal services.
INSTANCE_SIZE - this should be one of t1.micro, m1.small, m1.medium, m1.large, m1.xlarge - this governs how much memory / cpu you have. See http://aws.amazon.com/ec2/instance-types/ for more detail
INSTANCE_TYPE - set to one of RedHat or Windows. This governs your cluster platform
DISK_CAPACITY - if using RedHat, sets the size of the MarkLogic data partition ( in Gb )
EC2_SECURITY_GROUP_NAME - the name of your EC2 security group ( see above )
EC2_KEY_PAIR_NAME - the name of your EC2 key pair - see above.
In the license details section,
LICENSE_KEY - the 12 * 4 char ( plus hyphens ) license key you will be using. Note that if you are using clustering you need an Enterprise key.
LICENSEE - the licensee name
LICENSE_TYPE - if you have a full MarkLogic key use 'development', otherwise 'evaluation' - though this probably will not have enterprise capability.
The following commands are available : thaw|help|freeze|status|cluster|clean|create|setup|refresh|restart|devices|remote|all
They are called by typing
ec2setup.sh cmd - where cmd is one of the above commands. Use ec2setup.bat if calling from DOS.
In theory, having done the above config you should be able to type
ec2setup.sh all
and an n node cluster will be built for you. In the html sub-directory of myDir you will get a html file that you can click on to take you to the admin console for the host in question.
To understand the commands in more detail, let's focus on using just one instance.
ec2setup.sh create will create your ec2 node for you, based on INSTANCE_TYPE, INSTANCE_SIZE, EC2_SECURITY_GROUP_NAME and EC2_KEY_PAIR_NAME. If INSTANCE_TYPE=RedHat, a disk volume will be mounted of size DISK_CAPACITY. If USE_ELASTIC_IP is true, you will be assigned a fixed elastic ip.
Here is some sample output
Run mode is create
Created instance i-dc4803a1
Instance not yet in running state
Elastic IP <IP_ADDRESS> added
Elastic IP added for host i-dc4803a1 - <IP_ADDRESS>
10G disk volume created
Your instance id ( i-dc4803a1 in the above output ) will be written to host_file.txt. If you are using elastic ips that will be written to elastic_ip.txt.
ec2setup.sh status will give you some basic status info e.g.
Run mode is status
Host i-dc4803a1 is in the running state with dns = ec2-54-243-182-139.compute-1.amazonaws.com
You can also use the Amazon console : https://console.aws.amazon.com/ec2
If you want to set up MarkLogic on this host type
ec2setup.sh setup
This will install MarkLogic on your host, using the license credentials above. The security user will be ADMIN_USER_NAME with password ADMIN_PASSWORD. If INSTANCE_TYPE=Windows, your rdp password will be set to MSTSC_PASSWORD. Note that Windows boxes are assigned an initial password by EC2 - but this can take up to half an hour to complete. ec2setup.sh setup will loop until this password is found. It is recommended that 15 min or so are left between create and setup for windows boxes as premature requests for the windows password seem to result in instance unreliability in my experience. Setting MSTSC_PASSWORD requires your ssh private key to descrypt the initial password, hence the specification of RSA_PRIVATE_KEY.
The install will add some xqy files to the Admin directory of your remote host, used for naming the host ( it is given its EC2 dns name ), and setting up clustering.
If using RedHat, your block storage will be mapped, using ln, to the device name /dev/sdf ( specified by EXPECTED_EBS_DEVICE_NAME in config.ini). This is a little workaround required as the EC2 for attaching storage does not use the name you supply! MarkLogic will not start on EC2 without a device on /dev/sdf. Note the setup scripts will format the storage and mount at /var/opt/MarkLogic.
'Local' ( host based ) firewalls ( both Windows and RedHat ) will be turned off.
You will get some useful files following setup. In the html directory, a file with name dns-name.admin.html which when clicked will take you to the admin console. If INSTANCE_TYPE=RedHat, a file called dns-name.ssh.sh will be written to the sessions directory. If run using source
If using windows you get the html file. Also in the mstsc directory a file called dns-name.rdp. In the sessions directory a file called dns-name.session.ps1. If run using powershell -noexit -file
The windows setup is more complex than the RedHat install. Python 2.6 is native to the RedHat virtual image, but has to be installed for Windows. Also copying / downloading is more difficult. If you look in server-setup.ps1 you can see what's needed.
You can 'freeze' your instance using
ec2setup.sh freeze
This will stop your instance, but will keep your data. The advantage of this is that you do not incur CPU charges, only disk charges. Storage charges are 10c per Gb per month i.e. approx 0.33 cents per day per Gb, or 10 cents per day for 30Gb - a typical per host charge. The minimum instance charge is 2c per hour or 48c per day ( for the micro instance ) and around 32c per hour or $7.68 per day for large instances. So stopping saves you money. Typical output is
Run mode is freeze
Stopping host i-052baa78
Instance not yet in stopped state
Instance not yet in stopped state
Host stopped
The opposite of freeze is thaw. You can thaw your instance using
ec2setup.sh thaw
This will restart your instance, add your previously defined IPs if USE_ELASTIC_IP = true,
Run mode is thaw
Starting host i-dc4803a1
Instance not yet in running state
Elastic IP added for host i-dc4803a1 - Address:<IP_ADDRESS>
Check device mapping ...
Host started
If using RedHat, your block storage device mapping ( see above ) will be re-mapped using ln. This can sometimes fail - see below for what to do if this happens.
If running with elastic IPs, or running as a single node, you are good to go following a thaw. However, if you are not using elastic IPs and clustering, your hosts will no longer be able to communicate after a freeze / thaw as the dns names they used to communicate are no longer valid. The bootstrap host will have they other two hosts in the 'disconnected' state.
In this instance you can do a refresh. This re-installs MarkLogic, but does not need to go through the preliminary steps of downloading MarkLogic, copying files across, mapping the block storage. This is particularly relevant when using Windows machines as you do not have to wait will an admin password is assigned. Thawing an instance is faster than creating one also.
To refresh run
ec2setup.sh refresh
Here is some sample output
Run mode is refresh
Refreshing i-dc4803a1
Stopping MarkLogic
Stopping MarkLogic: .[ OK ]
Remove previous install
Install MarkLogic
Loaded plugins: amazon-id, product-id, rhui-lb, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Examining MarkLogic-6.0-1.1.x86\_64.rpm: MarkLogic-6.0-1.1.x86\_64
MarkLogic-6.0-1.1.x86\_64.rpm: does not update installed package.
Error: Nothing to do
Starting MarkLogic: [ OK ]
Stopping MarkLogic: .[ OK ]
Starting MarkLogic: [ OK ]
Configuring auth for <http://localhost:8001>
2. Installing
3. Starting MarkLogic Instance
4. Configuring licence details
5. Accepting EULA
6. Triggering initial application server config
7a. Restarting Server
7b. Restarting Server
8. Configuring Admin user (security)
9. Testing Admin Connection
Move set host name script
Setting host name
Script completed, visit <http://ec2-54-243-182-139.compute-1.amazonaws.com:8001> to access the admin interface.
Finally, you can run the clean command
ec2setup.sh clean
This will terminate your instance and remove any associated elastic ips and block storage. Sample output :
Run mode is clean
Terminating host i-dc4803a1
Instance not yet in terminated state
Instance not yet in terminated state
Removing volume vol-e155519b
All the above examples show the library working in single instance mode. In fact, the commands thaw,freeze,clean,setup,status,refresh,restart,devices can all take 0 or one arguments. If run without arguments, all hosts listed in host_file.txt, which is populated using the create command, are iterated over. Alternatively you can supply an index e.g.
ec2setup.sh freeze 2
will freeze the second host listed in hosts_file.txt. Or you can supply the id of the host e.g. ec2setup.sh freeze i-dc4803a1freeze i-dc4803a1_.
The create command, if run with an integer e.g.
ec2setup.sh create 5
will create that number of hosts, in this case 5.
After you have run something like
ec2setup.sh create 5
ec2setup.sh setup
you can run 'cluster' - which will add all your hosts into a cluster, with the first host created as the bootstrap host. Sample output :
ec2setup.sh cluster
Run mode is cluster
Configuring auth for http://ec2-54-243-185-5.compute-1.amazonaws.com:8001
Configuring auth for http://ec2-54-243-185-6.compute-1.amazonaws.com:8001
Joining Cluster
Configuring auth for http://ec2-54-243-185-7.compute-1.amazonaws.com:8001
Joining Cluster
Configuring auth for http://ec2-54-243-185-5.compute-1.amazonaws.com:8001
Joining Cluster II
Configuring auth for http://ec2-54-243-185-6.compute-1.amazonaws.com:8001
Restarting...
Configuring auth for http://ec2-54-243-185-5.compute-1.amazonaws.com:8001
Joining Cluster II
Configuring auth for http://ec2-54-243-185-7.compute-1.amazonaws.com:8001
Restarting...
Configuring auth for http://ec2-54-243-185-5.compute-1.amazonaws.com:8001
Setting cluster name to Master
`
Clustering requires two calls for each host - one to add to the cluster and one to write the cluster info back to the original host. Hosts are restarted following addition to a cluster. Finally the cluster is named using CLUSTER_NAME from config.ini
If you run
ec2setup.sh all
this will create n hosts where n is equal to HOST_COUNT in config.ini. It will then run setup for each host, followed by cluster. The only problem is that at the time setup is called, hosts may not be 'ready' - resulting in errors. By and large, try this, if you get errors, run setup against the hosts that failed, followed by cluster.
We have not yet looked at restart, devices, remote and help.
When thawing a cluster, with elastic ips, in theory you can start using this straight away. In practice, the block storage, where the MarkLogic data assets are kept will have been dismounted and re-mounted, and the elastic ip assigned after host startup, which may leave a running MarkLogic process in an non-usable state. So
ec2setup.sh restart
is a good idea - which will restart MarkLogic on all your hosts. You can restart a single host using
ec2setup.sh restart index
If for some reason the block storage device mapping has not taken place correctly (signified by a 'bad file number') error then use
ec2setup.sh devices index
to remount the volume for a particular host.
ec2setup.sh help
gives you a list of commands
To log into a box at the command line do
ec2setup.sh remote index
You will be logged in using ssh if the cluster is a UNIX cluster, and using powershell if the cluster is Windows based.
There is an per user elastic ip limit of five addresses, otherwise it would always make sense to use elastic ips. This is encoded into config.ini as EC2_ELASTIC_IP_LIMIT.
There are a number of constants in config.ini, which can be changed, but which should probably not be.
HOST_FILE = host_file.txt - the file where host ids are stored
ELASTIC_IP_FILE = elastic_ip.txt - the file where elastic ips are stored
EC2_ELASTIC_IP_LIMIT = 5 - the elastic ip limit
WINDOWS_IMAGE_ID = ami-71b50018 - the EC2 image used to create Windows hosts
REDHAT_IMAGE_ID = ami-cc5af9a5 - the EC2 image used to create Red Hat hosts
WINDOWS_INSTALL_DIR = c:\users\administrator\ - the directory where assets are stored during the setup phase, for Windows hosts
REDHAT_INSTALL_DIR = /tmp - the directory where assets are stored during the setup phase, for Red Hat hosts
MARKLOGIC_WINDOWS_ROOT = C:\Program Files\MarkLogic\ - the install directory for MarkLogic on Windows
MARKLOGIC_REDHAT_ROOT = /opt/MarkLogic/ - the install directory for MarkLogic on Red Hat
MARKLOGIC_REDHAT_DATA_ROOT = /var/opt/MarkLogic - the data directory for MarkLogic on Red Hat
EBS_DEVICE_NAME = /dev/sdh - the name given to the additional block storage when creating Red Hat instances. Note EC2 does not actually use this
EXPECTED_EBS_DEVICE_NAME = /dev/sdf - the desired device name of the added block storage
ACTUAL_EBS_DEVICE_NAME = /dev/xvdl - the actual device name of the added block storage - we do ln /dev/xvdl /dev/sdf during setup / thaw to make sure MarkLogic can find the /dev/sdf device
The versions of MarkLogic are used here, and the download location e.g.
MARKLOGIC_WINDOWS_EXE = MarkLogic-6.0-1.1-amd64.msi
MARKLOGIC_REDHAT_EXE = MarkLogic-6.0-1.1.x86_64.rpm
MARKLOGIC_DOWNLOAD_URL = http://developer.marklogic.com/download/binaries/6.0/
PYTHON_DOWNLOAD_URL = http://www.python.org/ftp/python/2.6/
PYTHON_EXE = python-2.6.amd64.msi
PYTHON_INSTALL_DIR = c:\python26
We also specify the python install location for windows, and its install location.
The script ec2setup-parallel.sh can be used to execute commands in parallel. For instance
ec2setup-parallel.sh setup
will execute ec2setup.sh setup for each node in host_file.txt, but will execute in parallel.
Other commands that can be executed in this way are thaw, freeze, clean, create, setup, refresh, restart, devices.
ec2setup-parallel.sh all
will execute
ec2setup-parallel.sh create
ec2setup-parallel.sh setup
ec2setup-parallel.sh cluster


Command Line Reflection:
Command tool you give it instructions and it finds what you need.
No I didn’t because I didn’t understand what I was doing.
• Ls – listing what was in a file
• Cd changing directory
• Mkdir making a directory
• Touch make or create a file directory
• Cat – showing the content
It took me a long time to start to understand the terminal being git and the directory being windows/ file directory. That was a surprise because I thought after hours of rewatching you tube and starting again that I would never even begin to understand what was going on.
Version control Reflection:
Git is software as in you download it to your computer – Git Hub is a service that you sign up to, to interact with the software and share with others and store content – kind of like a social media app?
Git is where you build and GitHub is where you share what you are building and make it better, get tips and support, eventually show off. It’s like mission control?
If I don’t revisit this information regularly, I will not remember it – although today I believe I wont forget Git, GitHub and version control!
I did not keep to the recommended time as currently I need a lot more to get my head around it all.
Install and Explore Reflection:
I have not finished this - I’m thinking that the workflow is a series of changes recorded as ‘commits’ as part of the bigger picture. I’m unsure as yet how this works
I need to constantly go back and relook at information, often starting from the beginning over and over until I get a flicker of understanding, not quite ‘lightbulb’ moments yet.
In a perfect world I would make sure I was a lot more familiar with my new computer and windows 10. I would be totally uninterrupted which is an absolute luxury and I would have a better seat.
I don’t feel like I’m adequately set up with GIT and GitHub – something is missing, I’m missing something important. I haven’t made a project, repository to enable me to make checkpoints, commits. I need to understand repositories and branches better.
Your git Commit history is visible to us and we use it to assess your participation and engagement. Throughout the course we'll be looking at the frequency and consistency. So engage daily and commit often.
How do I do this?? Where is this available…
 If you get lost or take a wrong turn you can go back and explore another path. You can leave instructions and updates at the checkpoints so you remember what happened on the journey. Commits are safety nets so you don’t get lost or lose your way back.
Branch, Pull, Merge, Primer Reflection:
Master is the original repository, project, it’s the master copy the master plan.
You would create a branch to make changes, fix things, try new ideas. You would create a new branch to test theories without affecting the master plan or overriding anyone elses work.
The introduced concepts feel like I’m trying to communicate with someone in a different language and I have no idea what they are saying. But I can pick up on their expressions and emotions through non verbal cues.
So both difficult to understand and intuitive


Create your first Angular app
Templates
Dependency-Injection
Component-Tree
Custom-Events
Angular is written in TypeScript, a superset of JavaScript. Learn
TypeScript.
Learn how to create and bootstrap your first Angular application
Learn how to use Angular templates
Learn how to provide dependencies to your code instead of hard-coding them
Learn how to structure your app with reusable components
Learn to bind to events.


Progress Bar with Slider
This page demonstrates how to use Zapatec.ProgressBar class with Slider.
Progress (default theme):
Progress (solid theme):
Progress (image theme):
Progress (float values):
Set progress
Control:
This page uses an
AJAX Component
- Zapatec DHTML Extra Widget, but your browser does not support Javascript.


| id | time | job | queue | user | status | exit status | node | actions |
|---|---|---|---|---|---|---|---|---|
| {{item.id}} | {{item.start_time}} | {{item.job}} | {{item.queue}} | {{item.user}} | Completed Success Completed Error Completed... Running Queued Exiting Holding Moving Waiting Suspended | {{item.exit_status}} | {{item.wn}} | |


Gecode::Kernel Namespace Reference
Kernel functionality More...
Namespaces | |
| namespace | MemoryConfig |
Parameters defining memory management policy for spaces. | |
| namespace | Config |
Classes | |
| class | FunctionBranch |
| Brancher for calling a function More... | |
| class | ViewOcc |
| Occurence information for a view. More... | |
| class | GPI |
| Global propagator information. More... | |
| class | MemoryChunk |
| Memory chunk with size information. More... | |
| class | HeapChunk |
| Memory chunk allocated from heap with proper alignment. More... | |
| class | SharedMemory |
| Shared object for several memory areas. More... | |
| class | MemoryManager |
| Manage memory for space. More... | |
| class | SharedSpaceData |
| Class to store data shared among several spaces. More... | |
Functions | |
| bool | duplicates (void **p, int n) |
| Check whether p has duplicates among its n elements (changes p). | |
| bool | duplicates (void **p, int n, void **q, int m) |
| Check whether p has common elements with q. |
Detailed Description
Kernel functionality
Kernel configuration parameters.
Function Documentation
| bool Gecode::Kernel::duplicates | ( | void ** | p, | |
| int | n | |||
| ) |
Check whether p has duplicates among its n elements (changes p).
| bool Gecode::Kernel::duplicates | ( | void ** | p, | |
| int | n, | |||
| void ** | q, | |||
| int | m | |||
| ) |
Check whether p has common elements with q.


SmartOptions, the Next Generation Command Line Parameter processing library for C++.
SmartOptions is used for processing command line parameters. It has been inspired by the command line processing in Python.
The benefit of SmartOptions is that it parses the command line parameters, and automatically populates the variables, so the developer can concentrate on the business logic, instead of parsing and getting the values from the command line parameters.
Salient Features of SmartOptions are:
- It handles the POSIX style single character options ( -w ) as well as the newer GNU long options ( –width )
- Is platform independent.
- Requires minimal effort to parse Command Line Arguments, and allows you to concentrate on business logic.
- Retrieves the Command Line arguments and populates the variables automatically.
- Supports printing out Help and Usage messages automatically.
SmartOptions processes 3 types of command line arguments:
- Option - has an associated value ( -w 100 )
- Flag - no value, just a boolean flag ( -nogui )
- Positional - has only value ( path )
Why not just use getopt() ?
- getopt() Its a POSIX standard not part of ANSI-C and hence its not available on platforms like Windows.
- Processing Command Line Arguments using getopt() is tedious, time consuming and everything needs to be done by the programmer.
Code Sample:
smartOptions.
AddUsage(
"[OPTION]... <POSITIONAL_ARG>");
const char *posArg_1 = NULL;
bool aFlag=false;
smartOptions.
AddFlag(
'a', NULL,
"a-Flag", &aFlag);
char *bOption = NULL;
smartOptions.
AddOption(
'b', NULL,
"B_VAR",
"b-Option", &bOption);
int statusCode = kxSmartOptionsProcessCommandArgs(handle, argc, argv);
exit(statusCode);
}
if (aFlag) {
}
if (bOption) {
}


Recently, the world's last male northern white rhino has died leaving only two females left to save the subspecies from extinction. It is again alarming us what a severe situation wildlife animals or plants is facing. Worldwide, one in every three species of amphibian is endangered, 39 species have gone extinct in the last 500 years and another 130 species are suspected to have gone extinct in recent decades.
Worldwide Distribution Of Wildlife Trade in 2017
Total Weight of Wild Life Traded
20+ million kg
Number of Taxon of Wild Life Traded
3000+
Number of Genus of Wild Life Traded
800+
Distribution of Amount of Exported Wildlife Across Continents
All the small circles represent for countries with no report of wildlife trade, which means either they are not officially listed for international wildlife regulation, or the data is missing. From the current data, we can see that most wildlife are exported from Asia, South Africa, and Africa. This fact raises our concern for the current status of wildlife in these continents. However, since the current data is not very complete, it’s very hard to use it to study its relationship with the potential impact on biodiversity or the economy of these continents.
Top ten countries of export and import (kg)
Japan, China, and the United States are the biggest importers of wildlife. The amount of total quantity of wildlife trade from these three countries is tremendously greater than the other countries, which is about more than 50% of the overall international wildlife traded.
Proportion of Different Class of Wildlife Traded
Purposes of Different Class of Wildlife Traded
Other purposes: Breeding, Educational, Hunting trophy, Law enforcement
Other classes: Aves, Hirudinoidea, Amphibia, Hydrozoa, Bivalvia, Aves, Holothuroidea, etc.


import {ZoneOffsetTransition} from<EMAIL_ADDRESS>ZoneOffsetTransition
A transition between two offsets caused by a discontinuity in the local time-line.
A transition between two offsets is normally the result of a daylight savings cutover. The discontinuity is normally a gap in spring and an overlap in autumn. ZoneOffsetTransition models the transition between the two offsets.
Gaps occur where there are local date-times that simply do not not exist.
An example would be when the offset changes from +03:00
to +04:00
.
This might be described as 'the clocks will move forward one hour tonight at 1am'.
Overlaps occur where there are local date-times that exist twice.
An example would be when the offset changes from +04:00
to +03:00
.
This might be described as 'the clocks will move back one hour tonight at 2am'.
Static Method Summary
| Static Public Methods | ||
| public static |
of(transition: LocalDateTime, offsetBefore: ZoneOffset, offsetAfter: ZoneOffset): ZoneOffsetTransition Obtains an instance defining a transition between two offsets. |
Method Summary
| Public Methods | ||
| public |
compareTo(transition: ZoneOffsetTransition): number Compares this transition to another based on the transition instant. |
|
| public |
Gets the local transition date-time, as would be expressed with the 'after' offset. |
|
| public |
Gets the local transition date-time, as would be expressed with the 'before' offset. |
|
| public |
Gets the duration of the transition. |
|
| public |
durationSeconds(): number Gets the duration of the transition in seconds. |
|
| public |
equals(other: *): * Checks if this object equals another. |
|
| public |
hashCode(): number Returns a suitable hash code. |
|
| public |
Gets the transition instant. |
|
| public |
isGap(): boolean Does this transition represent a gap in the local time-line. |
|
| public |
isOverlap(): boolean Does this transition represent a gap in the local time-line. |
|
| public |
isValidOffset(offset: ZoneOffset): boolean Checks if the specified offset is valid during this transition. |
|
| public |
Gets the offset after the transition. |
|
| public |
Gets the offset before the transition. |
|
| public |
toEpochSecond(): number Gets the transition instant as an epoch second. |
|
| public |
toString(): string Returns a string describing this object. |
|
| public |
validOffsets(): ZoneOffset[] Gets the valid offsets during this transition. |
Static Public Methods
public static of(transition: LocalDateTime, offsetBefore: ZoneOffset, offsetAfter: ZoneOffset): ZoneOffsetTransition source
Obtains an instance defining a transition between two offsets.
Applications should normally obtain an instance from ZoneRules. This factory is only intended for use when creating ZoneRules.
Params:
| Name | Type | Attribute | Description |
| transition | LocalDateTime | the transition date-time at the transition, which never actually occurs, expressed local to the before offset, not null |
|
| offsetBefore | ZoneOffset | the offset before the transition, not null |
|
| offsetAfter | ZoneOffset | the offset at and after the transition, not null |
Throw:
* |
IllegalArgumentException if offsetBefore and offsetAfter are equal, or transition.getNano returns non-zero value |
Public Methods
public compareTo(transition: ZoneOffsetTransition): number source
Compares this transition to another based on the transition instant.
This compares the instants of each transition. The offsets are ignored, making this order inconsistent with equals.
Params:
| Name | Type | Attribute | Description |
| transition | ZoneOffsetTransition | the transition to compare to, not null |
Return:
| number | the comparator value, negative if less, positive if greater |
public dateTimeAfter(): LocalDateTime source
Gets the local transition date-time, as would be expressed with the 'after' offset.
This is the first date-time after the discontinuity, when the new offset applies.
The combination of the 'before' date-time and offset represents the same instant as the 'after' date-time and offset.
public dateTimeBefore(): LocalDateTime source
Gets the local transition date-time, as would be expressed with the 'before' offset.
This is the date-time where the discontinuity begins expressed with the 'before' offset. At this instant, the 'after' offset is actually used, therefore the combination of this date-time and the 'before' offset will never occur.
The combination of the 'before' date-time and offset represents the same instant as the 'after' date-time and offset.
public duration(): Duration source
Gets the duration of the transition.
In most cases, the transition duration is one hour, however this is not always the case. The duration will be positive for a gap and negative for an overlap. Time-zones are second-based, so the nanosecond part of the duration will be zero.
public durationSeconds(): number source
Gets the duration of the transition in seconds.
Return:
| number | the duration in seconds |
public equals(other: *): * source
Checks if this object equals another.
The entire state of the object is compared.
Params:
| Name | Type | Attribute | Description |
| other | * | the other object to compare to, null returns false |
Return:
| * | true if equal |
public instant(): Instant source
Gets the transition instant.
This is the instant of the discontinuity, which is defined as the first instant that the 'after' offset applies.
The methods getInstant, getDateTimeBefore and getDateTimeAfter all represent the same instant.
public isGap(): boolean source
Does this transition represent a gap in the local time-line.
Gaps occur where there are local date-times that simply do not not exist.
An example would be when the offset changes from +01:00
to +02:00
.
This might be described as 'the clocks will move forward one hour tonight at 1am'.
Return:
| boolean | true if this transition is a gap, false if it is an overlap |
public isOverlap(): boolean source
Does this transition represent a gap in the local time-line.
Overlaps occur where there are local date-times that exist twice.
An example would be when the offset changes from +02:00
to +01:00
.
This might be described as 'the clocks will move back one hour tonight at 2am'.
Return:
| boolean | true if this transition is an overlap, false if it is a gap |
public isValidOffset(offset: ZoneOffset): boolean source
Checks if the specified offset is valid during this transition.
This checks to see if the given offset will be valid at some point in the transition. A gap will always return false. An overlap will return true if the offset is either the before or after offset.
Params:
| Name | Type | Attribute | Description |
| offset | ZoneOffset | the offset to check, null returns false |
Return:
| boolean | true if the offset is valid during the transition |
public offsetAfter(): ZoneOffset source
Gets the offset after the transition.
This is the offset in use on and after the instant of the transition.
public offsetBefore(): ZoneOffset source
Gets the offset before the transition.
This is the offset in use before the instant of the transition.
public toEpochSecond(): number source
Gets the transition instant as an epoch second.
Return:
| number | the transition epoch second |
public toString(): string source
Returns a string describing this object.
Return:
| string | a string for debugging, not null |
public validOffsets(): ZoneOffset[] source
Gets the valid offsets during this transition.
A gap will return an empty list, while an overlap will return both offsets.


Are you sure? All your progress and data will be cleared, and this action cannot be undone.
You are not allowed to play yet. You have not read the rules nor have you confirmed your browser type.
| Rank | Name | Money | Streak | Date |
|---|---|---|---|---|
| 001 | ||||
| 002 | ||||
| 003 | ||||
| 004 | ||||
| 005 | ||||
| 006 | ||||
| 007 | ||||
| 008 | ||||
| 009 | ||||
| 010 |
Total Games Played: 0


{% extends "base.html" %} {% block title %}{{ super() }} Results!{% endblock %} {% block content %}
Looking for tweets...
{a tweet.text a}
Unbelievable! Couldn't find any tweets for that!
{a tweeter.msg a}
Looking for wikipedia pages...
Loading summary...
{a page.summary a}
Unbelievable! Couldn't find any wikipedia pages for that!
{a wikier.msg a}


Don't leave your cryptocurrency in anyone's hands. Many people have already lost a lot of money by relying too much on others. With Walltime Zero™ you receive cripto directly from the seller to your wallet.
Keep your favorite cryptocurrency as decentralized as possible, as it really should be. Centralization can artificially inflate your cryptocurrency making it worth less.
Once the cryptocurrency is confirmed on the Blockchain, the transfer is made to your account. Keep your money as short as possible in the hands of others.


Tech update, getting read y for 3rd wave down on daily.
no need to be in a rush to buy
CryptoNinjaa22-Jan-19 10:13 AM
tried for you Lumbi but the site is being weird "This email address is already associated with another Canny account, did you mean to log in?" endless loop
"There is no Canny account associated with this account."  Is a token sale over, but it's yet to begin trading? Request it here! (Please use the Request an Exchange form to request an unsupported exchange)
LUMBER forms a essential part of the Lumberscout trading platform that will facilitate the crypto-conditioned global trade of forest products and commodities
you can make one of such per enything you can trade and just copy-paste into millions.... = scam to me
crypto-conditioned global trade of [water] products, crypto-conditioned global trade of [iron] products, crypto-conditioned global trade of [millions other] products
golde/silver/copper/music/audio/trump/putin token... who believes that? (edited)
The 2008 financial crisis spread distrust in banks and sped up the acceptance of new kinds of money. Cryptocurrencies like Bitcoin now promise to provide tra...
ComputerGenie 👴👴👴22-Jan-19 11:05 AM
What has a better ring to it is not presenting Bitcoin as a god
Do you call the Euro "the new USD" or an "altcurrency"?
Lumbi22-Jan-19 11:06 AM
@ComputerGenie 👴👴👴 touché! a sneaky 'maximalist' reference point! (edited)
ComputerGenie 👴👴👴22-Jan-19 11:10 AM
yes, the entire "alt" concept is that it must be an alternative to something and no one in this space sees it as meaning an alternative to fiat, but rather an alternative to Bitcoin (which means that you're on the defensive from the start by forcing yourself to show Bitcoin is "lesser than")
not much but i think about to buy them for 0.025 to 0.035 kmd is very cheap.
what do you think?
Hollowman900022-Jan-19 01:57 PM
USB encrapted
Who knows
PTYX22-Jan-19 02:38 PM
@Hollowman9000 has returned
6
Hollowman900022-Jan-19 03:53 PM
It’s a sign
Dump to $870 btc
jl777c22-Jan-19 03:54 PM
done
Hollowman900022-Jan-19 06:36 PM
Excellent
LocoMB22-Jan-19 07:17 PM
wooot! I am going to bed... dobn't poke the bear anyone while I am slumbering guys!
richardt22-Jan-19 09:22 PM
The price always goes up after I sell and goes down after I buy. Anyone else also have this problem?
polycryptoblog22-Jan-19 09:27 PM
everyone has that problem lol
ComputerGenie 👴👴👴22-Jan-19 09:28 PM
buys the dip, sells the peak, and lacks that issue(edited)
1
1
richardt22-Jan-19 09:39 PM
I suppose I need a different strategy. Buy when I think price will go down and sell when I think it'll go up
ComputerGenie 👴👴👴22-Jan-19 09:46 PM
then, might I suggest doing the opposite of what you think you should do....
Cryptoon22-Jan-19 09:47 PM
I dont sell
hodl
new laptop, should really transfer my wallets to new device
meatspoon22-Jan-19 10:56 PM
can one or more of the TA guys in here share their thoughts about the hourly BTC chart? With so many big red/green dildos and Bart Simpson style movements, it seems to me that this gentle, rounded swell preceded by 40+ sideways candles is very unusual.
Likewise22-Jan-19 11:35 PM
BTC, still same range, my bias is still bearish, guess we will range around a bit more before attempting to push through the 3200 low in a few days/weeks.
in bullish scenario we need to break above 4200 for any meaningful run. Not going to happen IMO, TA looks horrible, macro fundamentals are not telling us a clear story. ETF's, will know final decision on 27/2/2019, Bakkt ?
KMD seems to have made support at 1800. could continue its way upwards to 3200
if support here holds......
2
meatspoon23-Jan-19 03:00 AM
thanks for your input, @Likewise . But I guess i was more interested in an explanation or theory as to the specific 1-hour pattern that formed. I have been watching for a long time and it seemed very different than normal. A long sideways movement, then a gentle but significant positive wave pattern starting from a deep red candle wick.
Likewise23-Jan-19 03:45 AM
I dont really watch below 4 hour, it is just noise in a heavily manipulated market
259 Likes, 35 Comments - ₿rekkie von ₿itcoin (@cryptobrekkie) on Instagram: “Pretty proud of this meme.  I used to get…”
The general manager of the Bank of International Settlements (BIS) Agustin Carstens has renewed the institution’s attacks on cryptocurrency, calling them The general manager of the Bank of International Settlements (BIS) Agustin Carstens has renewed the institution’s atta...
“Cryptocurrencies do not fulfil any of the three purposes of money. They are neither a good means of payment, nor a good unit of account, nor are they suitable as a store of value. They fail dramatically on each of these counts,” he claimed.
ComputerGenie 👴👴👴23-Jan-19 02:01 PM
Yeah, because USD is a "store of value"
Well, I guess that it is, even losing 1% a year is still "storing" it (edited)
PTYX23-Jan-19 02:02 PM
If he really thinks that Bitcoin doesn't meet those purposes then he must be living under a rock.
ComputerGenie 👴👴👴23-Jan-19 02:03 PM
I feken hate BTC and hope it dies a fiery death, but I can't see how he could even being to support that claim
PTYX23-Jan-19 02:04 PM
I have mixed feelings about btc
but overall i would like to see it remain on top
ComputerGenie 👴👴👴23-Jan-19 02:06 PM
as long as Core pushes to make it a commodity and BTC remains "on top", actual "electronic cash" platforms will suffer
passcombo.com 🏴☠🏴23-Jan-19 02:10 PM
value is also determined by systems incorporating BTC / adoption. It is on every crypto exchange as basis, in many other crypto payments, and so on... many services allow payments in BTC (however probably rarely used).... adoption maybe leads the price? if KMD was in every core crypto related app - it could get BTC market cap(edited)
untill we see apps masively change BTC for another token BTC should stay top ?


FROM a neighborhood that in 1900 was second in the world only to Berlin in the number of German residents, the area of the Upper East Side known as Yorkville has been transformed into a mostly upscale community that is more silk stocking than lederhosen.
The dispersion of the Germans - and the Hungarians, Irish, and Slavs who followed then - resulted from the demoltion of the Third Avenue El in 1955 and the ensuing boom in high-rise apartment constructions. High rents altered the neighborhood's character, bringing more of a cross section of people to liv in housing that ranges from the million-dollar co-ops of East End Avenue to doorman rental buildings to low- and middle-income housing.
Today's Yorkville is a bustling area, with streets that provide diversions that a moneyed, heterogeneious community desires. Gimbel's Department Store rises 11 stories at 86th Street and Lexington Avenue. There are squash clubs, first-run movie houses and restaurants that offer all variety of cuisine.
But Yorkville is more than its "action" for those who settle there. The area posseses a certain cachet - it is an address that confers status. "If you've arrived," said Assemblyman Alexander B. Grannis, an East Side Democrat, "you go to the Upper East Side."
"It's a very solid community," he added. "It's percieved as safe. It's got a good transportation. It's been a traditionally strong neighborhood, with more of a sense of community and stability - even with the real-estate boom. A solid community, made up of people with a degree of social conscience. These are people that have traditionally civil-libertarian sentiments - the kind of people that elected Lindsay and Koch."
Yorkville - bounded by 79th and 96th Streets between Lexington Avenue and the East River - is typically associated with the German community that lived and worked there and gave its streets (particularly those around 86th Street and Third Avenue) their ethnic character.
The German influence was established in the early 1800's by prosperous families like the Rupperts, Ringlings, and Ehrets, who had their homes in Yorkville - and by other aristocrats like the Astors, Primes and Rhinelanders, who occupied river and country estates close by.
Brownstones and tenement houses began to go up by 1835 following the opening of the New York and Harlem Railroad and a stagecoach line. The new housing attracted both prosperous and working-class Germans, and many laborers found employemnt in Yorkville's plants and breweries. =
The ethnic legacy can be seen amid the high-rise developments, the smart shops and antiques stores. Notices posted otuside churches advise that services can be taken in German or Hungarian. In a few stores, Yorkville old-timers still buy delicacies that were once common supplies.
Schaller & Weber, on Second Avenue between 85th and 86th Streets since 1937, sells wieners, knackwurst, bockwurts, bauernwurst and varieties of kielbasa and hams, as myriad "pork stores" in the neighborhood once did. From the front door of Lekvar-by-the-Barrel, at First Avenue and 82nd Street since 1926, drift the scents of spices and herbs - including the Hungarian paprika that the store's catalogue boasts is "perfect for soups, salads - and, of course, the most popular Hungarian dish of all - goulash!"
Bremen House, at 220 East 86th Street, does a brisk business not only in gourmet fare, but also in German-language magazines and records. And for those whose palates are enticed by Wiener schnitzel, sauerbraten or maybe chopped chicken livers, there are German restaurants like Cafe Geiger at 206 East 86th Street and, for a less formal atmosphere, the Ideal Cafe 238 East 86th Street.
"Yorkville back when the Third Avenue El was up was delightful," recalled Helen Banyai, who grew up there and still attends services with her husband at the Hungarian Baptist Church. "There were different ethnic groups and wonderful odors from the restaurants and bakeries, and you could stroll past doorways where continental music could be heard - performed by violinsts and gypsy musicians."
The economic pressures on the community's housing stock brought on by a growing population is one of Yorkville's biggest concerns. Sprinkled amoung the middle- and upper-middle-class buildings are many old rent-controlled tenement buildings and walk-ups with poor and elderly tenants, many of whom are being bought out or harassed into moving to make way for new high-rise buildings.
When three- to five-room walk-ups and railroad flat are vacated, they rent for $400 to $700 a month, according to Robert Henry of Method Reality.
Addy Fattal, director of rentals at J.I. Sopher, said rents on one- to three-bedroom apartments in elevator buildings with doormen ranged from $850 to more than $2,800. Edith Sachs, vice-president and director of co-op sales for Sopher, said it was possible to find one- and two-bedroom aparments for $110,000 to $160,000 on the "very low end of the market." But most co-ops are more costly, especially in buildings offering river views along East End Avenue and Gracie Square.
BY comparison with other parts of the city, Yorkville is not particularly afflicted by violent street crime: Its most conspicious problems - prostitution and drug sales - are visible on East 96th Street. Burglaries are numerous, particularly in the old tenement and walk-up buildings, which offer an intruder easy access. But overall, said Detective Jack McGuire of the 19th Preinct, "It is a neighborhood that is safe to go out and walk in."
Yorkville still has the conveniences and comforts that attracted bordes of young people in the late 1960's before the rental market tightened up at the same time that the city's fiscal crisis began.
"That's when people realized they had to take charge of their lives and not depend on government," said Paulette Geanacopolous, director of community services at the Lenox Hill Neighborhood Association. "The feeling was, 'Hey, we're here now, and we're going to be here in five years because we can't afford to be anywhere else. In five years, the problems are going to be worse, so let's start working on them now.'"
That meant working with the neighborhood's block associations which, by establishing programs to beautify streets, aid the elderly and curb crime, have at least partially restored the community feeling for which Yorkville was once famous. "One way we fight crime is to put stickers on store windows," said Dawn Sullivan, president of the 400 East 80th Street Block Association. "These stickers let people know this is place they can go to if they are being followed, a place where they can use the telephone or just wait until the danger passes."
Yorkville has more than two dozen public, parochial and private schools, including P.S. 158, which had the highest reading scores in Manhattan this past year. Many parents tend to send their children to private schools after the sixth grade - Brearley and Chapin are amoung the better-known. Speaking of the junior high school that serves the Yorkville area, however, Charles N. Wilson, superintendent of Community School District 2, said, "The majority of students graduating from Wagner Junior High School go on to the specialized high schools such as Stuyvesant, Bronx Science, Brooklyn Tech and Music and Arts."
Yorkville has recently responded to the growing problem of the homeless, with organizations like the Coalition for Shelter, Lenox Hill Neighborhood Association, Jan Hus House, The Common Pantry and the Stanley Isaacs Neighborhood Center working to give street people places to stay. In Assemblyman Grannis's words, "Yorkville is a very socially compassionate area."
In that neighborly spirit, Manhattan Savings Bank, on Third Avenue and 86th Street, offers daily music for a mostly elderly audience that gathers midday to hear a pianist play on bank premises.
And for those who love the outdoors, there are other amenities. At Carl Schurz Park, a walkway overlooking the East River is trafficked by joggers, strollers and bench jockeys who watch the gulls and barges go by.
This is a link to my annotated Markdown page that transcribes the first few paragraphs of the article and includes
a link to an image of the article as it appearned in the New York Times.


Cognitive Science at
Indiana University:
Indiana University
Cognitive Science Program
Undergraduate
Program in Cognitive Science
Center for Research
on Concepts and Cognition
Other Cognitive Science Student Organizations:
University
of California at Berkley:
Cognitive Science Students Association
University
of California at San Diego:
Student
Cognitive and Neuroscience Society's (SCANS)
Ruters
University
The Undergraduate Cognitive
Science Club
Articles on Cognitive Science:
"The Mind Bending World of Cognitive Science" The College,
College of Arts and Sciences, Indiana University
Links to Other Undergraduate Cognitive Science Programs:
Brown
University:
Cognitive and Linguistic Sciences
Department
Carnegie
Mellon University:
The Center for the Neural Basis
of Cognition
Department of Psychology
Dartmouth College:
Program in Linguistics
and Cognitive Science
Georgia Tech:
Cognitive Science Program
Hampshire College:
School of Cognitive Science
Johns Hopkins University:
Department
of Cognitive Science
Northwestern University:
Cognitive Science Program
Rice University:
Undergraduate Cognitive
Science Program
Rutgers University:
Center for Cognitive Science
Stanford University:
Symbolic Systems
Program
University of California at Berkeley:
The
Institute of Cognitive Studies
University of California at San Diego:
Cognitive Science
Department
University of Pennsylvania:
Institute for Research in
Cognitive Science
University of Rochester:
Department of Brain and Cognitive
Sciences
Cognitive Science Program
Vassar College:
Cognitive Science
Program
Yale University:
Cognitive
Science Program
Cognitive Science on the Web:
Cognitive
and Psychological Sciences on the Internet
Cognitive Science Worldwide
Cognitive
Science Society
COGSCI
- discussion list about Cognitive Science
Epistemology,
Consciousness and the Mind
Mind
Brain Resources (from Virginia Tech)
PSYCHE:
An International Journal of Research on Consciousness
Society
for Philosophy and Psychology (SPP)
Yahoo
- Cognitive Science
This list was last updated February 10, 2000
Website written by Ben Motz


{% extends "base.html" %} {% block title %}Case Studies - {{ super() }}{% endblock %} {% block content %}
Opening Parliament has created a series of case studies on transparency and accountability tools that PMOs have used that can be replicated or serve as models for organizations in different contexts. To contribute a case study on a project that your organization has created, please fill out the template and email Greg Brown at<EMAIL_ADDRESS>with any questions.


--- layout: post tags: [ASP.NET MVC, REST, Services, ASP.NET Web API] date: 2012-04-24 11:45:41 UTC title: "Vendor Media Types With the ASP.NET Web API" --- {% include JB/setup %}
In RESTful services, media types (e.g. application/xml, application/json) are an important part of Content Negotiation (conneg in the jargon). This enables an API to provide multiple representations of the same resource.
Apart from the standard media types such as application/xml, application/json, etc. an API can (and often should, IMO) expose its resources using specialized media types. These often take the form of vendor-specific media types, such as application/vnd.247e.catalog+xml or application/vnd.247e.album+json.
In this article I'll present some initial findings I've made while investigating this in the ASP.NET Web API (beta).
For an introduction to conneg with the Web API, see Gunnar Peipman's ASP.NET blog, particularly these two posts:
In a particular RESTful API, I'd like to enable vendor-specific media types as well as the standard application/xml and application/json media types.
More specifically, I'd like to add these media types to the API:
However, I can't just add all these media types to GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes or GlobalConfiguration.Configuration.Formatters.JsonFormatter.SupportedMediaTypes. If I do that, each and every resource in the API would accept and (claim to) return all of those media types. That's not what I want. Rather, I want specific resources to accept and return specific media types.
For example, if a resource (Controller) returns an instance of the SearchResult (Model) class, it should only accept the media types application/vnd.247e.search-result+xml, application/vnd.247e.search-result+json (as well as the standard application/xml and application/json media types).
Likewise, a resource handling the Album (Model) class should accept and return application/vnd.247e.album+xml and application/vnd.247e.album+json, and so on.
Figuring out how to enable such behavior took me a bit of fiddling (yes, Fiddler was involved).
The Web API uses a polymorphic collection of MediaTypeFormatter classes. These classes can be extended to be more specifically targeted at a specific Model class.
For XML formatting, this can be done by deriving from the built-in XmlMediaTypeFormatter class:
public class TypedXmlMediaTypeFormatter : XmlMediaTypeFormatter { private readonly Type resourceType; public TypedXmlMediaTypeFormatter(Type resourceType, MediaTypeHeaderValue mediaType) { this.resourceType = resourceType; this.SupportedMediaTypes.Clear(); this.SupportedMediaTypes.Add(mediaType); } protected override bool CanReadType(Type type) { return this.resourceType == type; } protected override bool CanWriteType(Type type) { return this.resourceType == type; } }
The implementation is quite simple. In the constructor, it makes sure to clear out any existing supported media types and to add only the media type passed in via the constructor.
The CanReadType and CanWriteType overrides only return true of the type parameter matches the type targeted by the particular TypedXmlMediaTypeFormatter instance. You could say that the TypedXmlMediaTypeFormatter provides a specific match between a media type and a resource Model class.
The JSON formatter is similar:
public class TypedJsonMediaTypeFormatter : JsonMediaTypeFormatter { private readonly Type resourceType; public TypedJsonMediaTypeFormatter(Type resourceType, MediaTypeHeaderValue mediaType) { this.resourceType = resourceType; this.SupportedMediaTypes.Clear(); this.SupportedMediaTypes.Add(mediaType); } protected override bool CanReadType(Type type) { return this.resourceType == type; } protected override bool CanWriteType(Type type) { return this.resourceType == type; } }
The only difference from the TypedXmlMediaTypeFormatter class is that this one derives from JsonMediaTypeFormatter instead of XmlMediaTypeFormatter.
With these two classes available, I can now register all the custom media types in Global.asax like this:
GlobalConfiguration.Configuration.Formatters.Add( new TypedXmlMediaTypeFormatter( typeof(Album), new MediaTypeHeaderValue( "application/vnd.247e.album+xml"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedXmlMediaTypeFormatter( typeof(Artist), new MediaTypeHeaderValue( "application/vnd.247e.artist+xml"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedXmlMediaTypeFormatter( typeof(Catalog), new MediaTypeHeaderValue( "application/vnd.247e.catalog+xml"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedXmlMediaTypeFormatter( typeof(SearchResult), new MediaTypeHeaderValue( "application/vnd.247e.search-result+xml"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedXmlMediaTypeFormatter( typeof(Track), new MediaTypeHeaderValue( "application/vnd.247e.track+xml"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedJsonMediaTypeFormatter( typeof(Album), new MediaTypeHeaderValue( "application/vnd.247e.album+json"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedJsonMediaTypeFormatter( typeof(Artist), new MediaTypeHeaderValue( "application/vnd.247e.artist+json"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedJsonMediaTypeFormatter( typeof(Catalog), new MediaTypeHeaderValue( "application/vnd.247e.catalog+json"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedJsonMediaTypeFormatter( typeof(SearchResult), new MediaTypeHeaderValue( "application/vnd.247e.search-result+json"))); GlobalConfiguration.Configuration.Formatters.Add( new TypedJsonMediaTypeFormatter( typeof(Track), new MediaTypeHeaderValue( "application/vnd.247e.track+json")));
This is rather repetitive code, but I'll leave it as an exercise to the reader to write a set of conventions that appropriately register the correct media type for a Model class.
Please be aware that I've only tested this with a read-only API. You may need to tweak this solution in order to also handle incoming data.
As far as I can tell from the Web API source repository, it seems as though there are some breaking changes in the pipeline in this area, so don't bet the farm on this particular solution.
Lastly, it seems as though this solution doesn't correctly respect opt-out quality parameters in incoming Accept headers. As an example, if I request a 'Catalog' resource, but supply the following Accept header, I'd expect the response to be 406 (Not Acceptable)
.
Accept: application/vnd.247e.search-result+xml; q=1, */*; q=0.0
However, the result is that the service falls back to its default representation, which is application/json
. Whether this is a problem with my approach or a bug in the Web API, I haven't investigated.
Comments
http://pedroreys.com/2012/02/17/extending-asp-net-web-api-content-negotiation/
https://gist.github.com/2499672
You might find this useful.


This route was generated with the following code
use JLaso\SlimRoutingManager\Controller\Controller; class IntranetController extends Controller { /** * @Route('/intranet') * @Name('intranet.index') */ public function intranetAction() { /** @var Slim\Slim $slim */ $slim = $this->getSlim(); $slim->response()->body(THIS CONTENT); } }


Ghostbuster Containment
I recently built a Dockerfile for Buster, a static website generator for Ghost. In fact, that's how this site is currently published to Github pages!
The interesting obstacle was pushing to Github from inside of a docker container. While typically this requires SSH private keys, it turns out you can authenticate with your username and password over HTTPS. Even better, you can use a Github access token. By using this token in the URL, we can achieve HTTP authentication as so:
<EMAIL_ADDRESS>Note that there is no password required, and you had better use https! This still isn't as secure as SSH, but it allowed me to build a container that can be run without requiring any user-specific data inside the container, as so:
$ sudo docker run hamiltont/btest --token <my_token>
Now, no users will accidentally push their private key to the Docker index! It's not perfect--the token may be exposed in log files and process lists for any users with sudo powers.
My final annoyance is that GitPython seems to be unable to read the user properly from inside a Docker containter. I "fixed" it by setting an environment variable, but I suspect there is a better method...


RT @1337807: We still need sponsors for Open Source Bridge this year, quite desperately in fact. I'm not even a little bit too proud to beg…
6/10/2015, 9:03:38 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @1337807: We still need sponsors for Open Source Bridge this year, quite desperately in fact. I'm not even a little bit too proud to beg…
6/10/2015, 9:03:38 PM
Favs: 0
Retweets: 0
link


Kb3011 Download And Install Eset Endpoint Products On Individual Client Workstations 5 X
Business Endpoint Antivirus 5 For Windows Eset
Download Eset Endpoint Antivirus For Business Best Security Protection
Downloads For Eset Business Solutions Eset
Kb6992 Install Or Upgrade Eset Endpoint Security Or Eset Endpoint Antivirus On A Client Workstation 7 X
Kb6992 Install Or Upgrade Eset Endpoint Security Or Eset Endpoint Antivirus On A Client Workstation 7 X
Business Endpoint Security For Windows Eset
Business Endpoint Security For Windows Eset
Eset Endpoint Antivirus 7 0 2073 1 Free Download Filecr
Eset Nod32 Antivirus 64 Bit Download 2021 Latest For Windows 10 8 7
Business Endpoint Security For Windows Eset
Eset Endpoint Security Crack Download 2021 Keys Code
Amazon Com Eset Nod32 Antivirus 2021 Edition 1 Device 1 Year Antivirus Software Gamer Mode Small System Footprint Official Download With License Software
How To Download Eset Endpoint Security 7 0 2100 4 Keys Download Youtube
Eset Endpoint Antivirus 7 0 2073 1 Free Download Filecr
Eset Nod32 Antivirus 12 0 27 0 X86 X64 Activator Download Peatix
Eset Nod32 Antivirus 13 Free Download
Eset Endpoint Protection Advanced Cloud 50 99 User 3 Years New Govern


./configure --with-webdir=[path] where path specifies the location to install the JS9 Web files
The current JS9 source tar file is available at:
http://js9.si.eduThe source tar file will unpack into a js9-[version] directory with the usual tar command, e.g:
tar xfz js9-[version].tar.gzYou also can clone JS9 from GitHub:
https://github.com/ericmandel/js9
file:///Users/me/js9-[version]/js9basics.htmlto see the basic JS9 demo page. You then can drag any FITS image file onto the JS9 display and view it, change contrast/bias, colormaps, scale, create regions, etc. Furthermore, if you load the imexam Web page:
file:///Users/me/js9-[version]/js9imexam.htmlyou can move a region around and run browser-based analysis as the region changes.
NB: The file://URI does not work in Google Chrome: Chrome doesn't permit a local HTML file to read other local files. The workaround is to start Chrome with the --allow-file-access-from-files switch:
# Linux: chrome --allow-file-access-from-files # Mac: open /Applications/Google\ Chrome.app --args --allow-file-access-from-filesFirefox and Safari do not have this restriction.
If you just want to run JS9 in this simple way, you are done. However, you might want to edit the js9Prefs.json file to set up default values for colormaps, scaling, etc. See: JS9 Site Preferences for a description of the available parameters.
JS9 supports server-side ("back-end") analysis on FITS data using a server-side helper. This capability allows you to execute virtually any command-line analysis program from JS9. The analysis command is run on the back-end server and results viewed on your Web page. You can utilize your own Web server as the JS9 back-end helper using CGI calls, or you can run a separate Node.js-based server to process JS9 back-end requests. The server-side analysis capability is especially useful for archive centers, but also can be attractive to individual users who want to integrate their own data analysis programs into JS9.
In addition, JS9 supports communication with external processes via the js9 script. This capability requires the configuration of a Node.js-based server-side helper.
You configure a JS9 back-end helper by adding additional switches to the configure command. See: Installing a Server-side Helper for details.
./configure [your JS9 switches]
and then build the JS9 system using the make command:
make
When JS9 is loaded into your browser, it reads a file called js9Prefs.json from the JS9 Web directory. This file contains various default settings for JS9, e.g. default colormap and scale for image display. Feel free to edit this file to set up your own site-specific parameters. See JS9 Site Preferences for a description of the available parameters.
When the build is completed, you can install the JS9 into your Web tree:
make install
and then clean up the build directory using the command:
make clean
If you want to display our test data files in the JS9 demo pages, you must retrieve the JS9 data file tar file from the JS9 Web site:
http://js9.si.eduand untar it into the JS9 Web install directory. This will create sub-directories containing the image data. These data files also are available on GitHub:
https://github.com/ericmandel/js9data


RouteManeuver QML Type
The RouteManeuver type represents the information relevant to the point at which two RouteSegments meet. More...
| Import Statement: | import QtLocation 5.3 |
| Since: | Qt Location 5.5 |
Properties
- direction : enumeration
- distanceToNextInstruction : real
- instructionText : string
- position : coordinate
- timeToNextInstruction : int
- valid : bool
- waypoint : coordinate
- waypointValid : bool
Detailed Description
RouteSegment instances can be thought of as edges on a routing graph, with RouteManeuver instances as optional labels attached to the vertices of the graph.
The most interesting information held in a RouteManeuver instance is normally the textual navigation to provide and the position at which to provide it, accessible by instructionText and position respectively.
Example
The following QML snippet demonstrates how to print information about a route maneuver:
import QtQuick 2.3 import QtPositioning 5.5 import QtLocation 5.6 Text { text: "Distance till next maneuver: " + routeManeuver.distanceToNextInstruction + " meters, estimated time: " + routeManeuver.timeToNextInstruction + " seconds." }
Property Documentation
Describes the change in direction associated with the instruction text that is associated with a RouteManeuver.
- RouteManeuver.NoDirection - There is no direction associated with the instruction text
- RouteManeuver.DirectionForward - The instruction indicates that the direction of travel does not need to change
- RouteManeuver.DirectionBearRight - The instruction indicates that the direction of travel should bear to the right
- RouteManeuver.DirectionLightRight - The instruction indicates that a light turn to the right is required
- RouteManeuver.DirectionRight - The instruction indicates that a turn to the right is required
- RouteManeuver.DirectionHardRight - The instruction indicates that a hard turn to the right is required
- RouteManeuver.DirectionUTurnRight - The instruction indicates that a u-turn to the right is required
- RouteManeuver.DirectionUTurnLeft - The instruction indicates that a u-turn to the left is required
- RouteManeuver.DirectionHardLeft - The instruction indicates that a hard turn to the left is required
- RouteManeuver.DirectionLeft - The instruction indicates that a turn to the left is required
- RouteManeuver.DirectionLightLeft - The instruction indicates that a light turn to the left is required
- RouteManeuver.DirectionBearLeft - The instruction indicates that the direction of travel should bear to the left
This read-only property holds the distance, in meters, between the point at which the associated instruction was issued and the point that the next instruction should be issued.
position : coordinate |
This read-only property holds where the instructionText should be displayed.
This read-only property holds the estimated time it will take to travel from the point at which the associated instruction was issued and the point that the next instruction should be issued, in seconds.
This read-only property holds whether this maneuver is valid or not.
Invalid maneuvers are used when there is no information that needs to be attached to the endpoint of a QGeoRouteSegment instance.
waypoint : coordinate |
This property holds the waypoint associated with this maneuver. All maneuvers do not have a waypoint associated with them, this can be checked with waypointValid.
This read-only property holds whether this waypoint, associated with this maneuver, is valid or not.


Holly's Website
Holly is the best pokemon trainer in the world
She has beaten all the other gym trainers and has collected all of the pokemon.
Holly is the best pokemon trainer in the world
She has beaten all the other gym trainers and has collected all of the pokemon.


Contacts
Save time and effort looking up your contacts' details with Alfred. Search for Contacts in Alfred to speed up finding a friend's phone number or email address.
Type your contact's name to access their contact details. Powerpack users can also open these contacts in Alfred's Contacts Viewer to start an email, copy an address, call the contact and more.
Find out more about using Contacts in Alfred:
- Searching for Contacts
- Using the Contacts Viewer
- Emailing Contacts
- Advanced Preferences
- Contacts Troubleshooting
Searching for Contacts
You can search for a contact by simply typing their name into Alfred's search box, provided that the checkbox for "Contacts" is ticked in the Default Results preferences.
For non-Powerpack users, pressing the Return key will launch the macOS Contacts.app application with the details of your contact. For Powerpack users, the contacts will launch in Alfred's in-line Contacts Viewer.
Using the Contacts Viewer
With the Powerpack, you can view your contact's details in-line and take action on them. By default, once you've activated your Powerpack license, Alfred will open the contact's details in the Contact Viewer. You can still open contacts in Apple's Contacts app by using ⌘o.
When you've pressed Return and you see your contact's details in-line, use the down arrow to choose a particular contact information.
Here are some of the actions you'll be able to perform by default when pressing Return on information in the Contacts Viewer:
- On an email address, it will launch a new email to your contact in your default email client
- On a phone number, it'll copy the number to your clipboard
- On an address, it'll be opened in Apple Maps
- Other contact details (e.g. birthday, social network usernames) are copied to clipboard
Can't remember what action will be performed? Take a look at the subtext at the bottom of the Contact Viewer for details.
Customising Actions on Contacts
If you'd like to take an alternative action on contacts, you can add Custom Actions in the Contacts preferences.
For example, the "Phone" contact field action can be changed to pass the phone number to the tel:// URL scheme, which means that macOS will dial the phone number in your default app for this (e.g. FaceTime)
You can configure alternative actions using modifiers, for example, you could set ⌘↩ to use the tel:// URL scheme, and ↩ to copy to clipboard.
It is also possible to call a Contact Action Trigger within one of your workflows when selecting an item in the Contact Viewer. If you're not sure how to create these custom actions, pop by the Alfred forum where fellow Alfred users can help you out.
Emailing your Contacts
There are a few different ways to launch a new email a contact:
- Search for your contact, view their Contact Card as above, and press return on the email address you want to use
- Type "email" followed by the name or email address of your contact to launch an email to their default address
- Or find a file in Alfred and choose the "Email to..." action from the Result Actions menu
In the Features > Contacts > Email preferences, you can modify a few additional settings to suit your needs:
- Change or disable the "email" keyword used to tell Alfred to launch a new email to a contact
- Show the Contact Viewer if a contact has more than one email address
- Use Gmail in a web browser to compose emails
- Change the default subject lines when files are attached to new emails
Alfred supports Mail.app, Mailplane, Postbox, Postbox Express, Sparrow, AirMail, MailMate, and some versions of Microsoft Outlook for sending file attachments. Custom email app support is available via plugins.
For help using a different mail client, pop by the Alfred forum and search for your preferred email client, as many scripts have already been created by other users.
Using a contact's secondary address
By default, Alfred will save you time by automatically selecting the primary email address for any Contacts you choose.
To change this behaviour, take a look in Alfred's Features > Contacts > Email preferences where you can turn on showing the Contact Viewer if there are multiple email addresses.
Check the box that says "If multiple email addresses, open Contacts Viewer" to activate this feature.
Advanced Contacts Preferences
In the Advanced preferences, you'll find additional settings:
- Name: Show last name before first name, and show title (e.g. Mrs) if available
- Job Title: Show if available
- Maps URL: Change to an alternative Maps service
- Searching: Use Spotlight metadata for searching contacts if you experience issues with Apple's Contacts API
- URL Handler: Users of contacts apps (e.g. BusyContacts) can change the URL Handler so that contacts are launched in their preferred app instead of Contacts.
Contacts Troubleshooting
If you're having issues finding contacts when typing their name in Alfred, check that the box for Contacts is checked in your Default Results.
If your contact's name contains accented characters (diacritics), take a look at the Contacts with Diacritics page for details.
In order for Alfred to be able to search your Contacts and present them in the results, you need to grant him access to them. Here's how to grant Alfred access to your Contacts if you didn't allow it the first time.


Here is a timeline for how long you have to live after Dan Bailey sets his sights on you:
-
00.00s - The Assassin marks his kill. You.
-
01.00s - The ball is snapped.
-
02.20s - Foot to ball contact.
-
03.00s - Lights out.


Terms & Conditions
- 1. For the purposes of these Terms and Conditions “Reward” is defined as one (1) twenty five dollar ($25.00 USD) credit towards a round of golf from www.golfweek.com/teetimes
- 2. Fulfillment requirements: Customer must obtain one (1) bottle neck hanger from a specially marked bottle of Gran Reserva wine between May 1, 2015 and July 31, 2016 at a participating retailer. Customer must submit all required information on the online Registration Form, found at www.mywinerewards.com/GRSR/Register which includes a valid entry code from a promotional bottle neck hanger, contact information and confirming acceptance of these promotional Terms and Conditions no later than 11:59PT on July 31, 2016.
- 3. The Reward is only valid for one (1) Reward redemption per Customer, per Customer email address and per Customer booking group, with the term "booking group" being defined as one or more people accompanying the ticket holder. Multiple redemptions shall not be redeemed and The Reward Company, Inc, d/b/a TLC Marketing ("Promoter"), shall have no obligation whatsoever to honor any Rewards accepted in violation of these Terms and Conditions.
- 4. This Reward is subject to promotional availability.
- 5. Reward available while Reward supplies last.
- 6. No purchase necessary to participate.
- 7. Must be twenty one (21) years of age or older to participate in this promotion.
- 8. Golfweek Tee Times is an affiliate of TeeOff.com that has its own terms and conditions in addition to the terms of this Reward that are required to utilize the Reward and are binding upon Reward redemption. Golfweek terms and conditions can be found here. It is the Customer’s sole responsibility to comply with these terms and conditions.
- 9. The use of the Golfweek Tee Times website and the content is used at the participant’s own risk. Golfweek privacy policy can be found at http://teeoff.com/privacy-policy.
- 10. Customer is responsible for any additional fees associated with the credit.
- 11. Customer must redeem the Golfweek $25 credit code on www.golfweek.com/teetimes no later than 11:59PM PT on August 31, 2016.
- 12. Additional costs/fees for products and services outside of the promotional Reward are not included.
- 13. The recipient of the Reward must follow the instructions provided by the Promoter, TeeOff.com and Excelsior Wines. Failure to comply with the instructions or any other directives made in conjunction with this Reward may result in cancellation and/or a charge for the Reward. Under these circumstances, Reward shall be considered redeemed and participant shall be solely responsible for any costs or fees incurred as a result of their non compliance.
- 14. This Reward cannot be used in conjunction with any other promotional offer or discounts.
- 15. Credit card may be required.
- 16. Reward valid in the continental United States only (excludes U.S. territories and possessions).
- 17. Void where prohibited or restricted by law.
- 18. For the purpose of this reward, “Released Parties” includes the Promoter, Excelsior Wines, their respective parents, affiliates, partners, subsidiaries, agents and distributors.
- 19. Released Parties cannot be held responsible for any personal loss or any disagreements concerning availability and quality of service from Golfweek Tee Times. Any dispute must be settled directly with Golfweek Tee Times.
- 20. Released Parties and TeeOff.com cannot accept any liability for personal loss or injury.
- 21. This Reward is not transferable, transferable for sale, resale, and is not redeemable for cash or credit.
- 22. Golfweek Tee Times or Released Parties shall not be liable for lost, stolen, damaged, misdirected or undeliverable Golfweek credit codes and/or registration forms and will not issue or replace Rewards in any of these events.
- 23. Released Parties shall not be liable for lost, stolen, damaged, misdirected or undeliverable Golfweek Tee Times tee time confirmations and will not issue or replace Rewards in any of these events.
- 24. Employees or agents of the Promoter, Golfweek Tee Times, Excelsior Wines, its affiliates, subsidiaries or vendors specifically involved in this promotion or anyone professionally connected to this promotion, are not eligible.
- 25. Reward available while Reward supplies last.
- 26. The Reward is subject to Reward availability and Promoter reserves the right, in its sole discretion, to substitute a Reward of equal or greater value.
- 27. The Reward may only be applied to golf courses provided by Golfweek Tee Times during the promotional period. Reward cannot be applied to any golf courses outside of the Golfweek network. Neither Promoter nor Golfweek Tee Times can guarantee the inclusion of any specific golf courses in the Golfweek network at the time of reward redemption.
- 28. Each gold course may have its own terms and conditions in addition to the terms of this Reward, which will be binding upon choice of event. It is the Customer’s sole responsibility to comply with these terms and conditions.
- 29. No credit, refund or extension for any unused Rewards will be provided.
- 30. Failure to appear at the golf course at the posted time of the event may result in the event being closed to admittance. Under these circumstances, the Reward shall be considered redeemed and the ticket may be voided for use. Further, specific venues may have to reschedule certain event and may do so in their sole discretion. In the event of such instance neither Gran Reserva, Promoter nor Golfweek Tee Times shall be responsible for any ticket refunds or future use. All issues related to cancellation or rescheduling of any event are the sole responsibility of the specific venue. In all instances the participant shall be solely responsible for any costs or fees required for entry.
- 31. This information is correct at the time of campaign launch, although facilities and Released Parties reserve the right to change details at any time. Each facility featured reserves the right to make the final decision of admission, according to the rules and regulations established at their facility. Released Parties cannot be held responsible for this decision.
- 32. This Reward is issued by the Promoter located at PO Box 512, 292 Newbury Street, Boston, MA 02115-2832, or at such other address as the Promoter may advise in writing. No inquiry or notice will be validly received by the Promoter unless mailed to the Promoter’s address above by first-class mail, postage prepaid.
- 33. Promoter reserves the right to change or modify the Terms and Conditions of the Promotion at any time during the term thereof. It shall be the bearer's sole obligation to check the Terms and Conditions during the Promotion and when the bearer redeems the Reward.


At Delightful, we strive to bring you the relief you need in a product you can trust. Our plants are hand-grown in an environment specially designed to reduce unwanted chemicals and pests, keeping the process as natural as possible at every turn.
A dispensary is a store from which a particular item is dispensed, that is, sold. Cannabis dispensaries have existed in the United States since the early 1990s, when the San Francisco Cannabis Buyers Club was opened by Dennis Peron. Although the SF Cannabis Buyers Club faced many difficulties along the way, Dennis and his dream helped pave the way for future medical and recreational dispensaries.
O Finans vai além do básico e permite que você faça controles incríveis, essenciais para as suas finanças. Simples como tem que ser!
Tempo é dinheiro! Em segundos, você tem tudo sob controle e aproveite seu tempo com oque realmente importa pra você!
Dúvidas? Perguntas? Nosso suporte super legal ajuda você! A gente tá aqui pra resolver seus problemas e deixar sua vida bem mais fácil!


Following on from my post on Gliffy’s blog…
On more than a few occasions, I’ve been faced with making significant refactorings to an existing application. These are things where we need to overhaul an architectural component without breaking anything, or changing the application’s features. For an applicaiton without any test cases, this is not only scary, but ill-advised.
I believe this is the primary reason that development shops hang on to out-dated technology. I got a job at a web development shop after four years of doing nothing but Swing and J2EE. My last experience with Java web development was Servlets, JSPs and taglibs. This company was still using these as the primary components of their architecture. No Struts, no Spring, no SEAM. Why? One reason was that they had no test infrastructure and therefore not ability to refactor anything.
Doing it anyway
Nevertheless, sometimes the benefits outweigh the costs and you really need to make a change. At Gliffy, I was hired to create an API to integrate editing Gliffy diagrams into the workflow of other applications. After a review of their code and architecture, the principals and I decided that the database layer needed an overhaul. It was using JDBC/SQL and had become difficult to change (especially to the new guy: me). I suggested moving to the Java Persistence Architecture (backed by Hibernate), and they agreed. Only problem was how to make sure I didn’t break anything. They didn’t have automated tests, and I was totally new to the application environment.
They did have test scripts for testers to follow that would hit various parts of the application. Coming from my previous enviornment, that in and of itself was amazing. Since the application communicates with the server entirely via HTTP POST, and recieves mostly XML back, I figured I could manually execute the tests and record them in a way so they could be played back later as regression tests.
Recording Tests
This is suprisingly easy thanks to the filtering features of the Servlet specification:
<filter>
<filter-name>recorder</filter-name>
<filter-class>com.gliffy.test.online.RecordServletFilter</filter-class>
</filter>
<!-- ... -->
<filter-mapping>
<filter-name>recorder</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
The filter code is bit more complex, because I had to create proxy classes for
HttpServletRequest and
HttpServletResponse. Here’s an overview of how everything fits together:
The request proxy had to read everything from the requests input stream, save it, and send a new stream that would output the same data to the caller. It had to do the same thing with the Reader. I’m sure it’s an error to use both in the same request, and Gliffy’s code didn’t do that, so this worked well.
private class RecordingServletRequest extends javax.servlet.http.HttpServletRequestWrapper
{
BufferedReader reader = null;
ServletInputStream inputStream = null;
String readerContent = null;
byte inputStreamContent[] = null;
public RecordingServletRequest(HttpServletRequest r) { super(r); }
public BufferedReader getReader()
throws IOException
{
if (reader == null)
{
StringWriter writer = new StringWriter();
BufferedReader superReader = super.getReader();
int ch = superReader.read();
while (ch != -1)
{
writer.write(ch);
ch = superReader.read();
}
readerContent = writer.toString();
return new BufferedReader(new StringReader(readerContent));
}
return reader;
}
public ServletInputStream getInputStream()
throws IOException
{
if (inputStream == null)
{
ByteArrayOutputStream os = new ByteArrayOutputStream();
ServletInputStream superInputStream = super.getInputStream();
int b = superInputStream.read();
while (b != -1)
{
os.write(b);
b = superInputStream.read();
}
inputStreamContent = os.toByteArray();
inputStream = new ByteArrayServletInputStream(inputStreamContent);
}
return inputStream;
}
}
The response recorder was a bit trickier, because I needed to save things like status codes and content types. This implementation probably wouldn’t work for all clients (for example, it ignores any response headers), but since Gliffy is an OpenLaszlo app, and OpenLaszlo has almost no view into HTTP, this worked well for our purposes. Again, I had to wrap the OutputStream/Writer so I could record what was being sent back.
private class RecordingServletResponse extends HttpServletResponseWrapper
{
public RecordingServletResponse(HttpServletResponse r)
{
super(r);
}
int statusCode;
StringWriter stringWriter = null;
ByteArrayOutputStream byteOutputStream = null;
String contentType = null;
private PrintWriter writer = null;
private ServletOutputStream outputStream = null;
public ServletOutputStream getOutputStream()
throws IOException
{
if (outputStream == null)
{
byteOutputStream = new ByteArrayOutputStream();
outputStream = new RecordingServletOutputStream(super.getOutputStream(),new PrintStream(byteOutputStream));
}
return outputStream;
}
public PrintWriter getWriter()
throws IOException
{
if (writer == null)
{
stringWriter = new StringWriter();
writer = new RecordingPrintWriter(super.getWriter(),new PrintWriter(stringWriter));
}
return writer;
}
public void sendError(int sc)
throws IOException
{
statusCode = sc;
super.sendError(sc);
}
public void sendError(int sc, String msg)
throws IOException
{
statusCode = sc;
super.sendError(sc,msg);
}
public void setStatus(int sc)
{
statusCode = sc;
super.setStatus(sc);
}
public void setContentType(String type)
{
contentType = type;
super.setContentType(type);
}
}
The filter then needs to use this and inject them into the actual servlet calls:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
RecordingServletRequest recordingRequest =
new RecordingServletRequest((HttpServletRequest)request);
RecordingServletResponse recordingResponse =
new RecordingServletResponse((HttpServletResponse)response);
chain.doFilter(recordingRequest,recordingResponse);
After the call to
doFilter, we can then examine the proxy request/respons and record the test. I’ll spare you 20 lines of
setXXX methods. I created a Java bean class and used XStream to serialize it. I then created another class that runs as a TestNG test to deserialize these files and make the same requests. I record the response and see if it matches.
Running the Tests
There were a few problems with this approach:
- The tests required certain test data to exist
- Each test potentially modifies the database, meaning the tests have to be run in the order they were created.
- The test results had temporal data in them that, while irrelevant to the tests “passing”, complicated exact-match comparisions of results
TestNG (and JUnit) are not really designed for this; they are more for proper
unit testing, where each test can be run indepedent of the others and the results compared. While there are facilities for setting up test data and cleaning up, the idea of resetting the database before each of the 300 tests I would record was not appealing. Faking/mocking the database was not an option; I was creating these tests specifically to make sure my changes to the database layer were not causing regressions. I needed to test against a real database.
I ultimately decided to group my tests into logical areas, and ensure that: a) tests were run in a predictable order, and b) the first test of a group was run against a known dataset. I created a small, but useful, test dataset and created a TestNG test that would do both (a) and (b). It wasn’t pretty, but it worked. This clearly isn’t the way a unit test framework should be used, and I would call these sorts of tests functional, rather than unit. But, since our CI system requires JUnit test results as output, and the JUnit format isn’t documented, might as well use TestNG to handle it for me.
The last problem was making accurate comparisons of results. I did not want to have to parse the XML returned by the server. I settled on some regular expressions that stripped out temporal and transient data not relevant to the test. Both the expected and received content were run through this regexp filter and those results were compared. Parsing the XML might result in better failure messages (right now I have to do a visual diff, which is a pain), but I wasn’t convinced that the existing XML diff tools were that useful.
Results
Overall, it worked out great. I was able to completely overhaul the database layer, and the Gliffy client was none the wiser. We were even able to use these tests to remove our dependence on Struts, simplifying the application’s deployment (we weren’t using many features of Struts anyway). The final validation of these tests actually came recently, when we realized a join table needed to be exposed to our server-side code. This was a major change in two key data container, and the recorded tests were crucial to finding bugs this introduced.
So, if you don’t have the luxury of automated tests, you can always create them. I did a similar thing with EJB3 using the Interceptors concept.


Interface collections.HashTableParams
All Packages Class Hierarchy This Package Previous Next Index
Interface collections.HashTableParams
- public interface HashTableParams
- extends Object
Base interface for hash table based collections.
Provides common ways of dealing with buckets and threshholds.
(It would be nice to share some of the code too, but this
would require multiple inheritance here.)
-
defaultInitialBuckets
- The default initial number of buckets of a non-empty HT
-
defaultLoadFactor
- The default load factor for a non-empty HT.
-
buckets()
- return the current number of hash table buckets
-
buckets(int)
- Set the desired number of buckets in the hash table.
-
thresholdLoadFactor()
- Return the current load factor threshold
The Hash table occasionally checka against the load factor
resizes itself if it has gone past it.
-
thresholdLoadFactor(float)
- Set the current desired load factor.
defaultInitialBuckets
public final static int defaultInitialBuckets
- The default initial number of buckets of a non-empty HT
defaultLoadFactor
public final static float defaultLoadFactor
- The default load factor for a non-empty HT. When the proportion
of elements per buckets exceeds this, the table is resized.
buckets
public abstract int buckets()
- return the current number of hash table buckets
buckets
public abstract void buckets(int newCap) throws IllegalArgumentException
- Set the desired number of buckets in the hash table.
Any value greater than or equal to one is OK.
if different than current buckets, causes a version change
- Throws: IllegalArgumentException
- if newCap less than 1
thresholdLoadFactor
public abstract float thresholdLoadFactor()
- Return the current load factor threshold
The Hash table occasionally checka against the load factor
resizes itself if it has gone past it.
thresholdLoadFactor
public abstract void thresholdLoadFactor(float desired) throws IllegalArgumentException
- Set the current desired load factor. Any value greater than 0 is OK.
The current load is checked against it, possibly causing resize.
- Throws: IllegalArgumentException
- if desired is 0 or less
All Packages Class Hierarchy This Package Previous Next Index


Account Linking FAQ
This guide provides answers to FAQs.
Frequently asked questions
Can Account Linking handle accounts with 2FA, CAPTCHA or other authentication challenges?
Sometimes the user’s input is required to successfully log in to a retailer account. This can happen when the user has 2FA enabled for an account, or when the retailer shows a CAPTCHA for extra verification, or in various other situations.
For both verifyRetailer
and grabNewOrders
this is handled in the same way:
The
BRAccountLinkingError
will indicate the stages of this processBRAccountLinkingErrorVerificationNeeded
indicates that the SDK has encountered a page that requires the user’s input. TheUIViewController
parameter of the callback will be populated with the view controller that you should displayBRAccountLinkingErrorVerificationCompleted
indicates that the user successfully authenticated and you should now dismiss the view controller (note that theUIViewController
callback parameter will benil
in this case but you do not need it to dismiss a presented modal, simply call, e.g.self.dismiss(animated: false)
)
Example:
let taskId = BRAccountLinkingManager.shared().grabNewOrders(for: .walmart) { retailer, order, remaining, viewController, errorCode, sessionID in
if (errorCode == .verificationNeeded) {
self.present(viewController, animated: true)
} else if errorCode == .verificationCompleted {
self.dismiss(animated: false)
} else if errorCode == .none {
// Order may be returned here
if (remaining <= 0) {
// Grab Orders Completed Successfully
// No more orders to fetch
}
} else {
// Grab Orders Failed. Check error for more info
}
}
Can I execute Account Linking from a background thread?
Account Linking is not thread safe so we recommend all execution is done on the main thread.
Can I link multiple accounts for the same retailer?
Linking multiple accounts for the same merchant is not supported. You have to unlink the account first before you link a different one for the same retailer.
Can I change user’s credentials?
Modifying user’s credentials is not allowed after the BRAccountLinkingConnection object is created. In order for you to change the credentials, you have to unlink the account first and then create and link new connection with different credentials.
let username = "user 1"
let password = "pass 1"
let connection = BRAccountLinkingConnection(retailer: .walmart, username: username, password: password)
BRAccountLinkingManager.shared().linkRetailer(with: connection)
BRAccountLinkingManager.shared().unlinkAccount(for: .walmart) {
let conn = BRAccountLinkingConnection(retailer: .walmart, username: "user 2", password: "pass 2")
conn.configuration.dayCutoff = 30
BRAccountLinkingManager.shared().linkRetailer(with: conn)
}
Note
It is recommended to call verifyRetailer before linking if unsure the credentials are valid
grabNewOrders returns success but i don’t see any of my orders!
The most common reasons for that are:
- Make sure your connection dayCutoff or dateCutoff is large enough to capture your orders. You can verify that by login in your web account and verifying that you have purchases newer than your
dayCutoff
. - Have you tried resetting the orders history? Very often developers forget to reset the cache while testing. By default the SDK maintains an internal date of the last successful search for each retailer so that each time you attempt to retrieve new messages, you will only get messages since the last successful check, and subject to the day cutoff that you set (default is 15 days).
You can also reach out to us at<EMAIL_ADDRESS>if you are still not seeing orders after trying the steps above.
Note
Unlinking account won’t reset the user’s cache if the same user is linked again. To make sure the cache is removed, you must call BRAccountLinkingManager.shared().resetHistory(for: .walmart)
for your retailer
Can I fetch In-Store orders with Account Linking?
Yes, Account Linking supports In-Store
purchases as long as they are visible in your account on the web. Please check your retailer’s guidelines on how to link your In-Store
purchases so they appear in your web account.
Note
Target, Walmart, Kroger are just few of the popular merchants that allow their customers to see their In-Store
purchases on the web.
What order types Account Linking supports?
Account Linking supports 5 order types:
- In-Store - Purchases done in store.
- Delivery - Purchases that are shipped to the customer.
- Pickup - Online purchases, picked in store by the customer.
- Digital - movies, eBooks, etc…
- Subscription
Does Account Linking return an order status of my purchases?
Account Linking supports 6 status values: cancelled
, refunded
, returned
, completed
, shipped
, ordered
. Depending on the retailer and the order type you may see these values populated in one of the following places:
- Order status - A status representing the whole order
- Shipment status - A status representing a single shipment. Available for
Delivery
orders only - Product status - A status for a single product.
Is Account Linking going to return a previously fetched order, if its status changes from shipped to delivered?
Account Linking only returns an order once. To get the most recent version of an order you have to re-scrape the order by resetting the order history.
BRAccountLinkingManager.shared().resetHistory(for: .walmart)
How does Account Linking handles the user’s credentials?
All credentials are stored locally on device’s keychain. They don’t leave the device and are only used by Account Linking, if authentication is required.
What data should I expect from Account Linking?
Account Linking returns orders as BRScanResult objects. You may see different properties of that object populated with values, depending on the retailer and the order type. For example: A In-Store
order would return a list with BRProducts in its products
property, while a Delivery
order would have the shipments
property populated with BRShipment objects. See order examples here
Note
We recommend our clients support all fields they care about despite not seeing values at the moment for some of the retailers. That way they may benefit from any OTA updates down the road without the need to submit a new app update.
How frequent does the background fetch executes?
Although our background job is scheduled to run every hour, it is up to the device (OS) to decide if a background task should be executed or not.