问:
How to use Jest to mock onTouchStart for touchscreen usecase in unit test?
Hi I have a simple state that checking is the device touchable by using 'ontouchstart' in window here. And will add div class base on the conditioning below. And need to write a unit test for this scenario. I want to ask what the proper way to mock the touch case scenario in jest. Any one can help?

```<code>this.state = {
            touchable: true
        };

this.state.touchable = 'ontouchstart' in window;

<div class=`${state.touchable ? touchable : ''}`>
</div>
</code>```

Unit Test file here
I trying to test if the device is touchable, then the div should have class "touchable"

```<code>describe('Given touch device', () => {
  beforeAll(() => {
    window.ontouchstart = jest.fn()
  })

  it('should have class touchable', async () => {
    const { container } = await render(template, mockData)
    const container = container.querySelector('div')
    await waitFor(() => {
      expect(container).toHaveClass('touchable')
    })
  })
})
</code>```

Body:
Hi I have a simple state that checking is the device touchable by using 'ontouchstart' in window here. And will add div class base on the conditioning below. And need to write a unit test for this scenario. I want to ask what the proper way to mock the touch case scenario in jest. Any one can help?

this.state = {
            touchable: true
        };

this.state.touchable = 'ontouchstart' in window;

<div class=`${state.touchable ? touchable : ''}`>

Unit Test file here
I trying to test if the device is touchable, then the div should have class "touchable"

describe('Given touch device', () => {
  beforeAll(() => {
    window.ontouchstart = jest.fn()
  })

  it('should have class touchable', async () => {
    const { container } = await render(template, mockData)
    const container = container.querySelector('div')
    await waitFor(() => {
      expect(container).toHaveClass('touchable')
    })
  })
})


来源: stackexchange

问:
Unable to validate form in Flutter
I am working on a sign up form and I can't find a way to validate the form. I feel like some things have changed a bit with Flutter 3.0. I was trying to call the FocusNode variable into the _toggleSignUp button but it won't work. I'd appreciate whatever help or hint I could get! :)

```<code>import 'package:animations/animations.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:messagemaster/dialogs/policy_dialog.dart';
import 'package:messagemaster/theme.dart';
import 'package:messagemaster/widgets/snackbar.dart';

class SignUp extends StatefulWidget {
  const SignUp({ Key? key}) : super(key: key);

  @override
  _SignUpState createState() => _SignUpState();
}

class _SignUpState extends State<SignUp> {
  final FocusNode focusNodePassword = FocusNode();
  final FocusNode focusNodeConfirmPassword = FocusNode();
  final FocusNode focusNodeEmail = FocusNode();
  final FocusNode focusNodeName = FocusNode();

  bool _obscureTextPassword = true;
  bool _obscureTextConfirmPassword = true;

  TextEditingController signupEmailController = TextEditingController();
  TextEditingController signupNameController = TextEditingController();
  TextEditingController signupPasswordController = TextEditingController();
  TextEditingController signupConfirmPasswordController =
  TextEditingController();

  @override
  void dispose() {
    focusNodePassword.dispose();
    focusNodeConfirmPassword.dispose();
    focusNodeEmail.dispose();
    focusNodeName.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(top: 23.0),
      child: Column(
        children: <Widget>[
          Stack(
            alignment: Alignment.topCenter,
            children: <Widget>[
              Card(
                elevation: 2.0,
                color: Colors.white,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(8.0),
                ),
                child: Container(
                  width: 300.0,
                  height: 360.0,
                  child: Column(
                    children: <Widget>[
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodeName,
                          controller: signupNameController,
                          keyboardType: TextInputType.text,
                          textCapitalization: TextCapitalization.words,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: const InputDecoration(
                            border: InputBorder.none,
                            icon: Icon(
                              FontAwesomeIcons.user,
                              color: Colors.black,
                            ),
                            hintText: 'Name',
                            hintStyle: TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                          ),
                          onSubmitted: (_) {
                            focusNodeEmail.requestFocus();
                          },
                        ),
                      ),
                      Container(
                        width: 250.0,
                        height: 1.0,
                        color: Colors.grey[400],
                      ),
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodeEmail,
                          controller: signupEmailController,
                          keyboardType: TextInputType.emailAddress,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: const InputDecoration(
                            border: InputBorder.none,
                            icon: Icon(
                              FontAwesomeIcons.envelope,
                              color: Colors.black,
                            ),
                            hintText: 'Email Address',
                            hintStyle: TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                          ),
                          onSubmitted: (_) {
                            focusNodePassword.requestFocus();
                          },
                        ),
                      ),
                      Container(
                        width: 250.0,
                        height: 1.0,
                        color: Colors.grey[400],

   ),
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodePassword,
                          controller: signupPasswordController,
                          obscureText: _obscureTextPassword,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: InputDecoration(
                            border: InputBorder.none,
                            icon: const Icon(
                              FontAwesomeIcons.lock,
                              color: Colors.black,
                            ),
                            hintText: 'Password',
                            hintStyle: const TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                            suffixIcon: GestureDetector(
                              onTap: _toggleSignup,
                              child: Icon(
                                _obscureTextPassword
                                    ? FontAwesomeIcons.eye
                                    : FontAwesomeIcons.eyeSlash,
                                size: 15.0,
                                color: Colors.black,
                              ),
                            ),
                          ),
                          onSubmitted: (_) {
                            focusNodeConfirmPassword.requestFocus();
                          },
                        ),
                      ),
                      Container(
                        width: 250.0,
                        height: 1.0,
                        color: Colors.grey[400],
                      ),
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodeConfirmPassword,
                          controller: signupConfirmPasswordController,
                          obscureText: _obscureTextConfirmPassword,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: InputDecoration(
                            border: InputBorder.none,
                            icon: const Icon(
                              FontAwesomeIcons.lock,

color: Colors.black,
                            ),
                            hintText: 'Confirmation',
                            hintStyle: const TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                            suffixIcon: GestureDetector(
                              onTap: _toggleSignupConfirm,
                              child: Icon(
                                _obscureTextConfirmPassword
                                    ? FontAwesomeIcons.eye
                                    : FontAwesomeIcons.eyeSlash,
                                size: 15.0,
                                color: Colors.black,
                              ),
                            ),
                          ),
                          onSubmitted: (_) {
                            _toggleSignUpButton();
                          },
                          textInputAction: TextInputAction.go,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              Container(
                margin: const EdgeInsets.only(top: 400.0),
                decoration: const BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(16.0)),
                  boxShadow: <BoxShadow>[
                    BoxShadow(
                      color: CustomTheme.loginGradientStart,
                      offset: Offset(1.0, 6.0),
                      blurRadius: 20.0,
                    ),
                    BoxShadow(
                      color: CustomTheme.loginGradientEnd,
                      offset: Offset(1.0, 6.0),
                      blurRadius: 20.0,
                    ),
                  ],
                  gradient: LinearGradient(
                      colors: <Color>[
                        CustomTheme.loginGradientEnd,
                        CustomTheme.loginGradientStart
                      ],
                      begin: FractionalOffset(0.2, 0.2),
                      end: FractionalOffset(1.0, 1.0),
                      stops: <double>[0.0, 1.0],
                      tileMode: TileMode.clamp),
                ),
                child: MaterialButton(
                  highlightColor: Colors.transparent,
                  splashColor: CustomTheme.loginGradientEnd,
                  //shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5.0))),
                  child: const Padding(
                    padding:
                    EdgeInsets.symmetric(vertical: 16.0, horizontal: 50.0),
                    child: Text(
                  'SIGN UP',

              style: TextStyle(
                  color: Colors.white,
                  fontSize: 25.0,
                  fontFamily: 'WorkSansBold'),
            ),
          ),
          onPressed: () => _

toggleSignUpButton(),
                ),
              ),
            ],
      ),

      SizedBox(height: 30,),

      RichText(
        textAlign: TextAlign.center,
        text: TextSpan(
          text: "By creating an account, you are agreeing to our\n",
          style: new TextStyle(
            color: Colors.white,
          ),
          children: [
            TextSpan(
              text: "Terms & Conditions ",
              style: TextStyle(fontWeight: FontWeight.bold),
              recognizer: TapGestureRecognizer()
                ..onTap = () {
                  showModal(
                    context: context,
                    configuration: FadeScaleTransitionConfiguration(),
                    builder: (context) {
                      return PolicyDialog(
                        mdFileName: 'terms.md',
                      );
                    },
                  );
                },
            ),
            TextSpan(text: "and "),
            TextSpan(
              text: "Privacy Policy! ",
              style: TextStyle(fontWeight: FontWeight.bold),
              recognizer: TapGestureRecognizer()
                ..onTap = () {
                  showDialog(
                    context: context,
                    builder: (context) {
                      return PolicyDialog(
                        mdFileName: 'privacypolicy.md',
                      );
                    },
                  );
                },
            ),
          ],
        ),
      ),

    ],
  ),
);

 }
</code>```

