## Naming conventions for set/unset method parameter

I have some class

``````MyClass
``````

which has two methods:

``````Lock(){}
``````

and

``````Unlock(){}
``````

So far so good.

Because of reasons, the two methods are to be unified into one.

What should be the name of the parameter?

``````SetLockState(bool isLock)
``````

or

``````SetLockState(bool isLocked)
``````

or other?

This happens a lot in our code base, and I favor `isLock`, because it is the new state, but it seems there is some convention about `isLocked` which I am unfamiliar with, and would love an explanation as to why `isLocked` is the standard.

## calculus and analysis – How to use MMA to calculate the double integral of the integral area related to the parameter

I know that the `Integrate` function of MMA can compute double integrals.

``````Integrate[x*y, {x, y} ∈ Disk[]]
``````

Now I want to use MMA to calculate the result of this integral:

$$iint_{x+y<=z}{xy}mathrm{d}x mathrm{d}y$$

``````reg = ImplicitRegion[x + y <= z, {x, y}];
Integrate[x*y, {x, y} ∈ reg]
``````

But the integral area of this double integral is related to the parameter `z`, so the result of this double integral is related to the parameter `z`. I want to know how to use `MMA` to calculate this type of double integral.

## unity – Using Part of prefab as script parameter

I’m trying add a weapon to Eithan – the third person character. So I want to take his hand, which is part of the prefab Eithan (the weapon location) and use it in the my Player.cs script to Instantiate the weapon.
I created a parameter in the script for the hand: (SerializeField) GameObject weaponSocket; and I tried to Instantiate the weapon like this like this: Instantiate(weaponPrefab, weaponSocket.Transform);, but I just cant drag the hand to the parameter.

Anyone knows how to do this correctly?

Thank you!

Images: Player script: https://imgur.com/RcvKeXN
Trying to drag the left hand to the parameter (indicated by red arrows): https://imgur.com/RB63c9d

## linear algebra – What is the parameter update rule for neural networks

I am currently taking a machine learning course and had a question about the update rule for $$theta$$ in neural networks. In the discussion of previous learning algorithms, the professor defined:
$$theta := theta – alpha frac{partial J(theta)}{partial theta}$$

In the discussion of ANN classifiers, however, there was never an explicitly defined update rule, which I took to mean that it was the same as previous algorithms. If someone could verify that this is the case, that would be great. Thanks.

## how get dynamic parameter and pass data to controllers in laravel

i have a group route in laravel that get a parameter like below :

``````Route::group(('prefix' => '{ProjectCode}'),function(){
Route::get('/categories', 'CategoriesController@Categories');
});
``````

The ProjectCode is an id, that needs to get some data from the database
I want to pass the got data to controllers that they are in sub of the route group
and avoid getting data in every function in controller

## sql server – SQL Query fails when content of a single parameter change

Im very puzzled about this issue.. I have a SQL Server database with many records and it is used by my website. When the website user searches for a specific record, the SQL command gets a timeout. The only thing that is different between searches is the parameter.
Everything works within SQL Management Studio. Using newest version of SQL Server Express on a Windows Server 2016.

This fails with a timeout:

``````Query: SELECT * FROM dbo.v_MyView WHERE 1=@ONE AND Name LIKE @name Order by dbo.v_MyView.Date Desc OFFSET (0) ROWS FETCH NEXT (10) ROWS ONLY
Parameters: @ONE 1, @name flop%
``````

This works:

``````Query: SELECT * FROM dbo.v_MyView WHERE 1=@ONE AND Name LIKE @name Order by dbo.v_MyView.Date Desc OFFSET (0) ROWS FETCH NEXT (10) ROWS ONLY
Parameters: @ONE 1, @name bandit%
``````

Notice that it is only the content of the parameter @name that changes. searching for “flop%” fails and searching for “bandit%” works.

## absolute value – Let \$X\$ be a random variable with Poisson distribution of parameter \$lambda= 1\$, show that \$Eleft(left|X-1right|right)=frac{2}{e}\$

I used the definition of absolute value to say that
$$left|X-1right|=begin{cases} X-1,text{ if }X-1geq 0\ 1-X,text{ if }X-1< 0 end{cases}$$

So, I concluded that

begin{align*}Eleft(left|X-1right|right)&=Eleft(X-1right)+Eleft(1-Xright)\ &=0end{align*}

And that is wrong. How should I do it?

## Running over parameter space in Google Sheets

I’ve built a model in Google Sheets that with a few parameter cells and a few result cells. I’d like to analyze the results of the model while testing parameters over a specific range.

Is there a way for Sheets to run over ranges for two parameters and construct a table of the results?
e.g. Net present value as a function of interest rates and loan years

Note the model requires many calculations and tables and so I need some way for Sheets to scan over the parameter space (set of incremental interest rates and desecrate loan years range), recalculate the model for each parameter combination and output the value to a table.

## rest – Is it a good practice to have an endpoint URL with parameter accepting different type of values?

To add to what Ewan has said, since HTTP already has “stringly” typed parameters, so it can be impossible to parse the parameters correctly. You should aim for precision in being able to express your intent. You will already have a lot of other factors to deal with, but you don’t want to have design ambiguity as part of it.

Ewan gives the counter-example of having both siteId: 1 and siteCode: “1”. That is bad, since you will eventually run into that, and it can become more and more complex. Avoiding that will make your life easier. And even if you don’t think you will have that problem, you must have logic to determine the intent of the client, but that is backwards– the client should determine their intent and be able to express it unambiguously to you by selecting an endpoint.

A single client will almost always pick one endpoint, so removing as many edge cases from that endpoint as possible will simplify usage for your clients as well. A client would rarely want to pass a siteId and siteCode to the same endpoint.

Function overloading in normal code works because of the type encoding of parameters, when that type information does not exist, you need to have another way of expressing it.

Documenting two separate endpoints will also be easier for your users. They will usually already know what sort of data they have access to and can pass in to you. Having a clearly separated set of two endpoints with exact specifications will allow them to find the one they are looking for and use that. It will be clearly documented and straightforward to use, instead of trying to understand the type differentiation between two.