答:
groupby's sample returns n element from each group. If the group doesn't contain at least n element, you'll get the error.

To select groups randomly, you count how many groups there are, then sample (without replacement) n numbers in the range [0,number of groups), and then return those lines, where the group's group number is equal to the sampled random numbers.

import random
import pandas as pd

random.seed(0)

tot_groups = pd.read_csv("data.csv",header=None).rename(columns={0:"query_col"})
grouped = tot_groups.groupby("query_col")  # suppose you want to use this

group_selectors = random.sample(range(grouped.ngroups), k=2)
ret_df = tot_groups[grouped.ngroup().isin(group_selectors)]

print(ret_df)
```
<p>However, there is no need to create any <code>groupby</code> object. You can collect the list of different <code>query_col</code> values, sample them, and return those lines, where the <code>query_col</code> has the right value:</p>
<pre class="lang-py prettyprint-override"><code>import random
import pandas as pd

random.seed(0)

tot_groups = pd.read_csv("data.csv",header=None).rename(columns={0:"query_col"})
unique_queries = tot_groups["query_col"].unique().tolist()
selected_queries = random.sample(unique_queries,k=2)

ret_df = tot_groups[tot_groups["query_col"].isin(selected_queries)]

print(ret_df)
</code>```

Title: ValueError: Cannot take a larger sample than population when 'replace=False' using Groupby pandas

Body:
I want to randomly pick-up i.e. 10 groups that I have in a dataframe, but i'm stuck with this error.
What can I do if I want to apply a groupby before the random selection?
I try the following approaches:
random_selection=tot_groups.groupby('query_col').apply(lambda x: x.sample(3))
random_selection=tot_groups.groupby('query_col').sample(n=10)

Error:
ValueError: Cannot take a larger sample than population when 'replace=False'

Thanks !

UPDATE:

Current dataset

ABG23209.1,UBH04469.1,89.655,145,15,0,1,145,19,163,3.63e-100,275.0
ABG23209.1,UBH04470.1,89.655,145,15,0,1,145,20,164,4.68e-100,275.0
ABG23209.1,UBH04471.1,89.655,145,15,0,1,145,19,163,4.83e-100,275.0
ABG23209.1,UBH04472.1,89.655,145,15,0,1,145,24,168,5.58e-100,275.0
KOX89835.1,SFN69046.1,79.07,86,18,0,1,86,12,97,1.36e-49,143.0
KOX89835.1,SFE98714.1,77.907,86,19,0,1,86,19,104,2.1400000000000002e-49,143.0
KOX89835.1,WP_086938959.1,76.471,85,20,0,1,85,4,88,1.25e-48,140.0
KOX89835.1,WP_231794161.1,76.471,85,20,0,1,85,5,89,1.75e-48,140.0
KOX89835.1,WP_231794169.1,75.294,85,21,0,1,85,5,89,2.41e-48,140.0
WP_001287378.1,QBP98897.1,86.765,136,17,1,1,135,1,136,1.68e-85,241.0
WP_001287378.1,WP_005164157.1,86.765,136,17,1,1,135,1,136,1.68e-85,241.0
WP_001287378.1,WP_085071573.1,86.667,135,18,0,1,135,1,135,1.73e-85,241.0
WP_001287378.1,WP_014608965.1,86.765,136,17,1,1,135,1,136,2.49e-85,240.0
WP_001287378.1,WP_004932170.1,86.667,135,18,0,1,135,1,135,6.88e-78,221.0
WP_001287378.1,GGD19357.1,91.912,136,10,1,1,136,1,135,1.01e-77,221.0
WP_001287378.1,OMQ27200.1,85.926,135,19,0,1,135,1,135,1.79e-77,221.0
XP_037955766.1,WP_229689219.1,93.583,374,24,0,3,376,5,378,0.0,745.0
XP_037955766.1,WP_229799179.1,93.583,374,24,0,3,376,1,374,0.0,744.0
XP_037955766.1,WP_017454560.1,92.308,377,28,1,1,376,1,377,0.0,738.0
XP_037955766.1,WP_108127780.1,92.838,377,26,1,1,376,1,377,0.0,736.0

Desidered output: Randomly select n groups in the dataframe, groupby query_col . I.e. with n=2:

WP_001287378.1,QBP98897.1,86.765,136,17,1,1,135,1,136,1.68e-85,241.0
WP_001287378.1,WP_005164157.1,86.765,136,17,1,1,135,1,136,1.68e-85,241.0
WP_001287378.1,WP_085071573.1,86.667,135,18,0,1,135,1,135,1.73e-85,241.0
WP_001287378.1,WP_014608965.1,86.765,136,17,1,1,135,1,136,2.49e-85,240.0
WP_001287378.1,WP_004932170.1,86.667,135,18,0,1,135,1,135,6.88e-78,221.0
WP_001287378.1,GGD19357.1,91.912,136,10,1,1,136,1,135,1.01e-77,221.0
WP_001287378.1,OMQ27200.1,85.926,135,19,0,1,135,1,135,1.79e-77,221.0
ABG23209.1,UBH04469.1,89.655,145,15,0,1,145,19,163,3.63e-100,275.0
ABG23209.1,UBH04470.1,89.655,145,15,0,1,145,20,164,4.68e-100,275.0
ABG23209.1,UBH04471.1,89.655,145,15,0,1,145,19,163,4.83e-100,275.0
ABG23209.1,UBH04472.1,89.655,145,15,0,1,145,24,168,5.58e-100,275.0

Body:
groupby's sample returns n element from each group. If the group doesn't contain at least n element, you'll get the error.

To select groups randomly, you count how many groups there are, then sample (without replacement) n numbers in the range [0,number of groups), and then return those lines, where the group's group number is equal to the sampled random numbers.

import random
import pandas as pd

random.seed(0)

tot_groups = pd.read_csv("data.csv",header=None).rename(columns={0:"query_col"})
grouped = tot_groups.groupby("query_col")  # suppose you want to use this

group_selectors = random.sample(range(grouped.ngroups), k=2)
ret_df = tot_groups[grouped.ngroup().isin(group_selectors)]

print(ret_df)

However, there is no need to create any groupby object. You can collect the list of different query_col values, sample them, and return those lines, where the query_col has the right value:

import random
import pandas as pd

random.seed(0)

tot_groups = pd.read_csv("data.csv",header=None).rename(columns={0:"query_col"})
unique_queries = tot_groups["query_col"].unique().tolist()
selected_queries = random.sample(unique_queries,k=2)

ret_df = tot_groups[tot_groups["query_col"].isin(selected_queries)]

print(ret_df)


来源: stackexchange

问:
image 404 (not found) Github Pages Vitejs build React app not show the image
I am trying to make a simple React app with ViteJS and GitHub Pages but something is wrong with my images. I can't load them, event although I added them to assets folder. Can you help me how to fix that ?

when vite priview

vite.config.js file

that is my project, please help me
https://github.com/quocbinh-npm9081/React-App-Space-tourism-website

答:
Additionnaly, the vite doc say :

