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 |
|---|---|---|---|---|---|
1,265,860 | This keeps happening to me all the time:
1) I write a script(ruby, shell, etc).
2) run it, it works.
3) put it in crontab so it runs in a few minutes so I know it runs from there.
4) It doesnt, no error trace, back to step 2 or 3 a 1000 times.
When I ruby script fails in crontab, I can't really know why it fails cause... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1265860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96087/"
] | >
> "Is there a way for me to just have crontab run a script as if I ran it myself from my terminal?"
>
>
>
Yes:
```
bash -li -c /path/to/script
```
From the man page:
```
[vindaloo:pgl]:~/p/test $ man bash | grep -A2 -m1 -- -i
-i If the -i option is present, the shell is interactive.
-l Ma... | You could write a wrapper script, called for example `rbcron`, which looks something like:
```
#!/bin/bash
RUBY=ruby
export VAR1=foo
export VAR2=bar
export VAR3=baz
$RUBY "$*" 2>&1
```
This will redirect standard error from ruby to the standard output. Then you run `rbcron` in your cron job, and the standard output... |
1,265,860 | This keeps happening to me all the time:
1) I write a script(ruby, shell, etc).
2) run it, it works.
3) put it in crontab so it runs in a few minutes so I know it runs from there.
4) It doesnt, no error trace, back to step 2 or 3 a 1000 times.
When I ruby script fails in crontab, I can't really know why it fails cause... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1265860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96087/"
] | To find out the environment in which cron runs jobs, add this cron job:
```
{ echo "\nenv\n" && env|sort ; echo "\nset\n" && set; } | /usr/bin/mailx -s 'my env' you@example.com
```
Or send the output to a file instead of email. | You could write a wrapper script, called for example `rbcron`, which looks something like:
```
#!/bin/bash
RUBY=ruby
export VAR1=foo
export VAR2=bar
export VAR3=baz
$RUBY "$*" 2>&1
```
This will redirect standard error from ruby to the standard output. Then you run `rbcron` in your cron job, and the standard output... |
1,265,860 | This keeps happening to me all the time:
1) I write a script(ruby, shell, etc).
2) run it, it works.
3) put it in crontab so it runs in a few minutes so I know it runs from there.
4) It doesnt, no error trace, back to step 2 or 3 a 1000 times.
When I ruby script fails in crontab, I can't really know why it fails cause... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1265860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96087/"
] | >
> "Is there a way for me to just have crontab run a script as if I ran it myself from my terminal?"
>
>
>
Yes:
```
bash -li -c /path/to/script
```
From the man page:
```
[vindaloo:pgl]:~/p/test $ man bash | grep -A2 -m1 -- -i
-i If the -i option is present, the shell is interactive.
-l Ma... | To find out the environment in which cron runs jobs, add this cron job:
```
{ echo "\nenv\n" && env|sort ; echo "\nset\n" && set; } | /usr/bin/mailx -s 'my env' you@example.com
```
Or send the output to a file instead of email. |
1,265,860 | This keeps happening to me all the time:
1) I write a script(ruby, shell, etc).
2) run it, it works.
3) put it in crontab so it runs in a few minutes so I know it runs from there.
4) It doesnt, no error trace, back to step 2 or 3 a 1000 times.
When I ruby script fails in crontab, I can't really know why it fails cause... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1265860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96087/"
] | >
> "Is there a way for me to just have crontab run a script as if I ran it myself from my terminal?"
>
>
>
Yes:
```
bash -li -c /path/to/script
```
From the man page:
```
[vindaloo:pgl]:~/p/test $ man bash | grep -A2 -m1 -- -i
-i If the -i option is present, the shell is interactive.
-l Ma... | Run a 'set' command from inside of the ruby script, fire it from crontab, and you'll see exactly what's set and what's not. |
1,265,860 | This keeps happening to me all the time:
1) I write a script(ruby, shell, etc).
2) run it, it works.
3) put it in crontab so it runs in a few minutes so I know it runs from there.
4) It doesnt, no error trace, back to step 2 or 3 a 1000 times.
When I ruby script fails in crontab, I can't really know why it fails cause... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1265860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96087/"
] | Run a 'set' command from inside of the ruby script, fire it from crontab, and you'll see exactly what's set and what's not. | You could write a wrapper script, called for example `rbcron`, which looks something like:
```
#!/bin/bash
RUBY=ruby
export VAR1=foo
export VAR2=bar
export VAR3=baz
$RUBY "$*" 2>&1
```
This will redirect standard error from ruby to the standard output. Then you run `rbcron` in your cron job, and the standard output... |
1,265,860 | This keeps happening to me all the time:
1) I write a script(ruby, shell, etc).
2) run it, it works.
3) put it in crontab so it runs in a few minutes so I know it runs from there.
4) It doesnt, no error trace, back to step 2 or 3 a 1000 times.
When I ruby script fails in crontab, I can't really know why it fails cause... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1265860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96087/"
] | G'day,
One of the basic problems with cron is that you get a **minimal** environment being set by cron. In fact, you only get four env. var's set and they are:
* SHELL - set to /bin/sh
* LOGNAME - set to your userid as found in /etc/passwd
* HOME - set to your home dir. as found in /etc/passwd
* PATH - set to "/usr/b... | Run a 'set' command from inside of the ruby script, fire it from crontab, and you'll see exactly what's set and what's not. |
116,626 | Is there a way to limit the damage one constantly takes in Developper's garden? I get killed every time and don't even know by what. | 2013/05/08 | [
"https://gaming.stackexchange.com/questions/116626",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/48229/"
] | Another way is to use many invulnerability potions, just before you reach the enemies. Watch the countdown and teleport yourself back, when it's nearly over. Then use a seed or another teleport-scroll, so that you can use another invulnerability potion right before the next enemy. It took me the seeds and teleport-scro... | I did it by teleporting back before I got to those evil CGs, and always threw around earthquake scrolls on my way. Somehow that seemed to work... |
307,095 | Can't find a post saying this, and I get a compile error, but just to be sure, this is not supported in Apex right?
```
public interface Access {
public interface Context {
...
}
public Set<Id> accessibleContacts(Context context);
...
}
```
Pity it isn't given that the inner class approach... | 2020/05/22 | [
"https://salesforce.stackexchange.com/questions/307095",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/887/"
] | As the documentation says in this entry [Differences Between Apex Classes and Java Classes](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_java_diffs.htm)
```
- Inner classes and interfaces can only be declared one level deep inside an outer class.
```
So you are allowed to de... | The main reason why this is not supported, is that Apex isn't Java. When salesforce.com sat down and started designing Apex, they created a BNF that they felt could be implemented in a reasonable amount of time, have enough language features to be useful to the majority of customers, and be generally secure and stable ... |
60,758,670 | Given some alphanumerical strings in Python such as
* `A9`
* `B44B`
* `C101`
* `4D4`
how do I check if the string is a valid Excel cell (i.e., **letters come before numbers**)?
I've tried using the `.isalpha` and `.isdigit` methods to "gather" letters and numbers, and then using `.index` to check whether all letters... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60758670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11161432/"
] | As per my comment, validity depends on Excel version. Newer versions have a column range of `A-XDF` and rows from `1-1048576`. It might not be necessary in your project, but for future reference it could be handy:
Regex pattern: `^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([1-9]\d{0,6})$`
To visualize this:
![Re... | I would use regular expressions, well fit for the task:
```
import re
def is_valid_excel_cell(c):
m = re.match("[A-Z]+\d+$",c)
return bool(m)
```
that one checks if the cell contents starts with a capital letter and ends with a digit.
Now if range check is required on the number one more step would be requ... |
60,758,670 | Given some alphanumerical strings in Python such as
* `A9`
* `B44B`
* `C101`
* `4D4`
how do I check if the string is a valid Excel cell (i.e., **letters come before numbers**)?
I've tried using the `.isalpha` and `.isdigit` methods to "gather" letters and numbers, and then using `.index` to check whether all letters... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60758670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11161432/"
] | I would use regular expressions, well fit for the task:
```
import re
def is_valid_excel_cell(c):
m = re.match("[A-Z]+\d+$",c)
return bool(m)
```
that one checks if the cell contents starts with a capital letter and ends with a digit.
Now if range check is required on the number one more step would be requ... | ```
import re
def is_valid_excel_cell(addr):
m = re.match(r'^([A-Z]{1,3})([1-9]\d*)$', addr)
if not m:
return False
letters, numbers = m.groups()
if len(letters) == 3 and letters > 'XFD':
return False
if int(numbers) > 1048576:
return False
return True
```
Semicompress... |
60,758,670 | Given some alphanumerical strings in Python such as
* `A9`
* `B44B`
* `C101`
* `4D4`
how do I check if the string is a valid Excel cell (i.e., **letters come before numbers**)?
I've tried using the `.isalpha` and `.isdigit` methods to "gather" letters and numbers, and then using `.index` to check whether all letters... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60758670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11161432/"
] | As per my comment, validity depends on Excel version. Newer versions have a column range of `A-XDF` and rows from `1-1048576`. It might not be necessary in your project, but for future reference it could be handy:
Regex pattern: `^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([1-9]\d{0,6})$`
To visualize this:
![Re... | ```
import re
def is_valid_excel_cell(addr):
m = re.match(r'^([A-Z]{1,3})([1-9]\d*)$', addr)
if not m:
return False
letters, numbers = m.groups()
if len(letters) == 3 and letters > 'XFD':
return False
if int(numbers) > 1048576:
return False
return True
```
Semicompress... |
12,823,347 | I'm testing my asp.net website on my local server (Windows Server 2008, IIS 7.0.6), and when I type in just the IP address in my browser, e.g.,
```
192.168.0.5
```
it comes back like this:
```
http://192.168.0.5/(S(u0nmzwxobbwpuk1mtvuybwn0))/default.aspx
```
The weird stuff between .0.5/ and /default.aspx change... | 2012/10/10 | [
"https://Stackoverflow.com/questions/12823347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/403748/"
] | Sounds like you might be using cookieless sessions.
Basically ASP.NET is storing your session id in the query string instead of storing it in a cookie. Looks gross, but allows you to use session state when someone does not accept cookies. You can read more [here](http://msdn.microsoft.com/en-us/library/aa479314.aspx)... | Guessing here - in your `web.config` file, you have set the `sessionState` `cookieless` attribute to `UseUri` or to `true`.
See the documentation on the [`sessionState`](http://msdn.microsoft.com/en-us/library/h6bb9cz9%28v=vs.100%29.aspx) element. |
12,823,347 | I'm testing my asp.net website on my local server (Windows Server 2008, IIS 7.0.6), and when I type in just the IP address in my browser, e.g.,
```
192.168.0.5
```
it comes back like this:
```
http://192.168.0.5/(S(u0nmzwxobbwpuk1mtvuybwn0))/default.aspx
```
The weird stuff between .0.5/ and /default.aspx change... | 2012/10/10 | [
"https://Stackoverflow.com/questions/12823347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/403748/"
] | Sounds like you might be using cookieless sessions.
Basically ASP.NET is storing your session id in the query string instead of storing it in a cookie. Looks gross, but allows you to use session state when someone does not accept cookies. You can read more [here](http://msdn.microsoft.com/en-us/library/aa479314.aspx)... | Seems like you Have Cookieless Sessions enabled. Below article illustrates the behavior:
[MSDN - Cookie Less Sessions in ASP.NET](http://msdn.microsoft.com/en-us/library/aa479314.aspx)
Changing the Setting in Web.Config can change the behavior:
```
<sessionState cookieless="true" />
``` |
12,823,347 | I'm testing my asp.net website on my local server (Windows Server 2008, IIS 7.0.6), and when I type in just the IP address in my browser, e.g.,
```
192.168.0.5
```
it comes back like this:
```
http://192.168.0.5/(S(u0nmzwxobbwpuk1mtvuybwn0))/default.aspx
```
The weird stuff between .0.5/ and /default.aspx change... | 2012/10/10 | [
"https://Stackoverflow.com/questions/12823347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/403748/"
] | Guessing here - in your `web.config` file, you have set the `sessionState` `cookieless` attribute to `UseUri` or to `true`.
See the documentation on the [`sessionState`](http://msdn.microsoft.com/en-us/library/h6bb9cz9%28v=vs.100%29.aspx) element. | Seems like you Have Cookieless Sessions enabled. Below article illustrates the behavior:
[MSDN - Cookie Less Sessions in ASP.NET](http://msdn.microsoft.com/en-us/library/aa479314.aspx)
Changing the Setting in Web.Config can change the behavior:
```
<sessionState cookieless="true" />
``` |
6,320,207 | What I would like to be able to do is to add an attribute to specific methods of a class so that those methods so decorated could have the statements in their body be called in a manner that I liked.
For example, consider this scenario in C#:
```
public class A
{
public A() {}
[CallTwice()]
public vo... | 2011/06/12 | [
"https://Stackoverflow.com/questions/6320207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192131/"
] | Why not simply make Func1 private or protected, and make different method, that calls Func1 twice?
```
public class A
{
public A() {}
public void Func1()
{
Func1Core();
Func1Core();
}
private void Func1Core()
{
Console.WriteLine("Calling Func1().");
}
public void Func2()
{
Console.WriteLine("Calling... | You can make Func1 to recursively call itself by decrementing a count variable for each call. |
6,320,207 | What I would like to be able to do is to add an attribute to specific methods of a class so that those methods so decorated could have the statements in their body be called in a manner that I liked.
For example, consider this scenario in C#:
```
public class A
{
public A() {}
[CallTwice()]
public vo... | 2011/06/12 | [
"https://Stackoverflow.com/questions/6320207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192131/"
] | Why not simply make Func1 private or protected, and make different method, that calls Func1 twice?
```
public class A
{
public A() {}
public void Func1()
{
Func1Core();
Func1Core();
}
private void Func1Core()
{
Console.WriteLine("Calling Func1().");
}
public void Func2()
{
Console.WriteLine("Calling... | I don't know if it helps in this case but [PostSharp](http://www.sharpcrafters.com/) allows you to decorate methods with attributes for special purpose.
<http://www.sharpcrafters.com/postsharp/documentation> |
45,836 | The actual distributions I am dealing with are not uniform, but to
keep it simple, consider two uniform distributions, one on [1, 2] and
the other on [0,2]. Can we say that the first FOSDs the second?
Further, if we have a multitude of distributions (suppose uniform
still) on [b, 2], can we say their FOSD increases wit... | 2021/07/13 | [
"https://economics.stackexchange.com/questions/45836",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/31421/"
] | Let $X\_b$ a random variable uniformly distributed on $[b,2]$ with $b<2$. For every $x\in\mathbb{R}$,
$$\mathbb{P}[X\_b\geq x]=\begin{cases}
0\text{ if }x>2\\
\frac{2-x}{2-b}\text{ if } b\leq x\leq 2\\
1\text{ if }x<b.
\end{cases}
$$
Clearly, this probability is increasing in $b$. So $b>b'$ implies that $X\_b$ first or... | It is not exactly clear what you mean by "distribution functions that belong to the same class."
Consider a random variable $\widehat X$ with an arbitrary distribution on some support $[\underline x,\overline x]$. We can then normalize the support to $[0,1]$ by looking at $X=\frac{\widehat X-\underline x}{\overline x-\... |
17,541,407 | I'm currently making a game in Windows 7 using Batch Files. So I have a sequence where it asks you a question and you type in the answer:
```
:MainMenu
set /p LMainMenu=
if %LMainMenu%==1 goto PlayMenu
if %LMainMenu%==2 goto ColourMenu
if %LMainMenu%==3 goto Reset1
if %LMainMenu%==4 goto AboutMenu
goto MainMenu
```
... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17541407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2507295/"
] | try this
```
:MainMenu
set /a LMainMenu=1
set /p "LMainMenu=enter a number: "
```
For more help see `help set` on the command prompt. | Add this should work.
if "%LMainMenu%"=="" goto MainMenu |
17,541,407 | I'm currently making a game in Windows 7 using Batch Files. So I have a sequence where it asks you a question and you type in the answer:
```
:MainMenu
set /p LMainMenu=
if %LMainMenu%==1 goto PlayMenu
if %LMainMenu%==2 goto ColourMenu
if %LMainMenu%==3 goto Reset1
if %LMainMenu%==4 goto AboutMenu
goto MainMenu
```
... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17541407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2507295/"
] | try this
```
:MainMenu
set /a LMainMenu=1
set /p "LMainMenu=enter a number: "
```
For more help see `help set` on the command prompt. | If you want to have a default selection (automatically selected when the user just presses `Enter`), use the solution [Endoro](https://stackoverflow.com/a/17541554/1630171) suggested. If you want to loop until the user makes a valid selection, use this instead:
```
:MainMenu
set "LMainMenu="
set /p "LMainMenu=Enter a ... |
17,541,407 | I'm currently making a game in Windows 7 using Batch Files. So I have a sequence where it asks you a question and you type in the answer:
```
:MainMenu
set /p LMainMenu=
if %LMainMenu%==1 goto PlayMenu
if %LMainMenu%==2 goto ColourMenu
if %LMainMenu%==3 goto Reset1
if %LMainMenu%==4 goto AboutMenu
goto MainMenu
```
... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17541407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2507295/"
] | If you want to have a default selection (automatically selected when the user just presses `Enter`), use the solution [Endoro](https://stackoverflow.com/a/17541554/1630171) suggested. If you want to loop until the user makes a valid selection, use this instead:
```
:MainMenu
set "LMainMenu="
set /p "LMainMenu=Enter a ... | Add this should work.
if "%LMainMenu%"=="" goto MainMenu |
5,997,106 | On the production servers I can use the datastore viewer to compose some GQL (as long as it's supported by the indexes) and find data on the fly. What's the best way to do this on the dev server?
I'm using the Java sdk 1.4.3, and I already have remote\_api installed. | 2011/05/13 | [
"https://Stackoverflow.com/questions/5997106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439317/"
] | <http://www.developerfusion.com/tools/convert/csharp-to-vb/>
Which will give you:
```
For Each [property] As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = TryCast([property], ExtendedProperty)
If customProperty IsNot Nothing Then
... | As already posted, you can use an automated tool for such trivial conversions that don't use more advanced language features.
Note however: In VB, `As` is used to declare the **type** of a variable - not a cast, as it is in C#.
Thus
```
For Each property As Google.GData.Client.IExtensionElementFactory In googleEvent... |
5,997,106 | On the production servers I can use the datastore viewer to compose some GQL (as long as it's supported by the indexes) and find data on the fly. What's the best way to do this on the dev server?
I'm using the Java sdk 1.4.3, and I already have remote\_api installed. | 2011/05/13 | [
"https://Stackoverflow.com/questions/5997106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439317/"
] | <http://www.developerfusion.com/tools/convert/csharp-to-vb/>
Which will give you:
```
For Each [property] As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = TryCast([property], ExtendedProperty)
If customProperty IsNot Nothing Then
... | ```
For Each elem As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = DirectCast(elem, ExtendedProperty)
If ExtendedProperty IsNot Nothing Then
genericEvent.EventID = customProperty.Value
End If
Next
```
Try That |
5,997,106 | On the production servers I can use the datastore viewer to compose some GQL (as long as it's supported by the indexes) and find data on the fly. What's the best way to do this on the dev server?
I'm using the Java sdk 1.4.3, and I already have remote\_api installed. | 2011/05/13 | [
"https://Stackoverflow.com/questions/5997106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439317/"
] | <http://www.developerfusion.com/tools/convert/csharp-to-vb/>
Which will give you:
```
For Each [property] As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = TryCast([property], ExtendedProperty)
If customProperty IsNot Nothing Then
... | Try this:
```
For Each property as Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = CType(property, ExtendedProperty)
If customerProperty IsNot Nothing Then
genericEvent.EventID = customProperty.Value
End If
Next
``` |
5,997,106 | On the production servers I can use the datastore viewer to compose some GQL (as long as it's supported by the indexes) and find data on the fly. What's the best way to do this on the dev server?
I'm using the Java sdk 1.4.3, and I already have remote\_api installed. | 2011/05/13 | [
"https://Stackoverflow.com/questions/5997106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439317/"
] | <http://www.developerfusion.com/tools/convert/csharp-to-vb/>
Which will give you:
```
For Each [property] As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = TryCast([property], ExtendedProperty)
If customProperty IsNot Nothing Then
... | ```
For Each property As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = TryCast(property, ExtendedProperty)
If customProperty IsNot Nothing Then
genericEvent.EventID = customProperty.Value
End If
Next
```
One of the keys ... |
5,997,106 | On the production servers I can use the datastore viewer to compose some GQL (as long as it's supported by the indexes) and find data on the fly. What's the best way to do this on the dev server?
I'm using the Java sdk 1.4.3, and I already have remote\_api installed. | 2011/05/13 | [
"https://Stackoverflow.com/questions/5997106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439317/"
] | <http://www.developerfusion.com/tools/convert/csharp-to-vb/>
Which will give you:
```
For Each [property] As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty As ExtendedProperty = TryCast([property], ExtendedProperty)
If customProperty IsNot Nothing Then
... | You were pretty close. The main issue is your variable declarations.
in VB, declarations are almost reverse of C#.
I haven't tested it or anything, but the following code should work.
```
For Each [property] As Google.GData.Client.IExtensionElementFactory In googleEvent.ExtensionElements
Dim customProperty as E... |
48,691,271 | I am trying to extract HSV values from my previously collect RGB values, but I am running into an error that I don't understand.
Using the code `> Hmean<-rgb2hsv(Hmean, maxColorValue=255)`
I get the error:
```
Error in if (any(0 > rgb) || any(rgb > 1)) stop("rgb values must be in [0, maxColorValue]") :
missing ... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48691271",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8059981/"
] | These data would be much easier to work with if each sample was a row, and the colors were on the columns:
```
Hmean.transpose <- as.data.frame(t(Hmean))
head(Hmean.transpose)
Red Green Blue
BIOUG06754-A02 60.517 68.521 107.304
BIOUG06754-A04 150.321 142.084 136.413
BIOUG06754-A05 147.890 13... | If you just want to drop NA values, you can exclude columns that have NA values. For example
```
sapply(Filter(function(x) any(!is.na(x)), Hmean), rgb2hsv, maxColorValue=255)
```
Or using the tidyverse purrr functions,
```
library(purrr)
Hmean %>% discard(~any(is.na(.))) %>% map_dfr(rgb2hsv, maxColorValue=255)
``` |
13,470 | Какие существуют слова с одинаковым значением, но ударения ставятся по-разному, например: щавель на А, щавель на Е? | 2012/12/12 | [
"https://rus.stackexchange.com/questions/13470",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/1439/"
] | Не понимаю, в чём вопрос. Вариант ударения в этом слове всего один — щаве́ль. Разноместное ударение допустимо, например, в слове *"творог"*. Если спрашивается термин, коим именуется такое явление, то его называют по-разному: вариативность ударения, разноместное ударение и др. | >
> слова с одинаковым значением но ударения ставятся поразному.
>
>
>
>
>
Здесь не хватает запятой, и слово "по-разному" пишется через дефис. Цитируйте, пожалуйста, без ошибок. |
13,470 | Какие существуют слова с одинаковым значением, но ударения ставятся по-разному, например: щавель на А, щавель на Е? | 2012/12/12 | [
"https://rus.stackexchange.com/questions/13470",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/1439/"
] | >
> слова с одинаковым значением, но ударения ставятся по-разному
>
>
>
Если Вы проедете по славянским странам, то Вы сможете услышать множество слов с одинаковым значением и одинаковым (или почти одинаковым) написанием, но с самыми неожиданными ударениями. И даже в разных регионах одной и той же страны (России, У... | >
> слова с одинаковым значением но ударения ставятся поразному.
>
>
>
>
>
Здесь не хватает запятой, и слово "по-разному" пишется через дефис. Цитируйте, пожалуйста, без ошибок. |
5,601,803 | I have a small gallery website but the amount of images in directory differs from that accounted for in database by around 150 so I was wondering if there is a way to find out/list what files are in a directory that are "not" in the database (or vice versa).
basic db structure:
* **images**
+ id
+ images
image nam... | 2011/04/08 | [
"https://Stackoverflow.com/questions/5601803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/576638/"
] | Put file names from server in one array and files from database in another. Use [array\_diff()](http://www.php.net/manual/en/function.array-diff.php) to get result.
Example (PHP):
```
$files_db = array("car.jpg", "bike.jpg", "plane.jpg", "ship.jpg", "tank.jpg");
$files_server = array("car.jpg", "bike.jpg", "ship.jpg... | If this is likely a one-off problem, I'd solve this with a half-assed solution, using first a little SQL script:
```
SELECT filename FROM images;
```
and ask the database client [`mysql`](http://dev.mysql.com/doc/refman/5.5/en/mysql.html) or [`psql`](http://developer.postgresql.org/pgdocs/postgres/app-psql.html) or ... |
32,717,584 | I have an array like this:
```
$templateStyleArr = array(
0 => array(
'text' => 'General Text',
'default_value' => '#444',
'scopval' => 'general',
),
1 => array(
... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32717584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5320720/"
] | Referring to [the manual](http://php.net/manual/en/function.json-decode.php), you may need to set the `assoc` parameter to `TRUE` so that the returned object will be converted into an associative array.
```
$array = json_decode($json_string_from_db, TRUE);
``` | If you want to store just the array as string in the database you can try [serialize()](http://php.net/manual/de/function.serialize.php), with unserialize you'll get the exactly same array as return value
```
$templateStyleArr = array(
0 => array(
'text' => 'General Text',
'default_value' => '#444'... |
32,717,584 | I have an array like this:
```
$templateStyleArr = array(
0 => array(
'text' => 'General Text',
'default_value' => '#444',
'scopval' => 'general',
),
1 => array(
... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32717584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5320720/"
] | Referring to [the manual](http://php.net/manual/en/function.json-decode.php), you may need to set the `assoc` parameter to `TRUE` so that the returned object will be converted into an associative array.
```
$array = json_decode($json_string_from_db, TRUE);
``` | basicly your json encode will convert array to object when you decode it, so you need create function for generate object to array, you should try this function where will convert correct
```
function to_array( $object ){
if( !is_object( $object ) && !is_array( $object ) ){
return $object;
}
if( is... |
32,717,584 | I have an array like this:
```
$templateStyleArr = array(
0 => array(
'text' => 'General Text',
'default_value' => '#444',
'scopval' => 'general',
),
1 => array(
... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32717584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5320720/"
] | If you want to store just the array as string in the database you can try [serialize()](http://php.net/manual/de/function.serialize.php), with unserialize you'll get the exactly same array as return value
```
$templateStyleArr = array(
0 => array(
'text' => 'General Text',
'default_value' => '#444'... | basicly your json encode will convert array to object when you decode it, so you need create function for generate object to array, you should try this function where will convert correct
```
function to_array( $object ){
if( !is_object( $object ) && !is_array( $object ) ){
return $object;
}
if( is... |
671,589 | Here's the stupid thing I did: I deleted many folders inside the icon folder, with root privileges, and now some icons are gone, but not the main ones, the ones from compiz for instance, or some from top notification bar, like the skype one. I looked for days to find a solution to restore the icons folder, or to find t... | 2015/09/08 | [
"https://askubuntu.com/questions/671589",
"https://askubuntu.com",
"https://askubuntu.com/users/159413/"
] | Unfortunately, applications like compiz usually install their own icons. You can install these icons by re-installing the application to replace the missing files.
```
sudo apt-get update
sudo apt-get install --reinstall compizconfig-settings-manager
```
That should work if the files are missing, however, if it does... | You can download an unzip in the :
`/usr/share/icons`
download default icons from here:
<http://4uploader.com/dl/257/icons.7z> |
671,589 | Here's the stupid thing I did: I deleted many folders inside the icon folder, with root privileges, and now some icons are gone, but not the main ones, the ones from compiz for instance, or some from top notification bar, like the skype one. I looked for days to find a solution to restore the icons folder, or to find t... | 2015/09/08 | [
"https://askubuntu.com/questions/671589",
"https://askubuntu.com",
"https://askubuntu.com/users/159413/"
] | I solved it: Downloaded the ubuntu 14.04 iso. Mounted it with VirtualBox, used root to go to the icons folder, archive it, uploaded it to the internet. Then downloaded it to my OS, and just copied it to the 'shared' folder. Basically I restored the icons folder by copying it from the ubuntu iso file. ;) | You can download an unzip in the :
`/usr/share/icons`
download default icons from here:
<http://4uploader.com/dl/257/icons.7z> |
671,589 | Here's the stupid thing I did: I deleted many folders inside the icon folder, with root privileges, and now some icons are gone, but not the main ones, the ones from compiz for instance, or some from top notification bar, like the skype one. I looked for days to find a solution to restore the icons folder, or to find t... | 2015/09/08 | [
"https://askubuntu.com/questions/671589",
"https://askubuntu.com",
"https://askubuntu.com/users/159413/"
] | I solved it: Downloaded the ubuntu 14.04 iso. Mounted it with VirtualBox, used root to go to the icons folder, archive it, uploaded it to the internet. Then downloaded it to my OS, and just copied it to the 'shared' folder. Basically I restored the icons folder by copying it from the ubuntu iso file. ;) | Unfortunately, applications like compiz usually install their own icons. You can install these icons by re-installing the application to replace the missing files.
```
sudo apt-get update
sudo apt-get install --reinstall compizconfig-settings-manager
```
That should work if the files are missing, however, if it does... |
72,793,337 | It is 2022/06/28 actually 28th of June 2022; I noticed when I try to get the current time from Python console two different results are possible the Eastern Time (Toronto, Montreal and New York). So what is the difference between these two parameters? I am going to answer the question: | 2022/06/28 | [
"https://Stackoverflow.com/questions/72793337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1284584/"
] | "EST" is not accurate if you want to get the current time in New York because it represents Eastern Standard Time (UTC-05:00), which is one hour behind Eastern Daylight Time (UTC-04:00). Due to daylight savings, New York will observe either EST or EDT depending on the time of year.
"US/Eastern" is preferable to "EST" ... | The first way to get the current time in Toronto is:
```
from datetime import datetime
from pytz import timezone
tz = timezone('EST')
print(datetime.now(tz))
```
The output is the following:
>
> 2022-06-28 16:23:23.333585-05:00
>
>
>
The second way to get the current time in Toronto is:
```
from datetime impo... |
36,095,630 | I don't understand what the `...` notation does exactly.
I tried a simple example with Babel to understand it ([**view the example**](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Creact%2Cstage-2&code=let%20myArray%20%3D%20%5B1%2C2%2C3%2C%20...18%5D%3B%0A%0Aconsole.log(myArray)%3B%20%2F%2F%20%5B1%2C%202%2C%2... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36095630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4467741/"
] | The `...`([*spread operator*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator)) works by returning each value from index `0` to index `length-1`:
As example:
```
[...'18'] // returns ['1', '8']
```
which would be the same as:
```
['18'[0], '18'[1]]
```
---
Now, to get... | The expression `[1, 2, 3, ...18]` is invalid.
You cannot use `...` with a [**Number**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number). You can only use `...` with an iterable object like an [**Array**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Ob... |
20,246,523 | This message is a a bit long with many examples, but I hope it
will help me and others to better grasp the full story of variables
and attribute lookup in Python 2.7.
I am using the terms of PEP 227
(<http://www.python.org/dev/peps/pep-0227/>) for code blocks (such as
modules, class definition, function definitions, ... | 2013/11/27 | [
"https://Stackoverflow.com/questions/20246523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3022222/"
] | In two words, the difference between example 5 and example 6 is that in example 5 the variable `x` is also assigned to in the same scope, while not in example 6. This triggers a difference that can be understood by historical reasons.
This raises UnboundLocalError:
```
x = "foo"
def f():
print x
x = 5
f()
``... | Long story short, this is a corner case of Python's scoping that is a bit inconsistent, but has to be kept for backwards compatibility (and because it's not that clear what the right answer should be). You can see lots of the [original discussion](https://mail.python.org/pipermail/python-dev/2002-April/023427.html) abo... |
20,246,523 | This message is a a bit long with many examples, but I hope it
will help me and others to better grasp the full story of variables
and attribute lookup in Python 2.7.
I am using the terms of PEP 227
(<http://www.python.org/dev/peps/pep-0227/>) for code blocks (such as
modules, class definition, function definitions, ... | 2013/11/27 | [
"https://Stackoverflow.com/questions/20246523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3022222/"
] | In an ideal world, you'd be right and some of the inconsistencies you found would be wrong. However, CPython has optimized some scenarios, specifically function locals. These optimizations, together with how the compiler and evaluation loop interact and historical precedent, lead to the confusion.
Python translates co... | Long story short, this is a corner case of Python's scoping that is a bit inconsistent, but has to be kept for backwards compatibility (and because it's not that clear what the right answer should be). You can see lots of the [original discussion](https://mail.python.org/pipermail/python-dev/2002-April/023427.html) abo... |
87,704 | So, I just got a new [ENUTV-2](http://www.encore-usa.com/product_item.php?region=us&bid=2&pgid=17&pid=375#DOWNLOAD) USB TV Tuner Box, and it works fine overall. The driver seems to be OK, but the utility provided by encore doesn't seem to be working 100% in win 7. The only real issue is that I can't mute it, or change ... | 2009/12/26 | [
"https://superuser.com/questions/87704",
"https://superuser.com",
"https://superuser.com/users/6371/"
] | Have you tried (version of Windows depending) Media Center?
It is free and comes with Windows Home Premium and above! | That's because of your gpu drivers. I had the same problem updated them, and it worked just fine. I have an nvidia 9500 gt with 196. something drivers. |
191,346 | I am writing a report that has graphics, photos and maps. If I use the figure environment everything is labeled as a figure in the caption. However, what I would like to do is where I have a map to have the map labeled appropriately e.g. Map 1: caption text; Map 2: caption text etc and to be able to refer to it in the ... | 2014/07/14 | [
"https://tex.stackexchange.com/questions/191346",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/59053/"
] | Define yourself new floats that match the type you're using:

```
\documentclass{article}
\usepackage{float}% http://ctan.org/pkg/float
\newfloat{photo}{htbp}{pho}\floatname{photo}{Photo}
\newfloat{map}{htbp}{map}\floatname{map}{Map}
\setcounter{topn... | My solution uses the `caption` package and its `\captionsetup` facility, however, this way it is necessary to do this in every `figure` environment where the name should be changed.
This will also not provide different counters or separate `lists of maps` etc.
```
\documentclass{report}
\usepackage{caption}%
\usepa... |
191,346 | I am writing a report that has graphics, photos and maps. If I use the figure environment everything is labeled as a figure in the caption. However, what I would like to do is where I have a map to have the map labeled appropriately e.g. Map 1: caption text; Map 2: caption text etc and to be able to refer to it in the ... | 2014/07/14 | [
"https://tex.stackexchange.com/questions/191346",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/59053/"
] | If you use the `tocbasic` package from the KOMA-Script bundle you can also print a list of photos and a list of maps.
```
\documentclass{article}
\usepackage{tocbasic}
\DeclareNewTOC[%
type=photo,
float,
name=Photo,
listname={List of Photos},
]{pho}
\DeclareNewTOC[%
type=map,
float,
name=Map,
listnam... | My solution uses the `caption` package and its `\captionsetup` facility, however, this way it is necessary to do this in every `figure` environment where the name should be changed.
This will also not provide different counters or separate `lists of maps` etc.
```
\documentclass{report}
\usepackage{caption}%
\usepa... |
361,990 | I have a table in MS SQL server which currently has around 800 records and 20 columns.
I want to manually update and add to the information within this table on a frequent basis.
Would exporting the table to Microsoft Excel (and later and re-importing it back to SQL Server) be the best solution for this, or is there ... | 2011/11/27 | [
"https://superuser.com/questions/361990",
"https://superuser.com",
"https://superuser.com/users/340/"
] | Assuming your SQL back-end is an MS SQL server you can use the Microsoft [SQL Server Management Studio](http://www.microsoft.com/download/en/details.aspx?id=7593) (Express edition linked) to directly query and edit data (amongst many other things).
>
> Microsoft SQL Server 2008 Management Studio Express is a free,
> ... | More simply, use SQL Server Management Studio (SSMS) or MS Access if you have it available.
If you have SQL Server, you have SSMS...
Although, what is the table there for? Does it have other clients using it? |
361,990 | I have a table in MS SQL server which currently has around 800 records and 20 columns.
I want to manually update and add to the information within this table on a frequent basis.
Would exporting the table to Microsoft Excel (and later and re-importing it back to SQL Server) be the best solution for this, or is there ... | 2011/11/27 | [
"https://superuser.com/questions/361990",
"https://superuser.com",
"https://superuser.com/users/340/"
] | More simply, use SQL Server Management Studio (SSMS) or MS Access if you have it available.
If you have SQL Server, you have SSMS...
Although, what is the table there for? Does it have other clients using it? | Many people, my self included, use [PHPMyAdmin](http://www.phpmyadmin.net/home_page/index.php) for MySQL interactions. It may be too slow for what you need though (one entry at a time kind of thing). It's completely free and gives direct access to the database. Even if you don't use if for this I recommend having it av... |
361,990 | I have a table in MS SQL server which currently has around 800 records and 20 columns.
I want to manually update and add to the information within this table on a frequent basis.
Would exporting the table to Microsoft Excel (and later and re-importing it back to SQL Server) be the best solution for this, or is there ... | 2011/11/27 | [
"https://superuser.com/questions/361990",
"https://superuser.com",
"https://superuser.com/users/340/"
] | More simply, use SQL Server Management Studio (SSMS) or MS Access if you have it available.
If you have SQL Server, you have SSMS...
Although, what is the table there for? Does it have other clients using it? | You've already selected an answer, but I was a fan of [Evolutility](http://evolutility.org/index.aspx) for quick CRUD interfaces. It has support for mass updates and a pleasing UI. |
361,990 | I have a table in MS SQL server which currently has around 800 records and 20 columns.
I want to manually update and add to the information within this table on a frequent basis.
Would exporting the table to Microsoft Excel (and later and re-importing it back to SQL Server) be the best solution for this, or is there ... | 2011/11/27 | [
"https://superuser.com/questions/361990",
"https://superuser.com",
"https://superuser.com/users/340/"
] | Assuming your SQL back-end is an MS SQL server you can use the Microsoft [SQL Server Management Studio](http://www.microsoft.com/download/en/details.aspx?id=7593) (Express edition linked) to directly query and edit data (amongst many other things).
>
> Microsoft SQL Server 2008 Management Studio Express is a free,
> ... | Many people, my self included, use [PHPMyAdmin](http://www.phpmyadmin.net/home_page/index.php) for MySQL interactions. It may be too slow for what you need though (one entry at a time kind of thing). It's completely free and gives direct access to the database. Even if you don't use if for this I recommend having it av... |
361,990 | I have a table in MS SQL server which currently has around 800 records and 20 columns.
I want to manually update and add to the information within this table on a frequent basis.
Would exporting the table to Microsoft Excel (and later and re-importing it back to SQL Server) be the best solution for this, or is there ... | 2011/11/27 | [
"https://superuser.com/questions/361990",
"https://superuser.com",
"https://superuser.com/users/340/"
] | Assuming your SQL back-end is an MS SQL server you can use the Microsoft [SQL Server Management Studio](http://www.microsoft.com/download/en/details.aspx?id=7593) (Express edition linked) to directly query and edit data (amongst many other things).
>
> Microsoft SQL Server 2008 Management Studio Express is a free,
> ... | You've already selected an answer, but I was a fan of [Evolutility](http://evolutility.org/index.aspx) for quick CRUD interfaces. It has support for mass updates and a pleasing UI. |
33,649,705 | I'm trying to make an horizontal list of sticky images with `RecyclerView` and I'd like to move them by pixels' offset with [`scrollToPositionWithOffset`](http://developer.android.com/intl/ja/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int)). I thought passing `0` as `... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1348187/"
] | I finally used:
`recyclerView.scrollBy(int offsetX, int offsetY);` setting `offsetY = 0` and it works now.
I don't understand what's the utility of the function `scrollToPositionWithOffset`. | A late answer to your first question, and an addition to your answer:
Your method works better for your personal needs, because `scrollToPositionWithOffset` is not intended to do what you want.
As the [doc says here](http://developer.android.com/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPos... |
33,649,705 | I'm trying to make an horizontal list of sticky images with `RecyclerView` and I'd like to move them by pixels' offset with [`scrollToPositionWithOffset`](http://developer.android.com/intl/ja/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int)). I thought passing `0` as `... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1348187/"
] | I finally used:
`recyclerView.scrollBy(int offsetX, int offsetY);` setting `offsetY = 0` and it works now.
I don't understand what's the utility of the function `scrollToPositionWithOffset`. | I had a similar issue. My problem was that my recyclerview wasn't of the same size of its parent layout. I solved it by setting the recycler view width and height to `match_parent`. I don't know why this happens in this case. |
33,649,705 | I'm trying to make an horizontal list of sticky images with `RecyclerView` and I'd like to move them by pixels' offset with [`scrollToPositionWithOffset`](http://developer.android.com/intl/ja/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int)). I thought passing `0` as `... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1348187/"
] | I finally used:
`recyclerView.scrollBy(int offsetX, int offsetY);` setting `offsetY = 0` and it works now.
I don't understand what's the utility of the function `scrollToPositionWithOffset`. | recently I encountered this problem too, I invoke **scrollToPositionWithOffset** when `onScrolled()` directly, but nothing change, with that I turn to scrollToPosition() even scrollBy() but not help, finally I attempt to delay that so it work, first time I delay 50ms, but two weeks later I found that's not enough, so I... |
33,649,705 | I'm trying to make an horizontal list of sticky images with `RecyclerView` and I'd like to move them by pixels' offset with [`scrollToPositionWithOffset`](http://developer.android.com/intl/ja/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int)). I thought passing `0` as `... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1348187/"
] | I finally used:
`recyclerView.scrollBy(int offsetX, int offsetY);` setting `offsetY = 0` and it works now.
I don't understand what's the utility of the function `scrollToPositionWithOffset`. | I find a solution.
Coz I am the developer of DNA Launcher. When I use RecyclerView to display A-Z App List, I found that the function scrollToPositionWithOffset is not working. I track the problem for almost one day and I figured it out.
When the RecyclerView display again, just let the parent of RecyclerView do reque... |
33,649,705 | I'm trying to make an horizontal list of sticky images with `RecyclerView` and I'd like to move them by pixels' offset with [`scrollToPositionWithOffset`](http://developer.android.com/intl/ja/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int)). I thought passing `0` as `... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1348187/"
] | I had a similar issue. My problem was that my recyclerview wasn't of the same size of its parent layout. I solved it by setting the recycler view width and height to `match_parent`. I don't know why this happens in this case. | A late answer to your first question, and an addition to your answer:
Your method works better for your personal needs, because `scrollToPositionWithOffset` is not intended to do what you want.
As the [doc says here](http://developer.android.com/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPos... |
33,649,705 | I'm trying to make an horizontal list of sticky images with `RecyclerView` and I'd like to move them by pixels' offset with [`scrollToPositionWithOffset`](http://developer.android.com/intl/ja/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int)). I thought passing `0` as `... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1348187/"
] | I had a similar issue. My problem was that my recyclerview wasn't of the same size of its parent layout. I solved it by setting the recycler view width and height to `match_parent`. I don't know why this happens in this case. | recently I encountered this problem too, I invoke **scrollToPositionWithOffset** when `onScrolled()` directly, but nothing change, with that I turn to scrollToPosition() even scrollBy() but not help, finally I attempt to delay that so it work, first time I delay 50ms, but two weeks later I found that's not enough, so I... |
33,649,705 | I'm trying to make an horizontal list of sticky images with `RecyclerView` and I'd like to move them by pixels' offset with [`scrollToPositionWithOffset`](http://developer.android.com/intl/ja/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int)). I thought passing `0` as `... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1348187/"
] | I had a similar issue. My problem was that my recyclerview wasn't of the same size of its parent layout. I solved it by setting the recycler view width and height to `match_parent`. I don't know why this happens in this case. | I find a solution.
Coz I am the developer of DNA Launcher. When I use RecyclerView to display A-Z App List, I found that the function scrollToPositionWithOffset is not working. I track the problem for almost one day and I figured it out.
When the RecyclerView display again, just let the parent of RecyclerView do reque... |
26,051,939 | Hi i'm quite new to yii framework, currently trying to establish a login through database authentication. but while im trying to log in i get this error saying
>
> Please fix the following input errors:
> Password is incorrect.
>
>
>
but when i check the database table im typing the correct password.
can anybo... | 2014/09/26 | [
"https://Stackoverflow.com/questions/26051939",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3584871/"
] | You have to write your authentication logic inside UserIdentity class not in LoginForm model.
1. LoginForm model ex:-
```
public function authenticate($attribute, $params) {
if (!$this->hasErrors()) {
$this->_identity = new UserIdentity($this->email, $this->password);
if (!$this->_identity->authen... | In common/models/User.php
```
public function rules()
{
return [
['status', 'default', 'value' => self::STATUS_INACTIVE],
['status', 'in', 'range' => [self::STATUS_ACTIVE,
self::STATUS_INACTIVE, self::STATUS_DELETED]],
];
}
```
In this method, set the default 'value'=>self... |
14,906,751 | I have a byte array of data, which should be consistent cross-platform. Let's say I have a pointer, `unsigned char* data`, which points to some location inside my array, and I want to read 4 bytes into a variable. I would think that I could just to this:
```
uint32_t my_int = *data;
```
However, I realize that metho... | 2013/02/16 | [
"https://Stackoverflow.com/questions/14906751",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/465378/"
] | You need to worry about endianness whenever reading or writing binary data. You also need to worry about variable size and possibly structure packing if you're trying to read/write entire structs. Some architectures can't handle integers on odd variable boundaries as well, so you can't just grab an integer directly fro... | If using integers there is a family of functions/macros
See
[ntol](http://linux.die.net/man/3/ntohl) for example
As to packing - just define a protocol and where things should be placed. Then write could to construct a character array with the various bits in the correct locations. This should correspond to the code... |
14,906,751 | I have a byte array of data, which should be consistent cross-platform. Let's say I have a pointer, `unsigned char* data`, which points to some location inside my array, and I want to read 4 bytes into a variable. I would think that I could just to this:
```
uint32_t my_int = *data;
```
However, I realize that metho... | 2013/02/16 | [
"https://Stackoverflow.com/questions/14906751",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/465378/"
] | You need to worry about endianness whenever reading or writing binary data. You also need to worry about variable size and possibly structure packing if you're trying to read/write entire structs. Some architectures can't handle integers on odd variable boundaries as well, so you can't just grab an integer directly fro... | These are typical issues you face when data goes out or come in to your application. If producer and consumer of the data is just your application, then it is less of an issue.
However, as EricS mentions, if there are other applications that are going to consume or produce this data and if these are on a different pla... |
41,144,752 | I am currently refactoring a codebase inherited from another developer. In several classes, i found constants that contained the symbols =, ? and & (and others). They are used to build URLs, like so:
```
class SomeClass {
private static final String EQUALS = "=";
private static final String AMPERSAND = "&";
... | 2016/12/14 | [
"https://Stackoverflow.com/questions/41144752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3419647/"
] | The constants are useful, but poorly named. If they're used in URL construction, they should be named like this:
```
private static final String PARAMETER_ASSIGNMENT = "=";
private static final String PARAMETER_SEPARATOR = "&";
private static final String QUERY_INTRODUCER = "?";
private static final String PATH_SEPARA... | I think there are not *any* deep technical reasons here
The only *little* thing I see: they make typos like "==" less likely to happen, as EQUALS + EQUALS is obviously more obvious to spot.
On the other hand, that shouldn't really matter in reality; because in reality you would be calling *helper* methods to build th... |
48,354,155 | I want to set autocomplete text in my application. The suggestion values will fetch from the database. But for a trial I made a string array for the suggestion values. It works fine when I implement it on an activity but not working in fragment.
In place of getActivity function I tried:
1) getContext()
2) this.g... | 2018/01/20 | [
"https://Stackoverflow.com/questions/48354155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5041813/"
] | Its working for me...You missed to set threshold
```
AutoCompleteTextView autoCompleteTextView;
ArrayAdapter<String> adapter;
String[] stop_names;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.... | Set in your xml file android:completionThreshold.
```
<AutoCompleteTextView
android:id="@+id/id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:completionThreshold="1"
android:layout_weight="1"/>
``` |
28,513,470 | i have a ready to use .jar file and want to know if its possible to extract and rename the packages?
so when usually i start the .jar file with:
```
java -cp myFile.jar com.codehelper.demo.Main
```
i want to rename the "codehelper" in it to something different that i can run it by
```
java -cp myFile.jar com.NEW_N... | 2015/02/14 | [
"https://Stackoverflow.com/questions/28513470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4522486/"
] | There is a problem in controller parameter injection. You have not added `$routeParams` in your array injection list.
```
ngAddressBook.controller('ngAddressDetailsController', ['$scope','$routeParams', function ($scope,$routeParams)
{
alert($routeParams);
$scope.id = $routeParams.id;
}]);
``` | As I found this on top on google:
apart from the missing injection - asign the object `$routeParams` and not the Key `$routeParams.id`
[I found the explination here (from Sander Elias)](https://groups.google.com/forum/?fromgroups#!topic/angular/_3OtYYRe_-I)
```
ngAddressBook.controller('ngAddressDetailsController', [... |
16,359,651 | I'm trying to add USB controller support to my Android game. I'm using Marmalade and I've created an extension based on the USB example code. Here it is:
```
public class GameControllerInput extends Activity
implements InputManager.InputDeviceListener
{
private static final String TAG = "GameControll... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16359651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2346286/"
] | A `Looper` (a message queue processor) is tied to a single thread, each thread has at most one looper. A `Handler` needs to register itself with a `Looper` to work, so each time you invoke `new Handler()`, it tries to get the `Looper` for the current thread (the thread that's creating the `Handler`), which can be eithe... | Well it's better to have a callback method and mark it as main thread only by calling `run_on_os_thread` after the method declaration in `s4e` file. |
33,876 | Count the number of paths from $(0,0)$ to $(2n,n)$ than never go above $y=x$
At first I thought of the problem by expanding the graph to $(0,0)$ to $(2n,2n)$ and messing around with adding and subtracting multiples of the Catalan number formula, but I feel this is far too rudimentary and in doing so I am leaving out m... | 2011/04/19 | [
"https://math.stackexchange.com/questions/33876",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/9755/"
] | The [Ballot theorem](http://en.wikipedia.org/wiki/Ballot_problem) says
>
> In an election where candidate A receives $p$ votes and candidate B $q$ votes with $p$ > $q$, the probability that A will be strictly ahead of B throughout the count is $\dfrac{p-q}{p+q}$
>
>
>
So if you had asked "Count the number of pat... | The most straightforward way of doing this seems to be to partition based on where the paths cross over from $x=n$ to $x=n+1$ and then staple together the two calculations: first, how many paths from $(0,0)$ to $(n, k)$ ($k \leq n$) never go above the diagonal (this should be feasible through versions of the usual mach... |
34,726,667 | **Quick Background**
I have received a project from our marketing team to make bulk updates to the descriptions of products that will be displayed on our website (>500k items). They have decided to take many decades worth of descriptions and try to make them as similar as possible. (Ex. 'screw driver', 'screwdriver', ... | 2016/01/11 | [
"https://Stackoverflow.com/questions/34726667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4528764/"
] | If your rules are really as simple as that then simply having "old\_value" and "new\_value" in the table should suffice, with a single statement to fix all of the data:
```
UPDATE
MT
SET
description = REPLACE(description, old_value, new_value)
FROM
dbo.My_Table MT
INNER JOIN dbo.Fix_Table FT ON MT.descript... | Have a table like bad\_val and good\_val (call it tblMod). you can write a stored procedure that loops on tblMod and generate SQL statement and execute the statement as dynamic SQL.
```
loop on tblMod
-- generate SQL statements like:
set sqlText = 'update myTable set description = ' + good_val + ' where description =... |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | I also faced this problem but when i call window request before calling **super.onCreate()** then problem was solved, please try it also like..
```
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R... | Extend (**Activity**) instead of (**ActionBarActivity**)
example: `public class Itemdetails extends Activity {....`
then in the onCreate write:
```
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.Your_Activity);
``` |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | ```html
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
... | I had this error with `AlertDialog` and the error was happening in API 19 only when `dialog.show()` was called.
figured out that the `android.app.AlertDialog` import is causing the problem so I changed it to `androidx.appcompat.app.AlertDialog` and it fixed it.
Note that this will work if you are using androidx. if y... |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | I got that exception (`android.util.AndroidRuntimeException: requestFeature() must be called before adding content`) when using
```
requestWindowFeature(Window.FEATURE_NO_TITLE);
```
in an older device running Android 2.3.5 (Gingerbread). I am using the v7 support library.
The error was fixed when I changed it to u... | i think the simplest way to do this is use this below code
```
getActionBar().setTitle(null);
``` |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | I also faced this problem but when i call window request before calling **super.onCreate()** then problem was solved, please try it also like..
```
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R... | Please try the following options, at least one of these should work for you:
1. If you are using a DialogFragment then try not overriding both methods `onCreateDialog(..)` and `onCreateView(..)` (This change worked for me)
2. try `supportRequestWindowFeature(Window.FEATURE_NO_TITLE)/requestWindowFeature(Window.FEATURE... |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | I was extending a **DialogFragment** and the above answer didnot work. I had to use getDialog() to remove the title:
```
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
``` | i think the simplest way to do this is use this below code
```
getActionBar().setTitle(null);
``` |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | ```html
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
... | Misplaced your line:
super.onCreate(savedInstanceState);
use this Manner:
```
@Override
protected void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrscanner);
``` |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | I was extending a **DialogFragment** and the above answer didnot work. I had to use getDialog() to remove the title:
```
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
``` | I had this error with `AlertDialog` and the error was happening in API 19 only when `dialog.show()` was called.
figured out that the `android.app.AlertDialog` import is causing the problem so I changed it to `androidx.appcompat.app.AlertDialog` and it fixed it.
Note that this will work if you are using androidx. if y... |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | Please check your class is extend from Activity or ActionBarActivity. If you are using ActionBarActivity please use Activity. | Please try the following options, at least one of these should work for you:
1. If you are using a DialogFragment then try not overriding both methods `onCreateDialog(..)` and `onCreateView(..)` (This change worked for me)
2. try `supportRequestWindowFeature(Window.FEATURE_NO_TITLE)/requestWindowFeature(Window.FEATURE... |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | Please check your class is extend from Activity or ActionBarActivity. If you are using ActionBarActivity please use Activity. | Misplaced your line:
super.onCreate(savedInstanceState);
use this Manner:
```
@Override
protected void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrscanner);
``` |
16,939,814 | I am getting this `android.util.AndroidRuntimeException: requestFeature() must be called before adding content` error. As you can see in the below code, the `requestWindowFeature(Window.FEATURE_NO_TITLE);` line comes before `setContentView(R.layout.mainmenu);` line of code. This onCreate() code is the same format in ju... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16939814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866707/"
] | I also faced this problem but when i call window request before calling **super.onCreate()** then problem was solved, please try it also like..
```
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R... | I had this error with `AlertDialog` and the error was happening in API 19 only when `dialog.show()` was called.
figured out that the `android.app.AlertDialog` import is causing the problem so I changed it to `androidx.appcompat.app.AlertDialog` and it fixed it.
Note that this will work if you are using androidx. if y... |
48,398,197 | So I am trying to parse HTMl from a website but all I get is menu because body has a preloader. Links are NSFW so I added a wildcard to them. My question is how do I parse whole page and not only menu? Creating a timeout doesn't seem to help (or I am doing the timeout wrong).
```
<?php
$ctx = stream_context_create... | 2018/01/23 | [
"https://Stackoverflow.com/questions/48398197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8389421/"
] | Well, What I am going to say will sound CRAZY, but it is a fact and known issue and really hard to be found.
The problem is in the **project path**, the path for the project I have created contained a special character c:/users/Hussein Khalil(XXX)/PROJECT\_NAME
when I created the project on a simple path c:/test/..... | I faced the same issue and it was not related with special characters in project path.
I executed "clean solution" and then "build solution" and it restored the dependency successfully. It solved the issue. |
34,976,628 | How can I insert something after the second form with `mform` class, for this markup:
```
<table id="sortme">
<tr>
<td>1</td>
<td><form class="mform"></form></td>
</tr>
<tr>
<td>2</td>
<td><form class="mform"></form><!---Insert Me here !---></td>
</tr>
<tr>
<td>3</td>
<td><form cl... | 2016/01/24 | [
"https://Stackoverflow.com/questions/34976628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3330034/"
] | Try `.insertAfter("#sortme form.mform:eq(1)");` | You, also, may use a `counter`, conditional statement and `append` as follows:
```
<script>
$(document).ready(function(){
counter = 0;
$(".mform").each(function(){
if (counter === 1){
$(this).append("<div>Block</div>");
}
counter++;
});
});
</script>
```
... |
23,303,358 | I am creating a simple clock application using MFC. My application title appears as follows : "CLOCK - [CLOCK1]". How do I reset it to simply "CLOCK"?
FYI, I have enabled the Document-View architecture. | 2014/04/25 | [
"https://Stackoverflow.com/questions/23303358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3397590/"
] | Put in this override of the MFC title:
```
void CMainFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
{
SetWindowText(L"CLOCK");
}
``` | You can change it in visual editor by clicking on a your window and typing a title.
Or you can add this code in function OnInitDialog
`this->SetWindowText(L"CLOCK");` |
23,303,358 | I am creating a simple clock application using MFC. My application title appears as follows : "CLOCK - [CLOCK1]". How do I reset it to simply "CLOCK"?
FYI, I have enabled the Document-View architecture. | 2014/04/25 | [
"https://Stackoverflow.com/questions/23303358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3397590/"
] | There's an answer [here](https://stackoverflow.com/a/14295450/1850797), but I feel that the following solution is more "proper".
In addition to overriding `CMainFrame::OnUpdateFrameTitle()`, you also need to override `CMainFrame::PreCreateWindow()` as below:
```
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{ ... | You can change it in visual editor by clicking on a your window and typing a title.
Or you can add this code in function OnInitDialog
`this->SetWindowText(L"CLOCK");` |
64,930,506 | Please tell me, I have 2 classes. There is a `load_shop()` function that enables the display of the webView.
If I call a function from the first class `ViewController` then the function is executed and the webView is displayed, and if from another class `CheckUpdate` the function is executed (print is output) but the w... | 2020/11/20 | [
"https://Stackoverflow.com/questions/64930506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14675890/"
] | let first\_class = ViewController() // stop doing this. It will not work. Think of it; you have a car (view controller), you want to turn on the radio of your car. What would you have to do? First turn your car on and then its radio right? But what you do in your code is; instead of turning on the radio of your car, yo... | If your CheckUpdate class resides in a file other than ViewController's file this is not to correct way to do it. You can define a closure or protocol in ViewController then implement it in CheckUpdate class. Something like:
```
class ViewController: UIViewController {
...
typeAlias OnUpdate = () -> Void
...
... |
320,282 | I am working on a practice problem for my Calculus 3 course. I am given a contour plot and one of the questions is to determine the sign of the second derivative with respect to $x$ at $(3,2)$: $f\_{xx}(3,2)$.
I have no clue how to determine this? Could someone please explain the process of how to figure this out mere... | 2013/03/04 | [
"https://math.stackexchange.com/questions/320282",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/64908/"
] | Stand yourself at the point $(3,2)$ in the contour plot and start walking parallel to the $x$-axis in the positive direction. First, we see that the $f(x,2)$ is increasing when we increase $x$ which indicates that $f\_x(3,2)>0$. But we can even go a step further. Because not only does it increase but it increase faster... | The $f\_x$ tells if you will "hike" up or down ($+$ or $-$) from your position, while $f\_{xx}$ determines if you are "hiking" steeper or leveling off ($+$ or $-$). Since $f\_x$ is moving "uphill" and doing so at a faster and faster rate (the lines are scrunching up) then we know $f\_x$ and $f\_{xx}$ are both positive. |
66,785,823 | I have written a function in T-SQL that is supposed to take a string value and return any row with a similar value in the 'Course Taken' column. Here is the function:
```
enter code here
USE [alumni_project1]
GO
/****** Object: UserDefinedFunction [dbo].[Course_Search] Script Date: 24-Mar-21 7:45:04 PM
******/
SE... | 2021/03/24 | [
"https://Stackoverflow.com/questions/66785823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14305603/"
] | SOLVED:
The issue was in the database data. Using the above configurations, I:
1. Stopped all 3 nodes of Cassandra.
2. Deleted the database from nodes 2 and 3
3. Restored the node 1 DB from a backup I made before changing anything
4. Started Cassandra on node 1 (and let it "settle")
5. Started Cassandra on node 2 (and... | Try setting your `seeds` list to be the same across all 3 nodes.
Right now, it's different for each node...which works only when one of the nodes in the seed list is already running. The first node in the cluster needs to find itself in that seed list.
In a small cluster like this, I'd take the `seeds` setting from y... |
7,797,530 | I'm building a movie player which requires a highly sensitive scrubbing feature. My aim is to allow the user to scrub frame by frame if he selects the highest sensitivity.
Currently I'm using the method:
`[player seekToTime:CMTimeMakeWithSeconds(duration*(Float64) slider.value, 600)];`
but I'm far from the sensitivi... | 2011/10/17 | [
"https://Stackoverflow.com/questions/7797530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428213/"
] | Solve this problem. Somehow it slipped from my eyes but there is a method that does exactly that:
```
[player seekToTime:CMTimeMakeWithSeconds(duration*(Float64)value , 600)
toleranceBefore:kCMTimeZero
toleranceAfter:kCMTimeZero];
```
The `toleranceBefore` and the `toleranceAfter` are set to zero whi... | Just want to mention a limitation of HLS here. Even though you specify the tolerance 0, it is not possible to seek in the middle of any ts segment. Once you lift your finger from scrubber to seek a position, the player will start playing the video from the nearest TS segment. |
4,563 | My cherry tomato plant has been showing some yellowing of leaves over the past week or so. Just today I noticed the formation of these cluster of white granules - not sure if it's connected to the yellowing or not. It looks like grains of salt more than anything else; if it's an insect of some sort, I can't get a close... | 2012/06/17 | [
"https://gardening.stackexchange.com/questions/4563",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/644/"
] | Aphids ! Use 2tsps of dishwashing liquid to one quart of water, mix and spray to cover all of the insects. Wait 4-7days repeat as needed. Don't spray during heat of the day! | I used an organic insecticidal soap, it has fatty acid salts in it. Destroys the organisms. I think aphids were my gardenias problem |
4,563 | My cherry tomato plant has been showing some yellowing of leaves over the past week or so. Just today I noticed the formation of these cluster of white granules - not sure if it's connected to the yellowing or not. It looks like grains of salt more than anything else; if it's an insect of some sort, I can't get a close... | 2012/06/17 | [
"https://gardening.stackexchange.com/questions/4563",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/644/"
] | Aphids ! Use 2tsps of dishwashing liquid to one quart of water, mix and spray to cover all of the insects. Wait 4-7days repeat as needed. Don't spray during heat of the day! | Those white granules are crystallized sugar dew from an insect infestation such as scale. You can see a light green scale like insect on the top most leaf of the first image. Alternatively that could be a nymph of the [tomato potato psyllid](https://nzacfactsheets.landcareresearch.co.nz/factsheet/InterestingInsects/Tom... |
4,563 | My cherry tomato plant has been showing some yellowing of leaves over the past week or so. Just today I noticed the formation of these cluster of white granules - not sure if it's connected to the yellowing or not. It looks like grains of salt more than anything else; if it's an insect of some sort, I can't get a close... | 2012/06/17 | [
"https://gardening.stackexchange.com/questions/4563",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/644/"
] | Aphids ! Use 2tsps of dishwashing liquid to one quart of water, mix and spray to cover all of the insects. Wait 4-7days repeat as needed. Don't spray during heat of the day! | OK, I'm very late coming to the party on this - but for anyone else that stumbles upon this, wondering what might be causing the sandy deposits on their otherwise healthy tomato plant stems and leaves - I may well have the answer for you! In my case (which looks and sounds identical to the original poster) the sandy de... |
4,563 | My cherry tomato plant has been showing some yellowing of leaves over the past week or so. Just today I noticed the formation of these cluster of white granules - not sure if it's connected to the yellowing or not. It looks like grains of salt more than anything else; if it's an insect of some sort, I can't get a close... | 2012/06/17 | [
"https://gardening.stackexchange.com/questions/4563",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/644/"
] | I used an organic insecticidal soap, it has fatty acid salts in it. Destroys the organisms. I think aphids were my gardenias problem | Those white granules are crystallized sugar dew from an insect infestation such as scale. You can see a light green scale like insect on the top most leaf of the first image. Alternatively that could be a nymph of the [tomato potato psyllid](https://nzacfactsheets.landcareresearch.co.nz/factsheet/InterestingInsects/Tom... |
4,563 | My cherry tomato plant has been showing some yellowing of leaves over the past week or so. Just today I noticed the formation of these cluster of white granules - not sure if it's connected to the yellowing or not. It looks like grains of salt more than anything else; if it's an insect of some sort, I can't get a close... | 2012/06/17 | [
"https://gardening.stackexchange.com/questions/4563",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/644/"
] | I used an organic insecticidal soap, it has fatty acid salts in it. Destroys the organisms. I think aphids were my gardenias problem | OK, I'm very late coming to the party on this - but for anyone else that stumbles upon this, wondering what might be causing the sandy deposits on their otherwise healthy tomato plant stems and leaves - I may well have the answer for you! In my case (which looks and sounds identical to the original poster) the sandy de... |
59,887,244 | I am trying to use `array.filter()` to compare two arrays and separate out values that the two arrays have in common, based on a certain property (id), vs. values they don't have in common. The common ids I want to push to a new array (recordsToUpdate). And I want to push the remaining elements from `arr2` to a new arr... | 2020/01/23 | [
"https://Stackoverflow.com/questions/59887244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7934883/"
] | Try this, which uses [Array.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) to test for whether an object exists in `arr2` with a given `id`:
```js
const arr1 = [{id: 1}, {id: 2}, {id: 3}];
const arr2 = [{id: 3}, {id: 4}, {id: 5}];
const recordsToUpdate =... | Update to Robin post using `some` instead of `find`. It is just other way around.
```js
const arr1 = [{id: 1}, {id: 2}, {id: 3}];
const arr2 = [{id: 3}, {id: 4}, {id: 5}];
const recordsToUpdate = arr1.filter(e => arr2.some(obj => obj.id === e.id));
const recordsToInsert = arr2.filter(e => !arr1.some(obj => obj.id ... |
59,887,244 | I am trying to use `array.filter()` to compare two arrays and separate out values that the two arrays have in common, based on a certain property (id), vs. values they don't have in common. The common ids I want to push to a new array (recordsToUpdate). And I want to push the remaining elements from `arr2` to a new arr... | 2020/01/23 | [
"https://Stackoverflow.com/questions/59887244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7934883/"
] | Try this, which uses [Array.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) to test for whether an object exists in `arr2` with a given `id`:
```js
const arr1 = [{id: 1}, {id: 2}, {id: 3}];
const arr2 = [{id: 3}, {id: 4}, {id: 5}];
const recordsToUpdate =... | I think this is what you are after... I added values to show the replacement. If you are doing any kind of state management, be careful as I am directly mutating the current array.
```js
const arr1 = [
{ id: 1, v: "a" },
{ id: 2, v: "b" },
{ id: 3, v: "old" }
];
const arr2 = [
{ id: 3, v: "new" },
{ ... |
59,887,244 | I am trying to use `array.filter()` to compare two arrays and separate out values that the two arrays have in common, based on a certain property (id), vs. values they don't have in common. The common ids I want to push to a new array (recordsToUpdate). And I want to push the remaining elements from `arr2` to a new arr... | 2020/01/23 | [
"https://Stackoverflow.com/questions/59887244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7934883/"
] | Update to Robin post using `some` instead of `find`. It is just other way around.
```js
const arr1 = [{id: 1}, {id: 2}, {id: 3}];
const arr2 = [{id: 3}, {id: 4}, {id: 5}];
const recordsToUpdate = arr1.filter(e => arr2.some(obj => obj.id === e.id));
const recordsToInsert = arr2.filter(e => !arr1.some(obj => obj.id ... | I think this is what you are after... I added values to show the replacement. If you are doing any kind of state management, be careful as I am directly mutating the current array.
```js
const arr1 = [
{ id: 1, v: "a" },
{ id: 2, v: "b" },
{ id: 3, v: "old" }
];
const arr2 = [
{ id: 3, v: "new" },
{ ... |
43,520,034 | I am attempting to create a C# application that connects to a PostgreSQL database using SSL with client certificate and key files similar in functionality to the PGAdmin UI, but the documentation for this in NPGSQL is lacking and I cannot find any examples. The [documentation](http://www.npgsql.org/doc/security.html#en... | 2017/04/20 | [
"https://Stackoverflow.com/questions/43520034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7895713/"
] | I am facing the same situation. Documentation certainly needs to describe usage explicitly on how to supply cert, key and CA files if needed to the connection string or connection builder, and how the ProvideClientCertificatesCallback can actually supply back cert, key and CA files.
Nov 2018: I got below sample code t... | You need to have `SSL=true` in your connection stream, and then provide a `ProvideClientCertificatesCallback` on your NpgsqlConnection before opening it (like SSLStream). |
51,534,603 | Suppose to have 3 date in input, data1 and data2 are the interval and data3 is a generical input dates. data1 and data2 can be null, data3 is not null. So I can have 3 situtation :
1. data3 > data1 (data2 is null)
2. data3 < data2 (data1 is null)
3. data1 < data3 < data2
I don't want create a different if with differ... | 2018/07/26 | [
"https://Stackoverflow.com/questions/51534603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10100222/"
] | You can write this explicitly:
```
where (data3 > date1 or date1 is null) and
(date3 < date2 or date2 is null)
```
You can also use some form of `coalesce()`, such as:
```
where date3 > coalesce(date1, date3 - interval '1 day') and
date3 < coalesce(date2, date3 + interval '1 day')
```
Personally, I fi... | I would suggest using following line of code in where clause:
(...) WHERE data3 BETWEEN NVL(data1, data3) AND NVL(data2, data3)
EDIT: I believe that, when working with dates, handling cases when date3 is equal to date1 (or date2, respectively) is mandatory rather then optional and BETWEEN AND also handle those cases. |
26,018,331 | I would like to use the wkhtmltopdf for HTML to PDF conversion.
When I have tried to convert it via linux terminal, it works fine.
But when I have tried with the php script it does not work.
I am trying execute the binary directly.
here is the code I am trying with PHP.
```
exec('/home/binary_loc/wkhtmltopdf http:... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26018331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3305818/"
] | You can do this:
```
display(Optional.<String> absent());
``` | I think you try to pass unvalid parameter to method. You have to wrap it in method. It will solve the issue.
```
private void display(String message) {
Optional<String> optionalMessage=Optional.fromNullable(message);
...
}
``` |
70,359,604 | [barchart](https://i.stack.imgur.com/kvMPR.png)
html file
```
<canvas width="3" height="1"
*ngIf="loaded"
baseChart
[data]="barChartData"
[labels]="barChartLabels"
[options]="barChartOptions"
[legend]="barCha... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70359604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13433597/"
] | You can use the dataset option `barPercentage` as described [here](https://www.chartjs.org/docs/2.9.4/charts/bar.html#dataset-configuration).
In you code, this could look as follows:
```
barChartData: ChartDataSets[] = [
{
label: 'My Dataset',
data: [65, 56, 40],
barPercentage: 0.5
}
];
``` | Just insert static data for testing purpose and set barThickness property instead of barPercentage. It worked for me. |
46,126,695 | I have an algolia application with some objects that look like this:
```
{
"company_id": "36ec09ec-6b07-45e3-ae2d-a77bfe381baa",
"first_name": "maryam",
"objectID": "ffd92558-6bd3-42df-96c2-9c9124e66f6a"
}
```
I'm trying to run a query that filter search results by `company_id`.
I've read the Algolia docs and... | 2017/09/09 | [
"https://Stackoverflow.com/questions/46126695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3666882/"
] | Try like this way, more about filtering <https://www.algolia.com/doc/guides/searching/filtering/>
```
this.index.search({
query: 'mar',
filters: 'company_id:36ec09ec-6b07-45e3-ae2d-a77bfe381baa'
}).then(resp => {
console.log(resp);
});
``` | I encountered this issue as well. Looks like we need to add a facet to the attribute we want to filter. So in this case, you might want to create a facet related to `company_id` and make sure it's searchable |
46,126,695 | I have an algolia application with some objects that look like this:
```
{
"company_id": "36ec09ec-6b07-45e3-ae2d-a77bfe381baa",
"first_name": "maryam",
"objectID": "ffd92558-6bd3-42df-96c2-9c9124e66f6a"
}
```
I'm trying to run a query that filter search results by `company_id`.
I've read the Algolia docs and... | 2017/09/09 | [
"https://Stackoverflow.com/questions/46126695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3666882/"
] | Try like this way, more about filtering <https://www.algolia.com/doc/guides/searching/filtering/>
```
this.index.search({
query: 'mar',
filters: 'company_id:36ec09ec-6b07-45e3-ae2d-a77bfe381baa'
}).then(resp => {
console.log(resp);
});
``` | This usually happens if you haven't created an attribute for facet. To create an attribute, follow these steps:
1. Go to your Algoloa dashboard.
2. Scroll down to "Data source" card.
3. Click on the index that you need.
4. In the left pane, choose Configure > Index.
5. In the right pane, click on the configure tab.
6.... |
46,126,695 | I have an algolia application with some objects that look like this:
```
{
"company_id": "36ec09ec-6b07-45e3-ae2d-a77bfe381baa",
"first_name": "maryam",
"objectID": "ffd92558-6bd3-42df-96c2-9c9124e66f6a"
}
```
I'm trying to run a query that filter search results by `company_id`.
I've read the Algolia docs and... | 2017/09/09 | [
"https://Stackoverflow.com/questions/46126695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3666882/"
] | This usually happens if you haven't created an attribute for facet. To create an attribute, follow these steps:
1. Go to your Algoloa dashboard.
2. Scroll down to "Data source" card.
3. Click on the index that you need.
4. In the left pane, choose Configure > Index.
5. In the right pane, click on the configure tab.
6.... | I encountered this issue as well. Looks like we need to add a facet to the attribute we want to filter. So in this case, you might want to create a facet related to `company_id` and make sure it's searchable |
69,260,783 | We are wrapping a component library with React components, but in some cases the library manipulates the DOM tree in such a way that React will crash when trying to remove the React components.
Here's a sample that reproduces the issue:
```
function Sample ()
{
let [shouldRender, setShouldRender] = React.useState(... | 2021/09/20 | [
"https://Stackoverflow.com/questions/69260783",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2919731/"
] | The cleanup function of useEffect, hence `someExternalLibrary.cleanup()`, is called **after** React has updated the DOM (removed the div from the DOM). It fails, because React is trying to remove a DOM node that `someExternalLibrary.setup()` removed (and `someExternalLibrary.cleanup()` will put back later).
In class c... | React doesn't expect you to remove nodes that React has created. Treat nodes created by React as read-only. Instead you should:
>
> wrap the existing HTML inside another DIV element
>
>
>
However you don't explain why that isn't feasible:
>
> but unfortunately, that's not always possible in our project, so I ne... |
14,403,677 | It was hard to find the correct question topic. Well, let me elaborate more. I'm making a barcode generator simple webapp. It is for our warehouse team.
I made a class named `SqlComm` where I handle all `SQL` connection related thing. Then, I have a query (the query is just about counting a column where some Date in b... | 2013/01/18 | [
"https://Stackoverflow.com/questions/14403677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1620283/"
] | If `self.variable` is a string holding the name of an attribute, use `getattr`:
```
getattr(self.array, self.variable)
``` | It's not clear what you mean here (at least to me). But basically, the `self` is just the conventional name for the instance within a class method. It has local scope, so you don't reference it that way from outside it. It *is* the instance, from outside you should be able to do simply `self.array.variable`.
However,... |
4,971,909 | Is there any way of getting the "Windows Live Anonymous ID" from a PC based on the users e-mail-adress, logged in Windows-account, registry, Zune, currently usb-connected phone or else? | 2011/02/11 | [
"https://Stackoverflow.com/questions/4971909",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382838/"
] | Marcus S. Zarra's "Core Data" book gets good reviews. | I learned by actually doing. [This is where I started](http://cocoadevcentral.com/articles/000085.php). It's a pretty good tutorial.
Edit: I forgot two other tutorials I followed:
[Part 1](http://www.mactech.com/articles/mactech/Vol.21/21.07/CoreData/)
[Part 2](http://www.mactech.com/articles/mactech/Vol.21/21.09/Co... |
4,971,909 | Is there any way of getting the "Windows Live Anonymous ID" from a PC based on the users e-mail-adress, logged in Windows-account, registry, Zune, currently usb-connected phone or else? | 2011/02/11 | [
"https://Stackoverflow.com/questions/4971909",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382838/"
] | There are several guides besides the [Core Data Programming Guide](http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/) that are relevant:
* [Model Object Implementation Guide](http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ModelObjects/)
* [Key-Value Coding Programmi... | I learned by actually doing. [This is where I started](http://cocoadevcentral.com/articles/000085.php). It's a pretty good tutorial.
Edit: I forgot two other tutorials I followed:
[Part 1](http://www.mactech.com/articles/mactech/Vol.21/21.07/CoreData/)
[Part 2](http://www.mactech.com/articles/mactech/Vol.21/21.09/Co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.