text:
Q: Difficulty reverse engineering CRC 16 I have captured 3 packets that I think all use the same 16 bit CRC, but I can't find a common match. They are:
1. DB97BD7F85C7
2. DCC45CDFBF47
3. DB5BF51FA66F
Running reveng on all 3 produces no match. But I get a match for just 1 and 2, 1 and 3, and 2 and 3. I also have the SRP16 matches below, with similar results. I assume the numerous partial matches from SRP16 makes a great example of why Ross Williams and others say to NEVER make up your own poly unless you know what you're doing. I will post more if I make any progress.
What am I missing?
Here is what I tried:
1, 2 and 3
>reveng -w 16 -s DB97BD7F85C7 DCC45CDFBF47 DB5BF51FA66F
reveng: no models found

1 and 2
>reveng -w 16 -s DB97BD7F85C7 DCC45CDFBF47
width=16  poly=0x1c4d  init=0x0820  refin=false  refout=false xorout=0x0000  check=0xe5a3  name=(none)
width=16  poly=0x5313  init=0x0541  refin=false  refout=false  xorout=0x0000  check=0x16ee  name=(none)

width=16  poly=0xd84d  init=0xcbb0  refin=false  refout=false  xorout=0x0000  check=0xd81f  name=(none)
1 and 3
>reveng -w 16 -s DB97BD7F85C7 DB5BF51FA66F
width=16  poly=0xcfdb  init=0x2152  refin=false  refout=false  xorout=0x0000  check=0x7c5f  name=(none)

2 and 3
>reveng -w 16 -s DCC45CDFBF47 DB5BF51FA66F
width=16  poly=0x6319  init=0xce07  refin=false  refout=false  xorout=0x0000  check=0x358f  name=(none)

For what its worth, I also ran an exhaustive search with SRP16. As you can see, SRP16 found several matches for 1 and 3, and 2 and 3 (it only searches for Data 1, then checks the other 2). These are the results:
===== Result parameter sets =====
CRC=$c791  Poly=$0a1f  init=$51a7  xorout=$ffff  refin=false  refout=true
 *** Third  data set verified
CRC=$c791  Poly=$0a1f  init=$560a  xorout=$0000  refin=false  refout=true
 *** Third  data set verified
CRC=$91c7  Poly=$24ab  init=$4b77  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$24ab  init=$f978  xorout=$0000  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$32c1  init=$58d2  xorout=$0000  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$32c1  init=$e604  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4078  init=$19b0  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4078  init=$31bf  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4078  init=$49ae  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4078  init=$61a1  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4078  init=$9183  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4078  init=$b98c  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4078  init=$c19d  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4078  init=$e992  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$45cf  init=$12de  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$45cf  init=$78e7  xorout=$0000  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$4928  init=$0e97  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4928  init=$27b2  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4928  init=$5cdd  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4928  init=$75f8  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4928  init=$8326  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4928  init=$aa03  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4928  init=$d16c  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$4928  init=$f849  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5b2b  init=$d6b6  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5b2b  init=$fa7d  xorout=$0000  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$0056  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$2ba9  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$57a8  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$7c57  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$8455  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$afaa  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$d3ab  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$5ff8  init=$f854  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$c791  Poly=$701f  init=$c9e9  xorout=$0000  refin=false  refout=true
 *** Second data set verified
CRC=$c791  Poly=$701f  init=$fa7c  xorout=$ffff  refin=false  refout=true
 *** Second data set verified
CRC=$c791  Poly=$723b  init=$4239  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$c791  Poly=$723b  init=$da97  xorout=$0000  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7296  init=$6f03  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7296  init=$d648  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$1faf  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$311c  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$42c9  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$6c7a  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$8bd0  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$a563  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$d6b6  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$7598  init=$f805  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$868a  init=$12de  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$868a  init=$d19b  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$9232  init=$1faf  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$9232  init=$d6b6  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$a4df  init=$0bee  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$a4df  init=$1a23  xorout=$0000  refin=true   refout=false
 *** Third  data set verified
CRC=$c791  Poly=$aa75  init=$16df  xorout=$ffff  refin=true   refout=true
 *** Second data set verified
CRC=$c791  Poly=$aa75  init=$c58b  xorout=$0000  refin=true   refout=true
 *** Second data set verified
CRC=$91c7  Poly=$c732  init=$4b77  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$c732  init=$a8ee  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$cbdd  init=$6f03  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$cbdd  init=$8ec3  xorout=$0000  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$cf54  init=$311c  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$cf54  init=$42c9  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$cf54  init=$a563  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$cf54  init=$d6b6  xorout=$ffff  refin=false  refout=false
 *** Third  data set verified
CRC=$c791  Poly=$d143  init=$2b44  xorout=$ffff  refin=true   refout=true
 *** Second data set verified
CRC=$c791  Poly=$d143  init=$754a  xorout=$0000  refin=true   refout=true
 *** Second data set verified
CRC=$91c7  Poly=$e044  init=$19b0  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$e044  init=$61a1  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$e044  init=$9183  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$e044  init=$e992  xorout=$ffff  refin=false  refout=false
 *** Second data set verified
CRC=$91c7  Poly=$ea2e  init=$1ec6  xorout=$ffff  refin=false  refout=true
 *** Second data set verified
CRC=$91c7  Poly=$ea2e  init=$ebd1  xorout=$ffff  refin=false  refout=true
 *** Second data set verified
CRC=$91c7  Poly=$edbc  init=$27b2  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$edbc  init=$5cdd  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$edbc  init=$aa03  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
CRC=$91c7  Poly=$edbc  init=$d16c  xorout=$ffff  refin=true   refout=false
 *** Third  data set verified
===== done =====


text:
Q: ADO.NET how to identify a user's roles in the database? There is a database on an Sql Server 2012. The server has users who belong to different roles. The application is written in C#.  It connects to the database via SqlConnection. In Sql Connection I build the connection string with the user's stated username and password.
I need to know how to identify what roles the user belongs to in the database, so that I can configure my application appropriately.  How do I find out what roles the user has so I can log in through a single login window, but redirect the user to different windows depending on their DB roles.

A: I think he is asking how to know what roles the user has in the database so he can configure his application appropriately. It is OK to ask the user to provide their username and password, and build that into the connection string to access the database. This properly limits the user access only as far as the db is configured to give them access, which is what users and roles were created for in SQL Server - to authenticate and authorize the user connecting to the database through whatever application.
But if you want to know their roles in the database, so you can configure your application appropriately, you will need to read from the security catalog views in SQL server. These are views like any other views you create, only they are already created for you. You can read from them with a select statement just like you would read from your own tables and views. You might specifically look into the sys.database_role_members, which connects users to their roles. If you connect to the db using the actual user's username and password, you will still be able to read from these security catalogs, you will just only be able to read that specific user's information, which is what you want anyway.
You would use a select statement like this:
SELECT roles.NAME, members.NAME
  FROM sys.database_role_members role_members
       JOIN sys.database_principals roles
         ON role_members.role_principal_id = roles.principal_id
       JOIN sys.database_principals members
         ON role_members.member_principal_id = members.principal_id

You can read more about these security catalogs at https://msdn.microsoft.com/en-us/library/ms178542.aspx.

A: Authorization should not be done on connection string level, but in business logic of application.
When user gets logged in, you check for his role, and based on that you decide what he can/can't do.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How do up upgrade LetsEncrypt certbot to version 0.22 which supports wildcard certificates? To get a wildcard SSL certificate from LetsEncrypt you need to run certbot version 0.22 or later according to https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578
I've installed certbot from apt using
sudo apt-get install certbot

However, that reports:

certbot is already the newest version (0.17.0-2).

How can I upgrade certbot to a version that supports wildcard certificates?

A: If you have already installed Certbot, you should add a parameter to apt-get install to upgrade only a specific package
sudo apt-get update
sudo apt-get install --only-upgrade certbot

Check version number
certbot --version || /path/to/certbot-auto --version

Reference answer:
  How to upgrade a single package using apt-get?

A: As the certbot site indicates, the certbot team maintains a PPA. The certbot package is at 0.22.2 on all supported versions of Ubuntu in that PPA. (What are PPAs and how do I use them?)

A: Check version number:
certbot --version

On Ubuntu systems, the Certbot team maintains a PPA. You can add it to your list of repositories and install Certbot by running the following commands:
$ sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository universe
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt install certbot

(source)


text:
Q: aws amplify react-ui authenticator not rendering I'm just trying to use the default provided authentication component but nothing is showing up on the DOM and it's just a white screen.
Setup:
npm create vite@latest
 -> react, typescript
npm install
npm install aws-amplify @aws-amplify/ui-react
amplify init
amplify add auth
amplify push

main.tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
    <React.StrictMode>
        <App />
    </React.StrictMode> );

App.tsx
import { Amplify } from 'aws-amplify';

import { Authenticator } from '@aws-amplify/ui-react';
import '@aws-amplify/ui-react/styles.css';

import awsExports from './aws-exports';
Amplify.configure(awsExports);

export default function App() {
    return (
        <Authenticator>
            {({ signOut, user }) => (

Hello {user?.username}

                    <button onClick={signOut}>Sign out</button>

            )}
        </Authenticator>
    );
}

All I changed from https://ui.docs.amplify.aws/react/connected-components/authenticator was user.username to user?.username because I was getting an error Object is possible 'undefined'.

A: Turns out nothing was wrong with the code itself, rather the index.html and  vite config. To fix:
index.html, between
 and

in vite.config.ts add:
export default defineConfig({
    plugins: [react()],
    resolve: {
        alias: {
            './runtimeConfig': './runtimeConfig.browser',
        },
    },
});


text:
Q: I need the behavior of media queries to change layout inside individual divs The grid layout of my site changes relative to the width of the browser viewport by using CSS3 Media Queries.
But now I'm looking for a way to change layouts of specific blocks in my grid. So they behave differently relative to the width of their parent element.
For example, if the parent element is +500px wide, I can show titles with thumbnails, if the parent element is less than 500px wide, only titles are shown, in a bigger font-size.
If even possible, what's the best approach for this? Preferably without the use of JavaScript.
This approach should allow me to write one block of HTML that could be reused on any site, anywhere on a page, with or without a responsive layout.