If you are deploying to https://<USERNAME>.github.io/, you can omit base as it defaults to '/'.

```<code>export default defineConfig(
  // base: ''
}
</code>```

If you are deploying to https://<USERNAME>.github.io/<REPO>/, for example your repository is at https://github.com/<USERNAME>/<REPO>, then set base to '/<REPO>/'.

```<code>export default defineConfig(
  base: '/React-App-Space-tourism-website/'
}
</code>```

then in your case:

git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages

ContentLicense: CC BY-SA 4.0

Body:
Additionnaly, the vite doc say :

If you are deploying to https://<USERNAME>.github.io/, you can omit base as it defaults to '/'.

export default defineConfig(
  // base: ''
}

If you are deploying to https://<USERNAME>.github.io/<REPO>/, for example your repository is at https://github.com/<USERNAME>/<REPO>, then set base to '/<REPO>/'.

export default defineConfig(
  base: '/React-App-Space-tourism-website/'
}

then in your case:

git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages


问:
Javascript - How to convert string '0' to number 0
I'm trying to do error handling on 2 input values. I'm using regex to confirm that the input is always a number. The issue I'm having is that I don't want my error handling to kick in if the user literally inputs 0. Right now I'm using:

```<code>number = parseInt(incomingValue) || ""
</code>```

to set my variable. The issue is that this turns '0' into ""

Its fine if an empty value becomes an empty string because I am disabling my error checking when the lengths are equal to 0, but I need to properly turn '0' into a number 0. Anyone have any ideas?

Additionally, I'd also like to turn '000' (and so forth) into a number 0

答:
Use "Number()":

console.log(Number('0'));
console.log(Number('000'));

console.log(typeof(Number('0')));
console.log(typeof(Number('000')));```
</div>
</div>
</p>
<p>Or put <strong>"+"</strong> before <strong>'0'</strong> and <strong>'000'</strong>:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>console.log(+'0');
console.log(+'000');

console.log(typeof(+'0'));
console.log(typeof(+'000'));</code>```

Or put "* 1" before or after '0' and '000':

console.log('0' * 1);
console.log('000' * 1);

console.log(typeof('0' * 1));
console.log(typeof('000' * 1));```

Body:
I'm trying to do error handling on 2 input values. I'm using regex to confirm that the input is always a number. The issue I'm having is that I don't want my error handling to kick in if the user literally inputs 0. Right now I'm using:

number = parseInt(incomingValue) || ""

to set my variable. The issue is that this turns '0' into ""

Its fine if an empty value becomes an empty string because I am disabling my error checking when the lengths are equal to 0, but I need to properly turn '0' into a number 0. Anyone have any ideas?

Additionally, I'd also like to turn '000' (and so forth) into a number 0

Body:
Use "Number()":

console.log(Number('0'));
console.log(Number('000'));

console.log(typeof(Number('0')));
console.log(typeof(Number('000')));

Or put "+" before '0' and '000':

console.log(+'0');
console.log(+'000');

console.log(typeof(+'0'));
console.log(typeof(+'000'));

Or put "* 1" before or after '0' and '000':

console.log('0' * 1);
console.log('000' * 1);

console.log(typeof('0' * 1));
console.log(typeof('000' * 1));


问:
How to write a portable constexpr std::copysign()?
In particular, it must work with NaNs as std::copysign does. Similarly, I need a constexpr std::signbit.

```<code>constexpr double copysign(double mag, double sgn)
{
    // how?
}

constexpr bool signbit(double arg)
{
    // how?
}

// produce the two types of NaNs
constexpr double nan_pos = copysign(std::numeric_limits<double>::quiet_NaN(), +1);
constexpr double nan_neg = copysign(std::numeric_limits<double>::quiet_NaN(), -1);

// must pass the checks
static_assert(signbit(nan_pos) == false);
static_assert(signbit(nan_neg) == true);
</code>```

The story behind is that I need two types of NaNs at compile time, as well as ways to distinguish between them. The most straightforward way I can think of is to manipulate the sign bit of the NaNs. It does work at run time; now I just want to move some computations to compile time, and this is the last hurdle.

Notes: at the moment, I'm relying on GCC, as it has built-in versions of these functions and they are indeed constexpr, which is nice. But I want my codebase to compile on Clang and perhaps other compilers too.

答:
P0533: constexpr for <cmath> and <cstdlib> is now accepted.

Starting in C++23 you can just use std::copysign and std::syncbit.

Body:
In particular, it must work with NaNs as std::copysign does. Similarly, I need a constexpr std::signbit.

constexpr double copysign(double mag, double sgn)
{
    // how?
}

constexpr bool signbit(double arg)
{
    // how?
}

// produce the two types of NaNs
constexpr double nan_pos = copysign(std::numeric_limits<double>::quiet_NaN(), +1);
constexpr double nan_neg = copysign(std::numeric_limits<double>::quiet_NaN(), -1);

// must pass the checks
static_assert(signbit(nan_pos) == false);
static_assert(signbit(nan_neg) == true);

The story behind is that I need two types of NaNs at compile time, as well as ways to distinguish between them. The most straightforward way I can think of is to manipulate the sign bit of the NaNs. It does work at run time; now I just want to move some computations to compile time, and this is the last hurdle.

Notes: at the moment, I'm relying on GCC, as it has built-in versions of these functions and they are indeed constexpr, which is nice. But I want my codebase to compile on Clang and perhaps other compilers too.


问:
Eclipse updates not working
I have installed Eclipse 3,6 on 64 bit Windows platform.
When I try to connect to update sites by going to Help->install new software it gives following error:

```<code>Unable to connect to repository
http://download.eclipse.org/releases/galileo/content.xml
Connection refused: connect
</code>```

I have tried all available sites - they all give me the same error.
Dialog box shows: Provision exception.

Any idea what's happening?

答:
In Eclipse (go to Window > Preferences > General > Network connections).

Select "Active Provider" as "Manual".

Select HTTP and click edit.

Enter the  host and port

Select "Requires Authentication" and enter the username and password.

Repeat Step 1 to 5 for Https.

In "proxy bypass" section click "Add host"

Enter http://download.eclipse.org/releases/galileo/content.xml and OK

After spending an entire week with the issue, this solution finally worked for me

ContentLicense: CC BY-SA 3.0

Title: Eclipse updates not working

Body:
I have installed Eclipse 3,6 on 64 bit Windows platform.
When I try to connect to update sites by going to Help->install new software it gives following error:

Unable to connect to repository
http://download.eclipse.org/releases/galileo/content.xml
Connection refused: connect

I have tried all available sites - they all give me the same error.
Dialog box shows: Provision exception.

Any idea what's happening?


问:
One SQL Server query results into multiple datasets
In a SQL Server stored procedure, the first select statement creates a temp table (#fundnames) containing a list of distinct fundnames. A second select then uses #fundnames to select from portfolio_history to select the histories of each fundname. The output is a single dataset.

```<code>select  h.valuedate "valuedate",
        h.fundname "fundname",
        h.value "value"
