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
45,387,842
I keepy getting TypeError: testsession.testset[0].athletes is undefined - i have tried lots of different ways, is it not possible to have an array of arrays of objects ```js var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; test...
2017/07/29
[ "https://Stackoverflow.com/questions/45387842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8020258/" ]
The testset[0] is a string. Make it an object ``` var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; testsession.testset = testset; //Earlier you pushed 400m directly which is a string hence causing the error later on testsession.tes...
I think you are working code like this. ``` <script > var testsession = {}; testsession.testset = []; testsession.testset.push({testsetname:"week9"}); testsession.testset[0].list = []; testsession.testset[0].list.push({distance:"400M"}); testsession.testset[0].list[0].athletes = []; testsession.testset[0].list[0].a...
45,387,842
I keepy getting TypeError: testsession.testset[0].athletes is undefined - i have tried lots of different ways, is it not possible to have an array of arrays of objects ```js var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; test...
2017/07/29
[ "https://Stackoverflow.com/questions/45387842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8020258/" ]
`testsession.testset[0]` is a primitive value, a string. The following statement will therefore not have the effect you may think it has: ``` testsession.testset[0].athletes = athletes; ``` What happens here? The primitive at the left has no `athletes` property, but JavaScript will coerce it to a `String` object, t...
I think you are working code like this. ``` <script > var testsession = {}; testsession.testset = []; testsession.testset.push({testsetname:"week9"}); testsession.testset[0].list = []; testsession.testset[0].list.push({distance:"400M"}); testsession.testset[0].list[0].athletes = []; testsession.testset[0].list[0].a...
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
``` // Store integer 182 int intValue = 182; // Convert integer 182 as a hex in a string variable string hexValue = intValue.ToString("X"); // Convert the hex string back to the number int intAgain = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber); ``` from <http://www.geekpedia.com/KB8_How-do-I-conv...
``` string HexFromID(int ID) { return ID.ToString("X"); } int IDFromHex(string HexID) { return int.Parse(HexID, System.Globalization.NumberStyles.HexNumber); } ``` I really question the value of this, though. You're stated goal is to make the value shorter, which it will, but that isn't a goal in itself. You...
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
Try the following to convert it to hex ``` public static string ToHex(this int value) { return String.Format("0x{0:X}", value); } ``` And back again ``` public static int FromHex(string value) { // strip the leading 0x if ( value.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) { value = value.Substr...
Like @Joel C, I think this is an AB problem. There’s an existing algorithm that I think suits the need as described better which is uuencode, which I’m sure has many public domain implementations, perhaps tweaked to eliminate characters that looks very similar like 0/O. Likely to produce significantly shorter strings. ...
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
Use: ``` int myInt = 2934; string myHex = myInt.ToString("X"); // Gives you hexadecimal int myNewInt = Convert.ToInt32(myHex, 16); // Back to int again. ``` See *[How to: Convert Between Hexadecimal Strings and Numeric Types (C# Programming Guide)](http://msdn.microsoft.com/en-us/library/bb311038.aspx)* for more i...
I created my own solution for converting int to Hex string and back before I found this answer. Not surprisingly, it's considerably faster than the .net solution since there's less code overhead. ``` /// <summary> /// Convert an integer to a string of hexidecimal numbers. /// </summary> ...
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
``` // Store integer 182 int intValue = 182; // Convert integer 182 as a hex in a string variable string hexValue = intValue.ToString("X"); // Convert the hex string back to the number int intAgain = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber); ``` from <http://www.geekpedia.com/KB8_How-do-I-conv...
int to hex: > > int a = 72; > > > Console.WriteLine("{0:X}", a); > > > hex to int: > > int b = 0xB76; > > > Console.WriteLine(b); > > >
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
Like @Joel C, I think this is an AB problem. There’s an existing algorithm that I think suits the need as described better which is uuencode, which I’m sure has many public domain implementations, perhaps tweaked to eliminate characters that looks very similar like 0/O. Likely to produce significantly shorter strings. ...
int to hex: > > int a = 72; > > > Console.WriteLine("{0:X}", a); > > > hex to int: > > int b = 0xB76; > > > Console.WriteLine(b); > > >
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
``` int valInt = 12; Console.WriteLine(valInt.ToString("X")); // C ~ possibly single-digit output Console.WriteLine(valInt.ToString("X2")); // 0C ~ always double-digit output ```
To Hex: ``` string hex = intValue.ToString("X"); ``` To int: ``` int intValue = int.Parse(hex, System.Globalization.NumberStyles.HexNumber) ```
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
``` // Store integer 182 int intValue = 182; // Convert integer 182 as a hex in a string variable string hexValue = intValue.ToString("X"); // Convert the hex string back to the number int intAgain = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber); ``` from <http://www.geekpedia.com/KB8_How-do-I-conv...
To Hex: ``` string hex = intValue.ToString("X"); ``` To int: ``` int intValue = int.Parse(hex, System.Globalization.NumberStyles.HexNumber) ```
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
``` string HexFromID(int ID) { return ID.ToString("X"); } int IDFromHex(string HexID) { return int.Parse(HexID, System.Globalization.NumberStyles.HexNumber); } ``` I really question the value of this, though. You're stated goal is to make the value shorter, which it will, but that isn't a goal in itself. You...
Like @Joel C, I think this is an AB problem. There’s an existing algorithm that I think suits the need as described better which is uuencode, which I’m sure has many public domain implementations, perhaps tweaked to eliminate characters that looks very similar like 0/O. Likely to produce significantly shorter strings. ...
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
**NET FRAMEWORK** > > Very well explained and few programming lines > GOOD JOB > > > ``` // Store integer 182 int intValue = 182; // Convert integer 182 as a hex in a string variable string hexValue = intValue.ToString("X"); // Convert the hex string back to the number int intAgain = int.Parse(hexValue, System.G...
Print integer in hex-value with zero-padding (if needed) : ``` int intValue = 1234; Console.WriteLine("{0,0:D4} {0,0:X3}", intValue); ``` <https://learn.microsoft.com/en-us/dotnet/standard/base-types/how-to-pad-a-number-with-leading-zeros>
1,139,972
I am looking for ideas on the best way to persist an array of values from one web session to the next. I will be populating a Checkbox list and would like to persist the last set of selected checkboxes to the next session. (this is meant to save time for the user since they will likely always select the same subset of ...
2009/07/16
[ "https://Stackoverflow.com/questions/1139972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61623/" ]
Use: ``` int myInt = 2934; string myHex = myInt.ToString("X"); // Gives you hexadecimal int myNewInt = Convert.ToInt32(myHex, 16); // Back to int again. ``` See *[How to: Convert Between Hexadecimal Strings and Numeric Types (C# Programming Guide)](http://msdn.microsoft.com/en-us/library/bb311038.aspx)* for more i...
**NET FRAMEWORK** > > Very well explained and few programming lines > GOOD JOB > > > ``` // Store integer 182 int intValue = 182; // Convert integer 182 as a hex in a string variable string hexValue = intValue.ToString("X"); // Convert the hex string back to the number int intAgain = int.Parse(hexValue, System.G...
28,776,888
I want to define an infinite tree in Haskell using infinitree :: Tree, but want to set a pattern up for each node, defining what each node should be. The pattern is 1 more then then its parent. I am struggling on how to set up a tree to begin with, and how and where to define the pattern of each node? Thank you
2015/02/28
[ "https://Stackoverflow.com/questions/28776888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4616611/" ]
Infinite data structures can generally be defined by functions which call themselves but have no base case. Usually these functions don't need to pattern match on their arguments. For example, a list equal to `[1..]` can be written as ``` infiniteList :: [Int] infiniteList = go 1 where go n = n : go (n+1) ``` Y...
A type for infinite binary trees with no leaves: ``` data Tree a = Tree (Tree a) a (Tree a) ``` One general pattern for doing this sort of thing is called `unfold`. For this particular type: ``` unfold :: (a -> (a,b,a)) -> a -> Tree b ``` Can you see how to define this function and use it for your purpose?
53,304,021
How can I open the same link 10 times in 10 tabs by just clicking on button? Is php required to do this and if so can you provide a code sample? Below is an example of my code: ```html <html> <body> <script language="javascript"> function kishan() { window.ope...
2018/11/14
[ "https://Stackoverflow.com/questions/53304021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10652898/" ]
A 1D array is itself once transposed, contrary to Matlab where a 1D array doesn't exist and is at least 2D. What you want is to reshape it: ``` my_array.reshape(-1, 1) ``` Or: ``` my_array.reshape(1, -1) ``` Depending on what kind of vector you want (column or row vector). The `-1` is a broadcast-like, using al...
IIUC, use `reshape` ``` my_array.reshape(my_array.size, -1) ```
53,304,021
How can I open the same link 10 times in 10 tabs by just clicking on button? Is php required to do this and if so can you provide a code sample? Below is an example of my code: ```html <html> <body> <script language="javascript"> function kishan() { window.ope...
2018/11/14
[ "https://Stackoverflow.com/questions/53304021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10652898/" ]
If your array is `my_array` and you want to convert it to a column vector you can do: ``` my_array.reshape(-1, 1) ``` For a row vector you can use ``` my_array.reshape(1, -1) ``` Both of these can also be transposed and that would work as expected.
IIUC, use `reshape` ``` my_array.reshape(my_array.size, -1) ```
53,304,021
How can I open the same link 10 times in 10 tabs by just clicking on button? Is php required to do this and if so can you provide a code sample? Below is an example of my code: ```html <html> <body> <script language="javascript"> function kishan() { window.ope...
2018/11/14
[ "https://Stackoverflow.com/questions/53304021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10652898/" ]
A 1D array is itself once transposed, contrary to Matlab where a 1D array doesn't exist and is at least 2D. What you want is to reshape it: ``` my_array.reshape(-1, 1) ``` Or: ``` my_array.reshape(1, -1) ``` Depending on what kind of vector you want (column or row vector). The `-1` is a broadcast-like, using al...
If your array is `my_array` and you want to convert it to a column vector you can do: ``` my_array.reshape(-1, 1) ``` For a row vector you can use ``` my_array.reshape(1, -1) ``` Both of these can also be transposed and that would work as expected.
32,683,096
I'm using a `Viewholder` in my `RecyclerView` adapter, in which I'm dynamically creating ImageViews. However, when I scroll down and back up, the new images get displayed on top of the previous images. I understand that this is the concept of recycling but how can I reset/clear the `Viewholder`/layout so that old `Imag...
2015/09/20
[ "https://Stackoverflow.com/questions/32683096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3228515/" ]
I think you need to have a `LinearLayout` hold your icons and clear it before your for loop: ``` viewHolder.linearLayout.removeAllViews(); ```
As I just encountered a similar problem, if you set a lot of styling in onBindViewHolder() it maybe helpful to override onViewRecycled() as well to restore the view to its original condition ...
366,085
I got a problem when I want to color the region bounded by curves `\sigma^{(0)}, \sigma^{(1)}, \sigma^{(0)}`. I use the command `\draw[fill=red!30, opacity=.5] (h2)--(h3)--(h4)--cycle;` but it is colored only the triangle formed by 3 vertices `v_0`, `v_1`, `v_2`. Like in the image below: [![enter image description her...
2017/04/22
[ "https://tex.stackexchange.com/questions/366085", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/129730/" ]
You can use: ``` \path [fill=red!30, opacity=.5] (h2) to [ bend right=30] (h3) to [ bend left=25] (h4) to [ bend right=20] (h2); ``` MWE: ``` \documentclass[12pt]{article} \usepackage{epsfig,psfrag} \usepackage{amsmath,amsxtra,amssymb,latexsym,amscd,amsthm} \usepackage[linesnumbered,ruled,vlined]{algor...
Bobyandbob already showed you how to fill that region, so this is more of a comment in a way, with some additional notes on your code. * To change page margins etc., you should in general use the `geometry` package instead of setting the lengths manually like you do. That is, use something like ``` \usepackage[ tex...
46,445,855
I have the following field called - Amount. It's a decimal(18,2). So a value of 70.26 What I want to create for the sake of a file out is something like - 00000007026 Where it's a varchar (11), with leading zeros to make up the 11 characters, if only 4 exist in the example above, but also I want the decimal removed...
2017/09/27
[ "https://Stackoverflow.com/questions/46445855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747619/" ]
You don't really need the XPath stuff to achieve this. Have a look here: ``` $dom = new DOMDocument(); $dom->loadHTML($html); $iFrame = $dom->getElementsByTagName('iframe')->item(0); $src = $iFrame->getAttribute('thesrc'); echo $src; ``` Which gives you: ``` //feedback.aliexpress.com/display/productEvaluation.html...
You can try something like this. Instead of querying`//div[#class='ui-tab-pane']` over `div` and then finding `iframe`, You can query iframe directly with `//div[@class="ui-tab-pane"]/iframe` [**Try this code snippet here**](https://eval.in/869110) ``` <?php ini_set('display_errors', 1); libxml_use_internal_errors...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For change value of radio. ``` $("input:radio[name=myname]").val("cat"); ``` To get value from radio. ``` var myval = $("input:radio[name=myname]").val(); ```
You can use val without [ ] for single values and use myval.val() to get its value. ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="radio" name="myname" value="horse"> <script> var myval = $("input:radio").val("cat"); alert(myval.val()); </script> `...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
[JSFIDDLE DEMO](https://jsfiddle.net/rko6L8b6/) ``` var myval = $("input:radio").val("cat"); // remove [] alert(myval.val()); // alert the value, not the jquery selector ``` Note - `$("input:radio")` will select all the radio buttons on the page which may not be what you want all the time. * If you are targeting a ...
You can use val without [ ] for single values and use myval.val() to get its value. ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="radio" name="myname" value="horse"> <script> var myval = $("input:radio").val("cat"); alert(myval.val()); </script> `...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $('input:radio') ``` returns all the radio buttons in your page as an object. ``` $('input:radio').val("cat") ``` will set the value of **all** radio buttons. ``` $("input:radio[name=myname]").val("cat"); ``` will set the value of the radio button to "cat". Note that multiple radio buttons can have the s...
You can use val without [ ] for single values and use myval.val() to get its value. ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="radio" name="myname" value="horse"> <script> var myval = $("input:radio").val("cat"); alert(myval.val()); </script> `...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $('input:radio') ``` returns all the radio buttons in your page as an object. ``` $('input:radio').val("cat") ``` will set the value of **all** radio buttons. ``` $("input:radio[name=myname]").val("cat"); ``` will set the value of the radio button to "cat". Note that multiple radio buttons can have the s...
For change value of radio. ``` $("input:radio[name=myname]").val("cat"); ``` To get value from radio. ``` var myval = $("input:radio[name=myname]").val(); ```
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $('input:radio') ``` returns all the radio buttons in your page as an object. ``` $('input:radio').val("cat") ``` will set the value of **all** radio buttons. ``` $("input:radio[name=myname]").val("cat"); ``` will set the value of the radio button to "cat". Note that multiple radio buttons can have the s...
You can find it like this: ``` $('input[name=myname]').val("cat"); ```
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
[JSFIDDLE DEMO](https://jsfiddle.net/rko6L8b6/) ``` var myval = $("input:radio").val("cat"); // remove [] alert(myval.val()); // alert the value, not the jquery selector ``` Note - `$("input:radio")` will select all the radio buttons on the page which may not be what you want all the time. * If you are targeting a ...
``` <input type="radio" name="myname" value="horse"> var myval = $("input:radio[name=myname]").val("cat"); alert(myval.val()); ``` remove [] around cat as you want to set value to the string cat, not an array containing the string cat. select $("input:radio[name=myname]") as it provides more clarity it doesn't matt...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $('input:radio') ``` returns all the radio buttons in your page as an object. ``` $('input:radio').val("cat") ``` will set the value of **all** radio buttons. ``` $("input:radio[name=myname]").val("cat"); ``` will set the value of the radio button to "cat". Note that multiple radio buttons can have the s...
[JSFIDDLE DEMO](https://jsfiddle.net/rko6L8b6/) ``` var myval = $("input:radio").val("cat"); // remove [] alert(myval.val()); // alert the value, not the jquery selector ``` Note - `$("input:radio")` will select all the radio buttons on the page which may not be what you want all the time. * If you are targeting a ...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can find it like this: ``` $('input[name=myname]').val("cat"); ```
``` <input type="radio" name="myname" value="horse"> var myval = $("input:radio[name=myname]").val("cat"); alert(myval.val()); ``` remove [] around cat as you want to set value to the string cat, not an array containing the string cat. select $("input:radio[name=myname]") as it provides more clarity it doesn't matt...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can find it like this: ``` $('input[name=myname]').val("cat"); ```
You can use val without [ ] for single values and use myval.val() to get its value. ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="radio" name="myname" value="horse"> <script> var myval = $("input:radio").val("cat"); alert(myval.val()); </script> `...
37,616,586
I have a basic radio button and want to change its value. I tried this but it did not work. It gave me an `[object Object]` error. ``` <input type="radio" name="myname" value="horse"> ``` ```js var myval = $("input:radio").val(["cat"]); alert(myval); ``` How can I do it?
2016/06/03
[ "https://Stackoverflow.com/questions/37616586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $('input:radio') ``` returns all the radio buttons in your page as an object. ``` $('input:radio').val("cat") ``` will set the value of **all** radio buttons. ``` $("input:radio[name=myname]").val("cat"); ``` will set the value of the radio button to "cat". Note that multiple radio buttons can have the s...
``` <input type="radio" name="myname" value="horse"> var myval = $("input:radio[name=myname]").val("cat"); alert(myval.val()); ``` remove [] around cat as you want to set value to the string cat, not an array containing the string cat. select $("input:radio[name=myname]") as it provides more clarity it doesn't matt...
52,787
Can Tasker launch an app's shortcut as an action? I can't find "Shortcuts" as an option in the "Select Action Category"-dialog when creating a new task. This works without problems in Locale.
2013/09/06
[ "https://android.stackexchange.com/questions/52787", "https://android.stackexchange.com", "https://android.stackexchange.com/users/10246/" ]
Strangely, this does not appear to be possible in Tasker, by default. However, I see there is the [AutoShortcut](https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut&hl=en) app on Google Play which is meant to allow it. Interestingly, Tasker itself will tell you about [AutoShortcut](https://play.goog...
My advice would be to switch to Automagic. What you're asking is a simple matter of selecting the "class" option in "Launch App." It gives you a complete list of available "shortcuts" to launch. Automagic has 90% of the functionality of Tasker, and requires fewer plugins. However, it will also use all the plugins Taske...
52,787
Can Tasker launch an app's shortcut as an action? I can't find "Shortcuts" as an option in the "Select Action Category"-dialog when creating a new task. This works without problems in Locale.
2013/09/06
[ "https://android.stackexchange.com/questions/52787", "https://android.stackexchange.com", "https://android.stackexchange.com/users/10246/" ]
Strangely, this does not appear to be possible in Tasker, by default. However, I see there is the [AutoShortcut](https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut&hl=en) app on Google Play which is meant to allow it. Interestingly, Tasker itself will tell you about [AutoShortcut](https://play.goog...
Seems like [Secure Settings](https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin) lets you launch shortcuts from Tasker in the same way as [AutoShortcut](https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut&hl=en "AutoShortcut") but without all the annoying ads an...
52,787
Can Tasker launch an app's shortcut as an action? I can't find "Shortcuts" as an option in the "Select Action Category"-dialog when creating a new task. This works without problems in Locale.
2013/09/06
[ "https://android.stackexchange.com/questions/52787", "https://android.stackexchange.com", "https://android.stackexchange.com/users/10246/" ]
Strangely, this does not appear to be possible in Tasker, by default. However, I see there is the [AutoShortcut](https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut&hl=en) app on Google Play which is meant to allow it. Interestingly, Tasker itself will tell you about [AutoShortcut](https://play.goog...
LS In tasker there is a field data. When starting Chrome, one can fill in a url is this field and Chrom then starts with this url. I asume that othe apps will also react in a simular way. Regards, Martin
52,787
Can Tasker launch an app's shortcut as an action? I can't find "Shortcuts" as an option in the "Select Action Category"-dialog when creating a new task. This works without problems in Locale.
2013/09/06
[ "https://android.stackexchange.com/questions/52787", "https://android.stackexchange.com", "https://android.stackexchange.com/users/10246/" ]
Seems like [Secure Settings](https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin) lets you launch shortcuts from Tasker in the same way as [AutoShortcut](https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut&hl=en "AutoShortcut") but without all the annoying ads an...
My advice would be to switch to Automagic. What you're asking is a simple matter of selecting the "class" option in "Launch App." It gives you a complete list of available "shortcuts" to launch. Automagic has 90% of the functionality of Tasker, and requires fewer plugins. However, it will also use all the plugins Taske...
52,787
Can Tasker launch an app's shortcut as an action? I can't find "Shortcuts" as an option in the "Select Action Category"-dialog when creating a new task. This works without problems in Locale.
2013/09/06
[ "https://android.stackexchange.com/questions/52787", "https://android.stackexchange.com", "https://android.stackexchange.com/users/10246/" ]
Seems like [Secure Settings](https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin) lets you launch shortcuts from Tasker in the same way as [AutoShortcut](https://play.google.com/store/apps/details?id=com.joaomgcd.autoshortcut&hl=en "AutoShortcut") but without all the annoying ads an...
LS In tasker there is a field data. When starting Chrome, one can fill in a url is this field and Chrom then starts with this url. I asume that othe apps will also react in a simular way. Regards, Martin
28,948,812
As far as I understand, in order to track our quota usage, we need to provide our API key to the Google App Service on the service we are planning to use. In my case I have a spreadsheet with Origin and Destination and a Custom function to calculate the distance between. I ran into the problem of meeting the quota fr...
2015/03/09
[ "https://Stackoverflow.com/questions/28948812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4650814/" ]
I also have been eager to find this answer for a long time and am happy to say that I've found it. It looks like Google might have just made this available around Oct 14, 2015 based on the date [this page](https://developers.google.com/maps/documentation/directions/get-api-key) was updated. You can leverage the UrlFe...
As of 7/13/2017, I was able to get the API to function by enabling the Sheets API in both the "Advanced Google Services" menu (images 1 and 2), and in the Google Developer Console. If you're logged into Google Sheets with the same email address, no fetch function should be necessary. [In the Resources menu, select Adv...
28,948,812
As far as I understand, in order to track our quota usage, we need to provide our API key to the Google App Service on the service we are planning to use. In my case I have a spreadsheet with Origin and Destination and a Custom function to calculate the distance between. I ran into the problem of meeting the quota fr...
2015/03/09
[ "https://Stackoverflow.com/questions/28948812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4650814/" ]
I also have been eager to find this answer for a long time and am happy to say that I've found it. It looks like Google might have just made this available around Oct 14, 2015 based on the date [this page](https://developers.google.com/maps/documentation/directions/get-api-key) was updated. You can leverage the UrlFe...
1.) I added an API key from my console dashboard. Remember to select the correct project you are working on. <https://console.developers.google.com/apis/credentials?project=> 2.) In my Project (Scripts Editor) I setAuthentication to Maps using the API key and the Client ID from the console. I have included the script...
28,948,812
As far as I understand, in order to track our quota usage, we need to provide our API key to the Google App Service on the service we are planning to use. In my case I have a spreadsheet with Origin and Destination and a Custom function to calculate the distance between. I ran into the problem of meeting the quota fr...
2015/03/09
[ "https://Stackoverflow.com/questions/28948812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4650814/" ]
I also have been eager to find this answer for a long time and am happy to say that I've found it. It looks like Google might have just made this available around Oct 14, 2015 based on the date [this page](https://developers.google.com/maps/documentation/directions/get-api-key) was updated. You can leverage the UrlFe...
Thank goodness for JP Carlin! Thank you for your answer above. JP's answer also explains his code. Just to share, without a code explanation (just go look above for JP Carlin's explanation), below is my version. You will see that I also have the departure\_time parameter so that I will get distance and driving-minutes ...
28,948,812
As far as I understand, in order to track our quota usage, we need to provide our API key to the Google App Service on the service we are planning to use. In my case I have a spreadsheet with Origin and Destination and a Custom function to calculate the distance between. I ran into the problem of meeting the quota fr...
2015/03/09
[ "https://Stackoverflow.com/questions/28948812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4650814/" ]
1.) I added an API key from my console dashboard. Remember to select the correct project you are working on. <https://console.developers.google.com/apis/credentials?project=> 2.) In my Project (Scripts Editor) I setAuthentication to Maps using the API key and the Client ID from the console. I have included the script...
As of 7/13/2017, I was able to get the API to function by enabling the Sheets API in both the "Advanced Google Services" menu (images 1 and 2), and in the Google Developer Console. If you're logged into Google Sheets with the same email address, no fetch function should be necessary. [In the Resources menu, select Adv...
28,948,812
As far as I understand, in order to track our quota usage, we need to provide our API key to the Google App Service on the service we are planning to use. In my case I have a spreadsheet with Origin and Destination and a Custom function to calculate the distance between. I ran into the problem of meeting the quota fr...
2015/03/09
[ "https://Stackoverflow.com/questions/28948812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4650814/" ]
1.) I added an API key from my console dashboard. Remember to select the correct project you are working on. <https://console.developers.google.com/apis/credentials?project=> 2.) In my Project (Scripts Editor) I setAuthentication to Maps using the API key and the Client ID from the console. I have included the script...
Thank goodness for JP Carlin! Thank you for your answer above. JP's answer also explains his code. Just to share, without a code explanation (just go look above for JP Carlin's explanation), below is my version. You will see that I also have the departure\_time parameter so that I will get distance and driving-minutes ...
16,275
What's the quickest way to find the current blockchain size of the chain you're on? I am sure there are ways to look up an authoritative size for ETH. EDIT: Apparently I wasn't clear. I am not curious about the size of the file on disk. I want to know the size of the blockchain *without* downloading it. I want to know...
2017/05/18
[ "https://ethereum.stackexchange.com/questions/16275", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/6804/" ]
@Krio, you can make it with an external oracle, for example, using Ethereum Alarm Clock <http://www.ethereum-alarm-clock.com/> Ethereum Alarm Clock: * Schedule Contract Function Calls * An ethereum contract that facilitates scheduling function calls for a specified block in the future. * Function calls can be schedul...
The answer is here: <https://bitcoin.stackexchange.com/questions/37663/is-it-possible-to-schedule-function-calls-to-an-ethereum-smart-contract> It is not possible to schedule a transaction in a contract.
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
The intent of the scene is clearly that they are stopped just out of bow and Scorpion range, and only Tyrion approaches close enough to be in danger. It just utterly fails at conveying this visually, possibly because they also need to be close enough to see Missandei get killed so the range of the Scorpions magically s...
The obvious answer is: Jon Snow. She knows he's in league with her, and he'd simply show up and continue the war without her anyway. And if she's heard anything from the battle in the North, she'll know that Jon's ridden a dragon before, so Drogon would still be a threat (unless he got emotional and exposed himself). ...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
The obvious answer is: Jon Snow. She knows he's in league with her, and he'd simply show up and continue the war without her anyway. And if she's heard anything from the battle in the North, she'll know that Jon's ridden a dragon before, so Drogon would still be a threat (unless he got emotional and exposed himself). ...
That's not how politics work. ============================= Remember the previous season, Cersei meets with Jon & co. and they show her the zombie they stole from NK. At that meeting Daenerys had both her dragons and there were no scorpions. She could easily burn Cerse, Mountain , Jaime... **But** If she did that , ...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
The obvious answer is: Jon Snow. She knows he's in league with her, and he'd simply show up and continue the war without her anyway. And if she's heard anything from the battle in the North, she'll know that Jon's ridden a dragon before, so Drogon would still be a threat (unless he got emotional and exposed himself). ...
During the wide shot from the top of the ramparts, you can see that the dragon is much further than the rest of the Dani's guard. [![enter image description here](https://i.stack.imgur.com/7h9w0.png)](https://i.stack.imgur.com/7h9w0.png) Presumably it's outside of the reach of the [scorpions](https://gameofthrones.fa...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
The obvious answer is: Jon Snow. She knows he's in league with her, and he'd simply show up and continue the war without her anyway. And if she's heard anything from the battle in the North, she'll know that Jon's ridden a dragon before, so Drogon would still be a threat (unless he got emotional and exposed himself). ...
A parlay is risky for both sides. She Cersei had attacked she would be risking retaliation. She was on top of the walls in a vulnerable position. Maybe her forces could have taken out Drogon in time, maybe she would have been incinerated. It's also possible that she simply intended to anger Dany, in the hopes of her m...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
The intent of the scene is clearly that they are stopped just out of bow and Scorpion range, and only Tyrion approaches close enough to be in danger. It just utterly fails at conveying this visually, possibly because they also need to be close enough to see Missandei get killed so the range of the Scorpions magically s...
That's not how politics work. ============================= Remember the previous season, Cersei meets with Jon & co. and they show her the zombie they stole from NK. At that meeting Daenerys had both her dragons and there were no scorpions. She could easily burn Cerse, Mountain , Jaime... **But** If she did that , ...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
The intent of the scene is clearly that they are stopped just out of bow and Scorpion range, and only Tyrion approaches close enough to be in danger. It just utterly fails at conveying this visually, possibly because they also need to be close enough to see Missandei get killed so the range of the Scorpions magically s...
During the wide shot from the top of the ramparts, you can see that the dragon is much further than the rest of the Dani's guard. [![enter image description here](https://i.stack.imgur.com/7h9w0.png)](https://i.stack.imgur.com/7h9w0.png) Presumably it's outside of the reach of the [scorpions](https://gameofthrones.fa...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
The intent of the scene is clearly that they are stopped just out of bow and Scorpion range, and only Tyrion approaches close enough to be in danger. It just utterly fails at conveying this visually, possibly because they also need to be close enough to see Missandei get killed so the range of the Scorpions magically s...
A parlay is risky for both sides. She Cersei had attacked she would be risking retaliation. She was on top of the walls in a vulnerable position. Maybe her forces could have taken out Drogon in time, maybe she would have been incinerated. It's also possible that she simply intended to anger Dany, in the hopes of her m...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
That's not how politics work. ============================= Remember the previous season, Cersei meets with Jon & co. and they show her the zombie they stole from NK. At that meeting Daenerys had both her dragons and there were no scorpions. She could easily burn Cerse, Mountain , Jaime... **But** If she did that , ...
A parlay is risky for both sides. She Cersei had attacked she would be risking retaliation. She was on top of the walls in a vulnerable position. Maybe her forces could have taken out Drogon in time, maybe she would have been incinerated. It's also possible that she simply intended to anger Dany, in the hopes of her m...
211,769
It's obvious that > > Cersei > > > could have killed > > Daenerys > > > with the > > scorpions mounted on the towers of Kings Landing and thus ended the war. > > > Are there any legitimate in-universe reasons why she didn't? Seems like the writers just don't care anymore to me. EDIT: I've been co...
2019/05/06
[ "https://scifi.stackexchange.com/questions/211769", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/116116/" ]
During the wide shot from the top of the ramparts, you can see that the dragon is much further than the rest of the Dani's guard. [![enter image description here](https://i.stack.imgur.com/7h9w0.png)](https://i.stack.imgur.com/7h9w0.png) Presumably it's outside of the reach of the [scorpions](https://gameofthrones.fa...
A parlay is risky for both sides. She Cersei had attacked she would be risking retaliation. She was on top of the walls in a vulnerable position. Maybe her forces could have taken out Drogon in time, maybe she would have been incinerated. It's also possible that she simply intended to anger Dany, in the hopes of her m...
6,039,707
I have a series of parser which parse the same basic sort of text for relevant data but they come from various sources so they differ subtltey. I am parsing millions of documents per day so any speed optimizations help. Here is a simplified example to show the fundamental issue. The parser is set up such that there is...
2011/05/18
[ "https://Stackoverflow.com/questions/6039707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/423079/" ]
The things in the get already are constant. I bet the jitter is already optimizing away the property accessors, so you probably won't see much performance gain by refactoring them out.
From the code you show not clear why you need an abstract class and inheriting. Using virtual members is slower. Moreover, your child classes aren't sealed. Why don't you do something like this: ``` public class Parser { private Regex regex; public Parser(string someRegex) { regex = new Regex(...
6,039,707
I have a series of parser which parse the same basic sort of text for relevant data but they come from various sources so they differ subtltey. I am parsing millions of documents per day so any speed optimizations help. Here is a simplified example to show the fundamental issue. The parser is set up such that there is...
2011/05/18
[ "https://Stackoverflow.com/questions/6039707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/423079/" ]
I don't think converting the properties to constants will give you any appreciable performance boost. The Jit'ed code probably have those inlined anyway (since you put in constants). I think the best approach is profiling your code first and see which parts have the most potential of optimization. My suggestion of thi...
The things in the get already are constant. I bet the jitter is already optimizing away the property accessors, so you probably won't see much performance gain by refactoring them out.
6,039,707
I have a series of parser which parse the same basic sort of text for relevant data but they come from various sources so they differ subtltey. I am parsing millions of documents per day so any speed optimizations help. Here is a simplified example to show the fundamental issue. The parser is set up such that there is...
2011/05/18
[ "https://Stackoverflow.com/questions/6039707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/423079/" ]
I don't think you'd see appreciable speed improvements from this kind of optimsation. Your best bet, though, is to try it and benchmark the results. One change that would make a difference is to not use Regex if you can get away without it. Regex is a pretty big and useful hammer, but not every nail needs a hammer tha...
From the code you show not clear why you need an abstract class and inheriting. Using virtual members is slower. Moreover, your child classes aren't sealed. Why don't you do something like this: ``` public class Parser { private Regex regex; public Parser(string someRegex) { regex = new Regex(...
6,039,707
I have a series of parser which parse the same basic sort of text for relevant data but they come from various sources so they differ subtltey. I am parsing millions of documents per day so any speed optimizations help. Here is a simplified example to show the fundamental issue. The parser is set up such that there is...
2011/05/18
[ "https://Stackoverflow.com/questions/6039707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/423079/" ]
I don't think converting the properties to constants will give you any appreciable performance boost. The Jit'ed code probably have those inlined anyway (since you put in constants). I think the best approach is profiling your code first and see which parts have the most potential of optimization. My suggestion of thi...
I don't think you'd see appreciable speed improvements from this kind of optimsation. Your best bet, though, is to try it and benchmark the results. One change that would make a difference is to not use Regex if you can get away without it. Regex is a pretty big and useful hammer, but not every nail needs a hammer tha...
6,039,707
I have a series of parser which parse the same basic sort of text for relevant data but they come from various sources so they differ subtltey. I am parsing millions of documents per day so any speed optimizations help. Here is a simplified example to show the fundamental issue. The parser is set up such that there is...
2011/05/18
[ "https://Stackoverflow.com/questions/6039707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/423079/" ]
I don't think converting the properties to constants will give you any appreciable performance boost. The Jit'ed code probably have those inlined anyway (since you put in constants). I think the best approach is profiling your code first and see which parts have the most potential of optimization. My suggestion of thi...
From the code you show not clear why you need an abstract class and inheriting. Using virtual members is slower. Moreover, your child classes aren't sealed. Why don't you do something like this: ``` public class Parser { private Regex regex; public Parser(string someRegex) { regex = new Regex(...
28,838,665
When I the following command in bash, I get a list of files that match the regular expression I want: ``` $> ls *-[0-9].jtl benchmark-1422478133-1.jtl benchmark-1422502883-4.jtl benchmark-1422915207-2.jtl ``` However, when I run the same command in the fish shell, I get different result: ``` $> ls *-[0-9].jtl fis...
2015/03/03
[ "https://Stackoverflow.com/questions/28838665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3195691/" ]
Fish's documentation does not claim to support the full power of POSIX glob patterns. Quoting the docs: > > Wildcards > --------- > > > If a star (\*) or a question mark (?) is present in the parameter, fish attempts to match the given parameter to any files in such a way that: > > > * `?` can match any single c...
You can also use more extended tool unix `find`. It is very powerful. * <https://kb.iu.edu/d/admm> * <https://duckduckgo.com/?q=unix+find> example: use regular expressions ``` find . -path '.*-[0-9].jtl' -not -path '.*-32.jtl' ```
28,838,665
When I the following command in bash, I get a list of files that match the regular expression I want: ``` $> ls *-[0-9].jtl benchmark-1422478133-1.jtl benchmark-1422502883-4.jtl benchmark-1422915207-2.jtl ``` However, when I run the same command in the fish shell, I get different result: ``` $> ls *-[0-9].jtl fis...
2015/03/03
[ "https://Stackoverflow.com/questions/28838665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3195691/" ]
Fish's documentation does not claim to support the full power of POSIX glob patterns. Quoting the docs: > > Wildcards > --------- > > > If a star (\*) or a question mark (?) is present in the parameter, fish attempts to match the given parameter to any files in such a way that: > > > * `?` can match any single c...
This is an older post, but I think it's worth revisiting this. At time of writing (Mar 2021), the documentation *does* explicitly state supporting wildcards. > > Fish supports the familiar wildcard \*. To list all JPEG files: > > > > ``` > > ls *.jpg > lena.jpg > meena.jpg > santa maria.jpg > > ``` > > You can i...
28,838,665
When I the following command in bash, I get a list of files that match the regular expression I want: ``` $> ls *-[0-9].jtl benchmark-1422478133-1.jtl benchmark-1422502883-4.jtl benchmark-1422915207-2.jtl ``` However, when I run the same command in the fish shell, I get different result: ``` $> ls *-[0-9].jtl fis...
2015/03/03
[ "https://Stackoverflow.com/questions/28838665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3195691/" ]
Fish's documentation does not claim to support the full power of POSIX glob patterns. Quoting the docs: > > Wildcards > --------- > > > If a star (\*) or a question mark (?) is present in the parameter, fish attempts to match the given parameter to any files in such a way that: > > > * `?` can match any single c...
In fish 3+ you could `string match`: ``` ls | string match -r --entire '-[0-9].jtl' ``` options: * `-r`: regular expression * `--entire`: returns the entire matching string
28,838,665
When I the following command in bash, I get a list of files that match the regular expression I want: ``` $> ls *-[0-9].jtl benchmark-1422478133-1.jtl benchmark-1422502883-4.jtl benchmark-1422915207-2.jtl ``` However, when I run the same command in the fish shell, I get different result: ``` $> ls *-[0-9].jtl fis...
2015/03/03
[ "https://Stackoverflow.com/questions/28838665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3195691/" ]
Fish's documentation does not claim to support the full power of POSIX glob patterns. Quoting the docs: > > Wildcards > --------- > > > If a star (\*) or a question mark (?) is present in the parameter, fish attempts to match the given parameter to any files in such a way that: > > > * `?` can match any single c...
Fish just needs quotes `"*.conf"` to do the same as bash `*.conf`.
28,838,665
When I the following command in bash, I get a list of files that match the regular expression I want: ``` $> ls *-[0-9].jtl benchmark-1422478133-1.jtl benchmark-1422502883-4.jtl benchmark-1422915207-2.jtl ``` However, when I run the same command in the fish shell, I get different result: ``` $> ls *-[0-9].jtl fis...
2015/03/03
[ "https://Stackoverflow.com/questions/28838665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3195691/" ]
You can also use more extended tool unix `find`. It is very powerful. * <https://kb.iu.edu/d/admm> * <https://duckduckgo.com/?q=unix+find> example: use regular expressions ``` find . -path '.*-[0-9].jtl' -not -path '.*-32.jtl' ```
In fish 3+ you could `string match`: ``` ls | string match -r --entire '-[0-9].jtl' ``` options: * `-r`: regular expression * `--entire`: returns the entire matching string
28,838,665
When I the following command in bash, I get a list of files that match the regular expression I want: ``` $> ls *-[0-9].jtl benchmark-1422478133-1.jtl benchmark-1422502883-4.jtl benchmark-1422915207-2.jtl ``` However, when I run the same command in the fish shell, I get different result: ``` $> ls *-[0-9].jtl fis...
2015/03/03
[ "https://Stackoverflow.com/questions/28838665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3195691/" ]
This is an older post, but I think it's worth revisiting this. At time of writing (Mar 2021), the documentation *does* explicitly state supporting wildcards. > > Fish supports the familiar wildcard \*. To list all JPEG files: > > > > ``` > > ls *.jpg > lena.jpg > meena.jpg > santa maria.jpg > > ``` > > You can i...
In fish 3+ you could `string match`: ``` ls | string match -r --entire '-[0-9].jtl' ``` options: * `-r`: regular expression * `--entire`: returns the entire matching string
28,838,665
When I the following command in bash, I get a list of files that match the regular expression I want: ``` $> ls *-[0-9].jtl benchmark-1422478133-1.jtl benchmark-1422502883-4.jtl benchmark-1422915207-2.jtl ``` However, when I run the same command in the fish shell, I get different result: ``` $> ls *-[0-9].jtl fis...
2015/03/03
[ "https://Stackoverflow.com/questions/28838665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3195691/" ]
Fish just needs quotes `"*.conf"` to do the same as bash `*.conf`.
In fish 3+ you could `string match`: ``` ls | string match -r --entire '-[0-9].jtl' ``` options: * `-r`: regular expression * `--entire`: returns the entire matching string
1,965,488
I have a little problem in my little project , I wish that someone here could help me! I am planning to use a bayesian network as a decision factor in my game AI and I want to improve the decision making every step of the way , anyone knows how to do that ? Any tutorials / existing implementations will be very good,I ...
2009/12/27
[ "https://Stackoverflow.com/questions/1965488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/79379/" ]
There are two steps: 1. You need to know how to apply a Bayesian Network and how to define the nodes and the belief propagation for your game. To do this, you need to read tutorials. 2. Apply software. This is quite easy, there are plenty of free/open source implementations. At the end of the wiki page <http://en.wiki...
You can try Charniak's [Bayesian Networks Without Tears](http://www.aaai.org/ojs/index.php/aimagazine/article/viewArticle/918). For Bayesian Network implementations, look at [BUGS](http://www.mrc-bsu.cam.ac.uk/bugs/) and [LibB](http://www.cs.huji.ac.il/labs/compbio/LibB/).
16,079,649
I want the total of the each column . There are no key values in my data that can be used as a group field for a "Group By Step". Please help me.
2013/04/18
[ "https://Stackoverflow.com/questions/16079649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/926921/" ]
You can use the "Group By" step without providing a Group field.
You can use the "Group By" step without providing a Group field. Follow the below steps: 1. Select table input 2. Select "Group By" step In Group by step follow the below steps: Select what ever required grouping field and in looup field section assign function as sum/avg
2,950,626
Suppose we want to encode the natural numbers as bit strings as follows: ``` 0 = λ // the empty string 1 = 0 2 = 1 3 = 00 4 = 01 5 = 10 6 = 11 7 = 000 8 = 001 9 = 010 10 = 011 11 = 100 12 = 101 13 = 110 14 = 111 15 = 0000 ... ``` How can we calculate the encoding of any given number? For example, how do I calculate ...
2018/10/10
[ "https://math.stackexchange.com/questions/2950626", "https://math.stackexchange.com", "https://math.stackexchange.com/users/602811/" ]
Think about cutting the cube in half in any dimension ($x$ in my example). Now you have $2$ blocks of dimension $2\times4\times 4$. The trick is to rearrange the cubes so we can cut both of them in half at the same time, now in a different direction ($y$ for instance) Now we have $4$ blocks of dimension $2\times 2 \t...
***HINT*** Notice that the Volume of the cube is $4^3=64$ so your cube is essentially comprised of $64$ cubes of volume $1$. Assume that we have made the required partition. Focus on one side of the cube-a square with sides equal to $4$. Observe that any such partition must consist of an equal number of cubes in each...
27,123,240
Running top interactively you can do different things. Is there a way to write a bash script that would interact with top without using programs like xdotool?
2014/11/25
[ "https://Stackoverflow.com/questions/27123240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4290992/" ]
``` <?php $slug = "category-b"; $args = array( 'posts_per_page' => -1, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $slug ) ), 'post_type' => 'product', 'orderby' ...
After careful consideration, I found the root of the problem: 1. The category needs to be an ID, quoting [Wordpress](http://codex.wordpress.org/Template_Tags/get_posts): > > Note: The category parameter needs to be the ID of the category, and > not the category name. > > > Note: The category parameter can be a co...
18,468,923
I am working with a page layout that has a sidebar/callout box that's floated to one side of a large chunk of text content, and the text content may have some notice banners with a different background color sprinkled throughout. Here is the issue (full JSFiddle [here](http://jsfiddle.net/midnightlightning/UrsLW/)): ...
2013/08/27
[ "https://Stackoverflow.com/questions/18468923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144756/" ]
You can be clever, and use a white border to hide the contents behind it. Like this: ``` .sidebar { border-left: 1em solid #FFF; } ``` Example: <http://jsfiddle.net/UrsLW/7/> And the result: ![Result](https://i.stack.imgur.com/Qtfai.png)
First thing that came to my mind was using CSS3's **box-shadow**, maybe? ``` .sidebar { float:right; width:40%; padding:1em; margin-left:1em; background-color:#FFC; box-shadow: 0px 0px 0px 1em #fff; } ``` Or even a simple border would work, for that matter. ``` .sidebar { float:right; ...
18,468,923
I am working with a page layout that has a sidebar/callout box that's floated to one side of a large chunk of text content, and the text content may have some notice banners with a different background color sprinkled throughout. Here is the issue (full JSFiddle [here](http://jsfiddle.net/midnightlightning/UrsLW/)): ...
2013/08/27
[ "https://Stackoverflow.com/questions/18468923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144756/" ]
enclose your SideBar with another wraper **HTML:** ``` <div id="test"> <div class="sidebar"> </div> </div> ``` **CSS:** ``` #test { /*moved from your old siderbar*/ float:right; width:40%; padding-left:1em; /*essential*/ background-color:white; } .sidebar { padding:1em; back...
First thing that came to my mind was using CSS3's **box-shadow**, maybe? ``` .sidebar { float:right; width:40%; padding:1em; margin-left:1em; background-color:#FFC; box-shadow: 0px 0px 0px 1em #fff; } ``` Or even a simple border would work, for that matter. ``` .sidebar { float:right; ...
18,468,923
I am working with a page layout that has a sidebar/callout box that's floated to one side of a large chunk of text content, and the text content may have some notice banners with a different background color sprinkled throughout. Here is the issue (full JSFiddle [here](http://jsfiddle.net/midnightlightning/UrsLW/)): ...
2013/08/27
[ "https://Stackoverflow.com/questions/18468923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144756/" ]
You could simply add `overflow: auto` to your notice to [stop its background from leaking behind the sidebar](http://jsfiddle.net/BoltClock/UrsLW/22), while preserving the margin on the sidebar. The reason this works is because `overflow` that isn't `visible` interferes with floats as it creates a new block formatting...
First thing that came to my mind was using CSS3's **box-shadow**, maybe? ``` .sidebar { float:right; width:40%; padding:1em; margin-left:1em; background-color:#FFC; box-shadow: 0px 0px 0px 1em #fff; } ``` Or even a simple border would work, for that matter. ``` .sidebar { float:right; ...
18,468,923
I am working with a page layout that has a sidebar/callout box that's floated to one side of a large chunk of text content, and the text content may have some notice banners with a different background color sprinkled throughout. Here is the issue (full JSFiddle [here](http://jsfiddle.net/midnightlightning/UrsLW/)): ...
2013/08/27
[ "https://Stackoverflow.com/questions/18468923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144756/" ]
You could simply add `overflow: auto` to your notice to [stop its background from leaking behind the sidebar](http://jsfiddle.net/BoltClock/UrsLW/22), while preserving the margin on the sidebar. The reason this works is because `overflow` that isn't `visible` interferes with floats as it creates a new block formatting...
You can be clever, and use a white border to hide the contents behind it. Like this: ``` .sidebar { border-left: 1em solid #FFF; } ``` Example: <http://jsfiddle.net/UrsLW/7/> And the result: ![Result](https://i.stack.imgur.com/Qtfai.png)
18,468,923
I am working with a page layout that has a sidebar/callout box that's floated to one side of a large chunk of text content, and the text content may have some notice banners with a different background color sprinkled throughout. Here is the issue (full JSFiddle [here](http://jsfiddle.net/midnightlightning/UrsLW/)): ...
2013/08/27
[ "https://Stackoverflow.com/questions/18468923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144756/" ]
You could simply add `overflow: auto` to your notice to [stop its background from leaking behind the sidebar](http://jsfiddle.net/BoltClock/UrsLW/22), while preserving the margin on the sidebar. The reason this works is because `overflow` that isn't `visible` interferes with floats as it creates a new block formatting...
enclose your SideBar with another wraper **HTML:** ``` <div id="test"> <div class="sidebar"> </div> </div> ``` **CSS:** ``` #test { /*moved from your old siderbar*/ float:right; width:40%; padding-left:1em; /*essential*/ background-color:white; } .sidebar { padding:1em; back...
43,771,086
How can I use `terraform import` with resources of type `aws_lambda_permission` in terraform? What should the second argument be?
2017/05/03
[ "https://Stackoverflow.com/questions/43771086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755934/" ]
At the time of writing Terraform does not have an importer for this resource, so it's not possible to import it automatically using the `terraform import` command. Since a Lambda permission is a subordinate resource belonging to a Lambda function, once there *is* support for importing it the most likely way it would b...
You can create the same permission with different `statement_id`, then remove the old lambda permission via aws cli: `aws lambda remove-permission --function-name myfunction --statement-id myoldfunctionsid`
43,771,086
How can I use `terraform import` with resources of type `aws_lambda_permission` in terraform? What should the second argument be?
2017/05/03
[ "https://Stackoverflow.com/questions/43771086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755934/" ]
At the time of writing Terraform does not have an importer for this resource, so it's not possible to import it automatically using the `terraform import` command. Since a Lambda permission is a subordinate resource belonging to a Lambda function, once there *is* support for importing it the most likely way it would b...
For those landing on this it is now possible. `terraform import aws_lambda_permission.<your_resource_name> <lambda_function_name>/<permission_statement_id>` The statement id (SID) can be found by under `permissions > Resource-based policy` for the lambda function on the AWS console.
43,771,086
How can I use `terraform import` with resources of type `aws_lambda_permission` in terraform? What should the second argument be?
2017/05/03
[ "https://Stackoverflow.com/questions/43771086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755934/" ]
For those landing on this it is now possible. `terraform import aws_lambda_permission.<your_resource_name> <lambda_function_name>/<permission_statement_id>` The statement id (SID) can be found by under `permissions > Resource-based policy` for the lambda function on the AWS console.
You can create the same permission with different `statement_id`, then remove the old lambda permission via aws cli: `aws lambda remove-permission --function-name myfunction --statement-id myoldfunctionsid`
881,111
Running v3.1 of the SQL Server Kerberos Configuration Manager (KerberosConfigMgr) on Windows Server 2012 against a SQL Server Developer 2016 instance on same server. Running tool as admin (logged in to server as domain admin account). Default blank details specified in the Kerberos tool. I have also tried entering de...
2017/10/31
[ "https://serverfault.com/questions/881111", "https://serverfault.com", "https://serverfault.com/users/441934/" ]
Look at the Weight setting in slurm.conf > > The priority of the node for scheduling purposes. All things being > equal, jobs will be allocated the nodes with the lowest weight which > satisfies their requirements. For example, a heterogeneous collection > of nodes might be placed into a single partition for grea...
I don't believe that it is possible to randomize node allocation without altering the code or providing your own plugin. There are many way to affect which nodes will be chosen by a given job, but none of them are random. As @Tux\_DEV\_NULL noted you can use weight to prefer a subset of nodes, but unless you're randoml...
881,111
Running v3.1 of the SQL Server Kerberos Configuration Manager (KerberosConfigMgr) on Windows Server 2012 against a SQL Server Developer 2016 instance on same server. Running tool as admin (logged in to server as domain admin account). Default blank details specified in the Kerberos tool. I have also tried entering de...
2017/10/31
[ "https://serverfault.com/questions/881111", "https://serverfault.com", "https://serverfault.com/users/441934/" ]
Look at the Weight setting in slurm.conf > > The priority of the node for scheduling purposes. All things being > equal, jobs will be allocated the nodes with the lowest weight which > satisfies their requirements. For example, a heterogeneous collection > of nodes might be placed into a single partition for grea...
You can add "LLN=YES" to the partition. > > LLN > Schedule resources to jobs on the least loaded nodes (based upon the number of idle CPUs). > > >
881,111
Running v3.1 of the SQL Server Kerberos Configuration Manager (KerberosConfigMgr) on Windows Server 2012 against a SQL Server Developer 2016 instance on same server. Running tool as admin (logged in to server as domain admin account). Default blank details specified in the Kerberos tool. I have also tried entering de...
2017/10/31
[ "https://serverfault.com/questions/881111", "https://serverfault.com", "https://serverfault.com/users/441934/" ]
You can add "LLN=YES" to the partition. > > LLN > Schedule resources to jobs on the least loaded nodes (based upon the number of idle CPUs). > > >
I don't believe that it is possible to randomize node allocation without altering the code or providing your own plugin. There are many way to affect which nodes will be chosen by a given job, but none of them are random. As @Tux\_DEV\_NULL noted you can use weight to prefer a subset of nodes, but unless you're randoml...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
You need to handle the exception when using the CreateUser method: ``` try { myClass.CreateUser (user); } catch (ArgumentNullException ex) { } ```
Handle the exception :-) This is normal behavior. Your client must call your method like so: ``` try { long result = myService.CreateUser(someVariable); } catch (ArgumentNullException exc) { // Your error-handling code here } ``` If you don't want to handle the exception, but simply process the "error code" (...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
I think it would be best to just do something like this at the top of your method rather than create and throw an exception. ``` if (string.IsNullOrEmpty(userName)) { //handle } ```
Handle the exception :-) This is normal behavior. Your client must call your method like so: ``` try { long result = myService.CreateUser(someVariable); } catch (ArgumentNullException exc) { // Your error-handling code here } ``` If you don't want to handle the exception, but simply process the "error code" (...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
I think String.IsNullOrEmpty() is the most clear way; but I'm not sure I understand the question. Your IF is working; and your code is throwing the exception. So writting it with String.IsnullOrEmpty() won't change that. Do you want to know how to 'handle' that exception?
Handle the exception :-) This is normal behavior. Your client must call your method like so: ``` try { long result = myService.CreateUser(someVariable); } catch (ArgumentNullException exc) { // Your error-handling code here } ``` If you don't want to handle the exception, but simply process the "error code" (...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
If you want to notify the client use [FaultException](http://msdn.microsoft.com/en-us/library/system.servicemodel.faultexception.aspx).
Handle the exception :-) This is normal behavior. Your client must call your method like so: ``` try { long result = myService.CreateUser(someVariable); } catch (ArgumentNullException exc) { // Your error-handling code here } ``` If you don't want to handle the exception, but simply process the "error code" (...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
You need to handle the exception when using the CreateUser method: ``` try { myClass.CreateUser (user); } catch (ArgumentNullException ex) { } ```
First, you should know about String.IsNullOrEmpty(), it's useful in the case you provided. Second, you are throwing an exception up the stack. There needs to be a try/catch block further up that is catching the exception you're throwing. Here, the try/catch is doing you no good. ``` public long CreateUser(string user...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
I think it would be best to just do something like this at the top of your method rather than create and throw an exception. ``` if (string.IsNullOrEmpty(userName)) { //handle } ```
First, you should know about String.IsNullOrEmpty(), it's useful in the case you provided. Second, you are throwing an exception up the stack. There needs to be a try/catch block further up that is catching the exception you're throwing. Here, the try/catch is doing you no good. ``` public long CreateUser(string user...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
I think String.IsNullOrEmpty() is the most clear way; but I'm not sure I understand the question. Your IF is working; and your code is throwing the exception. So writting it with String.IsnullOrEmpty() won't change that. Do you want to know how to 'handle' that exception?
First, you should know about String.IsNullOrEmpty(), it's useful in the case you provided. Second, you are throwing an exception up the stack. There needs to be a try/catch block further up that is catching the exception you're throwing. Here, the try/catch is doing you no good. ``` public long CreateUser(string user...
5,834,063
I'm developing a WCF service with C# and .NET Framework 4.0. I have the following code: ``` public long CreateUser(string userName) { try { if ((userName == null) || (userName.Equals(string.Empty))) throw new ArgumentNullException(); ... } catch (Exception ex)...
2011/04/29
[ "https://Stackoverflow.com/questions/5834063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68571/" ]
If you want to notify the client use [FaultException](http://msdn.microsoft.com/en-us/library/system.servicemodel.faultexception.aspx).
First, you should know about String.IsNullOrEmpty(), it's useful in the case you provided. Second, you are throwing an exception up the stack. There needs to be a try/catch block further up that is catching the exception you're throwing. Here, the try/catch is doing you no good. ``` public long CreateUser(string user...
2,704
Various sources, such as Cicero's Republic state that Archimedes had made a machine consisting of glass spheres that represented the Eudoxian system of the world. Considering that Callipus died over a decade before Archimedes was born, would Archimedes have been aware of Callipus' work and therefore would his mechani...
2015/08/25
[ "https://hsm.stackexchange.com/questions/2704", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/2702/" ]
There is no definite answer on this question. About the Archimedes machine we only know a very imprecise description from the authors who did not understand much about this machine, or about science in general. What Archimedes knew and what he did not we cannot tell for sure. Probably he knew about Callipus. Probably h...
According to [Sedley's Epicurus and the mathematicians of Cyzicus](https://www.academia.edu/3051043/Epicurus_and_the_mathematicians_of_Cyzicus), "*Archimedes's celebrated planetarium was said to reproduce all the planetary motions simultaneously, but whether it followed a system of concentric spheres or that of eccentr...
8,454,809
Is there any way to create a picker which allows you to select multiple rows? Or something that is similar to this (Something that looks like when you select multiple files in a File Browser)?
2011/12/10
[ "https://Stackoverflow.com/questions/8454809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/829430/" ]
Try This Code, This code is from Appcelerator Titanium Kitchensink. You can find this in kitchensink. Path : kitchensinl/resource/emaples/picker\_android\_spinner\_text.js. Hope this will help. It's code to generate multi column picker in android. ``` /*global Ti,Titanium,alert */ var w = Ti.UI.currentWindow; ...
Try <https://gist.github.com/981250>
8,454,809
Is there any way to create a picker which allows you to select multiple rows? Or something that is similar to this (Something that looks like when you select multiple files in a File Browser)?
2011/12/10
[ "https://Stackoverflow.com/questions/8454809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/829430/" ]
Try This Code, This code is from Appcelerator Titanium Kitchensink. You can find this in kitchensink. Path : kitchensinl/resource/emaples/picker\_android\_spinner\_text.js. Hope this will help. It's code to generate multi column picker in android. ``` /*global Ti,Titanium,alert */ var w = Ti.UI.currentWindow; ...
You may prefer using check boxes. Here is a discussion on this issue. [Stack-overflow Link](https://stackoverflow.com/questions/9548038/create-a-checkbox-in-titanium)
10,838
I need a C# implementation of the gamma function that produces correct exact answers at positive integer inputs. I took a look at MathNet.Numerics Meta.Numerics. In both cases, if you calculate something like gamma(5)-4!, evaluating the latter by integer arithmetic, you get an answer whose absolute value is approximate...
2014/02/19
[ "https://scicomp.stackexchange.com/questions/10838", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/7381/" ]
The [GSL implementation of the Gamma function](http://git.savannah.gnu.org/cgit/gsl.git/tree/specfunc/gamma.c) stores the integer factorial cases up to 297 for double precision (integers greater than that overflow), and uses a table of those values directly for integer arguments (see lines 42-555 or so). Any error you ...
The following code will give you the expected zero ``` static void Main(string[] args) { int a = 24; double result = alglib.gammafunction(5) - a; Console.WriteLine(result); } ``` The library used is here [alglib](http://www.alglib.net)
48,341,992
So, I created this caption inside my image, to show up when the user hover with the mouse over a symbol as you can see on the image [![enter image description here](https://i.stack.imgur.com/bdBEX.png)](https://i.stack.imgur.com/bdBEX.png) As expected (I guess), it doesn't work on mobile/tablet because of the size of...
2018/01/19
[ "https://Stackoverflow.com/questions/48341992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9240281/" ]
It looks like with WP 4.9 the wp\_new\_user\_notification() function has been altered and we have a new wp\_new\_user\_notification\_email() filter to work with. I have following code working except for the password. A value is passed but when I try to log in, the password is denied. ``` add_filter( 'wp_new_user_notif...
thanks for this solution, it works, but there is a little error inside. This function returns the md5-encoded password, not the password as plain-text for the new user. I think the best way to solve it would be to set a new password (wp\_set\_password) within the function: ``` function my_wp_new_user_notification_emai...
385,888
When studying objects like profinite groups, profinite spaces and profinite rings, I have noticed that some properties just remain the same. For example they will always be inductive limits of some discrete finite spaces, or equivalently totally disconnected compact Hausdorff spaces. I was therefore wondering, if ther...
2021/03/08
[ "https://mathoverflow.net/questions/385888", "https://mathoverflow.net", "https://mathoverflow.net/users/152933/" ]
There is a notion of pro-object in a general category $\mathbf{C}$, which generalises the usual profinite objects - profinite spaces are the case $\mathbf{C} = \mathbf{FinSet}$, profinite groups are $\mathbf{C} = \mathbf{FinGroup}$, etc. See this [nLab article](https://ncatlab.org/nlab/show/pro-object) for details. Per...
I would like to post my answer as well. In the Chapter 3 of my thesis: "Automorphism-preserving color substitutions on Profinite Graphs" (2022). Electronic Thesis and Dissertation Repository. 8795. <https://ir.lib.uwo.ca/etd/8795> , I came up with a certain categorical notion that worked for what I intended to do: prov...
385,888
When studying objects like profinite groups, profinite spaces and profinite rings, I have noticed that some properties just remain the same. For example they will always be inductive limits of some discrete finite spaces, or equivalently totally disconnected compact Hausdorff spaces. I was therefore wondering, if ther...
2021/03/08
[ "https://mathoverflow.net/questions/385888", "https://mathoverflow.net", "https://mathoverflow.net/users/152933/" ]
There are two natural definitions of a profinite category. You can look at inverse limits of finite categories or you can look at topological categories whose underlying spaces are profinite (call these Stone categories). Any profinite category is Stone and any Stone category with finitely many objects is profinite. Bu...
I would like to post my answer as well. In the Chapter 3 of my thesis: "Automorphism-preserving color substitutions on Profinite Graphs" (2022). Electronic Thesis and Dissertation Repository. 8795. <https://ir.lib.uwo.ca/etd/8795> , I came up with a certain categorical notion that worked for what I intended to do: prov...
19,957,027
I have aform which has lots of radio button both visible and hidden. I need to get only the visible radio buttons and do some manipulations. I am trying the below code. But its not working. Can somebody please help me in this. One group has 4-5 radio buttons. I need to check any of the radio button in the group is chec...
2013/11/13
[ "https://Stackoverflow.com/questions/19957027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049057/" ]
I've found one that requires NO a priori information/guesses and does very well for what I'm asking it to do. It's called [Mean Shift](http://scikit-learn.org/stable/modules/generated/sklearn.cluster.MeanShift.html#sklearn.cluster.MeanShift) and is located in [SciKit-Learn](http://scikit-learn.org/stable/index.html). I...
You can try a minimum spanning tree (zahn algorithm) and then remove the longest edge similar to alpha shapes. I used it with a delaunay triangulation and a concave hull:<http://www.phpdevpad.de/geofence>. You can also try a hierarchical cluster for example clusterfck.
19,957,027
I have aform which has lots of radio button both visible and hidden. I need to get only the visible radio buttons and do some manipulations. I am trying the below code. But its not working. Can somebody please help me in this. One group has 4-5 radio buttons. I need to check any of the radio button in the group is chec...
2013/11/13
[ "https://Stackoverflow.com/questions/19957027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049057/" ]
* When using DBSCAN it can be helpful to scale/normalize data or distances beforehand, so that estimation of epsilon will be relative. * There is a implementation of DBSCAN - I think its the one Anony-Mousse somewhere denoted as 'floating around' - , which comes with a epsilon estimator function. It works, as long as i...
You can try a minimum spanning tree (zahn algorithm) and then remove the longest edge similar to alpha shapes. I used it with a delaunay triangulation and a concave hull:<http://www.phpdevpad.de/geofence>. You can also try a hierarchical cluster for example clusterfck.
19,957,027
I have aform which has lots of radio button both visible and hidden. I need to get only the visible radio buttons and do some manipulations. I am trying the below code. But its not working. Can somebody please help me in this. One group has 4-5 radio buttons. I need to check any of the radio button in the group is chec...
2013/11/13
[ "https://Stackoverflow.com/questions/19957027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049057/" ]
I've found one that requires NO a priori information/guesses and does very well for what I'm asking it to do. It's called [Mean Shift](http://scikit-learn.org/stable/modules/generated/sklearn.cluster.MeanShift.html#sklearn.cluster.MeanShift) and is located in [SciKit-Learn](http://scikit-learn.org/stable/index.html). I...
Your plot indicates that you chose the `minPts` parameter *way* too small. Have a look at OPTICS, which does no longer need the epsilon parameter of DBSCAN.
19,957,027
I have aform which has lots of radio button both visible and hidden. I need to get only the visible radio buttons and do some manipulations. I am trying the below code. But its not working. Can somebody please help me in this. One group has 4-5 radio buttons. I need to check any of the radio button in the group is chec...
2013/11/13
[ "https://Stackoverflow.com/questions/19957027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049057/" ]
* When using DBSCAN it can be helpful to scale/normalize data or distances beforehand, so that estimation of epsilon will be relative. * There is a implementation of DBSCAN - I think its the one Anony-Mousse somewhere denoted as 'floating around' - , which comes with a epsilon estimator function. It works, as long as i...
Your plot indicates that you chose the `minPts` parameter *way* too small. Have a look at OPTICS, which does no longer need the epsilon parameter of DBSCAN.
19,957,027
I have aform which has lots of radio button both visible and hidden. I need to get only the visible radio buttons and do some manipulations. I am trying the below code. But its not working. Can somebody please help me in this. One group has 4-5 radio buttons. I need to check any of the radio button in the group is chec...
2013/11/13
[ "https://Stackoverflow.com/questions/19957027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1049057/" ]
I've found one that requires NO a priori information/guesses and does very well for what I'm asking it to do. It's called [Mean Shift](http://scikit-learn.org/stable/modules/generated/sklearn.cluster.MeanShift.html#sklearn.cluster.MeanShift) and is located in [SciKit-Learn](http://scikit-learn.org/stable/index.html). I...
* When using DBSCAN it can be helpful to scale/normalize data or distances beforehand, so that estimation of epsilon will be relative. * There is a implementation of DBSCAN - I think its the one Anony-Mousse somewhere denoted as 'floating around' - , which comes with a epsilon estimator function. It works, as long as i...
17,708,772
I'm working on a program that reads in some images (.jpg) and text from source files and assembling them into a single PDF. I know processing probably isn't the best language to do it in, but its the only one I know how to do it in. Anyway, I am having an issue where processing calls setup two times. I've seen that thi...
2013/07/17
[ "https://Stackoverflow.com/questions/17708772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2309865/" ]
How about moving all these functions to be done before setup()? Although processing usually complains that you are "mixing static and active modes", this hack seems to work at processing 2.0.1: ``` int i = beforeSetup(); int szX,szY; int beforeSetup() { println("look! I am happening before setup()!!"); szX = 800;...
perhaps you can resize your window after calcs are done? Once I made this sketch to see how resizing would work, it is expecting an image file, see if it can help you... ``` //no error handling for non image files! PImage img; int newCanvasWidth = MIN_WINDOW_WIDTH; // made global to use in draw int newCanvasHeight...
13,730,519
I have a lot of arrays to test , is there a better to way in term of performance on doing the following : ``` if(is_array($data) && count($data) > 0) { foreach($data as $d) { } } ``` can this code be better ?
2012/12/05
[ "https://Stackoverflow.com/questions/13730519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1880139/" ]
There really isn't a function for this, but as long as all of your text is either in the format **NUMBER TEXT** or **TEXT** (and not **NUMBER TEXT NUMBER**), you could use the following: ``` TRIM(Replace(Column, VAL(Column), '')) AS Result ``` Basically, use `VAL` to find the number in the text, and then replace it ...
You want a simple function like the inverse of `Val()` to discard all non-alpha characters. I don't know anything like that. However, a solution based on regular expressions is easy. The function below discards all characters which aren't letters. Here is that function applied to some of your sample inputs. ``` ? Only...
29,572,884
How do you find the base y logarithm of a number x in Scala? I have searched the scala.math library and I can't find a way. It seems to have only log10(x) and ln(x).
2015/04/11
[ "https://Stackoverflow.com/questions/29572884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3599135/" ]
This is a maths question :) ``` log<base y>(x) == log10(x)/log10(y) == ln(x)/ln(y) ``` Random link from the web that explains this: <http://www.purplemath.com/modules/logrules5.htm>
For convenience, you can use a lambda function, e.g., ``` scala> val log2 = (x: Double) => log10(x)/log10(2.0) log2: Double => Double = <function1> scala> log2(2) res0: Double = 1.0 ```
2,102,042
I want to write an application for my Windows 6.1 standard smart phone that intercepts incoming SMS messages and auto responds if they match a specific criteria, but despite installing countless SDk's I am unable to do what I need. The code I want to use relies on the Microsoft.WindowsMobile.PocketOutlook.dll assembly...
2010/01/20
[ "https://Stackoverflow.com/questions/2102042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38695/" ]
In my opinion it's very difficult for someone new to Windows Mobile development to work without Visual Studio. In theory you can use SharpDevelop or MonoDevelop, but you wouldn't be able to do any debugging on the emulator or a connected device. Being able to debug by stepping through the code while it's running seem...
Try starting with sample code that has most of you requirements implemented. The SDK comes with the sample: SMSIM [link text](http://msdn.microsoft.com/en-us/library/bb158721.aspx) It demonstrates how to use C# to write a managed code version of a Short Messaging Service (SMS) interception application. I hope this h...