text:
Q: Django 1.11 custom widget template TemplateDoesNotExist I am trying replace widget template with my own, but I am getting a TemplateDoesNotExist error.
In app\forms.py:
class SelectPlus(Select):
    template_name = 'selectplus.html'

class SimpleForm(ModelForm):
    somefield = ModelChoiceField(
        queryset=SomeObjects.objects.all(),
        widget=SelectPlus(attrs={'url': 'custom_url_to_context'})
    )

In settings.py
TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [ROOT_PATH, 'templates'],
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
        ],

    },
},

In debug trace I see that template-loader doesn't search in apps folders or main template folder:

But all other templates works fine.

A: In Django 1.11:
# app/widgets.py
from django.forms.widgets import DefaultWidget

class SelectPlus(DefaultWidget):
    template_name = 'app/selectplus.html'

Import the widget that you want to modify. Your choices can be found here: https://docs.djangoproject.com/en/1.11/ref/forms/widgets/#built-in-widgets
Create a subclass and specify the template name.
# app/templates/app/selectplus.html
<select name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% for group_name, group_choices, group_index in widget.optgroups %}{% if group_name %}
  <optgroup label="{{ group_name }}">{% endif %}{% for option in group_choices %}
  {% include option.template_name with widget=option %}{% endfor %}{% if group_name %}
  </optgroup>{% endif %}{% endfor %}
</select>

Create your template. This is copied exactly from django/forms/widgets/select.html but you can put anything you want here. You can also reference other existing widget templates for inspiration. Your choice can be found here: https://github.com/django/django/tree/master/django/forms/templates/django/forms/widgets
# app/forms.py
from .widgets import SelectPlus

class SimpleForm(ModelForm):
    my_field = forms.ExampleField(widget=SelectPlus())

Import your customer widget (SelectPlus) and add it to a field in your form.
Finally, in your template, render the main field and it will reference app/templates/app/selectplus.html.

A: You have two ways to fix this.
1) fixing your templates path, like this.
TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [ROOT_PATH, os.path.join(BASE_DIR, 'templates')],
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
        ],

    },
}

2) Add template folder inside the app.


text:
all the information, none of the junk | biotech • healthcare • life sciences
Want EXOME sent to you daily?
Meet the Contributors →
Gates Foundation Invests in Flu Drug Developer Visterra
Catherine Arnst
@cathyarnst
Xconomy Boston —
The Bill and Melinda Gates Foundation continues its strategy of financial support for biotech startups with an investment in Visterra, a four-year-old Cambridge, MA, company developing an antidote to pandemic flu. Visterra says today that the Gates Foundation is one of the investors in an additional $13 million raised to complete a $26 million Series A financing.
Omega Funds also participated in the financing along with existing investors Polaris Venture Partners, Flagship Ventures, and Lux Capital. The money will be used to continue developing Visterra's lead product, VIS410, an antibody meant to both prevent and treat influenza.
As my colleague Luke Timmerman wrote a few weeks ago in "The New Power Players in Drug R&D are Wearing Bright T-Shirts," the Gates Foundation is one of a number of non-profits providing seed money to biotech firms working on drugs for some of the world's worst diseases. "The gap between nonprofit and for-profits worlds is narrowing, and it's a good thing," Luke wrote.
Visterra said the Gates Foundation may also commit more money to support the company's other research that fits in with the foundation's goals. "We look forward to a long and productive partnership, including collaborating on additional programs of common interest in the future," Visterra CEO Steven Brugger said in a statement.
Visterra's focus on infectious disease certainly fits into the Gates Foundation's mission, and it is a focus embraced by few large pharma companies, although Visterra did announce an antibody discovery collaboration deal with Pfizer in September. Visterra, formerly called Parasol Therapeutics, was spun out of the lab of MIT biochemist Ram Sasisekharan of MIT with $3.25 million in seed money, and in 2010 it raised another $6 million.
More from EXOME
Gilead, Gates Foundation Join Lyndra's $55M Funding for Phase 2 Tests
Can We Afford to Be Cured? A Conversation With ICER's Steve Pearson
Net@50
Join us on July 16 for a special two-part gathering that will take a unique and critical look at the Internet today, and where it is heading.
Tweets from https://twitter.com/Xconomy/lists/lifesci