FROM    portfolio_history h,
        #fundnames f
where   f.fundname = h.fundname
order by
        h.fundname asc,
        h.valuedate asc
</code>```

The result set is something like this:

```<code>valuedate  fundname                                           value
2022-02-04 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99
2022-02-05 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99
2021-07-20 RLPAbsoluteReturnGovernmentBond                    99999.99
2021-07-23 RLPAbsoluteReturnGovernmentBond                    99999.99
</code>```

What I want is this:

```<code>valuedate  fundname                                           value
----------------------------------------------------------------------
2022-02-04 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99
2022-02-05 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99

valuedate  fundname                                           value
----------------------------------------------------------------------
2021-07-20 RLPAbsoluteReturnGovernmentBond                    99999.99
2021-07-23 RLPAbsoluteReturnGovernmentBond                    99999.99
</code>```

Can this be done?

答:
Not multiple datasets. You mean multiple data tables
1 Dataset can have many Data tables</p>
```<code>-- query 1, produces datatable 1
select * from table1 where date = @date1

-- query 2, produces datatable 2
select * from table1 where date = @date2
</code>```

Body:
In a SQL Server stored procedure, the first select statement creates a temp table (#fundnames) containing a list of distinct fundnames. A second select then uses #fundnames to select from portfolio_history to select the histories of each fundname. The output is a single dataset.

select  h.valuedate "valuedate",
        h.fundname "fundname",
        h.value "value"
FROM    portfolio_history h,
        #fundnames f
where   f.fundname = h.fundname
order by
        h.fundname asc,
        h.valuedate asc

The result set is something like this:

valuedate  fundname                                           value
2022-02-04 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99
2022-02-05 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99
2021-07-20 RLPAbsoluteReturnGovernmentBond                    99999.99
2021-07-23 RLPAbsoluteReturnGovernmentBond                    99999.99

What I want is this:

valuedate  fundname                                           value
----------------------------------------------------------------------
2022-02-04 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99
2022-02-05 RLP/BlackrockACSWorld(ExUK)EquityIndex             99999.99

valuedate  fundname                                           value
----------------------------------------------------------------------
2021-07-20 RLPAbsoluteReturnGovernmentBond                    99999.99
2021-07-23 RLPAbsoluteReturnGovernmentBond                    99999.99

Can this be done?

Body:
Not multiple datasets. You mean multiple data tables
1 Dataset can have many Data tables

-- query 1, produces datatable 1
select * from table1 where date = @date1

-- query 2, produces datatable 2
select * from table1 where date = @date2


问:
AttributeError: 'InstrumentedList' object has no attribute
I have these tables tables:

```<code>class Thing(Base):
    __tablename__ = 'thing'
    id = Column(Integer, primary_key=True)

class User(Base):
    __tablename__ = 'user'
    id = Column(Integer, primary_key=True)

class Voteinfo(Base):
    __tablename__ = 'voteinfo'
    thing_id = Column(Integer, ForeignKey('thing.id'), primary_key=True)
    thing = relationship('Thing', backref='voteinfo')
    upvotes = Column(Integer)
    downvotes = Column(Integer)

    def __init__(self, thing)
        self.thing = thing

class VoteThing(Base):
    __tablename__ = 'votething'
    id = Column(Integer, primary_key=True)
    voter_id = Column(Integer, ForeignKey('voter.id'))
    voter = relationship('Voter', backref='votescast')
    thing_id = Column(Integer, ForeignKey('thing.id'))
    thing = relationship('Thing', backref='votesreceived')
    value = Column(Boolean)

    def __init__(self, voter, thing, value):
        if value is True:
            thing.voteinfo.upvotes += 1
        else:
            thing.voteinfo.downvotes += 1
</code>```

When I try to run this, I get this error code in the "if value is True" clause:

```<code>AttributeError: 'InstrumentedList' object has no attribute 'upvotes'
</code>```

I've tried giving Voteinfo its own unique ID and adding uselist=False to the relationship. I've tried replacing the relationship to thing from VoteThing to Voteinfo, but that didn't help either. I don't know what an InstrumentedList is. What is going on?

答: It may been useful to add lazy='dynamic' argument to request that the query is not automatically executed and of course refresh (thing = relationship('Thing', backref='voteinfo', lazy='dynamic')), otherwise expression is issued internally call all() to return the list of 'thing' hence AttributeError: 'InstrumentedList' object has no attribute error!!

Body:
I have these tables tables:

class Thing(Base):
    __tablename__ = 'thing'
    id = Column(Integer, primary_key=True)

class User(Base):
    __tablename__ = 'user'
    id = Column(Integer, primary_key=True)

class Voteinfo(Base):
    __tablename__ = 'voteinfo'
    thing_id = Column(Integer, ForeignKey('thing.id'), primary_key=True)
    thing = relationship('Thing', backref='voteinfo')
    upvotes = Column(Integer)
    downvotes = Column(Integer)

    def __init__(self, thing)
        self.thing = thing

class VoteThing(Base):
    __tablename__ = 'votething'
    id = Column(Integer, primary_key=True)
    voter_id = Column(Integer, ForeignKey('voter.id'))
    voter = relationship('Voter', backref='votescast')
    thing_id = Column(Integer, ForeignKey('thing.id'))
    thing = relationship('Thing', backref='votesreceived')
    value = Column(Boolean)

    def __init__(self, voter, thing, value):
        if value is True:
            thing.voteinfo.upvotes += 1
        else:
            thing.voteinfo.downvotes += 1

When I try to run this, I get this error code in the "if value is True" clause:

AttributeError: 'InstrumentedList' object has no attribute 'upvotes'

I've tried giving Voteinfo its own unique ID and adding uselist=False to the relationship. I've tried replacing the relationship to thing from VoteThing to Voteinfo, but that didn't help either. I don't know what an InstrumentedList is. What is going on?


问:
PHP str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
I'm getting this error while running my app:

PHP str_replace(): Passing null to parameter #3 ($subject) of type
array|string is deprecated

I am Using CodeIgniter Version : V4.1.8 PHP Version : 8.1.2, full error output below:

```<code>{"data":[
    ["omron","<span class=\"label label-success\">Active<\/span>",
    "<button type=\"button\" class=\"btn btn-default\" onclick=\"editBrand(4)\" data-toggle=\"modal\" data-target=\"#editBrandModal\"><i class=\"fa fa-pencil\"><\/i><\/button> <button type=\"button\" class=\"btn btn-default\" onclick=\"removeBrand(4)\" data-toggle=\"modal\" data-target=\"#removeBrandModal\"><i class=\"fa fa-trash\"><\/i><\/button>\n\t\t\t\t"]
    ]
}
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: 8192</p>
<p>Message:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated</p>
<p>Filename: core/Output.php</p>
<p>Line Number: 457</p>

    <p>Backtrace:</p>
