Write and draw without inhibition with the Ztylus Metal Apple Pencil Case which offers all-over protection with lightweight aluminum.
Write and draw without inhibition with the Ztylus Metal Apple Pencil Case. Offering all-over protection, this case remains totally sleek and slim to not create any bulk. Sliding over your Apple Pencil, the Ztylus Case uses aircraft grade aluminum. This material is known for its lightweight structure as well as its durability. Built into the Ztylus Case is a retractable tip protector as well as a clip. You can use and store your Apple Pencil just like you would a traditional pen. This retractable ability also ensures that the tip doesn't get damaged when it's not in use. Additionally, the Ztylus Case features a built-in cap holder which, as all Apple Pencil users know, it vital. Available in black and silver, the Ztylus Case is a must-have.


text:
/**
 * Example_PlotCoefficients.cpp (version 1.0)
 *
 * Intended to expand a given function into a
 * wavelet series and plot wavelet coefficients.
 *
 * This software is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either expressed or implied.
 *
 * Contact: AG Numerik, Philipps University Marburg
 * http://www.mathematik.uni-marburg.de/~numerik/
 */

#define PARALLEL 0
#define _DIM 1

#include <iostream>
#include <utils/function.h>
#include <interval/p_basis.h>
#include <interval/p_expansion.h>
#include <interval/i_indexplot.h>
#include <./TestFunctions.h>

using namespace std;
using namespace MathTL;
using namespace WaveletTL;

/**
 * Example PlotCoefficients: main()
 *
 *
 */
int main()
{
    cout << "Example [PlotCoefficients]" << endl
         << "\nExpanding some functions into their wavelet series ..." << endl;

    /*
     * Setup wavelet basis
     */
    const int d = 2;
    const int dt = 2;

    typedef PBasis<d,dt> Basis;
    typedef Basis::Index Index;
    Basis basis(0,0);  /* basis with no b.c.'s */

    //const int j0 = basis.j0();
    const int jmax = 9;  /* maximal level of wavelet basis */
    basis.set_jmax(jmax);

    /*
     * Hat function
     */
    Function<1>* f1 = new Hat();
    const char* filenameCoefficients1 = "Example_PlotCoefficients_Hat.m";

    cout << "\nExpanding 'Hat' function ..." << endl;

    InfiniteVector<double,Index> coeffs1;
    expand(f1, basis, false, jmax, coeffs1);

    cout << "\nWavelet coefficients in the primal basis:" << endl
         << coeffs1 << endl
         << "\nWrite coefficients of 'Hat' function to file ..." << endl;

    std::ofstream coeff_stream1;
    coeff_stream1.open(filenameCoefficients1);
    coeff_stream1 << "figure;" << endl;
    plot_indices(&basis, coeffs1, jmax, coeff_stream1, "jet", false, true, -8);
    coeff_stream1 << "title('Example [PlotCoefficients]: Hat function (Primbs basis)');" << endl;
    coeff_stream1.close();

    delete f1;

    cout << "Coefficient plot written to:" << endl
         << filenameCoefficients1 << endl;

    /*
     * Cut lin function
     */
    Function<1>* f2 = new CutLin();
    const char* filenameCoefficients2 = "Example_PlotCoefficients_CutLin.m";

    cout << "\nExpanding 'cut lin' function ..." << endl;

    InfiniteVector<double,Index> coeffs2;
    expand(f2, basis, false, jmax, coeffs2);

    cout << "\nWavelet coefficients in the primal basis:" << endl
         << coeffs2 << endl
         << "\nWrite coefficients of 'cut lin' function to file ..." << endl;

    std::ofstream coeff_stream2;
    coeff_stream2.open(filenameCoefficients2);
    coeff_stream2 << "figure;" << endl;
    plot_indices(&basis, coeffs2, jmax, coeff_stream2, "jet", false, true, -8);
    coeff_stream2 << "title('Example [PlotCoefficients]: cut lin function (Primbs basis)');" << endl;
    coeff_stream2.close();

    delete f2;

    cout << "Coefficient plot written to:" << endl
         << filenameCoefficients2 << endl;

    /*
     * Cut sqrt function
     */
    Function<1>* f3 = new CutSqrt();
    const char* filenameCoefficients3 = "Example_PlotCoefficients_CutSqrt.m";

    cout << "\nExpanding 'cut sqrt' function ..." << endl;

    InfiniteVector<double,Index> coeffs3;
    expand(f3, basis, false, jmax, coeffs3);

    cout << "\nWavelet coefficients in the primal basis:" << endl
         << coeffs3 << endl
         << "\nWrite coefficients of 'cut sqrt' function to file ..." << endl;

    std::ofstream coeff_stream3;
    coeff_stream3.open(filenameCoefficients3);
    coeff_stream3 << "figure;" << endl;
    plot_indices(&basis, coeffs3, jmax, coeff_stream3, "jet", false, true, -8);
    coeff_stream3 << "title('Example [PlotCoefficients]: cut sqrt function (Primbs basis)');" << endl;
    coeff_stream3.close();

    delete f3;

    cout << "Coefficient plot written to:" << endl
         << filenameCoefficients3 << endl;

    /*
     * Cut pwr function
     */
    Function<1>* f4 = new CutPwr();
    const char* filenameCoefficients4 = "Example_PlotCoefficients_CutPwr.m";

    cout << "\nExpanding 'cut pwr' function ..." << endl;

    InfiniteVector<double,Index> coeffs4;
    expand(f4, basis, false, jmax, coeffs4);

    cout << "\nWavelet coefficients in the primal basis:" << endl
         << coeffs4 << endl
         << "\nWrite coefficients of 'cut pwr' function to file ..." << endl;

    std::ofstream coeff_stream4;
    coeff_stream4.open(filenameCoefficients4);
    coeff_stream4 << "figure;" << endl;
    plot_indices(&basis, coeffs4, jmax, coeff_stream4, "jet", false, true, -8);
    coeff_stream4 << "title('Example [PlotCoefficients]: cut pwr function (Primbs basis)');" << endl;
    coeff_stream4.close();

    delete f4;

    cout << "Coefficient plot written to:" << endl
         << filenameCoefficients4 << endl;

    /*
     * Kink function
     */
    Function<1>* f5 = new Kink(0.5);
    const char* filenameCoefficients5 = "Example_PlotCoefficients_Kink.m";

    cout << "\nExpanding 'Kink' function ..." << endl;

    InfiniteVector<double,Index> coeffs5;
    expand(f5, basis, false, jmax, coeffs5);

    cout << "\nWavelet coefficients in the primal basis:" << endl
         << coeffs5 << endl
         << "\nWrite coefficients of 'Kink' function to file ..." << endl;

    std::ofstream coeff_stream5;
    coeff_stream5.open(filenameCoefficients5);
    coeff_stream5 << "figure;" << endl;
    plot_indices(&basis, coeffs5, jmax, coeff_stream5, "jet", false, true, -8);
    coeff_stream5 << "title('Example [PlotCoefficients]: Kink function (Primbs basis)');" << endl;
    coeff_stream5.close();

    delete f5;

    cout << "Coefficient plot written to:" << endl
         << filenameCoefficients5 << endl;

    /**
     * Contact: AG Numerik, Philipps University Marburg
     * http://www.mathematik.uni-marburg.de/~numerik/
     */
    cout << "\nContact: AG Numerik, Philipps University Marburg" << endl
         << "http://www.mathematik.uni-marburg.de/~numerik/" << endl
         << "\nEnd of Example [PlotCoefficients]." << endl;

    return EXIT_SUCCESS;
}

redpajama_set_name: RedPajamaGithub


text:
Honda restores 1961 Chevy pickup to celebrate 60 years in America
To commemorate American Honda's 60th anniversary, the company has located and restored a half-ton '61 Chevy pickup. You might be wondering why this makes any sense, but it all has to do with a literal snapshot in time at American Honda HQ in 1961.
American Honda Motor Company first set up shop on Los Angeles' Pico Avenue 60 years ago, in 1959, selling the 50cc Super Cub motorcycle. Within six years, Honda was America's best-selling motorcycle brand, with nearly three-quarters of the market.
There is a historic photo taken of the modest Pico Ave. headquarters in 1961. Parked on the sidewalk in front of the shop was a white 1961 Chevrolet Apache 10 pickup truck, wearing Honda logos in red, with a Honda 50 (as the Super Cub was marketed in the U.S.) and a CB160 in the bed. That year, AHM bought 10 Chevy pickups to deliver motorcycles to its growing network of dealers in Southern California. The trucks were an important element in establishing a foothold for Honda in the American market, and the company is not ashamed to attribute some of that success to a competitor's product.
Using the resources of both company archives and retired employees to get the details just right, Honda replicated the original paint scheme and livery for this true-to-the-photo '61 Chevy. Honda even loaded the bed with perfect examples of the Honda 50 and CB160, just as in the photograph.
The "Honda Chevy" and its two bikes are currently on display in the lobby of American Honda's present headquarters in Torrance, California, which is a bit more substantial than its former Pico Ave. digs.
Over the next few months, the truck will appear at car shows and events in Southern California and around the country, culminating in an appearance at the 2019 SEMA show in Las Vegas. Eventually, it will find its final home at the American Honda Collection Hall at the Torrance HQ, where it will go on display in front of a replica of the Pico office.
Read next Up next: The car that couldn't save Saturn

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Using Python to retrieve access token for Power BI's Rest API? I'm in the process of building an app that utilises Power BI Service's Rest API to build PBI dashboards. The documentation for this, however, seems to be sparse and incomplete. Getting an access token isn't, in and of itself, too difficult. If you go to any PBI Rest API doc (e.g. Push Datasets - Datasets PostDataset) and click "Try It" you can find an access token in the Request Preview. The difficult part is to have your code automatically retrieve the right token.
I have found at least one method to make this work, but I copy and pasted it from an online forum, don't exactly understand it, and can't get it to work with app passwords (which is essential). That piece of code is this.
def retrieve_access_token(email_address, password, my_org, client_id):
    import adal
    authority_url = f'https://login.microsoftonline.com/{my_org}.com'
    context = adal.AuthenticationContext(
        authority_url,
        validate_authority=True,
        api_version=None
    )

    token = context.acquire_token_with_username_password(
        resource='https://analysis.windows.net/powerbi/api',
        username=email_address,
        password=password,
        client_id=client_id
    )

    access_token = 'Bearer ' + token['accessToken']

    return access_token

