qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
27,736,178
I have this very simple Python function, but there is one part I am confused about. The function is called bigger and it takes two numbers as inputs and outputs the bigger number. (I could only use if statements, no elses) Here's the code: ``` def bigger(x, y): if x > y: return x return y ``` I woul...
2015/01/02
[ "https://Stackoverflow.com/questions/27736178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4087357/" ]
The `return` statement not only returns a value, but also terminates the current function and returns control to the calling function. So, this function will only return a single value. In my opinion it would be slightly more clear to write this: ``` def bigger(x, y): if x > y: return x else: r...
Python functions only returns one value. You can try, ``` def bigger(x, y): #this is optional: value = None if x > y: value = x else: value = y return value ```
27,736,178
I have this very simple Python function, but there is one part I am confused about. The function is called bigger and it takes two numbers as inputs and outputs the bigger number. (I could only use if statements, no elses) Here's the code: ``` def bigger(x, y): if x > y: return x return y ``` I woul...
2015/01/02
[ "https://Stackoverflow.com/questions/27736178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4087357/" ]
``` def bigger(x, y): if x > y: # when x>y, x will be returned and 'return y' in the last line will not be executed. return x # only if x<y, this line will be executed. return y ```
Try this ``` def bigger(x, y): if x > y: a=(x,y) # or a=[x,y] return a return y ``` This way it will return x and y if x is bigger, but y if y is bigger. I assume this was your question? The reason for this is that return gives back that 1 value, then exits the function. So it would leave the function ...
27,736,178
I have this very simple Python function, but there is one part I am confused about. The function is called bigger and it takes two numbers as inputs and outputs the bigger number. (I could only use if statements, no elses) Here's the code: ``` def bigger(x, y): if x > y: return x return y ``` I woul...
2015/01/02
[ "https://Stackoverflow.com/questions/27736178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4087357/" ]
In a Python function, when a `return` statement is encountered, execution of that function is terminated. Execution context then goes back to the context that called the function. So, even though you see two `return` statements, if that first one is encountered (as a result of x being bigger than y), nothing else in t...
Try this ``` def bigger(x, y): if x > y: a=(x,y) # or a=[x,y] return a return y ``` This way it will return x and y if x is bigger, but y if y is bigger. I assume this was your question? The reason for this is that return gives back that 1 value, then exits the function. So it would leave the function ...
27,736,178
I have this very simple Python function, but there is one part I am confused about. The function is called bigger and it takes two numbers as inputs and outputs the bigger number. (I could only use if statements, no elses) Here's the code: ``` def bigger(x, y): if x > y: return x return y ``` I woul...
2015/01/02
[ "https://Stackoverflow.com/questions/27736178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4087357/" ]
``` def bigger(x, y): if x > y: # when x>y, x will be returned and 'return y' in the last line will not be executed. return x # only if x<y, this line will be executed. return y ```
Python functions can only return one value. It would be possible to return both x and y as a tuple, but the way this function is set up, it will return a single value and then exit the function.
52,366
What "dabei" is for in the "sehen Sie dabei nicht ins Bildlexikon" sentence? And what is its meaning here?
2019/05/24
[ "https://german.stackexchange.com/questions/52366", "https://german.stackexchange.com", "https://german.stackexchange.com/users/38335/" ]
Presumably, there is a previous sentence like > > Lösen Sie die folgende Aufgabe/Lesen Sie den folgenden Text. Sehen Sie **dabei** nicht ins Bildlexikon > > > Dabei refers to the previous sentence. It can be translated as > > Read the following text. **While doing so**, do not look into the visual dictionary. ...
Those *hier*- and *da*-words are backreferencing adverbs made from a preposition. > > Er telefoniert **beim Fahren**. > > > **Er fährt.** Er telefoniert **dabei**. > > > The preposition *bei* can take a nominalized infinitive. It's a description of a continous action happening during the action of the finite ve...
43,178,417
I'm trying to return a vector from a function. My code compiles and I've checked my function and reckon that the error comes from the return part. It compiles fine (using Cygwin) but when running it, I get an Aborted (core dumped) error. Here is my code: ``` #include <iostream> #include <vector> #include <string> usin...
2017/04/03
[ "https://Stackoverflow.com/questions/43178417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7761443/" ]
You should iterate over the `candidates` QuerySet instead of the `lista2` list. Then you can do it like this: ``` {% for candidate in candidates %} <p class="tr"> <a href="{% url 'candidate_detail' candidate.pk %}">{{ candidate }}</a> </p> {% endfor %} ```
Replace `href` to the following: ``` {% load staticfiles %} {% load mathfilters %} <!DOCTYPE html> <html> <head> <title>Lista de candidatos</title> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap...
21,955,598
I want to download and parse the JSON in my Windows Phone project, so I decided to download `newtonsoft.json` library via Nuget in Visual Studios, but I'm receiving the following: ``` PM> Install-Package Newtonsoft.Json Successfully installed 'Newtonsoft.Json 6.0.1'. Successfully uninstalled 'Newtonsoft.Json 6.0.1'. I...
2014/02/22
[ "https://Stackoverflow.com/questions/21955598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2068754/" ]
Download the component (aka DLL) from here: <http://james.newtonking.com/json> **Note:** Make sure to delete any previous Nuget traces of the old Newtonsoft component you had. Just to make sure things are clear before you attempt to do this. * Once downloaded, extract the contents of the compressed file to a folder. ...
You've two options. The second one is a little more brute force. Run VS 2013 in admin mode, then in BUILD, run a Clean, *helps to-- ensure your config manager has the build option set to build and copy everytime. The will force it remove stale dll's to put new ones in* option 1: 1. Uninstall the package from the pac...
21,955,598
I want to download and parse the JSON in my Windows Phone project, so I decided to download `newtonsoft.json` library via Nuget in Visual Studios, but I'm receiving the following: ``` PM> Install-Package Newtonsoft.Json Successfully installed 'Newtonsoft.Json 6.0.1'. Successfully uninstalled 'Newtonsoft.Json 6.0.1'. I...
2014/02/22
[ "https://Stackoverflow.com/questions/21955598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2068754/" ]
Download the component (aka DLL) from here: <http://james.newtonking.com/json> **Note:** Make sure to delete any previous Nuget traces of the old Newtonsoft component you had. Just to make sure things are clear before you attempt to do this. * Once downloaded, extract the contents of the compressed file to a folder. ...
This is most likely caused by the source package being incorrect, please see my answer on this question [Package error question](https://stackoverflow.com/questions/38296006/unable-to-install-newtonsoft-json/44944552#44944552)
234,642
> > “If you can't explain it to a six year old, you don't understand it yourself." - Einstein > > > --- A properly worded question asking for a *generalized summary* of a broad concept, in my opinion, is a valuable question. However, not all users here seem to share this opinion: > > "Why is the sky blue?" >...
2014/06/26
[ "https://meta.stackexchange.com/questions/234642", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/305457/" ]
First off note that different Stack Exchange sites have differing levels of expectation of the people asking and answering the questions. Gaming (for example) may be perfectly content with what some would consider 'basic' questions while Theoretical Computer Science and MathOverflow strive to keep their questions at a ...
I've noticed something about questions like what you propose above, and I'll let folks here vote their opinion of whether they agree. It seems to me, anytime I see a question that requires qualification on how it should be answered just to ensure it get's quality answers, it's not a good question in either the qualifi...
234,642
> > “If you can't explain it to a six year old, you don't understand it yourself." - Einstein > > > --- A properly worded question asking for a *generalized summary* of a broad concept, in my opinion, is a valuable question. However, not all users here seem to share this opinion: > > "Why is the sky blue?" >...
2014/06/26
[ "https://meta.stackexchange.com/questions/234642", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/305457/" ]
As a rule, such questions would be *actively harmful* for Stack Exchange, because content provided in these would be inferior in comparison to similar [Wikipedia](https://meta.stackexchange.com/a/70656/165773) articles. Summaries of broad topics are specialty of Wikipedia, which is focused and optimized on providing t...
I've noticed something about questions like what you propose above, and I'll let folks here vote their opinion of whether they agree. It seems to me, anytime I see a question that requires qualification on how it should be answered just to ensure it get's quality answers, it's not a good question in either the qualifi...
14,070
There is a typical construction that I do not know specially when concerning about movements, in which we use the preposition y instead of the subject?
2017/03/05
[ "https://russian.stackexchange.com/questions/14070", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/8657/" ]
The phrase *у меня есть* means possession = *я имею* (I have). Your sentence contains this phrase in the future tense *у меня будет* (I will have, I am having). The sentence should be: > > После русского языка у меня будет химия (лекция по химии). > > > You can use another verb to describe your action. > > Посл...
The following article explains your subject rather well: <http://masterrussian.com/aa120199a.shtml> Your example, in particular, has a direct English analogy: *I have Chemistry after Russian* sounds quite regular.
14,070
There is a typical construction that I do not know specially when concerning about movements, in which we use the preposition y instead of the subject?
2017/03/05
[ "https://russian.stackexchange.com/questions/14070", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/8657/" ]
The phrase *у меня есть* means possession = *я имею* (I have). Your sentence contains this phrase in the future tense *у меня будет* (I will have, I am having). The sentence should be: > > После русского языка у меня будет химия (лекция по химии). > > > You can use another verb to describe your action. > > Посл...
Russian prepositions can express either motion/tramsition, or state (both evidential and non-evidential). The stumbling block is usually how to distinguish between a motion (or transition) and a state. As prepositions, both ***на*** and ***в*** can be used to express either 'a translative/motional or 'an existential'...
54,757,798
I am trying to give a brightness effect on specific columns on stacked bar chart using Highcharts. I want to develop the effect as the right side "SOLUTION" of below picture. ![](https://i.stack.imgur.com/PzaXF.png) Now when hovering over a series or a column, i.e. Apples-John, it can be seen that the entire bar's b...
2019/02/19
[ "https://Stackoverflow.com/questions/54757798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9363113/" ]
> > If this was removed, would it cause issues when including the header file in multiple source files? > > > No. It might cause issues when including the header file in the same source file more than once. > > or is the preprocessor smart enough to ignore it? > > > No. The preprocessor doesn't know about mo...
How would the preprocessor know that ignoring it is the right thing to do? For example, consider the following header file, "foobar.h": ``` FOO(BAR); ``` And the following C code: ``` int main() { #define FOO printf #define BAR "hello" #include "foobar.h" #undef BAR #define BAR " world\n" #include "foobar.h" } ...
54,757,798
I am trying to give a brightness effect on specific columns on stacked bar chart using Highcharts. I want to develop the effect as the right side "SOLUTION" of below picture. ![](https://i.stack.imgur.com/PzaXF.png) Now when hovering over a series or a column, i.e. Apples-John, it can be seen that the entire bar's b...
2019/02/19
[ "https://Stackoverflow.com/questions/54757798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9363113/" ]
> > If this was removed, would it cause issues when including the header file ... > > > Potentially, yes. Not necessarily. In general, it depends. In particular, it depends on the content of the header and whether the header is included more than once into a single translation unit (TU). Some declarations can be r...
How would the preprocessor know that ignoring it is the right thing to do? For example, consider the following header file, "foobar.h": ``` FOO(BAR); ``` And the following C code: ``` int main() { #define FOO printf #define BAR "hello" #include "foobar.h" #undef BAR #define BAR " world\n" #include "foobar.h" } ...
1,474,055
This is the first time I have attempted such a problem, and have been tackling it all morning. I've been trying to use simultaneous equations to solve for the variables, but it doesn't seem to be working out, so perhaps that's not the way to go... $$\hat{\bf a} = \dfrac{1}{\sqrt{14}}({\bf i}+2{\bf j}+3{\bf k})$$ $$\ha...
2015/10/11
[ "https://math.stackexchange.com/questions/1474055", "https://math.stackexchange.com", "https://math.stackexchange.com/users/279034/" ]
we will first deal with expressing as a linear combination of $\sqrt{14}\hat a, \sqrt 5\hat b,$ and $\sqrt{70}\hat c.$ we need number $x, y, z$ so that $$x(i+2j+3k)+y(2i-j)+z(3i+6j-5k)=5i+3j+2k \tag 1 $$ in matrix form, we have $$\pmatrix{1&2&3&|&5\\2&-1&6&|&3\\3&0&-5&|&2}\to \pmatrix{1&0&0&|&1.21428\\0&1&0&|&1.40...
You're looking for $[r,s,t]$ where $r\hat{\bf a}+s\hat{\bf b}+t\hat{\bf c}=5{\bf i}+3{\bf j}+2{\bf k}$. This means that $\dfrac{r}{\sqrt{14}}+\dfrac{2s}{\sqrt{5}}+\dfrac{3t}{\sqrt{70}}=5$ (the coefficients of ${\bf i}$). Same for the coefficients of ${\bf j}$ and ${\bf k}$. Then it's just a matter of slugging through ...
1,474,055
This is the first time I have attempted such a problem, and have been tackling it all morning. I've been trying to use simultaneous equations to solve for the variables, but it doesn't seem to be working out, so perhaps that's not the way to go... $$\hat{\bf a} = \dfrac{1}{\sqrt{14}}({\bf i}+2{\bf j}+3{\bf k})$$ $$\ha...
2015/10/11
[ "https://math.stackexchange.com/questions/1474055", "https://math.stackexchange.com", "https://math.stackexchange.com/users/279034/" ]
Wow, after all of that, and what I had believed to be a meticulous examination of my work, I rechecked it in the morning after some refreshing sleep, and found a basic arithmetic mistake. Theta should have been (17 x rt(14))/14. Sorry to have wasted anybody's time!
You're looking for $[r,s,t]$ where $r\hat{\bf a}+s\hat{\bf b}+t\hat{\bf c}=5{\bf i}+3{\bf j}+2{\bf k}$. This means that $\dfrac{r}{\sqrt{14}}+\dfrac{2s}{\sqrt{5}}+\dfrac{3t}{\sqrt{70}}=5$ (the coefficients of ${\bf i}$). Same for the coefficients of ${\bf j}$ and ${\bf k}$. Then it's just a matter of slugging through ...
1,474,055
This is the first time I have attempted such a problem, and have been tackling it all morning. I've been trying to use simultaneous equations to solve for the variables, but it doesn't seem to be working out, so perhaps that's not the way to go... $$\hat{\bf a} = \dfrac{1}{\sqrt{14}}({\bf i}+2{\bf j}+3{\bf k})$$ $$\ha...
2015/10/11
[ "https://math.stackexchange.com/questions/1474055", "https://math.stackexchange.com", "https://math.stackexchange.com/users/279034/" ]
we will first deal with expressing as a linear combination of $\sqrt{14}\hat a, \sqrt 5\hat b,$ and $\sqrt{70}\hat c.$ we need number $x, y, z$ so that $$x(i+2j+3k)+y(2i-j)+z(3i+6j-5k)=5i+3j+2k \tag 1 $$ in matrix form, we have $$\pmatrix{1&2&3&|&5\\2&-1&6&|&3\\3&0&-5&|&2}\to \pmatrix{1&0&0&|&1.21428\\0&1&0&|&1.40...
Wow, after all of that, and what I had believed to be a meticulous examination of my work, I rechecked it in the morning after some refreshing sleep, and found a basic arithmetic mistake. Theta should have been (17 x rt(14))/14. Sorry to have wasted anybody's time!
1,474,055
This is the first time I have attempted such a problem, and have been tackling it all morning. I've been trying to use simultaneous equations to solve for the variables, but it doesn't seem to be working out, so perhaps that's not the way to go... $$\hat{\bf a} = \dfrac{1}{\sqrt{14}}({\bf i}+2{\bf j}+3{\bf k})$$ $$\ha...
2015/10/11
[ "https://math.stackexchange.com/questions/1474055", "https://math.stackexchange.com", "https://math.stackexchange.com/users/279034/" ]
we will first deal with expressing as a linear combination of $\sqrt{14}\hat a, \sqrt 5\hat b,$ and $\sqrt{70}\hat c.$ we need number $x, y, z$ so that $$x(i+2j+3k)+y(2i-j)+z(3i+6j-5k)=5i+3j+2k \tag 1 $$ in matrix form, we have $$\pmatrix{1&2&3&|&5\\2&-1&6&|&3\\3&0&-5&|&2}\to \pmatrix{1&0&0&|&1.21428\\0&1&0&|&1.40...
so you are looking for [$\alpha, \beta, \gamma$] where $\vec b = \alpha \hat a + \beta \hat b + \gamma \hat c =5\hat i+3\hat j+2\hat k$. By rules of vectors, if you project $\vec b$ onto $\hat i$, you get the value of that unit vector only, which would be 5 in this case. mathmatically it looks like this $\vec d ⋅\ha...
1,474,055
This is the first time I have attempted such a problem, and have been tackling it all morning. I've been trying to use simultaneous equations to solve for the variables, but it doesn't seem to be working out, so perhaps that's not the way to go... $$\hat{\bf a} = \dfrac{1}{\sqrt{14}}({\bf i}+2{\bf j}+3{\bf k})$$ $$\ha...
2015/10/11
[ "https://math.stackexchange.com/questions/1474055", "https://math.stackexchange.com", "https://math.stackexchange.com/users/279034/" ]
Wow, after all of that, and what I had believed to be a meticulous examination of my work, I rechecked it in the morning after some refreshing sleep, and found a basic arithmetic mistake. Theta should have been (17 x rt(14))/14. Sorry to have wasted anybody's time!
so you are looking for [$\alpha, \beta, \gamma$] where $\vec b = \alpha \hat a + \beta \hat b + \gamma \hat c =5\hat i+3\hat j+2\hat k$. By rules of vectors, if you project $\vec b$ onto $\hat i$, you get the value of that unit vector only, which would be 5 in this case. mathmatically it looks like this $\vec d ⋅\ha...
16,790,330
I have a service class that is required to create a pdf, which needs the ControllerContext injected, in order to render a the `html => pdf`. This service is called through a middle tier, that has no reference to the web/mvc project. which is fine, since ninject does all the required injection of services etc. This is w...
2013/05/28
[ "https://Stackoverflow.com/questions/16790330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/465509/" ]
OK. I've come up with a solution that I'm happy with. Here is how I'm retrieving the ControllerContext: ``` public class PdfCreatorService { [Inject] public ControllerContextProvider contextProvider { get; set; } [Inject] public PdfController pdfController { get; set; } public override byte[] ...
You could create a Custom Controller factory. ``` public class MyControllerFactory : DefaultControllerFactory { public override IController CreateController(RequestContext requestContext, string controllerName) { var controller = base.CreateController(requestContext, controllerName); HttpConte...
25,261,013
I would like to show a pdf from a website in my windows rt app (for Desktops with windows 8). How can I handle this? If I add the file manually to the asset I can display it. But how can I do this with files where are not located on my asset Folder? * Can I copy the file to the StorageFolder? * Or can I directly open...
2014/08/12
[ "https://Stackoverflow.com/questions/25261013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1966464/" ]
JavaScript objects don't have ordering. You should use an array of objects instead. ``` var arr = [ { id: 'element1' }, { id: 'element2' }, { id: 'element3' } ] ``` You could then reorder it something like: ``` var first = arr.splice(0, 1); arr.push(first); ``` Maybe you could then grab specific elements ba...
Objects in JavaScript are essentially hash maps. Their properties don't have any ordering, per se. They are simply name value pairs. You are probably confusing objects with arrays, in which case ordering does indeed matter.
25,261,013
I would like to show a pdf from a website in my windows rt app (for Desktops with windows 8). How can I handle this? If I add the file manually to the asset I can display it. But how can I do this with files where are not located on my asset Folder? * Can I copy the file to the StorageFolder? * Or can I directly open...
2014/08/12
[ "https://Stackoverflow.com/questions/25261013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1966464/" ]
Here's my code for doing that logic. Thanks! ``` function _moveElementObject(object, from, to) { var newObjects = []; var newObject = {}; var oldObject = {}; var firstObject = {}; var lastObject = {}; var toMoveKey = ""; var toMoveValue; oldObject = object; var objLength = _countPro...
Objects in JavaScript are essentially hash maps. Their properties don't have any ordering, per se. They are simply name value pairs. You are probably confusing objects with arrays, in which case ordering does indeed matter.
25,261,013
I would like to show a pdf from a website in my windows rt app (for Desktops with windows 8). How can I handle this? If I add the file manually to the asset I can display it. But how can I do this with files where are not located on my asset Folder? * Can I copy the file to the StorageFolder? * Or can I directly open...
2014/08/12
[ "https://Stackoverflow.com/questions/25261013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1966464/" ]
JavaScript objects don't have ordering. You should use an array of objects instead. ``` var arr = [ { id: 'element1' }, { id: 'element2' }, { id: 'element3' } ] ``` You could then reorder it something like: ``` var first = arr.splice(0, 1); arr.push(first); ``` Maybe you could then grab specific elements ba...
Here's my code for doing that logic. Thanks! ``` function _moveElementObject(object, from, to) { var newObjects = []; var newObject = {}; var oldObject = {}; var firstObject = {}; var lastObject = {}; var toMoveKey = ""; var toMoveValue; oldObject = object; var objLength = _countPro...
896,595
Like there is a folder say XYZ , whcih contain files with diffrent diffrent format let say .txt file, excel file, .py file etc. i want to display in the output all file name using Python programming
2009/05/22
[ "https://Stackoverflow.com/questions/896595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` import glob glob.glob('XYZ/*') ``` [See the documentation for more](http://docs.python.org/library/glob.html)
``` import os XYZ = '.' for item in enumerate(sorted(os.listdir(XYZ))): print item ```
896,595
Like there is a folder say XYZ , whcih contain files with diffrent diffrent format let say .txt file, excel file, .py file etc. i want to display in the output all file name using Python programming
2009/05/22
[ "https://Stackoverflow.com/questions/896595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Here is an example that might also help show some of the handy basics of python -- dicts `{}` , lists `[]` , little string techniques (`split`), a module like `os`, etc.: ``` bvm@bvm:~/example$ ls deal.xls five.xls france.py guido.py make.py thing.mp3 work2.doc example.py four.xls fun.mp3 letter.doc...
``` import os XYZ = '.' for item in enumerate(sorted(os.listdir(XYZ))): print item ```
702,647
![enter image description here](https://i.stack.imgur.com/wVR1Y.png) can sombody explain the above calculation in the red circle marked with "why?"? I am studying MLE with Bernoulli Distribution, and in the middle of a video clip, the lecturer says $ 1\over{n} \sum\_{i=1}^{n}x\_i$ becomes $ n\bar x $. But I can't see a...
2014/03/07
[ "https://math.stackexchange.com/questions/702647", "https://math.stackexchange.com", "https://math.stackexchange.com/users/122358/" ]
Equations shown involve straightforward application of rules of logarithms. In the red circle, all he is saying is that the sum\_i(x\_i) -- showing at the bottom in the product log(p)\*sum\_i(x\_i) -- can alternatively be written as N\*average(x\_i). That's it.
Logarithms are not needed here. I think it's pretty clear $$\frac{1}{N}\sum^N\_{i=1}x\_i = \frac{x\_1 + x\_2 + ... + x\_N}{N} = \overline{x}$$ by the definition of what a mean is ($\overline{x}$ represents the mean of $x$).
216,987
Is it possible to rotate marker symbols (e.g. a triangle) in QGIS individually with an attribute field like in ArcGIS? **Edit:** I would like to rotate each marker symbol individually in category A with an attribute field X, where the angle is defined. This is how it is done in ArcGIS: "To rotate marker symbols indiv...
2016/11/08
[ "https://gis.stackexchange.com/questions/216987", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/71527/" ]
Use **Data defined override**. Go to *Layer Properties* and in *Simple marker* style open the Data defined override menu with icon next to the *Angle* value. Choose `Field Type -> "your column"`. Data defined override button: [![enter image description here](https://i.stack.imgur.com/3L0S2.png)](https://i.stack.imgur....
If u want rotate symbol for a specific Category go style -> change symbol method to Rule-Based ->add new rule like "column" = 'something' and chose rotation angle Edit: solution to your problem: click icon next to rotation input field -> click edit (under "Variable") -> type "column" Where "column" is the name of col...
41,148,068
This is likely beyond the scope of the argparse module, but I'll try to describe my issue using an example. I have some fruits and some files attributed to each fruit. Specifically Apple, Banana, and Orange. Apple has 10 files associated with it, Banana has 7, and Oranges has 9. I can hardcode `-a`, `-b`, `-o` each t...
2016/12/14
[ "https://Stackoverflow.com/questions/41148068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283949/" ]
I would create an argument for each of the fruits, but I would do it in the [DRYest](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) way I could: ``` import argparse parser = argparse.ArgumentParser() parser.add_argument("-i", "--insecticide") for fruit, nargs in ( ('Apple', 10), ('Banana', 7), ('...
You can use `nargs=7` for example, and it will only accept exactly 7 (or return `None` if the flag is not entered) For example, add `parser.add_argument('-x', nargs=7, help='testing')` to your argument list and `print args.x` Say your file was `a.py` > > $ python a.py > > > > None > > > $ python a.py -x 1 > ...
18,905,250
I have such piece of code: ``` private void button1_Click(object sender, EventArgs e) { // Do something... } private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.A) { // Call button1_Click. } } ``` How do I manage to call the Click eve...
2013/09/19
[ "https://Stackoverflow.com/questions/18905250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1636566/" ]
Events are meant to be triggered not called. So you can trigger the event in your `Form1_KeyDown` event by performing the button click. I mean ``` private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.A) { button1.PerformClick(); } } ```
Since the button click event handler is just a method, you could just do: ``` private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.A) { button1_Click(this, e); } } ``` However, it's often a better idea to move the *logic* into a separate method, and call it from both loca...
2,232,492
One of the major gripes voiced by the Alt.Net community against the Microsoft Entity Framework is that it forces you to use a Base Persistable Object for everything being stored in the database. I have two questions related to this: 1. Is it acceptable to have a "Root Persistent Class" as the base for the domain objec...
2010/02/09
[ "https://Stackoverflow.com/questions/2232492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19112/" ]
My feeling is that it's ok presuming the context is such that it 1. stays out of the way 2. doesn't add features that aren't used outside of the scope of the entity 3. doesn't tie you to any particular ORM (sort of in keeping with #2) So if the base class is used to describe, for instance, an ID and the meaning of Eq...
Unless you are using Data Transfer Objects (DTO) for persistence and using that model, having a root object for persist-able classes in my experience greatly decreases code repetition and increases developer productivity. And even when using a DTO, I think it could be helpful though I rarely use DTOs so can't speak fro...
2,232,492
One of the major gripes voiced by the Alt.Net community against the Microsoft Entity Framework is that it forces you to use a Base Persistable Object for everything being stored in the database. I have two questions related to this: 1. Is it acceptable to have a "Root Persistent Class" as the base for the domain objec...
2010/02/09
[ "https://Stackoverflow.com/questions/2232492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19112/" ]
For applications with a low-to-moderate level of complexity, using a base persistable object can really increase development productivity. However, doing so constrains your code and limits design options as your application gets more complex. Obviously, you use up your base class at the start, which is significant in ...
Unless you are using Data Transfer Objects (DTO) for persistence and using that model, having a root object for persist-able classes in my experience greatly decreases code repetition and increases developer productivity. And even when using a DTO, I think it could be helpful though I rarely use DTOs so can't speak fro...
2,232,492
One of the major gripes voiced by the Alt.Net community against the Microsoft Entity Framework is that it forces you to use a Base Persistable Object for everything being stored in the database. I have two questions related to this: 1. Is it acceptable to have a "Root Persistent Class" as the base for the domain objec...
2010/02/09
[ "https://Stackoverflow.com/questions/2232492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19112/" ]
My feeling is that it's ok presuming the context is such that it 1. stays out of the way 2. doesn't add features that aren't used outside of the scope of the entity 3. doesn't tie you to any particular ORM (sort of in keeping with #2) So if the base class is used to describe, for instance, an ID and the meaning of Eq...
For applications with a low-to-moderate level of complexity, using a base persistable object can really increase development productivity. However, doing so constrains your code and limits design options as your application gets more complex. Obviously, you use up your base class at the start, which is significant in ...
365,804
I am on Windows using this `MikTex`version: ``` pdflatex --version MiKTeX-pdfTeX 2.9.6211 (1.40.17) (MiKTeX 2.9.6210) Copyright (C) 1982 D. E. Knuth, (C) 1996-2016 Han The Thanh TeX is a trademark of the American Mathematical Society. using bzip2 version 1.0.6, 6-Sept-2010 compiled with curl version 7.52.1; using libc...
2017/04/20
[ "https://tex.stackexchange.com/questions/365804", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/119062/" ]
Although the question already has an accepted answer, I feel the urge to provide a solution which does not depend on luck with the update, for this did not work for me. I had the same problem with German hyphenation and was eventually able to solve it. Maybe this helps future users to solve their problem. **Setup** ...
Thanks [@Bernard](https://tex.stackexchange.com/users/38908) I updated my `MikTex` installation now I am not noticing this warning anymore: ``` pdflatex --version MiKTeX-pdfTeX (MiKTeX 2.9.6300) using bzip2 version 1.0.6, 6-Sept-2010 compiled with curl version 7.53.1; using libcurl/7.53.1 WinSSL compiled with expat ...
365,804
I am on Windows using this `MikTex`version: ``` pdflatex --version MiKTeX-pdfTeX 2.9.6211 (1.40.17) (MiKTeX 2.9.6210) Copyright (C) 1982 D. E. Knuth, (C) 1996-2016 Han The Thanh TeX is a trademark of the American Mathematical Society. using bzip2 version 1.0.6, 6-Sept-2010 compiled with curl version 7.52.1; using libc...
2017/04/20
[ "https://tex.stackexchange.com/questions/365804", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/119062/" ]
Although the question already has an accepted answer, I feel the urge to provide a solution which does not depend on luck with the update, for this did not work for me. I had the same problem with German hyphenation and was eventually able to solve it. Maybe this helps future users to solve their problem. **Setup** ...
This fixed it for me: ``` initexmf --mklangs initexmf -u ``` Source: <https://github.com/MiKTeX/miktex/issues/136#issuecomment-392561637>
365,804
I am on Windows using this `MikTex`version: ``` pdflatex --version MiKTeX-pdfTeX 2.9.6211 (1.40.17) (MiKTeX 2.9.6210) Copyright (C) 1982 D. E. Knuth, (C) 1996-2016 Han The Thanh TeX is a trademark of the American Mathematical Society. using bzip2 version 1.0.6, 6-Sept-2010 compiled with curl version 7.52.1; using libc...
2017/04/20
[ "https://tex.stackexchange.com/questions/365804", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/119062/" ]
Although the question already has an accepted answer, I feel the urge to provide a solution which does not depend on luck with the update, for this did not work for me. I had the same problem with German hyphenation and was eventually able to solve it. Maybe this helps future users to solve their problem. **Setup** ...
I had this problem with TexLive and solved it by installing the approriate package ``` sudo dnf install texlive-hyphen-italian ```
14,188,834
I've been looking for a while, and can't see to find a definitive documentation source. When I search for these, the first Google results are to StackOverflow. Are there any more middleware functions similar to this?
2013/01/07
[ "https://Stackoverflow.com/questions/14188834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1925955/" ]
While not explicitly documented anywhere easily found, you can see where the the `isAuthenticated` and `isUnauthenticated` flags are set in the Passport code at <https://github.com/jaredhanson/passport/blob/a892b9dc54dce34b7170ad5d73d8ccfba87f4fcf/lib/passport/http/request.js#L74>. `ensureAuthenticated` is not offici...
the reason it return false is mostly because its declared below the route definition. i am doing it in other file so i use it like this ``` //auth check function auth(req,res,next){ if(req.isAuthenticated()){ next(); } else{ res.redirect("/fail");} } //routes require("./routes/myroute")(...
37,071,422
In Xamarin Forms XAML, I want to hide part of ViewCell if it is not selected. For example the second label with text="Show only if selected". How to do that using MVVM without code behind? `<ListView x:Name="listView"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout> <Label Text="Always Show it"/> ...
2016/05/06
[ "https://Stackoverflow.com/questions/37071422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2838067/" ]
Here is one possible MVVM approach, which involve no code-behind. **ViewModels** Add a property\* in your `ListView` item viewmodel to store information that indicate whether the item is currently selected : ```cs public class ItemViewModel : INotifyPropertyChanged { ...... private bool _isSelected; pub...
Each item in your listview needs to have a "IsSelected" bindable property. Then on your listviews ItemSelected event get the item and set is IsSelected to true. Just make sure you keep a reference the the currently selected item so that you can set the IsSelected to false on it one a new selected item is pressed. It sh...
14,547,728
**UPDATED**: I understood I should not use a `DbSet` so I changed the implementation to an ICollection as suggested by Erenga Please consider the following classes: ``` [Table("Tenant")] public class Tenant : IEntity { public int Id { get; set; } public string Name { get; set; } [Key] public string Gu...
2013/01/27
[ "https://Stackoverflow.com/questions/14547728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1470327/" ]
``` var tenant = new Tenant { Name = "localhost", Guid = Guid.NewGuid().ToString(), Users = new List<User> { user } }; ```
I think you were expecting something like this (not threadsafe): ``` [Table("Tenant")] public class Tenant : IEntity { private DbSet<User> _users; public int Id { get; set; } public string Name { get; set; } [Key] public string Guid { get; set; } public virtual ICollection<User> Users { ...
14,547,728
**UPDATED**: I understood I should not use a `DbSet` so I changed the implementation to an ICollection as suggested by Erenga Please consider the following classes: ``` [Table("Tenant")] public class Tenant : IEntity { public int Id { get; set; } public string Name { get; set; } [Key] public string Gu...
2013/01/27
[ "https://Stackoverflow.com/questions/14547728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1470327/" ]
There are 2 problems I see here. 1. As @SimonWhitehead mentioned, reference types are initialized as null by default. Lazy loading works only on entities created by EF. These are actually sub classes of your class that contain addtional logic to lazy load. 2. `DbSet` is not a collection type that is supported on entit...
``` var tenant = new Tenant { Name = "localhost", Guid = Guid.NewGuid().ToString(), Users = new List<User> { user } }; ```
14,547,728
**UPDATED**: I understood I should not use a `DbSet` so I changed the implementation to an ICollection as suggested by Erenga Please consider the following classes: ``` [Table("Tenant")] public class Tenant : IEntity { public int Id { get; set; } public string Name { get; set; } [Key] public string Gu...
2013/01/27
[ "https://Stackoverflow.com/questions/14547728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1470327/" ]
There are 2 problems I see here. 1. As @SimonWhitehead mentioned, reference types are initialized as null by default. Lazy loading works only on entities created by EF. These are actually sub classes of your class that contain addtional logic to lazy load. 2. `DbSet` is not a collection type that is supported on entit...
I think you were expecting something like this (not threadsafe): ``` [Table("Tenant")] public class Tenant : IEntity { private DbSet<User> _users; public int Id { get; set; } public string Name { get; set; } [Key] public string Guid { get; set; } public virtual ICollection<User> Users { ...
27,166,620
I want to clean the code like this: Before: ``` .title { text-align:right; width:100px; } ``` To ``` .title { text-align:right; width:100px; } ``` Is there a website to clean the code?
2014/11/27
[ "https://Stackoverflow.com/questions/27166620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4094044/" ]
What you're looking for is a **css minifier**. ***Minification: Definition*** *Minification (also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code without changing its functionality. These unnecessary cha...
Both versions are clean code. The second just has the values on one line. If you want to speed up your css load times, use a minify tool such as <http://cssminifier.com/>
27,166,620
I want to clean the code like this: Before: ``` .title { text-align:right; width:100px; } ``` To ``` .title { text-align:right; width:100px; } ``` Is there a website to clean the code?
2014/11/27
[ "https://Stackoverflow.com/questions/27166620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4094044/" ]
What you're looking for is a **css minifier**. ***Minification: Definition*** *Minification (also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code without changing its functionality. These unnecessary cha...
<http://www.lonniebest.com/FormatCSS/> This site is best that i have used. This will provide you much more option that when do u have to use space, new line etc. Just visit it you will get what you need.
27,166,620
I want to clean the code like this: Before: ``` .title { text-align:right; width:100px; } ``` To ``` .title { text-align:right; width:100px; } ``` Is there a website to clean the code?
2014/11/27
[ "https://Stackoverflow.com/questions/27166620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4094044/" ]
What you're looking for is a **css minifier**. ***Minification: Definition*** *Minification (also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code without changing its functionality. These unnecessary cha...
I'm using this site for formatting purposes on my CSS code: <http://www.cssportal.com/format-css/index.php>
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
Loading Scripts and Styles Dynamically Per Page Using a Shortcode ----------------------------------------------------------------- ### Advantages * **Does not search through all the posts everytime the shortcode is called.** * Able to add styles as well as scripts dynamically only when shortcode is on the page. * Do...
You can just use this code to check if the shortcode is implemented in page content or in sidebar widgets. ``` <?php if ( shortcode_exists( 'gallery' ) ) { // The [gallery] short code exists. } ?> ```
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
I read a solution in here: <http://scribu.net/wordpress/conditional-script-loading-revisited.html> Basically if using wordpress 3.3 you can enqueue your scripts in your short code function. ``` function my_shortcode($atts){ wp_enqueue_script( 'my-script', plugins_url( 'plugin_name/js/script.js' ), array('jquery'),...
**Load Scripts and Styles if Post/Page has Short Code** The best solution is to load the files into the page header if, and only if, the current post or page has the short code inside its content. And that’s exactly what the following function does: ``` function flip_register_frontend_assets() { ``` //register you...
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
to answer my own question... I had it write the first time. You have to search each page to check that your shortcode is being used. This has to be done when page data is loaded and before page is displayed. To me it is complete overkill on the system, but unfortunately it is the way it is. I got this information from:...
Just read this tutorial over here: <http://scribu.net/wordpress/optimal-script-loading.html> Seems to be the best way. ``` add_action('init', 'register_my_script'); add_action('wp_footer', 'print_my_script'); function register_my_script() { wp_register_script('my-script', plugins_url('my-script.js', __FILE__), a...
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
to answer my own question... I had it write the first time. You have to search each page to check that your shortcode is being used. This has to be done when page data is loaded and before page is displayed. To me it is complete overkill on the system, but unfortunately it is the way it is. I got this information from:...
You can just use this code to check if the shortcode is implemented in page content or in sidebar widgets. ``` <?php if ( shortcode_exists( 'gallery' ) ) { // The [gallery] short code exists. } ?> ```
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
Just read this tutorial over here: <http://scribu.net/wordpress/optimal-script-loading.html> Seems to be the best way. ``` add_action('init', 'register_my_script'); add_action('wp_footer', 'print_my_script'); function register_my_script() { wp_register_script('my-script', plugins_url('my-script.js', __FILE__), a...
BraedenP is right, I'm pretty sure there is no way to detect shortcode usage at the execution time of wp\_enqueue\_scripts / when the stylesheets load. Is there any reason you must do this in 8 files? One would just be more efficient, then it may not be a problem to load it on every page. You could consider a PHP sty...
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
I read a solution in here: <http://scribu.net/wordpress/conditional-script-loading-revisited.html> Basically if using wordpress 3.3 you can enqueue your scripts in your short code function. ``` function my_shortcode($atts){ wp_enqueue_script( 'my-script', plugins_url( 'plugin_name/js/script.js' ), array('jquery'),...
Just read this tutorial over here: <http://scribu.net/wordpress/optimal-script-loading.html> Seems to be the best way. ``` add_action('init', 'register_my_script'); add_action('wp_footer', 'print_my_script'); function register_my_script() { wp_register_script('my-script', plugins_url('my-script.js', __FILE__), a...
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
**Load Scripts and Styles if Post/Page has Short Code** The best solution is to load the files into the page header if, and only if, the current post or page has the short code inside its content. And that’s exactly what the following function does: ``` function flip_register_frontend_assets() { ``` //register you...
BraedenP is right, I'm pretty sure there is no way to detect shortcode usage at the execution time of wp\_enqueue\_scripts / when the stylesheets load. Is there any reason you must do this in 8 files? One would just be more efficient, then it may not be a problem to load it on every page. You could consider a PHP sty...
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
I read a solution in here: <http://scribu.net/wordpress/conditional-script-loading-revisited.html> Basically if using wordpress 3.3 you can enqueue your scripts in your short code function. ``` function my_shortcode($atts){ wp_enqueue_script( 'my-script', plugins_url( 'plugin_name/js/script.js' ), array('jquery'),...
You can just use this code to check if the shortcode is implemented in page content or in sidebar widgets. ``` <?php if ( shortcode_exists( 'gallery' ) ) { // The [gallery] short code exists. } ?> ```
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
to answer my own question... I had it write the first time. You have to search each page to check that your shortcode is being used. This has to be done when page data is loaded and before page is displayed. To me it is complete overkill on the system, but unfortunately it is the way it is. I got this information from:...
I use WordPress Version 5.4 with OOP style of code i dont know if this affect why none of the above solutions didn't work for me so i come up with this solution: ``` public function enqueue_scripts() { global $post; //error_log( print_r( $post, true ) ); //error_log( print_r( $post->post_content, true ) ); //erro...
6,235,338
have an interesting conundrum. I need to load about 8 javascript files and the same number of styles for my plugin. These are only needed where ever my shortcode is ran. I've tried to load them with print\_styles and print\_scripts but they aren't rendering properly, plus to do so breaks xhtml validation. So at the mo...
2011/06/04
[ "https://Stackoverflow.com/questions/6235338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288644/" ]
to answer my own question... I had it write the first time. You have to search each page to check that your shortcode is being used. This has to be done when page data is loaded and before page is displayed. To me it is complete overkill on the system, but unfortunately it is the way it is. I got this information from:...
How many pages are these scripts going to be loaded on? Would it be feasible to maintain an array of pages, and only load the scripts/stylesheets when the current page is in the array? Otherwise, without scanning the code there is no way to do this, as WP doesn't even know the shortcode exists until well into the page...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
If you want to use jQuery, then do it like this ``` $("select.fruits").val("Grapes"); ``` Javascript ``` var element = document.getElementsByClassName('fruits')[0]; element.value = valueToSelect; ```
1. You can use the selector `:nth-child()` index starts at 1 2. You can use method `.eq()` index starts at 0 ```js $(".fruits").find('option').eq(0).css('color', 'blue')//index starts at 0 so first option will be blue $(".fruits").find('option:nth-child(2)').css('color', 'red');//index starts at 1 so second option wi...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
If you want to use jQuery, then do it like this ``` $("select.fruits").val("Grapes"); ``` Javascript ``` var element = document.getElementsByClassName('fruits')[0]; element.value = valueToSelect; ```
For your HTML Dropdown ``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` > > Using JS You can use **below code** to get desired result > > > ``` document.getElementsByClas...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
If you want to use jQuery, then do it like this ``` $("select.fruits").val("Grapes"); ``` Javascript ``` var element = document.getElementsByClassName('fruits')[0]; element.value = valueToSelect; ```
HTML Code: ``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">admin</option> <option value="Kiwi">Kiwi</option> </select> ``` javascript: ``` $('.fruits option:eq(2)').attr('selected', 'selected'); ``` eq(nth), you can pass index which opt...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
If you want to use jQuery, then do it like this ``` $("select.fruits").val("Grapes"); ``` Javascript ``` var element = document.getElementsByClassName('fruits')[0]; element.value = valueToSelect; ```
You can use the selectedIndex property: ```js $('select.fruits').prop('selectedIndex', 2); ``` ```html <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <select class="fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">G...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
For your HTML Dropdown ``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` > > Using JS You can use **below code** to get desired result > > > ``` document.getElementsByClas...
1. You can use the selector `:nth-child()` index starts at 1 2. You can use method `.eq()` index starts at 0 ```js $(".fruits").find('option').eq(0).css('color', 'blue')//index starts at 0 so first option will be blue $(".fruits").find('option:nth-child(2)').css('color', 'red');//index starts at 1 so second option wi...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
HTML Code: ``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">admin</option> <option value="Kiwi">Kiwi</option> </select> ``` javascript: ``` $('.fruits option:eq(2)').attr('selected', 'selected'); ``` eq(nth), you can pass index which opt...
1. You can use the selector `:nth-child()` index starts at 1 2. You can use method `.eq()` index starts at 0 ```js $(".fruits").find('option').eq(0).css('color', 'blue')//index starts at 0 so first option will be blue $(".fruits").find('option:nth-child(2)').css('color', 'red');//index starts at 1 so second option wi...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
For your HTML Dropdown ``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` > > Using JS You can use **below code** to get desired result > > > ``` document.getElementsByClas...
You can use the selectedIndex property: ```js $('select.fruits').prop('selectedIndex', 2); ``` ```html <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <select class="fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">G...
48,416,371
``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">Grapes</option> <option value="Kiwi">Kiwi</option> </select> ``` it by default shows orange in the box but I want Grapes in a box. Please help Thanks
2018/01/24
[ "https://Stackoverflow.com/questions/48416371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6511917/" ]
HTML Code: ``` <select class=fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">admin</option> <option value="Kiwi">Kiwi</option> </select> ``` javascript: ``` $('.fruits option:eq(2)').attr('selected', 'selected'); ``` eq(nth), you can pass index which opt...
You can use the selectedIndex property: ```js $('select.fruits').prop('selectedIndex', 2); ``` ```html <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <select class="fruits"> <option value="Orange">Orange</option> <option value="Apple">Apple</option> <option value="Grapes">G...
272,844
I am clicking on the link define in the anchor tag and fetching the url. I want to pass this url in url\_to\_postid($\_POST['url']) which returns me ID. What I have done till far now is everything working except the ajax call on admin-ajax to pass url to fetch ID Step 1 : Created a widget in widget() function Step 2...
2017/07/10
[ "https://wordpress.stackexchange.com/questions/272844", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/123508/" ]
the another way to get the `post_id` by clicking on the `link` is to add a `data-attribute` to the link. e.g; `data-post-id="'.get_the_ID().'"` your html code should look like ``` <a href="#link" data-post-id="47">Link</a> ``` then in your js code above the ajax call ``` var post_id = jQuery(this).attr('data-post-...
Your `action` in JQuery and and hook action is not matching. It should be: ``` add_action('wp_ajax_get_prev_ajax_handler', 'get_prev_ajax_handler'); add_action( 'wp_ajax_nopriv_get_prev_ajax_handler', 'get_prev_ajax_handler' ); ``` Also get `get_prev_ajax_handler` function outside `Reco_Person` class.
49,755,930
I'm trying to detect from my mainActivity wheter the user does a normal click or a long press because depend of it I need to do one thing or another, and I have the object of my SQLite on my MainActivity and not in my Adapter, I do not know if it's better to detect it on the Adapter or in MainActivity. My adapter is a...
2018/04/10
[ "https://Stackoverflow.com/questions/49755930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4329781/" ]
You might want to use an interface for that purpose, like such: **Add this to your Custom Adapter:** ``` public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private ItemClickListener mClickListener; public void setClickListener(ItemClickListener itemClickListener) { this.mCli...
Follow the Android guide about input Events [here](https://developer.android.com/guide/topics/ui/ui-events.html). TLDR; You should use [OnClickListener](https://developer.android.com/reference/android/view/View.OnClickListener.html) and [OnLongClickListener](https://developer.android.com/reference/android/view/View.O...
49,755,930
I'm trying to detect from my mainActivity wheter the user does a normal click or a long press because depend of it I need to do one thing or another, and I have the object of my SQLite on my MainActivity and not in my Adapter, I do not know if it's better to detect it on the Adapter or in MainActivity. My adapter is a...
2018/04/10
[ "https://Stackoverflow.com/questions/49755930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4329781/" ]
You might want to use an interface for that purpose, like such: **Add this to your Custom Adapter:** ``` public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private ItemClickListener mClickListener; public void setClickListener(ItemClickListener itemClickListener) { this.mCli...
You have to use **Adapter** for this purpose, additionally you have to use **GestureDetector** for long press, **AlertDialog** for confirmation message and handle requisite **sqllite** accordingly.
39,164
[This post on Reddit](https://www.reddit.com/r/ChineseLanguage/comments/gijs7r/can_anyone_help_me_do_this_task_theres_one/) gives eleven 把 sentences **containing grammar errors** ([original image](https://i.redd.it/vcntj09x9ey41.jpg)). It looks like a worthwhile exercise. (A native Chinese speaker /u/Lvguichen gave cor...
2020/05/13
[ "https://chinese.stackexchange.com/questions/39164", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8099/" ]
> > *(11) 别当我作傻子了。 --> 别把我当傻子了* > > > another way to fix it is use "当是" instead of "当作" e.g. 别当我是傻子了 > > > [当][我][是][傻子] is [v] + [n] + [v] + [n] > > > [当(我)作][傻子] is [verb + (n) + verb complement] + [n] (*we don't insert noun between verb and verb complement*) > > > ~ > > *(8) 顾客把一些水果[放]在购物篮里[了] --> 顾客把一些...
Regarding the 8th one [顾客把一些水果放在购物篮里。] I think the teorical "mistake" that they want to point out here is the use of "一些", as Chinese lengage manuals usually stress that the use of "把" is only for a "definite object" (which means specific object that both the speaker and the listener know what they are refering to), an...
39,164
[This post on Reddit](https://www.reddit.com/r/ChineseLanguage/comments/gijs7r/can_anyone_help_me_do_this_task_theres_one/) gives eleven 把 sentences **containing grammar errors** ([original image](https://i.redd.it/vcntj09x9ey41.jpg)). It looks like a worthwhile exercise. (A native Chinese speaker /u/Lvguichen gave cor...
2020/05/13
[ "https://chinese.stackexchange.com/questions/39164", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8099/" ]
“把”字句语法: 施事-把-受事-动作-补语 注意: 1、动作不能没有补语(2)(3)(7) 2、不及物动词、系动词、趋向动词、表感受的动词不能作为“把”字句的动作 (10) 3、否定词、能愿词和时间词提到“把”之前(1)(4)(5) 4、“把”字句不能应用可能补语(9) 我一天以内把工作做得完->我一天以内能把工作做完 补充: 5、“把”的宾语可以确指、泛指,但不能不定指 把一本书拿过来好吗?-> 把那本书拿过来好吗? 6、“把”字句的结果补语、状态补语指向的应是宾语而非主语 他把故事听高兴了->他听故事听高兴了 另:什么时候非用“把”字句不可(6)(11) [Chris Xia的回答](https:/...
Regarding the 8th one [顾客把一些水果放在购物篮里。] I think the teorical "mistake" that they want to point out here is the use of "一些", as Chinese lengage manuals usually stress that the use of "把" is only for a "definite object" (which means specific object that both the speaker and the listener know what they are refering to), an...
24,520,923
When IsEnabled=false, the datepicker's text looks light grey whereas the textbox's text is a crisp black, which is what I want to acheive. I have tried using the following, but no joy: ``` <Style TargetType="{x:Type DatePickerTextBox}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> ...
2014/07/01
[ "https://Stackoverflow.com/questions/24520923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/172752/" ]
Following seems to work, in case it helps anyone else with similar issue: ``` <Style TargetType="{x:Type customControls:DatePicker}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Template"> <Setter.Value> ...
Try ``` <Style TargetType="{x:Type DatePickerTextBox}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Background" Value="LightGray"></Setter> **<Setter Property="FontWeight" Value="Black"></Setter>** </Trigger> </Style.Triggers> </Style...
24,520,923
When IsEnabled=false, the datepicker's text looks light grey whereas the textbox's text is a crisp black, which is what I want to acheive. I have tried using the following, but no joy: ``` <Style TargetType="{x:Type DatePickerTextBox}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> ...
2014/07/01
[ "https://Stackoverflow.com/questions/24520923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/172752/" ]
I solved this binding to the `IsEnabled` Property and using a Converter: **XAML:** ``` <Style TargetType="DatePickerTextBox"> <Setter Property="Background" Value="{Binding IsEnabled, Mode=OneWay, RelativeSource={RelativeSource Self}, Converter={StaticResource BoolToBackgroundConverter"/> </Style> ``` **Converte...
Try ``` <Style TargetType="{x:Type DatePickerTextBox}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Background" Value="LightGray"></Setter> **<Setter Property="FontWeight" Value="Black"></Setter>** </Trigger> </Style.Triggers> </Style...
55,638,923
The problem I'm having is that if I set textbox's width to under 70, it won't be shown fully. I've set the `MinWidth` to 0 and the `TextBox` still displays as the lower textbox in the following image. The upper one's width I set it to 70 and it displays fully. Is there something I need to change in the template to make...
2019/04/11
[ "https://Stackoverflow.com/questions/55638923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7741133/" ]
> > Uwp cannot lower the width of textbox to less than 70 > > > The red circle area is TextBox Border. and it's `MinHeight` and `MinWidth` are `TextControlThemeMinHeight` and `TextControlThemeMinWidth`.So if you just `MinWidth` property, the border `MinWidth` will not be changed. [![enter image description here](...
Alright, so I do not think your textbox is the issue. I believe your problem is with the width of your controls:DropShadowPanel. I suspect that your grid column is sizing to the textbox, but your DropShadowPanel is just getting clipped or cutoff. Try setting the width of your DropShadowPanel to 60 ( this will allow a l...
26,719,439
```coffee # I know rows parse correctly as the chart does render @data = new google.visualization.arrayToDataTable rows if @get('tooltipCol') isnt false (columns or []).forEach (col, index)=> if index is 0 return # This sets every other column as a tooltip if not (index % 2) @data.setColumnPro...
2014/11/03
[ "https://Stackoverflow.com/questions/26719439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266763/" ]
This is a poorly documented feature (setting existing column to tooltip), but have found an answer. The `p : {html: true}` is actually an abbreviature of `properties:{html: true}`. So my guess was: Why use a method called `setColumnProperties` and put as a parameter `properties`? Well, tried to remove that and it worke...
Have you tried converting your DataView to a DataTable prior to rendering it? Just call toDataTable() on the DataView. Google Visualization has a lot of quirks when rendering DataViews. It's usually best to just convert to a DataTable even though there's a (usually actually pretty small) performance penalty.
640,193
Say we had $$y'' +2y' -8y = xe^{-x}.$$ For the particular solution, would it be wise to try $$y\_p(x) = (c\_1 + c\_2x)e^{-x}\quad or\quad y\_p(x) = c\_1xe^{-x}?$$ Similarly, we had $y'' +2y' -8y = x^2e^{-x}$ or $ y'' +2y' -8y = x^2cos(x)$ would it be wise to try $y\_p(x) = (c\_1 + c\_2x + c\_3x^2)e^{-x} $ and $y\_p(x) ...
2014/01/16
[ "https://math.stackexchange.com/questions/640193", "https://math.stackexchange.com", "https://math.stackexchange.com/users/118782/" ]
A good criteria: > > Let $a\_ny^{(n)}+a\_{n-1}y^{(n-1)}+\cdots+a\_1y'+a\_0y=Q(x)$ where $a\_n\neq0$ and $Q(x)$ is not zero in an interval $I$. If *No term* of $Q(x)$ is the same as a term of $y\_c(x)$, then the particular solution $y\_p(x)$ is a linear combination of the terms in $Q(x)$ and all its linearly independe...
For the first RHS the particular solution is of the form $(c\_1+c\_2x)e^{-x}$. For the second RHS the appropriate particular solution is $(c\_1+c\_2x+c\_3x^2)e^{-x}$. For the third RHS the appropriate particular solution is $(c\_1+c\_2x+c\_3x^2)\sin(x)+(d\_1+d\_2x+d\_3x^2)\cos(x)$.
640,193
Say we had $$y'' +2y' -8y = xe^{-x}.$$ For the particular solution, would it be wise to try $$y\_p(x) = (c\_1 + c\_2x)e^{-x}\quad or\quad y\_p(x) = c\_1xe^{-x}?$$ Similarly, we had $y'' +2y' -8y = x^2e^{-x}$ or $ y'' +2y' -8y = x^2cos(x)$ would it be wise to try $y\_p(x) = (c\_1 + c\_2x + c\_3x^2)e^{-x} $ and $y\_p(x) ...
2014/01/16
[ "https://math.stackexchange.com/questions/640193", "https://math.stackexchange.com", "https://math.stackexchange.com/users/118782/" ]
In general, if you have an equation of the form $$ y^{(n)}+a\_{n-1}y^{(n-1)}+\cdots a\_0 y^{(0)}=p(x)\,\mathrm{e}^{ax}, $$ where $p$ is a polynomial of degreee $k$, then you look for a solution of the form $q(x)\,\mathrm{e}^{ax}$, where $q$ is also a polynomial of degree $k$, unless $a$ is a root of the characteristic ...
For the first RHS the particular solution is of the form $(c\_1+c\_2x)e^{-x}$. For the second RHS the appropriate particular solution is $(c\_1+c\_2x+c\_3x^2)e^{-x}$. For the third RHS the appropriate particular solution is $(c\_1+c\_2x+c\_3x^2)\sin(x)+(d\_1+d\_2x+d\_3x^2)\cos(x)$.
640,193
Say we had $$y'' +2y' -8y = xe^{-x}.$$ For the particular solution, would it be wise to try $$y\_p(x) = (c\_1 + c\_2x)e^{-x}\quad or\quad y\_p(x) = c\_1xe^{-x}?$$ Similarly, we had $y'' +2y' -8y = x^2e^{-x}$ or $ y'' +2y' -8y = x^2cos(x)$ would it be wise to try $y\_p(x) = (c\_1 + c\_2x + c\_3x^2)e^{-x} $ and $y\_p(x) ...
2014/01/16
[ "https://math.stackexchange.com/questions/640193", "https://math.stackexchange.com", "https://math.stackexchange.com/users/118782/" ]
In general, if you have an equation of the form $$ y^{(n)}+a\_{n-1}y^{(n-1)}+\cdots a\_0 y^{(0)}=p(x)\,\mathrm{e}^{ax}, $$ where $p$ is a polynomial of degreee $k$, then you look for a solution of the form $q(x)\,\mathrm{e}^{ax}$, where $q$ is also a polynomial of degree $k$, unless $a$ is a root of the characteristic ...
A good criteria: > > Let $a\_ny^{(n)}+a\_{n-1}y^{(n-1)}+\cdots+a\_1y'+a\_0y=Q(x)$ where $a\_n\neq0$ and $Q(x)$ is not zero in an interval $I$. If *No term* of $Q(x)$ is the same as a term of $y\_c(x)$, then the particular solution $y\_p(x)$ is a linear combination of the terms in $Q(x)$ and all its linearly independe...
20,602,831
I am just learning function templates and the template I created below doesn't compile and I am not sure what's wrong. I am trying to make an int variable and a double variable go into the template but I keep getting an error when I call the function. The error is: > > error: no matching function for call to 'Largest...
2013/12/16
[ "https://Stackoverflow.com/questions/20602831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2499631/" ]
You probably are looking for an outer join or an outer excluding join. OUTER JOIN ![enter image description here](https://i.stack.imgur.com/hx2oa.png) ``` SELECT * FROM tableA a FULL OUTER JOIN tableB b ON a.column = b.column ``` OUTER EXCLUDING JOIN ![enter image description here](https://i.stack.imgur.com/H...
If you want to get values from both tables, you can use full outer join and take records which have one side as null: ``` select a.*, b.* from tableA a full outer join tableB b on a.col = b.col where a.col is null or b.col is null ``` Obviously this way all the values for either one table or the other will be null.
10,214,452
I get this error: `Error: defineAlreadyDefined`, that only occurs with dojo. **index.php** ``` <script data-main="app" src="require.js"></script> ``` --- **app.js** ``` require({ paths : { dojo : 'http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo' } }); require([ 'dojo' ], function() { ...
2012/04/18
[ "https://Stackoverflow.com/questions/10214452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
In order to use a foreign loader w/ dojo you need to skip the dojo/dojo.js file, which defines the AMD loader. Your require config should have something like: ``` require({ packages: [ { name: 'dojo', location: 'dojo', main:'dojo/main' } ] }); ``` However,...
Im not sure of what you want to accomplish here, but [Dojo implements requireJS](http://dojotoolkit.org/reference-guide/1.7/loader/amd.html). Therefore you don't need requireJS. What you would do, for the normal use of Dojo library, is: ``` //call dojo script <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7...
33,798
I've ordered a [Pathfinder Beginner Box](http://paizo.com/pathfinderRPG/products/beginnerbox). It contains a "Flip-mat" battlemat, which can supposedly work with markers. But what kind of marker should I use? Are they included in the box? If not, should I use a regular pencil or a special marker? Is it expensive? Plea...
2014/02/18
[ "https://rpg.stackexchange.com/questions/33798", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/10904/" ]
If it is the style of battle map found [here](http://paizo.com/products/btpy8oto?GameMastery-FlipMat-Basic) then the markers I see used most often(and with best results), are wet erase style. However the website does list as any marker being usable. Looking at the beginner box page, it seems like it uses the above bat...
Paizo claims even permanent markers (Sharpie) will come off if you draw over it with a dry-erase marker first. <http://paizo.com/threads/rzs2hgqy?FlipMat-Issues> I don't think I'd try permanent marker, but wet-erase and dry-erase are both proven options (according to Paizo reviews/threads). Dry-erase can stain prope...
33,798
I've ordered a [Pathfinder Beginner Box](http://paizo.com/pathfinderRPG/products/beginnerbox). It contains a "Flip-mat" battlemat, which can supposedly work with markers. But what kind of marker should I use? Are they included in the box? If not, should I use a regular pencil or a special marker? Is it expensive? Plea...
2014/02/18
[ "https://rpg.stackexchange.com/questions/33798", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/10904/" ]
If it is the style of battle map found [here](http://paizo.com/products/btpy8oto?GameMastery-FlipMat-Basic) then the markers I see used most often(and with best results), are wet erase style. However the website does list as any marker being usable. Looking at the beginner box page, it seems like it uses the above bat...
Personal experience answer here (I own the beginner box). The flip mat in mine is a semi-rigid glossy cardstock like material. I use dry erase markers on mine. It wipes off easily. I have also used permanent marker. The permanent market came off easily after writing over it with a dry erase marker.
33,798
I've ordered a [Pathfinder Beginner Box](http://paizo.com/pathfinderRPG/products/beginnerbox). It contains a "Flip-mat" battlemat, which can supposedly work with markers. But what kind of marker should I use? Are they included in the box? If not, should I use a regular pencil or a special marker? Is it expensive? Plea...
2014/02/18
[ "https://rpg.stackexchange.com/questions/33798", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/10904/" ]
Paizo claims even permanent markers (Sharpie) will come off if you draw over it with a dry-erase marker first. <http://paizo.com/threads/rzs2hgqy?FlipMat-Issues> I don't think I'd try permanent marker, but wet-erase and dry-erase are both proven options (according to Paizo reviews/threads). Dry-erase can stain prope...
Personal experience answer here (I own the beginner box). The flip mat in mine is a semi-rigid glossy cardstock like material. I use dry erase markers on mine. It wipes off easily. I have also used permanent marker. The permanent market came off easily after writing over it with a dry erase marker.
64,721,983
I would like to be able to save and print logcat messages when my device is disconnected from the computer, and then when I plug it in, to have all the messages be printed to logcat. Currently, when I log, this does not happen. When I plug my phone in, I can hook the device to logcat and lots of logs from the day get ...
2020/11/06
[ "https://Stackoverflow.com/questions/64721983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13264143/" ]
You need to build a class that will be a wrapper for the `android.util.Log` class, that redirects the output to both file and console. Check [this answer](https://stackoverflow.com/a/10102176/12502168), it is a bit outdated but you can still follow the example and build such a class. This way you get the logs written t...
You may save your logs to sharedpreferences and get it value after connection
50,926,125
I was wondering what would be the correct declaration for a long running task. ``` suspend fun methodName(image: Bitmap?): String? = async { // heavy task }.await() ``` OR ``` fun methodName(image: Bitmap?): String? { //heavyTask } ``` And in code use ``` async{ methodName() }.await() ``` The First on...
2018/06/19
[ "https://Stackoverflow.com/questions/50926125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4613032/" ]
It's a bug. Fix should be available in the upcoming SDK version 2.1.1. There are 3 things you can do right now: 1. You can install SDK 2.1.301 ([x64 Installer](https://dotnetfeed.blob.core.windows.net/orchestrated-release-2-1/20180605-09/final/assets/Sdk/2.1.301-preview-008906/dotnet-sdk-2.1.301-win-x64.exe), [x86 Ins...
For my case, I have installed Microsoft.NET.Sdk.Razor 2.2.0 Open "Package Manager Console" run follows query.... > > Install-Package Microsoft.NET.Sdk.Razor -Version 2.2.0 > > > Razor is a markup syntax for adding server-side logic to web pages. This package contains MSBuild support for Razor.
1,558,091
Last night I was writing a simple T-SQL program something like this ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) IF (@ROLEID = 1) BEGIN //SOMECODE END ELSE IF(@ROLEID = 2) BEGIN //SOMECODE END ELSE BEGIN //SOMECODE END ``` I...
2009/10/13
[ "https://Stackoverflow.com/questions/1558091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111663/" ]
[Common table expressions](http://msdn.microsoft.com/en-us/library/ms175972.aspx) are defined within the context of a single statement: ``` WITH cte_name AS ( <cte definition>) <statement that uses cte>; ``` So you can do something like: ``` WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT * FROM CTE; ``` or...
The closest you'll get is using a UNION ALL to do a crude switched select: ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT --somecolumns FROM CTE --other stuff too WHERE @ROLEID = 1 UNION ALL SELECT --somecolumns FROM CTE...
1,558,091
Last night I was writing a simple T-SQL program something like this ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) IF (@ROLEID = 1) BEGIN //SOMECODE END ELSE IF(@ROLEID = 2) BEGIN //SOMECODE END ELSE BEGIN //SOMECODE END ``` I...
2009/10/13
[ "https://Stackoverflow.com/questions/1558091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111663/" ]
[Common table expressions](http://msdn.microsoft.com/en-us/library/ms175972.aspx) are defined within the context of a single statement: ``` WITH cte_name AS ( <cte definition>) <statement that uses cte>; ``` So you can do something like: ``` WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT * FROM CTE; ``` or...
A little late but I can't be the only one bumping into this. A solution could be to create a temporary table like this: ``` -- If previous run of this query fails, the temp table will be deleted. -- Selecting into creates the temp table which fails if it already exists IF EXISTS(SELECT [name] FROM tempdb.sys.tables W...
1,558,091
Last night I was writing a simple T-SQL program something like this ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) IF (@ROLEID = 1) BEGIN //SOMECODE END ELSE IF(@ROLEID = 2) BEGIN //SOMECODE END ELSE BEGIN //SOMECODE END ``` I...
2009/10/13
[ "https://Stackoverflow.com/questions/1558091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111663/" ]
[Common table expressions](http://msdn.microsoft.com/en-us/library/ms175972.aspx) are defined within the context of a single statement: ``` WITH cte_name AS ( <cte definition>) <statement that uses cte>; ``` So you can do something like: ``` WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT * FROM CTE; ``` or...
Try putting the CTE in the IF. It worked for me. ``` IF @awsome = 1 BEGIN ;WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT 'WHATEVERYOUWANT' FROM CTE END ELSE IF @awesome = 2 BEGIN ;WITH CTE2 AS ( SELECT * FROM SOMETABLE ) SELECT 'WHATEVERYOUWANT' FROM CTE2 END ```
1,558,091
Last night I was writing a simple T-SQL program something like this ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) IF (@ROLEID = 1) BEGIN //SOMECODE END ELSE IF(@ROLEID = 2) BEGIN //SOMECODE END ELSE BEGIN //SOMECODE END ``` I...
2009/10/13
[ "https://Stackoverflow.com/questions/1558091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111663/" ]
A little late but I can't be the only one bumping into this. A solution could be to create a temporary table like this: ``` -- If previous run of this query fails, the temp table will be deleted. -- Selecting into creates the temp table which fails if it already exists IF EXISTS(SELECT [name] FROM tempdb.sys.tables W...
The closest you'll get is using a UNION ALL to do a crude switched select: ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT --somecolumns FROM CTE --other stuff too WHERE @ROLEID = 1 UNION ALL SELECT --somecolumns FROM CTE...
1,558,091
Last night I was writing a simple T-SQL program something like this ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) IF (@ROLEID = 1) BEGIN //SOMECODE END ELSE IF(@ROLEID = 2) BEGIN //SOMECODE END ELSE BEGIN //SOMECODE END ``` I...
2009/10/13
[ "https://Stackoverflow.com/questions/1558091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111663/" ]
The closest you'll get is using a UNION ALL to do a crude switched select: ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT --somecolumns FROM CTE --other stuff too WHERE @ROLEID = 1 UNION ALL SELECT --somecolumns FROM CTE...
Try putting the CTE in the IF. It worked for me. ``` IF @awsome = 1 BEGIN ;WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT 'WHATEVERYOUWANT' FROM CTE END ELSE IF @awesome = 2 BEGIN ;WITH CTE2 AS ( SELECT * FROM SOMETABLE ) SELECT 'WHATEVERYOUWANT' FROM CTE2 END ```
1,558,091
Last night I was writing a simple T-SQL program something like this ``` DECLARE @ROLEID AS INT SELECT @ROLEID = [ROLE ID] FROM TBLROLE ;WITH CTE AS ( SELECT * FROM SOMETABLE ) IF (@ROLEID = 1) BEGIN //SOMECODE END ELSE IF(@ROLEID = 2) BEGIN //SOMECODE END ELSE BEGIN //SOMECODE END ``` I...
2009/10/13
[ "https://Stackoverflow.com/questions/1558091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111663/" ]
A little late but I can't be the only one bumping into this. A solution could be to create a temporary table like this: ``` -- If previous run of this query fails, the temp table will be deleted. -- Selecting into creates the temp table which fails if it already exists IF EXISTS(SELECT [name] FROM tempdb.sys.tables W...
Try putting the CTE in the IF. It worked for me. ``` IF @awsome = 1 BEGIN ;WITH CTE AS ( SELECT * FROM SOMETABLE ) SELECT 'WHATEVERYOUWANT' FROM CTE END ELSE IF @awesome = 2 BEGIN ;WITH CTE2 AS ( SELECT * FROM SOMETABLE ) SELECT 'WHATEVERYOUWANT' FROM CTE2 END ```
15,560,244
I'm trying to put in a rel and class attribute inside a anchor tag but it keeps going into the img tag. I'm fairly new to Rails so I'm hoping can see what i'm doing wrong. ``` <% @series.uploads.each do |upload| %> <%= link_to image_tag upload.upload.url(:thumb), :class => 'lightbox', :rel => 'lightbox'%> ...
2013/03/21
[ "https://Stackoverflow.com/questions/15560244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1547076/" ]
This? ``` <%= link_to(image_tag(upload.upload.url(:thumb)), :class => 'lightbox', :rel => 'lightbox') %> ```
This is what I ended up doing to get it to work but it just doesn't look right? ``` <% @series.uploads.each do |upload| %> <%= link_to(image_tag(upload.upload.url(:thumb)), '', {:rel => "lightbox", :class => "lightbox"})%> <% end %> ```
11,432,364
Im trying to parse an XML file containing all the uploaded videos on a certain channel. Im attempting to get tbe value of the URL attribute in one of the `<media:content>` nodes and put it in the ViewerLocation field. However there are several of them. My current code is this: ``` var videos = from xElem in xml.Descen...
2012/07/11
[ "https://Stackoverflow.com/questions/11432364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413671/" ]
you can make a search about Robotium. it provides you to do blackbox testing. <http://testdroid.com/tech/54/automated-ui-testing-android-applications-robotium>
Maybe [Robolectric](http://pivotal.github.com/robolectric/) is what You are looking for. You can use JUnit to test only java code that doesn't use methods from android sdk.
11,432,364
Im trying to parse an XML file containing all the uploaded videos on a certain channel. Im attempting to get tbe value of the URL attribute in one of the `<media:content>` nodes and put it in the ViewerLocation field. However there are several of them. My current code is this: ``` var videos = from xElem in xml.Descen...
2012/07/11
[ "https://Stackoverflow.com/questions/11432364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413671/" ]
you can make a search about Robotium. it provides you to do blackbox testing. <http://testdroid.com/tech/54/automated-ui-testing-android-applications-robotium>
have you considered using [AndroidTestCase](http://developer.android.com/reference/android/test/AndroidTestCase.html)? JUnit can only be used to non-android specific function, but this does the job for your Android-specific code.
11,432,364
Im trying to parse an XML file containing all the uploaded videos on a certain channel. Im attempting to get tbe value of the URL attribute in one of the `<media:content>` nodes and put it in the ViewerLocation field. However there are several of them. My current code is this: ``` var videos = from xElem in xml.Descen...
2012/07/11
[ "https://Stackoverflow.com/questions/11432364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413671/" ]
you can make a search about Robotium. it provides you to do blackbox testing. <http://testdroid.com/tech/54/automated-ui-testing-android-applications-robotium>
There is a very detailed account for android testing available at: <http://developer.android.com/tools/testing/testing_android.html> This includes basic as well as activity testing and is built on top of JUnit.
11,432,364
Im trying to parse an XML file containing all the uploaded videos on a certain channel. Im attempting to get tbe value of the URL attribute in one of the `<media:content>` nodes and put it in the ViewerLocation field. However there are several of them. My current code is this: ``` var videos = from xElem in xml.Descen...
2012/07/11
[ "https://Stackoverflow.com/questions/11432364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413671/" ]
you can make a search about Robotium. it provides you to do blackbox testing. <http://testdroid.com/tech/54/automated-ui-testing-android-applications-robotium>
For people that don't want to use Roboticum and such, but just stick with Eclipse built-in JUnit testing, this is what I would recommend: Have three projects: * AndroidProject * AndroidProject.test * AndroidProject.test.android In your AndroidProject.test project you only test Models, Controllers and such which excl...
11,432,364
Im trying to parse an XML file containing all the uploaded videos on a certain channel. Im attempting to get tbe value of the URL attribute in one of the `<media:content>` nodes and put it in the ViewerLocation field. However there are several of them. My current code is this: ``` var videos = from xElem in xml.Descen...
2012/07/11
[ "https://Stackoverflow.com/questions/11432364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413671/" ]
Maybe [Robolectric](http://pivotal.github.com/robolectric/) is what You are looking for. You can use JUnit to test only java code that doesn't use methods from android sdk.
have you considered using [AndroidTestCase](http://developer.android.com/reference/android/test/AndroidTestCase.html)? JUnit can only be used to non-android specific function, but this does the job for your Android-specific code.
11,432,364
Im trying to parse an XML file containing all the uploaded videos on a certain channel. Im attempting to get tbe value of the URL attribute in one of the `<media:content>` nodes and put it in the ViewerLocation field. However there are several of them. My current code is this: ``` var videos = from xElem in xml.Descen...
2012/07/11
[ "https://Stackoverflow.com/questions/11432364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413671/" ]
Maybe [Robolectric](http://pivotal.github.com/robolectric/) is what You are looking for. You can use JUnit to test only java code that doesn't use methods from android sdk.
There is a very detailed account for android testing available at: <http://developer.android.com/tools/testing/testing_android.html> This includes basic as well as activity testing and is built on top of JUnit.
11,432,364
Im trying to parse an XML file containing all the uploaded videos on a certain channel. Im attempting to get tbe value of the URL attribute in one of the `<media:content>` nodes and put it in the ViewerLocation field. However there are several of them. My current code is this: ``` var videos = from xElem in xml.Descen...
2012/07/11
[ "https://Stackoverflow.com/questions/11432364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413671/" ]
Maybe [Robolectric](http://pivotal.github.com/robolectric/) is what You are looking for. You can use JUnit to test only java code that doesn't use methods from android sdk.
For people that don't want to use Roboticum and such, but just stick with Eclipse built-in JUnit testing, this is what I would recommend: Have three projects: * AndroidProject * AndroidProject.test * AndroidProject.test.android In your AndroidProject.test project you only test Models, Controllers and such which excl...
247,076
I am working on creating a circuit that will scale +/- 12v input to a unipolar 3.3v centered around 1.65v, in order to scale the kind of CV used in modular synthesis systems to work with the ADCs on the STM32F4 microcontroller, which want to see a 0-3.3v input. I am encountering problems with noise, specifically a str...
2016/07/20
[ "https://electronics.stackexchange.com/questions/247076", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/107083/" ]
![schematic](https://i.stack.imgur.com/jOmD2.png) [simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fjOmD2.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/) You don't need any op amps, at all - maybe a single buffer.
![schematic](https://i.stack.imgur.com/UcJtG.png) [simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fUcJtG.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/) The above circuit could work for you if the input is a digital signal. The first stage converts the +12/-1...
247,076
I am working on creating a circuit that will scale +/- 12v input to a unipolar 3.3v centered around 1.65v, in order to scale the kind of CV used in modular synthesis systems to work with the ADCs on the STM32F4 microcontroller, which want to see a 0-3.3v input. I am encountering problems with noise, specifically a str...
2016/07/20
[ "https://electronics.stackexchange.com/questions/247076", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/107083/" ]
You are making this way too complicated. For reference, here is your circuit: [![](https://i.stack.imgur.com/TdUxK.gif)](https://i.stack.imgur.com/TdUxK.gif) There are a number of ways to simplify this. The two back to back inverting buffers are just silly. Why not the obvious single non-inverting buffer? Also, the f...
![schematic](https://i.stack.imgur.com/UcJtG.png) [simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fUcJtG.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/) The above circuit could work for you if the input is a digital signal. The first stage converts the +12/-1...
37,227,631
I have the following code in order to read a text file line by line with nodejs: ``` var lineReader = require('readline').createInterface({ input: require('fs').createReadStream('log.txt') }); lineReader.on('line', function (line) { console.log(line); }); lineReader.on('close', function() { console.log('Finished!...
2016/05/14
[ "https://Stackoverflow.com/questions/37227631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1043170/" ]
I am not sure why you want the percentiles to be on the y-axis, but here is code that does what you want: ``` library(dplyr) library(shiny) library(tidyr) library(ggplot2) # simulate some data df_foo = data_frame( percentile = seq.int(99), ATI = sort(rnorm(99)), BTI = sort(rnorm(99)) ) # UI ui_foo = shinyUI(...
In order to plot both `BTI` and `ATI`, you need to define which one is plotted on which axis. In other words, you should tell `ggplot` that you would like both columns plotted, this is missing in your code, i.e. in `ggplot(incomedata, aes(x = BTI, y = PP))`. In this code you are asking BTI to be plotted on x axis and P...
37,227,631
I have the following code in order to read a text file line by line with nodejs: ``` var lineReader = require('readline').createInterface({ input: require('fs').createReadStream('log.txt') }); lineReader.on('line', function (line) { console.log(line); }); lineReader.on('close', function() { console.log('Finished!...
2016/05/14
[ "https://Stackoverflow.com/questions/37227631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1043170/" ]
I am not sure why you want the percentiles to be on the y-axis, but here is code that does what you want: ``` library(dplyr) library(shiny) library(tidyr) library(ggplot2) # simulate some data df_foo = data_frame( percentile = seq.int(99), ATI = sort(rnorm(99)), BTI = sort(rnorm(99)) ) # UI ui_foo = shinyUI(...
Thanks for your help bert and tchakravarty. I reshaped my data into long format and it worked perfectly. So what I did was: * Reshape my data into long format as @Bert suggested with a new Category column * Changed my ggplot() to this: `output$plot1 <- renderPlot({ ggplot(incomedata, aes(x = Income, y = PP)) + ...
12,340,482
I am trying to get an int from an edit text set to inputType="number" and then out put it ( i will do something with it later) i cant do it, this is the code i have which i have been told to try but it dose not work ``` Button go; EditText num; TextView OP, ST; String OPS; int oer; @Override public void onCreate(Bund...
2012/09/09
[ "https://Stackoverflow.com/questions/12340482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1658329/" ]
**1.** You will **never get an** `int` from EditText, `InputType` is provided **to provide you with the correct softKeyboard...** **2.** You can **convert** the text from EditText in to integer using this.. `int i = Integer.parseInt(editText.getText().toString());` moreover `setText` will expect you to provide it wi...
**`"inputType = number"`** does not mean that the input in the EditText would be in the form of an integer. It just implies the type of soft keyboard that would be shown to the user while entering the value and also the valid entries in the EditText,i.e. an EditText with `inputType=number` would take **only numbers** a...
12,340,482
I am trying to get an int from an edit text set to inputType="number" and then out put it ( i will do something with it later) i cant do it, this is the code i have which i have been told to try but it dose not work ``` Button go; EditText num; TextView OP, ST; String OPS; int oer; @Override public void onCreate(Bund...
2012/09/09
[ "https://Stackoverflow.com/questions/12340482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1658329/" ]
**1.** You will **never get an** `int` from EditText, `InputType` is provided **to provide you with the correct softKeyboard...** **2.** You can **convert** the text from EditText in to integer using this.. `int i = Integer.parseInt(editText.getText().toString());` moreover `setText` will expect you to provide it wi...
OP.setText(myNum) is causing the crash. This is due to the nature of setText(int value), where it will look up a string resource rather than set the literal value of the integer. Instead you would need to do: `OP.setText(String.valueOf(myNum))` Everything else is ok.