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
65,948,015
I have a variable where the user inputs one number. That variable is of type `int` because that's the return value of `fgetc(stdin)` and `getchar()`. In this case, I'm using `fgetc(stdin)`. After the user inputs the number, I would like to convert it to an integer with `strtol()`, however, I get a warning about an inco...
2021/01/29
[ "https://Stackoverflow.com/questions/65948015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13716610/" ]
`strtol` is used to convert a "string" into `long`, not a single char. You just need `choice = option - '0'` to get the value. But you don't actually need to convert because you can directly switch on the char value ``` switch (option) { case '1': // ... break; case '2': // ... ...
since the variable 'option' is already an integer, there is no reason to call 'strtol' anymore. or you can used gets to get a buffer from stdin, then transform the buffer into integer by strtol.
25,900,333
I've already set the maxLength attribute for an EditText widget in the xml layout file, and it does limit the display of characters. But it still allows the user to press more letters on the keyboard, and backspacing deletes these extra presses rather than the last letter on the display. I believe this is not how it'...
2014/09/17
[ "https://Stackoverflow.com/questions/25900333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3893122/" ]
1. Disable auto-suggestions(`android:inputType="textFilter"` or `textNoSuggestions`): 2. Set maxLength ``` <EditText android:id="@+id/editText" android:inputType="textFilter" android:maxLength="8" android:layout_width="match_parent" android:layout_height="wrap_content" /> ``` I hope, it helps
**Unfortunately the following answer does not work. However, it helped us to find out that the bug mentioned by Poly Bug is not reproducible if the input begins with a number.** --- You can use a `TextWatcher` to listen for `EditText` changes and prevent the user from typing too many characters into the field. The fo...
25,900,333
I've already set the maxLength attribute for an EditText widget in the xml layout file, and it does limit the display of characters. But it still allows the user to press more letters on the keyboard, and backspacing deletes these extra presses rather than the last letter on the display. I believe this is not how it'...
2014/09/17
[ "https://Stackoverflow.com/questions/25900333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3893122/" ]
**Unfortunately the following answer does not work. However, it helped us to find out that the bug mentioned by Poly Bug is not reproducible if the input begins with a number.** --- You can use a `TextWatcher` to listen for `EditText` changes and prevent the user from typing too many characters into the field. The fo...
You can use **[InputFilter](http://developer.android.com/intl/es/reference/android/text/InputFilter.html)** > > InputFilters can be attached to Editables to constrain the changes > that can be made to them. > > > **Xml** ``` <EditText android:id="@+id/edit_Text" android:layout_width="match_parent" ...
25,900,333
I've already set the maxLength attribute for an EditText widget in the xml layout file, and it does limit the display of characters. But it still allows the user to press more letters on the keyboard, and backspacing deletes these extra presses rather than the last letter on the display. I believe this is not how it'...
2014/09/17
[ "https://Stackoverflow.com/questions/25900333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3893122/" ]
**Unfortunately the following answer does not work. However, it helped us to find out that the bug mentioned by Poly Bug is not reproducible if the input begins with a number.** --- You can use a `TextWatcher` to listen for `EditText` changes and prevent the user from typing too many characters into the field. The fo...
I also bumped into this situation when had a series of fields containing 1 symbol (a usual pin-code). My solution is based on @jmeinke answer. Create a layout containing several `EditText`s with `android:maxLength="2"` (we will enter 1 symbol in any of them and jump to another `EditText`. Strange, but on some phones ...
25,900,333
I've already set the maxLength attribute for an EditText widget in the xml layout file, and it does limit the display of characters. But it still allows the user to press more letters on the keyboard, and backspacing deletes these extra presses rather than the last letter on the display. I believe this is not how it'...
2014/09/17
[ "https://Stackoverflow.com/questions/25900333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3893122/" ]
1. Disable auto-suggestions(`android:inputType="textFilter"` or `textNoSuggestions`): 2. Set maxLength ``` <EditText android:id="@+id/editText" android:inputType="textFilter" android:maxLength="8" android:layout_width="match_parent" android:layout_height="wrap_content" /> ``` I hope, it helps
You can use **[InputFilter](http://developer.android.com/intl/es/reference/android/text/InputFilter.html)** > > InputFilters can be attached to Editables to constrain the changes > that can be made to them. > > > **Xml** ``` <EditText android:id="@+id/edit_Text" android:layout_width="match_parent" ...
25,900,333
I've already set the maxLength attribute for an EditText widget in the xml layout file, and it does limit the display of characters. But it still allows the user to press more letters on the keyboard, and backspacing deletes these extra presses rather than the last letter on the display. I believe this is not how it'...
2014/09/17
[ "https://Stackoverflow.com/questions/25900333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3893122/" ]
1. Disable auto-suggestions(`android:inputType="textFilter"` or `textNoSuggestions`): 2. Set maxLength ``` <EditText android:id="@+id/editText" android:inputType="textFilter" android:maxLength="8" android:layout_width="match_parent" android:layout_height="wrap_content" /> ``` I hope, it helps
I also bumped into this situation when had a series of fields containing 1 symbol (a usual pin-code). My solution is based on @jmeinke answer. Create a layout containing several `EditText`s with `android:maxLength="2"` (we will enter 1 symbol in any of them and jump to another `EditText`. Strange, but on some phones ...
25,900,333
I've already set the maxLength attribute for an EditText widget in the xml layout file, and it does limit the display of characters. But it still allows the user to press more letters on the keyboard, and backspacing deletes these extra presses rather than the last letter on the display. I believe this is not how it'...
2014/09/17
[ "https://Stackoverflow.com/questions/25900333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3893122/" ]
You can use **[InputFilter](http://developer.android.com/intl/es/reference/android/text/InputFilter.html)** > > InputFilters can be attached to Editables to constrain the changes > that can be made to them. > > > **Xml** ``` <EditText android:id="@+id/edit_Text" android:layout_width="match_parent" ...
I also bumped into this situation when had a series of fields containing 1 symbol (a usual pin-code). My solution is based on @jmeinke answer. Create a layout containing several `EditText`s with `android:maxLength="2"` (we will enter 1 symbol in any of them and jump to another `EditText`. Strange, but on some phones ...
93,442
Is there any way to index the following query? ``` SELECT run_id, MAX ( frame ) , MAX ( time ) FROM run.frames_stat GROUP BY run_id; ``` I've tried creating sorted (non-composite) indexes on `frame` and `time`, and an index on `run_id`, but the query planner doesn't use them. Misc info: * Unfortunately (and for re...
2015/02/20
[ "https://dba.stackexchange.com/questions/93442", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/59983/" ]
### Too bad If you cannot change the query at all, that's **too bad**. You won't get a good solution. If you had not table-qualified the table (**`run.`**`frames_stat`), you could create a materialized view (see below) with the same name in another schema (or just a temporary one) and adapt the [`search_path`](https:/...
You could try creating an `INSTEAD OF SELECT` rule on the table .. although this might break the application (depending on what all actually uses the table in question) ``` CREATE RULE "RETURN_MODIFIED_SELECT" AS ON SELECT TO run.frames_stat DO INSTEAD <MY QUERY FROM BELOW>; ``` I have not used `RULE...
5,069,239
``` setcookie("cookie1", "", 0, "/",".domain.com"); setcookie("cookie2", "", 0, "/",".domain.com"); header('Location: /index.php'); ``` It doesn't delete cookie1 and cookie2. Why is that?
2011/02/21
[ "https://Stackoverflow.com/questions/5069239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/237681/" ]
An expiration time of 0 is a special value which means the cookie will be deleted when the browser is closed. To delete it immediately, you need to give a valid expiration time in the past. An example from the [PHP docs](http://php.net/manual/en/function.setcookie.php): ``` // set the expiration date to one hour ago s...
My best guess would be that the browser simply hasn't done it yet. Cookie management is the responsibility of the browser, and depending on the browser settings it may not delete your cookie immediately.
40,881,166
I am working in child theme and put following code for admin ajax js ``` function wpb_adding_scripts() { /* echo "string". get_stylesheet_directory_uri().'/css/jquery.bxslider.css'; exit();*/ wp_register_script('flexslider', get_stylesheet_directory_uri() . '/js/jquery.flexisel.js', array('jquery'),'1.1', tru...
2016/11/30
[ "https://Stackoverflow.com/questions/40881166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7034664/" ]
Try this: ``` wp_enqueue_script('custom'); //Name of the script. Should be unique.here is 'custom' wp_localize_script('custom', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ))); // remove admin_script and add unique javascript file. ``` Here above code localized the object:'myAjax' in script "custom". ...
Instead of `admin_script` use `ajax-script` like this ``` wp_localize_script( 'ajax-script', 'myAjax',array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); ``` Otherwise you can add `wp_enqueue_script('ajax-script');` before you have define your ajax script localize function.
144,036
I have an [IKEA desk](https://www.ikea.com/us/en/catalog/products/S49932175/#/S59133593) with a subtle fake wood grain paint layer (black) on the surface. The paint in the area that my mouse moves has worn away leaving a shiny textureless surface that the laser mouse doesn't detect. What's the simplest, cheapest, mos...
2018/07/27
[ "https://diy.stackexchange.com/questions/144036", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/89230/" ]
Shelf liner (contact paper). Cut it into an oversize mouse pad shape with rounded corners and stick it down. You want it large enough that you aren't snagging the edge with your arm, keyboard, etc. It'll feel like nothing but give your mouse a better view. You could use black so it's not so conspicuous, but a bold co...
You need a surface with a pattern or texture on it. In my experience any 1/4" span of distance needs to have at least 2-3 transitions on it. If all the sensor sees is a solid color, it can't realize you have moved it. The wood grain was doing that for you. As you have discovered, routine use of a computer mouse will ...
144,036
I have an [IKEA desk](https://www.ikea.com/us/en/catalog/products/S49932175/#/S59133593) with a subtle fake wood grain paint layer (black) on the surface. The paint in the area that my mouse moves has worn away leaving a shiny textureless surface that the laser mouse doesn't detect. What's the simplest, cheapest, mos...
2018/07/27
[ "https://diy.stackexchange.com/questions/144036", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/89230/" ]
Shelf liner (contact paper). Cut it into an oversize mouse pad shape with rounded corners and stick it down. You want it large enough that you aren't snagging the edge with your arm, keyboard, etc. It'll feel like nothing but give your mouse a better view. You could use black so it's not so conspicuous, but a bold co...
Rub the area with 000 or 0000 steel wool to bring back some subtle texture. It won't be possibly lumpy or uneven like paint, and you can easily texture the affected area only. This is a far cheaper solution in terms of money and time than paint.
144,036
I have an [IKEA desk](https://www.ikea.com/us/en/catalog/products/S49932175/#/S59133593) with a subtle fake wood grain paint layer (black) on the surface. The paint in the area that my mouse moves has worn away leaving a shiny textureless surface that the laser mouse doesn't detect. What's the simplest, cheapest, mos...
2018/07/27
[ "https://diy.stackexchange.com/questions/144036", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/89230/" ]
Shelf liner (contact paper). Cut it into an oversize mouse pad shape with rounded corners and stick it down. You want it large enough that you aren't snagging the edge with your arm, keyboard, etc. It'll feel like nothing but give your mouse a better view. You could use black so it's not so conspicuous, but a bold co...
Use fabric. The threads are detectable by the mouse. You can cover the whole top with something like a table cloth, or use a smaller piece in the work area. You say you don't like mouse pads but you're considering something like wallpaper, so I assume the mouse pad thickness is it's main problem, and maybe the issue of...
24,992,036
I have a simple factory that returns a promise after a async.-request. ``` getUpdates: function(){ var q = $q.defer(); $http.get(...) .success(function(data, status, headers, config) { q.resolve(data); }) .error(function(data, status, headers, config) { q.reject(status); }); ...
2014/07/28
[ "https://Stackoverflow.com/questions/24992036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2329592/" ]
The `$http` service already return a promise, there is no need to use `$q.defer()` to create an another promise in this case. You could just write it like this: ``` getUpdates: function () { return $http.get(...); } ``` This way the `success()` and `error()` methods will still be available. Or if you really have ...
You `then` function to handle the success and failure of the promise: ``` factory.getUpdates() .then(function(value) { // handle success }, function(reason) { // handle failure }); ```
24,992,036
I have a simple factory that returns a promise after a async.-request. ``` getUpdates: function(){ var q = $q.defer(); $http.get(...) .success(function(data, status, headers, config) { q.resolve(data); }) .error(function(data, status, headers, config) { q.reject(status); }); ...
2014/07/28
[ "https://Stackoverflow.com/questions/24992036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2329592/" ]
The `$http` service already return a promise, there is no need to use `$q.defer()` to create an another promise in this case. You could just write it like this: ``` getUpdates: function () { return $http.get(...); } ``` This way the `success()` and `error()` methods will still be available. Or if you really have ...
``` factory.getUpdates().then( //onSucess function(response) { // ... }, //onError function() { // ... } ); ```
24,992,036
I have a simple factory that returns a promise after a async.-request. ``` getUpdates: function(){ var q = $q.defer(); $http.get(...) .success(function(data, status, headers, config) { q.resolve(data); }) .error(function(data, status, headers, config) { q.reject(status); }); ...
2014/07/28
[ "https://Stackoverflow.com/questions/24992036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2329592/" ]
You `then` function to handle the success and failure of the promise: ``` factory.getUpdates() .then(function(value) { // handle success }, function(reason) { // handle failure }); ```
``` factory.getUpdates().then( //onSucess function(response) { // ... }, //onError function() { // ... } ); ```
50,897,066
I'm developing an Electron application and I aim to 'split up' `index.js` (main process) file. Currently I have put my menu bar-related and Touch Bar-related code into two separate files, `menu.js` and `touchBar.js`. Both of these files rely on a function named `redir`, which is in `index.js`. Whenever I attempt to act...
2018/06/17
[ "https://Stackoverflow.com/questions/50897066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3991859/" ]
`redir` it is not a function, because you're exporting an object, containing a `redir` property, which is a function. So you should either use: ``` const { redir } = require('./index.js'); ``` Or export it this way ``` module.exports = redir ``` When you do: `module.exports.redir = redir;` You're exporting: `{ ...
You are exporting ``` module.exports.redir = redir; ``` That means that your import ``` const redir = require('./index'); ``` is the exported object. `redir` happens to be one of its keys. To use the function, use ``` const redir = require('./index').redir; ``` or destructure directly into redir ``` const {...
11,860,855
To create buttons in the SDL Tridion ribbon toolbar, where can we find the extension related information (like the config file, js files) of already existing controls like Check-in, Check-out, Undo Check-out so we can use them as a reference?
2012/08/08
[ "https://Stackoverflow.com/questions/11860855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1544948/" ]
Parts of the configuration are in the `..\Tridion\web\WebUI\Editors\CME\Configuration\CME.config`, the rest is in the `..\Tridion\web\WebUI\WebRoot\Configuration\System.config` I believe. The ASPX, CSS and JS files are all located in `..\Tridion\web\WebUI\Editors\CME`, interesting paths to follow there are the `Views`...
I don't have a running system to check with right now, but I believe you can find this information by "following the trail" from System.Config. Just like with our own extensions, the Tridion CME must register its commands in there, and will have links to js, css, config, etc.
133,701
There is kind of a risk gaining an access to personal data or some way getting debts with a passport. Is there a chance someone can read biometric RFID data from an international passport, like fingerprints or a photograph?
2019/03/12
[ "https://travel.stackexchange.com/questions/133701", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/68847/" ]
The RFID chip in a biometric passport can be convinced to communicate all the data stored therein if the right keys are provided to it. Note it’s not a matter of downloading encrypted data from the chip and then having a go at it with decryption tools of some kind; the communication with the chip is bi-directional and ...
The data on your passport chip is encrypted, but the encryption key is the machine-readable data on the personal data page (see e.g. [this slide deck from ICAO](https://www.icao.int/Meetings/TAG-MRTD/Documents/Tag-Mrtd-18/Kinneging.pdf)). So it is useless if someone just reads the chip alone, but if they also can see t...
10,306,328
``` class LogUtil<T> : ILogUtility { log4net.ILog log; public LogUtil() { log = log4net.LogManager.GetLogger(typeof(T).FullName); } public void Log(LogType logtype, string message) { Console.WriteLine("logging coming from class {0} - message {1} " , typeof(T).FullName, message)...
2012/04/24
[ "https://Stackoverflow.com/questions/10306328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/71422/" ]
It looks like you're adding a level of abstraction where there really doesn't need to be one. If we start with your end result, LoggerUtility just needs to have an interface that it can use to log things based on the `LogType` parameter. Your `Logger` class, as its currently written, is just a thin wrapper around t...
You don't need a second wrapper, you need either a factory or to use a dependency injection framework to construct an appropriate wrapper around log4net. Using Ninject, and modifying your interface, you can do ``` kernel.Bind(typeof(ILogUtility<>)).To(typeof(Log4NetUtil<>); ``` and instantiate it as ``` var logge...
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
You can make x even, by using floor division and then multiplication: ``` x = (x // 2) * 2 ``` x will then be rounded to the previous even integer or stay the same if it was even before. If you want to round it to the following even integer you need to do: ``` x = ((x + 1) // 2) * 2 ``` This can be improved furt...
You can do it this way: ``` >>> for n in range((x + 1) // 2 * 2, y+1, 2): print(n) ``` The first argument to `range` forces it to be the next even number if it is odd. The last argument goes up in twos.
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
You can make x even, by using floor division and then multiplication: ``` x = (x // 2) * 2 ``` x will then be rounded to the previous even integer or stay the same if it was even before. If you want to round it to the following even integer you need to do: ``` x = ((x + 1) // 2) * 2 ``` This can be improved furt...
You can use reminder to get the correct range: ``` def print_event_for(min_, max_): reminder = min_ % 2 for i in range(min_+reminder, max_+reminder, 2): print(i) print_event_for(5, 12) ``` Output: ``` 6 8 10 12 ```
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
one way is by using while, that takes the start and end range in ``` for each in range(int(input()),int(input())): while each%2 == 0: print (each) break; ```
``` def printEvenfor(x,y): return list(range(((x+1) // 2) * 2,y+1, 2)) printEvenfor(9,16) ```
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
one way is by using while, that takes the start and end range in ``` for each in range(int(input()),int(input())): while each%2 == 0: print (each) break; ```
Try this: ```py x = x+x%2 for num in range (x,y+1,2): print (num) ```
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
You can use reminder to get the correct range: ``` def print_event_for(min_, max_): reminder = min_ % 2 for i in range(min_+reminder, max_+reminder, 2): print(i) print_event_for(5, 12) ``` Output: ``` 6 8 10 12 ```
The following function will do what you want. I use `round` to force the boundaries to be even in order to get start the range on an even number. ``` def print_even_between(x, y): x = round(x / 2) * 2 y = round(y / 2) * 2 for i in range(x, y, 2): print(i) print(y) ```
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
You can use reminder to get the correct range: ``` def print_event_for(min_, max_): reminder = min_ % 2 for i in range(min_+reminder, max_+reminder, 2): print(i) print_event_for(5, 12) ``` Output: ``` 6 8 10 12 ```
Try this: ```py x = x+x%2 for num in range (x,y+1,2): print (num) ```
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
one way is by using while, that takes the start and end range in ``` for each in range(int(input()),int(input())): while each%2 == 0: print (each) break; ```
Hacky but fun: multiplying strings with zero. ``` >>> low, high = int(input()), int(input()) 5 13 >>> for n in range(low, high + 1): ... print('{}\n'.format(n)*(not n%2), end='') ... 6 8 10 12 ``` Odd numbes are not printed because the string is multiplied with `False` (acting as zero).
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
You can make x even, by using floor division and then multiplication: ``` x = (x // 2) * 2 ``` x will then be rounded to the previous even integer or stay the same if it was even before. If you want to round it to the following even integer you need to do: ``` x = ((x + 1) // 2) * 2 ``` This can be improved furt...
Try this: ```py x = x+x%2 for num in range (x,y+1,2): print (num) ```
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
You can use reminder to get the correct range: ``` def print_event_for(min_, max_): reminder = min_ % 2 for i in range(min_+reminder, max_+reminder, 2): print(i) print_event_for(5, 12) ``` Output: ``` 6 8 10 12 ```
``` def printEvenfor(x,y): return list(range(((x+1) // 2) * 2,y+1, 2)) printEvenfor(9,16) ```
55,535,138
I have a homework to do in Python class and was given this question: > > Make a program that gets 2 numbers from the user, and prints all even > numbers in the range of those 2 numbers, you can only use as many for > statements as you want, but can't use another loops or if statement. > > > I understand that I ...
2019/04/05
[ "https://Stackoverflow.com/questions/55535138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10301715/" ]
You can make x even, by using floor division and then multiplication: ``` x = (x // 2) * 2 ``` x will then be rounded to the previous even integer or stay the same if it was even before. If you want to round it to the following even integer you need to do: ``` x = ((x + 1) // 2) * 2 ``` This can be improved furt...
Hacky but fun: multiplying strings with zero. ``` >>> low, high = int(input()), int(input()) 5 13 >>> for n in range(low, high + 1): ... print('{}\n'.format(n)*(not n%2), end='') ... 6 8 10 12 ``` Odd numbes are not printed because the string is multiplied with `False` (acting as zero).
111,580
Torque seal is a lacquer-like product used in critical applications after a screw is tightened to provide a visual indication if the screw comes loose. Considering that a terminal screw on an electrical device coming loose can give you a Bad Day™, is it legal to use torque seal or an equivalent product (nail polish is ...
2017/04/06
[ "https://diy.stackexchange.com/questions/111580", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/27099/" ]
I don't know of any restrictions for the use you are proposing. In fact I have used it myself. Mostly for time clocks so if we can tell if someone is jacking with it.
I have never used this product, but often make a sharpie mark, which IME is a very common practice, and never raises an eyebrow. Since the amount is so small, I don't think there's a danger of fumes around the equipment while it cures, or introducing a combustible into the interior of the equipment. I think since t...
13,125,284
In the code below, I am applying a different background color to all even rows by dynamically assigning the class "even" to them using javascript. I am calling the alternamte() function onload of the body tag. At first, I was using getElementById to get the table object and my code worked fine. However, I am suppose ...
2012/10/29
[ "https://Stackoverflow.com/questions/13125284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1316524/" ]
It's [getElementsByTagName()](https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName), plural. It returns a HTMLCollection ``` var table = document.getElementsByTagName("table")[0]; ``` (if you're confident that there's a `<table>` on the page.) If you want to do things to *all* the `<tab...
Use `getElementsByTagName` instead of `getElementByTagName` (getElementsByTagName return multiple node elements ) ``` var table = document.getElementsByTagName("table")[0], trs, rl; vat tl= table.length; while(tl--){ trs = tables[tl].getElementsByTagName("tr"); rl = trs.length; while(rl--)...
13,125,284
In the code below, I am applying a different background color to all even rows by dynamically assigning the class "even" to them using javascript. I am calling the alternamte() function onload of the body tag. At first, I was using getElementById to get the table object and my code worked fine. However, I am suppose ...
2012/10/29
[ "https://Stackoverflow.com/questions/13125284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1316524/" ]
Use `getElementsByTagName` instead of `getElementByTagName` (getElementsByTagName return multiple node elements ) ``` var table = document.getElementsByTagName("table")[0], trs, rl; vat tl= table.length; while(tl--){ trs = tables[tl].getElementsByTagName("tr"); rl = trs.length; while(rl--)...
getElementsByTagName() returns an array matching the selector. Hence try ``` var table = getElementsByTagName('table')[indexnumber]; ```
13,125,284
In the code below, I am applying a different background color to all even rows by dynamically assigning the class "even" to them using javascript. I am calling the alternamte() function onload of the body tag. At first, I was using getElementById to get the table object and my code worked fine. However, I am suppose ...
2012/10/29
[ "https://Stackoverflow.com/questions/13125284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1316524/" ]
It's [getElementsByTagName()](https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName), plural. It returns a HTMLCollection ``` var table = document.getElementsByTagName("table")[0]; ``` (if you're confident that there's a `<table>` on the page.) If you want to do things to *all* the `<tab...
getElementsByTagName() returns an array matching the selector. Hence try ``` var table = getElementsByTagName('table')[indexnumber]; ```
41,862,030
So I needed to use the code of the subprocess module to add some functionality I needed. When I was trying to compile the \_subprocess.c file, it gives this error message: `Error 1 error C2086: 'PyTypeObject sp_handle_type' : redefinition` This is the code part which is relevant from `_subprocess.c` file: ``` typede...
2017/01/25
[ "https://Stackoverflow.com/questions/41862030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5372734/" ]
**Notes**: * I'm talking about *Python 2.7* here (since in newer versions, the *subprocess* module no longer has an own *C* implementation for *Win*) * *Python 2.7* is built (officially) using *VStudio2008 (9.0)* according to [[Python.Wiki]: WindowsCompilers](https://wiki.python.org/moin/WindowsCompilers). Building it...
Ok I found an answer. It turns out that the definition of `staticforward` should have been `extern` instead of `static`. My compiler didn't know how to handle it. I guess in other compilers it works ok.
45,094,992
I need to append a new item to the end of a list. Here is what I tried: ``` (define my-list (list '1 2 3 4)) (let ((new-list (append my-list (list 5))))) new-list ``` I expect to see: ``` (1 2 3 4 5) ``` But I receive: > > let: bad syntax (missing binding pair5s or body) in (let ((new-list (append my-list (list...
2017/07/14
[ "https://Stackoverflow.com/questions/45094992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8305676/" ]
Your problem is mostly of syntactical nature. The `let` expression in Scheme has the form `(let (binding pairs) body)`. In your example code, while you do have a binding that should work, you don't have a body. For it to work, you need to change it to ``` (let ((new-list (append my-list (list 5)))) new-list) ```...
A `let` makes a local variable that exists for the duration of the `let` form. Thus ```scm (let ((new-list (append my-list '(5)))) (display new-list) ; prints the new list ) ; ends the let, new-list no longer exist new-list ; error since new-list is not bound ``` Your error message tells you that you have no ex...
59,080
I want to re-edit my question so that it will come in latest questions again and you all experts can look and help me. But i forgot my actual login id i used to post for the question. This is the link to my actual question. [My actual question](https://stackoverflow.com/questions/2854989/dsnless-connection-for-aruna-...
2010/07/30
[ "https://meta.stackexchange.com/questions/59080", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/-1/" ]
No worries, we're glad to see you care about your question. Did you insert your email address when you created that account? If so, have a look at this: <https://stackoverflow.com/users/account-recovery> As pointed out by George in the actual question, you can also have a moderator merge your new account with the old...
You [are a registered user](https://stackoverflow.com/users/309131/vijay), do you remember if you used OpenID or made an account directly? If OpenID, Flag your question for moderator and ask them to e-mail you the OpenID URL associated with your account, if you provided your e-mail when filling out your profile. That ...
27,711,123
I have a svg.php file with some shapes. ``` <rect onclick="window.location='search.php?filter=1'" width="50" height="50"> <rect onclick="window.location='search.php?filter=2'" width="50" height="50"> ``` Search.php ``` div class="container"> <textarea class="search" id="search_id"></textarea> ...
2014/12/30
[ "https://Stackoverflow.com/questions/27711123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3906855/" ]
Azure SQL Databases are always UTC, regardless of the data center. You'll want to handle time zone conversion at your application. In this scenario, since you want to compare "now" to a data column, make sure `AcceptedDate` is also stored in UTC. [Reference](http://blogs.msdn.com/b/cie/archive/2013/07/29/manage-timez...
The SQL databases on the `Azure` cloud are pegged against `Greenwich Mean Time(GMT) or Coordinated Universal Time(UTC)` however many applications are using `DateTime.Now` which is the time according to the regional settings specified on the host machine. Sometimes this is not an issue when the DateTime is not used fo...
27,711,123
I have a svg.php file with some shapes. ``` <rect onclick="window.location='search.php?filter=1'" width="50" height="50"> <rect onclick="window.location='search.php?filter=2'" width="50" height="50"> ``` Search.php ``` div class="container"> <textarea class="search" id="search_id"></textarea> ...
2014/12/30
[ "https://Stackoverflow.com/questions/27711123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3906855/" ]
Azure SQL Databases are always UTC, regardless of the data center. You'll want to handle time zone conversion at your application. In this scenario, since you want to compare "now" to a data column, make sure `AcceptedDate` is also stored in UTC. [Reference](http://blogs.msdn.com/b/cie/archive/2013/07/29/manage-timez...
In this modern times where infrastructure is scaled globally, it is good idea to save data in UTC and convert to a timezone based on users location preference. Please refere: <https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow?view=netframework-4.7.2>
27,711,123
I have a svg.php file with some shapes. ``` <rect onclick="window.location='search.php?filter=1'" width="50" height="50"> <rect onclick="window.location='search.php?filter=2'" width="50" height="50"> ``` Search.php ``` div class="container"> <textarea class="search" id="search_id"></textarea> ...
2014/12/30
[ "https://Stackoverflow.com/questions/27711123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3906855/" ]
Azure SQL Databases are always UTC, regardless of the data center. You'll want to handle time zone conversion at your application. In this scenario, since you want to compare "now" to a data column, make sure `AcceptedDate` is also stored in UTC. [Reference](http://blogs.msdn.com/b/cie/archive/2013/07/29/manage-timez...
I created a simple function that returns the correct UK time whether in DST or not. It can be adapted for other time zones where DST kicks in. ```sql CREATE FUNCTION [dbo].[f_CurrentDateTime]() RETURNS DATETIME AS BEGIN RETURN DATEADD(HOUR,CONVERT(INT,(SELECT is_currently_dst FROM sys.time_zone_info WHERE 1=1 AND NAME...
27,711,123
I have a svg.php file with some shapes. ``` <rect onclick="window.location='search.php?filter=1'" width="50" height="50"> <rect onclick="window.location='search.php?filter=2'" width="50" height="50"> ``` Search.php ``` div class="container"> <textarea class="search" id="search_id"></textarea> ...
2014/12/30
[ "https://Stackoverflow.com/questions/27711123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3906855/" ]
The SQL databases on the `Azure` cloud are pegged against `Greenwich Mean Time(GMT) or Coordinated Universal Time(UTC)` however many applications are using `DateTime.Now` which is the time according to the regional settings specified on the host machine. Sometimes this is not an issue when the DateTime is not used fo...
In this modern times where infrastructure is scaled globally, it is good idea to save data in UTC and convert to a timezone based on users location preference. Please refere: <https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow?view=netframework-4.7.2>
27,711,123
I have a svg.php file with some shapes. ``` <rect onclick="window.location='search.php?filter=1'" width="50" height="50"> <rect onclick="window.location='search.php?filter=2'" width="50" height="50"> ``` Search.php ``` div class="container"> <textarea class="search" id="search_id"></textarea> ...
2014/12/30
[ "https://Stackoverflow.com/questions/27711123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3906855/" ]
The SQL databases on the `Azure` cloud are pegged against `Greenwich Mean Time(GMT) or Coordinated Universal Time(UTC)` however many applications are using `DateTime.Now` which is the time according to the regional settings specified on the host machine. Sometimes this is not an issue when the DateTime is not used fo...
I created a simple function that returns the correct UK time whether in DST or not. It can be adapted for other time zones where DST kicks in. ```sql CREATE FUNCTION [dbo].[f_CurrentDateTime]() RETURNS DATETIME AS BEGIN RETURN DATEADD(HOUR,CONVERT(INT,(SELECT is_currently_dst FROM sys.time_zone_info WHERE 1=1 AND NAME...
27,711,123
I have a svg.php file with some shapes. ``` <rect onclick="window.location='search.php?filter=1'" width="50" height="50"> <rect onclick="window.location='search.php?filter=2'" width="50" height="50"> ``` Search.php ``` div class="container"> <textarea class="search" id="search_id"></textarea> ...
2014/12/30
[ "https://Stackoverflow.com/questions/27711123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3906855/" ]
I created a simple function that returns the correct UK time whether in DST or not. It can be adapted for other time zones where DST kicks in. ```sql CREATE FUNCTION [dbo].[f_CurrentDateTime]() RETURNS DATETIME AS BEGIN RETURN DATEADD(HOUR,CONVERT(INT,(SELECT is_currently_dst FROM sys.time_zone_info WHERE 1=1 AND NAME...
In this modern times where infrastructure is scaled globally, it is good idea to save data in UTC and convert to a timezone based on users location preference. Please refere: <https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow?view=netframework-4.7.2>
46,768,071
I'm trying to use the hash algorithms provided by the openssl library. I have openssl and libssl-dev installed. The version is 1.1.0f. I try to run the example code of the openssl.org site: ``` #include <stdio.h> #include <openssl/evp.h> int main(int argc, char *argv[]){ EVP_MD_CTX *mdctx; const EVP_MD *md; char mes...
2017/10/16
[ "https://Stackoverflow.com/questions/46768071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8783607/" ]
You seem to be using an older version of openssl (< 1.1.0). Maybe you have downloaded and installed the newer version, but your linker seems to find and use an older version of your openssl library. `EVP_MD_CTX_new()` in 1.1.0 has replaced `EVP_MD_CTX_create()` in 1.0.x. `EVP_MD_CTX_free()` in 1.1.0 has replaced `EVP...
> > The version is 1.1.0f. I try to run the example code of the openssl.org site ... > > > I installed and reinstalled OpenSSL 2 times from the website by compiling it ... > > > I believe OpenSSL 1.1.0 installs into `/usr/local/ssl`. Headers are located at `/usr/local/ssl/include` and libs are located at `/usr/l...
3,373,668
I'm new to android development and as a pet project I wanted to try and connect to an bluetooth device using the HID profile using an android phone. The phone I'll be using is the vibrant and according to samsung it doesn't support the HID Profile ( <http://ars.samsung.com/customer/usa/jsp/faqs/faqs_view_us.jsp?SITE_ID...
2010/07/30
[ "https://Stackoverflow.com/questions/3373668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305682/" ]
With an HTTP DELETE, the URI should fully identify the resource to be deleted. Sending additional data in the request body is unexpected, [and on App Engine, unsupported](http://code.google.com/p/googleappengine/issues/detail?id=601#c5): > > Indeed, when the appspot frontends see > a DELETE request that includes an ...
I've seen this happen when the site authenticating doesn't resolve multiple browser users properly or adequately. In ChromeOS the fix is to sign out entirely, and access the site when only the primary identity has been authenticated. Examples: Gmail, and Ingress.
3,373,668
I'm new to android development and as a pet project I wanted to try and connect to an bluetooth device using the HID profile using an android phone. The phone I'll be using is the vibrant and according to samsung it doesn't support the HID Profile ( <http://ars.samsung.com/customer/usa/jsp/faqs/faqs_view_us.jsp?SITE_ID...
2010/07/30
[ "https://Stackoverflow.com/questions/3373668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305682/" ]
With an HTTP DELETE, the URI should fully identify the resource to be deleted. Sending additional data in the request body is unexpected, [and on App Engine, unsupported](http://code.google.com/p/googleappengine/issues/detail?id=601#c5): > > Indeed, when the appspot frontends see > a DELETE request that includes an ...
[Drew Sears' Answer](https://stackoverflow.com/a/3375122/6124909) is the most probable issue. However in our case, there was a GET request which was having an empty Request body `{}` which resulted in the `400 - Bad Request` Error with the following message: > > Your client has issued a malformed or illegal request....
3,373,668
I'm new to android development and as a pet project I wanted to try and connect to an bluetooth device using the HID profile using an android phone. The phone I'll be using is the vibrant and according to samsung it doesn't support the HID Profile ( <http://ars.samsung.com/customer/usa/jsp/faqs/faqs_view_us.jsp?SITE_ID...
2010/07/30
[ "https://Stackoverflow.com/questions/3373668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305682/" ]
[Drew Sears' Answer](https://stackoverflow.com/a/3375122/6124909) is the most probable issue. However in our case, there was a GET request which was having an empty Request body `{}` which resulted in the `400 - Bad Request` Error with the following message: > > Your client has issued a malformed or illegal request....
I've seen this happen when the site authenticating doesn't resolve multiple browser users properly or adequately. In ChromeOS the fix is to sign out entirely, and access the site when only the primary identity has been authenticated. Examples: Gmail, and Ingress.
31,843,925
I have a query in Linq that needs to be dynamically adjustable based on some values a user selects in a form. My query looks as follows: ``` (from data in DbContext.CoacheeData group data by data.UserId into g select new LeaderboardEntry { Name = g.FirstOrDefault().UserName, Value = g.Sum(data => data.Ste...
2015/08/05
[ "https://Stackoverflow.com/questions/31843925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4500048/" ]
If I understand this correctly, you wish to get the most recently liked photos of a particular user. This can be done using the Instagram API - but only when that particular user has authenticated your app. You can use the following endpoint: > > GET /users/self/media/liked > > > Here the API call would be : ...
Unfortunately no, you can't. This feature is only available on the Instagram app following [this steps](https://help.instagram.com/367550509992787) > > To view the 300 most-recent posts you've liked, go to your account > settings in the app and then tap Posts You've Liked. You won't be able > to view posts you've ...
42,318,634
I am trying to print a list from mysql table to express page. app.js uses routes.js. there I have get for users profile page ``` //profile app.get('/profile', isLoggedIn, function(req, res){ var courses = []; connection.query('SELECT courseID FROM studentCourses WHERE userID = ?', [req.user], function(err, rows){...
2017/02/18
[ "https://Stackoverflow.com/questions/42318634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7488770/" ]
`x` in `main()` is a local variable that is *independent* from the `x` variable in `getheight()`. You are returning the new value from the latter but areignoring the returned value. Set `x` in `main` from the function call result: ``` while x not in range (1,23): x = getheight() if x in range (1,23): b...
Return does not mean that it will automatically update whatever variable name in main matches the return variable. If you do not store this return value, the return value will be gone. Hence you must do ``` x=getheight() ``` to update your variable x
66,999,934
I have 2 icons in divs and 1 link which works as a button ```css .A { width: 50px; height: 50px; border: 1px solid black; display: inline-flex; justify-content: center; align-items: center; margin: 5px; } a { text-decoration: none; } .B { width: 100px; height: 50px; } /* when i change font-size ...
2021/04/08
[ "https://Stackoverflow.com/questions/66999934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10766879/" ]
Wrap in flex: ```css .container { display: flex; } ``` ```html <div class="container"> <a href="#"> <div class="A"> <i class="fab fa-facebook-f"></i> </div> </a> <a href="#"> <div class="A"> <i class="fab fa-youtube"></i> </div> </a> <a href="#"> <div class="A B"> ...
I know I am a bit a late to the party, but it is possible to make it simpler: ```css .container { display: inline-flex; width: 300px; height: 50px; } .container a { width: 33%; margin: 5px; border: 1px solid black; display:inline-flex; justify-content:center; align-items:center; font-size: 16px; }...
66,999,934
I have 2 icons in divs and 1 link which works as a button ```css .A { width: 50px; height: 50px; border: 1px solid black; display: inline-flex; justify-content: center; align-items: center; margin: 5px; } a { text-decoration: none; } .B { width: 100px; height: 50px; } /* when i change font-size ...
2021/04/08
[ "https://Stackoverflow.com/questions/66999934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10766879/" ]
Wrap in flex: ```css .container { display: flex; } ``` ```html <div class="container"> <a href="#"> <div class="A"> <i class="fab fa-facebook-f"></i> </div> </a> <a href="#"> <div class="A"> <i class="fab fa-youtube"></i> </div> </a> <a href="#"> <div class="A B"> ...
You should only add "flex-direction: column;" for your CSS code. ``` .container{ display: flex; flex-direction: column; } .A { width:50px; height: 50px; border: 1px solid black; display:inline-flex; justify-content:center; align-items:center; margin: 5px; } a { text-decoration:none; } .B { wid...
15,988,638
I have a class called TileView which extends UIView. In another view I create 9 TileView objects and display them on the screen. Below is an example of 1 of them ``` tile1 = [[TileView alloc] initWithFrame:CGRectMake(20,20, 100, 150) withImageNamed:@"tile1.png" value: 1 ...
2013/04/13
[ "https://Stackoverflow.com/questions/15988638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1424638/" ]
If all you want is the tiles not to be interacted with, surely simply: ``` for (UIView *tile in acceptedTiles) { [tile setUserInteractionEnabled:NO]; } ``` If that doesn't meet your requirements, please elaborate. It seems perfect for you.
If you didn't want to change your code too much you could check if the view was added to `acceptedTiles` before you do anything else in `touchesBegan:withEvent`, and if it was just return. However, I wonder why you aren't using a `UITapGestureRecognizer` here instead? If you did you could set a delegate that implemen...
34,810,451
I have this conditions ``` if (txtBoxFatherHusbandName.Text != "" || txtBoxName.Text != "" || txtBoxNICNo.Text != "") { ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields"); txtBoxFatherHusbandName.Focus(); return; } ``` all three textboxes are empty with no t...
2016/01/15
[ "https://Stackoverflow.com/questions/34810451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5700366/" ]
You have to use [`String.IsNullOrWhiteSpace()`](https://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace%28v=vs.110%29.aspx) to check them here, because user may press spaces in that case there can be propblems, so you should be writing if like following to tackle with empty textboxes: ``` if (!String...
``` if (!string.IsNullOrWhiteSpace(txtBoxFatherHusbandName.Text) || !string.IsNullOrWhiteSpace(txtBoxName.Text) || !string.IsNullOrWhiteSpace(txtBoxNICNo.Text)) { ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields"); txtBoxFatherHusbandName.Focus(); retu...
34,810,451
I have this conditions ``` if (txtBoxFatherHusbandName.Text != "" || txtBoxName.Text != "" || txtBoxNICNo.Text != "") { ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields"); txtBoxFatherHusbandName.Focus(); return; } ``` all three textboxes are empty with no t...
2016/01/15
[ "https://Stackoverflow.com/questions/34810451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5700366/" ]
Use following statement in if condition ``` if(!string.IsNullOrEmpty(txtBoxFatherHusbandName.Text.Trim())) ```
``` if (!string.IsNullOrWhiteSpace(txtBoxFatherHusbandName.Text) || !string.IsNullOrWhiteSpace(txtBoxName.Text) || !string.IsNullOrWhiteSpace(txtBoxNICNo.Text)) { ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields"); txtBoxFatherHusbandName.Focus(); retu...
34,810,451
I have this conditions ``` if (txtBoxFatherHusbandName.Text != "" || txtBoxName.Text != "" || txtBoxNICNo.Text != "") { ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields"); txtBoxFatherHusbandName.Focus(); return; } ``` all three textboxes are empty with no t...
2016/01/15
[ "https://Stackoverflow.com/questions/34810451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5700366/" ]
You have to use [`String.IsNullOrWhiteSpace()`](https://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace%28v=vs.110%29.aspx) to check them here, because user may press spaces in that case there can be propblems, so you should be writing if like following to tackle with empty textboxes: ``` if (!String...
Use following statement in if condition ``` if(!string.IsNullOrEmpty(txtBoxFatherHusbandName.Text.Trim())) ```
29,139,964
Given a SQL query variable, i.e., ``` string mySQLQuery = "SELECT TableA.Field1, TableA.Field2,..., TableB.Field1, TableB.Field2,.... FROM TableA LEFT OUTER JOIN TableB ON TableA.Field1 = TableB.Field1" ``` Is there any straight way I can extract the fields and the table names within the query in two lists? so: Li...
2015/03/19
[ "https://Stackoverflow.com/questions/29139964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162164/" ]
I found out where the problem came from. Since the content loaded in the “div” element changed its height 2 times with each press of the button, the height of the page body changed as well. This was the cause of the scrolling. I fixed the height of the “div” element in the css file: ``` div#result {height: 200px;} ``...
Good, for the answer and also good if you give your code in jsfiddle. Still no issue, recently I have done the same thing. By default it same position if you click on button, but if you have anchor tag, then it will automatically goes on top. There is so many things to stay or scroll on desired position. [window.scr...
29,139,964
Given a SQL query variable, i.e., ``` string mySQLQuery = "SELECT TableA.Field1, TableA.Field2,..., TableB.Field1, TableB.Field2,.... FROM TableA LEFT OUTER JOIN TableB ON TableA.Field1 = TableB.Field1" ``` Is there any straight way I can extract the fields and the table names within the query in two lists? so: Li...
2015/03/19
[ "https://Stackoverflow.com/questions/29139964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162164/" ]
I found out where the problem came from. Since the content loaded in the “div” element changed its height 2 times with each press of the button, the height of the page body changed as well. This was the cause of the scrolling. I fixed the height of the “div” element in the css file: ``` div#result {height: 200px;} ``...
You have to call this function on page load. ``` limit – The number of records to display per request. offset – The starting pointer of the data. busy – Check if current request is going on or not. The main trick for this scroll down pagination is binding the window scroll event and checking with the data container h...
422,149
I have a Windows 7 Ultimate machine where the wireless adapter all of a sudden started having trouble connecting to wireless networks. Whenever I go to a new place and try to connect to a wireless network, it says that the DNS server is not responding, and tells me to go unplug the router and try again. After several l...
2012/05/08
[ "https://superuser.com/questions/422149", "https://superuser.com", "https://superuser.com/users/133169/" ]
It really depends on the case you have. I would personally get one of solid state picoPSU things and power the PC through a battery. Charge up a capacitor while the car is running, then when the car shuts off let it slowly drain through a resistor to ground and when the capacitor is empty get a mosfet to poke the "po...
I think, given the sheer form factor of a M-ITX case you would be better off getting some soft of UPS that is plugged into the car battery and working out how to do a graceful shutdown if the ignition has been cut for more than x minutes. You could try and bodge a load of batteries into a hard disk space but that proba...
14,018,088
I have a jBoss 5.1.0-GA running a server, it was running find. But I copied whole jboss to another server, (by using tar). When I start new jBoss, it give a "user null is NOT authenticated", here is the stack trace ``` [ExceptionUtil] ConnectionFactoryEndpoint[jboss.messaging.connectionfactory:service=ConnectionFacto...
2012/12/24
[ "https://Stackoverflow.com/questions/14018088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1479203/" ]
Solved the problem, that was happened when we are going to solve some other problem, that is com.arjuna transaction issue, in that jboss keep throwing messages non stop, to resolve that issue, some posts recommended delete the 'data' folder in jBoss, when we delete that, the hypersonic database script inside the data f...
One other possibility is that the data-source specified in the `DatabaseServerLoginModule` bean, which is configured in "messaging-jboss-beans.xml", does not match the data-source you are using for JMS. This would probably occur when you have replaced the "hsqldb-persistence-service.xml" file in the "deploy/messaging"...
46,782,347
I am trying to output SQL as XML to match the exact format as the following ``` <?xml version="1.0" encoding="utf-8"?> <ProrateImport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schema.aldi- sued.com/Logistics/Shipping/ProrateImport/20151009"> <P...
2017/10/17
[ "https://Stackoverflow.com/questions/46782347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8787739/" ]
When defining `sum''`, you have defined what it means for two empty lists, and for two non-empty lists, but you haven't defined what it means for two lists, only one of which is empty. This is what the compiler is telling you via that error message. Simply add definitions of what `sum''` means whenever left list is em...
Well in Haskell, actually for what you need there is the [`ZipList`](https://hackage.haskell.org/package/base-4.10.0.0/docs/Control-Applicative.html#t:ZipList) type and you may use it to simply do as follows; ``` import Control.Applicative addLists :: Num a => [a] -> [a] -> [a] addLists xs ys = getZipList $ (+) <$> Z...
484,819
Let $X\_1, X\_2 , \dots, X\_n$ be i.i.d observations from $N(\theta, \theta)$ (where $\theta$ is the variance). I intend to find the minimal sufficient statistics (M.S.S) for the joint distribution. My steps ultimately lead me to the following: $\dfrac{f\_\theta(x)}{f\_\theta(y)} = \text{exp}{ \left\{ \dfrac{-1}{2\th...
2020/08/26
[ "https://stats.stackexchange.com/questions/484819", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/48950/" ]
It turns out that after further expansion, the above becomes $\dfrac{f\_\theta(x)}{f\_\theta(y)} = \exp \left\{ - \left[ \dfrac{1}{2\theta} \left( \sum x\_i^2 - \sum y\_i^2 \right) + \left( \sum y\_i - \sum x\_i \right) \right] \right\}$. Since it is only the first term that depends on $\theta$, the M.S.S is $\sum x\...
By writing the joint density in exponential family form we find $$ f(x,\theta) = \frac1{\sqrt{2\pi}} \exp\left\{ -\frac{n}{2}\log\theta - \frac1{2\theta} \sum\_i x\_i^2 + \sum\_i x\_i -n\theta^2 \right\} $$ and then the result follows by general exponential family theory, as noted in comments.
56,605,977
I mean for example use a normal case switch but instead of the case being selected by a user being chosen randomly ``` def switch_demo(argument):     switcher = {         1: "January",         2: "February",         3: "March",         4: "April",         5: "May",         6: "June",         7: "July",       ...
2019/06/14
[ "https://Stackoverflow.com/questions/56605977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I don't know if I understand what you wanted to do with it, but you don't need to do it, you could do it like this: ``` import random months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] rand_month_choice = random.choice(months) print(ra...
This is very possible, but there are probably better ways of going about it. For example, you could simply go: ```py from random import randint month = randint(1,12) case (month)... ``` I would suggest using a list to store this information, since this isn't really an appropriate use-case (no pun intended) for case...
267,026
I'm running a script within a script, release.sh and caller.sh (caller.sh calls release.sh). Both are bash. release.sh contains a bunch of conditions with 'exit 1' for errors. caller.sh contains a line that goes "./release.sh", then a checks for the exit code of release.sh - if $? is greater than 0 then echo "releas...
2016/03/02
[ "https://unix.stackexchange.com/questions/267026", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/137597/" ]
Since you are using bash you can set in the script the option: ``` set -o pipefail ``` > > The pipeline's return status is the value of the last (rightmost) command > to exit with a non-zero status, or zero if all commands exit successfully. > > > Alternatively, immediately after the piped command you can look...
May I suggest rewriting it like that: ``` ./release.sh > release.txt 2>&1 ``` and then ``` echo $? ``` would return the correct exit status
20,523,881
Is there any event, to append to the following listener, that will tell me if a radio button is already clicked? ``` var budgetType; $(document).on('change', 'input[name="import_export"]', function() { console.log($(this)) budgetType = $(this).val(); }); ``` My problem is that, on page reload, if the radio b...
2013/12/11
[ "https://Stackoverflow.com/questions/20523881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/971392/" ]
``` $('input[type=radio]').is(':checked') ``` Try this code here: <http://jsfiddle.net/afzaal_ahmad_zeeshan/rU2Fc/> or try this one ``` $('input[type=radio]').prop('checked', true); ``` Try this code here: <http://jsfiddle.net/afzaal_ahmad_zeeshan/rU2Fc/1/> It will work, you can execute this onload to get the fi...
Try this : ``` $('input[type=radio]').is(':checked') ``` Or ``` $('input[type=radio]').prop('checked') === true; ``` Or ``` $('input[type=radio]').attr('checked') === 'checked'; ```
20,523,881
Is there any event, to append to the following listener, that will tell me if a radio button is already clicked? ``` var budgetType; $(document).on('change', 'input[name="import_export"]', function() { console.log($(this)) budgetType = $(this).val(); }); ``` My problem is that, on page reload, if the radio b...
2013/12/11
[ "https://Stackoverflow.com/questions/20523881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/971392/" ]
``` $('input[type=radio]').is(':checked') ``` Try this code here: <http://jsfiddle.net/afzaal_ahmad_zeeshan/rU2Fc/> or try this one ``` $('input[type=radio]').prop('checked', true); ``` Try this code here: <http://jsfiddle.net/afzaal_ahmad_zeeshan/rU2Fc/1/> It will work, you can execute this onload to get the fi...
Trigger the change event on load: ``` var budgetType; $(document).on('change', 'input[name="import_export"]', function() { var isChecked = $(this).is(":checked"); console.log($(this).val()+" "+isChecked); budgetType = $(this).val(); }); $('input[name="import_export"]:checked').trigger('change'); ``` <htt...
20,523,881
Is there any event, to append to the following listener, that will tell me if a radio button is already clicked? ``` var budgetType; $(document).on('change', 'input[name="import_export"]', function() { console.log($(this)) budgetType = $(this).val(); }); ``` My problem is that, on page reload, if the radio b...
2013/12/11
[ "https://Stackoverflow.com/questions/20523881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/971392/" ]
Trigger the change event on load: ``` var budgetType; $(document).on('change', 'input[name="import_export"]', function() { var isChecked = $(this).is(":checked"); console.log($(this).val()+" "+isChecked); budgetType = $(this).val(); }); $('input[name="import_export"]:checked').trigger('change'); ``` <htt...
Try this : ``` $('input[type=radio]').is(':checked') ``` Or ``` $('input[type=radio]').prop('checked') === true; ``` Or ``` $('input[type=radio]').attr('checked') === 'checked'; ```
2,755,102
Fifty years ago, we were taught to calculate square roots one digit at a time with pencil and paper (and in my case, an eraser was also required). That was before calculators with a square root button were available. (And a square root button is an incredibly powerful doorway to the calculation of other functions.) Wh...
2018/04/26
[ "https://math.stackexchange.com/questions/2755102", "https://math.stackexchange.com", "https://math.stackexchange.com/users/133895/" ]
A real as repeating digit patterns iff it is a rational. Your question is then under which conditions the square root of a rational $r$ is rational. The answer (see [here](https://math.stackexchange.com/questions/448172/what-rational-numbers-have-rational-square-roots/448180#448180)) is that $r$ must be the square of ...
Any repeating digit pattern *must* be rational, so take a rational number $\frac{p}{q}$, and square it to get $\frac{p^2}{q^2}$, and there you have it! It's worth noting that, in the examples you gave, $\sqrt{0.1111...} = \sqrt{\frac{1}{9}} = \sqrt{\frac{1}{3^2}} = \frac{1}{3}$, and $\sqrt{0.44444...} = \sqrt{\frac{4}...
2,755,102
Fifty years ago, we were taught to calculate square roots one digit at a time with pencil and paper (and in my case, an eraser was also required). That was before calculators with a square root button were available. (And a square root button is an incredibly powerful doorway to the calculation of other functions.) Wh...
2018/04/26
[ "https://math.stackexchange.com/questions/2755102", "https://math.stackexchange.com", "https://math.stackexchange.com/users/133895/" ]
Just take your favorite rational number with a repeating decimal: $$\frac{1}{11} = .09090909\ldots.$$ Square it: $$\frac{1}{121} = .00826446280991735537190082644628099173553719\ldots,$$ and you've created an example. This one has period 21 and its square root has period 2.
Any repeating digit pattern *must* be rational, so take a rational number $\frac{p}{q}$, and square it to get $\frac{p^2}{q^2}$, and there you have it! It's worth noting that, in the examples you gave, $\sqrt{0.1111...} = \sqrt{\frac{1}{9}} = \sqrt{\frac{1}{3^2}} = \frac{1}{3}$, and $\sqrt{0.44444...} = \sqrt{\frac{4}...
2,755,102
Fifty years ago, we were taught to calculate square roots one digit at a time with pencil and paper (and in my case, an eraser was also required). That was before calculators with a square root button were available. (And a square root button is an incredibly powerful doorway to the calculation of other functions.) Wh...
2018/04/26
[ "https://math.stackexchange.com/questions/2755102", "https://math.stackexchange.com", "https://math.stackexchange.com/users/133895/" ]
Every rational number has either eventually repeating or terminating decimals. Therefore if your $x$ is a square of a rational number, $\sqrt x$ will either terminate or have eventually repeating decimals. For example $ 1/36 =.0277777777\ldots$ and its square root is $$ \sqrt { .0277777777\ldots} = 0.166666666\ldots$$...
Any repeating digit pattern *must* be rational, so take a rational number $\frac{p}{q}$, and square it to get $\frac{p^2}{q^2}$, and there you have it! It's worth noting that, in the examples you gave, $\sqrt{0.1111...} = \sqrt{\frac{1}{9}} = \sqrt{\frac{1}{3^2}} = \frac{1}{3}$, and $\sqrt{0.44444...} = \sqrt{\frac{4}...
84,956
I am researching this company <https://boldip.com/> How do I verify that 1. It's even a real law firm 2. It's credible 3. It's great at its practice
2022/10/02
[ "https://law.stackexchange.com/questions/84956", "https://law.stackexchange.com", "https://law.stackexchange.com/users/46457/" ]
As to #1, the US Patent and Trademark Office has a [patent practitioner search](https://oedci.uspto.gov/OEDCI/practitionerSearchEntry) where you can verify if someone is a registered patent practitioner. If so, it means they passed a [registration process] that evaluates their "legal, scientific, and technical qualific...
1. The lawyer makes the law firm. If there is at least one lawyer who will sign off on any advice and representation on behalf of the client in a company, in other words, they provide legal services under the lead of a lawyer, and its formally established, it is — potentially besides of any other services they may prov...
69,155,288
I'm supposed to write a LIFO (last in first out) class for chars, which can be edited by Pop and Add functions and seen by Peek function or foreach. Class is working on array to be more optimalized, but foreach for some reason's not working. I tried to make function GetEnumerator based on return value of \_arr.GetEnume...
2021/09/12
[ "https://Stackoverflow.com/questions/69155288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16832655/" ]
The issue is that `Reset` is not called. It is no longer needed but the interface is not changed due to backwards compatibility. Since new iterators implemented using `yield return` is actually required to throw an exception if `Reset` is called, no code is expected to call this method anymore. As such, your iterator ...
Your index counter variable using get values in \_arr array (it is \_i) and index varible that doing increase and decrease operations on it (it is \_index) are different. Because of that your for loop never iterate your collection. I fix the code with some addition here. I hope it's helpful. LIFO.cs ``` using System;...
18,647,942
Is there's a way to get the indices properly from a Pymel/Maya API function? I know Pymel has a function called `getEdges()` however according to their docs this get's them from the selected face, however I just need them from the selected edges. Is this possible?
2013/09/06
[ "https://Stackoverflow.com/questions/18647942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1683943/" ]
While your answer will work theodox, I did find a much simpler resolution, after some serious digging! Turns out, hiding and not very well documented, was a function ironically called `indices()`, I did search for this but nothing came up in the docs. **Pymel** `selection[0].indices()[0]` The above will give us t...
Do you mean you just the expanded list of selected edges? That's just FilterExpand -sm 32 or cmds.filterExpand(sm=32) or pm.filterExpand(sm=32) on an edge selection. Those commands are always strings, you grab the indices out them with a regular expression: ``` # where objs is a list of edges, for example cmds.ls(sl=T...
62,972,549
Im working an a project using Tkinter right now. Whenever I input 'Japan', it prints out: ``` [('Japan', '23,473', 0.0, 985.0, '3,392', '19,096')] ``` I'm not really sure if that's a list or if it's a tuple? I want to seperate all of that data thats seperated by the commas into different variables. Heres what I have...
2020/07/18
[ "https://Stackoverflow.com/questions/62972549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The 'problem' arises because of the change in tsconfig files (solutions style tsconfig) that comes with Typescript 3.9 and Angular 10. More info here : <https://github.com/microsoft/TypeScript/issues/39632> <https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit#> **Solution style tsco...
This is a bizarre behaviour I have also come across with WebStorm. All I can say is that after a while (couldn't tell you what triggers the IDE to understand properly), the warning disappears and everything goes back to normal.
62,972,549
Im working an a project using Tkinter right now. Whenever I input 'Japan', it prints out: ``` [('Japan', '23,473', 0.0, 985.0, '3,392', '19,096')] ``` I'm not really sure if that's a list or if it's a tuple? I want to seperate all of that data thats seperated by the commas into different variables. Heres what I have...
2020/07/18
[ "https://Stackoverflow.com/questions/62972549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This is a bizarre behaviour I have also come across with WebStorm. All I can say is that after a while (couldn't tell you what triggers the IDE to understand properly), the warning disappears and everything goes back to normal.
A comment at the end of the first post in @Wolf359's answer led me to a simple workaround, in the event that your issue is cause by the `tsconfig.json` being split into `tsconfig.base.json` and `tsconfig.app.json`: add a `tsconfig.json` consisting solely of `{ "extends": "./tsconfig.base.json" }` (I have commented like...
62,972,549
Im working an a project using Tkinter right now. Whenever I input 'Japan', it prints out: ``` [('Japan', '23,473', 0.0, 985.0, '3,392', '19,096')] ``` I'm not really sure if that's a list or if it's a tuple? I want to seperate all of that data thats seperated by the commas into different variables. Heres what I have...
2020/07/18
[ "https://Stackoverflow.com/questions/62972549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The 'problem' arises because of the change in tsconfig files (solutions style tsconfig) that comes with Typescript 3.9 and Angular 10. More info here : <https://github.com/microsoft/TypeScript/issues/39632> <https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit#> **Solution style tsco...
A comment at the end of the first post in @Wolf359's answer led me to a simple workaround, in the event that your issue is cause by the `tsconfig.json` being split into `tsconfig.base.json` and `tsconfig.app.json`: add a `tsconfig.json` consisting solely of `{ "extends": "./tsconfig.base.json" }` (I have commented like...
210,779
> > **Is the Solar System stable?** > > > You can see [this](https://en.wikipedia.org/wiki/Stability_of_the_Solar_System) Wikipedia page. In May 2015 I was at the conference of Cedric Villani at Sharif university of technology with this title: "Of planets, stars and eternity (stabilization and long-time behavi...
2015/07/04
[ "https://mathoverflow.net/questions/210779", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
[This paper](http://iopscience.iop.org/0004-637X/683/2/1207/fulltext/) (Batyrin and Laughlin, 2008) seems to indicate that we are doomed.
in a conference in Paris, Jacques Féjoz said (and i quote from memory) that the big planets seem to be stable, while the small ones chaotic. if i remember well, it was based on numerical evidence, intuition and the known results on the stability of the planar many-body problem...
210,779
> > **Is the Solar System stable?** > > > You can see [this](https://en.wikipedia.org/wiki/Stability_of_the_Solar_System) Wikipedia page. In May 2015 I was at the conference of Cedric Villani at Sharif university of technology with this title: "Of planets, stars and eternity (stabilization and long-time behavi...
2015/07/04
[ "https://mathoverflow.net/questions/210779", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
[This paper](http://iopscience.iop.org/0004-637X/683/2/1207/fulltext/) (Batyrin and Laughlin, 2008) seems to indicate that we are doomed.
The work of Wisdom is relevant (for example, see <http://rspa.royalsocietypublishing.org/content/413/1844/109.short>) but not conclusive. Numerical work suggests overall stability over very long time periods.
210,779
> > **Is the Solar System stable?** > > > You can see [this](https://en.wikipedia.org/wiki/Stability_of_the_Solar_System) Wikipedia page. In May 2015 I was at the conference of Cedric Villani at Sharif university of technology with this title: "Of planets, stars and eternity (stabilization and long-time behavi...
2015/07/04
[ "https://mathoverflow.net/questions/210779", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
Due to chaotic behaviour of the Solar System, it is not possible to precisely predict the evolution of the Solar System over 5 Gyr and the question of its long-term stability can only be answered in a statistical sense. For example, in <http://www.nature.com/nature/journal/v459/n7248/full/nature08096.html> (Existence o...
[This paper](http://iopscience.iop.org/0004-637X/683/2/1207/fulltext/) (Batyrin and Laughlin, 2008) seems to indicate that we are doomed.
210,779
> > **Is the Solar System stable?** > > > You can see [this](https://en.wikipedia.org/wiki/Stability_of_the_Solar_System) Wikipedia page. In May 2015 I was at the conference of Cedric Villani at Sharif university of technology with this title: "Of planets, stars and eternity (stabilization and long-time behavi...
2015/07/04
[ "https://mathoverflow.net/questions/210779", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
Due to chaotic behaviour of the Solar System, it is not possible to precisely predict the evolution of the Solar System over 5 Gyr and the question of its long-term stability can only be answered in a statistical sense. For example, in <http://www.nature.com/nature/journal/v459/n7248/full/nature08096.html> (Existence o...
in a conference in Paris, Jacques Féjoz said (and i quote from memory) that the big planets seem to be stable, while the small ones chaotic. if i remember well, it was based on numerical evidence, intuition and the known results on the stability of the planar many-body problem...
210,779
> > **Is the Solar System stable?** > > > You can see [this](https://en.wikipedia.org/wiki/Stability_of_the_Solar_System) Wikipedia page. In May 2015 I was at the conference of Cedric Villani at Sharif university of technology with this title: "Of planets, stars and eternity (stabilization and long-time behavi...
2015/07/04
[ "https://mathoverflow.net/questions/210779", "https://mathoverflow.net", "https://mathoverflow.net/users/-1/" ]
Due to chaotic behaviour of the Solar System, it is not possible to precisely predict the evolution of the Solar System over 5 Gyr and the question of its long-term stability can only be answered in a statistical sense. For example, in <http://www.nature.com/nature/journal/v459/n7248/full/nature08096.html> (Existence o...
The work of Wisdom is relevant (for example, see <http://rspa.royalsocietypublishing.org/content/413/1844/109.short>) but not conclusive. Numerical work suggests overall stability over very long time periods.
71,301,486
I am scraping and modifying content from a website. The website consists of broken images that I need to fix. My JSON looks something like this ``` [ { "post_title": "post 1", "post_link": "link 1", "post_date": "@1550725200", "post_content": [ "<p>Lorem ipsum dolor sit amet, consectetur adipis...
2022/02/28
[ "https://Stackoverflow.com/questions/71301486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17074732/" ]
Consider using the [`DOMParser`](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) utility to create a document from your html string. Then you can use the typical DOM methods (notably, `querySelectorAll`) to find the relevant elements and then to execute your replacement. Eg, something like: ``` const pars...
```js var arr = [ { "post_title": "post 1", "post_link": "link 1", "post_date": "@1550725200", "post_content": [ "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna <a href=\"somelink.com\">aliqua. Ut enim ad minim veniam, quis ...
618,483
I am using the `amsmath` package. My code is ``` \begin{center} \left $\begin{bmatrix} u_1 & u_2\\ u_3 & u_4 \end{bmatrix}$ \end{center} \begin{center} \right $\begin{bmatrix} u_1 & u_2\\ u_3 & u_4 \end{bmatrix}$ \end{center} ``` Thanks for any help!
2021/10/10
[ "https://tex.stackexchange.com/questions/618483", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/254367/" ]
* Please, always provide complete small document called MWE (Minimal Working Example) which reproduce your problem. * your question is not entirely clear, so I guess, that you after the following: [![enter image description here](https://i.stack.imgur.com/V6mKz.png)](https://i.stack.imgur.com/V6mKz.png) MWE: ``` \do...
I have created a minimal working example (with a comma between the two matrices) to have **the matrices on the same line in LaTeX.** However I would to use a small matrix when you use `$...$`. ``` \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb} \begin{document} Some $\begin{bmatrix} u_1 & u_2\\ ...
302,744
When using the Book module, is there any limit on the number of child items that can be added to a book parent node?
2021/04/28
[ "https://drupal.stackexchange.com/questions/302744", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/98004/" ]
Yes, books in Drupal 8 and 9 have a maximum depth of 9, which is the value of the [`BookManager::BOOK_MAX_DEPTH`](https://api.drupal.org/api/drupal/core%21modules%21book%21src%21BookManager.php/constant/BookManager%3A%3ABOOK_MAX_DEPTH/8.8.x) constant. ```php const BOOK_MAX_DEPTH = 9; ```
If your question isn't about the hierarchy levels but the number of nodes that can be added in any level here's a question and answer with a lot more information: [How to increase book weight range for a same-level chapters](https://drupal.stackexchange.com/questions/272952/how-to-increase-book-weight-range-for-a-same...
19,800,821
Before I debug my code, I would like to know why there's an error occurred when I call the function? It says "NameError: name 'stDigs' is not defined". I've tried using "avgUntilLetter(0123a)" and "avgUntilLetter("0123a")" but none of them works. Help me plz! This function receives as input one string containing digit...
2013/11/05
[ "https://Stackoverflow.com/questions/19800821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2958352/" ]
There are several problems in your code: 1. You can end up trying to access `stDigs[len(stDigs)]` because `num < len(stDigs)` might be true, but you then add 1 before using it as an index. 2. `sum(digits)` won't work because `digits` is a string. Just loop over the string *directly* instead of using a `while` loop, a...
The `TypeError` comes from this line: ``` avg = sum(digits)/len(digits) ``` because the one before it makes `digits` a string. And, you can't use `sum` on strings. You can fix your code by changing the above line to: ``` # `avg = float(sum(map(int, digits)))/len(digits)` if you are on Python 2.x avg = sum(map(int,...
19,800,821
Before I debug my code, I would like to know why there's an error occurred when I call the function? It says "NameError: name 'stDigs' is not defined". I've tried using "avgUntilLetter(0123a)" and "avgUntilLetter("0123a")" but none of them works. Help me plz! This function receives as input one string containing digit...
2013/11/05
[ "https://Stackoverflow.com/questions/19800821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2958352/" ]
There are several problems in your code: 1. You can end up trying to access `stDigs[len(stDigs)]` because `num < len(stDigs)` might be true, but you then add 1 before using it as an index. 2. `sum(digits)` won't work because `digits` is a string. Just loop over the string *directly* instead of using a `while` loop, a...
`stDigs` is not assigned to any value. ``` avgUntilLetter([]) stDigs = [] avgUntilLetter(stDigs) ``` In you case, it's a string, jsut set `stDigs` to a string first. ``` stDigs = "" avgUntilLetter(stDigs) ```
532,311
Say I have 2 continuous variables (x & y) in a logit model. I want to test the following hypotheses in the model: 1. For low values of x, increasing the value of y will increase the value of the response variable 2. For high values of x, increasing the value of y will decrease the value of the response variable Is th...
2021/06/26
[ "https://stats.stackexchange.com/questions/532311", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/223309/" ]
In my comment I wrote that you could model the kind of nonlinearity you describe with a model such as the below model, which incorporates a "multiplicative interaction term." $$\text{logit}({y\_i}) = \beta\_0 + \beta\_{x}x\_{i} + \beta\_{z}z\_{i} + \beta\_{xz}xz\_{i} + \varepsilon\_{i}$$ Consider such a model where: ...
It seems to me that you want: 1. A two-way interaction, $XZ$, between $X$ and $Z$. This will estimate the expected change in the response for a 1 unit change in $X$, when $Z$ also changes by 1 unit. 2. If you want this two-way interaction also to also vary with $X$ then you can interact the two-way interaction with $X...
532,311
Say I have 2 continuous variables (x & y) in a logit model. I want to test the following hypotheses in the model: 1. For low values of x, increasing the value of y will increase the value of the response variable 2. For high values of x, increasing the value of y will decrease the value of the response variable Is th...
2021/06/26
[ "https://stats.stackexchange.com/questions/532311", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/223309/" ]
In my comment I wrote that you could model the kind of nonlinearity you describe with a model such as the below model, which incorporates a "multiplicative interaction term." $$\text{logit}({y\_i}) = \beta\_0 + \beta\_{x}x\_{i} + \beta\_{z}z\_{i} + \beta\_{xz}xz\_{i} + \varepsilon\_{i}$$ Consider such a model where: ...
X1 = I(x>a) X2= I (x<b) Logit (Response ) = beta0 + betax \* x + betay \* x + betax1y \* X1 \* y + betax2y \* X2 \* y Then X1*y is activated when x is above a, X2* y when x is below b. You can exclude betay*y if you think that response is only through y*x terms. A and b are exogenous parameters in this model, so eit...
532,311
Say I have 2 continuous variables (x & y) in a logit model. I want to test the following hypotheses in the model: 1. For low values of x, increasing the value of y will increase the value of the response variable 2. For high values of x, increasing the value of y will decrease the value of the response variable Is th...
2021/06/26
[ "https://stats.stackexchange.com/questions/532311", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/223309/" ]
It seems to me that you want: 1. A two-way interaction, $XZ$, between $X$ and $Z$. This will estimate the expected change in the response for a 1 unit change in $X$, when $Z$ also changes by 1 unit. 2. If you want this two-way interaction also to also vary with $X$ then you can interact the two-way interaction with $X...
X1 = I(x>a) X2= I (x<b) Logit (Response ) = beta0 + betax \* x + betay \* x + betax1y \* X1 \* y + betax2y \* X2 \* y Then X1*y is activated when x is above a, X2* y when x is below b. You can exclude betay*y if you think that response is only through y*x terms. A and b are exogenous parameters in this model, so eit...
64,526,055
I am currently setting up a project that is based on Python Flask (with Flask Migrate) with a PostgreSQL DB. I am working in a small team and have some questions regarding database updates. As far as I am aware, If I update the database schema in Flask, I will have to perform a `flask db migrate` and `flask db upgrade...
2020/10/25
[ "https://Stackoverflow.com/questions/64526055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10448741/" ]
To understand your error, you have to know what strings are. Strings in java are arrays of char: ``` char[] example = {'H', 'E', 'L', 'L', 'O'); ``` You can manipulate strings in a similar why to arrays. Arrays first index is 0 and max Index length - 1 Let now assume the above example is an instance of String and ...
You can also use a condition to take care of out of bounds e.g. ``` <span th:if="${post.content.length()>17}"> <span th:utext="${#strings.substring(post.content,0,17)}"></span> </span> <span th:if="${post.content.length()<17}"> <span th:utext="${#strings.substring(post.content,0,post.content.length...
13,956,983
Here is the website I'm working on: I can get the image not to stretch by removing height: 481px; but then I lose the caption and squares below the image and it moves around if the images are different heights. I've tried messing around with positioning, but I haven't found a solution.
2012/12/19
[ "https://Stackoverflow.com/questions/13956983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/753250/" ]
There are several ways you can solve this. A cleaner solution, as @Sven pointed out, would be to use the tag `<div>` instead of `<img>` and use the images as `background` for the div. Or, you can use the CCS clip property to crop all your images to the same size, while maintaining their original proportions: ``` im...
Well, if images don't have the same proportion, no matter what you do, you'll never get different image sizes fit perfectly in the same spot. so, what do you want?
58,979
I'm looking at a [bike for sale](https://www.likessale.com/index.php?route=product/product&product_id=1&path=1_2) on Likessale. It seems way too good to be true, based on a [Google search](https://www.google.com/search?rlz=1C1CHBF_enUS713US714&biw=1920&bih=969&tbm=shop&ei=yu1EXKutG4bI_QaqyYSQBA&q=Diamond%20Release%205%...
2019/01/20
[ "https://bicycles.stackexchange.com/questions/58979", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/40943/" ]
I'm confident to call it a scam. The same bike is on Amazon for $2162 to $3856 USD. [https://www.amazon.com/Diamondback-Bicycles-Podium-Vitesse-Carbon/dp/B01HHQ1BWA/ref=pd\_lpo\_sbs\_200\_t\_1](https://rads.stackoverflow.com/amzn/click/B01HHQ1BWA) Manufacturer gives it a MSRP of $3700 USD. To expect to pay 5% of...
Don't give money to likesale.com. I made a purchase on 18 January 2019 and I should've done some research before. I also wondered how they could have reviews posted from september when the site is only a week old. I've emailed the website and even sent an email to the owner email address provided through the domain i...
58,979
I'm looking at a [bike for sale](https://www.likessale.com/index.php?route=product/product&product_id=1&path=1_2) on Likessale. It seems way too good to be true, based on a [Google search](https://www.google.com/search?rlz=1C1CHBF_enUS713US714&biw=1920&bih=969&tbm=shop&ei=yu1EXKutG4bI_QaqyYSQBA&q=Diamond%20Release%205%...
2019/01/20
[ "https://bicycles.stackexchange.com/questions/58979", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/40943/" ]
I'm confident to call it a scam. The same bike is on Amazon for $2162 to $3856 USD. [https://www.amazon.com/Diamondback-Bicycles-Podium-Vitesse-Carbon/dp/B01HHQ1BWA/ref=pd\_lpo\_sbs\_200\_t\_1](https://rads.stackoverflow.com/amzn/click/B01HHQ1BWA) Manufacturer gives it a MSRP of $3700 USD. To expect to pay 5% of...
I also made an online purchase two weeks ago and I've not received the product or shipping information to track the delivery. I've not received replies to my emails and I don't have telephone numbers. If somebody knows what I can do, please tell me. --- This post was originally made in Spanish, as follows. Yo tambie...
1,051,944
I have been using AWS SES for a year now for my SaaS. I added DKIM, SPF and DMARC. Yet some people are still not receiving emails. I provide instructions for them to add my domain to their safe senders list. That seems to resolve it. I would like to avoid end-users having to do that. I am wondering if using a dedicate...
2021/02/01
[ "https://serverfault.com/questions/1051944", "https://serverfault.com", "https://serverfault.com/users/615222/" ]
Yes, technically you can modify files in the underling volume, but Gluster will **not** be notified about your changes, and therefore they may not be replicated to other Gluster nodes. This is **very much not recommended**, and could mean that your servers end up with different underlying files, which can lead to unpr...
Once I have several files copied directly to the brick, is there any way to make Gluster be aware about those new files?
38,882,128
So here's what I'm trying to accomplish: I have a client facing page that loads, and when that happens I automatically run a series of 4 quick tests, if any of those tests fail I update the HCresults variable. .aspx ``` <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <script language="j...
2016/08/10
[ "https://Stackoverflow.com/questions/38882128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2993239/" ]
You can write a webmethod in your code behind; pseudo code: ``` public static var HCresultsCS; [webmethod] public static void grabHCresults(var HCresultsfromJS) { HCresultsCS= HCresultsfromJS; } ``` make an AJAX post to this webmethod with HCresults you're setting on a test failure as parameter; Access the HCresul...
Unfortunately not using JS, you can store the value in a `hiddenfield` however to retrieve in C#. Make sure that you set the attribute `runat = "server"` for the control. I should also mention you'll use `element.value = value` to assign the value.
20,671,989
I've just just recently begun to learn how to write Javascript, started a few weeks ago. Right now I'm working on making an interactive story. The way I've been planning on making the story is having the user answer a prompt question, and the answer to the prompt will trigger the next part of the story to be shown in a...
2013/12/19
[ "https://Stackoverflow.com/questions/20671989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3117439/" ]
Given that there is no code to reference, here's a mock-up example: ``` document.getElementById("myTextArea").value = prompt("Foo?"); ``` Assuming you would have a textarea like this ``` <textarea id="myTextArea"></textarea> ``` its text would then be set to whatever the user entered, for instance, ``` bar ``` ...
If all you're doing is putting story information in the `textarea` then you shouldn't be using it, just use a `div` instead and put the story text in there. Have the div initially set to `display: none` and once they get the question right, set it to `display: block` using JS!
22,926,466
I have a verry unusual problem, none of my static files are loaded `404` is thrown. To note, I use my production environment with `DEBUG=False` set so the static files are entirely served by the `nginx` server. > > settings/production.py > > > ``` STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') STATIC_URL = '/...
2014/04/08
[ "https://Stackoverflow.com/questions/22926466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1389448/" ]
OK, the problem is that `Django's` static files are served by default from `www.myapp.com/static/` folder so there is no reason specifying the `/static/` folder in the `nginx` configuration file. So if anyone else has the same problem, just remove the following part from `nginx/sites-enabled/myapp` file: ``` location ...
Have you ran python manage.py collectstatic on your server? Make sure the file is in the static root directory.
53,835,266
I new in MXGraph usage (by javascript) and I'm trying to drag and drop an image (png) from toolbar. Starting from toolbar.html example I able to add a new icon in the toolbar but I don't how to add a custom image in the graph. Could anyone tell me how I can do it?
2018/12/18
[ "https://Stackoverflow.com/questions/53835266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6283217/" ]
Here is the code sample to add icons/images in sidebar and create drag and drop source. 1. Call function to set Image source and Labels/Html. ``` // Adds sidebar icons. // // NOTE: For non-HTML labels a simple string as the third argument // and the alternative style as shown in conf...
This worked for me: ``` addVertex('static/images/Icon_Image.svg', 30, 40, 'shape=image;image=static/images/Icon_Image.svg;'); ``` where, addVertex function has the syntax function(icon, w, h, style) with var vertex = new mxCell(null, new mxGeometry(0, 0, w, h), style); Reference: source code of <https://jgraph.gith...
67,174,874
I am calling a fortran function sgesv() of lapack library for solving linear equations for unknown vector from my CUDA C routine. As per the general rule I am declaring the function as sgesv\_() and invoking it in the main() function passing the variables by reference. I am following the commands to compile and execute...
2021/04/20
[ "https://Stackoverflow.com/questions/67174874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15068888/" ]
I believe you might have hit this issue [#861878 nvidia-cuda-toolkit: nvcc needs to pass -fpie to compiler](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861878). The proposed solution is to use `nvcc --compiler-options -fpie` but see also the respones and other points. It is important to consider your versions of...
Couple of things/findings: `nvcc --compiler-options -fpie` is the right syntax and it did resolve the issue. @VladimirF thank you for providing that answer for me. extern "C" ... declaration also required for compiling and executing for as \*.cu. However, declaration is not needed at all rather it is redundant for com...
73,428,442
I need to get the absolute path of a file in python, i already tried `os.path.abspath(filename)` in my code like this: ```py def encrypt(filename): with open(filename, 'rb') as toencrypt: content = toencrypt.read() content = Fernet(key).encrypt(content) with open(filename, "wb") as toencrypt: t...
2022/08/20
[ "https://Stackoverflow.com/questions/73428442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19400931/" ]
If you want to control something over time in Pygame you have two options: 1. Use [`pygame.time.get_ticks()`](https://www.pygame.org/docs/ref/time.html#pygame.time.get_ticks) to measure time and and implement logic that controls the object depending on the time. 2. Use the timer event. Use [`pygame.time.set_timer()`](...
You could try making spawn\_ship async, then use a thread so it doesn't affect the main loop ```py import threading def main(): threading.Timer(5.0, spawn_ship).start() async def spawn_ship(): # ... ```
31,952,948
I am new to Swift and I want to know how to dismiss the current view controller and go to another view. My storyboard is like the following: MainMenuView -> GameViewController -> GameOverView. I want to dismiss the GameViewController to go to the GameOverView, not to the MainMenuView. I use the following code in my M...
2015/08/11
[ "https://Stackoverflow.com/questions/31952948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4724949/" ]
What you can do is let the `GameOverView` be presented, after all when you presenting it the `GameViewController` is below in the hierarchy, and then in your `GameOverView` run the following code to close both when you want to dismiss the `GameOverView`, like in the following way: ``` @IBAction func ReturnMainMenu(sen...
The below code will take you to the main VC, Here's a tried and tested piece of code. ``` self.view.window!.rootViewController?.dismiss(animated: false, completion: nil) ```