qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | There's a whole algebra ("Geometric Algebra", or Clifford algebra) behind the concept of multiplying vectors. Look there to find out where the handedness comes from, why $ \cos \theta $ for $a \cdot b$ but $\sin \theta$ for $a \times b$, and many other gems. [Here](http://faculty.luther.edu/~macdonal/GA&GC.pdf)'s a gre... | The real reason is because it is convention to use a right-handed coordinate system. If you switched to a left-handed coordinate system for some reason (I'm not sure why), then you would need to do your cross-products using a left-hand rule to get the same answers. That's really as simple as it gets. It's a result of o... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | As far as $\sin \theta$ and $\cos \theta$ are concerned,
Using the law of cosines,
\begin{align}
\|\overrightarrow{v\_2}\|^2 + \|\overrightarrow{v\_1}\|^2
-2\|\overrightarrow{v\_2}\| \, \|\overrightarrow{v\_1}\| \cos \theta
&= \|\overrightarrow{v\_2} - \overrightarrow{v\_1}\|^2
\\
2x\_1 x\_2 + 2y\_1 y\_2 + 2z\_1... | As a complement to Bye\_World's illuminating answer, which defines $b \times\ c$ as the vector whose dot product with $a$ equals $\det(a, b, c)$, $\|b\|\|c\|\sin(\theta)$ is the surface of the parallelogram formed by vectors $b$ and $c$. If $a$ is a unit vector orthogonal to the $b$-and-$c$ plane, then $\det(a, b, c)$,... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | As far as $\sin \theta$ and $\cos \theta$ are concerned,
Using the law of cosines,
\begin{align}
\|\overrightarrow{v\_2}\|^2 + \|\overrightarrow{v\_1}\|^2
-2\|\overrightarrow{v\_2}\| \, \|\overrightarrow{v\_1}\| \cos \theta
&= \|\overrightarrow{v\_2} - \overrightarrow{v\_1}\|^2
\\
2x\_1 x\_2 + 2y\_1 y\_2 + 2z\_1... | The real reason is because it is convention to use a right-handed coordinate system. If you switched to a left-handed coordinate system for some reason (I'm not sure why), then you would need to do your cross-products using a left-hand rule to get the same answers. That's really as simple as it gets. It's a result of o... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | The cross product originally came from the *quaternions*, which extend the complex numbers with two other 'imaginary units' $j$ and $k$, that have noncommutative multiplication (i.e. you can have $uv \neq vu$), but satisfy the relations
$$ i^2 = j^2 = k^2 = ijk = -1 $$
AFAIK, this is the exact form that Hamilton orig... | This may be a bit too deep but let $V$ be a finite dimensional vector space with basis $v\_1,...,v\_n$. We say $(v\_1,...,v\_n)$ is an oriented basis for $V$. We can define an equivalence class on orientations of $V$ by $[v\_1,...,v\_n] \sim [b\_1,...,b\_n] \iff [v\_1,...,v\_n] = A[b\_1,...,b\_n]$ (where $A$ is the tra... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | The cross product originally came from the *quaternions*, which extend the complex numbers with two other 'imaginary units' $j$ and $k$, that have noncommutative multiplication (i.e. you can have $uv \neq vu$), but satisfy the relations
$$ i^2 = j^2 = k^2 = ijk = -1 $$
AFAIK, this is the exact form that Hamilton orig... | the Gibbs Vector Algebra Cross Product Right Hand Rule is a Convention
Any description of the (nominally) Euclidean 3 dimensional world we perceive runs into Chirality, the distinction between Right and Left handedness, the difference in a Mirror Reflection.
<https://en.wikipedia.org/wiki/Chirality>
A Mathematical S... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | I have answers for your question. If it was defined relative to the left-hand rule, you'd currently be asking why not the right-hand rule. It's how we deal with ambiguity: by establishing conventions. Depending on how you choose the definition of cross product, the result could be one of two different vectors. This led... | The real reason is because it is convention to use a right-handed coordinate system. If you switched to a left-handed coordinate system for some reason (I'm not sure why), then you would need to do your cross-products using a left-hand rule to get the same answers. That's really as simple as it gets. It's a result of o... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | The cross product doesn't actually follow any such rule. It is defined arithmetically as a determinant:
$$\mathbf{u\times v} = \begin{vmatrix}
\mathbf{i}&\mathbf{j}&\mathbf{k}\\
u\_1&u\_2&u\_3\\
v\_1&v\_2&v\_3\\
\end{vmatrix}$$
There is no hand rule there. The right hand rule comes from the conventions about how w... | The real reason is because it is convention to use a right-handed coordinate system. If you switched to a left-handed coordinate system for some reason (I'm not sure why), then you would need to do your cross-products using a left-hand rule to get the same answers. That's really as simple as it gets. It's a result of o... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | If the right hand rule seems too arbitrary to you, use a definition of the cross product that doesn't make use of it (explicitly). Here's one way to construct the cross product:
Recall that the (signed) volume of a [parallelepiped](https://en.wikipedia.org/wiki/Parallelepiped) in $\Bbb R^3$ with sides $a, b, c$ is giv... | There's a whole algebra ("Geometric Algebra", or Clifford algebra) behind the concept of multiplying vectors. Look there to find out where the handedness comes from, why $ \cos \theta $ for $a \cdot b$ but $\sin \theta$ for $a \times b$, and many other gems. [Here](http://faculty.luther.edu/~macdonal/GA&GC.pdf)'s a gre... |
1,941,044 | >
> $\mathbf{a}\times \mathbf{b}$ follows the right hand rule? Why not left hand rule? Why is it $a b \sin (x)$ times the perpendicular vector? Why is $\sin (x)$ used with the vectors but $\cos(x)$ is a scalar product?
>
>
>
So why is cross product defined in the way that it is?
I am mainly interested in the right... | 2016/09/25 | [
"https://math.stackexchange.com/questions/1941044",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363952/"
] | the Gibbs Vector Algebra Cross Product Right Hand Rule is a Convention
Any description of the (nominally) Euclidean 3 dimensional world we perceive runs into Chirality, the distinction between Right and Left handedness, the difference in a Mirror Reflection.
<https://en.wikipedia.org/wiki/Chirality>
A Mathematical S... | As a complement to Bye\_World's illuminating answer, which defines $b \times\ c$ as the vector whose dot product with $a$ equals $\det(a, b, c)$, $\|b\|\|c\|\sin(\theta)$ is the surface of the parallelogram formed by vectors $b$ and $c$. If $a$ is a unit vector orthogonal to the $b$-and-$c$ plane, then $\det(a, b, c)$,... |
2,198,408 | This question was on a test in my cryptography class a couple weeks ago and I haven't been able to figure out a good proof. A hint was given with the question: all natural numbers have unique prime factors.
Here's an example showing it's true for $P = 11$
$a = 1, b = 1, ab \equiv 1 \pmod P$
$a = 2, b = 6, ab \equiv... | 2017/03/22 | [
"https://math.stackexchange.com/questions/2198408",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/428264/"
] | Let $S = \{1,2, \dots, p-1\}$ Fix $a \in S$ and consider the function $m\_a: S -> S$ which sends $k \mapsto k\cdot a \pmod p$
We claim that $m\_a$ is injective. Note that if $m\_a(k\_1)=m\_a(k\_2)$ we have $a\cdot k\_1 \equiv a \cdot k\_2 \pmod p $ so $a \cdot (k\_1 - k\_2) \equiv 0 \pmod p$ This means that the product... | Lets see that, take $a$ in $S $ then as $p $ is prime $(a,p)=1$. Then there exists integers $r,s $ such that $ar+ps=1$ this implies $ps=1-ar $ then $p| 1-ar $ and this is the definition of $1 \equiv ar \pmod p $ and then the b you are looking for is the r we used. This shows such b exists and tells how can you find it.... |
2,198,408 | This question was on a test in my cryptography class a couple weeks ago and I haven't been able to figure out a good proof. A hint was given with the question: all natural numbers have unique prime factors.
Here's an example showing it's true for $P = 11$
$a = 1, b = 1, ab \equiv 1 \pmod P$
$a = 2, b = 6, ab \equiv... | 2017/03/22 | [
"https://math.stackexchange.com/questions/2198408",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/428264/"
] | It's easy to check that the values of $f(x)=ax$ are distinct for $x \in \{0,...,p-1\}$
So there is a unique $b$ with the property $f(b)=1$. | Lets see that, take $a$ in $S $ then as $p $ is prime $(a,p)=1$. Then there exists integers $r,s $ such that $ar+ps=1$ this implies $ps=1-ar $ then $p| 1-ar $ and this is the definition of $1 \equiv ar \pmod p $ and then the b you are looking for is the r we used. This shows such b exists and tells how can you find it.... |
37,623,430 | I managed to configure and schedule a Quartz job using JobStoreTX persistent store in Spring Boot ( version 4.2.5 ). Here is how I schedule the job.
First :
```
public class MyJob implements Job{
@Autowired
IService service;
@Override
public void execute(JobExecutionContext context) throws JobExec... | 2016/06/03 | [
"https://Stackoverflow.com/questions/37623430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5227664/"
] | I have experienced the same problem in past. My understanding on this issue is that beans instantiated in spring context cannot be injected in quartz context simply by using `@Autowired` annotation.
I managed to solve it by using setter based dependency injection. But the same is mentioned in the "LINK" you have added... | We can use JobDataMap to pass the objects.
example: here restTemplate is Autowired.
```
JobDataMap newJobDataMap = new JobDataMap();
newJobDataMap.put("restTemplate", restTemplate);
JobDetail someJobDetail = JobBuilder
.newJob(QuartzJob.class)
.withIdentity(jobName, GROUP)
.usingJobData(newJobDataMap)
.build();
``` |
37,623,430 | I managed to configure and schedule a Quartz job using JobStoreTX persistent store in Spring Boot ( version 4.2.5 ). Here is how I schedule the job.
First :
```
public class MyJob implements Job{
@Autowired
IService service;
@Override
public void execute(JobExecutionContext context) throws JobExec... | 2016/06/03 | [
"https://Stackoverflow.com/questions/37623430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5227664/"
] | I fix my problem implementing "InitializingBean" in my job;
```
public class MyJob extends QuartzJobBean implements InitializingBean {
private String someParam;
private int someParam2;
public void setSomeParam(String someParam) {
this.someParam = someParam;
}
... | We can use JobDataMap to pass the objects.
example: here restTemplate is Autowired.
```
JobDataMap newJobDataMap = new JobDataMap();
newJobDataMap.put("restTemplate", restTemplate);
JobDetail someJobDetail = JobBuilder
.newJob(QuartzJob.class)
.withIdentity(jobName, GROUP)
.usingJobData(newJobDataMap)
.build();
``` |
37,623,430 | I managed to configure and schedule a Quartz job using JobStoreTX persistent store in Spring Boot ( version 4.2.5 ). Here is how I schedule the job.
First :
```
public class MyJob implements Job{
@Autowired
IService service;
@Override
public void execute(JobExecutionContext context) throws JobExec... | 2016/06/03 | [
"https://Stackoverflow.com/questions/37623430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5227664/"
] | The correct way from the most of the examples I've seen is to make your Job interface implementation a @Component
```
@Component
public class MyJob implements Job{
@Autowired IService service;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException{
service.... | We can use JobDataMap to pass the objects.
example: here restTemplate is Autowired.
```
JobDataMap newJobDataMap = new JobDataMap();
newJobDataMap.put("restTemplate", restTemplate);
JobDetail someJobDetail = JobBuilder
.newJob(QuartzJob.class)
.withIdentity(jobName, GROUP)
.usingJobData(newJobDataMap)
.build();
``` |
949,361 | I have a Cocoa app with an `NSTextView` control which holds its text in an `NSAttributedString` (actually I believe it's a `NSMutableAttributedString`). I can easily set and modify different text attributes (such as font, underline, etc.) on different character ranges inside that string.
However, I want to set a part ... | 2009/06/04 | [
"https://Stackoverflow.com/questions/949361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/884/"
] | The supported attributes for NSAttributedString are listed in AppKit's NSAttributedString.h header. There's no key like 'hidden' or 'visible'. The attributes (styles) are not derived from html and cannot express all css features.
Nevertheless, to hide a range of characters you can set the foreground color to transpare... | As far as I know there are no invisible type attributes for NSAttributedString, however you could create a subclass of NSAttributedString (or the Mutable version, but that might not be necessary) that overrides the drawInRect: to avoid drawing the portion of the text that has your attribute.
But this could be a little... |
949,361 | I have a Cocoa app with an `NSTextView` control which holds its text in an `NSAttributedString` (actually I believe it's a `NSMutableAttributedString`). I can easily set and modify different text attributes (such as font, underline, etc.) on different character ranges inside that string.
However, I want to set a part ... | 2009/06/04 | [
"https://Stackoverflow.com/questions/949361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/884/"
] | Another possibility would be to use a custom attribute on the text you want to hide, and then write your own method in a category on `NSAttributedString` that creates a new attributed string that excludes the text marked as hidden.
```
- (NSAttributedString *)attributedStringWithoutHiddenText {
NSMutableAttribute... | As far as I know there are no invisible type attributes for NSAttributedString, however you could create a subclass of NSAttributedString (or the Mutable version, but that might not be necessary) that overrides the drawInRect: to avoid drawing the portion of the text that has your attribute.
But this could be a little... |
949,361 | I have a Cocoa app with an `NSTextView` control which holds its text in an `NSAttributedString` (actually I believe it's a `NSMutableAttributedString`). I can easily set and modify different text attributes (such as font, underline, etc.) on different character ranges inside that string.
However, I want to set a part ... | 2009/06/04 | [
"https://Stackoverflow.com/questions/949361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/884/"
] | A simple option is to set the font size of the hidden text to 0 | As far as I know there are no invisible type attributes for NSAttributedString, however you could create a subclass of NSAttributedString (or the Mutable version, but that might not be necessary) that overrides the drawInRect: to avoid drawing the portion of the text that has your attribute.
But this could be a little... |
949,361 | I have a Cocoa app with an `NSTextView` control which holds its text in an `NSAttributedString` (actually I believe it's a `NSMutableAttributedString`). I can easily set and modify different text attributes (such as font, underline, etc.) on different character ranges inside that string.
However, I want to set a part ... | 2009/06/04 | [
"https://Stackoverflow.com/questions/949361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/884/"
] | The supported attributes for NSAttributedString are listed in AppKit's NSAttributedString.h header. There's no key like 'hidden' or 'visible'. The attributes (styles) are not derived from html and cannot express all css features.
Nevertheless, to hide a range of characters you can set the foreground color to transpare... | I realize this is a very old thread, but the other other option is to do custom glyph rendering. There was a session about advanced text handling techniques at WWDC 2010 that covered code folding. This uses a similar technique to what you'll need to do with this and that is to examine the text as its being lain out and... |
949,361 | I have a Cocoa app with an `NSTextView` control which holds its text in an `NSAttributedString` (actually I believe it's a `NSMutableAttributedString`). I can easily set and modify different text attributes (such as font, underline, etc.) on different character ranges inside that string.
However, I want to set a part ... | 2009/06/04 | [
"https://Stackoverflow.com/questions/949361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/884/"
] | Another possibility would be to use a custom attribute on the text you want to hide, and then write your own method in a category on `NSAttributedString` that creates a new attributed string that excludes the text marked as hidden.
```
- (NSAttributedString *)attributedStringWithoutHiddenText {
NSMutableAttribute... | I realize this is a very old thread, but the other other option is to do custom glyph rendering. There was a session about advanced text handling techniques at WWDC 2010 that covered code folding. This uses a similar technique to what you'll need to do with this and that is to examine the text as its being lain out and... |
949,361 | I have a Cocoa app with an `NSTextView` control which holds its text in an `NSAttributedString` (actually I believe it's a `NSMutableAttributedString`). I can easily set and modify different text attributes (such as font, underline, etc.) on different character ranges inside that string.
However, I want to set a part ... | 2009/06/04 | [
"https://Stackoverflow.com/questions/949361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/884/"
] | A simple option is to set the font size of the hidden text to 0 | I realize this is a very old thread, but the other other option is to do custom glyph rendering. There was a session about advanced text handling techniques at WWDC 2010 that covered code folding. This uses a similar technique to what you'll need to do with this and that is to examine the text as its being lain out and... |
7,109,180 | I have been using java mail to automate Gmail operations.
One of the operation is to delete mail and I use following for it -
```
message.setFlag(Flags.Flag.DELETED, true);
```
but doing so only pushes my mails to spam folder.
I am wondering if there is a straight way to delete mail permanently instead of deleting ... | 2011/08/18 | [
"https://Stackoverflow.com/questions/7109180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/270835/"
] | According to <http://mail.google.com/support/bin/answer.py?answer=78755>:
>
> If you want to delete a message from all folders, move it to the [Gmail]/Trash folder.
>
>
> If you delete a message from [Gmail]/Spam or [Gmail]/Trash, it will be deleted permanently.
>
>
>
However, that page doesn't give any indicat... | You told that you are trying
```
message.setFlag(Flags.Flag.DELETED, true);
```
did you tried
`folder.close(true);`
this will expunge all messages with DELETED flags. |
7,109,180 | I have been using java mail to automate Gmail operations.
One of the operation is to delete mail and I use following for it -
```
message.setFlag(Flags.Flag.DELETED, true);
```
but doing so only pushes my mails to spam folder.
I am wondering if there is a straight way to delete mail permanently instead of deleting ... | 2011/08/18 | [
"https://Stackoverflow.com/questions/7109180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/270835/"
] | According to <http://mail.google.com/support/bin/answer.py?answer=78755>:
>
> If you want to delete a message from all folders, move it to the [Gmail]/Trash folder.
>
>
> If you delete a message from [Gmail]/Spam or [Gmail]/Trash, it will be deleted permanently.
>
>
>
However, that page doesn't give any indicat... | Setting the flag to Flags.Flag.DELETED only marks the email as deleted.
You need to call
folder.expunge();
to actually expunge those emails marked as deleted. |
7,109,180 | I have been using java mail to automate Gmail operations.
One of the operation is to delete mail and I use following for it -
```
message.setFlag(Flags.Flag.DELETED, true);
```
but doing so only pushes my mails to spam folder.
I am wondering if there is a straight way to delete mail permanently instead of deleting ... | 2011/08/18 | [
"https://Stackoverflow.com/questions/7109180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/270835/"
] | You told that you are trying
```
message.setFlag(Flags.Flag.DELETED, true);
```
did you tried
`folder.close(true);`
this will expunge all messages with DELETED flags. | Setting the flag to Flags.Flag.DELETED only marks the email as deleted.
You need to call
folder.expunge();
to actually expunge those emails marked as deleted. |
74,128,913 | ```
function isPrime(num) {
let result = true;
if (num < 2) {
result = false;
return result;
}
for (let i = 2; i < num; i++) {
if (num % i === 0) {
result = false;
break;
}
}
return result;
}
```
I am trying to find whether a given number is prime or not, why is my code not e... | 2022/10/19 | [
"https://Stackoverflow.com/questions/74128913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12730690/"
] | §6.7.6.3p5 "Function declarators (including prototypes) > Semantics":
>
> If, in the declaration "**T D1**", **D1** has the form
>
>
>
> >
> > **D** **(** *parameter-type-list* **)**
> >
> >
> >
>
>
> or
>
>
>
> >
> > **D** **(** *identifier-list*opt **)**
> >
> >
> >
>
>
> and the type specified fo... | Undefined behavior?
>
> **6.7.3 Type qualifiers**
>
> ...
>
>
> 9 If the specification of an array type includes any type qualifiers, the element type is so qualified, not the array type. ***If the specification of a function type includes any type
> qualifiers, the behavior is undefined.***136)
>
Or am I ma... |
1,289,711 | Given $A\in M\_{n \times n}(\mathbb{F})$ and $p\_{A}(x)=\det(xI-A)$ why saying that $\det(AI-A)=0$ is not valid? | 2015/05/19 | [
"https://math.stackexchange.com/questions/1289711",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/222832/"
] | It's not valid because in the expression $xI$, the hidden operation is scalar multiplication, i.e., multiplication of the identity matrix by the constant real value $x$. In the expression $AI$, the hidden operation is matrix multiply, which is in general different from scalar multiply.
There's a real subtlety here: t... | It's not valid because Cayley Hamilton says that $p\_A(A)=0$ where 0 is the zero matrix, but in your argument you have a zero scalar. |
117,996 | There are many web application vulnerabilities out there, such as XSS, CSRF, and etc, and there are many resources which explain them very well. But I want to find about their history, for example, who was the first to discover them **[Surely, it wasn't a single person]**, and when they were first discovered **[Surely,... | 2016/03/19 | [
"https://security.stackexchange.com/questions/117996",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/94890/"
] | You can
* [search the CVE list](https://cve.mitre.org/cve/cve.html) for keywords or specific CVEs and
* [search the NVD of the NIST](https://web.nvd.nist.gov/view/vuln/search).
Those two links should be fine to answer questions you might have about individual vulnerabilities - not only constrained to web application... | [CVE Details](http://www.cvedetails.com/) is a great site listing vulnerabilities narrowed down to manufacture, product and version.
In addition it also shows the published dates in any results, which is very useful. |
117,996 | There are many web application vulnerabilities out there, such as XSS, CSRF, and etc, and there are many resources which explain them very well. But I want to find about their history, for example, who was the first to discover them **[Surely, it wasn't a single person]**, and when they were first discovered **[Surely,... | 2016/03/19 | [
"https://security.stackexchange.com/questions/117996",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/94890/"
] | You can
* [search the CVE list](https://cve.mitre.org/cve/cve.html) for keywords or specific CVEs and
* [search the NVD of the NIST](https://web.nvd.nist.gov/view/vuln/search).
Those two links should be fine to answer questions you might have about individual vulnerabilities - not only constrained to web application... | Wikipedia and Google would be my choice, as there isn't one authoritative website including the history of vulnerability types.
The usual places that list vulnerability types generally do not include a history section. For example, here is the [CWE on XSS](https://cwe.mitre.org/data/definitions/79.html), here is the [... |
117,996 | There are many web application vulnerabilities out there, such as XSS, CSRF, and etc, and there are many resources which explain them very well. But I want to find about their history, for example, who was the first to discover them **[Surely, it wasn't a single person]**, and when they were first discovered **[Surely,... | 2016/03/19 | [
"https://security.stackexchange.com/questions/117996",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/94890/"
] | Wikipedia and Google would be my choice, as there isn't one authoritative website including the history of vulnerability types.
The usual places that list vulnerability types generally do not include a history section. For example, here is the [CWE on XSS](https://cwe.mitre.org/data/definitions/79.html), here is the [... | [CVE Details](http://www.cvedetails.com/) is a great site listing vulnerabilities narrowed down to manufacture, product and version.
In addition it also shows the published dates in any results, which is very useful. |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | The `\DeclarePairedDelimiter` command from [mathtools](http://www.ctan.org/pkg/mathtools) is useful. For example defining an absolute value macro;
```
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
```
gives also a starred version with `\left` and `\right`
```
\abs*{\frac{a}{b}}
```
and the unstarred version takes a... | To make auto-sized bracketing as painless and concise as possible, here's what I do:
```
\usepackage{mathtools}
\DeclarePairedDelimiter\autobracket{(}{)}
\newcommand{\br}[1]{\autobracket*{#1}}
```
Example:
```
$$\br{\frac{1}{2}} + \br{1} - \br{\frac{\int_0^{2\pi} f(x)}{\sqrt[2]{\frac{1}{2}}}}$$
```
[![enter ima... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | Adding `\left` and `\right` to all delimiters is difficult and likely not to yield the desired result in many places.
The [`nath`](http://www.ctan.org/pkg/nath) package aims at making `\left` and `\right` obsolete. From the readme:
>
> delimiters adapt their size to the material enclosed, rendering `\left` and `\ri... | It seems to me that it's easy to do *exactly* what you say, but you might not really want that; see the caveat below.
```
\let\lparen=(\let\rparen=)
\catcode`(=\active\catcode`)=\active
\def({\left\lparen}\def){\right\rparen}
```
The catch: There are some obvious disadvantages to this, such as that parentheses now o... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | To make auto-sized bracketing as painless and concise as possible, here's what I do:
```
\usepackage{mathtools}
\DeclarePairedDelimiter\autobracket{(}{)}
\newcommand{\br}[1]{\autobracket*{#1}}
```
Example:
```
$$\br{\frac{1}{2}} + \br{1} - \br{\frac{\int_0^{2\pi} f(x)}{\sqrt[2]{\frac{1}{2}}}}$$
```
[![enter ima... | I use the following newcommands:
```
\newcommand{\of}[1]{\left(#1\right)}
\newcommand{\off}[1]{\left[#1\right]}
\newcommand{\offf}[1]{\left\{#1\right\}}
```
Hence, in the text, `f\of{x}` will appear as `f(x)`, `M\ast\offf{g\off{x}+h\off{x}}` will appear as `M*{g[x]+h[x]}`, etc. with the `\left` and `\right` commands... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | Adding `\left` and `\right` to all delimiters is difficult and likely not to yield the desired result in many places.
The [`nath`](http://www.ctan.org/pkg/nath) package aims at making `\left` and `\right` obsolete. From the readme:
>
> delimiters adapt their size to the material enclosed, rendering `\left` and `\ri... | I always use some commands. For example:
```
\newcommand{\angles}[1]{\left\lange #1 \right\rangle}% ⟨⟩
\newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}% {}
\newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}% []
\newcommand{\pars}[1]{\left( #1 \right)}% ()
\newcommand{\ds}[1]{\d... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | **Edit:** *I'm leaving this answer up for “academic purposes” but, consider [Lev Bishop's](https://tex.stackexchange.com/questions/1742/automatic-left-and-right-commands/1765#1765) answer for an easier solution than mine.*
---
Over the years I've evolved my own solution which I think turned out quite nice. It gives y... | I always use some commands. For example:
```
\newcommand{\angles}[1]{\left\lange #1 \right\rangle}% ⟨⟩
\newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}% {}
\newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}% []
\newcommand{\pars}[1]{\left( #1 \right)}% ()
\newcommand{\ds}[1]{\d... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | Adding `\left` and `\right` to all delimiters is difficult and likely not to yield the desired result in many places.
The [`nath`](http://www.ctan.org/pkg/nath) package aims at making `\left` and `\right` obsolete. From the readme:
>
> delimiters adapt their size to the material enclosed, rendering `\left` and `\ri... | I use the following newcommands:
```
\newcommand{\of}[1]{\left(#1\right)}
\newcommand{\off}[1]{\left[#1\right]}
\newcommand{\offf}[1]{\left\{#1\right\}}
```
Hence, in the text, `f\of{x}` will appear as `f(x)`, `M\ast\offf{g\off{x}+h\off{x}}` will appear as `M*{g[x]+h[x]}`, etc. with the `\left` and `\right` commands... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | To make auto-sized bracketing as painless and concise as possible, here's what I do:
```
\usepackage{mathtools}
\DeclarePairedDelimiter\autobracket{(}{)}
\newcommand{\br}[1]{\autobracket*{#1}}
```
Example:
```
$$\br{\frac{1}{2}} + \br{1} - \br{\frac{\int_0^{2\pi} f(x)}{\sqrt[2]{\frac{1}{2}}}}$$
```
[![enter ima... | I always use some commands. For example:
```
\newcommand{\angles}[1]{\left\lange #1 \right\rangle}% ⟨⟩
\newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}% {}
\newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}% []
\newcommand{\pars}[1]{\left( #1 \right)}% ()
\newcommand{\ds}[1]{\d... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | The `\DeclarePairedDelimiter` command from [mathtools](http://www.ctan.org/pkg/mathtools) is useful. For example defining an absolute value macro;
```
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
```
gives also a starred version with `\left` and `\right`
```
\abs*{\frac{a}{b}}
```
and the unstarred version takes a... | I use the following newcommands:
```
\newcommand{\of}[1]{\left(#1\right)}
\newcommand{\off}[1]{\left[#1\right]}
\newcommand{\offf}[1]{\left\{#1\right\}}
```
Hence, in the text, `f\of{x}` will appear as `f(x)`, `M\ast\offf{g\off{x}+h\off{x}}` will appear as `M*{g[x]+h[x]}`, etc. with the `\left` and `\right` commands... |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | I use the following newcommands:
```
\newcommand{\of}[1]{\left(#1\right)}
\newcommand{\off}[1]{\left[#1\right]}
\newcommand{\offf}[1]{\left\{#1\right\}}
```
Hence, in the text, `f\of{x}` will appear as `f(x)`, `M\ast\offf{g\off{x}+h\off{x}}` will appear as `M*{g[x]+h[x]}`, etc. with the `\left` and `\right` commands... | Why has no one metioned `\qty`?
It comes in physics package
```tex
\documentclass{minimal}
\usepackage{amsmath}
\usepackage{physics}
\begin{document}
\begin{align*}
\qty{curly braces}\\
\qty(parenthesis)\\
\qty|Vertical bars|
\end{align*}
\end{document}
``` |
1,742 | Is it possible to automatically "add" `\left` and `\right` commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding `\left` and `\right` commands is time consuming and makes source code l... | 2010/08/15 | [
"https://tex.stackexchange.com/questions/1742",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/808/"
] | I use the following newcommands:
```
\newcommand{\of}[1]{\left(#1\right)}
\newcommand{\off}[1]{\left[#1\right]}
\newcommand{\offf}[1]{\left\{#1\right\}}
```
Hence, in the text, `f\of{x}` will appear as `f(x)`, `M\ast\offf{g\off{x}+h\off{x}}` will appear as `M*{g[x]+h[x]}`, etc. with the `\left` and `\right` commands... | There is another possibility to do it, if the automatic size should be the default ([as here](https://tex.stackexchange.com/questions/23178/swap-definition-of-starred-and-non-starred-command)) and explicit sizes should be easier to remember (numbers 0 till 4 instead of exotic names)
```
\documentclass{article}
\usepa... |
17,152,489 | I'm using a self tracking entity model. `ProductInstallation` is a DTO which contains all the details about the product installation for a company.
The `UserRoles` entity holds the relationship in-between the Product-System Role-UserID.
As an example:
>
> Product: Inventory
>
>
> System Role : PurchasingUser
>
... | 2013/06/17 | [
"https://Stackoverflow.com/questions/17152489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2494075/"
] | You write it as follows:
```
var result = context.SystemUsers.Where(su =>
productInstallation.UserRoles.Any(ur => su.UserID == ur.UserId));
```
Or if both sources are not `IQuerable` from the same db:
```
string[] userIDs = productInstallation.UserRoles
.Select(u=>u.UserID).Distin... | You can try this:
```
productInstallation.SystemUsers =
context.SystemUsers.FindAll(u=> userIDs.Contains(u.UserID))
``` |
17,152,489 | I'm using a self tracking entity model. `ProductInstallation` is a DTO which contains all the details about the product installation for a company.
The `UserRoles` entity holds the relationship in-between the Product-System Role-UserID.
As an example:
>
> Product: Inventory
>
>
> System Role : PurchasingUser
>
... | 2013/06/17 | [
"https://Stackoverflow.com/questions/17152489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2494075/"
] | You write it as follows:
```
var result = context.SystemUsers.Where(su =>
productInstallation.UserRoles.Any(ur => su.UserID == ur.UserId));
```
Or if both sources are not `IQuerable` from the same db:
```
string[] userIDs = productInstallation.UserRoles
.Select(u=>u.UserID).Distin... | What you really want to do here is join the two tables. Using a Join you can do this in one query rather than executing two separate queries:
```
var systemUsers = from userRole in UserRoles
join systemUser in SystemUsers
on userRole.UserID equals systemUser.UserID
... |
70,670,161 | I'm working to create a graph using HTML/JS/Python/Flask and the labels for this line graph should come from a list in Python and then I would use it on a Javascript.
So far I have not been able to successfully iterate over that list in Javascript, I'm getting 4 times the same string on my HTML.
I'm using a code simi... | 2022/01/11 | [
"https://Stackoverflow.com/questions/70670161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12959019/"
] | As you might have noticed, I'm a complete beginner when it comes to Javascript, doing some research, I found out I can slice and split in Javascript as well. So I solved my issue by using those two methods.
Giving more detail about what I did, {{data}} is passed over to Javascript as a single string, as '['ABC','DEF',... | Try this in HTML
```html
<body>
<p id='test'></p>
<script>
let text = '';
for (i=0; i<'{{len}}'; i++){
text += '{{data[i]}}' + '<br>'
}
console.log(text)
document.getElementById('test').innerHTML = text;
</script>
</body>
```
or you can also pass a string instead of an a... |
27,019,783 | well, i'm new in this and i dont know how i can make this program works, i need Write a program that calculates and returns the sum of the components of a vector squared
and i got this error:
```
import java.util.*;
public class cuadrado
{
public static void main(String[] args)
{
Scanner teclado=... | 2014/11/19 | [
"https://Stackoverflow.com/questions/27019783",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It's fairly simple to do this with XML::Twig (and I am happy I got the "delete the current element during parsing" to work a while back):
```
#!/usr/bin/perl
use strict;
use warnings;
use XML::Twig;
my $delt= 'delt.xml';
XML::Twig->new( twig_handlers => { delt => \&delt },
pretty_print => 'indented... | The reason you're having difficult is because what you're doing is extracting a subset from an XML doc, but then trying to also include some of the stuff from the 'parent'.
Pulling your 'delts' out would be fairly straightforward
I would be wanting to use `XML::Twig` with this - this is a perfect place to use a twi... |
71,769,925 | I have a dataframe like the below and want to remove trailing zeros in pairs of 2.
```
col1
99990000
11100000
22220000
```
```
data = {'col1': ['99990000', '11100000', '22220000']}
df = pd.DataFrame(data=data)
```
desired result
```
col1
9999
1110
2222
```
The below removes all trailing zeros not and not keepin... | 2022/04/06 | [
"https://Stackoverflow.com/questions/71769925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6402231/"
] | Your `00+` applies the repeater `+` only to the last `0`, you need to use a group:
```
df['col1'].str.replace('(00)+$','')
```
Output:
```
0 9999
1 1110
2 2222
Name: col1, dtype: object
``` | Try this, it should work
```
df['col1'].str[:4]
``` |
71,769,925 | I have a dataframe like the below and want to remove trailing zeros in pairs of 2.
```
col1
99990000
11100000
22220000
```
```
data = {'col1': ['99990000', '11100000', '22220000']}
df = pd.DataFrame(data=data)
```
desired result
```
col1
9999
1110
2222
```
The below removes all trailing zeros not and not keepin... | 2022/04/06 | [
"https://Stackoverflow.com/questions/71769925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6402231/"
] | Just to conceptualize the regex, here is an example. The solution from @mozway is much better but this focuses on the substitution only, ignoring pandas:
```
import re
col1 = [re.sub(r'(00)+$', '', num) for num in
['99990000', '11100000', '22220000']]
# ['9999', '1110', '2222']
```
* [`(00)+$`](https:/... | Try this, it should work
```
df['col1'].str[:4]
``` |
71,769,925 | I have a dataframe like the below and want to remove trailing zeros in pairs of 2.
```
col1
99990000
11100000
22220000
```
```
data = {'col1': ['99990000', '11100000', '22220000']}
df = pd.DataFrame(data=data)
```
desired result
```
col1
9999
1110
2222
```
The below removes all trailing zeros not and not keepin... | 2022/04/06 | [
"https://Stackoverflow.com/questions/71769925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6402231/"
] | Your `00+` applies the repeater `+` only to the last `0`, you need to use a group:
```
df['col1'].str.replace('(00)+$','')
```
Output:
```
0 9999
1 1110
2 2222
Name: col1, dtype: object
``` | Just to conceptualize the regex, here is an example. The solution from @mozway is much better but this focuses on the substitution only, ignoring pandas:
```
import re
col1 = [re.sub(r'(00)+$', '', num) for num in
['99990000', '11100000', '22220000']]
# ['9999', '1110', '2222']
```
* [`(00)+$`](https:/... |
29,711,573 | I don't understand this behavior of dart2js code.
I have this only in async function and only after compiling to JS.
```
e.keyCode is equal 13
KeyCode.ENTER is equal 13
```
but
```
(e.keyCode == KeyCode.ENTER) is false
```
This is simple code to debugging my issue.
Whats going on?
```
import 'dart:html';... | 2015/04/18 | [
"https://Stackoverflow.com/questions/29711573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3489593/"
] | This is indeed the same as [this bug](http://dartbug.com/23119).
The wrong type was inferred for the iteration variable of async for loops.
It is fixed in 1.10. | This must be 1.9.3 dart2js bug.
I use now Dart SDK version 1.10.0-dev.1.5 and everything works fine. This is only solution what I found, if I want use 'await for'. |
1,557,019 | I have a clumsy way to get the max length of a column in the database, but it's so bad that it seems wrong:
```
var length = new DataNS.WidgetTable(provider).description.MaxLength
```
Do I really have to instantiate some object and go digging through it? I even have to pass a provider to it explicitly.
If this real... | 2009/10/12 | [
"https://Stackoverflow.com/questions/1557019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15915/"
] | Yes this does seem a bit clumsy but I can't see any less clumsy way of getting the MaxLength values. To get the current provider you can just use the GetProvider method of theSubSonic.DataProviders.ProviderFactory class. So your example would look something like:
```
var length = new DataNS.WidgetTable(ProviderFactory... | In subsonic 2.2 I do the following. Does this not work in 3?
```
var length = Template.Schema.GetColumn("Name").MaxLength;
``` |
1,557,019 | I have a clumsy way to get the max length of a column in the database, but it's so bad that it seems wrong:
```
var length = new DataNS.WidgetTable(provider).description.MaxLength
```
Do I really have to instantiate some object and go digging through it? I even have to pass a provider to it explicitly.
If this real... | 2009/10/12 | [
"https://Stackoverflow.com/questions/1557019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15915/"
] | Yes this does seem a bit clumsy but I can't see any less clumsy way of getting the MaxLength values. To get the current provider you can just use the GetProvider method of theSubSonic.DataProviders.ProviderFactory class. So your example would look something like:
```
var length = new DataNS.WidgetTable(ProviderFactory... | If you use ActiveRecord then your object has a [COLUMN\_NAME]Column property which has all of this information. So if you have a Post object instantiated (like "post") you could use post.TitleColumn.MaxLength.
If you're using SubSonic 3 you can head in to Structs.tt and spin up whatever you need as well. |
1,557,019 | I have a clumsy way to get the max length of a column in the database, but it's so bad that it seems wrong:
```
var length = new DataNS.WidgetTable(provider).description.MaxLength
```
Do I really have to instantiate some object and go digging through it? I even have to pass a provider to it explicitly.
If this real... | 2009/10/12 | [
"https://Stackoverflow.com/questions/1557019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15915/"
] | Yes this does seem a bit clumsy but I can't see any less clumsy way of getting the MaxLength values. To get the current provider you can just use the GetProvider method of theSubSonic.DataProviders.ProviderFactory class. So your example would look something like:
```
var length = new DataNS.WidgetTable(ProviderFactory... | I got something like this to work in SubSonic 3 using ActiveRecord, it works:
```
new AccountsTable(null).ContactEmail.MaxLength
```
I'm using it in an ASP.NET MVC view:
```
<%= Html.TextBoxFor(model => model.ContactEmail,
new { maxlength = new AccountsTable(null).ContactEmail.MaxLength })%>
```
But not sure if ... |
1,557,019 | I have a clumsy way to get the max length of a column in the database, but it's so bad that it seems wrong:
```
var length = new DataNS.WidgetTable(provider).description.MaxLength
```
Do I really have to instantiate some object and go digging through it? I even have to pass a provider to it explicitly.
If this real... | 2009/10/12 | [
"https://Stackoverflow.com/questions/1557019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15915/"
] | If you use ActiveRecord then your object has a [COLUMN\_NAME]Column property which has all of this information. So if you have a Post object instantiated (like "post") you could use post.TitleColumn.MaxLength.
If you're using SubSonic 3 you can head in to Structs.tt and spin up whatever you need as well. | In subsonic 2.2 I do the following. Does this not work in 3?
```
var length = Template.Schema.GetColumn("Name").MaxLength;
``` |
1,557,019 | I have a clumsy way to get the max length of a column in the database, but it's so bad that it seems wrong:
```
var length = new DataNS.WidgetTable(provider).description.MaxLength
```
Do I really have to instantiate some object and go digging through it? I even have to pass a provider to it explicitly.
If this real... | 2009/10/12 | [
"https://Stackoverflow.com/questions/1557019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15915/"
] | If you use ActiveRecord then your object has a [COLUMN\_NAME]Column property which has all of this information. So if you have a Post object instantiated (like "post") you could use post.TitleColumn.MaxLength.
If you're using SubSonic 3 you can head in to Structs.tt and spin up whatever you need as well. | I got something like this to work in SubSonic 3 using ActiveRecord, it works:
```
new AccountsTable(null).ContactEmail.MaxLength
```
I'm using it in an ASP.NET MVC view:
```
<%= Html.TextBoxFor(model => model.ContactEmail,
new { maxlength = new AccountsTable(null).ContactEmail.MaxLength })%>
```
But not sure if ... |
30,916,718 | I have problem with my Dynamic Web Application. I just started learning JavaEE 6 and now I stack on JPA. I configured my app, added libraries but I still get this annoying info: No Persistence provider for EntityManager named X. I try to get answer in Internet, but nothing help me.
This is my persistance.xml file:
`... | 2015/06/18 | [
"https://Stackoverflow.com/questions/30916718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5024224/"
] | You're gonna need to extend the `HtmlHelper` class with the following:
```
public static MvcHtmlString HelpTextFor<TModel, TValue>(this HtmlHelper<TModel> helper, Expression<Func<TModel, TValue>> expr)
{
var memberExpr = expr.Body as MemberExpression;
if (memberExpr != null)
{
var helpAttr = membe... | Maybe you are doing things wrong because i think that `DataAnnotations` and `MVC Helpers` are different things.
i would do something like this:
a helper view on my `App_Code` with the code:
```
@helper HelpTextFor(string text) {
<span>@text</span>
}
```
and then use it as you wrote. |
30,916,718 | I have problem with my Dynamic Web Application. I just started learning JavaEE 6 and now I stack on JPA. I configured my app, added libraries but I still get this annoying info: No Persistence provider for EntityManager named X. I try to get answer in Internet, but nothing help me.
This is my persistance.xml file:
`... | 2015/06/18 | [
"https://Stackoverflow.com/questions/30916718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5024224/"
] | You're gonna need to extend the `HtmlHelper` class with the following:
```
public static MvcHtmlString HelpTextFor<TModel, TValue>(this HtmlHelper<TModel> helper, Expression<Func<TModel, TValue>> expr)
{
var memberExpr = expr.Body as MemberExpression;
if (memberExpr != null)
{
var helpAttr = membe... | About localizing the string (I cannot comment because I do not have enough points yet)
Add the following attributes to your HelpTextAttribute
```
public string ResourceName { get; set; }
public Type ResourceType { get; set; }
```
and then adjust the HelpTextFor as follows:
```
var helpAttr = memberExpr.Member.G... |
39,469,608 | How to run controller from the sub folder in codeigniter.
I have tried but i get the following error bellow.
[](https://i.stack.imgur.com/wruhe.png) | 2016/09/13 | [
"https://Stackoverflow.com/questions/39469608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6661902/"
] | You can do this by following below steps:
Stpep 1) create sub-folder `"superadmin"` in controllers folder like below:
```
controllers/superadmin
```
Stpep 2) create controller `controllers/superadmin/loginvalueget.php` in sub-folder `"superadmin"` like below:
```
<?php
class Loginvalueget extends CI_Controller {
... | As you can see yourself in the attachment, you haven't set the route. You can do this by setting route path in "application>config>routes.php". |
10,560,622 | I have searched many articles but I could not find one appropriate. I am trying to take input form user a multiple line text and show them as it is. I am using textarea tag, but the page is not working the input values are showed in one line even it I press enter an start a new line.
Please help me fixing this. | 2012/05/12 | [
"https://Stackoverflow.com/questions/10560622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1403801/"
] | Use [`nl2br()`](http://us3.php.net/manual/en/function.nl2br.php) when echoing the output. | Already mentioned `nl2br()` is one way;
another way is to echo the output within `<pre> .. </pre>` HTML tags. |
63,217,004 | I am trying to plot the S-shape cumulative distribution function (cdf) curve of a normal distribution. However, I ended up with a uniform distribution. What am I doing wrong?
**Test Script**
```
import numpy as np
from numpy.random import default_rng
from scipy.stats import norm
import matplotlib.pyplot as plt
siz =... | 2020/08/02 | [
"https://Stackoverflow.com/questions/63217004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5722359/"
] | Now I don't know your particular application. But I think the problem lies in that you are creating the values of the cdf for a number of normally distributed random numbers.
Below you can see a code example which plots the CDF of a standard normal from -3 to +3
```
import numpy as np
from scipy.stats import norm
impo... | You are plotting the wrong values.
when you do `b = norm.rvs(size=siz, random_state=rg)`, what you get is a 10 independently drawn random samples from standard normal distribution, i.e., `z` values
hence their histogram is what you see as bell shaped curve.
`norm.cdf` returns the `cfd` value at a given z value. If yo... |
63,217,004 | I am trying to plot the S-shape cumulative distribution function (cdf) curve of a normal distribution. However, I ended up with a uniform distribution. What am I doing wrong?
**Test Script**
```
import numpy as np
from numpy.random import default_rng
from scipy.stats import norm
import matplotlib.pyplot as plt
siz =... | 2020/08/02 | [
"https://Stackoverflow.com/questions/63217004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5722359/"
] | To plot the sigmoidal result of the CDF of the normally distributed random variates, I should not have used matplotlib's `hist()` function. Rather, I could have used the `bar()` function to plot my results.
[@Laaggan](https://stackoverflow.com/a/63217196/5722359) and [@dumbPy](https://stackoverflow.com/a/63217209/5722... | Now I don't know your particular application. But I think the problem lies in that you are creating the values of the cdf for a number of normally distributed random numbers.
Below you can see a code example which plots the CDF of a standard normal from -3 to +3
```
import numpy as np
from scipy.stats import norm
impo... |
63,217,004 | I am trying to plot the S-shape cumulative distribution function (cdf) curve of a normal distribution. However, I ended up with a uniform distribution. What am I doing wrong?
**Test Script**
```
import numpy as np
from numpy.random import default_rng
from scipy.stats import norm
import matplotlib.pyplot as plt
siz =... | 2020/08/02 | [
"https://Stackoverflow.com/questions/63217004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5722359/"
] | To plot the sigmoidal result of the CDF of the normally distributed random variates, I should not have used matplotlib's `hist()` function. Rather, I could have used the `bar()` function to plot my results.
[@Laaggan](https://stackoverflow.com/a/63217196/5722359) and [@dumbPy](https://stackoverflow.com/a/63217209/5722... | You are plotting the wrong values.
when you do `b = norm.rvs(size=siz, random_state=rg)`, what you get is a 10 independently drawn random samples from standard normal distribution, i.e., `z` values
hence their histogram is what you see as bell shaped curve.
`norm.cdf` returns the `cfd` value at a given z value. If yo... |
51,014,512 | What way is more convenient to set image from my app assets in my app Image View? I have two ways: the first one is function UIImage(named: String) or UIImage and both is working for me, but I want to know which one is the best ,so I can use one in the future
here is two examples
```
// first
let myImages1 = ["di... | 2018/06/24 | [
"https://Stackoverflow.com/questions/51014512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7374351/"
] | We're using Images from assets catalog instead String names. It's the better way to set UIImage. But from swift 4.2 we can't use asset names anymore.
We should use image literal.
Here's the example:
```
let logoImageView: UIImageView = {
let iv = UIImageView()
// Set image with image literal
iv.image = #i... | You can create an extension for UIImage and have static variables holding your images.
```
extension UIImage {
static var dice1: UIImage? {
return UIImage(named: "dice1")
}
}
let imageView = UIImageView()
imageView.image = UIImage.dice1
```
Or you can use image literals in Xcode which are nice becau... |
48,285,834 | In oracle DB I have a table say T which has columns id, att1, att2, att3. Now i also have a CSV file which has lots of id's in it along with one additional parameter.How to insert att2 corresponding to each id in the DB.
initially, csv is like
```
id, random
id, random
.
.
```
i.e after running the PL/SQ... | 2018/01/16 | [
"https://Stackoverflow.com/questions/48285834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3767047/"
] | I think the concept that you like to use are `interceptors`.
In `vue-resource` you can define them for `request` and `response`.
An example for a interceptor:
```
Vue.http.interceptors.push(function(request, next) {
// modify request ...
// stop and return response
next(request.respondWith(body, {
status: ... | Thanks to [C Sharper](https://stackoverflow.com/users/1487681/c-sharper) for the very good start point.
I've wrote here my final solution for posterity.
I've checked the `response` status in the interceptor and if it isn't `ok`, it will show a message to end-user, using the `$alert()` function.
Here the code:
```
Vu... |
8,436,515 | I have a DataTable that contains 4 rows. I want to compare a value in one column in row 1 with the value in row 2. Something similar to this:
```
For Each row As DataRow in drRows
If row("column") <> row("column") 'I want the second row("column") to be the next row.
'do something else
End If
Next
``` | 2011/12/08 | [
"https://Stackoverflow.com/questions/8436515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | You can always access a `DataRow` with its index ([`DataRowCollection.Item`](http://msdn.microsoft.com/en-us/library/system.data.datarowcollection.item.aspx)):
```
For i As Integer = 0 To tbl.Rows.Count - 1
Dim row As DataRow = tbl.Rows(i)
If i <> tbl.Rows.Count - 1 Then
Dim nextRow As DataRow = tbl(i ... | Say you have the following table:
```none
A B C D
1 2 3 4
5 6 7 8
9 10 11 12
12 12 13 14
```
```
For i As Integer = 0 To dt.Rows.Count - 2
If dt.Rows(i)("ColName") <> dt.Rows(i + 1)("ColName") Then
'Do something
End If
Next
``` |
8,436,515 | I have a DataTable that contains 4 rows. I want to compare a value in one column in row 1 with the value in row 2. Something similar to this:
```
For Each row As DataRow in drRows
If row("column") <> row("column") 'I want the second row("column") to be the next row.
'do something else
End If
Next
``` | 2011/12/08 | [
"https://Stackoverflow.com/questions/8436515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | You can always access a `DataRow` with its index ([`DataRowCollection.Item`](http://msdn.microsoft.com/en-us/library/system.data.datarowcollection.item.aspx)):
```
For i As Integer = 0 To tbl.Rows.Count - 1
Dim row As DataRow = tbl.Rows(i)
If i <> tbl.Rows.Count - 1 Then
Dim nextRow As DataRow = tbl(i ... | You keep track of the last item:
```
Dim last As DataRow = Nothing
For Each row As DataRow In drRows
If last IsNot Nothing Then
' Compare last with row
End If
last = row
Next
``` |
8,436,515 | I have a DataTable that contains 4 rows. I want to compare a value in one column in row 1 with the value in row 2. Something similar to this:
```
For Each row As DataRow in drRows
If row("column") <> row("column") 'I want the second row("column") to be the next row.
'do something else
End If
Next
``` | 2011/12/08 | [
"https://Stackoverflow.com/questions/8436515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33690/"
] | You keep track of the last item:
```
Dim last As DataRow = Nothing
For Each row As DataRow In drRows
If last IsNot Nothing Then
' Compare last with row
End If
last = row
Next
``` | Say you have the following table:
```none
A B C D
1 2 3 4
5 6 7 8
9 10 11 12
12 12 13 14
```
```
For i As Integer = 0 To dt.Rows.Count - 2
If dt.Rows(i)("ColName") <> dt.Rows(i + 1)("ColName") Then
'Do something
End If
Next
``` |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | If you have no SSH access to the remote server and the hosting provider doesn't offer a git deploy feature, you won't be able to deploy directly using git.
However, it's always a good idea to track your source code regardless the remote options.
In your case, a good alternative to automate the release process would b... | If you are in a shared hosting plan, its not a good idea to host your own git server as you'll have both space and bandwidth limitations. You can look out for other options such as [github](http://github.com) or if you want to have a private hosting, there is [bitbucket](http://bitbucket.org) |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | If you have no SSH access to the remote server and the hosting provider doesn't offer a git deploy feature, you won't be able to deploy directly using git.
However, it's always a good idea to track your source code regardless the remote options.
In your case, a good alternative to automate the release process would b... | Maybe think about a different hosting set up?
1. On a VPS you have more freedom but you need to set up everything yourself.
2. On a cloud PaaS you will get great technology but pay a little more.
3. As mentioned above: A private repo hoster with ftp deployment option might also work.
For me, best productivity is most... |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | If you have no SSH access to the remote server and the hosting provider doesn't offer a git deploy feature, you won't be able to deploy directly using git.
However, it's always a good idea to track your source code regardless the remote options.
In your case, a good alternative to automate the release process would b... | If git is installed on the server (e.g `<?php $last_line = system('git --version', $retval); ?>`), but you don't have SSH access, perhaps try [php-git-bundle](https://bitbucket.org/jwerner/php-git-bundle). |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | If you have no SSH access to the remote server and the hosting provider doesn't offer a git deploy feature, you won't be able to deploy directly using git.
However, it's always a good idea to track your source code regardless the remote options.
In your case, a good alternative to automate the release process would b... | This question may be old but there is a shared web hosting which offers git deployment option and SSH access to git pull/push etc: [githoster.com](http://githoster.com)
Or there are some scripts you can search in google which will link your github account to your host with git hooks. |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | If you are in a shared hosting plan, its not a good idea to host your own git server as you'll have both space and bandwidth limitations. You can look out for other options such as [github](http://github.com) or if you want to have a private hosting, there is [bitbucket](http://bitbucket.org) | If git is installed on the server (e.g `<?php $last_line = system('git --version', $retval); ?>`), but you don't have SSH access, perhaps try [php-git-bundle](https://bitbucket.org/jwerner/php-git-bundle). |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | If you are in a shared hosting plan, its not a good idea to host your own git server as you'll have both space and bandwidth limitations. You can look out for other options such as [github](http://github.com) or if you want to have a private hosting, there is [bitbucket](http://bitbucket.org) | This question may be old but there is a shared web hosting which offers git deployment option and SSH access to git pull/push etc: [githoster.com](http://githoster.com)
Or there are some scripts you can search in google which will link your github account to your host with git hooks. |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | Maybe think about a different hosting set up?
1. On a VPS you have more freedom but you need to set up everything yourself.
2. On a cloud PaaS you will get great technology but pay a little more.
3. As mentioned above: A private repo hoster with ftp deployment option might also work.
For me, best productivity is most... | If git is installed on the server (e.g `<?php $last_line = system('git --version', $retval); ?>`), but you don't have SSH access, perhaps try [php-git-bundle](https://bitbucket.org/jwerner/php-git-bundle). |
10,333,503 | So I started using Git together with [this workflow](http://nvie.com/posts/a-successful-git-branching-model/) to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.
But now I would like to make this website public and upload it to my webserver. Problem... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10333503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356391/"
] | Maybe think about a different hosting set up?
1. On a VPS you have more freedom but you need to set up everything yourself.
2. On a cloud PaaS you will get great technology but pay a little more.
3. As mentioned above: A private repo hoster with ftp deployment option might also work.
For me, best productivity is most... | This question may be old but there is a shared web hosting which offers git deployment option and SSH access to git pull/push etc: [githoster.com](http://githoster.com)
Or there are some scripts you can search in google which will link your github account to your host with git hooks. |
71,199,771 | ```
// program to count down numbers to 1
function countDown(number) {
// display the number
console.log(number);
// decrease the number value
const newNumber = number - 1;
// base case
if (newNumber > 0) {
countDown(newNumber);
}
console.log(newNumber);
}
countDown(4);
// output => 4 3 2 1 0 ... | 2022/02/20 | [
"https://Stackoverflow.com/questions/71199771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11586735/"
] | Your recursive call does not end the execution of the function.
So what happens is that if you call `newNumber(2)` it executes the first console.log, logging 2. Then it assigns `newNumber` to 1. Then your recursion happens, printing 1. Inside the recursive call newNumber becomes 0, so no more recursion. Instead, the s... | You can simplify your function.
```js
function countDown(number) {
if (number > 0) {
console.log(number);
countDown(--number);
}
}
countDown(4);
``` |
71,199,771 | ```
// program to count down numbers to 1
function countDown(number) {
// display the number
console.log(number);
// decrease the number value
const newNumber = number - 1;
// base case
if (newNumber > 0) {
countDown(newNumber);
}
console.log(newNumber);
}
countDown(4);
// output => 4 3 2 1 0 ... | 2022/02/20 | [
"https://Stackoverflow.com/questions/71199771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11586735/"
] | You can simplify your function.
```js
function countDown(number) {
if (number > 0) {
console.log(number);
countDown(--number);
}
}
countDown(4);
``` | this way ?
```js
countDown( 4 )
// program to count down numbers to 1
function countDown(num)
{
if (num<1) return
console.log(num)
countDown(--num)
}
``` |
71,199,771 | ```
// program to count down numbers to 1
function countDown(number) {
// display the number
console.log(number);
// decrease the number value
const newNumber = number - 1;
// base case
if (newNumber > 0) {
countDown(newNumber);
}
console.log(newNumber);
}
countDown(4);
// output => 4 3 2 1 0 ... | 2022/02/20 | [
"https://Stackoverflow.com/questions/71199771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11586735/"
] | Your recursive call does not end the execution of the function.
So what happens is that if you call `newNumber(2)` it executes the first console.log, logging 2. Then it assigns `newNumber` to 1. Then your recursion happens, printing 1. Inside the recursive call newNumber becomes 0, so no more recursion. Instead, the s... | this way ?
```js
countDown( 4 )
// program to count down numbers to 1
function countDown(num)
{
if (num<1) return
console.log(num)
countDown(--num)
}
``` |
9,704,329 | I have tested loads of HTML5 MP3 players with Flash fallback in the past month, and none seem to work on Blackberry phones (i.e. below OS 7.0, because OS 7 already has some HTML5 support). Do you know of any?
The closest I have gotten so far is for it to play but then the flash never responds when you try to pause or ... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9704329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572561/"
] | Does it *have* to have a **FLASH** fallback? Because [jPlayer](http://www.jplayer.org/) seems to have good java intentions, while running in HTML5. It's open source, too, so I suppose it could have a forked flash version? (just a question, *who uses blackberry anymore anyway?*)
Best of regards,
JXP | Try the [Yahoo! WebPlayer](http://webplayer.yahoo.com/). I haven't tried it on blackberry but I've had good luck with it on every other device I've tested. I believe it used html5 if it can and has a flash fallback if it can't use html5. Hopefully it works for you. If not, sorry and good luck! |
8,347,990 | So if I have a select list of lets say dates that looks like
```
<option value="624e70cb-2796-4029-bd09-2642abaa54b4">1989</option>
<option value="ff591d9a-e8a4-4280-829b-9307b7b41912">1988</option>
<option value="f2e9e756-7c59-4883-89b5-9c8cccf85ad6">1987</option>
<option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060"... | 2011/12/01 | [
"https://Stackoverflow.com/questions/8347990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517721/"
] | You can use google chrome. Open console by pressing F12 or inspect any element, in right-bottom corner click on gear icon, then go to "overrides" where you can enable "Emulate touch events". Your mouse clicks will be like touches.
Notice: unbind/remove any pc's click events like onclick,onmousedown,.click and .ect beca... | One possible way is to [install the Android SDK](http://developer.android.com/sdk/installing.html) and use the browser in the emulator. I'd advise an Android 2.x image as emulation is a bit slow, especially the 3.x and 4.0 images. |
8,347,990 | So if I have a select list of lets say dates that looks like
```
<option value="624e70cb-2796-4029-bd09-2642abaa54b4">1989</option>
<option value="ff591d9a-e8a4-4280-829b-9307b7b41912">1988</option>
<option value="f2e9e756-7c59-4883-89b5-9c8cccf85ad6">1987</option>
<option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060"... | 2011/12/01 | [
"https://Stackoverflow.com/questions/8347990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517721/"
] | If it's still actual, you can use [this](https://github.com/jtangelder/faketouches.js) library to test touch events. It's used to test touch for Hammer. | One possible way is to [install the Android SDK](http://developer.android.com/sdk/installing.html) and use the browser in the emulator. I'd advise an Android 2.x image as emulation is a bit slow, especially the 3.x and 4.0 images. |
8,347,990 | So if I have a select list of lets say dates that looks like
```
<option value="624e70cb-2796-4029-bd09-2642abaa54b4">1989</option>
<option value="ff591d9a-e8a4-4280-829b-9307b7b41912">1988</option>
<option value="f2e9e756-7c59-4883-89b5-9c8cccf85ad6">1987</option>
<option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060"... | 2011/12/01 | [
"https://Stackoverflow.com/questions/8347990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517721/"
] | You can use google chrome. Open console by pressing F12 or inspect any element, in right-bottom corner click on gear icon, then go to "overrides" where you can enable "Emulate touch events". Your mouse clicks will be like touches.
Notice: unbind/remove any pc's click events like onclick,onmousedown,.click and .ect beca... | `Hammer.js` library can simulate touch events on desktop devices.
<http://eightmedia.github.com/hammer.js/> |
8,347,990 | So if I have a select list of lets say dates that looks like
```
<option value="624e70cb-2796-4029-bd09-2642abaa54b4">1989</option>
<option value="ff591d9a-e8a4-4280-829b-9307b7b41912">1988</option>
<option value="f2e9e756-7c59-4883-89b5-9c8cccf85ad6">1987</option>
<option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060"... | 2011/12/01 | [
"https://Stackoverflow.com/questions/8347990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517721/"
] | If it's still actual, you can use [this](https://github.com/jtangelder/faketouches.js) library to test touch events. It's used to test touch for Hammer. | `Hammer.js` library can simulate touch events on desktop devices.
<http://eightmedia.github.com/hammer.js/> |
17,568,348 | I am using SuiteScript to fetch Subsidiary information. Using nlapiLookupField method I am able to see the basic fields. But I want some information on Subsidiary-Preferences tab.
It seems nlapiLookupField cannot access fields on a subtab (Preferences). | 2013/07/10 | [
"https://Stackoverflow.com/questions/17568348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665836/"
] | These fields are not even listed in [SuiteScript Records Browser](https://system.netsuite.com/help/helpcenter/en_US/RecordsBrowser/2013_1/index.html).
One way to read them is by loading the record eg:
```
var rec = nlapiLoadRecord('subsidiary', 11);
rec.getFieldValue('CHECKTYPE');
``` | Open the record inside the NetSuite UI. Append '&xml=T' to the end of the url for the record.
Take a look at the underlying XML data - that should be everything you see in the UI, and you will see the field names, sublists, etc. |
3,767,128 | In my page, I'm using a javascript function
```
<script>
function redirect(){
window.location="hurray.php";
}
</script>
```
Calling the function from the line below.
```
<input id="search_box" name="textbox" type="text" size="50" maxlength="100" onkeypress="redirect()" />
```
Now I want to make it sure that... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3767128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383393/"
] | Make an AJAX call to a PHP function that will set a variable in the session. When the AJAX call returns response redirect the user to this page and check for the session variable. You can delete it if you do not want the user to be able to visit it again for this session. | You cannot do this using javascript alone, I don't think.
You need to intercept this on the server and handle it accordingly.
Your probably going to need a token to be sent along with the redirect, you can then validate this token server side and allow the redirect to complete or do some other action if the user has ... |
3,767,128 | In my page, I'm using a javascript function
```
<script>
function redirect(){
window.location="hurray.php";
}
</script>
```
Calling the function from the line below.
```
<input id="search_box" name="textbox" type="text" size="50" maxlength="100" onkeypress="redirect()" />
```
Now I want to make it sure that... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3767128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383393/"
] | You cannot do this using javascript alone, I don't think.
You need to intercept this on the server and handle it accordingly.
Your probably going to need a token to be sent along with the redirect, you can then validate this token server side and allow the redirect to complete or do some other action if the user has ... | Does your example contain real code, or have you just included someething that's made up to make the question simpler to ask?
It seems a strange thing to do - providing the user with a search box and then, as soon as they start typing, redirect them to another page.
If you are doing a search, and you only want the ea... |
3,767,128 | In my page, I'm using a javascript function
```
<script>
function redirect(){
window.location="hurray.php";
}
</script>
```
Calling the function from the line below.
```
<input id="search_box" name="textbox" type="text" size="50" maxlength="100" onkeypress="redirect()" />
```
Now I want to make it sure that... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3767128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383393/"
] | Make an AJAX call to a PHP function that will set a variable in the session. When the AJAX call returns response redirect the user to this page and check for the session variable. You can delete it if you do not want the user to be able to visit it again for this session. | Does your example contain real code, or have you just included someething that's made up to make the question simpler to ask?
It seems a strange thing to do - providing the user with a search box and then, as soon as they start typing, redirect them to another page.
If you are doing a search, and you only want the ea... |
3,767,128 | In my page, I'm using a javascript function
```
<script>
function redirect(){
window.location="hurray.php";
}
</script>
```
Calling the function from the line below.
```
<input id="search_box" name="textbox" type="text" size="50" maxlength="100" onkeypress="redirect()" />
```
Now I want to make it sure that... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3767128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383393/"
] | Make an AJAX call to a PHP function that will set a variable in the session. When the AJAX call returns response redirect the user to this page and check for the session variable. You can delete it if you do not want the user to be able to visit it again for this session. | Extend your function so it sets a cookie via "document.cookie", then check via JS ,PHP or whatever on the target page if the cookie is set and redirect somewhere else if not, quite simple. **Of Course thats not really secure!** |
3,767,128 | In my page, I'm using a javascript function
```
<script>
function redirect(){
window.location="hurray.php";
}
</script>
```
Calling the function from the line below.
```
<input id="search_box" name="textbox" type="text" size="50" maxlength="100" onkeypress="redirect()" />
```
Now I want to make it sure that... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3767128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383393/"
] | Extend your function so it sets a cookie via "document.cookie", then check via JS ,PHP or whatever on the target page if the cookie is set and redirect somewhere else if not, quite simple. **Of Course thats not really secure!** | Does your example contain real code, or have you just included someething that's made up to make the question simpler to ask?
It seems a strange thing to do - providing the user with a search box and then, as soon as they start typing, redirect them to another page.
If you are doing a search, and you only want the ea... |
45,725 | I read the instructions as stating that you can place an action and/ or a money and/ or a property. But others say you can do any combination of the three in any of the three piles. | 2019/04/01 | [
"https://boardgames.stackexchange.com/questions/45725",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/27005/"
] | The three cards can be any combination of properties, actions, and/or money. From the rules (abbreviated for clarity):
>
> PLAY UP TO 3 CARDS from your hand, onto the table in front of you. You don't have to play any cards if you don't want to. Play your 3 cards in any combination of the following: A, B, and/or C.
> ... | You can play any three cards from your hand during your turn. These three cards are not otherwise restricted in type; you can for example,
* Play three *Deal Breaker* cards and potentially win the game
* Play three *Pass Go* cards to draw a total of six new cards
* Lay down three properties to either form a set (and p... |
32,305,717 | **How can I read OST file (outlook 2010/2013) from another computer in network using C#**
I can read but only from local system/server. I want to read it from other computer/server in network.I have credentials of other system/server. I couldn't find any article on google | 2015/08/31 | [
"https://Stackoverflow.com/questions/32305717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1055502/"
] | Your update query seems to have problem. Check shop` rate. Change it
```
UPDATE `table_name` SET `shop rate` = '545454' WHERE i_id = '190';
``` | ```
UPDATE table_name SET `shop rate` = '545454' WHERE i_id = '190';
```
will work
EDIT: also, sorry for not noticing earlier:
$posted[`shop rate`]
should be $posted['shop rate']
EDIT2: part of answer was wrong, omitted that |
62,257,565 | I have tried this alert but not getting result what exactly I want
Suppose my URL = <http://expense.test/admin/manageExpense.php>
I want alert (<http://expense.test/admin/>)
```
var base_url = window.location.origin + '/' + window.location.pathname.split ('/') [1] + '/';
```
Above query getting exact result which i... | 2020/06/08 | [
"https://Stackoverflow.com/questions/62257565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10903445/"
] | I have taken a look at your stackblitz and I have modified it and made it working. You don't need to bind the formControlName with your products because you are not setting them from the frontend UI rather you are just selecting them. I have added a field named `added` in the class `ProductModel` and then I have just i... | courses is array of formGroup and inside that formGroup products is another formArray so you have to pass single course formGroup to getProducts method.
**component.html**
```
<div class="row" formArrayName="courses">
<div *ngFor="let course of getCourses(menuForm); let i = index" [formGroupName]="i">
<div clas... |
20,628,812 | Good day, I found this priority queue implementation and I am trying to get a min version of it (instead of max). I have no idea where to start. I tried mixing the signs of the functions (naive attempt) but it didn't get me far. Any help of how to implement it and a few words explaining it are very wellcome. The source... | 2013/12/17 | [
"https://Stackoverflow.com/questions/20628812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846979/"
] | You *can* do this with `setattr`, but **I don't recommend it**:
```
for i in range(1,5):
setattr(self, 'folderheader%s' % i, QtGui.QLabel(self.folders))
```
Instead, might I suggest a `list`?
```
self.folderheaders = [QtGui.Qlabel(self.folders) for _ in range(1, 5)]
```
Now instead of `self.folderheaders1` yo... | You can use a `dict` like this
```
self.foldersdict = {}
for i in range(100):
self.foldersdict[i] = QtGui.QLabel(self.folders)
```
You can later access them like this,
```
self.foldersdict[1]
``` |
19,443,247 | I want to save value TRUE if checkbox checked, and FALSE if it is unchecked in an array, how can I do that. I have implemented checkbox in tableview. Code is,
```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
BOOL checked = [[checkedArr objectAtIndex:indexPath.row] b... | 2013/10/18 | [
"https://Stackoverflow.com/questions/19443247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2772174/"
] | You don't need to bind `click` event handler to *every* button in the column. Every binding take memory and other resources of web browser. The most events bubbling to from inner to outer DOM element (see [here](http://en.wikipedia.org/wiki/DOM_events#Event_flow)), Mouse click, Keyboard keydown, Touch touchstart and ot... | Here's an simple example how you could add buttons dynamically to a jqgrid
<http://jsfiddle.net/ShKDX/1/>
Not sure if you first row is the id as specified in the fiddle, but you can modify it to use the correct data from the `afterInsertRow` function
```
var data = [
{id: 1, text: 'row1'},
{id: 2, text: 'row... |
16,802,360 | I have an observable array of observables - each observable has been extended for require however when i save the form with cleared fields it does not collect error or have any errors to show -
```
ko.validation.configure({
grouping: {
deep: true,
observable: true
}
});
var viewModel = functio... | 2013/05/28 | [
"https://Stackoverflow.com/questions/16802360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1034670/"
] | Easiest thing to do is call ko.validation.group again inside the populate function. Another option, which i prefer, is to subscribe to defaultcalculations and run the group call in there.
```
self.defaultCalculations.subscribe(function () {
self.errors = ko.validation.group(self.defaultCalculations);
});
```
thi... | You can also add notify always when extending observable.
```
this.validationModel = ko.validatedObservable({
Num: ko.observable(this.Num).extend({ number: true, notify: 'always' }),
});
```
It worked for me. Before, when this.Num wasn't modified, it wasn't validated. |
6,561,477 | I have someone who wants me to make a website for them but wants to know how much i will charge. I severely undervalue the worth of what i can do as i enjoy it and find it easy. So what would be a fair price for a website consisting of 5 basic html pages and 45+ catalog pages (images, descriptions and item code)? These... | 2011/07/03 | [
"https://Stackoverflow.com/questions/6561477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/635129/"
] | You're not missing anything and this isn't a particularly important issue. You have a few options:
```
NSLog(@"%d", sender.tag);
```
Sometimes that will produce warnings when compiling, depending on the type of the method parameter.
```
NSLog(@"%d", ((UIButton *)sender).tag);
```
Or finally:
```
UIButton *button... | When you say `UIButton* myButton = (UIButton*) sender;`, you are not making a new object. You are simply making a new handle (pointer) to the `sender` object, and explicitly telling the compiler that it is a `UIButton`.
This means that you can call `UIButton` methods on it without having the compiler complain that the... |
6,561,477 | I have someone who wants me to make a website for them but wants to know how much i will charge. I severely undervalue the worth of what i can do as i enjoy it and find it easy. So what would be a fair price for a website consisting of 5 basic html pages and 45+ catalog pages (images, descriptions and item code)? These... | 2011/07/03 | [
"https://Stackoverflow.com/questions/6561477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/635129/"
] | You're not missing anything and this isn't a particularly important issue. You have a few options:
```
NSLog(@"%d", sender.tag);
```
Sometimes that will produce warnings when compiling, depending on the type of the method parameter.
```
NSLog(@"%d", ((UIButton *)sender).tag);
```
Or finally:
```
UIButton *button... | If the sender is always UIButton, I would declare method as
```
- (void) myMethod: (UIButton*) sender
```
because it practically yield the same effect to pointer type casting. It also saves you one line of code. |
6,561,477 | I have someone who wants me to make a website for them but wants to know how much i will charge. I severely undervalue the worth of what i can do as i enjoy it and find it easy. So what would be a fair price for a website consisting of 5 basic html pages and 45+ catalog pages (images, descriptions and item code)? These... | 2011/07/03 | [
"https://Stackoverflow.com/questions/6561477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/635129/"
] | When you say `UIButton* myButton = (UIButton*) sender;`, you are not making a new object. You are simply making a new handle (pointer) to the `sender` object, and explicitly telling the compiler that it is a `UIButton`.
This means that you can call `UIButton` methods on it without having the compiler complain that the... | If the sender is always UIButton, I would declare method as
```
- (void) myMethod: (UIButton*) sender
```
because it practically yield the same effect to pointer type casting. It also saves you one line of code. |
39,971,726 | For example, my string is: `DELIMxxxyyyzzzaaabbbcc,DELIMaaabbcccxxxyyyzzz,DELIMzzzyyyxxxaaabbbccc,DELIMyyyaaabbb,`
You can see this data is organised in delimited groups. I want to extract the second group (for example) where I'm given the position (in this case 24) and the next delimiter which I know to be "DELIM".
... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39971726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2066625/"
] | Use `strpos` to select the start and end position of your delimited group. Then you can use `substr` to get the delimeted group by selecting the string between those two positions.
```
$offset = 4;
$start = strpos($mystring, 'DELIM', $offset); //select start point
$end = strpos($mystring, 'DELIM', $start+5); //selec... | You can use strpos with offset
```
$mystring = 'DELIMxxxyyyzzzaaabbbcc,DELIMaaabbcccxxxyyyzzz,DELIMzzzyyyxxxaaabbbccc,DELIMyyyaaabbb,'
$pos = strpos($mystring, 'DELIM', 24+1 + strlen('DELIM'));
$myPart = substr($mystring, 24, $pos);
``` |
22,363,701 | I'm looking for an OS X editor (preferably a dedicated Forth editor, but I doubt it exists) that has/can be customized to change the font color of Forth variables, programs, etc. If not, is there any sort of workaround? | 2014/03/12 | [
"https://Stackoverflow.com/questions/22363701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3412631/"
] | I know it's an old question, but: atom with the forth-language package. See <http://atom.io/>
Longer answer:
I have tried both emacs and atom on Mac OS X and both are more than adequate for editing Forth. Atom is lighter and easier to learn while maintaining many emacs-ish capabilities (cmd-shift-p in place of meta... | I would suggest Gedit and if you change the forth.lang in the app you can change the syntax highlighting |
22,363,701 | I'm looking for an OS X editor (preferably a dedicated Forth editor, but I doubt it exists) that has/can be customized to change the font color of Forth variables, programs, etc. If not, is there any sort of workaround? | 2014/03/12 | [
"https://Stackoverflow.com/questions/22363701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3412631/"
] | [UltraEdit](http://www.ultraedit.com/products/uex.html) has a Forth syntax highlight mode. MicroProcessor Engineering have an up to date copy in there [downloads](http://www.mpeforth.com/arena.htm) page. | I would suggest Gedit and if you change the forth.lang in the app you can change the syntax highlighting |
22,363,701 | I'm looking for an OS X editor (preferably a dedicated Forth editor, but I doubt it exists) that has/can be customized to change the font color of Forth variables, programs, etc. If not, is there any sort of workaround? | 2014/03/12 | [
"https://Stackoverflow.com/questions/22363701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3412631/"
] | Look no further !!
I'm currently programming in FORTH using the 'Visual Studio Code; editor.
Has (installable) syntax-highlighting for many languages, including FORTH.
Have a try:
<https://code.visualstudio.com/download>
It has even automatic indenting, AND code folding!!
...and let me know if you like it like I do... | I would suggest Gedit and if you change the forth.lang in the app you can change the syntax highlighting |
13,953,102 | I'm trying to get [poshrunner.exe] to be able to run a script in a PowerShell version 2.0 environment on a machine where PowerShell version 3.0 is installed. PowerShell.exe supports this, [although it seems that distinct support for PowerShell 1.0 is dubious](https://stackoverflow.com/questions/5415259/why-is-powershel... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13953102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95195/"
] | I have had all sorts of issues with System.Management.Automation over time. I recently hit it again and decided to find an alternative way to run PowerShell from .NET using a batch file. See this blog post for code samples:
<http://www.nootn.com.au/2013/01/run-powershell-from-net-program-without.html>
This also mentio... | If you go to the references in your project, find the reference and tell it to copy to local that should help too. |
60,683,954 | I'm developing an app in two different languages (fa/en) using [Angular Internationalization (i18n)](https://angular.io/guide/i18n).
* The target is to deploy the two different builds into sub-folders on the server (example.com/en/...)
* These builds are different not only in translation but also styles and layout dir... | 2020/03/14 | [
"https://Stackoverflow.com/questions/60683954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3160597/"
] | In Angular 9 the development server (ng serve) can only be used with a single locale.
However, you can still serve each locale on different ports by running two separate commands:
`ng serve --configuration=fa --port 4200`
`ng serve --configuration=en --port 4201`
Hopefully, they will introduce multiple locale optio... | If you just want to quickly validate the localization for a specific language, like me, just add `"localize": ["<YOUR-LOCALE>"]` to the `angular.json` in `"projects" > "<YOUR PROJECT NAME>" > "architect" > "build" > "configurations" > "development"`. After that, the normal `ng serve` command uses the specified localiza... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.