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 |
|---|---|---|---|---|---|
18,383,869 | Would this be the correct way to loop through the $POST data sent by an API and have a equivalent $SESSION name/value pair be created from it?
```
foreach($_POST as $key=>$value)
{ $_SESSION['$key']=$value; }
```
**UPDATE:** First, thanks for the solid responses - I think I need to explain the problem I'm trying to ... | 2013/08/22 | [
"https://Stackoverflow.com/questions/18383869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2065226/"
] | Don't you rather want to keep them separated?
```
$_SESSION['response'] = $_POST;
``` | Since the POST is made by a payment gateway, the session will be associated with it (and most likely be lost at first request, since it can be assumed that it won't ever bother reading the session cookie).
Your client won't ever see this data in their session.
If you want to have this data available, you need to pers... |
18,383,869 | Would this be the correct way to loop through the $POST data sent by an API and have a equivalent $SESSION name/value pair be created from it?
```
foreach($_POST as $key=>$value)
{ $_SESSION['$key']=$value; }
```
**UPDATE:** First, thanks for the solid responses - I think I need to explain the problem I'm trying to ... | 2013/08/22 | [
"https://Stackoverflow.com/questions/18383869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2065226/"
] | Don't use single quotes:
```
foreach ($_POST as $key => $value) {
$_SESSION[$key] = $value;
}
```
I'd encourage you to read about [Strings in PHP](http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single).
**Note:** This is potentially unsafe for several reasons - mostly injectio... | Since the POST is made by a payment gateway, the session will be associated with it (and most likely be lost at first request, since it can be assumed that it won't ever bother reading the session cookie).
Your client won't ever see this data in their session.
If you want to have this data available, you need to pers... |
18,383,869 | Would this be the correct way to loop through the $POST data sent by an API and have a equivalent $SESSION name/value pair be created from it?
```
foreach($_POST as $key=>$value)
{ $_SESSION['$key']=$value; }
```
**UPDATE:** First, thanks for the solid responses - I think I need to explain the problem I'm trying to ... | 2013/08/22 | [
"https://Stackoverflow.com/questions/18383869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2065226/"
] | Don't use single quotes:
```
foreach ($_POST as $key => $value) {
$_SESSION[$key] = $value;
}
```
I'd encourage you to read about [Strings in PHP](http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single).
**Note:** This is potentially unsafe for several reasons - mostly injectio... | If you **really** want to do it as you state, you could use something like
```
$_SESSION=array_merge($_SESSION,$_POST);
```
which would work but be a "bad thing" - plenty of scope to overwrite items already in the `$_SESSION` variable:
index.php:
```
<form action="2.php" method="post">
<input type="text" name="hid... |
18,383,869 | Would this be the correct way to loop through the $POST data sent by an API and have a equivalent $SESSION name/value pair be created from it?
```
foreach($_POST as $key=>$value)
{ $_SESSION['$key']=$value; }
```
**UPDATE:** First, thanks for the solid responses - I think I need to explain the problem I'm trying to ... | 2013/08/22 | [
"https://Stackoverflow.com/questions/18383869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2065226/"
] | Don't use single quotes:
```
foreach ($_POST as $key => $value) {
$_SESSION[$key] = $value;
}
```
I'd encourage you to read about [Strings in PHP](http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single).
**Note:** This is potentially unsafe for several reasons - mostly injectio... | Ignoring the security issues this could cause depending on how you use it, what you could do is use:
```
$_SESSION = array_merge($_POST, $_SESSION);
```
This will only bring in POST vars which have a key not already found in $\_SESSION. Switch them around if you want the POST vars to take precedence of course.
Just... |
18,383,869 | Would this be the correct way to loop through the $POST data sent by an API and have a equivalent $SESSION name/value pair be created from it?
```
foreach($_POST as $key=>$value)
{ $_SESSION['$key']=$value; }
```
**UPDATE:** First, thanks for the solid responses - I think I need to explain the problem I'm trying to ... | 2013/08/22 | [
"https://Stackoverflow.com/questions/18383869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2065226/"
] | If you **really** want to do it as you state, you could use something like
```
$_SESSION=array_merge($_SESSION,$_POST);
```
which would work but be a "bad thing" - plenty of scope to overwrite items already in the `$_SESSION` variable:
index.php:
```
<form action="2.php" method="post">
<input type="text" name="hid... | You could also use the [array union operator](http://php.net/language.operators.array):
```
$_SESSION = $_POST + $_SESSION;
```
This takes the values of `$_POST` and adds those values of `$_SESSION` whose keys are not already present in `$_POST`. |
18,383,869 | Would this be the correct way to loop through the $POST data sent by an API and have a equivalent $SESSION name/value pair be created from it?
```
foreach($_POST as $key=>$value)
{ $_SESSION['$key']=$value; }
```
**UPDATE:** First, thanks for the solid responses - I think I need to explain the problem I'm trying to ... | 2013/08/22 | [
"https://Stackoverflow.com/questions/18383869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2065226/"
] | Don't you rather want to keep them separated?
```
$_SESSION['response'] = $_POST;
``` | You could also use the [array union operator](http://php.net/language.operators.array):
```
$_SESSION = $_POST + $_SESSION;
```
This takes the values of `$_POST` and adds those values of `$_SESSION` whose keys are not already present in `$_POST`. |
18,383,869 | Would this be the correct way to loop through the $POST data sent by an API and have a equivalent $SESSION name/value pair be created from it?
```
foreach($_POST as $key=>$value)
{ $_SESSION['$key']=$value; }
```
**UPDATE:** First, thanks for the solid responses - I think I need to explain the problem I'm trying to ... | 2013/08/22 | [
"https://Stackoverflow.com/questions/18383869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2065226/"
] | If you **really** want to do it as you state, you could use something like
```
$_SESSION=array_merge($_SESSION,$_POST);
```
which would work but be a "bad thing" - plenty of scope to overwrite items already in the `$_SESSION` variable:
index.php:
```
<form action="2.php" method="post">
<input type="text" name="hid... | Ignoring the security issues this could cause depending on how you use it, what you could do is use:
```
$_SESSION = array_merge($_POST, $_SESSION);
```
This will only bring in POST vars which have a key not already found in $\_SESSION. Switch them around if you want the POST vars to take precedence of course.
Just... |
41,645,853 | First off this is a pretty basic problem, but i just cant seem to get it,
ok so here is a general overview of my program
```
|class A |
|new B();|
|new C();|
/ \
/ \
|Class B | |Class C |
|new D();| |method E(){}|
|
|Class D |
|Invokes method E|... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41645853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6096085/"
] | Just use `into`:
```
select O.[full name], O.[EID], O.[Loc], GL.*
into #NewTable
from [dbo].[team] O outer apply
[dbo].[fngetlocdetail](O.[eWorkCity]) GL;
```
You should specify the column names for `GL`. As @Prdp aptly points out, this will fail if the column names in `GL` duplicate one of the other names. | Did you try to use the [Select Into](http://www.w3schools.com/sql/sql_select_into.asp) statement?
```
SELECT
column_name(s)
INTO newtable [IN externaldb]
FROM table1;
``` |
49,069,956 | I'm currently working on a react native project . Here I want to use Realm as database incorporated with Redux.I searched over internet and theoretically tried to understand how whole things works together. But I found no simple demo / source code to get a clear picture of whole thing. Official website of Realm provide... | 2018/03/02 | [
"https://Stackoverflow.com/questions/49069956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4390775/"
] | Comparing Redux and Realm is odd. But, whether to have them both are choose one between them is sure, a problem.
For getting clear with, you can read the following links:
* What is functionality difference between redux and realm, and which
suits React? - Read this [comment](https://github.com/realm/realm-js/issues/... | It's time to avoid using Redux everywhere.
It added tremendous complexity and so many steps to interact with DB.
Also, the usual suggested approach of opening Realm connection inside actions is problematic since you don't use the real benefits of Realm objects.
Here we ended up removing Redux altogether.
<https://mediu... |
1,468,619 | I'm asking for the advice. I'm working at the Silverlight 3 application and now I should select the mean how to save the information and get it. I could save the necessary info in files (from 1 to 300K size) or I could save them in database. If I would use WebClient for accessing to separate file there's very low loadi... | 2009/09/23 | [
"https://Stackoverflow.com/questions/1468619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46503/"
] | there are additional considerations if you use a file that is localized to the users machine. If you wish to save data w/o any user intervention then you are limited to using Isolated Storage, which has constraints on the size of your data. Otherwise, you have to ask the user for information on where to save/load the f... | If you are saving and loading the entire file at a time, then it might be okay to use a WebClient. This might take a little coding to handle errors that may result in incomplete saves.
If you're serializing some objects or xml data and storing that in a file, then you should probably be using a database instead.
Edi... |
9,602,127 | I use graphviz (v2.28.0) as a library in a C++ application and I would like to render graphs using the dot layout. Everything works fine until I call the **gvLayout(\_context, \_graph, "dot");** function which outputs the following error :
```
Error: Layout type: "dot" not recognized. Use one of:
```
I use the foll... | 2012/03/07 | [
"https://Stackoverflow.com/questions/9602127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1137884/"
] | You probably either already fixed this or gave up, but I ended up here so I'm sure someone else will...
Plugins need to be loaded explicitly. I'm not sure whether this is related to static linking or needs to be done whenever graphviz is used as a library.
This fixed dot for me:
```
extern gvplugin_library_t gvplugi... | Do you use graphviz with dynamic library loading? In a static environment the following lines may help:
```
#include "gvplugin.h"
extern gvplugin_library_t gvplugin_dot_layout_LTX_library;
extern gvplugin_library_t gvplugin_neato_layout_LTX_library;
extern gvplugin_library_t gvplugin_core_LTX_library;
extern gvplugin... |
9,602,127 | I use graphviz (v2.28.0) as a library in a C++ application and I would like to render graphs using the dot layout. Everything works fine until I call the **gvLayout(\_context, \_graph, "dot");** function which outputs the following error :
```
Error: Layout type: "dot" not recognized. Use one of:
```
I use the foll... | 2012/03/07 | [
"https://Stackoverflow.com/questions/9602127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1137884/"
] | I got this error when I added the "-O2" optimization flag to gcc when I compiled graphviz on macosx. When I removed that flag, the error went away. | Do you use graphviz with dynamic library loading? In a static environment the following lines may help:
```
#include "gvplugin.h"
extern gvplugin_library_t gvplugin_dot_layout_LTX_library;
extern gvplugin_library_t gvplugin_neato_layout_LTX_library;
extern gvplugin_library_t gvplugin_core_LTX_library;
extern gvplugin... |
9,602,127 | I use graphviz (v2.28.0) as a library in a C++ application and I would like to render graphs using the dot layout. Everything works fine until I call the **gvLayout(\_context, \_graph, "dot");** function which outputs the following error :
```
Error: Layout type: "dot" not recognized. Use one of:
```
I use the foll... | 2012/03/07 | [
"https://Stackoverflow.com/questions/9602127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1137884/"
] | You probably either already fixed this or gave up, but I ended up here so I'm sure someone else will...
Plugins need to be loaded explicitly. I'm not sure whether this is related to static linking or needs to be done whenever graphviz is used as a library.
This fixed dot for me:
```
extern gvplugin_library_t gvplugi... | I got this error when I added the "-O2" optimization flag to gcc when I compiled graphviz on macosx. When I removed that flag, the error went away. |
9,602,127 | I use graphviz (v2.28.0) as a library in a C++ application and I would like to render graphs using the dot layout. Everything works fine until I call the **gvLayout(\_context, \_graph, "dot");** function which outputs the following error :
```
Error: Layout type: "dot" not recognized. Use one of:
```
I use the foll... | 2012/03/07 | [
"https://Stackoverflow.com/questions/9602127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1137884/"
] | You probably either already fixed this or gave up, but I ended up here so I'm sure someone else will...
Plugins need to be loaded explicitly. I'm not sure whether this is related to static linking or needs to be done whenever graphviz is used as a library.
This fixed dot for me:
```
extern gvplugin_library_t gvplugi... | According to a [reply](http://graphviz.996277.n3.nabble.com/How-to-load-libraries-in-correct-order-no-plugins-found-tp2174p2175.html) by Emden R. Gansner on the ['graphviz-interest' mailing list](http://graphviz.996277.n3.nabble.com/Graphviz-Interest-f3.html), this error message indicates that the software was unable t... |
9,602,127 | I use graphviz (v2.28.0) as a library in a C++ application and I would like to render graphs using the dot layout. Everything works fine until I call the **gvLayout(\_context, \_graph, "dot");** function which outputs the following error :
```
Error: Layout type: "dot" not recognized. Use one of:
```
I use the foll... | 2012/03/07 | [
"https://Stackoverflow.com/questions/9602127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1137884/"
] | I got this error when I added the "-O2" optimization flag to gcc when I compiled graphviz on macosx. When I removed that flag, the error went away. | According to a [reply](http://graphviz.996277.n3.nabble.com/How-to-load-libraries-in-correct-order-no-plugins-found-tp2174p2175.html) by Emden R. Gansner on the ['graphviz-interest' mailing list](http://graphviz.996277.n3.nabble.com/Graphviz-Interest-f3.html), this error message indicates that the software was unable t... |
196,416 | So I trying to use list of wrapper class as iterator in batch. below is the code I have tried so far
Iterable class
--------------
```
public class AccountCustomIterator implements Iterable<AccountWrapper>, Iterator<AccountWrapper>
{
public List<AccountWrapper> lstAccountWrapper;
Integer i {get; set;}
... | 2017/10/21 | [
"https://salesforce.stackexchange.com/questions/196416",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/18731/"
] | Note that there are two separate classes: `Iterable` and `Iterator`. In your question you use the latter where the interface demands the former.
Note also that a `List` is an `Iterable`:
```
Object demo = new List<String>();
system.assert(demo instanceof Iterable<String>);
```
So you can just return the list. No ne... | ok So I found the issue able to resolve it. Below is code for custom data type as batch iterator
```
global class AccountChildrecordsUpdateBatch implements Database.batchable<AccountCustomIterator.AccountWrapper>
{
global Iterable<AccountCustomIterator.AccountWrapper> start(Database.BatchableContext BC)
{
... |
25,124,499 | As per the question, let's say you have the following code:
```
Random rand = new Random();
for (int k = 0; k < rand.nextInt(10); k++) {
//Do stuff here
}
```
Does `k` get compared to `rand.nextInt(10)` only once, when the loop starts running, so that there's an equal chance of the loop running a... | 2014/08/04 | [
"https://Stackoverflow.com/questions/25124499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3907638/"
] | >
> Does k get compared to rand.nextInt(10) only once, when the loop starts running?
>
>
>
No, `k` is compared to the next random number the `rand` generates each time the loop continuation condition is checked.
If you wish to generate a random number once, define a variable, and set it to `nextInt(10)` before th... | Let's `testIt()`
```
public static int testIt() {
System.out.println("testIt()");
return 2;
}
public static void main(String[] args) {
for (int i = 0; i < testIt(); i++) {
System.out.println(i);
}
}
```
Output is
```
testIt()
0
testIt()
1
testIt()
```
The answer is it gets compared at each iteration o... |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | To substract to dates you can get them both as longs `getTime()` and subtract the values that are returned. | There is a framework to work with the date in java...
<http://joda-time.sourceforge.net/userguide.html>
take a look, i'm sure that it can help you |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | To substract to dates you can get them both as longs `getTime()` and subtract the values that are returned. | It depends what do you want. To get difference in milliseconds say `dtStartDate.getTime() - dtEndDate.getTime()`.
To get difference in days, hours etc use Calendar class (methods like after, before, compareTo, roll may help). |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | To substract to dates you can get them both as longs `getTime()` and subtract the values that are returned. | ```
long diffInMillis = dtEndDate.getTimeInMillis() - dtStartDate.getTimeInMillis();
``` |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | >
> ***how can i subtract these two Dates?***
>
>
>
You can get the difference in milliseconds like this:
```
dtEndDate.getTime() - dtStartDate.getTime()
```
([`getTime`](http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html#getTime%28%29) returns the number of milliseconds since January 1, 1970... | Create two [Calendar](http://download.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) objects from those Dates and then use the add() method (which can be used to subtrade dates too). |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | >
> ***how can i subtract these two Dates?***
>
>
>
You can get the difference in milliseconds like this:
```
dtEndDate.getTime() - dtStartDate.getTime()
```
([`getTime`](http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html#getTime%28%29) returns the number of milliseconds since January 1, 1970... | There is a framework to work with the date in java...
<http://joda-time.sourceforge.net/userguide.html>
take a look, i'm sure that it can help you |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | ```
long msDiff = dtEndDate.getTime() - dtStartDate.getTime()
```
`msDiff` now holds the number of milliseconds difference between the two dates. Feel free to use the division and mod operators to convert to other units. | Create two [Calendar](http://download.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) objects from those Dates and then use the add() method (which can be used to subtrade dates too). |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | To substract to dates you can get them both as longs `getTime()` and subtract the values that are returned. | Create two [Calendar](http://download.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) objects from those Dates and then use the add() method (which can be used to subtrade dates too). |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | >
> ***how can i subtract these two Dates?***
>
>
>
You can get the difference in milliseconds like this:
```
dtEndDate.getTime() - dtStartDate.getTime()
```
([`getTime`](http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html#getTime%28%29) returns the number of milliseconds since January 1, 1970... | ```
long diffInMillis = dtEndDate.getTimeInMillis() - dtStartDate.getTimeInMillis();
``` |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | >
> ***how can i subtract these two Dates?***
>
>
>
You can get the difference in milliseconds like this:
```
dtEndDate.getTime() - dtStartDate.getTime()
```
([`getTime`](http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html#getTime%28%29) returns the number of milliseconds since January 1, 1970... | To substract to dates you can get them both as longs `getTime()` and subtract the values that are returned. |
6,537,023 | >
> **Possible Duplicate:**
>
> [How to calculate time difference in java?](https://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java)
>
>
>
Actually I want to subtract two dates in Java. I tried a lot but can't succeed. So anyone please help me.
```
Date dtStartDate=pCycMan.getStar... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/806106/"
] | ```
long msDiff = dtEndDate.getTime() - dtStartDate.getTime()
```
`msDiff` now holds the number of milliseconds difference between the two dates. Feel free to use the division and mod operators to convert to other units. | There is a framework to work with the date in java...
<http://joda-time.sourceforge.net/userguide.html>
take a look, i'm sure that it can help you |
67,583,870 | I am creating a Discord bot in Discord.js and I need your "+help". The `+help` command will display an embed containing all the relevant commands. However, when I make the embed, I get this error.
```js
TypeError: Cannot read property 'MessageEmbed' of undefined
```
If you are curious, here is my code in `help.js`:
... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67583870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15860183/"
] | Try using just MessageEmbed() remove Discord from execute as well so like
```py
module.exports = {
name: "help",
description: "Help embed.",
execute(message, args) {
const Help = new Discord.MessageEmbed()
.setColor("red")
.setTitle("Command List")
... | According to @Tyler2P's comment, I used `Discord` object in the `execute()` function in `help.js`, but I did not in `client.commands.get().execute()` in `main.js`. |
5,081,454 | I have built a FB4 application which accesses a .NET web service of a partner company. The app runs just fine in FB4 development environment, but won't work when published to my server. I can not figure out how to get past the following error:
>
> Security error accessing url Destination: DefaultHTTP
>
>
>
It is ... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5081454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/628711/"
] | Sounds like a cross domain policy issue. Check here <http://livedocs.adobe.com/flex/3/html/help.html?content=security2_04.html> for Adobe's advice. | I can't see any obvious reason to why this should not work in concept. So it's likely some minor detail tripping this up.
I would recommend using a web debug proxy to work out exactly what is going across the pipes, I personally prefer [Charles](http://www.charlesproxy.com/) but something like [Fiddler](http://www.fi... |
5,081,454 | I have built a FB4 application which accesses a .NET web service of a partner company. The app runs just fine in FB4 development environment, but won't work when published to my server. I can not figure out how to get past the following error:
>
> Security error accessing url Destination: DefaultHTTP
>
>
>
It is ... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5081454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/628711/"
] | Sounds like a cross domain policy issue. Check here <http://livedocs.adobe.com/flex/3/html/help.html?content=security2_04.html> for Adobe's advice. | Make sure you're using relative paths to get the url and not absolute, if you go to <http://mydomain.com> and it tries to get the proxy url from <http://www.mydomain.com> (www. subdomain) a security error will be thrown. |
21,580,391 | I'm not sure how to refer to what I need to do. So here is an example of the formatting.
```
Where ABC is the Actual Before Calculation
A is the total population of the US
XYB is the percentage that own their own homes
XYC is the percentage in a rural area
```
Notice how all the sentences are ali... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21580391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1573545/"
] | You could use a table, I did a quick JSFiddle:
```
<table>
<tr>
<td>Where ABC is</td>
<td>the Actual Before Calculation</td>
</tr>
<tr>
<td>Where A is</td>
<td>the total population of the US</td>
</tr>
</table>
```
[JSFiddle](http://jsfiddle.net/Z6fr5/1/)
With some CSS you can align the text of the ... | You'll have various solutions. Here's one building a `table` from your unformatted text using jQuery :
```
var lines = $('#a').text().split('\n');
$t = $('<table>').appendTo($('#a').empty());
lines.forEach(function(l){
var m = l.match(/(.*)( is )(.*)/);
if (m) $t.append('<tr><td>'+m[1]+'</td><td>'+m[2]+'</td><td>'... |
21,580,391 | I'm not sure how to refer to what I need to do. So here is an example of the formatting.
```
Where ABC is the Actual Before Calculation
A is the total population of the US
XYB is the percentage that own their own homes
XYC is the percentage in a rural area
```
Notice how all the sentences are ali... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21580391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1573545/"
] | You can use a **[Definition List](http://www.w3schools.com/tags/tag_dl.asp)** for this:
**HTML**
```
<dl>
<dt>Where ABC is</dt>
<dd>the Actual Before Calculation</dd>
<dt>A is</dt>
<dd>the total population of the US</dd>
<dt>XYB is</dt>
<dd>the percentage that own their own homes</dd>
<dt>... | You could use a table, I did a quick JSFiddle:
```
<table>
<tr>
<td>Where ABC is</td>
<td>the Actual Before Calculation</td>
</tr>
<tr>
<td>Where A is</td>
<td>the total population of the US</td>
</tr>
</table>
```
[JSFiddle](http://jsfiddle.net/Z6fr5/1/)
With some CSS you can align the text of the ... |
21,580,391 | I'm not sure how to refer to what I need to do. So here is an example of the formatting.
```
Where ABC is the Actual Before Calculation
A is the total population of the US
XYB is the percentage that own their own homes
XYC is the percentage in a rural area
```
Notice how all the sentences are ali... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21580391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1573545/"
] | This might help you <http://jsfiddle.net/Ytv8p/1/>
HTML
```
<div> <span class="a">Where ABC</span>
<span>is</span>
<span>the Actual Before Calculation.</span>
</div>
<div> <span class="a">A</span>
<span>is</span>
<span>the total population of the US</span>
</div>
<div> <span class="a">XYB</span>
<span>is</span... | You could use a table, I did a quick JSFiddle:
```
<table>
<tr>
<td>Where ABC is</td>
<td>the Actual Before Calculation</td>
</tr>
<tr>
<td>Where A is</td>
<td>the total population of the US</td>
</tr>
</table>
```
[JSFiddle](http://jsfiddle.net/Z6fr5/1/)
With some CSS you can align the text of the ... |
21,580,391 | I'm not sure how to refer to what I need to do. So here is an example of the formatting.
```
Where ABC is the Actual Before Calculation
A is the total population of the US
XYB is the percentage that own their own homes
XYC is the percentage in a rural area
```
Notice how all the sentences are ali... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21580391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1573545/"
] | You can use a **[Definition List](http://www.w3schools.com/tags/tag_dl.asp)** for this:
**HTML**
```
<dl>
<dt>Where ABC is</dt>
<dd>the Actual Before Calculation</dd>
<dt>A is</dt>
<dd>the total population of the US</dd>
<dt>XYB is</dt>
<dd>the percentage that own their own homes</dd>
<dt>... | You'll have various solutions. Here's one building a `table` from your unformatted text using jQuery :
```
var lines = $('#a').text().split('\n');
$t = $('<table>').appendTo($('#a').empty());
lines.forEach(function(l){
var m = l.match(/(.*)( is )(.*)/);
if (m) $t.append('<tr><td>'+m[1]+'</td><td>'+m[2]+'</td><td>'... |
21,580,391 | I'm not sure how to refer to what I need to do. So here is an example of the formatting.
```
Where ABC is the Actual Before Calculation
A is the total population of the US
XYB is the percentage that own their own homes
XYC is the percentage in a rural area
```
Notice how all the sentences are ali... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21580391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1573545/"
] | This might help you <http://jsfiddle.net/Ytv8p/1/>
HTML
```
<div> <span class="a">Where ABC</span>
<span>is</span>
<span>the Actual Before Calculation.</span>
</div>
<div> <span class="a">A</span>
<span>is</span>
<span>the total population of the US</span>
</div>
<div> <span class="a">XYB</span>
<span>is</span... | You'll have various solutions. Here's one building a `table` from your unformatted text using jQuery :
```
var lines = $('#a').text().split('\n');
$t = $('<table>').appendTo($('#a').empty());
lines.forEach(function(l){
var m = l.match(/(.*)( is )(.*)/);
if (m) $t.append('<tr><td>'+m[1]+'</td><td>'+m[2]+'</td><td>'... |
21,580,391 | I'm not sure how to refer to what I need to do. So here is an example of the formatting.
```
Where ABC is the Actual Before Calculation
A is the total population of the US
XYB is the percentage that own their own homes
XYC is the percentage in a rural area
```
Notice how all the sentences are ali... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21580391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1573545/"
] | You can use a **[Definition List](http://www.w3schools.com/tags/tag_dl.asp)** for this:
**HTML**
```
<dl>
<dt>Where ABC is</dt>
<dd>the Actual Before Calculation</dd>
<dt>A is</dt>
<dd>the total population of the US</dd>
<dt>XYB is</dt>
<dd>the percentage that own their own homes</dd>
<dt>... | This might help you <http://jsfiddle.net/Ytv8p/1/>
HTML
```
<div> <span class="a">Where ABC</span>
<span>is</span>
<span>the Actual Before Calculation.</span>
</div>
<div> <span class="a">A</span>
<span>is</span>
<span>the total population of the US</span>
</div>
<div> <span class="a">XYB</span>
<span>is</span... |
29,903,947 | Why am i getting 0. I is an auto variable, so it should print some garbage value, right? I am using gcc compiler.
```
#include "stdio.h"
void main() {
int i;
printf("%d\n", i);
}
``` | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4367335/"
] | >
> Does gcc initializes auto variable to 0?
>
>
>
Yes and No!
Actually uninitialized auto variables get **indeterminate value** (either an unspecified value or a trap representation**1**).
Using such variables in a program invoke undefined behavior-- *behavior, upon use of a nonportable or erroneous program... | Variables declared inside a function are uninitialized. One cannot predict what might show up if you print them out. in your example `main` is a function too. Hence it so happens that it is zero.
When you declare variable to be static or gloabally, the compiler will have them initialzed to zero. |
29,903,947 | Why am i getting 0. I is an auto variable, so it should print some garbage value, right? I am using gcc compiler.
```
#include "stdio.h"
void main() {
int i;
printf("%d\n", i);
}
``` | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4367335/"
] | >
> Does gcc initializes auto variable to 0?
>
>
>
Yes and No!
Actually uninitialized auto variables get **indeterminate value** (either an unspecified value or a trap representation**1**).
Using such variables in a program invoke undefined behavior-- *behavior, upon use of a nonportable or erroneous program... | No, I get random values with gcc (Debian 4.9.2-10) 4.9.2.
```
ofd@ofd-pc:~$ gcc '/home/ofd/Destkop/test.c'
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218415715
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218653283
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218845795
``` |
29,903,947 | Why am i getting 0. I is an auto variable, so it should print some garbage value, right? I am using gcc compiler.
```
#include "stdio.h"
void main() {
int i;
printf("%d\n", i);
}
``` | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4367335/"
] | >
> Does gcc initializes auto variable to 0?
>
>
>
Yes and No!
Actually uninitialized auto variables get **indeterminate value** (either an unspecified value or a trap representation**1**).
Using such variables in a program invoke undefined behavior-- *behavior, upon use of a nonportable or erroneous program... | It has become standard security practice for freshly allocated memory to be cleared (usually to 0) before being handed over by the OS. Don't want to be handing over memory that may have contained a password or private key! So, there's no guarantee what you'll get since the compiler is not guaranteeing to initialize it ... |
29,903,947 | Why am i getting 0. I is an auto variable, so it should print some garbage value, right? I am using gcc compiler.
```
#include "stdio.h"
void main() {
int i;
printf("%d\n", i);
}
``` | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4367335/"
] | No, I get random values with gcc (Debian 4.9.2-10) 4.9.2.
```
ofd@ofd-pc:~$ gcc '/home/ofd/Destkop/test.c'
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218415715
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218653283
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218845795
``` | Variables declared inside a function are uninitialized. One cannot predict what might show up if you print them out. in your example `main` is a function too. Hence it so happens that it is zero.
When you declare variable to be static or gloabally, the compiler will have them initialzed to zero. |
29,903,947 | Why am i getting 0. I is an auto variable, so it should print some garbage value, right? I am using gcc compiler.
```
#include "stdio.h"
void main() {
int i;
printf("%d\n", i);
}
``` | 2015/04/27 | [
"https://Stackoverflow.com/questions/29903947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4367335/"
] | No, I get random values with gcc (Debian 4.9.2-10) 4.9.2.
```
ofd@ofd-pc:~$ gcc '/home/ofd/Destkop/test.c'
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218415715
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218653283
ofd@ofd-pc:~$ '/home/ofd/Desktop/a.out'
-1218845795
``` | It has become standard security practice for freshly allocated memory to be cleared (usually to 0) before being handed over by the OS. Don't want to be handing over memory that may have contained a password or private key! So, there's no guarantee what you'll get since the compiler is not guaranteeing to initialize it ... |
24,969,577 | There are some filters out there but there are no working Java only solutions or some useful libraries. I am using Spring MVC with Tomcat and deploy release to Heroku (so cannot change servlet container configuration). How to enable REST gzip compression in Spring MVC without XML? | 2014/07/26 | [
"https://Stackoverflow.com/questions/24969577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1809513/"
] | You could set the rule for using compression on your servlet container, for example apache-tomcat you could use the compression property. From [documentation](https://tomcat.apache.org/tomcat-8.0-doc/config/http.html):
>
> **compression**
>
>
> The Connector may use HTTP/1.1 GZIP compression in an attempt to save
>... | One option is to change to Spring Boot and use an embedded Tomcat. Then you can use the `ConfigurableEmbeddedServletContainer` as suggested by [Andy Wilkinson](https://stackoverflow.com/users/1384297/andy-wilkinson) and myself in the answers to [this question](https://stackoverflow.com/questions/21410317/using-gzip-com... |
33,545,424 | I have a google spreadsheet that contains a list of email addresses. It's a contact list of sorts. I would like to have a function that opens a gmail new mail message window with these adresses (or some sub-set of them) so I can then complete the email and send.
The [Sending Email tutorial](https://developers.google.c... | 2015/11/05 | [
"https://Stackoverflow.com/questions/33545424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995013/"
] | There is no way for Google Apps Script to interact with the GMail User Interface.
An alternative would be to produce a `mailto:` link with a [prefilled message URL](https://stackoverflow.com/questions/2583928/prefilling-gmail-compose-screen-with-html-text), and present that to the user in a dialog or sidebar in your ... | yes this is (sort of) possible.
1. make a webapp with a button to create the email.
2. create a draft email as you wish using the gmail api in advanced services (see [How to use the Google Apps Script code for creating a Draft email (from 985)?](https://stackoverflow.com/q/25391740/2213940))
3. provide a link in your ... |
33,545,424 | I have a google spreadsheet that contains a list of email addresses. It's a contact list of sorts. I would like to have a function that opens a gmail new mail message window with these adresses (or some sub-set of them) so I can then complete the email and send.
The [Sending Email tutorial](https://developers.google.c... | 2015/11/05 | [
"https://Stackoverflow.com/questions/33545424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995013/"
] | There is no way for Google Apps Script to interact with the GMail User Interface.
An alternative would be to produce a `mailto:` link with a [prefilled message URL](https://stackoverflow.com/questions/2583928/prefilling-gmail-compose-screen-with-html-text), and present that to the user in a dialog or sidebar in your ... | Thanks for your suggestions. It seems that there are several work arounds.
As my email needs are repetitively simple I ended up using a function that opens a really simple dialog box, with a text boxs for reciepients (which I can prepopulate if necessary) and subject and a text area for the message. The send button ha... |
33,545,424 | I have a google spreadsheet that contains a list of email addresses. It's a contact list of sorts. I would like to have a function that opens a gmail new mail message window with these adresses (or some sub-set of them) so I can then complete the email and send.
The [Sending Email tutorial](https://developers.google.c... | 2015/11/05 | [
"https://Stackoverflow.com/questions/33545424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995013/"
] | yes this is (sort of) possible.
1. make a webapp with a button to create the email.
2. create a draft email as you wish using the gmail api in advanced services (see [How to use the Google Apps Script code for creating a Draft email (from 985)?](https://stackoverflow.com/q/25391740/2213940))
3. provide a link in your ... | Thanks for your suggestions. It seems that there are several work arounds.
As my email needs are repetitively simple I ended up using a function that opens a really simple dialog box, with a text boxs for reciepients (which I can prepopulate if necessary) and subject and a text area for the message. The send button ha... |
39,523,726 | Say for example I have a table that contains a description of a customer's activities while in a cafe. (Metaphor of the actual table I am working on)
```
Customer Borrowed Book Ordered Drink Has Company
1 1
1 1
1 ... | 2016/09/16 | [
"https://Stackoverflow.com/questions/39523726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6596647/"
] | As per your comment, initial table is a temp table,
Try to make the result as a cte result, then do aggregation on that, like the below query.
```
; WITH cte_1
AS
( //your query to return the result set)
SELECT customer,sum([borrowed book]) BorrowedBook,
sum([ordered drink]) OrderedDrink,
... | Use **Group By:**
```
DECLARE @tblTest as Table(
Customer INT,
BorrowedBook INT,
OrderedDrink INT,
HasCompany BIt
)
INSERT INTO @tblTest VALUES
(1,1,NULL,NULL)
,(1,NULL,1,NULL)
,(1,NULL,NULL,1)
,(2,NULL,1,NULL)
,(3,NULL,1,NULL)
,(3,NULL,NULL,1)
,(4,1,1,NULL)
,(4,NULL,1,NULL)
SELECT
Customer,
... |
39,523,726 | Say for example I have a table that contains a description of a customer's activities while in a cafe. (Metaphor of the actual table I am working on)
```
Customer Borrowed Book Ordered Drink Has Company
1 1
1 1
1 ... | 2016/09/16 | [
"https://Stackoverflow.com/questions/39523726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6596647/"
] | As per your comment, initial table is a temp table,
Try to make the result as a cte result, then do aggregation on that, like the below query.
```
; WITH cte_1
AS
( //your query to return the result set)
SELECT customer,sum([borrowed book]) BorrowedBook,
sum([ordered drink]) OrderedDrink,
... | Not sure, why you are getting error with group by.
Your coalesce should be correct. Refer below way.
```
Select customer
, case when [borrowed] = 0 then NULL else [borrowed] end as [borrowed]
, case when [ordered] = 0 then NULL else [ordered] end as [ordered]
, case when [company] = 1 then 'Yes' end as company
from
... |
39,523,726 | Say for example I have a table that contains a description of a customer's activities while in a cafe. (Metaphor of the actual table I am working on)
```
Customer Borrowed Book Ordered Drink Has Company
1 1
1 1
1 ... | 2016/09/16 | [
"https://Stackoverflow.com/questions/39523726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6596647/"
] | You can do this by **group by**,
```
select Customer,sum([borrowed book]), sum([ordered drink]), max([has company])
from customeractivity group by Customer
``` | Use **Group By:**
```
DECLARE @tblTest as Table(
Customer INT,
BorrowedBook INT,
OrderedDrink INT,
HasCompany BIt
)
INSERT INTO @tblTest VALUES
(1,1,NULL,NULL)
,(1,NULL,1,NULL)
,(1,NULL,NULL,1)
,(2,NULL,1,NULL)
,(3,NULL,1,NULL)
,(3,NULL,NULL,1)
,(4,1,1,NULL)
,(4,NULL,1,NULL)
SELECT
Customer,
... |
39,523,726 | Say for example I have a table that contains a description of a customer's activities while in a cafe. (Metaphor of the actual table I am working on)
```
Customer Borrowed Book Ordered Drink Has Company
1 1
1 1
1 ... | 2016/09/16 | [
"https://Stackoverflow.com/questions/39523726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6596647/"
] | You can do this by **group by**,
```
select Customer,sum([borrowed book]), sum([ordered drink]), max([has company])
from customeractivity group by Customer
``` | Not sure, why you are getting error with group by.
Your coalesce should be correct. Refer below way.
```
Select customer
, case when [borrowed] = 0 then NULL else [borrowed] end as [borrowed]
, case when [ordered] = 0 then NULL else [ordered] end as [ordered]
, case when [company] = 1 then 'Yes' end as company
from
... |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | The main problem is that the rule you are using assumes $a$ is a constant. Whilst your problem is most definitely not.
$$
u(x) = f(x)^{g(x)} = \mathrm{e}^{g\ln f}
$$
which means
$$
u'(x) = \left(g'(x) \ln f(x) + \frac{g(x)}{f(x)}f'(x)\right)f(x)^{g(x)}
$$ | $${ \left( { \sin { x } }^{ \cos { x } } \right) }^{ \prime }={ \left( { e }^{ \cos { x } \ln { \sin { x } } } \right) }^{ \prime }={ e }^{ \cos { x } \ln { \sin { x } } }\left( -\sin { x } \ln { \left( \sin { x } \right) +\frac { \cos ^{ 2 }{ x } }{ \sin { x } } } \right) \\ $$ |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | $${ \left( { \sin { x } }^{ \cos { x } } \right) }^{ \prime }={ \left( { e }^{ \cos { x } \ln { \sin { x } } } \right) }^{ \prime }={ e }^{ \cos { x } \ln { \sin { x } } }\left( -\sin { x } \ln { \left( \sin { x } \right) +\frac { \cos ^{ 2 }{ x } }{ \sin { x } } } \right) \\ $$ | Write the function as
$$
y=e^{\cos x \ln(\sin x)}
$$
so
$$
y'=e^{\cos x \ln(\sin x)}\left[-\sin x \ln(\sin x) +\frac{\cos x}{\sin x} \cos x \right]
$$ |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | Note your answer is incorrect, since the formula you quoted requires $a$ to be a constant
Let $y=\sin x^{\cos x}$
$$\ln y = \cos x\ln(\sin x)$$
$$\frac{1}{y} \frac{dy}{dx} = -\sin x\ln(\sin x)+\cos x\cdot\frac{\cos x}{\sin x}$$
$$\frac{dy}{dx} = \sin x^{\cos x}\bigg(\frac{\cos^2x}{\sin x} -\sin x\ln(\sin x)\bigg) $... | $${ \left( { \sin { x } }^{ \cos { x } } \right) }^{ \prime }={ \left( { e }^{ \cos { x } \ln { \sin { x } } } \right) }^{ \prime }={ e }^{ \cos { x } \ln { \sin { x } } }\left( -\sin { x } \ln { \left( \sin { x } \right) +\frac { \cos ^{ 2 }{ x } }{ \sin { x } } } \right) \\ $$ |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | I suggest you start here:
$(\sin x)^{cos x} = e^{\cos x \ln (\sin x)}$
As you differentiate don't lose track of the product rule and the chain rule.
$\frac d{dx} e^{\cos x \ln \sin x} = e^{\cos x \ln \sin x} \frac d{dx} (\cos x\ln (\sin x))\\
e^{\cos x \ln \sin x} (-\sin x \ln (\sin x) + \frac {cos x}{\sin x}(\frac ... | $${ \left( { \sin { x } }^{ \cos { x } } \right) }^{ \prime }={ \left( { e }^{ \cos { x } \ln { \sin { x } } } \right) }^{ \prime }={ e }^{ \cos { x } \ln { \sin { x } } }\left( -\sin { x } \ln { \left( \sin { x } \right) +\frac { \cos ^{ 2 }{ x } }{ \sin { x } } } \right) \\ $$ |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | The main problem is that the rule you are using assumes $a$ is a constant. Whilst your problem is most definitely not.
$$
u(x) = f(x)^{g(x)} = \mathrm{e}^{g\ln f}
$$
which means
$$
u'(x) = \left(g'(x) \ln f(x) + \frac{g(x)}{f(x)}f'(x)\right)f(x)^{g(x)}
$$ | Write the function as
$$
y=e^{\cos x \ln(\sin x)}
$$
so
$$
y'=e^{\cos x \ln(\sin x)}\left[-\sin x \ln(\sin x) +\frac{\cos x}{\sin x} \cos x \right]
$$ |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | The main problem is that the rule you are using assumes $a$ is a constant. Whilst your problem is most definitely not.
$$
u(x) = f(x)^{g(x)} = \mathrm{e}^{g\ln f}
$$
which means
$$
u'(x) = \left(g'(x) \ln f(x) + \frac{g(x)}{f(x)}f'(x)\right)f(x)^{g(x)}
$$ | Note your answer is incorrect, since the formula you quoted requires $a$ to be a constant
Let $y=\sin x^{\cos x}$
$$\ln y = \cos x\ln(\sin x)$$
$$\frac{1}{y} \frac{dy}{dx} = -\sin x\ln(\sin x)+\cos x\cdot\frac{\cos x}{\sin x}$$
$$\frac{dy}{dx} = \sin x^{\cos x}\bigg(\frac{\cos^2x}{\sin x} -\sin x\ln(\sin x)\bigg) $... |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | The main problem is that the rule you are using assumes $a$ is a constant. Whilst your problem is most definitely not.
$$
u(x) = f(x)^{g(x)} = \mathrm{e}^{g\ln f}
$$
which means
$$
u'(x) = \left(g'(x) \ln f(x) + \frac{g(x)}{f(x)}f'(x)\right)f(x)^{g(x)}
$$ | I suggest you start here:
$(\sin x)^{cos x} = e^{\cos x \ln (\sin x)}$
As you differentiate don't lose track of the product rule and the chain rule.
$\frac d{dx} e^{\cos x \ln \sin x} = e^{\cos x \ln \sin x} \frac d{dx} (\cos x\ln (\sin x))\\
e^{\cos x \ln \sin x} (-\sin x \ln (\sin x) + \frac {cos x}{\sin x}(\frac ... |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | Note your answer is incorrect, since the formula you quoted requires $a$ to be a constant
Let $y=\sin x^{\cos x}$
$$\ln y = \cos x\ln(\sin x)$$
$$\frac{1}{y} \frac{dy}{dx} = -\sin x\ln(\sin x)+\cos x\cdot\frac{\cos x}{\sin x}$$
$$\frac{dy}{dx} = \sin x^{\cos x}\bigg(\frac{\cos^2x}{\sin x} -\sin x\ln(\sin x)\bigg) $... | Write the function as
$$
y=e^{\cos x \ln(\sin x)}
$$
so
$$
y'=e^{\cos x \ln(\sin x)}\left[-\sin x \ln(\sin x) +\frac{\cos x}{\sin x} \cos x \right]
$$ |
2,240,755 | In a regular heptagon, all diagonals are drawn. Then points $A$, $B$, and $C$ in the diagram below are collinear:
[](https://i.stack.imgur.com/cuSzo.png)
(If the vertices of the pentagon are $P\_1, \dots, P\_7$ in clockwise order, then $A = P\_1$, $B$ is the intersectio... | 2017/04/18 | [
"https://math.stackexchange.com/questions/2240755",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/383078/"
] | I suggest you start here:
$(\sin x)^{cos x} = e^{\cos x \ln (\sin x)}$
As you differentiate don't lose track of the product rule and the chain rule.
$\frac d{dx} e^{\cos x \ln \sin x} = e^{\cos x \ln \sin x} \frac d{dx} (\cos x\ln (\sin x))\\
e^{\cos x \ln \sin x} (-\sin x \ln (\sin x) + \frac {cos x}{\sin x}(\frac ... | Write the function as
$$
y=e^{\cos x \ln(\sin x)}
$$
so
$$
y'=e^{\cos x \ln(\sin x)}\left[-\sin x \ln(\sin x) +\frac{\cos x}{\sin x} \cos x \right]
$$ |
72,645,168 | I am after some help with a bit of complex dataframe management/column creation.
I have a data frame that looks something like this:
```
dat <- data.frame(Target = sort(rep(c("1", "2", "3", "4"), times = 5)),
targ1frames_x = c(0.42, 0.46, 0.50, 0.60, 0.86, 0.32, 0.56,
... | 2022/06/16 | [
"https://Stackoverflow.com/questions/72645168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16958042/"
] | We could do it this way.
Here demonstrated for `targ1frames_x` (for `targ1frames_y` the code needs to be adapted):
```
library(dplyr)
dat %>%
group_by(Target) %>%
mutate(diff_x = targ1frames_x - lag(targ1frames_x)) %>%
filter(diff_x >= 0.2) %>%
slice(1) %>%
select(Target, targ1frames_time)
Target t... | ```
dat %>%
mutate(diff_row_x = targ1frames_x - lag(targ1frames_x , default = first(targ1frames_x )))%>%
mutate(diff_row_y = targ1frames_y - lag(targ1frames_y , default = first(targ1frames_y )))%>%
filter(!(diff_row_x & diff_row_y <=0.2))
```
Now I understand your question, this code is more appropriate tha... |
72,645,168 | I am after some help with a bit of complex dataframe management/column creation.
I have a data frame that looks something like this:
```
dat <- data.frame(Target = sort(rep(c("1", "2", "3", "4"), times = 5)),
targ1frames_x = c(0.42, 0.46, 0.50, 0.60, 0.86, 0.32, 0.56,
... | 2022/06/16 | [
"https://Stackoverflow.com/questions/72645168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16958042/"
] | We could do it this way.
Here demonstrated for `targ1frames_x` (for `targ1frames_y` the code needs to be adapted):
```
library(dplyr)
dat %>%
group_by(Target) %>%
mutate(diff_x = targ1frames_x - lag(targ1frames_x)) %>%
filter(diff_x >= 0.2) %>%
slice(1) %>%
select(Target, targ1frames_time)
Target t... | I realised I had not done an amazing job of explaining what I was trying to do, so these solutions did not entirely work, though they gave me the building blocks to get there! Thanks so much for all of your help. Here is what I did in the end:
```
#Change columns to correct class
dat2 <-dat %>%
mutate(targ1frames_x ... |
12,187,842 | In the website on which I'm working, users may send messages to each other. I want users to be able to use text-style tags such as < b > , < i > , and < u > to make text bold, italic and underlined respectively. But, in fact, I don't want to be XSSed with those < script > tags. Or perhaps a < b > with a mouseover attri... | 2012/08/29 | [
"https://Stackoverflow.com/questions/12187842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/684397/"
] | If you want to write to a log file don't use `Write-Host`. Use `Write-Output` or don't use `Write-*` at all because `Write-Output` is the default e.g:
```
Write-Output 'hello' > foo.txt
```
is equivalent to:
```
'hello' > foo.txt
```
`Write-Output` sends output to the stdout stream (ie 1). Use `Write-Error` to se... | I would use `Start-Transcript`. The only caveat is that it doesn't capture standard output, only output from `Write-Host`. So, you just have to pipe the output from legacy command line applications to `Write-Host`:
```
Start-Transcript -Path C:\logs\mylog.log
program.exe | Write-Host
``` |
57,571,510 | I am working on an iOS 11+ app and would like to create a view like in this picture:
[](https://i.stack.imgur.com/6YrHQ.png)
The two labels are positioned to work as columns of different height depending on the label content. The content of both labels is variable due to cu... | 2019/08/20 | [
"https://Stackoverflow.com/questions/57571510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777861/"
] | [](https://i.stack.imgur.com/dJxW6.png)
You can add labels to stackView | One way to do this is to assign equal height constraint to both label. By doing this height of label will always be equal to large label (Label with more content).
You can do this by selecting both labels and adding equal height constraint as mentioned in screen short.
[](https://i.stack.imgur.com/6YrHQ.png)
The two labels are positioned to work as columns of different height depending on the label content. The content of both labels is variable due to cu... | 2019/08/20 | [
"https://Stackoverflow.com/questions/57571510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777861/"
] | [](https://i.stack.imgur.com/dJxW6.png)
You can add labels to stackView | The answer given as <https://stackoverflow.com/a/57571805/341994> does work, but it is not very educational. "Use a stack view." Yes, but what is a stack view? It is a view that makes constraints for you. It is not magic. What the stack view does, you can do. An ordinary view surrounding the two labels and sizing itsel... |
15,297,557 | I have a line of code that is : `File file = new File(getFile())` in a java class `HandleData.java`
Method - `getFile()` takes the value of the property `fileName`. And `fileName` is injected through `application_context.xml` with a bean section of the class - HandleData as below:
```
<bean id="dataHandler" class="c... | 2013/03/08 | [
"https://Stackoverflow.com/questions/15297557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893135/"
] | While injecting a `File` is generally the preferred approach, you can also leverage Spring's ResourceLoader for dynamic loading of resources.
Generally this is as simple as injecting the `ResourceLoader` into your Spring bean:
```
@Autowired
private ResourceLoader resourceLoader;
```
Then to load from the classpath... | You should have:
```
<property name="fileName" value="classpath:DataFile.xml" />
```
And it should be injected as a `org.springframework.core.io.Resource` similar to [this answer](https://stackoverflow.com/a/7486582/516433) |
15,297,557 | I have a line of code that is : `File file = new File(getFile())` in a java class `HandleData.java`
Method - `getFile()` takes the value of the property `fileName`. And `fileName` is injected through `application_context.xml` with a bean section of the class - HandleData as below:
```
<bean id="dataHandler" class="c... | 2013/03/08 | [
"https://Stackoverflow.com/questions/15297557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893135/"
] | While injecting a `File` is generally the preferred approach, you can also leverage Spring's ResourceLoader for dynamic loading of resources.
Generally this is as simple as injecting the `ResourceLoader` into your Spring bean:
```
@Autowired
private ResourceLoader resourceLoader;
```
Then to load from the classpath... | Since OP is injecting Only the fileName through spring, still want to create the File Object through code ,
You should Use ClassLoadeer to read the file
Try this
```
InputStream is = HandleData.class.getClassLoader().getResourceAsStream(getFile()));
```
**Edit**
Heres the remainder of code , to read the file
`... |
14,489,632 | Below is some example code I use to make some boxplots:
```
stest <- read.table(text=" site year conc
south 2001 5.3
south 2001 4.67
south 2001 4.98
south 2002 5.76
south 2002 5.93
north 2001 4.64
north 2001 6.32
north 2003 11.5
north ... | 2013/01/23 | [
"https://Stackoverflow.com/questions/14489632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2005342/"
] | Use the `scales='free.x'` argument to `facet_wrap`. But I suspect you'll need to do more than that to get the plot you're looking for.
Specifically `aes(x=factor(year), y=conc)` in your initial `ggplot` call. | A simple way to circumvent your problem (with a fairly good result):
generate separately the two boxplots and then join them together using the `grid.arrange` command of the `gridExtra` package.
```
library(gridExtra)
p1 <- ggplot(subset(stest,site=="north"), aes(x=factor(year), y=conc)) +
geom_boxplot(horizonta... |
28,662,450 | I'm trying to create a makefile that will compile two files:
-main.cpp
-queue.h
Inside of the header file I have the a full implementation of a template Queue class. The main file includes the header file.
I can test this code in the terminal (on a Mac) by typing this in:
```
g++ -c main.cpp
g++ -o queue main.o
```
... | 2015/02/22 | [
"https://Stackoverflow.com/questions/28662450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4594551/"
] | ```
# All the targets
all: queue
# Dependencies and rule to make queue
queue: main.o
g++ -o queue main.o
# Dependencies and rule to make main.o
main.o: main.cpp queue.h
g++ -c main.cpp
clean:
rm queue main.o
``` | R Sahu's answer is correct, but note that you can do a lot better (less typing) by taking advantage of GNU make's built-in rules, which already know how to do this stuff.
In particular, if you rename your `main.cpp` file to `queue.cpp` (so that it has the same prefix as the program you want to generate, `queue`), your... |
51,097,743 | I've seen lots of questions about this but I still can't solve my problem.
I have a fragment called `CameraFragment.java` which opens a camera and saves the taken picture. The problem is, to save that I need to have WRITE\_EXTERNAL\_STORAGE permissions... I've added these lines to my Manifest.xml:
`<uses-permission an... | 2018/06/29 | [
"https://Stackoverflow.com/questions/51097743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9995448/"
] | [Click here](http://github.com/Karumi/Dexter) for run time permissions! please look into this github.com/Karumi/Dexter | Here is a class, with a method asking for storage permission
```
public class PermissionManager {
public static boolean checkPermissionREAD_EXTERNAL_STORAGE(final Context context) {
int currentAPIVersion = Build.VERSION.SDK_INT;
if (currentAPIVersion >= android.os.Build.VERSION_CODES.M) {
if (ContextC... |
51,097,743 | I've seen lots of questions about this but I still can't solve my problem.
I have a fragment called `CameraFragment.java` which opens a camera and saves the taken picture. The problem is, to save that I need to have WRITE\_EXTERNAL\_STORAGE permissions... I've added these lines to my Manifest.xml:
`<uses-permission an... | 2018/06/29 | [
"https://Stackoverflow.com/questions/51097743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9995448/"
] | [Click here](http://github.com/Karumi/Dexter) for run time permissions! please look into this github.com/Karumi/Dexter | You can use [PermissionDispatcher](https://github.com/codepath/android_guides/wiki/Managing-Runtime-Permissions-with-PermissionsDispatcher) to handle it very gently AFAIK it works in all versions.
Hope this will help you |
51,097,743 | I've seen lots of questions about this but I still can't solve my problem.
I have a fragment called `CameraFragment.java` which opens a camera and saves the taken picture. The problem is, to save that I need to have WRITE\_EXTERNAL\_STORAGE permissions... I've added these lines to my Manifest.xml:
`<uses-permission an... | 2018/06/29 | [
"https://Stackoverflow.com/questions/51097743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9995448/"
] | Here is a class, with a method asking for storage permission
```
public class PermissionManager {
public static boolean checkPermissionREAD_EXTERNAL_STORAGE(final Context context) {
int currentAPIVersion = Build.VERSION.SDK_INT;
if (currentAPIVersion >= android.os.Build.VERSION_CODES.M) {
if (ContextC... | You can use [PermissionDispatcher](https://github.com/codepath/android_guides/wiki/Managing-Runtime-Permissions-with-PermissionsDispatcher) to handle it very gently AFAIK it works in all versions.
Hope this will help you |
67,522,333 | I am using `springdoc` with `spring-boot` configured mostly with annotations.
I would like to expose a particular class schema which is not referenced by any service. Is it possible to do this?
In pseudocode, I am effectively trying to do this:
`GroupedOpenAPI.parseAndAddClass(Class<?> clazz);`
or
`GroupedOpenAPI.... | 2021/05/13 | [
"https://Stackoverflow.com/questions/67522333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1243436/"
] | In the SpringDoc, you can add a non-related class to the generated specification using `OpenApiCustomiser`
```
@Bean
public OpenApiCustomiser schemaCustomiser() {
ResolvedSchema resolvedSchema = ModelConverters.getInstance()
.resolveAsResolvedSchema(new AnnotatedType(MyClass.class));
return openApi... | The accepted answer is correct, however this will only add the schema for "MyClass.class". If there are any classes referenced from `MyClass.class` which are not in the schemas, they won't be added. I managed to add all classes like this:
```
private OpenApiCustomiser addAdditionalModels() {
Map<String, Schema> sc... |
67,522,333 | I am using `springdoc` with `spring-boot` configured mostly with annotations.
I would like to expose a particular class schema which is not referenced by any service. Is it possible to do this?
In pseudocode, I am effectively trying to do this:
`GroupedOpenAPI.parseAndAddClass(Class<?> clazz);`
or
`GroupedOpenAPI.... | 2021/05/13 | [
"https://Stackoverflow.com/questions/67522333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1243436/"
] | In the SpringDoc, you can add a non-related class to the generated specification using `OpenApiCustomiser`
```
@Bean
public OpenApiCustomiser schemaCustomiser() {
ResolvedSchema resolvedSchema = ModelConverters.getInstance()
.resolveAsResolvedSchema(new AnnotatedType(MyClass.class));
return openApi... | I tested both solutions with following dependencies:
```
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codeg... |
67,522,333 | I am using `springdoc` with `spring-boot` configured mostly with annotations.
I would like to expose a particular class schema which is not referenced by any service. Is it possible to do this?
In pseudocode, I am effectively trying to do this:
`GroupedOpenAPI.parseAndAddClass(Class<?> clazz);`
or
`GroupedOpenAPI.... | 2021/05/13 | [
"https://Stackoverflow.com/questions/67522333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1243436/"
] | In the SpringDoc, you can add a non-related class to the generated specification using `OpenApiCustomiser`
```
@Bean
public OpenApiCustomiser schemaCustomiser() {
ResolvedSchema resolvedSchema = ModelConverters.getInstance()
.resolveAsResolvedSchema(new AnnotatedType(MyClass.class));
return openApi... | With `GroupedOpenApi` (schema must be set manually):
```
@Bean
GroupedOpenApi api() {
return GroupedOpenApi.builder()
.group("REST API")
.addOpenApiCustomizer(openApi -> {
openApi.addSecurityItem(new SecurityRequirement().addList("Authorization"))
... |
20,594,498 | I had task to copy and delete a huge folder using win32 api (C++), I am using the Code Guru recurisive directory deletion code, which works well, but there arises certain question.
[RemoveDirectory](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365488%28v=vs.85%29.aspx)
>
> **Million thanks to Lerooooy ... | 2013/12/15 | [
"https://Stackoverflow.com/questions/20594498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2056430/"
] | Use [`DeleteFile`](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363915%28v=vs.85%29.aspx) to delete file symbolic links.
Use [`RemoveDirectory`](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365488%28v=vs.85%29.aspx) to delete directory symbolic links and junctions.
In other words, you treat ... | The simplest way to achieve your goal, and the recommended way to do it, is to get the system to do the work.
* If you need to support XP then you use [`SHFileOperation`](http://msdn.microsoft.com/en-us/library/windows/desktop/bb762164.aspx) with the `FO_DELETE` flag.
* Otherwise, for Vista and later, use [`IFileOpera... |
9,178,718 | I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .
```
*:focus { outline:none; }
input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box... | 2012/02/07 | [
"https://Stackoverflow.com/questions/9178718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192687/"
] | Try this:
```
* {
outline-color: lime;
}
``` | Most effective solution on Links only:
```
a:focus, a:active{
outline:none;
}
```
Or you can disable global:
```
*{
outline:none;
}
``` |
9,178,718 | I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .
```
*:focus { outline:none; }
input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box... | 2012/02/07 | [
"https://Stackoverflow.com/questions/9178718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192687/"
] | Try this:
```
* {
outline-color: lime;
}
``` | This should also do the trick:
```
a:focus, a:active {
outline-color: transparent !important;
}
``` |
9,178,718 | I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .
```
*:focus { outline:none; }
input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box... | 2012/02/07 | [
"https://Stackoverflow.com/questions/9178718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192687/"
] | Try this:
```
* {
outline-color: lime;
}
``` | for me this worked
```
:focus {
outline: -webkit-focus-ring-color auto 0;
}
``` |
9,178,718 | I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .
```
*:focus { outline:none; }
input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box... | 2012/02/07 | [
"https://Stackoverflow.com/questions/9178718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192687/"
] | This should also do the trick:
```
a:focus, a:active {
outline-color: transparent !important;
}
``` | Most effective solution on Links only:
```
a:focus, a:active{
outline:none;
}
```
Or you can disable global:
```
*{
outline:none;
}
``` |
9,178,718 | I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .
```
*:focus { outline:none; }
input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box... | 2012/02/07 | [
"https://Stackoverflow.com/questions/9178718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192687/"
] | for me this worked
```
:focus {
outline: -webkit-focus-ring-color auto 0;
}
``` | Most effective solution on Links only:
```
a:focus, a:active{
outline:none;
}
```
Or you can disable global:
```
*{
outline:none;
}
``` |
9,178,718 | I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .
```
*:focus { outline:none; }
input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box... | 2012/02/07 | [
"https://Stackoverflow.com/questions/9178718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1192687/"
] | for me this worked
```
:focus {
outline: -webkit-focus-ring-color auto 0;
}
``` | This should also do the trick:
```
a:focus, a:active {
outline-color: transparent !important;
}
``` |
34,737,272 | In Azure there are 2 options available to create virtual machines.
A. normal VM
B. Classic VM
Does anybody know what is the difference between both option? When do we use one over other? | 2016/01/12 | [
"https://Stackoverflow.com/questions/34737272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1136425/"
] | The Azure Virtual Machine (classic) is based on the old Azure Service Management Model (ASM). Which revolved around the concept of a cloud service. Everything was contained inside a cloud service, and that was the gateway to the internet. While it is still used (extensively) Azure is now moving over to the Azure Resour... | The one big differences is for resource management. For that new version is called Azure Resource Manager VM (ARM VM).
ARM VM is better in terms of;
* Classic VM must be tied with *Cloud Service*, and Cloud Service consumes resource limitation and not-so-flexible network configuration.
* ARM VM is managed under Azure... |
34,737,272 | In Azure there are 2 options available to create virtual machines.
A. normal VM
B. Classic VM
Does anybody know what is the difference between both option? When do we use one over other? | 2016/01/12 | [
"https://Stackoverflow.com/questions/34737272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1136425/"
] | Short answer to your question is `Normal VM or Virtual Machines` is the new way of deploying your Virtual Machines whereas `Classic VM or Virtual Machines (Classic)` is the old way of deploying them. Azure is pushing towards the new way of deploying resources so the recommendation would be to use it instead of old way.... | The Azure Virtual Machine (classic) is based on the old Azure Service Management Model (ASM). Which revolved around the concept of a cloud service. Everything was contained inside a cloud service, and that was the gateway to the internet. While it is still used (extensively) Azure is now moving over to the Azure Resour... |
34,737,272 | In Azure there are 2 options available to create virtual machines.
A. normal VM
B. Classic VM
Does anybody know what is the difference between both option? When do we use one over other? | 2016/01/12 | [
"https://Stackoverflow.com/questions/34737272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1136425/"
] | The Azure Virtual Machine (classic) is based on the old Azure Service Management Model (ASM). Which revolved around the concept of a cloud service. Everything was contained inside a cloud service, and that was the gateway to the internet. While it is still used (extensively) Azure is now moving over to the Azure Resour... | Azure provides two deploy models now: Azure Resource Manager(Normal) and Azure Service Management(Classic) and some [important considerations](https://azure.microsoft.com/en-us/documentation/articles/resource-manager-deployment-model#considerations-for-virtual-machines) you should care when working Virtual Machines.
1... |
34,737,272 | In Azure there are 2 options available to create virtual machines.
A. normal VM
B. Classic VM
Does anybody know what is the difference between both option? When do we use one over other? | 2016/01/12 | [
"https://Stackoverflow.com/questions/34737272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1136425/"
] | Short answer to your question is `Normal VM or Virtual Machines` is the new way of deploying your Virtual Machines whereas `Classic VM or Virtual Machines (Classic)` is the old way of deploying them. Azure is pushing towards the new way of deploying resources so the recommendation would be to use it instead of old way.... | The one big differences is for resource management. For that new version is called Azure Resource Manager VM (ARM VM).
ARM VM is better in terms of;
* Classic VM must be tied with *Cloud Service*, and Cloud Service consumes resource limitation and not-so-flexible network configuration.
* ARM VM is managed under Azure... |
34,737,272 | In Azure there are 2 options available to create virtual machines.
A. normal VM
B. Classic VM
Does anybody know what is the difference between both option? When do we use one over other? | 2016/01/12 | [
"https://Stackoverflow.com/questions/34737272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1136425/"
] | The one big differences is for resource management. For that new version is called Azure Resource Manager VM (ARM VM).
ARM VM is better in terms of;
* Classic VM must be tied with *Cloud Service*, and Cloud Service consumes resource limitation and not-so-flexible network configuration.
* ARM VM is managed under Azure... | Azure provides two deploy models now: Azure Resource Manager(Normal) and Azure Service Management(Classic) and some [important considerations](https://azure.microsoft.com/en-us/documentation/articles/resource-manager-deployment-model#considerations-for-virtual-machines) you should care when working Virtual Machines.
1... |
34,737,272 | In Azure there are 2 options available to create virtual machines.
A. normal VM
B. Classic VM
Does anybody know what is the difference between both option? When do we use one over other? | 2016/01/12 | [
"https://Stackoverflow.com/questions/34737272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1136425/"
] | Short answer to your question is `Normal VM or Virtual Machines` is the new way of deploying your Virtual Machines whereas `Classic VM or Virtual Machines (Classic)` is the old way of deploying them. Azure is pushing towards the new way of deploying resources so the recommendation would be to use it instead of old way.... | Azure provides two deploy models now: Azure Resource Manager(Normal) and Azure Service Management(Classic) and some [important considerations](https://azure.microsoft.com/en-us/documentation/articles/resource-manager-deployment-model#considerations-for-virtual-machines) you should care when working Virtual Machines.
1... |
70,374,067 | ```cpp
#include <stdio.h>
int main()
{
int arr[] = {10, 20, 30, 8, 2};
int index = -1, ele;
printf("Enter the elment you want to search :");
scanf("%d", ele);
for (int i = 0; i < 5; i++)
{
if (arr[i] == ele)
;
index = i;
break;
}
if (index == -1)
... | 2021/12/16 | [
"https://Stackoverflow.com/questions/70374067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16166780/"
] | Your if statement doesn't have any code within it *(just a semi colon)*. Prefer using braces
```cpp
if (arr[i] == ele) {
index = i;
break;
}
```
Also, you'll need to specify the address of the variable you are reading into when using scanf, e.g.
```cpp
scanf("%d", &ele); //<... | There are 2 mistakes in the code
```
#include<stdio.h>
int main()
{
int arr[] = {10, 20, 30, 8, 2};
int index = -1, ele;
printf("Enter the elment you want to search :");
scanf("%d", &ele);//mistake here
for (int i = 0; i < 5; i++)
{
if (arr[i] == ele)
{ ... |
70,095,538 | I am trying to deploy a hub & spoke topology on Azure. I have VNet: hub, spoke1 & spoke2, respectively with the 3 following address spaces: `10.0.0.0/16`, `10.1.0.0/16` & `10.2.0.0/16`. And each have only one subnet on the `/24` address space.
I have peered each spoke to the hub and deployed a Linux machine in my hub ... | 2021/11/24 | [
"https://Stackoverflow.com/questions/70095538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2003148/"
] | No need for
```
setContentView(binding.getRoot());
```
DataBinding.setContentView() is enough. | Or u can code it Like I do. Also Im using kotlin
```
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
val view = binding.root
setContentView... |
6,378 | Let's suppose a CFI can no longer qualify for a 1st or 2nd class physical, or maybe her/his 2nd class physical was 18 months ago. Can she/he still give required instruction and endorsements as long as they don't charge for their time and are not paid for it in any other way? | 2014/06/19 | [
"https://aviation.stackexchange.com/questions/6378",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/394/"
] | A CFI with a third class medical can provide any kind of instruction that they are qualified for (and be compensated for it), per [14 CFR 61.23(a)(3)(iv) and (v)](http://rgl.faa.gov/Regulatory_and_Guidance_Library/rgFar.nsf/FARSBySectLookup/61.23). The FAA's position in these scenarios is that you're being compensated ... | A CFI can give, and charge for instruction with a 3rd class medical. If the training does not require the CFI to be PIC, then the instruction can be given (and charged for) with no medical at all. |
7,197,947 | I have a xml in which I have to search for a tag and replace the value of tag with a new values. For example,
```
<tag-Name>oldName</tag-Name>
```
and replace `oldName` to `newName` like
```
<tag-Name>newName</tag-Name>
```
and save the xml. How can I do that without using thirdparty lib like `BeautifulSo... | 2011/08/25 | [
"https://Stackoverflow.com/questions/7197947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379235/"
] | The best option from the standard lib is (I think) the [xml.etree](http://docs.python.org/library/xml.etree.elementtree.html) package.
Assuming that your example tag occurs only once somewhere in the document:
```
import xml.etree.ElementTree as etree
# or for a faster C implementation
# import xml.etree.cElementTree... | Python has 'builtin' libraries for working with xml. For this simple task I'd look into minidom. You can find the docs here:
<http://docs.python.org/library/xml.dom.minidom.html> |
7,197,947 | I have a xml in which I have to search for a tag and replace the value of tag with a new values. For example,
```
<tag-Name>oldName</tag-Name>
```
and replace `oldName` to `newName` like
```
<tag-Name>newName</tag-Name>
```
and save the xml. How can I do that without using thirdparty lib like `BeautifulSo... | 2011/08/25 | [
"https://Stackoverflow.com/questions/7197947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379235/"
] | The best option from the standard lib is (I think) the [xml.etree](http://docs.python.org/library/xml.etree.elementtree.html) package.
Assuming that your example tag occurs only once somewhere in the document:
```
import xml.etree.ElementTree as etree
# or for a faster C implementation
# import xml.etree.cElementTree... | If you are certain, I mean, completely 100% positive that the string `<tag-Name>` will *never* appear inside that tag and the XML will always be formatted like that, you can always use good old string manipulation tricks like:
```
xmlstring = xmlstring.replace('<tag-Name>oldName</tag-Name>', '<tag-Name>newName</tag-Na... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | Since you want to learn, I guess you don't want to use a lot of utility functions, so I will help with your `high`. Notice that there are two things when you want to construct the list: the starting number and the ending number.
For `low`, it's easy because the ending number is a literal 0, while the starting number ... | How about using built-in list procedures? it'll be a lot easier, an besides, it's the recommended way to think about a solution when using Scheme, which encourages a functional-programming style of coding:
```
(define (high-low n)
(let ((lst (build-list n identity)))
(append lst
(cons n
... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | How about using built-in list procedures? it'll be a lot easier, an besides, it's the recommended way to think about a solution when using Scheme, which encourages a functional-programming style of coding:
```
(define (high-low n)
(let ((lst (build-list n identity)))
(append lst
(cons n
... | Here are a couple more options. Using `named let` and `quasi-quote`...
```
(define (high-low n)
(let hi-lo ((i 0))
(if (= i n) `(,i) `(,i ,@(hi-lo (+ i 1)) ,i))))
```
...another option using `do`:
```
(define (high-low2 n)
(do ((i (- n) (+ i 1))
(out '() (cons (- n (abs i)) out)))
((> i n) out)... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | How about using built-in list procedures? it'll be a lot easier, an besides, it's the recommended way to think about a solution when using Scheme, which encourages a functional-programming style of coding:
```
(define (high-low n)
(let ((lst (build-list n identity)))
(append lst
(cons n
... | Here is a rather over-general solution, built on a function which builds lists in a rather general way. It has the advantage of being tail-recursive: it will build arbitrarily long lists without exploding, but the disadvantages of needing to build them backwards and of being somewhat obscure to understand.
Here is the... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | Since you want to learn, I guess you don't want to use a lot of utility functions, so I will help with your `high`. Notice that there are two things when you want to construct the list: the starting number and the ending number.
For `low`, it's easy because the ending number is a literal 0, while the starting number ... | `#!racket` (aka `#lang racket`) has a `range` procedure so if you have the power of racket at your hands you can just do:
```
(define (high-low n)
(append (range n) ; 0 to n-1
(range n -1 -1))) ; n to 0
```
If you want to roll your own recursive loop you can think of it as building a list in reve... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | Since you want to learn, I guess you don't want to use a lot of utility functions, so I will help with your `high`. Notice that there are two things when you want to construct the list: the starting number and the ending number.
For `low`, it's easy because the ending number is a literal 0, while the starting number ... | Here are a couple more options. Using `named let` and `quasi-quote`...
```
(define (high-low n)
(let hi-lo ((i 0))
(if (= i n) `(,i) `(,i ,@(hi-lo (+ i 1)) ,i))))
```
...another option using `do`:
```
(define (high-low2 n)
(do ((i (- n) (+ i 1))
(out '() (cons (- n (abs i)) out)))
((> i n) out)... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | Since you want to learn, I guess you don't want to use a lot of utility functions, so I will help with your `high`. Notice that there are two things when you want to construct the list: the starting number and the ending number.
For `low`, it's easy because the ending number is a literal 0, while the starting number ... | Here is a rather over-general solution, built on a function which builds lists in a rather general way. It has the advantage of being tail-recursive: it will build arbitrarily long lists without exploding, but the disadvantages of needing to build them backwards and of being somewhat obscure to understand.
Here is the... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | `#!racket` (aka `#lang racket`) has a `range` procedure so if you have the power of racket at your hands you can just do:
```
(define (high-low n)
(append (range n) ; 0 to n-1
(range n -1 -1))) ; n to 0
```
If you want to roll your own recursive loop you can think of it as building a list in reve... | Here are a couple more options. Using `named let` and `quasi-quote`...
```
(define (high-low n)
(let hi-lo ((i 0))
(if (= i n) `(,i) `(,i ,@(hi-lo (+ i 1)) ,i))))
```
...another option using `do`:
```
(define (high-low2 n)
(do ((i (- n) (+ i 1))
(out '() (cons (- n (abs i)) out)))
((> i n) out)... |
37,220,607 | I'm not sure what the best way to phrase this is, so I'm just going to show an example.
(high-low 4) -> (0 1 2 3 4 3 2 1 0)
(high-low 0) -> (0)
```
(define low
(λ (a)
(cond
[(zero? a) '()]
[else (cons (sub1 a) (low (sub1 a)))])))
```
I think that the best way to do this is to break it up into 2 ... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37220607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6264061/"
] | `#!racket` (aka `#lang racket`) has a `range` procedure so if you have the power of racket at your hands you can just do:
```
(define (high-low n)
(append (range n) ; 0 to n-1
(range n -1 -1))) ; n to 0
```
If you want to roll your own recursive loop you can think of it as building a list in reve... | Here is a rather over-general solution, built on a function which builds lists in a rather general way. It has the advantage of being tail-recursive: it will build arbitrarily long lists without exploding, but the disadvantages of needing to build them backwards and of being somewhat obscure to understand.
Here is the... |
9,468 | Can anyone identify these bricks, which I suspect are LEGO clones. They may be more than 30 years old.
I bought them on ebay as Betta Bilda from LEGO/Duplo dealer. Some BB was included, but these are unknown to me, with an extensive BB collection.
[](https://i.s... | 2017/12/05 | [
"https://bricks.stackexchange.com/questions/9468",
"https://bricks.stackexchange.com",
"https://bricks.stackexchange.com/users/9622/"
] | From the LEGO Wikipedia Page "1961 and 1962 saw the introduction of the first Lego wheels, an addition that expanded the potential for building cars, trucks, buses and other vehicles from Lego bricks. Also during this time, the Lego Group introduced toys specifically targeted towards the pre-school market." here is a p... | I don’t exactly know if it is LEGO,
But it may be an old version of LEGO. The numbers also could be the date the were made or a factory code. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.