redpajama_set_name: RedPajamaCommonCrawl


Post Free Classifieds Ads in Telangana. Sell or Advertise anything using free Online Telangana Classifieds. You can Advertise by Posting Real Estate, Jobs, Automobiles, Mobiles & Tablets, Electronics, Home Store, Education & Learning, Travels, Services, Entertainment, Matrimonial and Business Opportunities free ads in Telangana Classifieds. You can easily post ads on Telangana Classifieds and buy or sell products online. If you want to sell your unused things then on Post your classified Ads on Goadindia.com. Sell, Buy, Find - faster and easier: flats, apartments, houses, PG, jobs, IT jobs, BPO jobs, cars, used cars, used bikes, motorcycles in your city..
SuVitas is a modern multi-specialty rehabilitation centre with cost-effective stroke rehabilitation (plus neuro rehab, cardiac rehab, orthopedic rehab, oncology rehab) in Hyderabad. For more info visit:http://www.suvitas.com.


kohler polished brass bathroom faucets faucet creative fixtures.
kohler polished brass bathroom faucets 4 in 2 handle sink faucet vibrant brushed s.
kohler brass bathroom sink faucet handles faucets bath the home depot vibrant polished k compressed.
kohler brass bathroom sink faucet widespread 4 8.
kohler brass bathroom sink faucet faucets polished bath medium size of wall mount lavatory two tone.
kohler polished brass bathroom faucets widespread faucet k 4.
kohler polished brass bathroom faucets vintage faucet kitchen handles rose gold shower fixtures for ro.
kohler brass bathroom sink faucet bathtub faucets beautiful amazing antique lavatory.
kohler polished brass bathroom faucets kitchen faucet sink sinks.
kohler polished brass bathroom faucets bath faucet.
kohler brass bathroom sink faucet k 4 polished nickel purist single hole.
kohler polished brass bathroom faucets cross bath the home depot vibrant brushed gold widespread sink k 3 compressed.
kohler brass bathroom sink faucet faucets sinks gold brushed the fauc.
kohler brass bathroom sink faucet purist wall mount medicine cabinet and black.
kohler polished brass bathroom faucets k 4 sink faucet.
kohler brass bathroom sink faucet antique faucets aged kitchen buy colored peerless solid delta f.
kohler polished brass bathroom faucets plastic cabinet a purchase fresh new picture.
kohler brass bathroom sink faucet faucets gold single handle bath hardware 4 inch spread outlet.
kohler polished brass bathroom faucets widespread sink vibrant k 4 compressed.
kohler brass bathroom sink faucet 4 vibrant.
kohler brass bathroom sink faucet faucets 8 brushed gold small.
kohler brass bathroom sink faucet faucets leak of polished fixtures bath vanity light.
kohler polished brass bathroom faucets bath the home depot vibrant widespread sink k 3 compressed.
kohler brass bathroom sink faucet antique faucets aged kitchen buy traditional l.


