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
11,828,045
let's say I have a interface IPerson that expose a collection of another interface ICar. ICar is implemented by the Car class, and the IPerson is implemented by the Person class. I would like that Person could expose a collection of Car, and not of ICar, but this does not seem possible without changing the IPerson inte...
2012/08/06
[ "https://Stackoverflow.com/questions/11828045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1472131/" ]
I don't know if this solution will fit your needs, however depending on what language you are using, you could use a generic solution to achieve this kind of behavior. For example in java ``` interface IPerson<T extends ICar> { public T[] getCars(); // ... } ``` This will insure that the generic type `T` m...
In my opinion this is not possible. If IPerson has a collection of ICars, then your Person class also needs to accept any ICar, not just your concrete *Car* class. This is of course assuming that the user of IPerson is allowed to add ICar instances. If the collection is readonly, then in theory this might be possible...
3,473,797
we have to calculate the arc length of the following function $y=\sqrt{(\cos2x)} dx$ in the interval $[0 ,\pi/4]$. I know the arc length formula but following it becomes an integral thats really complex...need help....
2019/12/12
[ "https://math.stackexchange.com/questions/3473797", "https://math.stackexchange.com", "https://math.stackexchange.com/users/734313/" ]
I got the following integral $$\int\_0^{\frac{\pi }{4}} \sqrt{\sin (2 x) \tan (2 x)+1} \, dx$$ no hope that this has an algebraic solution.
$\int\_{0}^{\frac{\pi}{4}} \sqrt{\cos2x} dx = \frac{1}{2}\int\_{0}^{\frac{\pi}{4}} \sqrt{\cos{u}} du = \frac{1}{2}\cdot \:2\text{E}\left(\frac{u}{2}|\:2\right) = \frac{1}{2}\cdot \:2\text{E}\left(\frac{2x}{2}|\:2\right) = \text{E}\left(x|2\right)+C$, where $\text{E}\left(x|m\right)$ is the elliptic integral of the seco...
19,778,790
I'm trying to have a default instance of a class. I want to have ``` class Foo(): def __init__(self): .... _default = Foo() @staticmethod def get_default(): return _default ``` However `_default = Foo()` leads to `NameError: name 'Foo' is not defined`
2013/11/04
[ "https://Stackoverflow.com/questions/19778790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1445618/" ]
`Foo` does not exist until the class definition is finalized. You can easily refer to it *after* the class definition, though: ``` class Foo(object): def __init__(self): # .... Foo.default_instance = Foo() ``` Note also that I have removed the superfluous getter method in favor of a plain old attribute. Yo...
You cannot refer to a class that doesn't yet exist. Within the class definition body, the `Foo` class is *not yet created*. Add the attribute after the class has been created: ``` class Foo(): def __init__(self): .... @staticmethod def get_default(): return Foo._default Foo._default = Fo...
19,778,790
I'm trying to have a default instance of a class. I want to have ``` class Foo(): def __init__(self): .... _default = Foo() @staticmethod def get_default(): return _default ``` However `_default = Foo()` leads to `NameError: name 'Foo' is not defined`
2013/11/04
[ "https://Stackoverflow.com/questions/19778790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1445618/" ]
`Foo` does not exist until the class definition is finalized. You can easily refer to it *after* the class definition, though: ``` class Foo(object): def __init__(self): # .... Foo.default_instance = Foo() ``` Note also that I have removed the superfluous getter method in favor of a plain old attribute. Yo...
You may lazily initialize your default instance. ``` class Foo(object): _default = None @staticmethod def get_default(): if not Foo._default: Foo._default = Foo() return Foo._default ```
19,778,790
I'm trying to have a default instance of a class. I want to have ``` class Foo(): def __init__(self): .... _default = Foo() @staticmethod def get_default(): return _default ``` However `_default = Foo()` leads to `NameError: name 'Foo' is not defined`
2013/11/04
[ "https://Stackoverflow.com/questions/19778790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1445618/" ]
You cannot refer to a class that doesn't yet exist. Within the class definition body, the `Foo` class is *not yet created*. Add the attribute after the class has been created: ``` class Foo(): def __init__(self): .... @staticmethod def get_default(): return Foo._default Foo._default = Fo...
You may lazily initialize your default instance. ``` class Foo(object): _default = None @staticmethod def get_default(): if not Foo._default: Foo._default = Foo() return Foo._default ```
247,639
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are: * *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i...
2008/10/29
[ "https://Stackoverflow.com/questions/247639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778/" ]
The alignment will be picked by the compiler according to its defaults, this will probably end up as four-bytes under GCC / MSVC. This should only be a problem if there is code (SIMD/DMA) that requires a specific alignment. In this case you should be able to use compiler directives to ensure that member\_list\_store\_...
Allocate the char array `member_list_store_d` with malloc or global operator new[], either of which will give storage aligned for any type. Edit: Just read the OP again - you don't want to pay for another pointer. Will read again in the morning.
247,639
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are: * *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i...
2008/10/29
[ "https://Stackoverflow.com/questions/247639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778/" ]
Ok - had a chance to read it properly. You have an alignment problem, and invoke undefined behaviour when you access the char array as an Obj\_list. Most likely your platform will do one of three things: let you get away with it, let you get away with it at a runtime penalty or occasionally crash with a bus error. You...
The alignment will be picked by the compiler according to its defaults, this will probably end up as four-bytes under GCC / MSVC. This should only be a problem if there is code (SIMD/DMA) that requires a specific alignment. In this case you should be able to use compiler directives to ensure that member\_list\_store\_...
247,639
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are: * *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i...
2008/10/29
[ "https://Stackoverflow.com/questions/247639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778/" ]
If you want to ensure alignment of your structures, just do a ``` // MSVC #pragma pack(push,1) // structure definitions #pragma pack(pop) // *nix struct YourStruct { .... } __attribute__((packed)); ``` To ensure 1 byte alignment of your char array in Aggregate
Allocate the char array `member_list_store_d` with malloc or global operator new[], either of which will give storage aligned for any type. Edit: Just read the OP again - you don't want to pay for another pointer. Will read again in the morning.
247,639
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are: * *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i...
2008/10/29
[ "https://Stackoverflow.com/questions/247639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778/" ]
Can you simply have an instance of Obj\_list inside Aggregate? IOW, something along the lines of class Aggregate : public Lesser { ... protected: Obj\_list list; }; I must be missing something, but I can't figure why this is bad. As to your question - it's perfectly compiler-dependent. Most compilers, though, wil...
Allocate the char array `member_list_store_d` with malloc or global operator new[], either of which will give storage aligned for any type. Edit: Just read the OP again - you don't want to pay for another pointer. Will read again in the morning.
247,639
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are: * *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i...
2008/10/29
[ "https://Stackoverflow.com/questions/247639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778/" ]
Ok - had a chance to read it properly. You have an alignment problem, and invoke undefined behaviour when you access the char array as an Obj\_list. Most likely your platform will do one of three things: let you get away with it, let you get away with it at a runtime penalty or occasionally crash with a bus error. You...
Allocate the char array `member_list_store_d` with malloc or global operator new[], either of which will give storage aligned for any type. Edit: Just read the OP again - you don't want to pay for another pointer. Will read again in the morning.
247,639
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are: * *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i...
2008/10/29
[ "https://Stackoverflow.com/questions/247639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778/" ]
Ok - had a chance to read it properly. You have an alignment problem, and invoke undefined behaviour when you access the char array as an Obj\_list. Most likely your platform will do one of three things: let you get away with it, let you get away with it at a runtime penalty or occasionally crash with a bus error. You...
If you want to ensure alignment of your structures, just do a ``` // MSVC #pragma pack(push,1) // structure definitions #pragma pack(pop) // *nix struct YourStruct { .... } __attribute__((packed)); ``` To ensure 1 byte alignment of your char array in Aggregate
247,639
I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are: * *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i...
2008/10/29
[ "https://Stackoverflow.com/questions/247639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778/" ]
Ok - had a chance to read it properly. You have an alignment problem, and invoke undefined behaviour when you access the char array as an Obj\_list. Most likely your platform will do one of three things: let you get away with it, let you get away with it at a runtime penalty or occasionally crash with a bus error. You...
Can you simply have an instance of Obj\_list inside Aggregate? IOW, something along the lines of class Aggregate : public Lesser { ... protected: Obj\_list list; }; I must be missing something, but I can't figure why this is bad. As to your question - it's perfectly compiler-dependent. Most compilers, though, wil...
22,962
Not all nations provide education in the national tongue. In India, being educated in English is generally preferred. I am looking for any study with details about the situations in different countries about this - with details about to what level (primary, secondary school, bachelors or masters) education in the n...
2017/05/18
[ "https://linguistics.stackexchange.com/questions/22962", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/16920/" ]
I suspect that there are not any *good* studies that will give you a comprehensive answer. You might be able to find a compilation of official national educational policies that covers a sufficient number of countries, but official policy and reality are different things. For example, policy used to be in Tanzania and ...
A Google search will bring up a huge number of articles. Also look at UNESCO and UNICEF and the Global Reading Network websites. There is a big international push for mother tongue-based education (also referred to as multilingual education) and a number of countries have introduced MLE, but on a large scale across all...
32,859,367
I am getting these errors using `sbt assembly`. I am using Spark which seems to be at the root of this problem. ``` val Spark = Seq( "org.apache.spark" %% "spark-core" % sparkVersion, "org.apache.spark" %% "spark-sql" % sparkVersion, "org.apache.spark" %% "spark-streaming" % sparkVersion ) ``` Error: ``` [e...
2015/09/30
[ "https://Stackoverflow.com/questions/32859367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417896/" ]
This is not exactly an answer to the problem, but it is a workaround. *I hope this saves a few hundred man-hours.* Use [`sbt-native-packager`](http://www.scala-sbt.org/sbt-native-packager/) instead of `sbt-assembly`. Add to `plugins.sbt`: ``` addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0") ``` ...
``` assemblyMergeStrategy in assembly := { case PathList("org", "apache", xs @ _*) => MergeStrategy.last case PathList("com", "google", xs @ _*) => MergeStrategy.last case x => val oldStrategy = (assemblyMergeStrategy in assembly).value oldStrategy(x) } ``` This works for me.
32,859,367
I am getting these errors using `sbt assembly`. I am using Spark which seems to be at the root of this problem. ``` val Spark = Seq( "org.apache.spark" %% "spark-core" % sparkVersion, "org.apache.spark" %% "spark-sql" % sparkVersion, "org.apache.spark" %% "spark-streaming" % sparkVersion ) ``` Error: ``` [e...
2015/09/30
[ "https://Stackoverflow.com/questions/32859367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417896/" ]
This is not exactly an answer to the problem, but it is a workaround. *I hope this saves a few hundred man-hours.* Use [`sbt-native-packager`](http://www.scala-sbt.org/sbt-native-packager/) instead of `sbt-assembly`. Add to `plugins.sbt`: ``` addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0") ``` ...
Spark dependencies should be provided by the cluster, add the "Provided": ``` val Spark = Seq( "org.apache.spark" %% "spark-core" % sparkVersion % Provided, "org.apache.spark" %% "spark-sql" % sparkVersion % Provided, "org.apache.spark" %% "spark-streaming" % sparkVersion % Provided ) ```
32,859,367
I am getting these errors using `sbt assembly`. I am using Spark which seems to be at the root of this problem. ``` val Spark = Seq( "org.apache.spark" %% "spark-core" % sparkVersion, "org.apache.spark" %% "spark-sql" % sparkVersion, "org.apache.spark" %% "spark-streaming" % sparkVersion ) ``` Error: ``` [e...
2015/09/30
[ "https://Stackoverflow.com/questions/32859367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417896/" ]
This is not exactly an answer to the problem, but it is a workaround. *I hope this saves a few hundred man-hours.* Use [`sbt-native-packager`](http://www.scala-sbt.org/sbt-native-packager/) instead of `sbt-assembly`. Add to `plugins.sbt`: ``` addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0") ``` ...
I know this is an old question but none of the solutions given so far handle the case I encountered. It appears there are cases where a jar that is not "provided" has dependencies on jars that are. If the transitive dependencies pull in jars with conflicting content, you can see this same error. In certain cases, addi...
47,459,747
I am trying to install pygame with pip install . but every time i tried i faced to this error. > > Retrying (Retry(total=4, connect=None, read=None, redirect=None)) > after connection broken by 'ProxyError('Cannot connect to proxy.', > NewConnectionError(': Failed to establish a new connection: [WinError > 10061] ...
2017/11/23
[ "https://Stackoverflow.com/questions/47459747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8385256/" ]
Go to this [Website](https://www.lfd.uci.edu/~gohlke/pythonlibs/), download the pygame‑1.9.3‑cp36‑cp36m‑win\_amd64.whl file, open cmd, change directory to the folder you have the .whl file end type: `pip install pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl` . This works when you are trying to install packages and firewalls ...
It looks like `pip` is not connecting to the internet. I have a few options -- I don't know if they will work, but you can try them. 1. Try to reinstall `pip` (`pip3` if using python3) I had to do this on my systeme, as `pip3` didn't work initally either. 2. Check and see if you can ping a website from your terminal ...
47,459,747
I am trying to install pygame with pip install . but every time i tried i faced to this error. > > Retrying (Retry(total=4, connect=None, read=None, redirect=None)) > after connection broken by 'ProxyError('Cannot connect to proxy.', > NewConnectionError(': Failed to establish a new connection: [WinError > 10061] ...
2017/11/23
[ "https://Stackoverflow.com/questions/47459747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8385256/" ]
I had the same issue in windows. My antivirus was blocking PIP requests. Try disabling your antivirus(in my case manually killed it from task manager).
It looks like `pip` is not connecting to the internet. I have a few options -- I don't know if they will work, but you can try them. 1. Try to reinstall `pip` (`pip3` if using python3) I had to do this on my systeme, as `pip3` didn't work initally either. 2. Check and see if you can ping a website from your terminal ...
47,459,747
I am trying to install pygame with pip install . but every time i tried i faced to this error. > > Retrying (Retry(total=4, connect=None, read=None, redirect=None)) > after connection broken by 'ProxyError('Cannot connect to proxy.', > NewConnectionError(': Failed to establish a new connection: [WinError > 10061] ...
2017/11/23
[ "https://Stackoverflow.com/questions/47459747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8385256/" ]
I had same error message when I tried to install Python packages on my laptop with Windows 10 OS. I tried all methods recommended online and it still didn't work. I have been noticing for a while that Windows 10 automatically set proxy off causing Internet access problem sometime. Then I googled with keywords: 'window...
It looks like `pip` is not connecting to the internet. I have a few options -- I don't know if they will work, but you can try them. 1. Try to reinstall `pip` (`pip3` if using python3) I had to do this on my systeme, as `pip3` didn't work initally either. 2. Check and see if you can ping a website from your terminal ...
47,459,747
I am trying to install pygame with pip install . but every time i tried i faced to this error. > > Retrying (Retry(total=4, connect=None, read=None, redirect=None)) > after connection broken by 'ProxyError('Cannot connect to proxy.', > NewConnectionError(': Failed to establish a new connection: [WinError > 10061] ...
2017/11/23
[ "https://Stackoverflow.com/questions/47459747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8385256/" ]
Go to this [Website](https://www.lfd.uci.edu/~gohlke/pythonlibs/), download the pygame‑1.9.3‑cp36‑cp36m‑win\_amd64.whl file, open cmd, change directory to the folder you have the .whl file end type: `pip install pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl` . This works when you are trying to install packages and firewalls ...
I had same error message when I tried to install Python packages on my laptop with Windows 10 OS. I tried all methods recommended online and it still didn't work. I have been noticing for a while that Windows 10 automatically set proxy off causing Internet access problem sometime. Then I googled with keywords: 'window...
47,459,747
I am trying to install pygame with pip install . but every time i tried i faced to this error. > > Retrying (Retry(total=4, connect=None, read=None, redirect=None)) > after connection broken by 'ProxyError('Cannot connect to proxy.', > NewConnectionError(': Failed to establish a new connection: [WinError > 10061] ...
2017/11/23
[ "https://Stackoverflow.com/questions/47459747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8385256/" ]
I had the same issue in windows. My antivirus was blocking PIP requests. Try disabling your antivirus(in my case manually killed it from task manager).
I had same error message when I tried to install Python packages on my laptop with Windows 10 OS. I tried all methods recommended online and it still didn't work. I have been noticing for a while that Windows 10 automatically set proxy off causing Internet access problem sometime. Then I googled with keywords: 'window...
36,066,548
I would like to nest a protocol in my class to implement the delegate pattern like so : ``` class MyViewController : UIViewController { protocol Delegate { func eventHappened() } var delegate:MyViewController.Delegate? private func myFunc() { delegate?.eventHappened() } } ``` B...
2016/03/17
[ "https://Stackoverflow.com/questions/36066548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327557/" ]
according to the [swift documenation](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/NestedTypes.html) > > Swift enables you to define nested types, whereby you nest supporting enumerations, classes, and structures within the definition of the type they s...
A separate problem with your class is that `delegate` does not have a concrete type. You can get away with declaring it a `MyViewController.Delegate?` because it is an optional type and can be `.None`. But that just makes your private `myFunc` dead code. Only enumerations, classes, and structures can **conform** to a p...
36,066,548
I would like to nest a protocol in my class to implement the delegate pattern like so : ``` class MyViewController : UIViewController { protocol Delegate { func eventHappened() } var delegate:MyViewController.Delegate? private func myFunc() { delegate?.eventHappened() } } ``` B...
2016/03/17
[ "https://Stackoverflow.com/questions/36066548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327557/" ]
according to the [swift documenation](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/NestedTypes.html) > > Swift enables you to define nested types, whereby you nest supporting enumerations, classes, and structures within the definition of the type they s...
this is my work around: ``` protocol MyViewControllerDelegate : class { func eventHappened() } class MyViewController : UIViewController { typealias Delegate = MyViewControllerDelegate weak var delegate: Delegate? private func myFunc() { delegate?.eventHappened() } } ```
36,066,548
I would like to nest a protocol in my class to implement the delegate pattern like so : ``` class MyViewController : UIViewController { protocol Delegate { func eventHappened() } var delegate:MyViewController.Delegate? private func myFunc() { delegate?.eventHappened() } } ``` B...
2016/03/17
[ "https://Stackoverflow.com/questions/36066548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327557/" ]
this is my work around: ``` protocol MyViewControllerDelegate : class { func eventHappened() } class MyViewController : UIViewController { typealias Delegate = MyViewControllerDelegate weak var delegate: Delegate? private func myFunc() { delegate?.eventHappened() } } ```
A separate problem with your class is that `delegate` does not have a concrete type. You can get away with declaring it a `MyViewController.Delegate?` because it is an optional type and can be `.None`. But that just makes your private `myFunc` dead code. Only enumerations, classes, and structures can **conform** to a p...
36,097,446
I have a data.frame that is a single column with 235,886 rows. Each row corresponds to a single word of the English language. E.g. ``` > words[10000:10005,1] ``` [1] anticontagionist anticontagious anticonventional anticonventionalism anticonvulsive [6] anticor What I'd like to do is convert each row to a num...
2016/03/19
[ "https://Stackoverflow.com/questions/36097446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6085225/" ]
``` let count = reminderListsStructure.structure.reduce(0) { $0 + $1.1.list.count } ``` Something like this. Not enough info though, so I'm not 100% sure it works.
When you `reduce` a dictionary, the element type is a tuple of the Key and Value types, so you can use: ``` dictionary.reduce(0) { $0 + $1.1.list.count } ``` Or, you can get just the values from the dictionary and reduce that: ``` dictionary.values.reduce(0) { $0 + $1.list.count } ``` Note that since Dictionary.v...
36,097,446
I have a data.frame that is a single column with 235,886 rows. Each row corresponds to a single word of the English language. E.g. ``` > words[10000:10005,1] ``` [1] anticontagionist anticontagious anticonventional anticonventionalism anticonvulsive [6] anticor What I'd like to do is convert each row to a num...
2016/03/19
[ "https://Stackoverflow.com/questions/36097446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6085225/" ]
``` let count = reminderListsStructure.structure.reduce(0) { $0 + $1.1.list.count } ``` Something like this. Not enough info though, so I'm not 100% sure it works.
I think [`flatMap`](http://swiftdoc.org/v2.2/protocol/SequenceType/#comment-func--flatmap-s_-sequencetype_-self-generator-element-throws-s) is a more appropriate choice here: ``` let input = [ 1: [1], 2: [1, 2], 3: [1, 2, 3], 4: [1, 2, 3, 4], 5: [1, 2, 3, 4, 5] ] let output = input.values.flatMap{...
36,097,446
I have a data.frame that is a single column with 235,886 rows. Each row corresponds to a single word of the English language. E.g. ``` > words[10000:10005,1] ``` [1] anticontagionist anticontagious anticonventional anticonventionalism anticonvulsive [6] anticor What I'd like to do is convert each row to a num...
2016/03/19
[ "https://Stackoverflow.com/questions/36097446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6085225/" ]
``` let count = reminderListsStructure.structure.reduce(0) { $0 + $1.1.list.count } ``` Something like this. Not enough info though, so I'm not 100% sure it works.
More simple and clear way goes like this, ``` var dict = ["x" : 1 , "y" : 2, "z" : 3] let count = dict.reduce(0, { x, element in //maybe here some condition //if(element.value > 1){return x} return x + 1 }) ```
36,097,446
I have a data.frame that is a single column with 235,886 rows. Each row corresponds to a single word of the English language. E.g. ``` > words[10000:10005,1] ``` [1] anticontagionist anticontagious anticonventional anticonventionalism anticonvulsive [6] anticor What I'd like to do is convert each row to a num...
2016/03/19
[ "https://Stackoverflow.com/questions/36097446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6085225/" ]
I think [`flatMap`](http://swiftdoc.org/v2.2/protocol/SequenceType/#comment-func--flatmap-s_-sequencetype_-self-generator-element-throws-s) is a more appropriate choice here: ``` let input = [ 1: [1], 2: [1, 2], 3: [1, 2, 3], 4: [1, 2, 3, 4], 5: [1, 2, 3, 4, 5] ] let output = input.values.flatMap{...
When you `reduce` a dictionary, the element type is a tuple of the Key and Value types, so you can use: ``` dictionary.reduce(0) { $0 + $1.1.list.count } ``` Or, you can get just the values from the dictionary and reduce that: ``` dictionary.values.reduce(0) { $0 + $1.list.count } ``` Note that since Dictionary.v...
36,097,446
I have a data.frame that is a single column with 235,886 rows. Each row corresponds to a single word of the English language. E.g. ``` > words[10000:10005,1] ``` [1] anticontagionist anticontagious anticonventional anticonventionalism anticonvulsive [6] anticor What I'd like to do is convert each row to a num...
2016/03/19
[ "https://Stackoverflow.com/questions/36097446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6085225/" ]
When you `reduce` a dictionary, the element type is a tuple of the Key and Value types, so you can use: ``` dictionary.reduce(0) { $0 + $1.1.list.count } ``` Or, you can get just the values from the dictionary and reduce that: ``` dictionary.values.reduce(0) { $0 + $1.list.count } ``` Note that since Dictionary.v...
More simple and clear way goes like this, ``` var dict = ["x" : 1 , "y" : 2, "z" : 3] let count = dict.reduce(0, { x, element in //maybe here some condition //if(element.value > 1){return x} return x + 1 }) ```
36,097,446
I have a data.frame that is a single column with 235,886 rows. Each row corresponds to a single word of the English language. E.g. ``` > words[10000:10005,1] ``` [1] anticontagionist anticontagious anticonventional anticonventionalism anticonvulsive [6] anticor What I'd like to do is convert each row to a num...
2016/03/19
[ "https://Stackoverflow.com/questions/36097446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6085225/" ]
I think [`flatMap`](http://swiftdoc.org/v2.2/protocol/SequenceType/#comment-func--flatmap-s_-sequencetype_-self-generator-element-throws-s) is a more appropriate choice here: ``` let input = [ 1: [1], 2: [1, 2], 3: [1, 2, 3], 4: [1, 2, 3, 4], 5: [1, 2, 3, 4, 5] ] let output = input.values.flatMap{...
More simple and clear way goes like this, ``` var dict = ["x" : 1 , "y" : 2, "z" : 3] let count = dict.reduce(0, { x, element in //maybe here some condition //if(element.value > 1){return x} return x + 1 }) ```
4,876,737
Hi there im using a ListView in wpf and have a few columns that have auto width, now i want some padding on them but im a bit unsure how to do this? i have a red background on my header and then text in there, but i want to have some space between the border of the box and the text... ![Sample image](https://i.stack.i...
2011/02/02
[ "https://Stackoverflow.com/questions/4876737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58553/" ]
You could modify the `HeaderTemplate` of the `GridViewColumn` ``` <GridViewColumn ...> <GridViewColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding}" Margin="5,0,5,0"/> </DataTemplate> </GridViewColumn.HeaderTemplate> <GridViewColumnHeader Content="Some Header" Backg...
For anyone else coming across this, here is an option that's a little cleaner. Not specifying a key on the style has this apply to all columns. This also uses padding, like the OP wanted. ``` <ListView.Resources> <Style TargetType="GridViewColumnHeader"> <Setter Property="Padding" Value="10,0" /> </Sty...
33,010,751
I followed a tutorial of new component NavigationView in Support Design Library and can't get through this error message > > java.lang.RuntimeException: Unable to start activity ComponentInfo{com.encore/com.encore.NavViewActivity}: android.view.InflateException: Binary XML file line #27: Error inflating class androi...
2015/10/08
[ "https://Stackoverflow.com/questions/33010751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5324789/" ]
I also encountered the same problem,Error exactly,Later I found out wrong here:menu->item->`android:icon="@drawable/ic_menu_camera"`,this`ic_menu_camera` header has `vector` only used in v21 or higher,so in system 5.0 or less useing can get the problems,than you can copy the following code in values folder and Named "d...
Try replacing `android:layout_gravity="start"`with `android:layout_gravity="right"` inside `NavigationView` layout.
33,010,751
I followed a tutorial of new component NavigationView in Support Design Library and can't get through this error message > > java.lang.RuntimeException: Unable to start activity ComponentInfo{com.encore/com.encore.NavViewActivity}: android.view.InflateException: Binary XML file line #27: Error inflating class androi...
2015/10/08
[ "https://Stackoverflow.com/questions/33010751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5324789/" ]
I also encountered the same problem,Error exactly,Later I found out wrong here:menu->item->`android:icon="@drawable/ic_menu_camera"`,this`ic_menu_camera` header has `vector` only used in v21 or higher,so in system 5.0 or less useing can get the problems,than you can copy the following code in values folder and Named "d...
check your navigation view by removing one of these and check your code is working or not * app:headerLayout="@layout/nav\_header" * app:menu="@menu/drawer" if your logcat says cause by resourcenotfoundexception with your above error. issue may be with a icon file/resource file in drawers. if it coming from menu/draw...
35,423,581
How can we copy all the contents of all the files in a given directory into a file **so that there are two empty lines between contents of each files**? Need not to mention, I am new to bash scripting, and I know this is not an extra complicated code! Any help will be greatly appreciated. Related links are follow...
2016/02/16
[ "https://Stackoverflow.com/questions/35423581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5200329/" ]
Try this. ``` awk 'FNR==1 && NR>1 { printf("\n\n") }1' * >newfile.txt ``` The variable `FNR` is the line number within the current file and `NR` is the line number overall.
One way: ``` ( files=(*) cat "${files[0]}" for (( i = 1; i < "${#files[@]}" ; ++i )) ; do echo echo cat "${files[i]}" done ) > newfile.txt ```
35,423,581
How can we copy all the contents of all the files in a given directory into a file **so that there are two empty lines between contents of each files**? Need not to mention, I am new to bash scripting, and I know this is not an extra complicated code! Any help will be greatly appreciated. Related links are follow...
2016/02/16
[ "https://Stackoverflow.com/questions/35423581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5200329/" ]
Try this. ``` awk 'FNR==1 && NR>1 { printf("\n\n") }1' * >newfile.txt ``` The variable `FNR` is the line number within the current file and `NR` is the line number overall.
Example of file organization: ----------------------------- I have a directory ~/Pictures/Temp If I wanted to move PNG's from that directory to another directory I would first want to set a variable for my file names: ``` # This could be other file types as well file=$(find ~/Pictures/Temp/*.png) ``` Of course the...
35,423,581
How can we copy all the contents of all the files in a given directory into a file **so that there are two empty lines between contents of each files**? Need not to mention, I am new to bash scripting, and I know this is not an extra complicated code! Any help will be greatly appreciated. Related links are follow...
2016/02/16
[ "https://Stackoverflow.com/questions/35423581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5200329/" ]
One way: ``` ( files=(*) cat "${files[0]}" for (( i = 1; i < "${#files[@]}" ; ++i )) ; do echo echo cat "${files[i]}" done ) > newfile.txt ```
Example of file organization: ----------------------------- I have a directory ~/Pictures/Temp If I wanted to move PNG's from that directory to another directory I would first want to set a variable for my file names: ``` # This could be other file types as well file=$(find ~/Pictures/Temp/*.png) ``` Of course the...
16,088,103
I'm trying to print a label from an Android app to a Zebra printer (iMZ 320) but it seems not to be understanding my command line. When I try this sample code, the printer prints all the commands to the paper as I send them to the printer: ``` zebraPrinterConnection.write("^XA^FO50,50^ADN,36,20^FDHELLO^FS^XZ".getByte...
2013/04/18
[ "https://Stackoverflow.com/questions/16088103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2295894/" ]
The Zebra iMZ may ship in line print mode. This means that it will not parse and interpret the ZPL commands that you have provided, but rather, it will print them. You'll need to configure the printer to ZPL mode instead of line print mode. The following command should do it: ! U1 setvar "device.languages" "zpl" **No...
If you want to print simple text you can send normal "raw" data trough BT socket to Zebra printer and it will print it! You don't need to use Zebra print library. Just run this code in async task to print two lines of plain text: ``` protected Object doInBackground(Object... params) { //bt address String bt_p...
58,130,757
I need to convert this function to work with IE10. I thought to use Babel to convert the file from ES6 to ES5, but i dont know how to use correctly Babel, because Babel dont convert Promise. The script ES6 is this: .... ``` function readTextFile(file) { return new Promise(function (resolve, reject) { let...
2019/09/27
[ "https://Stackoverflow.com/questions/58130757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4597387/" ]
According to [this article](https://en.cppreference.com/w/cpp/language/static) arr5 is declared but not defined. Add ``` int MyClass::arr5[5]; ``` after declaration of `class MyClass`. Than you can get `obj.arr5[0]` ``` class MyClass { public: int arr4[5]; static int arr5[5]; }; int MyClass::arr5[5]; ``...
arr1 scope is global and exists until the end of the program. arr2 scope is local and it will be created and destroyed every time when a function will be called. arr3 scope is local. Local static variables are created and initialized the first time they are used, not at program startup and will be destroyed when the p...
20,722,015
I want to send a request with fiddler and want to send it **every second** same request.Is there any way to make this with fiddler.
2013/12/21
[ "https://Stackoverflow.com/questions/20722015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3105966/" ]
I would use [JMeter](http://jmeter.apache.org/index.html) for these kind of tests, but to answer your question, here is sample script which I got from [here](http://www.bayden.com/fiddler/Dev/ScriptSamples.asp) ``` public static ToolsAction("Crawl Sequential URLs") function doCrawl(){ var sBase: String; var ...
I believe you can do it, as you can write scripts in fiddler. Anyway, I recommend you to use BURP for this purpose - you have built-in option to do it easily (repeater, for example). See <http://portswigger.net/burp/> and <http://portswigger.net/burp/repeater.html> (for repeater).
20,722,015
I want to send a request with fiddler and want to send it **every second** same request.Is there any way to make this with fiddler.
2013/12/21
[ "https://Stackoverflow.com/questions/20722015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3105966/" ]
I would use [curl](http://curl.haxx.se/) with a batch file to do just that From Fiddler, select one or more requests you want to repeat and head over to *File > Export Sessions > Selected Sessions* [![enter image description here](https://i.stack.imgur.com/NAxfk.png)](https://i.stack.imgur.com/NAxfk.png) Now select ...
I believe you can do it, as you can write scripts in fiddler. Anyway, I recommend you to use BURP for this purpose - you have built-in option to do it easily (repeater, for example). See <http://portswigger.net/burp/> and <http://portswigger.net/burp/repeater.html> (for repeater).
36,064,921
The past few days I’ve been experimenting with time pickers in Xamarin.Android. I've followed these two links: [How to update text-view with multiple datepickers](https://stackoverflow.com/questions/20738960/how-to-update-text-view-with-multiple-datepickers?lq=1) <http://blog.falafel.com/31-days-of-xamarin-android-da...
2016/03/17
[ "https://Stackoverflow.com/questions/36064921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5655661/" ]
`var numbers = list.Where(x => x == s || !string.IsNullOrEmpty(x));` takes each element from list - `x` and checks if it fits specific condition. The condition is `x == s` OR `!string.IsNullOrEmpty(x)`, so element should fit at least one part of the condition. Particularly, every element of list meets the `!string....
The operator is correct . In your first example: ``` string s = "One"; var numbers = list.Where(x => x == s || !string.IsNullOrEmpty(x)); foreach(var number in numbers) { Console.WriteLine(number); // output: // One <-- First condition is met // Two <-- First condition is not met so goes into the OR oper...
36,064,921
The past few days I’ve been experimenting with time pickers in Xamarin.Android. I've followed these two links: [How to update text-view with multiple datepickers](https://stackoverflow.com/questions/20738960/how-to-update-text-view-with-multiple-datepickers?lq=1) <http://blog.falafel.com/31-days-of-xamarin-android-da...
2016/03/17
[ "https://Stackoverflow.com/questions/36064921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5655661/" ]
You are right in saying that: ``` a || b ``` Will not evaluate `b` if `a` is `true`, but: `Where` LINQ using Lambda expression checks **every** element in the Enumerable regardless of the previous result. Thus when you do: ``` string s = "One"; var numbers = list.Where(x => x == s || !string.IsNullOrEmpty(x)); ``...
`var numbers = list.Where(x => x == s || !string.IsNullOrEmpty(x));` takes each element from list - `x` and checks if it fits specific condition. The condition is `x == s` OR `!string.IsNullOrEmpty(x)`, so element should fit at least one part of the condition. Particularly, every element of list meets the `!string....
36,064,921
The past few days I’ve been experimenting with time pickers in Xamarin.Android. I've followed these two links: [How to update text-view with multiple datepickers](https://stackoverflow.com/questions/20738960/how-to-update-text-view-with-multiple-datepickers?lq=1) <http://blog.falafel.com/31-days-of-xamarin-android-da...
2016/03/17
[ "https://Stackoverflow.com/questions/36064921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5655661/" ]
You are right in saying that: ``` a || b ``` Will not evaluate `b` if `a` is `true`, but: `Where` LINQ using Lambda expression checks **every** element in the Enumerable regardless of the previous result. Thus when you do: ``` string s = "One"; var numbers = list.Where(x => x == s || !string.IsNullOrEmpty(x)); ``...
The operator is correct . In your first example: ``` string s = "One"; var numbers = list.Where(x => x == s || !string.IsNullOrEmpty(x)); foreach(var number in numbers) { Console.WriteLine(number); // output: // One <-- First condition is met // Two <-- First condition is not met so goes into the OR oper...
47,296,821
I had a component in a ReactJS app I am working on that I sweeeearrr is not used anywhere. It even gave me the warning that "footer is defined but not used'. It isn't render anywhere and it never did anything, modify state... yet I'm getting an error message that says that the page cannot be rendered because the file i...
2017/11/14
[ "https://Stackoverflow.com/questions/47296821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
A few troubleshooting tips. It's helpful if you include these details in your question so we know what you've already tried. Try one at a time and see if the error resolves: 1. Restart your server (webpack-dev?). 2. Clear browser cache or open an incognito window and load the page again. 3. String-search your project ...
> > yet I'm getting an error message that says that the page cannot be rendered because the file is missing after I deleted it. > > > An unused import / require statement is left in there. Solution ======== Search for filename in the entire code base and remove usage. More ==== Something like TypeScript would ...
47,296,821
I had a component in a ReactJS app I am working on that I sweeeearrr is not used anywhere. It even gave me the warning that "footer is defined but not used'. It isn't render anywhere and it never did anything, modify state... yet I'm getting an error message that says that the page cannot be rendered because the file i...
2017/11/14
[ "https://Stackoverflow.com/questions/47296821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
A few troubleshooting tips. It's helpful if you include these details in your question so we know what you've already tried. Try one at a time and see if the error resolves: 1. Restart your server (webpack-dev?). 2. Clear browser cache or open an incognito window and load the page again. 3. String-search your project ...
A bit late but I faced this exact same problem. Here is what I did: 1. In VSCode, I opened command pallete and reloaded typescript 2. I restarted react server And it worked for me.
53,461,656
I'm trying to solve my issue with .htaccess file. I found out that accessing my page with <http://www.example.com> redirects to <https://www.www.example.com>. I have tried numerous .htaccess rules and can't figure it out. I want to redirect http to https and non www to www. My .htaccess file: ``` RewriteCond %{HTTPS...
2018/11/24
[ "https://Stackoverflow.com/questions/53461656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It looks like it's a browser problem. I used Justin's rule and it works good in Safari but on Chrome it's getting double www.www still. Anyways it isn't related to .htaccess as I though first and was scratching my head why it's not working.
Edited to work the way you asked. Try this as your configuration in .htaccess: ``` RewriteEngine on RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ RewriteRule ^(.*)$ https://www.%1%{REQUEST_URI} [R=301,L] ```
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
Latex paint is water soluble and non-toxic. You can dilute with water and pour it down the drain. Alternatively you can just throw it out in the trash.
I'd try the craigslist free section before I tried actually disposing of it.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
Latex paint is water soluble and non-toxic. You can dilute with water and pour it down the drain. Alternatively you can just throw it out in the trash.
Check out paintcare.org and see if that helps.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
The municipalities just don't want it liquid or with the lid on. Imagine a paint can full of paint when the compactor squishes down on it. Paint everywhere! You can put whatever you want in the paint to make it more solid. Kitty litter, the store bought stuff drying agent, sand. I have used some old mortar that I had o...
Check out paintcare.org and see if that helps.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
Look to see if your municipality has a home hazardous waste disposal. I have in a large metro area and they have multiple locations and open Tue-Sat. I've been in another where they were only open once a month. But it is a good location to dispose of batteries, paint, meds and other chemicals I don't need around the ho...
I picked up a leaflet on paint re-use at the local B&Q (UK DIY store) the other day. If you can't give it to a community re-use scheme they say stir in sawdust/wood shavings/a proprietary paint-setting product (similar to cat litter). The set (emulsion/latex) paint can then be disposed of as normal waste and if you emp...
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
What I have done on several occasions is to pour unwanted latex paint out on a sheet of plastic in the sun. spread it out so there are no deep puddles. After it dries, simply fold up the plastic and dispose as any other solid waste. After the can is dry, it also can go into recycling or the trash.
I'd try the craigslist free section before I tried actually disposing of it.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
Look to see if your municipality has a home hazardous waste disposal. I have in a large metro area and they have multiple locations and open Tue-Sat. I've been in another where they were only open once a month. But it is a good location to dispose of batteries, paint, meds and other chemicals I don't need around the ho...
Open the lid and let it dry out. Place it out of the way somewhere where rainwater will not cause it to overflow. Throw it out in a few weeks when it is mostly dried up. Do not worry about VOCs, this is an acceptable method of disposal.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
I picked up a leaflet on paint re-use at the local B&Q (UK DIY store) the other day. If you can't give it to a community re-use scheme they say stir in sawdust/wood shavings/a proprietary paint-setting product (similar to cat litter). The set (emulsion/latex) paint can then be disposed of as normal waste and if you emp...
I'd try the craigslist free section before I tried actually disposing of it.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
Open the lid and let it dry out. Place it out of the way somewhere where rainwater will not cause it to overflow. Throw it out in a few weeks when it is mostly dried up. Do not worry about VOCs, this is an acceptable method of disposal.
Check out paintcare.org and see if that helps.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
I picked up a leaflet on paint re-use at the local B&Q (UK DIY store) the other day. If you can't give it to a community re-use scheme they say stir in sawdust/wood shavings/a proprietary paint-setting product (similar to cat litter). The set (emulsion/latex) paint can then be disposed of as normal waste and if you emp...
Check out paintcare.org and see if that helps.
47,364
So, like most home owners, I have gallons of partially used paint, both from my old place, and old ones from the previous owners here. I want to dispose of these both safely and efficiently (we have quite a few gallons so pricey solutions may not fly). They're all latex paint. My municipality will take these if they'r...
2014/08/11
[ "https://diy.stackexchange.com/questions/47364", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2888/" ]
The municipalities just don't want it liquid or with the lid on. Imagine a paint can full of paint when the compactor squishes down on it. Paint everywhere! You can put whatever you want in the paint to make it more solid. Kitty litter, the store bought stuff drying agent, sand. I have used some old mortar that I had o...
I picked up a leaflet on paint re-use at the local B&Q (UK DIY store) the other day. If you can't give it to a community re-use scheme they say stir in sawdust/wood shavings/a proprietary paint-setting product (similar to cat litter). The set (emulsion/latex) paint can then be disposed of as normal waste and if you emp...
4,107,957
I know that a quadratic equation can be represented in the form $$ax^2 + bx + c = 0$$ where $a$ is not equal to $0$, and $a$, $b$, and $c$ are real numbers. However, if there is an equation in the form $$ax^2 + bx = 0$$ would it be classified as a quadratic equation since the conditions are satisfied, or would it be a ...
2021/04/19
[ "https://math.stackexchange.com/questions/4107957", "https://math.stackexchange.com", "https://math.stackexchange.com/users/483546/" ]
A quadratic equation is an equation that can be rearranged as $ax^2+bx+c=0$ where $a$ is not equal to $0$ and $b$ and $c$ are real numbers. If $a=0$ then the equation is linear not quadratic since the $x^2$ has no influence .
You need only $a≠0$ for $$ax^2+bx+c=0.$$ If the degree of your polynomial is equal to $2$, then you have a quadratic polynomial. This means , your equation $ax^2+bx=0$ is still a quadratic equation, if $a≠0.$ But, the degree of the polynomial $ax+b$ is equal to $1$. This implies, $ax+b=0$ is not a quadratic. --- **...
4,107,957
I know that a quadratic equation can be represented in the form $$ax^2 + bx + c = 0$$ where $a$ is not equal to $0$, and $a$, $b$, and $c$ are real numbers. However, if there is an equation in the form $$ax^2 + bx = 0$$ would it be classified as a quadratic equation since the conditions are satisfied, or would it be a ...
2021/04/19
[ "https://math.stackexchange.com/questions/4107957", "https://math.stackexchange.com", "https://math.stackexchange.com/users/483546/" ]
Hints 1. If you draw the graph of $y=ax^2+bx$ what shape is it? (Plug in some non-zero values for $a$ and $b$) 2. If you factorize $ax^2+bx=0$ and then apply null factor law, how many solutions are there?
You need only $a≠0$ for $$ax^2+bx+c=0.$$ If the degree of your polynomial is equal to $2$, then you have a quadratic polynomial. This means , your equation $ax^2+bx=0$ is still a quadratic equation, if $a≠0.$ But, the degree of the polynomial $ax+b$ is equal to $1$. This implies, $ax+b=0$ is not a quadratic. --- **...
4,107,957
I know that a quadratic equation can be represented in the form $$ax^2 + bx + c = 0$$ where $a$ is not equal to $0$, and $a$, $b$, and $c$ are real numbers. However, if there is an equation in the form $$ax^2 + bx = 0$$ would it be classified as a quadratic equation since the conditions are satisfied, or would it be a ...
2021/04/19
[ "https://math.stackexchange.com/questions/4107957", "https://math.stackexchange.com", "https://math.stackexchange.com/users/483546/" ]
It is a quadratic equation as it satisfies the definition. Notice that $ax^2+bx=0$ and $ax+b=0$ are not equivalent, the first one has $0$ as a solution for sure and $\frac{-b}a$ as a root as well.
You need only $a≠0$ for $$ax^2+bx+c=0.$$ If the degree of your polynomial is equal to $2$, then you have a quadratic polynomial. This means , your equation $ax^2+bx=0$ is still a quadratic equation, if $a≠0.$ But, the degree of the polynomial $ax+b$ is equal to $1$. This implies, $ax+b=0$ is not a quadratic. --- **...
4,107,957
I know that a quadratic equation can be represented in the form $$ax^2 + bx + c = 0$$ where $a$ is not equal to $0$, and $a$, $b$, and $c$ are real numbers. However, if there is an equation in the form $$ax^2 + bx = 0$$ would it be classified as a quadratic equation since the conditions are satisfied, or would it be a ...
2021/04/19
[ "https://math.stackexchange.com/questions/4107957", "https://math.stackexchange.com", "https://math.stackexchange.com/users/483546/" ]
It is a quadratic equation as it satisfies the definition. Notice that $ax^2+bx=0$ and $ax+b=0$ are not equivalent, the first one has $0$ as a solution for sure and $\frac{-b}a$ as a root as well.
A quadratic equation is an equation that can be rearranged as $ax^2+bx+c=0$ where $a$ is not equal to $0$ and $b$ and $c$ are real numbers. If $a=0$ then the equation is linear not quadratic since the $x^2$ has no influence .
4,107,957
I know that a quadratic equation can be represented in the form $$ax^2 + bx + c = 0$$ where $a$ is not equal to $0$, and $a$, $b$, and $c$ are real numbers. However, if there is an equation in the form $$ax^2 + bx = 0$$ would it be classified as a quadratic equation since the conditions are satisfied, or would it be a ...
2021/04/19
[ "https://math.stackexchange.com/questions/4107957", "https://math.stackexchange.com", "https://math.stackexchange.com/users/483546/" ]
It is a quadratic equation as it satisfies the definition. Notice that $ax^2+bx=0$ and $ax+b=0$ are not equivalent, the first one has $0$ as a solution for sure and $\frac{-b}a$ as a root as well.
Hints 1. If you draw the graph of $y=ax^2+bx$ what shape is it? (Plug in some non-zero values for $a$ and $b$) 2. If you factorize $ax^2+bx=0$ and then apply null factor law, how many solutions are there?
297,431
When I create a new instance of a ChannelFactory: ``` var factory = new ChannelFactory<IMyService>(); ``` and that I create a new channel, I have an exception saying that the address of the Endpoint is null. My configuration inside my web.config is as mentioned and everything is as it is supposed to be (especially...
2008/11/18
[ "https://Stackoverflow.com/questions/297431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24975/" ]
I finally found the answer. ChannelFactory doesn't read information from your Web.Config/app.config. ClientBase (which then work with a ChannelFactory) does. All this costed me a few hours of work but I finally found a valid reason. :)
Will it work if you provide the endpoint with a name like this in Web.Config: ``` <endpoint address="http://localhost:2000/MyService/" binding="wsHttpBinding" behaviorConfiguration="wsHttpBehaviour" contract="IService" name="MyWsHttpEndpoint" /> ``` And create the channel using ChannelFactory like this: ```...
297,431
When I create a new instance of a ChannelFactory: ``` var factory = new ChannelFactory<IMyService>(); ``` and that I create a new channel, I have an exception saying that the address of the Endpoint is null. My configuration inside my web.config is as mentioned and everything is as it is supposed to be (especially...
2008/11/18
[ "https://Stackoverflow.com/questions/297431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24975/" ]
Will it work if you provide the endpoint with a name like this in Web.Config: ``` <endpoint address="http://localhost:2000/MyService/" binding="wsHttpBinding" behaviorConfiguration="wsHttpBehaviour" contract="IService" name="MyWsHttpEndpoint" /> ``` And create the channel using ChannelFactory like this: ```...
ChannelFactory instantiated by the new operator DOES read from web.config. AnAngel answer above is correct. You just have to make sure that you provide your endpoint with a name. And make sure that the endpoint contract is set correctly (very important) I have an experience before where my web.config was generated by ...
297,431
When I create a new instance of a ChannelFactory: ``` var factory = new ChannelFactory<IMyService>(); ``` and that I create a new channel, I have an exception saying that the address of the Endpoint is null. My configuration inside my web.config is as mentioned and everything is as it is supposed to be (especially...
2008/11/18
[ "https://Stackoverflow.com/questions/297431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24975/" ]
I finally found the answer. ChannelFactory doesn't read information from your Web.Config/app.config. ClientBase (which then work with a ChannelFactory) does. All this costed me a few hours of work but I finally found a valid reason. :)
ChannelFactory instantiated by the new operator DOES read from web.config. AnAngel answer above is correct. You just have to make sure that you provide your endpoint with a name. And make sure that the endpoint contract is set correctly (very important) I have an experience before where my web.config was generated by ...
11,873,160
I am developing an application that needs to interract with a "lightly documented" Legacy Oracle Database. To Start that process I want to start creating a view into that Database using ODBC links into an MS Access database so I can figure out the DB structure but I can't figure out how to setup the ODBC connection to ...
2012/08/08
[ "https://Stackoverflow.com/questions/11873160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487159/" ]
Navigate to the **Control Panel** > **Administrative Tools** > **Data Sources (ODBC)** Select the **System DSN** tab and click 'Add'. Next scroll down the lists of drivers until you find **Microsoft ODBC for Oracle**. ![enter image description here](https://i.stack.imgur.com/qiVzc.png) Fill in the required informat...
The simplest option to generate the tnsnames.ora file is to let Oracle do it. If you launch the Oracle Net Configuration Assistant (Start | Oracle in *Oracle Home Name* | Configuration and Migration Tools | Net Configuration Assistant), you should be able to choose "Local Net Service Name configuration" which allows yo...
11,873,160
I am developing an application that needs to interract with a "lightly documented" Legacy Oracle Database. To Start that process I want to start creating a view into that Database using ODBC links into an MS Access database so I can figure out the DB structure but I can't figure out how to setup the ODBC connection to ...
2012/08/08
[ "https://Stackoverflow.com/questions/11873160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487159/" ]
Navigate to the **Control Panel** > **Administrative Tools** > **Data Sources (ODBC)** Select the **System DSN** tab and click 'Add'. Next scroll down the lists of drivers until you find **Microsoft ODBC for Oracle**. ![enter image description here](https://i.stack.imgur.com/qiVzc.png) Fill in the required informat...
In tnsnames.ora, try changing SERVICE\_NAME to SID. That worked for me.
11,873,160
I am developing an application that needs to interract with a "lightly documented" Legacy Oracle Database. To Start that process I want to start creating a view into that Database using ODBC links into an MS Access database so I can figure out the DB structure but I can't figure out how to setup the ODBC connection to ...
2012/08/08
[ "https://Stackoverflow.com/questions/11873160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487159/" ]
Navigate to the **Control Panel** > **Administrative Tools** > **Data Sources (ODBC)** Select the **System DSN** tab and click 'Add'. Next scroll down the lists of drivers until you find **Microsoft ODBC for Oracle**. ![enter image description here](https://i.stack.imgur.com/qiVzc.png) Fill in the required informat...
My Experience 1. TNSNAMES.ORA is as follows. XE = (DESCRIPTION = (ADDRESS\_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.116) (PORT = 1521) ) ) (CONNECT\_DATA = (SERVICE\_NAME = XE) ) ) 2. Set Windows Environment Variables (ControlPanel --> System --> Detail..) 2-1. Add to PATH c:\oraclexe\insta...
11,873,160
I am developing an application that needs to interract with a "lightly documented" Legacy Oracle Database. To Start that process I want to start creating a view into that Database using ODBC links into an MS Access database so I can figure out the DB structure but I can't figure out how to setup the ODBC connection to ...
2012/08/08
[ "https://Stackoverflow.com/questions/11873160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487159/" ]
The simplest option to generate the tnsnames.ora file is to let Oracle do it. If you launch the Oracle Net Configuration Assistant (Start | Oracle in *Oracle Home Name* | Configuration and Migration Tools | Net Configuration Assistant), you should be able to choose "Local Net Service Name configuration" which allows yo...
In tnsnames.ora, try changing SERVICE\_NAME to SID. That worked for me.
11,873,160
I am developing an application that needs to interract with a "lightly documented" Legacy Oracle Database. To Start that process I want to start creating a view into that Database using ODBC links into an MS Access database so I can figure out the DB structure but I can't figure out how to setup the ODBC connection to ...
2012/08/08
[ "https://Stackoverflow.com/questions/11873160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487159/" ]
The simplest option to generate the tnsnames.ora file is to let Oracle do it. If you launch the Oracle Net Configuration Assistant (Start | Oracle in *Oracle Home Name* | Configuration and Migration Tools | Net Configuration Assistant), you should be able to choose "Local Net Service Name configuration" which allows yo...
My Experience 1. TNSNAMES.ORA is as follows. XE = (DESCRIPTION = (ADDRESS\_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.116) (PORT = 1521) ) ) (CONNECT\_DATA = (SERVICE\_NAME = XE) ) ) 2. Set Windows Environment Variables (ControlPanel --> System --> Detail..) 2-1. Add to PATH c:\oraclexe\insta...
73,833,899
Currently in my SceneKit scene for a game in iOS using Swift the render distance is very limited, there is a noticeable cutoff in the terrain [![infront](https://i.stack.imgur.com/btFEi.jpg)](https://i.stack.imgur.com/btFEi.jpg) of the players perspective, i cant find a "max render distance" setting anywhere and the ...
2022/09/24
[ "https://Stackoverflow.com/questions/73833899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15243101/" ]
Camera Far Clipping Plane ------------------------- To adjust a max distance between the camera and a visible surface, use `zFar` instance property. If a 3D object's surface is farther from the camera than this distance, the surface is clipped and does not appear. The default value in SceneKit is 100.0 meters. ``` ar...
Im a dingdong and figured out what i was missing. What i was looking for was a setting in the camera that your scene is using as the point of view, theres a setting called 'Z clipping" which clips out anything closer then the "near" value or further then the "far" value, and by default far is set to 100 units. just ad...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
This should help you. ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);",product.getName(), product.getCost()); session.createSQLQuery(sql).executeUpdate(); session.getTransacti...
Its always better to use PreparedStatement *(You dont want to give way to SQL Injections)*. ``` String sql = "INSERT INTO products (name,cost) VALUES (?,?)"; Session sess = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); Connection con = sess.connection(); PreparedStatement pstmt = con.prepareStatemen...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
This should help you. ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);",product.getName(), product.getCost()); session.createSQLQuery(sql).executeUpdate(); session.getTransacti...
Another issue that might hit you (like it hit me) is this: You want to run a native query, but can't get it to work in your production code? Pay attention if you are using a different database user for the application than the schema owner. In that case you may have to add the schema prefix to the referenced tables in...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
This should help you. ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);",product.getName(), product.getCost()); session.createSQLQuery(sql).executeUpdate(); session.getTransacti...
The solution that work for me is the following: ``` public List<T> queryNativeExecute(String query) throws CustomException { List<T> result =null; Session session =null; Transaction transaction=null; try{ session = HibernateUtil.getSessionJavaConfigFactory().openSession(); ...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
This should help you. ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);",product.getName(), product.getCost()); session.createSQLQuery(sql).executeUpdate(); session.getTransacti...
worked with me in spring-boot and hibernate 5.4.2 using the entity manager ``` @Autowired EntityManager em; public List<String> getDistinctColumnValues(String tableName, String columnName) { List<String> result = em.createNativeQuery("select distinct (" + columnName + ") from " + tableName).getResultList(); ...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
Its always better to use PreparedStatement *(You dont want to give way to SQL Injections)*. ``` String sql = "INSERT INTO products (name,cost) VALUES (?,?)"; Session sess = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); Connection con = sess.connection(); PreparedStatement pstmt = con.prepareStatemen...
Another issue that might hit you (like it hit me) is this: You want to run a native query, but can't get it to work in your production code? Pay attention if you are using a different database user for the application than the schema owner. In that case you may have to add the schema prefix to the referenced tables in...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
Its always better to use PreparedStatement *(You dont want to give way to SQL Injections)*. ``` String sql = "INSERT INTO products (name,cost) VALUES (?,?)"; Session sess = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); Connection con = sess.connection(); PreparedStatement pstmt = con.prepareStatemen...
The solution that work for me is the following: ``` public List<T> queryNativeExecute(String query) throws CustomException { List<T> result =null; Session session =null; Transaction transaction=null; try{ session = HibernateUtil.getSessionJavaConfigFactory().openSession(); ...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
Its always better to use PreparedStatement *(You dont want to give way to SQL Injections)*. ``` String sql = "INSERT INTO products (name,cost) VALUES (?,?)"; Session sess = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); Connection con = sess.connection(); PreparedStatement pstmt = con.prepareStatemen...
worked with me in spring-boot and hibernate 5.4.2 using the entity manager ``` @Autowired EntityManager em; public List<String> getDistinctColumnValues(String tableName, String columnName) { List<String> result = em.createNativeQuery("select distinct (" + columnName + ") from " + tableName).getResultList(); ...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
Another issue that might hit you (like it hit me) is this: You want to run a native query, but can't get it to work in your production code? Pay attention if you are using a different database user for the application than the schema owner. In that case you may have to add the schema prefix to the referenced tables in...
The solution that work for me is the following: ``` public List<T> queryNativeExecute(String query) throws CustomException { List<T> result =null; Session session =null; Transaction transaction=null; try{ session = HibernateUtil.getSessionJavaConfigFactory().openSession(); ...
24,782,717
I'm using `hibernate 4.2.6` and `PostgreSQL 9.1` I've been trying to execute sql query with hibernate. I've written: ``` Session session = Hibernate.util.HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); String sql = String.format("INSERT INTO products (name,cost) VALUES('%s',%s);", product....
2014/07/16
[ "https://Stackoverflow.com/questions/24782717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
Another issue that might hit you (like it hit me) is this: You want to run a native query, but can't get it to work in your production code? Pay attention if you are using a different database user for the application than the schema owner. In that case you may have to add the schema prefix to the referenced tables in...
worked with me in spring-boot and hibernate 5.4.2 using the entity manager ``` @Autowired EntityManager em; public List<String> getDistinctColumnValues(String tableName, String columnName) { List<String> result = em.createNativeQuery("select distinct (" + columnName + ") from " + tableName).getResultList(); ...
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
You could use the `.innerWidth()` and `.outerWidth()` to get the the width with and without the borders and subtract the second from the first one. ``` var someElement = $("#someId"); var outer = someElement.outerWidth(); var inner = someElement.innerWidth(); alert(outer - inner); // alerts the border width in pixels...
Get Border width : ``` <script type="text/javascript"> $(document).ready(function(){ var widthBorder = $("div").css("border"); alert(widthBorder); //you can split between sintax 'px' }); </script> ```
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
You could use the `.innerWidth()` and `.outerWidth()` to get the the width with and without the borders and subtract the second from the first one. ``` var someElement = $("#someId"); var outer = someElement.outerWidth(); var inner = someElement.innerWidth(); alert(outer - inner); // alerts the border width in pixels...
I have a solution using an additional inner container to circumvent the problem and calculate the real border withs of all sides of the container. So if having this additional inner container is possible in your situation, then [this fiddle](http://jsfiddle.net/XxZ37/1/) works for me in Chrome/FF/Safari/IE7/IE8 and wit...
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
You could use the `.innerWidth()` and `.outerWidth()` to get the the width with and without the borders and subtract the second from the first one. ``` var someElement = $("#someId"); var outer = someElement.outerWidth(); var inner = someElement.innerWidth(); alert(outer - inner); // alerts the border width in pixels...
``` <script type="text/javascript"> $(document).ready(function(){ var widthBorder = $("div").css("border","5px"); // you can increase your pixel size according to your requirement. }); </script> ```
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
usualy if you have: ``` <div id="container">myContainer</div> ``` you can get the Border-Width attribute by jQuery: ``` var borderWidth = $('#container').css('borderWidth'); alert(borderWidth); ``` or for each side by: ``` var left = $('#container').css('borderLeftWidth'); var right = $('#container').css('border...
Get Border width : ``` <script type="text/javascript"> $(document).ready(function(){ var widthBorder = $("div").css("border"); alert(widthBorder); //you can split between sintax 'px' }); </script> ```
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
usualy if you have: ``` <div id="container">myContainer</div> ``` you can get the Border-Width attribute by jQuery: ``` var borderWidth = $('#container').css('borderWidth'); alert(borderWidth); ``` or for each side by: ``` var left = $('#container').css('borderLeftWidth'); var right = $('#container').css('border...
I have a solution using an additional inner container to circumvent the problem and calculate the real border withs of all sides of the container. So if having this additional inner container is possible in your situation, then [this fiddle](http://jsfiddle.net/XxZ37/1/) works for me in Chrome/FF/Safari/IE7/IE8 and wit...
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
usualy if you have: ``` <div id="container">myContainer</div> ``` you can get the Border-Width attribute by jQuery: ``` var borderWidth = $('#container').css('borderWidth'); alert(borderWidth); ``` or for each side by: ``` var left = $('#container').css('borderLeftWidth'); var right = $('#container').css('border...
``` <script type="text/javascript"> $(document).ready(function(){ var widthBorder = $("div").css("border","5px"); // you can increase your pixel size according to your requirement. }); </script> ```
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
I played around with this for a little longer and the only solution I was able to come up with which would kind-off sort out the issue is similar to this: ``` var thinBorder = 1; var mediumBorder = 3; var thickBorder = 5; function getLeftBorderWidth($element) { var leftBorderWidth = $element.css("borderLeftWidth"...
Get Border width : ``` <script type="text/javascript"> $(document).ready(function(){ var widthBorder = $("div").css("border"); alert(widthBorder); //you can split between sintax 'px' }); </script> ```
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
I played around with this for a little longer and the only solution I was able to come up with which would kind-off sort out the issue is similar to this: ``` var thinBorder = 1; var mediumBorder = 3; var thickBorder = 5; function getLeftBorderWidth($element) { var leftBorderWidth = $element.css("borderLeftWidth"...
I have a solution using an additional inner container to circumvent the problem and calculate the real border withs of all sides of the container. So if having this additional inner container is possible in your situation, then [this fiddle](http://jsfiddle.net/XxZ37/1/) works for me in Chrome/FF/Safari/IE7/IE8 and wit...
13,607,252
I have to position a popup element dynamically inside a container. I'm trying to get the border width of the container. I've found several questions like this one: [How to get border width in jQuery/javascript](https://stackoverflow.com/questions/3787502/how-to-get-border-width-in-jquery-javascript) My problem has be...
2012/11/28
[ "https://Stackoverflow.com/questions/13607252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103075/" ]
I played around with this for a little longer and the only solution I was able to come up with which would kind-off sort out the issue is similar to this: ``` var thinBorder = 1; var mediumBorder = 3; var thickBorder = 5; function getLeftBorderWidth($element) { var leftBorderWidth = $element.css("borderLeftWidth"...
``` <script type="text/javascript"> $(document).ready(function(){ var widthBorder = $("div").css("border","5px"); // you can increase your pixel size according to your requirement. }); </script> ```
62,543,396
i have this query which is very simple but i dont want to use index here due to some constraints. so my worry is how to avoid huge load on server if we are calling non indexed item in where clause. the solution i feel will be limit. i am sure of having data in 1000 rows so if i use limit i can check the available val...
2020/06/23
[ "https://Stackoverflow.com/questions/62543396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13095122/" ]
For that specific layout I would use VBox instead of AnchorPane: ``` Label label = new Label("User Name"); ChoiceBox<String> cb = new ChoiceBox<>(); VBox container = new VBox(); container.setPadding(new Insets(20, 0, 0, 0)); container.setSpacing(10); List<String> items = List.of("<New User>...
Oboe was correct, if I use a ComboBox instead of a ChoiceBox, the control behaves as I want it to. After looking up the difference between the two, I think a ComboBox will suit my needs just fine. Thank you Oboe. If anyone is interested, here is the code behaving as desired: ``` import javafx.application.Application...
28,890,813
Using bootstrap v3 adapt each level of Pascal Triangle. Each level must adapt to width according each device, level 1 one single adaptive box, level 2 3 single adaptive box, etc.
2015/03/06
[ "https://Stackoverflow.com/questions/28890813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639143/" ]
There is a wrong offset between your injected value and the name of it You injected `fetchSet` but you did not use it in the function signature This ``` function CardInfoController (fetchCard, _, $routeParams, $filter, $location) { ``` Should be ``` function CardInfoController (fetchCard, fetchSet, _, $routeParam...
`$routeParams` is a service of the `ngRoute` module, you have to add it to your module declaration: ``` angular .module('card-info.controller', ['ui.bootstrap', 'ngRoute']) .controller('CardInfoController', CardInfoController); ``` Source: [$routeParams](https://docs.angularjs.org/api/ngRoute/service/$routePara...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
How about using `--since` and `--before`? For example, this will delete all branches that have not received any commits for a week: ``` for k in $(git branch | sed /\*/d); do if [ -z "$(git log -1 --since='1 week ago' -s $k)" ]; then git branch -D $k fi done ``` If you want to delete all branches that are ...
*The poor man's method:* List the branches by the date of last commit: ``` git branch --sort=committerdate | xargs echo ``` this will list the branches while `xargs echo` pipe makes it inline (*thx [Jesse](https://stackoverflow.com/questions/10325599/delete-all-branches-that-are-more-than-x-days-weeks-old/49998249#...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
This is what worked for me: ``` for k in $(git branch -r | sed /\*/d); do if [ -z "$(git log -1 --since='Aug 10, 2016' -s $k)" ]; then branch_name_with_no_origin=$(echo $k | sed -e "s/origin\///") echo deleting branch: $branch_name_with_no_origin git push origin --delete $branch_name_with_no_origin f...
For how using **PowerShell:** * **Delete all merged branches** excluding notMatch pattern ``` git branch -r --merged | Select-String -NotMatch "(^\*|master)" | %{ $_ -replace ".*/", "" } | %{ git push origin --delete $_ } ``` * **List all merged branches** in txt file ``` git branch -r --merged | Select-String -No...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
The [above code](https://stackoverflow.com/a/10325758/537998) did not work for me, but it was close. Instead, I used the following: ``` for k in $(git branch | sed /\*/d); do if [[ ! $(git log -1 --since='2 weeks ago' -s $k) ]]; then git branch -D $k fi done ```
I'm assuming that you want to delete just the refs, not the commits in the branches. To delete all merged branches except the most recent `__X__`: ``` git branch -d `for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk 'BEGIN{ORS=" "}; {if(NR>__X__) print $2}'`...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
Safe way to show the delete commands only for local branches merged into master with the last commit over a month ago. ```sh for k in $(git branch --format="%(refname:short)" --merged master); do if (($(git log -1 --since='1 month ago' -s $k|wc -l)==0)); then echo git branch -d $k fi done ``` This *does not...
Sometimes it needs to know if a branch has been merged to the master branch. For that purpose could be used the following script: ``` #!/usr/bin/env bash read -p "If you want delete branhes type 'D', otherwise press 'Enter' and branches will be printed out only: " action [[ $action = "D" ]] && ECHO="" || ECHO="echo" ...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
How about using `--since` and `--before`? For example, this will delete all branches that have not received any commits for a week: ``` for k in $(git branch | sed /\*/d); do if [ -z "$(git log -1 --since='1 week ago' -s $k)" ]; then git branch -D $k fi done ``` If you want to delete all branches that are ...
Based on @daniel-baulig's answer and the comments I came up with this: ``` for k in $(git branch -r --format="%(refname:short)" | sed s#^origin/##); do if [ -z "$(git log -1 --since='4 week ago' -s $k)" ]; then ## Info about the branches before deleting git log -1 --format="%ci %ce - %H $k" -s $k; ## De...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
How about using `--since` and `--before`? For example, this will delete all branches that have not received any commits for a week: ``` for k in $(git branch | sed /\*/d); do if [ -z "$(git log -1 --since='1 week ago' -s $k)" ]; then git branch -D $k fi done ``` If you want to delete all branches that are ...
For how using **PowerShell:** * **Delete all merged branches** excluding notMatch pattern ``` git branch -r --merged | Select-String -NotMatch "(^\*|master)" | %{ $_ -replace ".*/", "" } | %{ git push origin --delete $_ } ``` * **List all merged branches** in txt file ``` git branch -r --merged | Select-String -No...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
This is what worked for me: ``` for k in $(git branch -r | sed /\*/d); do if [ -z "$(git log -1 --since='Aug 10, 2016' -s $k)" ]; then branch_name_with_no_origin=$(echo $k | sed -e "s/origin\///") echo deleting branch: $branch_name_with_no_origin git push origin --delete $branch_name_with_no_origin f...
``` for k in $(git branch -r | sed /\*/d); do if [ -n "$(git log -1 --before='80 week ago' -s $k)" ]; then git push origin --delete "${k/origin\//}" fi done ```
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
``` for k in $(git branch -r | sed /\*/d); do if [ -n "$(git log -1 --before='80 week ago' -s $k)" ]; then git push origin --delete "${k/origin\//}" fi done ```
I'm assuming that you want to delete just the refs, not the commits in the branches. To delete all merged branches except the most recent `__X__`: ``` git branch -d `for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk 'BEGIN{ORS=" "}; {if(NR>__X__) print $2}'`...
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
Safe way to show the delete commands only for local branches merged into master with the last commit over a month ago. ```sh for k in $(git branch --format="%(refname:short)" --merged master); do if (($(git log -1 --since='1 month ago' -s $k|wc -l)==0)); then echo git branch -d $k fi done ``` This *does not...
``` for k in $(git branch -r | sed /\*/d); do if [ -n "$(git log -1 --before='80 week ago' -s $k)" ]; then git push origin --delete "${k/origin\//}" fi done ```
10,325,599
I found the below script that lists the branches by date. How do I filter this to exclude newer branches and feed the results into the Git delete command? ``` for k in $(git branch | sed /\*/d); do echo "$(git log -1 --pretty=format:"%ct" $k) $k" done | sort -r | awk '{print $2}' ```
2012/04/26
[ "https://Stackoverflow.com/questions/10325599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200295/" ]
Delete 5 oldest remote branches ``` git branch -r --sort=committerdate | head -n 5 | sed 's/ origin\///' | xargs git push origin --delete ```
For how using **PowerShell:** * **Delete all merged branches** excluding notMatch pattern ``` git branch -r --merged | Select-String -NotMatch "(^\*|master)" | %{ $_ -replace ".*/", "" } | %{ git push origin --delete $_ } ``` * **List all merged branches** in txt file ``` git branch -r --merged | Select-String -No...