qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | ( value == 0.00 )
Never gets true.
Or, it takes so many runs of the function that the it runs into, well, stack overflow :P
You should take another look at how you made your function. Right now it is not even useful, it can only ever return 0. | You could check `if (value * 0.98 == value)` instead of `if (value == 0)`. This condition will be met exactly when `value` becomes so small (subnormal) that it has too few bits of precision for multiplication by `0.98` to yield a different result. |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | You should *always* use 'approximate' comparisons in floating point calculations. E.g., `if (abs(value) < EPS)` instead of `if ( value == 0.00 )`. `EPS` here is a small constant (depends on your requirements and datatype).
I suspect this is what's actually happening. You get to the smallest possible positive value in ... | Wow, thanks for the quick answer everyone!
Apparently that little floating point detail was skipped in my class...
So since everyone is pretty much saying the same thing (don't compare floating points with equality since they're never really exact), does the same hold true if I used ints or doubles?
Originally I had ... |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | Due to floating point calculations never being exact in floating point math you never get to value == 0.00. You might want to try something like value < 0.0000001 or something like that and tweak it where it works. | ( value == 0.00 )
Never gets true.
Or, it takes so many runs of the function that the it runs into, well, stack overflow :P
You should take another look at how you made your function. Right now it is not even useful, it can only ever return 0. |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | You should *always* use 'approximate' comparisons in floating point calculations. E.g., `if (abs(value) < EPS)` instead of `if ( value == 0.00 )`. `EPS` here is a small constant (depends on your requirements and datatype).
I suspect this is what's actually happening. You get to the smallest possible positive value in ... | don't compare float values with constants, always check if they fall under a lower-bound.
change your value == 0.00 to value <= 0.0001 for example |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | ( value == 0.00 )
Never gets true.
Or, it takes so many runs of the function that the it runs into, well, stack overflow :P
You should take another look at how you made your function. Right now it is not even useful, it can only ever return 0. | don't compare float values with constants, always check if they fall under a lower-bound.
change your value == 0.00 to value <= 0.0001 for example |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | ( value == 0.00 )
Never gets true.
Or, it takes so many runs of the function that the it runs into, well, stack overflow :P
You should take another look at how you made your function. Right now it is not even useful, it can only ever return 0. | Wow, thanks for the quick answer everyone!
Apparently that little floating point detail was skipped in my class...
So since everyone is pretty much saying the same thing (don't compare floating points with equality since they're never really exact), does the same hold true if I used ints or doubles?
Originally I had ... |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | You should *always* use 'approximate' comparisons in floating point calculations. E.g., `if (abs(value) < EPS)` instead of `if ( value == 0.00 )`. `EPS` here is a small constant (depends on your requirements and datatype).
I suspect this is what's actually happening. You get to the smallest possible positive value in ... | Do not directly compare floating point numbers; your "value" will probably never really be 0.0 (zero).
do something like :
```
float smallNumber = 0.00001;
if ( value < smallNumber )
{
...
}
``` |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | Do not directly compare floating point numbers; your "value" will probably never really be 0.0 (zero).
do something like :
```
float smallNumber = 0.00001;
if ( value < smallNumber )
{
...
}
``` | don't compare float values with constants, always check if they fall under a lower-bound.
change your value == 0.00 to value <= 0.0001 for example |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | You could check `if (value * 0.98 == value)` instead of `if (value == 0)`. This condition will be met exactly when `value` becomes so small (subnormal) that it has too few bits of precision for multiplication by `0.98` to yield a different result. | Wow, thanks for the quick answer everyone!
Apparently that little floating point detail was skipped in my class...
So since everyone is pretty much saying the same thing (don't compare floating points with equality since they're never really exact), does the same hold true if I used ints or doubles?
Originally I had ... |
4,628,946 | I have a Qt application wrapped up inside a DLL for plugging into 3rd party applications. When those 3rd party applications start the Qt application, the toolbar tooltips in the 3rd party applications stop working. As soon as I close the Qt application, they work again.
I recreated the problem in Visual Studio by crea... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4628946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88692/"
] | Do not directly compare floating point numbers; your "value" will probably never really be 0.0 (zero).
do something like :
```
float smallNumber = 0.00001;
if ( value < smallNumber )
{
...
}
``` | Wow, thanks for the quick answer everyone!
Apparently that little floating point detail was skipped in my class...
So since everyone is pretty much saying the same thing (don't compare floating points with equality since they're never really exact), does the same hold true if I used ints or doubles?
Originally I had ... |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | Using this config maintains my session id on node 0.6.17, express 3.0.0rc4. Initially I had the following in the virtualhost, but even after changing to match your config, it still works.
```
ServerName api
ServerAlias api.internal.local
```
I get a Set-cookie connect.sid which is maintained. | This happened to us to i don't think the reverse cookies stuff did anything to help our situation out.
I tried:
app.use("trust proxy");
to no avail.
however using
```
app.use("trust proxy");
app.set("trust proxy", 1);
```
Works.
Hope this helps anyone having proxy cookie issues. |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | I experienced this exact issue and tried everything else mentioned here without success. The final piece of the puzzle was adding the following to Apache's SSL Virtual Host config:
`RequestHeader set X-Forwarded-Proto "https"`
This particular gem I discovered in one of the last comments at <https://github.com/express... | It should be trivial to look at the session cookie being forwarded and see why your browser doesn't re-send it when proxied -- the domain or path are likely wrong.
Re: your later comments -- Maybe you really did set "ProxyPassReverseCookieDomain / /" instead of using domains as the argument?
ProxyPreserveHost would p... |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | I experienced this exact issue and tried everything else mentioned here without success. The final piece of the puzzle was adding the following to Apache's SSL Virtual Host config:
`RequestHeader set X-Forwarded-Proto "https"`
This particular gem I discovered in one of the last comments at <https://github.com/express... | Using this config maintains my session id on node 0.6.17, express 3.0.0rc4. Initially I had the following in the virtualhost, but even after changing to match your config, it still works.
```
ServerName api
ServerAlias api.internal.local
```
I get a Set-cookie connect.sid which is maintained. |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | Judging by [Apache ProxyPass and Sessions](https://stackoverflow.com/questions/8676890/apache-proxypass-and-sessions) This apache config Maybe ...
```
<VirtualHost *:80>
ServerName api.mydomain.com
ProxyPass / http://localhost:2000/
ProxyPassReverse / http://localhost:2000/
ProxyPassReverseCookiePat... | It should be trivial to look at the session cookie being forwarded and see why your browser doesn't re-send it when proxied -- the domain or path are likely wrong.
Re: your later comments -- Maybe you really did set "ProxyPassReverseCookieDomain / /" instead of using domains as the argument?
ProxyPreserveHost would p... |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | Judging by [Apache ProxyPass and Sessions](https://stackoverflow.com/questions/8676890/apache-proxypass-and-sessions) This apache config Maybe ...
```
<VirtualHost *:80>
ServerName api.mydomain.com
ProxyPass / http://localhost:2000/
ProxyPassReverse / http://localhost:2000/
ProxyPassReverseCookiePat... | Add the following to server.js
```
app.enable('trust proxy');
```
Quote from ExpressJS API Docs: <http://expressjs.com/api.html#app-settings> ...
>
> trust proxy - Enables reverse proxy support, disabled by default
>
>
> |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | Judging by [Apache ProxyPass and Sessions](https://stackoverflow.com/questions/8676890/apache-proxypass-and-sessions) This apache config Maybe ...
```
<VirtualHost *:80>
ServerName api.mydomain.com
ProxyPass / http://localhost:2000/
ProxyPassReverse / http://localhost:2000/
ProxyPassReverseCookiePat... | Using this config maintains my session id on node 0.6.17, express 3.0.0rc4. Initially I had the following in the virtualhost, but even after changing to match your config, it still works.
```
ServerName api
ServerAlias api.internal.local
```
I get a Set-cookie connect.sid which is maintained. |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | I experienced this exact issue and tried everything else mentioned here without success. The final piece of the puzzle was adding the following to Apache's SSL Virtual Host config:
`RequestHeader set X-Forwarded-Proto "https"`
This particular gem I discovered in one of the last comments at <https://github.com/express... | This happened to us to i don't think the reverse cookies stuff did anything to help our situation out.
I tried:
app.use("trust proxy");
to no avail.
however using
```
app.use("trust proxy");
app.set("trust proxy", 1);
```
Works.
Hope this helps anyone having proxy cookie issues. |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | It should be trivial to look at the session cookie being forwarded and see why your browser doesn't re-send it when proxied -- the domain or path are likely wrong.
Re: your later comments -- Maybe you really did set "ProxyPassReverseCookieDomain / /" instead of using domains as the argument?
ProxyPreserveHost would p... | This happened to us to i don't think the reverse cookies stuff did anything to help our situation out.
I tried:
app.use("trust proxy");
to no avail.
however using
```
app.use("trust proxy");
app.set("trust proxy", 1);
```
Works.
Hope this helps anyone having proxy cookie issues. |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | Judging by [Apache ProxyPass and Sessions](https://stackoverflow.com/questions/8676890/apache-proxypass-and-sessions) This apache config Maybe ...
```
<VirtualHost *:80>
ServerName api.mydomain.com
ProxyPass / http://localhost:2000/
ProxyPassReverse / http://localhost:2000/
ProxyPassReverseCookiePat... | This happened to us to i don't think the reverse cookies stuff did anything to help our situation out.
I tried:
app.use("trust proxy");
to no avail.
however using
```
app.use("trust proxy");
app.set("trust proxy", 1);
```
Works.
Hope this helps anyone having proxy cookie issues. |
12,295,963 | I've setup an Apache reverse proxy to forward `api.mydomain.com` to `localhost:2000` which works just fine.
However, the real issue i'm having is in regard to sessions - it seems that the req.session's aren't being stored when querying via `api.mydomain.com`. Sessions will work just fine visiting from `localhost:2000`... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731814/"
] | Add the following to server.js
```
app.enable('trust proxy');
```
Quote from ExpressJS API Docs: <http://expressjs.com/api.html#app-settings> ...
>
> trust proxy - Enables reverse proxy support, disabled by default
>
>
> | Using this config maintains my session id on node 0.6.17, express 3.0.0rc4. Initially I had the following in the virtualhost, but even after changing to match your config, it still works.
```
ServerName api
ServerAlias api.internal.local
```
I get a Set-cookie connect.sid which is maintained. |
8,054,360 | I have written my own `PopupPanel` in GWT. I want to show the popup relative to an other widget. My implementation of the class looks like the following:
```java
public class Popover extends PopupPanel implements PositionCallback {
private static final Binder binder = GWT.create(Binder.class);
private UIObjec... | 2011/11/08 | [
"https://Stackoverflow.com/questions/8054360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | To solve this issue, I followed the steps used by `PopupPanel`'s `setPopupPositionAndShow()`, but I made the positioning step a deferred command. My code didn't extend `PopupPanel`, hence the `popupPanel` variable:
```java
popupPanel.setVisible(false);
popupPanel.show();
// Pausing until the event loop is clear appea... | `getOffsetWidth()` and `getOffsetHeight()` only work if the DOM is fully constructed and the container for which you want to get the value is visible and attached.
Why don't you use the `showRelativeTo()` function of the `PopupPanel`?
```java
popup.showRelativeTo(SomeWidget);
``` |
70,110,718 | I'm trying to create a ENV VAR called SETTINGS in a Python image with Dockerfile. This env var must be dynamic, because I need to change the conf profile betweet production and preproduction.
I've created an script (entrypoint.sh) with two commands, the first one create the SETTINGS VAR and the second one is a python ... | 2021/11/25 | [
"https://Stackoverflow.com/questions/70110718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10744148/"
] | This would be a pretty typical use of an entrypoint wrapper script. Remember that a container only runs a single process. If your Dockerfile specifies an `ENTRYPOINT`, that's the process, and the `CMD` is passed as additional arguments to it. That lets you set up a script that does some first-time setup and then replac... | There is a difference in passing a `dynamic` environment var on `docker build` or pass the variable on runtime.
Env vars on runtime
===================
If you want to pass it on runtime, it doesn't need to be in your Dockerfile, just pass it when running your container:
```
docker run my-image -e MY_ENV=foo
```
En... |
60,408,730 | I am using spring boot starter 2.2.0.RELEASE for my application. I have one kafka consumer. Now I want to inject my spring entities into my kafka consumer (kafka consumer is not managed by spring container).
I tried ApplicationContextAware but it didn't helped me. I am getting applicationContext as null in my kafka c... | 2020/02/26 | [
"https://Stackoverflow.com/questions/60408730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8086483/"
] | Based on clarifications in question and comments, and assuming its impossible to move KafkaConsumer to be spring managed (which is I believe the best solution):
`@Autowired` won't work in KafkaConsumer, so no need to put that annotation.
I assume that you're getting null for Application context in this line:
```
Ap... | My main problem was my spring context was being loaded twice. As I printed every class's class loader I found that my Application was running twice. (i.e. when I debug in intellij after pressing F9 I was again landing up on same line i.e.
```
ConfigurableApplicationContext applicationContext = SpringApplication.run(Co... |
20,131,144 | I'm running the following query using NHibernate:
```
var query = session.QueryOver<TaskMeeting>()
.JoinQueryOver(x => x.Task)
.Where(x => x.CloseOn == null)
.List();
```
Which then generates the following SQL:
```
SELECT
this_.Id as Id89_1_,
this_.TaskMeetingTypeID as TaskMeet2_89_1_,
this_... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20131144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/467172/"
] | The way you queried your data, you get back a generic IList<> containing TaskMeeting entities. So it's normal for NHibernate to query all columns of your TaskMeeting table to put that data into your TaskMeeting entity properties. But i guess that is known already.
But because you want to restrict the data through ano... | The quick answer is you told it to. You called JoinQueryOver which is going to create a join query on the task.
An easier way to get only what you want is to create a linq query and project only the fields you want into am anonymous type. That will generate a query with only the columns declared in the anonymous type... |
14,150,565 | The following code is to add the font tag to every character, but it don't work
```
Function AddFontTag (counter)
Do While Len (counter) < 7
newStr = newStr & "<font>" & Left (counter, i) & "</font>"
i = i + 1
Loop
AddFontTag = newStr
End Function
```
Because i'm not skilled in classic as... | 2013/01/04 | [
"https://Stackoverflow.com/questions/14150565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/925552/"
] | Your `do..while` loop is an infinite loop - assuming `counter` is a string variable, its length never changes so if `Len(counter)` is less than `7` upon entering the function, it'll always stay less than `7` so your function never exits.
Your `newStr` variable is undefined - this works in VBScript but it's really bad ... | I'm not sure of how your 7 character limit applies, but for a general approach the following will do what you need for any length string:
```vb
function AddFontTag(byval str)
AddFontTag = Empty
do while len(str) <> 0
' get next character
dim c: c = left(str, 1)
' reduce original string
... |
14,150,565 | The following code is to add the font tag to every character, but it don't work
```
Function AddFontTag (counter)
Do While Len (counter) < 7
newStr = newStr & "<font>" & Left (counter, i) & "</font>"
i = i + 1
Loop
AddFontTag = newStr
End Function
```
Because i'm not skilled in classic as... | 2013/01/04 | [
"https://Stackoverflow.com/questions/14150565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/925552/"
] | Your `do..while` loop is an infinite loop - assuming `counter` is a string variable, its length never changes so if `Len(counter)` is less than `7` upon entering the function, it'll always stay less than `7` so your function never exits.
Your `newStr` variable is undefined - this works in VBScript but it's really bad ... | your codes is looping without a condition to EXIT the looping.
try this... hope it helps.
```
Function AddFontTag (counter)
dim i,newStr,max
max=7
Do While Len (counter) < max
newStr = newStr & "<font>" & Left (counter, i) & "-" & "</font>"
i = i + 1
if i = max-1 then exit Do
Loop
A... |
14,150,565 | The following code is to add the font tag to every character, but it don't work
```
Function AddFontTag (counter)
Do While Len (counter) < 7
newStr = newStr & "<font>" & Left (counter, i) & "</font>"
i = i + 1
Loop
AddFontTag = newStr
End Function
```
Because i'm not skilled in classic as... | 2013/01/04 | [
"https://Stackoverflow.com/questions/14150565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/925552/"
] | I'm not sure of how your 7 character limit applies, but for a general approach the following will do what you need for any length string:
```vb
function AddFontTag(byval str)
AddFontTag = Empty
do while len(str) <> 0
' get next character
dim c: c = left(str, 1)
' reduce original string
... | your codes is looping without a condition to EXIT the looping.
try this... hope it helps.
```
Function AddFontTag (counter)
dim i,newStr,max
max=7
Do While Len (counter) < max
newStr = newStr & "<font>" & Left (counter, i) & "-" & "</font>"
i = i + 1
if i = max-1 then exit Do
Loop
A... |
2,137,187 | I am stuck on this limit.
$$\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}$$
I couldn't find the limit using the basic properties of limits, since that just yields: $$\infty-\infty$$ which is undefined. Could I get any hints for finding this limit? | 2017/02/09 | [
"https://math.stackexchange.com/questions/2137187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/409174/"
] | Hint: Mulitply by
$$
\frac{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}
$$ | You can write $\sqrt[3]{1+x}=1+\frac{1}{3}x+O(x^2)$ for $x$ near zero.
So $$\sqrt[3]{n^2+3}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+3/n^2} = n^{2/3}+\frac{1}{3}\frac{3}{n^{4/3}} + O(1/n^{10/3})$$
Similarly, $$\sqrt[3]{n^2+5}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+5/n^2} = n^{2/3}+\frac{1}{3}\frac{5}{n^{4/3}} + O(1/n^{10/3})$$
So $$\sq... |
2,137,187 | I am stuck on this limit.
$$\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}$$
I couldn't find the limit using the basic properties of limits, since that just yields: $$\infty-\infty$$ which is undefined. Could I get any hints for finding this limit? | 2017/02/09 | [
"https://math.stackexchange.com/questions/2137187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/409174/"
] | Hint: Mulitply by
$$
\frac{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}
$$ | One developes an intuition that as $n^2$ becomes large the $+5$ and $-3$ become negligible and the whole thing becomes but how to prove it...
Well we can is eliminate the difference of square roots by multiplying by the compliment so we can probably do the same for cube roots.
I.e. $(\sqrt[3]a - \sqrt[3]b)(\sqrt[3]a^... |
2,137,187 | I am stuck on this limit.
$$\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}$$
I couldn't find the limit using the basic properties of limits, since that just yields: $$\infty-\infty$$ which is undefined. Could I get any hints for finding this limit? | 2017/02/09 | [
"https://math.stackexchange.com/questions/2137187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/409174/"
] | Hint: Mulitply by
$$
\frac{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}
$$ | $\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}
$
Since
$a^3-b^3
=(a-b)(a^2+ab+b^2)
$,
$a-b
=\dfrac{a^3-b^3}{a^2+ab+b^2}
$.
Therefore
$a^{1/3}-b^{1/3}
=\dfrac{a-b}{a^{2/3}+a^{1/3}b^{1/3}+b^{2/3}}
$.
Since,
for $x > 0$,
$1 < (1+x)^{1/3}
< 1+x/3
$
(cube both sides),
we have,
if $u > 0$,
$n^{2/3}
< (n^2+u)^{1/3}
= ... |
2,137,187 | I am stuck on this limit.
$$\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}$$
I couldn't find the limit using the basic properties of limits, since that just yields: $$\infty-\infty$$ which is undefined. Could I get any hints for finding this limit? | 2017/02/09 | [
"https://math.stackexchange.com/questions/2137187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/409174/"
] | Hint: Mulitply by
$$
\frac{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}{\left(\sqrt[3]{n^2+5}\right)^2 + \sqrt[3]{n^2+5}\sqrt[3]{n^2+3} + \left(\sqrt[3]{n^2+3}\right)^2}
$$ | If you have the Mean Value Theorem available, and if you know that the derivative of $f(x)=x^{1/3}$ is $f'(x)={1\over3}x^{-2/3}$, then note that
$$\sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}=2{f(n^2+5)-f(n^2+3)\over(n^2+5)-(n^2+3)}=2f'(c\_n)={2\over3c\_n^{2/3}}$$
for some $c\_n\in(n^2+3,n^5+5)$. Clearly $c\_n\to\infty$ as $n\to\... |
2,137,187 | I am stuck on this limit.
$$\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}$$
I couldn't find the limit using the basic properties of limits, since that just yields: $$\infty-\infty$$ which is undefined. Could I get any hints for finding this limit? | 2017/02/09 | [
"https://math.stackexchange.com/questions/2137187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/409174/"
] | You can write $\sqrt[3]{1+x}=1+\frac{1}{3}x+O(x^2)$ for $x$ near zero.
So $$\sqrt[3]{n^2+3}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+3/n^2} = n^{2/3}+\frac{1}{3}\frac{3}{n^{4/3}} + O(1/n^{10/3})$$
Similarly, $$\sqrt[3]{n^2+5}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+5/n^2} = n^{2/3}+\frac{1}{3}\frac{5}{n^{4/3}} + O(1/n^{10/3})$$
So $$\sq... | One developes an intuition that as $n^2$ becomes large the $+5$ and $-3$ become negligible and the whole thing becomes but how to prove it...
Well we can is eliminate the difference of square roots by multiplying by the compliment so we can probably do the same for cube roots.
I.e. $(\sqrt[3]a - \sqrt[3]b)(\sqrt[3]a^... |
2,137,187 | I am stuck on this limit.
$$\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}$$
I couldn't find the limit using the basic properties of limits, since that just yields: $$\infty-\infty$$ which is undefined. Could I get any hints for finding this limit? | 2017/02/09 | [
"https://math.stackexchange.com/questions/2137187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/409174/"
] | You can write $\sqrt[3]{1+x}=1+\frac{1}{3}x+O(x^2)$ for $x$ near zero.
So $$\sqrt[3]{n^2+3}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+3/n^2} = n^{2/3}+\frac{1}{3}\frac{3}{n^{4/3}} + O(1/n^{10/3})$$
Similarly, $$\sqrt[3]{n^2+5}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+5/n^2} = n^{2/3}+\frac{1}{3}\frac{5}{n^{4/3}} + O(1/n^{10/3})$$
So $$\sq... | $\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}
$
Since
$a^3-b^3
=(a-b)(a^2+ab+b^2)
$,
$a-b
=\dfrac{a^3-b^3}{a^2+ab+b^2}
$.
Therefore
$a^{1/3}-b^{1/3}
=\dfrac{a-b}{a^{2/3}+a^{1/3}b^{1/3}+b^{2/3}}
$.
Since,
for $x > 0$,
$1 < (1+x)^{1/3}
< 1+x/3
$
(cube both sides),
we have,
if $u > 0$,
$n^{2/3}
< (n^2+u)^{1/3}
= ... |
2,137,187 | I am stuck on this limit.
$$\lim\_{n\to\infty} \sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}$$
I couldn't find the limit using the basic properties of limits, since that just yields: $$\infty-\infty$$ which is undefined. Could I get any hints for finding this limit? | 2017/02/09 | [
"https://math.stackexchange.com/questions/2137187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/409174/"
] | You can write $\sqrt[3]{1+x}=1+\frac{1}{3}x+O(x^2)$ for $x$ near zero.
So $$\sqrt[3]{n^2+3}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+3/n^2} = n^{2/3}+\frac{1}{3}\frac{3}{n^{4/3}} + O(1/n^{10/3})$$
Similarly, $$\sqrt[3]{n^2+5}=\sqrt[3]{n^2}\cdot \sqrt[3]{1+5/n^2} = n^{2/3}+\frac{1}{3}\frac{5}{n^{4/3}} + O(1/n^{10/3})$$
So $$\sq... | If you have the Mean Value Theorem available, and if you know that the derivative of $f(x)=x^{1/3}$ is $f'(x)={1\over3}x^{-2/3}$, then note that
$$\sqrt[3]{n^2+5}-\sqrt[3]{n^2+3}=2{f(n^2+5)-f(n^2+3)\over(n^2+5)-(n^2+3)}=2f'(c\_n)={2\over3c\_n^{2/3}}$$
for some $c\_n\in(n^2+3,n^5+5)$. Clearly $c\_n\to\infty$ as $n\to\... |
32,500 | Could you please explain why the syntax in the following stanza is wrong?
>
> Surrounded
>
> by that sturdy assertiveness
>
> that walled England the din
>
> of traffic in my mind quietens,
>
>
> | 2011/07/02 | [
"https://english.stackexchange.com/questions/32500",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/10536/"
] | There is nothing I can see wrong in the syntax of that stanza. In fact, unlike much poetry, there is no serious lexical ambiguity; and with a single comma it would render just fine as a prose sentence:
>
> Surrounded by that sturdy assertiveness that walled England, the din of traffic in my mind quietens.
>
>
>
T... | There are two slightly different answers to your question. As a matter of formal grammar it is missing a comma.
```
Surrounded
by that sturdy assertiveness
that walled England **[COMMA]** the din
of traffic in my mind quietens,
```
However, there is something else worth pointing out. One of the things that sets poe... |
33,061,827 | This question has been asked before: [Start the thumbnails from the left of the slideshow instead of the middle](https://stackoverflow.com/q/30867297/4220943), but there's no answer yet.
I'm trying to get the thumbnail bar at the bottom to align the thumbnails to the left when fotorama is loaded. By default, it's cent... | 2015/10/11 | [
"https://Stackoverflow.com/questions/33061827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4220943/"
] | As I answered it here, [Start the thumbnails from the left of the slideshow instead of the middle](https://stackoverflow.com/questions/30867297/start-the-thumbnails-from-the-left-of-the-sldieshow-instead-of-middle-of-the-sli/33062159#33062159), It is simple. The fotorama plugin uses css3 transform property to align thu... | Just add to CSS that code:
```
.fotorama__nav {
text-align: left or right !important;
}
``` |
33,061,827 | This question has been asked before: [Start the thumbnails from the left of the slideshow instead of the middle](https://stackoverflow.com/q/30867297/4220943), but there's no answer yet.
I'm trying to get the thumbnail bar at the bottom to align the thumbnails to the left when fotorama is loaded. By default, it's cent... | 2015/10/11 | [
"https://Stackoverflow.com/questions/33061827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4220943/"
] | I've just set
```
.fotorama__nav__shaft {
display: block;
}
``` | Just add to CSS that code:
```
.fotorama__nav {
text-align: left or right !important;
}
``` |
47,171 | I'm running an alter table, alter column on a table with nearly 30 million rows and SQL Azure fails after approximately 18 minutes saying that `The session has been terminated because of excessive transaction log space usage. Try modifying fewer rows in a single transaction.`
I'm guessing that it's not possible to bre... | 2013/07/28 | [
"https://dba.stackexchange.com/questions/47171",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/574/"
] | You will want to load your data into a new table, doing this in small batches, then drop the existing table. I put together a quick example using the Sales.Customer table in AdventureWorks, something similar should work for you also.
First, create your new table, complete with the new datatype you want to use:
```
CR... | I'm on a phone right now but I just answered a very similar question on StackOverflow a few days ago. The column names are probably not applicable to you, but here's what I gave.
```
SELECT
[ID],
[Title],
[Abstract],
[Value],
[UserID],
[GroupID],
[Date],
[Views],
[Hates],
[Likes],
[Source]
INTO dbo.[News-News_Newest... |
914,814 | ```
class Object
attr_reader :foo
def initialize
@foo = 'bar'
end
end
Object.new.foo # => 'bar'
''.foo # => nil
//.foo # => nil
[].foo # => nil
```
I want them all to return `'bar'`
Am aware that you can do this already:
```
class Object
def foo
'bar'
end
end
```
But I specifically want to init... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113019/"
] | If the thing you're trying to return (here, `'bar'`) requires much more setup cost than a small String, you could use the memoized version of [HermanD's answer](https://stackoverflow.com/questions/914814/in-ruby-how-can-i-initialize-instance-variables-in-new-objects-of-core-classes-c/914838#914838):
```
class Object
... | It's not an instance variable, but will meet the requirements of your example
```
class Object
def foo
'bar'
end
end
``` |
914,814 | ```
class Object
attr_reader :foo
def initialize
@foo = 'bar'
end
end
Object.new.foo # => 'bar'
''.foo # => nil
//.foo # => nil
[].foo # => nil
```
I want them all to return `'bar'`
Am aware that you can do this already:
```
class Object
def foo
'bar'
end
end
```
But I specifically want to init... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113019/"
] | This **is** possible.
```
class Object
class << self
Kernel.send :define_method, :foo do #Object.send to be more restrictive
@foo = 'bar'
end
end
end
```
.
```
irb(main):023:0> class Object
irb(main):024:1> class << self
irb(main):025:2> Kernel.send :define_method, :foo do
irb(main):026:3* @foo =... | It's not an instance variable, but will meet the requirements of your example
```
class Object
def foo
'bar'
end
end
``` |
914,814 | ```
class Object
attr_reader :foo
def initialize
@foo = 'bar'
end
end
Object.new.foo # => 'bar'
''.foo # => nil
//.foo # => nil
[].foo # => nil
```
I want them all to return `'bar'`
Am aware that you can do this already:
```
class Object
def foo
'bar'
end
end
```
But I specifically want to init... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113019/"
] | This **is** possible.
```
class Object
class << self
Kernel.send :define_method, :foo do #Object.send to be more restrictive
@foo = 'bar'
end
end
end
```
.
```
irb(main):023:0> class Object
irb(main):024:1> class << self
irb(main):025:2> Kernel.send :define_method, :foo do
irb(main):026:3* @foo =... | If the thing you're trying to return (here, `'bar'`) requires much more setup cost than a small String, you could use the memoized version of [HermanD's answer](https://stackoverflow.com/questions/914814/in-ruby-how-can-i-initialize-instance-variables-in-new-objects-of-core-classes-c/914838#914838):
```
class Object
... |
91,576 | Are the Jazz Masses, like the ones Mary Lou Williams and Joe Masters composed still licit forms of the Mass or have they been officially suppressed at some point in the last 50-60 years? | 2022/06/14 | [
"https://christianity.stackexchange.com/questions/91576",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/4/"
] | The 1967 instruction *[Musicam Sacram](https://www.vatican.va/archive/hist_councils/ii_vatican_council/documents/vat-ii_instr_19670305_musicam-sacram_en.html)* stated
>
> In permitting and using musical instruments, the culture and traditions of individual peoples must be taken into account. However, those instrument... | They are certainly not suppressed, if not less popular than at one point in time. Various churches in the US have weekly Jazz Masses, and multiple dioceses sponsor annual ones (while others have commissioned them for special occasions). There's one coming up next month in Detroit.
This, of course, says nothing on the ... |
51,153,183 | I am trying to cherry-pick a commit from one branch to another. Consider the below scenario.
Branch A -> commit1 -> commit message "12345 Hello World"
I want to add a new message at the beginning of the commit message while doing cherry-pick. So after cherry-pick it should look like,
Branch B -> commit2 -> commit me... | 2018/07/03 | [
"https://Stackoverflow.com/questions/51153183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6096034/"
] | There isn't much to explain about `git cherry-pick --edit`. If you cherry pick with the `--edit` option, Git will bring up the commit message editor window before making the commit. There, you may customize the commit message however you want.
As to the logistics of *why* this is possible, when you cherry pick a commi... | From comments, what you want is for the edit to occur automatically, rather than for git to present you with the commit message in an editor window.
To do this, write a script that edits the message in the required way. Your script will receive a filename as its first command-line argument, and it must update that fil... |
51,153,183 | I am trying to cherry-pick a commit from one branch to another. Consider the below scenario.
Branch A -> commit1 -> commit message "12345 Hello World"
I want to add a new message at the beginning of the commit message while doing cherry-pick. So after cherry-pick it should look like,
Branch B -> commit2 -> commit me... | 2018/07/03 | [
"https://Stackoverflow.com/questions/51153183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6096034/"
] | There isn't much to explain about `git cherry-pick --edit`. If you cherry pick with the `--edit` option, Git will bring up the commit message editor window before making the commit. There, you may customize the commit message however you want.
As to the logistics of *why* this is possible, when you cherry pick a commi... | Thank you everyone for your quick response. I found the below way which helps my case. It will be done in two steps.
1. Cherry-pick without committing to the target using -n.
```
git cherry-pick -n <hash>
```
2. Then perform commit action.
```
git commit -m <message>
``` |
53,855,437 | I'm a beginner and I'm working on a little exercice right now where I need to implement a function that will vote for a specific picture every time we click on the "Vote" button.
[](https://i.stack.imgur.com/CgrDy.png)
Here is what it looks like, for... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53855437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9736244/"
] | Easiest way is to pipe `node`'s stdout to `python`'s stdin and keep reading `stdin` in Python until it is over. What is not good is that you most probably want to have some console output from Node application, and you definately dont want it to be passed to Python.
Second, recommended approach is to use `tcp/ip` chan... | All you need is to make an ajax request to your pythoncode. You can do this with jquery <http://api.jquery.com/jQuery.ajax/>, or use just javascript
```
$.ajax({
type: "POST",
url: "~/pythoncode.py",
data: { param: text}
}).done(function( o ) {
// do something
});
``` |
17,374,871 | My project has a bare repo setup on the server. I'm currently on branch `0.9/develop`. I merged `0.9/develop` with a branch that another developer was working on. It turns out that it would be **way** more work to fix his code than to obliterate his changes entirely. Unfortunately, I already ran a `git push origin 0.9/... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17374871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1023812/"
] | The message
```
Branch 0.9/develop set up to track remote branch 0.9/develop from origin.
Switched to a new branch '0.9/develop'
```
means the following:
* git created a new branch pointer named 0.9/develop that points to the current head of origin/0.9/develop
* This branch pointer has auto-generated configuration... | Possibly your root problem is [answered here](https://stackoverflow.com/questions/4084868/how-do-i-recover-resynchronise-after-someone-pushes-a-rebase-or-a-reset-to-a-pub)
After manipulation like yours client must reset back a few commits and pull again, as their repo is ahead the forced push.
If you happen to be on ... |
17,374,871 | My project has a bare repo setup on the server. I'm currently on branch `0.9/develop`. I merged `0.9/develop` with a branch that another developer was working on. It turns out that it would be **way** more work to fix his code than to obliterate his changes entirely. Unfortunately, I already ran a `git push origin 0.9/... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17374871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1023812/"
] | The message
```
Branch 0.9/develop set up to track remote branch 0.9/develop from origin.
Switched to a new branch '0.9/develop'
```
means the following:
* git created a new branch pointer named 0.9/develop that points to the current head of origin/0.9/develop
* This branch pointer has auto-generated configuration... | It sounds like you need to check out the branch in the bare repo and use `git reset` to reset it back to where you want it. Alternatively, you can `git reset` the local branch in your local repo and `git push -f` it. In the staging repo, you have to do a `git reset` just like you do in your normal working repo. |
23,318,767 | I have this little class:
```
var SwitchHider;
SwitchHider = {
inputSelector: 'body.socials input',
_showOrHideClosestSwitch: function(element) {
var socialUrl, swich_wrapper;
socialUrl = $(element).val();
swich_wrapper = $(element).closest('.white-box').find('.switch');
if (socialUrl.length > 0) ... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23318767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1988673/"
] | The two commands have absolutely nothing in common, so no, you cannot use parentheses like that.
You must execute all the commands within a single CMD /C. You can concatenate commands on one line using `&`. I've defined a simple XCOPY "macro" to save a bit of typing.
```
set XCOPY=xcopy /e /c /h /i /v /r /y /q"
forfi... | I realize this is an old post, but another way of doing it is to call a batch file and pass it the parameters that it needs. And I do not believe that there is any limitations in what can be in that batch file. For example:
forfiles /M "\*.img" /C "cmd /c ProcessFile.bat @file @fdate @ftime" |
40,765,504 | I upload image files with codeigniter to my website using:
```
$uploaded = $this->upload->data();
```
and getting the filename in this way:
```
$uploaded['file_name'];
```
I want to change this filename adding "\_thumb" before extension and after the name. Like 'sda8sda8fa8f9.jpg' to 'sda8sda8fa8f9\_thumb.jpg'. S... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40765504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5830157/"
] | When configuring [CI's file uploader](https://www.codeigniter.com/user_guide/libraries/file_uploading.html), you can pass a `file_name` option to the class. That will change the name of the uploaded file. Here's the description from the docs:
>
> If set CodeIgniter will rename the uploaded file to this name. The ext... | Simply add the calculated hash value to file name with thumb
```
$hash_variable = //Your calculated value
$thumb = '_thumb'
$config['file_name'] = $hash_variable.$thumb.".pdf|jpg|png etc";
$this->load->library('upload',$config);
``` |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't have much experience with dating. But I want to leave this here.
>
> *When I meet someone to date, how can I communicate clearly that I am only interested in a casual/short-term dating relationship, such as dating for a few months by doing fun activities, going to parties, attending concerts, etc?*
>
>
>
... | >
> My latest three dating experiences have ended with the other person
> upset about the relationship not becoming more serious, even though
> I made it clear that I would **never** get serious with the person.
>
>
>
Are you sure you can always control your feelings? No matter how clearly or well you communicat... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't have much experience with dating. But I want to leave this here.
>
> *When I meet someone to date, how can I communicate clearly that I am only interested in a casual/short-term dating relationship, such as dating for a few months by doing fun activities, going to parties, attending concerts, etc?*
>
>
>
... | First, the assumptions.
* When you say "short term dating relationship" I'm assuming you mean acting as BF and GF, including physical intimacy.
* You are not currently in this situation, you are looking toward the next one
It is not unseemly for her to want to renegotiate the terms as her feelings evolve over time. ... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | Short term dating relationships are just that *short term.* Meaning that regardless of how you try to frame it, you can only push them so long before people want or expect more.
I applaud your being honest about your intentions, telling people upfront what you're looking for is a good first step, but then you have to ... | First, the assumptions.
* When you say "short term dating relationship" I'm assuming you mean acting as BF and GF, including physical intimacy.
* You are not currently in this situation, you are looking toward the next one
It is not unseemly for her to want to renegotiate the terms as her feelings evolve over time. ... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't have much experience with dating. But I want to leave this here.
>
> *When I meet someone to date, how can I communicate clearly that I am only interested in a casual/short-term dating relationship, such as dating for a few months by doing fun activities, going to parties, attending concerts, etc?*
>
>
>
... | Short term dating relationships are just that *short term.* Meaning that regardless of how you try to frame it, you can only push them so long before people want or expect more.
I applaud your being honest about your intentions, telling people upfront what you're looking for is a good first step, but then you have to ... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't see *sex* mentioned anywhere, or in reply to Catija's comments. It matters.
If you want to make it crystal clear that you're not interested in any long-term relationships, then put a time limit on it. Honest. Otherwise there's a good chance that the person you're "having fun with" might think they can change y... | First, the assumptions.
* When you say "short term dating relationship" I'm assuming you mean acting as BF and GF, including physical intimacy.
* You are not currently in this situation, you are looking toward the next one
It is not unseemly for her to want to renegotiate the terms as her feelings evolve over time. ... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't see *sex* mentioned anywhere, or in reply to Catija's comments. It matters.
If you want to make it crystal clear that you're not interested in any long-term relationships, then put a time limit on it. Honest. Otherwise there's a good chance that the person you're "having fun with" might think they can change y... | >
> My latest three dating experiences have ended with the other person
> upset about the relationship not becoming more serious, even though
> I made it clear that I would **never** get serious with the person.
>
>
>
Are you sure you can always control your feelings? No matter how clearly or well you communicat... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't see *sex* mentioned anywhere, or in reply to Catija's comments. It matters.
If you want to make it crystal clear that you're not interested in any long-term relationships, then put a time limit on it. Honest. Otherwise there's a good chance that the person you're "having fun with" might think they can change y... | First of all, kudos to you for being so honest. And I think the other answers are great advice.
However, I think the following points are yet missing. You ask:
>
> When I meet someone to date, how can I communicate clearly [...]
>
>
>
The key point here is that this communication should not be a one-time thing yo... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | Short term dating relationships are just that *short term.* Meaning that regardless of how you try to frame it, you can only push them so long before people want or expect more.
I applaud your being honest about your intentions, telling people upfront what you're looking for is a good first step, but then you have to ... | >
> My latest three dating experiences have ended with the other person
> upset about the relationship not becoming more serious, even though
> I made it clear that I would **never** get serious with the person.
>
>
>
Are you sure you can always control your feelings? No matter how clearly or well you communicat... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't see *sex* mentioned anywhere, or in reply to Catija's comments. It matters.
If you want to make it crystal clear that you're not interested in any long-term relationships, then put a time limit on it. Honest. Otherwise there's a good chance that the person you're "having fun with" might think they can change y... | Short term dating relationships are just that *short term.* Meaning that regardless of how you try to frame it, you can only push them so long before people want or expect more.
I applaud your being honest about your intentions, telling people upfront what you're looking for is a good first step, but then you have to ... |
4,618 | I didn't see a related or similar question, but if you can find one, please link it and I'll close this.
**Background**
I had little experience in high school and college and learned some of my skills later. My first two serious girlfriends were in my twenties and they both cheated. From this I realized I didn't enjo... | 2017/09/26 | [
"https://interpersonal.stackexchange.com/questions/4618",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/6485/"
] | I don't have much experience with dating. But I want to leave this here.
>
> *When I meet someone to date, how can I communicate clearly that I am only interested in a casual/short-term dating relationship, such as dating for a few months by doing fun activities, going to parties, attending concerts, etc?*
>
>
>
... | I don't see *sex* mentioned anywhere, or in reply to Catija's comments. It matters.
If you want to make it crystal clear that you're not interested in any long-term relationships, then put a time limit on it. Honest. Otherwise there's a good chance that the person you're "having fun with" might think they can change y... |
71,591,314 | I'm working in an Electron application. There are alot of events being passed around with specific listeners for each event. For instance BrowserWindow.on:
```
Electron.BrowserWindow.on(event, listener)
```
`event` can be any of `'always-on-top-changed', 'app-command', etc etc...` . I want a list of all of these eve... | 2022/03/23 | [
"https://Stackoverflow.com/questions/71591314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5839529/"
] | Turns out it is possible to do this, but it's not pretty. The problem is that the `on` method is declared with a separate overload for each event name, and type inference on overloaded functions only considers the last one (in this case the overload for `'will-resize'`).
There is a way to infer types from overloaded f... | Short answer: not possible, see <https://github.com/microsoft/TypeScript/issues/32164>.
In your case, I recommend hard coding the event types.
Overloads are represented as intersections, not unions. Converting the overloads to unions is messy, but possible. I don't recommend using my solution. The type only works wit... |
311,124 | I can't figure out how to set up a simple search. I am trying to find all messages that 'start with' a particular string. Here is an example of 4 message
```
1) Subject: ABC DEF
2) Subject: ABC XYZ
3) Subject: RE: ABC DEF
4) Subject: FW: ABC XYX
```
From this list; I only want to search for message 1 and message 2. ... | 2011/07/16 | [
"https://superuser.com/questions/311124",
"https://superuser.com",
"https://superuser.com/users/90470/"
] | There is no space between NOT and (Subject... ).
the right search is
(subject: "ABC ") and NOT(subject: "RE: ") and NOT(subject: "FW: " ) | Try this:
>
> subject:abc and subject:def not subject:"re:"
>
>
>
<http://www.groovypost.com/forum/microsoft-office/microsoft-outlook-search-syntax-t95537.html> |
35,613,103 | Today i ran into a problem. I was trying to install a plugin via the Wordpress enviroment and all of a sudden I got the following error: "an error occurred while installing IshYoBoy Multicorp Assets: unable to create directory ishyoboy-multicorp-assets."
I have already tried to give the files in wp-content the 777 per... | 2016/02/24 | [
"https://Stackoverflow.com/questions/35613103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5967896/"
] | Simply append owner and group arguments to the `synced_folder` config in the Vagrantfile
>
> ,:owner=> 'www-data', :group=>'www-data'
>
>
>
### Example
```
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.synced_folder "wp-root/", "/var/www",:owner=> 'www-data', ... | Make sure that your web server has permission to write to that folder. Changing the permissions to 0777 may not solve the problem, and it's not a great way to go anyway.
If the folder is currently owned by "root" or some other user, try switching the owner to apache, www, or whatever your server uses for ownership usi... |
48,201,696 | I'm loading image url using glide and applying rounded corner transformation. It works fine for first setup of recyclerview. Later when i call `notifydatasetchanged()` after pagination it becomes square. What am I missing?
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.bitmapTransform(new Rounde... | 2018/01/11 | [
"https://Stackoverflow.com/questions/48201696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7923473/"
] | Use this diskCacheStrategy Saves the media item after all transformations to cache.
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.diskCacheStrategy(DiskCacheStrategy.RESULT)
.bitmapTransform(new RoundedCornersTransformation(mContext, 8, 0,
RoundedCornersTransformation.CornerType.ALL))
.placeh... | If the problem happens after calling `notifydatasetchanged()` then don't use it. In fact, that method takes a lot of CPU resources and recreate every item in recyclerview even these items have been already added.
When paginating use `notifyItemInserted` or `notifyItemRangeInserted`. It'll allow you to avoid your probl... |
48,201,696 | I'm loading image url using glide and applying rounded corner transformation. It works fine for first setup of recyclerview. Later when i call `notifydatasetchanged()` after pagination it becomes square. What am I missing?
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.bitmapTransform(new Rounde... | 2018/01/11 | [
"https://Stackoverflow.com/questions/48201696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7923473/"
] | Use this diskCacheStrategy Saves the media item after all transformations to cache.
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.diskCacheStrategy(DiskCacheStrategy.RESULT)
.bitmapTransform(new RoundedCornersTransformation(mContext, 8, 0,
RoundedCornersTransformation.CornerType.ALL))
.placeh... | Don't use `notifyDataSetChanged()` method for pagination at all. instead use `notifyItemInserted()`. [DiffUtil](https://developer.android.com/reference/android/support/v7/util/DiffUtil.html) is a better choice for your apps performance.
If you're loading your image inside `onBindViewHolder()` method this problem shoul... |
48,201,696 | I'm loading image url using glide and applying rounded corner transformation. It works fine for first setup of recyclerview. Later when i call `notifydatasetchanged()` after pagination it becomes square. What am I missing?
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.bitmapTransform(new Rounde... | 2018/01/11 | [
"https://Stackoverflow.com/questions/48201696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7923473/"
] | Use this diskCacheStrategy Saves the media item after all transformations to cache.
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.diskCacheStrategy(DiskCacheStrategy.RESULT)
.bitmapTransform(new RoundedCornersTransformation(mContext, 8, 0,
RoundedCornersTransformation.CornerType.ALL))
.placeh... | ```
datalist.clear(); //clear old data before adddi
SampleAdapter adapter = (SampleAdapter) recyclerview.getAdapter();
recyclerview.setAdapter(null);
recyclerview.setAdapter(adapter);
datalist.addAll(resource.getData());//add new data
adapter.notifyDataSetChanged();
```
I also had the same problem and fixed it in thi... |
48,201,696 | I'm loading image url using glide and applying rounded corner transformation. It works fine for first setup of recyclerview. Later when i call `notifydatasetchanged()` after pagination it becomes square. What am I missing?
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.bitmapTransform(new Rounde... | 2018/01/11 | [
"https://Stackoverflow.com/questions/48201696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7923473/"
] | If the problem happens after calling `notifydatasetchanged()` then don't use it. In fact, that method takes a lot of CPU resources and recreate every item in recyclerview even these items have been already added.
When paginating use `notifyItemInserted` or `notifyItemRangeInserted`. It'll allow you to avoid your probl... | ```
datalist.clear(); //clear old data before adddi
SampleAdapter adapter = (SampleAdapter) recyclerview.getAdapter();
recyclerview.setAdapter(null);
recyclerview.setAdapter(adapter);
datalist.addAll(resource.getData());//add new data
adapter.notifyDataSetChanged();
```
I also had the same problem and fixed it in thi... |
48,201,696 | I'm loading image url using glide and applying rounded corner transformation. It works fine for first setup of recyclerview. Later when i call `notifydatasetchanged()` after pagination it becomes square. What am I missing?
```
Glide.with(mContext)
.load(primary.getpSmallImage())
.bitmapTransform(new Rounde... | 2018/01/11 | [
"https://Stackoverflow.com/questions/48201696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7923473/"
] | Don't use `notifyDataSetChanged()` method for pagination at all. instead use `notifyItemInserted()`. [DiffUtil](https://developer.android.com/reference/android/support/v7/util/DiffUtil.html) is a better choice for your apps performance.
If you're loading your image inside `onBindViewHolder()` method this problem shoul... | ```
datalist.clear(); //clear old data before adddi
SampleAdapter adapter = (SampleAdapter) recyclerview.getAdapter();
recyclerview.setAdapter(null);
recyclerview.setAdapter(adapter);
datalist.addAll(resource.getData());//add new data
adapter.notifyDataSetChanged();
```
I also had the same problem and fixed it in thi... |
2,245 | >
> Только три процента всей воды на Земле явля(Е/Ю)тся пресной
>
>
>
What letter should I choose there? Е or Ю? | 2013/05/15 | [
"https://russian.stackexchange.com/questions/2245",
"https://russian.stackexchange.com",
"https://russian.stackexchange.com/users/170/"
] | In this case the following rule would apply (Rosenthal et al., №184.2):
>
> Форма единственного числа сказуемого указывает на совокупность предметов, форма множественного числа – на отдельные предметы. Ср.: *В городе строится пять объектов соцкультбыта* (единое нерасчлененное представление о действии). – *В крупнейши... | три процента ... являются, так как "являться" - глагол относится к 1 спряжению. <http://www.gramota.ru/class/coach/tbgramota/45_91> |
50,727,539 | I made some elements in JavaScript that i add to the website. When i add an eventlistener to the button, only the first button works and runs the function.
I used to do this before and worked fine, any idea what i'm doing here wrong?
my javascript function:
```js
function laadProjectDetails(){
fetch("restservices/... | 2018/06/06 | [
"https://Stackoverflow.com/questions/50727539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9528069/"
] | I wasn't satisfied with the previous answer (specially concerning the beta macOS component) ... and I really wanted to install Mojave, so I went hunting for some docs or verification. The closest I got is this quoted answer from Apple Developer Technical Support related to a failed submission with an odd ITMS error: <h... | No, you can not submit a build of your app that was built with either Xcode 10 or macOS Mojave at this time. Apple does not allow apps built with any beta software to be published. |
67,184,541 | I am trying to extract a CSV report from our company's ASP.NET ReportViewer via selenium.
I have got as far as clicking the the export dropdown menu (see image), but I am unable to click the csv button (which will download the CSV report) I have tried waiting then clicking with no results.
**My code:**
```
driver = w... | 2021/04/20 | [
"https://Stackoverflow.com/questions/67184541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12734203/"
] | You need to await connection first inorder to use execute function:
```
const [rows] = await (await connection()).execute('SELECT * FROM media');
```
OR
```
const conn = await connection();
const [rows] = await conn.execute('SELECT * FROM media');
``` | You need to await the `connection()` itself, then execute:
```js
app.get('/', async () => {
const connected = await connection();
const [rows] = await connected.execute('SELECT * FROM media');
res.send(rows.length);
});
``` |
5,938,594 | I have a range slider on my site for min-max price ranges. On either side of the slider are two text input boxes. I've created a callback function with the slider which adjusts the vals of the text boxes based on a val change within the slider.
At the same time, I would also like to adjust the values of the slider ba... | 2011/05/09 | [
"https://Stackoverflow.com/questions/5938594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/558699/"
] | * For multi-handle sliders, you need to use `'values'` rather than `'value'` (which you're doing) but `'values'` takes this format:
```
.slider( "values" , index , [value] )
```
* You probably want to enforce `max >= min` when setting the slider values based on the textboxes.
* You are passing the initial values to `... | According to the [jQuery UI documentation](http://jqueryui.com/demos/slider/#method-values), `slider('values')` takes index as the second param and value as the third. Try this:
```
$('input#lower_bound').change(function(){
$('.price_slider').slider("values",0,$(this).val());
$('.price_slider').slider("values"... |
15,226,630 | I'm struggling on replacing text in each link.
```
$reg_ex = "/(http|https)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
$text = '<br /><p>this is a content with a link we are supposed to <a href="http://www.google.com">click</a></p><p>another - this is a content with a link we are supposed to <a href="http://www... | 2013/03/05 | [
"https://Stackoverflow.com/questions/15226630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/548278/"
] | You don't use regexes on html. use [DOM](http://php.net/dom) instead. That being said, your bug is here:
```
$replace = str_replace(...., $text);
^^^^^^^^--- ^^^^^---
```
you never update $text, so you continually trash the replacement on every iteration of the loop. You probably want
```
$text = s... | If you want the final variable to contain all replacements change it so something like this...
You basically are not passing the replaced string back into the "subject". I assume that is what you are expecting since it's a bit difficult to understand the question.
```
$reg_ex = "/(http|https)\:\/\/[a-zA-Z0-9\-\.]+\.[a... |
11,332,269 | I need to create route `/branch` which run script `/lib/branch.rb`, I need to display only one string which displayed in browser my current git branch which deployed at staging server. I already write script, but cant understand how to mount it to rails routes | 2012/07/04 | [
"https://Stackoverflow.com/questions/11332269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/548618/"
] | Try the following solutions by Directly targeting the `ul`
***Solution A***:
---
```js
// previous (following) is very inefficient and slow:
// -- $(this).find("ul.sub-menu").not("ul.sub-menu li ul.sub-menu").slideDown();
// Rather, target the exact ULs which are Direct Children
$("ul.menu").find('li').hover(... | This is untested .. and you have to expand it a bit.
```
$('ul.menu li').siblings('ul:first-child').on('click', function() {
if($(this).is(':visible')) {
$(this).hide();
}
else {
$(this).show();
}
})
$('ul.menu li').siblings('ul:first-child').hover(
function() {
$(this).show();
},
function() {
$(this... |
32,811,437 | Is it wrong way to pass $\_GET variable in MVC design?
```
http://localhost/video?id=123
```
I started to learn MCV design pattern and some people were telling me, that I'm doing wrong. The correct way would be:
```
http://localhost/video/?id=123
```
They were saying its kinda of 'standard' for passing $\_GET in ... | 2015/09/27 | [
"https://Stackoverflow.com/questions/32811437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | This has nothing to do with MVC. MVC is just a way to organize your code.
The way you rewrite/route URLs to controllers is up to you. Both ways work, as long as the URL matches what you defined on your backend! | When passing parameters that would bring up information from your DB or http server is ok to use GET.
When sending information to modify the state of anything, change data in your DB or on your http server you should always use POST |
72,170,760 | I'm new in VBA and actually don't know how to deal with that task. Maybe you can help me.
I have two tables in two sheets.
Table from sheet 1 is updated daily.
What I need to do is check if any value in column A (sheet 1) is in column A (sheet 2).
If yes, then do nothing.
If no, then copy whole row into the table in ... | 2022/05/09 | [
"https://Stackoverflow.com/questions/72170760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17902492/"
] | Update Worksheet With Missing (Unique) Rows (Dictionary)
--------------------------------------------------------
* Adjust the values in the constants section.
```vb
Sub UpdateData()
' Source
Const sName As String = "Sheet1"
Const sFirstCellAddress As String = "A2"
' Destination
Const dName As St... | No you don't need a loop. You need the Find function for a Range
See [Documentation for Find Method (Excel)](https://learn.microsoft.com/en-us/office/vba/api/excel.range.find)
also [Excel VBA Find A Complete Guide](https://excelmacromastery.com/excel-vba-find/) |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | Given your original problem statement,
>
> I need to use lists for my program and needed to decide if I use std::vector or std::list. The problem with vector is that there is no remove method and with list that there is no operator [].
>
>
>
there is no need to create your own list class (this is not a wise desig... | Vectors have the [erase method](http://www.cppreference.com/wiki/stl/vector/erase) that can remove elements. Is that not sufficient? |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | Given your original problem statement,
>
> I need to use lists for my program and needed to decide if I use std::vector or std::list. The problem with vector is that there is no remove method and with list that there is no operator [].
>
>
>
there is no need to create your own list class (this is not a wise desig... | In addition to other excellent comments, the best way to extend a standard container is not by derivation, but writing free functions. For instance, see how [Boost String Algorithms](http://www.boost.org/doc/libs/1_37_0/doc/html/string_algo.html) can be used to extend `std::string` and other string classes. |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | Depending on your needs, you should use `std::vector` (if you need often appends/removes at the end, and random access), or `std::deque` (if you need often appends/removes at the end or at the beginning, and your dataset is huge, and still want random access). Here is a good picture showing you how to make the decision... | You have to move all your template code into header. |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | Given your original problem statement,
>
> I need to use lists for my program and needed to decide if I use std::vector or std::list. The problem with vector is that there is no remove method and with list that there is no operator [].
>
>
>
there is no need to create your own list class (this is not a wise desig... | The obvious stuff has already been described in details:
But the methods you choose to implement??
* Destructor.
+ Not required compiler will generate that for you.
* The two different versions of operator[] are pointless
+ Also you should be uisng std::list::size\_type as the index
+ Unless you intend to suppor... |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | You have to move all your template code into header. | There is no need to call destructor of std::list , because you already derive from std::list when destructor called for myList automatically std::list destructor will be called. |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | Vectors have the [erase method](http://www.cppreference.com/wiki/stl/vector/erase) that can remove elements. Is that not sufficient? | You have to move all your template code into header. |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | Depending on your needs, you should use `std::vector` (if you need often appends/removes at the end, and random access), or `std::deque` (if you need often appends/removes at the end or at the beginning, and your dataset is huge, and still want random access). Here is a good picture showing you how to make the decision... | In addition to other excellent comments, the best way to extend a standard container is not by derivation, but writing free functions. For instance, see how [Boost String Algorithms](http://www.boost.org/doc/libs/1_37_0/doc/html/string_algo.html) can be used to extend `std::string` and other string classes. |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | The obvious stuff has already been described in details:
But the methods you choose to implement??
* Destructor.
+ Not required compiler will generate that for you.
* The two different versions of operator[] are pointless
+ Also you should be uisng std::list::size\_type as the index
+ Unless you intend to suppor... | There is no need to call destructor of std::list , because you already derive from std::list when destructor called for myList automatically std::list destructor will be called. |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | All template code should be put in header file. This fill fix linking problems (that's the simplest way).
The reason it happens is because compilers compiles every source (.cc) file separately from other files. On the other hand it needs to know what code exactly it needs to create (i.e. what is the T in template is su... | In addition to other excellent comments, the best way to extend a standard container is not by derivation, but writing free functions. For instance, see how [Boost String Algorithms](http://www.boost.org/doc/libs/1_37_0/doc/html/string_algo.html) can be used to extend `std::string` and other string classes. |
366,432 | I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
```
#include... | 2008/12/14 | [
"https://Stackoverflow.com/questions/366432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2450/"
] | All template code should be put in header file. This fill fix linking problems (that's the simplest way).
The reason it happens is because compilers compiles every source (.cc) file separately from other files. On the other hand it needs to know what code exactly it needs to create (i.e. what is the T in template is su... | The obvious stuff has already been described in details:
But the methods you choose to implement??
* Destructor.
+ Not required compiler will generate that for you.
* The two different versions of operator[] are pointless
+ Also you should be uisng std::list::size\_type as the index
+ Unless you intend to suppor... |
10,453,431 | Is there any open source findbugs detectors extensions, espcially for performance bugs, for low-latency? I didn't find any meaningful extension beyond barebone findbugs impl. | 2012/05/04 | [
"https://Stackoverflow.com/questions/10453431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1294552/"
] | Your code seems ok - did you copy the db to the ressource folder of your project?
**EDIT**
Make sure you access your db file with something like that:
```
- (void) initializeDB {
// Get the database from the application bundle
NSString* path = [[NSBundle mainBundle] pathForResource:@"tblStore" o... | The database file you add to the project will be embedded in the main `NSBundle` (see `[NSBundle mainBundle]`).
In order to do what you want, you need to copy the database from the main bundle to the documents folder before trying to access it. Otherwise, as you are experiencing, you will not be able to find the SQLit... |
10,453,431 | Is there any open source findbugs detectors extensions, espcially for performance bugs, for low-latency? I didn't find any meaningful extension beyond barebone findbugs impl. | 2012/05/04 | [
"https://Stackoverflow.com/questions/10453431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1294552/"
] | Your code seems ok - did you copy the db to the ressource folder of your project?
**EDIT**
Make sure you access your db file with something like that:
```
- (void) initializeDB {
// Get the database from the application bundle
NSString* path = [[NSBundle mainBundle] pathForResource:@"tblStore" o... | You can copy your database, click finder and write this address(/Users/administrator/Library/Application Support/iPhone Simulator/6.1/Applications/) in finder click ok.
You will get documentary path.
Open your project document file and paste your database.... |
10,453,431 | Is there any open source findbugs detectors extensions, espcially for performance bugs, for low-latency? I didn't find any meaningful extension beyond barebone findbugs impl. | 2012/05/04 | [
"https://Stackoverflow.com/questions/10453431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1294552/"
] | The database file you add to the project will be embedded in the main `NSBundle` (see `[NSBundle mainBundle]`).
In order to do what you want, you need to copy the database from the main bundle to the documents folder before trying to access it. Otherwise, as you are experiencing, you will not be able to find the SQLit... | You can copy your database, click finder and write this address(/Users/administrator/Library/Application Support/iPhone Simulator/6.1/Applications/) in finder click ok.
You will get documentary path.
Open your project document file and paste your database.... |
2,318,002 | $$|x-2|+|x+3|= 5$$
What are the real values of $x$ satisfies the equation?
I tried doing this but it somehow did not work. Could someone explaim why please? Here's my workings :
$$|x-2|+|x+3|=5$$
$$\Rightarrow (x-2)+(x+3)=5$$
$$\Rightarrow x+2+x+3=5$$
$$\Rightarrow x=6$$
$$\Rightarrow x=3$$
The answer is $[-3,2]$ | 2017/06/11 | [
"https://math.stackexchange.com/questions/2318002",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/454081/"
] | Hint:
For a number to be bigger than $340$.
The first digit can be either $3$ or $4$.
If the first digit is $3$, the second digit must be $4$ and the last digit can be anything.
If the first digit is $4$, the last two digit can be anything.
Can you compute the probability now? | In general suppose we have an alphabet of $n$ characters and a fixed permutation $a\_1,a\_2,\dots, a\_k$ of them. We select a permutation of length $k$ of the alphabet randomly, what is the probability it is less than or equal to $a\_1,a\_2,\dots, a\_n$?
This is given by the formula:
$$\frac{1+\sum\limits\_{i=1}^{k-1... |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | Your main method calls the methods but does not use the values returned from those methods.
You should change your `main` method as follows.
```
public class RunSugarBowl {
public static void main(String[] args) {
SugarBowl one = new SugarBowl(200);
System.out.println("Occupied size is : "+ one.occ... | You should replace
```
sugarBowl (int totalCapacity){
availableSpace=totalCapacity;
spoonSize = totalCapacity/20;//arbitrary size
}
```
by
```
public SugarBowl (int totalCapacity){
availableSpace=totalCapacity;
spoonSize = totalCapacity/20;//arbitrary size
}
``` |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | Your code is wrong unfortunately. You Should change this function
```
public void addSugar (int addedAmount){
if (addedAmount>availableSpace){
int remainingAmount=addedAmount-availableSpace;
System.out.println("Sugar bowl completely full. You got left: "+ remainingAmount);}
else{
S... | You should replace
```
sugarBowl (int totalCapacity){
availableSpace=totalCapacity;
spoonSize = totalCapacity/20;//arbitrary size
}
```
by
```
public SugarBowl (int totalCapacity){
availableSpace=totalCapacity;
spoonSize = totalCapacity/20;//arbitrary size
}
``` |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | First off, just as a tip, it's useful to add method headers so you know what your method is trying to do. Aka, if you look at your specifications many of your methods require you to "know how much..." so the methods should return a number rather than immediately printing something out (I made the same mistake when I be... | Your code is wrong unfortunately. You Should change this function
```
public void addSugar (int addedAmount){
if (addedAmount>availableSpace){
int remainingAmount=addedAmount-availableSpace;
System.out.println("Sugar bowl completely full. You got left: "+ remainingAmount);}
else{
S... |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | First off, just as a tip, it's useful to add method headers so you know what your method is trying to do. Aka, if you look at your specifications many of your methods require you to "know how much..." so the methods should return a number rather than immediately printing something out (I made the same mistake when I be... | Your main method calls the methods but does not use the values returned from those methods.
You should change your `main` method as follows.
```
public class RunSugarBowl {
public static void main(String[] args) {
SugarBowl one = new SugarBowl(200);
System.out.println("Occupied size is : "+ one.occ... |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | First off, just as a tip, it's useful to add method headers so you know what your method is trying to do. Aka, if you look at your specifications many of your methods require you to "know how much..." so the methods should return a number rather than immediately printing something out (I made the same mistake when I be... | The addSugar method as required by the spec should return an int:
addSugar method should also update both availableSpace and occupiedSpace.
in main you are calling one.occupied() method but you are not doing anything with that value,perhaps you want to print it to see it.
the following is your addSugar method and mai... |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | First off, just as a tip, it's useful to add method headers so you know what your method is trying to do. Aka, if you look at your specifications many of your methods require you to "know how much..." so the methods should return a number rather than immediately printing something out (I made the same mistake when I be... | You can add the `main()` method into your `sugarBowl` class. You don't need a separate class to run it.
I'd modify your main like this:
```
public class RunSugarBowl {
public static void main(String[] args) {
sugarBowl one = new sugarBowl(200);
one.occupied();
one.addSugar(100);
}... |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | Your main method calls the methods but does not use the values returned from those methods.
You should change your `main` method as follows.
```
public class RunSugarBowl {
public static void main(String[] args) {
SugarBowl one = new SugarBowl(200);
System.out.println("Occupied size is : "+ one.occ... | You can add the `main()` method into your `sugarBowl` class. You don't need a separate class to run it.
I'd modify your main like this:
```
public class RunSugarBowl {
public static void main(String[] args) {
sugarBowl one = new sugarBowl(200);
one.occupied();
one.addSugar(100);
}... |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | First off, just as a tip, it's useful to add method headers so you know what your method is trying to do. Aka, if you look at your specifications many of your methods require you to "know how much..." so the methods should return a number rather than immediately printing something out (I made the same mistake when I be... | You should replace
```
sugarBowl (int totalCapacity){
availableSpace=totalCapacity;
spoonSize = totalCapacity/20;//arbitrary size
}
```
by
```
public SugarBowl (int totalCapacity){
availableSpace=totalCapacity;
spoonSize = totalCapacity/20;//arbitrary size
}
``` |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | Your code is wrong unfortunately. You Should change this function
```
public void addSugar (int addedAmount){
if (addedAmount>availableSpace){
int remainingAmount=addedAmount-availableSpace;
System.out.println("Sugar bowl completely full. You got left: "+ remainingAmount);}
else{
S... | You can add the `main()` method into your `sugarBowl` class. You don't need a separate class to run it.
I'd modify your main like this:
```
public class RunSugarBowl {
public static void main(String[] args) {
sugarBowl one = new sugarBowl(200);
one.occupied();
one.addSugar(100);
}... |
14,059,274 | I'm a noob and Java is my first programming language.
I've this problem that I'm trying to solve:
>
> Define a class to represent a Sugar Bowl sugar characterized by three
> things: total capacity (in grams), available quantity and quantity of
> the spoon (how many grams of sugar takes the spoon associated with
> ... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14059274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1932739/"
] | Your code is wrong unfortunately. You Should change this function
```
public void addSugar (int addedAmount){
if (addedAmount>availableSpace){
int remainingAmount=addedAmount-availableSpace;
System.out.println("Sugar bowl completely full. You got left: "+ remainingAmount);}
else{
S... | Your main method calls the methods but does not use the values returned from those methods.
You should change your `main` method as follows.
```
public class RunSugarBowl {
public static void main(String[] args) {
SugarBowl one = new SugarBowl(200);
System.out.println("Occupied size is : "+ one.occ... |
1,690,743 | I'm investigating a possible memory leak which is causing an "Error creating window handle" Win32Exception in my .NET 2.0 WinForms app. This is related to number of Handles and number of USER objects (most likely) so I'm trying to log these metrics the next time the exception is thrown.
HandleCount is easy to find: `... | 2009/11/06 | [
"https://Stackoverflow.com/questions/1690743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/177227/"
] | Try [GetGuiResources](http://msdn.microsoft.com/en-us/library/ms683192(VS.85).aspx) which you can call using [P/Invoke](http://www.pinvoke.net/default.aspx/user32/GetGuiResources.html?DelayRedirect=1) | You can also see this in Windows Task Manager.
1. Select "Process" tab.
2. Select View > "Select Columns..." and check "User Objects" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.