I think that code comes from the MS doc Acquire an access token (Python), but the doc gives no detail on the 'authority' or 'resource' values, which means there's no way to change this code to get it to work better if you can somehow get it to work at all.
I've built another function based on the YouTube video How to Execute Azure REST APIs with Postman, which I think is using a method similar to that outlined in the MS doc Microsoft identity platform and OAuth 2.0 authorization code flow. That code is able to retrieve an access token, and I've configured the Azure app registration with every permission available for Power BI, but it doesn't get any responses from the PBI Rest API, and it's unclear what the token is for. That code is this.
def get_access_token(tenant_id, client_id, client_secret):
    url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/token"
    payload = {'grant_type': 'client_credentials',
               'client_id': client_id,
               'client_secret': client_secret,
               'resource': 'https://management.azure.com/'}
    headers = {'Cookie':
               'fpc=Aj6jaa6czgFGoa7atKyYeA7IWmJdAQAAAPp_ctYOAAAA; x-ms-gateway-slice=prod; stsservicecookie=ests'}
    response = requests.post(url, headers=headers, data = payload)
    return 'Bearer ' + eval(response.text)['access_token']

Does anyone have any idea how to get an access token that works for the PBI Rest API just from using code (Python, if possible), and does anyone know how to get the app passwords to work with it? Doing all of this from Python has been an uphill battle, to say the least, and any help would be greatly appreciated.
NOTE: The my_org part of retrieve_access_token is pseudocode. For it to work you have to find your login.microsoftonline URL. I found that out through trial and error and can't direct you to any further information.

A: you are using the client_credentials grant type method to get an Auth token for the tenant but I believe that while using the Azure web app Auth token call you need to use the grant type "password".  Meaning that the PBI account that you set up with the Azure web app needs to have admin access to the workspace that you are calling the Auth token for.  Example code below works in my specific environment.
I'm not going to pretend that I am an expert I'm also in the process of trying to figure out exactly what the permissions and PBI Auth token calls are limited too as per client secret vs web app username/password.
https://community.powerbi.com/t5/Developer/grant-type-must-be-quot-password-quot-and-app-level-permissions/m-p/515414#M15906
def get_access_token(client_id, username, password):
    data = {
        'grant_type': 'password',
        'scope': 'openid',
        'resource': r'https://analysis.windows.net/powerbi/api',
        'client_id': client_id,
        'username': username,
        'password': password
    }
    token = requests.post('https://login.microsoftonline.com/common/oauth2/token', data=data)
    assert token.status_code == 200, "Fail to retrieve token: {}".format(token.text)
    return token.json().get('access_token')

redpajama_set_name: RedPajamaStackExchange


text:
'Race 3' had Bollywood's largest shooting unit
Added by Indo American News on May 29, 2018.
Saved under Bollywood News, Entertainment
Tags: Baytown, Bollywood, Clear Lake, Cypress, Desi news, Greater Houston, Houston, Houston Desi news, India, Indian American community, Indian News, Indians in America, Indo-American News, Katy, NRI, pearland, Race 3, Remo D'Souza, Salman Khan, south asia, South India, Sugar Land, Texas, USA, Washington
MUMBAI: Apart from having an impressive ensemble cast, 'Race 3' has been generating a lot of interest for its songs and slick action sequences. Ever since the trailer of the Salman Khan flick released, fans have been eager to find out more details. Apart from the fact that the film is a part of a big franchise, with Salman performing a majority of the stunts on his own, what many people are unaware about is that fact that it had the biggest shooting unit on the sets.
Director Remo D'Souza hopes to take the 'Race' franchise to another level, which is why he is sparing no expense when it comes to making the film on a grand scale to ensure that fans enjoy every minute of it.


text:
Explainer: what is TB and am I at risk of getting it in Australia
This article was written by Associate Professor Justin Denholm for The Conversation.
Tuberculosis (TB) is an infectious disease caused by the bacterium Mycobacterium tuberculosis. It most commonly causes pneumonia - a lung infection. Sick people will experience cough, fever, sweats and weight loss, usually over weeks to months.
TB can also cause disease in other parts of the body. The most severe types affect the brain (TB meningitis) or spread through the bloodstream (disseminated TB).
Like other bacterial infections, tuberculosis is curable with antibiotics. It is a slow-growing bacteria, so long courses of several antibiotics are needed for effective treatment. Usually, this means a six month course of two to four antibiotics each day.
There are many strains of TB, and some drug resistant TB take much longer to finish treatment. Worldwide, there are growing problems with multi-drug resistant (MDR) TB. This is defined as being resistant to the two main antibiotics (isoniazid and rifampicin) and cases are not common in Australia (about 2% of all cases).
Tuberculosis is still a common disease in many parts of the world. There were more than 10 million cases and 1.4 million deaths from the disease in 2015. The risk of contracting the disease varies a great deal globally, with countries including India, South Africa and Indonesia being most affected.
In Australia, there are around 1200 to 1300 cases of tuberculosis each year, which means we are among the lowest-risk countries in the world. Because of Australia's low rate of TB and high health-care standards, we have been identified by the World Health Organization as one of the countries best placed to eliminate TB entirely.
People who were born and grew up in Australia are very unlikely to get TB, unless they have close contact with a sick person.
The people most at risk of TB in Australia are those who have spent their early years of life in countries with high rates of the disease, and have contracted it without knowing. Even many years after leaving, people can still be at risk of getting sick with TB.
People who are sick with TB pneumonia can infect others through coughing. But TB is much less contagious than influenza or other viral infections. People who spent long periods of close contact, especially young children living in a household with the sick person, are most at risk of contracting TB.
People with serious immune problems, such as HIV infection or cancer chemotherapy, are also at higher risk of becoming sick if they are exposed.
If a person does have close contact with someone with TB, they can breathe in TB and become infected. Most people with a normal immune system will not become sick themselves, but instead keep TB bacteria in a "sleeping" state called latent TB infection.
People with a latent infection may never become sick, but will have a chance of developing active TB at some point in their lives. People with latent TB will not feel sick, and cannot infect others, but can be identified with blood or skin tests. Antibiotic treatment is available for people with latent TB which can greatly reduce the risk of becoming sick in future.
When cases of TB happen in Australia, state and territory public health programs make sure those who are sick receive appropriate treatment, including antibiotics and hospital care. Tuberculosis treatment is provided free of charge in Australia for anyone who needs it.
TB programs will also investigate those who may have been in contact with the contagious person. These programs will arrange testing for community members who might be at risk, and suggest treatment to prevent those found to have been infected from becoming sick.
Isn't there a TB vaccine?
The Bacille Calmette-Guerin vaccine (BCG) for TB has been available for about 100 years, and is still one of the most widely used vaccines in the world. It is especially effective in preventing severe TB in young children, although much less effective in adults.
In Australia, the BCG vaccine was given routinely until the early 1980s, when it was removed from the vaccine schedule because falling TB rates made it unnecessary. Australian guidelines still recommend some groups of people get the vaccine.
This includes children younger than five who will be travelling overseas to countries with high rates of TB, and Aboriginal and Torres Strait Islander children living in TB-risk areas.
Australians who travel frequently, including to countries such as Vietnam, Indonesia and Papua New Guinea where TB is much more common, are fortunately at very low risk of catching TB overseas, and no pre-travel vaccines are needed.
People at very high risk of TB exposure, like those going to work in healthcare in countries with high TB rates or those on immune suppressing medication, may need special advice and should talk about risk with their doctors prior to travel.