</code>```

UPDATE: Code

```<code>if ($this->parse_exec_vars === TRUE)
{
    $memory = round(memory_get_usage() / 1024 / 1024, 2).'MB';
    // below is line 457
    $output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output);
}
</code>```

答:
This error message can show up if you have not loaded any views.  Codeigniter's internal output buffer is never initialized thus being null.  The output buffer is the third parameter to str_replace().  There might be other ways to trigger this error message.

You probably want to load a valid view, at some point.

PHP 7 and lower just would ignore the missing parameter, while PHP 8+ displays the warning.  It may also vary with your environment / debug settings.

Body:
I'm getting this error while running my app:

PHP str_replace(): Passing null to parameter #3 ($subject) of type
array|string is deprecated

I am Using CodeIgniter Version : V4.1.8 PHP Version : 8.1.2, full error output below:

{"data":[
    ["omron","Active<\/span>",
    "<button type=\"button\" class=\"btn btn-default\" onclick=\"editBrand(4)\" data-toggle=\"modal\" data-target=\"#editBrandModal\"><\/i><\/button> <button type=\"button\" class=\"btn btn-default\" onclick=\"removeBrand(4)\" data-toggle=\"modal\" data-target=\"#removeBrandModal\"><\/i><\/button>\n\t\t\t\t"]
    ]
}

A PHP Error was encountered

Severity: 8192

Message:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: core/Output.php

Line Number: 457

Backtrace:

UPDATE: Code

if ($this->parse_exec_vars === TRUE)
{
    $memory = round(memory_get_usage() / 1024 / 1024, 2).'MB';
    // below is line 457
    $output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output);
}


问:
Amazon DynamoDB - geographically distributed?
I am new to AWS. Sorry if my question is basic, got stuck with this term.

AWS Global Infrastructure says "18 geographic Regions" -> Geographic term is used along with Regions, that makes sense.

DynamoDB FAQs 3rd questions says, "Amazon DynamoDB stores three geographically distributed replicas of each table to enable high availability and data durability."

Here(three geographically) is it referring to Region or Availability Zones ? Bit confused. If it is Region, does it mean my data is going out of my country(if my country has only 1 Region).

Please suggest.

答:
"Amazon DynamoDB stores three geographically distributed replicas of each table to enable high availability and data durability."

This is specifically referring to multi AZ structure of dynamo, this helps in achieving high availability of your table. eg. if one of availability zone is down you still will be able to access you table.

To answer  "my data is going out of my country(if my country has only
1 Region)."

For multi region its not by default ON you need to use global tables and specify regions in which you want to replicate that means your data/table wont go in any other region till you specifically want it to be.

For more on global tables refer
https://aws.amazon.com/dynamodb/global-tables/


问:
TypeError: a bytes-like object is required, not 'KeyCode'

Code

```<code> import socket
    from pynput.keyboard import Key, Listener
    import logging

    def on_press(key):
        logging.info(str(key))
        #print(str(key))
        """dosya = open("keys.txt", "a", encoding="utf-8")
        dosya.write(str(key))"""
        client = socket.socket()  # bir socket nesnesi oluşturuyoruz
        host = "localhost"  # bağlanacağımız adres

        port = 9000  # bağlanacağımız kapı
        client.connect((host, port))  # bağlantı yapılıyor
        print("Bağlantı yapıldı")
        client.send(key) # mesaj gönderiyoruz

        mesaj = client.recv(1024)  # geri gelen mesajı okuyoruz
        print(mesaj)

        """client.close()"""  # bağlantıyı kapatıyoruz
        with Listener(on_press=on_press) as listener:
            listener.join()
</code>```

TypeError

and got this error:

```<code>File "C:\Users\Hp\PycharmProject\pythonProject\venv\deneme.py", line 16, in on_press
    client.send(key) # mesaj gönderiyoruz
TypeError: a bytes-like object is required, not 'KeyCode'
</code>```

答:
Debugging

Read Eric Lippert's article "How to debug small programs" to get tips for debugging.

As you already did with logging and out-commented line:

```<code>        logging.info(str(key))
        #print(str(key))
</code>```

Add a print-statement before sending to see the key.

```<code>print("Bağlantı yapıldı")
print(str(key))  # debug print the key before sending
client.send(key) # mesaj gönderiyoruz
</code>```

Think about format of your payload when sending

Think of how the key should be transmitted over TCP sockets, in which format (binary, text, JSON).

From the docs

Maybe the example from official docs Monitoring the Keybord can inspire you

which attributes to use from key for sending

how to catch an AttributeError

```<code>from pynput import keyboard

def on_press(key):
    try:
        print('alphanumeric key {0} pressed'.format(
            key.char))
    except AttributeError:
        print('special key {0} pressed'.format(
            key))
</code>```

See also about the on_press and its possible parameter types:

It will be called with the argument (key), where key is a KeyCode, a Key or None if the key is unknown.

Body:
Code

 import socket
    from pynput.keyboard import Key, Listener
    import logging

    def on_press(key):
        logging.info(str(key))
        #print(str(key))
        """dosya = open("keys.txt", "a", encoding="utf-8")
        dosya.write(str(key))"""
        client = socket.socket()  # bir socket nesnesi oluşturuyoruz
        host = "localhost"  # bağlanacağımız adres

        port = 9000  # bağlanacağımız kapı
        client.connect((host, port))  # bağlantı yapılıyor
        print("Bağlantı yapıldı")
        client.send(key) # mesaj gönderiyoruz

        mesaj = client.recv(1024)  # geri gelen mesajı okuyoruz
        print(mesaj)

        """client.close()"""  # bağlantıyı kapatıyoruz
        with Listener(on_press=on_press) as listener:
            listener.join()

TypeError

and got this error:

File "C:\Users\Hp\PycharmProject\pythonProject\venv\deneme.py", line 16, in on_press
    client.send(key) # mesaj gönderiyoruz
TypeError: a bytes-like object is required, not 'KeyCode'

Body:
Debugging

Read Eric Lippert's article "How to debug small programs" to get tips for debugging.

As you already did with logging and out-commented line:

        logging.info(str(key))
        #print(str(key))

Add a print-statement before sending to see the key.

print("Bağlantı yapıldı")
print(str(key))  # debug print the key before sending
client.send(key) # mesaj gönderiyoruz

Think about format of your payload when sending

Think of how the key should be transmitted over TCP sockets, in which format (binary, text, JSON).

From the docs

Maybe the example from official docs Monitoring the Keybord can inspire you

which attributes to use from key for sending

how to catch an AttributeError

from pynput import keyboard

def on_press(key):
    try:
        print('alphanumeric key {0} pressed'.format(
            key.char))
    except AttributeError:
        print('special key {0} pressed'.format(
            key))

See also about the on_press and its possible parameter types:

It will be called with the argument (key), where key is a KeyCode, a Key or None if the key is unknown.


问:
Why I can't to scrape new Euroleague.net website with BeautifulSoup?
I want to scrape all links off specific games for specific week, which I can see through inspect, but it scrapes only links of next games, no matter, which page (gameweek) I try to scrape.
https://www.euroleaguebasketball.net/euroleague/game-center/?round=1&season=E2021

```<code>soup.find_all('a', class_="game-card-view_linkWrap__u3Tea")
</code>```

shows:

```<code>['/euroleague/game-center/2021-22/olympiacos-piraeus-anadolu-efes-istanbul/E2021/228/',
 '/euroleague/game-center/2021-22/alba-berlin-zenit-st-petersburg/E2021/227/',
 '/euroleague/game-center/2021-22/as-monaco-zalgiris-kaunas/E2021/226/',
 '/euroleague/game-center/2021-22/maccabi-playtika-tel-aviv-cska-moscow/E2021/229/',
 '/euroleague/game-center/2021-22/ax-armani-exchange-milan-bitci-baskonia-vitoria-gasteiz/E2021/230/',
 '/euroleague/game-center/2021-22/unics-kazan-crvena-zvezda-mts-belgrade/E2021/231/',
 '/euroleague/game-center/2021-22/fenerbahce-beko-istanbul-fc-bayern-munich/E2021/232/',
 '/euroleague/game-center/2021-22/ldlc-asvel-villeurbanne-panathinaikos-opap-athens/E2021/233/',
 '/euroleague/game-center/2021-22/real-madrid-fc-barcelona/E2021/234/']
