qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | I finally realized this happens when I duplicate a layer from one canvas size to another, where the first canvas is larger in a significant way. The above answers were correct, zooming out works, but I wanted to clarify what the cause is, at least for me. Also helps to pay attention to where on the canvas the layer bei... | I've had this issue too. Check to see if your workspace is in "analysis" (upper right hand corner). That's the workspace I use most often. Good luck!! |
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | I finally realized this happens when I duplicate a layer from one canvas size to another, where the first canvas is larger in a significant way. The above answers were correct, zooming out works, but I wanted to clarify what the cause is, at least for me. Also helps to pay attention to where on the canvas the layer bei... | @Banjer, I solve the problem by:
* Creating a new layer above all other layers (to ensure I can see it)
* Selecting an area of that layer with the marquee tool
* Pasting into the selected area
The pasted graphic will appear in the new layer. |
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | When this happens to me I zoom out, slowly locate the layer in the layers side-panel and then a dotty box around that layer appears, then I drag it back to the correct place. - Try to figure out what combination of events make you lose the layer and work out a different workflow to minimise the hassle. | I have this same issue in my Adobe Photoshop CC 2015.
I restore the "layer" view by going to "Essentials" at top right hand corner, and "Reset Essentials". |
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | When this happens to me I zoom out, slowly locate the layer in the layers side-panel and then a dotty box around that layer appears, then I drag it back to the correct place. - Try to figure out what combination of events make you lose the layer and work out a different workflow to minimise the hassle. | @Banjer, I solve the problem by:
* Creating a new layer above all other layers (to ensure I can see it)
* Selecting an area of that layer with the marquee tool
* Pasting into the selected area
The pasted graphic will appear in the new layer. |
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | I've had this issue too. Check to see if your workspace is in "analysis" (upper right hand corner). That's the workspace I use most often. Good luck!! | @Banjer, I solve the problem by:
* Creating a new layer above all other layers (to ensure I can see it)
* Selecting an area of that layer with the marquee tool
* Pasting into the selected area
The pasted graphic will appear in the new layer. |
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | Press `CTRL`+`T`(transform) or Edit > Transform.
This will put a box around the object that is off the page and you should be able to see the box to bring it back into view. In combination with zooming out this should work. | I finally realized this happens when I duplicate a layer from one canvas size to another, where the first canvas is larger in a significant way. The above answers were correct, zooming out works, but I wanted to clarify what the cause is, at least for me. Also helps to pay attention to where on the canvas the layer bei... |
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | Press `CTRL`+`T`(transform) or Edit > Transform.
This will put a box around the object that is off the page and you should be able to see the box to bring it back into view. In combination with zooming out this should work. | I have this same issue in my Adobe Photoshop CC 2015.
I restore the "layer" view by going to "Essentials" at top right hand corner, and "Reset Essentials". |
375,407 | This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere.
The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is? | 2012/01/06 | [
"https://superuser.com/questions/375407",
"https://superuser.com",
"https://superuser.com/users/44531/"
] | When this happens to me I zoom out, slowly locate the layer in the layers side-panel and then a dotty box around that layer appears, then I drag it back to the correct place. - Try to figure out what combination of events make you lose the layer and work out a different workflow to minimise the hassle. | I finally realized this happens when I duplicate a layer from one canvas size to another, where the first canvas is larger in a significant way. The above answers were correct, zooming out works, but I wanted to clarify what the cause is, at least for me. Also helps to pay attention to where on the canvas the layer bei... |
149,494 | Can anyone plz tell how the below can be done ?
I want to remove the "del" option from the below in the Opp object. removing possibility of entire Action column also would be OK. thanks
[](https://i.stack.imgur.com/SZcDs.png) | 2016/11/21 | [
"https://salesforce.stackexchange.com/questions/149494",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/34421/"
] | There's a new method you can use while creating a record in memory, using a new two-parameter version of newSobject:
```
Account record = (Account)Account.SObjectType.newSobject(null, true);
```
The null value is the record type to use, and true specifies that all default field values should be populated.
This meth... | If you are doing DML into database and want the picklist field value to be default, you can simply leave it unset. It will automatically be setup as the default value.
If you use it for other purpose, I guess you need to go through the getDescribe() way. |
254,818 | I am using a SPFX Script Editor to make color changes on the Header of the Home Page. Now, when I visit other pages in the SharePoint site like-Site Contents, I don't see the changes applied to the header.
How can I ensure that the changes are applied across the site? Is it possible to edit the master page on the Comm... | 2018/12/25 | [
"https://sharepoint.stackexchange.com/questions/254818",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/53681/"
] | I will suggest you go with Microsoft business primium version. This version spicaly designed for SME type companies. | Most would probably recommend cloud for smaller organizations, and that also avoid any startup costs, and requires less in-house knowledge of how to configure servers, etc. However, none of the online licenses would include an internet site. To be clear, I'm not recommending an on-prem sharepoint server for this, and i... |
1,658,054 | [](https://i.stack.imgur.com/L6Xp0.png)
Prove the following statement by mathematical induction:
$n(n^2+5)$ is divisible by 6 for all integer $n \ge 1$
My attempt:
Let the given statement be p(n).
(1) $1(1^2+5)$=6 Hence, p(1) is true.
(2) S... | 2016/02/16 | [
"https://math.stackexchange.com/questions/1658054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/294566/"
] | If $f(n)=n(n^2+5)$
$f(k+1)-f(k)$
$=(k+1)\{(k+1)^2+5\}-k(k^2+5)=3k^2+3k+1+5=6\cdot\dfrac{k(k+1)}2+6$ which is divisible by $6$ as $k(k+1)$ is even
$\implies6\mid f(k)\iff6\mid f(k+1)$
If induction is not mandatory,
$$n(n^2+5)=\underbrace{(n-1)n(n+1)}\_{\text{Product of Three consecutive integers }}+6n$$ | Hint:
let $$f(n)=n(n^2+5),n\geq1$$ then
$$f(n+1)=(n+1)(n^2+2n+6)=n^3+2n^2+6n+n^2+2n+6=n^3+3n^2+8n+6=$$
$$=n^3+5n+3n^2+3n+6=3(n^2+n)+6+n(n^2+5)=f(n)+6\left(\frac{n(n+1)}{2}+1\right)$$ |
1,658,054 | [](https://i.stack.imgur.com/L6Xp0.png)
Prove the following statement by mathematical induction:
$n(n^2+5)$ is divisible by 6 for all integer $n \ge 1$
My attempt:
Let the given statement be p(n).
(1) $1(1^2+5)$=6 Hence, p(1) is true.
(2) S... | 2016/02/16 | [
"https://math.stackexchange.com/questions/1658054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/294566/"
] | **First, show that this is true for $n=1$:**
$1(1^2+5)=6$
**Second, assume that this is true for $n$:**
$n(n^2+5)=6k$
**Third, prove that this is true for $n+1$:**
$(n+1)((n+1)^2+5)=$
$\color\red{n(n^2+5)}+3n^2+3n+6=$
$\color\red{6k}+3n^2+3n+6=$
$6\left(k+\frac{n(n+1)}{2}+1\right)$
---
Since either $n$ or $n+... | Hint:
let $$f(n)=n(n^2+5),n\geq1$$ then
$$f(n+1)=(n+1)(n^2+2n+6)=n^3+2n^2+6n+n^2+2n+6=n^3+3n^2+8n+6=$$
$$=n^3+5n+3n^2+3n+6=3(n^2+n)+6+n(n^2+5)=f(n)+6\left(\frac{n(n+1)}{2}+1\right)$$ |
1,658,054 | [](https://i.stack.imgur.com/L6Xp0.png)
Prove the following statement by mathematical induction:
$n(n^2+5)$ is divisible by 6 for all integer $n \ge 1$
My attempt:
Let the given statement be p(n).
(1) $1(1^2+5)$=6 Hence, p(1) is true.
(2) S... | 2016/02/16 | [
"https://math.stackexchange.com/questions/1658054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/294566/"
] | I'm utterly confused. Three hours before asking this, you asked (and had answered) this: [Proof of for all integer $n \ge 2$, $n^3-n$ is divisible by 6 by mathematical induction.](https://math.stackexchange.com/questions/1657878/proof-of-for-all-integer-n-ge-2-n3-n-is-divisible-by-6-by-mathematical-in)
In that one you... | Hint:
let $$f(n)=n(n^2+5),n\geq1$$ then
$$f(n+1)=(n+1)(n^2+2n+6)=n^3+2n^2+6n+n^2+2n+6=n^3+3n^2+8n+6=$$
$$=n^3+5n+3n^2+3n+6=3(n^2+n)+6+n(n^2+5)=f(n)+6\left(\frac{n(n+1)}{2}+1\right)$$ |
44,189,216 | ```
local script= string.dump(
function()
print('Hi')
end
)
buff=""
for v=1,string.len(script) do
buff=buff..'\\'..string.byte(script,v)
end
print(buff)
```
script turns into byte code, any idea how to reverse it? | 2017/05/25 | [
"https://Stackoverflow.com/questions/44189216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8067182/"
] | You cannot reverse bytecode to Lua source but you can list the VM instructions with `luac -l`. | To find the difference between VM bytecode and Lua bytecode, in VM bytecode there would always be a `\24` in the front.
In this case, this is VM `(virtual machine)` bytecode. This obfuscation thing also uses a `string.dump` function and can be easily reversed.
Here's the modified decompiler version:
```
local script... |
71,197,496 | I have python script that creates dataflow template in the specified GCS path. I have tested the script using my GCP Free Trial and it works perfect.
My question is using same code in production environment I want to generate a template but I can not use Cloud-Shell as there are restrictions also can not directly run t... | 2022/02/20 | [
"https://Stackoverflow.com/questions/71197496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2458847/"
] | First, you can do this with RXJS, or promises, but either way intentionally makes room for asynchronous programming, so when your `transform` method synchronously returns `this.value` at the end, I don't think you're getting what you're expecting? I'm guessing the reason it is compiling but you don't think it is workin... | If I understand the problem well, your code has a fundamental problem and the fact that "*Everything works well, if I use Observables*" is a fruit of a very special case.
Let's look at this very stripped down version of your code
```
function translationObservable(key) {
return of("Obs translates key: " + key);
}
... |
11,170,753 | In the example provided below, I execute nmake and then redirect STDOUT/STDERR to tee, which then sends it to the screen, and also to a log file.
The problem is that I'm trying to capture the exit code for nmake and not tee.
What I need is the exit code from nmake, and not tee.
```
nmake | tee output.txt
``` | 2012/06/23 | [
"https://Stackoverflow.com/questions/11170753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451492/"
] | You might think you could do something like the following, but it won't work.
```
(nmake & call set myError=%%errorlevel%%) | tee output.txt
```
The problem lies in the mechanism by which Windows pipes work. Each side of the pipe is executed in it's own CMD shell. So any environment variable you set there will disap... | There is a version of "tee" (called mtee => <https://ritchielawrence.github.io/mtee/>) that optionally adopts the exit code of the piped process. With that you could write
```
nmake | mtee /E output.txt
``` |
11,170,753 | In the example provided below, I execute nmake and then redirect STDOUT/STDERR to tee, which then sends it to the screen, and also to a log file.
The problem is that I'm trying to capture the exit code for nmake and not tee.
What I need is the exit code from nmake, and not tee.
```
nmake | tee output.txt
``` | 2012/06/23 | [
"https://Stackoverflow.com/questions/11170753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451492/"
] | You might think you could do something like the following, but it won't work.
```
(nmake & call set myError=%%errorlevel%%) | tee output.txt
```
The problem lies in the mechanism by which Windows pipes work. Each side of the pipe is executed in it's own CMD shell. So any environment variable you set there will disap... | Inspired by the answer of @dbenham, I made the following version:
```
(%cmd% & call echo EXIT /B %^^ERRORLEVEL% >%ret_file%)
| tee %log_file% & %ret_file%>NUL
```
It is a one-liner, that can be used on the command line, or in a batch file.
It has the advantage that the line ends up producing the correct %ERROR... |
150,099 | 1) I would have called you, but I didn't know your number.
2) I could have called you, but I didn't know your number.
Can I use 2 in place of 1? Do they mean same? | 2017/12/13 | [
"https://ell.stackexchange.com/questions/150099",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/66229/"
] | **Edit** after reading OP's comment to this answer.
The two sentences in the question are saying different things. In the first case **would** is *certain*, but in the second case **could** remains a *possibility*. So the second sentence reads like an excuse.
Referring to the examination question asked in comment, yo... | The first case is assuring someone that, had you had their number, you would have called.
The second makes no such assertion, but points out that because you didn't have their number, it was impossible for you to call.
This is because *would* expresses (potentially subjective) certainty (when used in this sort of sit... |
111,216 | I am mainly looking for apps which help increasing productivity and not the ones like Calculator, Periodic Table etc.
Apps which are good for taking notes, taking handwriting input. | 2013/11/20 | [
"https://apple.stackexchange.com/questions/111216",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/40266/"
] | * [CourseNotes](https://itunes.apple.com/us/app/coursenotes/id364183278?mt=8)
* [inclass](https://itunes.apple.com/en/app/inclass/id374986430?mt=8) (Free)
* [iThoughtsHD](https://itunes.apple.com/us/app/ithoughtshd-mindmapping/id369020033?mt=8)
* [GoodReader](https://itunes.apple.com/us/app/goodreader-for-ipad/id363448... | [Khan Academy](http://www.khanacademy.org/):
* Allows you to learn almost anything for free.
* [iOS app](https://itunes.apple.com/us/app/khan-academy/id469863705) is the best way to view Khan Academy’s complete library of over 4,200 videos.
See also:
[Khan Academy - Youtube Channel](http://www.youtube.com/user/khana... |
34,056 | I've stumbed upon this sentence in Mauilik V's [answer](https://ell.stackexchange.com/a/34049/2127) on this site:
>
> If you have an iPhone 6, for instance, you can use **both the** sentences to describe its functionality.
>
>
>
The use of the definite article in the bolded position seemed strange to me, and I e... | 2014/09/22 | [
"https://ell.stackexchange.com/questions/34056",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/2127/"
] | We RARELY say "both the X" in English, but it is valid and meaningful. The use of "the" here emphasizes that we are talking about a particular set of X.
I can't think of an example where the meaning would really change between "both X" and "both the X", other than emphasis. The word "both" implies that I've already in... | Your edit was correct.
The *the* after both is unnecessary, as the reader is assumed to know which sentences are being referred to.
Additionally, when using *the* with *both*, the phrasing generally used is *both of the*.
It's likely that *both the* is a prepositional phrase that is missing its preposition. |
32,997,185 | For a ***[trivially copyable](http://en.cppreference.com/w/cpp/concept/TriviallyCopyable)*** type T consider:
```
void f(T z)
{
T a;
T b;
std::memcpy(&b, &a, sizeof(T));
a = z;
b = z;
// ...
}
```
Is the behavior of this fragment defined in C++14 if
1. T is char,
2. T is int, or
3. T is struct {... | 2015/10/07 | [
"https://Stackoverflow.com/questions/32997185",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3127195/"
] | There are a couple things at play here:
* an expression evaluating to an indeterminate value causes undefined behavior, with certain exceptions (8.5p12)
* `unsigned char` (and possibly `char`, if unsigned) is the exception
* variables with automatic storage duration and whose types have trivial default initialization ... | Yes, it's well defined for all those cases. The answers do not change if `memcpy` is replaced by copy assignment (copying for trivially copyable types *is* byte-wise copy. That's what makes it trivial), and for all trivially copyable types, move construction IS copy construction, so there's no difference there either.
... |
23,225,521 | I would like to know if it's bad practice to have a static container in a class to store all the pointers to the class' objects so they can all be easily accessed by the base classes of the program. This is for a game and I saw it on sdltutorials dot com, and I find it very useful. It would allow me to have a very neat... | 2014/04/22 | [
"https://Stackoverflow.com/questions/23225521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3561265/"
] | It is certainly *convenient*, however a `static` variable or a `Singleton` are nothing more than global variables; and having global variables comes with drawbacks:
* the dependencies of a function become unclear: which global does it rely upon ?
* the re-entrancy of a function is compromised: what if `current_enemy.r... | Different people may have different opinions about this. I can give you some advice on *how* to store your static objects in a better way.
Use the [singleton pattern](http://en.wikipedia.org/wiki/Singleton_pattern) for a class which stores your objects:
```
class ObjectManager
{
private:
std::vector<Enemy*> enemie... |
23,225,521 | I would like to know if it's bad practice to have a static container in a class to store all the pointers to the class' objects so they can all be easily accessed by the base classes of the program. This is for a game and I saw it on sdltutorials dot com, and I find it very useful. It would allow me to have a very neat... | 2014/04/22 | [
"https://Stackoverflow.com/questions/23225521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3561265/"
] | It is certainly *convenient*, however a `static` variable or a `Singleton` are nothing more than global variables; and having global variables comes with drawbacks:
* the dependencies of a function become unclear: which global does it rely upon ?
* the re-entrancy of a function is compromised: what if `current_enemy.r... | I would not suggest doing this the way you are. At this point you may as well have a bare global variable in a namespace, it is the same thing you are doing right now.
I also do not suggest using singletons.
[When should the Singleton pattern NOT be used? (Besides the obvious)](https://stackoverflow.com/questions/407... |
31,291,826 | I'm interested in ESAPI to use in a production environment.
Is there any official documentation on how to setup properly a web application, and if so, where? | 2015/07/08 | [
"https://Stackoverflow.com/questions/31291826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1839105/"
] | ESAPI has good intentions, it is referenced de facto in OWASP Top 10 issues.
However its main development is not really active. The library is provided *as is*.
There are two Java libraries depending on the versions:
* [OWASP Enterprise Security API for Java](https://github.com/ESAPI/esapi-java): version >= 3.x
+ M... | If you want to learn secure programming with ESAPI, check out the ESAPI swing set: <https://www.owasp.org/index.php/ESAPI_Swingset>
However, as superbob has pointed out, you probably shouldn't use it in new production applications. |
24,167 | I know that many labs use either [FlowJo](http://www.flowjo.com/) or [FCS Express](http://www.denovosoftware.com/) to plot and analyze their flow data. These seem like the two standards for most labs (and I have used FlowJo before). However, my current funding does not cover software licenses and I'm not keen to pay $5... | 2014/11/20 | [
"https://biology.stackexchange.com/questions/24167",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/9829/"
] | Sounds like you should look into [Bioconductor's flow suite](http://master.bioconductor.org/help/course-materials/2007/BioC2007/labs/flowcore1/). I actually really like doing flow analysis in R, but it takes some practice and getting used to.
The biggest problem you will run into (in my opinion) is gating. It's not ea... | I created a free flow cytometry tool that works on any device <https://www.redmatterapp.com/>
The benefits of this tool is that it works on any device and analysis can be shared via a URL. |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | If anyone else comes across this question it's very easy.
1. You're most likely using a reverse proxy
2. Just enable websocket support on your reverse proxy.
Ex.
If you are using Docker and the popular NGINX Proxy Manager; when you are adding a proxy host make sure to choose `websocket support`
No more 1006 error :) | I had this issue as well. I used @thnee's solution of changing the connection method. I found this easiest to do by using the `settings UI > Remote > Connection Method` |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | 1. Find out which instance of WSL is running
```
wsl -l --running
```
2. Terminate all running instances of WSL
```
wsl --shutdown
```
3. Then simply restart WSL
```
wsl
``` | Just clean up the `/root/.vscode-server` directory, vs code will create a new one when you connect again to the remote machine. |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | 1. Find out which instance of WSL is running
```
wsl -l --running
```
2. Terminate all running instances of WSL
```
wsl --shutdown
```
3. Then simply restart WSL
```
wsl
``` | I have this issue all of a sudden and after a few trials, I found install another distro using WSL-1 fixes the problem. You can safely unregister the new distro afterwards. |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | If anyone else comes across this question it's very easy.
1. You're most likely using a reverse proxy
2. Just enable websocket support on your reverse proxy.
Ex.
If you are using Docker and the popular NGINX Proxy Manager; when you are adding a proxy host make sure to choose `websocket support`
No more 1006 error :) | I think that may cause by the conflict between `~/.ssh/config` and `~/.ssh/known_hosts`. I delete the `~/.ssh/known_hosts` file and try again, find that the vscode can connect to remote successly |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | 1. Find out which instance of WSL is running
```
wsl -l --running
```
2. Terminate all running instances of WSL
```
wsl --shutdown
```
3. Then simply restart WSL
```
wsl
``` | This can be resolved by rebooting the host machine (i.e. reboot your Windows PC) and restarting your WSL-2 box, then launching VSCode remote again.
No idea why this happens but from time to time I experience this issue.
Confirmed issue on:
```
Ubuntu 20.04
Vs code 1.60.1
``` |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | This can be resolved by rebooting the host machine (i.e. reboot your Windows PC) and restarting your WSL-2 box, then launching VSCode remote again.
No idea why this happens but from time to time I experience this issue.
Confirmed issue on:
```
Ubuntu 20.04
Vs code 1.60.1
``` | I think that may cause by the conflict between `~/.ssh/config` and `~/.ssh/known_hosts`. I delete the `~/.ssh/known_hosts` file and try again, find that the vscode can connect to remote successly |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | If anyone else comes across this question it's very easy.
1. You're most likely using a reverse proxy
2. Just enable websocket support on your reverse proxy.
Ex.
If you are using Docker and the popular NGINX Proxy Manager; when you are adding a proxy host make sure to choose `websocket support`
No more 1006 error :) | Just clean up the `/root/.vscode-server` directory, vs code will create a new one when you connect again to the remote machine. |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | I had this issue as well. I used @thnee's solution of changing the connection method. I found this easiest to do by using the `settings UI > Remote > Connection Method` | I have this issue all of a sudden and after a few trials, I found install another distro using WSL-1 fixes the problem. You can safely unregister the new distro afterwards. |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | 1. Find out which instance of WSL is running
```
wsl -l --running
```
2. Terminate all running instances of WSL
```
wsl --shutdown
```
3. Then simply restart WSL
```
wsl
``` | If anyone else comes across this question it's very easy.
1. You're most likely using a reverse proxy
2. Just enable websocket support on your reverse proxy.
Ex.
If you are using Docker and the popular NGINX Proxy Manager; when you are adding a proxy host make sure to choose `websocket support`
No more 1006 error :) |
68,799,596 | I don't know why the table name is different.
I create table name is tb\_user (model - Tb\_user)
How to resolve different table name?
[](https://i.stack.imgur.com/BpOA5.png)
```
use App\Models\Tb_user;
use Illuminate\Support\Facades\DB;
use Illumin... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68799596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9501341/"
] | I changed the setting `remote.WSL.server.connectThroughLocalhost` (Settings -> Extensions -> Remote - WSL -> Connect Through Localhost) from disabled to enabled, and that fixed the issue for me.
No idea why this happened in the first place though, it was working fine without enabling this setting for over 2 months, an... | >
> setting ->terminal>integrated>default profile was null, i made it as sh this is the fix for it [enter image description here](https://i.stack.imgur.com/7eFhU.png)
>
>
> |
31,336,162 | Trying to insert multiple records into a MySQL database using async/await and transactions, however it is still causing the UI to become frozen/unresponsive while in the loop.
Looking at the following code, what am I doing wrong or how can this be achieved so that the UI is still responsive during this process.
**The... | 2015/07/10 | [
"https://Stackoverflow.com/questions/31336162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3504007/"
] | Use `ExecuteNonQueryAsync` instead of `ExecuteNonQuery`:
```
await cmd.ExecuteNonQueryAsync();
```
That's the most time consuming call of your query, which is blocked synchronously because you're using the synchronous version.
**Edit:**
Since you don't need to do any UI work which requires a synchronization contex... | I think most of the time is spend in the `Commit` operation. The problem is that each `await` in your `AddRecords` function synchronizes back to the UI thread the function was called from. That is your main problem.
The easiest way to disconnect from this `SynchronizationContext` that causes you trouble is to force `A... |
33,763,445 | I need to use the QueryBuilder plugin from jQuery for my project, so I downloaded the files I needed as specified in the overview web page <http://mistic100.github.io/jQuery-QueryBuilder/>
I then set up a simple page using the code below but when I run it nothing happens.
What am I missing.
```
<!DOCTYPE html>
<html ... | 2015/11/17 | [
"https://Stackoverflow.com/questions/33763445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616076/"
] | I believe you need to load Jquery before the plugin. | I've never used this plugin before, but if it is a JQuery plugin, then the JQuery Library will need to be loaded FIRST. Since the browser will stop and read the entire library before moving on, make sure the JQuery Library appears first. That way, the library is loaded before it tries to load the plugin. Hope that work... |
33,763,445 | I need to use the QueryBuilder plugin from jQuery for my project, so I downloaded the files I needed as specified in the overview web page <http://mistic100.github.io/jQuery-QueryBuilder/>
I then set up a simple page using the code below but when I run it nothing happens.
What am I missing.
```
<!DOCTYPE html>
<html ... | 2015/11/17 | [
"https://Stackoverflow.com/questions/33763445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616076/"
] | I've never used this plugin before, but if it is a JQuery plugin, then the JQuery Library will need to be loaded FIRST. Since the browser will stop and read the entire library before moving on, make sure the JQuery Library appears first. That way, the library is loaded before it tries to load the plugin. Hope that work... | You'll need to include Bootstrap, jQuery and the dependencies first so you have to work with:
```
<script src="Scripts/bootstrap.js"></script>
<script src="Scripts/jquery-2.1.4.js"></script>
<script src="Scripts/jQuery.extendext.js"></script>
<script src="Scripts/doT.js"></script>
<script src="Scripts/moment.js"></scr... |
33,763,445 | I need to use the QueryBuilder plugin from jQuery for my project, so I downloaded the files I needed as specified in the overview web page <http://mistic100.github.io/jQuery-QueryBuilder/>
I then set up a simple page using the code below but when I run it nothing happens.
What am I missing.
```
<!DOCTYPE html>
<html ... | 2015/11/17 | [
"https://Stackoverflow.com/questions/33763445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616076/"
] | I've never used this plugin before, but if it is a JQuery plugin, then the JQuery Library will need to be loaded FIRST. Since the browser will stop and read the entire library before moving on, make sure the JQuery Library appears first. That way, the library is loaded before it tries to load the plugin. Hope that work... | Here is another working way.
1. Include all CSS files from jQuery-QueryBuilder\dist\css to VS Content folder.
2. Add Bootstrap 3+ version css file into VS Content folder.
3. Add doT.js, jQuery.extendext.js, moment.js, jquery-3.1.1.min.js and query-builder.standalone.js into VS Scripts folder.
4. In \_layout.cshtml pag... |
33,763,445 | I need to use the QueryBuilder plugin from jQuery for my project, so I downloaded the files I needed as specified in the overview web page <http://mistic100.github.io/jQuery-QueryBuilder/>
I then set up a simple page using the code below but when I run it nothing happens.
What am I missing.
```
<!DOCTYPE html>
<html ... | 2015/11/17 | [
"https://Stackoverflow.com/questions/33763445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616076/"
] | I believe you need to load Jquery before the plugin. | You'll need to include Bootstrap, jQuery and the dependencies first so you have to work with:
```
<script src="Scripts/bootstrap.js"></script>
<script src="Scripts/jquery-2.1.4.js"></script>
<script src="Scripts/jQuery.extendext.js"></script>
<script src="Scripts/doT.js"></script>
<script src="Scripts/moment.js"></scr... |
33,763,445 | I need to use the QueryBuilder plugin from jQuery for my project, so I downloaded the files I needed as specified in the overview web page <http://mistic100.github.io/jQuery-QueryBuilder/>
I then set up a simple page using the code below but when I run it nothing happens.
What am I missing.
```
<!DOCTYPE html>
<html ... | 2015/11/17 | [
"https://Stackoverflow.com/questions/33763445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616076/"
] | I believe you need to load Jquery before the plugin. | Here is another working way.
1. Include all CSS files from jQuery-QueryBuilder\dist\css to VS Content folder.
2. Add Bootstrap 3+ version css file into VS Content folder.
3. Add doT.js, jQuery.extendext.js, moment.js, jquery-3.1.1.min.js and query-builder.standalone.js into VS Scripts folder.
4. In \_layout.cshtml pag... |
45,686,494 | I have two tables `Posts, categories`. Here in the posts table I stored the category values as comma separated string like this `5,8,23,7`. While displaying the posts, I just want to show the post categories as comma separated like this `Flower, Birds, Animals`. So I tried some queries nothing helped me to get it. The ... | 2017/08/15 | [
"https://Stackoverflow.com/questions/45686494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9799597/"
] | EDIT: Updated to consider the fact that `Posts.categories` is a CSV value.
You need to use the `GROUP_CONCAT()` function, and also the trick posted in [SQL split comma separated row](https://stackoverflow.com/questions/19073500/sql-split-comma-separated-row) in order to split the `JOIN` CSV and then create the output ... | I believe you can use group\_concat? Just join the Categories table and group\_concat the name group\_concat(name)
as for the JOIN try to use find\_in\_set(Categories.ID, Post.ID) > 0
Thou this approach may not work if the comma delimited Category ID has space i.e. 1, 2 etc...But if you are saving it accurately this ... |
45,686,494 | I have two tables `Posts, categories`. Here in the posts table I stored the category values as comma separated string like this `5,8,23,7`. While displaying the posts, I just want to show the post categories as comma separated like this `Flower, Birds, Animals`. So I tried some queries nothing helped me to get it. The ... | 2017/08/15 | [
"https://Stackoverflow.com/questions/45686494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9799597/"
] | If you simply must use that schema, you could try something like this:
```
select P.ID, P.Title, (
select group_concat(C.name SEPARATOR ', ')
from Categories C
where LOCATE(CONCAT(C.ID, ','), P.categories) > 0
or LOCATE(CONCAT(', ', C.ID), P.categories) > 0
) as categories
from Post P;
... | I believe you can use group\_concat? Just join the Categories table and group\_concat the name group\_concat(name)
as for the JOIN try to use find\_in\_set(Categories.ID, Post.ID) > 0
Thou this approach may not work if the comma delimited Category ID has space i.e. 1, 2 etc...But if you are saving it accurately this ... |
57,958,524 | ### What I want?
I want to see live events on Debug View of Firebase Console where the iOS app is to be installed from an exported `ipa` file. I have only two distribution method options to export my `ipa` file
1. Ad-Hoc
2. Development.
[](https://i... | 2019/09/16 | [
"https://Stackoverflow.com/questions/57958524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2659493/"
] | I too had to struggle with this and found a solution by setting the -FIRDebugEnabled flag in AppDelegate so that whenever you want to export the build it will not be ignored. I've also added the DEBUG macro so that it will only fire for DEBUG.
```
#if DEBUG
var newArguments = ProcessInfo.processInfo.arguments
... | I doubt if it's doable on a non-jailbroken device. When you launch an app from SpringBoard, it doesn't make sense to me that SpringBoard would allow additional parameters, because that's not the way how it's designed. The parameter is likely come from a debugger, which means it's debug only. |
10,627 | I have a question about my Physics Stack Exchange post: [AC Circuits with Frequencies Dependent on Initial Conditions](https://physics.stackexchange.com/questions/405301/ac-circuits-with-frequencies-dependent-on-initial-conditions)
I don't understand why this question was put on hold. It clearly matches all the guidel... | 2018/05/12 | [
"https://physics.meta.stackexchange.com/questions/10627",
"https://physics.meta.stackexchange.com",
"https://physics.meta.stackexchange.com/users/195325/"
] | I don't know why the question was put on hold either; the only people who can truly answer that are those who voted for the hold. Hopefully one or more of them will contribute an answer.
However, my best guess as to why it was put on hold was that it's not clear what the post is actually asking. In other words, at lea... | I think this is a clear call: closing this question was a mistake, and I'm voting to reopen it.
This is an example of a common problem on Phys.SE. A lot of experienced users are going on autopilot in the close queue. The minimum judging time is three seconds. I certainly get a bit lazy, but I feel that many users are ... |
55,731 | I just got done with my Sign Up form set up for my File Sharing & Hosting service and now I'm at a point where I'm developing the returning of form errors.
There are 6 fields, and they are all mandatory which is said in the paragraph above the form. Error messages will be displayed in red and under the input it is abo... | 2014/04/15 | [
"https://ux.stackexchange.com/questions/55731",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/46613/"
] | Your error messages can be more polite and specific.
You cannot have this message "Please enter your name." for both your conditions. If the user has entered a name and if you show him the above message then he will be confused. You need to tell him more specifically what is the error and what will be the correct inpu... | Your error messages seems correct to me *(however, I'm not a native english speaker)*.
Edit : If you want to keep the e-mail confirmation, I would recommend you to say that **the two e-mails** doesn't match (with a better english than mine ;) ).
*It goes a little bit out of the scope of this post, but since you ar... |
55,731 | I just got done with my Sign Up form set up for my File Sharing & Hosting service and now I'm at a point where I'm developing the returning of form errors.
There are 6 fields, and they are all mandatory which is said in the paragraph above the form. Error messages will be displayed in red and under the input it is abo... | 2014/04/15 | [
"https://ux.stackexchange.com/questions/55731",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/46613/"
] | 1. User can enter his name later in his profile, if he wants to. The ultimate rule of any form is to be as simple (use as less fields) as possible. Users are lazy.
2. Assuming you have proper labels above your fields (and that all of them are mandatory), it makes sense to highlight erroneous fields with red outline and... | Your error messages seems correct to me *(however, I'm not a native english speaker)*.
Edit : If you want to keep the e-mail confirmation, I would recommend you to say that **the two e-mails** doesn't match (with a better english than mine ;) ).
*It goes a little bit out of the scope of this post, but since you ar... |
55,731 | I just got done with my Sign Up form set up for my File Sharing & Hosting service and now I'm at a point where I'm developing the returning of form errors.
There are 6 fields, and they are all mandatory which is said in the paragraph above the form. Error messages will be displayed in red and under the input it is abo... | 2014/04/15 | [
"https://ux.stackexchange.com/questions/55731",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/46613/"
] | 1. User can enter his name later in his profile, if he wants to. The ultimate rule of any form is to be as simple (use as less fields) as possible. Users are lazy.
2. Assuming you have proper labels above your fields (and that all of them are mandatory), it makes sense to highlight erroneous fields with red outline and... | Your error messages can be more polite and specific.
You cannot have this message "Please enter your name." for both your conditions. If the user has entered a name and if you show him the above message then he will be confused. You need to tell him more specifically what is the error and what will be the correct inpu... |
27,944,820 | I've seen example of it as batch command but it is not working for me.
I searched and there is a command like this :
```
find . -maxdepth 1 -type d
```
but it puts `./` to every folder name, is there a command that will give just folder names or how can i delete the first `./` characters in my script ?
After that ... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27944820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3402819/"
] | Try this, using `cut` command we can discard `./` from the list of folder name.
```
find . -maxdepth 1 -type d|cut -c 3-
```
Or you can use this option too, suggested by @Luis
```
find . -maxdepth 1 -type d|sed -e 's:^\./::'
``` | Use `sed` to eliminate the first two characters, like this:
```
find . -maxdepth 1 -type d | sed 's?^[.]/??'
``` |
27,944,820 | I've seen example of it as batch command but it is not working for me.
I searched and there is a command like this :
```
find . -maxdepth 1 -type d
```
but it puts `./` to every folder name, is there a command that will give just folder names or how can i delete the first `./` characters in my script ?
After that ... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27944820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3402819/"
] | ```
find . -maxdepth 1 -type d -printf "%P\n"
``` | Use `sed` to eliminate the first two characters, like this:
```
find . -maxdepth 1 -type d | sed 's?^[.]/??'
``` |
73,480,595 | First of all im brasilian. So im sorry for my english. ive studying the useContext hook about a week. There are a lot diferent ways in the internet to implement it. I want to know what im thinking wrong. Here is the code. There are 3 files to show me what to do. I wanna get the state user and show in the App component.... | 2022/08/25 | [
"https://Stackoverflow.com/questions/73480595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10985028/"
] | While getting a data from context, You have to use 'object destructing'. So you have to get the user from `UserContext` like below,
```
const { user } = useContext(UserContext);
``` | RecebeContexto Shouldn't have the user passed down since you will get it from the context.
The line
```
<RecebeContexto user={user} />
```
Should be:
```
<RecebeContexto />
```
Everything is working; check your node\_modules
-----------------------------------------------
I tried your code:
```
import React, {... |
1,728 | If I have two lists:
```
list1 = {{1, 2}, {3, 4}};
list2 = {{5, 6}, {7, 8}};
```
I want to export these two lists to an Excel file and have `list1` in a a worksheet called "list1" and `list2` in a worksheet called list2. How do I do that ...using information contained in `ref/format/XLSX` and `ref/format/XLX`?
**E... | 2012/02/14 | [
"https://mathematica.stackexchange.com/questions/1728",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/77/"
] | Using Export and specifying rules to create the sheet names:
```
Export["sampledata.xlsx", {"list1" -> list1, "list2" -> list2}]
``` | Resonding to your updated question, this is the best I can determine the relationship between syntax forms given for the XLS format and this syntax:
```
Export["test2.xls", {"list1" -> list1, "list2" -> list2}]
```
It appears to be special format for type `"Data"`, which is the default. The complete form is therefor... |
1,728 | If I have two lists:
```
list1 = {{1, 2}, {3, 4}};
list2 = {{5, 6}, {7, 8}};
```
I want to export these two lists to an Excel file and have `list1` in a a worksheet called "list1" and `list2` in a worksheet called list2. How do I do that ...using information contained in `ref/format/XLSX` and `ref/format/XLX`?
**E... | 2012/02/14 | [
"https://mathematica.stackexchange.com/questions/1728",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/77/"
] | Resonding to your updated question, this is the best I can determine the relationship between syntax forms given for the XLS format and this syntax:
```
Export["test2.xls", {"list1" -> list1, "list2" -> list2}]
```
It appears to be special format for type `"Data"`, which is the default. The complete form is therefor... | At the risk of raising a question from the grave its worth noting that this has been clarified/corrected at some point. Its not clear whether it was just a typo in the Help or its later functionality.
If you look at the XLSX help, the 4th Basic Example shows the correct syntax with Rules.
```
Export["test2.xls", "Sh... |
1,728 | If I have two lists:
```
list1 = {{1, 2}, {3, 4}};
list2 = {{5, 6}, {7, 8}};
```
I want to export these two lists to an Excel file and have `list1` in a a worksheet called "list1" and `list2` in a worksheet called list2. How do I do that ...using information contained in `ref/format/XLSX` and `ref/format/XLX`?
**E... | 2012/02/14 | [
"https://mathematica.stackexchange.com/questions/1728",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/77/"
] | Using Export and specifying rules to create the sheet names:
```
Export["sampledata.xlsx", {"list1" -> list1, "list2" -> list2}]
``` | At the risk of raising a question from the grave its worth noting that this has been clarified/corrected at some point. Its not clear whether it was just a typo in the Help or its later functionality.
If you look at the XLSX help, the 4th Basic Example shows the correct syntax with Rules.
```
Export["test2.xls", "Sh... |
48,537,563 | I'm trying to produce a program that will check the highest sum value of a 2D array.Then it needs to compare each value against each other to output which is the largest of all the sums for each position in the array.
I'm able to do this for a set number of elements but i would like to do this for an unlimited number... | 2018/01/31 | [
"https://Stackoverflow.com/questions/48537563",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9049868/"
] | The header and footer "margins" are set in the documents paper format. So you have to either change the default paper format, which should be used for most of the reports in Odoo, or you create a new one and link it to purchase order report. | Add this to your report file.
```
<record id="paperformat_rfq" model="report.paperformat">
<field name="name">A4 Barcode Paper</field>
<field name="default" eval="True" />
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orienta... |
5,985,717 | Is this the right way to use `mysql_real_escape_string`? I was using `$GET` but a friend told me to make it safer with real\_escape\_string:
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = $id") or die("err0r");
if(!$result) m... | 2011/05/12 | [
"https://Stackoverflow.com/questions/5985717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703952/"
] | No, you normally use `mysql_real_escape_string` to prepare variables for use in a query, but in your case:
1. you already use `intval`;
2. you use it in the wrong place.
You don't need it in your example. | NO, you need to escape before quering
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = '" . mysql_real_escape_string($id) . "'") or die("err0r");
if(!$result) {
}
``` |
5,985,717 | Is this the right way to use `mysql_real_escape_string`? I was using `$GET` but a friend told me to make it safer with real\_escape\_string:
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = $id") or die("err0r");
if(!$result) m... | 2011/05/12 | [
"https://Stackoverflow.com/questions/5985717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703952/"
] | No, you normally use `mysql_real_escape_string` to prepare variables for use in a query, but in your case:
1. you already use `intval`;
2. you use it in the wrong place.
You don't need it in your example. | Use:
```
$query = sprintf("SELECT *
FROM products
WHERE id = %d",
intval($_GET['id']));
$result = mysql_query($query) or die("err0r");
```
You use `mysql_real_escape_string` ***before*** the value is used in the query, otherwise you're not handling the SQL ... |
5,985,717 | Is this the right way to use `mysql_real_escape_string`? I was using `$GET` but a friend told me to make it safer with real\_escape\_string:
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = $id") or die("err0r");
if(!$result) m... | 2011/05/12 | [
"https://Stackoverflow.com/questions/5985717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703952/"
] | No, you normally use `mysql_real_escape_string` to prepare variables for use in a query, but in your case:
1. you already use `intval`;
2. you use it in the wrong place.
You don't need it in your example. | No. That is entirely wrong, and I can't quite understand what you're intending the call to do.
The purpose of `mysql_real_escape_string` is to avoid [SQL injection](http://en.wikipedia.org/wiki/SQL_injection), which is one of the biggest security risks in a website. It stops your users giving input that manipulates th... |
5,985,717 | Is this the right way to use `mysql_real_escape_string`? I was using `$GET` but a friend told me to make it safer with real\_escape\_string:
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = $id") or die("err0r");
if(!$result) m... | 2011/05/12 | [
"https://Stackoverflow.com/questions/5985717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703952/"
] | No, you normally use `mysql_real_escape_string` to prepare variables for use in a query, but in your case:
1. you already use `intval`;
2. you use it in the wrong place.
You don't need it in your example. | you want to escape it before you stick it in a query (Before it interacts with DB so you don't get injections).
```
// check if your $_GET is not empty otherwise you
// will run into "undefined variable"
if(!empty($_GET['id'])){
$id = intval($_GET['id']);
// to simplify you can escape here,
// or to be ... |
5,985,717 | Is this the right way to use `mysql_real_escape_string`? I was using `$GET` but a friend told me to make it safer with real\_escape\_string:
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = $id") or die("err0r");
if(!$result) m... | 2011/05/12 | [
"https://Stackoverflow.com/questions/5985717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703952/"
] | No. That is entirely wrong, and I can't quite understand what you're intending the call to do.
The purpose of `mysql_real_escape_string` is to avoid [SQL injection](http://en.wikipedia.org/wiki/SQL_injection), which is one of the biggest security risks in a website. It stops your users giving input that manipulates th... | NO, you need to escape before quering
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = '" . mysql_real_escape_string($id) . "'") or die("err0r");
if(!$result) {
}
``` |
5,985,717 | Is this the right way to use `mysql_real_escape_string`? I was using `$GET` but a friend told me to make it safer with real\_escape\_string:
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = $id") or die("err0r");
if(!$result) m... | 2011/05/12 | [
"https://Stackoverflow.com/questions/5985717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703952/"
] | No. That is entirely wrong, and I can't quite understand what you're intending the call to do.
The purpose of `mysql_real_escape_string` is to avoid [SQL injection](http://en.wikipedia.org/wiki/SQL_injection), which is one of the biggest security risks in a website. It stops your users giving input that manipulates th... | Use:
```
$query = sprintf("SELECT *
FROM products
WHERE id = %d",
intval($_GET['id']));
$result = mysql_query($query) or die("err0r");
```
You use `mysql_real_escape_string` ***before*** the value is used in the query, otherwise you're not handling the SQL ... |
5,985,717 | Is this the right way to use `mysql_real_escape_string`? I was using `$GET` but a friend told me to make it safer with real\_escape\_string:
```
$id = intval($_GET['id']);
$result = mysql_query("SELECT *
FROM products
WHERE id = $id") or die("err0r");
if(!$result) m... | 2011/05/12 | [
"https://Stackoverflow.com/questions/5985717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703952/"
] | No. That is entirely wrong, and I can't quite understand what you're intending the call to do.
The purpose of `mysql_real_escape_string` is to avoid [SQL injection](http://en.wikipedia.org/wiki/SQL_injection), which is one of the biggest security risks in a website. It stops your users giving input that manipulates th... | you want to escape it before you stick it in a query (Before it interacts with DB so you don't get injections).
```
// check if your $_GET is not empty otherwise you
// will run into "undefined variable"
if(!empty($_GET['id'])){
$id = intval($_GET['id']);
// to simplify you can escape here,
// or to be ... |
19,205,407 | Im trying to Enlarge the Centre most listview item. (Eventually, I hope to expand this into a sort of simple and light 3D effect that elements will appear to zoom in when in the middle of the screen and zoom out when they are down below, Total black background and text items zooming in and out... )
So, I've made a dum... | 2013/10/06 | [
"https://Stackoverflow.com/questions/19205407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2829896/"
] | A few things need to be addressed.
1. You need to use the ViewHolder pattern. That and the things you really need to know about ListView are in the [GoogleIO 2010 - The World of ListView](http://www.youtube.com/watch?v=wDBM6wVEO70) video.
2. It's not really a good idea to adjust the layout of an item in getView as th... | **1st no text appearing**
On your MySimpleArrayAdapter, getView method. You forgot to setText for your textView. There is why no text is showing.
**2nd make middle item bigger**
You try to getLastVisiblePosition before your listview adapter is setup. I guess value of v must be 0 and position == 0. There is why the t... |
59,316,265 | When attempting to push image to ECR, I always get 'no basic auth' error. ECR is in us-east-1.
This is login command
```
aws ecr get-login --region us-east-1 --no-include-email
```
I get response like this
```
docker login -u AWS -p eyJwYXl ...
```
I copy this response and run command, than I got this respons... | 2019/12/13 | [
"https://Stackoverflow.com/questions/59316265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It seems to be an Authentication issue. Reconfigure your AWS-CLI, maybe that will resolve your issue.
```
aws configure
```
<https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html> | try to login this way and push:
`eval $(aws ecr get-login --no-include-email | sed ‘s|https://||’)` |
59,316,265 | When attempting to push image to ECR, I always get 'no basic auth' error. ECR is in us-east-1.
This is login command
```
aws ecr get-login --region us-east-1 --no-include-email
```
I get response like this
```
docker login -u AWS -p eyJwYXl ...
```
I copy this response and run command, than I got this respons... | 2019/12/13 | [
"https://Stackoverflow.com/questions/59316265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It seems to be an Authentication issue. Reconfigure your AWS-CLI, maybe that will resolve your issue.
```
aws configure
```
<https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html> | The problem was, jenkins server already had aws configured with different team's account. so I added region settings (we uses different region) and the problem solved. |
59,316,265 | When attempting to push image to ECR, I always get 'no basic auth' error. ECR is in us-east-1.
This is login command
```
aws ecr get-login --region us-east-1 --no-include-email
```
I get response like this
```
docker login -u AWS -p eyJwYXl ...
```
I copy this response and run command, than I got this respons... | 2019/12/13 | [
"https://Stackoverflow.com/questions/59316265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It seems to be an Authentication issue. Reconfigure your AWS-CLI, maybe that will resolve your issue.
```
aws configure
```
<https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html> | For me, it was simply missing permissions.
There are a number of permissions related to uploading such as
```
"ecr:UploadLayerPart",
"ecr:InitiateLayerUpload",
"ecr:CompleteLayerUpload"
"ecr:PutImage"
```
I have solved it by adding them to my agent's a... |
59,316,265 | When attempting to push image to ECR, I always get 'no basic auth' error. ECR is in us-east-1.
This is login command
```
aws ecr get-login --region us-east-1 --no-include-email
```
I get response like this
```
docker login -u AWS -p eyJwYXl ...
```
I copy this response and run command, than I got this respons... | 2019/12/13 | [
"https://Stackoverflow.com/questions/59316265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | try to login this way and push:
`eval $(aws ecr get-login --no-include-email | sed ‘s|https://||’)` | For me, it was simply missing permissions.
There are a number of permissions related to uploading such as
```
"ecr:UploadLayerPart",
"ecr:InitiateLayerUpload",
"ecr:CompleteLayerUpload"
"ecr:PutImage"
```
I have solved it by adding them to my agent's a... |
59,316,265 | When attempting to push image to ECR, I always get 'no basic auth' error. ECR is in us-east-1.
This is login command
```
aws ecr get-login --region us-east-1 --no-include-email
```
I get response like this
```
docker login -u AWS -p eyJwYXl ...
```
I copy this response and run command, than I got this respons... | 2019/12/13 | [
"https://Stackoverflow.com/questions/59316265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The problem was, jenkins server already had aws configured with different team's account. so I added region settings (we uses different region) and the problem solved. | For me, it was simply missing permissions.
There are a number of permissions related to uploading such as
```
"ecr:UploadLayerPart",
"ecr:InitiateLayerUpload",
"ecr:CompleteLayerUpload"
"ecr:PutImage"
```
I have solved it by adding them to my agent's a... |
3,214,492 | I'm sorry that I can't find a better title of my question. Not lemme describe it in detail.
I have 4 database which are **a, b, c and d**. Database **a** have all table's that appear in **b**, **c** and **d**, and they have the same structure with the same constraints(pk, fk, default, check). **b**, **c**,**d** just h... | 2010/07/09 | [
"https://Stackoverflow.com/questions/3214492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/170931/"
] | Not sure on the question.
I have a working WPF app that acts as a client to several WCF services. It is deployed via ClickOnce.
However, the deployment medium (clickonce) and the design pattern (WCF) really aren't related when you are talking about the client.
What are you trying to do, and what problems are you hav... | Sure you can. A normal WPF app is just like WinForms. Consuming WCF services is behaviour that is allowed.
I don't have any samples by hand but simply googeling for standard ClickOnce Deployment should bring give you plenty of tutorials |
3,090,727 | I made a simple webpage with asp.net 3.5
and I wrote a code below
>
> var lines =
> File.ReadAllLines(@"\ad1-sunglim\Share\test.ini");
>
>
>
yes, `ad1-sunglim` is my PC. and that directory has a file, `test.ini`.
and permission to read.
But everytime I try to execute this code, I got `UnauthorizedAccessExcepti... | 2010/06/22 | [
"https://Stackoverflow.com/questions/3090727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278235/"
] | You need to make sure that the user that is running the website (the application pool identity in IIS 7.x) has the correct permissions to the share.
Additionally, as far as I know, you need to use `\\` for UNC paths:
```
@"\\ad1-sunglim\Share\test.ini"
``` | The Winform application worked because it was running under your account, which I assume had access.
If you're using Anonymous Authentication, sites in IIS run under a different account (usually Network Service in II6, IUSER in IIS7), so make sure that account has permission too. |
4,457,569 | I'm working on retrieving the Windows eventlog from a remote machine using Python.
I tried the following code:
```
import win32evtlog
server = 'aRemoteMachineHostName'
logtype = 'System'
hand = win32evtlog.OpenEventLog(server,logtype)
total = win32evtlog.GetNumberOfEventLogRecords(hand)
```
and I get an access ... | 2010/12/16 | [
"https://Stackoverflow.com/questions/4457569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/544239/"
] | Given that `comments_link` and `comments_container` are the respective IDs:
```
$('#comments_link').click(function() {
$('#comments_container').load('some-awesome-url-here');
});
```
This technique uses Ajax to make a request to a URL asynchronously and injects the resulting HTML into the specified element.
Se... | Yes... The technology you need to use is called Ajax. You can do it with jQuery or using the XMLHttpRequest object directly (not recommended).
What server technology are you using. e.g. php, .net, java,... |
4,457,569 | I'm working on retrieving the Windows eventlog from a remote machine using Python.
I tried the following code:
```
import win32evtlog
server = 'aRemoteMachineHostName'
logtype = 'System'
hand = win32evtlog.OpenEventLog(server,logtype)
total = win32evtlog.GetNumberOfEventLogRecords(hand)
```
and I get an access ... | 2010/12/16 | [
"https://Stackoverflow.com/questions/4457569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/544239/"
] | Given that `comments_link` and `comments_container` are the respective IDs:
```
$('#comments_link').click(function() {
$('#comments_container').load('some-awesome-url-here');
});
```
This technique uses Ajax to make a request to a URL asynchronously and injects the resulting HTML into the specified element.
Se... | Yes. Use [jQuery's `load()` function](http://api.jquery.com/load/). |
45,900,523 | I want to connect to old mysql server (Server is 4.0.20-standard) with php7. Upgrade mysql server or downgrade php is not an option.
I'm doing this: `$conn = mysqli_connect($local,$user,$pwd,$db,$port);`
But i'm getting this error: `Warning: mysqli_connect(): Connecting to 3.22, 3.23 & 4.0 is not supported. Server is ... | 2017/08/26 | [
"https://Stackoverflow.com/questions/45900523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4198633/"
] | The mysql native client(mysqlnd) which has been the default mysql driver since php 5.4 does not support old mysql servers, if you still want to connect to old versions of mysql servers, you should use another mysql driver libmysqlclient, which is needed to be compiled with php.
Here is the introductions of these two d... | Solution (**didactic solution**, do not use this on production environment):
Step 1: Install putty.exe + plink.exe in php7 machine. Step 2: I created [these methods](https://github.com/TroniPM/ClassesParaReuso/blob/master/php/php7_connecting_oldmysql.php) to do all the job for you/me. Example1:
```
$query = "SELECT *... |
8,243,681 | I just started playing around with the Twitter Streaming API and using the command line, redirect the raw JSON reponses to a file using the command below:
```
curl https://stream.twitter.com/1/statuses/sample.json -u USER:PASSWORD -o "somefile.txt"
```
Is it possible to stay completely within R and leverage RCurl to... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8243681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/155406/"
] | I was able to figure out the basics, hopefully this helps.
```
#==============================================================================
# Streaming twitter using RCURL
#==============================================================================
library(RCurl)
library(rjson)
# set the directory
setwd("C:\\")... | Try the twitter api package for R.
```
install.packages('twitteR')
library(twitteR)
```
I think this is what you need. |
15,139,109 | Here is the php code
```
<?php
$hostname = "127.0.0.1";
$portno = "5060";
$sock = socket_create(AF_INET, SOCK_STREAM, 0) or die("Socket create error\n");
socket_bind($sock, $hostname, $portno) or die("Socket bind error\n");
socket_listen($sock, 3) or die("Could not set up socket listener\n");
while(1)
{
ech... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15139109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1426157/"
] | I don't believe `socket_listen` can be used with UDP. From the [manual](http://php.net/manual/en/function.socket-listen.php):
>
> socket\_listen() is applicable only to sockets of type SOCK\_STREAM or SOCK\_SEQPACKET.
>
>
> | You don't need socket\_listen().
Use `socket_recvfrom()`
<http://php.net/manual/en/function.socket-recvfrom.php> |
234,632 | I have a custom module installed which displays a form at user/UID/apps/add. So, what this form does is lets user add node/nodes of "x" content type he/she wants in their app.
Form is created using this function-
*function devconnect\_developer\_apps\_edit\_form(array $form, array &$form\_state, stdClass $account, $a... | 2017/04/21 | [
"https://drupal.stackexchange.com/questions/234632",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/75025/"
] | The third argument to your form is $account, and it doesn't have a default argument. You aren't passing that block in your argument, which is why it is crashing. | Rightly pointed, Thanks
For any other noobs like me out there-
```
'page arguments' => array('devconnect_developer_apps_edit_form', $user, NULL),
``` |
57,645 | The sky is overcast so there is no sunshine, and you want to ask someone if they could feel sunshine which isn't present. Do I still need to add "the" with sunshine?
1. Can you feel sunshine?
2. Can you feel the sunshine? | 2015/05/25 | [
"https://ell.stackexchange.com/questions/57645",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/16246/"
] | In the context of your question, the first choice is probably better. Your first sentence, without "the", implies that the speaker may or may not feel sunshine, and is in a sense asking for confirmation. The second sentence, with "the" implies that the speak *does* feel the sunshine, and is asking if the other person c... | Once when I was a child, there were tornadoes in our area, and we were in our basement. At some point, the sun came out, and I said that I saw sunshine. Not *the* sunshine, but sunshine; the sunshine that was shining through our basement window.
Leaving out *the* implies a quantity of sunshine, sunshine as applied in ... |
57,645 | The sky is overcast so there is no sunshine, and you want to ask someone if they could feel sunshine which isn't present. Do I still need to add "the" with sunshine?
1. Can you feel sunshine?
2. Can you feel the sunshine? | 2015/05/25 | [
"https://ell.stackexchange.com/questions/57645",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/16246/"
] | In the context of your question, the first choice is probably better. Your first sentence, without "the", implies that the speaker may or may not feel sunshine, and is in a sense asking for confirmation. The second sentence, with "the" implies that the speak *does* feel the sunshine, and is asking if the other person c... | It's difficult to imagine someone asking your questions naturally without the help of clarifying body language or tone. To avoid confusion, you could ask:
3. Do you feel any sunshine? |
512,259 | What is the AC voltage gain in the following common emitter BJT amplifier? We are also given that for the BJT \$\beta\_{DC} = \beta\_{ac} = 150\$.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fUwVFU.png) – Schematic created using [... | 2020/07/25 | [
"https://electronics.stackexchange.com/questions/512259",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/236051/"
] | Overview
========
The left and right side schematics below are entirely equivalent to each other (within numerical truncation errors):

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f5NyIO.png) – Schematic created using [CircuitLab]... | The answer is 92.3 as revealed in the comments.
In particular, the mistake is due to not accounting for the effect of \$R\_E\$ on \$R\_2\$ in the voltage divider. This yields a lower \$V\_B\$ of \$1.47V\$. The same steps as in the question then yield the correct gain factor. |
512,259 | What is the AC voltage gain in the following common emitter BJT amplifier? We are also given that for the BJT \$\beta\_{DC} = \beta\_{ac} = 150\$.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fUwVFU.png) – Schematic created using [... | 2020/07/25 | [
"https://electronics.stackexchange.com/questions/512259",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/236051/"
] | The answer is 92.3 as revealed in the comments.
In particular, the mistake is due to not accounting for the effect of \$R\_E\$ on \$R\_2\$ in the voltage divider. This yields a lower \$V\_B\$ of \$1.47V\$. The same steps as in the question then yield the correct gain factor. | Another way.
Considering the Re emitter resistance amplified by hFE to the base 150\*100=15k across the 3.3K which becomes 2.7k
$$V\_B = 8\frac{2.7}{2.7 + 12} = 1.47V$$
$$ V\_E = V\_B - 0.7V = 0.77V $$
$$ I\_E = 770mV/100 ohm= 7.7mA$$
$$ r\_e = \frac{25mV}{7.7mA} = 3.25\Omega$$
$$ A\_v = \frac{R\_C}{r\_e} = 300/3.25=... |
512,259 | What is the AC voltage gain in the following common emitter BJT amplifier? We are also given that for the BJT \$\beta\_{DC} = \beta\_{ac} = 150\$.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fUwVFU.png) – Schematic created using [... | 2020/07/25 | [
"https://electronics.stackexchange.com/questions/512259",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/236051/"
] | Overview
========
The left and right side schematics below are entirely equivalent to each other (within numerical truncation errors):

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f5NyIO.png) – Schematic created using [CircuitLab]... | Another way.
Considering the Re emitter resistance amplified by hFE to the base 150\*100=15k across the 3.3K which becomes 2.7k
$$V\_B = 8\frac{2.7}{2.7 + 12} = 1.47V$$
$$ V\_E = V\_B - 0.7V = 0.77V $$
$$ I\_E = 770mV/100 ohm= 7.7mA$$
$$ r\_e = \frac{25mV}{7.7mA} = 3.25\Omega$$
$$ A\_v = \frac{R\_C}{r\_e} = 300/3.25=... |
57,641,981 | I use the repository pattern in lumen together with Query Builder. The repository classes look generally like this:
```
<?php
namespace App\Repositories;
use Illuminate\Support\Facades\DB;
class RepoNameRepository {
public function methodName() {
/*
Various Calls to the DB facade...
$dat... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57641981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | No, this is how PHP works.
Your alternatives are to use the alias:
```php
use DB;
```
Or prefix your calls with a backslash so it looks in the root namespace.
```php
\DB::table('users');
``` | You can use the `app()` helper function with the `'db'` [service container binding key](https://laravel.com/docs/5.8/facades#facade-class-reference):
```php
$data = app('db')->table('tableName')...->get();
```
It doesn't require any `use` statement. |
9,747,015 | I'm adding two subviews, which are stored by properties, to my view. When adding the subviews to my view the subViews are seemingly deallocated after my `setup` method is called. The end result is that the views never get displayed. Now, if I change my properties to `strong` as opposed to `weak` I retain a reference to... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9747015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1125429/"
] | Weak shouldn't be used unless in cases where a parent-child retain cycle is formed (the parent keeps a reference to the child, the child keeps a reference to the parent, so neither is dealloc'd). Strong is the ARC equivalent of retain (now invalid under ARC), and keeps a nice stable pointer to the object for a much lon... | Try using this instead:
```
@property (nonatomic, retain)
``` |
9,747,015 | I'm adding two subviews, which are stored by properties, to my view. When adding the subviews to my view the subViews are seemingly deallocated after my `setup` method is called. The end result is that the views never get displayed. Now, if I change my properties to `strong` as opposed to `weak` I retain a reference to... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9747015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1125429/"
] | Here's a line of your code:
```
self.horizontalLineView = [[HorizontalLineView alloc] initWithFrame:self.frame];
```
Recall that the `horizontalLineView` property is weak. Let's walk through what really happens in that line, with the extra code that ARC generates. First, you send the `alloc` and `initWithFrame:` met... | Weak shouldn't be used unless in cases where a parent-child retain cycle is formed (the parent keeps a reference to the child, the child keeps a reference to the parent, so neither is dealloc'd). Strong is the ARC equivalent of retain (now invalid under ARC), and keeps a nice stable pointer to the object for a much lon... |
9,747,015 | I'm adding two subviews, which are stored by properties, to my view. When adding the subviews to my view the subViews are seemingly deallocated after my `setup` method is called. The end result is that the views never get displayed. Now, if I change my properties to `strong` as opposed to `weak` I retain a reference to... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9747015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1125429/"
] | Here's a line of your code:
```
self.horizontalLineView = [[HorizontalLineView alloc] initWithFrame:self.frame];
```
Recall that the `horizontalLineView` property is weak. Let's walk through what really happens in that line, with the extra code that ARC generates. First, you send the `alloc` and `initWithFrame:` met... | Try using this instead:
```
@property (nonatomic, retain)
``` |
35,522,810 | Newbie need some help on first Shiny App.
I want to filter several countrys and draw an simple line chart depend on that. But I'm getting error: "Error in eval: incorrect length (0), expecting: 110 Stack trace (innermost first)"
Here is code. Thanks for your help :)
ui.r
====
```
> shinyUI(fluidPage(
> titlePane... | 2016/02/20 | [
"https://Stackoverflow.com/questions/35522810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5953442/"
] | Here is some [helpful documentation](https://meteorhacks.com/subscription-manager-for-iron-router/) on managing subscriptions for Iron Router.
I'm pretty sure your `findOne()` is returning `undefined` at this point, which means your findOne().title is going to throw an exception. You'll want to use `waitOn()` to get y... | Thanks to Stephen Woods I found that my initial code printed both the exception and the title just because of reactivity. And everything I had to do is wait for subscriptions from iron:router.
```
Router.route('/news/:_id', function() {
this.render('l_basic');
console.log (newsCollection.findOne().title);
}, {... |
270,965 | What are the differences between Public URL: Internet, Custom and External when configuring Alternate Access Mappings in SharePoint 2019? | 2019/10/18 | [
"https://sharepoint.stackexchange.com/questions/270965",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/85511/"
] | These zones, and their labels, are just labels. There is [no functional difference](https://social.technet.microsoft.com/Forums/sharepoint/en-US/cb58994e-c4c2-4a84-9e53-da3cdf544fed/difference-between-internet-and-extranet-zones) between the five
Zone is a label representing a Public URL, the zone is used to ‘connect’... | The answer above is correct but let me explain it to you in a much simpler way .
The public URL is basically the URL that a user sees when he gets a hit to the site.
For example -
If your default URL is
>
> <http://example.sharepoint.com>
>
>
>
and you have made changes in the Alternate access mappings to poin... |
388,340 | I'm using this code for a table and I've successfully added a footnote to it. However, when I want to adjust the table to fit in the paper using {Adjustbox} (commented lines that are lines 18 and 179) it gives me this error:
```
Missing \endgroup inserted.
```
I appreciate your help to find a way to adjust this tabl... | 2017/08/26 | [
"https://tex.stackexchange.com/questions/388340",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/141580/"
] | I'd recommend using the `matlab-prettifier` package (see <https://tex.stackexchange.com/a/158816/586>), which is really just provides a style for the `listings` package. This will give you good highlighting of Matlab code, while still enabling you to use the built-in stuff in LyX related to code listings (if you so des... | How about
```
\usepackage{listings}
...
\lstinputlisting[language=Matlab]{//--PATH--//YourNameHere.m}
```
However I would rather use:
```
\begin{lstlisting}
[
language=Matlab
,caption={CAPTION}
,label=LABEL]
%%%%% COPY CODE HERE %%%%%
\end{lstlisting}
``` |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | Forget using `plt.title` and place the text directly with `plt.text`. An over-exaggerated example is given below:
```
import pylab as plt
fig = plt.figure(figsize=(5,10))
figure_title = "Normal title"
ax1 = plt.subplot(1,2,1)
plt.title(figure_title, fontsize = 20)
plt.plot([1,2,3],[1,4,9])
figure_title = "Raised ... | Using the `plt.tight_layout()` before the `plt.show()` works for me well.
you can even make it better and visible by adding a padding
```
ax.set_title("title", pad=15)
``` |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | Forget using `plt.title` and place the text directly with `plt.text`. An over-exaggerated example is given below:
```
import pylab as plt
fig = plt.figure(figsize=(5,10))
figure_title = "Normal title"
ax1 = plt.subplot(1,2,1)
plt.title(figure_title, fontsize = 20)
plt.plot([1,2,3],[1,4,9])
figure_title = "Raised ... | I was having an issue with the x-label overlapping a subplot title; this worked for me:
```
import matplotlib.pyplot as plt
fig, ax = plt.subplots(2, 1)
ax[0].scatter(...)
ax[1].scatter(...)
plt.tight_layout()
.
.
.
plt.show()
```
before
======
[](... |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | I was having an issue with the x-label overlapping a subplot title; this worked for me:
```
import matplotlib.pyplot as plt
fig, ax = plt.subplots(2, 1)
ax[0].scatter(...)
ax[1].scatter(...)
plt.tight_layout()
.
.
.
plt.show()
```
before
======
[](... | Using the `plt.tight_layout()` before the `plt.show()` works for me well.
you can even make it better and visible by adding a padding
```
ax.set_title("title", pad=15)
``` |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | I'm not sure whether it is a new feature in later versions of matplotlib, but at least for 1.3.1, this is simply:
```
plt.title(figure_title, y=1.08)
```
This also works for `plt.suptitle()`, but not (yet) for `plt.xlabel()`, etc. | Forget using `plt.title` and place the text directly with `plt.text`. An over-exaggerated example is given below:
```
import pylab as plt
fig = plt.figure(figsize=(5,10))
figure_title = "Normal title"
ax1 = plt.subplot(1,2,1)
plt.title(figure_title, fontsize = 20)
plt.plot([1,2,3],[1,4,9])
figure_title = "Raised ... |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | I'm not sure whether it is a new feature in later versions of matplotlib, but at least for 1.3.1, this is simply:
```
plt.title(figure_title, y=1.08)
```
This also works for `plt.suptitle()`, but not (yet) for `plt.xlabel()`, etc. | You can use pad for this case:
```
ax.set_title("whatever", pad=20)
``` |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | Forget using `plt.title` and place the text directly with `plt.text`. An over-exaggerated example is given below:
```
import pylab as plt
fig = plt.figure(figsize=(5,10))
figure_title = "Normal title"
ax1 = plt.subplot(1,2,1)
plt.title(figure_title, fontsize = 20)
plt.plot([1,2,3],[1,4,9])
figure_title = "Raised ... | Just use `plt.tight_layout()` before `plt.show()`. It works well. |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | You can use pad for this case:
```
ax.set_title("whatever", pad=20)
``` | A temporary solution if you don't want to get into the `x`, `y` position of your title.
Following worked for me.
```
plt.title('Capital Expenditure\n') # Add a next line after your title
```
kudos. |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | I was having an issue with the x-label overlapping a subplot title; this worked for me:
```
import matplotlib.pyplot as plt
fig, ax = plt.subplots(2, 1)
ax[0].scatter(...)
ax[1].scatter(...)
plt.tight_layout()
.
.
.
plt.show()
```
before
======
[](... | Just use `plt.tight_layout()` before `plt.show()`. It works well. |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | Forget using `plt.title` and place the text directly with `plt.text`. An over-exaggerated example is given below:
```
import pylab as plt
fig = plt.figure(figsize=(5,10))
figure_title = "Normal title"
ax1 = plt.subplot(1,2,1)
plt.title(figure_title, fontsize = 20)
plt.plot([1,2,3],[1,4,9])
figure_title = "Raised ... | ```
ax.set_title('My Title\n', fontsize="15", color="red")
plt.imshow(myfile, origin="upper")
```
If you put `'\n'` right after your title string, the plot is drawn just below the title. That might be a fast solution too. |
12,750,355 | I am trying to plot two separate quantities on the same graph using twiny as follows:
```
fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, 'b-', T, R, 'r-', T, r_geo, 'g-')
ax.set_yscale('log')
ax.annotate('Approx. sea level', xy=(Planet.T_day*1.3,(Planet.R)/1000), xytext=(Planet.T_day*1.3, Planet.R/1000))
ax.an... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1206928/"
] | You can use pad for this case:
```
ax.set_title("whatever", pad=20)
``` | Just use `plt.tight_layout()` before `plt.show()`. It works well. |
64,581,003 | Another issue with perl script. This script creates socket,accept incoming connection and save data from socket to a file. I use netcat:
```
netcat 127.0.0.1 6000 <my_data.txt
```
But maybe I will be forced to write a perl script with client :/ Is it possible?
Is this method done properly? When I execute the scipt ... | 2020/10/28 | [
"https://Stackoverflow.com/questions/64581003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It is not clear why OP stores configuration in JSON file.
Please investigate the following code sample which uses Config::General module to read configuration file.
Point your web browser to [http://localhost:8080](http://localhost:8080/) and read some html header data in `socket_data.txt` file.
```
use strict;
use ... | ```
$my_data=$data->{'my_data'};
...
open(DATA, ">$my_data");
...
print $my_data "$data\n";
```
This should likely be `print DATA "$data\n";` in the last line since you want to write to the opened file handle. |
3,853,901 | I'm looking for a simpler test framework. I had a look at a few PHPUnit and SimpleTest scripts and I find the required syntactic sugar appalling. SnapTest sounded nice, but was as cumbersome. Apache More::Test was too procedural, even for my taste. And Symfony lime-test was ununique in that regard.
BDD tools like <http... | 2010/10/04 | [
"https://Stackoverflow.com/questions/3853901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/345031/"
] | For the record, I've now discovered **Shinpuru**.
<http://arkanis.de/projects/shinpuru/>
Which looks promising for real world test cases, and uses PHP5.3-style anonymous functions instead of introspection-class wrappers. | Have to say - it isn't obvious how your example of a simplified test case would be possible to implement. Unfortunately the *convolutedness* is - more or less - something that has to be lived with. That said, I've seen cases where PHPUnit is extended to simplify things, as well as adding web test runners, tests for hea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.