text:
American Kim Lee Wins Landmark Divorce Case Against Abusive Husband
By Anthony Tao February 4, 2013 5:39 pm Comments: 5
American Kim Lee came into the Chinese spotlight in 2011 when she dared to speak out against domestic violence. She posted pictures of injuries suffered at the hands of her abusive husband, Crazy English founder Li Yang. And then she publicly hassled him about signing their divorce papers.
Well, yesterday morning, Kim won about as definitively as she could have hoped. Reports Global Times:
During the hearing at Chaoyang district court Sunday morning, chief judge Liu Li ruled Lee, 41, should receive 12 million yuan ($1.9 million) in property division and full custody of their three daughters.
The court also ordered a restraining order against Li, 43, the first time a Beijing court has given such an order.
None other than the New York Times's Rendezvous blog has commented on the significance of this case:
"It's a very important case. All of society was paying attention," Guo Jianmei, a leading rights lawyer, said in a phone interview. "We've been waiting for this for a long time."
Guo listed "three victories – and one defeat."
"Firstly, the court granted a protection order. Secondly, it acknowledged domestic violence as the grounds of divorce," something still too rare, she said.
"Thirdly, it ordered Li Yang to pay 50,000 renminbi in compensation for the violence, which although it's a small amount is important in saying 'it's not acceptable,'" she said.
The defeat, however, may be that Lee is actually getting less than she deserves:
Yet Ms. Guo said that the financial terms of the settlement – Ms. Lee will receive 12 million renminbi ($1.9 million) and a fixed sum annually until her daughters reach 18 – showed that Chinese courts failed to uncover Mr. Li's true assets and make him pay commensurately.
Still, 12 million will go a long way. And there may be another victory yet, not just for the 41-year-old Lee, but for Chinese women everywhere:
By last Friday, two days before the divorce, she had received 1,141 such messages from strangers, she said.
"It quickly became a matter of the other women and their stories," she said. "No one else was speaking out. I just felt I had to."
"I hope people will use me as an example of success," she said. "Now I can say, 'use your rights, these are the laws and it's painful and they could be better but you can succeed."
(Image via)
5 Responses to "American Kim Lee Wins Landmark Divorce Case Against Abusive Husband"
Big Pile O' Fragrant Roses
February 4th, 2013 9:27pm
Good for her. Didn't know about the story but just read up on it. Let's hope this can serve to liberate more women who suffer daily abuse.
Ant Farm
February 5th, 2013 9:29am
Hey Big Pile, we just hacked Beijing Cream and got your IP address! We also hacked Anthonytao13@gmail.com and we have his address book. He's been a very naughty boy. Stay away from this site while he is politely asked to clean it up or we'll be tracking you for your comments about China.
We can do it to the Washington Post, and we can route via many IP addresses.
Stay away from this site or we'll come and visit your computers home. We're really not very far away and we are watching what is being written and by who.
Keep commenting here though if you want a deportation order or a 30 day detention.
Jonathan Alpart
I think this threat is serious, guys! After all, this is exactly the tactics used before they hacked The New York Times! You know, making immature threats in the comments section!
Chackie Jan
You know most guys here use VPN right? So I'm sure you'll have a nice time when you visit one of the thirty servers we use. LOL.
June 6th, 2013 4:31am
Hey Ant Farm, I can assist you. The guy Monkey King is a creepy old racist American paedophile who owns a kindergarten in Beijing and also has connections with colleges in Chengdu. Just check out his comments on thebeijinger to see how racist he is. Or here are a couple to start you off – just search down to the comments section and read the last comment by afairman:
http://www.cityweekend.com.cn/beijing/articles/blogs-beijing/expat-life/the-internet-highlight-of-my-life/


Did you get a paper wallet at one of our bitcoin ATMs?
In order to spend those funds you'll need to import the private key into a bitcoin wallet on your smartphone, tablet or computer.
If you don't have a smartphone please see the web wallet import tutorial.
If you're looking to move funds off of a cold storage paper wallet, check out our guide to Importing BIP 38 paper wallets.
Paper wallets are a simple way to protect your bitcoin from online threats, like hackers, spyware, and keyloggers. But when it's time to spend your coins, you'll need to bring the keys back online. We've put together guides for a couple of popular wallets to walk you through the process of importing private keys from paper.
First, download and setup the Blockchain wallet on your phone.
Step 4: Scan the private key from your paper wallet. (tip: cover the public key with your hand).
First, download and install Airbitz from the App Store.
First, download and setup the Mycelium app from your app store.
Step 1: Press "Cold Storage"
Step 3: Give it a few seconds... and you're done.
BIP 0038, that is Bitcoin Improvement Protocol 38, is a specification that allows private keys to be encrypted with a password. It is particularly useful for printing paper wallets, because anyone who stumbles on a BIP38 paper wallet also needs the password in order to spend from it.
You don't need to use these as your primary wallet, but they are useful to have around.
Step 2 - Navigate to the "incoming" transaction page.
Step 4 - Enter password.
Step 5 - Your wallet will perform the private key decryption.


