text:
========================================
Add CORS headers to server configuration
========================================

.. contents:: Table of Contents
    :depth: 3

Overview
========

If the MOTECH-UI is hosted on different a domain than MOTECH-CORE, we have to share resources between different domains.
XMLHttpRequest requests have traditionally been limited to accessing the same domain as the parent web page (as per the same-origin security policy).
Cross-site requests are forbidden by default because of their ability to perform advanced requests that introduce many cross-site scripting security issues.
Cross-Origin Resource Sharing (CORS) can define a way in which MOTECH-UI and MOTECH-CORE interact to determine safely whether or not to allow the cross-origin request.

It gives possibilities to specify which domains will have access to resources. This documentation page explains how MOTECH-CORE can configure its headers to support CORS.

Cross-site requests
===================

If we want to share resources, the MOTECH-CORE(server) must enable CORS.
However sending a cross-site request does not require setting any cross-origing sharing request headers programmatically.
CORS headers are set for you when making invocations to the server. Here you can find more information about it `the HTTP request headers <https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#The_HTTP_request_headers>`_.

Enable CORS in MOTECH-CORE
==========================

By default when a cross-site request is sent to MOTECH-CORE, the following error occurs::

	Origin http://example.domain.com is not allowed by Access-Control-Allow-Origin

To enable CORS we have to change configuration in the web server on which MOTECH-CORE is hosted. We can add the following CORS headers :

Access-Control-Allow-Origin
----------------------------

In this header we can specify which domains have access to resources. We can allow access from any origin using "*". But if you'd like finer control over who can access your data, use an actual value in the header. Examples::

   Access-Control-Allow-Origin: "*" (allow access from any origin)
   Access-Control-Allow-Origin: "http://motech-ui.example" (allow access from only "http://motech-ui.example" origin)
   Access-Control-Allow-Origin: "http://motech-ui.example | http://other.domain" (allow access from two mentioned origins)

Access-Control-Allow-Methods
-----------------------------