New York Rangers President and General Manager Glen Sather announced today that the club has agreed to terms with forward Kris Newbury on a new contract.
Newbury, 30, skated in 65 games with the Connecticut Whale of the American Hockey League (AHL) last season, registering 25 goals and 39 assists for 64 points, along with 130 penalty minutes. He established career-highs in goals, points, shots on goal (221), and power play goals (seven). Newbury tied for 10th in the AHL in points, 18th in assists and 15th in shots on goal. He led Connecticut in goals, tied for the team lead in points, ranked second in assists, shots on goal and penalty minutes, and fourth in power play goals.
Newbury posted a team-high, 18 multi-point performances, including his first career hat trick in the season opener on October 8 at Adirondack and a career-high, four-assist effort on December 16 against Bridgeport. His four-assist effort began a season-high, eight-game point streak through January 2 at Portland, registering 17 points (five goals, 12 assists) over the span.
Forward Kris Newbury, who first came to the Blueshirts in a 2010 trade, has played parts of the last two seasons in New York while splitting time with the Connecticut Whale, where he has been one of the AHL team's top scorers.
In the playoffs, Newbury recorded one goal and three assists, along with 20 penalty minutes in nine games. He tied for fourth on Connecticut in postseason points and fifth in assists.
In addition, Newbury skated in seven games with the Rangers last season. He made his season debut with the Blueshirts on October 18 at Vancouver. Newbury has registered eight points (four goals, four assists) and 123 penalty minutes in 66 career NHL games over six seasons with the Rangers, Detroit Red Wings and Toronto Maple Leafs.
He made his NHL debut on December 23, 2006, against Washington, and tallied his first career point with a goal on January 1, 2007, against Boston.
The 5-11, 205-pounder has skated in 529 career AHL games over nine seasons with the Connecticut Whale/Hartford Wolf Pack, Grand Rapids Griffins, and Toronto Marlies/St. John's Maple Leafs, registering 122 goals and 255 assists for 377 points, along with 1,205 penalty minutes. Newbury established career-highs in assists (44) and tied his career-high in game-winning goals (five) with Connecticut in 2010-11.
In postseason play, Newbury has recorded seven goals and 15 assists for 22 points, along with 143 penalty minutes in 44 career games with Connecticut and Toronto/St. John's. He established career-highs in games played (19), goals (four), assists (nine), and points (13) with Toronto (AHL) in the 2008 playoffs.
The Brampton, Ontario native was acquired by the Rangers from Detroit in exchange for Jordan Owens on March 3, 2010. He was originally selected by San Jose as a fifth round choice, 139th overall, in the 2002 NHL Entry Draft.


How do you become successful and consequentially happy in what you are doing? Harvard professor Mr. Shawn Achor conducts research on the happiness of humans and its main drivers. In a TED Talk he explained, «[…] it's not necessarily the reality that shapes us, but the lens through which your brain views the world that shapes your reality. And if we can change the lens, not only can we change your happiness, we can change every single educational and business outcome at the same time».
Our mutual understanding is that we are successful if we work hard, and this rises our happiness level. Mr. Achor wants us to reverse this formula as he found that our brain is 31% more productive if we feel positive because of a hormone produced in a stage of happiness: dopamine. First, it makes us feel even better and second, it increases our cognitive activities.
Let me give you an insight on my humble career, that has been consistently influenced by my strive for happiness. After finishing high-school and turning 19 (recently I joined the club of the 30s), I was not at all interested in studying. I joined a team of snowboard instructors in a tiny Swiss village. I felt that being outside and teaching followers who want to improve their snow sport skills was the passion that evoked personal happiness. After four years of working and travelling between the mountainous landscape of Switzerland and the crystal blue water in the Caribbean Sea, my ideas advanced. In autumn 2012, and after three years of academic exchange and terrific student life, I graduated from the HTW Chur and obtained my Bachelor of Science in Tourism. During my studies, I acquired a competence profile with specialist knowledge and a broad understanding of complex business processes with a special focus on the tourism industry. Teaching methods at the HTW Chur attach high importance on practice orientation in both teaching and research. The university provides a very attractive study program that meets a clear need in the labor market and provides access to challenging management tasks not solely in the tourism industry. Afterwards, I worked three years as pricing manager at Lenzerheide Bergbahnen AG and product manager of snow sport products at Lenzerheide Marketing & Support AG. Along the way, I certified as Revenue Manager ECRME. In September 2015, I enrolled in the consecutive part-time master's degree at the ZHAW School of Management and Law in Winterthur at the end of which I aim to acquire the Master in Business Administration with specialization in marketing. In the meantime, I have been selected for membership in Beta Gamma Sigma in recognition of high scholastic achievement and was recently granted a scholarship from the Hirschmann Foundation to promote my academic career and honor my social engagement.
I would like to highlight a specific experience to date: my exchange semesters abroad. Studying abroad is an exceptional experience and opportunity to develop cultural competences and foster an international understanding. Let me list my three reasons why I decided to go abroad. Firstly, the exchange of experiences with people whose believes and values are shaped by a different cultural background is of great importance to me. Secondly, I had the desire to meet new citizens of the world, form friendships and create a global social network. Thirdly, I was aspired to improve my language skills. In my point of view communication is a crucial method to exchange emotions, knowledge and expectations – not only verbally.
My first exchange year brought me to Thompson Rivers University in Kamloops, British Columbia (BC) in Canada. When I arrived in Kamloops I was surprised by the setting and the very rural area. But at second glance I discovered the beauty of Kamloops and its overwhelming and boundless possibilities.
My second study abroad was at EBAPE FGV in Rio de Janeiro, which according to the Brazilian Ministry of Education is the top-rated business school in Brazil. The marvelous city (cidade maravilhosa) is one of the major economic and cultural hubs of South America. Its residents (cariocas) are famous for their kindness and hospitality. There is so much more to Rio than Copacabana and Christ the Redeemer. It offers a huge variety of lifestyle, culture or nature – a place where people strive for happiness.
Soon, I will graduate from the ZHAW. What comes next? Where will I head to? So far, I do not know. The main thing is that I won't stop striving for happiness. Success will follow. In any shape, at all points.
Tobias Cerny is an alumnus of the HTW Chur. He obtained his Bachelor of Science in Tourism in 2012.


Word of God Baltimore is Celebrating 5 Years as a WORD Church Living a WORD Life!
We invite you to experience the move of God with us! Sunday service begins at 10am and Wednesday Bible study begins at 7pm. For directions to our campus, click here or join us on church online! We look forward to seeing you soon.
No longer dead, but alive. No longer hopeless, but purposeful. — Come hear about the victory already won!
Worship with our online community - chat, pray, read the Bible, take notes and more!


