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 |
|---|---|---|---|---|---|
769,854 | I am executing `dir /q` on a Windows server 2008r2 and what I get back for one of the folders is `...` What does it mean?
```
2014-06-11 16:32 <KAT> ... AFolder
2014-06-03 16:17 <KAT> MyDomain\AUser AnotherFolder
```
My guess is that is somehow has to do with inheritance but can'... | 2014/06/17 | [
"https://superuser.com/questions/769854",
"https://superuser.com",
"https://superuser.com/users/129732/"
] | A disk with bad sectors is not reliable. Modern disks have the capacity to transparently map out a handful of bad sectors -- as many as are deemed acceptable in terms of manufacturing defects, etc. When the number of bad sectors exceeds that value, it means that the disk is on its last legs. Although the disk *might* l... | As far as I know what can be programmatically blocked, can later be programmatically unblocked provided user has enough technical knowledge and spare time.
Any software method you will use to block the corrupt area of the disk can later be overridden.
If you hide the partition using DiskPart, your friend can use Disk... |
769,854 | I am executing `dir /q` on a Windows server 2008r2 and what I get back for one of the folders is `...` What does it mean?
```
2014-06-11 16:32 <KAT> ... AFolder
2014-06-03 16:17 <KAT> MyDomain\AUser AnotherFolder
```
My guess is that is somehow has to do with inheritance but can'... | 2014/06/17 | [
"https://superuser.com/questions/769854",
"https://superuser.com",
"https://superuser.com/users/129732/"
] | You can indeed *hide* those sectors, but that won't prevent the disk to **continue failing**. You can create a new partition table, which effectively wipes all the information on the drive, and make a partition that **starts at 20GB** and goes up to the end of the disk, but **there's no way** to prevent your friend to ... | As far as I know what can be programmatically blocked, can later be programmatically unblocked provided user has enough technical knowledge and spare time.
Any software method you will use to block the corrupt area of the disk can later be overridden.
If you hide the partition using DiskPart, your friend can use Disk... |
46,876,901 | I just don't get it right. How do I center *list items* inside the `ul`?
```css
body {margin: 0}
ul {
width: 1000px;
margin: 0 auto;
padding: 0;
list-style-type: none;
margin-top: 30px;
overflow: hidden;
background-color: #333;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
... | 2017/10/22 | [
"https://Stackoverflow.com/questions/46876901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5853817/"
] | You can use the `location` prop to access the state you have passed. Visit [React-Router](https://reacttraining.com/react-router/web/api/location) for reference. When you want to access that state, you can do it by `this.props.location.state`. | you can access state using `this.props.location.state` |
46,876,901 | I just don't get it right. How do I center *list items* inside the `ul`?
```css
body {margin: 0}
ul {
width: 1000px;
margin: 0 auto;
padding: 0;
list-style-type: none;
margin-top: 30px;
overflow: hidden;
background-color: #333;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
... | 2017/10/22 | [
"https://Stackoverflow.com/questions/46876901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5853817/"
] | You can use the `location` prop to access the state you have passed. Visit [React-Router](https://reacttraining.com/react-router/web/api/location) for reference. When you want to access that state, you can do it by `this.props.location.state`. | If you're using React hooks you can use `useLocation` hook.
```
import { useLocation } from 'react-router-dom';
export const MyComponent = () => {
const { state } = useLocation();
...
}
``` |
46,876,901 | I just don't get it right. How do I center *list items* inside the `ul`?
```css
body {margin: 0}
ul {
width: 1000px;
margin: 0 auto;
padding: 0;
list-style-type: none;
margin-top: 30px;
overflow: hidden;
background-color: #333;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
... | 2017/10/22 | [
"https://Stackoverflow.com/questions/46876901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5853817/"
] | If you're using React hooks you can use `useLocation` hook.
```
import { useLocation } from 'react-router-dom';
export const MyComponent = () => {
const { state } = useLocation();
...
}
``` | you can access state using `this.props.location.state` |
15,740,802 | I want each JButton to also have a number or id associated with it. That is why I decided to extend the JButton class to make a class SuperJButton.
How do I include the value of the id/number in the action event generated when this button is clicked so that the class which responds to this action can access the id ? | 2013/04/01 | [
"https://Stackoverflow.com/questions/15740802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1667147/"
] | Another alternative which doesn't require sub-classing, could be to use `JComponent.putClientProperty(Object key, Object value)` to store the ID associated with your button.
It can be retrieved using `getClientProperty(Object key)`.
```
public void actionPerformed(ActionEvent e)
{
JComponent comp = (JComponent)e... | You don't have to change the Action event.You can do this,
```
SuperJButton jButton = (SuperJButton) actionEvent.getSource();
jButton.getId()
jButton.getNumber()
``` |
15,740,802 | I want each JButton to also have a number or id associated with it. That is why I decided to extend the JButton class to make a class SuperJButton.
How do I include the value of the id/number in the action event generated when this button is clicked so that the class which responds to this action can access the id ? | 2013/04/01 | [
"https://Stackoverflow.com/questions/15740802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1667147/"
] | You don't have to change the Action event.You can do this,
```
SuperJButton jButton = (SuperJButton) actionEvent.getSource();
jButton.getId()
jButton.getNumber()
``` | From `MVC` point of view: `JButton` is a `view`, and `JButton` class is not better place to something like `id`. Much better place for an id is in your own `ButtonModel` implementation. |
15,740,802 | I want each JButton to also have a number or id associated with it. That is why I decided to extend the JButton class to make a class SuperJButton.
How do I include the value of the id/number in the action event generated when this button is clicked so that the class which responds to this action can access the id ? | 2013/04/01 | [
"https://Stackoverflow.com/questions/15740802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1667147/"
] | Another alternative which doesn't require sub-classing, could be to use `JComponent.putClientProperty(Object key, Object value)` to store the ID associated with your button.
It can be retrieved using `getClientProperty(Object key)`.
```
public void actionPerformed(ActionEvent e)
{
JComponent comp = (JComponent)e... | From `MVC` point of view: `JButton` is a `view`, and `JButton` class is not better place to something like `id`. Much better place for an id is in your own `ButtonModel` implementation. |
225,691 | Is it possible to separate the email hosting for my domain into a couple of different hosts?
For example `company.com` has emails going to Google (apps for business) and Microsoft Online Services (exchange). `Employee A's` inbox is at *Microsoft online services* as `a@company.com` while `Employee B's` inbox is at *Goo... | 2011/01/23 | [
"https://serverfault.com/questions/225691",
"https://serverfault.com",
"https://serverfault.com/users/7330/"
] | This is possible, but not completely independently.
You need to have one primary mail provider which accepts all of your mail.
Then configure mailboxes there to forward emails to another account.
For example, set up company.com at Google, and a new domain, company.net at Microsoft.
Have Google forward all emails for b... | The most simple solution when using Google Apps (like in your case) is to enable dual delivery in Google Apps.
* More details here: <http://www.google.com/support/a/bin/answer.py?hl=en&answer=96855> |
23,560,845 | Is it possible to access beans defined outside of the step scope? For example, if I define a strategy "strategyA" and pass it in the job parameters I would like the @Value to resolve to the strategyA bean. Is this possible? I am currently working round the problem by getting the bean manually from the applicationContex... | 2014/05/09 | [
"https://Stackoverflow.com/questions/23560845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/318381/"
] | The sort answer is yes. This is more general spring/design pattern issue rater then Spring Batch.
The Spring Batch tricky parts are the configuration and understanding scope of bean creation.
Let’s assume all your Strategies implement Strategy interface that looks like:
```
interface Strategy {
int execute(... | `jobParameters` is holding just a String object and not the real object (and I think is not a good pratice store a bean definition into parameters).
I'll move in this way:
```
@Bean
@StepScope
class MyStategyHolder {
private MyCustomClass myStrategy;
// Add get/set
@BeforeJob
void beforeJob(JobExecut... |
59,437,973 | An aspx page is loaded up inside a modal using Kendo Dialog for angular.
Intended behaviour for this page is once it is generated it opens the print dialogue. The output of that printing action should be the aspx page. It is so when printed from Chrome/Firefox but IE11 prints only a part of the page behind the actual ... | 2019/12/21 | [
"https://Stackoverflow.com/questions/59437973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10056183/"
] | The client credentials flow is described in the OAuth2 [RFC-6749](https://www.rfc-editor.org/rfc/rfc6749#section-4.4). The client id and secret are base64 encoded in a Basic authentication scheme as described in [RFC-7617](https://www.rfc-editor.org/rfc/rfc7617)
You should be able to get a token using Python code like... | When using the previous response I can obtain a token. (Thanks a lot for your answer)
So I tried :
```
myUrl = 'http://ops.epo.org/3.2/rest-services/register/publication/EPODOC/EP2814089/biblio'
header = {'PRIVATE-TOKEN': myToken}
response = requests.get(myUrl, headers=header)
print(response.text)
```
but I obtain... |
51,133,101 | My question is simple is a UI/UX design question. I want to get this model for my layout [](https://i.stack.imgur.com/S0U73.jpg)
I have no idea how is this called, want some help and idea for coding this one I tried few options but nothing. | 2018/07/02 | [
"https://Stackoverflow.com/questions/51133101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9412929/"
] | To create this above layout You can use either of FrameLayout or Co-ordinator Layout or the new ConstraintLayout.
This will do it for you.
[Refer this link to understand the above design.](https://github.com/hi-manshu/CryptoKoin/blob/master/app/src/main/res/layout/activity_main.xml)
```
<RelativeLayout xmlns:andr... | Try using a Relative Layout for the image & recycler view and put the recycler view in cardview. This should work for 1st & 2nd view & in 3rd inside a cardview add a calendar & a recycler view below it. Hope this helps |
29,192,219 | How do I store the user input into the Insert VALUES of the two html form values?
In the last line of the script VALUES doesn't store these from form
```
<?php
error_reporting(0);
require 'connectit.php';
mysqli_query($db, "INSERT INTO bills (bill_name, bill_cost)
VALUES ($_POST['bill_name'], $_POST['bill_cost'])";
?>... | 2015/03/22 | [
"https://Stackoverflow.com/questions/29192219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4609277/"
] | I would suggest starting by breaking down the question into smaller pieces.
The question asks for a method to calculate an employees pay, so that seems like a reasonable place to start. The question gives you the name of the method and what parameters it should take:
>
> ...a method called pay that accepts two parame... | Answer with code is like this,
```
public class PayJava {
public static void main(String[] argv) {
PayJava test = new PayJava();
double pay = test.pay(5.2,5);
System.out.println("Pay 1= " + pay);
pay = test.pay(4.00, 11);
System.out.println("Pay 2= " + pay);
pay = test.pay(5.50, 6);
... |
310,991 | In my previous question [question](https://electronics.stackexchange.com/questions/310899/midi-out-thru-circuit-questions#310968) I learnt I have to use inductor beads, which is also according to the MIDI specs, see below
[](https://i.stack.imgur.com/... | 2017/06/14 | [
"https://electronics.stackexchange.com/questions/310991",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/140343/"
] | Apart from the fact that a coil across the emitter resistor completely alters the dc quiescent point of your transistor you have to think about what the input impedance is looking into the emitter.
You are driving a current through the collector that is quite high because the base bias is a single pull up resistor. Wi... | This is not a useful circuit:
[](https://i.stack.imgur.com/lvmFp.gif)
1. A coil connected across R3 will mess up the DC bias point by shorting the emitter to ground.
- Even if the coil were AC coupled, the bias point is indeterminate since it depends highly on the gain of Q1.
... |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | It seems you only have one `?` in your statement, so you can't make a reference to the second index (2) in the `functionalCRsStatement.setString(2, x);`, because as it says, it's out of range.
you should use
```
functionalCRsStatement.setString(1, x);
``` | You have only one parameter to set in your prepared statement. the set method to set parameter in prepared statement checks index of the `?` in the prepared statement and sets the value to prepared statement accordingly.
So in your case there is only 1 `?` so in an array of values to be passed for prepared statement i... |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | It seems you only have one `?` in your statement, so you can't make a reference to the second index (2) in the `functionalCRsStatement.setString(2, x);`, because as it says, it's out of range.
you should use
```
functionalCRsStatement.setString(1, x);
``` | The prepared statement is not recognizing any param, for is this query contains 0 params because of mal-written string; try this :
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(APRPRD," +
"'Select X , Y, Z, A from D r" +
"INNER JOIN E c" +
"ON r.RNID =... |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | As @JonK commented, you have apostrophes in your query, which means your parameter is actually inside a string where the SQL engine won't bind a value (whether you use 1 or 2 as the index):
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(APRPRD,\n" +
"\t'Select X ,... | It seems you only have one `?` in your statement, so you can't make a reference to the second index (2) in the `functionalCRsStatement.setString(2, x);`, because as it says, it's out of range.
you should use
```
functionalCRsStatement.setString(1, x);
``` |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | You have only one bind variable placeholder (`?`) in your query - so you should bind it with an index of `1`, not `2`:
```
functionalCRsStatement.setString(1, x); // Was 2 in the OP
``` | You have only one parameter to set in your prepared statement. the set method to set parameter in prepared statement checks index of the `?` in the prepared statement and sets the value to prepared statement accordingly.
So in your case there is only 1 `?` so in an array of values to be passed for prepared statement i... |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | You have only one bind variable placeholder (`?`) in your query - so you should bind it with an index of `1`, not `2`:
```
functionalCRsStatement.setString(1, x); // Was 2 in the OP
``` | The prepared statement is not recognizing any param, for is this query contains 0 params because of mal-written string; try this :
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(APRPRD," +
"'Select X , Y, Z, A from D r" +
"INNER JOIN E c" +
"ON r.RNID =... |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | As @JonK commented, you have apostrophes in your query, which means your parameter is actually inside a string where the SQL engine won't bind a value (whether you use 1 or 2 as the index):
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(APRPRD,\n" +
"\t'Select X ,... | You have only one bind variable placeholder (`?`) in your query - so you should bind it with an index of `1`, not `2`:
```
functionalCRsStatement.setString(1, x); // Was 2 in the OP
``` |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | As @JonK commented, you have apostrophes in your query, which means your parameter is actually inside a string where the SQL engine won't bind a value (whether you use 1 or 2 as the index):
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(APRPRD,\n" +
"\t'Select X ,... | You have only one parameter to set in your prepared statement. the set method to set parameter in prepared statement checks index of the `?` in the prepared statement and sets the value to prepared statement accordingly.
So in your case there is only 1 `?` so in an array of values to be passed for prepared statement i... |
38,655,215 | I'm trying to execute a `SQL` query using a Java `PreparedStatement` in Java 7 using the code below:
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(SERVER,\n" +
"\t'Select X , Y, Z, A from D r\n" +
"\tINNER JOIN E c\n" +
"\tON r.RNID = c.RNID\n" +
"\... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38655215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6556658/"
] | As @JonK commented, you have apostrophes in your query, which means your parameter is actually inside a string where the SQL engine won't bind a value (whether you use 1 or 2 as the index):
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(APRPRD,\n" +
"\t'Select X ,... | The prepared statement is not recognizing any param, for is this query contains 0 params because of mal-written string; try this :
```
PreparedStatement functionalCRsStatement = con.prepareStatement(
"select * from openquery(APRPRD," +
"'Select X , Y, Z, A from D r" +
"INNER JOIN E c" +
"ON r.RNID =... |
5,970,491 | Here is my case:
I have a MongoDB collection in Node.Js.
Let's say three elements: **a, b, c** I want to insert new element as the first one and want the last one to go out.
So it would be:
**d, a, b**
In next iteration:
**e, d, a**
1.How to do that kind of insetion?
2.Is there a chance to listen for those insetio... | 2011/05/11 | [
"https://Stackoverflow.com/questions/5970491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/591939/"
] | 1. [Capped collections](http://www.mongodb.org/display/DOCS/Capped+Collections) in MongoDB preserve insertion order and discard the oldest items based on the total collection size (unfortunately measured in bytes). Seems like ideal fit for your scenario.
2. I believe there is no trigger/notification mechanism in MongoD... | Another way to handle this would be to write a custom Queue object that would dequeue the last item when a new item was enqueued if the total number of items in the queue exceeded your requirements, and emit an 'item added' event that other parts of your application could listen for.
Here's some generic example code ... |
38,659,717 | I have the following code. Is there a better way to write it. It feels like when conditions and promises and querying from multiple tables are involved, the code becomes harder to read. Any help would be appreciated. Thanks!
```
fetchUserById = function (id) {
var user = {};
return knex_instance('user_info')
... | 2016/07/29 | [
"https://Stackoverflow.com/questions/38659717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123132/"
] | A `ScrollPane` stores its single child in the [`contentProperty`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/ScrollPane.html#contentProperty):
>
> The node used as the content of this ScrollPane.
>
>
>
Therefore corrected code is:
```
scrollPaneIdFx.setContent(imageViewIdFx);
```
In case ... | There is only a single "child" you should add to a `ScrollPane`: the [`content`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/ScrollPane.html#contentProperty). If you want a `ScrollPane` that contains multiple `Node`s, add them to a suitable `Parent` (e.g. a `Pane`) and use this `Parent` as content ... |
70,188 | Most books I find on German grammar are precriptive in the sense that they try to describe Grammar by giving some rules. This approaches make the amount of thinking required the language less , but, I personally am also interested in the descriptive way which tries to form a general theory on what constitutes a meaning... | 2022/04/04 | [
"https://german.stackexchange.com/questions/70188",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/51342/"
] | The ultimate descriptive grammar of German (in English) may be Peter Jørgensen's *German Grammar*, translated by G. Kolisko and published by Heinemann in the years 1959-1966. This is now out of print, so you may need to go to a nearby university library, e.g. those included in WorldCat: [Volume 1](https://www.worldcat.... | You might try: "Deskriptive Linguistik. Grundlagen und Methoden" by Michael Dürr and Peter Schlobinski; Vandenhoeck & Ruprecht, Göttingen, 2006, ISBN: 978-3525265185 |
70,188 | Most books I find on German grammar are precriptive in the sense that they try to describe Grammar by giving some rules. This approaches make the amount of thinking required the language less , but, I personally am also interested in the descriptive way which tries to form a general theory on what constitutes a meaning... | 2022/04/04 | [
"https://german.stackexchange.com/questions/70188",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/51342/"
] | The ultimate descriptive grammar of German (in English) may be Peter Jørgensen's *German Grammar*, translated by G. Kolisko and published by Heinemann in the years 1959-1966. This is now out of print, so you may need to go to a nearby university library, e.g. those included in WorldCat: [Volume 1](https://www.worldcat.... | It is not heavily theoretical, but Helbig/Buscha: "Deutsche Grammatik: ein Handbuch für den Ausländerunterricht" (Klett) is very descriptive. Many examples and exceptions are listed. It's German, though. |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | I think it would not change much in modern warfare, as the current trend is less based on infantry combat. They would improve the existent uses of shields in military and police activity, but not change the tactics, as most tactics involve long distance, high-tech (drones), or explosive power. So it would just be used ... | Everything old becomes new again.
Your invention would bring back the use of mustard gas and other airborne poisons on the battlefield. |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | The military doesn't supply everyone with the new hotness shield because some infantry will be slowed down by it. In WW2 soldier packs were supposedly already 90lbs. Do you seriously think that an infantryman wants to carry another 40lbs of cover with them at all times? That's 130lbs.. Weight is heavy.
Right now the ... | If such shields were adopted, the result would simply be wider usage of mortars and automatic grenade launchers. Mortar bombs can explode behind or above a warfighter as well as before him, thus negating the shield. Grenades just plain destroy the shield and kill its user. |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | I think it would not change much in modern warfare, as the current trend is less based on infantry combat. They would improve the existent uses of shields in military and police activity, but not change the tactics, as most tactics involve long distance, high-tech (drones), or explosive power. So it would just be used ... | The weapons you describe as being effective against the shields all have a large energetic yield. Then an obvious trend would be to develop weapons that deliver the same kind of impact but are smaller, cheaper and less messy on the battlefield.
Super-sniper rifles might be the order of the day. |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | Everything old becomes new again.
Your invention would bring back the use of mustard gas and other airborne poisons on the battlefield. | A human being is weak and fleshy, and is limited to converting 3000 Calories into energy per day.
A motorcycle engine can convert 6000 Calories into energy per hour.
A high speed tankette is probably what you're going to end up with.
Not Roman Captain America.
<https://en.wikipedia.org/wiki/Tankette> |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | I think it would not change much in modern warfare, as the current trend is less based on infantry combat. They would improve the existent uses of shields in military and police activity, but not change the tactics, as most tactics involve long distance, high-tech (drones), or explosive power. So it would just be used ... | If such shields were adopted, the result would simply be wider usage of mortars and automatic grenade launchers. Mortar bombs can explode behind or above a warfighter as well as before him, thus negating the shield. Grenades just plain destroy the shield and kill its user. |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | I think it would not change much in modern warfare, as the current trend is less based on infantry combat. They would improve the existent uses of shields in military and police activity, but not change the tactics, as most tactics involve long distance, high-tech (drones), or explosive power. So it would just be used ... | The military doesn't supply everyone with the new hotness shield because some infantry will be slowed down by it. In WW2 soldier packs were supposedly already 90lbs. Do you seriously think that an infantryman wants to carry another 40lbs of cover with them at all times? That's 130lbs.. Weight is heavy.
Right now the ... |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | Shield-equipped troops, so safe against rifle bullets, meet the device called a "land mine".
Shield-equipped troops, glad you're protected against shrapnel from exploding artillery rounds. Let us introduce you to this thing called "blast wave". Or better yet, this thing called "airburst".
Shield-equipped troops, glad... | If such shields were adopted, the result would simply be wider usage of mortars and automatic grenade launchers. Mortar bombs can explode behind or above a warfighter as well as before him, thus negating the shield. Grenades just plain destroy the shield and kill its user. |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | I think it would not change much in modern warfare, as the current trend is less based on infantry combat. They would improve the existent uses of shields in military and police activity, but not change the tactics, as most tactics involve long distance, high-tech (drones), or explosive power. So it would just be used ... | A human being is weak and fleshy, and is limited to converting 3000 Calories into energy per day.
A motorcycle engine can convert 6000 Calories into energy per hour.
A high speed tankette is probably what you're going to end up with.
Not Roman Captain America.
<https://en.wikipedia.org/wiki/Tankette> |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | Everything old becomes new again.
Your invention would bring back the use of mustard gas and other airborne poisons on the battlefield. | If such shields were adopted, the result would simply be wider usage of mortars and automatic grenade launchers. Mortar bombs can explode behind or above a warfighter as well as before him, thus negating the shield. Grenades just plain destroy the shield and kill its user. |
96,883 | Humans have finally developed a shield completely made out of handwavium. Hurrah! This shield is unbreakable except to anti-tank rounds, RPGS, and other heavy weapons. Assuming the army could afford giving half of their troops handwavium shields, how would this change how modern (2017) infantry moves and takes cover? A... | 2017/11/03 | [
"https://worldbuilding.stackexchange.com/questions/96883",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/44220/"
] | I think it would not change much in modern warfare, as the current trend is less based on infantry combat. They would improve the existent uses of shields in military and police activity, but not change the tactics, as most tactics involve long distance, high-tech (drones), or explosive power. So it would just be used ... | A 40 lb shield on top of the average **45 lb pack** the infantry is already carrying around would be too much of a burden for most soldiers. Since its made out of handwavium, you could make it a lot lighter.
In addition, the bulk of a tower shield is way too much; and for most soldiers bunkered down in the line of fir... |
43,860,679 | I am performing some reordering in a couple of array list, I have an adapter called
>
> adapterMeasureEvi
>
>
>
which is set to a static `ArrayList` called `measureEviArray` from `DataIpat` class.
When debugging I can see that the static list is been assigned properly and it follows a notification to the adapte... | 2017/05/09 | [
"https://Stackoverflow.com/questions/43860679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4910896/"
] | MarkLogic 8 currently caches `user data` at `/var/local/mlcmd.conf`. The documentation says `usr/local/mlcmd.conf`. (<https://docs.marklogic.com/8.0/guide/ec2/CloudFormation>)
`/etc/sysconfig/MarkLogic` runs `init-config.sh` (I couldn't find the path of that file), which is said in a comment to write to `/var/local/ml... | MarkLogic does not 'cache user-data'. The scripts referenced (/opt/MarkLogic/mlcmd/\*) do read from user-data, as well as other configuration sources such as /etc/marklogic.conf. What is 'cached' in /var/local/mlcmd.conf is the resolved values of the variables documented in <https://docs.marklogic.com/8.0/guide/ec2/Clo... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | >
> a Pollyanna
>
>
>
is a
>
> [person characterized by irrepressible optimism and a tendency to find good in everything](https://www.merriam-webster.com/dictionary/Pollyanna) or pollyannish, after the title character of a novel displaying such properties.
>
>
>
Machiavellian isn't necessarily malevolent or ... | **Lincolnian**
Abraham Lincoln was a moral and virtous leader, but also a strategic and cunning commander in chief. He assembled a “team of rivals”, which indicates a willingness to entertain opposing viewpoints as well as the involvement of others in decision-making. With fortitude, political savvy, and moral rectitu... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | "Christlike", as people of the Christian persuasion would often argue that Jesus Christ's leadership style is that of self sacrifice and love.
Note that skeptics might argue that a strong theme underlying this claimed virtuosity is the threat of eternal damnation for those who refuse to follow Him (thereby, being iron... | Jeffersonian
From Dictionary.com:
pertaining to or advocating the political principles and doctrines of Thomas Jefferson, especially those stressing minimum control by the central government, the inalienable rights of the individual, and the superiority of an agrarian economy and rural society. |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | "Christlike", as people of the Christian persuasion would often argue that Jesus Christ's leadership style is that of self sacrifice and love.
Note that skeptics might argue that a strong theme underlying this claimed virtuosity is the threat of eternal damnation for those who refuse to follow Him (thereby, being iron... | Strictly speaking, we are looking for the antonym of a writer, who advised a prince, or wrote in that form. That rules out many of the candidates so far. The writer has to be a household word for the ideas s/he put forward, as is M. That rules out many of the candidates so far. Churchill, Mandela and Ghandi were politi... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | Before we can suggest terms that might stand as opposites to *Machiavellian*, we need to nail down what people mean by that term. Here is the entry for *Machiavellian* in *Merriam-Webster's Eleventh Collegiate Dictionary* (2003):
>
> **Machiavellian** *adj.* {Niccolo *Machiavelli*} (1572) **1 :** of or relating to Ma... | One option is **Confucian**. What constitutes good government is an essential question with which Confucian thought concerns itself, and its methods and foundations are the opposite of your "Machiavellian": Confucianism emphasises that human nature is fundamentally good, that one must practice virtue in daily life, and... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | Before we can suggest terms that might stand as opposites to *Machiavellian*, we need to nail down what people mean by that term. Here is the entry for *Machiavellian* in *Merriam-Webster's Eleventh Collegiate Dictionary* (2003):
>
> **Machiavellian** *adj.* {Niccolo *Machiavelli*} (1572) **1 :** of or relating to Ma... | I have been trying to break this down for some time now. Here are my thoughts…
It is my understanding that the definition of the traits found to be “Machiavellian” in nature contain both negative and positive aspects. To me, that is the heart of the reason why it is difficult to ascertain a true opposite.
Here is w... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | Call me cynical, but my candidate is ***quixotic***. [Merriam-Webster](https://www.merriam-webster.com/dictionary/quixotic) says:
>
> foolishly impractical especially in the pursuit of ideals; especially
> : marked by rash lofty romantic ideas or extravagantly chivalrous
> action.
>
>
>
The word is derived fro... | **Lincolnian**
Abraham Lincoln was a moral and virtous leader, but also a strategic and cunning commander in chief. He assembled a “team of rivals”, which indicates a willingness to entertain opposing viewpoints as well as the involvement of others in decision-making. With fortitude, political savvy, and moral rectitu... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | Note, the present nuance of the question is:
*"with equivalent cultural weight and recognition..."*
======================================================
Indeed, really the only one I can think of is Churchill, or possibly Gandhi (but Gandhi is just so different, not an "opposite").
I can't really think of any, at ... | I don't think there really is an antonym, especially a positive one. Though perhaps that's my personal bias showing, as I don't consider Machivellian particularly negative :-)
But in a certain sense, perhaps Panglossian, after the character in Voltaire's "Candide" to whom "all is for the best in this best of possible ... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | **Christian** has been used in this way. The following defintions from [dictionary.com](http://www.dictionary.com/browse/christian) are relevant:
>
> 4. exhibiting a spirit proper to a follower of Jesus Christ; Christlike:
> *She displayed true Christian charity.*
> 5. decent; respectable:
> *They gave him a good C... | **saint-like**
**he's a Saint** - **she's a saint** both strongly suggest that the person goes out of their way to help others .. to an extreme of self-sacrifice
**Mother Teresa** had it's time in the sun, although it was so frequently used in the "I'm no Mother Teresa" or (I'm no saint) way, and it was a term that ... |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | Jeffersonian
From Dictionary.com:
pertaining to or advocating the political principles and doctrines of Thomas Jefferson, especially those stressing minimum control by the central government, the inalienable rights of the individual, and the superiority of an agrarian economy and rural society. | [Good Samaritan](http://www.thefreedictionary.com/good+Samaritan)
n.
A compassionate person who unselfishly helps others, especially strangers.
Good Samaritan deeds are opposite to the selfish deeds exhibited by Machiavellian characters. |
391,559 | Before *execution* settled into its modern meanings of "running a piece of software" and "state-organised killing", it was a much more general term for acting and doing. In this now outdated context, one could "do an execution on" something or someone, meaning roughly the same as "fix it", "do a number on it" or "lick ... | 2017/05/29 | [
"https://english.stackexchange.com/questions/391559",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/153997/"
] | Call me cynical, but my candidate is ***quixotic***. [Merriam-Webster](https://www.merriam-webster.com/dictionary/quixotic) says:
>
> foolishly impractical especially in the pursuit of ideals; especially
> : marked by rash lofty romantic ideas or extravagantly chivalrous
> action.
>
>
>
The word is derived fro... | Platonic - without ulterior motive, peaceful intent |
13,092,696 | I am trying to set an image with size of 960x640 pixels... My device has 854x480 pixels..
What I have done is to load the sprite, and then set as scene background...
```
sprite = new Sprite(0, 0, fieldITexture, BaseActivity.getSharedInstance().getVertexBufferObjectManager());
setBackground(new SpriteBackground(sprite... | 2012/10/26 | [
"https://Stackoverflow.com/questions/13092696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1354096/"
] | Don't use device.getWitdh() and device.getHeight() use fixed width and height
```
public final static int CAMERA_WIDTH = 720;
public final static int CAMERA_HEIGHT = 480;
```
AndEngine will scale all the images for you, sometimes you will see a small black bar around the edges of the screen because of the scaling. b... | just to put it out there, I believe there are 2 major ratio's (5:3 and 4:3) for the devices.
Most others are closer to 5:3 than 4:3 (so 5:3 should be default).
I wanted to support the best graphics possible, without having to go through ALL screen sizes.
So i took those 2 ratios.
Now I made my setup like this:
defin... |
13,092,696 | I am trying to set an image with size of 960x640 pixels... My device has 854x480 pixels..
What I have done is to load the sprite, and then set as scene background...
```
sprite = new Sprite(0, 0, fieldITexture, BaseActivity.getSharedInstance().getVertexBufferObjectManager());
setBackground(new SpriteBackground(sprite... | 2012/10/26 | [
"https://Stackoverflow.com/questions/13092696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1354096/"
] | Don't use device.getWitdh() and device.getHeight() use fixed width and height
```
public final static int CAMERA_WIDTH = 720;
public final static int CAMERA_HEIGHT = 480;
```
AndEngine will scale all the images for you, sometimes you will see a small black bar around the edges of the screen because of the scaling. b... | Replace:
new RatioResolutionPolicy(WIDTH, HEIGHT)
with:
new FillResolutionPolicy ()
this fills up the whole screen. |
13,092,696 | I am trying to set an image with size of 960x640 pixels... My device has 854x480 pixels..
What I have done is to load the sprite, and then set as scene background...
```
sprite = new Sprite(0, 0, fieldITexture, BaseActivity.getSharedInstance().getVertexBufferObjectManager());
setBackground(new SpriteBackground(sprite... | 2012/10/26 | [
"https://Stackoverflow.com/questions/13092696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1354096/"
] | just to put it out there, I believe there are 2 major ratio's (5:3 and 4:3) for the devices.
Most others are closer to 5:3 than 4:3 (so 5:3 should be default).
I wanted to support the best graphics possible, without having to go through ALL screen sizes.
So i took those 2 ratios.
Now I made my setup like this:
defin... | Replace:
new RatioResolutionPolicy(WIDTH, HEIGHT)
with:
new FillResolutionPolicy ()
this fills up the whole screen. |
111,686 | I have the following data consisting of x, y pairs and errors of y:
```
dataWithError = {{0.0333333, 0.0000122672, 0.00000173485}, {0.05, 0.0000371462,
0.00000448037}, {0.0666667, 0.0000697768, 0.00000748151},
{0.0833333, 0.000108625, 0.000010837}, {0.1, 0.000147595,
... | 2016/04/01 | [
"https://mathematica.stackexchange.com/questions/111686",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/19892/"
] | You can always perform coordinate transformation yourself. There is nothing so special about `LogLogPlot`. You have to apply `Log` to your points and plot it with regular `ErrorListPlot`. Keep in mind that your error bar won't be symmetric in log-log coordinates. After that you have to draw ticks according to your new ... | In Mathematica 12, you can use the new [Around](https://reference.wolfram.com/language/ref/Around.html) function inside `ListLogLogPlot`. No need for `ErrorBarPlots` any more.
```
toPlot = Map[({#[[1]], Around[#[[2]], #[[3]]]}) &, dataWithError];
ListLogLogPlot[toPlot, Joined -> True, Frame -> True]
```

```
<ng-container matColumnDef="EditButtonCol">
<th mat-header-cell *matHead... | This works
```
<button mat-button (click)="onEdit(element)">Edit</button>
``` |
36,571,397 | I need to make it so if I have a navigation bar with Home, Oil, Coal and Natural gas, when I hover over oil, it'll make the background image for that box an oil drop or something, and if I hover over coal it will have the background image for coal in that specific box.
This is my code so far, but it's currently showin... | 2016/04/12 | [
"https://Stackoverflow.com/questions/36571397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6192926/"
] | You're wanting something client side to validate the fields before you're able to submit to the next page. Look up validation in jQuery and maybe include the "required" attribute that's been added into HTML5. | Add name attribute to button set required to all required fields
```
<input name="submit" type="submit" />
```
in php
```
<?php
if(isset($_POST['submit'])){
$required = array('name', 'surname', 'phone');
$error = false;
foreach($required as $field) {
if (empty($_POST[$field])) {
$error = true;
}
}
if (... |
36,571,397 | I need to make it so if I have a navigation bar with Home, Oil, Coal and Natural gas, when I hover over oil, it'll make the background image for that box an oil drop or something, and if I hover over coal it will have the background image for coal in that specific box.
This is my code so far, but it's currently showin... | 2016/04/12 | [
"https://Stackoverflow.com/questions/36571397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6192926/"
] | You're wanting something client side to validate the fields before you're able to submit to the next page. Look up validation in jQuery and maybe include the "required" attribute that's been added into HTML5. | Try the below code
```
<?php
if(isset($_POST['submit'])){
$required = array('name', 'surname', 'phone');
$error = false;
$message='';
foreach($required as $field) {
if (empty($_POST[$field])) {
$error = true;
}
... |
36,571,397 | I need to make it so if I have a navigation bar with Home, Oil, Coal and Natural gas, when I hover over oil, it'll make the background image for that box an oil drop or something, and if I hover over coal it will have the background image for coal in that specific box.
This is my code so far, but it's currently showin... | 2016/04/12 | [
"https://Stackoverflow.com/questions/36571397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6192926/"
] | You're wanting something client side to validate the fields before you're able to submit to the next page. Look up validation in jQuery and maybe include the "required" attribute that's been added into HTML5. | Easiest and quickest way, You can use HTML5 `required`.
```html
<form method="post" action="process.php" autocomplete="off">
Name: <input type="text" name="name" required />
<BR>
Surname: <input type="text" name="surname" required />
<BR>
Phone: <input type="text" name="phone" required />
<BR>
Gender: Male <in... |
62,965,995 | Please help me with the code . How i can create alert when time runs out in this code. i want to set alert on when time runs out .
```js
function makeTimer() {
// var endTime = new Date("29 April 2018 9:56:00 GMT+01:00");
var endTime = new Date("29 April 2020 9:56:00 GMT+01:00");
endTime = (Date.parse(endT... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62965995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6731583/"
] | You don't need to make things complicated, when you logged in your logged in guard (i.e. auth guard).
```
import { Injectable } from '@angular/core';
import { Router, CanActivate } from '@angular/router';
import { AuthService } from './auth.service';
@Injectable()
export class AuthGuardService implements CanActivate {... | The constructor is executed only one time during the creation of the page.
```
constructor(public router: Router, private cartService: CartService, public sidenavMenuService:SidebarMenuService) {
this.checkLogin();
this.name = Cookie.get('userName');
}
```
Now, according to the code, if the cookie `authtok... |
39,431 | [Fishstacks](http://esolangs.org/wiki/Fishstacks) is a [deadfish](http://esolangs.org/wiki/Deadfish) derivative based on a stack the stack can only hold four elements when a fifth element is pushed the bottom element is kicked out and eventually printed out to the screen.
I've come up with an interpreter in TI-BASIC f... | 2014/01/17 | [
"https://codereview.stackexchange.com/questions/39431",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/33952/"
] | I was asked by @Timtech to join + post an improvement. Using arrays is a lot easier to understand, and there were so many optimizations that I decided to completely re-write the code. I'm sure it could be improved by other advanced programmers like me, as I'm using several long expressions here... note that `L1` repres... | Beyond the bad names that you are already aware of, I see a few things that could be improved.
`str1` and `str2` are bad variable names as well. They should be `str` and `chr` respectively. Those names would properly represent the data and make this code much more understandable. It would be instantly clear to anyone ... |
39,431 | [Fishstacks](http://esolangs.org/wiki/Fishstacks) is a [deadfish](http://esolangs.org/wiki/Deadfish) derivative based on a stack the stack can only hold four elements when a fifth element is pushed the bottom element is kicked out and eventually printed out to the screen.
I've come up with an interpreter in TI-BASIC f... | 2014/01/17 | [
"https://codereview.stackexchange.com/questions/39431",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/33952/"
] | Beyond the bad names that you are already aware of, I see a few things that could be improved.
`str1` and `str2` are bad variable names as well. They should be `str` and `chr` respectively. Those names would properly represent the data and make this code much more understandable. It would be instantly clear to anyone ... | ```
:ClrHome
:Disp "FISHSTACKS IDSP","INTERPRETER"
:-{2,2,2,0->L1
:Input Str1
:For(I,1,length(Str1
:sub(Str1,I,1
:If Ans≠"P"
:Then
:(Ans="I")-(Ans="D")+L1(4)^int(e^(Ans="S"->L1(4
:If Ans≥0 and Ans≠256
:Else
:L1(1
:If 2+Ans
:Disp Ans
:augment(ΔList(cumSum(L1)),{0->L1
:End
:End
```
I was able to shorten FlyAwayBirdie's... |
39,431 | [Fishstacks](http://esolangs.org/wiki/Fishstacks) is a [deadfish](http://esolangs.org/wiki/Deadfish) derivative based on a stack the stack can only hold four elements when a fifth element is pushed the bottom element is kicked out and eventually printed out to the screen.
I've come up with an interpreter in TI-BASIC f... | 2014/01/17 | [
"https://codereview.stackexchange.com/questions/39431",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/33952/"
] | I was asked by @Timtech to join + post an improvement. Using arrays is a lot easier to understand, and there were so many optimizations that I decided to completely re-write the code. I'm sure it could be improved by other advanced programmers like me, as I'm using several long expressions here... note that `L1` repres... | ```
:ClrHome
:Disp "FISHSTACKS IDSP","INTERPRETER"
:-{2,2,2,0->L1
:Input Str1
:For(I,1,length(Str1
:sub(Str1,I,1
:If Ans≠"P"
:Then
:(Ans="I")-(Ans="D")+L1(4)^int(e^(Ans="S"->L1(4
:If Ans≥0 and Ans≠256
:Else
:L1(1
:If 2+Ans
:Disp Ans
:augment(ΔList(cumSum(L1)),{0->L1
:End
:End
```
I was able to shorten FlyAwayBirdie's... |
4,211,274 | I am trying to make an interactive, text-based connect4 game in SWI Prolog, and I'm a little stuck on how to start. What I don't understand is how to represent the game board, since I don't think I can have arrays, or variables that can be seen and modified by all rules.
Any insight as to how to start would be greatly... | 2010/11/18 | [
"https://Stackoverflow.com/questions/4211274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/395986/"
] | An appropriate representation of a data structure amenable to your situation is often half the problem in PROLOG.
There are many ways of representing things in a grid like a 2-dim array in PROLOG, but I'd argue that the easiest are probably list-based, since there is a lot of inherent support for list structures:
**... | (I hope you are talking about [this](http://en.wikipedia.org/wiki/Connect_Four) game).
You have a several choices.
You can have a list of lists for the whole field, like
[[empty,empty,yellow,red,empty],[red,red,red,yellow,yellow],[red,red,red,red,red]].
Or you can assert/retract facts like
red(2, 4).
red(1, 3).
... |
55,018,442 | Currently i want to make event for "Copy to Clipboard" on user device.
When user click to "List view leading icon.content copy" then text should be store on his device clipboard.
Please can anyone help me?
```
Widget _buildListItem(BuildContext context, DocumentSnapshot data) {
final record = Record.fromSnaps... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55018442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11074663/"
] | ```
import 'package:flutter/services.dart';
```
inside your `onTap` add the following:
```
onTap:(){
Clipboard.setData(new ClipboardData(text: record.name));
Scaffold.of(context).showSnackBar(SnackBar
(content: Text('text copied')));
}
``` | If Sami Kanafani's answer throws an exception because of the snackbar try this solution that worked for me.
```
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
...//build method
Scaffold(
key: _scaffoldKey,
appBar: _appBar,
body: _content,
floatingActionButton: FloatingActionButton.extended(... |
3,911,433 | I need to call a VB.NET DLL in VB6 application, does anybody have any ideas? | 2010/10/12 | [
"https://Stackoverflow.com/questions/3911433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/472874/"
] | [How to call a Visual Basic .NET or Visual Basic 2005 assembly from Visual Basic 6.0](https://web.archive.org/web/20120210204121/http://support.microsoft.com/kb/817248)
[Using .NET DLL in VB6](https://www.codeproject.com/Articles/1194639/Using-NET-DLL-in-VB) | You can also export functions as standard windows DLL function entry points if you're willing to use a post compile tool
Check out
<http://www.codeproject.com/KB/dotnet/DllExport.aspx>
Works a treat and lets you integrate with all sorts of apps using Native VB.net when it'd require C or asm otherwise. |
21,605,904 | hi all i have gone through many thread and i found the way but don't know how to fit in my string please give me `regex`pattern to solve this.
```
input: String [200,350,500]
output: String{"200","350","500"}
```
one of the article where i found something:
[How to convert a String into an array of Strings containin... | 2014/02/06 | [
"https://Stackoverflow.com/questions/21605904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3154663/"
] | Get the substring between the first and the last character and then split by `,`:
```
String input = "[200,350,500]";
String[] split = input.substring(1, input.length() - 1).split(",");
``` | ```
String input = "[200,350,500]";
String[] split = input.replaceAll("^.(.*).$","$1").split(",");
``` |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | I had a similar problem, but with a duplication of computational graphs: they've just added in tensorboard when I called
```
writer.add_graph(graph=sess.graph)
```
In my case, it wasn't about log files but about Jupyter Notebook context.
I figured out that after multiple runs of a Jupyter cell with a Graph definit... | Add the following snippet to your code and it should automatically reset your tensorboard.
```
if tf.gfile.Exists(dirpath):
tf.gfile.DeleteRecursively(dirpath)
```
This will delete the previous logs. |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | I just figured out the solution to this problem. Just put each Events.out file in a separate folder inside your log directory. And you will get a nice visualization in tensorboard with each run in a different color. | Had a similar issue, which threw an error: '*You must feed a value for placeholder tensor 'dense\_input' with dtype float and shape*'. This specific issue was discussed [here](https://github.com/keras-team/keras/issues/10074).
The suggestion that worked for me used:
```
from keras.backend import clear_session
# Before... |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | Yes, I believe ultimately this aspect is positive.
As an example, in my script I automate new run logs via `datetime`:
```py
from datetime import datetime
now = datetime.now()
logdir = "tf_logs/.../" + now.strftime("%Y%m%d-%H%M%S") + "/"
```
Then when running TensorBoard you can click the different runs on and of... | Add the following snippet to your code and it should automatically reset your tensorboard.
```
if tf.gfile.Exists(dirpath):
tf.gfile.DeleteRecursively(dirpath)
```
This will delete the previous logs. |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | Note: The solution you've posted (erase TensorBoard's log files and kill the process) will work, but it isn't preferred, because it destroys historical information about your training.
Instead, you can have each new training job write to a new subdirectory (of your top-level log directory). Then, TensorBoard will cons... | I had a similar problem, but with a duplication of computational graphs: they've just added in tensorboard when I called
```
writer.add_graph(graph=sess.graph)
```
In my case, it wasn't about log files but about Jupyter Notebook context.
I figured out that after multiple runs of a Jupyter cell with a Graph definit... |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | Ok, for some reason it didn't work before but now it did:
**You must erase Tensorboard's log files AND kill its process**
After killing the process run `fuser 6006/tcp -k` to free port 6006 (if you're in linux) and fire tensorboard again. | Add the following snippet to your code and it should automatically reset your tensorboard.
```
if tf.gfile.Exists(dirpath):
tf.gfile.DeleteRecursively(dirpath)
```
This will delete the previous logs. |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | Note: The solution you've posted (erase TensorBoard's log files and kill the process) will work, but it isn't preferred, because it destroys historical information about your training.
Instead, you can have each new training job write to a new subdirectory (of your top-level log directory). Then, TensorBoard will cons... | Add the following snippet to your code and it should automatically reset your tensorboard.
```
if tf.gfile.Exists(dirpath):
tf.gfile.DeleteRecursively(dirpath)
```
This will delete the previous logs. |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | Had a similar issue, which threw an error: '*You must feed a value for placeholder tensor 'dense\_input' with dtype float and shape*'. This specific issue was discussed [here](https://github.com/keras-team/keras/issues/10074).
The suggestion that worked for me used:
```
from keras.backend import clear_session
# Before... | This automatically deletes the log directory.
```
import shutil
shutil.rmtree('log_dir', ignore_errors=True)
``` |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | I just figured out the solution to this problem. Just put each Events.out file in a separate folder inside your log directory. And you will get a nice visualization in tensorboard with each run in a different color. | Add the following snippet to your code and it should automatically reset your tensorboard.
```
if tf.gfile.Exists(dirpath):
tf.gfile.DeleteRecursively(dirpath)
```
This will delete the previous logs. |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | Yes, I believe ultimately this aspect is positive.
As an example, in my script I automate new run logs via `datetime`:
```py
from datetime import datetime
now = datetime.now()
logdir = "tf_logs/.../" + now.strftime("%Y%m%d-%H%M%S") + "/"
```
Then when running TensorBoard you can click the different runs on and of... | This automatically deletes the log directory.
```
import shutil
shutil.rmtree('log_dir', ignore_errors=True)
``` |
34,454,733 | I'm having troubles scrawling a website that use Spanish characters. I wrote the following code to generate the codes the website uses for its leagues:
```
LEAGUES = ['Internacional', 'Inglaterra', 'España', 'Francia', 'Alemania', 'Italia', 'Holanda', 'Portugal', 'Australia',
'Bélgica', 'Egipto', 'Grecia', ... | 2015/12/24 | [
"https://Stackoverflow.com/questions/34454733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3550480/"
] | I had a similar problem, but with a duplication of computational graphs: they've just added in tensorboard when I called
```
writer.add_graph(graph=sess.graph)
```
In my case, it wasn't about log files but about Jupyter Notebook context.
I figured out that after multiple runs of a Jupyter cell with a Graph definit... | This automatically deletes the log directory.
```
import shutil
shutil.rmtree('log_dir', ignore_errors=True)
``` |
2,285,692 | Is there a way to prove that every Riemann integrable function is a uniform limit of step functions? If not, does there exist a function that contradicts this? | 2017/05/17 | [
"https://math.stackexchange.com/questions/2285692",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/421156/"
] | The above suggested counterexample doesn't actually work, since that choice of $f(x)$ is itself a step function, namely the indicator function of $[1,1]$. Thus, the trivial sequence of functions $f\_n(x)=f(x)$ is a sequence of step functions uniformely convergent to $f(x)$ and they are all indeed Riemann integrable.
I... | Take as a counterexample,
$$f(x) = \begin{cases} 0, \,\, 0 \leqslant x < 1 \\ 1, \,\, x = 1 \\ 0, \,\, 1 < x \leqslant 2 \end{cases}$$
There exist sequences of step functions converging pointwise to $f$ -- for example
$$s\_n(x) = \begin{cases} 0, \,\, 0 \leqslant x < 1-1/n \\ 1, \,\, 1- 1/n \leqslant x \leqslant 1 +... |
193,304 | I recently purchased a 1/2" garden hose and two hose fittings (not native English speaker, this is what the English version of the store's website calls them - image attached) which according to the packaging are for 1/2".
The problem is that the hose is really difficult to connect to the fittings, it's a really tight... | 2020/05/21 | [
"https://diy.stackexchange.com/questions/193304",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/117555/"
] | This is possibly a daft question, but just to be sure - you are unscrewing the "nut" that is on the right side of that picture, sliding that over the hose, pushing the hose under the "fingers", and then doing the nut back up?
If so, and you're sure that that hose and fitting are the same size, then try putting the en... | I ran into this same problem a few times and the fix was to replace the hose. My last problem was with a 5/8" hose and a 5/8" repair end . No matter what I did I could not get any repair end to fit that hose so the rubbish man received it when he collected the trash. |
1,962,004 | I have to solve a couple of problems involving very large numbers, ie. those that are too big to use in a calculator. I clearly need a general approach for this sort of problem. Any pointers would be appreciated, ie. no need to solve the problems completely, just give me some direction. (If I get desperate I'll ask for... | 2016/10/10 | [
"https://math.stackexchange.com/questions/1962004",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/272669/"
] | For Question 1, you can easily prove it is not prime by considering that both 5555 and 2222 are divisible by 1111
Continuing your proof on question 2:
You have shown correctly that $7^{35}$ has exactly 30 digits and that it is not enough to say there is at least one digit that repeats 4 times. By pigeon hole, the onl... | Hint for the first question:
What is $2222^{5555} \mod 3$? What is $5555^{2222} \mod 3$?
Hint for the second question:
How many digits long is $7^{35}$? |
31,240,952 | I just upgraded to `pymongo==3.0.3` via `pip install --upgrade pymongo`, and I'm flooded with `ImportError`:
```py
In [2]: pymongo.version
Out[2]: '3.0.3'
In [3]: from pymongo import Connection
---------------------------------------------------------------------------
ImportError Traceb... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31240952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2810981/"
] | According to [Pymongo 3.0 changelog](http://api.mongodb.org/python/current/changelog.html#mongoclient-changes) -
>
> **MongoClient changes**
>
>
> MongoClient is now the one and only client class for a standalone server, mongos, or replica set. It includes the functionality that had been split into MongoReplicaSetC... | Probably you can support both versions in your code by doing something like this.
```
try:
from pymongo.connection import Connection
except ImportError as e:
from pymongo import MongoClient as Connection
``` |
31,240,952 | I just upgraded to `pymongo==3.0.3` via `pip install --upgrade pymongo`, and I'm flooded with `ImportError`:
```py
In [2]: pymongo.version
Out[2]: '3.0.3'
In [3]: from pymongo import Connection
---------------------------------------------------------------------------
ImportError Traceb... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31240952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2810981/"
] | According to [Pymongo 3.0 changelog](http://api.mongodb.org/python/current/changelog.html#mongoclient-changes) -
>
> **MongoClient changes**
>
>
> MongoClient is now the one and only client class for a standalone server, mongos, or replica set. It includes the functionality that had been split into MongoReplicaSetC... | Since Connection class is deprecated from pymongo(3.0.0). Install a older version of pymongo(2.9) to make it temporarily work. It can be done with pip using:
```
pip install pymongo==2.9
``` |
47,249,699 | I write a boot loader in asm and want to add some compiled C code in my project.
I created a test function here:
**test.c**
```
__asm__(".code16\n");
void print_str() {
__asm__ __volatile__("mov $'A' , %al\n");
__asm__ __volatile__("mov $0x0e, %ah\n");
__asm__ __volatile__("int $0x10\n");
}
```
And he... | 2017/11/12 | [
"https://Stackoverflow.com/questions/47249699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5562200/"
] | >
> I write a boot loader in asm and want to add some compiled C code in my project.
>
>
>
Then you need to use a 16-bit x86 compiler, such as [OpenWatcom](http://www.openwatcom.org/).
**GCC cannot safely build real-mode code**, as it is unaware of some important features of the platform, including memory segment... | First i want to express how to link C compiled code with assembled file.
I put together some Q/A in SO and reach to this.
***C code:***
**func.c**
```
//__asm__(".code16gcc\n");when we use eax, 32 bit reg we cant use this as truncate
//problem
#include <stdio.h>
int x = 0;
int madd(int a, int b)
{
return a... |
47,249,699 | I write a boot loader in asm and want to add some compiled C code in my project.
I created a test function here:
**test.c**
```
__asm__(".code16\n");
void print_str() {
__asm__ __volatile__("mov $'A' , %al\n");
__asm__ __volatile__("mov $0x0e, %ah\n");
__asm__ __volatile__("int $0x10\n");
}
```
And he... | 2017/11/12 | [
"https://Stackoverflow.com/questions/47249699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5562200/"
] | Compiling & Linking NASM and GCC Code
-------------------------------------
This question has a more complex answer than one might believe, although it is possible. Can the first stage of a bootloader (the original 512 bytes that get loaded at physical address 0x07c00) make a call into a *C* function? Yes, but it requ... | >
> I write a boot loader in asm and want to add some compiled C code in my project.
>
>
>
Then you need to use a 16-bit x86 compiler, such as [OpenWatcom](http://www.openwatcom.org/).
**GCC cannot safely build real-mode code**, as it is unaware of some important features of the platform, including memory segment... |
47,249,699 | I write a boot loader in asm and want to add some compiled C code in my project.
I created a test function here:
**test.c**
```
__asm__(".code16\n");
void print_str() {
__asm__ __volatile__("mov $'A' , %al\n");
__asm__ __volatile__("mov $0x0e, %ah\n");
__asm__ __volatile__("int $0x10\n");
}
```
And he... | 2017/11/12 | [
"https://Stackoverflow.com/questions/47249699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5562200/"
] | Compiling & Linking NASM and GCC Code
-------------------------------------
This question has a more complex answer than one might believe, although it is possible. Can the first stage of a bootloader (the original 512 bytes that get loaded at physical address 0x07c00) make a call into a *C* function? Yes, but it requ... | First i want to express how to link C compiled code with assembled file.
I put together some Q/A in SO and reach to this.
***C code:***
**func.c**
```
//__asm__(".code16gcc\n");when we use eax, 32 bit reg we cant use this as truncate
//problem
#include <stdio.h>
int x = 0;
int madd(int a, int b)
{
return a... |
57,375,509 | I have events table, now I want to display the most frequent element in a column using SQL
Here is the event table.
```
id | selectedcountries
0 | Tanzania
1 | Tanzania
2 | Tanzania
3 | Kenya
4 | Uganda
5 | Uganda
6 | Kenya
7 | Uganda
8 | Tanzania
8 | Pola... | 2019/08/06 | [
"https://Stackoverflow.com/questions/57375509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9964622/"
] | Finally I have discovered a way to do that with CSS only, which is as follows:
HTML
```
<body>
<form>
<input type="text" />
<input type="submit" />
</form>
<table>
<thead></thead>
<tbody>
<tr>
<td>table data 1</td>
<td>table data ... | Please check code.
html
```
<form>
<input type="text" />
<table>
<thead></thead>
<tbody>
<tr>
<td>table data 1</td>
<td>table data 2</td>
</tr>
</tbody>
</table>
<input type="submit" />
</form>
```
css
```
input[type="submit"] {
margin-top: 50px;
}
```
or you can... |
4,396,900 | Just as I described in the question, if $ f(x)$ is continuous on $[0,\infty]$ and
$$ \displaystyle \lim\_{x\to \infty} f(x)=1$$
Then what about this integration?
$$\displaystyle \int\_0^\infty f(x) dx$$
For me, I'm a little bit suspicious that the integration is guaranteed to be divergent. My idea is from function $\df... | 2022/03/06 | [
"https://math.stackexchange.com/questions/4396900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/993159/"
] | Continuity is not required. Since $\lim\_{x\to\infty} f(x)=1$, there is some $x\_0>0$ such that for all $x>x\_0$ we have $f(x)>\frac{1}{2}$. In order for $\int\_0^{\infty} f(x) \, dx$ to converge $\int\_{x\_0}^{\infty} f(x) \, dx$ must converge.
$\int\_{x\_0}^{\infty} \frac{1}{2} \, dx$ clearly diverges, as $\int\_{x\... | Yes, even if $\int\_{0}^{\infty}f(x)dx$ is defined in improper sense.
Let $F(x)=\int\_{0}^{x}f(t)dt$. Suppose the contrary that $I=\lim\_{x\rightarrow\infty}F(x)$
exists. For $\varepsilon=1$, there exists $x\_{1}>0$ such that $|F(x)-I|<\varepsilon$
whenever $x\geq x\_{1}$. Since $\lim\_{x\rightarrow\infty}f(x)=1>\frac{... |
4,396,900 | Just as I described in the question, if $ f(x)$ is continuous on $[0,\infty]$ and
$$ \displaystyle \lim\_{x\to \infty} f(x)=1$$
Then what about this integration?
$$\displaystyle \int\_0^\infty f(x) dx$$
For me, I'm a little bit suspicious that the integration is guaranteed to be divergent. My idea is from function $\df... | 2022/03/06 | [
"https://math.stackexchange.com/questions/4396900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/993159/"
] | Yes, even if $\int\_{0}^{\infty}f(x)dx$ is defined in improper sense.
Let $F(x)=\int\_{0}^{x}f(t)dt$. Suppose the contrary that $I=\lim\_{x\rightarrow\infty}F(x)$
exists. For $\varepsilon=1$, there exists $x\_{1}>0$ such that $|F(x)-I|<\varepsilon$
whenever $x\geq x\_{1}$. Since $\lim\_{x\rightarrow\infty}f(x)=1>\frac{... | Divergence is definitely guaranteed. Consider this: suppose that $f$ has an antiderivative $F.$ Then by L'Hopital's theorem, $$\lim\_{x\to\infty}\frac{F(x)}{x}=\lim\_{x\to\infty}f(x).$$ By the fundamental theorem of calculus, since $f$ is continuous, you are guaranteed that $$F(x)=\int\_a^xf(t)\,\mathrm{d}t$$ for some ... |
4,396,900 | Just as I described in the question, if $ f(x)$ is continuous on $[0,\infty]$ and
$$ \displaystyle \lim\_{x\to \infty} f(x)=1$$
Then what about this integration?
$$\displaystyle \int\_0^\infty f(x) dx$$
For me, I'm a little bit suspicious that the integration is guaranteed to be divergent. My idea is from function $\df... | 2022/03/06 | [
"https://math.stackexchange.com/questions/4396900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/993159/"
] | Continuity is not required. Since $\lim\_{x\to\infty} f(x)=1$, there is some $x\_0>0$ such that for all $x>x\_0$ we have $f(x)>\frac{1}{2}$. In order for $\int\_0^{\infty} f(x) \, dx$ to converge $\int\_{x\_0}^{\infty} f(x) \, dx$ must converge.
$\int\_{x\_0}^{\infty} \frac{1}{2} \, dx$ clearly diverges, as $\int\_{x\... | Divergence is definitely guaranteed. Consider this: suppose that $f$ has an antiderivative $F.$ Then by L'Hopital's theorem, $$\lim\_{x\to\infty}\frac{F(x)}{x}=\lim\_{x\to\infty}f(x).$$ By the fundamental theorem of calculus, since $f$ is continuous, you are guaranteed that $$F(x)=\int\_a^xf(t)\,\mathrm{d}t$$ for some ... |
26,674,984 | I have an array of objects example
```
var objects = [
{ first_nom: 'dave', value: '5'},
{ first_nom: 'roger', value: '-0'},
{ first_nom: 'pete', value: '+0' },
{ first_nom: 'pete', value: '-5' },
];
```
Sorting this by value would ideally reverse the two zeros.
I have tried the normal javascript/j... | 2014/10/31 | [
"https://Stackoverflow.com/questions/26674984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1685866/"
] | You can special-case them, sorting as strings when both values are `0`:
```js
var objects = [
{ first_nom: 'dave', value: '5'},
{ first_nom: 'roger', value: '-0'},
{ first_nom: 'pete', value: '+0' },
{ first_nom: 'pete', value: '-5' },
];
var sorted = objects.sort(
function(a,b) {
if ((... | A simple solution is to convert a signed zero to some signed small value, for example:
```js
var objects = [
{ first_nom: 'dave', value: '5'},
{ first_nom: 'pete', value: '+0' },
{ first_nom: 'pete', value: '-5' },
{ first_nom: 'roger', value: '-0'},
];
convert = function(n) {
if(n == '-0')... |
26,674,984 | I have an array of objects example
```
var objects = [
{ first_nom: 'dave', value: '5'},
{ first_nom: 'roger', value: '-0'},
{ first_nom: 'pete', value: '+0' },
{ first_nom: 'pete', value: '-5' },
];
```
Sorting this by value would ideally reverse the two zeros.
I have tried the normal javascript/j... | 2014/10/31 | [
"https://Stackoverflow.com/questions/26674984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1685866/"
] | Try the following:
```js
var objects = [
{ first_nom: "dave", value: "5" },
{ first_nom: "roger", value: "-0" },
{ first_nom: "pete", value: "+0" },
{ first_nom: "pete", value: "-5" },
];
objects.sort(function (a, b) {
var x = parseInt(a.value, 10);
var y = parseInt(b.value, 10);
... | A simple solution is to convert a signed zero to some signed small value, for example:
```js
var objects = [
{ first_nom: 'dave', value: '5'},
{ first_nom: 'pete', value: '+0' },
{ first_nom: 'pete', value: '-5' },
{ first_nom: 'roger', value: '-0'},
];
convert = function(n) {
if(n == '-0')... |
13,283,916 | I Have created a table model extending DefaultTableModel.
```
public class TableModel extends DefaultTableModel {
List<VariableDetails> data;
public AttachedVariableTableModel(){
super();
this.data=Collections.synchronizedList(new ArrayList<VariableDetails>());
}
//method for adding rows
public void addRow(Va... | 2012/11/08 | [
"https://Stackoverflow.com/questions/13283916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1548689/"
] | 1. for why reason is there `super();`
2. `DefaultTableModel` can add `Object[]` or `Vector`
3. have to override `AbstractTableModel`, rather than `DefaultTableModel`, have to override all [`get/set` methods](https://stackoverflow.com/a/6901508/714968), with proper `fireXxxXxx()` in the methods, otherwise there aren't s... | May i suggest you a complete table model example to undestand how it works. It also uses a List as data. The most important thing is you need to extends **AbstractTableModel** to use your own variable in order to store data. Here is a complete sample of source code.
```
import java.util.ArrayList;
import java.util.Lis... |
200,210 | I want to run a new 20A service and 2x POE lines from my basement to my garage. Can I put them in the same pieces of conduit or do I need two? Piece of conduit would be less than 1 foot in length. | 2020/08/03 | [
"https://diy.stackexchange.com/questions/200210",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/121696/"
] | No, you cannot mix AC mains and low-voltage wiring (such as network cables) in the same conduit. The length of the run is not important, it's prohibited.
Run two separate conduits and you'll be good. | There's a gizmo made for *precisely this sort of job*
-----------------------------------------------------
While Exception 1 to NEC 800.133(A)(1)(c) or 800.133(A)(2) would permit the shared sleeve you describe, I would not bother with your conduit sleeve approach here to begin with as the fireblocking foam fill would... |
1,553,377 | i want to create a page with frame set
first i divide the page in 3 rows. In second row i divide it by 2 coloumns. My problem is that first column of the second row contain lot of content(a full screen height), so there is a scroll bar , I want to show all the content without scrolling..., is it possible ???
can i gi... | 2009/10/12 | [
"https://Stackoverflow.com/questions/1553377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148449/"
] | I guess you have your frameset something like this:
```
<frameset rows="100,*,80">
<frame src="f1.htm"/>
<frameset cols="120,*">
<frame src="left.htm"/>
<frame src="right.htm"/>
</frameset>
<frame src="f2.htm"/>
</frameset>
```
Which will look something like this:
```
________________________
| f1.h... | Setting height to \* should work...
```
<frameset blabla height="*">
```
Bobby |
48,340,719 | Found a few versions of this question, such as [Django get environment variables from apache](https://stackoverflow.com/questions/20102620/django-get-environment-variables-from-apache), however the advice I've found so far doesn't seem to work with the latest LTS django (1.11).
I have an apache configuration which hol... | 2018/01/19 | [
"https://Stackoverflow.com/questions/48340719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192158/"
] | You can't use `SetEnv` as the settings file is evaluated before the first request is handled. Setting environment variables from per request WSGI environ values was always a bad idea and can cause problems, so you shouldn't do that anyway.
Result is that you cannot set environment variables from the Apache configurati... | You have to defer initialising the Django app until the first request. Something like this in your wsgi.py:
```
from django.core.wsgi import get_wsgi_application
_application = None
def application(environ, start_response):
global _application
if _application == None:
for key in environ:
if... |
48,340,719 | Found a few versions of this question, such as [Django get environment variables from apache](https://stackoverflow.com/questions/20102620/django-get-environment-variables-from-apache), however the advice I've found so far doesn't seem to work with the latest LTS django (1.11).
I have an apache configuration which hol... | 2018/01/19 | [
"https://Stackoverflow.com/questions/48340719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192158/"
] | You can't use `SetEnv` as the settings file is evaluated before the first request is handled. Setting environment variables from per request WSGI environ values was always a bad idea and can cause problems, so you shouldn't do that anyway.
Result is that you cannot set environment variables from the Apache configurati... | For Django > 1.7 get\_wsgi\_application calls django.setup() which initializes the settings. So if your env vars aren't set at that point you won't see them in the settings.
To get around it, don't actually call get\_wsgi\_application until you're ready. This works for me in wsgi.py:
```
def application(environ, star... |
48,340,719 | Found a few versions of this question, such as [Django get environment variables from apache](https://stackoverflow.com/questions/20102620/django-get-environment-variables-from-apache), however the advice I've found so far doesn't seem to work with the latest LTS django (1.11).
I have an apache configuration which hol... | 2018/01/19 | [
"https://Stackoverflow.com/questions/48340719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192158/"
] | For Django > 1.7 get\_wsgi\_application calls django.setup() which initializes the settings. So if your env vars aren't set at that point you won't see them in the settings.
To get around it, don't actually call get\_wsgi\_application until you're ready. This works for me in wsgi.py:
```
def application(environ, star... | You have to defer initialising the Django app until the first request. Something like this in your wsgi.py:
```
from django.core.wsgi import get_wsgi_application
_application = None
def application(environ, start_response):
global _application
if _application == None:
for key in environ:
if... |
37,557,284 | I am trying to increment a value for a key-value in redis, if the value already exists in redis. For instance if we have
```
client.get(key, function checkRedis(err, data){
var redisData = JSON.parse(data);
if(redisData === null){
//do something
}else{
client.incr(redisData.val);
}
});
```
From my... | 2016/05/31 | [
"https://Stackoverflow.com/questions/37557284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5213120/"
] | You need to give `client` the `key` not the value.
I believe the below will do what you need.
```
client.get(key, function checkRedis(err, data){
var redisData = JSON.parse(data);
if(redisData === null){
//do something
}else{
redisData.val++;
client.set(key, redisData);
}
});
``` | **You need to use the INCR key to increment value in redis**
```
const redisClient = require('ioredis');
const name = 'Bob';
redisClient.incr('id', (err, id) =>
{
redisClient.hmset('user:' + id, 'username', name);
});
``` |
4,305,794 | I am reading about bases in topology and have encountered the concept of a (local) neighborhood basis. The example they give is for the topology on metric spaces: the set of all open balls around $x$ (or the set of all small open balls around $x$, or all open balls with radius $\frac{1}{n}$ for all $n \in \mathbb{N}$ a... | 2021/11/14 | [
"https://math.stackexchange.com/questions/4305794",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/726980/"
] | It can be useful to calculate these moments in a general case, invoking [Gamma Function](https://en.wikipedia.org/wiki/Gamma_function)
$$E(X^k)=\int\_0^{\infty} x^k \lambda e^{-\lambda x}dx=\frac{1}{\lambda^k}\int\_0^{\infty}(\lambda x)^k e^{-\lambda x} d(\lambda x)=\frac{\Gamma(k+1)}{\lambda^k}=\frac{k!}{\lambda^k}$$... | The notation being used here is an alternate way of writing
$$u = x^2, \quad du = 2x \, dx, \\
dv = \lambda e^{-\lambda x} dx, \quad v = -e^{-\lambda x}.$$
You will notice that with this definition of $v$, we simply have $$d(-e^{-\lambda x}) = dv = \lambda e^{-\lambda x} \, dx,$$ and substituting this into the first ... |
869,178 | In Nginx we can return a specific status code to URL prefix like this.
`location /api {
return 200;
}`
How can we achieve the same in Haproxy?.
Gone through Haproxy ACL but couldn't find any. | 2017/08/17 | [
"https://serverfault.com/questions/869178",
"https://serverfault.com",
"https://serverfault.com/users/281864/"
] | This can be accomplished by using a lua response script.
I already use one to set the CORS headers for the preflight response.
My rule is the following:
```
global
...
lua-load /etc/haproxy/200.lua
frontend
bind ...
...
use_backend http_200 if ...
backend http_200
http-request use-service lu... | For completeness, from version 2.2 you can return dynamic content like this
```
http-request return status 200 content-type "text/plain" lf-string "Hello"
```
More in [docs](https://cbonte.github.io/haproxy-dconv/2.5/configuration.html#4.2-http-request%20return). |
21,182,321 | At the moment i have a query which counts the number of records dependent on country, and gives me a list something like:
* UK = 400
* Spain = 350
* etc...
I have now added in another coloumn for language as some countries have different languages e.g. Switzerland\_Italian.
What would be the best way to amend my que... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21182321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739911/"
] | You would have to GROUP BY both region and lang, like this:
```
SELECT COUNT(*) as `count`,`region`, `lang`, DATE(NOW()) as `week_ending`
FROM mydata.table
WHERE `date` > DATE_ADD(DATE(NOW()), INTERVAL -1 WEEK) AND `date` < DATE(NOW())
GROUP BY `region`, `lang`, DATE(NOW());
``` | How about this
```
SELECT
COUNT(*) AS `count`,
CONCAT( `region`,'_',`lang`),
`region`,
`lang`,
DATE(NOW()) AS `week_ending`
FROM
mydata.table
WHERE `date` > DATE_ADD(DATE(NOW()), INTERVAL - 1 WEEK)
AND `date` < DATE(NOW())
GROUP BY `region`,`lang`,
DATE(NOW()) ;
``` |
36,865,742 | On my project i have wordpress custom field data from mysql :
```
---------------------------------------------------
id | post_id | meta_key | meta_value
---------------------------------------------------
1 | 200 | age_min | 5
2 | 200 | age_max | 8
3 | 399 ... | 2016/04/26 | [
"https://Stackoverflow.com/questions/36865742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Using ajax you can call a controller action and return it's response to a particular `div`.
Empty `div`:
```
<div class="row" id="div3">
</div>
```
Ajax to display html in empty `div`:
```
function performSearch(searchCriteria) {
//get information to pass to controller
var searchInformation = JSON.stringif... | So, say you have your View with PartialView, which have to be updated by button click:
```
<div class="target">
@{ Html.RenderAction("UpdatePoints");}
</div>
<input class="button" value="update" />
```
There are some ways to do it. For example you may use jQuery:
```
<script type="text/javascript">
$(function... |
36,865,742 | On my project i have wordpress custom field data from mysql :
```
---------------------------------------------------
id | post_id | meta_key | meta_value
---------------------------------------------------
1 | 200 | age_min | 5
2 | 200 | age_max | 8
3 | 399 ... | 2016/04/26 | [
"https://Stackoverflow.com/questions/36865742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | jQuery will help you with it!
Try to handle submit button onclick event like this:
```
$("#yourButtonId").click(function()
{
$.ajax({
type: "POST",
url: "/yourUrl", //in asp.net mvc using ActionResult
data: data,
dataType: 'html',
success: functi... | So, say you have your View with PartialView, which have to be updated by button click:
```
<div class="target">
@{ Html.RenderAction("UpdatePoints");}
</div>
<input class="button" value="update" />
```
There are some ways to do it. For example you may use jQuery:
```
<script type="text/javascript">
$(function... |
36,865,742 | On my project i have wordpress custom field data from mysql :
```
---------------------------------------------------
id | post_id | meta_key | meta_value
---------------------------------------------------
1 | 200 | age_min | 5
2 | 200 | age_max | 8
3 | 399 ... | 2016/04/26 | [
"https://Stackoverflow.com/questions/36865742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can do it with ajax.
First, change your html.beginform to ajax.beginform in your view and add div id into **UpdateTargetId** that you want to change contents. After updating first partial with ajax.beginform, you can update other partialviews with ajax.beginform's **"OnSuccess"** function. You have to add update f... | So, say you have your View with PartialView, which have to be updated by button click:
```
<div class="target">
@{ Html.RenderAction("UpdatePoints");}
</div>
<input class="button" value="update" />
```
There are some ways to do it. For example you may use jQuery:
```
<script type="text/javascript">
$(function... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.