This is the function where I am trying to call the focus nodes.
I was thinking on how to validate all the textfields in this function.
If the textfields aren't empty, proceed to the next screen.

```<code>void _toggleSignUpButton() {
    CustomSnackBar(context, const Text('SignUp button pressed'));
}

void _toggleSignup() {
    setState(() {
      _obscureTextPassword = !_obscureTextPassword;
    });
}
void _toggleSignupConfirm() {
    setState(() {
    _obscureTextConfirmPassword = !_obscureTextConfirmPassword;
    });
}
}
</code>```

ContentLicense: CC BY-SA 4.0

Title: Unable to validate form in Flutter

Body:
I am working on a sign up form and I can't find a way to validate the form. I feel like some things have changed a bit with Flutter 3.0. I was trying to call the FocusNode variable into the _toggleSignUp button but it won't work. I'd appreciate whatever help or hint I could get! :)

import 'package:animations/animations.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:messagemaster/dialogs/policy_dialog.dart';
import 'package:messagemaster/theme.dart';
import 'package:messagemaster/widgets/snackbar.dart';

class SignUp extends StatefulWidget {
  const SignUp({ Key? key}) : super(key: key);

  @override
  _SignUpState createState() => _SignUpState();
}

class _SignUpState extends State<SignUp> {
  final FocusNode focusNodePassword = FocusNode();
  final FocusNode focusNodeConfirmPassword = FocusNode();
  final FocusNode focusNodeEmail = FocusNode();
  final FocusNode focusNodeName = FocusNode();

  bool _obscureTextPassword = true;
  bool _obscureTextConfirmPassword = true;

  TextEditingController signupEmailController = TextEditingController();
  TextEditingController signupNameController = TextEditingController();
  TextEditingController signupPasswordController = TextEditingController();
  TextEditingController signupConfirmPasswordController =
  TextEditingController();

  @override
  void dispose() {
    focusNodePassword.dispose();
    focusNodeConfirmPassword.dispose();
    focusNodeEmail.dispose();
    focusNodeName.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(top: 23.0),
      child: Column(
        children: <Widget>[
          Stack(
            alignment: Alignment.topCenter,
            children: <Widget>[
              Card(
                elevation: 2.0,
                color: Colors.white,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(8.0),
                ),
                child: Container(
                  width: 300.0,
                  height: 360.0,
                  child: Column(
                    children: <Widget>[
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodeName,
                          controller: signupNameController,
                          keyboardType: TextInputType.text,
                          textCapitalization: TextCapitalization.words,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: const InputDecoration(
                            border: InputBorder.none,
                            icon: Icon(
                              FontAwesomeIcons.user,
                              color: Colors.black,
                            ),
                            hintText: 'Name',
                            hintStyle: TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                          ),
                          onSubmitted: (_) {
                            focusNodeEmail.requestFocus();
                          },
                        ),
                      ),
                      Container(
                        width: 250.0,
                        height: 1.0,
                        color: Colors.grey[400],
                      ),
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodeEmail,
                          controller: signupEmailController,
                          keyboardType: TextInputType.emailAddress,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: const InputDecoration(
                            border: InputBorder.none,
                            icon: Icon(
                              FontAwesomeIcons.envelope,
                              color: Colors.black,
                            ),
                            hintText: 'Email Address',
                            hintStyle: TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                          ),
                          onSubmitted: (_) {
                            focusNodePassword.requestFocus();
                          },
                        ),
                      ),
                      Container(
                        width: 250.0,
                        height: 1.0,
                        color: Colors.grey[400],

   ),
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodePassword,
                          controller: signupPasswordController,
                          obscureText: _obscureTextPassword,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: InputDecoration(
                            border: InputBorder.none,
                            icon: const Icon(
                              FontAwesomeIcons.lock,
                              color: Colors.black,
                            ),
                            hintText: 'Password',
                            hintStyle: const TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                            suffixIcon: GestureDetector(
                              onTap: _toggleSignup,
                              child: Icon(
                                _obscureTextPassword
                                    ? FontAwesomeIcons.eye
                                    : FontAwesomeIcons.eyeSlash,
                                size: 15.0,
                                color: Colors.black,
                              ),
                            ),
                          ),
                          onSubmitted: (_) {
                            focusNodeConfirmPassword.requestFocus();
                          },
                        ),
                      ),
                      Container(
                        width: 250.0,
                        height: 1.0,
                        color: Colors.grey[400],
                      ),
                      Padding(
                        padding: const EdgeInsets.only(
                            top: 20.0, bottom: 20.0, left: 25.0, right: 25.0),
                        child: TextField(
                          focusNode: focusNodeConfirmPassword,
                          controller: signupConfirmPasswordController,
                          obscureText: _obscureTextConfirmPassword,
                          autocorrect: false,
                          style: const TextStyle(
                              fontFamily: 'WorkSansSemiBold',
                              fontSize: 16.0,
                              color: Colors.black),
                          decoration: InputDecoration(
                            border: InputBorder.none,
                            icon: const Icon(
                              FontAwesomeIcons.lock,

color: Colors.black,
                            ),
                            hintText: 'Confirmation',
                            hintStyle: const TextStyle(
                                fontFamily: 'WorkSansSemiBold', fontSize: 16.0),
                            suffixIcon: GestureDetector(
                              onTap: _toggleSignupConfirm,
                              child: Icon(
                                _obscureTextConfirmPassword
                                    ? FontAwesomeIcons.eye
                                    : FontAwesomeIcons.eyeSlash,
                                size: 15.0,
                                color: Colors.black,
                              ),
                            ),
                          ),
                          onSubmitted: (_) {
                            _toggleSignUpButton();
                          },
                          textInputAction: TextInputAction.go,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              Container(
                margin: const EdgeInsets.only(top: 400.0),
                decoration: const BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(16.0)),
                  boxShadow: <BoxShadow>[
                    BoxShadow(
                      color: CustomTheme.loginGradientStart,
                      offset: Offset(1.0, 6.0),
                      blurRadius: 20.0,
                    ),
                    BoxShadow(
                      color: CustomTheme.loginGradientEnd,
                      offset: Offset(1.0, 6.0),
                      blurRadius: 20.0,
                    ),
                  ],
                  gradient: LinearGradient(
                      colors: <Color>[
                        CustomTheme.loginGradientEnd,
                        CustomTheme.loginGradientStart
                      ],
                      begin: FractionalOffset(0.2, 0.2),
                      end: FractionalOffset(1.0, 1.0),
                      stops: <double>[0.0, 1.0],
                      tileMode: TileMode.clamp),
                ),
                child: MaterialButton(
                  highlightColor: Colors.transparent,
                  splashColor: CustomTheme.loginGradientEnd,
                  //shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5.0))),
                  child: const Padding(
                    padding:
                    EdgeInsets.symmetric(vertical: 16.0, horizontal: 50.0),
                    child: Text(
                  'SIGN UP',

              style: TextStyle(
                  color: Colors.white,
                  fontSize: 25.0,
                  fontFamily: 'WorkSansBold'),
            ),
          ),
          onPressed: () => _

toggleSignUpButton(),
                ),
              ),
            ],
      ),

      SizedBox(height: 30,),

      RichText(
        textAlign: TextAlign.center,
        text: TextSpan(
          text: "By creating an account, you are agreeing to our\n",
          style: new TextStyle(
            color: Colors.white,
          ),
          children: [
            TextSpan(
              text: "Terms & Conditions ",
              style: TextStyle(fontWeight: FontWeight.bold),
              recognizer: TapGestureRecognizer()
                ..onTap = () {
                  showModal(
                    context: context,
                    configuration: FadeScaleTransitionConfiguration(),
                    builder: (context) {
                      return PolicyDialog(
                        mdFileName: 'terms.md',
                      );
                    },
                  );
                },
            ),
            TextSpan(text: "and "),
            TextSpan(
              text: "Privacy Policy! ",
              style: TextStyle(fontWeight: FontWeight.bold),
              recognizer: TapGestureRecognizer()
                ..onTap = () {
                  showDialog(
                    context: context,
                    builder: (context) {
                      return PolicyDialog(
                        mdFileName: 'privacypolicy.md',
                      );
                    },
                  );
                },
            ),
          ],
        ),
      ),

    ],
  ),
);

 }

This is the function where I am trying to call the focus nodes.
I was thinking on how to validate all the textfields in this function.
If the textfields aren't empty, proceed to the next screen.

void _toggleSignUpButton() {
    CustomSnackBar(context, const Text('SignUp button pressed'));
}

void _toggleSignup() {
    setState(() {
      _obscureTextPassword = !_obscureTextPassword;
    });
}
void _toggleSignupConfirm() {
    setState(() {
    _obscureTextConfirmPassword = !_obscureTextConfirmPassword;
    });
}
}


问:
SolidJS handle different URL paths
SolidJS path doesn't work when typing the path directly into the browser. For example, if I want to go on the path

https://test.com/contact
I need to go on the path https://test.com first then click the button to go the /contact