The 2016 Swiss Stata Users Group meeting was November 17, but you can still interact with the user community even after the meeting and learn more about the presentations shared.
Abstract: matchit is a user-written command allowing one to combine two datasets based on similar but not necessarily equal text strings and to compare the text similarity between two string variables from the same dataset. These features make matchit a handy and powerful tool in the preparation of data for statistical and econometric analysis as well as in the creation of metrics based on text similarity.
A nonexhaustive list of typical uses for matchit includes duplicate record consolidation within a nonstandardized dataset (for example, cleaning a list of patient names including multiple spellings), combination of two datasets with non-standardized keys (for example, merging hospital and insurance data based on treatment names), or creating quantitative measures based on string similarity (for example, comparing the scientific proximity between two medical schools based on their scientific publications and patents).
matchit can perform a wide range of string similarity algorithms—such as ngram, token, soundex, nysiis, or hybrid ones—that, combined with different weighting and scoring functions, allow users to perfect the resulting dataset. Moreover, it also allows for coding custom algorithms and functions benefiting from indexation and other built-in functionalities.
Abstract: Researchers working with observational data are often faced with the problem of finding the nearest measurement around a particular date. For instance, a medical researcher may be interested in finding the least proximal CD4+ Tcell count measurement prior to initiation of an antiretroviral therapy against HIV, which is known to be predictive for treatment success. While this is not an overly difficult programming task, it takes several lines of potentially error‐prone code for implementation.
The fmatch command offers a versatile tool that can achieve such tasks with a single line of code. fmatch is a "wrapper" program for the well‐known mmerge command by J. Weesie. It offers multiple options for controlling merging options via specification of date ranges to define eligible measurements as well as for finding smallest or largest values among all eligible measurements. The functionality of fmatch will be illustrated with examples from HIV research.
Abstract: Missing values are common in many fields. If analyses do not properly account for missing values, the resulting estimates may be biased. Stata gives the user access to multiple principled methods of handling missing values in a dataset. This talk will focus on two methods, multiple imputation (MI) and full information maximum likelihood (FIML). After an introduction to important concepts in the analysis of missing data, this presentation will provide an overview of how to perform analyses using MI and FIML in Stata. A comparison of the techniques and their advantages and disadvantages will be included.
Abstract: MarkDoc is a general-purpose literate programming package for Stata that can serve a variety of purposes such as creating dynamic documents, dynamic presentation slides, Stata package help files, and Stata package documentation in various formats. The presentation introduces the package and its overall workflow as well as the recent improvements in the package. Moreover, the applications of the package for data analysis, teaching statistics, and documenting new Stata packages are discussed.
Abstract: At the 2009 meeting in Bonn, I presented a new Stata command called texdoc. The command allowed weaving Stata code into a LaTeX document, but its functionality and its usefulness for larger projects was limited. In the meantime, I heavily revised the texdoc command to simplify the workflow and improve support for complex documents. The command is now well suited, for example, to generate automatic documentation of data analyses or even to write an entire book. In this talk, I will present the new features of texdoc and provide examples of their application. Furthermore, I will present a newly released companion command called webdoc that can be used to produce HTML or Markdown documents.
Abstract: Since the early nineties, logistic regression for binary, ordinal, and nominal dependent variables has become widely spread in the social sciences. Nevertheless, there is no consensus on how to assess the fit of these models corresponding to practical significance. A lot of pseudocoefficients of determination have been proposed but seldom used in applied research. Most of these pseudo-R2 follow the principle of the proportional reduction of error comparing the likelihood, the log-likelihood, or the precision of prediction with those of a baseline model including the constant only.
Alternatively, McKelvey and Zavoina (1975) have proposed a different one estimating the proportion of explained variance of the underlying latent dependent variable. Summarizing the Monte Carlo studies of Hagle and Mitchell (1992), Veall and Zimmermann (1992, 1994) and Windmeijer (1995) show that the McKelvey and Zavoina pseudo-R2 is the best one to evaluate the fit of binary and ordinal logit or probit models. Applying the assumption of identical independent distributed errors, I also propose a generalization of the McKelvey and Zavoina pseudo-R2 to the multinomial logistic regression, assessing the fit of each binary comparison simultaneously. The usefulness of this concept is demonstrated by applied data analysis of an election study with Stata using the self-developed mzr2 command.
Abstract: Counterfactual distributions are important ingredients for policy and decomposition analysis. For example, we might be interested in what the outcome distribution for the treated units would be had they not received the treatment or in what the distribution of wages for female workers would be in the absence of gender discrimination in the labor market (that is, if female workers are paid the same as male workers with the same characteristics) or in what the distribution of housing prices would be if we clean up a local hazardous waste site. More generally, we can think of a policy intervention either as a change in the distribution of a set of explanatory variables X that determine the outcome variable of interest Y or as a change in the conditional distribution of Y given X. The Stata commands counterfactual and cdeco implement estimation and inference procedures for these two types of applications. The estimation of the conditional distribution can be based on the main regression methods, including classical, quantile, duration, and distribution regressions. The commands provide not only pointwise but also functional confidence bands, which cover the entire functions with prespecified probability and can be used to test functional hypotheses such as no effect, positive effect, or stochastic dominance.
Abstract: Incorporating covariates in (income or wage) distribution analysis typically involves estimating conditional distribution models, that is, models for the cumulative distribution of the outcome of interest conditionally on the value of a set of covariates. A simple strategy is to estimate a series of binary outcome regression models for F(z|xi)=Pr(yi≤z|xi)F(z|xi)=Pr(yi≤z|xi) for a grid of values for z (Peracchi and Foresi, 1995, Journal of the American Statistical Association; Chernozhukov et al., 2013, Econometrica). This approach, now often referred to as "distribution regression", is attractive and easy to implement. This talk illustrates how the Stata commands margins and suest can be useful for inference here and suggests various tips and tricks to speed up the process and solve potential computational issues. It also shows how to use conditional distribution model estimates to analyze various aspects of unconditional distributions.
Abstract: Bland and Altman's limits of agreement (LoA) have traditionally been used in clinical research to assess the agreement between different methods of measurement for quantitative variables. However, when the variances of the measurement errors of the two methods are different, Bland and Altman's plot may be misleading; there are settings where the regression line shows an upward or a downward trend but there is no bias or a zero slope and there is a bias.
Therefore, the goal of this presentation is to clearly illustrate why and when a bias arises, particularly when heteroskedastic measurement errors are expected, and to propose new plots to help the investigator visually and clinically appraise the performance of the new method. These plots do not have the above-mentioned defect and are still easy to interpret, in the spirit of Bland and Altman's LoA.
To achieve this goal, we rely on the modeling framework recently developed by Nawarathna and Choudhary, which allows the measurement errors to be heteroskedastic and depend on the underlying latent trait. Their estimation procedure, however, is complex and rather daunting to implement. Therefore, we have developed a new estimation procedure that is much simpler to implement and yet performs very well, as illustrated by our simulations.
The methodology requires several measurements with the reference standard and possibly only one with the new method for each individual.
Abstract: While Stata's computational capabilities have intensively increased over the last decade, the quality of its default figure schemes is still a matter of debate among users. Clearly, some of the arguments speaking against Stata figures are subject to individual taste, but others are not, such as horizontal labeling, unnecessary background tinting, missing gridlines, and oversized markers. The two schemes introduced here attempt to solve the major shortcomings of Stata's default figure schemes. Furthermore, the schemes come with 21 new colors, of which 7 colors are distinguishable for people suffering from color blindness.
Abstract: grcomb is a user-written wrapper for Stata's graph combine. It makes quick-and-dirty multipanel plotting easy.
The logistics organizer for the 2016 Swiss Stata Users Group meeting is Ritme, scientific solutions, the distributor of Stata in Switzerland, France, and Belgium.
For more information about the 2016 Stata Users Group meeting, visit the official website.


text:
/*
 * User: anna
 * Date: 06-May-2008
 */
package com.intellij.refactoring.extractMethodObject;

import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.codeStyle.VariableKind;
import com.intellij.psi.controlFlow.ControlFlowUtil;
import com.intellij.psi.impl.source.PsiImmediateClassType;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.PropertyUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.refactoring.BaseRefactoringProcessor;
import com.intellij.refactoring.HelpID;
import com.intellij.refactoring.classMembers.MemberInfoBase;
import com.intellij.refactoring.changeSignature.ChangeSignatureProcessor;
import com.intellij.refactoring.changeSignature.ParameterInfoImpl;
import com.intellij.refactoring.extractMethod.AbstractExtractDialog;
import com.intellij.refactoring.extractMethod.ExtractMethodProcessor;
import com.intellij.refactoring.ui.MemberSelectionPanel;
import com.intellij.refactoring.util.RefactoringUtil;
import com.intellij.util.VisibilityUtil;
import com.intellij.refactoring.util.classMembers.MemberInfo;
import com.intellij.refactoring.util.duplicates.Match;
import com.intellij.usageView.UsageInfo;
import com.intellij.usageView.UsageViewDescriptor;
import com.intellij.usageView.UsageViewUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Function;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.*;

public class ExtractMethodObjectProcessor extends BaseRefactoringProcessor {
  private static final Logger LOG = Logger.getInstance("#" + com.intellij.refactoring.extractMethodObject.ExtractMethodObjectProcessor.class.getName());
  @NonNls public static final String REFACTORING_NAME = "Extract Method Object";

  private final PsiElementFactory myElementFactory;

  private final MyExtractMethodProcessor myExtractProcessor;
  private boolean myCreateInnerClass = true;
  private String myInnerClassName;

  private boolean myMultipleExitPoints;
  private PsiField[] myOutputFields;

  private PsiMethod myInnerMethod;
  private boolean myMadeStatic = false;
  private final Set<MethodToMoveUsageInfo> myUsages = new HashSet<MethodToMoveUsageInfo>();
  private PsiClass myInnerClass;

  public ExtractMethodObjectProcessor(Project project, Editor editor, PsiElement[] elements, final String innerClassName) {
    super(project);
    myInnerClassName = innerClassName;
    myExtractProcessor = new MyExtractMethodProcessor(project, editor, elements, null, REFACTORING_NAME, innerClassName, HelpID.EXTRACT_METHOD_OBJECT);
    myElementFactory = JavaPsiFacade.getInstance(project).getElementFactory();
  }

  protected UsageViewDescriptor createUsageViewDescriptor(final UsageInfo[] usages) {
    return new ExtractMethodObjectViewDescriptor(getMethod());
  }

  @NotNull
  protected UsageInfo[] findUsages() {
    final ArrayList<UsageInfo> result = new ArrayList<UsageInfo>();
    PsiReference[] refs =
        ReferencesSearch.search(getMethod(), GlobalSearchScope.projectScope(myProject), false).toArray(PsiReference.EMPTY_ARRAY);
    for (PsiReference ref : refs) {
      final PsiElement element = ref.getElement();
      if (element != null && element.isValid()) {
        result.add(new UsageInfo(element));
      }
    }
    if (isCreateInnerClass()) {
      final Set<PsiMethod> usedMethods = new HashSet<PsiMethod>();
      getMethod().accept(new JavaRecursiveElementWalkingVisitor() {
        @Override
        public void visitMethodCallExpression(PsiMethodCallExpression expression) {
          super.visitMethodCallExpression(expression);
          final PsiMethod method = expression.resolveMethod();
          if (method != null) {
            usedMethods.add(method);
          }
        }
      });

      for (PsiMethod usedMethod : usedMethods) {
        if (usedMethod.getModifierList().hasModifierProperty(PsiModifier.PRIVATE)) {
          PsiMethod toMove = usedMethod;
          for (PsiReference reference : ReferencesSearch.search(usedMethod)) {
            if (!PsiTreeUtil.isAncestor(getMethod(), reference.getElement(), false)) {
              toMove = null;
              break;
            }
          }
          if (toMove != null) {
            myUsages.add(new MethodToMoveUsageInfo(toMove));
          }
        }
      }
    }
    UsageInfo[] usageInfos = result.toArray(new UsageInfo[result.size()]);
    return UsageViewUtil.removeDuplicatedUsages(usageInfos);
  }

  protected void refreshElements(final PsiElement[] elements) {}