A: if you're using media queries already, just add what you want to them;
regular css:
.parent .child .thumbnails,.parent .child .titles{display:block}  -500px
-500 px css:
@media only screen and (max-width :500px) { .parent .child .thumbnails{display:none;}


text:
Q: Using CMake with Eclipse CDT and Cygwin on Windows For a new project we want to use CMake. We are using Eclipse CDT as IDE and Cygwin gcc.
We generated the CMakeLists.txt and followed [this tutorial (option 2)][1].
When I try to run the described Make target to generate the Makefiles with CMake, which executes
cmake -E chdir C:/projects/eclipse_ws/MyApp/Build/ cmake -G "Unix Makefiles" ../ Run CMake

I get the error
CMake Error: The source directory "C:/projects/eclipse_ws/MyApp/Build/CMake" does not exist.

If I run the command directly from a Cygwin console it works just fine, however then I have to run make also from the Cygwin console, because the Makefiles are generated with Unix paths.
EDIT:
So I fixed this issue (see my answer below).
But I'm still having problems.
When I try to run CMake as Make target in Eclipse as suggested in the tutorial I get the following errors:
cmake -E chdir Build/ cmake -G 'Unix Makefiles' ../
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
System is unknown to cmake, create:
Platform/MINGW32_NT-6.1 to use this system, please send your config file to cmake@www.cmake.org so it can be added to cmake
Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please send that file to cmake@www.cmake.org.
-- Check for working C compiler: /usr/bin/gcc.exe
System is unknown to cmake, create:
Platform/MINGW32_NT-6.1 to use this system, please send your config file to cmake@www.cmake.org so it can be added to cmake
-- Check for working C compiler: /usr/bin/gcc.exe -- broken
CMake Error at /usr/share/cmake-2.8.9/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "/usr/bin/gcc.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: /cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles CMakeTmp

  Run Build Command:/usr/bin/make.exe "cmTryCompileExec726566634/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec726566634.dir/build.make
  CMakeFiles/cmTryCompileExec726566634.dir/build

  make[1]: Entering directory
  '/cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp'

  /usr/bin/cmake.exe -E cmake_progress_report
  /cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object
  CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj

  /usr/bin/gcc.exe -o
  CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj -c
  /cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp/testCCompiler.c

  CMakeFiles/cmTryCompileExec726566634.dir/build.make:60: recipe for target
  'CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj' failed

  make[1]: Leaving directory
  '/cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp'

  make[1]: *** [CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj]
  Error 1

  Makefile:117: recipe for target 'cmTryCompileExec726566634/fast' failed

  make: *** [cmTryCompileExec726566634/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!

Seems like for some reason CMake assumes I have an MinGW environment and not Cygwin.
EDIT2
MinGW system was assumed, because a Git installation was in PATH before Cygwin and Git's uname command was used (which returns MinGW).

A: If you check "Make Target - Same as the target name" in Eclipse's Make dialog, Eclipse will add a
Run CMake

to the command (see question), which is misinterpreted by CMake.
I just unchecked "Same as the target name".


text:
Q: dispose() not working. Opening new window while closing another one So I tried searching and I found an answer here: Java swing application, close one window and open another when button is clicked
I did the example given there and it worked just fine. But when I tried to put it in my code it's not working.
The objective of my program is to open a new window when a button is clicked. The program shows an error when dispose() is there but it still won't run when it's deleted. Is there any way to fix this? Or should I try using CardLayout?  Thanks in advance.
Here's my code:
HelpME.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class HelpME extends JPanel
                implements ActionListener{

private JButton PetrolStation=new JButton("Petrol Stations");
private JButton Food=new JButton("Foods");
private JButton Parking=new JButton("Parkings");
private JButton Coffee=new JButton ("Coffee");
private JButton Shopping=new JButton("Shoppings");
private JButton Pharmacies=new JButton("Pharmacies");
private JButton Supermarket=new JButton ("Supermarkets");
private JButton Hospital=new JButton ("Hospitals");
private JButton Hotel=new JButton ("Hotels");
private JButton OutdoorPark=new JButton ("Outdoor Parks");

public HelpME(){

    HelpME h = new HelpME();
    h.setLayout(new GridLayout(5,2));

    JFrame f = new JFrame("HelpMe");
    f.getContentPane().add(h);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setSize(460, 460);
    f.setVisible(true);
    f.setLocationRelativeTo(null);

    PetrolStation.addActionListener(this);
    Food.addActionListener(this);
    Food.setActionCommand("Foods");
    Parking.addActionListener(this);
    Coffee.addActionListener(this);
    Shopping.addActionListener(this);
    Pharmacies.addActionListener(this);
    Supermarket.addActionListener(this);
    Hospital.addActionListener(this);
    Hotel.addActionListener(this);
    OutdoorPark.addActionListener(this);

    add(PetrolStation);
    add(Food);
    add(Parking);
    add(Coffee);
    add(Shopping);
    add(Pharmacies);
    add(Supermarket);
    add(Hospital);
    add(Hotel);
    add(OutdoorPark);

}

@Override
public void actionPerformed(ActionEvent e) {
    String cmd = e.getActionCommand();

    if(cmd.equals("Foods"))
    {
        dispose();
        new SecondScreen();
    }

}

public static void main(String[] args) {

    SwingUtilities.invokeLater(new Runnable(){

        @Override
        public void run()
        {
            new HelpME().setVisible(true);
        }

    });
}

}

SecondScreen.Java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class SecondScreen extends JFrame {

public SecondScreen() {
    super("Location Finder");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    add(new JLabel("Empty JFrame"));
    pack();
    setVisible(true);
}
}

This is the error
Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:89)
at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:72)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javax.swing.UIDefaults.getUI(UIDefaults.java:769)
at javax.swing.UIManager.getUI(UIManager.java:1016)
at javax.swing.JPanel.updateUI(JPanel.java:126)
at javax.swing.JPanel.<init>(JPanel.java:86)
at javax.swing.JPanel.<init>(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:117)
at HelpME.<init>(HelpME.java:19)
at HelpME.<init>(HelpME.java:21)
at HelpME.<init>(HelpME.java:21)
at HelpME.<init>(HelpME.java:21)
at HelpME.<init>(HelpME.java:21)
at HelpME.<init>(HelpME.java:21)
at HelpME.<init>(HelpME.java:21)

This is how my first window should look like

A: Your constructor is inexplicably recursive:
public HelpME(){

    HelpME h = new HelpME();
    ...
}

Every time you you try it instantiate it, it will try to instantiate another one, which will try to instantiate another one, which will try to instantiate another one .... until your stack overflows.
You certainly want to get rid of
HelpME h = new HelpME();

and should probably change
h.setLayout(new GridLayout(5,2));

to
setLayout(new GridLayout(5,2));


text:
Q: How to know the test case failure reason in iOS? I'm running the unit tests and getting the result Test failed
Here is the exception I'm getting:
Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "SIGN-UP step1 with valid email & pw succeeds".

How can I define the failure reason?
Thanks in advance


text:
Q: Quantile Regression with Tensorflow Probability I am trying to give tensorflow probability a try. I have a simple quantile regression in R. I would like to get the same results from tensorflow probability.
R Quantile Regression
library("quantreg")
mtcars_url <- "https://gist.githubusercontent.com/seankross/a412dfbd88b3db70b74b/raw/5f23f993cd87c283ce766e7ac6b329ee7cc2e1d1/mtcars.csv"
mtcars <- readr::read_csv(mtcars_url)
rqfit <- rq(mpg ~ wt, data = mtcars, tau = seq(.1, .9, by = 0.1))
predict(rqfit, mtcars, interval = c("confidence"),
          level = .95)

The output for the above is 9 quantile predictions for each value
    tau= 0.1 tau= 0.2  tau= 0.3  tau= 0.4  tau= 0.5  tau= 0.6  tau= 0.7 tau= 0.8 tau= 0.9
1  20.493299 20.92800 21.238356 22.176471 22.338816 23.592283 24.475462 25.12302 27.97207
2  18.837113 19.33680 19.910959 20.938971 21.181250 22.313183 23.110731 23.78409 26.37404
3  22.441753 22.80000 22.800000 23.632353 23.700658 25.097106 26.081028 26.69824 29.85210
4  16.628866 17.21520 18.141096 19.288971 19.637829 20.607717 21.291089 21.99884 24.24333
5  15.167526 15.81120 16.969863 18.197059 18.616447 19.479100 20.086915 20.81743 22.83330
6  15.037629 15.68640 16.865753 18.100000 18.525658 19.378778 19.979877 20.71242 22.70797
7  14.323196 15.00000 16.293151 17.566176 18.026316 18.827010 19.391169 20.13484 22.01862
8  16.791237 17.37120 18.271233 19.410294 19.751316 20.733119 21.424886 22.13011 24.40000
9  17.051031 17.62080 18.479452 19.604412 19.932895 20.933762 21.638962 22.34014 24.65067
10 15.167526 15.81120 16.969863 18.197059 18.616447 19.479100 20.086915 20.81743 22.83330
11 15.167526 15.81120 16.969863 18.197059 18.616447 19.479100 20.086915 20.81743 22.83330
12 11.075773 11.88000 13.690411 15.139706 15.756579 16.318971 16.715226 17.50948 18.88523
13 13.284021 14.00160 15.460274 16.789706 17.300000 18.024437 18.534868 19.29472 21.01594
14 12.959278 13.68960 15.200000 16.547059 17.073026 17.773633 18.267273 19.03219 20.70260
15  3.411856  4.51680  7.547945  9.413235 10.400000 10.400000 10.400000 11.31363 11.49042
16  2.281753  3.43104  6.642192  8.568824  9.610132  9.527203  9.468772 10.40000 10.40000
17  2.794845  3.92400  7.053425  8.952206  9.968750  9.923473  9.891571 10.81481 10.89508
18 23.221134 23.54880 23.424658 24.214706 24.245395 25.699035 26.723254 27.32833 30.60412
19 27.020619 27.19920 26.469863 27.053676 26.900987 28.633441 29.854108 30.40000 34.27019
20 25.591753 25.82640 25.324658 25.986029 25.902303 27.529904 28.676693 29.24484 32.89150
21 21.500000 21.89520 22.045205 22.928676 23.042434 24.369775 25.305004 25.93689 28.94342
22 14.647938 15.31200 16.553425 17.808824 18.253289 19.077814 19.658764 20.39737 22.33196
23 15.200000 15.84240 16.995890 18.221324 18.639145 19.504180 20.113674 20.84369 22.86464
24 12.569588 13.31520 14.887671 16.255882 16.800658 17.472669 17.946160 18.71714 20.32659
25 12.537113 13.28400 14.861644 16.231618 16.777961 17.447588 17.919401 18.69089 20.29526
26 24.942268 25.20240 24.804110 25.500735 25.448355 27.028296 28.141504 28.71977 32.26482
27 23.610825 23.92320 23.736986 24.505882 24.517763 26.000000 27.044367 27.64337 30.98013
28 27.683093 27.83568 27.000822 27.548676 27.364013 29.145080 30.400000 30.93557 34.90940
29 16.921134 17.49600 18.375342 19.507353 19.842105 20.833441 21.531924 22.23513 24.52534
30 19.519072 19.99200 20.457534 21.448529 21.657895 22.839871 23.672679 24.33542 27.03205
31 14.323196 15.00000 16.293151 17.566176 18.026316 18.827010 19.391169 20.13484 22.01862
32 19.454124 19.92960 20.405479 21.400000 21.612500 22.789711 23.619160 24.28291 26.96938

Tensorflow Probability Try
# pip3 install tensorflow_probability must be installed
from pprint import pprint
import numpy as np
import pandas as pd
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
import termplotlib as tpl
np.set_printoptions(formatter={'float': lambda x: "{0:0.1f}".format(x)})

tf.enable_v2_behavior()
tfd = tfp.distributions
mtcars_url = "https://gist.githubusercontent.com/seankross/a412dfbd88b3db70b74b/raw/5f23f993cd87c283ce766e7ac6b329ee7cc2e1d1/mtcars.csv"
df_cars = pd.read_csv(mtcars_url)

y = df_cars.mpg
x = df_cars.wt
y = np.array(y)
x = np.array(x)
negloglik = lambda y, rv_y: -rv_y.log_prob(y)
model = tf.keras.Sequential([
      tf.keras.layers.Dense(1 + 1),
      tfp.layers.DistributionLambda(
            lambda t: tfd.Normal(loc=t[..., :1],
                                           scale=1e-3 + tf.math.softplus(0.05 * t[...,1:]))),
            ])