Endless nights have been spent by millions of students burning their midnight candles studying math. This subject has deprived them from fun gigs with friends, spending time with their families during special occasions and most especially giving themselves a good night's sleep. It's a universal uncontested fact that math needs a great amount of concentration and hard work to fully grasp mathematical ideas and concepts.
It takes a lot of hours for most students to get it and it only takes seconds for them to forget what they learned. This takes a toll on many students thinking that all their hard work would just go to waste in a matter of seconds. But students need not to worry anymore because Softmath has provided a solution to all their mathematical problems. The Algebrator, an algebra solver with a touch of a math tutor is the answer to students who feel like spending endless hours studying algebra is an unproductive attitude.
As an algebra solver, it solves every algebraic problem given to it with efficiency and accuracy. It gives curious learners a step by step overview of the problem assuring them that every step is completely discussed in a simplistic but thorough discussion. Meanwhile, as a virtual algebra tutor, the Algebrator also assists in prep tests, math homework help and study guides. It provides private tutoring without the need of an algebra tutor. If needed, you can get Algebrator Tutoring from us give you an overview of how the Algebrator works.
With the extensive service that the Algebrator provides such as math homework help, study guides and prep tests, you are not only cutting the long hours of studying Algebra but you are also helping your school improve its school ratings. The lengthy time you allocate for studying Algebra is no more. You will only be spending minutes or a few hours with the Algebrator since it would give the user a brief detailed explanation on each step of the solution of the math problem rather than having to go through piles of unnecessary information consuming your precious time.
So stop burning the midnight candle and start using our Algebra Solver now and give yourself a break from all those dyslexic inducing algebra books and test papers.


text:
package com.kloudtek.idvkey.sdk;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.kloudtek.idvkey.api.*;
import com.kloudtek.kryptotek.CryptoUtils;
import com.kloudtek.kryptotek.DigestAlgorithm;
import com.kloudtek.kryptotek.jce.JCECryptoEngine;
import com.kloudtek.kryptotek.key.HMACKey;
import com.kloudtek.kryptotek.key.SignAndVerifyKey;
import com.kloudtek.kryptotek.key.SignatureVerificationKey;
import com.kloudtek.kryptotek.key.SigningKey;
import com.kloudtek.kryptotek.rest.client.httpcomponents.HCInterceptor;
import com.kloudtek.kryptotek.rest.client.httpcomponents.RestAuthCredential;
import com.kloudtek.kryptotek.rest.client.httpcomponents.TimeAsHttpContentTimeSync;
import com.kloudtek.util.StringUtils;
import com.kloudtek.util.URLBuilder;
import com.kloudtek.util.io.IOUtils;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.*;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.security.InvalidKeyException;
import java.util.List;

import static com.kloudtek.util.StringUtils.base64Decode;
import static org.apache.http.auth.AuthScope.ANY;

/**
 * Allows to perform API operations on the IDVKey services
 */
public class IDVKeyAPIClient {
    public static final int DEFAULT_TIMEOUT = 30000;
    public static final String IDVKEY_URL = "https://api.idvkey.com";
    protected CloseableHttpClient httpClient;
    protected String serverUrl;
    private static final ObjectMapper jsonMapper;

    static {
        jsonMapper = new ObjectMapper();
    }

    /**
     * Constructor
     *
     * @param keyId     Key id
     * @param keyType   Type of key used
     * @param base64Key A {@link SignAndVerifyKey} key (base64 encoded)
     * @throws InvalidKeyException if the key was invalid
     */
    public IDVKeyAPIClient(String keyId, KeyType keyType, String base64Key) throws InvalidKeyException {
        this(keyId, keyType, base64Decode(base64Key));
    }

    /**
     * Constructor
     *
     * @param keyId   Key id
     * @param keyType Type of key used
     * @param keyData A {@link SignAndVerifyKey} key (in it's default format, for example RAW in the case of HMAC)
     * @throws InvalidKeyException if the key was invalid
     */
    public IDVKeyAPIClient(String keyId, KeyType keyType, byte[] keyData) throws InvalidKeyException {
        if (keyType != KeyType.HMAC_SHA256) {
            throw new IllegalArgumentException("This constructor only support HMAC SHA-256 at this time");
        }
        final HMACKey key = CryptoUtils.readHMACKey(DigestAlgorithm.SHA256, keyData);
        init(IDVKEY_URL, keyId, key, key, DEFAULT_TIMEOUT);
    }

    /**
     * Constructor
     *
     * @param keyId Key id
     * @param key   A {@link SignAndVerifyKey} key
     */
    public IDVKeyAPIClient(String keyId, SignAndVerifyKey key) {
        this(keyId, key, key, DEFAULT_TIMEOUT);
    }