Comma-delimited list of the supported HTTP methods (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`,  `OPTIONS`). Examples::

   Access-Control-Allow-Methods: "GET" (only GET method is allowed in request)
   Access-Control-Allow-Methods: "POST, GET" (POST and GET are allowed in request)

Access-Control-Allow-Headers
----------------------------

This header specifies which complex HTTP headers can be used in a request to MOTECH-CORE. Example::

   Access-Control-Allow-Headers: "Content-Type,X-Requested-With,Accept,Authorization,Origin,Access-Control-Request-Method,Access-Control-Request-Headers"

Access-Control-Expose-Headers
-----------------------------

During a CORS request, client(MOTECH-UI) can only access simple response headers. Simple response headers are defined as follows:
    - Cache-Control
    - Content-Language
    - Content-Type
    - Expires
    - Last-Modified
    - Pragma

If you want clients to be able to access other headers, you have to use the Access-Control-Expose-Headers header. The value of this header is a comma-delimited list of response headers you want to expose to the client. Example::

   Access-Control-Expose-Headers: "Access-Control-Allow-Origin,Access-Control-Allow-Credentials" (client has access to values of mentioned headers)

Apache Web Server Config
========================

Apache Web Server includes support for CORS. To enable CORS support we have to running the following command which enable necessary for CORS mod headers::

	a2enmod headers

Now we can add the CORS headers into server configuration (usually /etc/apache*/apache*.conf). Inside a tag '<LocationMatch "/path">', we set up CORS headers which we want to add into server configuration.

Here is a config example "allow-all-origins":

.. code-block:: xml

    <LocationMatch "/motech-platform-server">
        Header always set Access-Control-Allow-Origin "*"
    </LocationMatch>

Here is a different config example (let's assume that http://motech-ui.example is an url to MOTECH-UI application):

.. code-block:: xml

    <LocationMatch "/motech-platform-server">
        Header always set Access-Control-Allow-Origin "http://motech-ui.example"
        Header always set Access-Control-Allow-Methods "GET,POST,PUT,DELETE,HEAD,OPTIONS"
        Header always set Access-Control-Allow-Headers "Content-Type,X-Requested-With,Accept,Authorization,Origin,Access-Control-Request-Method,Access-Control-Request-Headers"
        Header always set Access-Control-Expose-Headers "Access-Control-Allow-Origin,Access-Control-Allow-Credentials"
    </LocationMatch>

If changes are made while the Apache server was running, you should restart Apache.

Tomcat Web Server Config
========================

If you use Tomcat from Apache and you set the configuration on the Apache Web Server, you may skip this part of configuration.

Tomcat includes support for CORS (starting from Tomcat version 7.0.41). To enable CORS support we have to use CORS Filter.

If you want to enable CORS for all webapps, add the filter into **$CATALINA_BASE/conf/web.xml**.

If you want to enable them only for the MOTECH application, add the filter into **$CATALINA_BASE/webapps/motech-platform-server/WEB-INF/web.xml**.

If you have not configured Tomcat for multiple instances by setting a CATALINA_BASE directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME, the directory into which you have installed Tomcat.

The minimal configuration required to use this filter is:

.. code-block:: xml

    <filter>
        <filter-name>CorsFilter</filter-name>
        <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>CorsFilter</filter-name>
        <url-pattern> /* </url-pattern>
    </filter-mapping>

By default CORS headers will be set like the following::

 Access-Control-Allow-Origin: * (any domain)
 Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS
 Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers
 Access-Control-Expose-Headers:  (Non-simple headers are not exposed by default)

Here is a different config example (let's assume that http://motech-ui.example is an url to MOTECH-UI application):

.. code-block:: xml

    <filter>
        <filter-name>CorsFilter</filter-name>
        <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
        <init-param>
            <param-name>cors.allowed.origins</param-name>
            <param-value>http://motech-ui.example</param-value>
        </init-param>
        <init-param>
            <param-name>cors.allowed.methods</param-name>
            <param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
        </init-param>
        <init-param>
            <param-name>cors.allowed.headers</param-name>
            <param-value>Content-Type,X-Requested-With,Accept,Authorization,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
        </init-param>
        <init-param>
            <param-name>cors.exposed.headers</param-name>
            <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CorsFilter</filter-name>
        <url-pattern> /* </url-pattern>
    </filter-mapping>

If changes are made while the Tomcat server was running, you should restart Tomcat.


text:
Hanban News
Confucius Institute at the University of Western Australia Officially Unveils Its "Chinese Culture Experience Center"
[Source] Confucius Institute at the University of Western Australia [Time] 2010-11-25 17:11:10
On November 15th, 2010, it was hot in Perth, Australia in the Southern Hemisphere, the Confucius Institute at The University of Western Australia by the Swan River was filled with a festive atmosphere. Dr. Zhou Ji, President of Chinese Academy of Engineering, paid a visit to the Confucius Institute at The University of Western Australia to cut the ribbon for the ' Chinese Culture Experience Center ' of the Confucius Institute, along with Barry J. Marshall, Professor of the University of Western Australia, Nobel Laureate in Medicine and Prof. Philip Mead, Deputy Director of Faculty of Arts, Humanities at The University of Western Australia.
The experience center is equipped with advanced touch screen multimedia interactive devices. You need only to select related options with a gentle touch, then all kinds of related information, pictures and videos will appear on the screen. In addition, there is also a typical mini 'Chinese Museum' inside the experience center, which consists of a variety of books, CDs and ethnic costumes that are all related to China. Supported by Hanban, the experience center is the first Chinese culture experience center in Western Australia and will provide a favorable platform of interaction to allow for the local people to know about China and get an understanding of Chinese culture. (Wang Liyong)
2010/11/03Minister for Employment and Workplace Relations in Australia, Together with a Tertiary Education Delegation Visits Hanban
2010/09/21First Training of Local Teachers in the Use of Chinese Language Textbooks in Australia Reaches a Successful Conclusion

redpajama_set_name: RedPajamaCommonCrawl


text:
Home Metallurgy
General Motors To Invest US$45 MM In Upgrading Indiana Aluminium Die Casting Plant – Aluminium Insider
in Metallurgy
American automaker General Motors said late last week that it plans to invest US$45 million at its Indiana aluminium die casting facility in order to meet the growing demand for electric vehicles.
Per the firm, expansion of the Bedford Casting Operations facility will begin immediately, and will augment a previous investment of US$51 million in new equipment. Production at the site is centered on EV drive unit casings for GM's Chevrolet Silverado EV and GMC Sierra EV, among others.
Phil Kienle, GM vice president of North America manufacturing and labor relations, said in a press release that this was the first step in increasing the plant's preparation for the rise of electric vehicles.
"Our Bedford operation is one of the leading aluminum die casting facilities in the world and this additional investment is really an investment in the Bedford team and their commitment to excellence. This investment helps build job security for our Bedford team for years to come as we continue to prepare our entire manufacturing footprint for an all-electric future."
Ray Curry, UAW president, similarly said that the plant is poised to make a greater contribution to GM's EV production.
"UAW commends the announcement of this investment which recognizes the contribution of UAW Local 440 members. Their skill, training and craftsmanship contribute to the success of this facility, and this investment highlights the role they will play in GM's future EV growth."
The Bedford plant boasts a workforce of around 680 laborers and produces engine blocks, transmission cases, drive unit housings, and other components for Buick, Cadillac, Chevrolet, and GMC models. First opened in 1942, General Motors has invested over US$456 million at the plant over the past decade.
Alcoa Agrees With Rusal's Call For LME To Disclose Aluminium Stocks Origin – Aluminium Insider
Why Are Saint-Gaudens Coins So Popular?
The Perfect Cost Averaging Opportunity
Volatility storm adds to pain for Chile's battered markets
What's Really Going on with BRICS?
U.S. Facing A Natural Gas Shortage – Silver Doctors
Climate disasters risk putting a damper on electric car making
Keep the Big Picture in Mind as the Run to Gold Has Begun!


text:
COSAFA Women's Cup / FIFA Rankings make for interesting reading ahead of showdown
FIFA Rankings make for interesting reading ahead of showdown
The current FIFA Women's World Rankings paint an interesting picture ahead of the 2022 HOLLYWOODBETS COSAFA Women's Championship that will be held from August 31-September 11.
Only two of the competing regional sides are in the top 100 in the world, but that does not reflect the current quality of the field with the rankings determined over a four-year period and barely taking into account the rapid improvement in many teams.
Group C, which contains defending champions Tanzania, last year's runners-up Malawi, recent 2022 Wafcon quarterfinalists Botswana and Comoros has, quite rightly, been dubbed the Group of Death.
Three of those sides are among the top seven ranked teams in Nelson Mandela Bay and with only one guaranteed qualification for the semifinals, it will be a huge bunfight.
Perhaps not surprisingly current African champions South Africa are the top-ranked side at number two on the continent and 54 in the world.
Zambia, who finished third at the recent continental championships in Morocco, are second on the list at number 10 in Africa – a figure that will surely rise in the coming years – and 80 in the world.
Then come Angola (24 in Africa, 141 in the world), who are in Group A with South Africa and drew 0-0 with Banyana Banyana at last year's championships.
They are followed by Namibia (26, 146), who contest Group B with Zambia, and then the trio of Group C sides – Botswana (28, 151), Tanzania (29, 155) and Malawi (30, 158).
The lowest ranked side in the competition are Mauritius (44, 185), who return for the first time since 2019 and could give their numbers a major boost with a good tournament.
FIFA WOMEN'S RANKINGS
WORLD AFRICA GROUP IN NMB
South Africa 54 2 A
Zambia 80 10 B
Angola 141 24 A
Namibia 146 26 B
Botswana 151 28 C
Tanzania 155 29 C
Malawi 158 30 C
Lesotho 167 36 B
Mozambique 170 38 A
Eswatini 171 39 B
Comoros 179 41 C
Mauritius 185 44 A


text:
Indra mulls over idea of setting badminton club in Malaysia
Tuesday, 04 Feb 2003
PETALING JAYA: Former national singles chief coach Indra Gunawan of Indonesia has not ruled out coming back to Malaysia and forming a club here.
Yesterday, when contacted at his home in Jakarta, Indra did not want to comment on speculation that he would be forming a club in Malaysia to cater to players who will be dropped when the national team is trimmed this Saturday.
The Badminton Association of Malaysia (BAM) will announce their new squad after their council meeting on Saturday.
They will also announce their disciplinary board's decision on veteran Ong Ewe Hock.
National singles head coach Misbun Sidek will forward his recommendation for 12 players he wanted in his team.
Currently, there are 15 players under the BAM banner.
They are Ewe Hock, Wong Choong Hann, Lee Tsuen Seng, James Chua, Sairul Amar Ayob, Lee Chong Wei, Yeoh Kay Bin, Kuan Beng Hong, Ramesh Nathan, Ismail Saman, K. Yogendran, Tan Zhao Rong, Stanley Michael, Mohd Hazuan Jamaluddin and Mohd Nazree Latifi.
Three others not under the BAM banner but training under Misbun are Yong Hock Kin and Hashim brothers Roslin and Hafiz.
"I have no comment on this matter (speculation that he was going to form a club). But even if I decide to form a club in Malaysia, don't you think it will be good for the sport in Malaysia? It is good to have competition to motivate the players," said Indra.
"No one should be worried and have fear on this issue. Even if a club is formed for those who did not make the national squad or for anyone else for that matter, it will be only for the good of the sport."
Indra, who is on a three-month break after the BAM announced in November that his services were no longer required, said he was keeping his options open on his future.
"I am still getting many offers. I am assessing each one and see which one will be suitable for my age and me," said the 56-year-old Indra, who is the manager of the six-court Wira Hall in Jakarta.


Is the question_id monotonically increasing?
Does the question_id monotonically increase for every new question?
Is the question_id unique globally for a deployed app or is it unique in some sub-domain?
Is there any relation between a question_id and the tags which are associated with the question?
Any correlatation to any other fields related to the question?
Questions and Answers both use the same ID count. This means that the first question on a site would be ID 1. Then, the first answer is ID 2 and the second is ID 3. Then the next question on the site is ID 4. This keeps going.
Not the answer you're looking for? Browse other questions tagged support api stackapps .
Can I determine the post that caused a user to earn a badge?
How can I get a user's Meta site details in the API call?


Get matched to an Online Gerontology Degree Program for FREE!
Fueled by an aging population, there is a constant need for professionals in the health sciences and human services fields with a complete understanding of older people and their unique health concerns.
Gerontologists study how to improve the quality of life of this aging population, and society at large, to help baby boomers and the elderly continue to live fulfilling lives.
Gerontology is a multidisciplinary field that can be applied to many different careers and professions because it combines the social, psychological, and biological aspects of aging.
What Can You Do With a Gerontology Degree?
Degrees in these fields are designed to teach the challenge of caring for the nation's aging population, as well as strategies to improve care to effect positive change.
Earning a gerontology degree isn't as straightforward as many other fields because few schools offer a gerontology degree.
Instead, professionals in the field have usually earned their degree in a variety of subjects that teach the key concepts and research of gerontology and how to apply those concepts to different fields.
Check out some of the degrees you can earn to enter the field of gerontology below to find one that suits you. Then, complete the form on this page to get matched to the perfect program for you by selecting "Health & Medicine" degrees.
Human services is one of the degrees you can pursue to examine some of the key concepts in gerontology. While there aren't many specific gerontology degrees, some online human services programs offer a gerontology concentration to tailor your curriculum for that field.
Health sciences bachelor's degrees teach how the world of health care is changing like never before and how to apply the principles of health care to provide the highest quality care.
Usually, health sciences bachelor's programs include a mix of courses that include microbiology, environmental health, and practices in public health. Understanding each of these subjects, and how they apply to the aging population, help teach how to provide better overall care.
As the name suggests, online public health degrees focus on reducing health risks to large populations.
Public health combines many aspects, including disaster relief and child wellness programs, as well as how to improve the care of an aging population. But public health programs usually deal with these issues on a larger scale, such as in a community or a global issue, and are not as focused on individual care. You can find many public health degree programs, including MPH programs that accept low GPA.
Usually, this also includes a comprehensive understanding and insights on healthcare administration and delivery systems, as well as studying the process of aging.
This is through the application of research, education, and interdisciplinary knowledge of the aging process and aging populations.
Gerontologists, whether in the field of human services, health sciences, or public health, develop ways to enhance programs for the elderly in order to improve care on a social and psychological level.
Gerontology is the multi-faceted approach to studying the physical aspects of aging, as well as the mental, social, and societal implications.
On the other hand, geriatrics is strictly focused on the medical aspects of aging bodies and how they change and adjust to change in elder years.
Gerontologists are scientists, researchers, assistants, and aides that combine aspects of many fields to study the biological, social, and societal aspects of aging. Instead of focusing on the particular health of one older person - which is the job of a geriatrics professional - they study the impact aging has on the individual, the family and the community.
For example, a gerontologist may devote his or her efforts to finding the most sustainable and effective way to care for the elderly population in the community. They conduct research about the services and support that is most beneficial to the aging populace and also help individuals face-to-face.
Earning one of the degrees on this page covers some of the key concepts and research of gerontology. This may offer you more options than other fields. This flexibility allows you to pursue a variety of careers upon earning your degree.
Get matched to the perfect program for you in human services, health sciences, or public health by completing the form on this page!
These courses, and others, focus on teaching the key concepts and theories of gerontology, as well as how to apply them to specific fields to effect positive change.
Human services is broadly defined as maintaining a commitment to improving the overall quality of life. This usually includes a focus on prevention, as well as remediation of problems.
In simpler terms, those in human services are looking to serve the needs of larger populations. This may include large efforts meant to reach several people at once or other ways to help people improve their lives.
Interested in helping an aging population receive the care they deserve? Do you want to learn how to improve the lives of senior citizens and future populations? Then find the perfect program for you!
Complete the form on this page to get matched to programs in human services, health sciences, and public health for free!
Gerontology professionals may pursue a number of different career paths composed of many different responsibilities. They may work in the public or private sector and in various settings.
For example, a social and human service assistant may take care of an older person within his or her own place of residence, at a long-term care facility, or even in a community center helping older people every day.
On the other side of the spectrum, you could pursue more research work pertaining to the changes in society that will result from an aging population. You may pursue a career with a research organization or a university that specifically conducts studies and analysis to harness valuable data about the way older individuals live and how these lifestyles can be improved and maintained.
Your salary as a gerontologist is largely decided by your specific job title, your level of education, your experience in the industry, and your skill. Consider the following careers, with statistics compiled by the U.S. Bureau of Labor Statistics in 2016.


Mesosphere is dedicated to helping enterprises unlock the next generation of datacenter scale, efficiency and automation with Apache Mesos. Mesosphere's commercial product is the Mesosphere Datacenter Operating System (DCOS), a new kind of operating system that spans the entire datacenter and pools datacenter resources and automates IT operations. Backed by Andreessen Horowitz, Data Collective, Fuel Capital and Kleiner Perkins Caufield & Byers, Mesosphere is headquartered in San Francisco with a second office in Hamburg, Germany.


IRVINE, Calif., May 17, 2018 /PRNewswire/ -- ATTOM Data Solutions, curator of the nation's premier multi-sourced property database, today released its Q1 2018 Pre-Mover Housing Index, which shows that the highest pre-mover index in the first quarter of 2018 — predictive of a high percentage of homeowners moving in the second quarter — was in Nevada (200), followed by Delaware (163), Florida (159), Colorado (154) and Virginia (149).
Using data collected from purchase loan applications on residential real estate transactions, the ATTOM Data Solutions Pre-Mover Housing Index is based on the ratio of homes with a "pre-mover" flag during a quarter to total single family homes and condos in a given geography, indexed off the national average. An index above 100 is above the national average and indicates an above-average ratio of homes that will likely be sold in the next 90 days in a given market (see full methodology below).
"The pre-mover index provides insight into which markets are poised to see a high percentage of homeowners moving this spring and which markets are likely to see a high percentage of homeowners staying put," said Daren Blomquist, senior vice president at ATTOM Data Solutions. "Markets with a high pre-mover index tend to be in areas where homes are still somewhat reasonably priced and have a growing job market, allowing for greater upward mobility. Markets with a low pre-mover index tend to be in areas with a struggling job market or with home prices that are out of reach for the average wage earner."
Using data collected from purchase loan applications on residential real estate transactions, the ATTOM Data Solutions Pre-Mover Housing Index is based on the ratio of homes with a "pre-mover" flag to total single family homes and condos in a given geography, indexed off the national average. Any index above 100 is above the national average and indicates an above-average ratio of homes that will likely be sold in the next 30 to 90 days in a given market. Historical pre-mover data going back to Q1 2014 shows that 59 percent of homes with a pre-mover flag sell within 30 days of the estimated loan settlement date that is provided in the pre-mover data, and 76 percent sell within 90 days of that settlement date. The loan application data used for the pre-mover index also includes the intended purpose of the potential purchase: primary residence, secondary (vacation) home, or investment property.


Despite concern from some – including the Federal Reserve – about widening spreads on investment-grade commercial mortgage-backed securities, metrics on CMBS issuances and falling delinquencies indicate a fairly sunny outlook.
But analysts have pointed to metrics indicating such conditions as more of a temporary blip than a sign of a more pronounced slowdown in the controversial market.
Widely viewed as the sparkplug to the financial crisis in 2008, the CMBS market has returned with a vengeance this year. In the first half of 2015, new securitized loans based on New York City properties rose 47 percent year-over-year, climbing from $7.83 billion to $11.54 billion — the highest total in the first half of any year since the crisis, according to Trepp data.
Essentially, securitization allows a bank or lender to issue a mortgage, then re-package it into bonds tied to the loan's performance and sell them off to investors. The lender is paid to securitize the loan, and uses that payment to issue additional mortgages, creating a high volume of packaged loans for potential real estate investors.
Also boding well for the rising CMBS market is that delinquency rates — the number of loans that have delinquent payments divided by the total number of loans held by the institution — fell around 17 basis points in September, to 5.28 percent across all property types, according to Trepp.
Data from credit ratings agency Fitch, meanwhile, pegged that number at 4.46 percent in September – down six basis points from August and down 31 basis points year-over-year.
CMBS issuances, however, slowed down in early September. Total issuances in the third quarter was $22.1 billion – the third consecutive period of declining volume in the CMBS market – to bring the year-to-date total to $73.6 billion, Trepp said.
While issuances were projected to hit $115 billion to $125 billion in 2015, the firm now expects total issuances between $100 billion to $105 billion this year.