If I directly type the path https://test.com/contact in the browser I will get nginx 404 not found.

How do I fix this?

*I deployed my website on my self-host server.

*In localhost it works properly

This is my code

```<code>import './root.css';
import Home from './routes';
import Contact from './routes/contact';
import Projects from './routes/projects';
import { Suspense } from 'solid-js';
import {
    Body,
    ErrorBoundary,
    FileRoutes,
    Head,
    Html,
    Link,
    Meta,
    Route,
    Routes,
    Scripts,
    Title
} from 'solid-start';

export default function Root() {
    return (
        <Html lang="en">
            <Head>
                <Title>Test</Title>
                <Meta charset="utf-8" />
                <Meta name="viewport" content="width=device-width, initial-scale=1" />
                <Link rel="icon" href="/user.png" />
            </Head>
            <Body>
                <Suspense>
                    <ErrorBoundary>
                        <Routes>
                            <FileRoutes />
                            <Route path="/" component={Home} />
                            <Route path="/projects" component={Projects} />
                            <Route path="/contact" component={Contact} />
                        </Routes>
                    </ErrorBoundary>
                </Suspense>
                <Scripts />
            </Body>
        </Html>
    );
}

</code>```

Title: SolidJS handle different URL paths

Body:
SolidJS path doesn't work when typing the path directly into the browser. For example, if I want to go on the path

https://test.com/contact
I need to go on the path https://test.com first then click the button to go the /contact

If I directly type the path https://test.com/contact in the browser I will get nginx 404 not found.

How do I fix this?

*I deployed my website on my self-host server.

*In localhost it works properly

This is my code

import './root.css';
import Home from './routes';
import Contact from './routes/contact';
import Projects from './routes/projects';
import { Suspense } from 'solid-js';
import {
    Body,
    ErrorBoundary,
    FileRoutes,
    Head,
    Html,
    Link,
    Meta,
    Route,
    Routes,
    Scripts,
    Title
} from 'solid-start';