# Do inference.
model.compile(optimizer=tf.optimizers.Adam(learning_rate=0.01), loss=negloglik)
model.fit(x, y, epochs=1000, verbose=False);
# generate 40000 samples
n = 40000
yhat = model(np.array(x))
a = yhat.sample(n).numpy().reshape(32,n,1)

# check that the quantiles of the 40000 samples are similar to R script
quantiles = np.linspace(start=0.1, stop=0.9, num=9)
array_quants = np.quantile(a, q = quantiles, axis=1)
print(array_quants.reshape(32, 9))

The output here is:
[[13.2 13.3 13.2 13.2 13.2 13.2 13.2 13.2 13.2]
 [13.2 13.2 13.2 13.2 13.2 13.2 13.2 13.2 13.2]
 [13.2 13.2 13.2 13.2 13.2 13.2 13.2 13.2 13.2]
 [13.2 13.2 13.2 13.2 13.2 15.1 15.1 15.1 15.2]
 [15.1 15.1 15.2 15.2 15.2 15.2 15.1 15.2 15.2]
 [15.2 15.2 15.2 15.2 15.1 15.2 15.2 15.2 15.1]
 [15.2 15.2 15.2 15.2 15.2 15.2 15.1 15.1 15.2]
 [15.1 16.9 16.9 16.9 16.9 16.9 16.9 16.9 16.9]
 [16.9 16.9 16.9 16.9 16.9 16.9 16.9 16.9 16.9]
 [16.9 16.9 16.9 16.9 16.9 16.9 16.9 16.9 16.9]
 [16.9 16.9 16.9 16.9 16.9 16.9 18.3 18.3 18.3]
 [18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3]
 [18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3]
 [18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3]
 [18.3 18.3 19.4 19.3 19.4 19.4 19.4 19.4 19.3]
 [19.4 19.4 19.3 19.4 19.3 19.4 19.4 19.4 19.3]
 [19.4 19.4 19.4 19.3 19.4 19.4 19.4 19.3 19.4]
 [19.4 19.3 19.4 19.4 19.4 19.4 19.3 20.2 20.3]
 [20.2 20.2 20.2 20.3 20.2 20.2 20.2 20.2 20.2]
 [20.3 20.2 20.2 20.3 20.2 20.3 20.3 20.3 20.2]
 [20.3 20.3 20.3 20.2 20.2 20.3 20.2 20.3 20.3]
 [20.3 20.3 20.2 21.1 21.1 21.1 21.1 21.1 21.2]
 [21.1 21.1 21.1 21.1 21.1 21.1 21.1 21.1 21.1]
 [21.1 21.2 21.2 21.1 21.1 21.1 21.1 21.2 21.1]
 [21.1 21.2 21.2 21.1 21.1 21.1 21.2 21.1 22.2]
 [22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2]
 [22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.2]
 [22.2 22.2 22.2 22.2 22.2 22.2 22.2 22.3 22.2]
 [22.2 22.2 22.2 22.2 24.9 24.9 24.9 24.9 24.9]
 [24.8 24.9 24.9 24.9 24.9 24.8 24.9 24.8 24.9]
 [24.9 24.9 24.9 24.9 24.9 24.9 24.9 24.9 24.9]
 [24.9 24.9 24.9 24.9 24.9 24.8 24.9 24.8 24.9]]

I am still learning TFP so I am sure there is some simple mistake I made in the model specification, but it is not currently obvious to me what that mistake is.

A: Try to adjust the learning rate and see if the model converges correctly. Also, with the reshape function in your code, you probably intended to do a transpose. With a learning rate of 1.0 and some code fixes, this is what I got:
>>> n = 1000
>>> a = yhat.sample(n)[:,:,0].numpy().T
>>> quantiles = np.linspace(start=0.1, stop=0.9, num=9)
>>> array_quants = np.quantile(a, q = quantiles, axis=1)
>>> np.round(array_quants.T,1)
array([[18.1, 19.8, 21.1, 22. , 23.1, 24.2, 25.4, 26.5, 28. ],
       [16.6, 18.4, 19.8, 21. , 21.8, 23. , 24.3, 25.7, 27.4],
       [19.9, 21.5, 22.9, 23.8, 24.7, 25.6, 26.6, 28. , 29.4],
       [14.2, 16.1, 17.7, 19.1, 20.3, 21.5, 22.7, 24.4, 26.4],
       [12.8, 15. , 16.4, 17.7, 19. , 20.3, 21.8, 23.4, 25.4],
       [12.3, 14.6, 16.3, 17.7, 19. , 20.2, 21.7, 23.2, 25.2],
       [12.1, 14.5, 16.2, 17.3, 18.6, 19.7, 21.3, 23. , 25.1],
       [14.6, 16.3, 17.5, 19.1, 20.4, 21.6, 22.9, 24.2, 26.6],
       [14.9, 17. , 18.4, 19.5, 20.5, 21.7, 22.9, 24.4, 26.5],
       [13.1, 15.2, 17. , 18.2, 19.3, 20.6, 21.9, 23.4, 25.4],
       [12.9, 15. , 16.7, 18.2, 19.4, 20.7, 22. , 23.6, 25.7],
       [ 8.7, 11.6, 13.3, 14.5, 16.1, 17.5, 19. , 20.8, 23. ],
       [10.7, 13.3, 15.1, 16.5, 17.7, 19.1, 20.6, 22.3, 24.3],
       [11.1, 13.3, 14.9, 16.3, 17.4, 18.9, 20.4, 21.9, 24.1],
       [ 2. ,  5. ,  7.1,  8.6, 10.2, 11.9, 13.4, 15.9, 18.6],
       [-0.1,  3.9,  6.1,  8. ,  9.7, 11.6, 13.5, 15.5, 17.9],
       [ 0.3,  3.9,  6.3,  8.1,  9.8, 11.5, 13.1, 15.4, 18.4],
       [20.6, 22.3, 23.3, 24.3, 25.2, 26.2, 27.2, 28.3, 30. ],
       [24.2, 25.6, 26.6, 27.6, 28.3, 29.2, 30. , 30.8, 32. ],
       [22.7, 24.1, 25.1, 26.1, 26.9, 27.9, 28.8, 29.9, 31.3],
       [19. , 20.9, 22. , 23.3, 24. , 25. , 26. , 27.4, 29.1],
       [12.4, 14.6, 16.3, 17.7, 18.9, 20. , 21.5, 23.1, 25.7],
       [13.2, 15.3, 16.8, 18.2, 19.2, 20.5, 22. , 23.4, 25.4],
       [10.5, 13.1, 14.9, 16.2, 17.4, 18.6, 20.1, 21.9, 24.3],
       [10.3, 12.7, 14.4, 15.8, 17.4, 18.7, 20. , 21.9, 24.3],
       [22.4, 23.9, 24.9, 25.8, 26.6, 27.5, 28.3, 29.3, 30.8],
       [21.1, 22.6, 23.6, 24.5, 25.5, 26.3, 27.2, 28. , 29.6],
       [25.1, 26.3, 27.2, 28. , 28.7, 29.4, 30.1, 31. , 32.3],
       [14.4, 16.3, 17.7, 18.9, 20. , 21.3, 22.7, 24.2, 26.5],
       [16.9, 18.8, 20.2, 21.2, 22.5, 23.5, 24.6, 25.8, 27.5],
       [12.4, 14.7, 16.1, 17.5, 18.7, 20. , 21.5, 23.1, 25.3],
       [16.8, 18.7, 20. , 21.2, 22.5, 23.5, 24.6, 26.3, 28.1]])


text:
Q: Why is Visual Studio not displaying correct autoCompletion suggestions I am using Unity with Visual Studio Code. However, VS Code is not giving me correct autocompletion suggestion. Below is a snippet of what it displays

Once I select any of the suggestions, I am getting this :

Anyone ever experienced the same? How can I get correct suggestions.

A: In Visual Studio: Tools -> Options -> Intellicode set to C#
In Unity: Edit -> Preferences -> External Script Editor, link up your Visual Studio

A: If you need go to the tools move to the options and then set the lang to C#
And also you have to link up your Visual Studio to the unity software
You can do that by going to the
Edit - preferences and external script editor the you can link up your visual studio


text:
Q: java.sql.SQLException: ORA-03115: unsupported network datatype or representation I'm Using Oracle 11g database. When i try to access data from db it was showing the error java.sql.SQLException: ORA-03115: unsupported network datatype or representation. I'm not understanding what this error means..
my code is :
 String uname,pass;
    ResultSet rs = null;
    response.setContentType("text/html");
    PrintWriter out=response.getWriter();
  try
  {
    uname=request.getParameter("uname");
    pass=request.getParameter("pass");
    Connection con=prepareConnection();
    String Query="select uname from passmanager where pass=?";
    PreparedStatement ps=con.prepareStatement(Query);
    ps.setString(1,pass);
    rs=ps.executeQuery(Query);
    if (rs.next() && uname.equalsIgnoreCase(rs.getString("uname")) || uname.equalsIgnoreCase(rs.getString("email"))) {
    HttpSession session = request.getSession(true);
    session.setAttribute("uname", rs.getString(1));

    ServletContext context = getServletContext();
    RequestDispatcher dispatcher = context
                    .getRequestDispatcher("/profile");
    dispatcher.forward(request, response);
  }

Any one help me to solve this problem..

A: Instead of:
rs = ps.executeQuery(Query);

you should execute:
rs = ps.executeQuery();

Otherwise, you unprepare your statement and lose all parameters because you assign it a new SQL statement (even though it's the same).

A: Add email column
select uname, email from passmanager where pass=?

A: This error appears when you try to get a field by name ( rs.getString("uname") in your case) which is not in the resultset.
And like igr said, you are trying to get the email field ( with rs.getString("email") ) and it's not in the query, so this is your error.
I found this conversation because I was getting the same error in an application when I was trying to get a field with an whitespace at the end of the string ( rs.getString("uname ") instead of rs.getString("uname" ).
And I just fix it using the correct name for the field I was getting from the query.
I hope it is useful! ;)


text:
Q: Como usar função WHERE em coluna criada a partir de uma formula? Escrevi esse código:
SELECT produtos.id AS id,
nome_produto AS Nome,
SUM(estoque.Estoque_produto) AS Estoque,
Periodicidade AS Periodicidade,
produtos.estoquemax_produto AS 'Média de venda mensal',
IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto * 2, 'Muito alto', IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto , 'Alto', IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto / IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) *0.5, 'Bom', IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto / IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) * 0.3, 'Baixo', IF(SUM(estoque.Estoque_produto) >  0, 'Crítico', 'Zerado'))))) AS Estado,
precos.Custo_produto AS Custo,
produtos.fornecedor_principal AS Fornecedor,
Descricao_produto AS 'Marca/Laboratório',
grupos_prod.Nome_grupo AS Grupo,
subgrupos.Nome AS Subgrupo

FROM genius.produtos
JOIN produtos_estoque AS estoque ON produtos.id = estoque.id_produto
JOIN produtos_precos AS precos ON produtos.id = precos.id_produto
JOIN subgruposprodutos AS subgrupos ON produtos.Id_grupo = subgrupos.Id
JOIN grupos_produtos AS grupos_prod ON subgrupos.id_grupo = grupos_prod.Id
WHERE Estado = 'Alto'
GROUP BY Id;