</code>```

but should be:
links of game 1 - game 9.

答:
What happens?

Content of website is generated dynamically and requests could not interpret / render these like a browser can do.

How to fix?

Option#1:

Use the api to get the information of the matches:

```<code>URL = 'https://feeds.incrowdsports.com/provider/euroleague-feeds/v2/competitions/E/seasons/E2021/games?teamCode=&phaseTypeCode=RS&roundNumber=1'
headers =   {
        'accept':'*/*',
        'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36',
        }
r = requests.get(URL, headers=headers)
r.json()['data']
</code>```

Option#2:

Use selenium to render the page like a browser will do and scrape data from driver.page_source

Body:
I want to scrape all links off specific games for specific week, which I can see through inspect, but it scrapes only links of next games, no matter, which page (gameweek) I try to scrape.
https://www.euroleaguebasketball.net/euroleague/game-center/?round=1&season=E2021

soup.find_all('a', class_="game-card-view_linkWrap__u3Tea")

shows:

['/euroleague/game-center/2021-22/olympiacos-piraeus-anadolu-efes-istanbul/E2021/228/',
 '/euroleague/game-center/2021-22/alba-berlin-zenit-st-petersburg/E2021/227/',
 '/euroleague/game-center/2021-22/as-monaco-zalgiris-kaunas/E2021/226/',
 '/euroleague/game-center/2021-22/maccabi-playtika-tel-aviv-cska-moscow/E2021/229/',
 '/euroleague/game-center/2021-22/ax-armani-exchange-milan-bitci-baskonia-vitoria-gasteiz/E2021/230/',
 '/euroleague/game-center/2021-22/unics-kazan-crvena-zvezda-mts-belgrade/E2021/231/',
 '/euroleague/game-center/2021-22/fenerbahce-beko-istanbul-fc-bayern-munich/E2021/232/',
 '/euroleague/game-center/2021-22/ldlc-asvel-villeurbanne-panathinaikos-opap-athens/E2021/233/',
 '/euroleague/game-center/2021-22/real-madrid-fc-barcelona/E2021/234/']

but should be:
links of game 1 - game 9.

Body:
What happens?

Content of website is generated dynamically and requests could not interpret / render these like a browser can do.

How to fix?

Option#1:

Use the api to get the information of the matches:

URL = 'https://feeds.incrowdsports.com/provider/euroleague-feeds/v2/competitions/E/seasons/E2021/games?teamCode=&phaseTypeCode=RS&roundNumber=1'
headers =   {
        'accept':'*/*',
        'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36',
        }
r = requests.get(URL, headers=headers)
r.json()['data']

Option#2:

Use selenium to render the page like a browser will do and scrape data from driver.page_source


问:
SQL to deal with Duplicate Record Management
I have an Oracle database application which creates lists of duplicate records for people to review, with users being able to deduplcate, leave or mark the record as being different to each other (legitimate duplicates). I need to report on the number of records in this queue.
The challenge is the legitimate duplicates as these are held on a second table of data and are held as two rows for each pair marked up (a≠b). However as duplicate groups can contain a number of duplicates, and records could be marked up a being a legitimate duplicate more than once I need to somehow remove the records that are marked up as legitimate duplicates from all the other records in a candidate group. Hopefully that is making sense.

So a simplified view of the two tables would be:
Duplicate Candidates

```<code>Group   Key
Dup-1   123
Dup-1   234
Dup-2   123
Dup-2   345
Dup-2   567
Dup-3   234
Dup-3   567
Dup-4   123
Dup-4   567
Dup-4   235
</code>```

Legitimate Duplicates:

```<code>Group   Key
A       123
A       234
B       345
B       456
C       123
C       567
D       123
D       235
</code>```

The results I would like to return from this example would be:

Duplicate Candidates

```<code>Group   Key
Dup-2   123
Dup-2   345
Dup-2   567
Dup-3   234
Dup-3   567
Dup-4   567
Dup-4   235
</code>```

Dup-1 would not be returned as Legitimate Group A has both Keys, Dup-2 would be returned as while both Key 123 and 345 are marked up as legitimate duplicates they are not currently marked as different to each other. Dup-3 again should be returned as the two records are not marked as legitimate duplicates. Finally the row Dup-4 123 should not be returned as it is marked up as legitimate duplicate to both of the other records in the group, but they should be returned as they are not marked a legitimate duplicates of each other.

I really need to carry this out in SQL as I will feed this data into a reporting solution (Business Objects or Tablaux) directly. Is anyone able to give me a nudge in the right direction on this. Unfortunately our software is completely black box so I cannot reverse engineer this from the code that deals with this for users.

答:
Using Exists. Return the Candidate if at least one other member of the group is not in any group of Legitimates where the tested Candidate is a member too.</p>
```<code>select *
from Candidates c
where exists (
    select 1
    from Candidates c2
    where c2.Grp = c.Grp and c2.Key <> c.Key
       and not exists (
          select 1
          from Legitimate l
          where l.Key = c.Key
            and exists (
                select 1
                from Legitimate l2
                where l2.Grp = l.Grp and l2.Key = c2.Key
            )
      )
   )