export default function Root() {
    return (

                <Title>Test</Title>
                <Meta charset="utf-8" />
                <Meta name="viewport" content="width=device-width, initial-scale=1" />
                <Link rel="icon" href="/user.png" />

                <Suspense>
                    <ErrorBoundary>
                        <Routes>
                            <FileRoutes />
                            <Route path="/" component={Home} />
                            <Route path="/projects" component={Projects} />
                            <Route path="/contact" component={Contact} />
                        </Routes>
                    </ErrorBoundary>
                </Suspense>


问:
How to insert IL code call into class type constructor in .Net?
I have an assembly I want to use and test. Yet I can not change its source code as .cs files but I am allowed to change it at runtime (say on app loading). In there I have a class with a public constructor. I want to insert (or inject) a public static function call into it. How to do such thing in .Net?


问:
How can I use a custom font for displaying Emojis in Google Colab using Seaborn graphs
I'm making a study about the use of emojis on Brazilian Twitter, I've manage to extract the data from the Twitter and made a pandas DataFrame that looks like this.

```<code>index,emojis
,75
,66
,55
,35
,32
,25
,18
,18
,17
❤,15
</code>```

The thing is that Seaborn default font does not have all the emojis, so my graph ends up looking something like this:

```<code>sns.barplot(x = data.index, y="emojis",data=data)
</code>```

seaborn graph with a bad display of emojis

```<code>!wget "https://fonts.google.com/download?family=Noto%20Color%20Emoji"
!mv font_file.ttf /usr/share/fonts/truetype/
!unzip "download?family=Noto Color Emoji"

!fc-cache -f -v
</code>```
```<code>#the error I get
mv: cannot stat 'font_file.ttf': No such file or directory
/usr/share/fonts: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/truetype/humor-sans: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/truetype/liberation: caching, new cache contents: 16 fonts, 0 dirs
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
</code>```

I tried this two methods that I've found here in stack overflow, The first one written above, I get an error "mv: cannot stat 'font_file.ttf': No such file or directory", that i have no idea how to solve.

```<code>!wget https://fonts.google.com/download?family=Noto%20Color%20Emoji -P /usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf

matplotlib.font_manager._rebuild()
matplotlib.rc('font', family='Noto Color Emoji')
</code>```

This second method did not gave me any errors but didn't change the font, maybe I'm missing a function to define the font for the graph, as I am using seaborn for the graph but changing the font on Matplotlib, but in my understanding it should work as seaborn is built over matplotlib.

If someone can shine a light in this problem I'll be very thankful for the help as I tried multiple suggestion from Stack overflow, using vs code in my computer and using Google Colab on the cloud, I could not change the fonts to display Emojis on my graph in either way, so my last resort was to ask a question here.

Body:
I'm making a study about the use of emojis on Brazilian Twitter, I've manage to extract the data from the Twitter and made a pandas DataFrame that looks like this.

index,emojis
,75
,66
,55
,35
,32
,25
,18
,18
,17
❤,15

The thing is that Seaborn default font does not have all the emojis, so my graph ends up looking something like this:

sns.barplot(x = data.index, y="emojis",data=data)

seaborn graph with a bad display of emojis

!wget "https://fonts.google.com/download?family=Noto%20Color%20Emoji"
!mv font_file.ttf /usr/share/fonts/truetype/
!unzip "download?family=Noto Color Emoji"

!fc-cache -f -v

#the error I get
mv: cannot stat 'font_file.ttf': No such file or directory
/usr/share/fonts: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/truetype/humor-sans: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/truetype/liberation: caching, new cache contents: 16 fonts, 0 dirs
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

I tried this two methods that I've found here in stack overflow, The first one written above, I get an error "mv: cannot stat 'font_file.ttf': No such file or directory", that i have no idea how to solve.

!wget https://fonts.google.com/download?family=Noto%20Color%20Emoji -P /usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf

matplotlib.font_manager._rebuild()
matplotlib.rc('font', family='Noto Color Emoji')

This second method did not gave me any errors but didn't change the font, maybe I'm missing a function to define the font for the graph, as I am using seaborn for the graph but changing the font on Matplotlib, but in my understanding it should work as seaborn is built over matplotlib.

If someone can shine a light in this problem I'll be very thankful for the help as I tried multiple suggestion from Stack overflow, using vs code in my computer and using Google Colab on the cloud, I could not change the fonts to display Emojis on my graph in either way, so my last resort was to ask a question here.


问:
JInternal Frame does not pop up
I'm working on a mvc project for which I have created a login form for which after logging in should show a JInternal frame which for some reason is not showing up I've tested the connection to the db and is working fine also there is no problem with the validation just the window not showing up.</p>
```<code> private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {
    UserDAO userDAO = new UserDAO();
    User u = new User();

        if (!txtUsername.getText().equals("") || txtPassword.getText().equals("")) {
        u.setUsername(txtUsername.getText());
        u.setPassword(txtPassword.getText());
        u.setUserType(cbType.getSelectedItem().toString());

            if (userDAO.login(u)) {

            String userID =String.valueOf(u.getUserId());
            String username = u.getUsername();
            String userType = u.getUserType();

            MainPage mainPage = new MainPage(userID, username, userType);
            mainPage.setVisible(true);

            }else{

                JOptionPane.showMessageDialog(null, "The username or password are incorrect");
            }
        }else{
        JOptionPane.showMessageDialog(null, "The spaces must be filled");
        }
    }

</code>```

Title: JInternal Frame does not pop up

Body:
I'm working on a mvc project for which I have created a login form for which after logging in should show a JInternal frame which for some reason is not showing up I've tested the connection to the db and is working fine also there is no problem with the validation just the window not showing up.

 private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {
    UserDAO userDAO = new UserDAO();
    User u = new User();

        if (!txtUsername.getText().equals("") || txtPassword.getText().equals("")) {
        u.setUsername(txtUsername.getText());
        u.setPassword(txtPassword.getText());
        u.setUserType(cbType.getSelectedItem().toString());

            if (userDAO.login(u)) {

            String userID =String.valueOf(u.getUserId());
            String username = u.getUsername();
            String userType = u.getUserType();

            MainPage mainPage = new MainPage(userID, username, userType);
            mainPage.setVisible(true);

            }else{

                JOptionPane.showMessageDialog(null, "The username or password are incorrect");
            }
        }else{
        JOptionPane.showMessageDialog(null, "The spaces must be filled");
        }
    }


问:
OSError: No space on device for weird reason
I am running some code that wasn't initially mine using GPT2-XL; it was initially implemented for GPT-Neo-1.3B and T5-Large. Running an experiment using GPT2-XL, I got the following error:
  File "/data/username/directory", line 631, in to_tsr_gpt_entity_inference _bleu_score = BLEU.compute(predictions=definition, File "/data/username/miniconda3/lib/python3.9/site-packages/evaluate/module.py", line 433, in compute self._finalize() File "/data/username/miniconda3/lib/python3.9/site-packages/evaluate/module.py", line 372, in _finalize self.writer.finalize() File "/data/username/miniconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 589, in finalize self.stream.close() File "/data/username/miniconda3/lib/python3.9/site-packages/fsspec/implementations/local.py", line 358, in close return self.f.close() OSError: [Errno 28] No space left on device

The issue here is that I'm not quite sure what is running out of space; I have checked df -h and df -I for example, and I tried setting the TMPDIR to be different with export TMPDIR=/new_directory, but that didn't work, so I can only assume something else is causing this to run out of space. It appears to have something to do with BLEU from the evaluate module of hugging_face, however, the same code (including the BLEU bit) works when running GPT-Neo/T5, so I'm not quite sure what the issue is.

I'd greatly appreciate any help in answering this question.


问:
How to generating a "promo code" from user choices in a form only with html and JS
I am practising some Js exercises from books I have and am stumped with this one!

The exercise in question is to generate a “promo code” for users based after they have answered two questions through a form; the user first chooses from a list of 6 years one option, and then in a second form they must choose 1 of 4 possible options, from there a code is generated by:

First: The sum of the last two numbers of the year chosen in Step 1. (Example: 1 + 7 = 8)

Next: the last 4 characters of the text of the option selected in step 2 are added, in capital letters. Spaces and the characters "a" and "A" must be removed. (Example: vacation- TION) So: 8TION

To be more clear form 1 has *2016 *2017 *2018... Form 2 has *Vacation *Specific *Gorilla...

I'm pretty new at this so I'm unsure how to go about it. I'd greatly appreciate some help, and even more an explanation of the reasoning!

I really don't know how to approach this one


问:
xcode cannot resolve the entered keypath
Using Xcode 12, and starting with the default XIB-based swift desktop app, I add a Model class, descended from NSObject with a single stringValue property.  In the XIB file I instantiate the Model class, and add a text field to the default window, and bind the value of the text field to the stringValue property of my Model instance.  The project builds and runs, and any value I set in the initializer of the Model class displays in the text field.

Here is my Model class:

```<code>import Foundation

@objc public class Model : NSObject {
  @objc dynamic public var stringValue: NSString

  override init() {
    stringValue = "some string"
  }
}
</code>```

The full project is available here:

https://github.com/thomasmarschall/KvoLab2023

I started with a bit more complicated setup involving a separate library and framework, but my current setup seems to be super straightforward.

Having done all of this, Xcode displays a grey flag in the Model Key Path field of the text field value binding, and the tool tip for the flag reads "xcode cannot resolve the entered keypath".  Also, the autocomplete in the key path field does not work.  How can I resolve these issues?  Any help would be appreciated.

Body:
Using Xcode 12, and starting with the default XIB-based swift desktop app, I add a Model class, descended from NSObject with a single stringValue property.  In the XIB file I instantiate the Model class, and add a text field to the default window, and bind the value of the text field to the stringValue property of my Model instance.  The project builds and runs, and any value I set in the initializer of the Model class displays in the text field.

Here is my Model class:

import Foundation

@objc public class Model : NSObject {
  @objc dynamic public var stringValue: NSString

  override init() {
    stringValue = "some string"
  }
}

The full project is available here:

https://github.com/thomasmarschall/KvoLab2023

I started with a bit more complicated setup involving a separate library and framework, but my current setup seems to be super straightforward.

Having done all of this, Xcode displays a grey flag in the Model Key Path field of the text field value binding, and the tool tip for the flag reads "xcode cannot resolve the entered keypath".  Also, the autocomplete in the key path field does not work.  How can I resolve these issues?  Any help would be appreciated.


问:
Async Class method does not work when passed as parameter to redux call function
I built a lib using typescript there is some async methods.
for example

```<code>type Credential = {
  email: string
  password: string
}

class User {
  api: ServiceProvider
  constructor(api: ServiceProvider) {
    this.api = api
  }

  async authenticate(credential: Credential): Promise<any> {
    return await this.api.post(`${baseEndpoint}/users/authenticate`, credential)
  }
}

export default User
</code>```

I built this with webpack

```<code>const webpack = require('webpack')

const path = require('path')

module.exports = env => ({
  mode: env,
  target: ['web', 'es5'],
  devtool: 'source-map',
  entry: './src/index.ts',
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: 'index.js',
    libraryTarget: 'umd',
    clean: true,
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js'],
    extensionAlias: {
      '.js': ['.js', '.ts'],
      '.cjs': ['.cjs', '.cts'],
      '.mjs': ['.mjs', '.mts'],
    },
  },
  module: {
    rules: [
      {
        test: /(?<!\.d)\.([cm]?ts|tsx)$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env', '@babel/preset-typescript'],
          },
        },
      },
    ],
  },
  plugins: [new webpack.BannerPlugin(header)],
})
</code>```

tsconfig

```<code>{
  "include": ["src/**/*"],
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2015",
    "jsx": "react",
    "lib": ["esnext", "dom", "dom.iterable", "es5", "es6", "es2017", "es2016"],
    "suppressImplicitAnyIndexErrors": true,
    "noImplicitAny": false,
    "noEmit": false,
    "removeComments": true,
    "preserveConstEnums": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "isolatedModules": true,
    "sourceMap": true,
    "declaration": true,
    "declarationMap": true,
    "declarationDir": "dist",
    "moduleResolution": "node",
    "allowJs": true,
    "emitDeclarationOnly": true,
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "@*": ["src/*"]
    }
  }
}
</code>```

I run webpack --env="production" && tsc

In my react project I try call the authenticate method using redux call function like this:

```<code>function* authenticateHandler({ credentials }) {
  try {
    const xx = yield user.authenticate(credentials) //this works fine
    const login = yield call(user.authenticate, credentials) //this does not work
  } catch (e) {
    console.log('error ', e)
  }
}

</code>```

I put the xx variable in order to check and works fine, lib its working at first, but using redux call function not and I got this error

```<code>TypeError: Cannot read properties of null (reading 'api')
    at User.ts:65:1
    at f (User.ts:2:1)
    at Generator.<anonymous> (User.ts:2:1)
    at Generator.next (User.ts:2:1)
    at B (User.ts:2:1)
    at i (User.ts:2:1)
    at User.ts:2:1
    at new Promise (<anonymous>)
    at User.ts:2:1
    at n.value (User.ts:67:1)
</code>```

Apparently this inside my lib is null at this point, but I should get same error shouldn't I ?
any idea ?
Thanks

Body:
I built a lib using typescript there is some async methods.
for example

type Credential = {
  email: string
  password: string
}

class User {
  api: ServiceProvider
  constructor(api: ServiceProvider) {
    this.api = api
  }

  async authenticate(credential: Credential): Promise<any> {
    return await this.api.post(`${baseEndpoint}/users/authenticate`, credential)
  }
}

export default User

I built this with webpack

const webpack = require('webpack')

const path = require('path')

module.exports = env => ({
  mode: env,
  target: ['web', 'es5'],
  devtool: 'source-map',
  entry: './src/index.ts',
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: 'index.js',
    libraryTarget: 'umd',
    clean: true,
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js'],
    extensionAlias: {
      '.js': ['.js', '.ts'],
      '.cjs': ['.cjs', '.cts'],
      '.mjs': ['.mjs', '.mts'],
    },
  },
  module: {
    rules: [
      {
        test: /(?<!\.d)\.([cm]?ts|tsx)$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env', '@babel/preset-typescript'],
          },
        },
      },
    ],
  },
  plugins: [new webpack.BannerPlugin(header)],
})

tsconfig

{
  "include": ["src/**/*"],
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2015",
    "jsx": "react",
    "lib": ["esnext", "dom", "dom.iterable", "es5", "es6", "es2017", "es2016"],
    "suppressImplicitAnyIndexErrors": true,
    "noImplicitAny": false,
    "noEmit": false,
    "removeComments": true,
    "preserveConstEnums": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "isolatedModules": true,
    "sourceMap": true,
    "declaration": true,
    "declarationMap": true,
    "declarationDir": "dist",
    "moduleResolution": "node",
    "allowJs": true,
    "emitDeclarationOnly": true,
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "@*": ["src/*"]
    }
  }
}

I run webpack --env="production" && tsc

In my react project I try call the authenticate method using redux call function like this:

function* authenticateHandler({ credentials }) {
  try {
    const xx = yield user.authenticate(credentials) //this works fine
    const login = yield call(user.authenticate, credentials) //this does not work
  } catch (e) {
    console.log('error ', e)
  }
}

I put the xx variable in order to check and works fine, lib its working at first, but using redux call function not and I got this error

TypeError: Cannot read properties of null (reading 'api')
    at User.ts:65:1
    at f (User.ts:2:1)
    at Generator.<anonymous> (User.ts:2:1)
    at Generator.next (User.ts:2:1)
    at B (User.ts:2:1)
    at i (User.ts:2:1)
    at User.ts:2:1
    at new Promise (<anonymous>)
    at User.ts:2:1
    at n.value (User.ts:67:1)

Apparently this inside my lib is null at this point, but I should get same error shouldn't I ?
any idea ?
Thanks