    /**
     * Constructor (used to connect to a different API Server like a simulator for example)
     *
     * @param serverUrl Server URL
     * @param id        Key id
     * @param key       A {@link SignAndVerifyKey} key
     */
    public IDVKeyAPIClient(String serverUrl, String id, SignAndVerifyKey key) {
        this(serverUrl, id, key, key, DEFAULT_TIMEOUT);
    }

    public IDVKeyAPIClient(String keyId, SigningKey signingKey, SignatureVerificationKey signatureVerificationKey, int timeout) {
        this(IDVKEY_URL, keyId, signingKey, signatureVerificationKey, timeout);
    }

    public IDVKeyAPIClient(String serverUrl, String keyId, SigningKey signingKey, SignatureVerificationKey signatureVerificationKey, int timeout) {
        init(serverUrl, keyId, signingKey, signatureVerificationKey, timeout);
    }

    private void init(String serverUrl, String keyId, SigningKey signingKey, SignatureVerificationKey signatureVerificationKey, int timeout) {
        this.serverUrl = serverUrl;
        // Create HTTP Client with REST security interceptor
        final HCInterceptor hcInterceptor = new HCInterceptor(new JCECryptoEngine(), null);
        HttpClientBuilder httpClientBuilder = hcInterceptor.createClientBuilder();
        RequestConfig.Builder requestBuilder = RequestConfig.custom().setConnectTimeout(timeout)
                .setConnectionRequestTimeout(timeout).setSocketTimeout(timeout);
        httpClientBuilder.setDefaultRequestConfig(requestBuilder.build());
        BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
        // This is used to used to adjust http timestamps in case client has the wrong time
        final TimeAsHttpContentTimeSync timeSync = new TimeAsHttpContentTimeSync(new URLBuilder(serverUrl).path("/public/time").toString());
        credentialsProvider.setCredentials(ANY, new RestAuthCredential(keyId, signingKey, signatureVerificationKey,
                DigestAlgorithm.SHA256, timeSync));
        httpClient = httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider).build();
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();
        close();
    }

    /**
     * Close the client and release resources
     */
    public void close() {
        try {
            httpClient.close();
        } catch (IOException e) {
            //
        }
    }

    /**
     * Return the list of services that have been registered on IDVKey
     *
     * @return list of services
     * @throws IOException If an error occurs contacting the server
     */
    public List<Service> getServices() throws IOException {
        return jsonMapper.readValue(get("api/services"), jsonMapper.getTypeFactory().constructCollectionType(List.class, Service.class));
    }

    /**
     * Link an IDVKey user to your service/website.
     * You need to call this operation before a user on your website can use his IDVKey device
     *
     * @param serviceId Your website serviceId
     * @param url       The URL to which the user's browser will be redirected to after he's approved the link
     * @param userRef   User reference (generally the user's username on your website)
     * @return URL you should redirect your user's browser to, in order for him to approve the linking
     * @throws IOException                If an error occurs contacting the server
     * @throws UserAlreadyLinkedException If the user was already linked
     * @throws ServiceNotFoundException   If the service was not found
     */
    public OperationResult linkUser(String serviceId, URL url, String userRef) throws IOException, UserAlreadyLinkedException, ServiceNotFoundException {
        try {
            return jsonMapper.readValue(postJson("api/services/" + serviceId + "/links", new ServiceLinkRequest(userRef, url)), OperationResult.class);
        } catch (HttpException e) {
            if (e.getStatusCode() == 409) {
                throw new UserAlreadyLinkedException();
            } else if (e.getStatusCode() == 404) {
                throw new ServiceNotFoundException();
            } else {
                throw e;
            }
        }
    }

    /**
     * Unlink an IDVKey user to your service/website.
     *
     * @param serviceId Your website serviceId
     * @param userRef   User reference (generally the user's username on your website)
     * @throws IOException If the server returned an error
     */
    public void unlinkUser(String serviceId, String userRef) throws IOException {
        try {
            delete(new URLBuilder("api/services/" + serviceId + "/links/ref/").path(userRef, true).toString());
        } catch (HttpException e) {
            if (e.getStatusCode() != 404) {
                throw e;
            }
        }
    }

    /**
     * Check if a user has been linked against your website.
     * Use this to verify the user has been successfully linked to your website/service after he's been redirected to
     * the redirectUrl you specified in {@link #linkUser(String, URL, String)}.
     *
     * @param serviceId Website serviceId
     * @param opId      Operation id
     * @return Service link details or null if no service link with that userRef was found.
     * @throws IOException If error occurred performing the operation
     */
    public ServiceLinkRequestStatus getServiceLinkRequestStatus(String serviceId, String opId) throws IOException {
        try {
            return getJson(new URLBuilder("api/services/" + serviceId + "/links/requests/").path(opId, true).toString(),ServiceLinkRequestStatus.class);
        } catch (HttpException e) {
            if (e.getStatusCode() == 404) {
                return null;
            } else {
                throw e;
            }
        }
    }

    /**
     * Check if a user has been linked against your website.
     * Use this to verify the user has been successfully linked to your website/service after he's been redirected to
     * the redirectUrl you specified in {@link #linkUser(String, URL, String)}.
     *
     * @param serviceId Website serviceId
     * @param userRef   User reference (generally the user's username on your website)
     * @return Service link details or null if no service link with that userRef was found.
     * @throws IOException If error occurred performing the operation
     */
    public ServiceLink getServiceLinkInfo(String serviceId, String userRef) throws IOException {
        try {
            return getJson(new URLBuilder("api/services").path(serviceId).path("links/ref").path(userRef, true).toString(), ServiceLink.class);
        } catch (HttpException e) {
            if (e.getStatusCode() == 404) {
                return null;
            } else {
                throw e;
            }
        }
    }

    /**
     * Initiate an IDVKey authentication for a user (where IDVKey will identify him). This will automatically link the
     * user to your service if required.
     *
     * @param serviceId     Website serviceId
     * @param redirectUrl   URL that the user's browser should be redirected to after he's performed the authentication.
     * @param securityLevel Optional security level for the authentication operation.
     * @return Operation result. This will contain the URL you should redirect your user's browser to.
     * ({@link OperationResult#getRedirectUrl()}), and an operation id that you will use to verify that the user has completed
     * authentication successfully ({@link OperationResult#getOpId()})
     * @throws IOException If error occurred performing the operation
     */
    public OperationResult authenticateUser(@NotNull String serviceId, @NotNull URL redirectUrl, @Nullable SecurityLevel securityLevel) throws IOException {
        return postJson(new URLBuilder("api/services").path(serviceId).path("notifications/authentication").toString(),
                new AuthenticationRequest(redirectUrl, securityLevel), OperationResult.class);
    }

    /**
     * Initiate an IDVKey authentication for a user where you have pre-identified him.
     *
     * @param serviceId     Website serviceId
     * @param redirectUrl   URL that the user's browser should be redirected to after he's performed the authentication.
     * @param securityLevel Optional security level for the authentication operation.
     * @param userRef       User ref assigned to this user
     * @return Operation result. This will contain the URL you should redirect your user's browser to.
     * ({@link OperationResult#getRedirectUrl()}), and an operation id that you will use to verify that the user has completed
     * authentication successfully ({@link OperationResult#getOpId()})
     * @throws IOException            If error occurred performing the operation
     * @throws UserNotLinkedException If the user is not currently linked
     */
    public OperationResult authenticatePreIdentifiedUser(@NotNull String serviceId, @NotNull URL redirectUrl, @Nullable SecurityLevel securityLevel, @NotNull String userRef)
            throws IOException, UserNotLinkedException {
        try {
            return postJson(new URLBuilder("api/services/").path(serviceId).path("/notifications/preidauthentication").toString(),
                    new PreIdentifiedAuthenticationRequest(redirectUrl, securityLevel, userRef), OperationResult.class);
        } catch (HttpException e) {
            if (e.getStatusCode() == 412) {
                throw new UserNotLinkedException();
            } else {
                throw e;
            }
        }
    }

    /**
     * Confirm that user Authentication was done successfully
     *
     * @param opId          Operation id returned by {@link #authenticateUser(String, URL, SecurityLevel)}
     * @return Authentication status
     * @throws IOException If error occurred performing the operation
     */
    public AuthenticationRequestStatus getPreIdentifiedAuthenticationStatus(@NotNull String opId) throws IOException {
        return getJson(new URLBuilder("api/notifications/preidauthentication/").path(opId).toString(), AuthenticationRequestStatus.class);
    }

    /**
     * Confirm that user Authentication was done successfully
     *
     * @param opId Operation id returned by {@link #authenticateUser(String, URL, SecurityLevel)}
     * @return Authentication status
     * @throws IOException If error occurred performing the operation
     */
    public AuthenticationRequestStatus getAuthenticationStatus(@NotNull String opId) throws IOException {
        return getJson(new URLBuilder("api/notifications/authentication/").path(opId).toString(), AuthenticationRequestStatus.class);
    }

    /**
     * Request for a user to approve an operation using IDVKey
     *
     * @param serviceId Service id
     * @param approvalRequest Approval request details
     * @return operation result
     * @throws IOException If an error occurs while performing the operation
     */
    @SuppressWarnings("ConstantConditions")
    public OperationResult requestApproval(@NotNull String serviceId, @NotNull ApprovalRequest approvalRequest) throws IOException {
        if (approvalRequest == null) {
            throw new IllegalArgumentException("approval request missing");
        } else if (StringUtils.isBlank(approvalRequest.getTitle())) {
            throw new IllegalArgumentException("approval title missing");
        } else if (StringUtils.isBlank(approvalRequest.getText())) {
            throw new IllegalArgumentException("approval text missing");
        }
        return postJson(new URLBuilder("api/services/").path(serviceId).path("/notifications/approval").toString(), approvalRequest, OperationResult.class);
    }

    /**
     * Request for a user to approve an operation using IDVKey
     *
     * @param serviceId Service id
     * @param notification Approval request details
     * @return operation result
     * @throws IOException If an error occurs while performing the operation
     */
    @SuppressWarnings("ConstantConditions")
    public OperationResult sendGenericNotification(@NotNull String serviceId, @NotNull GenericNotificationRequest notification) throws IOException {
        return postJson(new URLBuilder("api/services/").path(serviceId).path("/notifications/generic").toString(), notification, OperationResult.class);
    }

    /**
     * Check what is the approval state of an operation
     *
     * @param opId Operation Id
     * @return approval state
     * @throws IOException If an error occurs while performing the operation
     */
    public ApprovalRequestStatus getApprovalStatus(@NotNull String opId) throws IOException {
        return getJson("api/notifications/approval/" + opId, ApprovalRequestStatus.class);
    }

    /**
     * Check what is the approval state of an operation
     *
     * @param opId Operation Id
     * @return approval state
     * @throws IOException If an error occurs while performing the operation
     */
    public GenericNotificationRequestStatus getGenericNotificationStatus(@NotNull String opId) throws IOException {
        return getJson("api/notifications/generic/" + opId, GenericNotificationRequestStatus.class);
    }

    private void checkStatus(CloseableHttpResponse response) throws IOException {
        final int retCode = response.getStatusLine().getStatusCode();
        if (retCode < 200 || retCode > 299) {
            String body;
            if (response.getEntity() != null) {
                try {
                    body = IOUtils.toString(response.getEntity().getContent());
                } catch (Exception e) {
                    body = "";
                }
            } else {
                body = "";
            }
            throw new HttpException(response.getStatusLine().getReasonPhrase(), response.getStatusLine().getStatusCode(), body);
        }
    }

    protected String get(String path) throws IOException {
        return exec(new HttpGet(buildUrl(path)));
    }

    protected String delete(String path) throws IOException {
        return exec(new HttpDelete(buildUrl(path)));
    }

    protected <X> X getJson(String path, Class<X> expectedJsonReturnClass) throws IOException {
        final HttpGet req = new HttpGet(buildUrl(path));
        return jsonMapper.readValue(exec(req), expectedJsonReturnClass);
    }

    protected String postJson(String path, Object obj) throws IOException {
        final HttpPost post = new HttpPost(buildUrl(path));
        post.setEntity(new ByteArrayEntity(jsonMapper.writeValueAsBytes(obj), ContentType.APPLICATION_JSON));
        return exec(post);
    }

    protected <X> X postJson(String path, Object obj, Class<X> expectedJsonReturnClass) throws IOException {
        final HttpPost post = new HttpPost(buildUrl(path));
        post.setEntity(new ByteArrayEntity(jsonMapper.writeValueAsBytes(obj), ContentType.APPLICATION_JSON));
        return jsonMapper.readValue(exec(post), expectedJsonReturnClass);
    }

    protected String post(String path, String string) throws IOException {
        final HttpPost post = new HttpPost(buildUrl(path));
        if (string != null) {
            post.setEntity(new StringEntity(string));
        }
        return exec(post);
    }

    private String exec(HttpRequestBase req) throws IOException {
        req.setHeader("api-version", "1.0");
        try (CloseableHttpResponse response = httpClient.execute(req)) {
            checkStatus(response);
            if (response.getEntity() != null) {
                return StringUtils.utf8(IOUtils.toByteArray(response.getEntity().getContent()));
            } else {
                return null;
            }
        } finally {
            req.releaseConnection();
        }
    }

    private URLBuilder url(String path) {
        return new URLBuilder(serverUrl).path(path);
    }

    private URI buildUrl(String path) {
        return new URLBuilder(serverUrl).path(path).toUri();
    }

    private URI linkUserUrl(String serviceId, String userRef) {
        return linkUrlUrlBuilder(serviceId, userRef).toUri();
    }

    private URLBuilder linkUrlUrlBuilder(String serviceId, String userRef) {
        return url("api/services/" + serviceId + "/links/ref/").path(userRef);
    }
}