  protected void performRefactoring(final UsageInfo[] usages) {
    try {
      if (isCreateInnerClass()) {
        myInnerClass = (PsiClass)getMethod().getContainingClass().add(myElementFactory.createClass(getInnerClassName()));
        final boolean isStatic = copyMethodModifiers() && notHasGeneratedFields();
        for (UsageInfo usage : usages) {
          final PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfType(usage.getElement(), PsiMethodCallExpression.class);
          if (methodCallExpression != null) {
            replaceMethodCallExpression(inferTypeArguments(methodCallExpression), methodCallExpression);
          }
        }

        final PsiParameter[] parameters = getMethod().getParameterList().getParameters();
        if (parameters.length > 0) {
          createInnerClassConstructor(parameters);
        } else if (isStatic) {
          final PsiMethod copy = (PsiMethod)getMethod().copy();
          copy.setName("invoke");
          myInnerClass.add(copy);
          if (myMultipleExitPoints) {
            addOutputVariableFieldsWithGetters();
          }
          return;
        }
        if (myMultipleExitPoints) {
          addOutputVariableFieldsWithGetters();
        }
        copyMethodWithoutParameters();
        copyMethodTypeParameters();
      } else {
        for (UsageInfo usage : usages) {
          final PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfType(usage.getElement(), PsiMethodCallExpression.class);
          if (methodCallExpression != null) {
            methodCallExpression.replace(processMethodDeclaration( methodCallExpression.getArgumentList()));
          }
        }
      }
    }
    catch (IncorrectOperationException e) {
      LOG.error(e);
    }
  }

  protected void moveUsedMethodsToInner() {
    if (!myUsages.isEmpty()) {
      final List<MemberInfo> memberInfos = new ArrayList<MemberInfo>();
      for (MethodToMoveUsageInfo usage : myUsages) {
        memberInfos.add(new MemberInfo((PsiMethod)usage.getElement()));
      }

      final MemberSelectionPanel panel = new MemberSelectionPanel("Methods to move to the extracted class", memberInfos, null);
      DialogWrapper dlg = new DialogWrapper(myProject, false) {
        {
          init();
          setTitle("Move Methods Used in Extracted Block Only");
        }

        @Override
        protected JComponent createCenterPanel() {
          return panel;
        }
      };
      dlg.show();
      if (dlg.isOK()) {
        for (MemberInfoBase<PsiMember> memberInfo : panel.getTable().getSelectedMemberInfos()) {
          if (memberInfo.isChecked()) {
            myInnerClass.add(memberInfo.getMember().copy());
            memberInfo.getMember().delete();
          }

        }
      }
    }
  }

  private void addOutputVariableFieldsWithGetters() throws IncorrectOperationException {
    final Map<String, String> var2FieldNames = new HashMap<String, String>();
    final PsiVariable[] outputVariables = myExtractProcessor.getOutputVariables();
    for (int i = 0; i < outputVariables.length; i++) {
      final PsiVariable var = outputVariables[i];
      final PsiField outputField = myOutputFields[i];
      final String name = getPureName(var);
      LOG.assertTrue(name != null);
      if (outputField != null) {
        var2FieldNames.put(var.getName(), outputField.getName());
        myInnerClass.add(outputField);
      }
      final PsiField field = PropertyUtil.findPropertyField(myProject, myInnerClass, name, false);
      LOG.assertTrue(field != null, "i:" + i + "; output variables: " + Arrays.toString(outputVariables) + "; parameters: " + Arrays.toString(getMethod().getParameterList().getParameters()) + "; output field: " + outputField );
      myInnerClass.add(PropertyUtil.generateGetterPrototype(field));
    }

    PsiParameter[] params = getMethod().getParameterList().getParameters();
    ParameterInfoImpl[] infos = new ParameterInfoImpl[params.length];
    for (int i = 0; i < params.length; i++) {
      PsiParameter param = params[i];
      infos[i] = new ParameterInfoImpl(i, param.getName(), param.getType());
    }
    ChangeSignatureProcessor cp = new ChangeSignatureProcessor(myProject, getMethod(), false, null, getMethod().getName(),
                                                               new PsiImmediateClassType(myInnerClass, PsiSubstitutor.EMPTY), infos);
    cp.run();
    final PsiCodeBlock body = getMethod().getBody();
    LOG.assertTrue(body != null);
    final List<PsiLocalVariable> vars = new ArrayList<PsiLocalVariable>();
    final Map<PsiElement, PsiElement> replacementMap = new LinkedHashMap<PsiElement, PsiElement>();
    body.accept(new JavaRecursiveElementWalkingVisitor() {
      @Override
      public void visitReturnStatement(final PsiReturnStatement statement) {
        super.visitReturnStatement(statement);
        try {
          replacementMap.put(statement, myElementFactory.createStatementFromText("return this;", statement));
        }
        catch (IncorrectOperationException e) {
          LOG.error(e);
        }
      }

      @Override
      public void visitDeclarationStatement(final PsiDeclarationStatement statement) {
        super.visitDeclarationStatement(statement);
        final PsiElement[] declaredElements = statement.getDeclaredElements();//todo
        for (PsiElement declaredElement : declaredElements) {
          if (declaredElement instanceof PsiVariable) {
            for (PsiVariable variable : outputVariables) {
              PsiLocalVariable var = (PsiLocalVariable)declaredElement;
              if (Comparing.strEqual(var.getName(), variable.getName())) {
                final PsiExpression initializer = var.getInitializer();
                if (initializer == null) {
                  replacementMap.put(statement, null);
                }
                else {
                  replacementMap.put(var, var);
                }
              }
            }
          }
        }
      }

      @Override
      public void visitReferenceExpression(final PsiReferenceExpression expression) {
        super.visitReferenceExpression(expression);
        final PsiElement resolved = expression.resolve();
        if (resolved instanceof PsiLocalVariable) {
          final String var = ((PsiLocalVariable)resolved).getName();
          for (PsiVariable variable : outputVariables) {
            if (Comparing.strEqual(variable.getName(), var)) {
              vars.add((PsiLocalVariable)resolved);
              break;
            }
          }
        }
      }
    });

    for (PsiLocalVariable var : vars) {
      final String fieldName = var2FieldNames.get(var.getName());
      for (PsiReference reference : ReferencesSearch.search(var)) {
        reference.handleElementRename(fieldName);
      }
    }

    for (PsiElement statement : replacementMap.keySet()) {
      final PsiElement replacement = replacementMap.get(statement);
      if (replacement != null) {
        if (statement instanceof PsiLocalVariable) {
          final PsiLocalVariable variable = (PsiLocalVariable)statement;
          variable.normalizeDeclaration();
          final PsiExpression initializer = variable.getInitializer();
          LOG.assertTrue(initializer != null);
          final PsiStatement assignmentStatement = myElementFactory.createStatementFromText(var2FieldNames.get(variable.getName()) + " = " + initializer.getText() + ";", statement);
          final PsiDeclarationStatement declaration = PsiTreeUtil.getParentOfType(statement, PsiDeclarationStatement.class);
          LOG.assertTrue(declaration != null);
          declaration.replace(assignmentStatement);
        } else {
          statement.replace(replacement);
        }
      } else {
        statement.delete();
      }
    }
  }

  private String getPureName(PsiVariable var) {
    final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(myProject);
    return var instanceof PsiLocalVariable
                        ? styleManager.variableNameToPropertyName(var.getName(), VariableKind.LOCAL_VARIABLE) : styleManager.variableNameToPropertyName(var.getName(), VariableKind.PARAMETER);
  }

  public  PsiExpression processMethodDeclaration( PsiExpressionList expressionList) throws IncorrectOperationException {
    if (isCreateInnerClass()) {
      final String typeArguments = getMethod().hasTypeParameters() ? "<" + StringUtil.join(Arrays.asList(getMethod().getTypeParameters()),
                                                                                new Function<PsiTypeParameter, String>() {
                                                                                public String fun(final PsiTypeParameter typeParameter) {
                                                                                final String typeParameterName =
                                                                                typeParameter.getName();
                                                                                LOG.assertTrue(typeParameterName != null);
                                                                                return typeParameterName;
                                                                                }
                                                                                }, ", ") + ">" : "";
      final PsiMethodCallExpression methodCallExpression =
          (PsiMethodCallExpression)myElementFactory.createExpressionFromText("invoke" + expressionList.getText(), null);
      return replaceMethodCallExpression(typeArguments, methodCallExpression);
    }
    else {
      final String paramsDeclaration = getMethod().getParameterList().getText();
      final PsiType returnType = getMethod().getReturnType();
      LOG.assertTrue(returnType != null);

      final PsiCodeBlock methodBody = getMethod().getBody();
      LOG.assertTrue(methodBody != null);
      return myElementFactory.createExpressionFromText("new Object(){ \n" +
                                                       "private " +
                                                       returnType.getPresentableText() +
                                                       " " + myInnerClassName +
                                                       paramsDeclaration +
                                                       methodBody.getText() +
                                                       "}." + myInnerClassName +
                                                       expressionList.getText(), null);
    }
  }

