qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
33,349,844 | How could I have the first section be the height of the browser window on this template? <http://themes.3rdwavemedia.com/velocity/1.5.4>
Apparently the class that I have to update is `promo section section-on-bg` it isn't working. I also tried `min-height 100%, height 100%`.
Any help would be appreciated.
Regards. | 2015/10/26 | [
"https://Stackoverflow.com/questions/33349844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5489794/"
] | In short: yes, it is necessary.
Parts of standard library often use other parts, so `<string>` was included somehow through `<iostream>`, and your code compiles nicely.
If you accidentally decide that you don't need `<iostream>` anymore and remove that include, `<string>` will be implicitly removed, too, and you get ... | iostream includes `<string>`. It ripples through.
Well actually that's implementation dependant and not a guarantee. You should explicitly include the headers you need. |
33,349,844 | How could I have the first section be the height of the browser window on this template? <http://themes.3rdwavemedia.com/velocity/1.5.4>
Apparently the class that I have to update is `promo section section-on-bg` it isn't working. I also tried `min-height 100%, height 100%`.
Any help would be appreciated.
Regards. | 2015/10/26 | [
"https://Stackoverflow.com/questions/33349844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5489794/"
] | Your implementation's `iostream` header includes `string`. This is not something which you can or should rely on. If you want to use `std::string`, you should always `#include <string>`, otherwise your program might not run on different implementations, or even in later versions of your current one. | Some header might include other headers, but that's an implementation issue and not something you can count on. Always explicitly include the headers you need. |
33,349,844 | How could I have the first section be the height of the browser window on this template? <http://themes.3rdwavemedia.com/velocity/1.5.4>
Apparently the class that I have to update is `promo section section-on-bg` it isn't working. I also tried `min-height 100%, height 100%`.
Any help would be appreciated.
Regards. | 2015/10/26 | [
"https://Stackoverflow.com/questions/33349844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5489794/"
] | Your implementation's `iostream` header includes `string`. This is not something which you can or should rely on. If you want to use `std::string`, you should always `#include <string>`, otherwise your program might not run on different implementations, or even in later versions of your current one. | In short: yes, it is necessary.
Parts of standard library often use other parts, so `<string>` was included somehow through `<iostream>`, and your code compiles nicely.
If you accidentally decide that you don't need `<iostream>` anymore and remove that include, `<string>` will be implicitly removed, too, and you get ... |
17,052,147 | Here is what I do in `onCreateView` (in fragment):
```
NewsAdapter adapter = new NewsAdapter(getActivity(), newsList, R.layout.news_list_item);
newsListView.setAdapter(adapter);
newsListView.setOnItemClickListener(this);
```
And here is `onItemClick`:
```
@Override ... | 2013/06/11 | [
"https://Stackoverflow.com/questions/17052147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/377133/"
] | Removing `android:choiceMode="singleChoice"` attribute of the listview fixed the problem. | Not sure if thats it but it seems like the same issue that I have encountered some time ago :
[getting View for ListView item / reverse order on 2.2; works on 4.0.3](https://stackoverflow.com/questions/15783089/getting-view-for-listview-item-reverse-order-on-2-2-works-on-4-0-3)
try wraping it in Runnable
something ... |
17,052,147 | Here is what I do in `onCreateView` (in fragment):
```
NewsAdapter adapter = new NewsAdapter(getActivity(), newsList, R.layout.news_list_item);
newsListView.setAdapter(adapter);
newsListView.setOnItemClickListener(this);
```
And here is `onItemClick`:
```
@Override ... | 2013/06/11 | [
"https://Stackoverflow.com/questions/17052147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/377133/"
] | Removing `android:choiceMode="singleChoice"` attribute of the listview fixed the problem. | I think you have to call `adapter.notifyDataSetChanged()` when you affect the new background to tell the adapter that you want to refresh the view. |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | I'm not going to convince you to use other technologies. For all I know everyone should just stick to JSP if it works for them.
I work mainly with Spring MVC and I find **JSP 2+ in combination with SiteMesh** the perfect match.
### SiteMesh 2/3
Provide decorators to be applied to the views mostly like inheritance wo... | You didn't provide information about specific of your applications. For example I do not use JSP just for few reasons:
It is hard to avoid using Java code in JSP templates so your break concept of pure View, and as result you will have difficulties to maintain code in several places as view and controller
JSP automat... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | A good view technology eliminates most and most anoying if/switch/conditional statements, simple include does not. Using a 'complex' view technology results in a 'simple' application. | I realize that this comes off as a smart ass answer, but the truth of it is, if you don't see any advantage to using templating over code in your current project, it's probably because in your current project, there isn't one.
Part of it is about scale. You might think that includes are every bit as powerful as let's ... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | A few arguments for Velocity (I haven't used Freemarker):
* Potential to re-use templates outside of a web context, such as in sending emails
* Velocity's template language syntax is **far** simpler than JSP EL or tag libraries
* Strict separation of view logic from any other sort of logic - no possible option to drop... | One of the best arguments for facelets (not in your list, but I'll just mention it) opposed to using JSP is that the compilation is integrated with the interpreter instead of being delegated to the JSP compiler. This means that one of the most annoying things I had with JSF 1.1 - having to change the id-attribute on a ... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | A few arguments for Velocity (I haven't used Freemarker):
* Potential to re-use templates outside of a web context, such as in sending emails
* Velocity's template language syntax is **far** simpler than JSP EL or tag libraries
* Strict separation of view logic from any other sort of logic - no possible option to drop... | I realize that this comes off as a smart ass answer, but the truth of it is, if you don't see any advantage to using templating over code in your current project, it's probably because in your current project, there isn't one.
Part of it is about scale. You might think that includes are every bit as powerful as let's ... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | I'm not going to convince you to use other technologies. For all I know everyone should just stick to JSP if it works for them.
I work mainly with Spring MVC and I find **JSP 2+ in combination with SiteMesh** the perfect match.
### SiteMesh 2/3
Provide decorators to be applied to the views mostly like inheritance wo... | I realize that this comes off as a smart ass answer, but the truth of it is, if you don't see any advantage to using templating over code in your current project, it's probably because in your current project, there isn't one.
Part of it is about scale. You might think that includes are every bit as powerful as let's ... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | The choice between `jsp:include` and *Tiles/Sitemesh/etc* is the choice between *simplicity and power* that developers face all the time. Sure, if you only have a few files or don't expect your layout to change very often, then just use `jstl` and `jsp:include`.
But applications have a way of growing incrementally, an... | You didn't provide information about specific of your applications. For example I do not use JSP just for few reasons:
It is hard to avoid using Java code in JSP templates so your break concept of pure View, and as result you will have difficulties to maintain code in several places as view and controller
JSP automat... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | The choice between `jsp:include` and *Tiles/Sitemesh/etc* is the choice between *simplicity and power* that developers face all the time. Sure, if you only have a few files or don't expect your layout to change very often, then just use `jstl` and `jsp:include`.
But applications have a way of growing incrementally, an... | I realize that this comes off as a smart ass answer, but the truth of it is, if you don't see any advantage to using templating over code in your current project, it's probably because in your current project, there isn't one.
Part of it is about scale. You might think that includes are every bit as powerful as let's ... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | A good view technology eliminates most and most anoying if/switch/conditional statements, simple include does not. Using a 'complex' view technology results in a 'simple' application. | You didn't provide information about specific of your applications. For example I do not use JSP just for few reasons:
It is hard to avoid using Java code in JSP templates so your break concept of pure View, and as result you will have difficulties to maintain code in several places as view and controller
JSP automat... |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | A few arguments for Velocity (I haven't used Freemarker):
* Potential to re-use templates outside of a web context, such as in sending emails
* Velocity's template language syntax is **far** simpler than JSP EL or tag libraries
* Strict separation of view logic from any other sort of logic - no possible option to drop... | A good view technology eliminates most and most anoying if/switch/conditional statements, simple include does not. Using a 'complex' view technology results in a 'simple' application. |
3,168,559 | I'm about to choose to way to organize my view (with spring-mvc, but that shouldn't matter much)
There are 6 options as far as I see (though they are not mutually exclusive):
* *Tiles*
* *Sitemesh*
* *Freemarker*
* *Velocity*
* `<jsp:include>`
* `<%@ include file="..">`
*Tiles* and *Sitemesh* can be grouped; so can ... | 2010/07/02 | [
"https://Stackoverflow.com/questions/3168559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203907/"
] | A few arguments for Velocity (I haven't used Freemarker):
* Potential to re-use templates outside of a web context, such as in sending emails
* Velocity's template language syntax is **far** simpler than JSP EL or tag libraries
* Strict separation of view logic from any other sort of logic - no possible option to drop... | I'm not going to convince you to use other technologies. For all I know everyone should just stick to JSP if it works for them.
I work mainly with Spring MVC and I find **JSP 2+ in combination with SiteMesh** the perfect match.
### SiteMesh 2/3
Provide decorators to be applied to the views mostly like inheritance wo... |
197,773 | I only saw the beginning of this on TV, and it was a while ago- about mid 90's. What I remember is two teenage girls, possibly on the edge of graduation, both share ambitions of leaving the small town they live in. Both go to a body of water of some sort (kind of like either an aqueduct no longer used or the flooded ba... | 2018/11/01 | [
"https://scifi.stackexchange.com/questions/197773",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/47051/"
] | The title of this 1991 vampire movie is [*Children of the Night*](https://www.imdb.com/title/tt0103957/?ref_=tt_urv), and it starred Karen Black. I have a copy on DVD. The full movie is on [youtube](https://youtu.be/uDRa9RwEkCY?t=8m41s). That link should take you directly to the scene where the two girls discuss the tr... | "Creepshow 2" (1987)?
It sounds like the 2nd tale in this anthology movie containing 3 stories. It was called The Raft, and was based on a short story by Stephen King.
Here is the full movie from YouTube: |
24,511,846 | I have gotten used to/fell in love with Stylus for preprocessing css and Jade for simplifying my HTML in the Node.JS world. Now I am back to working on a Spring 4 MVC project and would like to use those technologies in this environment.
Is it possible to integrate them (I am using Gradle)? A quick google search for S... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24511846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125212/"
] | Stylus and Jade seem to be popular in the JavaScript world, not so much in the JVM world.
Here are the closest tools I know about, with good support in the JVM world:
* [LESS](http://lesscss.org/), for a CSS preprocessor replacement
* [Groovy Templates](http://groovy-lang.org/docs/groovy-2.3.3/html/documentation/mark... | For Jade, you can use Jade4J (<https://github.com/neuland/jade4j>). There is a Spring-ready version too. |
24,511,846 | I have gotten used to/fell in love with Stylus for preprocessing css and Jade for simplifying my HTML in the Node.JS world. Now I am back to working on a Spring 4 MVC project and would like to use those technologies in this environment.
Is it possible to integrate them (I am using Gradle)? A quick google search for S... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24511846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125212/"
] | Stylus and Jade seem to be popular in the JavaScript world, not so much in the JVM world.
Here are the closest tools I know about, with good support in the JVM world:
* [LESS](http://lesscss.org/), for a CSS preprocessor replacement
* [Groovy Templates](http://groovy-lang.org/docs/groovy-2.3.3/html/documentation/mark... | The approach we took was to use Webpack to transpile everything (Pug, Stylus, Less, Coffee, etc) then using the `generate-source` goal in Maven (might be slightly different for Gradle) we include an exec for webpack. |
33,649,109 | Well, the title may be sounds easy, but what i want is to do the same thing from browser address bar (my page contains many videos ).
i tried
```
javascript:videoelement=document.getElementById("vid1");videoelement.pause();
```
It doesn't works anyway.
suppose my code is
```
<html>
<body>
<embed src="https://m... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742342/"
] | Remove the `#` from the element name like so:
```
javascript:videoelement=document.getElementById("vid1");videoelement.pause();
```
You are already using the `getElementById` function so you don't need it. | You are using a jQuery/CSS ID selector when what you wanted was using vanilla javascript.
You are trying to select an element with ID "#vid1", such as:
`<video id="#vid1">`
Just remove the "#" from `getElementById`. |
33,649,109 | Well, the title may be sounds easy, but what i want is to do the same thing from browser address bar (my page contains many videos ).
i tried
```
javascript:videoelement=document.getElementById("vid1");videoelement.pause();
```
It doesn't works anyway.
suppose my code is
```
<html>
<body>
<embed src="https://m... | 2015/11/11 | [
"https://Stackoverflow.com/questions/33649109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742342/"
] | Remove the `#` from the element name like so:
```
javascript:videoelement=document.getElementById("vid1");videoelement.pause();
```
You are already using the `getElementById` function so you don't need it. | HTML Audio/Video DOM pause() Method:
The play() method starts playing the current audio or video.
Tip: Use the [pause()](http://www.w3schools.com/tags/av_met_pause.asp) method to pause the current audio/video. |
48,028,431 | I have searched for a solution to my problem but have not been able to find the right answer.
I have a list of *all* questions and a list of *selected* questions. I need to build a list of checkboxes from the list of all questions and check the ones that are in the list of selected questions. When changes are made t... | 2017/12/29 | [
"https://Stackoverflow.com/questions/48028431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5684322/"
] | I generally wouldn't encourage doing this type of authorization at the model/database level. Rather I would suggest that you abstract your authorization code into it's own layer and handle this at the controller level, then rely on tests to verify that nobody can create an object except through the controller.
<https:... | I mostly validating before action goes to the Model, controller could be good for it.
```
###Post Model Sample
validate :is_admin?
def is_admin?
unless User.find_by_id(user_id).admin
errors.add(:not_admin, "The post not belongs to you || not admin :) ")
end
end
``` |
60,869,651 | I am migrating form .Net 2.1 to 3.1 and this is including EF Core upgrade.
Now I had LINQ query as following, that worked with no issues:
```
var application = await _db.CustomerApplications
.AsNoTracking()
.Include(i => i.CustomerApplicationFields)
.Include(i => i.Cust... | 2020/03/26 | [
"https://Stackoverflow.com/questions/60869651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1935172/"
] | Before EF Core 3.0, queries that could not be translated into SQL queries were evaluated on the client side. This behaviour was dismissed and an exception is thrown instead of evaluating non-translatable queries on the client side, now.
Also I think the new behaviour should not lead to any big performance issues when ... | You should use && instead of & or you can add another where clause. |
52,510,659 | I'm trying to mark a Return Authorization as Approved.
```
var returnAuth = nlapiTransformRecord('invoice',invoice_id,'returnauthorization',true);
returnAuth.setFieldValue('customform','84');
returnAuth.setFieldValue('approvereturn','T');
nlapiSubmitRecord(returnAuth);
```
I've tried using the ... | 2018/09/26 | [
"https://Stackoverflow.com/questions/52510659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1532104/"
] | For suite script 2.0 this works
```
returnAuth.setValue({
fieldId: 'orderstatus',
value: 'B'
});
returnAuth.save();
```
i think this should work for suite secript 1.0
```
returnAuth.setFieldText('orderstatus','B');
nlapiSubmitRecord(returnAuth);
``` | Try the following:
```
var returnAuth = nlapiTransformRecord('invoice',invoice_id,'returnauthorization');
returnAuth.setFieldValue('customform','84');
nlapiSubmitRecord(returnAuth, true, true);
```
The parameters for 'nlapiSubmitRecord' are set to "true" for doSourcing - which indicates that field values will be so... |
52,510,659 | I'm trying to mark a Return Authorization as Approved.
```
var returnAuth = nlapiTransformRecord('invoice',invoice_id,'returnauthorization',true);
returnAuth.setFieldValue('customform','84');
returnAuth.setFieldValue('approvereturn','T');
nlapiSubmitRecord(returnAuth);
```
I've tried using the ... | 2018/09/26 | [
"https://Stackoverflow.com/questions/52510659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1532104/"
] | For suite script 2.0 this works
```
returnAuth.setValue({
fieldId: 'orderstatus',
value: 'B'
});
returnAuth.save();
```
i think this should work for suite secript 1.0
```
returnAuth.setFieldText('orderstatus','B');
nlapiSubmitRecord(returnAuth);
``` | Try Below Code
```
var returnAuth = nlapiTransformRecord('invoice',invoice_id,'returnauthorization',true);
returnAuth.setFieldValue('customform','84');
returnAuth.setFieldText('approvereturn','T');
nlapiSubmitRecord(returnAuth);
``` |
52,510,659 | I'm trying to mark a Return Authorization as Approved.
```
var returnAuth = nlapiTransformRecord('invoice',invoice_id,'returnauthorization',true);
returnAuth.setFieldValue('customform','84');
returnAuth.setFieldValue('approvereturn','T');
nlapiSubmitRecord(returnAuth);
```
I've tried using the ... | 2018/09/26 | [
"https://Stackoverflow.com/questions/52510659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1532104/"
] | For suite script 2.0 this works
```
returnAuth.setValue({
fieldId: 'orderstatus',
value: 'B'
});
returnAuth.save();
```
i think this should work for suite secript 1.0
```
returnAuth.setFieldText('orderstatus','B');
nlapiSubmitRecord(returnAuth);
``` | For SuiteScript 1.0:
```
const nsReturnAuthorization = nlapiTransformRecord('invoice', invoiceId, 'returnauthorization');
nsReturnAuthorization.setFieldText('orderstatus','B');
const returnAuthId = nlapiSubmitRecord(nsReturnAuthorization)
``` |
33,503,613 | I would like to redirect every url of my website from http:// to https://
My problem is that I alerady have a routing system in my .htaccess :
```
RewriteRule ([^.]+)\.html$ index.php?/$1 [QSA,L]
```
I tried to add this, but the route is broken :
```
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOS... | 2015/11/03 | [
"https://Stackoverflow.com/questions/33503613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4846686/"
] | Although your app contains `app.UseCors(CorsOptions.AllowAll)`, the original error message is pretty clear that this is a CORS issue.
>
> [](https://i.stack.imgur.com/SSzBo.png)
>
>
>
The Origin URL (<http://localhost:8100>) is different than the Signa... | See the selected answer for insight into the problem and potential solution.
I solved the problem by making sure I had a version of Mono 3.0.10 or later. I am using Docker, so this was as easy as updating my `FROM` statement in my Dockerfile. |
59,789,806 | How do I compare all the rows value(sum) in my table to the first row (which is the first date)
for example:
```
ID Date Sum
1 01-01-2020 60
2 01-02-2020 70
3 01-05-2020 80
4 01-06-2020 25
```
I want all the IDs which the sum in them is greater than 60 (the first date)
I tried to set the first d... | 2020/01/17 | [
"https://Stackoverflow.com/questions/59789806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12732153/"
] | ```
Select * from mytable where sum > (select sum from mytable order by date limit 1).
``` | In MySQL 8+, you can use `first_value()`:
```
select t.*, first_value(sum) over (order by date) as first_sum
from t;
```
You can then incorporate this into a subquery to get the rows that are at or exceed the value:
```
select t.*
from (select t.*, first_value(sum) over (order by date) as first_sum
from t
... |
4,181,074 | certain key colour in my application are loaded as dynamic resources. This works fine is most controls except ColorAnimation. For this, it throws an exception:
>
> Cannot convert the value in attribute 'To' to object of type 'System.Nullable`1[[System.Windows.Media.Color, PresentationCore, Version=3.0.0.0, Culture=ne... | 2010/11/15 | [
"https://Stackoverflow.com/questions/4181074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271588/"
] | According to <http://objectmix.com/csharp/733011-wpf-using-storyboards-custom-control.html> and a few hours of random experimentation, I have come to the conclusion that this can not be done. Not easily, at last. | You are trying to set a Color value with a Brush property. Try changing
```
<ColorAnimation BeginTime="00:00:00.3" Duration="00:00:00.4" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="{StaticResource ButtonBorder}"/>
```
to:
```
<ColorAnimation BeginTime="00:00:00.3" Duration="00:0... |
4,181,074 | certain key colour in my application are loaded as dynamic resources. This works fine is most controls except ColorAnimation. For this, it throws an exception:
>
> Cannot convert the value in attribute 'To' to object of type 'System.Nullable`1[[System.Windows.Media.Color, PresentationCore, Version=3.0.0.0, Culture=ne... | 2010/11/15 | [
"https://Stackoverflow.com/questions/4181074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271588/"
] | I just tried it and this works
```
<Color x:Key="ButtonBorderColor">Green</Color>
<SolidColorBrush x:Key="ButtonBorder" Color="{StaticResource ButtonBorderColor}" />
<Style x:Key="ChildWindowButtonBarButtonStyle" TargetType="{x:Type Button}">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorder}" /... | You are trying to set a Color value with a Brush property. Try changing
```
<ColorAnimation BeginTime="00:00:00.3" Duration="00:00:00.4" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="{StaticResource ButtonBorder}"/>
```
to:
```
<ColorAnimation BeginTime="00:00:00.3" Duration="00:0... |
4,181,074 | certain key colour in my application are loaded as dynamic resources. This works fine is most controls except ColorAnimation. For this, it throws an exception:
>
> Cannot convert the value in attribute 'To' to object of type 'System.Nullable`1[[System.Windows.Media.Color, PresentationCore, Version=3.0.0.0, Culture=ne... | 2010/11/15 | [
"https://Stackoverflow.com/questions/4181074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271588/"
] | I just tried it and this works
```
<Color x:Key="ButtonBorderColor">Green</Color>
<SolidColorBrush x:Key="ButtonBorder" Color="{StaticResource ButtonBorderColor}" />
<Style x:Key="ChildWindowButtonBarButtonStyle" TargetType="{x:Type Button}">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorder}" /... | According to <http://objectmix.com/csharp/733011-wpf-using-storyboards-custom-control.html> and a few hours of random experimentation, I have come to the conclusion that this can not be done. Not easily, at last. |
35,265,972 | My client needs an angular js app, the app is based on an api, of an app that's already running.
one of the apis, returns a json structured like this:
```
{
"groups":{
"60":{
"name":"History"
},
"74":{
"name":"Discover our offers"
},
"109":{
"name":... | 2016/02/08 | [
"https://Stackoverflow.com/questions/35265972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3531149/"
] | This structure isn't appropriate for angularjs, either :
1. Do it yourself in the .then method
2. Write your own filter
3. Map your object in a new one in the .then method to make it look like this :
[{
value:'60',
name:'History'
}, {
....
}]
Then you can use angular filtering. | use ngRepeat [orderBy](https://docs.angularjs.org/api/ng/filter/orderBy)
Use filter like **`orderBy: 'name'`**
```
<li ng-repeat="(key, value) in poi_groups| orderBy:'name'">
```
and
```
<li ng-repeat="(key, value) in poi_groups| orderBy:'name': -1">
```
for DESC
if you make plnk we can check it out |
3,123,150 | From *Complex Function Theory* by Palka, an example shows for positive integers $n$ that
$$\int\_0^\pi \sin^{2n}t \; dt=\frac{\pi}{4}\binom{2n}{n}$$
using the Residue Thm, and I understood his derivation. But he went on to say that this can be found using familiar techniques, he mentions the substitution $u= \tan (t/2)... | 2019/02/22 | [
"https://math.stackexchange.com/questions/3123150",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/164082/"
] | Let $$I\_n=\int\_0^\pi \sin^{2n}t \; dt. $$
Then by integration by parts, you has
\begin{eqnarray\*}
I\_n&=&\int\_0^\pi\sin^{2n-1}t\sin tdt\\
&=&-\int\_0^\pi\sin^{2n-1}td\cos t=(2n-1)\int\_0^\pi\cos^2 t\sin^{2n-2}tdt\\
&=&(2n-1)\int\_0^\pi(1-\sin^2t)\sin^{2n-2}tdt\\
&=&(2n-1)I\_{n-1}-(2n-1)I\_n
\end{eqnarray\*}
from w... | $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\new... |
3,123,150 | From *Complex Function Theory* by Palka, an example shows for positive integers $n$ that
$$\int\_0^\pi \sin^{2n}t \; dt=\frac{\pi}{4}\binom{2n}{n}$$
using the Residue Thm, and I understood his derivation. But he went on to say that this can be found using familiar techniques, he mentions the substitution $u= \tan (t/2)... | 2019/02/22 | [
"https://math.stackexchange.com/questions/3123150",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/164082/"
] | Here's a completely different method.
For $a,b\in\Bbb C$ such that $\operatorname{Re}a,\operatorname{Re}b>-1$, we define
$$I(a,b)=\int\_0^{\pi/2}\sin(x)^{a}\cos(x)^bdx$$
Sub.:
$$t=\sin(x)^2\Rightarrow 2t^{-1/2}(1-t)^{-1/2}dt=dx$$
Hence $$I(a,b)=2\int\_0^1t^{\frac{a-1}2}(1-t)^{\frac{b-1}2}dt=2\int\_0^1t^{\frac{a+1}2-1}(... | $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\new... |
4,242 | [This user](https://skeptics.stackexchange.com/users/46077/elliot-svensson) has recently posted a number of questions here on Skeptics about controversial recent political events, sometimes concurrently cross-posting on Politics.SE, sometimes self-answering. Most of the questions have been downvoted and several closed.... | 2018/10/03 | [
"https://skeptics.meta.stackexchange.com/questions/4242",
"https://skeptics.meta.stackexchange.com",
"https://skeptics.meta.stackexchange.com/users/46182/"
] | I wouldn't bother with anything more than voting and commenting where appropriate. I'd say their contribution is overall positive. The few issues I've seen were corrected by the community. Seems to be a user that will learn and follow the guidelines, rather than choosing obstinacy. | >
> it seems the community wants to avoid users turning this site into their personal blogging platform.
>
>
>
Why is that? If your blog is about claims made publicly that you're skeptical of, I would welcome you turning it into your own personal blogging platform. |
4,242 | [This user](https://skeptics.stackexchange.com/users/46077/elliot-svensson) has recently posted a number of questions here on Skeptics about controversial recent political events, sometimes concurrently cross-posting on Politics.SE, sometimes self-answering. Most of the questions have been downvoted and several closed.... | 2018/10/03 | [
"https://skeptics.meta.stackexchange.com/questions/4242",
"https://skeptics.meta.stackexchange.com",
"https://skeptics.meta.stackexchange.com/users/46182/"
] | I wouldn't bother with anything more than voting and commenting where appropriate. I'd say their contribution is overall positive. The few issues I've seen were corrected by the community. Seems to be a user that will learn and follow the guidelines, rather than choosing obstinacy. | Posting in agreement with fredsbend's answer.
I don't think there's anything here that requires more than continued guidance on what is and is not correct behavior (with closure/deletion/etc as appropriate). In my experience, the user has demonstrated that they are happy to fit their questions and answers to the comm... |
4,242 | [This user](https://skeptics.stackexchange.com/users/46077/elliot-svensson) has recently posted a number of questions here on Skeptics about controversial recent political events, sometimes concurrently cross-posting on Politics.SE, sometimes self-answering. Most of the questions have been downvoted and several closed.... | 2018/10/03 | [
"https://skeptics.meta.stackexchange.com/questions/4242",
"https://skeptics.meta.stackexchange.com",
"https://skeptics.meta.stackexchange.com/users/46182/"
] | Posting in agreement with fredsbend's answer.
I don't think there's anything here that requires more than continued guidance on what is and is not correct behavior (with closure/deletion/etc as appropriate). In my experience, the user has demonstrated that they are happy to fit their questions and answers to the comm... | >
> it seems the community wants to avoid users turning this site into their personal blogging platform.
>
>
>
Why is that? If your blog is about claims made publicly that you're skeptical of, I would welcome you turning it into your own personal blogging platform. |
46,038,910 | I am using css translate to create a sidebar for my site. The problem is that after clicking the side bar, and collapsing it. It creates white space on the right hand side of the screen. This only happens on mobile devices.
This project is written on React JS so no jquery fixes.
[ to `xml` folder, so Android Studio interpretate it incorrectly. Just move it to `drawable` folder | In my case I have res/font/regular.xml with this structure:
```
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderAuthority="com.google.android.gms.fonts"
..... |
53,784,017 | I want to use python pandas to drop rows in a spreadsheet that do not contain "CAT" within the "Equipment" column.
Here is what I have so far:
```
import pandas as pd
import openpyxl
import warnings
import xlrd
warnings.filterwarnings("ignore")
file_name = input("Enter File Name: ")
df = pd.read_csv(file_name)
for ... | 2018/12/14 | [
"https://Stackoverflow.com/questions/53784017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10724338/"
] | You don't need a loop here; you can do this with `str.contains`:
```
v = df[df["Equipment"].str.contains('CAT')]
print(v)
Equipment
0 CAT 259B3 1818 OE Skid Steer 2011 CAT
2 CAT 938M Loader RPO RENTAL 2017 CAT 938M
```
Or, use `query` with `engine='python'`:
```
v = df.query('... | You can use this to filter the rows.
```
df[df['Equipment'].apply(lambda x: 'CAT' in x)].to_excel("new_mp.xlsx")
```
**Edit:**
Alright, let me explain this inside out :
`lambda x: 'CAT' in x` takes as input x and returns True if 'CAT' is in x.
Now the `df['Equipment'].apply` method will invoke the `lambda` functi... |
4,123,730 | ```
geneHomology
============
id genome_name gene_id homolog_genome_name homolog_gene_id consider_homolog
1 HomoSap 1007 MusMus 824 1
2 HomoSap 1007 MusMus 825 1
3 HomoSap 1007 MusMus 826 1
4 HomoSap 289... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4123730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/377031/"
] | ```
SELECT a.genome_name, a.gene_id,
cats.gene_category,
(
SELECT COUNT(*)
FROM geneHomology ab
JOIN gene b
ON b.genome_name = ab.homolog_genome_name
AND b.gene_id = ab.homolog_gene_id
WHERE ab.genome_name = a.genome_name
... | From what you've posted here, I would reccomend a minor bit of denormalisation and put gene\_category into geneHomolgy. You can then get rid of the join entirely and you can create an index on your consider\_homolog + GROUP BY fields. |
4,123,730 | ```
geneHomology
============
id genome_name gene_id homolog_genome_name homolog_gene_id consider_homolog
1 HomoSap 1007 MusMus 824 1
2 HomoSap 1007 MusMus 825 1
3 HomoSap 1007 MusMus 826 1
4 HomoSap 289... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4123730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/377031/"
] | ```
SELECT a.genome_name, a.gene_id,
cats.gene_category,
(
SELECT COUNT(*)
FROM geneHomology ab
JOIN gene b
ON b.genome_name = ab.homolog_genome_name
AND b.gene_id = ab.homolog_gene_id
WHERE ab.genome_name = a.genome_name
... | First remove the reference to genome\_name from the WHERE part of the query - if both gene.gene\_id and gene.genome\_name are unique then here is a clear functional dependency here which is confusing the issue somewhat - the number/number join will be marginally mroe efficient that the text/text join.
Looking at the p... |
873,587 | I need to mount a smb share in my laptop. I added it in fstab, but it doesn't seem to be mounting at boot. I need to type `mount -a` manually to mount it. I think it is because the laptop is not getting connected to the network when its booted. I tried to add a cron to mount it 1 minute after reboot, but it is also not... | 2017/01/19 | [
"https://askubuntu.com/questions/873587",
"https://askubuntu.com",
"https://askubuntu.com/users/170142/"
] | Add the command to mount the share at the end of `~/.bash_profile`. This will execute the command when you login. | To mount samba share automatically when system reboot, You need to add an entry to the `/etc/fstab` file.
```
//server-name/sharename /mountpoint cifs username=smbuser,password=smbpass 0 0
```
When system reboot, Ubuntu will mount the samba share specified in the `/etc/fstab` file. |
20,583,990 | i have a folder with some folder names, for example **3 folders:**
**2012-2013, 2013-2014 ,2014-2015**
is any way with some php code, to show the names folders in my php like this:
```
<option value="2012-2013">2012-2013</option>
<option value="2013-2014">2013-2014</option>
<option value="2014-2015">2014-2015</optio... | 2013/12/14 | [
"https://Stackoverflow.com/questions/20583990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2773673/"
] | I suppose you want to recursive the folder in a directory. Below please find the code.
```
<?php
$folder_name = "c:\\your_folder\\";
$folders = scandir($folder_name);
echo '<select>';
foreach($folders as $folder){
if (is_dir($folder_name . $folder)){
if ($folder != '.' && $folder != '..')
echo ... | You need to read the directory and print an option tag for each time you find a file that is a folder.
first thing you need to open file handler to your directory by giving the main folder path, than itterate over the directory by using the read method on the folder handler.
By using the "is\_dir" function you can dete... |
2,023,617 | I've got a table `A` with a column full of sentences.
I've got another table `B` with two columns: words and abbreviations.
I want to look through table `A`'s column sentences and if a word from table `B`'s word column matches then replace it with abbreviation.
Hope that is clear.
Case doesn't matter, I can deal wi... | 2010/01/07 | [
"https://Stackoverflow.com/questions/2023617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245925/"
] | You can't do this with SQL alone, you'd need to pull the data from the database, manipulate it and then push it back.
There's a bunch of ways to do it, some are simpler that others and some are more efficient.
For example a simple but slow method would be (in pseudocode)...
```
sentence_list = db.execute("SELECT id... | You could get crazy and add a mysql odbc connection in excel. Query the sentences in one query table, Query the lookup words in another table, and write a little macro that refreshes the tables then does a find and replace, then re-import it back into your table. I know in Ms sql, you can do all this automatically in D... |
2,023,617 | I've got a table `A` with a column full of sentences.
I've got another table `B` with two columns: words and abbreviations.
I want to look through table `A`'s column sentences and if a word from table `B`'s word column matches then replace it with abbreviation.
Hope that is clear.
Case doesn't matter, I can deal wi... | 2010/01/07 | [
"https://Stackoverflow.com/questions/2023617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245925/"
] | You can't do this with SQL alone, you'd need to pull the data from the database, manipulate it and then push it back.
There's a bunch of ways to do it, some are simpler that others and some are more efficient.
For example a simple but slow method would be (in pseudocode)...
```
sentence_list = db.execute("SELECT id... | I know it's an old question but since there is no answer, I'll give a try with this :
[SQL Fiddle](http://sqlfiddle.com/#!2/46433/1)
**MySQL 5.5.32 Schema Setup**:
```
CREATE TABLE Table1
(`Id` int, `Sentence` varchar(80))
;
INSERT INTO Table1
(`Id`, `Sentence`)
VALUES
(1, 'Mister John is going to Los A... |
2,023,617 | I've got a table `A` with a column full of sentences.
I've got another table `B` with two columns: words and abbreviations.
I want to look through table `A`'s column sentences and if a word from table `B`'s word column matches then replace it with abbreviation.
Hope that is clear.
Case doesn't matter, I can deal wi... | 2010/01/07 | [
"https://Stackoverflow.com/questions/2023617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245925/"
] | I know it's an old question but since there is no answer, I'll give a try with this :
[SQL Fiddle](http://sqlfiddle.com/#!2/46433/1)
**MySQL 5.5.32 Schema Setup**:
```
CREATE TABLE Table1
(`Id` int, `Sentence` varchar(80))
;
INSERT INTO Table1
(`Id`, `Sentence`)
VALUES
(1, 'Mister John is going to Los A... | You could get crazy and add a mysql odbc connection in excel. Query the sentences in one query table, Query the lookup words in another table, and write a little macro that refreshes the tables then does a find and replace, then re-import it back into your table. I know in Ms sql, you can do all this automatically in D... |
43,580,476 | I'm working on a .NET 4.5 web application(non-MVC) which contains numerous modules.
While testing, I found out that my application is vulnerable to Reflected Cross Site Scripting attacks.
For instance this is what my sample URL would look like like:
```
example.com/abc.aspx?id=1234
```
Now if someone tries to... | 2017/04/24 | [
"https://Stackoverflow.com/questions/43580476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6340609/"
] | You can try to set [`System.Web.Security.AntiXss.AntiXssEncoder`](https://msdn.microsoft.com/fr-fr/library/system.web.security.antixss.antixssencoder(v=vs.110).aspx) (available since .NET 4.5) as a default encoder for your ASP.NET application.
It encodes a string meant to be used in a URL, HTML, CSS or XML string.
U... | Best way is to use validateRequest property and change your logic how and why you passing HTML in your get request. Maybe you need to pass only ids or values of this textboxes. |
39,928,737 | Not a Wordpress expert, but reasonably well versed in HTTP/HTML/CSS/Javascript/etc. Customer has a Wordpress site of not recent vintage, and I want to just get in, do the minimal required work, and get out. A page needs an image, so I upload it to the "Media Library". Push buttons and doodads to insert it into page, vi... | 2016/10/08 | [
"https://Stackoverflow.com/questions/39928737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/212264/"
] | I just checked it in IE11 on a virtual machine running Win10 and it was the correct size. It may sound daft, but are you sure you haven't accidentally enabled zooming in your browser? | This might sound simple-stupid, but sometimes, we all tend to miss something trivial:
While inserting the image/s into page, there is a column called **ATTACHMENT DETAILS** (extreme right). Down below on this column, there is a **Size** dropdown. Have you tried adjusting that? HTH. |
67,279,635 | I create a swiper slide. Slides works well but i want to navigate slide with custom buttons.
I just try something. Like:
```
<swiper #selectArtSlider [slidesPerView]="'auto'" [spaceBetween]="15" [observeParents]="'true'"
[navigation]="{ prevEl: '.swiper-navigation-prev', nextEl: '.swiper-navigation-next' }"
>
... | 2021/04/27 | [
"https://Stackoverflow.com/questions/67279635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14566666/"
] | One solution is to make the div elements inline-block. The float + width 100% you got going on above is also pushing everything to the next row I think
To prevent line breaks and spaces in the code from making this work a hack is to let the parents font-size be set to 0
```
.w3-col,
.w3-half,
.w3-third,
.w3-twothird,... | [flexbox](https://developer.mozilla.org/fr/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox) could help you place elements this way.
```
.w3-content {
display: flex;
justify-content: center;
align-items: center;
}
``` |
67,279,635 | I create a swiper slide. Slides works well but i want to navigate slide with custom buttons.
I just try something. Like:
```
<swiper #selectArtSlider [slidesPerView]="'auto'" [spaceBetween]="15" [observeParents]="'true'"
[navigation]="{ prevEl: '.swiper-navigation-prev', nextEl: '.swiper-navigation-next' }"
>
... | 2021/04/27 | [
"https://Stackoverflow.com/questions/67279635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14566666/"
] | One solution is to make the div elements inline-block. The float + width 100% you got going on above is also pushing everything to the next row I think
To prevent line breaks and spaces in the code from making this work a hack is to let the parents font-size be set to 0
```
.w3-col,
.w3-half,
.w3-third,
.w3-twothird,... | Using `float` for layout is outdated and complex. You should use more up-to-date tools such as `flex`.
Simplifying your CSS a lot, and using flex to get 2 thirds / 1 third when there's enough room (`flex-basis` will force that):
```css
.w3-content {
display: flex;
flex-direction: row;
border: 1px solid red;
}
... |
67,279,635 | I create a swiper slide. Slides works well but i want to navigate slide with custom buttons.
I just try something. Like:
```
<swiper #selectArtSlider [slidesPerView]="'auto'" [spaceBetween]="15" [observeParents]="'true'"
[navigation]="{ prevEl: '.swiper-navigation-prev', nextEl: '.swiper-navigation-next' }"
>
... | 2021/04/27 | [
"https://Stackoverflow.com/questions/67279635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14566666/"
] | One solution is to make the div elements inline-block. The float + width 100% you got going on above is also pushing everything to the next row I think
To prevent line breaks and spaces in the code from making this work a hack is to let the parents font-size be set to 0
```
.w3-col,
.w3-half,
.w3-third,
.w3-twothird,... | ```css
.container {
display: flex;
}
img {
margin: 6px;
width:30%;
height:auto;
border-radius:10px;
}
.content{
width:70%;
}
```
```html
<div class="container">
<div class="content">
<h5 class="w3-padding-32" style="font-size:15px">Here would be some information to accompany the image.</h5>
<p clas... |
67,279,635 | I create a swiper slide. Slides works well but i want to navigate slide with custom buttons.
I just try something. Like:
```
<swiper #selectArtSlider [slidesPerView]="'auto'" [spaceBetween]="15" [observeParents]="'true'"
[navigation]="{ prevEl: '.swiper-navigation-prev', nextEl: '.swiper-navigation-next' }"
>
... | 2021/04/27 | [
"https://Stackoverflow.com/questions/67279635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14566666/"
] | One solution is to make the div elements inline-block. The float + width 100% you got going on above is also pushing everything to the next row I think
To prevent line breaks and spaces in the code from making this work a hack is to let the parents font-size be set to 0
```
.w3-col,
.w3-half,
.w3-third,
.w3-twothird,... | OK here is actual problem statement:
Divs are covering full width of the container,and that is due to width being 100% in css. So does not matter whether its half full quarter they all get applied as 100%;
```
.w3-quarter {
float: left;
width: 100%
}
```
See for your self! I have only added background colour to ... |
67,279,635 | I create a swiper slide. Slides works well but i want to navigate slide with custom buttons.
I just try something. Like:
```
<swiper #selectArtSlider [slidesPerView]="'auto'" [spaceBetween]="15" [observeParents]="'true'"
[navigation]="{ prevEl: '.swiper-navigation-prev', nextEl: '.swiper-navigation-next' }"
>
... | 2021/04/27 | [
"https://Stackoverflow.com/questions/67279635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14566666/"
] | One solution is to make the div elements inline-block. The float + width 100% you got going on above is also pushing everything to the next row I think
To prevent line breaks and spaces in the code from making this work a hack is to let the parents font-size be set to 0
```
.w3-col,
.w3-half,
.w3-third,
.w3-twothird,... | Because these classes make your div 100% width.
```
.w3-col,
.w3-half,
.w3-third,
.w3-twothird,
.w3-threequarter,
.w3-quarter {
float: left;
width: 100%
}
```
So you will need to make your div 2/3 and 1/3 of 100% as your wish.
```
.w3-twothird {
width: 66.66%
}
.w3-athird {
width: 33.33%
}
```
There are m... |
49,629,260 | I've an Activity that extends `AppCompatActivity`.
I tried to disable back button like this:
```
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
}
return true;
}
@Override
public void onBackPressed() {
Toast.makeText(t... | 2018/04/03 | [
"https://Stackoverflow.com/questions/49629260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8358447/"
] | You can write that yaml by yourself, but it will be faster to create it in 2 steps using `kubectl`:
1. Generate a 'yaml' file. You can use the same command but in dry-run mode and output mode `yaml`.
Here is an example of a command that will save a secret into a 'docker-secret.yaml' file for `kubectl` version < 1.18 ... | ```
apiVersion: v1
kind: Secret
metadata:
name: <NAME>
namespace: <NAMESPACE>
data:
.dockercfg: eyJldXJvcGEubGFSfsdfsdfSFSDFsdfsdfSFSDFSDfjM2x1SDFSDFSDFSDFSDFSDFSFSDFSDFSDFSDFG9mZmVyLm5pY2tsYXNzb25AbGVuc3dheWdyb3VwLmNvbSIsImF1dGgiOiJWRTlMUlU0Nk1EZDBNM0JxTXpWak0yeDFNakEwZEdkbGRHVndjVzQ1YUdZPSJ9fQ==
type: kubernete... |
49,629,260 | I've an Activity that extends `AppCompatActivity`.
I tried to disable back button like this:
```
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
}
return true;
}
@Override
public void onBackPressed() {
Toast.makeText(t... | 2018/04/03 | [
"https://Stackoverflow.com/questions/49629260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8358447/"
] | You can write that yaml by yourself, but it will be faster to create it in 2 steps using `kubectl`:
1. Generate a 'yaml' file. You can use the same command but in dry-run mode and output mode `yaml`.
Here is an example of a command that will save a secret into a 'docker-secret.yaml' file for `kubectl` version < 1.18 ... | You can **kubectl apply** the output of an imperative command in one line:
```
kubectl create secret docker-registry --dry-run=true $secret_name \
--docker-server=<DOCKER_REGISTRY_SERVER> \
--docker-username=<DOCKER_USER> \
--docker-password=<DOCKER_PASSWORD> \
--docker-email=<DOCKER_EMAIL> -o yaml | kubectl a... |
49,629,260 | I've an Activity that extends `AppCompatActivity`.
I tried to disable back button like this:
```
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
}
return true;
}
@Override
public void onBackPressed() {
Toast.makeText(t... | 2018/04/03 | [
"https://Stackoverflow.com/questions/49629260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8358447/"
] | You can write that yaml by yourself, but it will be faster to create it in 2 steps using `kubectl`:
1. Generate a 'yaml' file. You can use the same command but in dry-run mode and output mode `yaml`.
Here is an example of a command that will save a secret into a 'docker-secret.yaml' file for `kubectl` version < 1.18 ... | In case someone also just wants to have a mapping of kubectl command to yaml file:
```
kubectl create secret docker-registry --dry-run=true dockerhostsecretname \
--docker-server=localhost \
--docker-username=root \
--docker-password=toor \
--docker-email=root@toor.nl -o yaml
```
gives me
```
apiVersion: v1... |
49,629,260 | I've an Activity that extends `AppCompatActivity`.
I tried to disable back button like this:
```
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
}
return true;
}
@Override
public void onBackPressed() {
Toast.makeText(t... | 2018/04/03 | [
"https://Stackoverflow.com/questions/49629260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8358447/"
] | You can write that yaml by yourself, but it will be faster to create it in 2 steps using `kubectl`:
1. Generate a 'yaml' file. You can use the same command but in dry-run mode and output mode `yaml`.
Here is an example of a command that will save a secret into a 'docker-secret.yaml' file for `kubectl` version < 1.18 ... | ```
cat <<EOF | kubectl apply -f -
---
apiVersion: v1
kind: Secret
metadata:
name: regcred
data:
.dockerconfigjson: $(echo "{\"auths\": {\"https://index.docker.io/v1/\": {\"auth\": \"$(echo "janedoe:xxxxxxxxxxx" | base64)\"}}}" | base64)
type: kubernetes.io/dockerconfigjson
EOF
``` |
49,629,260 | I've an Activity that extends `AppCompatActivity`.
I tried to disable back button like this:
```
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
}
return true;
}
@Override
public void onBackPressed() {
Toast.makeText(t... | 2018/04/03 | [
"https://Stackoverflow.com/questions/49629260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8358447/"
] | You can **kubectl apply** the output of an imperative command in one line:
```
kubectl create secret docker-registry --dry-run=true $secret_name \
--docker-server=<DOCKER_REGISTRY_SERVER> \
--docker-username=<DOCKER_USER> \
--docker-password=<DOCKER_PASSWORD> \
--docker-email=<DOCKER_EMAIL> -o yaml | kubectl a... | ```
apiVersion: v1
kind: Secret
metadata:
name: <NAME>
namespace: <NAMESPACE>
data:
.dockercfg: eyJldXJvcGEubGFSfsdfsdfSFSDFsdfsdfSFSDFSDfjM2x1SDFSDFSDFSDFSDFSDFSFSDFSDFSDFSDFG9mZmVyLm5pY2tsYXNzb25AbGVuc3dheWdyb3VwLmNvbSIsImF1dGgiOiJWRTlMUlU0Nk1EZDBNM0JxTXpWak0yeDFNakEwZEdkbGRHVndjVzQ1YUdZPSJ9fQ==
type: kubernete... |
49,629,260 | I've an Activity that extends `AppCompatActivity`.
I tried to disable back button like this:
```
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
}
return true;
}
@Override
public void onBackPressed() {
Toast.makeText(t... | 2018/04/03 | [
"https://Stackoverflow.com/questions/49629260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8358447/"
] | You can **kubectl apply** the output of an imperative command in one line:
```
kubectl create secret docker-registry --dry-run=true $secret_name \
--docker-server=<DOCKER_REGISTRY_SERVER> \
--docker-username=<DOCKER_USER> \
--docker-password=<DOCKER_PASSWORD> \
--docker-email=<DOCKER_EMAIL> -o yaml | kubectl a... | In case someone also just wants to have a mapping of kubectl command to yaml file:
```
kubectl create secret docker-registry --dry-run=true dockerhostsecretname \
--docker-server=localhost \
--docker-username=root \
--docker-password=toor \
--docker-email=root@toor.nl -o yaml
```
gives me
```
apiVersion: v1... |
49,629,260 | I've an Activity that extends `AppCompatActivity`.
I tried to disable back button like this:
```
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
}
return true;
}
@Override
public void onBackPressed() {
Toast.makeText(t... | 2018/04/03 | [
"https://Stackoverflow.com/questions/49629260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8358447/"
] | You can **kubectl apply** the output of an imperative command in one line:
```
kubectl create secret docker-registry --dry-run=true $secret_name \
--docker-server=<DOCKER_REGISTRY_SERVER> \
--docker-username=<DOCKER_USER> \
--docker-password=<DOCKER_PASSWORD> \
--docker-email=<DOCKER_EMAIL> -o yaml | kubectl a... | ```
cat <<EOF | kubectl apply -f -
---
apiVersion: v1
kind: Secret
metadata:
name: regcred
data:
.dockerconfigjson: $(echo "{\"auths\": {\"https://index.docker.io/v1/\": {\"auth\": \"$(echo "janedoe:xxxxxxxxxxx" | base64)\"}}}" | base64)
type: kubernetes.io/dockerconfigjson
EOF
``` |
353,772 | i have the following jquery code.
basically i will have several overlapped divs and a list of links on the right of all those overlapped divs. when hovering over a link, the link's assigned div will fade in.
I have the following code and it works (it uses the default windows' sample pictures), but if someone can thi... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34683/"
] | The first thing you can do, to make it cleaner is replace all those similar calls with something more generic.
(note: assume all of this is inside of `document.ready()`)
```
$('#trigger1').data('target', '#divsunset');
$('#trigger2').data('target', '#divwinter');
$('#trigger3').data('target', '#divbh');
$('#trigger4... | It's good, but you'll need a more generic approach to the id's you've assigned.
The quickest solution that comes to mind is to wrap up the overlapped divs that fade in under a parent div "#wrapped". Take all the links and assign them CSS classes 'trigger NAME' where 'NAME' is 'Sunset, 'Winter', etc. Then you can do so... |
353,772 | i have the following jquery code.
basically i will have several overlapped divs and a list of links on the right of all those overlapped divs. when hovering over a link, the link's assigned div will fade in.
I have the following code and it works (it uses the default windows' sample pictures), but if someone can thi... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34683/"
] | The first thing you can do, to make it cleaner is replace all those similar calls with something more generic.
(note: assume all of this is inside of `document.ready()`)
```
$('#trigger1').data('target', '#divsunset');
$('#trigger2').data('target', '#divwinter');
$('#trigger3').data('target', '#divbh');
$('#trigger4... | I replied to a similar question some months ago [jQuery Swapping Elements](https://stackoverflow.com/questions/233936/jquery-swapping-elements#234022) if that helps.
Matt
Clarrification, where i've got {id:'1'} you should swap in the id of the div you want to show and make a generic class name on the other DIV's to h... |
353,772 | i have the following jquery code.
basically i will have several overlapped divs and a list of links on the right of all those overlapped divs. when hovering over a link, the link's assigned div will fade in.
I have the following code and it works (it uses the default windows' sample pictures), but if someone can thi... | 2008/12/09 | [
"https://Stackoverflow.com/questions/353772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34683/"
] | I replied to a similar question some months ago [jQuery Swapping Elements](https://stackoverflow.com/questions/233936/jquery-swapping-elements#234022) if that helps.
Matt
Clarrification, where i've got {id:'1'} you should swap in the id of the div you want to show and make a generic class name on the other DIV's to h... | It's good, but you'll need a more generic approach to the id's you've assigned.
The quickest solution that comes to mind is to wrap up the overlapped divs that fade in under a parent div "#wrapped". Take all the links and assign them CSS classes 'trigger NAME' where 'NAME' is 'Sunset, 'Winter', etc. Then you can do so... |
42,943,535 | I have the records like this :-
```
1|Share Capital|Subscribed and paid up
1|Share Capital|Capital Redemption Reverse
1|Share Capital|12% Debertures
1|Share Capital|plant and machinery
1|Share Capital|Shares in SBI
1|Share Capital|Stock in Trade
1|Share Capital|Provisions for taxation
1|Share Capital|Bill Receivable... | 2017/03/22 | [
"https://Stackoverflow.com/questions/42943535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7749393/"
] | As the comment on your question suggests, this is suitable for `gsub`:
```
gsub("^.*_", "", string_thing)
```
I'd recommend you take note of the following cases as well.
```
string_thing <- c("I_AM_STRING", "I_AM_ALSO_STRING_THING", "AM I ONE", "STRING_")
gsub("^.*_", "", string_thing)
[1] "STRING" "THING" "AM... | We can loop through the `list` with `sapply` and get the 'n' number of last elements with `tail`
```
sapply(Split, tail, 1)
#[1] "STRING" "STRING"
```
If there is only a single string, then do use `[[` to convert `list` to `vector` and get the last element with `tail`
```
tail(Split[[1]], 1)
``` |
33,251,027 | I have java package
There is Host class and Client class that can reveive many hosts
```
public final class Host {
public final String name;
public final int port;
}
public class SomeClient{...
public Client(Host... hosts) throws Exception {
....
}
```
I'm writing scala code to creating this client
``... | 2015/10/21 | [
"https://Stackoverflow.com/questions/33251027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/850737/"
] | ```
def getClient(hosts:String): SomeClient = {
val default_port:Int = 100
val hostsArr: Array[String] = hosts.split(",")
//Here you map over array of string and create Host object for each item
val hosts = hostsArr map { hostStr =>
val host = new Host()
//Rest of assignment
... | So, actually your Scala array is already a Java array. You need to map your string array to Host array like:
```
val hosts = hostsArr.map { h =>
val host = new Host()
host.name = h
host.port = default_port
host
}
new Client(hosts)
``` |
33,251,027 | I have java package
There is Host class and Client class that can reveive many hosts
```
public final class Host {
public final String name;
public final int port;
}
public class SomeClient{...
public Client(Host... hosts) throws Exception {
....
}
```
I'm writing scala code to creating this client
``... | 2015/10/21 | [
"https://Stackoverflow.com/questions/33251027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/850737/"
] | ```
def getClient(hosts:String): SomeClient = {
val default_port:Int = 100
val hostsArr: Array[String] = hosts.split(",")
//Here you map over array of string and create Host object for each item
val hosts = hostsArr map { hostStr =>
val host = new Host()
//Rest of assignment
... | I have provided the basic Scala example of the Elasticsearch client [here](https://stackoverflow.com/questions/54975655/create-java-resthighlevelclient-in-elastic-cluster-mode/64484196#64484196), where it accepts many hosts/nodes(Array/List of hosts) as a parameter. I have used `Java Varargs(:_*)` as mentioned by @Fati... |
59,695,491 | I have a countdown timer that I need to reset from more than one place in my React Native application. I have a service function that returns my updated time string and a variable that the `setInterval` function is saved to via callbacks `returnCountDown` and `returnSetInterval`:
```js
export const getCountdown = (cal... | 2020/01/11 | [
"https://Stackoverflow.com/questions/59695491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11584105/"
] | You have currently declared `data` as a local variable in `MineData`'s constructor. Instead, you need to make it a member variable. Then, you can instantiate it in the initializer list.
```cpp
class MineData {
private:
int row = 10;
int col = 20;
public:
vector<vector<int>> data;
MineData(): data(col, vector<... | The vector `data` needs to be added as a class field. Now it is constructed in the `MineData` class constructor as a temporary variable and it is removed after the constructor function is finished.
```
class MineData {
private:
int row = 10;
int col = 20;
public:
MineData() {
data.resize(col, std::... |
27,219,957 | I've made s simple program to let the user withdraw a certain amount out of a bank account, and if they withdraw too much it will cause an AssertionError, how do I get it to write out the error?
```
import java.util.Scanner;
public class Withdraw {
public static void main(String[]args){
Scanner a = new S... | 2014/12/01 | [
"https://Stackoverflow.com/questions/27219957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4196672/"
] | I'll assume you want your `AssertionError` to include some information on the balance. You're using the constructor `AssertionError()`. According to [the documentation](https://docs.oracle.com/javase/7/docs/api/java/lang/AssertionError.html), you can also use the constructor `AssertionError(Object detailMessage)` where... | Replace the if block containing throw with:
```
assert b>0 : "Invalid Assertion, b must be positive"
```
The String message can be whatever you want. But this is only useful if you run your program as
```
java -ea ClassName
```
If you want to throw error in normal java runtime environment, don't use AssertionErr... |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | Surprisingly `CAST('2/November/2000' as datetime)` works (checked on SQL Server 2008), gives value **2000-11-02 00:00:00.000**
```
SELECT
Month(CAST(Account.date AS DateTime)) "Month",
Day(CAST(Account.date AS DateTime)) "Day",
Year(CAST(Account.date AS DateTime)) "Year",
FROM Account
```
But as rightly pointed o... | You can abuse the [PARSENAME](http://technet.microsoft.com/en-us/library/ms188006.aspx) function slightly here:
```
SELECT FirstPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 3),
SecondPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 2),
ThirdPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 1)
FR... |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | You can abuse the [PARSENAME](http://technet.microsoft.com/en-us/library/ms188006.aspx) function slightly here:
```
SELECT FirstPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 3),
SecondPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 2),
ThirdPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 1)
FR... | Try this:
```
DECLARE @VALUE VARCHAR(100)<BR>
SET @VALUE ='2/11/2000' <BR>
SELECT SUBSTRING(@VALUE,0,CHARINDEX('/',@VALUE,0)),
SUBSTRING(@VALUE,
CHARINDEX('/',@VALUE,0)+1,
(CHARINDEX('/',@VALUE,(CHARINDEX('/',@VALUE,0)+1)) -
CHARINDEX('/',@VALUE,0) - 1)
),RIGHT(@VALUE,4)
``` |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | Surprisingly `CAST('2/November/2000' as datetime)` works (checked on SQL Server 2008), gives value **2000-11-02 00:00:00.000**
```
SELECT
Month(CAST(Account.date AS DateTime)) "Month",
Day(CAST(Account.date AS DateTime)) "Day",
Year(CAST(Account.date AS DateTime)) "Year",
FROM Account
```
But as rightly pointed o... | You can use the combination of CharIndex and Substring function in SQL to split the string based on delimiter.
You can check CharIndex examples here [SQL Server 2005 Using CHARINDEX() To split a string](https://stackoverflow.com/questions/17555755/sql-server-2005-using-charindex-to-split-a-string)
and here [SQL Server... |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | Surprisingly `CAST('2/November/2000' as datetime)` works (checked on SQL Server 2008), gives value **2000-11-02 00:00:00.000**
```
SELECT
Month(CAST(Account.date AS DateTime)) "Month",
Day(CAST(Account.date AS DateTime)) "Day",
Year(CAST(Account.date AS DateTime)) "Year",
FROM Account
```
But as rightly pointed o... | Assuming your database column `account.date` contains a valid `datetime` or `date` value you should using SQLServers date functions like:
```
select month(getDate()) as "Month",
day(getDate()) as "Day",
year(getDate()) as "Year"
```
I replaced your column `account.date` by a `getDate()` to have some ... |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | You can do it this way by using `CHARINDEX` and `SUBSTRING` functions
```
select
LEFT(Account.date, CHARINDEX('/', Account.date) - 1),
SUBSTRING(Account.date, CHARINDEX('/', Account.date) + 1, LEN(Account.date) - CHARINDEX('/', Account.date) - CHARINDEX('/', Account.date, CHARINDEX('/', Account.date)) - 2),
... | You can abuse the [PARSENAME](http://technet.microsoft.com/en-us/library/ms188006.aspx) function slightly here:
```
SELECT FirstPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 3),
SecondPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 2),
ThirdPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 1)
FR... |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | You can do it this way by using `CHARINDEX` and `SUBSTRING` functions
```
select
LEFT(Account.date, CHARINDEX('/', Account.date) - 1),
SUBSTRING(Account.date, CHARINDEX('/', Account.date) + 1, LEN(Account.date) - CHARINDEX('/', Account.date) - CHARINDEX('/', Account.date, CHARINDEX('/', Account.date)) - 2),
... | Try this:
```
DECLARE @VALUE VARCHAR(100)<BR>
SET @VALUE ='2/11/2000' <BR>
SELECT SUBSTRING(@VALUE,0,CHARINDEX('/',@VALUE,0)),
SUBSTRING(@VALUE,
CHARINDEX('/',@VALUE,0)+1,
(CHARINDEX('/',@VALUE,(CHARINDEX('/',@VALUE,0)+1)) -
CHARINDEX('/',@VALUE,0) - 1)
),RIGHT(@VALUE,4)
``` |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | Surprisingly `CAST('2/November/2000' as datetime)` works (checked on SQL Server 2008), gives value **2000-11-02 00:00:00.000**
```
SELECT
Month(CAST(Account.date AS DateTime)) "Month",
Day(CAST(Account.date AS DateTime)) "Day",
Year(CAST(Account.date AS DateTime)) "Year",
FROM Account
```
But as rightly pointed o... | You can do it this way by using `CHARINDEX` and `SUBSTRING` functions
```
select
LEFT(Account.date, CHARINDEX('/', Account.date) - 1),
SUBSTRING(Account.date, CHARINDEX('/', Account.date) + 1, LEN(Account.date) - CHARINDEX('/', Account.date) - CHARINDEX('/', Account.date, CHARINDEX('/', Account.date)) - 2),
... |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | You can do it this way by using `CHARINDEX` and `SUBSTRING` functions
```
select
LEFT(Account.date, CHARINDEX('/', Account.date) - 1),
SUBSTRING(Account.date, CHARINDEX('/', Account.date) + 1, LEN(Account.date) - CHARINDEX('/', Account.date) - CHARINDEX('/', Account.date, CHARINDEX('/', Account.date)) - 2),
... | You can use the combination of CharIndex and Substring function in SQL to split the string based on delimiter.
You can check CharIndex examples here [SQL Server 2005 Using CHARINDEX() To split a string](https://stackoverflow.com/questions/17555755/sql-server-2005-using-charindex-to-split-a-string)
and here [SQL Server... |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | Surprisingly `CAST('2/November/2000' as datetime)` works (checked on SQL Server 2008), gives value **2000-11-02 00:00:00.000**
```
SELECT
Month(CAST(Account.date AS DateTime)) "Month",
Day(CAST(Account.date AS DateTime)) "Day",
Year(CAST(Account.date AS DateTime)) "Year",
FROM Account
```
But as rightly pointed o... | Try this:
```
DECLARE @VALUE VARCHAR(100)<BR>
SET @VALUE ='2/11/2000' <BR>
SELECT SUBSTRING(@VALUE,0,CHARINDEX('/',@VALUE,0)),
SUBSTRING(@VALUE,
CHARINDEX('/',@VALUE,0)+1,
(CHARINDEX('/',@VALUE,(CHARINDEX('/',@VALUE,0)+1)) -
CHARINDEX('/',@VALUE,0) - 1)
),RIGHT(@VALUE,4)
``` |
23,341,039 | I want to split date in column in 3 fields, I use this query
```
SELECT
SUBSTRING(Account.date, 1, 2) AS "Month",
SUBSTRING(Account.date, 4, 2) AS "Day",
SUBSTRING(Account.date, 7, 4) AS "Year"
FROM Account
```
Almost all data is in format `02/11/2000`, but some of it can be `02/November/2000` or `2/11/2000`.
On... | 2014/04/28 | [
"https://Stackoverflow.com/questions/23341039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260664/"
] | You can abuse the [PARSENAME](http://technet.microsoft.com/en-us/library/ms188006.aspx) function slightly here:
```
SELECT FirstPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 3),
SecondPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 2),
ThirdPart = PARSENAME(REPLACE(Account.Date, '/', '.'), 1)
FR... | Assuming your database column `account.date` contains a valid `datetime` or `date` value you should using SQLServers date functions like:
```
select month(getDate()) as "Month",
day(getDate()) as "Day",
year(getDate()) as "Year"
```
I replaced your column `account.date` by a `getDate()` to have some ... |
53,883,406 | I created a VueJs page with the CLI. I would like to show it to other people without having the Vue CLI or Node installed. Just like you normally open .html files in your browser I would like to open the index.html file after building it.
When I open the file I get an empty page with 404 error messages in the console.... | 2018/12/21 | [
"https://Stackoverflow.com/questions/53883406",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ### Referencing environment variables:
Environment variables are referenced using a different syntax per operating system:
* On [*\*nix*](https://en.wikipedia.org/wiki/Unix-like) operating systems, such as macOS and Linux, they are referenced using a dollar sign prefix. For instance:
```none
$npm_execpath
^
```
* O... | I tried the follow aboves suggestions and didn't work. But, in [this topic](https://github.com/wundergraph/wunderctl/issues/2) I tried add `yarn` in every line that has `$npm_execpath` and did work for me. |
14,990,895 | I know that that you can use something like this in Java:
```
(a > b) ? a : b;
```
Is there something similar just without the else part? | 2013/02/20 | [
"https://Stackoverflow.com/questions/14990895",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420042/"
] | It's an expression, not a statement, which means it always evaluates to something. If there wasn't an "else part" there would be nothing for the expression to evaluate to if the test was false. So, no, there's nothing similar without the else.
The thing I like about using the [conditional operator](http://docs.oracle.... | No there isn't. It wouldn't make sense.
`?:` is the ternary comparison operator - an expression. If there was no else statement, what would the value of the expression be? C# has a shorthand version `??` but that's just syntactical sugar and Java doesn't have anything like that anyway. |
14,990,895 | I know that that you can use something like this in Java:
```
(a > b) ? a : b;
```
Is there something similar just without the else part? | 2013/02/20 | [
"https://Stackoverflow.com/questions/14990895",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420042/"
] | It's an expression, not a statement, which means it always evaluates to something. If there wasn't an "else part" there would be nothing for the expression to evaluate to if the test was false. So, no, there's nothing similar without the else.
The thing I like about using the [conditional operator](http://docs.oracle.... | I'm guessing that you're using it to assign a value to a var, which I'll call "c", and the idea is you only want to assign the value when the if statement is true. The normal way would be:
```
if(a > b) c = a;
```
But if you *really* want to use the ternary syntax you could write:
```
c = a > b ? a : c;
```
Note ... |
5,929,129 | I am trying to use a combination of .htaccess and PHP to create subdomains on-the-fly on my GoDaddy Hosting account. I've run into a problem of trying to modify the zone using the wildcard asterisk. I am not at all familiar with how this works and have only found the zone stuff about the domain by exploring the domain ... | 2011/05/08 | [
"https://Stackoverflow.com/questions/5929129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/546657/"
] | DNS is only 1 part of the configuration. You need to have a ServerAlias for \*.mydomain.com in the configuration for the virtual host in Apache, otherwise Apache will not have any idea where to route requests for \*.mydomain.com - which means the .htaccess never has a chance to work at all.
If GoDaddy provides a way t... | I was advised to move my answer from [here](https://stackoverflow.com/questions/13199259/how-do-i-create-a-sub-domain-dynamically-using-php-on-godaddy) to this question:
While not the same as being able to create a new vhost entry for each subdomain dynamically added, you should be able to set this up using a Wildcard... |
5,929,129 | I am trying to use a combination of .htaccess and PHP to create subdomains on-the-fly on my GoDaddy Hosting account. I've run into a problem of trying to modify the zone using the wildcard asterisk. I am not at all familiar with how this works and have only found the zone stuff about the domain by exploring the domain ... | 2011/05/08 | [
"https://Stackoverflow.com/questions/5929129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/546657/"
] | DNS is only 1 part of the configuration. You need to have a ServerAlias for \*.mydomain.com in the configuration for the virtual host in Apache, otherwise Apache will not have any idea where to route requests for \*.mydomain.com - which means the .htaccess never has a chance to work at all.
If GoDaddy provides a way t... | I just got off the phone with GoDaddy tech support, and was given a brilliant solution that doesn't require using mod\_rewrite or upgrading to a dedicated server.
From your account login at <https://gateway.godaddy.com> select Hosting from the dropdown and then on the page that opens, select Settings. In the modal win... |
5,929,129 | I am trying to use a combination of .htaccess and PHP to create subdomains on-the-fly on my GoDaddy Hosting account. I've run into a problem of trying to modify the zone using the wildcard asterisk. I am not at all familiar with how this works and have only found the zone stuff about the domain by exploring the domain ... | 2011/05/08 | [
"https://Stackoverflow.com/questions/5929129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/546657/"
] | I was advised to move my answer from [here](https://stackoverflow.com/questions/13199259/how-do-i-create-a-sub-domain-dynamically-using-php-on-godaddy) to this question:
While not the same as being able to create a new vhost entry for each subdomain dynamically added, you should be able to set this up using a Wildcard... | I just got off the phone with GoDaddy tech support, and was given a brilliant solution that doesn't require using mod\_rewrite or upgrading to a dedicated server.
From your account login at <https://gateway.godaddy.com> select Hosting from the dropdown and then on the page that opens, select Settings. In the modal win... |
294,091 | This is what I got.
[](https://i.stack.imgur.com/mC2Zy.png)Here is an example. Can you help me with the second one? I am able to do all but not the cross in the center.
[](https://i.stac... | 2016/02/15 | [
"https://tex.stackexchange.com/questions/294091",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/98446/"
] | Instead of [`feynmp`](http://ctan.org/pkg/feynmp), there is a new package called [`tikz-feynman`](http://ctan.org/pkg/tikz-feynman) ([project page](http://www.jpellis.me/projects/tikz-feynman)) which also allows you to draw Feynman diagram. In particular, it has support for Majorana particles and mass insertions:
```
... | I added a cross on a dummy vertex and now the code for neutrinoless double beta decay is:
[P.S. Use Astrek (with fmfgraphs) to use labels!]
```
\documentclass[paper=a4, fontsize=11pt]{article}
\usepackage{feynmp}
%\usepackage{feynmf}
\usepackage{ifpdf}
\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}... |
294,091 | This is what I got.
[](https://i.stack.imgur.com/mC2Zy.png)Here is an example. Can you help me with the second one? I am able to do all but not the cross in the center.
[](https://i.stac... | 2016/02/15 | [
"https://tex.stackexchange.com/questions/294091",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/98446/"
] | [](https://i.stack.imgur.com/HVsHF.png)I just paste the code for feynmp.
```
\begin{fmfgraph*}(50,50)
\fmfleft{i0,i1,i2,i3}
\fmfright{f0,f1,f2,f3}
\fmf{fermion,label=$n$,label.side=right}{i3,v1}
\fmf{fermion,label=$p$,label.side=right}{v1,f3}
\fmf{bos... | I added a cross on a dummy vertex and now the code for neutrinoless double beta decay is:
[P.S. Use Astrek (with fmfgraphs) to use labels!]
```
\documentclass[paper=a4, fontsize=11pt]{article}
\usepackage{feynmp}
%\usepackage{feynmf}
\usepackage{ifpdf}
\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}... |
294,091 | This is what I got.
[](https://i.stack.imgur.com/mC2Zy.png)Here is an example. Can you help me with the second one? I am able to do all but not the cross in the center.
[](https://i.stac... | 2016/02/15 | [
"https://tex.stackexchange.com/questions/294091",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/98446/"
] | Instead of [`feynmp`](http://ctan.org/pkg/feynmp), there is a new package called [`tikz-feynman`](http://ctan.org/pkg/tikz-feynman) ([project page](http://www.jpellis.me/projects/tikz-feynman)) which also allows you to draw Feynman diagram. In particular, it has support for Majorana particles and mass insertions:
```
... | [](https://i.stack.imgur.com/HVsHF.png)I just paste the code for feynmp.
```
\begin{fmfgraph*}(50,50)
\fmfleft{i0,i1,i2,i3}
\fmfright{f0,f1,f2,f3}
\fmf{fermion,label=$n$,label.side=right}{i3,v1}
\fmf{fermion,label=$p$,label.side=right}{v1,f3}
\fmf{bos... |
3,675,365 | The following works
```
float a=3;
```
but the following doesn't:
```
Float a=3;
```
Shouldn't 3 be automatically promoted to float (as widening conversions don't require an explicit cast) and then Boxed to Float type ?
Is it because of a rule I read in Khalid Mogul's Java book ?
>
> Widening conversions can'... | 2010/09/09 | [
"https://Stackoverflow.com/questions/3675365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443259/"
] | The reason why `Float a=3;` won't work is because the compiler wraps the `3` into it's Integer object (in essence, the compiler does this: `Float a = new Integer(3);` and that's already a compiler error). Float object isn't and Integer object (even though they come from the same `Number` object).
The following works:
... | ```
Float Integer
^ ^
| |
| |
v v
float <-----------> int
```
There is a boxing/unboxing conversion betwen the primitive and the wrapper, and there is a promotion from one numeric primitive to another. But Java is not ... |
3,675,365 | The following works
```
float a=3;
```
but the following doesn't:
```
Float a=3;
```
Shouldn't 3 be automatically promoted to float (as widening conversions don't require an explicit cast) and then Boxed to Float type ?
Is it because of a rule I read in Khalid Mogul's Java book ?
>
> Widening conversions can'... | 2010/09/09 | [
"https://Stackoverflow.com/questions/3675365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443259/"
] | The reason why `Float a=3;` won't work is because the compiler wraps the `3` into it's Integer object (in essence, the compiler does this: `Float a = new Integer(3);` and that's already a compiler error). Float object isn't and Integer object (even though they come from the same `Number` object).
The following works:
... | Float a= 3.0f; will work. |
3,675,365 | The following works
```
float a=3;
```
but the following doesn't:
```
Float a=3;
```
Shouldn't 3 be automatically promoted to float (as widening conversions don't require an explicit cast) and then Boxed to Float type ?
Is it because of a rule I read in Khalid Mogul's Java book ?
>
> Widening conversions can'... | 2010/09/09 | [
"https://Stackoverflow.com/questions/3675365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443259/"
] | ```
Float Integer
^ ^
| |
| |
v v
float <-----------> int
```
There is a boxing/unboxing conversion betwen the primitive and the wrapper, and there is a promotion from one numeric primitive to another. But Java is not ... | Float a= 3.0f; will work. |
38,895,457 | I have a site in wordpress in which a page is showing questions based on its `ID`.
```
http://example.com/index.php/question/?questionid=9&title='how-to-rewite-htaccess'
```
I am the beginner to php I'm not able to graps other examples found on stackoverflow.com
Here's my .htaccess code
```
<IfModule mod_rewrite.c... | 2016/08/11 | [
"https://Stackoverflow.com/questions/38895457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5524348/"
] | Since your using Wordpress you can turn on permalinks which takes care of the url friendly urls for you see <https://codex.wordpress.org/Settings_Permalinks_Screen>.
Login to your admin then go to permalinks and set a preferred style. | Once you go to **setting > permalinks** and set the pretty links, WordPress will automatically generate .htaccess based on the setting you choose. Don't forget to save.
More information here <http://www.wpbeginner.com/beginners-guide/why-you-cant-find-htaccess-file-on-your-wordpress-site/> |
38,895,457 | I have a site in wordpress in which a page is showing questions based on its `ID`.
```
http://example.com/index.php/question/?questionid=9&title='how-to-rewite-htaccess'
```
I am the beginner to php I'm not able to graps other examples found on stackoverflow.com
Here's my .htaccess code
```
<IfModule mod_rewrite.c... | 2016/08/11 | [
"https://Stackoverflow.com/questions/38895457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5524348/"
] | Since your using Wordpress you can turn on permalinks which takes care of the url friendly urls for you see <https://codex.wordpress.org/Settings_Permalinks_Screen>.
Login to your admin then go to permalinks and set a preferred style. | `example.com/index.php/question/9/how-to-rewite-htaccess` doesn't match your rewrite rule because the rule has a trailing `/`. Change the regex (first) part of your rewrite rule to:
```
^/question/([^/]*)/([^/]*)/?$
```
Adding `?` makes the trailing `/` optional. |
38,895,457 | I have a site in wordpress in which a page is showing questions based on its `ID`.
```
http://example.com/index.php/question/?questionid=9&title='how-to-rewite-htaccess'
```
I am the beginner to php I'm not able to graps other examples found on stackoverflow.com
Here's my .htaccess code
```
<IfModule mod_rewrite.c... | 2016/08/11 | [
"https://Stackoverflow.com/questions/38895457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5524348/"
] | `example.com/index.php/question/9/how-to-rewite-htaccess` doesn't match your rewrite rule because the rule has a trailing `/`. Change the regex (first) part of your rewrite rule to:
```
^/question/([^/]*)/([^/]*)/?$
```
Adding `?` makes the trailing `/` optional. | Once you go to **setting > permalinks** and set the pretty links, WordPress will automatically generate .htaccess based on the setting you choose. Don't forget to save.
More information here <http://www.wpbeginner.com/beginners-guide/why-you-cant-find-htaccess-file-on-your-wordpress-site/> |
73,935,089 | Im working on a designing a graph in flutter using `CustomPaint`.
[](https://i.stack.imgur.com/aLyIi.png)
I have achieved this design using `canvas.drawLine()`.
My question is how to make the sharp edges of line to curved smooth edges?.
My code wit... | 2022/10/03 | [
"https://Stackoverflow.com/questions/73935089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19976446/"
] | This pub package provides a quick way to create a smooth curve - <https://pub.dev/packages/smoothie> | I think the best way is by using `path.relativeQuadraticBezierTo();`
Here is the official documentation : <https://api.flutter.dev/flutter/dart-ui/Path/relativeQuadraticBezierTo.html>
It takes 4 parameters which are offset positions (X, Y) and then draw a curve line between those points. |
23,968,986 | I have added YouTube player in android project. While playing any video I'm getting so many ads after some times.Is there any way to remove it by programming. | 2014/05/31 | [
"https://Stackoverflow.com/questions/23968986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260248/"
] | If you had authorization from the content owners of the videos to upload copies in your own account, and then ensure that your account was set up with monetization turned off, then that would prevent ads from showing during playback. It's up to you to work out that arrangement/permission with the original videos' owner... | No, you cannot remove the ads that play at the beginning of the video . |
27,139,833 | I have problem with Core Text when it's rendered to CALayer the text is blurry. I did check the position to be integral and frame height and width but still text appears blurry. The layout is simple in the IB i have standard UIView, then in the code i will create CALayer, append this layer to UIView layer and will draw... | 2014/11/26 | [
"https://Stackoverflow.com/questions/27139833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1166288/"
] | The clue was printing CALayer object (po 0x7fec22927c40) in the debugger.
CABackingStore buffer had same values as layer bounds [375 853], but based on the scale definition CAlayer should draw twice in the buffer.
Infer was that second draw was skipped. My layer.contentsScale was in the method:
```
drawLayer:(CALay... | There's the problem right there on the first line of your log output:
>
>
> ```
> 2014-11-25 20:18:10.159 DrawRect[15103:15454664]
> viewDidLoad View Position x 187.500000 pos y 333.500000
>
> ```
>
>
You've positioned your layer on a half-pixel. It's impossible for half a pixel to light up, so you're ... |
27,905 | I read [Computational Complexity of interacting electrons
and fundamental limitations of Density Functional Theory](http://arxiv.org/pdf/0712.0483.pdf). In appendix, it is claimed that
>
> In the following, we show that approximating the
> ground state energy using the Hartree-Fock method is
> an NP-complete probl... | 2014/06/22 | [
"https://cs.stackexchange.com/questions/27905",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/19583/"
] | There is plenty of precedent for problems that are NP-hard (in worst-case complexity) but can often be done in practice on many instances that arise in practice (e.g., because their average-case complexity is low, or for other reasons).
NP-hardness relates to the worst-case complexity of a problem. However, worst-case... | taking the wikipedia definition & working from that & taking a physics POV:
>
> In computational physics and chemistry, the Hartree–Fock (HF) method is a method of approximation for the determination of the wave function and the energy of a quantum many-body system in a stationary state.
>
>
>
therefore this prob... |
135,166 | I'm interested in simulating a circuit using a stepped sine wave input. I want to sample a sine wave at regular intervals and have the output constant during each interval, making an output that looks like:

(pardon my silly Excel plot!)
What's the ... | 2014/10/21 | [
"https://electronics.stackexchange.com/questions/135166",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/49251/"
] | I am not sure about Cadenece Orcad but LTSpice will do for you.
LTSpice allows you to use the PWL(piece wise linear) format to plot customized waveforms.
As a suggestion you can use PWL file which is a text file, store your data i.e. "**what voltages at what time**" in the text file. Take a general voltage source on... | Micro-cap has a component called "sample and hold" so, if you feed in a sinewave, the output will be a sampled version of the sinewave. Micro-cap also has the facility to have user-defined signal sources.
Like AKR I cannot give recommendations for OrCAD because I don't use it. |
135,166 | I'm interested in simulating a circuit using a stepped sine wave input. I want to sample a sine wave at regular intervals and have the output constant during each interval, making an output that looks like:

(pardon my silly Excel plot!)
What's the ... | 2014/10/21 | [
"https://electronics.stackexchange.com/questions/135166",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/49251/"
] | LTspice has a '[sample](http://ltwiki.org/?title=Undocumented_LTspice#SampleHold_.28aka_Sample.29)' block which implements a simple sample-and-hold. E.g. the below circuit

gives this waveform:
 format to plot customized waveforms.
As a suggestion you can use PWL file which is a text file, store your data i.e. "**what voltages at what time**" in the text file. Take a general voltage source on... |
135,166 | I'm interested in simulating a circuit using a stepped sine wave input. I want to sample a sine wave at regular intervals and have the output constant during each interval, making an output that looks like:

(pardon my silly Excel plot!)
What's the ... | 2014/10/21 | [
"https://electronics.stackexchange.com/questions/135166",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/49251/"
] | LTspice has a '[sample](http://ltwiki.org/?title=Undocumented_LTspice#SampleHold_.28aka_Sample.29)' block which implements a simple sample-and-hold. E.g. the below circuit

gives this waveform:
.ready(function(){
$("#choose").load(function(event){
$.getJSON('data/colors.json', function(jd) {
$('#choose').html('<option... | 2013/04/23 | [
"https://Stackoverflow.com/questions/16173025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553779/"
] | Try
```
$(function(){
$.getJSON('data.json', function(jd) {
$.each(jd, function(i, v){
$('#choose').append('<option value="' + v.name + '">' + v.name + '</option>');
})
})
});
```
Demo: [Fiddle](http://plnkr.co/edit/z5QQOBPvvcIC4ULs9qsJ?p=preview) | Try this
```
var data = [];
$.getJSON( 'data/colors.json', function( jd ) {
$.each( jd, function( k,v ){
data.push('<option value="' + v.name'">' + v.name + '</option>');
});
$('#choose').append( data.join('') );
});
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.