qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | I think you need qoutes around your date (i.e. '2011-06-08'). try this
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query(
"SELECT FROM tbl_event WHERE event_id = {$id} AND event_startdate <= '{$today}'
AND event_enddate >= '{$today}'");
return $query;
}
```
If... | I think u need to user date\_format(), more information in this link <http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format>.
Try this code:
```
$today = date('Y-m-d');
$query = $this->db->query("SELECT FROM tbl_event WHERE event_id = $id AND DATE_FORMAT(event_startdate ,'%Y-%m-%d')... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | ```
$this->db->where('date_start <=',date('Y-m-d'));
$this->db->where('date_end >=',date('Y-m-d'));
$query = $this->db->get('table');
``` | I think u need to user date\_format(), more information in this link <http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format>.
Try this code:
```
$today = date('Y-m-d');
$query = $this->db->query("SELECT FROM tbl_event WHERE event_id = $id AND DATE_FORMAT(event_startdate ,'%Y-%m-%d')... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | I think you need qoutes around your date (i.e. '2011-06-08'). try this
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query(
"SELECT FROM tbl_event WHERE event_id = {$id} AND event_startdate <= '{$today}'
AND event_enddate >= '{$today}'");
return $query;
}
```
If... | Looking into the errors, it seems that your queries are not escaped properly. Add single or double quotes to fix it. Check @danneth answer. Use [Query Binding](http://www.codeigniter.com/user_guide/database/queries.html#query-bindings) which is simple and secure or even more use [Active Record](http://www.codeigniter.c... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | ```
$this->db->where('date_start <=',date('Y-m-d'));
$this->db->where('date_end >=',date('Y-m-d'));
$query = $this->db->get('table');
``` | Looking into the errors, it seems that your queries are not escaped properly. Add single or double quotes to fix it. Check @danneth answer. Use [Query Binding](http://www.codeigniter.com/user_guide/database/queries.html#query-bindings) which is simple and secure or even more use [Active Record](http://www.codeigniter.c... |
6,288,261 | How can I get values between two dates in Codeigniter query function? Here is my model and sample code.
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query('SELECT FROM tbl_event WHERE event_id = $id AND event_startdate <= $today
AND event_enddate >= $today');
return $query;
}
... | 2011/06/09 | [
"https://Stackoverflow.com/questions/6288261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415699/"
] | I think you need qoutes around your date (i.e. '2011-06-08'). try this
```
function get_promo() {
$today = date('Y-m-d');
$query = $this->db->query(
"SELECT FROM tbl_event WHERE event_id = {$id} AND event_startdate <= '{$today}'
AND event_enddate >= '{$today}'");
return $query;
}
```
If... | ```
$this->db->where('date_start <=',date('Y-m-d'));
$this->db->where('date_end >=',date('Y-m-d'));
$query = $this->db->get('table');
``` |
339,763 | This is a simple linear fit between height as independent variable and density as dependent variable. I want to know if I can trust that I can use simple linear regression. Goodness of fit shows that the model fits very good.
The residual plot shows high residuals on the highest and lowest y values. How can I find out ... | 2018/04/10 | [
"https://stats.stackexchange.com/questions/339763",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/202403/"
] | If you look at the plot of residuals versus fitted values, you will see that most of the residuals are negative (hence located below the horizontal line going through zero). This suggests that your model tends to overestimate the mean value of density at a given height and it can't be trusted for estimation or predicti... | Consider to **rescale** your independent variable as it's too big for the y-axis. You're forcing your slope to zero, so your model is marginally better than the only-intercept model. Rescale it to something like **Hoyde per 1000.** |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | Only devices with API29 provide more biometric options than fingerprint.
By checking the `android.hardware.biometrics.BiometricManager.hasBiometrics()` (API29) you can understand how to inspect what biometrics are available:
```
final PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature... | The `BiometricManager` API seems to be designed so that the calling app must be agnostic to the authentication method used. So that it does not make a difference how user authenticates as long as he succeeds (along with this come requirements for strong authentication on the vendor side <https://source.android.com/secu... |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | It seems that it is not possible to find out the actual biometric method being used on Android (unlike on iOS). But it is possible to detect supported biometric methods on Android 10:
```
PackageManager pm = context.getPackageManager();
boolean hasFingerprint = pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT);
... | The `BiometricManager` API seems to be designed so that the calling app must be agnostic to the authentication method used. So that it does not make a difference how user authenticates as long as he succeeds (along with this come requirements for strong authentication on the vendor side <https://source.android.com/secu... |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | The `BiometricManager` API seems to be designed so that the calling app must be agnostic to the authentication method used. So that it does not make a difference how user authenticates as long as he succeeds (along with this come requirements for strong authentication on the vendor side <https://source.android.com/secu... | [The official recommendation](https://medium.com/@isaidamier/migrating-from-fingerprintmanager-to-biometricprompt-4bc5f570dccd) is that you use the [AndroidX Biometric Library](https://developer.android.com/jetpack/androidx/releases/biometric). It comes with a standard UI that handles form-factors for you. Essentially ... |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | The `BiometricManager` API seems to be designed so that the calling app must be agnostic to the authentication method used. So that it does not make a difference how user authenticates as long as he succeeds (along with this come requirements for strong authentication on the vendor side <https://source.android.com/secu... | Using `PackageManager` allows to check which biometrics are supported. [Here](https://handstandsam.com/2020/01/03/android-biometrics-ux-guide-user-messaging/) is an article proposing how to deal with showing strings which are understandable for the user. |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | Only devices with API29 provide more biometric options than fingerprint.
By checking the `android.hardware.biometrics.BiometricManager.hasBiometrics()` (API29) you can understand how to inspect what biometrics are available:
```
final PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature... | It seems that it is not possible to find out the actual biometric method being used on Android (unlike on iOS). But it is possible to detect supported biometric methods on Android 10:
```
PackageManager pm = context.getPackageManager();
boolean hasFingerprint = pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT);
... |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | Only devices with API29 provide more biometric options than fingerprint.
By checking the `android.hardware.biometrics.BiometricManager.hasBiometrics()` (API29) you can understand how to inspect what biometrics are available:
```
final PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature... | [The official recommendation](https://medium.com/@isaidamier/migrating-from-fingerprintmanager-to-biometricprompt-4bc5f570dccd) is that you use the [AndroidX Biometric Library](https://developer.android.com/jetpack/androidx/releases/biometric). It comes with a standard UI that handles form-factors for you. Essentially ... |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | Only devices with API29 provide more biometric options than fingerprint.
By checking the `android.hardware.biometrics.BiometricManager.hasBiometrics()` (API29) you can understand how to inspect what biometrics are available:
```
final PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature... | Using `PackageManager` allows to check which biometrics are supported. [Here](https://handstandsam.com/2020/01/03/android-biometrics-ux-guide-user-messaging/) is an article proposing how to deal with showing strings which are understandable for the user. |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | It seems that it is not possible to find out the actual biometric method being used on Android (unlike on iOS). But it is possible to detect supported biometric methods on Android 10:
```
PackageManager pm = context.getPackageManager();
boolean hasFingerprint = pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT);
... | [The official recommendation](https://medium.com/@isaidamier/migrating-from-fingerprintmanager-to-biometricprompt-4bc5f570dccd) is that you use the [AndroidX Biometric Library](https://developer.android.com/jetpack/androidx/releases/biometric). It comes with a standard UI that handles form-factors for you. Essentially ... |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | It seems that it is not possible to find out the actual biometric method being used on Android (unlike on iOS). But it is possible to detect supported biometric methods on Android 10:
```
PackageManager pm = context.getPackageManager();
boolean hasFingerprint = pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT);
... | Using `PackageManager` allows to check which biometrics are supported. [Here](https://handstandsam.com/2020/01/03/android-biometrics-ux-guide-user-messaging/) is an article proposing how to deal with showing strings which are understandable for the user. |
58,621,021 | Assume that i put `' 123abc'` as input in C++ console application.
if i get input as
```
int a; char ch;
scanf("%d", &a);
scanf("%ch", &ch);
```
i got 123 in a, 'a' in ch. Right?
Then, where does 4 blanks go? scanf just blow away blanks?
Is there no way can i get that blanks after i get 123abc?
To sum it up my qu... | 2019/10/30 | [
"https://Stackoverflow.com/questions/58621021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12295807/"
] | [The official recommendation](https://medium.com/@isaidamier/migrating-from-fingerprintmanager-to-biometricprompt-4bc5f570dccd) is that you use the [AndroidX Biometric Library](https://developer.android.com/jetpack/androidx/releases/biometric). It comes with a standard UI that handles form-factors for you. Essentially ... | Using `PackageManager` allows to check which biometrics are supported. [Here](https://handstandsam.com/2020/01/03/android-biometrics-ux-guide-user-messaging/) is an article proposing how to deal with showing strings which are understandable for the user. |
173,506 | I want to get a **prefab asset** (that resides in **Project Window**) and assign it to a field like the one you get when you manually drag the prefab asset from **Project Window** to GameObject field:
[](https://i.stack.imgur.com/TRDwa.png)
But when ... | 2019/07/07 | [
"https://gamedev.stackexchange.com/questions/173506",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/123486/"
] | If I understand what you want to do, then I think you want to use PrefabUtility.[GetPrefabAssetPathOfNearestInstanceRoot](https://docs.unity3d.com/ScriptReference/PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot.html) in combination with AssetDatabase.[LoadAssetAtPath](https://docs.unity3d.com/ScriptReference/Asse... | If you want to find prefab variant of an instance you should use
```
PrefabUtility.GetCorrespondingObjectFromSource(YourPrefabInstance)
```
If you want to find orginal prefab of an instance you should use
```
PrefabUtility.GetCorrespondingObjectFromOriginalSource(YourPrefabInstance)
```
It will work only in Edito... |
28,728,891 | Have the following C# code for loading and unloading a C++ DLL.
I load DLL only once, but code has to unload DLL 2 times. Also after unloading DLL, when I load it again, and I call DLL's exported function, I get the following error message:
>
> Attempted to read or write protected memory. This is often an indicati... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28728891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405291/"
] | If you only call LoadLibrary once then you only need to call FreeLibrary once as well. Calling it a second time is moving into undefined behavior.
If you look at the MSDN docs <https://msdn.microsoft.com/en-us/library/windows/desktop/ms683152%28v=vs.85%29.aspx> the function returns a non zero value if it succeeds, or ... | According to <https://msdn.microsoft.com/en-us/library/windows/desktop/ms683152%28v=vs.85%29.aspx> (the first google hit) `If the function succeeds, the return value is nonzero.` Your unload loop basically says "as long as freeing the library worked, free it again, until the unload fails". |
28,728,891 | Have the following C# code for loading and unloading a C++ DLL.
I load DLL only once, but code has to unload DLL 2 times. Also after unloading DLL, when I load it again, and I call DLL's exported function, I get the following error message:
>
> Attempted to read or write protected memory. This is often an indicati... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28728891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405291/"
] | The update to your question provides enough information to explain the behaviour.
1. You call `LoadLibrary` to load your DLL which accounts for one of the references.
2. You call `DllImport` p/invoke functions which in turn lead to a call to `LoadLibrary`. That's the other reference to the library.
3. Then when you ca... | According to <https://msdn.microsoft.com/en-us/library/windows/desktop/ms683152%28v=vs.85%29.aspx> (the first google hit) `If the function succeeds, the return value is nonzero.` Your unload loop basically says "as long as freeing the library worked, free it again, until the unload fails". |
28,728,891 | Have the following C# code for loading and unloading a C++ DLL.
I load DLL only once, but code has to unload DLL 2 times. Also after unloading DLL, when I load it again, and I call DLL's exported function, I get the following error message:
>
> Attempted to read or write protected memory. This is often an indicati... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28728891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405291/"
] | I know that this question come to completion, but working on a similar problem I have found a way to load and unload library dynamically using DllImport and without exceptions.
The approach is based on these stakeholders:
**- the DllImport load the library on the first call to a method wrapped.
- if a library is... | According to <https://msdn.microsoft.com/en-us/library/windows/desktop/ms683152%28v=vs.85%29.aspx> (the first google hit) `If the function succeeds, the return value is nonzero.` Your unload loop basically says "as long as freeing the library worked, free it again, until the unload fails". |
28,728,891 | Have the following C# code for loading and unloading a C++ DLL.
I load DLL only once, but code has to unload DLL 2 times. Also after unloading DLL, when I load it again, and I call DLL's exported function, I get the following error message:
>
> Attempted to read or write protected memory. This is often an indicati... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28728891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405291/"
] | The update to your question provides enough information to explain the behaviour.
1. You call `LoadLibrary` to load your DLL which accounts for one of the references.
2. You call `DllImport` p/invoke functions which in turn lead to a call to `LoadLibrary`. That's the other reference to the library.
3. Then when you ca... | If you only call LoadLibrary once then you only need to call FreeLibrary once as well. Calling it a second time is moving into undefined behavior.
If you look at the MSDN docs <https://msdn.microsoft.com/en-us/library/windows/desktop/ms683152%28v=vs.85%29.aspx> the function returns a non zero value if it succeeds, or ... |
28,728,891 | Have the following C# code for loading and unloading a C++ DLL.
I load DLL only once, but code has to unload DLL 2 times. Also after unloading DLL, when I load it again, and I call DLL's exported function, I get the following error message:
>
> Attempted to read or write protected memory. This is often an indicati... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28728891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405291/"
] | The update to your question provides enough information to explain the behaviour.
1. You call `LoadLibrary` to load your DLL which accounts for one of the references.
2. You call `DllImport` p/invoke functions which in turn lead to a call to `LoadLibrary`. That's the other reference to the library.
3. Then when you ca... | I know that this question come to completion, but working on a similar problem I have found a way to load and unload library dynamically using DllImport and without exceptions.
The approach is based on these stakeholders:
**- the DllImport load the library on the first call to a method wrapped.
- if a library is... |
50,145 | I began working at this place in June 2013. Had a steady relationship with the employer for at least a year. So much so that the supervisor, indirect supervisors, and a senior colleague provided B-School recommendations which I'm very thankful for.
Around late fall of last year the supervisor found some performance i... | 2015/07/25 | [
"https://workplace.stackexchange.com/questions/50145",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/38374/"
] | >
> People, what's your take on this? Resign as I know my performance will
> not get better or wait to get fired?
>
>
>
For me, I'd do neither. **I would neither resign nor wait.**
I'd work really hard to get a new job (or land a contract gig) over the next 90 days before getting fired. That way, I wouldn't ever... | Note that a proper PIP should spell out exactly what you have to accomplish, in how much time, to pass it. You may want to wait until you see the details before you panic. A PIP *can* be survived, if the problem was one of misunderstood requirements rather than your not being able to handle the job; it's likely to be p... |
15,351,127 | I want to generate a `<select>` menu of `Vendor` options in my `_navigation.html.erb` partial that will show up on every page.
This is the HTML I would like to produce:
```
<form>
<select>
<option value="">Browse by Store</option>
<option value="Apple">Apple</option>
<option value="Deisel">Dei... | 2013/03/12 | [
"https://Stackoverflow.com/questions/15351127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91970/"
] | I don't understand why you do you want to use a form to build theses links, and also why use theses links with your application controller. If you want to change links displayed by each product page you can do it this way :
```
<ul class="nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle"
data-tog... | Put your controller code in your application\_controller.rb then create a folder in your views folder called application and put your partial files inside that.
<http://railscasts.com/episodes/269-template-inheritance>
I'm not familiar with simple form but railscasts also has a nice how to on using simple form.
<htt... |
60,759,318 | I'm using [azure-sdk-js](https://github.com/Azure/azure-sdk-for-js) for reading and sending messages to Azure Service Bus Queues.
I've successfully managed to connect to queues, reading messages, reading DLQ and sending messages. I would like to extend this to show information about how many messages that exist in eac... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60759318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760402/"
] | So `@azure/service-bus` package essentially provides AMQP based connectivity to Azure Service Bus and has only methods to mainly work with messages. Functionality to manage entities (Queues, Topics, and Subscriptions) has been removed from this package.
You basically have three options:
1. Use `@azure/arm-servicebus`... | You can use REST Api and the GET operation:
<https://learn.microsoft.com/en-us/rest/api/servicebus/queues/get>
The information you're looking for is inside Message Count Details:
<https://learn.microsoft.com/en-us/rest/api/servicebus/queues/get#messagecountdetails> |
60,759,318 | I'm using [azure-sdk-js](https://github.com/Azure/azure-sdk-for-js) for reading and sending messages to Azure Service Bus Queues.
I've successfully managed to connect to queues, reading messages, reading DLQ and sending messages. I would like to extend this to show information about how many messages that exist in eac... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60759318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760402/"
] | A few interfaces like `QueueDetails` got exposed by accident from the `@azure/service-bus` package in version 1.1.3. The ATOM management client that uses these interfaces is still under works and therefore is not part of the exported public facing API surface. We have a working implementation, but the final design for ... | You can use REST Api and the GET operation:
<https://learn.microsoft.com/en-us/rest/api/servicebus/queues/get>
The information you're looking for is inside Message Count Details:
<https://learn.microsoft.com/en-us/rest/api/servicebus/queues/get#messagecountdetails> |
60,759,318 | I'm using [azure-sdk-js](https://github.com/Azure/azure-sdk-for-js) for reading and sending messages to Azure Service Bus Queues.
I've successfully managed to connect to queues, reading messages, reading DLQ and sending messages. I would like to extend this to show information about how many messages that exist in eac... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60759318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760402/"
] | So `@azure/service-bus` package essentially provides AMQP based connectivity to Azure Service Bus and has only methods to mainly work with messages. Functionality to manage entities (Queues, Topics, and Subscriptions) has been removed from this package.
You basically have three options:
1. Use `@azure/arm-servicebus`... | I check the sdk, there is a [serviceBusAtomManagementClient](https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-service-bus/1.1.3/classes/servicebusatommanagementclient.html), it has the [getQueueDetails](https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-service-bus/1.1.3/classes/servicebus... |
60,759,318 | I'm using [azure-sdk-js](https://github.com/Azure/azure-sdk-for-js) for reading and sending messages to Azure Service Bus Queues.
I've successfully managed to connect to queues, reading messages, reading DLQ and sending messages. I would like to extend this to show information about how many messages that exist in eac... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60759318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760402/"
] | A few interfaces like `QueueDetails` got exposed by accident from the `@azure/service-bus` package in version 1.1.3. The ATOM management client that uses these interfaces is still under works and therefore is not part of the exported public facing API surface. We have a working implementation, but the final design for ... | I check the sdk, there is a [serviceBusAtomManagementClient](https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-service-bus/1.1.3/classes/servicebusatommanagementclient.html), it has the [getQueueDetails](https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-service-bus/1.1.3/classes/servicebus... |
105,997 | I want put right headed double arrow between first two columns of the table

My code:
```
\documentclass[12pt,a4paper]{article}
\usepackage{algorithmic,algorithm,amsmath} %for mathematics %
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{booktabs}
\... | 2013/03/30 | [
"https://tex.stackexchange.com/questions/105997",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/28186/"
] | You can use `@{<symbol>}` as in `\begin{tabular}{l@{$\Longrightarrow\,\,\,$}ld{5}d{3}d{5}d{3}}`. This won't work if you use `\multicolumn{1}{l}{LCO2}` as in the last line. I have used `dcolumn` and aligned numbers around `.` .
```
\documentclass[12pt,a4paper]{article}
\usepackage{mathtools}
\usepackage{booktabs}
\usep... | You can always add a new column in between and populate it with the symbol you want.
How to look up a symbol?
[How to look up a symbol?](https://tex.stackexchange.com/q/14)
Importing a Single Symbol From a Different Font
[Importing a Single Symbol From a Different Font](https://tex.stackexchange.com/q/14386)
How do ... |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | To add to the answers above, the App Domain is required for security reasons. For example, your app has been sending the browser to `"www.example.com/PAGE_NAME_HERE"`, but suddenly a third party application (or something else) sends the user to `"www.supposedlymaliciouswebsite.com/PAGE_HERE"`, then a 191 error is throw... | it stands for your website where your app is running on.
like you have made an app www.xyz.pqr
then you will type this www.xyz.pqr in App domain
the site where your app is running on should be secure and valid |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | the app domain is your domain name.
Before you enter your domain, first click on Add Platform, select website, enter your site URL and mobile site url. Save the settings.
Thereafter, you can enter the domain name in the App domains field.
See more at my blog: <http://www.ogbongeblog.com/2014/03/unable-to-add-app-d... | To add to the answers above, the App Domain is required for security reasons. For example, your app has been sending the browser to `"www.example.com/PAGE_NAME_HERE"`, but suddenly a third party application (or something else) sends the user to `"www.supposedlymaliciouswebsite.com/PAGE_HERE"`, then a 191 error is throw... |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | it stands for your website where your app is running on.
like you have made an app www.xyz.pqr
then you will type this www.xyz.pqr in App domain
the site where your app is running on should be secure and valid | I think it is the domain that you run your app.
For example, your canvas URL is facebook.yourdomain.com, you should give App domain as .yourdomain.com |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | the app domain is your domain name.
Before you enter your domain, first click on Add Platform, select website, enter your site URL and mobile site url. Save the settings.
Thereafter, you can enter the domain name in the App domains field.
See more at my blog: <http://www.ogbongeblog.com/2014/03/unable-to-add-app-d... | I think it is the domain that you run your app.
For example, your canvas URL is facebook.yourdomain.com, you should give App domain as .yourdomain.com |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | To add to the answers above, the App Domain is required for security reasons. For example, your app has been sending the browser to `"www.example.com/PAGE_NAME_HERE"`, but suddenly a third party application (or something else) sends the user to `"www.supposedlymaliciouswebsite.com/PAGE_HERE"`, then a 191 error is throw... | It's simply the domain that your "facebook" application (wich means application visible on facebook but hosted on the website www.xyz.com) will be hosted. So you can put App Domain = www.xyz.com |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | If you don't specify the ***platform*** for the app you won't able to add app domain correctly.
Here is an example -- validate that its a type a website platform.
[](https://i.stack.imgur.com/Tapwm.png) | In this example:
http://**www.example.com:80**/somepage?parameter1="hello"¶meter2="world"
the bold part is the Domainname. 80 is rarely included. I post it since many people may wonder if 3000 or some other port is part of the domain if their not staging their app for production yet. Normally you don't specify i... |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | It's simply the domain that your "facebook" application (wich means application visible on facebook but hosted on the website www.xyz.com) will be hosted. So you can put App Domain = www.xyz.com | I think it is the domain that you run your app.
For example, your canvas URL is facebook.yourdomain.com, you should give App domain as .yourdomain.com |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | the app domain is your domain name.
Before you enter your domain, first click on Add Platform, select website, enter your site URL and mobile site url. Save the settings.
Thereafter, you can enter the domain name in the App domains field.
See more at my blog: <http://www.ogbongeblog.com/2014/03/unable-to-add-app-d... | it stands for your website where your app is running on.
like you have made an app www.xyz.pqr
then you will type this www.xyz.pqr in App domain
the site where your app is running on should be secure and valid |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | If you don't specify the ***platform*** for the app you won't able to add app domain correctly.
Here is an example -- validate that its a type a website platform.
[](https://i.stack.imgur.com/Tapwm.png) | I think it is the domain that you run your app.
For example, your canvas URL is facebook.yourdomain.com, you should give App domain as .yourdomain.com |
8,574,347 | I need to get user download some file (for example, PDF). What will be longer:
* send this file by PHP (with specific headers),
* or put it in http public folder, and get user the public link to download it (without PHP help)?
In 1st case the original file could be in private zone.
But I'm thinking it will take some... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8574347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016265/"
] | the app domain is your domain name.
Before you enter your domain, first click on Add Platform, select website, enter your site URL and mobile site url. Save the settings.
Thereafter, you can enter the domain name in the App domains field.
See more at my blog: <http://www.ogbongeblog.com/2014/03/unable-to-add-app-d... | If you don't specify the ***platform*** for the app you won't able to add app domain correctly.
Here is an example -- validate that its a type a website platform.
[](https://i.stack.imgur.com/Tapwm.png) |
42,405,653 | My python script is like this:
```
def main():
ret = [1, 2]
return ret
```
and I call the python script from ruby like this:
```
output = system("python script.py")
print output
```
However the value of output is true. I want to get [1, 2]. My question is how I can get the return value of the python script... | 2017/02/23 | [
"https://Stackoverflow.com/questions/42405653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1319283/"
] | First, have your Python script print the value rather than returning it, or add `print main()` at the bottom so the return value of `main()` gets printed.
Second, on the Ruby side, execute it with backticks rather than the `system()` function, like this:
```
output = `python script.py`
```
This captures the output ... | If you have the Python script `print` its result, then then it will be captured in `result`. This is the "standard out" i.e. StdOut, it's what ruby's `system` reads.
You also need to have the python script actually call the method when it's run from the command line.
*edit*
My mistake, use backticks instead of `sy... |
42,405,653 | My python script is like this:
```
def main():
ret = [1, 2]
return ret
```
and I call the python script from ruby like this:
```
output = system("python script.py")
print output
```
However the value of output is true. I want to get [1, 2]. My question is how I can get the return value of the python script... | 2017/02/23 | [
"https://Stackoverflow.com/questions/42405653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1319283/"
] | This is python test.py
```
import sys
def main():
ret = [1, 2]
print >> sys.stdout, ret
main()
```
This is ruby code test.rb
```
require 'open3'
require 'json'
stdin, stdout, stderr = Open3.popen3("python test.py")
stdout.each do |ele|
p ele #=> "[1, 2]\n"
p JSON.parse(ele) #=> [1, 2]
end
```
Then exe... | If you have the Python script `print` its result, then then it will be captured in `result`. This is the "standard out" i.e. StdOut, it's what ruby's `system` reads.
You also need to have the python script actually call the method when it's run from the command line.
*edit*
My mistake, use backticks instead of `sy... |
42,405,653 | My python script is like this:
```
def main():
ret = [1, 2]
return ret
```
and I call the python script from ruby like this:
```
output = system("python script.py")
print output
```
However the value of output is true. I want to get [1, 2]. My question is how I can get the return value of the python script... | 2017/02/23 | [
"https://Stackoverflow.com/questions/42405653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1319283/"
] | First, have your Python script print the value rather than returning it, or add `print main()` at the bottom so the return value of `main()` gets printed.
Second, on the Ruby side, execute it with backticks rather than the `system()` function, like this:
```
output = `python script.py`
```
This captures the output ... | This is python test.py
```
import sys
def main():
ret = [1, 2]
print >> sys.stdout, ret
main()
```
This is ruby code test.rb
```
require 'open3'
require 'json'
stdin, stdout, stderr = Open3.popen3("python test.py")
stdout.each do |ele|
p ele #=> "[1, 2]\n"
p JSON.parse(ele) #=> [1, 2]
end
```
Then exe... |
69,887,072 | I am working on a node project where I have imported pg library for database operations. I have a Kafka queue from where I fetch events and store them in the database. I am fetching orders from kafka and every time an order is updated a new event is generated, I need to delete the old order details and replace them wit... | 2021/11/08 | [
"https://Stackoverflow.com/questions/69887072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5759359/"
] | ```
alias(summarize(sumSeries(exclude(stats.checkout-*.*.*.*.*),"checkout-es"), '$time', 'sum', false), 'checkout')
```
This should be work.
<https://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.exclude> | If you don't need alerts you could use transformations
Filter data by name
Filter data by query
Filter data by value
<https://grafana.com/docs/grafana/latest/panels/transformations/> |
13,763,522 | I've developed a service that allows users to search for stores on www.mysite.com.
I also have partners that uses my service. To the user, it looks like they are on my partners web site, when in fact they are on my site. I have only replaced my own header and footer, with my partners header and footer.
For the user, i... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13763522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91612/"
] | Definitely. You'll want to use canonical tagging to stop this happening.
<http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394> | Yes. It will be considered as duplicate content by Google. Cause you have replaced only footer and header. By recent Google algorithm, content should be unique for website or even blog. If content is not unique, your website will be penalized by Google. |
13,763,522 | I've developed a service that allows users to search for stores on www.mysite.com.
I also have partners that uses my service. To the user, it looks like they are on my partners web site, when in fact they are on my site. I have only replaced my own header and footer, with my partners header and footer.
For the user, i... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13763522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91612/"
] | It's duplicate content but there is no penalty as such.
The problem is, for a specific search Google will pick one version of a page and filter out the others from the results. If your partner is targeting the same region then you are in direct competition.
The canonical tag is a way to tell Google which is the offic... | Yes. It will be considered as duplicate content by Google. Cause you have replaced only footer and header. By recent Google algorithm, content should be unique for website or even blog. If content is not unique, your website will be penalized by Google. |
13,763,522 | I've developed a service that allows users to search for stores on www.mysite.com.
I also have partners that uses my service. To the user, it looks like they are on my partners web site, when in fact they are on my site. I have only replaced my own header and footer, with my partners header and footer.
For the user, i... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13763522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91612/"
] | It's duplicate content but there is no penalty as such.
The problem is, for a specific search Google will pick one version of a page and filter out the others from the results. If your partner is targeting the same region then you are in direct competition.
The canonical tag is a way to tell Google which is the offic... | Definitely. You'll want to use canonical tagging to stop this happening.
<http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394> |
6,894,117 | I'm writing a program where I'm having to test if one set of unique integers `A` belongs to another set of unique numbers `B`. However, this operation might be done several hundred times per second, so I'm looking for an efficient algorithm to do it.
For example, if `A = [1 2 3]` and `B = [1 2 3 4]`, it is true, but i... | 2011/08/01 | [
"https://Stackoverflow.com/questions/6894117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/377160/"
] | The asymptotically fastest approach would be to just put each set in a hash table and query each element, which is `O(N)` time. You cannot do better (since it will take that much time to read the data).
Most set datastructures already support expected and/or amortized O(1) query time. Some languages even support this ... | Let A and B be two sets, and you want to check if A is a subset of B. The first idea that pops into my mind is to sort both sets and then simply check if every element of A is contained in B, as following:
Let n\_A and n\_B be the cardinality of A and B, respectively. Let i\_A = 1, i\_B = 1. Then the following algorit... |
6,894,117 | I'm writing a program where I'm having to test if one set of unique integers `A` belongs to another set of unique numbers `B`. However, this operation might be done several hundred times per second, so I'm looking for an efficient algorithm to do it.
For example, if `A = [1 2 3]` and `B = [1 2 3 4]`, it is true, but i... | 2011/08/01 | [
"https://Stackoverflow.com/questions/6894117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/377160/"
] | The asymptotically fastest approach would be to just put each set in a hash table and query each element, which is `O(N)` time. You cannot do better (since it will take that much time to read the data).
Most set datastructures already support expected and/or amortized O(1) query time. Some languages even support this ... | I'll present an O(m+n) time-per-test algorithm. But first, two notes regarding the problem statement:
Note 1 - Your edits say that set sizes may be a few thousand, and numbers may range up to a million or two.
In following, let m, n denote the sizes of sets A, B and let R denote the size of the largest numbers allowed... |
6,894,117 | I'm writing a program where I'm having to test if one set of unique integers `A` belongs to another set of unique numbers `B`. However, this operation might be done several hundred times per second, so I'm looking for an efficient algorithm to do it.
For example, if `A = [1 2 3]` and `B = [1 2 3 4]`, it is true, but i... | 2011/08/01 | [
"https://Stackoverflow.com/questions/6894117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/377160/"
] | The asymptotically fastest approach would be to just put each set in a hash table and query each element, which is `O(N)` time. You cannot do better (since it will take that much time to read the data).
Most set datastructures already support expected and/or amortized O(1) query time. Some languages even support this ... | Given the limit on the size of the integers, if the set of B sets is small and changes seldom, consider representing the B sets as bitsets (bit arrays indexed by integer set member). This doesn't require sorting, and the test for each element is very fast.
If the A members are sorted and tend to be clustered together... |
37,122,348 | This is my situation in psuedo code
```
<div data-ng-controller="test">
<div isolated-directive>
<select ng-model="testControllerScopeVar">...</select>
</div>
<div ng-if="some condition that uses testControllerScopeVar"></div>
</div>
```
This worked perfectly before I added `isolated-directive... | 2016/05/09 | [
"https://Stackoverflow.com/questions/37122348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058134/"
] | Well it seems once I know the solution, it is so simple
```
<div data-ng-controller="test as testCtrl">
<div isolated-directive>
<select ng-model="testCtrl.testControllerScopeVar">...</select>
</div>
<div ng-if="testCtrl.testControllerScopeVar == 'whatever'"></div>
</div>
```
ControllerAs allo... | One approach is to map the controller variable into your isolated scope and attach the isolated scope variable to your internal `ng-model`.
So your HTML would look like this:
```
<div data-ng-controller="test">
<div isolated-directive="testControllerScopeVar">
<select ng-model="isolatedScopeVar">...</sel... |
37,122,348 | This is my situation in psuedo code
```
<div data-ng-controller="test">
<div isolated-directive>
<select ng-model="testControllerScopeVar">...</select>
</div>
<div ng-if="some condition that uses testControllerScopeVar"></div>
</div>
```
This worked perfectly before I added `isolated-directive... | 2016/05/09 | [
"https://Stackoverflow.com/questions/37122348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058134/"
] | Well it seems once I know the solution, it is so simple
```
<div data-ng-controller="test as testCtrl">
<div isolated-directive>
<select ng-model="testCtrl.testControllerScopeVar">...</select>
</div>
<div ng-if="testCtrl.testControllerScopeVar == 'whatever'"></div>
</div>
```
ControllerAs allo... | You can try jQuery to get the value and assign it to a new scope variable. Something like this
HTML
```
<div ng-app="TestApp">
<div data-ng-controller="test">
<div isolated-directive>
<input id="isolatedVar" ng-model="testControllerScopeVar" />
</div>
<div>
{{isolatedVar}}
</div>
</div... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | If you are new to C++, it may be desirable to shy away from doing big work in a constructor. Constructors are wedded tightly to the way the language behaves, and you really don't want the constructor getting called unexpectedly (`explicit` is your friend!). Constructors are also rather unique in that they cannot return... | I don't think I would read a file in the constructor for a couple of reasons:
1. it will significantly slow down object creation and potentially the
startup of your program.
2. as you mentioned, there are limited options for error handling. You would have to either put the entire program in a try...catch block or set... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | When seeing a class with a constructor signature like
```
EnglishWordsListGenerator(const std::string &wordFileName)
```
I think it is pretty obvious that this constructor will read the given file (and so need some time), and it should not be to hard to understand that the caller has to care for possible exceptions... | I don't think I would read a file in the constructor for a couple of reasons:
1. it will significantly slow down object creation and potentially the
startup of your program.
2. as you mentioned, there are limited options for error handling. You would have to either put the entire program in a try...catch block or set... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | It's not a good practice to load an object from a file in the constructor.
Beyond the good C++ arguments in the other answers, I'd add a clean code principle: *[a function should do only one thing](http://www.itiseezee.com/?p=119)*. Ok, the constructor is not a normal function, but the principle still applies.
I sug... | I don't think I would read a file in the constructor for a couple of reasons:
1. it will significantly slow down object creation and potentially the
startup of your program.
2. as you mentioned, there are limited options for error handling. You would have to either put the entire program in a try...catch block or set... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | I don't think I would read a file in the constructor for a couple of reasons:
1. it will significantly slow down object creation and potentially the
startup of your program.
2. as you mentioned, there are limited options for error handling. You would have to either put the entire program in a try...catch block or set... | If the constructor does a lot of work, then there can be exceptions. In C++, exception in a constructor can be handled, but in practice you wouldn’t know how to do it correctly, and it is an absolute pain.
Much easier to write a factory method or even just a plain function that creates an object on the heap, reads a f... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | When seeing a class with a constructor signature like
```
EnglishWordsListGenerator(const std::string &wordFileName)
```
I think it is pretty obvious that this constructor will read the given file (and so need some time), and it should not be to hard to understand that the caller has to care for possible exceptions... | If you are new to C++, it may be desirable to shy away from doing big work in a constructor. Constructors are wedded tightly to the way the language behaves, and you really don't want the constructor getting called unexpectedly (`explicit` is your friend!). Constructors are also rather unique in that they cannot return... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | If you are new to C++, it may be desirable to shy away from doing big work in a constructor. Constructors are wedded tightly to the way the language behaves, and you really don't want the constructor getting called unexpectedly (`explicit` is your friend!). Constructors are also rather unique in that they cannot return... | If the constructor does a lot of work, then there can be exceptions. In C++, exception in a constructor can be handled, but in practice you wouldn’t know how to do it correctly, and it is an absolute pain.
Much easier to write a factory method or even just a plain function that creates an object on the heap, reads a f... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | When seeing a class with a constructor signature like
```
EnglishWordsListGenerator(const std::string &wordFileName)
```
I think it is pretty obvious that this constructor will read the given file (and so need some time), and it should not be to hard to understand that the caller has to care for possible exceptions... | It's not a good practice to load an object from a file in the constructor.
Beyond the good C++ arguments in the other answers, I'd add a clean code principle: *[a function should do only one thing](http://www.itiseezee.com/?p=119)*. Ok, the constructor is not a normal function, but the principle still applies.
I sug... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | When seeing a class with a constructor signature like
```
EnglishWordsListGenerator(const std::string &wordFileName)
```
I think it is pretty obvious that this constructor will read the given file (and so need some time), and it should not be to hard to understand that the caller has to care for possible exceptions... | If the constructor does a lot of work, then there can be exceptions. In C++, exception in a constructor can be handled, but in practice you wouldn’t know how to do it correctly, and it is an absolute pain.
Much easier to write a factory method or even just a plain function that creates an object on the heap, reads a f... |
343,820 | So, I am trying to create an English language trie data structure implementation in C++. I have created a `Trie` and `TrieNode` class. The `TrieNode` class takes in its constructor a `vector<string>` that is a list of words to construct the Trie from.
My solution to getting this `vector<string>` was to use an `English... | 2017/03/09 | [
"https://softwareengineering.stackexchange.com/questions/343820",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/145002/"
] | It's not a good practice to load an object from a file in the constructor.
Beyond the good C++ arguments in the other answers, I'd add a clean code principle: *[a function should do only one thing](http://www.itiseezee.com/?p=119)*. Ok, the constructor is not a normal function, but the principle still applies.
I sug... | If the constructor does a lot of work, then there can be exceptions. In C++, exception in a constructor can be handled, but in practice you wouldn’t know how to do it correctly, and it is an absolute pain.
Much easier to write a factory method or even just a plain function that creates an object on the heap, reads a f... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | In the [2.0.5 patch notes](http://us.battle.net/d3/en/blog/14138344/patch-205-now-live-5-13-2014#items), they mention changing the item [Sanguinary Vambraces](http://us.battle.net/d3/en/item/sanguinary-vambraces-1385JU). Inside this change they mention the modifier.
>
> The Thorns damage dealt by these bracers will n... | I have analyzed the source code of the [crusader thorns DPS calculator](http://www.ring.lt/crusader/) mentioned in [user77988's answer](https://gaming.stackexchange.com/a/170463/74333). The important lines are
```
var damage = Math.round(((parseInt(strength)/400)+1)*parseInt(thorns));
var rsdamage = Math.round(((parse... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some math, I arrived at the following formulas for thorns damage:
**Regular Attack**
* ((S / 100 / 4) + 1) \* T
**Reflective Skin Attack**
* ((S / 100) + 1) \* 2T \* (P / 100 + 1)
where
* S is Strength (or mainstat)
* T is your thorns damage
* P is your Physical Damage bonus (as a percent)
It does n... | I have analyzed the source code of the [crusader thorns DPS calculator](http://www.ring.lt/crusader/) mentioned in [user77988's answer](https://gaming.stackexchange.com/a/170463/74333). The important lines are
```
var damage = Math.round(((parseInt(strength)/400)+1)*parseInt(thorns));
var rsdamage = Math.round(((parse... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | Here's a thorns crusader damage calculator:
<http://www.ring.lt/crusader/> | I have analyzed the source code of the [crusader thorns DPS calculator](http://www.ring.lt/crusader/) mentioned in [user77988's answer](https://gaming.stackexchange.com/a/170463/74333). The important lines are
```
var damage = Math.round(((parseInt(strength)/400)+1)*parseInt(thorns));
var rsdamage = Math.round(((parse... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some math, I arrived at the following formulas for thorns damage:
**Regular Attack**
* ((S / 100 / 4) + 1) \* T
**Reflective Skin Attack**
* ((S / 100) + 1) \* 2T \* (P / 100 + 1)
where
* S is Strength (or mainstat)
* T is your thorns damage
* P is your Physical Damage bonus (as a percent)
It does n... | In the [2.0.5 patch notes](http://us.battle.net/d3/en/blog/14138344/patch-205-now-live-5-13-2014#items), they mention changing the item [Sanguinary Vambraces](http://us.battle.net/d3/en/item/sanguinary-vambraces-1385JU). Inside this change they mention the modifier.
>
> The Thorns damage dealt by these bracers will n... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some research, I have reached a few conclusions, plus found how the approximate damage works.
Thorns return damage does *not* depend on how much damage the attack against you does. It's calculated by your base thorns times a multiplier based on your primary stat. The multiplier is one quarter of the bonus ... | I did some testing because I was wondering the same question and came to the conclusion that only your main stat and dmg taken debuffs on the target affect thorns damage (dmg buffs on yourself do not increase thorns dmg, atleast not the ones I tested with), dmg taken debuff affects thorns dmg by 75% the normal amount a... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some research, I have reached a few conclusions, plus found how the approximate damage works.
Thorns return damage does *not* depend on how much damage the attack against you does. It's calculated by your base thorns times a multiplier based on your primary stat. The multiplier is one quarter of the bonus ... | I have analyzed the source code of the [crusader thorns DPS calculator](http://www.ring.lt/crusader/) mentioned in [user77988's answer](https://gaming.stackexchange.com/a/170463/74333). The important lines are
```
var damage = Math.round(((parseInt(strength)/400)+1)*parseInt(thorns));
var rsdamage = Math.round(((parse... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some research, I have reached a few conclusions, plus found how the approximate damage works.
Thorns return damage does *not* depend on how much damage the attack against you does. It's calculated by your base thorns times a multiplier based on your primary stat. The multiplier is one quarter of the bonus ... | Here's a thorns crusader damage calculator:
<http://www.ring.lt/crusader/> |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some research, I have reached a few conclusions, plus found how the approximate damage works.
Thorns return damage does *not* depend on how much damage the attack against you does. It's calculated by your base thorns times a multiplier based on your primary stat. The multiplier is one quarter of the bonus ... | In the [2.0.5 patch notes](http://us.battle.net/d3/en/blog/14138344/patch-205-now-live-5-13-2014#items), they mention changing the item [Sanguinary Vambraces](http://us.battle.net/d3/en/item/sanguinary-vambraces-1385JU). Inside this change they mention the modifier.
>
> The Thorns damage dealt by these bracers will n... |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some math, I arrived at the following formulas for thorns damage:
**Regular Attack**
* ((S / 100 / 4) + 1) \* T
**Reflective Skin Attack**
* ((S / 100) + 1) \* 2T \* (P / 100 + 1)
where
* S is Strength (or mainstat)
* T is your thorns damage
* P is your Physical Damage bonus (as a percent)
It does n... | Here's a thorns crusader damage calculator:
<http://www.ring.lt/crusader/> |
161,941 | I'm trying to figure out how thorns works so I can start deciding how to approach making a viable thorns build. Stacking some thorns on my Crusader has led me to believe that it's not as simple as it sounded at first.
I have around 7,000 thorns right now, but when enemies attack me, they take over 90,000 damage. I've ... | 2014/03/27 | [
"https://gaming.stackexchange.com/questions/161941",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/1719/"
] | After doing some math, I arrived at the following formulas for thorns damage:
**Regular Attack**
* ((S / 100 / 4) + 1) \* T
**Reflective Skin Attack**
* ((S / 100) + 1) \* 2T \* (P / 100 + 1)
where
* S is Strength (or mainstat)
* T is your thorns damage
* P is your Physical Damage bonus (as a percent)
It does n... | After doing some research, I have reached a few conclusions, plus found how the approximate damage works.
Thorns return damage does *not* depend on how much damage the attack against you does. It's calculated by your base thorns times a multiplier based on your primary stat. The multiplier is one quarter of the bonus ... |
29,179,000 | I am trying to use a variable to select from an array:
This works:
```
var myarray = {bricks:3000, studs:500, shingles:400, tiles:700};
function One() {
alert(myarray.bricks);
}
```
But this does not work:
```
var myarray = {bricks:3000, studs:500, shingles:400, tiles:700};
var myvalue = "bricks"
function Tw... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29179000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1218172/"
] | If its not too late, you may try this:
<https://jsfiddle.net/rradik/kuqdwuyd/>
```
<canvas id="canvas" width="200" height="200" />
var canvas;
var ctx;
var lastend = 0;
var pieColor = ["#ECD078","#D95B43","#C02942","#542437","#53777A"];
var pieData = [10,30,20,60,40];
var pieTotal... | The problem was that all your text was overlapping.
I simply changed the order of execution. The text is now drawn after the pie chart. One more thing, I added an offset to the text, each time the loop runs I offset by 50.
[Working Example](http://jsfiddle.net/t9zka7rn/1/)
```
var offset = 50;
for (var e = 0; e < da... |
305,029 | Lets say I have two strips of leather, or other material, one black and one white. If I paint over the surface of the black leather (material) in white and the white leather (material) in black which will be cooler in the sun? | 2017/01/14 | [
"https://physics.stackexchange.com/questions/305029",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/142014/"
] | The black leather painted in white should be cooler when exposed to sunlight.
Here's why: the layer of white paint reflects a large part of the sunlight and transmits and absorbs a small amount.
$$I\_{incident} = I\_{absorbed} + I\_{transmitted} + I\_{reflected}$$
For the white paint layer, $I\_{absorbed}$ and $I\_{... | A black object absorbs all wavelengths of light and converts them into heat, so the object gets warm. A white object reflects all wavelengths of light, so the light is not converted into heat and the temperature of the object does not increase noticeably. |
305,029 | Lets say I have two strips of leather, or other material, one black and one white. If I paint over the surface of the black leather (material) in white and the white leather (material) in black which will be cooler in the sun? | 2017/01/14 | [
"https://physics.stackexchange.com/questions/305029",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/142014/"
] | The black leather painted in white should be cooler when exposed to sunlight.
Here's why: the layer of white paint reflects a large part of the sunlight and transmits and absorbs a small amount.
$$I\_{incident} = I\_{absorbed} + I\_{transmitted} + I\_{reflected}$$
For the white paint layer, $I\_{absorbed}$ and $I\_{... | The only thing that matters is the color of the surface, not of the material inside, or the previous surface color. |
70,526,371 | I have this special case. I have an Oracle stored-procedure that doesn't receive IN parameters but returns 4 OUT parameters.
My entity class is this ...
```
@Entity
@Table(name = "TABLE_NAME")
@NamedStoredProcedureQueries({
@NamedStoredProcedureQuery(
name = "MyPackage.spName",
proce... | 2021/12/30 | [
"https://Stackoverflow.com/questions/70526371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2805479/"
] | Spring boot JPA starter calls `StoredProcedureJpaQuery` class on initialization.
That class contains a property called `useNamedParameters`.
Calling your stored procedure like this ...
```
@Procedure(name = "MyPackage.spName")
Map<String, Object> spName();
```
means that spring JPA will map your IN and OUT paramete... | I can't really answer your *specific* question about how to do these things with JPA and Spring Data, although maybe, you don't have to?
### Using JDBC for this, directly
JPA and Spring Data don't really offer too much value on top of JDBC for ordinary stored procedures. It's just a different way to manually configur... |
68,806,043 | I have 2 dataframes:
df1 and df2 ,df1 is used to be a reference or lookups file for df2.It means we need use each row of df1 to match with each row of df2 and then merge df1 into df2 and then out put new df2.
df1:
```
RB BeginDate EndDate Valindex0
0 00 19000100 19811231 45
1 00 19820100 198... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68806043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7984318/"
] | Use [IntervalIndex](https://pandas.pydata.org/docs/reference/api/pandas.IntervalIndex.html) -
```
idx = pd.IntervalIndex.from_arrays(df1['BeginDate'],df1['EndDate'],closed='both')
for x in df1['RB'].unique():
mask = df2['RB']==x
df2.loc[mask, 'Valindex0'] = df1.loc[idx.get_indexer(df2.loc[mask, 'IssueDate']), ... | If you dont care about the ordering of the records or index you could do this
```
df1 = pd.read_clipboard()
df2 = pd.read_clipboard()
# pandas wants to cast this column as int
df1['RB'] = '00'
new_df = df2.merge(df1, how='outer', on='RB')
mask = ((new_df['BeginDate'] <= new_df['IssueDate']) & (new_df['IssueDate'] <... |
5,458,102 | I want to show `UIImagePickerController` in fullscreen mode for iPad2.
`presentModalViewController:` appears not work for me.
It show the frame with capture button but not show video preview of what is being capture?
Anyone got same problem before and now how to solve?
Thanks | 2011/03/28 | [
"https://Stackoverflow.com/questions/5458102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192800/"
] | The *recommended* practice is not do something like this. Try to redesign so that the background image isn't/doesn't need to be of fixed height and the text doesn't need to be limited to exactly three lines. If this is some kind of requirement imposed on you by your boss/customer, you'll need to talk with them and expl... | Make sure you are using a good CSS reset as most browsers have different defaults for various tags. Assuming your reset is good, you can use browser specific CSS to account for differences in rendering. |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | If you use selfsigned ssl you have to point to the ssl path ,,
use the ssh to run this command after filling it with your real data ,,
```
curl -F "url=https://example.com/myscript.php" -F "certificate=@/etc/apache2/ssl/apache.crt" https://api.telegram.org/bot<SECRETTOKEN>/setWebhook
``` | After change to WebHook method, you need to put as follows, since now we are going to handle one message at time. For me works perfectly.
instead
```
$chatId = $updateArray["result"][0]["message"]["chat"]["id"];
```
to
```
$chatID = $update["message"]["chat"]["id"];
``` |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | If you use selfsigned ssl you have to point to the ssl path ,,
use the ssh to run this command after filling it with your real data ,,
```
curl -F "url=https://example.com/myscript.php" -F "certificate=@/etc/apache2/ssl/apache.crt" https://api.telegram.org/bot<SECRETTOKEN>/setWebhook
``` | Sorry for digging up this old question so enthusiastically, I had exactly the same question as you.
I think actually the answer may be easier yet less satisfying as we hoped: I don't think it's possible to get a list of previous messages to the bot while using the webhook.
Namely: what this does, is run the PHP script... |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | If you use selfsigned ssl you have to point to the ssl path ,,
use the ssh to run this command after filling it with your real data ,,
```
curl -F "url=https://example.com/myscript.php" -F "certificate=@/etc/apache2/ssl/apache.crt" https://api.telegram.org/bot<SECRETTOKEN>/setWebhook
``` | As per my understanding from your code snippet above, you need to use php://input within double quotes instead of single quotes. In php, we are having bing difference in this use case. |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | If you use selfsigned ssl you have to point to the ssl path ,,
use the ssh to run this command after filling it with your real data ,,
```
curl -F "url=https://example.com/myscript.php" -F "certificate=@/etc/apache2/ssl/apache.crt" https://api.telegram.org/bot<SECRETTOKEN>/setWebhook
``` | this is the answer for all of your problems.
follow this step after you got a secret token for your bot:
1. create file in your website <https://yourdomain.com/secret-folder/index.php>
create your php file like this :
```
<?php
$website = 'https://api.telegram.org/bot123456789:1234567890ABCDEF1234567890ABCDEF1... |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | After change to WebHook method, you need to put as follows, since now we are going to handle one message at time. For me works perfectly.
instead
```
$chatId = $updateArray["result"][0]["message"]["chat"]["id"];
```
to
```
$chatID = $update["message"]["chat"]["id"];
``` | Sorry for digging up this old question so enthusiastically, I had exactly the same question as you.
I think actually the answer may be easier yet less satisfying as we hoped: I don't think it's possible to get a list of previous messages to the bot while using the webhook.
Namely: what this does, is run the PHP script... |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | After change to WebHook method, you need to put as follows, since now we are going to handle one message at time. For me works perfectly.
instead
```
$chatId = $updateArray["result"][0]["message"]["chat"]["id"];
```
to
```
$chatID = $update["message"]["chat"]["id"];
``` | As per my understanding from your code snippet above, you need to use php://input within double quotes instead of single quotes. In php, we are having bing difference in this use case. |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | this is the answer for all of your problems.
follow this step after you got a secret token for your bot:
1. create file in your website <https://yourdomain.com/secret-folder/index.php>
create your php file like this :
```
<?php
$website = 'https://api.telegram.org/bot123456789:1234567890ABCDEF1234567890ABCDEF1... | Sorry for digging up this old question so enthusiastically, I had exactly the same question as you.
I think actually the answer may be easier yet less satisfying as we hoped: I don't think it's possible to get a list of previous messages to the bot while using the webhook.
Namely: what this does, is run the PHP script... |
32,166,562 | I saw a couple of days ago [this tutorial on youtube](https://www.youtube.com/watch?v=hJBYojK7DO4).
It was very interesting, so I decided to make a own bot.
I used the code from the tutorial as a template:
```
<?php
$bottoken = "*****";
$website = "https://api.telegram.org/bot".$bottoken;
$update = file_get_contents... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32166562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257071/"
] | this is the answer for all of your problems.
follow this step after you got a secret token for your bot:
1. create file in your website <https://yourdomain.com/secret-folder/index.php>
create your php file like this :
```
<?php
$website = 'https://api.telegram.org/bot123456789:1234567890ABCDEF1234567890ABCDEF1... | As per my understanding from your code snippet above, you need to use php://input within double quotes instead of single quotes. In php, we are having bing difference in this use case. |
102,430 | I have a directory with multiple img files and some of them are identical but they all have different names. I need to remove duplicates but with no external tools only with a `bash` script. I'm a beginner in Linux. I tried nested for loop to compare `md5` sums and depending on the result remove but something is wrong ... | 2013/11/24 | [
"https://unix.stackexchange.com/questions/102430",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/53012/"
] | There are quite a few problems in your script.
* First, in order to assign the *result* of a command to a variable you need to enclose it either in backtics (``command``) or, preferably, `$(command)`. You have it in single quotes (`'command'`) which instead of assigning the result of your command to your variable, as... | There is a nifty program called `fdupes` that simplifies the whole process and prompts the user for deleting duplicates. I think it is worth checking:
```
$ fdupes --delete DIRECTORY_WITH_DUPLICATES
[1] DIRECTORY_WITH_DUPLICATES/package-0.1-linux.tar.gz
[2] DIRECTORY_WITH_DUPLICATES/package-0.1-linux.tar.gz.1
... |
563,914 | Say I am going to write down the steps of some calculations to get the final value of $s$ from an equation like this:
$$ s = s\_0 + \frac12 gt^2. $$
Let us say $s\_0 = 20\,\mathrm{m}$, $g = 10\,\mathrm{ms^{-2}}$, and $t = 2\,\mathrm{s}$. What is the right way to write down the units in every step so that all the formul... | 2020/07/05 | [
"https://physics.stackexchange.com/questions/563914",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/7378/"
] | There's no *right* way. But I use and recommend Alternative #1 in the class I teach. It keeps the value with the unit which makes it easier to go back and find mistakes.
**Addendum**
Another thing that I try to drill into them with only modest success is to *not* do "algebra-by-cross-out", but rather to write a compl... | I perfectly agree with garyp: There is no right or wrong way to put the units into the equations. However, in my experience people tend to make mistakes, if they rewrite the equations. That's why I recommend
1. to convert all units to the standard SI units (no prefixes like nano or kilo),
2. do the insertion and calcu... |
100,747 | Why the probability of density is higher in the area that is closer to the nucleus? I'm a high school student. I don't know much about wave functions. | 2014/02/25 | [
"https://physics.stackexchange.com/questions/100747",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/40003/"
] | First of all you have to consider that there's an electric force (Coulomb) between nucleus and electron, so, from a classical point of view it seems reasonable that electron "wants" to stay as closer as possible to the nucleus (they respectively attract). Now it's clearly impossible that electrons could reach nucleus, ... | The short answer to your question is that in "nature;" energy, forces, and particles, operate in such a way that the energy or force needed to reach some kind of "stability" (equilibrium), is **minimized.** In the case of an electron, its "ground state" is the most stable, so the probability of "finding" it there, is v... |
100,747 | Why the probability of density is higher in the area that is closer to the nucleus? I'm a high school student. I don't know much about wave functions. | 2014/02/25 | [
"https://physics.stackexchange.com/questions/100747",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/40003/"
] | First of all you have to consider that there's an electric force (Coulomb) between nucleus and electron, so, from a classical point of view it seems reasonable that electron "wants" to stay as closer as possible to the nucleus (they respectively attract). Now it's clearly impossible that electrons could reach nucleus, ... | For the 1s orbital the highest probability density exists *inside* the nucleus. Welcome to the subatomic world!
But there are many other orbitals where the density inside or near the nucleus is low. Look e.g. at <http://www.chemistry.mcmaster.ca/esam/Chapter_3/section_2.html> for details (note that a standard “*hydrog... |
11,521,001 | Iam using a list item in my application. Iam using the adapter:
```
adapter adapter = new ArrayAdapter<Settingsmodel>(this,
android.R.layout.simple_list_item_checked, listItems);
```
In that i want to check the tick mark of the selected list item manually. I searched a lot. Could'nt find a way to do ... | 2012/07/17 | [
"https://Stackoverflow.com/questions/11521001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1498488/"
] | You can use a list and add a tag every time you clicked on checkbox in your CustomAdapter.
```
CheckBox chkbox= (CheckBox)view.findViewById(R.id.checkBox1);
chkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(
... | create your own Adapter....
```
public class SettingsmodelAdapter extends ArrayAdapter<Settingsmodel>
{
.....
public final View getView(final int position, final View convertView, final ViewGroup parent)
{
final View row = super.getView(position, convertView, parent);
final CheckBox checkB... |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | I think I found a double-self-smothered-stalemate that could occur via sequence of legal moves from the normal starting position.
```
[FEN "5bnk/4ppbp/4P2p/5P1P/p1p5/P2p4/PBPP4/KNB5 w - - 0 1"]
1. c3 f6
```
Each player has seven pawns and two dark-square bishops, so one pawn from each player must have been promo... | In response to an your original question about whether anything interesting has been written about stalemates, it may be worth mentioning that puzzle creator Sam Lloyd is often credited with two interesting stalemate "games" (though see game 3679 at <http://www.chesshistory.com/winter/winter08.html> for information abo... |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | I think I found a double-self-smothered-stalemate that could occur via sequence of legal moves from the normal starting position.
```
[FEN "5bnk/4ppbp/4P2p/5P1P/p1p5/P2p4/PBPP4/KNB5 w - - 0 1"]
1. c3 f6
```
Each player has seven pawns and two dark-square bishops, so one pawn from each player must have been promo... | Here's a simpler mutual smothered stalemate
(9 men on a side, no promoted pieces):
```
[Title "Mutual smothered stalemate"]
[fen "5brk/4p1pb/4P1p1/6P1/1p6/1P1p4/BP1P4/KRB5 w - - 0 1"]
``` |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | I think I found a double-self-smothered-stalemate that could occur via sequence of legal moves from the normal starting position.
```
[FEN "5bnk/4ppbp/4P2p/5P1P/p1p5/P2p4/PBPP4/KNB5 w - - 0 1"]
1. c3 f6
```
Each player has seven pawns and two dark-square bishops, so one pawn from each player must have been promo... | Reduce number of units from Noam's record of 18 to a new record of 15.
(8+7 units, no promoted units necessarily on the board, pawn captures all achievable):
```
[Title "Minimal mutual smothered stalemate"]
[fen "5brk/4p1pb/4P1p1/6P1/6PB/6PK/6PP/8 w - - 0 1"]
```
Is this the best possible?
It's interesting that ... |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | I think I found a double-self-smothered-stalemate that could occur via sequence of legal moves from the normal starting position.
```
[FEN "5bnk/4ppbp/4P2p/5P1P/p1p5/P2p4/PBPP4/KNB5 w - - 0 1"]
1. c3 f6
```
Each player has seven pawns and two dark-square bishops, so one pawn from each player must have been promo... | Just for fun, here is an attempt at **optimizing** the number of pieces that can be involved. I was able to manage **24 pieces.**
```
[Title "me, chess.stackexchange.com 6/23/2019, mate in 20"]
[FEN "5brk/4p1pb/4p1p1/p3P1Pp/Pp1p3P/1P1P4/BP1P4/KRB5 w - - 0 1"]
``` |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | Here's a simpler mutual smothered stalemate
(9 men on a side, no promoted pieces):
```
[Title "Mutual smothered stalemate"]
[fen "5brk/4p1pb/4P1p1/6P1/1p6/1P1p4/BP1P4/KRB5 w - - 0 1"]
``` | In response to an your original question about whether anything interesting has been written about stalemates, it may be worth mentioning that puzzle creator Sam Lloyd is often credited with two interesting stalemate "games" (though see game 3679 at <http://www.chesshistory.com/winter/winter08.html> for information abo... |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | Reduce number of units from Noam's record of 18 to a new record of 15.
(8+7 units, no promoted units necessarily on the board, pawn captures all achievable):
```
[Title "Minimal mutual smothered stalemate"]
[fen "5brk/4p1pb/4P1p1/6P1/6PB/6PK/6PP/8 w - - 0 1"]
```
Is this the best possible?
It's interesting that ... | In response to an your original question about whether anything interesting has been written about stalemates, it may be worth mentioning that puzzle creator Sam Lloyd is often credited with two interesting stalemate "games" (though see game 3679 at <http://www.chesshistory.com/winter/winter08.html> for information abo... |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | In response to an your original question about whether anything interesting has been written about stalemates, it may be worth mentioning that puzzle creator Sam Lloyd is often credited with two interesting stalemate "games" (though see game 3679 at <http://www.chesshistory.com/winter/winter08.html> for information abo... | Just for fun, here is an attempt at **optimizing** the number of pieces that can be involved. I was able to manage **24 pieces.**
```
[Title "me, chess.stackexchange.com 6/23/2019, mate in 20"]
[FEN "5brk/4p1pb/4p1p1/p3P1Pp/Pp1p3P/1P1P4/BP1P4/KRB5 w - - 0 1"]
``` |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | Here's a simpler mutual smothered stalemate
(9 men on a side, no promoted pieces):
```
[Title "Mutual smothered stalemate"]
[fen "5brk/4p1pb/4P1p1/6P1/1p6/1P1p4/BP1P4/KRB5 w - - 0 1"]
``` | Just for fun, here is an attempt at **optimizing** the number of pieces that can be involved. I was able to manage **24 pieces.**
```
[Title "me, chess.stackexchange.com 6/23/2019, mate in 20"]
[FEN "5brk/4p1pb/4p1p1/p3P1Pp/Pp1p3P/1P1P4/BP1P4/KRB5 w - - 0 1"]
``` |
4,836 | I came up with this rather amusing and bizarre stalemate where Black stalemates itself by self-smothering.
```
[FEN "8/8/8/8/8/3p4/pp6/krb1K3 b - - 0 1"]
1...d2+?? 2. Kd1
```
The peculiar feature of this stalemate is that Black is unable to move not because moving a piece would put its king into check, but mov... | 2014/02/27 | [
"https://chess.stackexchange.com/questions/4836",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2429/"
] | Reduce number of units from Noam's record of 18 to a new record of 15.
(8+7 units, no promoted units necessarily on the board, pawn captures all achievable):
```
[Title "Minimal mutual smothered stalemate"]
[fen "5brk/4p1pb/4P1p1/6P1/6PB/6PK/6PP/8 w - - 0 1"]
```
Is this the best possible?
It's interesting that ... | Just for fun, here is an attempt at **optimizing** the number of pieces that can be involved. I was able to manage **24 pieces.**
```
[Title "me, chess.stackexchange.com 6/23/2019, mate in 20"]
[FEN "5brk/4p1pb/4p1p1/p3P1Pp/Pp1p3P/1P1P4/BP1P4/KRB5 w - - 0 1"]
``` |
9,282,865 | I'm hosting a website for a friend of me and I want to use a sub domain (sapp.xgclan.com) to link to his directory on my webserver.
You can also access this directory by going to www.xgclan.com/sapp/
Now I'm using the following .htaccesses file:
```
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(sapp.)xgclan.com$
Rewri... | 2012/02/14 | [
"https://Stackoverflow.com/questions/9282865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/889861/"
] | Try
```
RewriteEngine on
RewriteBase /
#if its sapp.xgckan.com
RewriteCond %{HTTP_HOST} ^sapp.xgclan.com$ [NC]
#rewrite the request to the sapp folder
RewriteRule ^ sapp%{REQUEST_URI} [L]
```
**EDIT**
>
> I just want to do this for the following sub domains: forum, sapp and servers
>
>
>
For `forum`, `sapp`... | Not quite an answer to the concrete question, but: Why don't you point the virtual host sapp.xglcan.com directly to the sapp subdirectory? Like this:
```
<VirtualHost *:80>
DocumentRoot [path/to/www.xglan.com]/sapp
ServerName sapp.xglan.com
</VirtualHost>
``` |
56,201,386 | I am trying to update my Android project.
I initially got this error:
>
> ERROR: Gradle DSL method not found: 'classpath()'
> Possible causes:
> The project 'xxx' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
> Upgrade plugin to ver... | 2019/05/18 | [
"https://Stackoverflow.com/questions/56201386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2885727/"
] | I agree with @Doug on this one - callable wraps this for you and will be easier -, but my use case required me to make HTTPS calls (`onRequest` in Functions). Also, I think you're just in the correct path - but you're **possibly** not checking it in your Cloud Functions.
In your app, you'll call:
```dart
_httpsCall()... | It's going to be easiest for you to use a [callable function](https://firebase.google.com/docs/functions/callable), since that lets you:
1. Automatically send the current user's uid in the request.
2. Know very easily on the function side if a UID was provided in the request, and refuse service if none was provided.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.