  private PsiMethodCallExpression replaceMethodCallExpression(final String inferredTypeArguments,
                                                              final PsiMethodCallExpression methodCallExpression)
      throws IncorrectOperationException {
    @NonNls final String staticqualifier =
      getMethod().hasModifierProperty(PsiModifier.STATIC) && notHasGeneratedFields() ? getInnerClassName() : null;
    @NonNls String newReplacement;
    final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression();
    final PsiExpressionList argumentList = methodCallExpression.getArgumentList();
    if (staticqualifier != null) {
      newReplacement = argumentList.getExpressions().length > 0
                       ? "new " + staticqualifier + inferredTypeArguments + argumentList.getText() + "."
                       : staticqualifier + ".";
    } else {
      final PsiExpression qualifierExpression = methodExpression.getQualifierExpression();
      final String qualifier = qualifierExpression != null ? qualifierExpression.getText() + "." : "";
      newReplacement = qualifier + "new " + getInnerClassName() + inferredTypeArguments + argumentList.getText()+ ".";
    }
    return (PsiMethodCallExpression)methodCallExpression.replace(myElementFactory.createExpressionFromText(newReplacement + "invoke()", null));
  }

  @NotNull
  private String inferTypeArguments(final PsiMethodCallExpression methodCallExpression) {
    final PsiReferenceParameterList list = methodCallExpression.getMethodExpression().getParameterList();

    if (list != null && list.getTypeArguments().length > 0) {
      return list.getText();
    }
    final PsiTypeParameter[] methodTypeParameters = getMethod().getTypeParameters();
    if (methodTypeParameters.length > 0) {
      List<String> typeSignature = new ArrayList<String>();
      final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(getMethod().getProject()).getResolveHelper();
      for (final PsiTypeParameter typeParameter : methodTypeParameters) {
        final PsiType type = resolveHelper.inferTypeForMethodTypeParameter(typeParameter, getMethod().getParameterList().getParameters(),
                                                                           methodCallExpression.getArgumentList().getExpressions(),
                                                                           PsiSubstitutor.EMPTY, methodCallExpression, false);
        if (type == null || PsiType.NULL.equals(type)) {
          return "";
        }
        typeSignature.add(type.getPresentableText());
      }
      return "<" + StringUtil.join(typeSignature, ", ") + ">";

    }
    return "";
  }

  protected String getCommandName() {
    return REFACTORING_NAME;
  }

  private boolean copyMethodModifiers() throws IncorrectOperationException {
    final PsiModifierList methodModifierList = getMethod().getModifierList();

    final PsiModifierList innerClassModifierList = myInnerClass.getModifierList();
    LOG.assertTrue(innerClassModifierList != null);
    innerClassModifierList.setModifierProperty(VisibilityUtil.getVisibilityModifier(methodModifierList), true);
    final boolean isStatic = methodModifierList.hasModifierProperty(PsiModifier.STATIC);
    innerClassModifierList.setModifierProperty(PsiModifier.STATIC, isStatic);
    return isStatic;
  }

  private void copyMethodTypeParameters() throws IncorrectOperationException {
    final PsiTypeParameterList typeParameterList = myInnerClass.getTypeParameterList();
    LOG.assertTrue(typeParameterList != null);

    for (PsiTypeParameter parameter : getMethod().getTypeParameters()) {
      typeParameterList.add(parameter);
    }
  }

  private void copyMethodWithoutParameters() throws IncorrectOperationException {
    final PsiMethod newMethod = myElementFactory.createMethod("invoke", getMethod().getReturnType());
    newMethod.getThrowsList().replace(getMethod().getThrowsList());

    final PsiCodeBlock replacedMethodBody = newMethod.getBody();
    LOG.assertTrue(replacedMethodBody != null);
    final PsiCodeBlock methodBody = getMethod().getBody();
    LOG.assertTrue(methodBody != null);
    replacedMethodBody.replace(methodBody);
    PsiUtil.setModifierProperty(newMethod, PsiModifier.STATIC, myInnerClass.hasModifierProperty(PsiModifier.STATIC) && notHasGeneratedFields());
    myInnerMethod = (PsiMethod)myInnerClass.add(newMethod);
  }

  private boolean notHasGeneratedFields() {
    return !myMultipleExitPoints && getMethod().getParameterList().getParametersCount() == 0;
  }

  private void createInnerClassConstructor(final PsiParameter[] parameters) throws IncorrectOperationException {
    final PsiMethod constructor = myElementFactory.createConstructor();
    final PsiParameterList parameterList = constructor.getParameterList();
    for (PsiParameter parameter : parameters) {
      final PsiModifierList parameterModifierList = parameter.getModifierList();
      LOG.assertTrue(parameterModifierList != null);
      final String parameterName = parameter.getName();
      LOG.assertTrue(parameterName != null);
      PsiParameter parm = myElementFactory.createParameter(parameterName, parameter.getType());
      if (CodeStyleSettingsManager.getSettings(myProject).GENERATE_FINAL_PARAMETERS) {
        final PsiModifierList modifierList = parm.getModifierList();
        LOG.assertTrue(modifierList != null);
        modifierList.setModifierProperty(PsiModifier.FINAL, true);
      }
      parameterList.add(parm);

      final PsiField field = createField(parm, constructor, parameterModifierList.hasModifierProperty(PsiModifier.FINAL));
      for (PsiReference reference : ReferencesSearch.search(parameter)) {
        reference.handleElementRename(field.getName());
      }
    }
    myInnerClass.add(constructor);
  }

  private PsiField createField(PsiParameter parameter, PsiMethod constructor, boolean isFinal) {
    final String parameterName = parameter.getName();
    PsiType type = parameter.getType();
    if (type instanceof PsiEllipsisType) type = ((PsiEllipsisType)type).toArrayType();
    try {
      final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(getMethod().getProject());
      final String fieldName = styleManager.suggestVariableName(VariableKind.FIELD, styleManager.variableNameToPropertyName(parameterName, VariableKind.PARAMETER), null, type).names[0];
      PsiField field = myElementFactory.createField(fieldName, type);

      final PsiModifierList modifierList = field.getModifierList();
      LOG.assertTrue(modifierList != null);
      if (AnnotationUtil.isAnnotated(parameter, AnnotationUtil.NULLABLE, false)) {
        modifierList.addAfter(myElementFactory.createAnnotationFromText("@" + AnnotationUtil.NULLABLE, field), null);
      }
      modifierList.setModifierProperty(PsiModifier.FINAL, isFinal);

      final PsiCodeBlock methodBody = constructor.getBody();

      LOG.assertTrue(methodBody != null);

      @NonNls final  String stmtText;
      if (Comparing.strEqual(parameterName, fieldName)) {
        stmtText = "this." + fieldName + " = " + parameterName + ";";
      } else {
        stmtText = fieldName + " = " + parameterName + ";";
      }
      PsiStatement assignmentStmt = myElementFactory.createStatementFromText(stmtText, methodBody);
      assignmentStmt = (PsiStatement)CodeStyleManager.getInstance(constructor.getProject()).reformat(assignmentStmt);
      methodBody.add(assignmentStmt);

      field = (PsiField)myInnerClass.add(field);
      return field;
    }
    catch (IncorrectOperationException e) {
      LOG.error(e);
    }
    return null;
  }