order by Grp, Key
</code>```

Body:
I have an Oracle database application which creates lists of duplicate records for people to review, with users being able to deduplcate, leave or mark the record as being different to each other (legitimate duplicates). I need to report on the number of records in this queue.
The challenge is the legitimate duplicates as these are held on a second table of data and are held as two rows for each pair marked up (a≠b). However as duplicate groups can contain a number of duplicates, and records could be marked up a being a legitimate duplicate more than once I need to somehow remove the records that are marked up as legitimate duplicates from all the other records in a candidate group. Hopefully that is making sense.

So a simplified view of the two tables would be:
Duplicate Candidates

Group   Key
Dup-1   123
Dup-1   234
Dup-2   123
Dup-2   345
Dup-2   567
Dup-3   234
Dup-3   567
Dup-4   123
Dup-4   567
Dup-4   235

Legitimate Duplicates:

Group   Key
A       123
A       234
B       345
B       456
C       123
C       567
D       123
D       235

The results I would like to return from this example would be:

Duplicate Candidates

Group   Key
Dup-2   123
Dup-2   345
Dup-2   567
Dup-3   234
Dup-3   567
Dup-4   567
Dup-4   235

Dup-1 would not be returned as Legitimate Group A has both Keys, Dup-2 would be returned as while both Key 123 and 345 are marked up as legitimate duplicates they are not currently marked as different to each other. Dup-3 again should be returned as the two records are not marked as legitimate duplicates. Finally the row Dup-4 123 should not be returned as it is marked up as legitimate duplicate to both of the other records in the group, but they should be returned as they are not marked a legitimate duplicates of each other.

I really need to carry this out in SQL as I will feed this data into a reporting solution (Business Objects or Tablaux) directly. Is anyone able to give me a nudge in the right direction on this. Unfortunately our software is completely black box so I cannot reverse engineer this from the code that deals with this for users.

Body:
Using Exists. Return the Candidate if at least one other member of the group is not in any group of Legitimates where the tested Candidate is a member too.

select *
from Candidates c
where exists (
    select 1
    from Candidates c2
    where c2.Grp = c.Grp and c2.Key <> c.Key
       and not exists (
          select 1
          from Legitimate l
          where l.Key = c.Key
            and exists (
                select 1
                from Legitimate l2
                where l2.Grp = l.Grp and l2.Key = c2.Key
            )
      )
   )
order by Grp, Key


问:
Could managed code (specifically .NET) ever become 'unmanaged'?
Recently I was talking with a friend of mine who had started a C++ class a couple months ago (his first exposure to programming). We got onto the topic of C# and .NET generally, and he made the point to me that he felt it was 'doomed' for all of the commonly-cited issues (low speed, breakable bytecode, etc). I agreed with him on all those issues, but I held back in saying it was doomed, only because I felt that, in time, languages like C# could instead become native code (if Microsoft so chose to change the implementation of .NET from a bytecode, JIT runtime environemnent to one which compiles directly to native code like your C++ program does).

My question is, am I out to lunch here? I mean, it may take a lot of work (and may break too many things), but there isn't some type of magical barrier which prevents C# code from being compiled natively (if one wanted to do it), right? There was a time where C++ was considered a very high-level language (which it still is, but not as much as in the past) yet now it's the bedrock (along with C) for Microsoft's native APIs. The idea that .NET could one day be on the same level as C++ in that respect seems only to be a matter of time and effort to me, not some fundamental flaw in the design of the language.

EDIT: I should add that if native compilation of .NET is possible, why does Microsoft choose not to go that route? Why have they chosen the JIT bytecode path?

答:
It certainly could, but the real question is why? I mean, sure, it can be slow(er), but most of the time any major differences in performance come down to design problems (wrong algorithms, thread contention, hogging resources, etc.) rather than issues with the language. As for the "breakable" bytecode, it doesn't really seem to be a huge concern of most companies, considering adoption rates.

What it really comes down to is, what's the best tool for the job? For some, it's C++; for others, Java; for others, C#, or Python, or Erlang.

OwnerDisplayName: GRB

ContentLicense: CC BY-SA 2.5

LastEditorDisplayName: Joel Coehoorn

OwnerDisplayName: Adam Jaskiewicz


问:
websocket to prevent multiple insert?
I'm designing a reservation system. How can I handle such case if multiple users book the same time slot at the same time? do I have to use websocket? as I know in nosql db there's already a findOneAndUpdate function where it's not possible to insert redundant id into a db.</p>

答:
I'm no expert in SQL but I've had a read in this post and this may be a possible solution:

When booking, the user will try to write a row onto a MYSQL table. They will write the same information. Only 1 will succeed and the others will get a duplicate row exception. Whoever succeeds, then goes on to book.

This is only 1 possible solution, and may not be the best. I also know you are using noSQL, but I presume that the premise would be the same.

Good luck!

Title: websocket to prevent multiple insert?


问:
How to see indexes for a database or table in MySQL?
How do I see if my database has any indexes on it?

How about for a specific table?

答:
```<code>select
    table_name,
    index_name,
    seq_in_index,
    column_name,
    non_unique,
    index_type,
    comment
from
    information_schema.statistics
where 1=1
    and table_schema = 'my_schema'
    and table_name = 'my_table'
order by 1,2,3,4,5,6
</code>```


问:
removing icon from input field VeeValidate
I'm new in Vue.js and i have problem with validations. I'm using Vee-Validate framework for validations. Validation is working, but i got this red circle icon from 'is-danger' class.
Question: How to set only this red border, but without this little icon?
Look at the screenshot below:

```<code> <ValidationProvider
      :rules="{
      required: true,
      digitsRegex: /^(0|[1-9][0-9]{0,2}(?:(,[0-9]{3})*|[0-9]*))(\.[0-9]+){0,1}$/
      }"
      v-slot="{ errors, valid }"
       name="Discount"
  >
    <b-field
     :type="{ 'is-danger': errors[0], 'is-primary': valid }"
     >
      <b-input
         v-model="discount"
         step="any"
         type="text"
         :min="0"
         :max="sumWithoutDiscount"
      />
    </b-field>
       <span
           v-for="error in errors"
           :key="error.id"
           class="has-text-danger help"
       >{{ error }}</span
       >
  </ValidationProvider>
