Nginx proxy 302 redirect location header is wrong

I have a problem with getting Nginx proxy to work with Mautic instance, the website works like that(I swapped all urls to https://mautic.example):

When you visit https://mautic.example, you get redirected to /s/login. After logging in, browsers sends POST to /s/login_check, gets 302 found and location header, then browser sends GET to location header URL.
In original server the location header is https://mautic.example/s/dashboard. On proxy it’s /s/login which does nothing else but refreshes the page because the user is already on /s/login.

I want simplest proxy possible.

Here is configuration I tried:

server {
    listen 8091;

    location / {
       proxy_pass https://mautic.example;
   
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "Upgrade";
     }

}

What am I missing here?

java – Glassfish : Class name is wrong or classpath is not set for : com.mysql.cj.jdbc.Driver Please check the server.log for more details

I build JAVA EE project and choose glassfish as a server and mysql as a database,
when i trying integrate mysql database in glassfish server, there are some errors :
I fill properties database like name , server , PortNumber .. etc.
when I test connection by press on ping button , this message displayed

An error has occurred Ping Connection Pool failed for DemoDatabase.
Class name is wrong or classpath is not set for : com.mysql.cj.jdbc.Driver 
Please check the server.log for more details. An error has occurred    
Ping Connection Pool failed for DemoDatabase.
 Class name is wrong or classpath is not set for : com.mysql.cj.jdbc.Driver Please check the server.log for more details.

this message in Server.log

Cannot find poolName in ping-connection-pool command model, file a bugninjection failed on org.glassfish.connectors.admin.cli.PingConnectionPool.poolName with class java.lang.String

magento2.3 – Sorry, something went wrong. You can find out more in the error log

magento2.3 – Sorry, something went wrong. You can find out more in the error log – Magento Stack Exchange

google chrome – Some shortcuts in Windows start menu have wrong (always dark) background

In my Windows start menu, I have several Chrome shortcuts (Gmail, Outlook, Teams, OneDrive, To Do). They all have the same background, except To Do. How can I make To Do also have a light background?

enter image description here

What I have tried/checked so far:

  1. The icon does have a transparent background in general, which is clear when searching for it:

enter image description here

  1. The shortcuts all look the same in the Windows folder:

enter image description here

  1. When Windows is in dark mode, the background is the same for all shortcuts. So I guess, the mode for this one item is always dark?

enter image description here

data structures – Reverse An Array whats wrong with this type of code?

data structures – Reverse An Array whats wrong with this type of code? – Computer Science Stack Exchange

CDN module: wrong settings broke my site

I installed the cdn module from:

https://www.drupal.org/project/cdn

and in the UI i setted a wrong cdn path.

now my site is broken it can load css and js. end i cannot disable the module from the UI.

i have admin access at the server but i cant figure out how to disable cdn, there is a cdn,settings.yml but it seems that the option isnt there.

i cant find any documentation for the module… can you please help me?

RSS tickler does not tick when using a collection of links rather than texts: what is wrong?

I am using a solution at: https://www.cssscript.com/rss-feed-scroller-marquee/ in order to create a tickler for my web page. All fine, but for the fact the tickler just showed the texts of the rss feed but it was impossible to click them to get to article. So I tried to tamper with it constructing a proper url and trying to animate it. Yet the item seems well constructed, but when I animate it, nothing happens. This the code of the modified js class:

/*!
* RSS Marquee
*
* Licensed under MIT
* Copyright (c) 2020 (Samuel Carreira)
*/
class RSSMarquee {
/**
*
* @param {string()} feedURLs Feed URLs
* @param {object} elementContainer the selector of the marquee container
* @param {number} options.speed duration in ms per character. Bigger values = slow speed
* @param {number} options.maxItems specify max number of titles to show (useful to debug)
* @param {object} options.hostnameSelector The selector of the element where you want to show the URL of the news feed source (usefull for copyright atttribution)
*/
constructor(feedURLs, elementContainer, options = { speed: 110, maxItems: null, hostnameSelector: null }) {
this._feedURLs = new Array();
SEMrush

if (Array.isArray(feedURLs)) {
this._feedURLs = feedURLs;
} else {
this._feedURLs(0) = feedURLs;
}

const URLvalidation = this._feedURLs.every(this.validateURL);

if (!URLvalidation) {
throw new TypeError(‘Invalid URL on list’);
}

this._urlIndex = 0;

this._anim = null;

this._newsText = ”;

this._lastTime = Date.now();

if (elementContainer === null) {
throw new TypeError(‘Invalid element selector’);
}

this._elementContainer = elementContainer;
this.styleElementContainer();

this._options = {
speed: this.validateSpeed(options.speed),
maxItems: options.maxItems,
hostnameSelector: options.hostnameSelector,
// …options
};

this.getRSS();
}

validateSpeed(speed) {
if (!Number(speed) || speed < 50 || speed > 300) {
return 110; // default safe value
} else {
return speed;
}
}

/**
* Set the animation speed
* @param {number} speed value between 50-300
*/
set setSpeed(speed) {
this._options.speed = this.validateSpeed(speed);
}

get getSpeed() {
return this._options.speed;
}

/**
* Validate URL (uses URL interface)
*
* @param {string} url Url to check
* @returns {boolean} true if valid
*/
validateURL(url) {
try {
const u = new URL(url);
return true;
} catch (e) {
return false;
}
}

/**
* Get Hostname from url string
*
* Sample: “https://www.dnoticias.pt/rss/desporto.xml”
* returns url
*
* @param {string} url url string
* @returns {string} hostname
*/
getHostname(url) {
try {
const u = new URL(url);
return u.hostname;
} catch (e) {
return ”;
}
}

getRSS() {
const url = this._feedURLs(this._urlIndex);

this.fetchRSS(url)
.then((xmlText) => {
this._newsText = this.parseXMLFeed(xmlText);

this.showMarquee(this._newsText);

this.showHostname(url);
})
.catch((err) => {
console.error(err);

this.handleErrors();
});

}

handleErrors() {
const diffTime = Date.now() – this._lastTime;

if (diffTime > 5000) {
console.log(‘Trying next feed URL…’);

this.nextURL();
this._lastTime = Date.now();
} else {
if (this._newsText === ”) {
console.log(‘delay…’);
setTimeout(() => {
this.nextURL();
}, 5000);
} else {
console.log(‘show again cached saved news’);
this.showMarquee(this._newsText);
}
}
}

nextURL() {
this.increaseIndex();

this.getRSS();
}

styleElementContainer() {
this._elementContainer.style.overflow = ‘hidden’;
this._elementContainer.style.whiteSpace = ‘nowrap’;
}

showHostname(url) {
if (!this._options.hostnameSelector) {
return;
}

this._options.hostnameSelector.innerText = this.getHostname(url);
}

showMarquee(aCollection) {

try {
const animKeyframes = ({
transform: ‘translateX(0)’
},
{
transform: ‘translateX(-100%)’
}
);

const animOptions = {
duration: 25000, // The number of milliseconds each iteration of the animation takes to complete. Defaults to 0. Although this is technically optional, keep in mind that your animation will not run if this value is 0.
easing: ‘linear’, // The rate of the animation’s change over time. Accepts the pre-defined values “linear”, “ease”, “ease-in”, “ease-out”, and “ease-in-out”, or a custom “cubic-bezier” value like “cubic-bezier(0.42, 0, 0.58, 1)”. Defaults to “linear”.
iterations: 1, // The number of times the animation should repeat. Defaults to 1, and can also take a value of Infinity to make it repeat for as long as the element exists.
delay: 0, // The number of milliseconds to delay the start of the animation. Defaults to 0.
endDelay: 0 // The number of milliseconds to delay after the end of an animation. This is primarily of use when sequencing animations based on the end time of another animation. Defaults to 0.
};

animOptions.duration = aCollection.length * this._options.speed;

const elementChildNode = document.createElement(‘span’);
elementChildNode.style.display = ‘inline-block’;
elementChildNode.style.paddingLeft = ‘100%’;

//const textNode = document.createTextNode(text);
console.log(aCollection.lenght);
aCollection.forEach(function(item, index, array) {
elementChildNode.appendChild(item)
})
console.log(“totale:”);
console.log(elementChildNode);
//elementChildNode.appendChild(textNode);

//this._elementContainer.appendChild(elementChildNode);

this._anim = elementChildNode.animate(animKeyframes, animOptions);
console.log(‘start animation’);
this._anim.onfinish = () => {
console.log(‘end’);
while (this._elementContainer.firstChild) {
this._elementContainer.firstChild.remove();
}
delete this._anim.onfinish;

this.nextURL();
};

this._lastTime = Date.now();
} catch (err) {
console.error(err);
}
}

increaseIndex() {
this._urlIndex += 1;
if (this._urlIndex > this._feedURLs.length – 1) {
this._urlIndex = 0;
}
}

/**
* Fetch RSS
* @param {string} feedURL RSS XML url
*/
fetchRSS(feedURL) {
return new Promise((resolve, reject) => {
console.info(`Start fetching ${feedURL}…`);

fetch(feedURL, { mode: ‘cors’, redirect: ‘follow’ })
.then((response) => {
return response.text();
})
.then((xmlTxt) => {
return resolve(xmlTxt);
})
.catch(() => {
console.error(‘Error in fetching the RSS feed’);
reject();
})
});
}

/**
* Parses RSS XML feed
*
* – Select title elementContainer
* – add dot separator between “headlines”
* – remove <!(CDATA( string
* – remove html tags
*
* @param {string} xmlText
* @returns {string} parsed feed
*/
parseXMLFeed(xmlText) {
try {
const parser = new DOMParser();
const doc = parser.parseFromString(xmlText, “text/xml”);

let news = ”;
let aCollection=();
let totals = 0;

for (let item of doc.querySelectorAll(‘item’)) {
let title = item.getElementsByTagName(“title”)(0).childNodes(0).nodeValue;
// let description = item.getElementsByTagName(“description”)(0).childNodes(0).nodeValue;
let link = item.getElementsByTagName(“link”)(0).childNodes(0).nodeValue;
if (title) {
if (news.length) {
news += ‘xa0’ + ‘ • ‘ + ‘xa0’;
}
title = this.remoteCData(title);
title = this.stripTags(title);
news += title;
var a = document.createElement(‘a’);
var linkText = document.createTextNode(title);
a.appendChild(linkText);
a.title = title;
a.href = link;
aCollection.push(a);
totals += 1;
}

if (this._options.maxItems !== null && totals >= this._options.maxItems) {
console.info(‘Maximum items reached!’);
break;
}
}
//console.log(aCollection);
//console.log(news);
console.info(`Parsed ${totals} title(s)`);
return aCollection;
} catch (err) {
console.error(err);
return ‘ ‘;
}
}

stripTags(textWithTags) {
return textWithTags.replace(/<(.|n)*?>/g, ”);
}

remoteCData(originalText) {
return originalText.replace(“<!(CDATA(“, “”).replace(“))>”, “”);
}
}

The non occurring animation is in function: showMarquee(aCollection). The original site shows how to test it.

Thanks,

 

built in symbols – What could go wrong in redefining Power to act on functions?

Inspired by a tweet (from a locked account, unfortunately, so I can’t link it), we can get notation like $cos^2(x)$ to work in Mathematica in general:

Unprotect(Power);
Power(f_, n_)(x___) := Power(f(x), n);
Protect(Power)

Weirdly, so far, I can’t think of anything this would break, since—as far as I can tell—Power(f_, n_) is never otherwise expected to appear as the head of some other expression. It seems like this might actually be a convenient choice.

Is there any chaos this could cause that I’m not thinking of?

python – CodeChef showing wrong answer for my below submission, but my code is working perfect in VSCode

Lead Game Problem
The game of billiards involves two players knocking 3 balls around on a green baize table. Well, there is more to it, but for our purposes this is sufficient.

The game consists of several rounds and in each round both players obtain a score, based on how well they played. Once all the rounds have been played, the total score of each player is determined by adding up the scores in all the rounds and the player with the higher total score is declared the winner.

The Siruseri Sports Club organises an annual billiards game where the top two players of Siruseri play against each other. The Manager of Siruseri Sports Club decided to add his own twist to the game by changing the rules for determining the winner. In his version, at the end of each round the leader and her current lead are calculated. Once all the rounds are over the player who had the maximum lead at the end of any round in the game is declared the winner.

  • Input:
    The first line of the input will contain a single integer N (N≤10000) indicating the number of rounds in the game. Lines 2,3,…,N+1 describe the scores of the two players in the N rounds. Line i+1 contains two integer Si and Ti, the scores of the Player 1 and 2 respectively, in round i.

  • Output:
    Your output must consist of a single line containing two integers W and L, where W is 1 or 2 and indicates the winner and L is the maximum lead attained by the winner.

Consider the following score sheet for a game with 5 rounds:

  • Sample input:
  • 5
  • 140 82
  • 89 134
  • 90 110
  • 112 106
  • 88 90
  • Sample output:

1 58

import sys
scores = ()
winner = 0
noOfRounds = 0
compareCount = 0
noOfRounds = int(input())

if(noOfRounds < 1 or noOfRounds > 10000):
    sys.exit()

for i in range(noOfRounds):
    scores.append(list(map(int, input().split())))
    if(scores(i)(0) < 1 or scores(i)(0) > 1000 or scores(i)(1) > 1000 or scores(i)(1) < 1):
        sys.exit()

for j in range(noOfRounds):
    if(scores(j)(0) > scores(j)(1)):
        scores(j)(1) = scores(j)(0) - scores(j)(1)
        scores(j)(0) = 1
    elif(scores(j)(0) < scores(j)(1)):
        scores(j)(1) = scores(j)(1) - scores(j)(0)
        scores(j)(0) = 2
    else:
        continue

k=0
for z in range(1,noOfRounds):
    if(scores(k)(1) > scores(z)(1)):
        winner = scores(k)
    elif(scores(k)(1) < scores(z)(1)):
        winner = scores(z)
        k+=1
    else:
        continue

if(noOfRounds == 1):
    print(*scores(0))
else:
    print(*winner)

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123