  protected void changeInstanceAccess(final Project project)
      throws IncorrectOperationException {
    if (myMadeStatic) {
      PsiReference[] refs =
          ReferencesSearch.search(myInnerMethod, GlobalSearchScope.projectScope(project), false).toArray(PsiReference.EMPTY_ARRAY);
      for (PsiReference ref : refs) {
        final PsiElement element = ref.getElement();
        final PsiMethodCallExpression callExpression = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class);
        if (callExpression != null) {
          replaceMethodCallExpression(inferTypeArguments(callExpression), callExpression);
        }
      }
    }
  }

  public PsiMethod getMethod() {
    return myExtractProcessor.getExtractedMethod();
  }

  public String getInnerClassName() {
    return myInnerClassName;
  }

  public void setCreateInnerClass(final boolean createInnerClass) {
    myCreateInnerClass = createInnerClass;
  }

  public boolean isCreateInnerClass() {
    return myCreateInnerClass;
  }

  public MyExtractMethodProcessor getExtractProcessor() {
    return myExtractProcessor;
  }

  public class MyExtractMethodProcessor extends ExtractMethodProcessor {

    public MyExtractMethodProcessor(Project project,
                                        Editor editor,
                                        PsiElement[] elements,
                                        PsiType forcedReturnType,
                                        String refactoringName,
                                        String initialMethodName,
                                        String helpId) {
      super(project, editor, elements, forcedReturnType, refactoringName, initialMethodName, helpId);

    }

    @Override
    protected void apply(final AbstractExtractDialog dialog) {
      super.apply(dialog);
      myCreateInnerClass = ((ExtractMethodObjectDialog)dialog).createInnerClass();
      myInnerClassName = myCreateInnerClass ? StringUtil.capitalize(dialog.getChosenMethodName()) : dialog.getChosenMethodName();
    }

    @Override
    protected AbstractExtractDialog createExtractMethodDialog(final boolean direct) {
      return new ExtractMethodObjectDialog(myProject, myTargetClass, myInputVariables, myReturnType, myTypeParameterList,
                                           myThrownExceptions, myStatic, myCanBeStatic, myElements, myMultipleExitPoints);
    }

    @Override
    protected boolean checkOutputVariablesCount() {
      myMultipleExitPoints = super.checkOutputVariablesCount();
      myOutputFields = new PsiField[myOutputVariables.length];
      for (int i = 0; i < myOutputVariables.length; i++) {
        PsiVariable variable = myOutputVariables[i];
        if (!myInputVariables.contains(variable)) { //one field creation
          final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(myProject);
          final String fieldName =
            styleManager.suggestVariableName(VariableKind.FIELD, getPureName(variable), null, variable.getType()).names[0];
          try {
            myOutputFields[i] = myElementFactory.createField(fieldName, variable.getType());
          }
          catch (IncorrectOperationException e) {
            LOG.error(e);
          }
        }
      }
      return !myCreateInnerClass && myMultipleExitPoints;
    }

    @Override
    public PsiElement processMatch(final Match match) throws IncorrectOperationException {
      final boolean makeStatic = myInnerMethod != null &&
                                 RefactoringUtil.isInStaticContext(match.getMatchStart(), getExtractedMethod().getContainingClass());
      final PsiElement element = super.processMatch(match);
      if (makeStatic) {
        myMadeStatic = true;
        final PsiModifierList modifierList = myInnerMethod.getContainingClass().getModifierList();
        LOG.assertTrue(modifierList != null);
        modifierList.setModifierProperty(PsiModifier.STATIC, true);
        PsiUtil.setModifierProperty(myInnerMethod, PsiModifier.STATIC, true);
      }
      PsiMethodCallExpression methodCallExpression = null;
      if (element instanceof PsiMethodCallExpression) {
        methodCallExpression = (PsiMethodCallExpression)element;
      }
      else if (element instanceof PsiExpressionStatement) {
        final PsiExpression expression = ((PsiExpressionStatement)element).getExpression();
        if (expression instanceof PsiMethodCallExpression) {
          methodCallExpression = (PsiMethodCallExpression)expression;
        }
        else if (expression instanceof PsiAssignmentExpression) {
          final PsiExpression psiExpression = ((PsiAssignmentExpression)expression).getRExpression();
          if (psiExpression instanceof PsiMethodCallExpression) {
            methodCallExpression = (PsiMethodCallExpression)psiExpression;
          }
        }
      } else if (element instanceof PsiDeclarationStatement) {
        final PsiElement[] declaredElements = ((PsiDeclarationStatement)element).getDeclaredElements();
        for (PsiElement declaredElement : declaredElements) {
          if (declaredElement instanceof PsiLocalVariable) {
            final PsiExpression initializer = ((PsiLocalVariable)declaredElement).getInitializer();
            if (initializer instanceof PsiMethodCallExpression) {
              methodCallExpression = (PsiMethodCallExpression)initializer;
              break;
            }
          }
        }
      }
      if (methodCallExpression == null) return element;

      PsiExpression expression = processMethodDeclaration(methodCallExpression.getArgumentList());

      return methodCallExpression.replace(expression);
    }

    public PsiVariable[] getOutputVariables() {
      return myOutputVariables;
    }

    @Override
    protected void declareNecessaryVariablesAfterCall(final PsiVariable outputVariable) throws IncorrectOperationException {
      if (myMultipleExitPoints) {
        final String object = StringUtil.decapitalize(myInnerClassName);
        final PsiStatement methodCallStatement = PsiTreeUtil.getParentOfType(getMethodCall(), PsiStatement.class);
        LOG.assertTrue(methodCallStatement != null);
        methodCallStatement.replace(
          myElementFactory.createStatementFromText(myInnerClassName + " " + object + " = " + getMethodCall().getText() + ";", myInnerMethod));

        final List<PsiVariable> usedVariables = myControlFlowWrapper.getUsedVariables();
        Collection<ControlFlowUtil.VariableInfo> reassigned = myControlFlowWrapper.getInitializedTwice();
        for (PsiVariable variable : usedVariables) {
          String name = variable.getName();
          LOG.assertTrue(name != null);
          PsiStatement st = null;
          if (isDeclaredInside(variable)) {
            st = myElementFactory.createStatementFromText(
              variable.getType().getCanonicalText() + " " + name + " = " + object + "." + PropertyUtil.suggestGetterName(getPureName(variable), variable.getType()) + "();",
              myInnerMethod);
            if (reassigned.contains(new ControlFlowUtil.VariableInfo(variable, null))) {
              final PsiElement[] psiElements = ((PsiDeclarationStatement)st).getDeclaredElements();
              assert psiElements.length > 0;
              PsiVariable var = (PsiVariable)psiElements[0];
              PsiUtil.setModifierProperty(var, PsiModifier.FINAL, false);
            }
          }
          else {
            if (ArrayUtil.find(myOutputVariables, variable) != -1) {
              st = myElementFactory.createStatementFromText(name + " = " + object + "." + PropertyUtil.suggestGetterName(getPureName(variable), variable.getType()) + "();", myInnerMethod);
            }
          }
          if (st != null) {
            addToMethodCallLocation(st);
          }
        }
      }
      else {
        super.declareNecessaryVariablesAfterCall(outputVariable);
      }
    }

  }
}


text:
Small businesses warned of cybercrime threat
FSB (The Federation of Small Businesses) has issued a warning to small businesses across the UK to take steps to better protect themselves from cybercrime.
After the recent attack on NHS computer systems, the FSB has also received concerns from the National Cyber Security Centre. As a result, they are calling on small businesses to follow its cyber protection advice and put suitable insurance in place.
The digital revolution has changed the landscape of how all businesses work, but FSB is worried that smaller enterprises may be at greater risk from cybercrime due to a lack of awareness and resources. While owners are kept busy concentrating on growing and running their business, cyber-attackers are becoming increasingly effective.
Statistics from FSB in 2016 reveal that a single cybercrime incident can cost a small business nearly £3,000 and can take 2.2 recovery days. Even more concerning is the estimated seven million cybercrimes that are committed every year against smaller businesses in the UK. Averaging at around 19,000 a day, it's clear that cybercrime is on the rise.
Common attacks involve viruses and malware. Simple measures can be taken to avoid these types of cybercrime, but businesses are being urged to be more vigilant and stay up-to-date on solutions to keeping critical business data safe.
North East regional chairman for FSB, Ted Salmon, said: "Smaller businesses want to embrace the opportunities a digital world provides but these can also lead to vulnerabilities.
"With the nature, scale and costs of cyber security breaches escalating, smaller businesses need access to cyber security resources and clear advice on how to become cyber resilient."
Expanding on the FSB decision to raise the alarm, its Commercial Director, Dave Stallon, said: "We are raising the alarm with the UK's 5.5 million-strong small business community. It is vital that small businesses and the self-employed prioritise this, and that they do it today.
"These businesses have limited resources, time and expertise to deal with the current and growing cyber-crime threat but there is specific assistance available. They should follow our guidance, and do it right now."
The Government's Cyber Breaches Survey 2016 previously found that two-thirds of businesses have experienced a cyber-attack in the past year and that even though one-in-four larger firms reported a breach in security at least once a month, only half took any recommended action.
Mike Cherry, FSB National Chairman, added: "The National Cyber Security Centre has warned us that a new working week may bring more cyber ransomware outbreaks.
"We are urging all small businesses to take steps to reduce the risk of an attack. Businesses should immediately check for updates to their operating systems and anti-malware software and download them where needed.
"We advise small firms to make sure their data is backed up – if the worst happens, data cannot then be held to ransom. Small firms should also keep an eye on the NCSC website and Twitter feed to stay up to date with the latest advice. FSB members have access to specific cyber advice and insurance protection as part of their membership."
As a TaxAssist Accountants client you can save on an FSB Essentials membership. Call us today to benefit from expert advice and specialist support on 0800 0523 555 or drop us a line using our online enquiry form.


OverdoseFreePA, a collaboration among six partner organizations and 16 Pennsylvania communities, has expanded its resources for all Pennsylvanians to learn more about overdose and the way substance use disorders affect people, families and communities.
"By having additional resources in one place, communities can form a comprehensive strategy and get a good picture of what they need to do to increase their treatment and prevention efforts," said Jill Oblak, project director, Pennsylvania Heroin Prevention Technical Assistance Center (TAC).
The one-stop resource contains information such as what to do when someone is overdosing and an educational toolkit for health care and criminal justice professionals, as well as family and friends of overdose victims.
News articles about overdoses in the state are housed on the website, along with details on overdose-related events, training sessions and expert speaker recommendations. A dedicated section guides school and work leaders on how to facilitate open and honest conversations about the harmful effects of substance use and disorders, overdose risks, the opioid overdose antidote naloxone, and the hope that recovery is possible.
"We really have to work together to resolve and reduce these use disorders in our culture and the stigma associated with this issue," said Dr. Jan Pringle, director of Program Evaluation Research Unit, University of Pittsburgh School of Pharmacy.
In 2014, Pennsylvania was named one of 20 states with a statistically higher rate of fatal overdoses than the national average. That year, Pitt Pharmacy established TAC and developed OverdoseFreePA to increase public knowledge of overdoses and overdose prevention strategies.
Funding for the project is provided by the Pennsylvania Commission on Crime and Delinquency.