</code>```

答:
I used vee-validate3 and fixed this issue by adding

```<code>#password{
   background-image:none !important;
}
</code>```

and it worked fine, I did this because I did not want to show check or cross icon for password field, hope this answer helps you

Body:
I'm new in Vue.js and i have problem with validations. I'm using Vee-Validate framework for validations. Validation is working, but i got this red circle icon from 'is-danger' class.
Question: How to set only this red border, but without this little icon?
Look at the screenshot below:

 <ValidationProvider
      :rules="{
      required: true,
      digitsRegex: /^(0|[1-9][0-9]{0,2}(?:(,[0-9]{3})*|[0-9]*))(\.[0-9]+){0,1}$/
      }"
      v-slot="{ errors, valid }"
       name="Discount"
  >

       {{ error }}
  </ValidationProvider>

Body:
I used vee-validate3 and fixed this issue by adding

#password{
   background-image:none !important;
}

and it worked fine, I did this because I did not want to show check or cross icon for password field, hope this answer helps you


问:
dotnet core::Unable to run your project. Ensure you have a runnable project type and ensure 'dotnet run' supports this project
I have been running into an error lately trying to run some code with dotnetcore. When I try to run the project in the console (dotnet run), I get this error.

Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'.
The current OutputType is 'Exe'.

FYI, here are entries in the .csproj file

Also, I have the following skds and runtimes installed. Yet, whatever TargetFramework I set in the .csproj, I get the same error.

答:
Mine is an Azure Durable function. I got the following error when I try to run it with dotnet cli using the command dotnet run.

Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, net5.0) and have OutputType 'Exe'.
The current OutputType is 'Library'.

The solution is simple. You cannot use dotnet cli for this. Instead You need to run using the command func start as explained here.

And of course you need to install the azure function tools.


问:
Request body comming a empty object in rest api
code over here with mysql database https://gitlab.com/ramsharan.mittal/chat-service-temp . give me the following error :

```<code>java.lang.IllegalArgumentException: argument "content" is null
    at com.fasterxml.jackson.databind.ObjectMapper._assertNotNull(ObjectMapper.java:4757) ~[jackson-databind-2.12.5.jar:2.12.5]
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3515) ~[jackson-databind-2.12.5.jar:2.12.5]
    at co.seedwill.tech.chat.service.impl.ChatbotMasterDataServiceImpl.save(ChatbotMasterDataServiceImpl.java:42) ~[classes/:na]
    at co.seedwill.tech.chat.service.impl.ChatbotMasterDataServiceImpl$$FastClassBySpringCGLIB$$fad99688.invoke(<generated>) ~[classes/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.aop.logging.LoggingAspect.logAround(LoggingAspect.java:105) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.13.jar:5.3.13]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.13.jar:5.3.13]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.service.impl.ChatbotMasterDataServiceImpl$$EnhancerBySpringCGLIB$$4bb55356.save(<generated>) ~[classes/:na]
    at co.seedwill.tech.chat.web.rest.ChatbotMasterDataResource.createChatbotMasterData(ChatbotMasterDataResource.java:60) ~[classes/:na]
    at co.seedwill.tech.chat.web.rest.ChatbotMasterDataResource$$FastClassBySpringCGLIB$$e08cbc90.invoke(<generated>) ~[classes/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.aop.logging.LoggingAspect.logAround(LoggingAspect.java:105) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.web.rest.ChatbotMasterDataResource$$EnhancerBySpringCGLIB$$33d20b1a.createChatbotMasterData(<generated>) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) ~[spring-boot-actuator-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
</code>```

on following curl command:

```<code>curl --location --request POST 'http://localhost:8000/api/chatbot-master-data' \
--header 'Content-Type: application/json' \
--data-binary '@<git-repo>/src/main/resources/chatbot.json'
</code>```

looks like there is marshing issue

答:
Try once with giving whole json in the --data or save that json to a local file and give that file name with '@' in --data like below

```<code>curl --location --request POST 'http://localhost:8000/api/chatbot-master-data' \
 --header 'Content-Type: application/json' \
 --data-binary '{key:value}'
</code>```

or save it to local and use @chatbot.json to reference

```<code>curl --location --request POST 'http://localhost:8000/api/chatbot-master-data' \
--header 'Content-Type: application/json' \
--data-binary @chatbot.json
</code>```

See if this might help

Also check/validate the chatbot.json file.

Body:
code over here with mysql database https://gitlab.com/ramsharan.mittal/chat-service-temp . give me the following error :

java.lang.IllegalArgumentException: argument "content" is null
    at com.fasterxml.jackson.databind.ObjectMapper._assertNotNull(ObjectMapper.java:4757) ~[jackson-databind-2.12.5.jar:2.12.5]
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3515) ~[jackson-databind-2.12.5.jar:2.12.5]
    at co.seedwill.tech.chat.service.impl.ChatbotMasterDataServiceImpl.save(ChatbotMasterDataServiceImpl.java:42) ~[classes/:na]
    at co.seedwill.tech.chat.service.impl.ChatbotMasterDataServiceImpl$$FastClassBySpringCGLIB$$fad99688.invoke(<generated>) ~[classes/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.aop.logging.LoggingAspect.logAround(LoggingAspect.java:105) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.13.jar:5.3.13]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.13.jar:5.3.13]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.service.impl.ChatbotMasterDataServiceImpl$$EnhancerBySpringCGLIB$$4bb55356.save(<generated>) ~[classes/:na]
    at co.seedwill.tech.chat.web.rest.ChatbotMasterDataResource.createChatbotMasterData(ChatbotMasterDataResource.java:60) ~[classes/:na]
    at co.seedwill.tech.chat.web.rest.ChatbotMasterDataResource$$FastClassBySpringCGLIB$$e08cbc90.invoke(<generated>) ~[classes/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.aop.logging.LoggingAspect.logAround(LoggingAspect.java:105) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar:5.3.13]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.13.jar:5.3.13]
    at co.seedwill.tech.chat.web.rest.ChatbotMasterDataResource$$EnhancerBySpringCGLIB$$33d20b1a.createChatbotMasterData(<generated>) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.13.jar:5.3.13]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183) ~[spring-security-web-5.5.3.jar:5.5.3]
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) ~[spring-boot-actuator-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.13.jar:5.3.13]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.13.jar:5.3.13]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
    at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

on following curl command:

curl --location --request POST 'http://localhost:8000/api/chatbot-master-data' \
--header 'Content-Type: application/json' \
--data-binary '@<git-repo>/src/main/resources/chatbot.json'

looks like there is marshing issue

Body:
Try once with giving whole json in the --data or save that json to a local file and give that file name with '@' in --data like below

curl --location --request POST 'http://localhost:8000/api/chatbot-master-data' \
 --header 'Content-Type: application/json' \
 --data-binary '{key:value}'

or save it to local and use @chatbot.json to reference

curl --location --request POST 'http://localhost:8000/api/chatbot-master-data' \
--header 'Content-Type: application/json' \
--data-binary @chatbot.json

See if this might help

Also check/validate the chatbot.json file.


问:
how to set different time out limit for different sessions in php
Can we set diff time out limit for diff session variables in php?

For eg: $var1 = $_SESSION['var1'];

$var2 = $_SESSION['var2'];

I want $_SESSION['var1'] to expire after 5 mins while $_SESSION['var2'] should expire after 30 mins..

Thanks

答:
Nope, this is not possible natively.

You will have to implement this on your own. You would have to store creation date, expiry time, and value for every variable, and then maybe create a class that handles the checking.

You could use the __get() and __set() magic methods to build a very convenient interface that handles like this:

```<code>$data = new SessionData();
echo $data->var1; // Using a __get() magic method, the class checks for
                  // the expiry time and returns the value if it is still valid
</code>```

Body:
Nope, this is not possible natively.

You will have to implement this on your own. You would have to store creation date, expiry time, and value for every variable, and then maybe create a class that handles the checking.

You could use the __get() and __set() magic methods to build a very convenient interface that handles like this:

$data = new SessionData();
echo $data->var1; // Using a __get() magic method, the class checks for
                  // the expiry time and returns the value if it is still valid


问:
How to add pattern and title in input
Hi all I have following code:

```<code>   <form>
       <input type="text" id="FormField_6_input"  name="CompanyName"/>
       <button id="ContinueButton_6">Continue</button>
   </form>
   <script>
    let companyNameField = document.getElementById('FormField_6_input');
    companyNameField.setAttribute("pattern", "/[2-9]{1}\d{3}/");
    companyNameField.setAttribute("title", "invalid input");
   </script>
</code>```

I want to add pattern and title attributes to my input but it not working please help me to resolve this problem.

答:
I edited your code please review.

    let companyNameField = document.getElementById('FormField_6_input');
    companyNameField.setAttribute("pattern", "[2-9]\\d{3}" );
    companyNameField.setAttribute("title", "invalid input");```
<pre class="snippet-code-html lang-html prettyprint-override"><code> <form>
       <input type="text" id="FormField_6_input"  name="CompanyName"/>
       <button id="ContinueButton_6">Continue</button>
   </form> </code>```

Title: How to add pattern and title in input

Body:
Hi all I have following code:

   <form>
       <input type="text" id="FormField_6_input"  name="CompanyName"/>
       <button id="ContinueButton_6">Continue</button>
   </form>

I want to add pattern and title attributes to my input but it not working please help me to resolve this problem.

Body:
I edited your code please review.

    let companyNameField = document.getElementById('FormField_6_input');
    companyNameField.setAttribute("pattern", "[2-9]\\d{3}" );
    companyNameField.setAttribute("title", "invalid input");

 <form>
       <input type="text" id="FormField_6_input"  name="CompanyName"/>
       <button id="ContinueButton_6">Continue</button>
   </form>


问:
Error in installing Flask_mysqldb in PyCharm
Hi everyone I am installing Flask_mysqldb in Pycharm and I am experiencing problem.
Is seems to be the only library that I am not able to install.

答:
can you please check the details on the installation panel down there.

Another way to install package is to open terminal tap down on left of package tap and run this command

```<code>pip install flask-mysqldb
</code>```

Body:
can you please check the details on the installation panel down there.

Another way to install package is to open terminal tap down on left of package tap and run this command

pip install flask-mysqldb


问:
Apache Solr use entire string for search within collection
I have managed to create a dataset using Apache Solr. I have also managed to make queries, such as in this example:

 content:(test1 OR test2) OR title: test2

I would now like to search the dataset using an entire string, in similar fashion to searching on google. Is the correct way to approach this to keep using or tags on the title and content for each word within the query, or is there a better way to achieve this ? (I am not looking for exact matches, just the most relevant ones)

答:
You can use dismax or edismax for your approach and can pass the phrases if you have with the boosting.

The DisMax query parser is designed to process simple phrases (without
complex syntax) entered by users and to search for individual terms
across several fields using different weighting (boosts) based on the
significance of each field. Additional options enable users to
influence the score based on rules specific to each use case
(independent of user input).

The detailed parameters are found on the solr page at Solr Dismax


问:
Make div bigger then its parent
is there any way how can I make div bigger then its parent? I know its bad practice.
Basically I have div that is small and I need to create div inside which will be through entire window. But cant find way how to do it.
Thanks for any help.</p>

答:
You can do it easily. As long as the parent doesn't have overflow: hidden, you can even define its dimensions with pixels and see it working!

.parent {
  height: 40px;
  width: 40px;
  background: red;
}

.child {
  height: 100px;
  width: 100px;
  background: transparent;
  border: 1px solid green;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="parent">
  <div class="child"></div>
</div></code>```

If you want it over the entire screen, you can use vh and vw:

```<code>.child {
  height: 100vh;
  width: 100vw;
  background: transparent;
  border: 1px solid green;
}
</code>```

Title: Make div bigger then its parent

Body:
You can do it easily. As long as the parent doesn't have overflow: hidden, you can even define its dimensions with pixels and see it working!

.parent {
  height: 40px;
  width: 40px;
  background: red;
}

.child {
  height: 100px;
  width: 100px;
  background: transparent;
  border: 1px solid green;
}

<div class="parent">
  <div class="child"></div>
</div>

If you want it over the entire screen, you can use vh and vw:

.child {
  height: 100vh;
  width: 100vw;
  background: transparent;
  border: 1px solid green;
}


问:
POST method is working on POSTMAN but results are not being shown in SQL Server
I am trying to connect a Web API from Visual Studio which is connected with database using database first model but for some reason any data that I am trying to enter using POSTMAN POST method is not reflecting
back in SQL Server.

Here is the code that I wrote in VS in my Web API project:

```<code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using try43.Models;

namespace try43.Controllers
{

    public class LoginController : ApiController
    {
        [HttpPost]
        public HttpResponseMessage Login([FromBody] Customer customer)
        {
            ProjectDbContext db = new ProjectDbContext();
            db.Customers.Add(customer);
            return Request.CreateResponse(HttpStatusCode.OK, customer);
        }
    }
}
</code>```

and this is WebApIConfig.cs:

```<code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Cors;

namespace try43
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
            config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
            config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
        }
    }
}
</code>```

Postman is able to show this page:

答:
You're missing

```<code>db.SaveChanges();
</code>```

To tell EF to save your changes.

Body:
I am trying to connect a Web API from Visual Studio which is connected with database using database first model but for some reason any data that I am trying to enter using POSTMAN POST method is not reflecting
back in SQL Server.

Here is the code that I wrote in VS in my Web API project:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using try43.Models;

namespace try43.Controllers
{

    public class LoginController : ApiController
    {
        [HttpPost]
        public HttpResponseMessage Login([FromBody] Customer customer)
        {
            ProjectDbContext db = new ProjectDbContext();
            db.Customers.Add(customer);
            return Request.CreateResponse(HttpStatusCode.OK, customer);
        }
    }
}

and this is WebApIConfig.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Cors;

namespace try43
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
            config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
            config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
        }
    }
}

