qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
300,008
Is there a practical reason that the roles of the primary and secondary of a simple single-phase transformer cannot be swapped? Say you have a transformer (from the old vacuum tube days) that has rated for primary 120 VAC 1 A and secondary 12.6 VAC 10 A (so there is about 0.120 kVA for this transformer). Is there any...
2017/04/17
['https://electronics.stackexchange.com/questions/300008', 'https://electronics.stackexchange.com', 'https://electronics.stackexchange.com/users/89489/']
You can do exactly that. Respect the maximum voltage on each winding. Transformers cannot be over-volted and still behave themselves. Due to the various small non-idealities, winding resistance and leakage inductance being the major ones, you will notice that the voltage ratio one way when under load is slightly less...
A simple answer is not always right. The first problem you have is your quoted ratings. 120 V @ 1 A - 120 VA. If the load is entirely resistive, ie, there is no reactive load, then the maximum you can get out of the secondary will be about 12.6 V @ 9 A, if the efficiency is 95% - not 10 A. Brian Drummond's answer is c...
300,008
Is there a practical reason that the roles of the primary and secondary of a simple single-phase transformer cannot be swapped? Say you have a transformer (from the old vacuum tube days) that has rated for primary 120 VAC 1 A and secondary 12.6 VAC 10 A (so there is about 0.120 kVA for this transformer). Is there any...
2017/04/17
['https://electronics.stackexchange.com/questions/300008', 'https://electronics.stackexchange.com', 'https://electronics.stackexchange.com/users/89489/']
Yes, that'll work - with one caveat. A carefully designed transformer will take into account the internal losses, to minimise them while reducing cost. So the primary may be wound with slightly thicker wire for lower resistance than in an "ideal" transformer, or the secondary with slightly thinner wire because it only...
A simple answer is not always right. The first problem you have is your quoted ratings. 120 V @ 1 A - 120 VA. If the load is entirely resistive, ie, there is no reactive load, then the maximum you can get out of the secondary will be about 12.6 V @ 9 A, if the efficiency is 95% - not 10 A. Brian Drummond's answer is c...
27,641,563
I am using MyBatis 3.2.8 in a Play Framework 2.3.6 Java project. I've been struggling for several days with iterating over a list of integers that is passed to a MyBatis mapper within a complex object parameter. Here is my setup: I have a class called EventFilter in EventFilter.java: ``` public class EventFilter { pr...
2014/12/24
['https://Stackoverflow.com/questions/27641563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1695454/']
I finally got it working. The only thing I ended up having to change was addressing the parameter lists in my XML mapper without the surrounding curly braces. So instead of: ``` <if test="#{eventFilter.closestCountry} != null"> AND ev.location_closest_country_id IN <foreach item="id" index="index" co...
try this ``` <if test="eventFilter.closestCountry != null"> AND ev.location_closest_country_id IN <foreach item="id" index="index" collection="eventFilter.closestCountry" open="(" separator="," close=")"> ${id} </foreach> </if> ```
27,641,563
I am using MyBatis 3.2.8 in a Play Framework 2.3.6 Java project. I've been struggling for several days with iterating over a list of integers that is passed to a MyBatis mapper within a complex object parameter. Here is my setup: I have a class called EventFilter in EventFilter.java: ``` public class EventFilter { pr...
2014/12/24
['https://Stackoverflow.com/questions/27641563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1695454/']
I finally got it working. The only thing I ended up having to change was addressing the parameter lists in my XML mapper without the surrounding curly braces. So instead of: ``` <if test="#{eventFilter.closestCountry} != null"> AND ev.location_closest_country_id IN <foreach item="id" index="index" co...
I'm using MyBatis v. 3.4.6. My case: ``` @Mapper public interface CorsoMapper { List<CorsoEntity> elenco(Filtro filtro); } public class Filtro implements Serializable { private static final long serialVersionUID = -8357822764110641974L; private String codice; private List<String> codici; public...
27,641,563
I am using MyBatis 3.2.8 in a Play Framework 2.3.6 Java project. I've been struggling for several days with iterating over a list of integers that is passed to a MyBatis mapper within a complex object parameter. Here is my setup: I have a class called EventFilter in EventFilter.java: ``` public class EventFilter { pr...
2014/12/24
['https://Stackoverflow.com/questions/27641563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1695454/']
try this ``` <if test="eventFilter.closestCountry != null"> AND ev.location_closest_country_id IN <foreach item="id" index="index" collection="eventFilter.closestCountry" open="(" separator="," close=")"> ${id} </foreach> </if> ```
I'm using MyBatis v. 3.4.6. My case: ``` @Mapper public interface CorsoMapper { List<CorsoEntity> elenco(Filtro filtro); } public class Filtro implements Serializable { private static final long serialVersionUID = -8357822764110641974L; private String codice; private List<String> codici; public...
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
DEPRECATED: As mentioned on this answer ([How can I run commands in a running container in AWS ECS using Fargate](https://stackoverflow.com/questions/51570928/how-can-i-run-commands-in-a-running-container-in-aws-ecs-using-fargate)) you cannot do it due to the fact AWS doesn't give you access to the underlying infrastru...
As i know and having experience on ECS you are not allowed to do it. aws does not give you access to the underlying resources. if you are using fargate + EC2 Configuration then also it is not to access EC2.
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
DEPRECATED: As mentioned on this answer ([How can I run commands in a running container in AWS ECS using Fargate](https://stackoverflow.com/questions/51570928/how-can-i-run-commands-in-a-running-container-in-aws-ecs-using-fargate)) you cannot do it due to the fact AWS doesn't give you access to the underlying infrastru...
I don't know if this is what you are trying to achieve, but if you want you can run a command on a new container that you instantiate for the occasion through a CloudWatch Rule It will be enough to create a new task definition and indicate the command to execute (in the example executing a Laravel command) ``` ECSRep...
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
DEPRECATED: As mentioned on this answer ([How can I run commands in a running container in AWS ECS using Fargate](https://stackoverflow.com/questions/51570928/how-can-i-run-commands-in-a-running-container-in-aws-ecs-using-fargate)) you cannot do it due to the fact AWS doesn't give you access to the underlying infrastru...
You may be able to script your container to execute a cli command, but you cannot ssh into the container though. If you can invoke a `.sh` file from the `CMD` command in the Dockerfile, the cli command will get executed as long as you have aws-cli installed on the docker image. In the Dockerfile make sure to run `pip...
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
As i know and having experience on ECS you are not allowed to do it. aws does not give you access to the underlying resources. if you are using fargate + EC2 Configuration then also it is not to access EC2.
I don't know if this is what you are trying to achieve, but if you want you can run a command on a new container that you instantiate for the occasion through a CloudWatch Rule It will be enough to create a new task definition and indicate the command to execute (in the example executing a Laravel command) ``` ECSRep...
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
As i know and having experience on ECS you are not allowed to do it. aws does not give you access to the underlying resources. if you are using fargate + EC2 Configuration then also it is not to access EC2.
You may be able to script your container to execute a cli command, but you cannot ssh into the container though. If you can invoke a `.sh` file from the `CMD` command in the Dockerfile, the cli command will get executed as long as you have aws-cli installed on the docker image. In the Dockerfile make sure to run `pip...
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
AWS have now launched Amazon ECS Exec, which allows you to directly interact with containers: <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html>.
As i know and having experience on ECS you are not allowed to do it. aws does not give you access to the underlying resources. if you are using fargate + EC2 Configuration then also it is not to access EC2.
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
AWS have now launched Amazon ECS Exec, which allows you to directly interact with containers: <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html>.
I don't know if this is what you are trying to achieve, but if you want you can run a command on a new container that you instantiate for the occasion through a CloudWatch Rule It will be enough to create a new task definition and indicate the command to execute (in the example executing a Laravel command) ``` ECSRep...
53,867,961
There is a GlobalSign CA. In most cases its root certificate is already exists in the Windows Certificates storage. But sometimes (especially on old Windows versions) the storage doesn't contain the certificate. I need to check if the certificate exists and import it if does not. I exported the certificate to a file a...
2018/12/20
['https://Stackoverflow.com/questions/53867961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4675884/']
AWS have now launched Amazon ECS Exec, which allows you to directly interact with containers: <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html>.
You may be able to script your container to execute a cli command, but you cannot ssh into the container though. If you can invoke a `.sh` file from the `CMD` command in the Dockerfile, the cli command will get executed as long as you have aws-cli installed on the docker image. In the Dockerfile make sure to run `pip...
31,441,040
I'm trying to retain the selected value of a dropdownlist once the user change the dropdownlist item but its not working as expected what I wanted is to retain the selected item in the dropdownlist but its it defaulted to the `Select Company` everytime i select the item from dropdownlist, once the user change it postba...
2015/07/15
['https://Stackoverflow.com/questions/31441040', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/275390/']
As I wrote in the comment section, it's really unclear to me what you're asking. However, looking at your code examples, it seems to me that `trait A` isn't really required. You can use the types that already come with the Scala SDK: ``` object B extends (()=>Unit) { def apply() { /* implementation */ } } ``` Or, ...
`object B` doesn't really have much to do with `class B` aside from some special rules. If you wish to reuse that `doSomething` method you should just reuse the implementation from the object: ``` class B { def doSomething() = B.doSomething() } ``` If you want to specify `object B` as a specific instance of `clas...
31,441,040
I'm trying to retain the selected value of a dropdownlist once the user change the dropdownlist item but its not working as expected what I wanted is to retain the selected item in the dropdownlist but its it defaulted to the `Select Company` everytime i select the item from dropdownlist, once the user change it postba...
2015/07/15
['https://Stackoverflow.com/questions/31441040', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/275390/']
As I wrote in the comment section, it's really unclear to me what you're asking. However, looking at your code examples, it seems to me that `trait A` isn't really required. You can use the types that already come with the Scala SDK: ``` object B extends (()=>Unit) { def apply() { /* implementation */ } } ``` Or, ...
The notion of a *companion object* extending a trait is useful for defining behavior associated with the class itself (e.g. static methods) as opposed to instances of the class. In other words, it allows your static methods to implement interfaces. Here's an example: ``` import java.nio.ByteBuffer // a trait to be im...
31,441,040
I'm trying to retain the selected value of a dropdownlist once the user change the dropdownlist item but its not working as expected what I wanted is to retain the selected item in the dropdownlist but its it defaulted to the `Select Company` everytime i select the item from dropdownlist, once the user change it postba...
2015/07/15
['https://Stackoverflow.com/questions/31441040', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/275390/']
`object B` doesn't really have much to do with `class B` aside from some special rules. If you wish to reuse that `doSomething` method you should just reuse the implementation from the object: ``` class B { def doSomething() = B.doSomething() } ``` If you want to specify `object B` as a specific instance of `clas...
The notion of a *companion object* extending a trait is useful for defining behavior associated with the class itself (e.g. static methods) as opposed to instances of the class. In other words, it allows your static methods to implement interfaces. Here's an example: ``` import java.nio.ByteBuffer // a trait to be im...
2,815,373
I'm looking for the following features: 1. Scheduler uses SQL Server as the backing store 2. Tasks can be scheduled by one application and executed by another 3. I can have multiple applications, each of which handles a specific subset of tasks 4. Tasks can be triggered at specific times, now, or based on the success ...
2010/05/12
['https://Stackoverflow.com/questions/2815373', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/156767/']
I hate to say it, but it sounds like you want [BizTalk](http://www.microsoft.com/biztalk/en/us/default.aspx) which is neither open source, nor free, but is ideally suited towards what you are trying to accomplish.
You could use Windows Workflow (WF), maybe along with Quartz.NET
332,362
Suppose $M$ is a $\sigma$-finite measure space, and $\Gamma$ a set of positive-measure subsets of $M$ such that every point in $M$ belongs to only finitely many members of $\Gamma$. Must $\Gamma$ be countable? (And if the answer to this question is *no* for general σ-finite measures, is it also no for, say, Lebesgue me...
2013/03/16
['https://math.stackexchange.com/questions/332362', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/4909/']
Assume a finite measure. There is an $\epsilon > 0$ and countable collection $E\_i$ with $\mu(E\_i) > \epsilon$, because the alternative is that $\lbrace E: \mu(E) > \frac 1 n \rbrace$ is finite for all $n$, which would make $\lbrace E: \mu(E) > 0 \rbrace$ countable. Let $F\_n = E\_n \cup E\_{n+1} \cup .... $. The sequ...
Here is a more detailed and more elementary version of mike's proof, using continuity rather than the bounded convergence theorem, which I'm writing up mostly for my own edification. Suppose that for some finite-measure $S$ and $ε>0$, there are infinitely many $E⊂Γ$ with $μ(S∩E)≥ε$. Let $E\_0, E\_1, E\_2\ldots$ be a ...
201,346
We were fighting Vecna himself, and at one point had a *[prismatic wall](https://www.dndbeyond.com/spells/prismatic-wall)* up between us and Vecna. The *prismatic wall* says it creates "a vertical, opaque wall." Vecna's powers include truesight, and presumably x-ray vision as well (since the artifact *Eye of Vecna* al...
2022/09/10
['https://rpg.stackexchange.com/questions/201346', 'https://rpg.stackexchange.com', 'https://rpg.stackexchange.com/users/30992/']
**Truesight does not help** - a Prismatic Wall is an Abjuration, not an Illusion, and neither involves the Ethereal plane nor shapeshifting. **X-ray vision is less clear** - Prismatic Wall is defined as one inch thick, which definitely fits within the realm of X-ray vision. However, X-ray vision states "solid objects"...
*Prismatic wall*: > > A shimmering, multicolored plane of light forms a vertical opaque wall > > > Truesight: maybe indirectly --------------------------- Monster Manual (p. 9): > > A monster with truesight can, out to a specific range, see in normal and magical darkness, see invisible creatures and objects, a...
201,346
We were fighting Vecna himself, and at one point had a *[prismatic wall](https://www.dndbeyond.com/spells/prismatic-wall)* up between us and Vecna. The *prismatic wall* says it creates "a vertical, opaque wall." Vecna's powers include truesight, and presumably x-ray vision as well (since the artifact *Eye of Vecna* al...
2022/09/10
['https://rpg.stackexchange.com/questions/201346', 'https://rpg.stackexchange.com', 'https://rpg.stackexchange.com/users/30992/']
**Truesight does not help** - a Prismatic Wall is an Abjuration, not an Illusion, and neither involves the Ethereal plane nor shapeshifting. **X-ray vision is less clear** - Prismatic Wall is defined as one inch thick, which definitely fits within the realm of X-ray vision. However, X-ray vision states "solid objects"...
RAW, vague. ----------- True sight and x-ray vision could either be *argued* to see through *Prismatic Wall* depending on various definitions of light, matter, ethereal, etc. However, D&D 5e is not a physics simulator. Neither *explicitly* states they see through 'planes of shimmering light' or w/e, yet they both talk...
201,346
We were fighting Vecna himself, and at one point had a *[prismatic wall](https://www.dndbeyond.com/spells/prismatic-wall)* up between us and Vecna. The *prismatic wall* says it creates "a vertical, opaque wall." Vecna's powers include truesight, and presumably x-ray vision as well (since the artifact *Eye of Vecna* al...
2022/09/10
['https://rpg.stackexchange.com/questions/201346', 'https://rpg.stackexchange.com', 'https://rpg.stackexchange.com/users/30992/']
Neither effect allows you to see through a Prismatic Wall --------------------------------------------------------- Prismatic Wall has this effect: > > A shimmering, multicolored plane of light forms a vertical opaque wall > > > ### Truesight [Truesight](https://www.dndbeyond.com/sources/basic-rules/monsters#Tr...
*Prismatic wall*: > > A shimmering, multicolored plane of light forms a vertical opaque wall > > > Truesight: maybe indirectly --------------------------- Monster Manual (p. 9): > > A monster with truesight can, out to a specific range, see in normal and magical darkness, see invisible creatures and objects, a...
201,346
We were fighting Vecna himself, and at one point had a *[prismatic wall](https://www.dndbeyond.com/spells/prismatic-wall)* up between us and Vecna. The *prismatic wall* says it creates "a vertical, opaque wall." Vecna's powers include truesight, and presumably x-ray vision as well (since the artifact *Eye of Vecna* al...
2022/09/10
['https://rpg.stackexchange.com/questions/201346', 'https://rpg.stackexchange.com', 'https://rpg.stackexchange.com/users/30992/']
Neither effect allows you to see through a Prismatic Wall --------------------------------------------------------- Prismatic Wall has this effect: > > A shimmering, multicolored plane of light forms a vertical opaque wall > > > ### Truesight [Truesight](https://www.dndbeyond.com/sources/basic-rules/monsters#Tr...
RAW, vague. ----------- True sight and x-ray vision could either be *argued* to see through *Prismatic Wall* depending on various definitions of light, matter, ethereal, etc. However, D&D 5e is not a physics simulator. Neither *explicitly* states they see through 'planes of shimmering light' or w/e, yet they both talk...
17,724,172
How to convert the string "Thu Jul 18 13:20:12 GMT+05:30 2013" in date in android? Using DateFormatter and SimpleDateFormatter throw an exception saying cannot parse the date format while using it to convert into date.
2013/07/18
['https://Stackoverflow.com/questions/17724172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1954375/']
``` try { String dateString = "Thu Jul 18 13:20:12 GMT+05:30 2013"; SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy"); Date date = sdf.parse(dateString); } catch (ParseException e) { e.printStackTrace(); } ```
You can also do this: ``` SimpleDateFormat dateFormat = new SimpleDateFormat("DD-MM-YYYY"); Date dd = dateFormat.parse("string") ```
17,724,172
How to convert the string "Thu Jul 18 13:20:12 GMT+05:30 2013" in date in android? Using DateFormatter and SimpleDateFormatter throw an exception saying cannot parse the date format while using it to convert into date.
2013/07/18
['https://Stackoverflow.com/questions/17724172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1954375/']
``` try { String dateString = "Thu Jul 18 13:20:12 GMT+05:30 2013"; SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy"); Date date = sdf.parse(dateString); } catch (ParseException e) { e.printStackTrace(); } ```
This is how you can do: ``` try { String dateString = "Thu Jul 18 13:20:12 GMT+05:30 2013"; Date date = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy").parse(dateString ); } catch (ParseException e) { e.printStackTrace(); } ```
17,724,172
How to convert the string "Thu Jul 18 13:20:12 GMT+05:30 2013" in date in android? Using DateFormatter and SimpleDateFormatter throw an exception saying cannot parse the date format while using it to convert into date.
2013/07/18
['https://Stackoverflow.com/questions/17724172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1954375/']
``` SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy"); try { String dateString = "Thu Jul 18 13:20:12 GMT+05:30 2013"; Date date = formatter.parse(dateString); } catch (Exception e) { e.printStackTrace(); } ``` this is how we doing in android..but i...
You can also do this: ``` SimpleDateFormat dateFormat = new SimpleDateFormat("DD-MM-YYYY"); Date dd = dateFormat.parse("string") ```
17,724,172
How to convert the string "Thu Jul 18 13:20:12 GMT+05:30 2013" in date in android? Using DateFormatter and SimpleDateFormatter throw an exception saying cannot parse the date format while using it to convert into date.
2013/07/18
['https://Stackoverflow.com/questions/17724172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1954375/']
``` SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy"); try { String dateString = "Thu Jul 18 13:20:12 GMT+05:30 2013"; Date date = formatter.parse(dateString); } catch (Exception e) { e.printStackTrace(); } ``` this is how we doing in android..but i...
This is how you can do: ``` try { String dateString = "Thu Jul 18 13:20:12 GMT+05:30 2013"; Date date = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy").parse(dateString ); } catch (ParseException e) { e.printStackTrace(); } ```
73,306
Tables allow us to easily see how **2** variables (for example "Employee" and "Time") correlate. For me the main benefit of this view is that you can easily find answers to two kinds of questions. Like: * What is employee X been doing since he started working for us? * What is everybody doing today? My question: is t...
2015/02/09
['https://ux.stackexchange.com/questions/73306', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/28176/']
While it can be computationaly and mathematically complex, the concept of heat maps can help you out here. The point of a heat map is you add a third dimension to a 2 dimensional plot not by actually having an additional axis, but by using color. For example, your X axis could be "employees", your Y axis could be "pr...
There was a similar question posted a little bit back about visualization combinations (see [Best visualization for combinations](https://ux.stackexchange.com/questions/72605/best-visualization-for-combinations/72683#72683)). In addition to the heat map posted above you also have a couple other choices which are simila...
4,442,828
I'm playing with the latest Entity Framework CTP 5 release and building a simple asp.net MVC blog where I just have two tables: Post and Comments. This is done entirely in POCO, I just need help on the DbContext part, where I need it to be unit testable (using IDbSet?) and I need a simple/generic repository pattern for...
2010/12/14
['https://Stackoverflow.com/questions/4442828', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/248480/']
Start with you DbContext, create a new file called Database.cs: **Database.cs** ``` public class Database : DbContext { private IDbSet<Post> _posts; public IDbSet<Post> Posts { get { return _posts ?? (_posts = DbSet<Post>()); } } public virtual IDbSet<T> DbSet<T>() w...
The only thing I'd do differently is in the implementation, i.e. expose the IPostRepository in the service layer and have an interface field of type IPostService in the controller just as another layer of abstraction but otherwise this is a good example - nice one, Paul.
4,442,828
I'm playing with the latest Entity Framework CTP 5 release and building a simple asp.net MVC blog where I just have two tables: Post and Comments. This is done entirely in POCO, I just need help on the DbContext part, where I need it to be unit testable (using IDbSet?) and I need a simple/generic repository pattern for...
2010/12/14
['https://Stackoverflow.com/questions/4442828', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/248480/']
Start with you DbContext, create a new file called Database.cs: **Database.cs** ``` public class Database : DbContext { private IDbSet<Post> _posts; public IDbSet<Post> Posts { get { return _posts ?? (_posts = DbSet<Post>()); } } public virtual IDbSet<T> DbSet<T>() w...
I just love this in-depth article about Entity Framework 4 POCO, Repository and Specification Pattern <http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/>
4,442,828
I'm playing with the latest Entity Framework CTP 5 release and building a simple asp.net MVC blog where I just have two tables: Post and Comments. This is done entirely in POCO, I just need help on the DbContext part, where I need it to be unit testable (using IDbSet?) and I need a simple/generic repository pattern for...
2010/12/14
['https://Stackoverflow.com/questions/4442828', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/248480/']
I just love this in-depth article about Entity Framework 4 POCO, Repository and Specification Pattern <http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/>
The only thing I'd do differently is in the implementation, i.e. expose the IPostRepository in the service layer and have an interface field of type IPostService in the controller just as another layer of abstraction but otherwise this is a good example - nice one, Paul.
2,441,903
factorize $$x^4+4abx^2-(a^2-b^2)^2$$ I am getting problem in factoring this. Anyone help me. I tried synthetic division but that doesn't work. Can anyone suggest me any other ways
2017/09/23
['https://math.stackexchange.com/questions/2441903', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/483811/']
$\color{red}{x^4-4abx^2}-(a^2-b^2)^2$ The red part is *almost* a square. What we need is adding $4a^2b^2$ But if we add then we modify the polynomial and this is not legal, so we must subtract the same quantity to be fair. Therefore we get $\color{red}{x^4-4abx^2+4a^2b^2}\color{blue}{-4a^2b^2-(a^2-b^2)^2}=\color{red...
HINT: $$x=a+b$$ and $$x=-(a+b)$$ are two Solutions and now you can divide your equation $$x^4-4abx^2-(a^2-b^2)^2$$ by $$x^2+(a+b)^2$$ note that your equation can factorized into $$- \left( {a}^{2}-2\,ab+{b}^{2}+{x}^{2} \right) \left( b+a+x \right) \left( b+a-x \right) $$
20,254,346
I'm trying to save my list of images to a folder determined by the user, in this case I have this list. ``` List<System.Drawing.Image> ListOfSystemDrawingImage = new List<System.Drawing.Image>(); ListOfSystemDrawingImage.Add(MatrizWPF.Properties.Resources.Earth); ListOfSystemDrawingImage.Add(MatrizWPF...
2013/11/27
['https://Stackoverflow.com/questions/20254346', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3023107/']
You can use `System.Windows.Forms.FolderBrowserDialog` for the user to pick the destination folder and use the `Image.Save` to save the image in the format of your chioce Example: ``` List<System.Drawing.Image> listOfSystemDrawingImage = new List<System.Drawing.Image>(); System.Windows.Forms.FolderBrowserDialog dial...
If you have the names you can just convert the image to a byte array and then use `File.WriteAllBytes`. Make sure the file name you pass toe `WriteAllBytes` has a .png extension. There's probably a simpler way but I don't really deal with media like that as much as raw data so this is what comes to mind for me.
20,254,346
I'm trying to save my list of images to a folder determined by the user, in this case I have this list. ``` List<System.Drawing.Image> ListOfSystemDrawingImage = new List<System.Drawing.Image>(); ListOfSystemDrawingImage.Add(MatrizWPF.Properties.Resources.Earth); ListOfSystemDrawingImage.Add(MatrizWPF...
2013/11/27
['https://Stackoverflow.com/questions/20254346', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3023107/']
You can use `System.Windows.Forms.FolderBrowserDialog` for the user to pick the destination folder and use the `Image.Save` to save the image in the format of your chioce Example: ``` List<System.Drawing.Image> listOfSystemDrawingImage = new List<System.Drawing.Image>(); System.Windows.Forms.FolderBrowserDialog dial...
You can save the list of `System.Drawing.Image` this way: ``` string folder = @"C:\temp"; int count = 1; foreach(Image image in listOfSystemDrawingImage) { string path = Path.Combine(folder, String.Format("image{0}.png", count)); image.Save(path); count++; } ``` I don't know where you store the image nam...
81,063
I submitted an article around 11 months ago to a SCI journal and another article around 5 months ago in another SCI journal. The second article cited the first article which was under review for 6 months at the time of submission of second article. Recently, we got acceptance letter for 2nd article while 1st article is...
2016/12/05
['https://academia.stackexchange.com/questions/81063', 'https://academia.stackexchange.com', 'https://academia.stackexchange.com/users/9709/']
If I understand correctly, this is your situation: * Paper 1 was submitted for review 11 months ago * Paper 2 was submitted for review six months later. * Paper 2 was accepted for publication. Paper 1 is still under review. Presumably, Paper 2 cites Paper 1 as being "submitted". The present version of Paper 1 does no...
If the second article depends in some substantive way in the material from the first, the second should cite the first, according to the journal's policy for material under review. (Different journals tend to handle such matters in different ways.) If there is no real dependence, I would suggest omitting the citation, ...
81,063
I submitted an article around 11 months ago to a SCI journal and another article around 5 months ago in another SCI journal. The second article cited the first article which was under review for 6 months at the time of submission of second article. Recently, we got acceptance letter for 2nd article while 1st article is...
2016/12/05
['https://academia.stackexchange.com/questions/81063', 'https://academia.stackexchange.com', 'https://academia.stackexchange.com/users/9709/']
If the second article depends in some substantive way in the material from the first, the second should cite the first, according to the journal's policy for material under review. (Different journals tend to handle such matters in different ways.) If there is no real dependence, I would suggest omitting the citation, ...
The traditional method to avoid these messes was to refer to any work as ***forthcoming*** until such a time as the work having definitely and definitively entered the literature. So yes, it did happen that certain papers were eternally immortalised as "forthcoming" - and as a reader you could be in for a bit of detect...
81,063
I submitted an article around 11 months ago to a SCI journal and another article around 5 months ago in another SCI journal. The second article cited the first article which was under review for 6 months at the time of submission of second article. Recently, we got acceptance letter for 2nd article while 1st article is...
2016/12/05
['https://academia.stackexchange.com/questions/81063', 'https://academia.stackexchange.com', 'https://academia.stackexchange.com/users/9709/']
If I understand correctly, this is your situation: * Paper 1 was submitted for review 11 months ago * Paper 2 was submitted for review six months later. * Paper 2 was accepted for publication. Paper 1 is still under review. Presumably, Paper 2 cites Paper 1 as being "submitted". The present version of Paper 1 does no...
The traditional method to avoid these messes was to refer to any work as ***forthcoming*** until such a time as the work having definitely and definitively entered the literature. So yes, it did happen that certain papers were eternally immortalised as "forthcoming" - and as a reader you could be in for a bit of detect...
114,561
I am a GIS beginner, and I have a question about how to get the distance between two points in meters instead of decimal degree. In QGIS 2.4 I have a project with two point layers (in WGS84). From both layers I used I wanted to have the distance in meters between the two closest point between the layers. So what I did...
2014/09/21
['https://gis.stackexchange.com/questions/114561', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/37252/']
gdal\_Calc.py can do that, a reclass Something like.. gdal\_calc.py -A filename.tiff --outfile=filename.tiff --calc="A\*(A>3)" --NoDataValue=0 --calc="1\*(A<3) See this one [gdal\_calc.py raster reclass equivalent of ArcGIS reclass or r.reclass in grass](https://gis.stackexchange.com/questions/100348/gdal-calc-py-r...
If the min value is consistent - like a no data value, you might be able to use the snodata option and specify the value you want ignore. As listed in the doc for [gdal\_contour](http://www.gdal.org/gdal_contour.html)
2,127,460
Prove $$I=\int\_0^\infty {\frac{x}{{\left( {x + 1} \right)\sqrt {4{x^4} + 8{x^3} + 12{x^2} + 8x + 1} }}dx} = \frac{{\ln 3}}{2} - \frac{{\ln 2}}{3}.$$ First note that $$4{x^4} + 8{x^3} + 12{x^2} + 8x + 1 = 4{\left( {{x^2} + x + 1} \right)^2} - 3,$$ we let $${x^2} + x + 1 = \frac{{\sqrt 3 }}{{2\cos \theta }} \Rightarrow...
2017/02/03
['https://math.stackexchange.com/questions/2127460', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/165013/']
This is a pseudo-elliptic integral, it has an elementary anti-derivative: $$\int \frac{x}{(x+1)\sqrt{4x^4+8x^3+12x^2+8x+1}} dx = \frac{\ln\left[P(x)+Q(x)\sqrt{4x^4+8x^3+12x^2+8x+1}\right]}{6} - \ln(x+1) + C$$ where $$P(x) = 112x^6+360x^5+624x^4+772x^3+612x^2+258x+43$$ and $$Q(x) = 52x^4+92x^3+30x^2-22x-11$$ To obtai...
**HINT 1** $$x=2x+1-(x+1),$$ so $$I=\frac12\int\_0^\infty\frac{(2x+1)dx}{(x+1)\sqrt{(x^2+x+1)^2-\frac34}} - \frac12\int\_0^\infty\frac{(2x+1)dx}{(2x+1)\sqrt{(x^2+x+1)^2-\frac34}}.$$ **HINT 2** $$(2x+1)dx = d(x^2+x+1) = \frac{\sqrt3}2d\sec\theta$$
2,514
I am trying to start `carthagenet.sh` in RPC mode on Ubuntu 18.04 ``` $ ./carthagenet.sh start --rpc-port 8732 ``` It appears to start fine: ``` v7.0: Pulling from tezos/tezos Digest: sha256:da126e8d6bf137a9b326c3992c0e464622b94e2ee42b7d311df158212b8ae153 Status: Image is up to date for tezos/tezos:v7.0 docker.io/t...
2020/05/14
['https://tezos.stackexchange.com/questions/2514', 'https://tezos.stackexchange.com', 'https://tezos.stackexchange.com/users/4999/']
First off, never risk more than you can afford. Secondly, your funds are not stuck. If you look at your address, <https://tzstats.com/tz1WBKfsPLp94D7wscTRn8KFt9pBfEopdUYr>, everything is still there. As the operation shows, the operation backtracked so, no, nothing transfered. Restart your trezor and try the transfer ...
I have the exact same problem except a small amount. I transferred a small amount of XTZ from my coinbase account to simplestaking via my Trezor T. That went fine. Then a couple of days later, I tried to send the XTZ back to coinbase. The same thing happened that you described. I opened a chat with simplestaking to ask...
37,563,013
I have some variable like this; ``` <?php the_field('reviews'); ?> ``` This variable prints; ``` Some text 1 Some text 2 Some text 3 Some text 4 ``` source code is here: [![](https://i.stack.imgur.com/9vm5Q.jpg)](https://i.stack.imgur.com/9vm5Q.jpg) and look like this [![](https://i.stack.imgur.com/vj98f.jpg)]...
2016/06/01
['https://Stackoverflow.com/questions/37563013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2745938/']
`<br>Some text 1</br>` - wow.... who wrote that? Anyway... do it as simple as possible ;) ``` $change = the_field('reviews'); $change = str_replace(array('<br>', '</br>'), array('', '<hr>'), $change); echo $change; ``` edit: Probably instead of `the_field` you should use `get_field` because first one displays it a...
``` $string= the_field('reviews'); $change = str_replace( array('<br>', '</br>'), array('<hr>', ''), $string ); echo $change; ``` Use simple php str\_replace function
37,563,013
I have some variable like this; ``` <?php the_field('reviews'); ?> ``` This variable prints; ``` Some text 1 Some text 2 Some text 3 Some text 4 ``` source code is here: [![](https://i.stack.imgur.com/9vm5Q.jpg)](https://i.stack.imgur.com/9vm5Q.jpg) and look like this [![](https://i.stack.imgur.com/vj98f.jpg)]...
2016/06/01
['https://Stackoverflow.com/questions/37563013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2745938/']
`<br>Some text 1</br>` - wow.... who wrote that? Anyway... do it as simple as possible ;) ``` $change = the_field('reviews'); $change = str_replace(array('<br>', '</br>'), array('', '<hr>'), $change); echo $change; ``` edit: Probably instead of `the_field` you should use `get_field` because first one displays it a...
[Above answer](https://stackoverflow.com/a/37563100/3536236) is exactly correct. You should use `str_replace` the different between `str_replace` and `preg_replace` ``` $string = "foo fighters"; $str_replace = str_replace('foo','bar',$string); $preg_replace = preg_replace('/f.{2}/','bar',$string); echo 'str_replace...
37,563,013
I have some variable like this; ``` <?php the_field('reviews'); ?> ``` This variable prints; ``` Some text 1 Some text 2 Some text 3 Some text 4 ``` source code is here: [![](https://i.stack.imgur.com/9vm5Q.jpg)](https://i.stack.imgur.com/9vm5Q.jpg) and look like this [![](https://i.stack.imgur.com/vj98f.jpg)]...
2016/06/01
['https://Stackoverflow.com/questions/37563013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2745938/']
`<br>Some text 1</br>` - wow.... who wrote that? Anyway... do it as simple as possible ;) ``` $change = the_field('reviews'); $change = str_replace(array('<br>', '</br>'), array('', '<hr>'), $change); echo $change; ``` edit: Probably instead of `the_field` you should use `get_field` because first one displays it a...
`<br> </br>` is incorrect. **HTML** `<br>` is an empty tag,so there is no end tag. **XHTML** `<br />` then you can use function `str_replace` to relace "br" by "hr" ``` $tag_br = array( "<br>", "</br>" ); $tag_hr = array( "<hr>", "" ); $change = str_replace($tag_br,$tag_hr ,$change); ```
37,563,013
I have some variable like this; ``` <?php the_field('reviews'); ?> ``` This variable prints; ``` Some text 1 Some text 2 Some text 3 Some text 4 ``` source code is here: [![](https://i.stack.imgur.com/9vm5Q.jpg)](https://i.stack.imgur.com/9vm5Q.jpg) and look like this [![](https://i.stack.imgur.com/vj98f.jpg)]...
2016/06/01
['https://Stackoverflow.com/questions/37563013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2745938/']
[Above answer](https://stackoverflow.com/a/37563100/3536236) is exactly correct. You should use `str_replace` the different between `str_replace` and `preg_replace` ``` $string = "foo fighters"; $str_replace = str_replace('foo','bar',$string); $preg_replace = preg_replace('/f.{2}/','bar',$string); echo 'str_replace...
``` $string= the_field('reviews'); $change = str_replace( array('<br>', '</br>'), array('<hr>', ''), $string ); echo $change; ``` Use simple php str\_replace function
37,563,013
I have some variable like this; ``` <?php the_field('reviews'); ?> ``` This variable prints; ``` Some text 1 Some text 2 Some text 3 Some text 4 ``` source code is here: [![](https://i.stack.imgur.com/9vm5Q.jpg)](https://i.stack.imgur.com/9vm5Q.jpg) and look like this [![](https://i.stack.imgur.com/vj98f.jpg)]...
2016/06/01
['https://Stackoverflow.com/questions/37563013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2745938/']
`<br> </br>` is incorrect. **HTML** `<br>` is an empty tag,so there is no end tag. **XHTML** `<br />` then you can use function `str_replace` to relace "br" by "hr" ``` $tag_br = array( "<br>", "</br>" ); $tag_hr = array( "<hr>", "" ); $change = str_replace($tag_br,$tag_hr ,$change); ```
``` $string= the_field('reviews'); $change = str_replace( array('<br>', '</br>'), array('<hr>', ''), $string ); echo $change; ``` Use simple php str\_replace function
37,563,013
I have some variable like this; ``` <?php the_field('reviews'); ?> ``` This variable prints; ``` Some text 1 Some text 2 Some text 3 Some text 4 ``` source code is here: [![](https://i.stack.imgur.com/9vm5Q.jpg)](https://i.stack.imgur.com/9vm5Q.jpg) and look like this [![](https://i.stack.imgur.com/vj98f.jpg)]...
2016/06/01
['https://Stackoverflow.com/questions/37563013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2745938/']
`<br> </br>` is incorrect. **HTML** `<br>` is an empty tag,so there is no end tag. **XHTML** `<br />` then you can use function `str_replace` to relace "br" by "hr" ``` $tag_br = array( "<br>", "</br>" ); $tag_hr = array( "<hr>", "" ); $change = str_replace($tag_br,$tag_hr ,$change); ```
[Above answer](https://stackoverflow.com/a/37563100/3536236) is exactly correct. You should use `str_replace` the different between `str_replace` and `preg_replace` ``` $string = "foo fighters"; $str_replace = str_replace('foo','bar',$string); $preg_replace = preg_replace('/f.{2}/','bar',$string); echo 'str_replace...
58,054,390
I have a program written in C that traverses a tree in reverse pre-order, reverse in-order, and reverse post-order whose individual functions rely heavily on recursion. How would I go about modifying these functions so that they perform the exact same task but without using any sort of recursion? I've spent many hours ...
2019/09/23
['https://Stackoverflow.com/questions/58054390', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12076645/']
The problem is made difficult because your list nodes do not have pointers to their parents. When an iterative/imperative procedure marches down the left or right link of the current node to navigate to another node, it has no reverse path. There are two general approaches to the problem: 1. Maintain an explicit stac...
you can use a stack to store the parent and an array if a node was previously processed or not before. example for inorder ``` push(root) while stack is not empty() parent=stack.top() if parent->left and done[parent->left]==false left=parent->left push(parent) done[left]=true continue...
37,918,148
I'm building a simple shopping cart for a site and have been working on the `add to cart`action. While I have ti working I feel there is probably a simple more elegant way of doing it. This is the starting state: ``` start_state = { inventory: [ {sku: "product_1", price: 600, name: "Product 1"}, {sku: "produc...
2016/06/20
['https://Stackoverflow.com/questions/37918148', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1945168/']
Since you are using ES6, you can use some of its new features like `findIndex` and `Object.assign` to achieve what you want. ``` addToCart: function(product) { let index = this.state.cart.findIndex((x) => x.sku === product.sku); if(index === -1) { let newProduct = {sku: product.sku, quantity:...
I think this way is better: ``` function getCardWithIncItem(currentCart, itemInCart) { return [ ...currentCart.slice(0, itemInCart), Object.assign({}, currentCart[itemInCart], { quantity: currentCart[itemInCart].quantity + 1, }), ...currentCart.slice(itemInCart + 1), ...
35,624,113
I am trying to transfer data between controllers. So this is my first controller that fetches data first when page loads using http- ``` function GetController($scope, $http) { $http.defaults.useXDomain = true; $http({ method: 'POST', url: serviceUrl + '/GetProductsByCategoryOrName', headers: { ...
2016/02/25
['https://Stackoverflow.com/questions/35624113', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1982631/']
When you need to share things betweens controller, those things should be in a [service](https://docs.angularjs.org/guide/services) For example : ``` angular.service("datasService", function ($http) { this.getDatas = function getDatas() { return $http({ method: 'POST', url: serviceUrl + '/GetProductsByCa...
If you have 2 `views` with 2 `controllers`, it is possible to share the `$scope` variables(data) between controllers through services and factory.But, the `$scope` variables are local to the controller itself so set the data to the service or factory to know about that particular variable.I prefer using factory, easy a...
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
You could use the [`zero?`](http://ruby-doc.org/core-2.0/File.html#method-c-zero-3F) method: ``` File.zero?("test.rb") ```
One different approach is to iterate over each line and do stuff for each iteration. 0 lines = 0 iterations = no extra code needed.
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
You could use the [`zero?`](http://ruby-doc.org/core-2.0/File.html#method-c-zero-3F) method: ``` File.zero?("test.rb") ```
`File.size?('test.rb')` evaluates to `nil` if the file is empty `or` it does not exist. `File.zero?('test.rb')` will return true is the file is empty, but it will return false if the file is not found. Depending on your particular needs you should be careful to use the correct method. As an example in the topic creato...
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
You could use the [`zero?`](http://ruby-doc.org/core-2.0/File.html#method-c-zero-3F) method: ``` File.zero?("test.rb") ```
As of Ruby 2.4.0, there is [File.empty?](https://ruby-doc.org/core-2.4.0/File.html#method-c-empty-3F). (Note that it always returns `false` if you pass it a directory, whether that directory is empty or not: `File.empty?('/') # => false`. So use [Dir.empty?](https://ruby-doc.org/core-2.4.0/Dir.html#method-c-empty-3F) ...
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
You could use the [`zero?`](http://ruby-doc.org/core-2.0/File.html#method-c-zero-3F) method: ``` File.zero?("test.rb") ```
I think should check like this: ``` def file_empty?(file_path) !(File.file?(file_path) && !File.zero?(file_path)) end ``` so we do not need to worry about file exist or not. File.zero?('test.rb') return false if file not exist
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
`File.size?('test.rb')` evaluates to `nil` if the file is empty `or` it does not exist. `File.zero?('test.rb')` will return true is the file is empty, but it will return false if the file is not found. Depending on your particular needs you should be careful to use the correct method. As an example in the topic creato...
One different approach is to iterate over each line and do stuff for each iteration. 0 lines = 0 iterations = no extra code needed.
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
One different approach is to iterate over each line and do stuff for each iteration. 0 lines = 0 iterations = no extra code needed.
I think should check like this: ``` def file_empty?(file_path) !(File.file?(file_path) && !File.zero?(file_path)) end ``` so we do not need to worry about file exist or not. File.zero?('test.rb') return false if file not exist
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
`File.size?('test.rb')` evaluates to `nil` if the file is empty `or` it does not exist. `File.zero?('test.rb')` will return true is the file is empty, but it will return false if the file is not found. Depending on your particular needs you should be careful to use the correct method. As an example in the topic creato...
As of Ruby 2.4.0, there is [File.empty?](https://ruby-doc.org/core-2.4.0/File.html#method-c-empty-3F). (Note that it always returns `false` if you pass it a directory, whether that directory is empty or not: `File.empty?('/') # => false`. So use [Dir.empty?](https://ruby-doc.org/core-2.4.0/Dir.html#method-c-empty-3F) ...
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
`File.size?('test.rb')` evaluates to `nil` if the file is empty `or` it does not exist. `File.zero?('test.rb')` will return true is the file is empty, but it will return false if the file is not found. Depending on your particular needs you should be careful to use the correct method. As an example in the topic creato...
I think should check like this: ``` def file_empty?(file_path) !(File.file?(file_path) && !File.zero?(file_path)) end ``` so we do not need to worry about file exist or not. File.zero?('test.rb') return false if file not exist
15,982,291
I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it! The errors: ``` 1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenc...
2013/04/12
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
As of Ruby 2.4.0, there is [File.empty?](https://ruby-doc.org/core-2.4.0/File.html#method-c-empty-3F). (Note that it always returns `false` if you pass it a directory, whether that directory is empty or not: `File.empty?('/') # => false`. So use [Dir.empty?](https://ruby-doc.org/core-2.4.0/Dir.html#method-c-empty-3F) ...
I think should check like this: ``` def file_empty?(file_path) !(File.file?(file_path) && !File.zero?(file_path)) end ``` so we do not need to worry about file exist or not. File.zero?('test.rb') return false if file not exist
54,004,943
I am using <https://docs.expo.io/versions/latest/sdk/facebook-ads> for adding Facebook ads to my app. I am following the documentation properly, but Facebook ads are not visible on my app home screen. BottomBannerAd.js ``` import React from 'react'; import { FacebookAds } from 'expo'; const { AdIconView, AdMediaView ...
2019/01/02
['https://Stackoverflow.com/questions/54004943', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10825278/']
One solution is to enter an actual device ID for testing, I wasn't able to get it working otherwise. [![setting up ID](https://i.stack.imgur.com/ojpl0.png)](https://i.stack.imgur.com/ojpl0.png) Your code above should generate something like this (attachment below), but only on the active device. [![enter image des...
Check this out - [react-native with expo problem with facebook ads](https://stackoverflow.com/questions/53836535/react-native-with-expo-problem-with-facebook-ads) I'm having the same issue. It appears FB ads are broken in the current expo builds.
346,122
Let $M$, $N$ be $n$-dimensional real manifolds. Does $M\times N$ admits a complex structure? If not, are there known condidtions ensuring that $M\times N$ admits a complex structure?
2019/11/15
['https://mathoverflow.net/questions/346122', 'https://mathoverflow.net', 'https://mathoverflow.net/users/147073/']
I assume you are asking if $M \times N$ admits a complex structure. I believe that there is no result known on this question, although we might have something to say about the existence of an almost complex structure for which both factors are totally real. Once again we can quote [Gromov](https://www.ihes.fr/~gromov/w...
[EDIT: I started to write this answer, and then realized it doesn't really answers the question - I leave it here anyway, just in case] Let $X=M\times N$, and let $E=\pi\_M^\*TM$ and $F=\pi\_N^\*TN$. Note that $TX=E\oplus F$. As suggested in Ben McKay's answer, you could first look for the existence of an almost comp...
346,122
Let $M$, $N$ be $n$-dimensional real manifolds. Does $M\times N$ admits a complex structure? If not, are there known condidtions ensuring that $M\times N$ admits a complex structure?
2019/11/15
['https://mathoverflow.net/questions/346122', 'https://mathoverflow.net', 'https://mathoverflow.net/users/147073/']
I'm going to take $M$ and $N$ to be connected. Note that they cannot have boundary. Furthermore, as complex manifolds are orientable, $M$ and $N$ must also be orientable. If $n = 1$, then $M, N \in \{\mathbb{R}, S^1\}$. Note that $\mathbb{R}\times\mathbb{R}$ has a complex structure, in fact, precisely two: $\mathbb{D}...
I assume you are asking if $M \times N$ admits a complex structure. I believe that there is no result known on this question, although we might have something to say about the existence of an almost complex structure for which both factors are totally real. Once again we can quote [Gromov](https://www.ihes.fr/~gromov/w...
346,122
Let $M$, $N$ be $n$-dimensional real manifolds. Does $M\times N$ admits a complex structure? If not, are there known condidtions ensuring that $M\times N$ admits a complex structure?
2019/11/15
['https://mathoverflow.net/questions/346122', 'https://mathoverflow.net', 'https://mathoverflow.net/users/147073/']
I'm going to take $M$ and $N$ to be connected. Note that they cannot have boundary. Furthermore, as complex manifolds are orientable, $M$ and $N$ must also be orientable. If $n = 1$, then $M, N \in \{\mathbb{R}, S^1\}$. Note that $\mathbb{R}\times\mathbb{R}$ has a complex structure, in fact, precisely two: $\mathbb{D}...
[EDIT: I started to write this answer, and then realized it doesn't really answers the question - I leave it here anyway, just in case] Let $X=M\times N$, and let $E=\pi\_M^\*TM$ and $F=\pi\_N^\*TN$. Note that $TX=E\oplus F$. As suggested in Ben McKay's answer, you could first look for the existence of an almost comp...
35,950,535
I have a function I've written to handle calculations of percent reductions with significant digits, and I'm having a problem with keeping trailing zeroes. The function: ``` Function RegexReduction(IValue As Double, EValue As Double) As String Dim TempPercent As Double Dim TempString As String Dim NumForma...
2016/03/11
['https://Stackoverflow.com/questions/35950535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4747836/']
You had several bugs. The first root loop was wrong, so with `-np 2` you would send to rank 2. The second root loop was wrong -- it should match the corrected first loop. A third bug, that only shows up with `-np` greater than 2 is that the root `MPI_Recv` is wrong. The program will hang. I've corrected the program...
The line ``` for (dest = 1; dest <= proc; ++dest) ``` should be ``` for (dest = 1; dest < proc; ++dest) ``` You are trying to send to a rank with a label of 2, but with only 2 ranks, you only have ranks 0 and 1 Also, when you are receiving on rank 0, you have: ``` for (int i = 0; i < proc; ++i) ``` Which imp...
7,718,418
Let's have simplified class: ``` class A { bool val_; public: A() : val_(true) {} bool isNew() const { return val_; } void setDirty() { val_ = false; } }; ``` and the vector of objects of such class: ``` vector<A> coll; coll.push_back(A()); coll.push_back(A()); coll.push_back(A()); coll.push_ba...
2011/10/10
['https://Stackoverflow.com/questions/7718418', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/801620/']
You can use [Partition](http://www.cplusplus.com/reference/algorithm/partition/) algorithm from standard library for that: ``` bool MyPredicate(A& a) { return a.isNew();} ... // bound is iterator pointing to the first element for which predicate returns false vector<A>::iterator bound = partition(coll.begin(), coll.en...
How about `sort`: ``` #include <algorithm> std::sort(coll.begin(), coll.end(), [](const A & a, const A & b) -> bool { return a.isNew() < b.isNew(); } ); ``` You'll have to rewrite the class to declare `isNew()` as `const`. For older compilers, use a function instead of the lambda: ``` bool isNewCompare(const...
7,718,418
Let's have simplified class: ``` class A { bool val_; public: A() : val_(true) {} bool isNew() const { return val_; } void setDirty() { val_ = false; } }; ``` and the vector of objects of such class: ``` vector<A> coll; coll.push_back(A()); coll.push_back(A()); coll.push_back(A()); coll.push_ba...
2011/10/10
['https://Stackoverflow.com/questions/7718418', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/801620/']
You can use [Partition](http://www.cplusplus.com/reference/algorithm/partition/) algorithm from standard library for that: ``` bool MyPredicate(A& a) { return a.isNew();} ... // bound is iterator pointing to the first element for which predicate returns false vector<A>::iterator bound = partition(coll.begin(), coll.en...
`std::sort` lets you provide a custom comparison function object. You define a class that overrides the paranthesis operator, and returns true if the first argument should come before the right argument: ``` class COrderByDirty { bool operator(const A& lhs, const A& rhs) const { // Says lhs should come b...
7,718,418
Let's have simplified class: ``` class A { bool val_; public: A() : val_(true) {} bool isNew() const { return val_; } void setDirty() { val_ = false; } }; ``` and the vector of objects of such class: ``` vector<A> coll; coll.push_back(A()); coll.push_back(A()); coll.push_back(A()); coll.push_ba...
2011/10/10
['https://Stackoverflow.com/questions/7718418', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/801620/']
You can use [Partition](http://www.cplusplus.com/reference/algorithm/partition/) algorithm from standard library for that: ``` bool MyPredicate(A& a) { return a.isNew();} ... // bound is iterator pointing to the first element for which predicate returns false vector<A>::iterator bound = partition(coll.begin(), coll.en...
You could use `std::sort` from `<algorithm>` together with `boost::bind`. It could look something like this: ``` std::sort(coll.begin(), coll.end(), boost::bind(&A::isDirty, _1)); ``` Assuming `A` has a function `bool A::isDirty() const`. This works because you use the following ordering predicate implicitly: ``` ...
7,718,418
Let's have simplified class: ``` class A { bool val_; public: A() : val_(true) {} bool isNew() const { return val_; } void setDirty() { val_ = false; } }; ``` and the vector of objects of such class: ``` vector<A> coll; coll.push_back(A()); coll.push_back(A()); coll.push_back(A()); coll.push_ba...
2011/10/10
['https://Stackoverflow.com/questions/7718418', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/801620/']
How about `sort`: ``` #include <algorithm> std::sort(coll.begin(), coll.end(), [](const A & a, const A & b) -> bool { return a.isNew() < b.isNew(); } ); ``` You'll have to rewrite the class to declare `isNew()` as `const`. For older compilers, use a function instead of the lambda: ``` bool isNewCompare(const...
`std::sort` lets you provide a custom comparison function object. You define a class that overrides the paranthesis operator, and returns true if the first argument should come before the right argument: ``` class COrderByDirty { bool operator(const A& lhs, const A& rhs) const { // Says lhs should come b...
7,718,418
Let's have simplified class: ``` class A { bool val_; public: A() : val_(true) {} bool isNew() const { return val_; } void setDirty() { val_ = false; } }; ``` and the vector of objects of such class: ``` vector<A> coll; coll.push_back(A()); coll.push_back(A()); coll.push_back(A()); coll.push_ba...
2011/10/10
['https://Stackoverflow.com/questions/7718418', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/801620/']
How about `sort`: ``` #include <algorithm> std::sort(coll.begin(), coll.end(), [](const A & a, const A & b) -> bool { return a.isNew() < b.isNew(); } ); ``` You'll have to rewrite the class to declare `isNew()` as `const`. For older compilers, use a function instead of the lambda: ``` bool isNewCompare(const...
You could use `std::sort` from `<algorithm>` together with `boost::bind`. It could look something like this: ``` std::sort(coll.begin(), coll.end(), boost::bind(&A::isDirty, _1)); ``` Assuming `A` has a function `bool A::isDirty() const`. This works because you use the following ordering predicate implicitly: ``` ...
11,277,841
If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded...
2012/06/30
['https://Stackoverflow.com/questions/11277841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/300385/']
[Visual Studio 2010 says Build failed with no errors after I change a source file](https://stackoverflow.com/questions/5068011/visual-studio-2010-says-build-failed-with-no-errors-after-i-change-a-source-file) One answer there suggested that I change the place from where I'm building. Here's the path of the debug direc...
I had the same error, it would not build but no errors. Restarting visual studio worked for me, this was in visual studio 2012.
11,277,841
If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded...
2012/06/30
['https://Stackoverflow.com/questions/11277841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/300385/']
[Visual Studio 2010 says Build failed with no errors after I change a source file](https://stackoverflow.com/questions/5068011/visual-studio-2010-says-build-failed-with-no-errors-after-i-change-a-source-file) One answer there suggested that I change the place from where I'm building. Here's the path of the debug direc...
Close Visual Studio. Run cmd, and type: **C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /ToolsVersion:4.0 /p:Configuration=Release *yoursolution.sln*** Then, enter again on VS and run your project. Worked for me!
11,277,841
If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded...
2012/06/30
['https://Stackoverflow.com/questions/11277841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/300385/']
[Visual Studio 2010 says Build failed with no errors after I change a source file](https://stackoverflow.com/questions/5068011/visual-studio-2010-says-build-failed-with-no-errors-after-i-change-a-source-file) One answer there suggested that I change the place from where I'm building. Here's the path of the debug direc...
if your solution contains too many projects , build projects individually, Check which project is failing for that project check the references of that project , if on any reference if their is yellow color mark, then delete that reference , and add that again , then build and check, this will work or check ...
11,277,841
If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded...
2012/06/30
['https://Stackoverflow.com/questions/11277841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/300385/']
I had the same error, it would not build but no errors. Restarting visual studio worked for me, this was in visual studio 2012.
Close Visual Studio. Run cmd, and type: **C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /ToolsVersion:4.0 /p:Configuration=Release *yoursolution.sln*** Then, enter again on VS and run your project. Worked for me!
11,277,841
If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded...
2012/06/30
['https://Stackoverflow.com/questions/11277841', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/300385/']
I had the same error, it would not build but no errors. Restarting visual studio worked for me, this was in visual studio 2012.
if your solution contains too many projects , build projects individually, Check which project is failing for that project check the references of that project , if on any reference if their is yellow color mark, then delete that reference , and add that again , then build and check, this will work or check ...
12,964,364
I am working on a physics engine related project. In the C++ code below: ``` #include <iostream> #include <vector> struct Vector3 { float x; float y; float z; }; struct object { std::vector < std::vector < Vector3 > > set_vertices; int ID; int Type; }; class World { public: std::vector< object > o...
2012/10/18
['https://Stackoverflow.com/questions/12964364', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1023798/']
I'd imagine that using RAII and having the constructor and destructor of `object` to take care of the memory would be a better way of doing this. Adding in a new `object` into world you can make use of `std::vector` ability to resize dynamically by just calling `push_back()` instead of needing to create the loop that ...
It's safe. You could save boilerplate by moving all that filling into a constructor, if appropriate. You might also be able to find a more efficient approach than levels of nested vectors. So, it's safe but could still be improved.
42,006,760
I have a table: ``` <div> <div className="shadow-z-1"> <table className="table table-bordered table-hover"> <thead> <tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>John</...
2017/02/02
['https://Stackoverflow.com/questions/42006760', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5993072/']
Here is a css code: ```css .scroll-table-container { border:2px solid green; height: 300px; overflow: scroll; } .scroll-table, td, th { border-collapse:collapse; border:1px solid #777; min-width: 300px;} ```
Check this example: ``` <html> <head> <style> div{display:inline-block;height:46px;overflow:scroll} table{background:gray} td{background:green} td,th{width:100px} th{background:orange} </style> </head> <body> <table> ...
47,488,903
I downloaded PayuMoney payment extension for Magento 1.9 from their website and copied the respective directories/code in the app folder. In the Admin, it is showing the configuration settings for this extension where I entered following details as instructed in the integration guide document: ``` Enabled: ​ ‘Yes’ ...
2017/11/25
['https://Stackoverflow.com/questions/47488903', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4873820/']
First of all, it's important to realize that though "model the animal kingdom in a class hierarchy" is a common beginner exercise, and often used in examples -- I use Animal, Mammal, Giraffe, Tiger, and so on all the time in examples -- **it is not a realistic problem to solve using OO techniques**. It's simply intende...
one of the reasons you want to use Interface is that C# does not support multiple inheritance. In general, I would like to think of interface as ability or feature instead of being a model. Something like: ``` public interface ISwimable { int SwimmingSpeed { get; set; } } public interface...
59,174,310
I am working on a C++ project using CodeBlocks on Windows but then decided to switch to NetBeans IDE 8.2. Within my project, I am calling another executable file with some passed parameters (I run the other .exe with suitable parameters then I take the output of it to use in my main project), and it used to work on Co...
2019/12/04
['https://Stackoverflow.com/questions/59174310', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1383685/']
Your current remote will be using https protocol. That is why it is still asking for password. use `git remote show origin | grep URL` to see the current remote URL for origin if it starts with `https://` it will ask for username and password. Then remove it by `git remote rm origin` Then add ssh url by `git remo...
Github does not provide SSH access. Your command is trying to connecto to github by ssh as connection to a remote computer. This is not what you are allowed to do. What you can do with the SSH keys in github now, is clone repositories, commit, etc. ``` git clone git@github.com:<project> ``` And with SSH you are all...
59,174,310
I am working on a C++ project using CodeBlocks on Windows but then decided to switch to NetBeans IDE 8.2. Within my project, I am calling another executable file with some passed parameters (I run the other .exe with suitable parameters then I take the output of it to use in my main project), and it used to work on Co...
2019/12/04
['https://Stackoverflow.com/questions/59174310', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1383685/']
Your current remote will be using https protocol. That is why it is still asking for password. use `git remote show origin | grep URL` to see the current remote URL for origin if it starts with `https://` it will ask for username and password. Then remove it by `git remote rm origin` Then add ssh url by `git remo...
All I want at this point is to no enter my username and password whenever I want to push my stuff on github. I made it work. But a day I had to create an other ssh key and id for my VPS but I overwrited it, I didn't know that I have to create one id/key per file. So I delete known\_host and erase the content of rsa.pu...
56,323,181
How to delete duplicate from this result ``` select *, row_number() over (order by (select null)) as seqnum from [elo].[dbo].[objkeys] where parentid in (select parentid from [elo].[dbo].[objekte] inner join [elo].[dbo].[objkeys] on objid = parentid wh...
2019/05/27
['https://Stackoverflow.com/questions/56323181', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10306114/']
Can you please try **ml-auto** instead of **mr-auto**? So the ul tag will be like this ``` <ul class="navbar-nav ml-auto"> ```
Please check the following Stack Overflow post [What happened to the .pull-left and .pull-right classes in Bootstrap 4?](https://stackoverflow.com/questions/39655110/what-happened-to-the-pull-left-and-pull-right-classes-in-bootstrap-4/42887127) Hope this helps you out.
45,614,363
I am having trouble getting my Alamofire call to execute my json Closure in Swift. Below is my NetworkingService file: ``` import Foundation import Alamofire import SwiftyJSON class NetworkingService { static let shared = NetworkingService() private init() {} func getSong(completionHandler: @escaping (J...
2017/08/10
['https://Stackoverflow.com/questions/45614363', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5412136/']
In your first method you define a `completionHandler` that you never call : This should works: ``` func getSong(completionHandler: @escaping (JSON) -> Void) { Alamofire.request("http://10.0.1.7/myiosapp/v1/songs.php", method: .get, parameters: nil, encoding: URLEncoding(), headers: nil).responseJSON { (response) i...
As per this code i think you missed to call the `completionHandler(response)`
45,614,363
I am having trouble getting my Alamofire call to execute my json Closure in Swift. Below is my NetworkingService file: ``` import Foundation import Alamofire import SwiftyJSON class NetworkingService { static let shared = NetworkingService() private init() {} func getSong(completionHandler: @escaping (J...
2017/08/10
['https://Stackoverflow.com/questions/45614363', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5412136/']
I was able to solve my problem: ``` class NetworkingService { static let shared = NetworkingService() private init() {} func getSong(completionHandler: @escaping (JSON) -> Void) { Alamofire.request("http://10.0.1.7/myiosapp/v1/songs.php", method: .get, parameters: nil, encoding: URLEncoding(), he...
As per this code i think you missed to call the `completionHandler(response)`
64,618,846
I'm new in wordpress and woocommerce development part. I'm trying to integrate woocommerce for my products, everything was fine. But when i click on product permalink for product details or product single page it's redirect to the same page. Interesting thing is when i click on product, the url changed but not go throu...
2020/10/31
['https://Stackoverflow.com/questions/64618846', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7088878/']
Looks like your WooCommerce single page is not working. Take a look at their official docs for the correct file structure. I think you have a problem here referencing incorrect file or you have overwritten core file, like woocommerce.php. You should use a child theme and then do your edits there. [WooCommerce Do...
I figured it out! The problem is `woocommerce.php` file. This file overwrite the other directory. In my case, I'm developing a custom theme that's why I need to create a directory inside my `../themes/my-theme` nameed- `/woocommerce/archive-product.php` and delete `woocommerce.php` form `../themes/my-theme` So, moral ...
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
[JSONiq](http://www.jsoniq.org/) is such a standard and [Zorba](http://www.zorba.io/) an open-source C++ implementation. JSONiq can also be seen as XQuery with adding JSON as a native data type.
Yate (<https://github.com/pasaran/yate>) is specifically designed after XSLT, features JPath (a natural XPath equivalent for JS), compiles to JavaScript and has quite a history of production use. It’s practically undocumented, but reading through samples and tests should be enough.
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
Have a look at [jsonpath-object-transform](https://www.npmjs.com/package/jsonpath-object-transform)
Yate (<https://github.com/pasaran/yate>) is specifically designed after XSLT, features JPath (a natural XPath equivalent for JS), compiles to JavaScript and has quite a history of production use. It’s practically undocumented, but reading through samples and tests should be enough.
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
XSLT supports JSON as seen at <http://www.w3.org/TR/xslt-30/#json> XML uses angular brackets for delimiter tokens, JSON uses braces, square brackets, ... I. e. XML's fewer token recognition comparisons means it's optimized for declarative transformation, whereas more comparisons, being like switch statement, for speed...
One approach not yet given is to use a parser generator to create a parser in XSLT which parses JSON and produces an XML output. One option that gets mentioned a lot at the XML conferences is the ReX parser generator (<http://www.bottlecaps.de/rex/>) - although totally undocumented on the site, recipes are available o...
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
[jq - lightweight and flexible command-line JSON processor](http://stedolan.github.io/jq/) It's not template-based like XSLT, but more concise. e.g. to extract `name` and `address` fields into an array: `[.name, .address]` The [tutorial](http://stedolan.github.io/jq/tutorial/) walks through an example of transforming...
it is very possible to convert JSON using XSLT: you need JSON2SAX deserializer and SAX2JSON serializer. Sample code in Java: <http://www.gerixsoft.com/blog/json/xslt4json>
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
XSLT equivalents for JSON - a list of candidates (tools and specs) Tools ===== **1. [XSLT](http://www.w3.org/TR/xslt-30/#json)** You can use [XSLT for JSON](http://www.w3.org/TR/xslt-30/#json) with the aim of [fn:json-to-xml](https://www.w3.org/TR/xslt-30/#func-json-to-xml). > > This section describes facilities a...
Interesting idea. Some searching on Google produced a few pages of interest, including: * an [outline](http://goessner.net/articles/jsont/) of how such a "jsonT" tool might be implemented, and [some downloads](http://goessner.net/download/prj/jsont/) * some [discussion of that implementation](http://ajaxian.com/archiv...
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
To say lack of tools suggest lack of need is just begging the question. The same could be applied to support for X or Y in Linux (Why bother developing quality drivers and/or games for such a minority OS? And why pay attention to an OS that big game and hardware companies don't develop for?). Probably the people who wo...
For a working doodle/proof of concept of an approach to utilize pure JavaScript along with the familiar and declarative pattern behind XSLT's matching expressions and recursive templates, see <https://gist.github.com/brettz9/0e661b3093764f496e36> (A similar approach might be taken for JSON.) Note that the demo also r...
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
I've been really tired of the enormous amount of JavaScript templating engines out there, and all their inline HTML-templates, different markup styles, etc., and decided to [build a small library](https://github.com/WelcomWeb/Stapling) that enables XSLT formatting for JSON data structures. Not rocket science in any way...
[CsvCruncher](https://github.com/OndraZizka/csv-cruncher/) ========================================================== Despite it's name does not suggest it, CsvCruncher can be efficiently used to read *tabular*\* JSON data and process them using SQL. `*` Tabular means that some part of the JSON tree is regular, i.e. ...
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
As yet another new answer to an old question, I'd suggest a look at [DefiantJS](http://defiantjs.com/). It's not an XSLT *equivalent* for JSON, it ***is*** XSLT for JSON. The "Templating" section of the documentation includes this example: ``` <!-- Defiant template --> <script type="defiant/xsl-template"> <xsl:tem...
[CsvCruncher](https://github.com/OndraZizka/csv-cruncher/) ========================================================== Despite it's name does not suggest it, CsvCruncher can be efficiently used to read *tabular*\* JSON data and process them using SQL. `*` Tabular means that some part of the JSON tree is regular, i.e. ...
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
Try [JOLT](https://github.com/bazaarvoice/jolt). It is a JSON to JSON transformation library written in Java. It was created specifically because we did not want to play the "JSON -> XML -> XSLT -> XML -> JSON" game, and using a template for any sufficiently complex transform is unmaintainable.
it is very possible to convert JSON using XSLT: you need JSON2SAX deserializer and SAX2JSON serializer. Sample code in Java: <http://www.gerixsoft.com/blog/json/xslt4json>
1,618,038
Is there an [XSLT](http://www.w3.org/TR/xslt) equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
2009/10/24
['https://Stackoverflow.com/questions/1618038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147141/']
Interesting idea. Some searching on Google produced a few pages of interest, including: * an [outline](http://goessner.net/articles/jsont/) of how such a "jsonT" tool might be implemented, and [some downloads](http://goessner.net/download/prj/jsont/) * some [discussion of that implementation](http://ajaxian.com/archiv...
I am using Camel route umarshal(xmljson) -> to(xlst) -> marshal(xmljson). Efficient enough (though not 100% perfect), but simple, if you are already using Camel.
73,693,252
So I have a file from which I import another file, in the main file I need to use a variable that is in another file and is under DEF function and IF condition. But every time I get that there is no such variable. Code: First file: ``` from modules.proxy import * set_proxy() browser.get("website.com") ``` Second f...
2022/09/12
['https://Stackoverflow.com/questions/73693252', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/17238800/']
you should return the browser variable value in the end of the function like this: ``` return browser ``` now get it main file like this: ``` browser = set_proxy() browser.get("website.com") ```
You need to give a default value for `browser`. File 1: ```py browser: str = "" def test(): proxy: bool = True if proxy: global browser browser = "TEST" ``` File 2: ```py import file1 file1.test() print(file1.browser) file1.browser = "TEST2" print(file1.browser) ``` As expected the outp...
42,826
I am integrating with a set of REST services exposed by our partner. The unit of integration is at the project level meaning that for each project created on our partners side of the fence they will expose a unique set of REST services. To be more clear, assume there are two projects - project1 and project2. The REST...
2011/02/02
['https://softwareengineering.stackexchange.com/questions/42826', 'https://softwareengineering.stackexchange.com', 'https://softwareengineering.stackexchange.com/users/15370/']
Why not make it easy on your self - both decision-wise and implementation-wise - and just use one of the many frameworks that already exist to consume Web API's, like [RestSharp](http://restsharp.org/) or [Hammock](http://hammock.codeplex.com/).
an interface for each REST project, one class per interface, with a static factory in other words, the ProjectClient class as presented violates the single-responsibility principle (and verges on being a 'god' class). I suggest: ``` public static class ProjectClientFactory { public static ISearchClient MakeSear...
35,089,135
I'm having a really bad issue here and I can't find anything about it online... this is my website: <http://top6.com> when you try to go to a page from FireFox, it shows you the page then redirects you back to the previous one... this only happens with FireFox and only happens if I'm not in a Private window. I tried t...
2016/01/29
['https://Stackoverflow.com/questions/35089135', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5261700/']
Use `array_chunk()` to split your array into arrays of size 4, then iterate row wise over data using `foreach`. ``` $links = array( array("Link 1", "link_href1"), array("Link 2", "link_href2"), array("Link 3", "link_href3"), array("Link 4", "link_href4"), array("Link 5", "link_href5"), array("Link 6", "lin...
It appears you are using a 12 column grid (probably bootstrap). If might be helpful to not only put things in the proper divs, but also have the ability to change the style using php variables. Here is a little code snip that might help you: ``` $colSize = 3; $colPrefix = "col-xs"; $numPerRow = 12/$colSize; for($ii =...
35,089,135
I'm having a really bad issue here and I can't find anything about it online... this is my website: <http://top6.com> when you try to go to a page from FireFox, it shows you the page then redirects you back to the previous one... this only happens with FireFox and only happens if I'm not in a Private window. I tried t...
2016/01/29
['https://Stackoverflow.com/questions/35089135', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5261700/']
Use `array_chunk()` to split your array into arrays of size 4, then iterate row wise over data using `foreach`. ``` $links = array( array("Link 1", "link_href1"), array("Link 2", "link_href2"), array("Link 3", "link_href3"), array("Link 4", "link_href4"), array("Link 5", "link_href5"), array("Link 6", "lin...
you can also try a foreach loop: ``` $i = 0; foreach ($links as $link) { if ($i == 0) { echo '<div class="row">'; } #... echo '<a href="' . $link[1] . '">' . $link[0] . '</a>'; #... ++$i; if ($i == 4) { echo '</div>'; $i = 0; } } if (...
17,800,748
I am developing a chrome extension for company internal use, what i want to do is open folder in explorer (design folder at internal server) when someone add the project id in a textbox and click the button, ex: 'Y:\design\' + siteNumber Can i do it using javascript? Thanks! Nalinda
2013/07/23
['https://Stackoverflow.com/questions/17800748', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1896674/']
No, javascript doesn't have access to the local machine's files/folders.
Sort of. You would need to write a stand-alone application in a native language (like C++ or Java) that could execute the opening of the folder, then have the Chrome extension communicate with it through the [NPAPI Plugin](http://developer.chrome.com/extensions/npapi.html). You *could* keep it all in Javascript by crea...
25,150,148
can't find an answer to this anywhere. haven't used c++ for long. in this file, 512, 256, 4736, and 448 all red-underlined as error 'expecting type specifier' ``` // AttackSqrs.h #include <valarray> #include <vector> #include <unordered_map> #include <string> #include <iostream> class AttackSqrs { public: Att...
2014/08/05
['https://Stackoverflow.com/questions/25150148', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2808996/']
You don't initialize members that way. Use the initialization list of the `AttackSqrs` constructor: ``` class AttackSqrs { public: AttackSqrs(); ~AttackSqrs(); private: void init(); std::valarray<int> board; std::valarray<int> vrChessPieces; std::valarray<int> vrAttackSqrs; std::valarr...
Your question is about vectors but you use valarray, which I haven't used before. I will answer for vectors. You need to set the size of the vectors in the constructor. header file ``` class AttackSqrs { public: AttackSqrs(); ~AttackSqrs(); private: std::vector<int> board(512); }; ``` cpp file ``` A...
25,150,148
can't find an answer to this anywhere. haven't used c++ for long. in this file, 512, 256, 4736, and 448 all red-underlined as error 'expecting type specifier' ``` // AttackSqrs.h #include <valarray> #include <vector> #include <unordered_map> #include <string> #include <iostream> class AttackSqrs { public: Att...
2014/08/05
['https://Stackoverflow.com/questions/25150148', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2808996/']
On the header file, you only declare the variable and their types. Any kind of object construction is implemented in the cpp file. **AttackSqrs.h** ``` class AttackSqrs { public: AttackSqrs(); ~AttackSqrs(); private: void init(); std::valarray<int> board; std::valarray<int> vrChessPieces; std...
Your question is about vectors but you use valarray, which I haven't used before. I will answer for vectors. You need to set the size of the vectors in the constructor. header file ``` class AttackSqrs { public: AttackSqrs(); ~AttackSqrs(); private: std::vector<int> board(512); }; ``` cpp file ``` A...
8,671,537
This is a weired problem, I have implemented simple quick sort as follows.. ``` static void Main(string[] args) { List<int> unsorted = new List<int> { 1, 3, 5, 7, 9, 8, 6, 4, 2 }; List<int> sorted = quicksort(unsorted); Console.WriteLine(string.Join(",", sorted)); Console.Re...
2011/12/29
['https://Stackoverflow.com/questions/8671537', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/612936/']
Your algorithm has a bug. Consider the simplest input list { 1, -1 }. Let's step through your logic. 1. You first choose a pivot index, Count / 2, which is 1. 2. You then remove the pivot element at index 1 (-1) from the `arr` list. 3. Next you compare each remaining element in the `arr` list (there's just the 1 at in...
if you don't have a debugger try this... ``` foreach (T i in arr) { if (i.CompareTo(pivot_val) <= 0) { loe.Add(i); Console.WriteLine("loe.add " + i.ToString()); } else { gt.Add(i); Cons...
29,123,885
I am using WebApi in a ASP.Net web application. I have a method in the controller called `Delete` and I want to access to this method by using jQuery's AJAX method. Below is my code: ``` [Authorize] public int Delete(int proposalId) { // logic here... } ``` ```js $.ajax({ url: "/Controller/Proposal/" + ...
2015/03/18
['https://Stackoverflow.com/questions/29123885', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1145184/']
Assuming this is accessing a REST API, you need to send a `DELETE` request by setting the appropriate `type` in your `$.ajax` call: ``` $.ajax({ url: "/Controller/Proposal/" + proposalId, type: "DELETE", // <- Change here contentType: "application/json", success: function() { bootbox.alert("Pro...
If you must use a custom method for deletion for example, you can always rely on setting HTTP attributes -- like so: ``` [HttpDelete] [Route("api/Proposal")] public IHttpActionResult Proposal(long id){ ... } ```