## ag.algebraic geometry – Which infinite-dimensional Lie algebras have realizations as algebras of global sections of vector bundles with special structure?

I would not be surprised by downvotes since this question is at the same time very naïve, very vague and might be asking about things well known for decades. Specifically vagueness comes from the word “special” in the title. As for that third weakness, I have a weak defence against it by choosing the reference request tag.

The starting point is the trivial observation that for a finite-dimensional semisimple Lie algebra $$mathfrak g$$, the algebra $$mathfrak g(t,t^{-1})$$ of Laurent polynomials with coefficients in $$mathfrak g$$ can be viewed as the algebra of polynomial global sections of the trivial vector bundle with fibre $$mathfrak g$$ over the punctured plane $$mathbb C^times$$.

My first question is whether it is possible to somehow modify this bundle in such a way that the global sections will turn out to be the affine Lie algebra $$hat{mathfrak g}$$ (the universal central extension of $$mathfrak g(t,t^{-1})$$); similarly for twisted versions of $$hat{mathfrak g}$$.

Second question – is it known what does one obtain with nontrivial vector bundles, and with some projective curve in place of $$mathbb C^times$$? I have no idea whether one indeed obtains a Lie algebra at all or something different. Does the algebraic group structure of $$mathbb C^times$$ have any significance in this context? Accordingly, is it important whether I take an elliptic curve or curves of all genera give more or less similar results?

Finally, I remember that although sections of the tangent bundle form a Lie algebra, it is not a Lie algebra bundle in the sense that fibres do not have any Lie algebra structure. Still, if I am not mistaken, the Virasoro algebra is the universal central extension of the algebra of global sections of a tangent bundle, right? Again, is there some modified form of the tangent bundle such that the Virasoro algebra would be global sections of this modified bundle? And again, is the group structure significant here? What are algebras of sections of tangent bundles over projective curves, in particular, over elliptic curves? Do they have nontrivial central extensions?

## jsx – React.js How to make a global win counter?

I’m making my first card game with React.js and I’m stuck at one point.
How can I display the total win count?
For example, if in this game the computer scored 10 points and won, and in the next 15 more points the global counter should show 25.

### App.js

``````import React from "react";
import './App.css';
import Start from "./components/Start";
import Game from "./components/Game";
import Result from "./components/Result";
import {game, result, start} from "./utils/constants";

class App extends React.Component{
constructor(props) {
super(props);
this.state = {
page: start,
name: 'You',
compWins: 0,
playerWins: 0,
countWinsPlayer: 0,
countWinsComp: 0
}
}

changePage = page => {
this.setState({page});
}

changeName = name => {
this.setState({name});
}

changeResult = (compWins, playerWins, countWinsPlayer,countWinsComp) => {
this.setState({compWins, playerWins,countWinsPlayer,countWinsComp})
}

render() {
switch (this.state.page) {
case game:
return <Game
name={this.state.name}
switchPage={this.changePage}
setResult={this.changeResult}/>;
case result:
return <Result
switchPage={this.changePage}
compWins={this.state.compWins}
playerWins={this.state.playerWins}
countWinsPlayer={this.state.countWinsPlayer}
countWinsComp={this.state.countWinsComp}
/>;
default:
return <Start
switchName={this.changeName}
switchPage={this.changePage}/>;
}
}
}

export default App;

``````

### Start.js

``````import React from 'react';
import {game} from "../utils/constants";

class Start extends React.Component {
constructor(props) {
super(props);
this.state = {
name: ''
}
}

render() {
return (
<div>
<input
onChange={(e) => this.setState({name: e.target.value})}
value={this.state.name}
type='text'
<button onClick={() => {
this.props.switchPage(game);
this.props.switchName(this.state.name)
}}>Start</button>
</div>
);
}
}

export default Start;
``````

### Game.js

``````import React from 'react';
import {deck, result, shuffle} from "../utils/constants";

class Game extends React.Component {

constructor(props) {
super(props);
this.state = {
playerCard: 'Player card',
compCard: 'Computer card',
compWins: 0,
playerWins: 0,
countWinsPlayer: 0,
countWinsComp: 0
};
}

componentDidMount() {
const cards = shuffle(deck);
this.compCards = cards.slice(0, deck.length / 2);
this.playerCards = cards.slice(deck.length / 2, deck.length);
}

handleClickNext = () => {
if (this.playerCards.length) {
const player = this.playerCards.pop();
const comp = this.compCards.pop();

if (player.rank > comp.rank) {
//this.setState({playerWins: this.state.playerWins + 1});
this.setState((state, props) => ({playerWins: state.playerWins + 1}));
this.setState((state, props) => ({countWinsPlayer: state.countWinsPlayer + 1}));

}
if (player.rank < comp.rank) {
this.setState({compWins: this.state.compWins + 1});
this.setState({countWinsComp: this.state.countWinsComp + 1});
}
this.setState({
playerCard: `\${player.rank}, \${player.suit}`,
compCard: `\${comp.rank}, \${comp.suit}`
});
} else {
this.props.setResult(this.state.compWins, this.state.playerWins, this.state.countWinsPlayer, this.countWinsComp);
this.props.switchPage(result);
}
}

render() {
return (
<div>
<h1>Computer</h1>
<p>{this.state.compCard}</p>
<p>{this.state.playerCard}</p>
<h1>{this.props.name}</h1>
<button onClick={this.handleClickNext}>Next</button>
</div>
);
}
}

export default Game;
``````

### Result.js

``````import React from 'react';
import {game} from "../utils/constants";