text:
Help in Portsmouth for grandparents raising kids
Hadley Barndollar @hbarndollar
PORTSMOUTH � As grandparents and other relatives are increasingly impacted by the displacement of children caused by the opioid crisis, the YMCA of the Seacoast and Granite Pathways are partnering in an effort to support those parenting perhaps a second time around.
The free seven-week workshop for family caregivers and grandparents will be held every other Tuesday beginning Jan. 7, from 12:30 to 2:30 p.m., at the 550 Peverly Hill Road YMCA.
According to the American Community Survey, an estimated 7,983 grandparents were raising grandchildren in New Hampshire in 2016, though not all related to substance abuse reasons. That number is now estimated to be between 12,000 to 14,000.
Pooled data from 2014 and 2015 showed 55.2% of those grandparents were not employed, and 49% were living at twice below the poverty level.
The percentage of New Hampshire children or youth removed from parental care with a substance abuse allegation doubled from 30% in 2012 to 60% in 2016, demonstrating the devastating impacts of the evolving opioid epidemic on Granite State families. Of those children, 33% were placed with a relative in 2016.
"The numbers are staggering," said Lauren Goodrich, family peer support specialist at Granite Pathways. "Because of the crisis, my job was created. A lot of grandparents are still working full-time, and they're now burdened with infants, young children, teenagers. They're trying to figure it out."
The upcoming workshop, known as PASTA, which stands for "parenting a second time around," was developed by Cornell University as a parenting program designed for relative caregivers.
Participants will learn about child development, discipline, caring for oneself as a caregiver, rebuilding a family, legal issues, living with teens and advocacy.
"Lots of times they don't know where to go," Goodrich said of family caregivers suddenly faced with the task of caring for a child again. "Emotionally, it's a struggle. And it is a burden, no easy job. It's daunting."
Nationwide, 2.7 million grandparents, other relatives or close family friends are raising children largely due to the opioid epidemic.
Earlier this year, two former Hampton School Board members, Kathy Terry and Denyse Richter, launched Step Up Parents �� nonprofit organization providing financial support to grandparents, aunts, uncles and other relatives who find themselves suddenly parenting young children.
Step Up Parents offers services statewide, and applicants can apply for aid on the organization�s website at www.stepupparents.net.
For more information and to register for the PASTA class, contact lgoodrich@granitepathways.org or (603) 496-7385.


PETER MURPHY first made his mark fronting influential UK group Bauhaus, who this year celebrate their 40th anniversary. Bauhaus appeared out of the London post-punk scene in 1978 and with their darkly romantic image and brooding songs like Bela Lugosi's Dead, quickly became the touchstone for the nascent goth movement.
Bauhaus, with PETER MURPHY at the helm and David J's soul wrenching bass, helped take goth mainstream, culminating in an appearance in David Bowie's 1983 film "The Hunger",noted by Rolling Stone as one of the greatest rock 'n' roll film movie moments of all time. Murphy then set forth on his internationally acclaimed solo career, and his pioneering and long-lasting influence was reinforced when Trent Reznor brought him in as a collaborator and Nine Inch Nails guest in the late 00's, and when he made a cameo appearance – as The Cold One – in The Twilight Saga: Eclipse in 2010.
PETER MURPHY will be reunited with David J on this tour and promises a set comprising the classic Bauhaus debut album In The Flat Field plus other brilliant works from theBauhaus canon which includes such gems as She's In Parties, Kick In The Eye, Terror Couple Kill Colonel, Hair Of The Dog, The Passion Of Lovers, The Sky's Gone Out, Telegram Sam, Hollow Hills, Dark Entries, Third Uncle, Spirit, Lagartija Nick, and of course Bela Lugosi's Dead and their amazing rendition of David Bowie's Ziggy Stardust.


Ray Lokar presents his "Fundamentals Factory," a place where developing basketball players go to build their game in a competitive, fun environment!
Coach Lok simplifies the fundamentals of basketball, highlights the key points, and leads the demonstration of fun and effective drills, competitive contests, and short-sided games to benefit any youth basketball team. Prepare to encounter fresh and innovative concepts and insightful teaching points from a basketball coaching veteran that will help you improve all of your players, on both sides of the ball, in all areas.
Pay special attention to Coach Lok's coaching style - giving receivable feedback and making corrections in a constructive, positive way and get his "5-Steps to Being a Better Player - RIGHT NOW!"
Fundamentals Factory for Youth Basketball is an amazing series of teaching points, drills, exercises, life lessons, coaching tips, team building and more. Coach Lok is terrific in his approach; he works with a group of young kids--most of whom have never worked with him before--and transforms them over the duration of this DVD, into a team-like unit capable of great potential.
A great DVD for every youth basketball coach and youth basketball program director! 276 minutes (2 DVDs). 2010.
Learn how you can consistently build effective and efficient youth basketball practices.
Fundamentals Packet - Eight pages of tips, drills and skills that will help every player!
"Special Situations" list that you can make into a mini "tournament" in practice!
A great DVD for every youth basketball coach! 50 minutes. 2010. DVD.
A great DVD for every youth basketball coach and youth basketball program director!
Learn how you can consistently build effective and efficient youth basketball practices!


Welcome to the College of Engineering Student Shop website. Our student shop is located in the HML building and supports simple parts fabrication, machining (including CNC), welding and painting. The shop is open to students, faculty and staff to work on school-related projects. However, users must complete training associated with the various shop tools before they will be allowed to use them. Students working on academic projects will be given a priority over others.
Required Training and Colored Tags.
The shop will have a supervisor that is available during all posted shop hours. Students may not use the shop unless the supervisor is available to admit them to the shop. The role of the supervisor is as much a mentor role as it is to provided oversight. Don't hesitate to ask the supervisor for help if you have questions.
Paul Robertson at 426-5932 /proberts@boisestate.edu.
Additional shop hours may be possible; discuss the need for shop hours outside of these posted hours with the shop supervisor.
All users of the student shop must be familiar and obey the shop rules. Those who do not obey the shop rules will lose shop privileges. The shop rules can be found here and also on the Blackboard training site.
Students must first login to the PC that is located at then entrance to the shop. A virtual shop name tag will be displayed at the entrance and inside the shop. The virtual name tag will show what colored tags the user has training for. If a user is found using a tool outside of the tag area(s) they are trained for, they will be promptly escorted out of the shop. See below for more information on how the color tags work.
Student shop training is administered through a Blackboard site. In order to use the shop, students must first contact the shop supervisor and provide their BroncoWeb login name so that they can be enrolled in the shop training. The supervisor will notify you when you have been enrolled in the course in Blackboard. Written and video training will be delivered through the Student Shop Blackboard site.
Training is broken down into three categories or "tags". Once enrolled, students will review the assignments for the tag in question and complete the training. Hands-on training will also be required for some tools, such as the drill press & horizontal bandsaw, lathe, mill and welders. Note that a student does not require training in all tags, but must have training in the tag areas for tools they wish to use.
For users that seek only to use hand tools, they must take the General Shop Training, which consists of reading the shop rules, understand shop waste practices, and signing a document that says they have read and understand them. If the user expects to use the shop multiple times, they will be enrolled into the Shop Course and receive a virtual name tag without colored tags.


Shopping for a suit can be an overwhelming and stressful experience for most men. With the right kind of knowledge and a good idea of what your body type is, you can dress with confidence and choose the right fit for you.
The Classic fit is everything you would picture it to be. This is what you see most men wearing on the daily. It is perfectly designed for the average built man. He has an equally proportioned torso and the extra fabric gives him a perceived confidence of blending in. This very traditional look is for the guy that wears suits daily and needs to feel comfortable. I would say most men over 40 will be seen in this style. Think accountants, bankers and upper level management. The proper fit will give him a clean look that is always in style. While Classic is never wrong, there are a few ways to update his style without creating discomfort in fit. You can choose a rich blue tone or a charcoal or black suit which you will see as a new emerging staple this Fall. Chances are he has never worn a bold blue suit and will really enjoy the change and people will surely notice his new sense of style. Add in a patterned shirt or a pop of color tie and you have a complete look that will really turn heads.
The Modern Fit is a hybrid between Classic and Slim fit style suiting. It is most suited for a man with a lean build and toned mid section. Most men in their early 20s-30s can be seen sporting this fit since they have just begun to build their wardrobe. This is a great compromise for the man that is aware of fashion trends and wanting to create a bold look for himself while also having a bit of room for comfort. You will see zero excess fabric in the pant legs and will have little to no break at the shoe line. The Modern Fit can be very slimming since it eliminates the bulk of fabric that most Classic Fit Suits have in the coat and the trouser. I would suggest a bold pattern in your suiting fabric in a shade of blue. And don't be afraid to mix and match solids with patterns. This brings depth to your look and elevates your style. A smaller patterned shirt can be layered with a large pattern to make a huge statement. Get ready for the compliments!
This is for the fashion forward man that is trim, slim or of smaller stature. You will see a much smaller fitting sport coat with a shorter length. Choosing a single button closure is an excellent option for this style as it elongates the mid section. You will typically see a slim fit leg with no break in this suit style. It is not uncommon to see a little bit of ankle and a loafer worn without socks to complete this fashion forward combination. You will see this on men that are in a creative working space; think marketing, advertising, real estate or fashion. Bringing in bold patterns will give this modern man a look that stops people in their tracks. He will be making an entrance and his confidence will dominate a room.
Which suit fit are you? Reach out to a personal stylist if you are still unsure of your look or fit. There are many professionals in your area that would love to help you walk into a room as the best version of yourself. After all, clothes really can make the man.
Exclusive deals, new arrival notifications, and fashion tips.
Copyright © 2019 MDZ Fashion.