问:
SLF4J: Class path contains multiple SLF4J bindings In iNTELIJI LENGUAGE JAVA
When trying to compile my Maven project in IntelliJ, it shows an error with the mvn install command, also with the mvn install -DskipTests command, it shows me in the surefire-reports and when executing the tests, the following:

SLF4J: Class Path contains multiple SLF4J bindings.
SLF4J: Link found in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/ impl/StaticLoggerBinder.class]

SLF4J: Link found in [jar:file:/C:/Users/admin/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.17.1/log4j-slf4j-impl-2.17.1 .jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
```

Error image

I hope you can help, I've been trying everything for days.

I tried to delete the duplicate folder, put dependencies but nothing.

Body:
When trying to compile my Maven project in IntelliJ, it shows an error with the mvn install command, also with the mvn install -DskipTests command, it shows me in the surefire-reports and when executing the tests, the following:

SLF4J: Class Path contains multiple SLF4J bindings.
SLF4J: Link found in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/ impl/StaticLoggerBinder.class]

SLF4J: Link found in [jar:file:/C:/Users/admin/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.17.1/log4j-slf4j-impl-2.17.1 .jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

Error image

I hope you can help, I've been trying everything for days.

I tried to delete the duplicate folder, put dependencies but nothing.


问:
Standard GKE + node pools cannot enable Autoscaling
Cloud Foundation Fabric Modules:
https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/tree/master/modules/gke-cluster

https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/tree/master/modules/gke-nodepool

Trying to provision a GKE Standard cluster (gke-cluster) with 2 individual node pools (gke-nodepool) with Autoscaling turned ON.

at the cluster level I've specified:

```<code>cluster_autoscaling = {
  enabled    = true
  cpu_min    = 15
  cpu_max    = 85
  memory_min = 15
  memory_max = 85
 }
</code>```

And at the node pool level:

```<code>nodepool_config = {
  autoscaling_config = {
  min_node_count = 1
  max_node_count = 4
 }
</code>```

What I see:
When I go to the GCP console > GKE > choose cluster > Nodes and see the Autoscaling property it's set to OFF.

Expectation:
I would think that if I have enabled Cluster Autoscaling at the cluster level by specifying my scaling thresholds then whatever node pool I individually create AND I have provided autoscaling_config for would show "Autoscaling ON" in the GCP Console.

update:
Here's my actual module configuration:

```<code>module "gke-cluster" {
  source                   = "../../../Modules/gke-cluster"
  project_id               = module.project.project_id
  name                     = "cluster-name"
  location                 = local.svpc.subnets["${local.subnet-gke}"].region
  node_locations           = local.nodepool_zones
  network                  = local.svpc.network.id
  subnetwork               = local.svpc.subnets["${local.subnet-gke}"].id
  secondary_range_pods     = "pods"
  secondary_range_services = "services"

  min_master_version = "1.22.12-gke.2300"
  enable_autopilot   = false
  release_channel    = "STABLE"

  addons = {
    dns_cache_config = true
    cloudrun_config = {
      disabled = true
    }
    gce_persistent_disk_csi_driver_config = true
    horizontal_pod_autoscaling            = true
    http_load_balancing                   = true
    config_connector_config               = false
    kalm_config                           = false
    istio_config = {
      enabled = false
      tls     = false
    }
    network_policy_config = false
  }

  cluster_autoscaling = {
    enabled    = true
    cpu_min    = 15
    cpu_max    = 85
    memory_min = 15
    memory_max = 85
  }

  master_authorized_ranges = {
*REDACTED*
  }

  maintenance_config = {
    recurring_window = {
      start_time = "2020-11-18T00:00:00Z"
      end_time   = "2050-01-01T04:00:00Z"
      recurrence = "FREQ=WEEKLY"
    }
    daily_maintenance_window = null
    maintenance_exclusion    = []
  }

  private_cluster_config = {
    enable_private_nodes    = true
    enable_private_endpoint = true
    master_ipv4_cidr_block  = local.master_ipv4_cidr_block
    master_global_access    = false
  }

  node_config = {
    image_type = "cos_containerd"
    shielded_instance_config = {
      enable_secure_boot          = true
      enable_integrity_monitoring = true
    }
    gcfs  = false
    gvnic = false
  }

  labels = {
*REDACTED*
  }

  depends_on = [module.gke-service-account]
}

</code>```
```<code>module "cpu-nodepool" {
  source            = "../../../Modules/gke-nodepool"
  project_id        = module.project.project_id
  name              = "cpu-nodepool"
  cluster_name      = "cluster-name"
  location          = local.node_location
  max_pods_per_node = 110
  node_count = {
    initial = 1
  }
  tags = [*REDACTED*]

  node_config = {
    image_type                    = "cos_containerd"
    disk_size_gb                  = local.disk_size_gb
    disk_type                     = "pd-standard"
    machine_type                  = local.cpu_machine_type
    preemptible                   = false
    workload_metadata_config_mode = "GKE_METADATA"
    shielded_instance_config = {
      enable_secure_boot          = true
      enable_integrity_monitoring = true
    }
    gcfs  = false
    gvnic = false
  }

  nodepool_config = {
    autoscaling_config = {
      min_node_count = 1
      max_node_count = 3
    }
    management_config = {
      auto_repair  = true
      auto_upgrade = true
    }
  }

  service_account = {
    create       = false
    email        = module.gke-service-account.email
    oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
  }

  depends_on = [module.gke-cluster]
}
</code>```
```<code>module "gpu-nodepool" {
  source            = "../../../Modules/gke-nodepool"
  project_id        = module.roject.project_id
  name              = "gpu-nodepool"
  cluster_name      = "cluster-name"
  location          = local.node_location
  max_pods_per_node = 110
  node_count = {
    initial = 1
  }
  tags = [*REDACTED*]

  node_config = {
    image_type                    = "cos_containerd"
    disk_size_gb                  = local.disk_size_gb
    disk_type                     = "pd-standard"
    machine_type                  = local.gpu_machine_type
    preemptible                   = false
    workload_metadata_config_mode = "GKE_METADATA"
    shielded_instance_config = {
      enable_secure_boot          = true
      enable_integrity_monitoring = true
    }
    guest_accelerator = {
      count = local.gpu_count
      type  = local.gpu_accelerator
    }
    gcfs  = false
    gvnic = false
  }

  nodepool_config = {
    autoscaling_config = {
      min_node_count = 1
      max_node_count = 4
    }
    management_config = {
      auto_repair  = true
      auto_upgrade = true
    }
  }

  service_account = {
    create       = false
    email        = module.gke-service-account.email
    oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
  }

  labels = {
*REDACTED*
  }

  depends_on = [module.gke-cluster]
}
</code>```

Body:
Cloud Foundation Fabric Modules:
https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/tree/master/modules/gke-cluster

https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/tree/master/modules/gke-nodepool

Trying to provision a GKE Standard cluster (gke-cluster) with 2 individual node pools (gke-nodepool) with Autoscaling turned ON.

at the cluster level I've specified:

cluster_autoscaling = {
  enabled    = true
  cpu_min    = 15
  cpu_max    = 85
  memory_min = 15
  memory_max = 85
 }

And at the node pool level:

nodepool_config = {
  autoscaling_config = {
  min_node_count = 1
  max_node_count = 4
 }

What I see:
When I go to the GCP console > GKE > choose cluster > Nodes and see the Autoscaling property it's set to OFF.

Expectation:
I would think that if I have enabled Cluster Autoscaling at the cluster level by specifying my scaling thresholds then whatever node pool I individually create AND I have provided autoscaling_config for would show "Autoscaling ON" in the GCP Console.

update:
Here's my actual module configuration:

module "gke-cluster" {
  source                   = "../../../Modules/gke-cluster"
  project_id               = module.project.project_id
  name                     = "cluster-name"
  location                 = local.svpc.subnets["${local.subnet-gke}"].region
  node_locations           = local.nodepool_zones
  network                  = local.svpc.network.id
  subnetwork               = local.svpc.subnets["${local.subnet-gke}"].id
  secondary_range_pods     = "pods"
  secondary_range_services = "services"

  min_master_version = "1.22.12-gke.2300"
  enable_autopilot   = false
  release_channel    = "STABLE"

  addons = {
    dns_cache_config = true
    cloudrun_config = {
      disabled = true
    }
    gce_persistent_disk_csi_driver_config = true
    horizontal_pod_autoscaling            = true
    http_load_balancing                   = true
    config_connector_config               = false
    kalm_config                           = false
    istio_config = {
      enabled = false
      tls     = false
    }
    network_policy_config = false
  }

  cluster_autoscaling = {
    enabled    = true
    cpu_min    = 15
    cpu_max    = 85
    memory_min = 15
    memory_max = 85
  }

  master_authorized_ranges = {
*REDACTED*
  }

  maintenance_config = {
    recurring_window = {
      start_time = "2020-11-18T00:00:00Z"
      end_time   = "2050-01-01T04:00:00Z"
      recurrence = "FREQ=WEEKLY"
    }
    daily_maintenance_window = null
    maintenance_exclusion    = []
  }

  private_cluster_config = {
    enable_private_nodes    = true
    enable_private_endpoint = true
    master_ipv4_cidr_block  = local.master_ipv4_cidr_block
    master_global_access    = false
  }

  node_config = {
    image_type = "cos_containerd"
    shielded_instance_config = {
      enable_secure_boot          = true
      enable_integrity_monitoring = true
    }
    gcfs  = false
    gvnic = false
  }

  labels = {
*REDACTED*
  }

  depends_on = [module.gke-service-account]
}

module "cpu-nodepool" {
  source            = "../../../Modules/gke-nodepool"
  project_id        = module.project.project_id
  name              = "cpu-nodepool"
  cluster_name      = "cluster-name"
  location          = local.node_location
  max_pods_per_node = 110
  node_count = {
    initial = 1
  }
  tags = [*REDACTED*]

  node_config = {
    image_type                    = "cos_containerd"
    disk_size_gb                  = local.disk_size_gb
    disk_type                     = "pd-standard"
    machine_type                  = local.cpu_machine_type
    preemptible                   = false
    workload_metadata_config_mode = "GKE_METADATA"
    shielded_instance_config = {
      enable_secure_boot          = true
      enable_integrity_monitoring = true
    }
    gcfs  = false
    gvnic = false
  }

  nodepool_config = {
    autoscaling_config = {
      min_node_count = 1
      max_node_count = 3
    }
    management_config = {
      auto_repair  = true
      auto_upgrade = true
    }
  }

  service_account = {
    create       = false
    email        = module.gke-service-account.email
    oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
  }

  depends_on = [module.gke-cluster]
}

module "gpu-nodepool" {
  source            = "../../../Modules/gke-nodepool"
  project_id        = module.roject.project_id
  name              = "gpu-nodepool"
  cluster_name      = "cluster-name"
  location          = local.node_location
  max_pods_per_node = 110
  node_count = {
    initial = 1
  }
  tags = [*REDACTED*]

  node_config = {
    image_type                    = "cos_containerd"
    disk_size_gb                  = local.disk_size_gb
    disk_type                     = "pd-standard"
    machine_type                  = local.gpu_machine_type
    preemptible                   = false
    workload_metadata_config_mode = "GKE_METADATA"
    shielded_instance_config = {
      enable_secure_boot          = true
      enable_integrity_monitoring = true
    }
    guest_accelerator = {
      count = local.gpu_count
      type  = local.gpu_accelerator
    }
    gcfs  = false
    gvnic = false
  }

  nodepool_config = {
    autoscaling_config = {
      min_node_count = 1
      max_node_count = 4
    }
    management_config = {
      auto_repair  = true
      auto_upgrade = true
    }
  }

  service_account = {
    create       = false
    email        = module.gke-service-account.email
    oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
  }

  labels = {
*REDACTED*
  }

  depends_on = [module.gke-cluster]
}


问:
JFrame method repaint() causes JFrame to sense two clicks
extends JPanel implements MouseListener, MouseMotionListener

when I use repaint(), the method mousePressed(MouseEvent e) begins to sense two clicks even though I only pressed one time.

Does anyone happen to know how to fix this?

```<code>@Override
public void mousePressed(MouseEvent e) {

    repaint();

}
</code>```

Body:
extends JPanel implements MouseListener, MouseMotionListener

when I use repaint(), the method mousePressed(MouseEvent e) begins to sense two clicks even though I only pressed one time.

Does anyone happen to know how to fix this?

@Override
public void mousePressed(MouseEvent e) {

    repaint();

}


问:
print function with formatted strings behave strange
i have a strange problem. i have this piece of code and i don't understand why the first print instruction gives different result for the operation

```<code>abs(miaradq(n)-math.sqrt(n))
</code>```

the code is this:

```<code>def miaradq(a):
    x = 5
    while True:
        y = (x + a/x) / 2
        if x == y:
            return x
            break
        x = y

def test_radq():
    for n in range (1,10):
      print('the difference between miasqrt and math.sqrt is %f', abs(miaradq(n) - math.sqrt(n)))
</code>```

with this print function i get all 0.000000, but if i use

```<code>print(abs(miaradq(n) - math.sqrt(n)))
</code>```

i get

```<code>0.0
2.220446049250313e-16
0.0
0.0
0.0
0.0
0.0
4.440892098500626e-16
0.0
</code>```

i tried with %d too, but no luck. the only way to get this result with the formatted string is to use %s, i don't understand what i am missing here.

Body:
i have a strange problem. i have this piece of code and i don't understand why the first print instruction gives different result for the operation

abs(miaradq(n)-math.sqrt(n))

the code is this:

def miaradq(a):
    x = 5
    while True:
        y = (x + a/x) / 2
        if x == y:
            return x
            break
        x = y

def test_radq():
    for n in range (1,10):
      print('the difference between miasqrt and math.sqrt is %f', abs(miaradq(n) - math.sqrt(n)))

with this print function i get all 0.000000, but if i use

print(abs(miaradq(n) - math.sqrt(n)))

i get

0.0
2.220446049250313e-16
0.0
0.0
0.0
0.0
0.0
4.440892098500626e-16
0.0

i tried with %d too, but no luck. the only way to get this result with the formatted string is to use %s, i don't understand what i am missing here.


问:
aggregating monthly averages for days within the week
I have this data frame;

```<code>city_name          Date       x1     x2   x3
London       2022-01-01       10     12   14
London       2022-01-02        8     11    5
London       2022-01-03        5      9    8
London       2022-01-04       15     10   13
London       2022-01-05       10     10   10
London       2022-01-06        9      5    9
Glasgow      2022-01-01       14     19    5
Glasgow      2022-01-02       12     17   11
Glasgow      2022-01-03        7     12    0
...
</code>```

I am trying to group the data by city_name and date and get aggregated values for days of the week. (Monday, Tuesday, Wednesday..) for each city.

```<code>m_wday_summary <- df %>%
  group_by(wday(city_name,Date, label = TRUE)) %>%
  summarise(across(x1:x3,  list(mean = ~ mean(.x, na.rm = TRUE),
                                                min = ~ min(.x, na.rm = TRUE),
                                                max = ~ max(.x, na.rm = TRUE))))
</code>```

Body:
I have this data frame;

city_name          Date       x1     x2   x3
London       2022-01-01       10     12   14
London       2022-01-02        8     11    5
London       2022-01-03        5      9    8
London       2022-01-04       15     10   13
London       2022-01-05       10     10   10
London       2022-01-06        9      5    9
Glasgow      2022-01-01       14     19    5
Glasgow      2022-01-02       12     17   11
Glasgow      2022-01-03        7     12    0
...

I am trying to group the data by city_name and date and get aggregated values for days of the week. (Monday, Tuesday, Wednesday..) for each city.

m_wday_summary <- df %>%
  group_by(wday(city_name,Date, label = TRUE)) %>%
  summarise(across(x1:x3,  list(mean = ~ mean(.x, na.rm = TRUE),
                                                min = ~ min(.x, na.rm = TRUE),
                                                max = ~ max(.x, na.rm = TRUE))))


问:
No exception of type DataAccessException
I have no idea what is going on right now with my project, when I try to use the command mvn clean package. I get this error of

incorrect classpath: /Users/myname/.m2/repository/org/springframework/spring-core/5.2.7.RELEASE/spring-core-5.2.7.RELEASE.jar
:

[ERROR] No exception of type DataAccessException can be thrown; an exception type must be a subclass of Throwable

Im not sure what this means really as when I go to my .m2 folder I have the required spring-core jar it is talking about so I don't understand how the classpath is wrong and why it cannot use the DataAccessException.

I have tried to delete my .m2 folder and redownload the dependencies but that didnt work. I even tried cloning the remote repo again into a new local repo to see if I can launch the master branch but the new repo is getting the same error....

Does anyone have any ideas why this is happening and how I can fix this? Im a junior and this is stumping me really bad


问:
Asp.Net Core Web API entity Framework connect to two databases
I am doing an Asp.Net Core API and I am connecting to a two databases using EF setted in appsettings.json

```<code>    "ConnectionStrings": {
        "DBConnection": "Server=2679; Database=A; Trusted_Connection=true; MultipleActiveResultSets=true; Integrated Security=true;Encrypt=false;",
        "DBConnection2": "Server= 2684; Database=B; Trusted_Connection=true; MultipleActiveResultSets=true; Integrated Security=true;Encrypt=false;"

      }
</code>```

In my Program.cs I have setted this two connections

```<code> var connectionString = (builder.Configuration.GetConnectionString("DBConnection") ?? String.Empty).Trim();
var connectionString2 = (builder.Configuration.GetConnectionString("DBConnectionAnthem") ?? String.Empty).Trim();

builder.Services.ConfigureServices(connectionString);
builder.Services.ConfigureServices(connectionString2);
</code>```

I call ConfigureServices with both connections and looks like this

```<code> public static class Configure
    {
        public static void ConfigureServices(this IServiceCollection services, string connectionString)
        {
            services
                 .AddDbContext<CobraDbContext>(options => options.UseSqlServer(connectionString));

            ........
            services.AddScoped<IUnitOfWork, UnitOfWork>();

        }
    }
}
</code>```

I am using EF and I have defined my DbContext like this

```<code>public class CobraDbContext : DbContext
    {
        public CobraDbContext(DbContextOptions<CobraDbContext> options)
        : base(options)
        {
        }
        public DbSet<SearchResultModel> ParticipantSearch { get; set; } = null!;
       ....

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
        }
    }
}
</code>```

From My Controller Method I call the Service.cs witch use UnitOfwork

```<code> public class ParticipantService : IParticipantService
    {
        private readonly ILogger<ParticipantService> _logger;
        private readonly IUnitOfWork _iUnitOfwork;
        public ParticipantService(ILogger<ParticipantService> logger, IUnitOfWork iUnitOfwork)
        {
            _logger = logger;
            _iUnitOfwork = iUnitOfwork;
        }
        public async Task<HttpResponseMessage> Search(string participantId)
        {
            try
            {
                List<SearchResultModel>? search = await _iUnitOfwork.Participant.AAA(participantId);
                return Request.CreateResponse(HttpStatusCode.OK, search);
            }
            catch (Exception ex)
            {

        }
    }
</code>```

From My Service I call the Repository that have a generic repository

```<code>public class ParticipantRepository : GenericRepository<SearchResultModel>, IParticipantRepository
    {
        private readonly CobraDbContext _db;
        public ParticipantRepository(CobraDbContext db) : base(db)
        {
            _db = db;
        }
     public async Task<List<ParticipantPlanModel>?> AAA(string participantId)
            {
                Query participantGetByID = new();

                Dictionary<string, string> dictionary = new Dictionary<string, string>();
                participantGetByID.SelectFrom = " exec sp";
                List<ParticipantPlanModel>? _return = await ExecuteGeneric(participantGetByID);
                return _return;
            }
}
</code>```

I have my generic repo like this

```<code> public class GenericRepository<T> : IGenericRepository<T> where T : class
    {
        protected readonly CobraDbContext Context;
        internal DbSet<T> dbSet;

        public GenericRepository(CobraDbContext context)
        {
            Context = context;
            dbSet = context.Set<T>();
        }
 public async Task<List<T>?> ExecuteGeneric(Query query)
        {
            //    var defaultVal = default(T);
            var cParameters = new SqlParameter[query.Parameters?.Count ?? 0];
            if (query.Parameters != null)
            {
                int i = 0;
                foreach (KeyValuePair<string, string> _param in query.Parameters)
                {
                    cParameters[i] = new SqlParameter() { ParameterName = _param.Key, Value = _param.Value };
                    i++;
                }
            }
            return await Context.Set<T>().FromSqlRaw(query.SelectFrom + query.Where + query.OrderBy, cParameters).ToListAsync();
        }
</code>```

Depending on the parameter I have to call a database or a the another. I know I can do this duplicating almost all the code... Having to DbContext and two generic Repo..

Is there a way to simplify it and not replicate most of the code?

Thanks

Body:
I am doing an Asp.Net Core API and I am connecting to a two databases using EF setted in appsettings.json

    "ConnectionStrings": {
        "DBConnection": "Server=2679; Database=A; Trusted_Connection=true; MultipleActiveResultSets=true; Integrated Security=true;Encrypt=false;",
        "DBConnection2": "Server= 2684; Database=B; Trusted_Connection=true; MultipleActiveResultSets=true; Integrated Security=true;Encrypt=false;"

      }

In my Program.cs I have setted this two connections

 var connectionString = (builder.Configuration.GetConnectionString("DBConnection") ?? String.Empty).Trim();
var connectionString2 = (builder.Configuration.GetConnectionString("DBConnectionAnthem") ?? String.Empty).Trim();

builder.Services.ConfigureServices(connectionString);
builder.Services.ConfigureServices(connectionString2);

I call ConfigureServices with both connections and looks like this

 public static class Configure
    {
        public static void ConfigureServices(this IServiceCollection services, string connectionString)
        {
            services
                 .AddDbContext<CobraDbContext>(options => options.UseSqlServer(connectionString));

            ........
            services.AddScoped<IUnitOfWork, UnitOfWork>();

        }
    }
}

I am using EF and I have defined my DbContext like this

public class CobraDbContext : DbContext
    {
        public CobraDbContext(DbContextOptions<CobraDbContext> options)
        : base(options)
        {
        }
        public DbSet<SearchResultModel> ParticipantSearch { get; set; } = null!;
       ....

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
        }
    }
}

From My Controller Method I call the Service.cs witch use UnitOfwork

 public class ParticipantService : IParticipantService
    {
        private readonly ILogger<ParticipantService> _logger;
        private readonly IUnitOfWork _iUnitOfwork;
        public ParticipantService(ILogger<ParticipantService> logger, IUnitOfWork iUnitOfwork)
        {
            _logger = logger;
            _iUnitOfwork = iUnitOfwork;
        }
        public async Task<HttpResponseMessage> Search(string participantId)
        {
            try
            {
                List<SearchResultModel>? search = await _iUnitOfwork.Participant.AAA(participantId);
                return Request.CreateResponse(HttpStatusCode.OK, search);
            }
            catch (Exception ex)
            {

        }
    }

From My Service I call the Repository that have a generic repository

public class ParticipantRepository : GenericRepository<SearchResultModel>, IParticipantRepository
    {
        private readonly CobraDbContext _db;
        public ParticipantRepository(CobraDbContext db) : base(db)
        {
            _db = db;
        }
     public async Task<List<ParticipantPlanModel>?> AAA(string participantId)
            {
                Query participantGetByID = new();

                Dictionary<string, string> dictionary = new Dictionary<string, string>();
                participantGetByID.SelectFrom = " exec sp";
                List<ParticipantPlanModel>? _return = await ExecuteGeneric(participantGetByID);
                return _return;
            }
}

I have my generic repo like this

 public class GenericRepository<T> : IGenericRepository<T> where T : class
    {
        protected readonly CobraDbContext Context;
        internal DbSet<T> dbSet;

        public GenericRepository(CobraDbContext context)
        {
            Context = context;
            dbSet = context.Set<T>();
        }
 public async Task<List<T>?> ExecuteGeneric(Query query)
        {
            //    var defaultVal = default(T);
            var cParameters = new SqlParameter[query.Parameters?.Count ?? 0];
            if (query.Parameters != null)
            {
                int i = 0;
                foreach (KeyValuePair<string, string> _param in query.Parameters)
                {
                    cParameters[i] = new SqlParameter() { ParameterName = _param.Key, Value = _param.Value };
                    i++;
                }
            }
            return await Context.Set<T>().FromSqlRaw(query.SelectFrom + query.Where + query.OrderBy, cParameters).ToListAsync();
        }

Depending on the parameter I have to call a database or a the another. I know I can do this duplicating almost all the code... Having to DbContext and two generic Repo..

Is there a way to simplify it and not replicate most of the code?

Thanks


问:
how to split long blog post in multiple pages

i have complete code to do this and works too but there is a problem, after using this code  all the text disappears from pages like, about me, contact us etc, this code only works on blogger posts and invalid for pages, can anyone make it work for both pages and posts, or just find the solution so it does not effect my pages. below i provided java script, css and html please have a look.

```<code>`<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:post.body contains "⏩"'>
<div class='aiti-body' id='PostBody'>
<data:post.body/>
  </div>
<b:if cond='data:blog.pageType == "item"'>
<!-- only display title if it's  non-empty -->
<b:if cond='data:post.body contains "⏩"'>
  <div id='aiti-out'/><br/>
<div class='aiti-message'>
<i class='fa fa-map' style='color: #ee4723; font-size: 20px;'/><b>
 Continue Reading about the  </b><b><a expr:href='data:post.url' style='font-size:18px;color:#ee4723'>"<data:post.title/>"</a></b><b>  on the next page below</b></div>
<br/>

<!-- code ad adsense -->
<div class='lalulintas1'><a href='#'><span class='rambuhijau1'>ad example 1</span></a></div>
<!-- code ad adsense -->

<div class='post-pagination'>
<div class='aiti-next-prev' id='aiti_prev'><a><div class='aiti_prev1 pag-btn'><span>« back</span></div></a></div>
<div class='aiti-next-prev' id='aiti_next'><a><div class='aiti_next1 pag-btn'><span>next »</span></div></a></div>
<div id='aiti-page-number'/>

</div>

<!-- code ad adsense  -->
<div class='lalulintas1'><a href='#'><span class='rambuhijau1'>ad example 2</span></a></div>
<!-- code ad adsense  -->

</b:if>
</b:if>
  <b:else/>
<data:post.body/>
</b:if>
</b:if>
`
</code>```

Here is the css

```<code>`.lalulintas1{width:728;height:90px;background:#d5d5d5;margin:0 auto;position:relative;max-width:100%}.rambuhijau1{background:#e7e7e7;position:absolute;display:block;color:rgba(0,0,0,.2);text-align:center;text-transform:uppercase;font-size:180%;padding:10px;margin:5px;right:0;left:0;top:0;bottom:0;font-weight:700;line-height:4.4rem}
.aiti-message { width: 77%; margin: auto; }
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 135px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 135px;}

#aiti-page-number{
BACKGROUND-COLOR: #ffe4c4;
font-size: 17px;
text-align: center;
padding: 5px 0px;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
font-weight: bold;
color: #ee4723;
}

@media only screen and (max-device-width: 375px) {
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 80px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 80px;}
}

.post-pagination {
    height: 40px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.pag-btn {
    font-size: 17px;
    box-sizing: border-box;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 0px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
    color: #FFF !important;
    font-weight: bold;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    display: inline-block;
}`
</code>```

Here is the JS

```<code>`.lalulintas1{width:728;height:90px;background:#d5d5d5;margin:0 auto;position:relative;max-width:100%}.rambuhijau1{background:#e7e7e7;position:absolute;display:block;color:rgba(0,0,0,.2);text-align:center;text-transform:uppercase;font-size:180%;padding:10px;margin:5px;right:0;left:0;top:0;bottom:0;font-weight:700;line-height:4.4rem}
.aiti-message { width: 77%; margin: auto; }
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 135px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 135px;}

#aiti-page-number{
BACKGROUND-COLOR: #ffe4c4;
font-size: 17px;
text-align: center;
padding: 5px 0px;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
font-weight: bold;
color: #ee4723;
}

@media only screen and (max-device-width: 375px) {
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 80px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 80px;}
}

.post-pagination {
    height: 40px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.pag-btn {
    font-size: 17px;
    box-sizing: border-box;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 0px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
    color: #FFF !important;
    font-weight: bold;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    display: inline-block;
}`
</code>```

this code works fine on my blogger posts but after using it all the text etc disappare from pages it is effecting pages so i want it  to work fine with pages too if not than atleast it shoult not effect my pages

Body:
i have complete code to do this and works too but there is a problem, after using this code  all the text disappears from pages like, about me, contact us etc, this code only works on blogger posts and invalid for pages, can anyone make it work for both pages and posts, or just find the solution so it does not effect my pages. below i provided java script, css and html please have a look.

`

<data:post.body/>

 Continue Reading about the  "<data:post.title/>"  on the next page below

ad example 1

« back

next »

ad example 2

<data:post.body/>

`

Here is the css

`.lalulintas1{width:728;height:90px;background:#d5d5d5;margin:0 auto;position:relative;max-width:100%}.rambuhijau1{background:#e7e7e7;position:absolute;display:block;color:rgba(0,0,0,.2);text-align:center;text-transform:uppercase;font-size:180%;padding:10px;margin:5px;right:0;left:0;top:0;bottom:0;font-weight:700;line-height:4.4rem}
.aiti-message { width: 77%; margin: auto; }
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 135px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 135px;}

#aiti-page-number{
BACKGROUND-COLOR: #ffe4c4;
font-size: 17px;
text-align: center;
padding: 5px 0px;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
font-weight: bold;
color: #ee4723;
}

@media only screen and (max-device-width: 375px) {
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 80px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 80px;}
}

