qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
114,281
I emailed a potential supervisor at a US university recently. He replied promptly, cc'ing the graduate school dean in the email and saying I had a very good idea but then suggesting another research question that needs to be answered first. I saw that no one has done it yet (nothing published, as far as I know), and ...
2018/07/26
[ "https://academia.stackexchange.com/questions/114281", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/96428/" ]
I think he is busy and just responded in the quickest way possible to your query. If you are interested in it, respond that you are and would like to take it up. More importantly, respond that you want to take it up under his supervision and will be following up with your formal application. If you come up with any d...
One thing is, be clear and specific. If you are looking for a place to do graduate study, be sure to ask for this. "I am looking for a place to do my PhD. Would it be possible for me to be a PhD student at your lab? Would you be available to be my supervisor to complete my PhD?" If the answer is hazy, or unclear, or no...
2,489,939
Is there some way to have a keyboard of type UIKeyboardTypeNamePhonePad start in phone number pad mode rather than alphabetic? The keyboard works well for what I need but I'd like it to start in the "other" mode since that is more likely what the user will enter.
2010/03/22
[ "https://Stackoverflow.com/questions/2489939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235160/" ]
I believe that by setting the `keyboardType` property to `UIKeyboardTypeNumbersAndPunctuation`, you will default to the numbers and punctuation view, while still having the option of returning to the "ABC" view. Apple's documentation on it: <http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextIn...
In the textfield in question, You set the kind of keyboard you would like it to "activate": ``` [self.myTextfield setKeyboardType:UIKeyboardTypeNumberPad]; ```
2,489,939
Is there some way to have a keyboard of type UIKeyboardTypeNamePhonePad start in phone number pad mode rather than alphabetic? The keyboard works well for what I need but I'd like it to start in the "other" mode since that is more likely what the user will enter.
2010/03/22
[ "https://Stackoverflow.com/questions/2489939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235160/" ]
Unfortunately the answer to this question is NO, but there is a workaround. You can use the UIKeyboardTypeNumberPad and add a custom button (e.g. <https://stackoverflow.com/a/4826342/61569>) to switch the keyboard to UIKeyboardTypeNamePhonePad. The challenge with this workaround is to support the keyboard styles of d...
In the textfield in question, You set the kind of keyboard you would like it to "activate": ``` [self.myTextfield setKeyboardType:UIKeyboardTypeNumberPad]; ```
2,489,939
Is there some way to have a keyboard of type UIKeyboardTypeNamePhonePad start in phone number pad mode rather than alphabetic? The keyboard works well for what I need but I'd like it to start in the "other" mode since that is more likely what the user will enter.
2010/03/22
[ "https://Stackoverflow.com/questions/2489939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235160/" ]
The *UIKeyboardTypeNumberPad* does not have the 'Done' or the 'ABC' button that will allow you to toggle back and forth between default keyboard and the NumberPad. Now you can choose to go with what @Anthony F suggested but remember you risk the chance of loosing the custom 'Done' button everytime Apple releases newer ...
In the textfield in question, You set the kind of keyboard you would like it to "activate": ``` [self.myTextfield setKeyboardType:UIKeyboardTypeNumberPad]; ```
2,489,939
Is there some way to have a keyboard of type UIKeyboardTypeNamePhonePad start in phone number pad mode rather than alphabetic? The keyboard works well for what I need but I'd like it to start in the "other" mode since that is more likely what the user will enter.
2010/03/22
[ "https://Stackoverflow.com/questions/2489939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235160/" ]
I believe that by setting the `keyboardType` property to `UIKeyboardTypeNumbersAndPunctuation`, you will default to the numbers and punctuation view, while still having the option of returning to the "ABC" view. Apple's documentation on it: <http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextIn...
Unfortunately the answer to this question is NO, but there is a workaround. You can use the UIKeyboardTypeNumberPad and add a custom button (e.g. <https://stackoverflow.com/a/4826342/61569>) to switch the keyboard to UIKeyboardTypeNamePhonePad. The challenge with this workaround is to support the keyboard styles of d...
2,489,939
Is there some way to have a keyboard of type UIKeyboardTypeNamePhonePad start in phone number pad mode rather than alphabetic? The keyboard works well for what I need but I'd like it to start in the "other" mode since that is more likely what the user will enter.
2010/03/22
[ "https://Stackoverflow.com/questions/2489939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235160/" ]
I believe that by setting the `keyboardType` property to `UIKeyboardTypeNumbersAndPunctuation`, you will default to the numbers and punctuation view, while still having the option of returning to the "ABC" view. Apple's documentation on it: <http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextIn...
The *UIKeyboardTypeNumberPad* does not have the 'Done' or the 'ABC' button that will allow you to toggle back and forth between default keyboard and the NumberPad. Now you can choose to go with what @Anthony F suggested but remember you risk the chance of loosing the custom 'Done' button everytime Apple releases newer ...
676,733
I'm trying to get the exit code of the function that I'm repeatedly calling in the "condition" part of a Bash `while` loop: ```bash while <function>; do <stuff> done ``` When this loop terminates due to an error, I need the exit code of `<function>`. Any thoughts on how I can get that?
2021/11/09
[ "https://unix.stackexchange.com/questions/676733", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/58343/" ]
You can capture the exit value from the condition and propagate that forward: ``` while rmdir FOO; ss=$?; [[ $ss -eq 0 ]] do echo in loop done echo "out of loop with ?=$? but ss=$ss" ``` Output ``` rmdir: failed to remove 'FOO': No such file or directory out of loop with ?=0 but ss=1 ``` In this instance the ...
One way to do this is to make the test explicitly instead of delegating it to `while`. So, the following should do: ```bash err=0 while true do <function> (( (err=$?) > 0 )) && break <stuff> done echo "$err" ``` At the beginning of the (a priori infinite) loop you would execute the condition command "man...
676,733
I'm trying to get the exit code of the function that I'm repeatedly calling in the "condition" part of a Bash `while` loop: ```bash while <function>; do <stuff> done ``` When this loop terminates due to an error, I need the exit code of `<function>`. Any thoughts on how I can get that?
2021/11/09
[ "https://unix.stackexchange.com/questions/676733", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/58343/" ]
One way to do this is to make the test explicitly instead of delegating it to `while`. So, the following should do: ```bash err=0 while true do <function> (( (err=$?) > 0 )) && break <stuff> done echo "$err" ``` At the beginning of the (a priori infinite) loop you would execute the condition command "man...
Create a wrapping function that sets a variable with the result of the exit code of your function. Example: ```bsh e=0 # file does not exist foo() { rm xyz } baz() { foo e=$? [[ $e -ne 0 ]] && return 1 return 0 } # create a file touch xyz while baz; do # first loop succeeds, the file exists # second...
676,733
I'm trying to get the exit code of the function that I'm repeatedly calling in the "condition" part of a Bash `while` loop: ```bash while <function>; do <stuff> done ``` When this loop terminates due to an error, I need the exit code of `<function>`. Any thoughts on how I can get that?
2021/11/09
[ "https://unix.stackexchange.com/questions/676733", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/58343/" ]
One way to do this is to make the test explicitly instead of delegating it to `while`. So, the following should do: ```bash err=0 while true do <function> (( (err=$?) > 0 )) && break <stuff> done echo "$err" ``` At the beginning of the (a priori infinite) loop you would execute the condition command "man...
With `zsh`, you could use `return` from an anonymous function: ``` () while ((1)) { <function> || return <stuff> } print $? ``` With any Bourne-like shell, you can always use a named function: ``` repeat_until_fail() while true; do <function> || return <stuff> done repeat_until_fail echo "$?" ```
676,733
I'm trying to get the exit code of the function that I'm repeatedly calling in the "condition" part of a Bash `while` loop: ```bash while <function>; do <stuff> done ``` When this loop terminates due to an error, I need the exit code of `<function>`. Any thoughts on how I can get that?
2021/11/09
[ "https://unix.stackexchange.com/questions/676733", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/58343/" ]
You can capture the exit value from the condition and propagate that forward: ``` while rmdir FOO; ss=$?; [[ $ss -eq 0 ]] do echo in loop done echo "out of loop with ?=$? but ss=$ss" ``` Output ``` rmdir: failed to remove 'FOO': No such file or directory out of loop with ?=0 but ss=1 ``` In this instance the ...
Create a wrapping function that sets a variable with the result of the exit code of your function. Example: ```bsh e=0 # file does not exist foo() { rm xyz } baz() { foo e=$? [[ $e -ne 0 ]] && return 1 return 0 } # create a file touch xyz while baz; do # first loop succeeds, the file exists # second...
676,733
I'm trying to get the exit code of the function that I'm repeatedly calling in the "condition" part of a Bash `while` loop: ```bash while <function>; do <stuff> done ``` When this loop terminates due to an error, I need the exit code of `<function>`. Any thoughts on how I can get that?
2021/11/09
[ "https://unix.stackexchange.com/questions/676733", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/58343/" ]
You can capture the exit value from the condition and propagate that forward: ``` while rmdir FOO; ss=$?; [[ $ss -eq 0 ]] do echo in loop done echo "out of loop with ?=$? but ss=$ss" ``` Output ``` rmdir: failed to remove 'FOO': No such file or directory out of loop with ?=0 but ss=1 ``` In this instance the ...
With `zsh`, you could use `return` from an anonymous function: ``` () while ((1)) { <function> || return <stuff> } print $? ``` With any Bourne-like shell, you can always use a named function: ``` repeat_until_fail() while true; do <function> || return <stuff> done repeat_until_fail echo "$?" ```
676,733
I'm trying to get the exit code of the function that I'm repeatedly calling in the "condition" part of a Bash `while` loop: ```bash while <function>; do <stuff> done ``` When this loop terminates due to an error, I need the exit code of `<function>`. Any thoughts on how I can get that?
2021/11/09
[ "https://unix.stackexchange.com/questions/676733", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/58343/" ]
Create a wrapping function that sets a variable with the result of the exit code of your function. Example: ```bsh e=0 # file does not exist foo() { rm xyz } baz() { foo e=$? [[ $e -ne 0 ]] && return 1 return 0 } # create a file touch xyz while baz; do # first loop succeeds, the file exists # second...
With `zsh`, you could use `return` from an anonymous function: ``` () while ((1)) { <function> || return <stuff> } print $? ``` With any Bourne-like shell, you can always use a named function: ``` repeat_until_fail() while true; do <function> || return <stuff> done repeat_until_fail echo "$?" ```
238,089
I'll try to explain this so it hopefully makes sense. I am putting a 9U server rack about 6 feet up a closet wall. I found a rack that has an open space in the back. My goal here is installing a 4 outlet box in the wall inside the rack to prevent anyone from unplugging it. This is for a security camera NVR. This is th...
2021/11/11
[ "https://diy.stackexchange.com/questions/238089", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/120126/" ]
A few things to consider: * Rack Mounting The rack itself needs to be either attached to studs or screwed into something else that is attached to studs. Since it is unlikely that you would be able to get enough screws into studs by positioning the rack "just right", the usual method is to cut a sheet of plywood to be...
I'm adding an answer to supplement the excellent [answer from manassehkatz above](https://diy.stackexchange.com/a/238091/43874) because he beat me to most of the points I wanted to make. If you can mount it right where you want it and have it centered between studs, thats great, but you have to make sure that electric...
6,235,009
I'm having trouble getting wikipedia urls including unicode! Given a page title like: 1992\u201393\_UE\_Lleida\_seasonnow Just plain url ... <http://en.wikipedia.org/wiki/1992>\u201393\_UE\_Lleida\_seasonnow Using URLEncoder (set to UTF-8) .... <http://en.wikipedia.org/wiki/1992%5Cu201393_UE_Lleida_seasonnow> Whe...
2011/06/04
[ "https://Stackoverflow.com/questions/6235009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/581135/" ]
The correct URI is `http://en.wikipedia.org/wiki/2009%E2%80%9310_UE_Lleida_season`. Many browsers display literals instead of [percent-encoded](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) escape sequences. This is considered to be more user-friendly. However, correctly encoded URIs must use percent encoding fo...
> > Does wikipedia have some strange way to encode unicode in urls? > > > It's not really strange, it's standard use of [IRI](http://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s. The IRI: ``` http://en.wikipedia.org/wiki/2009–10_UE_Lleida_season ``` which includes a Unicode en-dash, is equivale...
6,235,009
I'm having trouble getting wikipedia urls including unicode! Given a page title like: 1992\u201393\_UE\_Lleida\_seasonnow Just plain url ... <http://en.wikipedia.org/wiki/1992>\u201393\_UE\_Lleida\_seasonnow Using URLEncoder (set to UTF-8) .... <http://en.wikipedia.org/wiki/1992%5Cu201393_UE_Lleida_seasonnow> Whe...
2011/06/04
[ "https://Stackoverflow.com/questions/6235009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/581135/" ]
The correct URI is `http://en.wikipedia.org/wiki/2009%E2%80%9310_UE_Lleida_season`. Many browsers display literals instead of [percent-encoded](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) escape sequences. This is considered to be more user-friendly. However, correctly encoded URIs must use percent encoding fo...
Here's a simple algorithm for encoding URLs that use Unicode so that you can use HttpURLConnection to retrieve them: ``` import static org.junit.Assert.*; import java.net.URLEncoder; import org.apache.commons.lang.CharUtils; import org.junit.Test; public class InternationalURLEncoderTest { static String encode...
6,235,009
I'm having trouble getting wikipedia urls including unicode! Given a page title like: 1992\u201393\_UE\_Lleida\_seasonnow Just plain url ... <http://en.wikipedia.org/wiki/1992>\u201393\_UE\_Lleida\_seasonnow Using URLEncoder (set to UTF-8) .... <http://en.wikipedia.org/wiki/1992%5Cu201393_UE_Lleida_seasonnow> Whe...
2011/06/04
[ "https://Stackoverflow.com/questions/6235009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/581135/" ]
The correct URI is `http://en.wikipedia.org/wiki/2009%E2%80%9310_UE_Lleida_season`. Many browsers display literals instead of [percent-encoded](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) escape sequences. This is considered to be more user-friendly. However, correctly encoded URIs must use percent encoding fo...
Here's a simpler way of encoding the URL in Chi's answer: ``` static String encodeUrl(String urlToEncode) throws URISyntaxException { return new URI(urlToEncode).toASCIIString(); } ``` See [this answer](https://stackoverflow.com/questions/6519746/url-decode-in-java-6#6603584) for clarification.
6,235,009
I'm having trouble getting wikipedia urls including unicode! Given a page title like: 1992\u201393\_UE\_Lleida\_seasonnow Just plain url ... <http://en.wikipedia.org/wiki/1992>\u201393\_UE\_Lleida\_seasonnow Using URLEncoder (set to UTF-8) .... <http://en.wikipedia.org/wiki/1992%5Cu201393_UE_Lleida_seasonnow> Whe...
2011/06/04
[ "https://Stackoverflow.com/questions/6235009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/581135/" ]
> > Does wikipedia have some strange way to encode unicode in urls? > > > It's not really strange, it's standard use of [IRI](http://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s. The IRI: ``` http://en.wikipedia.org/wiki/2009–10_UE_Lleida_season ``` which includes a Unicode en-dash, is equivale...
Here's a simple algorithm for encoding URLs that use Unicode so that you can use HttpURLConnection to retrieve them: ``` import static org.junit.Assert.*; import java.net.URLEncoder; import org.apache.commons.lang.CharUtils; import org.junit.Test; public class InternationalURLEncoderTest { static String encode...
6,235,009
I'm having trouble getting wikipedia urls including unicode! Given a page title like: 1992\u201393\_UE\_Lleida\_seasonnow Just plain url ... <http://en.wikipedia.org/wiki/1992>\u201393\_UE\_Lleida\_seasonnow Using URLEncoder (set to UTF-8) .... <http://en.wikipedia.org/wiki/1992%5Cu201393_UE_Lleida_seasonnow> Whe...
2011/06/04
[ "https://Stackoverflow.com/questions/6235009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/581135/" ]
> > Does wikipedia have some strange way to encode unicode in urls? > > > It's not really strange, it's standard use of [IRI](http://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s. The IRI: ``` http://en.wikipedia.org/wiki/2009–10_UE_Lleida_season ``` which includes a Unicode en-dash, is equivale...
Here's a simpler way of encoding the URL in Chi's answer: ``` static String encodeUrl(String urlToEncode) throws URISyntaxException { return new URI(urlToEncode).toASCIIString(); } ``` See [this answer](https://stackoverflow.com/questions/6519746/url-decode-in-java-6#6603584) for clarification.
29,836,154
This seems easy. I have tried debugging it, and it keeps throwing an exception. Sanity check please? ``` int[] array = {0, 1, 2, 3, 4, 5}; for(int i = 0; i <= array.length; i++) { System.out.println(array[i]); } ```
2015/04/23
[ "https://Stackoverflow.com/questions/29836154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3299059/" ]
Change your for loop to: ``` for(int i = 0; i < array.length; i++) { ```
`ArrayIndexOutOfBounds`, since arrays in java are 0based, the highest index of an array with length 'l' is 'l-1'.
29,836,154
This seems easy. I have tried debugging it, and it keeps throwing an exception. Sanity check please? ``` int[] array = {0, 1, 2, 3, 4, 5}; for(int i = 0; i <= array.length; i++) { System.out.println(array[i]); } ```
2015/04/23
[ "https://Stackoverflow.com/questions/29836154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3299059/" ]
This: ``` i <= array.length ``` Will loop from 0-6. As the exception is undoubtedly telling you (and you really should read it), there is no index `6` in your array. Try this: ``` i < array.length ```
Change your for loop to: ``` for(int i = 0; i < array.length; i++) { ```
29,836,154
This seems easy. I have tried debugging it, and it keeps throwing an exception. Sanity check please? ``` int[] array = {0, 1, 2, 3, 4, 5}; for(int i = 0; i <= array.length; i++) { System.out.println(array[i]); } ```
2015/04/23
[ "https://Stackoverflow.com/questions/29836154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3299059/" ]
This: ``` i <= array.length ``` Will loop from 0-6. As the exception is undoubtedly telling you (and you really should read it), there is no index `6` in your array. Try this: ``` i < array.length ```
`ArrayIndexOutOfBounds`, since arrays in java are 0based, the highest index of an array with length 'l' is 'l-1'.
29,836,154
This seems easy. I have tried debugging it, and it keeps throwing an exception. Sanity check please? ``` int[] array = {0, 1, 2, 3, 4, 5}; for(int i = 0; i <= array.length; i++) { System.out.println(array[i]); } ```
2015/04/23
[ "https://Stackoverflow.com/questions/29836154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3299059/" ]
You can always iterate the array from `0` to `array.length-1`. You are trying to access the element at index which is out of bound of array length.
`ArrayIndexOutOfBounds`, since arrays in java are 0based, the highest index of an array with length 'l' is 'l-1'.
29,836,154
This seems easy. I have tried debugging it, and it keeps throwing an exception. Sanity check please? ``` int[] array = {0, 1, 2, 3, 4, 5}; for(int i = 0; i <= array.length; i++) { System.out.println(array[i]); } ```
2015/04/23
[ "https://Stackoverflow.com/questions/29836154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3299059/" ]
This: ``` i <= array.length ``` Will loop from 0-6. As the exception is undoubtedly telling you (and you really should read it), there is no index `6` in your array. Try this: ``` i < array.length ```
You can always iterate the array from `0` to `array.length-1`. You are trying to access the element at index which is out of bound of array length.
16,946,126
``` <tr id="trHdn"> <asp:hiddenfield runat="server" id="hdncontrol1" /> <asp:hiddenfield runat="server" id="hdncontrol2" /> </tr> ``` Need to write jQuery to update all hiddenfield values to '**true**' within tr '**trHdn**' in 1 line. This is a page in asp.net Web Application
2013/06/05
[ "https://Stackoverflow.com/questions/16946126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2324497/" ]
You can use the parent > child selector in jquery ``` $("#trHdn > input[type='hidden']").val('true'); ``` It's worth noting that this only handles direct descendants of tr, if you have hidden fields nested deeper inside of a tr, then you may want to leave out the '>' ``` $("#trHdn input[type='hidden']").val('true')...
You can manipulate all hidden fields (assumed to be having an `id` that starts with `hdncontrol`) using: ``` $('#trHdn [id^="hdncontrol"]').val(true); ```
16,946,126
``` <tr id="trHdn"> <asp:hiddenfield runat="server" id="hdncontrol1" /> <asp:hiddenfield runat="server" id="hdncontrol2" /> </tr> ``` Need to write jQuery to update all hiddenfield values to '**true**' within tr '**trHdn**' in 1 line. This is a page in asp.net Web Application
2013/06/05
[ "https://Stackoverflow.com/questions/16946126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2324497/" ]
You can use the parent > child selector in jquery ``` $("#trHdn > input[type='hidden']").val('true'); ``` It's worth noting that this only handles direct descendants of tr, if you have hidden fields nested deeper inside of a tr, then you may want to leave out the '>' ``` $("#trHdn input[type='hidden']").val('true')...
``` $('#trHdn').find('input[type="hidden"]').val('true'); ``` **Edit:** This is essentially the same as the accepted answer but for one important difference: It's a lot faster. Why? jQuery selectors search from right to left. The accepted answer will search for all hidden inputs in the document, then eliminate those...
17,646,724
In my Java Application i'm getting Request parameter like Array ``` <script type="text/javascript"> var names = new Array(); $.ajax({ url : "Result", type : 'POST', data : { "names" : JSON.stringify(names), "globalClassId" : globalClassId }}); </script> `...
2013/07/15
[ "https://Stackoverflow.com/questions/17646724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2423821/" ]
use [**org.json**](http://www.json.org/java/) ``` JSONObject obj = new JSONObject(request.getParameter("names")); List<String> list = new ArrayList<String>(); JSONArray array = obj.getJSONArray("interests"); for(int i = 0 ; i < array.length() ; i++){ } ```
First thing i want to tell you that generate your JSON like a list or Map Structure so that you can get Structure using any JSON or GSON Api. It will make simple for you to retrieve them & no other Constraints needed in future to retrieve them.
17,646,724
In my Java Application i'm getting Request parameter like Array ``` <script type="text/javascript"> var names = new Array(); $.ajax({ url : "Result", type : 'POST', data : { "names" : JSON.stringify(names), "globalClassId" : globalClassId }}); </script> `...
2013/07/15
[ "https://Stackoverflow.com/questions/17646724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2423821/" ]
Just i'm using String concept to solve this Problem but this is not real solution.. ``` //Get the each added user using names[] for (String id : names) { userVO = userService.getUser(id.substring(2, id.length()-2)); userList.add(userVO); } ``` If any body know real solution Please tell me...
First thing i want to tell you that generate your JSON like a list or Map Structure so that you can get Structure using any JSON or GSON Api. It will make simple for you to retrieve them & no other Constraints needed in future to retrieve them.
17,646,724
In my Java Application i'm getting Request parameter like Array ``` <script type="text/javascript"> var names = new Array(); $.ajax({ url : "Result", type : 'POST', data : { "names" : JSON.stringify(names), "globalClassId" : globalClassId }}); </script> `...
2013/07/15
[ "https://Stackoverflow.com/questions/17646724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2423821/" ]
instead of `JSON.stringify(names)` we can use names.join() this will be return Array, so we can easily send request attribute like string `@RequestParam("names") String names` and now using for loop we easily get values like.. ``` //Get the each added user using names[] for (String id : names.split(",")) { ...
First thing i want to tell you that generate your JSON like a list or Map Structure so that you can get Structure using any JSON or GSON Api. It will make simple for you to retrieve them & no other Constraints needed in future to retrieve them.
45,926,782
When I input data into a table, I get null instead of int for the primary key. How can I fix this? This is my table: ``` conn.execute('CREATE TABLE lists (listid INT PRIMARY KEY, book TEXT, chapter INT)') ``` I input data into `lists` with this code: ``` @app.route('/addbook', methods = ['POST', 'GET']) def addbo...
2017/08/28
[ "https://Stackoverflow.com/questions/45926782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7695268/" ]
From the [SQLite documentation](https://sqlite.org/lang_createtable.html#rowid) (emphasis mine): > > With one exception noted below, if a rowid table has a primary key > that consists of a single column and the declared type of that column > is "INTEGER" in any mixture of upper and lower case, then the column > be...
> > `cur.execute("INSERT INTO lists (book, chapter) VALUES (?, ?)", (bt, bc))` > > > This would produce a `ProgrammingError` for incorrect number of bindings. Instead use: ``` cur.execute("INSERT INTO lists (book, chapter) VALUES (?, ?)", [(bt, bc)]) ``` Also, in your `CREATE TABLE` command, you would need to c...
294,307
I want to make the same signal like the following images using an Arduino Uno. But I can't find the baudrate of this signal. I calculated baudrate the same way as Wikipedia. But when I used the baudrate I got framing error. The duration of the start bit: 0.2223 ms 1/ ( 0.2233 / 1000) = 4478 bit/s What did I do wron...
2017/03/23
[ "https://electronics.stackexchange.com/questions/294307", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/143107/" ]
Try 10500 baud. The data stream should be `0xAA 0x24 0x00 0x00 0x55`. My suggestion to determine the baud rate is to look for characteristic bytes. In your capture the long zero sequence is a good candidate (generally, the `0x00` and `0xFF` bytes look very characteristic on serial): [![enter image description here](htt...
I believe the baud rate is 14400. [![enter image description here](https://i.stack.imgur.com/DMnqC.png)](https://i.stack.imgur.com/DMnqC.png) --- I estimate (measured with ruler) the yellow pulse is about 3.2x the green pulse. **I multiply your 4478 bit/s by 3.2 = 14,329 bits/s.**
294,307
I want to make the same signal like the following images using an Arduino Uno. But I can't find the baudrate of this signal. I calculated baudrate the same way as Wikipedia. But when I used the baudrate I got framing error. The duration of the start bit: 0.2223 ms 1/ ( 0.2233 / 1000) = 4478 bit/s What did I do wron...
2017/03/23
[ "https://electronics.stackexchange.com/questions/294307", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/143107/" ]
Try 10500 baud. The data stream should be `0xAA 0x24 0x00 0x00 0x55`. My suggestion to determine the baud rate is to look for characteristic bytes. In your capture the long zero sequence is a good candidate (generally, the `0x00` and `0xFF` bytes look very characteristic on serial): [![enter image description here](htt...
Assuming this is asynchronous serial data, the bit time is probably equal to (and cannot be longer than) the narrowest pulse. According to my pixel counting this is ~64.4us, corresponding to 15.5k bits/s. However, a standard UART frame consists of a Start bit (always low), 5-10 data/parity bits (high/low), and a Stop ...
24,786,628
When I intentionally shut down a web sockets server the client JavaScript code: ``` try { self.socket.send('ping'); } catch(ex) { console.log('exception'); } ``` writes in Chrome console: ``` WebSocket is already in CLOSING or CLOSED state. ``` This exception couldn't be caught by try-catch. How to detect...
2014/07/16
[ "https://Stackoverflow.com/questions/24786628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/999355/" ]
`print()` takes separate arguments, `file.write()` *does not*. You can reuse `print()` to write to your file instead: ``` with open('result.txt', 'a', encoding='utf-8') as outf: for k in main_dic: s = 0 print('stem:', k, file=outf) print('word forms and frequencies:', file=outf) fo...
``` file.write('stem:', k) ``` You're supplying two arguments to `write` on this line, when it only wants one. In contrast, `print` is happy to take as many arguments as you care to give it. Try: ``` file.write('stem: ' + str(k)) ```
24,786,628
When I intentionally shut down a web sockets server the client JavaScript code: ``` try { self.socket.send('ping'); } catch(ex) { console.log('exception'); } ``` writes in Chrome console: ``` WebSocket is already in CLOSING or CLOSED state. ``` This exception couldn't be caught by try-catch. How to detect...
2014/07/16
[ "https://Stackoverflow.com/questions/24786628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/999355/" ]
`file.write` is given multiple arguments when its expecting only one string argument ``` file.write('stem total frequency:', s) ^ ``` The error gets raised as `'stem total frequency:', s` are treated as two different arguments. This can be fixed by concatenation ``` file.write('ste...
``` file.write('stem:', k) ``` You're supplying two arguments to `write` on this line, when it only wants one. In contrast, `print` is happy to take as many arguments as you care to give it. Try: ``` file.write('stem: ' + str(k)) ```
24,786,628
When I intentionally shut down a web sockets server the client JavaScript code: ``` try { self.socket.send('ping'); } catch(ex) { console.log('exception'); } ``` writes in Chrome console: ``` WebSocket is already in CLOSING or CLOSED state. ``` This exception couldn't be caught by try-catch. How to detect...
2014/07/16
[ "https://Stackoverflow.com/questions/24786628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/999355/" ]
`print()` takes separate arguments, `file.write()` *does not*. You can reuse `print()` to write to your file instead: ``` with open('result.txt', 'a', encoding='utf-8') as outf: for k in main_dic: s = 0 print('stem:', k, file=outf) print('word forms and frequencies:', file=outf) fo...
`file.write` is given multiple arguments when its expecting only one string argument ``` file.write('stem total frequency:', s) ^ ``` The error gets raised as `'stem total frequency:', s` are treated as two different arguments. This can be fixed by concatenation ``` file.write('ste...
34,679,564
I have a ng-repeat where I the orderBy-function. I've noticed that it's not working as I would like it to do when it comes to case sensitivity In my example you see that "BBBBB" comes before "aaaaa", which is wrong in my case. "aaaaa" should be ordered before "BBBBB". I'm not sure how to do this..Can anyone help me? ...
2016/01/08
[ "https://Stackoverflow.com/questions/34679564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1789325/" ]
Change your predicate to a function: ``` $scope.predicate = function(d) { return d.group[0].toLowerCase(); }; ```
Change your predicate as ``` $scope.predicate = function(item) { return item.group.join('').toUpperCase(); }; ```
34,679,564
I have a ng-repeat where I the orderBy-function. I've noticed that it's not working as I would like it to do when it comes to case sensitivity In my example you see that "BBBBB" comes before "aaaaa", which is wrong in my case. "aaaaa" should be ordered before "BBBBB". I'm not sure how to do this..Can anyone help me? ...
2016/01/08
[ "https://Stackoverflow.com/questions/34679564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1789325/" ]
Change your predicate to a function: ``` $scope.predicate = function(d) { return d.group[0].toLowerCase(); }; ```
The problem isn't actually the case. It's due to the fact that your data is not comprised of strings. Change the data structure to be like so: ``` $scope.friends = [{group:'aaaaa'}, {group:'BBBBB'}, {group:'AAAA'}, ]; ```
34,679,564
I have a ng-repeat where I the orderBy-function. I've noticed that it's not working as I would like it to do when it comes to case sensitivity In my example you see that "BBBBB" comes before "aaaaa", which is wrong in my case. "aaaaa" should be ordered before "BBBBB". I'm not sure how to do this..Can anyone help me? ...
2016/01/08
[ "https://Stackoverflow.com/questions/34679564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1789325/" ]
The problem isn't actually the case. It's due to the fact that your data is not comprised of strings. Change the data structure to be like so: ``` $scope.friends = [{group:'aaaaa'}, {group:'BBBBB'}, {group:'AAAA'}, ]; ```
Change your predicate as ``` $scope.predicate = function(item) { return item.group.join('').toUpperCase(); }; ```
127,150
> > To that great man, I dedicate this book to. > > > Is this correct? I'm wondering if it's alright to end a sentence with a to proposition at the end.
2017/04/19
[ "https://ell.stackexchange.com/questions/127150", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/54074/" ]
You can have either of the *to*'s, but not both; but the meaning is different. > > To that great man, I dedicate this book. > > > is a perfectly good sentence. It's a non-standard word order (more normal would be "I dedicate this book to that great man") so it has the effect of emphasising the great man. > > ...
In this case the second *to* is wrong because the sentence already has one (at the beginning). In the past, prepositions at the end of the sentence are termed "stranded prepositions" and regarded as a stylistic flaw, if not even grammatically wrong. More modern linguists and style guides, however, regard them as somet...
23,362,471
I have a weird problem in which if I delete the line ***`Type doctor name <input type="text" name="new_Doctor_name" value="<?php echo $row1[3]; ?>" ><br />`***, I cannot update my records and get the notice ***Undefined variable: row1***. However, if I keep this line, which I copy from another table, I can update just ...
2014/04/29
[ "https://Stackoverflow.com/questions/23362471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3548673/" ]
The `if()` statement : ``` if( isset($_POST['new_Doctor_name']) ) ``` Will only ever be executed if an `input` element exists in the `POST` data with a name of `new_Doctor_name`. If you remove it from the DOM, it will not be passed with the request, and thus the queries won't execute. It may be better to check for ...
The variable `row1` is set in this part of the code. If the variable is returning an error that it has not been defined this means that the code below has not been executed. This code is only ran if the `$_GET['edit1']` variable is set. ``` if( isset($_GET['edit1']) ) { $id = $_GET['edit1']; ...
63,899,995
I've a variable named var `text = 'Saif'` So how can I check the first character of this value (S) is a letter, number or special character?? I've already tried with the code bellow - ``` var text = 'Saif' var char = /[A-Z]/g var num = /[0-9]/g if (text.match(char)) { ...
2020/09/15
[ "https://Stackoverflow.com/questions/63899995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
While searching for an answer I tried to find something from the devs of the apps that I saw this feature working. I found [this article](https://willowtreeapps.com/ideas/an-introduction-to-android-instant-apps) and I notice only two differences from what I was doing: 1. `android:order="1"`, I never used so I looked t...
I had the same problem, and it was because I didn't have `android:targetSandboxVersion="2"` in my application tag.
55,865,686
I try to add width:100% to div tag which is inside bootstrap grid system (col-lg-3). But div takes the whole browser width. It doesn't take 100% width of parent(col-lg-3). ```css .sidebar { color: #fff; font-weight: bold; font-size: 18px; background-color: green; } .wrapping { width: 100...
2019/04/26
[ "https://Stackoverflow.com/questions/55865686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10145453/" ]
Are you trying to set 100% width to your .wrapping div? This will take the width of browser window, becouse its position fixed. try adding this to the .sidebar: ``` position: relative; ``` this will make the wrapping to take the width of the sidebar. Edit: Try using position sticky instead of position fixed. This w...
you can set the width to auto So it takes the width of the parent tag ``` .wrapping { width: auto; padding-left: 32px; position: fixed; background-color: red; } ```
8,702,762
I am new at learning how to make 10 or 20 or 25 number table. I am doing 10 number table. For example I have 4 number table 1,2,3,4 and want at the end to write it like 4,3,2,1 - can someone tell me how to do that? My program ``` static void Main(string[] args) { int[] p = new int[10] { 2, 9, 13, 3,...
2012/01/02
[ "https://Stackoverflow.com/questions/8702762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1125536/" ]
You can use [Linq's](http://msdn.microsoft.com/en-us/library/gg145016.aspx) [OrderBy](http://msdn.microsoft.com/en-us/library/bb343617.aspx) and [OrderByDescending](http://msdn.microsoft.com/en-us/library/bb292260.aspx) methods to sort a collection. In your example: ``` int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30...
If you're using a List you can do it with: ``` using System; using System.Collections.Generic; public class Example { public static void Main() { List<int> table = new List<int>(); table.Add(1); table.Add(2); table.Add(3); table.Add(4); foreach(int item in tab...
8,702,762
I am new at learning how to make 10 or 20 or 25 number table. I am doing 10 number table. For example I have 4 number table 1,2,3,4 and want at the end to write it like 4,3,2,1 - can someone tell me how to do that? My program ``` static void Main(string[] args) { int[] p = new int[10] { 2, 9, 13, 3,...
2012/01/02
[ "https://Stackoverflow.com/questions/8702762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1125536/" ]
You can use [Linq's](http://msdn.microsoft.com/en-us/library/gg145016.aspx) [OrderBy](http://msdn.microsoft.com/en-us/library/bb343617.aspx) and [OrderByDescending](http://msdn.microsoft.com/en-us/library/bb292260.aspx) methods to sort a collection. In your example: ``` int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30...
I think what you mean is that you want to reverse an array. So if you have this array: ``` int[] a = new int[] { 0, 1, 2, 3 }; ``` You want to reverse the elements so that they're `{ 3, 2, 1, 0 }`. The key is that you want to swap elements. For example, if you were to write: ``` // swap first and last elements int...
8,702,762
I am new at learning how to make 10 or 20 or 25 number table. I am doing 10 number table. For example I have 4 number table 1,2,3,4 and want at the end to write it like 4,3,2,1 - can someone tell me how to do that? My program ``` static void Main(string[] args) { int[] p = new int[10] { 2, 9, 13, 3,...
2012/01/02
[ "https://Stackoverflow.com/questions/8702762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1125536/" ]
You can use [Linq's](http://msdn.microsoft.com/en-us/library/gg145016.aspx) [OrderBy](http://msdn.microsoft.com/en-us/library/bb343617.aspx) and [OrderByDescending](http://msdn.microsoft.com/en-us/library/bb292260.aspx) methods to sort a collection. In your example: ``` int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30...
To sort a one-dimensional array, you could call the Array.Sort() and/or Array.Reverse() methods. Updating your example, you could do something like the following: ``` int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30, 0, 1, 4 }; int vsota = 0; float povprecje = 0; for (int i = 0; i < p.Length; i++) { Console.Write...
8,702,762
I am new at learning how to make 10 or 20 or 25 number table. I am doing 10 number table. For example I have 4 number table 1,2,3,4 and want at the end to write it like 4,3,2,1 - can someone tell me how to do that? My program ``` static void Main(string[] args) { int[] p = new int[10] { 2, 9, 13, 3,...
2012/01/02
[ "https://Stackoverflow.com/questions/8702762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1125536/" ]
You can use [Linq's](http://msdn.microsoft.com/en-us/library/gg145016.aspx) [OrderBy](http://msdn.microsoft.com/en-us/library/bb343617.aspx) and [OrderByDescending](http://msdn.microsoft.com/en-us/library/bb292260.aspx) methods to sort a collection. In your example: ``` int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30...
To reverse the array: ``` p = p.Reverse().ToArray(); ```
8,702,762
I am new at learning how to make 10 or 20 or 25 number table. I am doing 10 number table. For example I have 4 number table 1,2,3,4 and want at the end to write it like 4,3,2,1 - can someone tell me how to do that? My program ``` static void Main(string[] args) { int[] p = new int[10] { 2, 9, 13, 3,...
2012/01/02
[ "https://Stackoverflow.com/questions/8702762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1125536/" ]
You can use [Linq's](http://msdn.microsoft.com/en-us/library/gg145016.aspx) [OrderBy](http://msdn.microsoft.com/en-us/library/bb343617.aspx) and [OrderByDescending](http://msdn.microsoft.com/en-us/library/bb292260.aspx) methods to sort a collection. In your example: ``` int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30...
This is an update to @Metro Smurf's LINQ solution: ``` int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30, 0, 1, 4 }; p = p.OrderByDescending(x => x).ToArray(); ```
51,970,936
Consider the following code : ``` import React, { Component } from 'react'; class Counter extends Component { state = { value: 5 }; increment = () => { this.setState(prevState => ({ value: prevState.value + 1 })); }; decrement = () => { this.setState(prevState => ({ value: prevState....
2018/08/22
[ "https://Stackoverflow.com/questions/51970936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10185979/" ]
Just set a minimum value in your decrementing code: ``` decrement = () => { this.setState(prevState => ({ value: Math.max(prevState.value - 1, 0) })); }; ```
That's how number input works. To simplify the code you could try to use [validity](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) state (if your target browsers support it) ``` onChange(e) { if (!e.target.validity.badInput) { this.setState(Number(e.target.value)) } } ``` [Example](h...
51,970,936
Consider the following code : ``` import React, { Component } from 'react'; class Counter extends Component { state = { value: 5 }; increment = () => { this.setState(prevState => ({ value: prevState.value + 1 })); }; decrement = () => { this.setState(prevState => ({ value: prevState....
2018/08/22
[ "https://Stackoverflow.com/questions/51970936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10185979/" ]
Just set a minimum value in your decrementing code: ``` decrement = () => { this.setState(prevState => ({ value: Math.max(prevState.value - 1, 0) })); }; ```
you can test it ``` const onPressDecrement = () => setCount((prevCount) => (Math.max(prevCount - 1,1))); ```
51,970,936
Consider the following code : ``` import React, { Component } from 'react'; class Counter extends Component { state = { value: 5 }; increment = () => { this.setState(prevState => ({ value: prevState.value + 1 })); }; decrement = () => { this.setState(prevState => ({ value: prevState....
2018/08/22
[ "https://Stackoverflow.com/questions/51970936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10185979/" ]
Just set a minimum value in your decrementing code: ``` decrement = () => { this.setState(prevState => ({ value: Math.max(prevState.value - 1, 0) })); }; ```
**On Way Use Conditional (ternary) operator in decrement Function** ``` decrement = () => { this.setState(prevState => ({ value: prevState.value ? prevState.value -1 : 0 })); }; ```
33,027,421
``` public class Studying { public static void main(String[] args) { for (int i= 0; i<=5; i++){ for (int q = 4-i; q>=0;){ System.out.print(" "); } for (int w= i; w>0; w++ ){ System.out.print("*"); } System.out.print(...
2015/10/08
[ "https://Stackoverflow.com/questions/33027421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5420676/" ]
``` for (int i = 0; i < 5; i++) System.out.println(" *********".substring(i, 5 + 2*i)); ``` Result: ``` * *** ***** ******* ********* ```
Ex: ``` * *** ***** ******* ********* ``` Code: ``` int numberOfRows = 5; for(int i=0; i<numberOfRows; i++) { for(int a=0; a<=numberOfRows; a++) { int x = numberOfRows - i; if (a > x) { System.out.print("*"); } else { System.out.print(" ");...
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
I guess your mean to convert the list of ints to a **list** of floats, not to a single float, right? First, dart has no type called `float`. Instead it has type `double`. To convert it, you can use the `map()` function: ``` var listInt = [1, 2, 3]; var listDouble = list.map((i) => i.toDouble()).toList(); ```
If you already have: ```dart int.parse("0xbf641dad") ``` I don't see why this wouldn't work: ```dart int.parse("0xbf641dad").toDouble(); ```
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
I guess your mean to convert the list of ints to a **list** of floats, not to a single float, right? First, dart has no type called `float`. Instead it has type `double`. To convert it, you can use the `map()` function: ``` var listInt = [1, 2, 3]; var listDouble = list.map((i) => i.toDouble()).toList(); ```
You may need this: ``` double parseHexString(String hexStr, bool littleEndian){ if(hexStr.length % 2 != 0){ return 0; } if(littleEndian == true){ List<int> bytes = hex.decode(hexStr).reversed.toList(); hexStr = hex.encode(bytes); } var byteConvert = ByteData(12); byteConvert.setInt64(0, int.pa...
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
I guess your mean to convert the list of ints to a **list** of floats, not to a single float, right? First, dart has no type called `float`. Instead it has type `double`. To convert it, you can use the `map()` function: ``` var listInt = [1, 2, 3]; var listDouble = list.map((i) => i.toDouble()).toList(); ```
I used dart:typed\_data for this: ``` import 'dart:typed_data'; List<int> intList = [191, 100, 29, 173]; double asFloat = ByteData.view(Uint8List.fromList(List.from(intList)).buffer).getFloat32(0, Endian.little); ``` Library reference: <https://api.dart.dev/be/136883/dart-typed_data/dart-typed_data-library.html>
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
Had this same issue. I think you mean how do you make the four bytes into a float32 ? I needed to do the same thing. you will want to do something like this: first take the List value as a byte buffer, then take the byte data, then you can use the getFloat32 function. ``` ByteBuffer buffer = new Int8List.fromList(v...
If you already have: ```dart int.parse("0xbf641dad") ``` I don't see why this wouldn't work: ```dart int.parse("0xbf641dad").toDouble(); ```
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
Had this same issue. I think you mean how do you make the four bytes into a float32 ? I needed to do the same thing. you will want to do something like this: first take the List value as a byte buffer, then take the byte data, then you can use the getFloat32 function. ``` ByteBuffer buffer = new Int8List.fromList(v...
You may need this: ``` double parseHexString(String hexStr, bool littleEndian){ if(hexStr.length % 2 != 0){ return 0; } if(littleEndian == true){ List<int> bytes = hex.decode(hexStr).reversed.toList(); hexStr = hex.encode(bytes); } var byteConvert = ByteData(12); byteConvert.setInt64(0, int.pa...
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
Had this same issue. I think you mean how do you make the four bytes into a float32 ? I needed to do the same thing. you will want to do something like this: first take the List value as a byte buffer, then take the byte data, then you can use the getFloat32 function. ``` ByteBuffer buffer = new Int8List.fromList(v...
I used dart:typed\_data for this: ``` import 'dart:typed_data'; List<int> intList = [191, 100, 29, 173]; double asFloat = ByteData.view(Uint8List.fromList(List.from(intList)).buffer).getFloat32(0, Endian.little); ``` Library reference: <https://api.dart.dev/be/136883/dart-typed_data/dart-typed_data-library.html>
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
You may need this: ``` double parseHexString(String hexStr, bool littleEndian){ if(hexStr.length % 2 != 0){ return 0; } if(littleEndian == true){ List<int> bytes = hex.decode(hexStr).reversed.toList(); hexStr = hex.encode(bytes); } var byteConvert = ByteData(12); byteConvert.setInt64(0, int.pa...
If you already have: ```dart int.parse("0xbf641dad") ``` I don't see why this wouldn't work: ```dart int.parse("0xbf641dad").toDouble(); ```
57,284,372
I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a...
2019/07/31
[ "https://Stackoverflow.com/questions/57284372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064395/" ]
You may need this: ``` double parseHexString(String hexStr, bool littleEndian){ if(hexStr.length % 2 != 0){ return 0; } if(littleEndian == true){ List<int> bytes = hex.decode(hexStr).reversed.toList(); hexStr = hex.encode(bytes); } var byteConvert = ByteData(12); byteConvert.setInt64(0, int.pa...
I used dart:typed\_data for this: ``` import 'dart:typed_data'; List<int> intList = [191, 100, 29, 173]; double asFloat = ByteData.view(Uint8List.fromList(List.from(intList)).buffer).getFloat32(0, Endian.little); ``` Library reference: <https://api.dart.dev/be/136883/dart-typed_data/dart-typed_data-library.html>
7,074,327
When using clojure with postgresql, whenever a statement I issue is malformed in some way or otherwise rejected by the db itself I get something like the following error: ``` java.sql.BatchUpdateException: Batch entry 0 drop schema public cascade was aborted. Call getNextException to see the cause. ``` How ca...
2011/08/16
[ "https://Stackoverflow.com/questions/7074327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236375/" ]
See this [link on clojure/jdbc](http://en.wikibooks.org/wiki/Clojure_Programming/Examples/JDBC_Examples#Dropping_a_Table) showing how to drop a table with Clojure/JDBC. It also shows you how to handle errors with a try catch block. From within that try catch block, you can write something similar to: ``` (.printStac...
I have used the following to drop/create tables successfully and to get accurate error information when postgresql gets upset: ``` (defn drop-table [name] (sql/with-connection db (with-open [s (.createStatement (sql/connection))] (try (.addBatch s (str "drop table " name )) (seq (...
31,613,390
So I've got two iOS devices, an iPad and an iPhone. I have the iPad acting as an iBeacon and the phone picking it up and ranging correctly and that's all going swimmingly. What I want to achieve is for the phone to send the iPad a single string once it has been picked up as CLProximityImmediate. Is this possible and...
2015/07/24
[ "https://Stackoverflow.com/questions/31613390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3320342/" ]
I'm doing this now too. I started off using MultiPeer Connectivity as suggested by Felz. However, I was forced into an architecture that would support Android as well, so I switched to BlueTooth. The iPad acting as an iBeacon also has BlueTooth code that is looking for "peripherals" with a certain signature. Once the...
Location services do not include data transfers. Try the [Multipeer Connectivity framework](https://developer.apple.com/library/prerelease/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/index.html).
1,207
I've recently found a number of my own programs (very old!) on Spectrum +3 discs, and I'm about to get hold of a working +3. Assuming the discs are readable, I'd like to transfer the programs (mostly basic, some machine code) into something I can back-up and play with - ideally .TAP etc. I presume I could load them in...
2016/07/28
[ "https://retrocomputing.stackexchange.com/questions/1207", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/2169/" ]
I once wrote a program for this sort of situation: [DSKREAD](http://www.seasip.info/dskread.zip). It runs on a +3 and archives entire disks to tape. You could record the audio, convert to a .TAP file, and then load the .TAP in a +3 emulator to recreate .DSK images containing the original files. As far as I know, no-on...
One solution is to [plug](http://torlus.com/floppy/forum/viewtopic.php?f=20&t=403) an [HxC floppy emulator](http://hxc2001.free.fr/floppy_drive_emulator/) into the external floppy port and do a simple disk copy to an image on the SD card.
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
For all positive integers $k$, $$(4k-2)^4-(4k-2)=4(64k^4-128k^3+96k^2-33k+4)+2$$ is not divisible by $4$.
You can check that $2^4-2$ is not divisible by $4$. Next, note that if $n^4-n$ is not divisible by $4$, then $$ (n+4)^4-(n+4)=(4A - 4) + n^4-n $$ is also not divisible by $4$. ($A$ is an integer that can be found by the Binomial Theorem.)
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
For all positive integers $k$, $$(4k-2)^4-(4k-2)=4(64k^4-128k^3+96k^2-33k+4)+2$$ is not divisible by $4$.
Working in $\mathbb{Z}\_{4}$ we find $\bar{2}^{4}-\bar{2}=\bar{2}$ showing that $4\nmid\left(4m+2\right)^{4}-\left(4m+2\right)$ for each integer $m$.
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
For all positive integers $k$, $$(4k-2)^4-(4k-2)=4(64k^4-128k^3+96k^2-33k+4)+2$$ is not divisible by $4$.
$n^4 - n$ is divisible by $4$ for $n \equiv 0$ or $n \equiv 1 \bmod 4$. $n^4 - n$ leaves remainder $2$ when divided by $4$ for $n \equiv 2$ or $n \equiv 3 \bmod 4$.
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
$$n^4-n=n(n^3-1)=n(n-1)(n^2+n+1)$$ Now, $n^2+n+1=2\cdot\dfrac{n(n+1)}2+1$ is odd So, $4|(n^4-n)\iff4|n(n-1)$
You can check that $2^4-2$ is not divisible by $4$. Next, note that if $n^4-n$ is not divisible by $4$, then $$ (n+4)^4-(n+4)=(4A - 4) + n^4-n $$ is also not divisible by $4$. ($A$ is an integer that can be found by the Binomial Theorem.)
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
You can check that $2^4-2$ is not divisible by $4$. Next, note that if $n^4-n$ is not divisible by $4$, then $$ (n+4)^4-(n+4)=(4A - 4) + n^4-n $$ is also not divisible by $4$. ($A$ is an integer that can be found by the Binomial Theorem.)
Working in $\mathbb{Z}\_{4}$ we find $\bar{2}^{4}-\bar{2}=\bar{2}$ showing that $4\nmid\left(4m+2\right)^{4}-\left(4m+2\right)$ for each integer $m$.
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
You can check that $2^4-2$ is not divisible by $4$. Next, note that if $n^4-n$ is not divisible by $4$, then $$ (n+4)^4-(n+4)=(4A - 4) + n^4-n $$ is also not divisible by $4$. ($A$ is an integer that can be found by the Binomial Theorem.)
$n^4 - n$ is divisible by $4$ for $n \equiv 0$ or $n \equiv 1 \bmod 4$. $n^4 - n$ leaves remainder $2$ when divided by $4$ for $n \equiv 2$ or $n \equiv 3 \bmod 4$.
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
$$n^4-n=n(n^3-1)=n(n-1)(n^2+n+1)$$ Now, $n^2+n+1=2\cdot\dfrac{n(n+1)}2+1$ is odd So, $4|(n^4-n)\iff4|n(n-1)$
Working in $\mathbb{Z}\_{4}$ we find $\bar{2}^{4}-\bar{2}=\bar{2}$ showing that $4\nmid\left(4m+2\right)^{4}-\left(4m+2\right)$ for each integer $m$.
975,157
I need a little bit of help with this question: Show that there are an infinite number of positive integers n such that $n^4 - n$ is not divisible by 4. Obviously, this is true for all $n$ except for *multiples of* 4. I assume that I'm supposed the problem either by contradiction or induction - If I perform induct...
2014/10/15
[ "https://math.stackexchange.com/questions/975157", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105806/" ]
$$n^4-n=n(n^3-1)=n(n-1)(n^2+n+1)$$ Now, $n^2+n+1=2\cdot\dfrac{n(n+1)}2+1$ is odd So, $4|(n^4-n)\iff4|n(n-1)$
$n^4 - n$ is divisible by $4$ for $n \equiv 0$ or $n \equiv 1 \bmod 4$. $n^4 - n$ leaves remainder $2$ when divided by $4$ for $n \equiv 2$ or $n \equiv 3 \bmod 4$.
52,216,633
How to know which events slow down `setTimeout()`? In my code I have a keyframe animation of 2 seconds. I add a class to animate a div ``` $('#first').addClass('first-start'); ``` and using `setTimeout` I add a class to stop the animation only after 1 second. ``` setTimeout(function() { $('#first').addClass('...
2018/09/07
[ "https://Stackoverflow.com/questions/52216633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3162975/" ]
JavaScript timers are very inaccurate and there is nothing you can do about it. The timers only fire up if both of the following are met: * The Execution Stack of the currently active queued event is empty * The timer has elapsed The key insight to grasping why is it so is understanding that JavaScript is single-thre...
inside the setTimeout use the removeClass function to remove the 'first-start' class that you added. ``` setTimeout(function() { $('#first').removeClass('first-pause'); ``` }, 1000);
3,798,269
I'm writing something to 'clean' a URL. In this case all I'm trying to do is return a faked scheme as `urlopen` won't work without one. However, if I test this with `www.python.org` It'll return `http:///www.python.org`. Does anyone know why the extra /, and is there a way to return this without it? ``` def FixScheme(...
2010/09/26
[ "https://Stackoverflow.com/questions/3798269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/458741/" ]
Problem is that in parsing the *very* incomplete URL `www.python.org`, the string you give is actually taken as the `path` component of the URL, with the `netloc` (network location) one being empty as well as the scheme. For defaulting the scheme you can actually pass a second parameter `scheme` to `urlparse` (simplify...
It's because urlparse is interpreting "www.python.org" not as the hostname (netloc), but as the path, just as a browser would if it encountered that string in an href attribute. Then urlunparse seems to interpret scheme "http" specially. If you put in "x" as the scheme, you'll get "x:www.python.org". I don't know what...
19,162,290
I want to get the list of properties for an object of a specific type, I have made this static method to do the job. ex: class A have 3 bool properties, calling GetPropertiesList< bool>(aInstance); will return a list with all the bool returning properties. Is that ok or am I reinventing the wheel here? ``` publ...
2013/10/03
[ "https://Stackoverflow.com/questions/19162290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/767664/" ]
This won't work if `PropertyType` is a subclass of `T`. For example, if you have this class: ``` class SomeImages{ public Bitmap Img1{get;set;} public Image Img2{get;set;} } ``` Then `GetProperties<Image>(instanceOfSomeImages)` will only return Img2. Similarly, `GetProperties<Bitmap>(instanceOfSomeImages)` w...
You can use LINQ to shorten your query, eg: ``` obj.GetType() .GetProperties(BindingFlags.Public | BindingFlags.Instance) .Where(p=>typeof(T).IsAssignableFrom(p.PropertyType)) .Select(p=>(T)p.GetValue(obj,null)) .ToList(); ``` **UPDATE** You can also check the [Type.FindMembers](http://msdn.microsoft.co...
18,541
I'd like to buy new resistors for breadboarding with my Arduino Uno. There are 0.25W, 0.4W, 0.6W, 1W, 2W, 3W, 5W, 10W resistors in the shop. What is the most suitable for this operation?
2015/12/08
[ "https://arduino.stackexchange.com/questions/18541", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/15454/" ]
The answer is: It depends what you want to use them for. You need a wattage that is higher than the power it will dissipate. What that power is depends on what you are doing with them. There are standard formulae that tell you the power in any given situation. For instance, if you know the current and the resistance ...
The smaller the better for the most part. On 1/4 or 1/8 W resistors the leads size is small enough to work well in bread boards. Rarely do you need to dissipate large amounts of power so 1/8 is a good size for logic, maybe 1/4-1/2 for power supply areas. See Majenko's answer for the heavy math, mostly applicable in pow...
18,541
I'd like to buy new resistors for breadboarding with my Arduino Uno. There are 0.25W, 0.4W, 0.6W, 1W, 2W, 3W, 5W, 10W resistors in the shop. What is the most suitable for this operation?
2015/12/08
[ "https://arduino.stackexchange.com/questions/18541", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/15454/" ]
Go with 1/4 Watt resistors but be prepared to use 1/2 Watts if the leads don't press down cleanly into the breadboard which is what I think you are asking about. If you need anything in the higher wattage range and you are working with an Arduino, then you are doing it wrong. An Arduino could not smoke a 1/4 watt if it...
The smaller the better for the most part. On 1/4 or 1/8 W resistors the leads size is small enough to work well in bread boards. Rarely do you need to dissipate large amounts of power so 1/8 is a good size for logic, maybe 1/4-1/2 for power supply areas. See Majenko's answer for the heavy math, mostly applicable in pow...
18,541
I'd like to buy new resistors for breadboarding with my Arduino Uno. There are 0.25W, 0.4W, 0.6W, 1W, 2W, 3W, 5W, 10W resistors in the shop. What is the most suitable for this operation?
2015/12/08
[ "https://arduino.stackexchange.com/questions/18541", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/15454/" ]
The answer is: It depends what you want to use them for. You need a wattage that is higher than the power it will dissipate. What that power is depends on what you are doing with them. There are standard formulae that tell you the power in any given situation. For instance, if you know the current and the resistance ...
Go with 1/4 Watt resistors but be prepared to use 1/2 Watts if the leads don't press down cleanly into the breadboard which is what I think you are asking about. If you need anything in the higher wattage range and you are working with an Arduino, then you are doing it wrong. An Arduino could not smoke a 1/4 watt if it...
53,910,099
I have a tableView in which 5 types of cells and my problem is I have to perform the swipe gesture functionality on a specific one cell.
2018/12/24
[ "https://Stackoverflow.com/questions/53910099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6638593/" ]
You can use canEditRowAt function to specify editable row. ``` func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { if (indexPath.row == 0){ return true } else { return false } } ```
There is a UITableViewDelegate Method **canRowEditAt** where you can specify whether the row is editable or not on the basic of indexPath. ``` func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { if (indexPath.row == YOUR-EDITABLE-ROW-INDEXPATH){ return true } else { //...
1,213,399
After working in Java for a long time, I started to get interested in Scala. As a learning project, I am trying to duplicate a java library that stores and retrieves state objects from the database. For this, I would like to be able to just specify a state object like this: ``` @PersistName("PERSON") case class Pers...
2009/07/31
[ "https://Stackoverflow.com/questions/1213399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Scala's Enumeration is interesting, but case classes frequently have an edge over it: ``` sealed class Gender case object Male extends Gender case object Female extends Gender ``` This have the advantage of being `match`able, and Scala will even complain if you test for one gender but not the other. And, it seems to...
You can use Gender.Male.id to get an Int presentation of male gender value. Use Gender.apply() to get it back: ``` val person = Person() println("gender = " + person.gender.id) // prints "gender = 0" on my mac person.gender = Gender(Gender.Female.id) // have a little operation println("gender = " + person.gender.id)...
1,213,399
After working in Java for a long time, I started to get interested in Scala. As a learning project, I am trying to duplicate a java library that stores and retrieves state objects from the database. For this, I would like to be able to just specify a state object like this: ``` @PersistName("PERSON") case class Pers...
2009/07/31
[ "https://Stackoverflow.com/questions/1213399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Scala's Enumeration is interesting, but case classes frequently have an edge over it: ``` sealed class Gender case object Male extends Gender case object Female extends Gender ``` This have the advantage of being `match`able, and Scala will even complain if you test for one gender but not the other. And, it seems to...
I have run into the same problem and found a rather bulky solution but it works. You need to persist the name of the enclosing Enumeration since there is no way to find out the real Enumeration from a Value using reflection. ``` object WeekDay extends Enumeration { type WeekDay = Value val Mon, Tue, Wed, Thu, Fri,...
1,213,399
After working in Java for a long time, I started to get interested in Scala. As a learning project, I am trying to duplicate a java library that stores and retrieves state objects from the database. For this, I would like to be able to just specify a state object like this: ``` @PersistName("PERSON") case class Pers...
2009/07/31
[ "https://Stackoverflow.com/questions/1213399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Scala's Enumeration is interesting, but case classes frequently have an edge over it: ``` sealed class Gender case object Male extends Gender case object Female extends Gender ``` This have the advantage of being `match`able, and Scala will even complain if you test for one gender but not the other. And, it seems to...
Check out my [EnumReflector](https://github.com/stuz5000/Soriento/blob/develop/src/main/scala/com/emotioncity/soriento/EnumReflector.scala): You need to supply it the scala type of the field. ``` val enumObject:Type = ... object's scala.Enumeration field val typ:Type = ... object's scala.Enumeration field's scala typ...
43,711
The Wikipedia article on the [History of Writing](https://en.wikipedia.org/wiki/History_of_writing) contains the following quote: > > the earliest solid evidence of Egyptian writing **differs in structure** > and style from the Mesopotamian and must therefore have developed > independently... > > > It's clear tha...
2022/01/07
[ "https://linguistics.stackexchange.com/questions/43711", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/36204/" ]
The biggest difference, as you mention, is that the oldest forms of hieroglyphic writing don't indicate vowels at all and the oldest forms of cuneiform writing do. (By "oldest forms" here I mean the earliest forms that could indicate arbitrary words.) In hieroglyphs, the "mouth" glyph used phonetically could be used to...
I don't think much is known about the early stages of Egyptian writing. We get either a few objects with Hieroglyphic labels in the first few centuries or full blown passages in the pyramid texts a few centuries later on. There is nothing in between to show how the script arose and how it developed into mature writing....
1,199,196
The following is the truth table for an implication: $(T\Rightarrow T) = T$ $(T\Rightarrow F) = F$ $(F\Rightarrow T) = T$ $(F\Rightarrow F) = T$ Now, in an implication involved in a proof by contradiction I want to know which of the above row applies. Example: The square root of a prime number is irrational. [$s...
2015/03/21
[ "https://math.stackexchange.com/questions/1199196", "https://math.stackexchange.com", "https://math.stackexchange.com/users/48949/" ]
I think you are misunderstanding how a proof by contradiction really works. First consider a simple example (the propositional calculus explanation will follow): **Proposition:** Suppose $n$ is an odd integer. Then $n^2$ is an odd integer. *Proof.* Suppose that $n$ is an odd integer but the conclusion is false; that ...
I don't really know what you are trying to say, but here is how to understand proof by contradiction. In classical logic, we know that for any boolean statement $P$ we have only two possible cases, namely either $P$ or $\neg P$. If we want to prove $P$, we just have to prove that $\neg P$ cannot happen. If under the a...
1,199,196
The following is the truth table for an implication: $(T\Rightarrow T) = T$ $(T\Rightarrow F) = F$ $(F\Rightarrow T) = T$ $(F\Rightarrow F) = T$ Now, in an implication involved in a proof by contradiction I want to know which of the above row applies. Example: The square root of a prime number is irrational. [$s...
2015/03/21
[ "https://math.stackexchange.com/questions/1199196", "https://math.stackexchange.com", "https://math.stackexchange.com/users/48949/" ]
I think you are misunderstanding how a proof by contradiction really works. First consider a simple example (the propositional calculus explanation will follow): **Proposition:** Suppose $n$ is an odd integer. Then $n^2$ is an odd integer. *Proof.* Suppose that $n$ is an odd integer but the conclusion is false; that ...
Your implication $(T \Rightarrow T) = T$ would be the correct one because the proof by contradiction, for your specific case, would be $( \lnot s1 \vdash s4 \land \lnot s4 ) \to ( \vdash s1)$; both the left and right side of the implication are true. The implication inside the proof is $(F \to F) = T$ because, for you...
10,245,984
I'm new to WPF and MVVM and am struggling a lot with how to design my app (hence lots of questions on here) and am about to do a refactor. I've got a SQL backend and am using LINQtoSQL so the classes that LINQTOSQL generates will be my model. I have yet to see a good comprehensive example of how to keep the model class...
2012/04/20
[ "https://Stackoverflow.com/questions/10245984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/660948/" ]
The goal of MVVM is to make your application more maintainable, and save you from having to spend lots of time debugging tightly-coupled spaghetti code. If a pure implementation of the MVVM pattern achieves this for you, then it is worth your while to apply it fully. On the other hand, if you spend a whole lot of time ...
You neeed to employ commanding instead of directly accessing from view from viewmodel or vice versa. Refer to [WPF Apps With The Model-View-ViewModel Design Pattern](http://msdn.microsoft.com/en-us/magazine/dd419663.aspx)
10,245,984
I'm new to WPF and MVVM and am struggling a lot with how to design my app (hence lots of questions on here) and am about to do a refactor. I've got a SQL backend and am using LINQtoSQL so the classes that LINQTOSQL generates will be my model. I have yet to see a good comprehensive example of how to keep the model class...
2012/04/20
[ "https://Stackoverflow.com/questions/10245984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/660948/" ]
It seems like your `MessageType` is really an immutable value type, so I don't think the view-model is necessary. Assuming you are working with a view that is bound to something like a `MissionViewModel` and there is a dropdown you want to populate with `MessageType` options bound to the property for which you've show...
You neeed to employ commanding instead of directly accessing from view from viewmodel or vice versa. Refer to [WPF Apps With The Model-View-ViewModel Design Pattern](http://msdn.microsoft.com/en-us/magazine/dd419663.aspx)
10,245,984
I'm new to WPF and MVVM and am struggling a lot with how to design my app (hence lots of questions on here) and am about to do a refactor. I've got a SQL backend and am using LINQtoSQL so the classes that LINQTOSQL generates will be my model. I have yet to see a good comprehensive example of how to keep the model class...
2012/04/20
[ "https://Stackoverflow.com/questions/10245984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/660948/" ]
The goal of MVVM is to make your application more maintainable, and save you from having to spend lots of time debugging tightly-coupled spaghetti code. If a pure implementation of the MVVM pattern achieves this for you, then it is worth your while to apply it fully. On the other hand, if you spend a whole lot of time ...
It seems like your `MessageType` is really an immutable value type, so I don't think the view-model is necessary. Assuming you are working with a view that is bound to something like a `MissionViewModel` and there is a dropdown you want to populate with `MessageType` options bound to the property for which you've show...
15,335,277
I'm plotting a multiplot in GNUPLOT and in order to save space, I only plot the axis labels on one of the plots. For the other plots, I overwrite the tics-labels using ``` set ytics ("" -20, "" -15, "" -10, "" -5, "" 0, "" 5, "" 10, "" 15, "" 20) ``` For a small scale like this, its doable manually. Can I use a gnup...
2013/03/11
[ "https://Stackoverflow.com/questions/15335277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289801/" ]
Yes, you can, with something like ``` numtics = 8 set macros ticstring = '(' do for [i=0:numtics] { ticstring = ticstring.'"" '.(-20 + i*5).', ' } ticstring = ticstring.'"" 20)' set ytics @ticstring ``` What may be simpler in your case would be the command ``` set ytics format "" 5 ``` Which will put a t...
I think that it is **MUCH** easier to just do something like: ``` set multiplot layout 1,2 set xtics format "" #no x-tic labels on the top plot plot sin(x) #top plot set xtics format "%g" #x-tic labels on the bottom plot plot cos(x) #bottom plot unset multiplot ```
58,102,658
I have a helper method that is dependent upon `controller_name`, and I want to write tests for it. ``` module NavigationHelper def show_navigation? !sessions_controller? && !registrations_controller? end private def sessions_controller? controller_name.eql?('sessions') end def registratio...
2019/09/25
[ "https://Stackoverflow.com/questions/58102658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2675670/" ]
the answer from Richard did not work for me. I had to change from ``` let(:controller_name) { 'sessions' } ``` to ``` before do allow(helper).to receive(:controller_name).and_return 'sessions' end ``` Now I can verify as usual in my helpers.
Here's a working solution: ``` require 'rails_helper' RSpec.describe NavigationHelper, type: :helper do describe '#show_navigation?' do context 'SessionsController' do let(:controller_name) { 'sessions' } it { expect(show_navigation?).to eq(false) } end context 'RegistrationsController' do ...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
At the risk of giving a product recommendation you may want to look at an RF power splitter/combiner IC from someone like mini-circuits. [Mini-circuits splitters](http://194.75.38.69/products/Splitters.shtml) These will allow you to combine the 3 outputs (and split the returning signal) on the PCB without the impedanc...
This is a horiblle bodge (whether implemented in coax or on the PCB). Firstly the direct interconnections will create horiblle impedance mismatches which will reduce signal integrity. Some high power RF transmitters can even be damaged by signal reflections. Secondly whenever any module transmits a substational fract...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
I think a more reasonable way would be to use an [external three way splitter](http://www.instockwireless.com/power_divider_3way.htm) and the old design to connect your three GSM modules to one antenna. You don't seem to have the knowledge to do RF PCB designs (not knocking you, I don't either) so it would be safer f...
At the risk of giving a product recommendation you may want to look at an RF power splitter/combiner IC from someone like mini-circuits. [Mini-circuits splitters](http://194.75.38.69/products/Splitters.shtml) These will allow you to combine the 3 outputs (and split the returning signal) on the PCB without the impedanc...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
Apart from EMI issues, I have a hard time believing that this will work at all. Is there a reference design available for something similar? From what I would guess (I'm not an antenna specialist at all): * Multiple drivers for one antenna * No matching network (at least none which could be used if required) * Your an...
At the risk of giving a product recommendation you may want to look at an RF power splitter/combiner IC from someone like mini-circuits. [Mini-circuits splitters](http://194.75.38.69/products/Splitters.shtml) These will allow you to combine the 3 outputs (and split the returning signal) on the PCB without the impedanc...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
First of: all of the combiners from the other answers can only work on a single band. You can't use the same combiner for GSM900 as for GSM1900. That is physically impossible. The fact that GSM devices can use the same antenna for transmit and receive at all is due to the fact that up- age downlink in GSM are on diffe...
How do you intend to use it? Do you want to use three SIM800 modules at the same time with one antenna? This will not work. First of all, due to impedance split. Secondly, the modules output will affect each other which will disrupt the communication. Just add two additional connections for the antennas. Remember that ...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
I think a more reasonable way would be to use an [external three way splitter](http://www.instockwireless.com/power_divider_3way.htm) and the old design to connect your three GSM modules to one antenna. You don't seem to have the knowledge to do RF PCB designs (not knocking you, I don't either) so it would be safer f...
How do you intend to use it? Do you want to use three SIM800 modules at the same time with one antenna? This will not work. First of all, due to impedance split. Secondly, the modules output will affect each other which will disrupt the communication. Just add two additional connections for the antennas. Remember that ...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
I think a more reasonable way would be to use an [external three way splitter](http://www.instockwireless.com/power_divider_3way.htm) and the old design to connect your three GSM modules to one antenna. You don't seem to have the knowledge to do RF PCB designs (not knocking you, I don't either) so it would be safer f...
First of: all of the combiners from the other answers can only work on a single band. You can't use the same combiner for GSM900 as for GSM1900. That is physically impossible. The fact that GSM devices can use the same antenna for transmit and receive at all is due to the fact that up- age downlink in GSM are on diffe...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
At the risk of giving a product recommendation you may want to look at an RF power splitter/combiner IC from someone like mini-circuits. [Mini-circuits splitters](http://194.75.38.69/products/Splitters.shtml) These will allow you to combine the 3 outputs (and split the returning signal) on the PCB without the impedanc...
A has been mentioned before, this is an 'interesting' way to combine the signals. Certainly it is not good, but really I think you're asking if its any worse than your old bodged solution of paralelling the coax. With the coax, you have a more symetrical circuit (each RF path looks similar, and has the same parasitic ...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
At the risk of giving a product recommendation you may want to look at an RF power splitter/combiner IC from someone like mini-circuits. [Mini-circuits splitters](http://194.75.38.69/products/Splitters.shtml) These will allow you to combine the 3 outputs (and split the returning signal) on the PCB without the impedanc...
First of: all of the combiners from the other answers can only work on a single band. You can't use the same combiner for GSM900 as for GSM1900. That is physically impossible. The fact that GSM devices can use the same antenna for transmit and receive at all is due to the fact that up- age downlink in GSM are on diffe...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
I think a more reasonable way would be to use an [external three way splitter](http://www.instockwireless.com/power_divider_3way.htm) and the old design to connect your three GSM modules to one antenna. You don't seem to have the knowledge to do RF PCB designs (not knocking you, I don't either) so it would be safer f...
A has been mentioned before, this is an 'interesting' way to combine the signals. Certainly it is not good, but really I think you're asking if its any worse than your old bodged solution of paralelling the coax. With the coax, you have a more symetrical circuit (each RF path looks similar, and has the same parasitic ...
263,449
I am designing a PCB in which there are 3 SIM800 GSM modules sharing a (commercial) external antenna. The external antenna is connected to the PCB via an antenna connector, and from that connector, the antenna signal is “shared” via PCB traces running to the GSM\_ANT port of the GSM modules (please see photo) The reas...
2016/10/14
[ "https://electronics.stackexchange.com/questions/263449", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/58335/" ]
A has been mentioned before, this is an 'interesting' way to combine the signals. Certainly it is not good, but really I think you're asking if its any worse than your old bodged solution of paralelling the coax. With the coax, you have a more symetrical circuit (each RF path looks similar, and has the same parasitic ...
How do you intend to use it? Do you want to use three SIM800 modules at the same time with one antenna? This will not work. First of all, due to impedance split. Secondly, the modules output will affect each other which will disrupt the communication. Just add two additional connections for the antennas. Remember that ...
836,545
This is the error message I get when trying to logout or shutdown from the menu in Xubuntu 16.04 on my Dell laptop. Interestingly when I choose "Log Out..." from the actions menu the first time nothing happens, but if I try it again then do I get the `Session manager must be in idle state when requesting a shutdown` e...
2016/10/13
[ "https://askubuntu.com/questions/836545", "https://askubuntu.com", "https://askubuntu.com/users/6419/" ]
The same thing happend with me today, it was the first time: I've decided to go to the terminal mode by ctrl+alt+f1 and then find out the process id of session manager, by 'pidof xfce-session' then close it with 'kill -9 ID'. Then it started working fine.
Upgrading from 16.04 to 16.10 fixed the issue.
25,318,287
I am trying to write an Android application using Dagger. Trying to follow the TDD approach, I started writing a test for my First activity. For writing tests I am using Robolectric and I am trying to make it work in different scenarios using Mockito. Short story: I have an android activity which I want to test using...
2014/08/14
[ "https://Stackoverflow.com/questions/25318287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2612313/" ]
Here's what you can do. Create two different `modules` in the test class. One which provides Internet Connection as true and another as Internet Connection as False. Once you have the two different module's setup inject them in the individual test class rather than the `setUp` of the Test Class. So: ``` @Module( i...
Seems like you're looking for module override (like Roboguice does). I couldn't find any, but in my tests, I've been using something like this: ``` MyObjectTest.java @Test public void testMyObject() { ObjectGraph objectGraph = ObjectGraph.create(new TestModule()); MyObject object = objectGraph.get(MyObject.cl...
25,318,287
I am trying to write an Android application using Dagger. Trying to follow the TDD approach, I started writing a test for my First activity. For writing tests I am using Robolectric and I am trying to make it work in different scenarios using Mockito. Short story: I have an android activity which I want to test using...
2014/08/14
[ "https://Stackoverflow.com/questions/25318287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2612313/" ]
Ok, first off, [user2511882](https://stackoverflow.com/users/2511882/user2511882) I have tried your solution before posting the question but the thing is, if you look at the structure of TestMyApplication, where I inject the test module, you would see that your suggestion and my previous tries could not work. After re...
Seems like you're looking for module override (like Roboguice does). I couldn't find any, but in my tests, I've been using something like this: ``` MyObjectTest.java @Test public void testMyObject() { ObjectGraph objectGraph = ObjectGraph.create(new TestModule()); MyObject object = objectGraph.get(MyObject.cl...