Postman is able to show this page:

Body:
You're missing

db.SaveChanges();

To tell EF to save your changes.


问:
I am having Issues counting values in a row with separators using SQL
I am new to snowflake and trying the count the number of values in a row with separators using SQL. I am not sure how to go about it. I've googled solutions for this but have not been able to find one.

table name: Lee_tab

user
names

id01
Jon;karl;lee;

id02
Abi;jackson;

id03
don;

id04

what I want to achieve

user
names
name_count

id01
Jon;karl;lee;
3

id02
Abi;jackson;
2

id03
don;
1

id04

0

答:
Rewriting json_stattham's answer using Snowflake syntax. Basically, we are just counting the number of separators (semicolons) in the string and adding 1. There is no need to use the SUM() function as in json_stattham's answer.</p>
```<code>with cte as (
    select 'id01' as user, 'Jon;karl;lee' as names union all
    select 'id02' as user, 'Abi;jackson' as names union all
    select 'id03' as user, 'don' as names
)
SELECT user, names, (length(names) - length(replace(names, ';'))) + 1 AS name_count
FROM cte;
</code>```

Body:
Rewriting json_stattham's answer using Snowflake syntax. Basically, we are just counting the number of separators (semicolons) in the string and adding 1. There is no need to use the SUM() function as in json_stattham's answer.

with cte as (
    select 'id01' as user, 'Jon;karl;lee' as names union all
    select 'id02' as user, 'Abi;jackson' as names union all
    select 'id03' as user, 'don' as names
)
SELECT user, names, (length(names) - length(replace(names, ';'))) + 1 AS name_count
FROM cte;