.post-pagination {
    height: 40px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.pag-btn {
    font-size: 17px;
    box-sizing: border-box;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 0px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
    color: #FFF !important;
    font-weight: bold;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    display: inline-block;
}`

Here is the JS

`.lalulintas1{width:728;height:90px;background:#d5d5d5;margin:0 auto;position:relative;max-width:100%}.rambuhijau1{background:#e7e7e7;position:absolute;display:block;color:rgba(0,0,0,.2);text-align:center;text-transform:uppercase;font-size:180%;padding:10px;margin:5px;right:0;left:0;top:0;bottom:0;font-weight:700;line-height:4.4rem}
.aiti-message { width: 77%; margin: auto; }
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 135px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 135px;}

#aiti-page-number{
BACKGROUND-COLOR: #ffe4c4;
font-size: 17px;
text-align: center;
padding: 5px 0px;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
font-weight: bold;
color: #ee4723;
}

@media only screen and (max-device-width: 375px) {
.aiti_prev1{background-color: #f44336;float:left;color:#fff !important;width: 80px;}
.aiti_next1{background-color: #f44336;float:right;color:#fff !important;width: 80px;}
}

.post-pagination {
    height: 40px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.pag-btn {
    font-size: 17px;
    box-sizing: border-box;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 0px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
    color: #FFF !important;
    font-weight: bold;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    display: inline-block;
}`

this code works fine on my blogger posts but after using it all the text etc disappare from pages it is effecting pages so i want it  to work fine with pages too if not than atleast it shoult not effect my pages


问:
Html Input Required Attribute is not working
Although button type is submit, name attributes are same for radio buttons, there is action and method attributes for form, and all other requirements are done, input required attribute is still not working.

there is no novalidate attribute in the form as well.

```<code>
<form action="" method="">
                        <div class="form-group">
                            <div class="form-checkbox">
                                    <label for="resheadpay1">
                                    <input id="resheadpay1" type="radio" id="payinthecar" name="flight-type" required/>
                                    <span></span>Pay in the Car
                                </label>
                                    <label for="resheadpay2">
                                        <input id="resheadpay2"  type="radio" id="paybycreditcard" name="flight-type" />
                                    <span></span>Pay by Credit Card
                                </label>

                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">

                                    <input id="txtSource" class="form-control" name="pickLocation" type="text" placeholder="Pickup Location" required/>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">

                                    <input id="txtDestination" class="form-control" type="text" name="dropLocation" placeholder="Dropoff Location" required/>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3">
                                <div class="form-group">

                                        <input id="txtdate" class="form-control" placeholder="Date" type="date" name="datepick" required/>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">

                                        <input id="txttime"  class="form-control" type="text" id="datetimepicker" name="timepick" placeholder="hh:mm" required/>
                                </div>
                            </div>

                            <div class="col-md-3">
                                <div class="form-btn">
                                        <button class="submit-btn" onclick="GetRoute(); showres(); hidebooking(); changeText();" type="submit">Book Now </button>
                                </div>
                            </div>
                        </div>
                    </form>

</code>```

Body:
Although button type is submit, name attributes are same for radio buttons, there is action and method attributes for form, and all other requirements are done, input required attribute is still not working.

there is no novalidate attribute in the form as well.

<form action="" method="">

                                    <input id="resheadpay1" type="radio" id="payinthecar" name="flight-type" required/>
                                    Pay in the Car

                                        <input id="resheadpay2"  type="radio" id="paybycreditcard" name="flight-type" />
                                    Pay by Credit Card

                                    <input id="txtSource" class="form-control" name="pickLocation" type="text" placeholder="Pickup Location" required/>

                                    <input id="txtDestination" class="form-control" type="text" name="dropLocation" placeholder="Dropoff Location" required/>

                                        <input id="txtdate" class="form-control" placeholder="Date" type="date" name="datepick" required/>

                                        <input id="txttime"  class="form-control" type="text" id="datetimepicker" name="timepick" placeholder="hh:mm" required/>

                                        <button class="submit-btn" onclick="GetRoute(); showres(); hidebooking(); changeText();" type="submit">Book Now </button>

                    </form>


问:
CMake MSVC disable PDB generation completely
How can I completely disable .pdb generation in CMake  for MSVC when building a DLL? I need C/C++ -> General -> Debug Information Format set to None and Linker -> Debugging -> Generate Debug Info set to None . As far as I know that just means omit any flags for both, how can I set this?</p>


问:
How can you get the value of a specific 'object' in realtime firebase?
I would like to know how to get this specific object name/value because I want to retrieve it for conditions in my android studio project.

I can get the instance of the 'table' Users but it is all my users that are retrieved. I would like to get one specific one so that i can target the childs of it.
DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Users");


问:
Allure error messages Could not update step: no step running o.qameta.allure.AllureLifecycle - Could not stop step: no step running
I use Java and Cucumber 7 and Allure dependencies and Plugin with Allure.  The reports are created but I keep getting theses errors

ERROR io.qameta.allure.AllureLifecycle - Could not update step: no
step running

ERROR io.qameta.allure.AllureLifecycle - Could not stop
step: no step running

.

I've tried many things based on Google serach results but nothing helps

I don't want above error messages appear in my output log


问:
Customizing echart Horizontal select brush functionality to select single point & range of points in x-axis
We are trying to implement functionality using echarts that allow the user the select a single & range of samples/points on x-axis . which looks something like this.

we started with the Horizontal select feature from the below link, which is working fine for the Range of samples. how to implement the same for a single sample?

https://echarts.apache.org/examples/en/editor.html?c=bar-brush