Quando eu executo ele me retorna o erro :

Error Code: 1054. Unknown column 'Estado' in 'where clause'

O problema é que a coluna Estado é dada como resultado dessa parte :
IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto * 2, 'Muito alto',
IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto , 'Alto',
IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto /
IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) *0.5, 'Bom',
IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto /
IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) * 0.3, 'Baixo',
IF(SUM(estoque.Estoque_produto) >  0, 'Crítico', 'Zerado'))))) AS Estado,

ou seja, é resultado de uma formula e não de uma coluna de uma tabela do BD. e o problema só apareceu quando eu usei o:
WHERE Estado = 'Alto'

Alguém sabe como resolver isso?

A: Faça um subselect, sua coluna Estado , ainda não existe dentro do contexto que você esta criando, ou seja ela é a composição da linha.
IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto * 2, 'Muito alto',
IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto , 'Alto',
IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto /
IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) *0.5, 'Bom',
IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto /
IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) * 0.3, 'Baixo',
IF(SUM(estoque.Estoque_produto) >  0, 'Crítico', 'Zerado'))))) AS Estado,

essa (coluna/valor) só existe dentro do seu select, para você acessa-los você tem que criar um subselect depois usar em um where.
select * from
(
    SELECT produtos.id AS id,
    nome_produto AS Nome,
    SUM(estoque.Estoque_produto) AS Estoque,
    Periodicidade AS Periodicidade,
    produtos.estoquemax_produto AS 'Média de venda mensal',
    IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto * 2, 'Muito alto', IF(SUM(estoque.Estoque_produto) > produtos.estoquemax_produto , 'Alto', IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto / IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) *0.5, 'Bom', IF(SUM(estoque.Estoque_produto) > (produtos.estoquemax_produto / IF(Periodicidade = 'M' , 1 , IF(Periodicidade = 'Q' , 2 , 4))) * 0.3, 'Baixo', IF(SUM(estoque.Estoque_produto) >  0, 'Crítico', 'Zerado'))))) AS Estado,
    precos.Custo_produto AS Custo,
    produtos.fornecedor_principal AS Fornecedor,
    Descricao_produto AS 'Marca/Laboratório',
    grupos_prod.Nome_grupo AS Grupo,
    subgrupos.Nome AS Subgrupo

    FROM genius.produtos
    JOIN produtos_estoque AS estoque ON produtos.id = estoque.id_produto
    JOIN produtos_precos AS precos ON produtos.id = precos.id_produto
    JOIN subgruposprodutos AS subgrupos ON produtos.Id_grupo = subgrupos.Id
    JOIN grupos_produtos AS grupos_prod ON subgrupos.id_grupo = grupos_prod.Id
    GROUP BY Id
)d
WHERE d.Estado = 'Alto'

A: Atribua a cláusula WHERE dentro dos testes que você faz antes de atribuir o alias.
acredito que isso funcionara.


text:
Q: Normal Distribution and Iterated Logarithm Let $X_n$ be independent $N(0, \sigma^2)$-distributed random variables with partial sum $S_n := \sum_{k=1}^n X_k$, $n \geq 1$. Then I read the following results.
$$
\sum_{k = 1}^n \mathbb P (S_n > \epsilon\sqrt{n\log\log n}) \sim \sum_{k = 1}^n \frac{\sigma}{\epsilon\sqrt{\log\log n}} (\log n)^{-\frac{\epsilon^2}{2\sigma^2}} = \infty,
$$
for any $\epsilon > 0$. I do not know how these results are derived. To be specific,

*

*How to get the first approximation, please?

*How to know the second series does not converge, please? I tried to apply ratio test, but I got the limit is 1 which is not helpful. Could anyone help me, please? Thank you!

Update of the first question:
By the answer provided below, one has $$\mathbb P(S_n > \epsilon\sqrt{n\log\log n}) = \mathbb P\left(Z > \frac{\epsilon}{\sigma} \sqrt{\log\log n}\right) \leq \frac{1}{\sqrt{2\pi}}\frac{\sigma}{\epsilon\sqrt{\log\log n}} (\log n)^{-\frac{\epsilon^2}{2\sigma^2}}.$$ Then how to get $$\lim_{n \to \infty} \frac{\mathbb P\left(Z > \frac{\epsilon}{\sigma} \sqrt{\log\log n}\right)}{\frac{\sigma}{\epsilon\sqrt{\log\log n}} (\log n)^{-\frac{\epsilon^2}{2\sigma^2}}} = 1,$$ please? Thanks.

A: *

*Using independence, we obtain that
$$\mu\{S_n>\varepsilon\sqrt{n\log\log n}\}=\mu\{N>\varepsilon\sqrt{\log \log n}/\sigma\},$$
where the distribution of $N$ is standard normal. So we are reduce to estimates on the tail function of a standard normal distribution. We can use the equivalent
$$\mu\{|N|>x\sqrt 2\}\overset{x\to +\infty}{\sim}\frac 1{x\sqrt{\pi}}\exp(-x^2).$$

*Notice that for each positive $p$ the series $\sum_{n=1}^\infty(\log n)^{-p}$ is divergent. Indeed, $\sum_{n=N+1}^{2N}(\log n)^{-p}\geqslant N(\log(2N))^{-p}$.


text:
Q: Intentionally freezing Windows for a second I'm currently debugging a small problem in a software that happened when the Computer froze for a moment (I was rummaging around, deleting files etc. and the OS just froze momentarily).
I am now trying to freeze the Computer intentionally for a second or so, but it's harder than I thought. Just hogging the CPU with a bunch of hard-working threads doesn't do it as the OS obviously still handles the scheduling fine.
Can someone name a way to induce such a system-wide short freeze of all OS activity? Is there a specific resource I can hog in a software or combination thereof?
It's quite hard to google, as anyone is trying to solve something like that, not induce it. :-)
OS is Windows 10 Pro, 64 bit.

A: Instead of freezing the whole system I reverted to suspending the individual process by suspending the processes threads for short periods of time in order to simulate the system freezing for a moment.


text:
Q: Angular: Disabling/Enabling a button in a component not working as expected I have a component that emits an event when a checkbox is clicked. This particular component is inside another component with a button, which needs to be disabled at first and it should be enabled when someone checks the checkboxes. This component is in a ngFor. So there will be a couple of components with checkboxes and a button.
Checking a checkbox is enabling all the buttons of other components as well. I am not sure why this is happening. Any one had this before?
The component looks like this

<app-group [selection]="selection" (filterChanged)="onFilterChange()" >
</app-group>

  <button (click)="save()" [disabled]="disableSaveBtn">
      Save
  </button>

The parent component looks like this

<ng-container *ngFor="let group of groups; let i = index">
    <app-savable-group (filterChanged)="onFilterChange($event)">
    </app-savable-group>
</ng-container>


text:
Q: What is a suitable choice of form for $Y(t)$ for the following nonhomogeneous differential equation? What is a suitable choice of form for $Y(t)$ for the following nonhomogeneous differential equation?
$(a). y''-8y'+20y=7t^3e^{4t}\sin (2t)-t^2e^{4t}-9\\
(b). y''-8y'+16 y=7t^3e^{4t}\sin (2t)-t^2e^{4t}-9$
My idea
for (a) the corresponding homogeneous equation is $y''-8y'+20y=0$
So the axuilary equaton is $m^2-8m+20=0 \Rightarrow m= 4\pm2i$
then $y_c=e^{4t}(c_1\cos (2t)+c_2 \sin (2t))$ how to we find $y_p$ using $y_c$
thank you...

A: Little hint for b
$$(b). y''-8y'+16 y=7t^3e^{4t}\sin (2t)-t^2e^{4t}-9$$
$$(b). (y''-4y') -4(y'-4y) =7t^3e^{4t}\sin (2t)-t^2e^{4t}-9$$
Substitute $z=y'-4y$
$$z' -4z =7t^3e^{4t}\sin (2t)-t^2e^{4t}-9$$
$$(ze^{-4t})' =e^{-4t}(7t^3e^{4t}\sin (2t)-t^2e^{4t}-9)$$
$$(ze^{-4t})' =-9e^{-4t}+7t^3\sin (2t)-t^2$$
$$ze^{-4t} =\int -9e^{-4t}+7t^3\sin (2t)-t^2dt $$
$$y'-4y=e^{4t}\int -9e^{-4t}+7t^3\sin (2t)-t^2dt $$
$$(ye^{-4t})'=\int -9e^{-4t}+7t^3\sin (2t)-t^2dt $$
$$(ye^{-4t})'=\frac  94 e^{-4t}- \frac {t^3} 3+7\int t^3\sin (2t)dt+K_1 $$
Evaluate the last integral and you are almost done...
$$I=\int t^3\sin (2t)dt= ? $$
$$............$$


text:
Q: How I can rename file name when I share PDF base64 string via UIActivityViewController in IOS I got PDF base64 string from server, It looks like this:

"data:application/pdf;base64,JVBERi0x...."

Now I would like to share this file. I am using Cordova social share plugin, it works well.
But how can I assign the file name? now, it only shows default name like "PDF document.pdf"
//activityItems is the base64 string
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];

A: You have two option to do this functionality.
1) You can Rename your file in Document Directory.
2) You can change your file name when you are going to save it in Document Directory.
1) How to change the filename in Document Directory:
- (BOOL)renameFileFrom:(NSString*)oldName to:(NSString *)newName
{
    NSString *documentDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
                                                   NSUserDomainMask, YES) objectAtIndex:0];
    NSString *oldPath = [documentDir stringByAppendingPathComponent:oldName];
    NSString *newPath = [documentDir stringByAppendingPathComponent:newName];

    NSFileManager *fileMan = [NSFileManager defaultManager];
    NSError *error = nil;
    if (![fileMan moveItemAtPath:oldPath toPath:newPath error:&error])
    {
        NSLog(@"Failed to move '%@' to '%@': %@", oldPath, newPath, [error localizedDescription]);
        return NO;
    }
    return YES;
}

2) How to change the filename at the time of save File into Document Directory:
- (NSURL *)applicationDocumentsDirectory {
    return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
         inDomains:NSUserDomainMask] lastObject];
}

NSString *path = [[self applicationDocumentsDirectory].path
                       stringByAppendingPathComponent:@"fileName.pdf"];
[sampleText writeToFile:path atomically:YES
                       encoding:NSUTF8StringEncoding error:nil];

A: Save the file from URL to a temp directory and then use it in the UIActivityViewController
let temporaryDir = FileManager.default.temporaryDirectory
let tempFilePath = temporaryDir.appendingPathComponent(pass the file name you want to show here)
do {
    try? Data(contentsOf: pass the file URL here).write(to: tempFilePath, options: .atomic)
  }

let activityViewController = UIActivityViewController(activityItems:  [tempFilePath], applicationActivities: nil)
present(activityViewController, animated: true, completion: nil)