const Result = ({playerWins, compWins, switchPage, countWinsPlayer,countWinsComp}) => {
const getResult = () => {
if (playerWins > compWins) {
return 'WIN';
}
if (playerWins < compWins) {
return 'LOSE';
}
return 'DRAW';
};
return (
<div>
<h1>{getResult()}</h1>
<h3>This game:</h3>
<h3>Your wins {playerWins} - {compWins} Computer wins</h3>
<h3>Total wins:</h3>
<h3>Your wins {countWinsPlayer} - {countWinsComp} Computer wins</h3>
<button onClick={() => switchPage(game)}>Again ?</button>
</div>
);
};

export default Result;
``````

### constans.js

``````export const start = 'Home';
export const game = 'Game';
export const result = 'Result';
export const createDeck = () => {
const deck = ();
const suits = ('spade', 'club', 'diamond', 'heart');
for (let i = 0; i < suits.length; i++){
for (let j = 1; j <= 13; j++){
deck.push({rank: j, suit: suits(i)});
}
}
return deck;
};
export const deck = createDeck();
export const shuffle = arr => {
const res = (...arr);
res.sort(() => Math.random() - 0.5);
return res;
}

``````

## hooks – How to update global variables in plugin activation callback?

Sorry for being such a noob, I’m sure this is an easy question for most. I’m trying to register activation and deactivation hooks for my plugin. In the docs, they warn about the activation callback not having access to global variables:

If you’re using global variables, you may find that the function you pass to register_activation_hook() does not have access to global variables at the point when it is called, even though you state their global scope within the function like this:

The main body variables are therefore in the scope of the activate_plugin() function and are not global, unless you explicitly declare their global scope:

``````global \$myvar;
\$myvar = 'whatever';

function myplugin_activate() {

global \$myvar;
echo \$myvar; // this will be 'whatever'
}
register_activation_hook( __FILE__, 'myplugin_activate' );
``````

So, following that advice, I set up my code like this:

``````global \$post_id;
\$post_id = 0;

function install_xxx() {
global \$post_id;

\$post = array(
'post_title'    => __( 'Thank You', 'xxx' ),
'post_content'  => __( 'Lorem ipsum dolor.', 'xxx' ),
'post_status'   => 'publish',
'post_name'     => 'thank-you',
'post_type'     => 'page'
);

\$post_id = wp_insert_post( \$post, true );
error_log('Inserted page: ' . \$post_id);
}

function uninstall_xxx() {
global \$post_id;
error_log('Removing page: ' . \$post_id);
\$post = wp_delete_post( \$post_id, true );
}

register_activation_hook( __FILE__, 'install_xxx' );
register_deactivation_hook( __FILE__, 'uninstall_xxx' );

``````

But in my logs, it will echo something like:

Inserted page: 109

Removing page: 0

And of course, the page isn’t removed.

In other words, the global \$post_id isn’t being updated. Any clue what I’m doing wrong?

## html – Why would you ever use the shadow DOM if you can’t apply global styles?

How can you expect to create re-usable components with the shadow DOM and also be expected to give it a separate style? How can anyone be able to share components with each other if that person can’t apply a style on top? I would never use anyone else’s components if they aren’t using my css library..

Side suggestion, `<slot>` should be useable in light dom with custom components.

## Hetzner SX servers – yes or no for global services usage

Hello

i have a very heavy website (social network) and services to the world not any special location or country.

## javascript – Como pasar un JSON de la funcion de respuesta de ajax a una variable global

Este es el codigo que estoy usando, (ya llamo las libreria de jquery), pero por algun motivo no puedo pasar el objecto a una variable global que pueda usar en otra funcion, a que se debe?

``````\$(document).ready(function () {
let variableglobal;
// e.preventDefault();
var datos = {
'id_examen' : "1"
};
\$.ajax({
url: "traerdatos.php",
type: "POST",
data: datos,

success: function (data) {
var jsonData = JSON.parse(data);
console.log(jsonData);

variableglobal=jsonData;
},
error: function () {
console.log("error");
},
});
``````

Al momento de querer imprimir me sale indefinida

``````  console.log(variableglobal);
});
``````

## mathematical optimization – Maximize returns unevaluated even though there is a global maximum

I was trying to calculate the maximum of a gaussian plus a line, but Maximize return unevaluated:

``````In(8):= Maximize(1/((Sigma)*Sqrt(2*Pi))*Exp(-1/2*(x-(Mu))^2/(Sigma)^2)+s*x,x )
Out(8)= Maximize(s x+E^(-((x-(Mu))^2/(2 (Sigma)^2)))/(Sqrt(2 (Pi)) (Sigma)),x)
``````

So I thought maybe it doesn’t have an analytical form so I removed the line term but I still get no answer even though the answer is zero.

``````In(9):= Maximize(1/((Sigma)*Sqrt(2*Pi))*Exp(-1/2*(x-(Mu))^2/(Sigma)^2),x )
Out(9)= Maximize(E^(-((x-(Mu))^2/(2 (Sigma)^2)))/(Sqrt(2 (Pi)) (Sigma)),x)
``````

I’m not really trained in Mathematica so I know I’m probably just doing something wrong, I just don’t know what…

Thanks a lot 🙂

## Global Multimedia Sources for news aggregator site

y u no do it?

Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

Starts at just \$1 per CPM or \$0.10 per CPC.

## 2013 – Unable to add/remove items in Global and current navigation in SharePoint online

I am trying to add items in Global Navigation in a SharePoint online site.