qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
43,674,862
) Is there any way to use "th:block" tag inside "script" tag? something like that: ``` <script type="text/javascript"> <th:block> var test = 1; </th:block> </script> ```
2017/04/28
[ "https://Stackoverflow.com/questions/43674862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2769977/" ]
You should use the attribute `th:inline="javascript"`, then you can use a `th:block` but not in a tag, you must use a syntax like next: ``` <script th:inline="javascript"> [#th:block th:each="item : ${items}"] - [#th:block th:utext="${item}" /] [/th:block] </script> ```
We had the requirements to insert an external javascript (with thymleaf variables inside) and wrap it in cdata, it's based on @Pau's solution: ``` <script th:inline="javascript"> /*<![CDATA[*/ /*[+ [# th:insert="~{path/to/file.js}" /] +]*/ /*]]>*/ </script> ``` In these five lines we packed: * Javascript inli...
2,998,312
To let people know what version of the program they are using, i want to show the productversion in the title of the window. I can do that manually, but i want this to be dynamic, so i don't have to change both items everytime the version changes. Is this possible doing this in code behind without messing with the ins...
2010/06/08
[ "https://Stackoverflow.com/questions/2998312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213963/" ]
You can retrieve the version from the [`AssemblyName.Version`](http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.version.aspx) property using the following code: ``` Version version = Assembly.GetExecutingAssembly().GetName().Version; this.Text = "My Cool Product - Version " + version; // or wit...
try this: `System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();`
2,998,312
To let people know what version of the program they are using, i want to show the productversion in the title of the window. I can do that manually, but i want this to be dynamic, so i don't have to change both items everytime the version changes. Is this possible doing this in code behind without messing with the ins...
2010/06/08
[ "https://Stackoverflow.com/questions/2998312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213963/" ]
try this: `System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();`
Like this: ``` Text = "MyApplication v" + typeof(MyForm).Assembly.GetName().Version; ``` This will read the `[assembly: AssemblyVersion("...")]` attribute from AssemblyInfo.cs, which can also be set in Project Properties (by clicking the `Assembly Information...` button)
2,998,312
To let people know what version of the program they are using, i want to show the productversion in the title of the window. I can do that manually, but i want this to be dynamic, so i don't have to change both items everytime the version changes. Is this possible doing this in code behind without messing with the ins...
2010/06/08
[ "https://Stackoverflow.com/questions/2998312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213963/" ]
try this: `System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();`
Here is my solution using DataBinding and Reflection: In XAML: ``` <Window ... Title="{Binding WindowTitle, RelativeSource={RelativeSource Mode=Self}}" > ``` In code: ``` public string WindowTitle { get { Version version = Assembly.GetExecutingAssembly().GetName().Version; r...
2,998,312
To let people know what version of the program they are using, i want to show the productversion in the title of the window. I can do that manually, but i want this to be dynamic, so i don't have to change both items everytime the version changes. Is this possible doing this in code behind without messing with the ins...
2010/06/08
[ "https://Stackoverflow.com/questions/2998312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213963/" ]
You can retrieve the version from the [`AssemblyName.Version`](http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.version.aspx) property using the following code: ``` Version version = Assembly.GetExecutingAssembly().GetName().Version; this.Text = "My Cool Product - Version " + version; // or wit...
Like this: ``` Text = "MyApplication v" + typeof(MyForm).Assembly.GetName().Version; ``` This will read the `[assembly: AssemblyVersion("...")]` attribute from AssemblyInfo.cs, which can also be set in Project Properties (by clicking the `Assembly Information...` button)
2,998,312
To let people know what version of the program they are using, i want to show the productversion in the title of the window. I can do that manually, but i want this to be dynamic, so i don't have to change both items everytime the version changes. Is this possible doing this in code behind without messing with the ins...
2010/06/08
[ "https://Stackoverflow.com/questions/2998312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213963/" ]
You can retrieve the version from the [`AssemblyName.Version`](http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.version.aspx) property using the following code: ``` Version version = Assembly.GetExecutingAssembly().GetName().Version; this.Text = "My Cool Product - Version " + version; // or wit...
Here is my solution using DataBinding and Reflection: In XAML: ``` <Window ... Title="{Binding WindowTitle, RelativeSource={RelativeSource Mode=Self}}" > ``` In code: ``` public string WindowTitle { get { Version version = Assembly.GetExecutingAssembly().GetName().Version; r...
2,998,312
To let people know what version of the program they are using, i want to show the productversion in the title of the window. I can do that manually, but i want this to be dynamic, so i don't have to change both items everytime the version changes. Is this possible doing this in code behind without messing with the ins...
2010/06/08
[ "https://Stackoverflow.com/questions/2998312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213963/" ]
Here is my solution using DataBinding and Reflection: In XAML: ``` <Window ... Title="{Binding WindowTitle, RelativeSource={RelativeSource Mode=Self}}" > ``` In code: ``` public string WindowTitle { get { Version version = Assembly.GetExecutingAssembly().GetName().Version; r...
Like this: ``` Text = "MyApplication v" + typeof(MyForm).Assembly.GetName().Version; ``` This will read the `[assembly: AssemblyVersion("...")]` attribute from AssemblyInfo.cs, which can also be set in Project Properties (by clicking the `Assembly Information...` button)
47,688
If I remember correctly, Yoda chose Dagobah for his exile because it had been removed from the Jedi archives at some point and was generally unknown. However, in ESB, Luke seems to know exactly what Obi Wan's ghost is talking about, and doesn't seem to have any issue with setting a course to the planet when he takes of...
2014/01/08
[ "https://scifi.stackexchange.com/questions/47688", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/9154/" ]
I'm unable to remember any film **canon** explanation of why Yoda chose Dagobah, other than a line in the "Revenge of the Sith" in which he says > > **YODA:** *Into exile I must go. Failed, I have.* > > > Followed by > > Scene 236 : EXT. DAGOBAH-DAY A small escape pod hurls toward the > swamp planet and disa...
According to one of the "Inside the Worlds of..." books made for the prequels, (either the Episode II one or *Complete Locations*), Dagobah was one of the planets erased from the Jedi Archives that Yoda discovered after Episode II, and was likely erased by Count Dooku. For some reason, he decided not to restore the ent...
47,688
If I remember correctly, Yoda chose Dagobah for his exile because it had been removed from the Jedi archives at some point and was generally unknown. However, in ESB, Luke seems to know exactly what Obi Wan's ghost is talking about, and doesn't seem to have any issue with setting a course to the planet when he takes of...
2014/01/08
[ "https://scifi.stackexchange.com/questions/47688", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/9154/" ]
I'm unable to remember any film **canon** explanation of why Yoda chose Dagobah, other than a line in the "Revenge of the Sith" in which he says > > **YODA:** *Into exile I must go. Failed, I have.* > > > Followed by > > Scene 236 : EXT. DAGOBAH-DAY A small escape pod hurls toward the > swamp planet and disa...
In *Star Wars: The Clone Wars - The Lost Missions* (Unfinished season 6), Yoda went to Dagobah **with R2-D2** following voice of dead Qui-Gon Jinn. So, R2-D2 knew the location of Dagobah.
47,688
If I remember correctly, Yoda chose Dagobah for his exile because it had been removed from the Jedi archives at some point and was generally unknown. However, in ESB, Luke seems to know exactly what Obi Wan's ghost is talking about, and doesn't seem to have any issue with setting a course to the planet when he takes of...
2014/01/08
[ "https://scifi.stackexchange.com/questions/47688", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/9154/" ]
According to one of the "Inside the Worlds of..." books made for the prequels, (either the Episode II one or *Complete Locations*), Dagobah was one of the planets erased from the Jedi Archives that Yoda discovered after Episode II, and was likely erased by Count Dooku. For some reason, he decided not to restore the ent...
In *Star Wars: The Clone Wars - The Lost Missions* (Unfinished season 6), Yoda went to Dagobah **with R2-D2** following voice of dead Qui-Gon Jinn. So, R2-D2 knew the location of Dagobah.
50,354
Shepherds kill animals, and make food from their meat. It wasn't allowed in the antediluvian era. Abel was a shepherd, wasn't it a crime? Wasn't it at least problematic?
2014/12/14
[ "https://judaism.stackexchange.com/questions/50354", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/8558/" ]
People were vegetarians before the flood; the change is noted in Gen 9. But food isn't the only use for sheep. Hevel probably kept sheep for wool, since after the expulsion from the garden (Gen 3:23) people needed to clothe themselves. (God made clothes for Adam and Chava (3:21), but it doesn't say he continued to do ...
Shepherds move herds. They help raise animals (which provide milk and wool, especially the sheep). There is nothing in the job description of a shepherd that requires killing animals.
14,737,810
So say I have a really long line that I want to display in a `JLabel`. How can I do it? Currently, longer lines come up as this: ![enter image description here](https://i.stack.imgur.com/XNOTV.png) I have to resize the window to see the complete text. How can I make it so that there's linebreaks when the text almos...
2013/02/06
[ "https://Stackoverflow.com/questions/14737810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027425/" ]
Use HTML to display the text within the Label. ``` JLabel fancyLabel = new JLabel("<html>Punch Taskmaster</html>"); ``` (Taskmaster-suggested example added in)
Something like this. The answer give by rcook is very correct. Its just example to show how it can be done. ``` b1 = new JLabel("<html>Default Lable I have to resize the <br/> window to see the complete text.</html>"); ```
14,737,810
So say I have a really long line that I want to display in a `JLabel`. How can I do it? Currently, longer lines come up as this: ![enter image description here](https://i.stack.imgur.com/XNOTV.png) I have to resize the window to see the complete text. How can I make it so that there's linebreaks when the text almos...
2013/02/06
[ "https://Stackoverflow.com/questions/14737810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027425/" ]
Use HTML to display the text within the Label. ``` JLabel fancyLabel = new JLabel("<html>Punch Taskmaster</html>"); ``` (Taskmaster-suggested example added in)
Format with HTML. Works great. ``` import javax.swing.*; import java.awt.*; public class Test { public static void main(String[] args) { final JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(new Dimension(450, 400)); frame.setLocati...
14,737,810
So say I have a really long line that I want to display in a `JLabel`. How can I do it? Currently, longer lines come up as this: ![enter image description here](https://i.stack.imgur.com/XNOTV.png) I have to resize the window to see the complete text. How can I make it so that there's linebreaks when the text almos...
2013/02/06
[ "https://Stackoverflow.com/questions/14737810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027425/" ]
Just another example, showing that, with the right layout manager, text wrapped in `HTML` tags will automatically wrap to the available space... ![enter image description here](https://i.stack.imgur.com/yuAa8.png) ``` public class TestHTMLLabel { public static void main(String[] args) { new TestHTMLLabel...
Use HTML to display the text within the Label. ``` JLabel fancyLabel = new JLabel("<html>Punch Taskmaster</html>"); ``` (Taskmaster-suggested example added in)
14,737,810
So say I have a really long line that I want to display in a `JLabel`. How can I do it? Currently, longer lines come up as this: ![enter image description here](https://i.stack.imgur.com/XNOTV.png) I have to resize the window to see the complete text. How can I make it so that there's linebreaks when the text almos...
2013/02/06
[ "https://Stackoverflow.com/questions/14737810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027425/" ]
Format with HTML. Works great. ``` import javax.swing.*; import java.awt.*; public class Test { public static void main(String[] args) { final JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(new Dimension(450, 400)); frame.setLocati...
Something like this. The answer give by rcook is very correct. Its just example to show how it can be done. ``` b1 = new JLabel("<html>Default Lable I have to resize the <br/> window to see the complete text.</html>"); ```
14,737,810
So say I have a really long line that I want to display in a `JLabel`. How can I do it? Currently, longer lines come up as this: ![enter image description here](https://i.stack.imgur.com/XNOTV.png) I have to resize the window to see the complete text. How can I make it so that there's linebreaks when the text almos...
2013/02/06
[ "https://Stackoverflow.com/questions/14737810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027425/" ]
Just another example, showing that, with the right layout manager, text wrapped in `HTML` tags will automatically wrap to the available space... ![enter image description here](https://i.stack.imgur.com/yuAa8.png) ``` public class TestHTMLLabel { public static void main(String[] args) { new TestHTMLLabel...
Something like this. The answer give by rcook is very correct. Its just example to show how it can be done. ``` b1 = new JLabel("<html>Default Lable I have to resize the <br/> window to see the complete text.</html>"); ```
14,737,810
So say I have a really long line that I want to display in a `JLabel`. How can I do it? Currently, longer lines come up as this: ![enter image description here](https://i.stack.imgur.com/XNOTV.png) I have to resize the window to see the complete text. How can I make it so that there's linebreaks when the text almos...
2013/02/06
[ "https://Stackoverflow.com/questions/14737810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027425/" ]
Just another example, showing that, with the right layout manager, text wrapped in `HTML` tags will automatically wrap to the available space... ![enter image description here](https://i.stack.imgur.com/yuAa8.png) ``` public class TestHTMLLabel { public static void main(String[] args) { new TestHTMLLabel...
Format with HTML. Works great. ``` import javax.swing.*; import java.awt.*; public class Test { public static void main(String[] args) { final JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(new Dimension(450, 400)); frame.setLocati...
71,563,704
I have a Mysql database that contains some category ids on it which stores comma-separated values on a table. [sql table view](https://i.stack.imgur.com/fm3Rh.png) By using `select * from style where categories like '%8,%';` it returns all the values end with 8. For example, if the table rows have two values like 8 a...
2022/03/21
[ "https://Stackoverflow.com/questions/71563704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14108034/" ]
Storing multiple values in a single column is a denormalised design that will *almost always* cause you problems. However you need to add commas to both sides and compare: ``` select * from Style where concat(',',Categories,',') like '%,8,%'; ```
Like everyone else: normalize your data. But if you can't mySQL supports `find_in_set()` for `set` datatypes which this appears to be. * [DEMO dbfiddle.uk](https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=cc69b7aa1541259f2a1e45f02300bbd7) * [DOC LINK: Find\_in\_set()](https://dev.mysql.com/doc/refman/8.0/en/string-function...
71,563,704
I have a Mysql database that contains some category ids on it which stores comma-separated values on a table. [sql table view](https://i.stack.imgur.com/fm3Rh.png) By using `select * from style where categories like '%8,%';` it returns all the values end with 8. For example, if the table rows have two values like 8 a...
2022/03/21
[ "https://Stackoverflow.com/questions/71563704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14108034/" ]
Storing multiple values in a single column is a denormalised design that will *almost always* cause you problems. However you need to add commas to both sides and compare: ``` select * from Style where concat(',',Categories,',') like '%,8,%'; ```
You can also use rlike and in fact it is much better than like as it has much more options. ``` * = repetition of what is in front of it zero or more times . = Equivalent to any character including none ^ = Anchor start (Forces that begins with ...) $ = final anchor (forces it to end with ....) [ ] = [ RST ] Contain ...
1,948,725
As I understand, Russell's paradox demonstrates that not every class can be regarded as a set. He defines $$S:=\{x: x \text{ is a set such that }x\notin x\}$$ Assuming that $S$ is a set, this gives a contradiction. However, if in the above definition we replace "set" by "class", we find that $S$ cannot be a class. In o...
2016/10/01
[ "https://math.stackexchange.com/questions/1948725", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30860/" ]
There are lots of ways to paint the fine details, but the broad stroke is: * A set can be a member of a class * A proper class cannot be a member of a class When you use class-builder notation, such as in $\{ x \mid x \notin x \}$, the notation is only meaningful when $x$ quantifies over sets (or some subclass thereo...
In [ZF set theory](https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory), a set is an element of a model of ZF, which is a collection of things together with a relation called $\in$ between them satisfying the ZF axioms. Classes are not directly discussed by the axioms but one can describe classes as first...
1,948,725
As I understand, Russell's paradox demonstrates that not every class can be regarded as a set. He defines $$S:=\{x: x \text{ is a set such that }x\notin x\}$$ Assuming that $S$ is a set, this gives a contradiction. However, if in the above definition we replace "set" by "class", we find that $S$ cannot be a class. In o...
2016/10/01
[ "https://math.stackexchange.com/questions/1948725", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30860/" ]
In [ZF set theory](https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory), a set is an element of a model of ZF, which is a collection of things together with a relation called $\in$ between them satisfying the ZF axioms. Classes are not directly discussed by the axioms but one can describe classes as first...
In a system like MK (Morse-Kelley) set theory where there are two sorts, intended to be one for sets and one for classes in general, we can indeed construct (as an object in the system) any class of the form $\{ x : Set(x) \land φ(x) \}$, where $Set$ is the predicate corresponding to the sort intended for sets. It is t...
1,948,725
As I understand, Russell's paradox demonstrates that not every class can be regarded as a set. He defines $$S:=\{x: x \text{ is a set such that }x\notin x\}$$ Assuming that $S$ is a set, this gives a contradiction. However, if in the above definition we replace "set" by "class", we find that $S$ cannot be a class. In o...
2016/10/01
[ "https://math.stackexchange.com/questions/1948725", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30860/" ]
There are lots of ways to paint the fine details, but the broad stroke is: * A set can be a member of a class * A proper class cannot be a member of a class When you use class-builder notation, such as in $\{ x \mid x \notin x \}$, the notation is only meaningful when $x$ quantifies over sets (or some subclass thereo...
In a system like MK (Morse-Kelley) set theory where there are two sorts, intended to be one for sets and one for classes in general, we can indeed construct (as an object in the system) any class of the form $\{ x : Set(x) \land φ(x) \}$, where $Set$ is the predicate corresponding to the sort intended for sets. It is t...
19,547,316
I'm trying to incorporate JQuery Cycle 2's carousel functionality into an angular app. Everything works fine when I drop the images in the `<div class="carousel">`, but when I use `data-ng-repeat` to list out the images from JSON, the carousel function doesn't fire. I suspect this is a timing issue, but not sure and ...
2013/10/23
[ "https://Stackoverflow.com/questions/19547316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/818326/" ]
try to use cycle slideshow add function : `$('.cycle-slideshow').cycle('add', '<img src="'+value+'">');`
So, I ended up going outside of Angular and using PHP to draw the images. A lot easier in the shortrun to not rely on Angular for everything :P
48,226,789
How can I check if multiple strings are empty in an elegant way? This is how I currently do it: ``` //if one required field is empty, close the connection if (registerRequest.Email == "") || (registerRequest.PhoneNumber == "")|| (registerRequest.NachName =="") || (registerRequest.VorName ==...
2018/01/12
[ "https://Stackoverflow.com/questions/48226789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6525347/" ]
Note: You may use the solution below if you keep the "is-valid" condition in your handler, and also if you separate your condition into another function or method. You can create a simple helper function, which has a variadic parameter, and you can call it with any number of `string` values: ``` func containsEmpty(ss...
As Mario Santini mentioned in comment, a way to increase testability, encapsulate this logic, and decouple it from your handler method (which judging by the number of fields looks like it is at risk of changing at a different rate than your handler) could be to put this logic in a function: ``` func validRequest(regis...
48,226,789
How can I check if multiple strings are empty in an elegant way? This is how I currently do it: ``` //if one required field is empty, close the connection if (registerRequest.Email == "") || (registerRequest.PhoneNumber == "")|| (registerRequest.NachName =="") || (registerRequest.VorName ==...
2018/01/12
[ "https://Stackoverflow.com/questions/48226789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6525347/" ]
Note: You may use the solution below if you keep the "is-valid" condition in your handler, and also if you separate your condition into another function or method. You can create a simple helper function, which has a variadic parameter, and you can call it with any number of `string` values: ``` func containsEmpty(ss...
You can use a `switch`: ``` switch "" { case registerRequest.Email, registerRequest.NachName, registerRequest.Password, registerRequest.PhoneNumber, registerRequest.VerificationId, registerRequest.VorName: w.WriteHeader(UNABLE_TO_PROCEED) w.Write([]byte("Unable to register account.")) return } ``` <https://...
48,226,789
How can I check if multiple strings are empty in an elegant way? This is how I currently do it: ``` //if one required field is empty, close the connection if (registerRequest.Email == "") || (registerRequest.PhoneNumber == "")|| (registerRequest.NachName =="") || (registerRequest.VorName ==...
2018/01/12
[ "https://Stackoverflow.com/questions/48226789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6525347/" ]
As Mario Santini mentioned in comment, a way to increase testability, encapsulate this logic, and decouple it from your handler method (which judging by the number of fields looks like it is at risk of changing at a different rate than your handler) could be to put this logic in a function: ``` func validRequest(regis...
You can use a `switch`: ``` switch "" { case registerRequest.Email, registerRequest.NachName, registerRequest.Password, registerRequest.PhoneNumber, registerRequest.VerificationId, registerRequest.VorName: w.WriteHeader(UNABLE_TO_PROCEED) w.Write([]byte("Unable to register account.")) return } ``` <https://...
13,200,326
In Java How do you extract "issued to" or user from a SSL cert within an `HttpRequest`? what I'm working with: ``` Object certChain = request .getAttribute("javax.servlet.request.X509Certificate"); if (certChain != null) { X509Certificate certs[] = (X509Certificate[]) certChain; X509Certificate cert = certs...
2012/11/02
[ "https://Stackoverflow.com/questions/13200326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745835/" ]
Here's the code to extract the "Issued To" aka Subject for a cert within an httprequest, ``` import java.security.cert.X509Certificate; import javax.naming.InvalidNameException; import javax.naming.ldap.LdapName; import javax.naming.ldap.Rdn; X509Certificate[] certs = (X509Certificate[])request.getAttribute("javax.se...
[`getSubjectDN()`](http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509Certificate.html#getSubjectDN%28%29) should not be used any longer. > > **Denigrated**, replaced by getSubjectX500Principal(). > > > So use: ``` cert[0].getSubjectX500Principal().getName(); ``` Here is the JavaDoc for [`getSubje...
55,440,537
I've created a foreach loop that loops through Excel files the sheets within them. Based on the name of the sheet, one of a number of data flow tasks is executed. This is implemented by an execute SQL task that validates a variable against values in a table, and returns a value based on some conditions. For some reas...
2019/03/31
[ "https://Stackoverflow.com/questions/55440537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11284753/" ]
Thanks very much for your suggestions. I stripped the package back (to the loops without any import of excel data) and took Bogdan's suggestion of outputting the variable values into a table. Interestingly the package was tripping up on the variables with spaces. I then stripped the dollar sign out, which didn't make...
I think that you have a problem ordering IF...ELSE IF... ELSE statements. Try using the following syntax: ``` DECLARE @SheetName VARCHAR(100) SET @SheetName = 'Tab1$' IF EXISTS (SELECT 1 FROM [dbo].[xx] WHERE sheetname = @SheetName) -- The variable evaluates against the values in the sheet...
55,440,537
I've created a foreach loop that loops through Excel files the sheets within them. Based on the name of the sheet, one of a number of data flow tasks is executed. This is implemented by an execute SQL task that validates a variable against values in a table, and returns a value based on some conditions. For some reas...
2019/03/31
[ "https://Stackoverflow.com/questions/55440537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11284753/" ]
Thanks very much for your suggestions. I stripped the package back (to the loops without any import of excel data) and took Bogdan's suggestion of outputting the variable values into a table. Interestingly the package was tripping up on the variables with spaces. I then stripped the dollar sign out, which didn't make...
Have you tried to output the variable that holds the sheets names to some table/file? So in this way you can see the outputed values. Also, a nice approach would be to cleanse the sheet names after reading from the excel file, so when you set conditions you don't get dirty by dollar signs or quotes. For example(just ...
55,440,537
I've created a foreach loop that loops through Excel files the sheets within them. Based on the name of the sheet, one of a number of data flow tasks is executed. This is implemented by an execute SQL task that validates a variable against values in a table, and returns a value based on some conditions. For some reas...
2019/03/31
[ "https://Stackoverflow.com/questions/55440537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11284753/" ]
Thanks very much for your suggestions. I stripped the package back (to the loops without any import of excel data) and took Bogdan's suggestion of outputting the variable values into a table. Interestingly the package was tripping up on the variables with spaces. I then stripped the dollar sign out, which didn't make...
Use the square brackets but without a `$` or quotes in the sheet name. This would be `[My Tab]` in the examples posted above your code or `[Tab 2]` in the code. ``` DECLARE @SheetName VARCHAR(100) SET @SheetName = 'Tab1$' IF EXISTS (SELECT 1 FROM [dbo].[xx] WHERE sheetname = @SheetName) --...
14,463,084
I am only use to storyboarding in xcode but my new boss wants everyone done in xib files, of which I have no experience. All I have done so far is created a new single view application, and under the 'viewDidLoad'method have added the code.. ``` UILabel *scoreLabel = [ [UILabel alloc ] initWithFrame:CGRectMake(0, 0.0...
2013/01/22
[ "https://Stackoverflow.com/questions/14463084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798456/" ]
`self` is a `UIViewController`. You add subviews to a `UIView`. All you need is: ``` [self.view addSubview:scoreLabel]; ```
You are trying to add a subview to the controller? it should be to the view.
14,463,084
I am only use to storyboarding in xcode but my new boss wants everyone done in xib files, of which I have no experience. All I have done so far is created a new single view application, and under the 'viewDidLoad'method have added the code.. ``` UILabel *scoreLabel = [ [UILabel alloc ] initWithFrame:CGRectMake(0, 0.0...
2013/01/22
[ "https://Stackoverflow.com/questions/14463084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798456/" ]
`self` is a `UIViewController`. You add subviews to a `UIView`. All you need is: ``` [self.view addSubview:scoreLabel]; ```
`viewDidLoad` is a method of UIViewController, not UIView. For your code to work, replace: ``` [self addSubview:scoreLabel]; ``` with ``` [self.view addSubview:scoreLabel] ``` To add label from the xib, you do not need any of the above code. In your .h file you must declare property with IBOutlet. Then, in you...
14,463,084
I am only use to storyboarding in xcode but my new boss wants everyone done in xib files, of which I have no experience. All I have done so far is created a new single view application, and under the 'viewDidLoad'method have added the code.. ``` UILabel *scoreLabel = [ [UILabel alloc ] initWithFrame:CGRectMake(0, 0.0...
2013/01/22
[ "https://Stackoverflow.com/questions/14463084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798456/" ]
`self` is a `UIViewController`. You add subviews to a `UIView`. All you need is: ``` [self.view addSubview:scoreLabel]; ```
``` self.view will be the view of the view controller. ``` so you can add view ie; sub view only to the view. not its controller. self will be the view controller here
6,469,271
I need to perform a comparison between two XML documents. I've been looking at a lot of different xml-diffing tools typically mentioned here on Stack Overflow, but my needs are, of course, very peculiar and so they don't really fit. In short, I need to compare not the *documents as a whole*, but rather the element *con...
2011/06/24
[ "https://Stackoverflow.com/questions/6469271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367605/" ]
Turns out, my need *had* no solution at the time! Meanwhile, I've developed my own xml-diff routine that is specific to my problem, so I ended up with a working solution. Then, in late 2011, this was published: [Slashdot: Researchers Expanding Diff, Grep Unix Tools](http://tech.slashdot.org/story/11/12/08/185217) *Da...
+1 good question. I can't think of a workaround other than a lookahead, but you may find something in the diff algorithm literature (check <http://c2.com/cgi/wiki?DiffAlgorithm>). Is the algorithm you are using based on one that's described on that page? If not, you may want to try the algorithm described there (Myers ...
42,028,292
So I've been attempting to install the Shiny and Devtools R packages, but I'm running into the same kind of error as below: no matter what kind of package it always has a non-zero exit and includes the "error: unknown type name ‘FILE’" message. An example is below. For the record, I've already run the apt-get update an...
2017/02/03
[ "https://Stackoverflow.com/questions/42028292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834765/" ]
I have no answer, but I can only tell you that * CRAN tests on Debian and Fedora, and it of course it works there * Lost of folks use Ubuntu, Michael builds > 3k packages via his PPA * Maybe Mint changed the default libraries * `FILE` is something very plain old C, that *really* should be known * Your report lacks de...
I've been doing this long enough to know that if I wanted to install RStudio & R, then had better check and find out how to beforehand. So I wasn't suprised when the query (ubuntu mint 16.10 rstudio install apt-get) didn't return anything that resembled an usable answer. So, I did the investigation, and managed to stum...
42,028,292
So I've been attempting to install the Shiny and Devtools R packages, but I'm running into the same kind of error as below: no matter what kind of package it always has a non-zero exit and includes the "error: unknown type name ‘FILE’" message. An example is below. For the record, I've already run the apt-get update an...
2017/02/03
[ "https://Stackoverflow.com/questions/42028292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834765/" ]
I have no answer, but I can only tell you that * CRAN tests on Debian and Fedora, and it of course it works there * Lost of folks use Ubuntu, Michael builds > 3k packages via his PPA * Maybe Mint changed the default libraries * `FILE` is something very plain old C, that *really* should be known * Your report lacks de...
I'm running Mint 18.1, and just installed R with: ``` sudo apt-get install r-base r-base-dev ``` (I'm guessing just "r-base-dev" was enough.) As non-root user I then started `r` and typed: ``` install.packages('tibble') ``` It asked mirror, and I chose a geographically close one, and it asked if I wanted to crea...
42,028,292
So I've been attempting to install the Shiny and Devtools R packages, but I'm running into the same kind of error as below: no matter what kind of package it always has a non-zero exit and includes the "error: unknown type name ‘FILE’" message. An example is below. For the record, I've already run the apt-get update an...
2017/02/03
[ "https://Stackoverflow.com/questions/42028292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834765/" ]
I have no answer, but I can only tell you that * CRAN tests on Debian and Fedora, and it of course it works there * Lost of folks use Ubuntu, Michael builds > 3k packages via his PPA * Maybe Mint changed the default libraries * `FILE` is something very plain old C, that *really* should be known * Your report lacks de...
I had the same problem and I'd resolved it: * uninstall the R: sudo apt-get remove r-base-core * uninstall the rStudio: sudo apt-get remove rstudio And after it, reinstall R: * sudo apt-get install r-base r-base-dev * reinstall o rStudio and finally I got it make dowload of packages
3,644,443
I am looking for an algorithm in Java that creates an object thats attributes are set to the first not-null value of a string of objects. Consider this array (I will use JSON syntax to represent the array for the sake of simplicity): ``` { "objects": [ { "id": 1, "val1": null, ...
2010/09/04
[ "https://Stackoverflow.com/questions/3644443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268098/" ]
Before getting to your actual question, here's a better way of writing your existing loop: (replace `Object` with whatever the actual type is) ``` for (Object o : objectArray) { Double d = o.getVal1(); if (d != null) { bs.setVal1(d); break; } } ``` Considering the way your objects are laid out now, the...
+1 - Code repetition is a problem that can sometimes be hard to overcome in Java. One solution is to create an Iterable class which allows you to iterate over the values in one of those objects as if they were in an array. This takes away some of the repetition from your code without sacraficing the legibility benefit...
3,644,443
I am looking for an algorithm in Java that creates an object thats attributes are set to the first not-null value of a string of objects. Consider this array (I will use JSON syntax to represent the array for the sake of simplicity): ``` { "objects": [ { "id": 1, "val1": null, ...
2010/09/04
[ "https://Stackoverflow.com/questions/3644443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268098/" ]
Before getting to your actual question, here's a better way of writing your existing loop: (replace `Object` with whatever the actual type is) ``` for (Object o : objectArray) { Double d = o.getVal1(); if (d != null) { bs.setVal1(d); break; } } ``` Considering the way your objects are laid out now, the...
Whenever you want to eliminate code duplication, one of the first things you look for is whether you can extract a reusable method. Reflection helps you call arbitrary methods in a reusable way. Its not the prettiest thing in the world, but this method works for you: ``` @SuppressWarnings("unchecked") public <T> T fir...
34,171,490
I have two tables: 1. Cust : Contains customer details like customer ID and customer Name. 2. Cust\_Address : This table contains customer ID and customer address. **Table**: `Cust` ``` create table cust ( cust_id int, cust_name varchar(10) ); ``` **Records Insertion**: ``` insert into cust values(1,'A'); ins...
2015/12/09
[ "https://Stackoverflow.com/questions/34171490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4268241/" ]
You are not able to retrieve the rows in any particular order. You need some more info to get an order. The best way is **primary index** in Cust\_address ``` CustAddrID int identity(1, 1) not null primary key ``` You can also have a **CreatedOn** column that will have default value equal to **getDate()** After tha...
You will not be able to get the rows out of the link table in the order they were inserted. You need to have a column for this. Imagine how big the meta-data would be if you needed to keep a record for each record for creation! Would you also want to keep meta-data on your meta-data so you know when the meta-data was...
9,900,819
I have this XML: ``` <Catalog> <CUnit id="Bd"> <Race value="T1"/> </CUnit> <CUnit id="Critter"> </CUnit> <CUnit id="Ld"> <Race value="T1"/> </CUnit> </Catalog> ``` I want to use XPath to extract the CUnit elements that have a Race child element. Is there a clearer way than thi...
2012/03/28
[ "https://Stackoverflow.com/questions/9900819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917272/" ]
**Avoid using the `//` pseudo-operator**, because with many XPath engines it is implemented very inefficiently (causes traversal of the whole subtree rooted in the context node). **Whenever the structure of the XML document is well-known, use specific paths.** **In this case**: ``` /*/CUnit[Race] ```
Use a [predicate](http://www.w3.org/TR/xpath/#predicates) instead: ``` //CUnit[Race] ```
68,611,852
I have a classA which implements an interfaceA, with a methodA, then I have a classB in which I call classA with an @Autowired to be able to use methodA, but it gives me a warning that I must create a method for classA. Why is this happening? Doesn't @Autowired work like this in this case? Should I just instantiate cla...
2021/08/01
[ "https://Stackoverflow.com/questions/68611852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11332761/" ]
`img.get(mouseX, mouseY)` to get values from image, not a whole canvas
I too though that `img.get(mouseX, mouseY);` would work and @mevfy-y also said it so it might work?!
15,993,356
We all know that the safest "and probably only safe" way of removing an object from a collection while iterating it, is by first retrieving the `Iterator`, perform a loop and remove when needed; ``` Iterator iter=Collection.iterator(); while(iter.hasNext()){ Object o=iter.next() if(o.equals(what i'm looking fo...
2013/04/13
[ "https://Stackoverflow.com/questions/15993356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/594765/" ]
How exactly Iterator removes elements depends on its implementation, which may be different for different Collections. Definitely it doesn't break the loop you're in. I've just looked how ArrayList iterator is implemented and here's the code: ``` public void remove() { if (lastRet < 0) throw new IllegalSta...
The reason why you cannot modify a list while iterating over it is because the iterator has to know what to return for hasNext() and next(). How this is done is implementation specific, but you could have a look at the source code of ArrayList/AbstractList/LinkedList etc. Also note that in some situations you can use...
1,298
I am wondering if it would be worth emailing departments that I haven't applied to this year, asking if they'd be willing to take a look at my application material. Any advice, or should I just wait till next year? I applied to too few places this year, because I couldn't afford all the application fees. I'm saving up...
2012/04/28
[ "https://academia.stackexchange.com/questions/1298", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/736/" ]
For the most part, yes, it is too late to be considered for graduate admissions at most programs for this coming fall, as most schools have already made their decisions as to who they will admit. That said, if you are an exceptionally qualified candidate, and unusual circumstances have taken place, it *may* be possib...
The short answer is yes it is too late. The long answer is that usually only top programs have only one round of admission and other schools actually have also a spring round of admissions so you could trying going for that. This is not common but I found a few schools that do that, and some of them are actually decent...
1,211,682
I feel this is simple enough to have been asked before, but I couldn't find it if so. If B is an event and for each k, $\{B,A\_k\}$ is a pair of independent events, then is $\{B,\bigcup\_{k=1}^nA\_k\}$ a pair of independent events? Clearly if one can prove it for $A\_1$ and $A\_2$ then induction is easy, so this is w...
2015/03/29
[ "https://math.stackexchange.com/questions/1211682", "https://math.stackexchange.com", "https://math.stackexchange.com/users/225324/" ]
Let $x,y$ be two random numbers, each is either $0$ or $1$. Let $A\_1$ be the event $x=1$, $A\_2$ is the event $y=1$ and $B$ the event $x+y$ is even. $B$ is independent of both $A\_1$ and $A\_2$ but not their union.
If the $A\_k$ are mutually disjoint, then "yes", because in that case $$P(B\cap(\cup A\_k)) = P(\cup (B \cap A\_k)) = \sum P(B \cap A\_k) = \sum P(B)P(A\_k) = P(B) P(\cup A\_k)$$ and hence $B$ and $\cup A\_k$ are mutually independent. (Others have posted counterexamples in the non-disjoint case.)
12,525,815
I'm trying to use jQuery to load external pages into the current page without the user seeing the page load. When I call the page 'info.php' it is loaded into the `#content` div. That's what the script is supposed to do. The problem is that in the main page, which contains the script and the `#content` div, I already ...
2012/09/21
[ "https://Stackoverflow.com/questions/12525815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688011/" ]
if we are talking about performance, - then defiantly .htaccess/apache will be better/faster. if you wanna implement some logic on redirect, when probably it will be easier to do with php, using headers.
Definitely use the 301. It lets search engines know that the site is moved permanently and should transfer any "link weighting" from the old URL to the new one. Check out this info from [Google Webmasters](https://support.google.com/webmasters/bin/answer.py?hl=en&answer=83105) And this about [redirecting tons of links...
12,525,815
I'm trying to use jQuery to load external pages into the current page without the user seeing the page load. When I call the page 'info.php' it is loaded into the `#content` div. That's what the script is supposed to do. The problem is that in the main page, which contains the script and the `#content` div, I already ...
2012/09/21
[ "https://Stackoverflow.com/questions/12525815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688011/" ]
if we are talking about performance, - then defiantly .htaccess/apache will be better/faster. if you wanna implement some logic on redirect, when probably it will be easier to do with php, using headers.
Sorry I can't post comments yet. If the domain is the same, you should "bild" same site structure (same permalinks) and I guess use something like this: <http://drupal.org/project/blogger_importer> Then you should not use any redirects at all.
12,525,815
I'm trying to use jQuery to load external pages into the current page without the user seeing the page load. When I call the page 'info.php' it is loaded into the `#content` div. That's what the script is supposed to do. The problem is that in the main page, which contains the script and the `#content` div, I already ...
2012/09/21
[ "https://Stackoverflow.com/questions/12525815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688011/" ]
These scripts should be placed in the .htaccess file. ``` //*301 Redirect: xyz-site.com to www.xyz-site.com RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.xyz-site.com$ [NC] RewriteRule ^(.*)$ http://www.xyz-site.com/$1 [L,R=301] //*301 Redirect: www.xyz-site.com to xyz-site.com RewriteEngine On Rew...
Definitely use the 301. It lets search engines know that the site is moved permanently and should transfer any "link weighting" from the old URL to the new one. Check out this info from [Google Webmasters](https://support.google.com/webmasters/bin/answer.py?hl=en&answer=83105) And this about [redirecting tons of links...
12,525,815
I'm trying to use jQuery to load external pages into the current page without the user seeing the page load. When I call the page 'info.php' it is loaded into the `#content` div. That's what the script is supposed to do. The problem is that in the main page, which contains the script and the `#content` div, I already ...
2012/09/21
[ "https://Stackoverflow.com/questions/12525815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1688011/" ]
These scripts should be placed in the .htaccess file. ``` //*301 Redirect: xyz-site.com to www.xyz-site.com RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.xyz-site.com$ [NC] RewriteRule ^(.*)$ http://www.xyz-site.com/$1 [L,R=301] //*301 Redirect: www.xyz-site.com to xyz-site.com RewriteEngine On Rew...
Sorry I can't post comments yet. If the domain is the same, you should "bild" same site structure (same permalinks) and I guess use something like this: <http://drupal.org/project/blogger_importer> Then you should not use any redirects at all.
7,954,165
``` struct Foo {}; struct Bar : Foo {}; Foo &foo = Bar(); // without const ``` As it is written in the answers and comments to this [question](https://stackoverflow.com/questions/7953484/is-it-a-legal-notation-foo-foo-bar), I cannot assign a rvalue to a reference. However, I can compile this code (MSVC++ 2010) witho...
2011/10/31
[ "https://Stackoverflow.com/questions/7954165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/723845/" ]
Temporaries do not bind to non-constant references. That's just the way the language is designed. While there's in principle no technical obstruction to permitting non-constant access to temporaries, that would almost always be poor design, and quite often flat-out logically erroneous, so the standard just doesn't all...
You are assigning a temporary value to the reference. It is temporary because, here, `Bar()` acts like a function that returns a `Bar` instance which will evaporate at the and of the expression scope, which is here the end of line. It is highly dangerous and illegal, because dereferencing the `foo` creates an undefined...
3,031,399
INFORMIX-SQL 7.3 Perform Screen: Suppose I have a customer who wants to pay a $100 (7% tax included), what logic can I use so that when the cashier clerk enters $100 in the tax included sale amount, it will calculate the sale price and tax so that it adds up to $100. I have the following 3 field tags in my Perform sc...
2010/06/13
[ "https://Stackoverflow.com/questions/3031399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/366797/" ]
If your problem is the formula then sprice = stotal \* 100 / (100 + stax). For example $12345 \* 100 / (100 + 7) = $11537.38 and adding 7% to $11537.38 gives you $12345. Note of course that it may be impossible to find an exact amount of pennies that after adding a tax will give you a prescribed total.
To calculate disaggregated cost: sprice = stotal / (1 + .07) stax = sprice \* .07 Finally round both figures. Depending on the rounding algorithm you may need to apply a penny offset if the resulting rounding operation is off by a cent so that all figures add up.
3,031,399
INFORMIX-SQL 7.3 Perform Screen: Suppose I have a customer who wants to pay a $100 (7% tax included), what logic can I use so that when the cashier clerk enters $100 in the tax included sale amount, it will calculate the sale price and tax so that it adds up to $100. I have the following 3 field tags in my Perform sc...
2010/06/13
[ "https://Stackoverflow.com/questions/3031399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/366797/" ]
If your problem is the formula then sprice = stotal \* 100 / (100 + stax). For example $12345 \* 100 / (100 + 7) = $11537.38 and adding 7% to $11537.38 gives you $12345. Note of course that it may be impossible to find an exact amount of pennies that after adding a tax will give you a prescribed total.
Basic algebra arithmetic: 93% = 93 per centum which is Latin for 93/100 = 0.93 ``` Total receipt = p Sale price + Tax = p Sale price = 0.93p Tax = 0.07p ``` 4gl form: ``` sprice = transaction.sale_price,TYPE MONEY(7,2); stax = transaction.sale_tax,TYPE MONEY(7,2); stotal = transaction.sale_total,TYPE MONEY(7,2...
13,299,435
I have a button and icon on top of it. When i click on the button, the class succesfully toggles, however, when i click on the icon inside the button, the class doesn't toggle. Here is my html: ``` <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne-{{id}}"> <button id=...
2012/11/08
[ "https://Stackoverflow.com/questions/13299435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1752186/" ]
Use handler like this: ``` handleClass: function(event) { var $target; if (event.target.tagName.toUpperCase() == 'I') { $target = $(event.target); } else { $target = $(event.target).find('i'); } $target.toggleClass('right down'); } ```
You may want to try `event.currentTarget` instead of `event.target`. "This property will typically be equal to the this of the function." <http://api.jquery.com/event.currentTarget/>
64,711,601
I have been trying to solve polynomial addition with any variable in c so I get a bug when splitting the string and assigning it to an array after assigning my code crashes with the output ``` Enter the number of equations : 1 Enter the 1 Equation : 6x^2+3y^2+3x^1 Substring 6x Value 6x i : 0 j : 0 k : 0 Substring ...
2020/11/06
[ "https://Stackoverflow.com/questions/64711601", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12076801/" ]
``` for (int k = 0; k < 2; k++) { strcpy(coefficient_array[i][j][k], substr); // substr may be NULL here printf("Substring %s\n", substr); printf("Value %s\n", coefficient_array[i][j][k]); printf("i : %d j : %d k : %d\n", i, j, k); substr = strtok(NULL, "^+"); // substr may become NUL...
There is a strong issue in your program, `strtok` may return `NULL`. And `strcpy` crashes if you put null in parameter. ``` int main () { int no_of_equation; printf("Enter the number of equations : "); scanf("%d",&no_of_equation); char equation_arr[no_of_equation][59]; for (int i = 0;i < no_of_equation; i++...
58,346,633
Sorry everyone, not sure what I was thinking with my original question. I messed up the rows/name/convention. Update: Given the following alphanumeric input within the same ROW in Excel A1:E1 (columns separated with a "|" to illustrate each column of data within Row 1): A1:E1 Nike | Adidas | Under Armour | Champion...
2019/10/11
[ "https://Stackoverflow.com/questions/58346633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4584705/" ]
INDEX with some math: ``` =INDEX($A$1:$A$5,ROW(A$6)-ROW(A1)) ``` [![enter image description here](https://i.stack.imgur.com/TiLFV.png)](https://i.stack.imgur.com/TiLFV.png) Or INDEX with COUNTA (assuming no blank rows): ``` =INDEX($A$1:$A$5,COUNTA(A1:$A$5)) ``` [![enter image description here](https://i.stack.im...
FYI, if you are using Excel 2010 Professional Plus or later versions of Excel, you can use **Power Query** to transform the data in a few clicks. Steps are: 1. Load the data to Power Query Editor; 2. Transpose the data from columns to rows; 3. Use **Reverse Rows** function to reverse the order of rows; 4. Transpose t...
3,588,727
I have a question which I cannot seem to fathom out, as fairly newish to c++. I have a class, in which a set of variables are declared in the .h file and then initialised in the .cpp file. These same variables are used by a set of 3 other classes - and the compiler has them as out of scope. I am not sure how to link th...
2010/08/27
[ "https://Stackoverflow.com/questions/3588727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433428/" ]
If the WIDTH and HEIGHT are supposed to be constants, you can move them out of Smoke and just declare them as constants: `const int WIDTH = 300;` If they need to be members of Smoke but are still constants, then just declare them as `static const int WIDTH = 300` then `#include "Smoke.h"` in your Particle.cpp and refer...
The variables are declared within the scope of the Smoke class, so a) they're not global and b) you'll need an instance of a Smoke object in order to get your hands on them. You'd need to #include "Smoke.h", and create / obtain an instance of a Smoke object and then use e.g. `mySmoke.WIDTH`. If you want the variables ...
3,588,727
I have a question which I cannot seem to fathom out, as fairly newish to c++. I have a class, in which a set of variables are declared in the .h file and then initialised in the .cpp file. These same variables are used by a set of 3 other classes - and the compiler has them as out of scope. I am not sure how to link th...
2010/08/27
[ "https://Stackoverflow.com/questions/3588727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433428/" ]
If the WIDTH and HEIGHT are supposed to be constants, you can move them out of Smoke and just declare them as constants: `const int WIDTH = 300;` If they need to be members of Smoke but are still constants, then just declare them as `static const int WIDTH = 300` then `#include "Smoke.h"` in your Particle.cpp and refer...
An instance of the Smoke class will be needed if you would like to access WIDTH AND HEIGHT as they are currently defined because they are part of the smoke class. Change your method to receive a Smoke instance and then use it in the method as follows: ``` void Particle::reposition(Smoke& smoke) { x = smoke.WIDTH/2+...
17,572,628
I need to read from a file in C and put every word on an array, spaces should not be included on the word (when it reaches a space it should end copying that word), but \n MUST BE INCLUDED whenever it is found. ``` fscanf(arquivo,"%s",palavras[i].string); ``` is almost working, but it is not including \n when it is ...
2013/07/10
[ "https://Stackoverflow.com/questions/17572628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2568851/" ]
A way to change the `environment_variable` was introduced [in this commit](https://github.com/javan/whenever/commit/a5e652c02f4da24635f923d20c2e41cfed21d1b8) as :env\_argument and renamed :environment\_variable [in this commit](https://github.com/javan/whenever/commit/a8ba321e54b779ba4710012dd9a540d8d3912db1) and first...
Put this in your schedule.rb file ``` env:PATH,'the/path/of/your/server/' ```
28,762,042
I am using the following code it just eliminating the HTML tags but does not format string. How to format as it is shown in Html. ``` -(NSString *)convertHTML:(NSString *)html { NSScanner *myScanner; NSString *text = nil; myScanner = [NSScanner scannerWithString:html]; while ([myScanner isAtEnd] == N...
2015/02/27
[ "https://Stackoverflow.com/questions/28762042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3176076/" ]
Try this one.this might be helpful ``` textview= [[UITextView alloc]initWithFrame:CGRectMake(10, 130, 250, 170)]; NSString *str = [NSString stringWithFormat:@"<font color='red'>A</font><br/> shared photo of <font color='red'>B</font> with <font color='red'>C</font>, <font color='red'>D</font> "]; [textview set...
i would recommend using a third party library for that like <https://github.com/mwaterfall/MWFeedParser/blob/master/Classes/NSString%2BHTML.m> and than later use it like this: ``` NSString *string = [@"<b>Your HTML String</b>" stringByConvertingHTMLToPlainText]; ```
28,762,042
I am using the following code it just eliminating the HTML tags but does not format string. How to format as it is shown in Html. ``` -(NSString *)convertHTML:(NSString *)html { NSScanner *myScanner; NSString *text = nil; myScanner = [NSScanner scannerWithString:html]; while ([myScanner isAtEnd] == N...
2015/02/27
[ "https://Stackoverflow.com/questions/28762042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3176076/" ]
Try this one.this might be helpful ``` textview= [[UITextView alloc]initWithFrame:CGRectMake(10, 130, 250, 170)]; NSString *str = [NSString stringWithFormat:@"<font color='red'>A</font><br/> shared photo of <font color='red'>B</font> with <font color='red'>C</font>, <font color='red'>D</font> "]; [textview set...
There might be a better way of doing this but here is my run on this. 1. scan the html string for the html tags 2. create attributed string for each html tag 3. find all the occurrences of the tag in the string and apply the attributes to them in attributed string. Here is my sample code to detect break and bold tag ...
28,762,042
I am using the following code it just eliminating the HTML tags but does not format string. How to format as it is shown in Html. ``` -(NSString *)convertHTML:(NSString *)html { NSScanner *myScanner; NSString *text = nil; myScanner = [NSScanner scannerWithString:html]; while ([myScanner isAtEnd] == N...
2015/02/27
[ "https://Stackoverflow.com/questions/28762042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3176076/" ]
Try this one.this might be helpful ``` textview= [[UITextView alloc]initWithFrame:CGRectMake(10, 130, 250, 170)]; NSString *str = [NSString stringWithFormat:@"<font color='red'>A</font><br/> shared photo of <font color='red'>B</font> with <font color='red'>C</font>, <font color='red'>D</font> "]; [textview set...
``` -(NSString *) stringByStrippingHTML { NSRange r; NSString *s = [[self copy] autorelease]; while ((r = [s rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch]).location != NSNotFound) s = [s stringByReplacingCharactersInRange:r withString:@""]; return s; } ``` use this method its work for me
28,762,042
I am using the following code it just eliminating the HTML tags but does not format string. How to format as it is shown in Html. ``` -(NSString *)convertHTML:(NSString *)html { NSScanner *myScanner; NSString *text = nil; myScanner = [NSScanner scannerWithString:html]; while ([myScanner isAtEnd] == N...
2015/02/27
[ "https://Stackoverflow.com/questions/28762042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3176076/" ]
Try this one.this might be helpful ``` textview= [[UITextView alloc]initWithFrame:CGRectMake(10, 130, 250, 170)]; NSString *str = [NSString stringWithFormat:@"<font color='red'>A</font><br/> shared photo of <font color='red'>B</font> with <font color='red'>C</font>, <font color='red'>D</font> "]; [textview set...
NSAttributedString can be initialised with HTML and will display it just fine. If you want to remove tags, code that replaces tags in the string repeatedly runs in O (n^2), that is it will crawl for large strings. You need to have a mutable output string, and append bits to it as needed, to get linear time. You can...
237,636
Why does it seem unimportant to use a proper distance metric for clustering, i.e. (i) positive, (ii) zero iff the 2 operands are equal, and (iii) verifying the triangle inequality? I'm thinking in particular of condition (iii), which seems commonly ignored. In particular, spherical k-means clustering, as defined in a ...
2016/09/29
[ "https://stats.stackexchange.com/questions/237636", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/132863/" ]
1. Cosine is equivalent to (squared) Euclidean distance on L2 normalized data. So spherical k-means *is* using a distance. But it's actually using *squared* Euclidean distance, which does not satisfy the triangle inequality (and matematicians will kill kittens every time you call it a distance). While the nearest cente...
1. Without the triangle inequality, is not a distance measure. 2. There are 4 conditions: * Non-negativity: d(X,Y)>=0 * Symmetry: d(X,Y)=d(Y,X) * The triangular inequality * d(X,X)=0. Most of them are straigthforward. But a distance has to have all 4. Try $ d(X,Y) = (\sum\_{i=1}^{n}(X\_i-Y\_i)^r)^{(1/r)} $ as a g...
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
you should learn about child themes. the concept of it is having a main theme - which gets updated - and a child theme that'll you'll modify, add content, create different templates & styles... everything to your needs. I'd recommend taking some minutes to read this throughtfully: <https://codex.wordpress.org/Child_T...
you could do something like `git clone https://github.com/Automattic/_s.git` create directory `my_framework` with `mkdir my_framework`(if on windows) `cd my_framework` `git init` `git remote add <_s> <PATH to your local underscore>` `git pull`(to get latest version of underscore) again: `mkdir...
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
> > The goal is to keep everything updated with any underscores update, while changing and modifying the framework and the themes > > > That is called the [triangular workflow](https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows): [![https://i.stack.imgur.com/Lx7do.png](http...
you should learn about child themes. the concept of it is having a main theme - which gets updated - and a child theme that'll you'll modify, add content, create different templates & styles... everything to your needs. I'd recommend taking some minutes to read this throughtfully: <https://codex.wordpress.org/Child_T...
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
you should learn about child themes. the concept of it is having a main theme - which gets updated - and a child theme that'll you'll modify, add content, create different templates & styles... everything to your needs. I'd recommend taking some minutes to read this throughtfully: <https://codex.wordpress.org/Child_T...
Assuming you using a terminal, cd to the themes directory: ``` cd [PROJECT]/wp-content/themes ``` Now clone \_s to your project: ``` git clone git@github.com:Automattic/_s.git [THENE-NAME] ``` After the clone ends you can start working with your new theme. cd to theme directory: ``` cd [THENE-NAME] ``` and cre...
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
you should learn about child themes. the concept of it is having a main theme - which gets updated - and a child theme that'll you'll modify, add content, create different templates & styles... everything to your needs. I'd recommend taking some minutes to read this throughtfully: <https://codex.wordpress.org/Child_T...
What you want to do is called *nested git repo*. GitHub does not allow nested repositories. You can use [GitSubmodule](https://stackoverflow.com/questions/1811730/how-do-i-work-with-a-git-repository-within-another-repository) or [subtree](https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)....
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
> > The goal is to keep everything updated with any underscores update, while changing and modifying the framework and the themes > > > That is called the [triangular workflow](https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows): [![https://i.stack.imgur.com/Lx7do.png](http...
you could do something like `git clone https://github.com/Automattic/_s.git` create directory `my_framework` with `mkdir my_framework`(if on windows) `cd my_framework` `git init` `git remote add <_s> <PATH to your local underscore>` `git pull`(to get latest version of underscore) again: `mkdir...
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
Assuming you using a terminal, cd to the themes directory: ``` cd [PROJECT]/wp-content/themes ``` Now clone \_s to your project: ``` git clone git@github.com:Automattic/_s.git [THENE-NAME] ``` After the clone ends you can start working with your new theme. cd to theme directory: ``` cd [THENE-NAME] ``` and cre...
you could do something like `git clone https://github.com/Automattic/_s.git` create directory `my_framework` with `mkdir my_framework`(if on windows) `cd my_framework` `git init` `git remote add <_s> <PATH to your local underscore>` `git pull`(to get latest version of underscore) again: `mkdir...
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
> > The goal is to keep everything updated with any underscores update, while changing and modifying the framework and the themes > > > That is called the [triangular workflow](https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows): [![https://i.stack.imgur.com/Lx7do.png](http...
Assuming you using a terminal, cd to the themes directory: ``` cd [PROJECT]/wp-content/themes ``` Now clone \_s to your project: ``` git clone git@github.com:Automattic/_s.git [THENE-NAME] ``` After the clone ends you can start working with your new theme. cd to theme directory: ``` cd [THENE-NAME] ``` and cre...
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
> > The goal is to keep everything updated with any underscores update, while changing and modifying the framework and the themes > > > That is called the [triangular workflow](https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows): [![https://i.stack.imgur.com/Lx7do.png](http...
What you want to do is called *nested git repo*. GitHub does not allow nested repositories. You can use [GitSubmodule](https://stackoverflow.com/questions/1811730/how-do-i-work-with-a-git-repository-within-another-repository) or [subtree](https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)....
41,321,414
I have some basic git knowledge but I'm not sure how to accomplish this. I am trying to clone (?) github WordPress starter theme [underscores](https://github.com/automattic/_s). The idea is to create a basic framework **based** (with some modifications) on that repository. Then create other themes with that framework ...
2016/12/25
[ "https://Stackoverflow.com/questions/41321414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176359/" ]
Assuming you using a terminal, cd to the themes directory: ``` cd [PROJECT]/wp-content/themes ``` Now clone \_s to your project: ``` git clone git@github.com:Automattic/_s.git [THENE-NAME] ``` After the clone ends you can start working with your new theme. cd to theme directory: ``` cd [THENE-NAME] ``` and cre...
What you want to do is called *nested git repo*. GitHub does not allow nested repositories. You can use [GitSubmodule](https://stackoverflow.com/questions/1811730/how-do-i-work-with-a-git-repository-within-another-repository) or [subtree](https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)....
5,207,370
I have a program that classifies text and would like to make it interactive with a user on the front-end of my django site. The problem is it takes 20 seconds for the program to load the training set and get going, and that's not feasible every time someone enters input. Instead, I'd like Django to load the program o...
2011/03/05
[ "https://Stackoverflow.com/questions/5207370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400646/" ]
It's possible that [Celery](http://celeryproject.org/) would be appropriate here. There is Django integration available with [django-celery](http://ask.github.com/django-celery/).
As Jim noticed *celery* is one of the best options you have for asynchronus task management, but if you want to avoid celery & its dependecies overhead you could just add a status field on the model the process takes place (e.g. *text\_processed* boolean field with default=False) and create an application [management c...
46,723,084
I have a question of neural network Let's say I have 60 training, 20 validation, and 20 test set. For each epoch, I run through the 60 training set samples while adjusting the weights on each sample and also calculating the error on each validation sample. **So as I know, Weight updates occur in training set (Not val...
2017/10/13
[ "https://Stackoverflow.com/questions/46723084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8769184/" ]
Try `pip install pywin32-ctypes`.
PyInstaller is an application not a package. You can use it without installing it in your PC. Just download it and extract it. ``` cd pyinstaller ``` The package you want to is `newscript.py`. I saved it in the pyinstaller folder. Now in order to create the executable file out of this script just run ``` `python ...
45,029,500
Say I have a pivoted dataframe of the form ``` Value Qty Code Color Blue Green Red Blue Green Red Blue Green Red Date 2017-07-01 0.0 1.1 0.0 0.0 12.0 0.0 0 abc 0 2017-07-03 2.3 1.3 0.0 3.0...
2017/07/11
[ "https://Stackoverflow.com/questions/45029500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5753159/" ]
In the Glucose Service (<https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.glucose.xml>) there is 3 mandatory characteristics. One of them is Glucose Measurement where you get glucose reading notifications. In order to get notifications you have to request for them using Rec...
The characteristic you are trying to 'read' is most probably NOT readable, but can be delivered through a 'Notification' or an 'Indication' callback method. You'd better check first if this Characteristic is 'Notifiable' and/or 'Indicatable' and then, set up the required callback events in your code: - write the Descri...
825,988
My company is revamping their website and subdomains with a new platform which requires us to upgrade to a more performant LAMP server. That being said, I want to re-use the wildcard SSL that was originally created for use with our original LAMP stack. My intention is to copy over the intermediate and primary certifi...
2017/01/12
[ "https://serverfault.com/questions/825988", "https://serverfault.com", "https://serverfault.com/users/197788/" ]
First, let's clarify something: your certificates are **public**. Anyone can freely download them from your server. This is by design. The only file that needs to be kept truly private is the private key file that you generated when initially obtaining the certificate. Anyone that manages to get their hands on this fil...
There is nothing fundamentally wrong with securely copying your old certificate & key, so long as you are certain you understand the distinction as @EEAA clarified. Yet I believe it is reasonable to establish the practice of *always* re-keying (re-issue) the certificate when doing some sort of big move that dwarfs the...
74,456,260
I'm trying to update state inside a nested array with a map function and spread operator, but i don't understand how to get the key in the key/value pair to select a nested object . In below code, when i try to implement multiple selection but i acheive only single selection in innerarray1 and how to update innerarray...
2022/11/16
[ "https://Stackoverflow.com/questions/74456260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What's the problem? Add margins to `.child2`. ```css .parent > div { min-height: 50px; border: 1px solid black; } .child2 { margin: 0 50px; } ``` ```html <div class='parent'> <div class='child1'></div> <div class='child2'></div> </div> ```
You can give him a specific id or specific class ``` <div>1</div> <div>2</div> <div id="div3">3</div> <div>4</div> ``` and in css ``` #div3{ color:red; } ```
74,456,260
I'm trying to update state inside a nested array with a map function and spread operator, but i don't understand how to get the key in the key/value pair to select a nested object . In below code, when i try to implement multiple selection but i acheive only single selection in innerarray1 and how to update innerarray...
2022/11/16
[ "https://Stackoverflow.com/questions/74456260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can select specific child by nth-child selector, without having to assigning class name to each child seperately. ``` .parent .child:nth-child(2){padding: 10px;} ```
You can give him a specific id or specific class ``` <div>1</div> <div>2</div> <div id="div3">3</div> <div>4</div> ``` and in css ``` #div3{ color:red; } ```
16,805,203
i have a html form which contains the following elements 1) a list box (containing a list of filenames) ``` s1.txt2013 s2.txt2013 s3.txt2012 s4.txt2012 ``` 2) a text box (user enters a pattern say 2013) 3) a button by default list box contains a the above mentioned 4 files names. when a user enter a a te...
2013/05/29
[ "https://Stackoverflow.com/questions/16805203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2122220/" ]
Maybe you need two listboxes (select tags), one of them be hidden as main data source and one of them visible for users, you can use following code and add `onclick="buttonClicked()"` to you button attributes. ``` function buttonClicked () { var textbox = document.getElementById('YOUR TEXTBOX ID'), listbox...
Have you tried using .test? To me this would be a good approach. <http://www.w3schools.com/jsref/jsref_regexp_test.asp> ``` <script> var str="Hello world!"; //look for "Hello" var patt=/Hello/g; var result=patt.test(str); document.write("Returned value: " + result); //look for "W3Schools" patt=/W3Schools/g; result...
94,368
Which prefix is appropriate to use before family relatives(nieces, nephews and etc) to refer to the generation before them? For the sake of clarification and better understanding, I'll give a few examples. Example 1: Grand-niece or Great-niece? Example 2: Grand-nephew or Great-nephew? Example 3: Grand-uncle or Grea...
2016/06/21
[ "https://ell.stackexchange.com/questions/94368", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/17669/" ]
Great going up, grand going down is the general rule. Those of us that read the Paddington Bear stories to our children are well acquainted with Great Aunt Lucy... [![Relationship naming explained](https://i.stack.imgur.com/XP2Rx.gif)](https://i.stack.imgur.com/XP2Rx.gif) However - I have also seen the term grand-unc...
1. Great-niece. 2. Great-nephew. 3. Great-uncle. 4. Great-aunt. Your sibling's great-grandchildren are your great-great-nieces and great-great-nephews, and your great-grandparents' siblings are your great-great-uncles and great-great-aunts. The element "grand-" is not involved anywhere here. "Grand-" is used only for...
14,963,228
I had issues with my query that took 17 seconds to execute (350k rows): ``` SELECT idgps_unit, MAX(dt) FROM gps_unit_location GROUP BY 1 ``` Explain ``` 1 SIMPLE gps_unit_location index fk_gps2 5 422633 ``` After playing with it, I came with this solution that takes 1second: ...
2013/02/19
[ "https://Stackoverflow.com/questions/14963228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1076389/" ]
`> Can some one please explain what is actually happening?` It's an [operation precedence](http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence) problem: ``` printf("%d",(*(foo->bar))[1]); // <=== This is what you wanted ``` Note the extra parens grouping the deference of the `foo->bar` befor...
The array indexing operator `[]` has a higher precedence than the deference `*` operator. So, that line means "deference the `int *` at index 1 of the `foo->bar` array". But of course, you only have an array of 1 `int *` (index 0), so a seg fault results.
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Simply remove the dot for the relative import and do: ``` from p_02_paying_debt_off_in_a_year import compute_balance_after ```
If you have created directory and sub-directory, follow the steps below and please keep in mind all directory must have `__init__.py` to get it recognized as a directory. 1. In your script, include `import sys` and `sys.path`, you will be able to see all the paths available to Python. You must be able to see your curr...
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Remove the dot and import absolute\_import in the beginning of your file ``` from __future__ import absolute_import from p_02_paying_debt_off_in_a_year import compute_balance_after ```
If you have created directory and sub-directory, follow the steps below and please keep in mind all directory must have `__init__.py` to get it recognized as a directory. 1. In your script, include `import sys` and `sys.path`, you will be able to see all the paths available to Python. You must be able to see your curr...
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Simply remove the dot for the relative import and do: ``` from p_02_paying_debt_off_in_a_year import compute_balance_after ```
Remove the dot and import absolute\_import in the beginning of your file ``` from __future__ import absolute_import from p_02_paying_debt_off_in_a_year import compute_balance_after ```
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
I have the same issue as you did. I think the problem is that you used relative import in `in-package import`. There is no `__init__.py` in your directory. So just import as Moses answered above. The core issue I think is when you import with a dot: ``` from .p_02_paying_debt_off_in_a_year import compute_balance_afte...
If you have created directory and sub-directory, follow the steps below and please keep in mind all directory must have `__init__.py` to get it recognized as a directory. 1. In your script, include `import sys` and `sys.path`, you will be able to see all the paths available to Python. You must be able to see your curr...
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Try to run it as: `python3 -m p_03_using_bisection_search`
Remove the dot and import absolute\_import in the beginning of your file ``` from __future__ import absolute_import from p_02_paying_debt_off_in_a_year import compute_balance_after ```
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
I have the same issue as you did. I think the problem is that you used relative import in `in-package import`. There is no `__init__.py` in your directory. So just import as Moses answered above. The core issue I think is when you import with a dot: ``` from .p_02_paying_debt_off_in_a_year import compute_balance_afte...
Just use the name of the main folder which the .py file is in. ``` from problem_set_02.p_02_paying_debt_off_in_a_year import compute_balance_after ```
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Try to run it as: `python3 -m p_03_using_bisection_search`
Just use the name of the main folder which the .py file is in. ``` from problem_set_02.p_02_paying_debt_off_in_a_year import compute_balance_after ```
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Try to run it as: `python3 -m p_03_using_bisection_search`
If you have created directory and sub-directory, follow the steps below and please keep in mind all directory must have `__init__.py` to get it recognized as a directory. 1. In your script, include `import sys` and `sys.path`, you will be able to see all the paths available to Python. You must be able to see your curr...
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Simply remove the dot for the relative import and do: ``` from p_02_paying_debt_off_in_a_year import compute_balance_after ```
Try to run it as: `python3 -m p_03_using_bisection_search`
41,816,973
I am trying to run a module from the console. The structure of my directory is this: [![enter image description here](https://i.stack.imgur.com/naRKa.png)](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the `problem_set_02` directory using: ``` $ python3 p_0...
2017/01/23
[ "https://Stackoverflow.com/questions/41816973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705840/" ]
Simply remove the dot for the relative import and do: ``` from p_02_paying_debt_off_in_a_year import compute_balance_after ```
Just use the name of the main folder which the .py file is in. ``` from problem_set_02.p_02_paying_debt_off_in_a_year import compute_balance_after ```
666,552
My panel clock is showing time in UTC. This is recent behavior, and I believe it is a recent regression, but I'm not 100% sure so I'm posing this as a question first. Here's a screenshot of the clock in the panel, along with the clock settings. [![Panel clock in UTC, timezone is correct (PDT)](https://i.stack.imgur.c...
2015/08/27
[ "https://askubuntu.com/questions/666552", "https://askubuntu.com", "https://askubuntu.com/users/121284/" ]
Right click on the widget and select **Digital Clock Settings > Time Zones** and make a selection in *Clock defaults to*.
In the end I got desperate and just grepped for UTC in my home directory. So I discovered `~/.kde/share/config/plasma-desktop-appletsrc` This config file, for me, contained these two lines: ```none timezone=UTC timeZones=UTC ``` Removing these lines and logging out and back in fixed the problem.
666,552
My panel clock is showing time in UTC. This is recent behavior, and I believe it is a recent regression, but I'm not 100% sure so I'm posing this as a question first. Here's a screenshot of the clock in the panel, along with the clock settings. [![Panel clock in UTC, timezone is correct (PDT)](https://i.stack.imgur.c...
2015/08/27
[ "https://askubuntu.com/questions/666552", "https://askubuntu.com", "https://askubuntu.com/users/121284/" ]
In the end I got desperate and just grepped for UTC in my home directory. So I discovered `~/.kde/share/config/plasma-desktop-appletsrc` This config file, for me, contained these two lines: ```none timezone=UTC timeZones=UTC ``` Removing these lines and logging out and back in fixed the problem.
This hit me over the weekend - Friday afternoon, it showed the correct time; Monday morning, it showed UTC. I fixed it by right clicking the time, selecting "Digital Clock Settings", then checking "Show time zone" and clicking "Apply". The "Show time zone" check box was unchecked when I looked at the settings - I don...
666,552
My panel clock is showing time in UTC. This is recent behavior, and I believe it is a recent regression, but I'm not 100% sure so I'm posing this as a question first. Here's a screenshot of the clock in the panel, along with the clock settings. [![Panel clock in UTC, timezone is correct (PDT)](https://i.stack.imgur.c...
2015/08/27
[ "https://askubuntu.com/questions/666552", "https://askubuntu.com", "https://askubuntu.com/users/121284/" ]
Right click on the widget and select **Digital Clock Settings > Time Zones** and make a selection in *Clock defaults to*.
This hit me over the weekend - Friday afternoon, it showed the correct time; Monday morning, it showed UTC. I fixed it by right clicking the time, selecting "Digital Clock Settings", then checking "Show time zone" and clicking "Apply". The "Show time zone" check box was unchecked when I looked at the settings - I don...
18,122,062
``` package mypackage.pack1; class PackClass { public PackClass() { System.out.println("I'm creating a packaged class"); } } ``` then import the package containing this class. Can the public constructor be used even though the class is not public? Or do i need to be inside the same package to use it? I couldn't...
2013/08/08
[ "https://Stackoverflow.com/questions/18122062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2642553/" ]
You can not access the public constructor from a different package since the class modifier is default.
The top level modifier is valid, i.e. in your example *default modifier* is valid even though the constructor is public. Try interpreting your code like this: *default* class A { *public* A() {} } Your public constructor is **encapsulated** within a default-level accessible class, so how can a class from a different...
44,495,741
I've read [this interesting topic](http://www.reflectivesoftware.com/2015/07/26/unit-of-work-entity-framework-unity-ddd-hexagonal-onion/) in order to study DDD and found out a new idea that the author said "*the argument for not making a ‘ProductReviews’ collection inside the Product class*". Because "*There are no tru...
2017/06/12
[ "https://Stackoverflow.com/questions/44495741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6714652/" ]
> > Does it compatible with DDD? > > > Yes, separating the elements of a logical collection of ProductReviews as aggregates outside of the Product aggregate is compatible with DDD. That said, when separating things this way, you wouldn't normally try to insist upon a transactional cascade delete, as shown in the ...
From cqrs.nu > > **I know aggregates are transaction boundaries, but I really need to transactionally update two aggregates in the same transaction. What > should I do?** > > > You should re-think the following: > > > * Your aggregate boundaries. > * The responsibilities of each aggregate. > * What you can get a...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
The entire point is that it's **NOT** very clear what "much less than" is. What is "much less than"? In some contexts $1\ll 2$ and in others $ 1\not \ll 2$ but $1 \ll 100000$ and in others, even $1\not\ll 100000$. What precisely makes something "much less than"? In most contexts, $\ll$ is used in approximation. For ex...
Par example: Choose a priori positive number $N>1$ such that $0<x\ll y$. If $\frac{y-x}{x}>N$ for then $y>x\cdot(1+N)$. With repect to N, your 2nd example does not fit this requirement: $10^{10^{10^{10^{11}}}}\ll10^{10^{10^{10^{11}}}}+9999999999$. I had in mind $\frac{N-O}{O}\times 100\%$, the relative change has to ov...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
Let me chip in from a physicists vantage... It's all about orders of magnitude. Are the observed effects so different in order that your simplified model is *sufficiently* accurate? In this case, sufficient depends on how closely you need to look and how feasible it is to even look deeper. You'll rarely if ever see th...
Much less than, much more than is useful in mathematical formulas applying to everyday life. If I must find a life saving value using a formula, which has a part that doesn't contribute significantly to the end result, there it has a meaning.(<< or >>). Otherwise you might lose precious life saving time It doesn't hav...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
In certain contexts (primarily in Number Theory), $a(x) \ll b(x)$ is an alternative notation to $a(x) = O(b(x))$. See e.g. [this question](https://math.stackexchange.com/questions/199753/how-does-one-read-aloud-vinogradovs-notation-ll-and-ll-epsilon).
Much less than, much more than is useful in mathematical formulas applying to everyday life. If I must find a life saving value using a formula, which has a part that doesn't contribute significantly to the end result, there it has a meaning.(<< or >>). Otherwise you might lose precious life saving time It doesn't hav...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
The entire point is that it's **NOT** very clear what "much less than" is. What is "much less than"? In some contexts $1\ll 2$ and in others $ 1\not \ll 2$ but $1 \ll 100000$ and in others, even $1\not\ll 100000$. What precisely makes something "much less than"? In most contexts, $\ll$ is used in approximation. For ex...
Let me chip in from a physicists vantage... It's all about orders of magnitude. Are the observed effects so different in order that your simplified model is *sufficiently* accurate? In this case, sufficient depends on how closely you need to look and how feasible it is to even look deeper. You'll rarely if ever see th...