text:
Q: jquery settings with default and multiple instances I've made a jQuery plugin and it works pretty much ok. Except that when I have multiple instances on the same page the last instance's options/settings are used for both.
Here's a stripped down version of it... sorry for the length.
(function() {

    var settings = {};
    var defaults = {
        duration : 1000,
        easingShow : 'easeOutBounce',
        easingHide : 'easeOutQuad'
    };

    var methods = {
        init : function(options) {

            return this.each(function(n) {

                settings = $.extend(defaults, options);

            });

        },

        show : function() {

            // settings used here
        },

        hide : function() {
            // also used here
        }
    };

    $.fn.expander = function(method) {

        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
            return methods.init.apply(this, arguments);
        } else {
            $.error('Method ' + method + ' does not exist on jQuery.expander');
        }

    };

})(jQuery);

I'm sure it's some kind of namespace issue, as I get confused by that often.
Thanks

A: use
settings = $.extend(true, {}, defaults, options);

from jquery docs @ http://api.jquery.com/jQuery.extend/

deep     If true, the merge becomes recursive (aka. deep copy).
target   The object to extend. It will receive the new properties.
object1  An object containing additional properties to merge in.
objectN  Additional objects containing properties to merge in.

Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend(). If, however, we want to preserve both of the original objects, we can do so by passing an empty object as the target.

To have different settings per element, you can store them at each element using .data()
Check out a working demo: http://jsfiddle.net/roberkules/XvKs8/


text:
Q: What term means "the sum of a person"? Some will say that "the sum of a person" includes:

*

*Actions.

*Character, virtues.

*Experiences, memories.

*Abilities.

Is there a single term to mean this?

A: It is called personality.

The totality of qualities and traits, as of character or behavior, that are peculiar to a specific person.
(Psychology) psychol the sum total of all the behavioural and mental characteristics by means of which an individual is recognized as being unique
thefreedictionary.com

As you opened a bounty, you might be looking for something beyond personality. Then, we have to go beyond the usual vocabulary and enter the realm of philosophy and ontology.
There is quiddity:

the essential nature or quality of something that makes it different and distinct from other things and establishes its identity

thefreedictionary.com

and a similar term in meaning, haecceity:

the essence that makes something the kind of thing it is and makes it different from any other

thefreedictionary.com

There are various similar terms; and thoughts of philosophers on these terms.
Wikipedia adds that:

While terms such as haecceity, quiddity, noumenon and hypokeimenon all evoke the essence of a thing, they each have subtle differences and refer to different aspects of the thing's essence.

In conclusion, it all comes to the same thing, essence; but in my opinion, personality encompasses the essence. Essence is what you are born into but personality is what you become.

A: I would have to make a vote for the "Self".
The "Self" is the sum of a person's characteristics, traits, etc.
You refer to yourself, myself, himself, herself, etc. as a stand-in for people's existence.
It is the essence of being personified.  (Although, if you weren't seeking a one-word answer, I'd vote for that phrase . . . It rolls off the tongue nicely.)
There is an excellent article on Wikipedia about the Philosophy of Self.
And one from About.com

A: My suggestion is nature. From the Collins Online dictionary, one of its primary meanings is

1.the fundamental qualities of a person or thing; identity or essential character

but it also has the meanings of tendencies of behaviour, disposition and temperament.

A: Consider the term gestalt.  American Heritage defines it as

A physical, biological, psychological, or symbolic configuration or pattern of elements so unified as a whole that its properties cannot be derived from a simple summation of its parts.

Merriam-Webster adds

broadly : the general quality or character of something

It has been appropriated directly from German, meaning

shape, form, figure, configuration, appearance

As currently used, especially in psychology, the term conveys more than merely a collection recitation of all of the discrete elements that go into system (whether that be an individual or some other complex mechanism).
I think that the question carries an implication that the sum of a person is more that a simple compilation of elements.

A: The thing that separates persons from all other animals is our ability to view the world in the past, present and future. This ability allows us to learn from our past mistakes, progress in the present and imagine the future. I would suggest a word to be "Human Being".

A: I would say: "yourself/myself"
That should cover all, even if is not that romantical.

A: Isn't this "spirit" (the nonphysical part of a person that is the seat of emotions and character)?

A: There is the idiomatic phrase whole package. Referring to the whole package when describing a person would be to refer to all of their attributes.
Here is an example of how it might be used:

When you choose your mate, you get the whole package - all the good qualities and the bad, the sum of their life experiences, all of their strengths and all of their weaknesses.

There are also a couple of variants, such as total package and complete package. Generally calling someone the total package is to describe them as someone who has all of the best qualities.
If you are looking for a single word, you might consider just package. The previous example be rewritten like this:

When you choose your mate, you get a package - that package consists of all the good qualities and the bad, the sum of their life experiences, all of their strengths and all of their weaknesses.

A: I think psyche fits nicely your definition ("pyche is the totality of the human mind, conscious, and unconscious"), and to a lesser degree soul.


text:
Q: finding the probability that last ball picked up is white from bag of 5 balls consider a bag which contains 5 balls of which 3 are red and 2 are white. Balls are randomly removed one at a time without replacement until all red red balls are drawn or until all white balls are drawn. What is the probability that last ball drawn is white color?
can someone explain how to solve this question please!
The given answer is 6/10.
I have made out possible cases where we draw 1)red,red,red (red=R and white =W)
2)RWRW
3)WW
4)WRW
5)RRWR
All of the above are total possible cases where we stop draw all red balls or all white balls and then stop drawing out more balls.
Then I have calculated the sample space  of the event we need by adding up all possible outcomes from above possibilities, but i got struck there, I wasnt able to get correct sample space. When added up all of them i am getting an decimal value for sample spcae. although i guess i might have done some calculation mistake! can someone help me solve this.

A: Here's an easy way to see the answer.  Number the balls and list all $120$ possible orders.  Start selecting your order by choosing the last ball to be drawn.  It will be red $\frac 35$ of the time and white $\frac 25$ of the time, so the last ball to be drawn will be white with probability $\frac 35$ and it will be red with probability $\frac 25$.

A: Method $1$:
There are $6$ situations where the last ball is white: $WW, WRW, RWW, RRWW, RWRW, WRRW$.
Hence, $P = \frac{2 \times 1}{5 \times 4} + 2(\frac{3 \times 2 \times 1}{5 \times 4 \times 3}) + 3(\frac{3 \times 2 \times 2 \times 1}{5 \times 4 \times 3 \times 2}) = \frac{6}{10}$.
$$$$
Method $2$:
There are $6$ situations where the last ball is white: $WW, WRW, RWW, RRWW, RWRW, WRRW$.
There are $4$ situations where the last ball is red: $RRR, RWRR, WRRR, RRWR$.
Hence, $P = \frac{6}{6 + 4} = \frac{6}{10}$.
$$$$
Note $1$: By computing the probabilities of each of the situations, we can see that they are all equally likely, thus validating method $2$.
Note $2$: If you use the brute force approach, try to be systematic. If you notice above, the combinations listed progressively increase in the number of balls.


text:
Q: How to create new dataframe with only rows that have been changed in the another dataframe? I want to create a new csv file with only rows that have been changed.

The conditions are:
import pandas as pd
df = pd.read_csv("sample.csv", delimiter='')

df['Part Number'] = df['Part Number'].astype(str).str.replace('+','-PLUS')
df['Part Number'] = df['Part Number'].astype(str).str.replace('/','-SLASH-')
df['Part Number'] = df['Part Number'].astype(str).str.replace('\\','-SLASH-')
df['Part Number'] = df['Part Number'].astype(str).str.replace(' ','-')
df['Part Number'] = df['Part Number'].astype(str).str.replace('_','-')
df['Part Number'] = df['Part Number'].astype(str).str.replace('.','-')
df['Part Number'] = df['Part Number'].astype(str).str.replace('"','')
df['Part Number'] = df['Part Number'].astype(str).str.replace('(','')
df['Part Number'] = df['Part Number'].astype(str).str.replace(')','')
df['Part Number'] = df['Part Number'].astype(str).str.replace('%','-')
# It can be more these are examples.

Now I want to create new dataframes as:
This should only list the rows where the part number has been replaced.

A: Try storing the original values and comparing them later:
original = df['Part Number'].copy()

#...Changes happen here...

new_df = df[df['Part Number'] != original].join(original, rsuffix = " Changed")

A: As the two answer above addressed well the question, by curious, I make a small simulation of data and compare the run time of the two approaches. I post it here in case it may be useful for someone else.
executing time for a dataframe of shape (400000, 2):

*

*executed in 17.8s, finished 09:24:38 2021-01-14

*executed in 17.5s, finished 09:24:56 2021-01-14

So basically, the executing time is comparable.
Thanks Pablo C and Jezrael for sharing. Kr.
Method proposed by Pablo C:
import pandas as pd

df = pd.DataFrame({'Part Number': ['aa', 'bb'], 'other':[1, 2]})
# print(df)
df = pd.concat([df] * 200000, ignore_index=True)

original = df['Part Number'].copy()

#...Changes happen here...
df['Part Number'] = df['Part Number'].apply(lambda x: "ab" if "aa" in x else x)

#print('after change', df)
new_df = df[df['Part Number'] != original].copy()
print( new_df.head(3))

  Part Number  other
0          ab      1
2          ab      1
4          ab      1

Method proposed by Jezrael:
df = pd.DataFrame({'Part Number': ['aa', 'bb'], 'other':[1, 2]})
df = pd.concat([df] * 200000, ignore_index=True)
# print(df)
orig = df['Part Number'].astype(str)

#...Changes happen here...
df['Part Number'] = df['Part Number'].apply(lambda x: "ab" if "aa" in x else x)

df1 = df[orig.str.contains('|'.join(d1.keys()))]
print(df1.head(3))

  Part Number  other
0          ab      1
2          ab      1
4          ab      1

A: This worked for me taking reference from Pablo C:
import pandas as pd
df = pd.read_csv('sample.csv')
original = df['Part Number'].copy()

final_df = df.reindex(['ID','Part Number','Changed Part Number'],axis=1)
df['Part Number']= df['Part Number'].astype(str).str.replace('=', 'Equals')
final_df['Changed Part Number'] = final_df['Changed Part Number'].fillna(df['Part Number'])

new_df = final_df[df['Part Number'] != original].copy()
new_df

A: First you can simplify replacement by create dictionary,  escape regex in dictioanry comprehension and pass to Series.replace:
df = pd.DataFrame({'Part Number':['8/()2-2','3+/5==3-\\5[]',
                                '3-]%[ [";','5']})

import re

d = {'+':'-PLUS',
     '/':'-SLASH-',
     '\\':'-SLASH-',
     ' ':'-',
     '_':'-',
     '.':'-',
    '"':'',
    '(':'',
    ')':'',
    '%':'-'
}

d1 = {rf"{re.escape(k)}":v for k, v in d.items()}

orig = df['Part Number'].astype(str)
df['Part Number'] = orig.replace(d1, regex=True)
print (df)
                    Part Number