redpajama_set_name: RedPajamaGithub


The helicopter descended upon the infamous Hard Rock Hotel as KISS invaded Las Vegas for an historic nine-show run. Now, for one night only on May 25, fans will be able to experience this spectacular night for themselves as 'KISS Rocks Vegas' hits cinemas across the globe. From this blistering live show, fans can expect sky high flames, ear-bursting volume and a few drops of blood! Includes exclusive interviews with band and footage you will only see in the cinema.
Famed for their iconic face paint and stage attire, KISS was formed in New York City in 1973 by Paul Stanley (Vocals, Rhythm guitar) and Gene Simmons (Vocals, Bass guitar). Their sensational live performances feature fire breathing, blood-spitting, smoking guitars, shooting rockets, levitating drum kits, and pyrotechnics to spare. Tommy Thayer (Lead guitar, Vocals) and Eric Singer (Drums, Percussion, Vocals) round out the band's powerful lineup. Tommy is also Producer of the film 'KISS Rocks Vegas'.
"See us on the big screen with the awesome power of surround sound. Feel like you are in Vegas and don't be shy 'Shout it out loud"!
The band's global sales exceed 100 million records, making them one of the world's best-selling bands of all time. The Rock N Roll Hall of Famers have released 44 albums . Honored by their peers, KISS received the illustrious ASCAP Founders Award in 2015.
Over 40 years of record-breaking global tours have brought KISS to their fans. They kicked off their recent world tour with 5 headlining shows in Japan and a #1 single in 2015 "Samurai Son" with pop group, Momoiro Clover Z. Their 40th Anniversary World tour also rocked North & South America and Australia. Annually the "KISS Army" becomes the "KISS Navy" as fans from across the globe board the KISS Kruise (2016 year will mark their 6th voyage).
KISS teamed up with Warner Brothers in 2015 to create the well-received original movie ScoobyDoo and KISS: Rock And Roll Mystery. Other high-profile appearances have included the Super Bowl, the Winter Olympics, Rockin' The Corps concert, a FOX alliance with KISS appearing in multiple episodes of Family Guy, plus two special guest performances on American Idol finales.
KISS has been featured in major advertising and marketing campaigns for John Varvatos, Google Play, Hello Kitty— even appearing in a Dr. Pepper Super Bowl commercial and advertising campaign in support of their Hottest Show On Earth tour. This year represents the 3rd season of the LA KISS Arena Football League team bringing professional football back to Los Angeles. KISS founding band members Paul Stanley and Gene Simmons have also entered the culinary world by opening a string of successful restaurants aptly named Rock & Brews.
A select number of cinemas worldwide will also be screening the concert in Dolby Atmos, providing a powerfully immersive and moving audio experience for the cinema audience.
For more information and to book tickets for the cinema event please visit www.kissmycinema.com.