text:
package org.hackway.weixin.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties;
import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoTokenServices;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.oauth2.client.OAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter;
import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter;
import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails;
import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableOAuth2Client;
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import org.springframework.security.web.csrf.CsrfFilter;
import org.springframework.security.web.csrf.CsrfToken;
import org.springframework.security.web.csrf.CsrfTokenRepository;
import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository;
import org.springframework.web.filter.CompositeFilter;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.util.WebUtils;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * User: JervyShi
 * Date: 15/11/22
 * Time: 下午3:52
 * Email: jervyshi@gmail.com
 */
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableOAuth2Client
@EnableAuthorizationServer
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private UserDetailsService userDetailsService;

    @Autowired
    OAuth2ClientContext oauth2ClientContext;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/", "/index", "/error", "/public/**", "/login**", "/webjars/**").permitAll()
                .antMatchers("/static/**").permitAll()
                .antMatchers("/users/**").hasAuthority("ADMIN")
                .antMatchers("/api/send", "/api/receive").permitAll()
                .anyRequest().fullyAuthenticated()
                .and().exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/"))
                .and().formLogin().loginPage("/login").failureUrl("/login?error").permitAll()
                .and().logout().logoutUrl("/logout").deleteCookies("remember-me").logoutSuccessUrl("/").permitAll()
                .and().rememberMe()
                .and().csrf().csrfTokenRepository(csrfTokenRepository())
                .and().addFilterAfter(csrfHeaderFilter(), CsrfFilter.class)
                .addFilterBefore(ssoFilter(), BasicAuthenticationFilter.class);
    }

    @Override
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth
                .userDetailsService(userDetailsService)
                .passwordEncoder(new BCryptPasswordEncoder());
    }

    @Bean
    public FilterRegistrationBean oauth2ClientFilterRegistration(
            OAuth2ClientContextFilter filter) {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(filter);
        registration.setOrder(-100);
        return registration;
    }

    @Bean
    @ConfigurationProperties("github")
    ClientResources github() {
        return new ClientResources();
    }

    private Filter ssoFilter() {
        CompositeFilter filter = new CompositeFilter();
        List<Filter> filters = new ArrayList<>();
        filters.add(ssoFilter(github(), "/login/github"));
        filter.setFilters(filters);
        return filter;
    }

    private Filter ssoFilter(ClientResources client, String path) {
        OAuth2ClientAuthenticationProcessingFilter facebookFilter = new OAuth2ClientAuthenticationProcessingFilter(
                path);
        OAuth2RestTemplate facebookTemplate = new OAuth2RestTemplate(client.getClient(),
                oauth2ClientContext);
        facebookFilter.setRestTemplate(facebookTemplate);
        facebookFilter.setTokenServices(new UserInfoTokenServices(
                client.getResource().getUserInfoUri(), client.getClient().getClientId()));
        return facebookFilter;
    }

    private Filter csrfHeaderFilter() {
        return new OncePerRequestFilter() {
            @Override
            protected void doFilterInternal(HttpServletRequest request,
                                            HttpServletResponse response, FilterChain filterChain)
                    throws ServletException, IOException {
                CsrfToken csrf = (CsrfToken) request
                        .getAttribute(CsrfToken.class.getName());
                if (csrf != null) {
                    Cookie cookie = WebUtils.getCookie(request, "XSRF-TOKEN");
                    String token = csrf.getToken();
                    if (cookie == null
                            || token != null && !token.equals(cookie.getValue())) {
                        cookie = new Cookie("XSRF-TOKEN", token);
                        cookie.setPath("/");
                        response.addCookie(cookie);
                    }
                }
                filterChain.doFilter(request, response);
            }
        };
    }

    private CsrfTokenRepository csrfTokenRepository() {
        HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
        repository.setHeaderName("X-XSRF-TOKEN");
        return repository;
    }

}

class ClientResources {
    private OAuth2ProtectedResourceDetails client = new AuthorizationCodeResourceDetails();
    private ResourceServerProperties resource = new ResourceServerProperties();

    public OAuth2ProtectedResourceDetails getClient() {
        return client;
    }

    public ResourceServerProperties getResource() {
        return resource;
    }
}


Mac Miller is back! He's got a new album, Good A.M. coming out September 18th, and a new single out. "100 Grandkids" also has a video and is absolutely wild. The beat switch had me dancing on the ceiling after midnight. Do not miss out and watch the video for "100 Grandkids" below. Pre-order Good A.M. on iTunes now.


Tournament: November 8 – November 10, 2019.
Boys and Girls U8, U9, and U10. Gold, Silver, and Bronze divisions (where applicable).
All tournament fees and parking included.
Online application competed and entry fee paid by October 14, 2019.
2155 Creve Coeur Mill Rd.
This is a MYSA sanctioned official tournament. Out of town teams will need to provide permission to travel from their respective state associations.


text:
#include <stdio.h>
#include <stdlib.h>

#include <grpc/support/alloc.h>
#include <grpc/support/useful.h>
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"

#include "src/core/json/json_reader.h"
#include "src/core/json/json_writer.h"

static int g_string_clear_once = 0;

static void string_clear(void *userdata) {
  GPR_ASSERT(!g_string_clear_once);
  g_string_clear_once = 1;
}

static uint32_t read_char(void *userdata) { return GRPC_JSON_READ_CHAR_ERROR; }

static grpc_json_reader_vtable reader_vtable = {
    string_clear, NULL, NULL, read_char, NULL, NULL,
    NULL,         NULL, NULL, NULL,      NULL, NULL};

static void read_error() {
  grpc_json_reader reader;
  grpc_json_reader_status status;
  grpc_json_reader_init(&reader, &reader_vtable, NULL);

  status = grpc_json_reader_run(&reader);
  GPR_ASSERT(status == GRPC_JSON_READ_ERROR);
}

int main(int argc, char **argv) {
  grpc_test_init(argc, argv);
  read_error();
  gpr_log(GPR_INFO, "json_stream_error success");
  return 0;
}

redpajama_set_name: RedPajamaGithub


It has been tough to get myself to photograph the past few days after what has been going on in the rest of Japan. My mind has been full of images of destruction, and of the sights and sounds of the homeless, and their tears and memories about things lost including loved ones. Living in Japan, one gets used to the concept of earthquakes and after the earthquake in Kobe, there was a certain level of preparation, but then how does one prepare for a tsunami which reached a height of 30m and which played with huge ships like lego blocks? Living in the modern age, I watched "live" as thousands of unaware bystanders were swept away in a matter of minutes and homes crumbled like matchsticks. There was no chance for the ones who were caught in the fury of this record breaking disaster.
A few hundred kilometers away, my life in Tokyo also changed, and along with the 35+million other locals, I tried to adjust to the wave of 150+ earthquake aftershocks and the sea of humanity that was left without transportation and electricity, crippling this ultra-modern city. One could overcome the lack of toilet paper and food and bottled water in the stores, and one could overcome the lack of heat at night but it was difficult to face a danger which one could not see or feel. As thousands of foreigners left Tokyo due to the radiation scare, I went through many questions in my own mind and tried to answer what Tokyo and Japan meant to me and in the end, the choice was simple – this was home and I would stay. I have travelled over 50 countries, lived in 20+ cities but had never thought about that question. As I reflected back, I remembered that a long time ago, I had seen an Argentinian movie which had taught me that "home was a place which one did not want to leave" no matter how long one had lived there or how terrible it was.
I am lucky that I work in a company that "helps all people live healthy lives" and it was easy for me to find a way to start contributing. As I look around me and watch how others are supporting, I have full confidence that Japan will emerge from this crisis. It will not be easy and will take a while, but then this is a country of people who understand the word "self sacrifice". Discipline and dedication were the pillars behind the rise of modern Japan and I am happy to see that success did not weaken the moral foundation.
Today, Cherry Blossoms start to bloom and bring hope that better days are around the corner.
I want to thank all the people who have written to me and enquired about the safety of my family. Your thoughts, prayers, and warm wishes have been a big source of comfort and strength. Thank you and God Bless You.


text:
Drivers who switched from F1 to IndyCar
Race, Historic
The spirit of heart-warming goodwill towards Romain Grosjean following his miraculous escape from that fiery crash in Bahrain will travel with him across the Atlantic this year, as he plunges into the IndyCar scene with Dale Coyne's Honda-powered team.
The 34-year-old has racked up 179 grand prix starts since his F1 debut in 2009, but ran out of puff last season at Haas and was always going to be looking for a fresh start in 2021, before his life-changing accident in Bahrain. The IndyCar series, which is gaining back lost momentum under Roger Penske's invigorating patronage, makes sense for the Frenchman, who at his age still has much to offer the motorsport world.
Grosjean deserves respect for his honesty in the wake of the accident, admitting to a profound effect on his psyche – and with that in mind he has chosen not to race on the fearsome Texas Motor Speedway or in the Indianapolis 500. In the past, racing drivers never admitted to anything that could be perceived as a 'weakness', but in these more enlightened times Grosjean's reasoning seems quite acceptable. Although he still faces a significant and daunting challenge to deliver what's expected of a seasoned F1 driver on the road courses and street tracks IndyCar also visits, as a clutch of grand prix drivers have previously found when they made the switch. Here, we offer a few examples that might give him inspiration – and also some warning of what might be to come.
The lure of US IndyCars, and most specifically the Indy 500, has long drawn the attention of grand prix drivers. Rudolf Caracciola practiced at The Brickyard in 1946, only to end up in a coma for several days after hitting the wall, while Alberto Ascari made an unsuccessful bid at the 500 in his first world title season of 1952, during a decade when America's most famous motor race counted as a round of the nascent F1 World Championship.
But the true F1 love affair with IndyCars really began in the 1960s, when first Jack Brabham and Cooper headed to Indy in 1961, followed quickly by Lotus and Jim Clark, the combination that changed US racing forever by making the front-engined roadsters obsolete. But even though Clark famously dominated the 1965 running and Graham Hill followed up with his own victory in '66, F1's IndyCar dalliance proved short-lived. Through the 1970s, Mario Andretti switched back and forth between the codes, but the interest in Indy from European-focused drivers waned – although Clay Regazzoni qualified on the ninth row in 1977 in a Theodore Racing McLaren, before managing just 25 laps in the race itself.
Grosjean can take more inspiration from the examples of Emerson Fittipaldi, who enjoyed a long-lasting new lease of racing life via IndyCars in the 1980s and '90s, becoming CART series champion and a two-time Indy 500 winner. And then of course there was Nigel Mansell, who monumentally boosted IndyCar's global profile when he swept in and won the title at the first time of asking in 1993 with Newman-Haas, before the affair fizzled out the following season. More recently, Fernando Alonso starred on his Indy debut in 2017 – then failed to qualify for his next attempt.
But these most famous F1-to-IndyCar examples were high-profile world champions. That's not Grosjean. Instead, there are other examples who are perhaps more relevant for a man whose F1 career ultimately turned out to be a disappointment.
Teo Fabi
The quiet Italian was a talented nearly-man of 1980s F1, who contrived to take three pole positions for Toleman/Benetton – yet never led a single lap of a grand prix. In the wake of his first disastrous F1 experience with Toleman in '82, Fabi hitched a ride in IndyCars for the following season and stuck his Forsythe-run March on pole position at Indy, only his second race. Teo led the 500 for 23 laps until an engine failure put him out at quarter distance. But he then went on to claim four victories, at Pocono, Mid-Ohio, Laguna Seca and Phoenix, to finish runner-up in the standings to a consistent Al Unser Sr., who had won only once.
Fabi tried combining an IndyCar campaign with an F1 drive at Brabham in '84 – unimaginable today, and in fairness, not a great idea back then either. Fabi eventually dropped the IndyCar ride to focus on F1, then returned to Toleman in '85 as it transitioned into Benetton, took pole position at the Nürburgring and two more with potent BMW turbo power in '86 – but never quite lived up to his undoubted speed.
A return to IndyCars with Porsche should have delivered more than one win at Mid-Ohio in '89. But Fabi did at least enjoy the taste of victories Stateside, and achieved further success in endurance racing, becoming World Sportscar Champion with TWR Jaguar in 1991.
Roberto Guerrero
Pre-dating Juan Pablo Montoya by a couple of decades, this quick Colombian plugged away with Ensign/Theodore for two F1 seasons in 1982-83, then gave up on the European dream to chase IndyCar glory. If he couldn't land a competitive seat, why bother? Grosjean could probably sympathise, after his difficult final years at Haas.
Guerrero's Indy 500 record, a race he started 15 times, gives some indication to his significant ability. He was a sensational second on his debut in 1984, finished third in '85, fourth in '86 and was second again in '87 during a season in which he also won at Phoenix and Mid-Ohio – only to crash while testing at Indy. He was in a coma for 17 days.
Roberto recovered, but his career never really did – although pole position at the 500 in 1992 promised a revival. A shame, then, that he spun off on the parade lap… But life in America generally treated Guerrero well and eventually he became a US citizen.
Eddie Cheever
Like Grosjean, Eddie Cheever was a prolific F1 driver who started 132 grands prix between 1978 and '89, without ever winning one. But after his final season with Arrows, the American returned home to what was initially a disappointing IndyCar career driving for AJ Foyt. But when the Indy Racing League was created in the mid-1990s, splitting the Indy 500 away from the CART World Series, Cheever had his chance for the big career win that was missing from his record. He won the 500 in his own car from 17th on the grid in 1998.
Stefan Johansson
This popular Swede drove for both Ferrari and McLaren, but never at the best of times to win a grand prix. Nevertheless, Johansson carried a strong reputation when he defected to IndyCars for 1992 with the relatively minor Bettenhausen team, for whom he drove for four seasons.
Johansson had his moments in CART, but never won a race – another warning to Grosjean that he can take nothing for granted. Still, Stefan then enjoyed another second wind in sportscars, winning Le Mans with Michele Alboreto and a rookie Tom Kristensen in 1997, driving Joest's Porsche WSC95.
At his age, Grosjean too has no reason to consider this opportunity with Dale Coyne as his last chance. If it doesn't work out, at a time when IndyCar racing is becoming increasingly competitive, he'd sure make a great sportscar driver.
Video: Lessons for Alonso – how to pass 6 cars in two corners at Indy
IndyCar hero Bobby Unser dies aged 87
These Elise Classic Heritage Editions celebrate four great classic Lotus liveries
McLaren's boss owns a piece of Indy history

redpajama_set_name: RedPajamaCommonCrawl


Inspiring wall art holds the "key" to a meaningful life. With dimensional antique-style white doorknob. Composite wood. 22" l x 1 3/4" w x 10" h.
Challenges Word Sign is rated 4.8 out of 5 by 16.
Rated 5 out of 5 by Home Treasures from Antique Doorknob makes this great sign I bought one for myself and loved it so much, I went back and bought 3 more. It sends such a positive message, and the doorknob looks so cute,keyhole & all. My toddler grandaughter always wants me to lift her up to the sign and says "I open door?" The whole family enjoys. Many compliments. Well made. Reasonably priced. Would highly reccomend!
Rated 2 out of 5 by Robin from Not worth the price. Nice saying but on composite wood, the ing in the word iteresting is partially missing and the mea in meaningful is also partially missing.
Rated 5 out of 5 by Vicki from Love This! This sign goes perfectly with my shabby chic buffet. Love it, gets lots of compliments.
Rated 5 out of 5 by Sylvia Lazalde from NICE Nice piece especially with the vintage door knob.
Rated 5 out of 5 by Dee Thurman from FABULOUS! Who doesn't need to be reminded, time-to-time, of what is important in life?! This smart plaque says it all in an antique-looking saying with a cleverly placed door handle included to one side! It now hangs on the wall between my living room and kitchen for all to read and remember!