0                   8-SLASH-2-2
1  3-PLUS-SLASH-5==3--SLASH-5[]
2                      3-]-[-[;
3                             5

And then for filter replaced rows in boolean indexing with Series.ne:
df1 = df.assign(Original = orig)[df['Part Number'].ne(orig)]
print (df1)
                    Part Number      Original
0                   8-SLASH-2-2       8/()2-2
1  3-PLUS-SLASH-5==3--SLASH-5[]  3+/5==3-\5[]
2                      3-]-[-[;     3-]%[ [";


text:
Q: Объединение двух видео Не могу разобраться с этим кодом. Что мне с ним делать, чтобы я мог объединить два видео?
A:
Что мне с ним делать, чтобы я мог
объединить два видео?

Если просто с помощью ffmpeg и командной строки объединить видео, то можно использовать параметр concat.
Например, объединяем несколько эпизодов из DVD-диска в один файл, чтобы потом сконвертировать их в какой-нибудь другой формат.
ffmpeg -i concat:"VTS_02_1.VOB|VTS_02_2.VOB|VTS_02_3.VOB" -vcodec copy -acodec copy "VIDEO.VOB"


text:
Q: How to clear all checkbox When checkbox id="checkAll" are checked? How to clear all checkbox When checkbox id="checkAll" are checked ?
in my demo , when user checked checkbox id="checkAll" all checkbox are checked
But i want to apply to , when user checked checkbox id="checkAll" all checkbox are clear , How can i do ?
http://jsfiddle.net/peap/sydzL8Lc/1/
$('#checkAll').click(function () {
     $('input:checkbox').prop('checked', this.checked);
 });

A: You can use change() function and it you can check by using this.checked inside the change event, it will return boolean value for checkbox checked status :
Check All on Main Checked:
$('#checkAll').change(function () {
   $('input:checkbox').prop('checked', this.checked); // all checked on check of #checkAll
 });

Uncheck All on Main Checked:
$('#checkAll').change(function () {
    $('input:checkbox').prop('checked', !this.checked);   // all unchecked on check of #checkAll
     });

if you want all unchecked but no the main check box then:
Uncheck All Excluding the Main:
$('#checkAll').change(function () {
    $('input:checkbox').not(this).prop('checked', !this.checked);   // all unchecked on check of #checkAll but not itself
         });

A: Just apply the negation of this.checked
$('#checkAll').change(function () {
     $('input:checkbox').not(this).prop('checked', !this.checked);
 });

Demo

A: If I'm understanding you correctly, you want to clear all the items when they click "Check All" - you might want to change the name to "Clear All" for clarity.
If so, just add a simple ! in front of this.checked

$('#checkAll').click(function () {
      $('input:checkbox').prop('checked', !this.checked);
  });

A: You shouldn't use the same ID for multiple elements, since IDs are unique. Instead use class="checkedItem".
If you want to clear all use
$('#checkAll').click(function () {
    $('input:checkbox').prop('checked', !this.checked);
});

However this also clears the first checkbox. To prevent this use
$('#checkAll').click(function () {
    $('input:checkbox').not(this).prop('checked', !this.checked);
});


text:
Q: Table top town used by advertisers A man begins to suspect there is something wrong in his city, in which, we notice, product offers are repeatedly made to him.  The denouement is that the town all died in an industrial accident and their spirits are being used in an advertising experiment, and they are living in a table top model of the town.
I am looking for the name of this episode from the TV Show Twilight Zone.

A: The Tunnel under the World.
It originally appeared as a short story in Galaxy magazine. Since then it has appeared in several TV and film versions, including a Season 2 episode of Out of the Unknown.
Details which match your synopsis:

*

*product offers / adverts: yest for a variety of products, often with loud jingles

*rebuilt in miniture

*not spirits as such but rebuilt as tiny robots

For bonus points, "How would I know if I were a 1 mm tall robot?"


text:
Q: Proving that induction works for von Neuman's construction of naturals I have read on a number of books and other references that the von Neumann ordinals -- the model for ${\mathbb N}$  in which zero is $\emptyset$ and $s(n)=n\cup\{n\}$ -- satisfy all Peano axioms. I can work out the proofs for axioms 1-4, but how would I prove that the induction axiom works on such construction without using induction itself?
Is it OK to use induction, since it's metalanguage anyway?


text:
Q: prepend a html include ng-click in angularjs within function I have a problem to activate ng-click in prepend html using angularjs. I found an answer which helps solving almost same problem as mine which is include ng-click in apppended html when loaded as controller (http://next.plnkr.co/edit/5kjo8u7Qiyw6KHFO1jkh?p=preview&preview). the difference is :
I'm trigerring the prepend using a function in my controller so the user will click a button which open a modal. User will see the item list and choose few item within the popup modal.
If user clicked the item the item will be prepend to other html within same page(main page which is not in the pop-up modal) and the selected item will be disabled to prepend.
So far i could do it until this step
But i want to have a feature which enable user to delete the selected item in main page and make the deleted item available in pop-up modal again.
So how could i include/activate my ng-click in my prepend which locate in my function controller. I want to trigger MyFunc2 in my code.
Angular js:
app.controller('myCtrl', ['$scope', function($scope,$compile) {

$scope.myFunc = function(itemName,data1) {
var myEl = angular.element( document.querySelector( '#divID' ) );
var html="<button ng-click='myFunc2()'>"+itemName+"</button>";
myEl.prepend(html);
};

$scope.myFunc2 = function() {
alert("a");
};
});

My html which trigger the angular

    <link rel="stylesheet" href="lib/style.css">

      <button class="btn btn-success" type="button" ng-click="myFunc('tes',data1)">Choose</button>

Sorry for my bad english. I'm little hard to explain it hope someone could give good explanation(edit).
Update :
This is the problems i face which i build it to plunker for easier understanding the problems : http://next.plnkr.co/edit/RgWNX1zEjJe1BhoZ?open=lib%2Fscript.js&preview
i want to make the prepend button could run function 2 or alert in this program(ng-click prepend button isnt working).


text:
Q: Error in prolog when parsing xsd using xjc I am getting "Error in Prolog" when parsing followinf xsd by xjc
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="info">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="a" type="xsd:string" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

I have checked the validity of the xsd and not getting any error. no character before start also...

A: The problem seems to be with encoding="utf-16". Your file doesn't correspond it.
Set the encoding to something else (e.g. utf-8):
 <?xml version="1.0" encoding="utf-8"?>


text:
Q: How, in eclipse do I work with an existing maven project in GitHub without ending up checking my .project file? I have a maven project in GitHub that I wish to work with using eclipse.
I want to keep the GitHub repository clear of any eclipse project artifacts such as the .project file.
Is there a way to do the following (or alternative that accomplishes the same):

*

*Have two GitHub projects -- one being the pure maven project

*The other being the eclipse project

*Using eclipse project organization features to keep them separate

A: Git will look for a .gitignore file, which describes what files should be ignored by git.  Could you add entries in .gitignore for all of the files that you don't want ending up on GitHub?


text:
Q: How to find a document in a document library using jquery I have a requirement to check for duplicate documents in the document library. How can i implement this using jquery. Please share the code.

A: Code to check if the document exists in the doc lib using jquery
function findDocument(fileName, docLibName) {
        var optValue = "0";
        var query = "<Query><Where><Eq><FieldRef Name='FileLeafRef' /><Value Type='File'>" + fileName + "</Value></Eq></Where></Query>";

        $().SPServices({
            operation: "GetListItems",
            listName: docLibName,
            CAMLViewFields: "<ViewFields><FieldRef Name='ID' /></ViewFields>",
            CAMLQuery: query,
            async: false,

            completefunc: function (xData, Status) {
                    optValue = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
            }
        });
        return optValue;
    }


text:
Q: Fill NaN with corresponding row value in Python I have the following dataframe:
      Region                   Date         Confirmed   Deaths  Recovered   Latitude    Longitude
0     Mainland China Anhui     2020-01-22   1.0         0.0     0.0         NaN         NaN
1     Mainland China Beijing   2020-01-22   14.0        0.0     0.0         NaN         NaN
2     Mainland China Chongqing 2020-01-22   6.0         0.0     0.0         NaN         NaN
3     Mainland China Fujian    2020-01-22   1.0         0.0     0.0         NaN         NaN
4     Mainland China Gansu     2020-01-22   0.0         0.0     0.0         NaN         NaN
2825  Mainland China Anhui     2020-03-01   990.0       6.0     873.0       31.8257     117.2264
567   Mainland China Anhui     2020-02-05   1.0         0.0     0.0         NaN         NaN
2951  Mainland China Anhui     2020-03-02   990.0       6.0     917.0       31.8257     117.2264
4273  Mainland China Fujian    2020-03-07   296.0       1.0     295.0       26.0789     117.9874
4541  Mainland China Fujian    2020-03-07   296.0       1.0     295.0       26.0789     117.9874

I want to fill the NaN values in the Latitude and Longtitude with the corresponding value based on the region.
I tried:
df = df.groupby(['Region']).ffill()
df

But that only got me this:
        Date        Confirmed   Deaths  Recovered   Latitude    Longitude
0       2020-01-22  1.0         0.0     0.0         NaN         NaN
1       2020-01-22  14.0        0.0     0.0         NaN         NaN
2       2020-01-22  6.0         0.0     0.0         NaN         NaN
3       2020-01-22  1.0         0.0     0.0         NaN         NaN
4       2020-01-22  0.0         0.0     0.0         NaN         NaN

Thanks in advance!

A: I would just use the fact that max ignores NaN values, so this should be enough:
df.loc[:,['Latitude', 'Longitude']] = df.groupby('Region')[['Latitude', 'Longitude']].transform('max')

A: You can use back and forward fill method on grouped elements.
df['Latitude'] = df.groupby('Region')['Latitude'].fillna(method='backfill').fillna(method='pad')
df['Longitude'] = df.groupby('Region')['Longitude'].fillna(method='backfill').fillna(method='pad')


text:
Q: When does NLog capture the ThreadID? If I have async logging turned on in nlog.config, where is the ThreadID captured?
Context: I'm starting a greenfield project using .NET, Rx, and TPL Dataflow (a.k.a. TDP).  It will make heavy use of async operations and background work queues.
Goal: In my logging I'd like to capture the ManagedThreadId where the work is being performed, and when work is being done in parallel (easy to get wrong in Rx, where default scheduler isn't ThreadPool).   If I have async logging turned on in nlog.config, where is the ThreadID captured?
Concern: I don't see ThreadID in the core LogEntry class for NLog.  For example it isn't sent to the browser in cbley/NLog.SignalR.  If I have async logging turned on in nlog.config, where is the ThreadID captured?  If it isn't captured until the log entry is rendered (in an NLog background thread), then the ThreadId is useless to me and I need to find a more appropriate logging library.

A: NLog captures the threadid corrrectly.
NLog uses [ThreadAgnostic] on LayoutRender-derived classes that can be used/rendered outside the calling thread.  Because ThreadIdLayoutRender doesn't have that attribute it can't be delayed until the after the async transition.


text:
Q: How can I convince spark not to make an exchange when the join key is a super-set of the bucketBy key? While testing for a production use-case I have created and saved (using Hive Metastore) such tables:
table1:
fields: key1, key2, value1
sortedBy key1,key2
bucketBy: key1, 100 buckets

table2:
fields: key1, key2, value2
sortedBy: key1,key2
bucketBy: key1, 100 buckets

I'm running such a query (in pseudocode)
table1.join(table2, ["key1", "key2"])
 .groupBy("value2")
 .countUnique("key1")

Common sense says that this join should simply be done with a sort-merge join with no exchange; however spark does an exchange then join.
Even though for this particular use-case, I could have bucketed by both keys, due to some other use-cases I need to bucket by key1. And when I do a (simpler) join using a single key like this:
table1.join(table2, ["key1"])

It works as expected (i.e. sort-merge join with no exchange).
Now that I have an optimized join on these table, if I want to filter, as such:
table1.join(table2, ["key1"])
 .filter(table1.col("key2") == table2.col("key2"))

It reverts back to the exchange then join.
How can I convince spark not to make an exchange when the join key is a super-set of the bucketBy key?
Note:
One trick I know is instead of an equality check if I would rewrite as inequality checks, spark would not shuffle.
(x == y) can also be expressed as  ((x >= y) & ( x <= y)).  If I would apply two filters like this in the last example:

.filter(table1.col("key2") >= table2.col("key2"))
.filter(table1.col("key2") <= table2.col("key2"))

It will continue using sort-merge join with no exchange, however this is not a solution, this is a hack.

A: Based on some research and exploration this seems to be the least hacky solution:
Building on this example:
table1.join(table2, ["key1"])
      .filter(table1.col("key2") == table2.col("key2"))

Instead of using the equalTo (==) from Spark, implementing a custom MyEqualTo (by delegating to the the spark EqualTo implementation is fine) seems to solve the issue. This way, spark won't optimize(!) the join, and it will just pull the filter up into SortMergeJoin.
Similarly, the join condition can be also formed as such:
(table1.col("key1") == table2.col("key1")) AND
table1.col("key2").myEqualTo(table2.col("key2"))

A: I am facing the same issue.
It seems that there is a PR finished, solving exactly this problem
(PR) https://github.com/apache/spark/pull/19054
(Jira ticket) https://issues.apache.org/jira/browse/SPARK-18067
But I would have expected it to be already included (I am using Spark 3.0.0 and the issue is still there, while the ticket is resolved 21st of May 2019, more than one year before release of Spark3).
Thanks for the "hack" using inequality operators, doesn't feel great but it's an easy workaround. I will try to patch my spark version with the solution in the PR as well, but this is less sustainable/reproducable if I want to share my code.

A: org.apache.spark.sql.catalyst.optimizer.PushPredicateThroughJoin is the optimizer rule that pushes the predicate through the Join. ~~
We can exclude this rule from the optimizer rules. That way we don't have to make any changes to user code.
 To exclude, we can do one of the following
1. --conf spark.sql.optimizer.excludedRules=org.apache.spark.sql.catalyst.optimizer.PushPredicateThroughJoin.
2. add the property in spark-defaults .conf.
3. add set spark.sql.optimizer.excludedRules=org.apache.spark.sql.catalyst.optimizer.PushPredicateThroughJoin to the user code.
Again, this is again a hack. .
Ideally, the filters should be pushed down through join, which reduces the number of rows to be joined
Update: .
1. I was wrong about the pushdown. There will be no filter pushdown since the predicate has columns from both tables.
2.Why does SortMergeJoin(SMJ) not add additional exchanges when the where clause has a "non-equality" predicate?
This because SMJ can consider only equality-based predicates as part of join condition org.apache.spark.sql.catalyst.planning.ExtractEquiJoinKeys#unapply
And EnsureRequirements responsible for adding the exchange sees that SMJ does not have new join condition and that output distribution is already satisfied.
code: org.apache.spark.sql.execution.exchange.EnsureRequirements#ensureDistributionAndOrdering .
3. Which is efficient - adding a UDF which performs equals or representing the predicate as a combination of greater than and less than? .
To evaluate this, I checked the generated code using,
val df = spark.sql(<joinquery>)
df.queryExecution.debug.codegen

a. UDF equals - involves addition overhead of virtual function calls.
b. combination of lesser than and greater than - no virtual function calls. Once we find a joined row(using key1), the code checks for the other predicates one by one.
From the above observations in 3, using non-equality based predicate seems to be more efficient.

A: **based on your pseudocode **
table1.join(table2, ["key1", "key2"])
 .groupBy("value2")
 .countUnique("key1")
I guess the solution would be

as a first step just join the tables and get the data frame.

df = table1.join(table2, ["key1", "key2"])

then group by and do distinct counts

df.select("value2","key1").distinct().groupBy("value2","key1").count().show()


text:
Q: Convert label in line feature Is there a method to convert the text of labels in lines? I think infact that the letters can be hypothetically transformed in lines, for simplify the view in other kinds of gis.

A: ESRI has a VBA script that shows how to convert annotations to polygons. Works well and I made it into an add-in for my own use. Once you have the polygons, you can easily copy and paste to a line feature class then export to DXF, DWG, Shapefile, etc. This will give you the OUTLINE of the text which works fine in 3rd party applications.  If what you have in mind is a line-based font such as those proprietary drafting fonts in autocad for example then I don't personally know of any way to do that. These are legacy fonts that are actually line drawings converted to a special autocad type font (shx).  There is no such equivalent in ArcGIS.


text:
Q: Generate bounding box from PNG image and World File From this folder I can get two files:
PNG Image

World File   (.wld)
From this page where they document how these files are to be used, they say that they are generated in the EPSG:4326 projection.
My question is - how can I take these two files (image and world file) and generate a bounding box from them, using javascript (or just math that you can do in javascript)? By bounding box I mean an array of two or four coordinates, e.g.:
[[33.644214, -82.829214], [44.3182149, -72.155215]]

(Mapbox requires four coordinates for an image overlay, but leaflet only needs two. I am fairly confident I can find a way of generating the remaining two points if I am given the first two that will work with leaflet, but if there is a way to get 4, that would be awesome.)
I saw this answer: https://gis.stackexchange.com/a/288308/206737 that detailed how you might go about doing this, but overlaying the resulting coordinates onto a Leaflet map is slightly incorrect. The center is off, and the overlay is too small. I assume that is because that answer was using EPSG:3857, but since my image uses 4326 I will need a different way of doing it.
I am using browser javascript, and will end up overlaying the image onto a Mapbox GL JS map.

A: I got what I think is a solution - I just had to render my map in EPSG:4326. Loaded up the image + world file in QGIS and it worked fine. You can do this in Mapbox GL JS by setting the projection option to equirectangular:
const map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/bright-v9',
    zoom: 3,
    center: [-98.5606744, 36.8281576],
    projection: 'equirectangular'
});


text:
Q: Is it possible to get a metamask private key? I'm beginner to blockchain development, and I have a question in the polygon documentation in order to make a deployment using hradhat, you need to pass account: process.env.PRIVATE_KEY, but how do I get the user's private key when logging in to the metamask on the site?
require('dotenv').config();
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");

    module.exports = {
      defaultNetwork: "matic",
      networks: {
        hardhat: {
        },
        matic: {
          url: "https://rpc-mumbai.maticvigil.com",
          accounts: [process.env.PRIVATE_KEY]
        }
      },
      etherscan: {
        apiKey: process.env.POLYGONSCAN_API_KEY
      },
      solidity: {
        version: "0.7.0",
        settings: {
          optimizer: {
            enabled: true,
            runs: 200
          }
        }
      },
    }

A: In MetaMask's "Account details" there is an "export private key" option

A: Yes, you can get the MetaMask Private key through Google Chrome Extension.

*

*Go to Account Details

*Export Private Key

*Enter your Password

*Private Key Reveal to you

Make sure you do not share this with anyone this address have a all your assets stored.


text:
Q: Log File Locking Issue in C# I have a windows service that writes out log file entries to an XML log file. I maintain a handle to the log file while the service is operational, and close, flush and dispose of it when the service is stopped. The file write operations are by the service only, and I have the filestream open in FileAccess.ReadWrite while sharing is set to FileShare.Read. I would like to be able to open and view this file with an XmlRead() call by another application, but I get an error stating the file is being used by another process. I had read another post on this and was under the impression this was possible: Other Thread.
The writer in use is flushed, closed, and disposed of, and each write the filestream is flushed. Is this just not possible in .Net, or have I perhaps done something wrong? A cutdown version of the code follows:
if (_logFS == null)
        _logFS = new FileStream(_fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);

if (!initFile)
{
    _logFS.Seek(-13, SeekOrigin.End);
}

XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.OmitXmlDeclaration = true;
using (XmlWriter writer = XmlWriter.Create(_logFS, settings))
{
    if (initFile)
    {
        writer.WriteRaw("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n");
        writer.WriteStartElement("Entries", "http://www.abcdefg.com);
    }

    writer.WriteStartElement("Exception");
    // write out some stuff here.
    writer.WriteEndElement();

    writer.Flush();
    writer.Close();
}

_logFS.Flush();

The file opening code is now as follows:
_LogDS = new XmlLogFile();
using (FileStream logFS = new FileStream(_fileName, FileMode.Open, FileAccess.Read)
{
    _LogDS.ReadXml(logFS);
}

A: You also need to close the FileStream. At a minimum, you need to close it when your service exits, or when the FileStream would go out of the application's scope.
You should be able to open it as ReadOnly from another application either way, but you have to specify that, it's not a default.
In your service you need to enable the file sharing:
FileStream fs = new FileStream("path", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);

And in your reader application:
FileStream fs = new FileStream("path", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

Without the FileShare.Read, all requests to open the file for reading fail. Any other application requesting to open the file for writing will still fail, for write-enabled sharing you'd use FileShare.ReadWrite. The default option for FileShare is None.


text:
Q: Show loading when syncing Realm Mobile Database Is there any way to get notified when Realm starts/ends syncing (similar to REST API approach)?
I need to show loading to the user when needed. For example, when user download the app for first time, but there is a lot off data to syncing.
Thanks!

A: It's not available in the shipping build just yet, but we're actively working on a PR for that sort of functionality right now. You can view it here: https://github.com/realm/realm-cocoa/pull/4535
It will hopefully be ready to go within the next few days.


text:
Q: jQuery merge table rows, but take previous columns into account I have a table in html. The table utilizes generic tr's and td's... and makes a dynamic table with six columns and a variable number of rows.
If a given table looks something like this:
|column 1|column 2|column 3|column 4|column 5|column 6|
-------------------------------------------------------
|  John  |  Green |apples  |February|  cow   |   23   |
-------------------------------------------------------
|  John  |  Red   |Oranges |February|  lion  |   18   |
-------------------------------------------------------
|  John  |  Blue  |apples  |February|  cow   |   45   |
-------------------------------------------------------
|  Mary  |  Blue  |oranges |  April |  cow   |   23   |
-------------------------------------------------------
|  Mary  |  Blue  |apples  |   May  |  dog   |   49   |
-------------------------------------------------------
|  Mary  |  green |apples  |  June  |  cat   |   67   |
-------------------------------------------------------
|  Mary  |  red   |apples  |  June  |  mouse |   32   |
-------------------------------------------------------

When I run the following javascript:
function MergeCommonRows(table, columnIndexToMerge) {
previous = null;
cellToExtend = null;
table.find("td:nth-child(" + columnIndexToMerge + ")").each(function() {
    jthis = $(this);
    content = jthis.text()
    if (previous == content && content !== "") {
        jthis.remove();
        if (cellToExtend.attr("rowspan") == undefined) {
            cellToExtend.attr("rowspan", 2);
        }
        else {
            currentrowspan = parseInt(cellToExtend.attr("rowspan"));
            cellToExtend.attr("rowspan", currentrowspan + 1);
        }
    }
    else {
        previous = content;
        cellToExtend = jthis;
    }
});
}

The following table is made:
|column 1|column 2|column 3|column 4|column 5|column 6|
-------------------------------------------------------
|        |  Green |apples  |        |  cow   |   23   |
         ------------------         -------------------
|  John  |  Red   |Oranges |February|  lion  |   18   |
         ------------------         -------------------
|        |        |apples  |        |        |   45   |
---------         ------------------         ----------
|        |  Blue  |oranges | April  |  cow   |   23   |
                  ------------------         ----------
|  Mary  |        |        |  May   |        |   49   |
          --------         ----------------------------
|        |  green | apples |  June  |  cat   |   67   |
          --------         ----------------------------
|        |  red   |        |  July  |  mouse |   32   |
-------------------------------------------------------

Now, the javascript works in the sense that I do need the rows to merge as seen in the above table. The first column merges nicely. And other areas in the columns do so as well. My only issues arises in areas like columns 2 and five. Now to reiterate, these tables will always be dynamically generated so I can't approach this in a static fashion. But... the merging for "blue" in column 2 and "cow" in column 5 goes past the associated values in column 1. Instead, I would want a table like this:
|column 1|column 2|column 3|column 4|column 5|column 6|
-------------------------------------------------------
|        |  Green |apples  |        |  cow   |   23   |
         ------------------         -------------------
|  John  |  Red   |Oranges |February|  lion  |   18   |
         ------------------         -------------------
|        |  Blue  |apples  |        |  cow   |   45   |
-------------------------------------------------------
|        |  Blue  |oranges | April  |  cow   |   23   |
                  ------------------         ----------
|  Mary  |        |        |  May   |        |   49   |
          --------         ----------------------------
|        |  green | apples |  June  |  cat   |   67   |
          --------         ----------------------------
|        |  red   |        |  July  |  mouse |   32   |
-------------------------------------------------------

In the above table, the merged cells for "blue" and "cow" separate because the cells preceding it end their rowspan there. This would occur in any case. If a cell in the second column happened to span multiple rows, then any subsequent columns could not have rowspans extending past it. Hopefully what I have described is clear enough. I am asking... how do I revise my javascript to achieve this effect?

A: How about a simple addition to watch the first column, like so:
function MergeCommonRows(table, columnIndexToMerge) {
  previous = null;
  cellToExtend = null;
  col1 = null;
  table.find("td:nth-child(" + columnIndexToMerge + ")").each(function() {
      jthis = $(this);
      content1 = jthis.parent('tr').children().first().text();
      if (col1 !== content1) {
          previous = null;
          col1 = content1;
      }
      content = jthis.text()
      if (previous == content && content !== "") {
          jthis.remove();
          if (cellToExtend.attr("rowspan") == undefined) {
              cellToExtend.attr("rowspan", 2);
          }
          else {
              currentrowspan = parseInt(cellToExtend.attr("rowspan"));
              cellToExtend.attr("rowspan", currentrowspan + 1);
          }
      }
      else {
          previous = content;
          cellToExtend = jthis;
      }
  });
  }

A: If only the first column is supposed to be a "divider" for the rest of the columns, then you could use an array to store first column rows "breaks".
Also, your function doesn't have the right to work. When element is removed inside loop, The index of each element above the removed one is shifted down immediately to fill the DOM index gap (so the element right after the removed one is skipped in next iteration). You could use "decremental" loop or simply hide td's.

function MergeCommonRows(table) {
    var firstColumnBrakes = [];
    // iterate through the columns instead of passing each column as function parameter:
    for(var i=1; i<=table.find('th').length; i++){
        var previous = null, cellToExtend = null, rowspan = 1;
        table.find("td:nth-child(" + i + ")").each(function(index, e){
            var jthis = $(this), content = jthis.text();
            // check if current row "break" exist in the array. If not, then extend rowspan:
            if (previous == content && content !== "" && $.inArray(index, firstColumnBrakes) === -1) {
                // hide the row instead of remove(), so the DOM index won't "move" inside loop.
                jthis.addClass('hidden');
                cellToExtend.attr("rowspan", (rowspan = rowspan+1));
            }else{
                // store row breaks only for the first column:
                if(i === 1) firstColumnBrakes.push(index);
                rowspan = 1;
                previous = content;
                cellToExtend = jthis;
            }
        });
    }
    // now remove hidden td's (or leave them hidden if you wish):
    $('td.hidden').remove();
}

$('.button').click(function(){
    MergeCommonRows($('#tbl'));
});
table {
    border-collapse: collapse;
}

th, td {
    border: 1px solid black;
    padding:5px;
    text-align: center;
}

.hidden{
    display:none;
}

            column 1
            column 2
            column 3
            column 4
            column 5
            column 6

            John
            Green
            apples
            February
            cow
            23

            John
            Red
            Oranges
            February
            lion
            18

            John
            Blue
            apples
            February
            cow
            45

            Mary
            Blue
            Oranges
            April
            cow
            23

            Mary
            Blue
            apples
            May
            cow
            49

            Mary
            green
            apples
            June
            cat
            67

            Mary
            red
            apples
            June
            mouse
            32

<button class=button>Merge Rows</button>


text:
Q: How to send localstorage data to email in javascript I want to send client response to admin email account. So I want to use Javascript.
(e, t) => {
  const o = {
    msg: e,
    display_name: 'Customer Support',
    nick: 'agent:chatbot',
    timestamp: Date.now(),
    options: t ? ['paymentLink'] : void 0,
  };
  let messages = JSON.parse(window.localStorage.getItem('messages')) || []
  messages.push(o)
  window.localStorage.setItem('messages', JSON.stringify(messages))
  messages = JSON.parse(window.localStorage.getItem('messages'))

  if (messages.length === 3) {

    window.localStorage.setItem('messages', JSON.stringify([]))
    document.getElementById("hidden-form").submit()
  }

  if (document.querySelector('#mes2').value || document.querySelector('#mes2').value.length > 0) {
    document.querySelector('#mes2').value = document.querySelector('#mes2').value + ',' + JSON.stringify(o)
  } else {
    document.querySelector('#mes2').value = JSON.stringify(o)

  }
  C([...j, o]);
},

Here is how I want to call the function, But I'm not sure what to put into the javascript function. From the research I've done I found that I can use EmailJs or mailto method.

A: you can use sendgrid, it's very simple.
sendgrid.com


text:
Q: Does $\int_{0}^{\infty} \cos (x^2) dx$ diverge absolutely? I believe it does, but i would like some help formulating a proof.

A: *

*It's equivalent to the convergence of $\int_\pi^{\infty}\frac{|\cos t|}{\sqrt t}dt$, after having used the substitution $x^2=t$.

*We have
$$
\int_{\pi}^{N\pi}\frac{|\cos t|}{\sqrt t}dt=\sum_{n=1}^{N-1}\int_{n\pi}^{(n+1)\pi}\frac{|\cos t|}{\sqrt t}dt$$
Use $\pi$ periodicity of $|\cos|$ and a substitution $s=t-n\pi$ to get bound which doesn't depend on $n$.

*Find a good below bound will help to show the divergence.

This argument can be applied for the divergence of $\int_0^{+\infty}|\cos(x^p)|dx$, $p>0$.


text:
Q: Why can not copy for windows 7 to VIM? What would be the commands to be able to do CTRL + V on gVim?
In OS X I can copy text into vim, but on Windows I'm not getting.

A: From the vim documentation:

mswin.vim
To use the standard MS-Windows way of CTRL-X, CTRL-C and
  CTRL-V, use the $VIMRUNTIME/mswin.vim script.  You could add this line
  to your _vimrc file:  source $VIMRUNTIME/mswin.vim

A: While you can set up key bindings as Otiel suggests, I think it might be more useful to understand how copy and paste works in Vim, and learn what those commands actually mean.
The cut, copy and paste commands in Vim (d, y and p) work with so-called registers which hold the text last cut or copied. By default, they use the unnamed register "", while the system clipboard is the "+ register.
You can prefix commands with a register to that one instead. So, to copy from Vim to Windows, use "+y, and to paste from Windows, use "+p.
You also have 26 registers named "a to "z which you can use for anything you want. This can be very useful when doing complex editing operations.
There are more special registers as well, for more info, see :help registers.

A: I would recommend to one of the following instead of setting up custom shortcuts:

*

*Paste from register:

"+++p

*Paste using middle mouse button

*Paste using context menu
EDIT:
According to this answer you might need to have the clipboard set to unnamed to get register pasting to work.

set clipboard=unnamed

A: Add the following in your vimrc file (should be located under C:\Program Files\Vim\_vimrc):
" CTRL-X = cut
vnoremap <C-X> "+x
" CTRL-C = copy
vnoremap <C-C> "+y
" CTRL-V = paste
map <C-V> "+gP
cmap <C-V> <C-R>+
exe 'inoremap <script> <C-V>' paste#paste_cmd['i']
exe 'vnoremap <script> <C-V>' paste#paste_cmd['v']
imap <S-Insert> <C-V>
vmap <S-Insert> <C-V>

Or use the p command in vim to paste the content of the clipboard.


text:
Q: Opencart 1.5.5.1 can't send the Mail (Notification) to subscribers on admin Panel
*

*I've set the Mail Protoco as "MAIL"

*I can receive the all email etc. New order, New Member

*I try to sent email on admin Panel

*I've type few words in the message box but it's keep on  alarm me "E-MAIL MESSAGE REQUIRED!".

A: This is a known (and fixed bug). You can find all bugs on the bug tracker on the github project site. Here's the actual bug and fix (scroll down a little)


text:
Q: Как объединить два CSS класса в один? Есть огромная HTML таблица, решил сократить кол-во кода в ней.
Сейчас в не имеются теги с набором классов
...
...

Я же хочу сократить их до
...
...

Тупо копировать стили обоих классов в один новый не хотелось бы.
A: Если хочешь, сокращай, а мой тебе совет вот так не делать
.badge badge-success, .bs{...}
.badge badge-important, .bi{...}

лучше вот так
.bs{...}    /* .badge badge-success */
.bi{...}    /* .badge badge-important */

объясняю, если вам имена классов слишком длинные, их можно подкоротить и оставить себе пометки в коде, чтоб понятнее было потом через пару лет, что где находится и к чему относится - вместо того, чтоб копировать классы.
если-же надо объеденить 2 класса в один, то этого достич можно так
A: Посмотрите как во втором бутстрапе сделаны иконки:
[class^="icon-"],
[class*=" icon-"] {
    /* основные стили */
}

.icon-glass { background-position: 0 0;}
.icon-music { background-position: -24px 0; }
.icon-search { background-position: -48px 0; }
...

У вас, видимо, будет что-то вроде:

http://getbootstrap.com/2.3.2/assets/css/bootstrap.css
Может вы что-то типа этого хотите?
Но лично мне нравится вариант, который у вас изначально представлен. Да и бутстрап вот, к примеру, от таких хитростей обновился к варианту, как у вас опять же изначально. Так же ваш вариант хорошо описывается терминами БЭМ.
Если смотреть с другой стороны, то совсем не понятно, кто же выйграет от того, что вы пытаетесь сделать. Всем будет только хуже.
A: Можно например так поступить, только в итоге вы сократите код только за счёт названий классов.
.bs, bi {
    //общие стили
}

.bs {
    //конкретные стили
}

.bi {
    //конкретные стили
}