qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
1,094,511 | I do not want to display all the slashes when displaying the html
What I have is
```
echo "<input type=\"text\" name=\"myname\" value=\"myvalue\"";
```
What I want to do is:
```
echo '<input type="text" name="myname" value="myvalue">';
```
I am looking to save myself from typing all the slashes. Is there a way a... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1094511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26130/"
] | Do not forget you can also do something along the lines of:
```
/* PHP CODE */
?>
--- HTML HERE ---
<input type="text" name="myname" value="myvalue">
<?php
/*PHP CODE */
```
Typically I use the second example with apostrophes.
```
<?php
echo '<input type="text" name="myname" value="myvalue">';
?>
```
As Paolo... | ```
echo '<img src="'.$files[$i].'">';
``` |
2,329,266 | Here's my code:
```
<?php session_start();
require("validationLibrary.php");
$_SESSION['validForm'] = true;
if($_SESSION['validForm'] == true){
header("Location: registerFormTwo.php");
}
?>
<html>
<head>
<title>Registration Form - 1 of 2</title>
</head>
<body>
<h1>Registration - Par... | 2010/02/24 | [
"https://Stackoverflow.com/questions/2329266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Perfect case for grouping!
```
var groups = list.GroupBy(s => s.Attribute1);
var recur_1 = groups.Where(g => g.Count() == 1).SelectMany(s => s);
var recur_2 = groups.Where(g => g.Count() == 2).SelectMany(s => s);
var recur_3 = groups.Where(g => g.Count() == 3).SelectMany(s => s);
``` | ```
seq.Where(l => seq.Count(i => i.attrib1 == l.attrib1) == X);
``` |
2,329,266 | Here's my code:
```
<?php session_start();
require("validationLibrary.php");
$_SESSION['validForm'] = true;
if($_SESSION['validForm'] == true){
header("Location: registerFormTwo.php");
}
?>
<html>
<head>
<title>Registration Form - 1 of 2</title>
</head>
<body>
<h1>Registration - Par... | 2010/02/24 | [
"https://Stackoverflow.com/questions/2329266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
seq.Where(l => seq.Count(i => i.attrib1 == l.attrib1) == X);
``` | ```
public static void Test()
{
var list = new[]
{
new {p1 = 1, p2 = 'a', p3 = 'b'},
new {p1 = 1, p2 = 'c', p3 = 'd'},
new {p1 = 1, p2 = 'e', p3 = 'f'},
new {p1 = 2, p2 = 'a', p3 = 'b'},
new {p1 = 2, ... |
2,329,266 | Here's my code:
```
<?php session_start();
require("validationLibrary.php");
$_SESSION['validForm'] = true;
if($_SESSION['validForm'] == true){
header("Location: registerFormTwo.php");
}
?>
<html>
<head>
<title>Registration Form - 1 of 2</title>
</head>
<body>
<h1>Registration - Par... | 2010/02/24 | [
"https://Stackoverflow.com/questions/2329266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Perfect case for grouping!
```
var groups = list.GroupBy(s => s.Attribute1);
var recur_1 = groups.Where(g => g.Count() == 1).SelectMany(s => s);
var recur_2 = groups.Where(g => g.Count() == 2).SelectMany(s => s);
var recur_3 = groups.Where(g => g.Count() == 3).SelectMany(s => s);
``` | ```
public static void Test()
{
var list = new[]
{
new {p1 = 1, p2 = 'a', p3 = 'b'},
new {p1 = 1, p2 = 'c', p3 = 'd'},
new {p1 = 1, p2 = 'e', p3 = 'f'},
new {p1 = 2, p2 = 'a', p3 = 'b'},
new {p1 = 2, ... |
20,559,116 | I am learning Yii and I wanted to ask a basic question.
I have a controller and there are two actions in that controller which are as follows
```
class MyappController extends Controller
{
public $count=0;
public function actionInitialCount()
{
$this->count=1;
$this->redirect('secondCount');
}
public function action... | 2013/12/13 | [
"https://Stackoverflow.com/questions/20559116",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2799319/"
] | You should acesss value in this way
```
cell.textLabel.text = [[self.myArray objectAtIndex:indexPath.row]objectForKey:@"key"];
```
OR
```
cell.textLabel.text = self.myArray[indexPath.row][@"key"];
``` | In cellForRowAtIndexPath put this line of code...
employeeName data taken from dictionary into which JSON data is put
`cell.textLabel.text = [NSString stringWithFormat:@"%@",[[self.data objectAtIndex:indexPath.row]employeeName]];` |
2,973,367 | Hope this isn't a duplicate.
I was trying the following Problem:
>
> Prove that for any point $p ∈ \Bbb RP\_n$ , $\Bbb RP\_n − p \simeq S^{n−1} \text{ (homotopy equivalent)}$
>
>
>
But I am not quite sure whether the statement is true.
Like, for $n=1$,$\Bbb RP^1 \cong S^1$ (homeomorphic). Thus,$\Bbb RP^1 - p \c... | 2018/10/27 | [
"https://math.stackexchange.com/questions/2973367",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | $$
\newcommand{\rpn} {\Bbb R P^n}
$$
The statement you've got is ... *almost* true (at least for $n \ge 2$). And the case $n = 2$ is particularly misleading, because the *true* statement is that
for any point $Q \in \rpn$,
$$
\rpn - \{Q\} \simeq \Bbb RP^{n-1},
$$
but for $n = 2$, we have (as you observed) that this i... | Your argument for $n=1$ is almost correct, but you probably meant $\pi\_0$ instead of $\pi\_1$. I don't think the statement for $n \geq 2$ is true, but maybe I made a mistake.
See $RP^n$ as $S^n$ with antipodal points identified. Deleting a point on $RP^n$ is the same as deleting the north/south poles on $S^n$ and th... |
34,466,482 | The code below gives a compile error:
```
class Info(val x: String)
object Info {
val default = new Info("top")
}
case class Data(x: String) {
import Info.default
def this() = this(default.x)
}
```
>
> Error:(11, 23) not found: value default
> def this() = this(default.x)
>
>
>
Why is... | 2015/12/25 | [
"https://Stackoverflow.com/questions/34466482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16673/"
] | This is behaving according to specs. The body of the class is part of the so called **primary constructor**. The **auxiliary constructor(s)** needs to start by calling the primary or another auxiliary defined before. Assuming you only have one auxiliary, since the call to primary must be the first statement in your aux... | In scala, any fields defined in the class is not available until after the primary constructor is invoked. To fix it is usually used companion object with `apply` method. |
34,466,482 | The code below gives a compile error:
```
class Info(val x: String)
object Info {
val default = new Info("top")
}
case class Data(x: String) {
import Info.default
def this() = this(default.x)
}
```
>
> Error:(11, 23) not found: value default
> def this() = this(default.x)
>
>
>
Why is... | 2015/12/25 | [
"https://Stackoverflow.com/questions/34466482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16673/"
] | Scoping doesn't work the way you expected because of [the scoping of self constructor invocations](http://www.scala-lang.org/files/archive/spec/2.11/05-classes-and-objects.html#constructor-definitions) (when secondary constructors invoke the primary constructor):
>
> The signature and the self constructor invocation ... | In scala, any fields defined in the class is not available until after the primary constructor is invoked. To fix it is usually used companion object with `apply` method. |
34,466,482 | The code below gives a compile error:
```
class Info(val x: String)
object Info {
val default = new Info("top")
}
case class Data(x: String) {
import Info.default
def this() = this(default.x)
}
```
>
> Error:(11, 23) not found: value default
> def this() = this(default.x)
>
>
>
Why is... | 2015/12/25 | [
"https://Stackoverflow.com/questions/34466482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16673/"
] | Scoping doesn't work the way you expected because of [the scoping of self constructor invocations](http://www.scala-lang.org/files/archive/spec/2.11/05-classes-and-objects.html#constructor-definitions) (when secondary constructors invoke the primary constructor):
>
> The signature and the self constructor invocation ... | This is behaving according to specs. The body of the class is part of the so called **primary constructor**. The **auxiliary constructor(s)** needs to start by calling the primary or another auxiliary defined before. Assuming you only have one auxiliary, since the call to primary must be the first statement in your aux... |
22,066,184 | Is it possible to do optional kerberos authentication?
What I want is: if the client (browser) is not on the domain it is redirected to a username/password web login. Otherwise it will do SPNEGO do Kerberos authentication.
Is there is any solution for this? If Yes what are the configurations we required? | 2014/02/27 | [
"https://Stackoverflow.com/questions/22066184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3337285/"
] | Yes. You can do this. When the server receives an unauthenticated request, it replies with a 401 ("Authorization required") which is a header `WWW-Authenticate` set to `Negotiate`. If the Kerberos authentication fails, the server also send a 401 back.
Whenever the client fails to authenticate (for example, if it doesn... | if you're using Apache, the [Cosign](http://www.weblogin.org/) module can be adjusted to do this with some JavaScript on the (normal, in-band auth) login page, and a second path to the login controller that's Kerberos authenticated. The "regular" login form tests if access to a Kerberos-protected resource succeeds, and... |
22,066,184 | Is it possible to do optional kerberos authentication?
What I want is: if the client (browser) is not on the domain it is redirected to a username/password web login. Otherwise it will do SPNEGO do Kerberos authentication.
Is there is any solution for this? If Yes what are the configurations we required? | 2014/02/27 | [
"https://Stackoverflow.com/questions/22066184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3337285/"
] | Yes. You can do this. When the server receives an unauthenticated request, it replies with a 401 ("Authorization required") which is a header `WWW-Authenticate` set to `Negotiate`. If the Kerberos authentication fails, the server also send a 401 back.
Whenever the client fails to authenticate (for example, if it doesn... | If you're need redirect to login page after server receives an unauthenticated request (like Elias Mårtenson said), you need configure spring security like this:
springSecurity.xml
------------------
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmln... |
24,708,800 | I'm currently developing for iOS 8 and developing an app with the new adaptive framework. The weird part is when I use the the splitviewcontroller on iPhone with this storyboard configuration the app does not start with the master view controller but the detail controller. Is this a bug and how could I be able to fix i... | 2014/07/12 | [
"https://Stackoverflow.com/questions/24708800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3243124/"
] | **UPDATE: Michael Wybrow's answer is better.**
I ran into this issue and found this to work:
```
splitViewController.viewControllers =
UIScreen.mainScreen.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact ?
@[ leftNavigationController ] :
@[ leftNavigationController, rightNavigationCo... | It is probably an error due to the `SplitViewController` being just exclusive to the iPad. Also when you have it in the portrait orientation, it displays the detail view by default and the master view will show as a bar. You will have to change it using some method like `splitViewController:shouldHideViewController:inO... |
24,708,800 | I'm currently developing for iOS 8 and developing an app with the new adaptive framework. The weird part is when I use the the splitviewcontroller on iPhone with this storyboard configuration the app does not start with the master view controller but the detail controller. Is this a bug and how could I be able to fix i... | 2014/07/12 | [
"https://Stackoverflow.com/questions/24708800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3243124/"
] | The thing to realise is that when a split view controller app starts on iPhone 6 Plus in portrait, it is just showing the split view controller in its collapsed state. By default this has the detailed view pushed above any view controllers in the primary navigation controller.
The way to stop a particular view (such ... | It is probably an error due to the `SplitViewController` being just exclusive to the iPad. Also when you have it in the portrait orientation, it displays the detail view by default and the master view will show as a bar. You will have to change it using some method like `splitViewController:shouldHideViewController:inO... |
24,708,800 | I'm currently developing for iOS 8 and developing an app with the new adaptive framework. The weird part is when I use the the splitviewcontroller on iPhone with this storyboard configuration the app does not start with the master view controller but the detail controller. Is this a bug and how could I be able to fix i... | 2014/07/12 | [
"https://Stackoverflow.com/questions/24708800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3243124/"
] | The thing to realise is that when a split view controller app starts on iPhone 6 Plus in portrait, it is just showing the split view controller in its collapsed state. By default this has the detailed view pushed above any view controllers in the primary navigation controller.
The way to stop a particular view (such ... | **UPDATE: Michael Wybrow's answer is better.**
I ran into this issue and found this to work:
```
splitViewController.viewControllers =
UIScreen.mainScreen.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact ?
@[ leftNavigationController ] :
@[ leftNavigationController, rightNavigationCo... |
32,340,889 | The project I'm developing for recently switched to .Net4.5 and Visual Web GUI 10.0.4 and a context menu item that works in Firefox doesn't work in IE11 (our official supported' browser).
I can't post images here yet, so here's a link:
[img]<http://i.imgur.com/oIEca4l.png[/img]>
notice that the firefox windows has 'i... | 2015/09/01 | [
"https://Stackoverflow.com/questions/32340889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4628864/"
] | That's invalid syntax.
The conditional operator is an operator; like all operators, its operands must be expressions. `return` is a statement, not an expression.
Instead, you must return the entire expression:
```
return a ? b : c;
``` | The problem with your expression is that it's not an expression; it's a syntax error. You can't drop `return` into the middle of an expression:
```
return variation > 0 ? 'Positive' : 'Negative';
```
The `return` statement starts with the keyword `return`, and that's (unless I'm forgetting something obscure) the onl... |
32,340,889 | The project I'm developing for recently switched to .Net4.5 and Visual Web GUI 10.0.4 and a context menu item that works in Firefox doesn't work in IE11 (our official supported' browser).
I can't post images here yet, so here's a link:
[img]<http://i.imgur.com/oIEca4l.png[/img]>
notice that the firefox windows has 'i... | 2015/09/01 | [
"https://Stackoverflow.com/questions/32340889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4628864/"
] | That's invalid syntax.
The conditional operator is an operator; like all operators, its operands must be expressions. `return` is a statement, not an expression.
Instead, you must return the entire expression:
```
return a ? b : c;
``` | Having the return in the ternary operator may produce a syntax error. Try this:
```
return (variation > 0) ? "Positive" : "Negative";
``` |
32,340,889 | The project I'm developing for recently switched to .Net4.5 and Visual Web GUI 10.0.4 and a context menu item that works in Firefox doesn't work in IE11 (our official supported' browser).
I can't post images here yet, so here's a link:
[img]<http://i.imgur.com/oIEca4l.png[/img]>
notice that the firefox windows has 'i... | 2015/09/01 | [
"https://Stackoverflow.com/questions/32340889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4628864/"
] | The problem with your expression is that it's not an expression; it's a syntax error. You can't drop `return` into the middle of an expression:
```
return variation > 0 ? 'Positive' : 'Negative';
```
The `return` statement starts with the keyword `return`, and that's (unless I'm forgetting something obscure) the onl... | Having the return in the ternary operator may produce a syntax error. Try this:
```
return (variation > 0) ? "Positive" : "Negative";
``` |
236,100 | I have a small C# project that reads a file and gives me an output: a string that does not contain spaces nor any types of punctuation marks. It may also contain a few misspellings.
Ex.
Output:
THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG
**I wonder if there is a way to analyze this string by using text mining/data minin... | 2014/04/16 | [
"https://softwareengineering.stackexchange.com/questions/236100",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/127092/"
] | Here is the general approach:
1. Read a dictionary file and organize all words in a [trie](https://en.wikipedia.org/wiki/Trie) data structure. Many Unix systems have such files in the `/usr/share/dict/` directory.
2. Find possible matches of a prefix of your input in the trie. This will usually produce multiple matche... | Thanks to [amon](https://softwareengineering.stackexchange.com/users/60357/amon) I managed to get the algorithm going!
By using [this here](http://geekyisawesome.blogspot.se/2010/07/c-trie.html) code a Trie was implemented and filled with the english dictionary (around 23600 words).
By starting reading from each inde... |
4,097,026 | I managed to get the address of a .net object by
```
GCHandle objHandle = GCHandle.Alloc(obj,GCHandleType.WeakTrackResurrection);
int address = GCHandle.ToIntPtr(objHandle).ToInt32();
```
and I can recall the object by
```
Object obj = GCHandle.FromIntPtr(IntPtr(address)).Target;
```
Well, the purpose is to sto... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4097026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425817/"
] | You'll want to pin the GCHandle to stop the object moving around, as the GC moves objects around, so an unpinned pointer could become invalid. Pinning the object stops it moving:
```
GCHandle handle = GCHandle.Alloc(obj, GCHandleType.Pinned);
IntPtr ptr = handle.AddrOfPinnedObject();
```
You'll also have to free the... | >
> AFAIK the address does not change because of allocing, is it true
>
>
>
The address of a managed object *does* change. The garbage collector is free to move objects in memory. When the garbage collector runs, it collects unused objects, then rearranges the remaining objects to minimize the overall size of the ... |
4,097,026 | I managed to get the address of a .net object by
```
GCHandle objHandle = GCHandle.Alloc(obj,GCHandleType.WeakTrackResurrection);
int address = GCHandle.ToIntPtr(objHandle).ToInt32();
```
and I can recall the object by
```
Object obj = GCHandle.FromIntPtr(IntPtr(address)).Target;
```
Well, the purpose is to sto... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4097026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425817/"
] | As Tim and thecoop has pointed out, GCHandle.Alloc may prevent garbage collection but actual object address can change as GC may move object around unless you pin the object. Further, your code is using `GCHandleType.WeakTrackResurrection` and that would not event prevent the garbage collection. `GCHandle.ToIntPtr` wil... | >
> AFAIK the address does not change because of allocing, is it true
>
>
>
The address of a managed object *does* change. The garbage collector is free to move objects in memory. When the garbage collector runs, it collects unused objects, then rearranges the remaining objects to minimize the overall size of the ... |
4,097,026 | I managed to get the address of a .net object by
```
GCHandle objHandle = GCHandle.Alloc(obj,GCHandleType.WeakTrackResurrection);
int address = GCHandle.ToIntPtr(objHandle).ToInt32();
```
and I can recall the object by
```
Object obj = GCHandle.FromIntPtr(IntPtr(address)).Target;
```
Well, the purpose is to sto... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4097026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425817/"
] | What you are getting is not actually an address.
As you notice, it seems to act like an address most of the time, and you can recall the object, by using GCHandle.FromIntPtr. However, the interesting issue is that you are using **GCHandleType.WeakTrackResurrection**.
If your weakly referenced object gets collected (i... | >
> AFAIK the address does not change because of allocing, is it true
>
>
>
The address of a managed object *does* change. The garbage collector is free to move objects in memory. When the garbage collector runs, it collects unused objects, then rearranges the remaining objects to minimize the overall size of the ... |
4,097,026 | I managed to get the address of a .net object by
```
GCHandle objHandle = GCHandle.Alloc(obj,GCHandleType.WeakTrackResurrection);
int address = GCHandle.ToIntPtr(objHandle).ToInt32();
```
and I can recall the object by
```
Object obj = GCHandle.FromIntPtr(IntPtr(address)).Target;
```
Well, the purpose is to sto... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4097026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425817/"
] | As Tim and thecoop has pointed out, GCHandle.Alloc may prevent garbage collection but actual object address can change as GC may move object around unless you pin the object. Further, your code is using `GCHandleType.WeakTrackResurrection` and that would not event prevent the garbage collection. `GCHandle.ToIntPtr` wil... | You'll want to pin the GCHandle to stop the object moving around, as the GC moves objects around, so an unpinned pointer could become invalid. Pinning the object stops it moving:
```
GCHandle handle = GCHandle.Alloc(obj, GCHandleType.Pinned);
IntPtr ptr = handle.AddrOfPinnedObject();
```
You'll also have to free the... |
4,097,026 | I managed to get the address of a .net object by
```
GCHandle objHandle = GCHandle.Alloc(obj,GCHandleType.WeakTrackResurrection);
int address = GCHandle.ToIntPtr(objHandle).ToInt32();
```
and I can recall the object by
```
Object obj = GCHandle.FromIntPtr(IntPtr(address)).Target;
```
Well, the purpose is to sto... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4097026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425817/"
] | You'll want to pin the GCHandle to stop the object moving around, as the GC moves objects around, so an unpinned pointer could become invalid. Pinning the object stops it moving:
```
GCHandle handle = GCHandle.Alloc(obj, GCHandleType.Pinned);
IntPtr ptr = handle.AddrOfPinnedObject();
```
You'll also have to free the... | What you are getting is not actually an address.
As you notice, it seems to act like an address most of the time, and you can recall the object, by using GCHandle.FromIntPtr. However, the interesting issue is that you are using **GCHandleType.WeakTrackResurrection**.
If your weakly referenced object gets collected (i... |
4,097,026 | I managed to get the address of a .net object by
```
GCHandle objHandle = GCHandle.Alloc(obj,GCHandleType.WeakTrackResurrection);
int address = GCHandle.ToIntPtr(objHandle).ToInt32();
```
and I can recall the object by
```
Object obj = GCHandle.FromIntPtr(IntPtr(address)).Target;
```
Well, the purpose is to sto... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4097026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425817/"
] | As Tim and thecoop has pointed out, GCHandle.Alloc may prevent garbage collection but actual object address can change as GC may move object around unless you pin the object. Further, your code is using `GCHandleType.WeakTrackResurrection` and that would not event prevent the garbage collection. `GCHandle.ToIntPtr` wil... | What you are getting is not actually an address.
As you notice, it seems to act like an address most of the time, and you can recall the object, by using GCHandle.FromIntPtr. However, the interesting issue is that you are using **GCHandleType.WeakTrackResurrection**.
If your weakly referenced object gets collected (i... |
18,135,864 | I am trying to get all @events where that have a `FiscalYear.id` in`IList<int> years`. I am using `any()` but it is throwing the following stacktrace error:
```
Unrecognised method call:
System.Linq.Enumerable:Boolean Any[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Bool... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18135864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/802331/"
] | Try using the [`Contains`](http://msdn.microsoft.com/en-us/library/bb338641.aspx) method instead:
```
IList<Domain.Event> results = session
.QueryOver<Event>()
.Where(e => !@event.IsDeleted &&
@event.EventType.Id == eventTypeId &&
years.Contains(@event.FiscalYear.Id))
.ToList();
```
Or b... | You could try this:
```
IList<Domain.Event> results = session.QueryOver<Event>().ToList().FindAll(e => !e.IsDeleted && e.Id.Equals(eventTypeId) && years.Contains(e.FiscalYear.Id))
``` |
18,135,864 | I am trying to get all @events where that have a `FiscalYear.id` in`IList<int> years`. I am using `any()` but it is throwing the following stacktrace error:
```
Unrecognised method call:
System.Linq.Enumerable:Boolean Any[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Bool... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18135864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/802331/"
] | Looks like you are trying to use a Linq method in `QueryOver`. This isn't supported. Try using the Linq provider instead:
```
FindAllPaged(int eventTypeId, IList<int> aors, IList<int> years)
{
IList<Domain.Event> results =
session.Query<Event>()
.Where(@event => !@event.IsDeleted &&
@event.EventType.... | You could try this:
```
IList<Domain.Event> results = session.QueryOver<Event>().ToList().FindAll(e => !e.IsDeleted && e.Id.Equals(eventTypeId) && years.Contains(e.FiscalYear.Id))
``` |
18,135,864 | I am trying to get all @events where that have a `FiscalYear.id` in`IList<int> years`. I am using `any()` but it is throwing the following stacktrace error:
```
Unrecognised method call:
System.Linq.Enumerable:Boolean Any[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Bool... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18135864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/802331/"
] | I also encountered the same exception message
>
> Unrecognised method call:
> System.Linq.Enumerable:Boolean Any[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Boolean])
>
>
>
when using IqueryOver with Contains method
```
Ex:
var departmentTypesArray = criteria.Dep... | You could try this:
```
IList<Domain.Event> results = session.QueryOver<Event>().ToList().FindAll(e => !e.IsDeleted && e.Id.Equals(eventTypeId) && years.Contains(e.FiscalYear.Id))
``` |
16,738,595 | I would like to have for example a `LinearLayout` or a `RelativeLayout` sliding from the left of the screen instead of a lone `ListView`.
I tried to use à `LinearLayout` with `android:layout_gravity="start"` and i had this error at runtime:
```
ClassCastException: android.widget.LinearLayout$LayoutParams cannot
be c... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16738595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058369/"
] | Yes it is possible to have any view as the sliding part of a drawer layout. I prefer declaring a FrameLayout as the drawer and replacing it with my fragment, and it runs just fine.
The error you are getting is probably due to some other reason in the Java part of your implementation. | Try moving `android:id="@+id/left_drawer"` to the LinearLayout instead of the `ListView` |
16,738,595 | I would like to have for example a `LinearLayout` or a `RelativeLayout` sliding from the left of the screen instead of a lone `ListView`.
I tried to use à `LinearLayout` with `android:layout_gravity="start"` and i had this error at runtime:
```
ClassCastException: android.widget.LinearLayout$LayoutParams cannot
be c... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16738595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058369/"
] | This will work if you move both the `android:id="@+id/left_drawer"` (or create a new id) and set the gravity.
The id move (or new one) is so the reference is correct so you call `closeDrawer()` on it and not the child views.
But most importantly, the `DrawerLayout` requires that element to have a `android:layout_grav... | Try moving `android:id="@+id/left_drawer"` to the LinearLayout instead of the `ListView` |
16,738,595 | I would like to have for example a `LinearLayout` or a `RelativeLayout` sliding from the left of the screen instead of a lone `ListView`.
I tried to use à `LinearLayout` with `android:layout_gravity="start"` and i had this error at runtime:
```
ClassCastException: android.widget.LinearLayout$LayoutParams cannot
be c... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16738595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058369/"
] | Make sure you pass correct object (your `LinearLayout` called mDrawerLinear) for methods like `isDrawerOpen, closeDrawer` etc. This line solved my `ClassCastException`:
```
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerLinear);
``` | Try moving `android:id="@+id/left_drawer"` to the LinearLayout instead of the `ListView` |
16,738,595 | I would like to have for example a `LinearLayout` or a `RelativeLayout` sliding from the left of the screen instead of a lone `ListView`.
I tried to use à `LinearLayout` with `android:layout_gravity="start"` and i had this error at runtime:
```
ClassCastException: android.widget.LinearLayout$LayoutParams cannot
be c... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16738595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058369/"
] | Yes it is possible to have any view as the sliding part of a drawer layout. I prefer declaring a FrameLayout as the drawer and replacing it with my fragment, and it runs just fine.
The error you are getting is probably due to some other reason in the Java part of your implementation. | Make sure you pass correct object (your `LinearLayout` called mDrawerLinear) for methods like `isDrawerOpen, closeDrawer` etc. This line solved my `ClassCastException`:
```
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerLinear);
``` |
16,738,595 | I would like to have for example a `LinearLayout` or a `RelativeLayout` sliding from the left of the screen instead of a lone `ListView`.
I tried to use à `LinearLayout` with `android:layout_gravity="start"` and i had this error at runtime:
```
ClassCastException: android.widget.LinearLayout$LayoutParams cannot
be c... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16738595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058369/"
] | This will work if you move both the `android:id="@+id/left_drawer"` (or create a new id) and set the gravity.
The id move (or new one) is so the reference is correct so you call `closeDrawer()` on it and not the child views.
But most importantly, the `DrawerLayout` requires that element to have a `android:layout_grav... | Make sure you pass correct object (your `LinearLayout` called mDrawerLinear) for methods like `isDrawerOpen, closeDrawer` etc. This line solved my `ClassCastException`:
```
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerLinear);
``` |
32,942,635 | I am working on Android Application; which register user and provide services to registered user using web services...
Now How will register user using my app ?... Here is the services code.
WebServices:
```
{"USERDETAIL DETAIL":[{"post":{"id":"42","fname":"hanif","lname":"khan","address":"Dhok Saiydan Road, Rawal... | 2015/10/05 | [
"https://Stackoverflow.com/questions/32942635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5057162/"
] | You can define a `keyup` event on the text input and calculate the total relative to the input values.
Following is how it shall be done, but you really need a code refactor..
```
$('input[type=text]').keyup(function(){
var total = 0;
$(".tot_amount:checked").each(function()
... | Here this code show exact result what you wants. if you unchecked checkbox than it will assign your default value.
use this :
```
<script>
$(".tot_amount").click(function(event) {
var total = 0;
$(".tot_amount:checked").each(function()
{
var inputVal = $(this).parent().f... |
27,716,872 | I imported the Facebook SDK (v3.21.1) module into Android Studio (v1.0.2), and am trying to create a LoginActivity with `com.facebook.widget.LoginButton` as suggested [in the documentation](https://developers.facebook.com/docs/android/login-with-facebook/v2.2#step1) with the following code:
```
<LinearLayout xmlns:and... | 2014/12/31 | [
"https://Stackoverflow.com/questions/27716872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1986871/"
] | Have you integrated the Facebook SDK into your project? Check the `build.gradle` of your module and make sure that Facebook SDK is in dependencies. If not, add it and sync with Gradle and then try again.
The Facebook module should be added to the dependencies in `build.gradle` of the project that uses it:
```
depende... | For those who still have problem,
change `com.facebook.widget.LoginButton` to `com.facebook.login.widget.LoginButton` might help. |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | After you select the minimum repeat option (5 minutes or 10 minutes) you can highlight the number and write whatever number you want | In the "Repeat Task every:" just type 2 minutes instead of choosing from the dropdown list. |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | The task must be configured in two steps.
First you create a simple task that start at 0:00, every day. Then, you go in `Advanced...` (or similar depending on the operating system you are on) and select the `Repeat every X minutes` option for 24 hours.
The key here is to find the advanced properties. If you are using... | You can also create a batch file like the following if you need finer granularity between calls:
```
:loop
call YourScript.Exe
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop
``` |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | [](https://i.stack.imgur.com/XEIVz.png)
While taking the advice above with schtasks, you can see in the UI what must be done to perform an hourly task. When you edit trigger begin the task on a schedule, One Time (this is the key). Then you can select "Repeat ... | To schedule the update to be automatic you should:
* Go to Control Panel » Administrative Tools » Scheduled Tasks
* Create the (basic) task
* Go to Schedule » Advanced
* Check the box for "Repeat Task" every 10 minutes with a duration of, e.g. 24 hours or Indefinitely
* Leave End Date unchecked
If you cannot find the... |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | The task must be configured in two steps.
First you create a simple task that start at 0:00, every day. Then, you go in `Advanced...` (or similar depending on the operating system you are on) and select the `Repeat every X minutes` option for 24 hours.
The key here is to find the advanced properties. If you are using... | In the "Repeat Task every:" just type 2 minutes instead of choosing from the dropdown list. |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | The task must be configured in two steps.
First you create a simple task that start at 0:00, every day. Then, you go in `Advanced...` (or similar depending on the operating system you are on) and select the `Repeat every X minutes` option for 24 hours.
The key here is to find the advanced properties. If you are using... | [](https://i.stack.imgur.com/XEIVz.png)
While taking the advice above with schtasks, you can see in the UI what must be done to perform an hourly task. When you edit trigger begin the task on a schedule, One Time (this is the key). Then you can select "Repeat ... |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | After you select the minimum repeat option (5 minutes or 10 minutes) you can highlight the number and write whatever number you want | To schedule the update to be automatic you should:
* Go to Control Panel » Administrative Tools » Scheduled Tasks
* Create the (basic) task
* Go to Schedule » Advanced
* Check the box for "Repeat Task" every 10 minutes with a duration of, e.g. 24 hours or Indefinitely
* Leave End Date unchecked
If you cannot find the... |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | On XP, I clicked the `Advanced` button on the `Schedule` tab. There is a checkbox for `Repeat task`. The default is every 10 minutes.
Additionally, you can create scheduled task [via the command line](http://support.microsoft.com/kb/814596). I haven't tried this myself, but it looks like you'd want something along the... | Some of the links provided are *only* settings for Windows 2003's version of "Scheduled Tasks"
In Windows Server 2008 the "Tasks" setup *only* has a box with options for "5 Minutes, 10 minutes, 15 minutes, 30 mins, and 1 hour" (screen shot: <http://i46.tinypic.com/2gwx7r8.jpg>)... where the Window 2003 was a "enter wh... |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | In the "Repeat Task every:" just type 2 minutes instead of choosing from the dropdown list. | Some of the links provided are *only* settings for Windows 2003's version of "Scheduled Tasks"
In Windows Server 2008 the "Tasks" setup *only* has a box with options for "5 Minutes, 10 minutes, 15 minutes, 30 mins, and 1 hour" (screen shot: <http://i46.tinypic.com/2gwx7r8.jpg>)... where the Window 2003 was a "enter wh... |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | After you select the minimum repeat option (5 minutes or 10 minutes) you can highlight the number and write whatever number you want | Some of the links provided are *only* settings for Windows 2003's version of "Scheduled Tasks"
In Windows Server 2008 the "Tasks" setup *only* has a box with options for "5 Minutes, 10 minutes, 15 minutes, 30 mins, and 1 hour" (screen shot: <http://i46.tinypic.com/2gwx7r8.jpg>)... where the Window 2003 was a "enter wh... |
4,249,542 | I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution.
Is there a way I can get it to run a .exe every 10 or 20 minutes? | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352157/"
] | In the "Repeat Task every:" just type 2 minutes instead of choosing from the dropdown list. | To schedule the update to be automatic you should:
* Go to Control Panel » Administrative Tools » Scheduled Tasks
* Create the (basic) task
* Go to Schedule » Advanced
* Check the box for "Repeat Task" every 10 minutes with a duration of, e.g. 24 hours or Indefinitely
* Leave End Date unchecked
If you cannot find the... |
56,714,600 | When the request from postman initiated with the json as given below, I get `hello undefined` as response.
request json
```
{
"name":"test"
}
```
my middleware
```
import express from 'express';
import bodyParser from 'body-parser';
const app = express();
app.use(bodyParser.json());
app.get('/hello', (req, res)=... | 2019/06/22 | [
"https://Stackoverflow.com/questions/56714600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2661429/"
] | Since express 4.16.0 you can use app.use(express.json()); to get the json data from request,in your case it would be.You don't require to use bodyparser and all.
```
const app = express();
app.use(bodyParser.json()); // remove this
app.use(express.json())// add this line
``` | Actually issue is not with the code. The Postman client making the request didn't mark it as `application/json` type request. Once I rectified it, it just worked as expected. |
56,714,600 | When the request from postman initiated with the json as given below, I get `hello undefined` as response.
request json
```
{
"name":"test"
}
```
my middleware
```
import express from 'express';
import bodyParser from 'body-parser';
const app = express();
app.use(bodyParser.json());
app.get('/hello', (req, res)=... | 2019/06/22 | [
"https://Stackoverflow.com/questions/56714600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2661429/"
] | Since express 4.16.0 you can use app.use(express.json()); to get the json data from request,in your case it would be.You don't require to use bodyparser and all.
```
const app = express();
app.use(bodyParser.json()); // remove this
app.use(express.json())// add this line
``` | use bodyParser as meddleware
```
const app = express();
app.use(bodyParser.urlencoded({ extended: true })); //add this
app.use(bodyParser.json());
```
also
```
app.post('/hello', (req, res)=>{
console.log(req.body);
name.push(req.body.name) // add this if you store in array
return res.send(`hello ${req.body... |
56,714,600 | When the request from postman initiated with the json as given below, I get `hello undefined` as response.
request json
```
{
"name":"test"
}
```
my middleware
```
import express from 'express';
import bodyParser from 'body-parser';
const app = express();
app.use(bodyParser.json());
app.get('/hello', (req, res)=... | 2019/06/22 | [
"https://Stackoverflow.com/questions/56714600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2661429/"
] | Actually issue is not with the code. The Postman client making the request didn't mark it as `application/json` type request. Once I rectified it, it just worked as expected. | use bodyParser as meddleware
```
const app = express();
app.use(bodyParser.urlencoded({ extended: true })); //add this
app.use(bodyParser.json());
```
also
```
app.post('/hello', (req, res)=>{
console.log(req.body);
name.push(req.body.name) // add this if you store in array
return res.send(`hello ${req.body... |
46,711,211 | I've a `ConstraintLayout` with the following hierarchy:
```
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
... | 2017/10/12 | [
"https://Stackoverflow.com/questions/46711211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423773/"
] | Try like this :
```
<app-item [listItem]="item" (itemDeleted)="onItemDeleted(i)"></app-item>
onItemDeleted(index){
this.toDoList.splice(index, 1);
}
``` | Without looking at your code, a simple way to delete items from your array.
```
myArray = myArray.filter(x => x.ITEM !== ITEM);
```
\*Edit: spelling |
46,711,211 | I've a `ConstraintLayout` with the following hierarchy:
```
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
... | 2017/10/12 | [
"https://Stackoverflow.com/questions/46711211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423773/"
] | You can use .filter():
```
onDeleteItem(id: number) {
this.list = this.list.filter(item => item.id !== id);
}
```
or you can user [.splice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice), but to use it you will need to get the index of the item in the array:
```... | Without looking at your code, a simple way to delete items from your array.
```
myArray = myArray.filter(x => x.ITEM !== ITEM);
```
\*Edit: spelling |
46,711,211 | I've a `ConstraintLayout` with the following hierarchy:
```
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
... | 2017/10/12 | [
"https://Stackoverflow.com/questions/46711211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423773/"
] | Try like this :
```
<app-item [listItem]="item" (itemDeleted)="onItemDeleted(i)"></app-item>
onItemDeleted(index){
this.toDoList.splice(index, 1);
}
``` | You can use .filter():
```
onDeleteItem(id: number) {
this.list = this.list.filter(item => item.id !== id);
}
```
or you can user [.splice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice), but to use it you will need to get the index of the item in the array:
```... |
46,711,211 | I've a `ConstraintLayout` with the following hierarchy:
```
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
... | 2017/10/12 | [
"https://Stackoverflow.com/questions/46711211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423773/"
] | Try like this :
```
<app-item [listItem]="item" (itemDeleted)="onItemDeleted(i)"></app-item>
onItemDeleted(index){
this.toDoList.splice(index, 1);
}
``` | You can use the folowing code :
at the start we announce rowItems :
```
rowItems: RowItems= new RowItems(0, "", "", new Array<Something>());
```
....
method in code
```
deleteRowOfSomething(rowIndex: number) {
console.log("removing row index: " + rowIndex);
this.rowItems.splice(rowIndex, 1);
... |
46,711,211 | I've a `ConstraintLayout` with the following hierarchy:
```
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
... | 2017/10/12 | [
"https://Stackoverflow.com/questions/46711211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423773/"
] | You can use .filter():
```
onDeleteItem(id: number) {
this.list = this.list.filter(item => item.id !== id);
}
```
or you can user [.splice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice), but to use it you will need to get the index of the item in the array:
```... | You can use the folowing code :
at the start we announce rowItems :
```
rowItems: RowItems= new RowItems(0, "", "", new Array<Something>());
```
....
method in code
```
deleteRowOfSomething(rowIndex: number) {
console.log("removing row index: " + rowIndex);
this.rowItems.splice(rowIndex, 1);
... |
32,386,231 | I have an App which constantly polls for location when its in travelling mode. My issue is that once the screen is locked, the App can no longer access the geolocation from the phone.
I have managed to find this plugin but it requires I purchase it for the capability to work in Android.
<http://shop.transistorsoft.co... | 2015/09/03 | [
"https://Stackoverflow.com/questions/32386231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1908909/"
] | Another option is to use a [partial wakelock](http://developer.android.com/reference/android/os/PowerManager.html#PARTIAL_WAKE_LOCK) on Android to keep your app alive while in the background (screen off or switched out of foreground). You'd need to do this via a plugin, but it would have the same effect as a background... | Have you looked at [NG-Cordova](http://ngcordova.com/)?
first add ng-cordova to your project:
```
bower install ngCordova
or
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>
```
Then inject it:
```
angular.module('myApp', ['ngCordova'])
```
Here is a plugin you could... |
32,199,870 | I am trying to pass a variable from js to a `backoffice` page.
So far I've tried using a form and submitting it from javascript (but that refreshes the page, which I don't want)
* I ditched the form and when for an iframe (so the page doesn't reload everytime the data is submitted). The function is run every few seco... | 2015/08/25 | [
"https://Stackoverflow.com/questions/32199870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/631924/"
] | And i think you no need to use form or iframe for this purpose . You just want to know the user onf without refreshing then use the following method with ajax.
`index.html` the code in this will
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
navigator.geo... | Instead of using iframe to submit your form with out reloading you submit form using ajax call.
```
$.ajax({
type: "POST",
url: url,
data: $("#formId").serialize(), // This will hold the form data
success: success, // Action to perform on success
dataType: "JSON" or "HTML" or "TEXT" // return type of functio... |
32,199,870 | I am trying to pass a variable from js to a `backoffice` page.
So far I've tried using a form and submitting it from javascript (but that refreshes the page, which I don't want)
* I ditched the form and when for an iframe (so the page doesn't reload everytime the data is submitted). The function is run every few seco... | 2015/08/25 | [
"https://Stackoverflow.com/questions/32199870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/631924/"
] | And i think you no need to use form or iframe for this purpose . You just want to know the user onf without refreshing then use the following method with ajax.
`index.html` the code in this will
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
navigator.geo... | You can use plugin ajaxForm. On action and method you can form options
```js
$(function() {
$('#form_f').ajaxForm({
beforeSubmit: ShowRequest, //show request
success:SubmitSuccesful, //success
error: AjaxError //error
});
});
``` |
32,199,870 | I am trying to pass a variable from js to a `backoffice` page.
So far I've tried using a form and submitting it from javascript (but that refreshes the page, which I don't want)
* I ditched the form and when for an iframe (so the page doesn't reload everytime the data is submitted). The function is run every few seco... | 2015/08/25 | [
"https://Stackoverflow.com/questions/32199870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/631924/"
] | And i think you no need to use form or iframe for this purpose . You just want to know the user onf without refreshing then use the following method with ajax.
`index.html` the code in this will
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
navigator.geo... | Lakhan is right, you should try to use ajax instead of an iframe as they cause a lot of issues. If you absolutely need to use an iframe add a target attribute to your form (target the iframe not the main page) and only the iframe will reload.
```
<form action="action" method="post" target="target_frame">
<!-- inpu... |
32,199,870 | I am trying to pass a variable from js to a `backoffice` page.
So far I've tried using a form and submitting it from javascript (but that refreshes the page, which I don't want)
* I ditched the form and when for an iframe (so the page doesn't reload everytime the data is submitted). The function is run every few seco... | 2015/08/25 | [
"https://Stackoverflow.com/questions/32199870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/631924/"
] | And i think you no need to use form or iframe for this purpose . You just want to know the user onf without refreshing then use the following method with ajax.
`index.html` the code in this will
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
navigator.geo... | Here's a fully worked example that makes use of a `<form>`, the `FormData` object and AJAX to do the submission. It will update the page every 5 seconds. Do note that in PHP, the use of single quotes ( ' ) and double quotes ( " ) is *not always interchangeable*. If you use single quotes, the contents are printed litera... |
16,156,088 | I have a set of radio buttons:
```
<input type="radio" name="attending_days" value="06-18-13"/>Tuesday June 18, 2013
<input type="radio" name="attending_days" value="06-18-13"/>Wednesday June 19, 2013
<input type="radio" name="attending_days" value="both_days"/>Both days
```
Checkboxes:
```
<div id="checkboxes">
<... | 2013/04/22 | [
"https://Stackoverflow.com/questions/16156088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1896181/"
] | Demo: <http://jsfiddle.net/terryyounghk/xLCzp/>
```
$('input[name=checkboxes]').on('click', function () {
var lastOneChecked = $('input[name=attending_days]:last:checked').length,
iLimit = lastOneChecked ? 8 : 4,
iChecked = $('input[name=checkboxes]:checked').length;
if (iChecked > iLimit) {
... | An example would be using `classes`. You give each `radio button` and its `checkboxes` a class.
```
<input type="radio" class='both' name="attending_days" value="both_days"/>Both days
```
And checkboxes: (note that the checkboxes are **disabled**)
```
<input type="checkbox" class='both' name="checkboxes" value ="1"... |
16,156,088 | I have a set of radio buttons:
```
<input type="radio" name="attending_days" value="06-18-13"/>Tuesday June 18, 2013
<input type="radio" name="attending_days" value="06-18-13"/>Wednesday June 19, 2013
<input type="radio" name="attending_days" value="both_days"/>Both days
```
Checkboxes:
```
<div id="checkboxes">
<... | 2013/04/22 | [
"https://Stackoverflow.com/questions/16156088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1896181/"
] | Demo: <http://jsfiddle.net/terryyounghk/xLCzp/>
```
$('input[name=checkboxes]').on('click', function () {
var lastOneChecked = $('input[name=attending_days]:last:checked').length,
iLimit = lastOneChecked ? 8 : 4,
iChecked = $('input[name=checkboxes]:checked').length;
if (iChecked > iLimit) {
... | You can create a global look-up table of the Ids or values.
```
var lookup = {};
lookup['rdo1'] = ['rdo2','rdo3','rdo4'];
lookup['rdo2'] = ['rdo5','rdo6','rdo7'];
...and so on...
```
Then, when a radiobutton is clicked, in the handler
```
// grabs all of the ids from the lookup
var ids = lookup[$(this).attr('id... |
19,595,184 | I have a NodeJs application that listens to messages via subscribe on a Redis server. It collects the messages for a period of 5 Seconds and then pushes them out to the connected clients, the code looks something like this:
```
io.sockets.on('connection', function (socket) {
nClients++;
console.log("Number of ... | 2013/10/25 | [
"https://Stackoverflow.com/questions/19595184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970902/"
] | It is better you try some tools for finding leaks in node.js.
**Tools for Finding Leaks**
* Jimb Esser’s [node-mtrace](https://github.com/Jimbly/node-mtrace), which uses the
GCC mtrace utility to profile heap usage.
* Dave Pacheco’s [node-heap-dump](https://github.com/davepacheco/node-heap-dump) takes a snapshot of t... | It looks to me that you keep adding keys to the global `ablv_last_message` object and never clean it. |
19,595,184 | I have a NodeJs application that listens to messages via subscribe on a Redis server. It collects the messages for a period of 5 Seconds and then pushes them out to the connected clients, the code looks something like this:
```
io.sockets.on('connection', function (socket) {
nClients++;
console.log("Number of ... | 2013/10/25 | [
"https://Stackoverflow.com/questions/19595184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/970902/"
] | It is better you try some tools for finding leaks in node.js.
**Tools for Finding Leaks**
* Jimb Esser’s [node-mtrace](https://github.com/Jimbly/node-mtrace), which uses the
GCC mtrace utility to profile heap usage.
* Dave Pacheco’s [node-heap-dump](https://github.com/davepacheco/node-heap-dump) takes a snapshot of t... | You may use Object.getOwnPropertyNames rather than Object.keys |
67,189,618 | how to use index of numpy.array in numba.njit()? In the following, if numba.njit is used, the code will exit with an error. I find that the error dues to "b = a[idx]". But in fact, that should be right in python. How to correct that in numba? thx
```
@numba.njit()
def test(a):
idx = np.where(a>5)
b = a[idx]
... | 2021/04/21 | [
"https://Stackoverflow.com/questions/67189618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15619640/"
] | The [docs](https://numba.pydata.org/numba-doc/dev/reference/numpysupported.html#array-access) say that *a subset of advanced indexing is also supported: only one advanced index is allowed, and it has to be a one-dimensional array*.
And if you run your code without numba, you can see that the result is an 1D array anyw... | Checkout this documentation
<http://numba.pydata.org/numba-doc/0.15.1/arrays.html>
b = test(a)
try to change the variable here like
k=test(a), as I think test(a) = b and that would mean like b=b
just try if it works ... |
284,771 | Let $p$ be a prime number, $n$ be a positive integer, and let ${\mathbb Z}\_p^{n\times n}$ denote the set of $n\times n$-matrices over ${\mathbb Z}/p{\mathbb Z}$.
Suppose we are given an integer $m>0$ and matrices ${\bf A}\_1,\ldots, {\bf A}\_m\in {\mathbb Z}\_p^{n\times n}.$ I am looking at the following problem: if ... | 2017/10/30 | [
"https://mathoverflow.net/questions/284771",
"https://mathoverflow.net",
"https://mathoverflow.net/users/8628/"
] | Yes. If we conider the sequence $A\_i^n$, because it is a sequence inside a finite set, it must eventually repeat. After it repeats, the sequence won't take any new values, so we can assume $n\_i$ is less than this first repetition. This means that there are only finitely many possibilities, which of course reduces the... | Even more is decidable: we may get a list of all possible spaces which are images of the operator $A\_1^{n\_1}\dots A\_m^{n\_m}$.
Induction in $m$. Base $m=1$. Consider the spaces $X\_k=A^k(\mathbb{Z}\_p^n)$. Two of them coincide, since they take only finitely many possible values (and we know an a priori estimate fo... |
42,061,912 | I'm working on this project that have foreign keys on two tables. By using a form I'm trying to insert a new record to the database. And there's also an image path in the db and I'm inserting the image path via the form. I'm using codeigniter file upload library. Other fields of the database table get updated when i su... | 2017/02/06 | [
"https://Stackoverflow.com/questions/42061912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5832930/"
] | You should use "update" query on the behalf of insert in add\_product\_images().
Because "insert" will add a new record of the product and there is no any category id(Foreign Key) with this that's why shows this error.
So try to update image. | [](https://i.stack.imgur.com/GtIfW.png)
you have two variables with the same name and thats the problem.
You need have different variable name.
I hope this will help you. |
42,061,912 | I'm working on this project that have foreign keys on two tables. By using a form I'm trying to insert a new record to the database. And there's also an image path in the db and I'm inserting the image path via the form. I'm using codeigniter file upload library. Other fields of the database table get updated when i su... | 2017/02/06 | [
"https://Stackoverflow.com/questions/42061912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5832930/"
] | You should use "update" query on the behalf of insert in add\_product\_images().
Because "insert" will add a new record of the product and there is no any category id(Foreign Key) with this that's why shows this error.
So try to update image. | there are some problems in this script
1. if model you wrote, function add product. if your query failed, returns -1 otherwise return product Id
but if product was in database it returns 0, then in controller: you check if product\_id != 0 then insert images. so you don't care if product didn't exists in database, you... |
33,117,693 | I am learning angular js from ground up and am currently trying to retrieve data from a json file.
I am using - nodejs, express, AngularJS.
Earlier I was getting an error "Unexpected token D" on using -
```
$http.get("/models/driversList.json").success(function(response){$scope.driversList = response})
```
which g... | 2015/10/14 | [
"https://Stackoverflow.com/questions/33117693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1906636/"
] | You can try to use substring function like this:
```
var mystring = "5,4,3,2,1";
alert( mystring.substr(0, 1) + mystring.substr(3));
```
**[JSFIDDLE DEMO](http://jsfiddle.net/63g51tbd/)** | I would juse use javascripts `split` function for that.
So if you have
```
var string = "5,4,3,2,1";
```
than you just need to do
```
var splitted = string.split(",");
```
whereas the character in the brackets is the one you want to split on. After you did that, you can just make a new string, and build it w... |
12,220,012 | Here is my scenario. I have a cube designed to track the hiring process of an applicant for a job. So, they go from applying, to hired, and sometimes to termination.
I want to find the number of employees that are hired in a particular month and see how many of these same employees are still around in each month after... | 2012/08/31 | [
"https://Stackoverflow.com/questions/12220012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1022235/"
] | I think your design may not be optimal for solving this problem. In the past for student retention, I have used a **transition matrix** "pattern" as outlined here: [The Many-to-Many Revolution 2.0](http://www.sqlbi.com/articles/many2many/)
Let me know if you need more detail after looking through the solution.
To sol... | You can create a measure with this expression:
```
Sum(NonEmpty('employees set', ([Measures].[Hired Qty], 'a hire date')),
([Measures].[Termination Qty], 'a termination date'))
```
The first argument of Sum will return the employees that were hired at your chosen date. |
40,590,517 | I'm working on a website based on the BETHEME, it includes muffin content builder and visual composer. Visual composer is how I hvae build the website.
On the homepage I have included a revolution slider in an visual composer text field. I used the shortcode as follows:
```
[rev_slider alias="Home_page"]
```
The pr... | 2016/11/14 | [
"https://Stackoverflow.com/questions/40590517",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5350443/"
] | This seems like a bug with Revolution Slider(not really sure)
However this is how I went about fixing it.
Edit your `functions.php` and add the following:
```
add_post_type_support( 'page', 'excerpt' );
```
This code modifies the default WordPress content type ‘page’ to add support for excerpts.
After you've done t... | One potential solution is to remove shortcodes from your search results.
One method to do this would be to add the below code to your theme's functions.php file.
```
function remove_shortcodes_from_search( $content ) {
// Only modify the content if it is the search results page
if ( is_search() ) {
$content =... |
2,812,018 | ```
static void Main()
{
string[] a = { "a", "asd", "bdfsd", "we" };
a = a.OrderBy(fun).ToArray();
}
private static int fun(string s)
{
return s.Length;
}
```
its is giving compile time error . I know that we can do this with Lambda expression like this. `a.OrderBy(s=... | 2010/05/11 | [
"https://Stackoverflow.com/questions/2812018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/338429/"
] | The expression `fun` is an untyped expression called a *method group*.
Since a method group has no type, the compiler cannot infer the type parameters of the generic `OrderBy` method.
You need to explicitly pass the type parameters, like this:
```
a = a.OrderBy<string, int>(fun).ToArray();
```
Or,
```
a = a.Ord... | SLaks is correct in that the C# 3 compiler will not allow this but it is important to point out that [the C# 4 compiler will compile your example without issue.](http://togaroga.com/2009/11/smarter-type-inference-with-c-4/) |
2,812,018 | ```
static void Main()
{
string[] a = { "a", "asd", "bdfsd", "we" };
a = a.OrderBy(fun).ToArray();
}
private static int fun(string s)
{
return s.Length;
}
```
its is giving compile time error . I know that we can do this with Lambda expression like this. `a.OrderBy(s=... | 2010/05/11 | [
"https://Stackoverflow.com/questions/2812018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/338429/"
] | The expression `fun` is an untyped expression called a *method group*.
Since a method group has no type, the compiler cannot infer the type parameters of the generic `OrderBy` method.
You need to explicitly pass the type parameters, like this:
```
a = a.OrderBy<string, int>(fun).ToArray();
```
Or,
```
a = a.Ord... | Here's what happened. When I first implemented the method type inference algorithm for C# 3 I reasoned as SLaks suggests: method groups have no type, nothing was inferred from them in C# 2, and overload resolution needs to pick the method out of the method group by knowing the types of the arguments, which is precisely... |
42,413,094 | In Python 3.0, if I run the following code for a Hangman game
```
secretWord = list("Apple")
compareWord = secretWord
print("".join(secretWord))
for (index , alphabet) in enumerate(secretWord):
compareWord[index] = "_"
print("".join(secretWord))
```
The result is
```
Apple
_____
```
Why did it change the s... | 2017/02/23 | [
"https://Stackoverflow.com/questions/42413094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1936752/"
] | You could generate an array with the objects first and the stringify the array.
```js
var headers = ['first name', 'last name', 'age'],
data = [['John', 'Gill', '21'], ['Sai', 'Varun', '21']],
result = data.map(function (a) {
var object = {};
headers.forEach(function (k, i) {
o... | **DEMO**
```js
var headers = ['first name','last name','age'];
var data = [['John', 'Gill', '21'],['Sai', 'Varun', '21']];
var res = data.map(function(item) {
var obj = {};
for (var i in headers) {
obj[headers[i]] = item[i];
}
return obj;
});
console.log(res);
``` |
42,413,094 | In Python 3.0, if I run the following code for a Hangman game
```
secretWord = list("Apple")
compareWord = secretWord
print("".join(secretWord))
for (index , alphabet) in enumerate(secretWord):
compareWord[index] = "_"
print("".join(secretWord))
```
The result is
```
Apple
_____
```
Why did it change the s... | 2017/02/23 | [
"https://Stackoverflow.com/questions/42413094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1936752/"
] | ```js
var headers = ['first name','last name','age']
var data = [ [ 'John', 'Gill', '21' ], [ 'Sai', 'Varun', '21' ] ]
function createItem(item) {
newObject = {}
item.map((val,i)=>newObject[headers[i]]=val)
return newObject
}
console.log(data.map(item=>createItem(item)))
``` | **DEMO**
```js
var headers = ['first name','last name','age'];
var data = [['John', 'Gill', '21'],['Sai', 'Varun', '21']];
var res = data.map(function(item) {
var obj = {};
for (var i in headers) {
obj[headers[i]] = item[i];
}
return obj;
});
console.log(res);
``` |
22,190 | I've been interested in creating Geometric Polygonal art illustrations, i.e. making polygons and shapes with different color shading represent a face, or an object, see [this](http://pelfind.com/photos/42567/exploring-geometry-30-polygonal-art-illustrations-71607) set of [examples](http://pelfind.com/photos/42567/explo... | 2013/10/24 | [
"https://graphicdesign.stackexchange.com/questions/22190",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/15600/"
] | As I mentioned in the comments, these illustrations were most likely done by hand, as the level of complexity, detail and 'originality' is not something you can achieve with a script.
You could potentially use effects like Mosaic (with triangular shapes), but the results are not nearly as good as your samples. **Your ... | Some fun from Vitaliy at [another stack exchange site](https://mathematica.stackexchange.com/a/8513/61):
 |
22,190 | I've been interested in creating Geometric Polygonal art illustrations, i.e. making polygons and shapes with different color shading represent a face, or an object, see [this](http://pelfind.com/photos/42567/exploring-geometry-30-polygonal-art-illustrations-71607) set of [examples](http://pelfind.com/photos/42567/explo... | 2013/10/24 | [
"https://graphicdesign.stackexchange.com/questions/22190",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/15600/"
] | As I mentioned in the comments, these illustrations were most likely done by hand, as the level of complexity, detail and 'originality' is not something you can achieve with a script.
You could potentially use effects like Mosaic (with triangular shapes), but the results are not nearly as good as your samples. **Your ... | You could install something like the [*Processing*](http://processing.org/) IDE and then [search](http://www.openprocessing.org/search/?q=delaunay) and literally load a [*sketch*](http://openprocessing.org/sketch/118949) (replace the assets with yours i.e. jpg files), then grab an image of that:
![enter image descript... |
67,726,813 | <https://github.com/koalaman/shellcheck>
I can install the above package using `cabal install`. But I'd like to run the raw `ghc` commands that compile the binary without the installation.
How can I do it? | 2021/05/27 | [
"https://Stackoverflow.com/questions/67726813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1424739/"
] | Here's the usual way. Step one is to get a copy of the code. One of these two will do it:
```
% git clone https://github.com/koalaman/shellcheck
% cabal unpack shellcheck
```
Once you are in the directory with the code, you can ask `cabal` to build it without installing it by using the `build` command instead of the... | First of all you'll need to install all dependencies, you can do that with `cabal install --dependencies-only`. Then you need to make a file `Paths_ShellCheck.hs` with the contents:
```
module Paths_ShellCheck where
import Data.Version
version = Version [0,7,2] []
```
Then you can use this GHC command:
```
ghc \
... |
45,494,905 | Hello I'm new to android studio I have built an app when you take a photo from the camera app see it in an ImageView and share it
I have made a share button:
```
case R.id.shrbtn:
startshare();
break;
```
the share button go to this method to start sharing the photo
I have added internet permission and the bu... | 2017/08/03 | [
"https://Stackoverflow.com/questions/45494905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5451687/"
] | Send it by an intent and get it from startActivityForResult() method.
[This](https://www.youtube.com/watch?v=6Z6k7X2vfhk) tutorial explains it well | This sounds to me like an issue regarding the button callback itself. Have you make sure that the method have been called? Maybe you should set breakpoints to identify the issue?
Maybe you should take a look here (as your share intent looks wrong): <https://stackoverflow.com/a/7662164/6268503> |
86,410 | I have a 1-year multiple entry Schengen visa 90/180 issued by Italy.
Out of five trips, I used it twice to enter Italy. The other three times, I entered Germany but stayed once in Luxembourg and twice in Holland.
I arrived and departed from Germany because the flights there were cheaper.
My last return trip from ... | 2017/01/18 | [
"https://travel.stackexchange.com/questions/86410",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/-1/"
] | You've made several trips to the Schengen area using a multiple-entry visa, and when you most recently left, German officials gave you extra scrutiny. The purpose of that scrutiny was almost certainly to check whether you have violated the 90/180 rule. You have not, so there is nothing to worry about.
In particular, i... | >
> **Did I do something wrong?**
>
>
>
No.
>
> **On my next trip, will my Schengen tourist visa be cancelled or will they refuse me entry?**
>
>
>
We can't predict the future. There's nothing in your question to suggest that outcome is likely.
>
> **Am I on the radar with German authorities now?**
>
>
>... |
86,410 | I have a 1-year multiple entry Schengen visa 90/180 issued by Italy.
Out of five trips, I used it twice to enter Italy. The other three times, I entered Germany but stayed once in Luxembourg and twice in Holland.
I arrived and departed from Germany because the flights there were cheaper.
My last return trip from ... | 2017/01/18 | [
"https://travel.stackexchange.com/questions/86410",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/-1/"
] | >
> **Did I do something wrong?**
>
>
>
No.
>
> **On my next trip, will my Schengen tourist visa be cancelled or will they refuse me entry?**
>
>
>
We can't predict the future. There's nothing in your question to suggest that outcome is likely.
>
> **Am I on the radar with German authorities now?**
>
>
>... | There are a few possible reasons why they took your fingerprints randomly
1) To verify that you're the same person as your visa
2) To check you haven't violated the 90/180 rule
3) They suspect you might be a threat to a member state
4) They might suspect you of "visa shopping" i.e after being refused a schengen vis... |
86,410 | I have a 1-year multiple entry Schengen visa 90/180 issued by Italy.
Out of five trips, I used it twice to enter Italy. The other three times, I entered Germany but stayed once in Luxembourg and twice in Holland.
I arrived and departed from Germany because the flights there were cheaper.
My last return trip from ... | 2017/01/18 | [
"https://travel.stackexchange.com/questions/86410",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/-1/"
] | You've made several trips to the Schengen area using a multiple-entry visa, and when you most recently left, German officials gave you extra scrutiny. The purpose of that scrutiny was almost certainly to check whether you have violated the 90/180 rule. You have not, so there is nothing to worry about.
In particular, i... | There are a few possible reasons why they took your fingerprints randomly
1) To verify that you're the same person as your visa
2) To check you haven't violated the 90/180 rule
3) They suspect you might be a threat to a member state
4) They might suspect you of "visa shopping" i.e after being refused a schengen vis... |
642,176 | If two jobs are entered into bash command line separated by semicolon:
```
$ job 1; job 2;
```
How do I cancel the second one? If I press `CTRL`+`c`, the first one will be canceled and 'job 2' would start, I just want to stop second job not to be executed. I tried atq, ps but no luck, with ps -ef I can see only 'job... | 2015/06/29 | [
"https://askubuntu.com/questions/642176",
"https://askubuntu.com",
"https://askubuntu.com/users/350520/"
] | I think you miss something, When you run two commands seperated by `;` you can kill the both commands by the `CTRL`+`c`.
just to be sure try this command:
```
find / -name a ; ls /home
```
Then kill the above commands with `CTRL`+`c`, this would kill both processes, you'll not list your home content. I.e, the next ... | Kill the **parent process** of job1 with `SIGKILL`.
Show the processes in a process tree, eg. with `htop` or `ps axf` and kill the ***parent process of job1*** and not job1 itself.
---
Install `htop` with
```
sudo apt-get install htop
```
---
**Downvoters, understand the answer before downvoting** |
39,899,332 | I am trying to write a function that returns a TRUE or FALSE value based on whether the date is present in the array or not. Currently I have this:
```
function isInArray(value, array) {
var a = array.indexOf(value) > -1;
if (a == false) {
return false; //DATE DOES NOT EXIST
}
else {
r... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39899332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959978/"
] | You can try using the [**`find()`**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) method (if ecmascript is supported):
### Case: array contains strings
```js
var array = ["26/12/2016", "27/12/2016", "28/12/2016", "29/12/2016"];
var value1 = "26/12/2016"; //exists
var v... | you can use includes function.
```
ri = ["26/12/2016", "27/12/2016", "28/12/2016", "29/12/2016"];
ri.includes("20/12/2016"); //False
ri.includes("26/12/2016"); //True
```
Alternative to IE
indexOf return the position of value.
```
var pos = ri.indexOf("26/12/2016"); // 0
var pos = ri.indexOf("20/12/2016"); // -1
v... |
39,899,332 | I am trying to write a function that returns a TRUE or FALSE value based on whether the date is present in the array or not. Currently I have this:
```
function isInArray(value, array) {
var a = array.indexOf(value) > -1;
if (a == false) {
return false; //DATE DOES NOT EXIST
}
else {
r... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39899332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959978/"
] | you can use includes function.
```
ri = ["26/12/2016", "27/12/2016", "28/12/2016", "29/12/2016"];
ri.includes("20/12/2016"); //False
ri.includes("26/12/2016"); //True
```
Alternative to IE
indexOf return the position of value.
```
var pos = ri.indexOf("26/12/2016"); // 0
var pos = ri.indexOf("20/12/2016"); // -1
v... | Something like
```
function isInArray(value, array) {
for (var i = 0; i < array.length; i++) {
if (value == array[i]) {
return true;
}
}
return false;
}
```
should work..
You may have to use different comparing operations though. |
39,899,332 | I am trying to write a function that returns a TRUE or FALSE value based on whether the date is present in the array or not. Currently I have this:
```
function isInArray(value, array) {
var a = array.indexOf(value) > -1;
if (a == false) {
return false; //DATE DOES NOT EXIST
}
else {
r... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39899332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959978/"
] | you can use includes function.
```
ri = ["26/12/2016", "27/12/2016", "28/12/2016", "29/12/2016"];
ri.includes("20/12/2016"); //False
ri.includes("26/12/2016"); //True
```
Alternative to IE
indexOf return the position of value.
```
var pos = ri.indexOf("26/12/2016"); // 0
var pos = ri.indexOf("20/12/2016"); // -1
v... | I solved by getting only the first 15 characters in the dates, this is my snippet:
```
//get the first 15 characters of each date in my array (hdates)
for (i=0;i<hdates.length;i++){
hdates[i]=hdates[i].toString().substring(0,15); //converts dates to 15 characters long strings
}
function highlight(date) {
if(hdate... |
39,899,332 | I am trying to write a function that returns a TRUE or FALSE value based on whether the date is present in the array or not. Currently I have this:
```
function isInArray(value, array) {
var a = array.indexOf(value) > -1;
if (a == false) {
return false; //DATE DOES NOT EXIST
}
else {
r... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39899332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959978/"
] | You can try using the [**`find()`**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) method (if ecmascript is supported):
### Case: array contains strings
```js
var array = ["26/12/2016", "27/12/2016", "28/12/2016", "29/12/2016"];
var value1 = "26/12/2016"; //exists
var v... | Something like
```
function isInArray(value, array) {
for (var i = 0; i < array.length; i++) {
if (value == array[i]) {
return true;
}
}
return false;
}
```
should work..
You may have to use different comparing operations though. |
39,899,332 | I am trying to write a function that returns a TRUE or FALSE value based on whether the date is present in the array or not. Currently I have this:
```
function isInArray(value, array) {
var a = array.indexOf(value) > -1;
if (a == false) {
return false; //DATE DOES NOT EXIST
}
else {
r... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39899332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959978/"
] | You can try using the [**`find()`**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) method (if ecmascript is supported):
### Case: array contains strings
```js
var array = ["26/12/2016", "27/12/2016", "28/12/2016", "29/12/2016"];
var value1 = "26/12/2016"; //exists
var v... | I solved by getting only the first 15 characters in the dates, this is my snippet:
```
//get the first 15 characters of each date in my array (hdates)
for (i=0;i<hdates.length;i++){
hdates[i]=hdates[i].toString().substring(0,15); //converts dates to 15 characters long strings
}
function highlight(date) {
if(hdate... |
39,899,332 | I am trying to write a function that returns a TRUE or FALSE value based on whether the date is present in the array or not. Currently I have this:
```
function isInArray(value, array) {
var a = array.indexOf(value) > -1;
if (a == false) {
return false; //DATE DOES NOT EXIST
}
else {
r... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39899332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959978/"
] | Something like
```
function isInArray(value, array) {
for (var i = 0; i < array.length; i++) {
if (value == array[i]) {
return true;
}
}
return false;
}
```
should work..
You may have to use different comparing operations though. | I solved by getting only the first 15 characters in the dates, this is my snippet:
```
//get the first 15 characters of each date in my array (hdates)
for (i=0;i<hdates.length;i++){
hdates[i]=hdates[i].toString().substring(0,15); //converts dates to 15 characters long strings
}
function highlight(date) {
if(hdate... |
25,063,003 | I want to initialize the splitter handle position like the following instead of in the middle. I cannot set it in the property.

How to solve this?
Thank you for your help. | 2014/07/31 | [
"https://Stackoverflow.com/questions/25063003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2828227/"
] | You can use `QSplitter::setSizes` in this why to reposition the handle:
```
ui->splitter->setSizes(QList<int>() << 100 << 200);
``` | You should set the horizontal stretch for the two widgets in the splitter. For instance by setting the horizontal stretch of the left widget to `1` and the right widget to `2`, the right widget gets a width 2 times the left one :
```
leftWidget->sizePolicy().setHorizontalStretch(1);
rightWidget->sizePolicy().setHorizo... |
25,063,003 | I want to initialize the splitter handle position like the following instead of in the middle. I cannot set it in the property.

How to solve this?
Thank you for your help. | 2014/07/31 | [
"https://Stackoverflow.com/questions/25063003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2828227/"
] | You should set the horizontal stretch for the two widgets in the splitter. For instance by setting the horizontal stretch of the left widget to `1` and the right widget to `2`, the right widget gets a width 2 times the left one :
```
leftWidget->sizePolicy().setHorizontalStretch(1);
rightWidget->sizePolicy().setHorizo... | Use `QSplitter::setStretchFactor(int index, int stretch)` where `index` is the position of the respective widget. |
25,063,003 | I want to initialize the splitter handle position like the following instead of in the middle. I cannot set it in the property.

How to solve this?
Thank you for your help. | 2014/07/31 | [
"https://Stackoverflow.com/questions/25063003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2828227/"
] | You can use `QSplitter::setSizes` in this why to reposition the handle:
```
ui->splitter->setSizes(QList<int>() << 100 << 200);
``` | Use `QSplitter::setStretchFactor(int index, int stretch)` where `index` is the position of the respective widget. |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | An `int` is an integer. At the most rudimentary level, it is simply a set of bytes intepreted as a numeric value. Modern processors (and operating systems) support multiple sizes of integer, though 32-bit and 64-bit (4 and 8 bytes respectively) are most common.
In terms of representation in hardware, they're simply da... | `typedef int INT` doesn't define `int`. It's just the opposite: It defines `INT` to be like `int`. `int` itself is defined in the guts of the compiler, not in source files.
A typedef doesn't map to memory at all. It is simply text describing type of storage, size, etc.. It's the variable of that type that is mapped to... |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | An `int` is an integer. At the most rudimentary level, it is simply a set of bytes intepreted as a numeric value. Modern processors (and operating systems) support multiple sizes of integer, though 32-bit and 64-bit (4 and 8 bytes respectively) are most common.
In terms of representation in hardware, they're simply da... | `int` is described in the c++ standard §3.9.1 Fundamental Types. The actual size is implementation dependent. Concerning the sizes of the fundamental types, C++ references C99. See the `<climits>` header, where values such as `MIN_INT` and `MAX_INT` are defined, and the functionality available in the `<limits>` header,... |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | An `int` is an integer. At the most rudimentary level, it is simply a set of bytes intepreted as a numeric value. Modern processors (and operating systems) support multiple sizes of integer, though 32-bit and 64-bit (4 and 8 bytes respectively) are most common.
In terms of representation in hardware, they're simply da... | You cannot go any deeper because `int` is primitive C/C++ type.
>
> what/where is the linkage between type in text code and physical
> storage in RAM? it cannot be end, becouse what the compiler is
> supposed to do when you tell him int i= . he must know what is this
> int.
>
>
>
For Windows case (I do not ha... |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | An `int` is an integer. At the most rudimentary level, it is simply a set of bytes intepreted as a numeric value. Modern processors (and operating systems) support multiple sizes of integer, though 32-bit and 64-bit (4 and 8 bytes respectively) are most common.
In terms of representation in hardware, they're simply da... | C++ is not purely object-oriented, although every defined variable is called "object" in C++ terminology. There are types which are not instances of a class and `int` is one of them.
An `int` is just a set of at least 16 consecutive bits which are interpreted as a signed integer. The actual size and how a certain bit ... |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | `typedef int INT` doesn't define `int`. It's just the opposite: It defines `INT` to be like `int`. `int` itself is defined in the guts of the compiler, not in source files.
A typedef doesn't map to memory at all. It is simply text describing type of storage, size, etc.. It's the variable of that type that is mapped to... | You cannot go any deeper because `int` is primitive C/C++ type.
>
> what/where is the linkage between type in text code and physical
> storage in RAM? it cannot be end, becouse what the compiler is
> supposed to do when you tell him int i= . he must know what is this
> int.
>
>
>
For Windows case (I do not ha... |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | `typedef int INT` doesn't define `int`. It's just the opposite: It defines `INT` to be like `int`. `int` itself is defined in the guts of the compiler, not in source files.
A typedef doesn't map to memory at all. It is simply text describing type of storage, size, etc.. It's the variable of that type that is mapped to... | C++ is not purely object-oriented, although every defined variable is called "object" in C++ terminology. There are types which are not instances of a class and `int` is one of them.
An `int` is just a set of at least 16 consecutive bits which are interpreted as a signed integer. The actual size and how a certain bit ... |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | `int` is described in the c++ standard §3.9.1 Fundamental Types. The actual size is implementation dependent. Concerning the sizes of the fundamental types, C++ references C99. See the `<climits>` header, where values such as `MIN_INT` and `MAX_INT` are defined, and the functionality available in the `<limits>` header,... | You cannot go any deeper because `int` is primitive C/C++ type.
>
> what/where is the linkage between type in text code and physical
> storage in RAM? it cannot be end, becouse what the compiler is
> supposed to do when you tell him int i= . he must know what is this
> int.
>
>
>
For Windows case (I do not ha... |
10,216,744 | Can anyone tell sth about what is int data type in C++, drilling the headers I can find
```
typedef int INT;
```
What/where is the linkage between type in text code and physical storage in RAM? Compiler must know what is this int. And I ask - where it is explained to compiler? | 2012/04/18 | [
"https://Stackoverflow.com/questions/10216744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141471/"
] | `int` is described in the c++ standard §3.9.1 Fundamental Types. The actual size is implementation dependent. Concerning the sizes of the fundamental types, C++ references C99. See the `<climits>` header, where values such as `MIN_INT` and `MAX_INT` are defined, and the functionality available in the `<limits>` header,... | C++ is not purely object-oriented, although every defined variable is called "object" in C++ terminology. There are types which are not instances of a class and `int` is one of them.
An `int` is just a set of at least 16 consecutive bits which are interpreted as a signed integer. The actual size and how a certain bit ... |
510,244 | I am performing eye safety calculations on a device and I have hit a roadblock.
To perform the calculations I have been following the IEC 62471 "Photobiological safety of lamps and lamp systems" Standard.
I am using three IR LED arrays. One has 34 IR LEDs and the other two have 3 IR LEDs. The arrays utilizes the SFH 4... | 2020/07/13 | [
"https://electronics.stackexchange.com/questions/510244",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/257156/"
] | The effectiveness of a good twisted pair cable relies on these things to largely eradicate differential-mode induction: -
* What source feeds it and
* What receive circuit it connects to
So, if the send and return wires (and their associated transmit and receive circuits) don't present a balanced impedance to ground,... | For the cancellation of magnetic fields, you want to use machine\_twisted wires, not human\_twisted wires.
And dense twists --- many twists per inch --- are required, otherwise the field variations will not be cancelled.
And the imperfect alignment of the wires inside the field will not be uniform, so cancellation wi... |
8,876,584 | This is a program so that the GHC takes a number n from user and then it forms a list of n numbers which again are given by the user. this code is showing some parse error for loop. How can i remove that error?
```
import System.IO
main = do
putStrLn "Please enter the number"
number <- readLn :: IO Int
putS... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8876584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1151746/"
] | In addition to what the other answers have said:
You don't need to write a loop function.
```
import System.IO
main = do
putStrLn "Please enter the number"
number <- readLn :: IO Int
putStrLn $ "The num is:" ++ show number
xs <- sequence (replicate number (readLn :: IO Int)) -- pay attention to this li... | There are three errors in your code. Copying it and starting it in GHC gives the following messages:
```
temp.hs:9:13
Couldn't match expected type `Char' with actual type `Int'
Expected type: String
Actual type: [Int]
In the first argument of `putStrLn', namely `xs'
In the expression: putStrLn xs... |
8,876,584 | This is a program so that the GHC takes a number n from user and then it forms a list of n numbers which again are given by the user. this code is showing some parse error for loop. How can i remove that error?
```
import System.IO
main = do
putStrLn "Please enter the number"
number <- readLn :: IO Int
putS... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8876584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1151746/"
] | In addition to what the other answers have said:
You don't need to write a loop function.
```
import System.IO
main = do
putStrLn "Please enter the number"
number <- readLn :: IO Int
putStrLn $ "The num is:" ++ show number
xs <- sequence (replicate number (readLn :: IO Int)) -- pay attention to this li... | If I understand your intent correctly, you meant to create a "loop" construct that would perform an action *n* times, and produce a list of the results. In the code you have,
```
loop number
xs <- sequence [readLn :: IO Int]
```
But these two statements are separate; you need to instead *send* the action you wish to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.