qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
59,151 | I've had an interview at company X. It went good, I got a coding assignment and did okay. The company is going to let me know if they want to see me again for a second interview, with CEO.
I feel they're going to see quite some other candidates who either could have better technical background or more stable school c... | 2015/12/10 | [
"https://workplace.stackexchange.com/questions/59151",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/37663/"
] | Firstly, if you are planning on sending your letter in English then please get someone to proofread it before you send it. It is clear English is not your first language and it does not come across well.
Secondly, if I were an employer and I received a letter like this from a candidate during an unfinished interview p... | Personally, I think that this sounds both quite arrogant and also comes across as a bit desperate. Regardless of how desperate you actually are, it's never a good idea to look it.
I think sending a letter like this is more likely to harm your chances with the company than to improve them. If your interview went well, ... |
59,151 | I've had an interview at company X. It went good, I got a coding assignment and did okay. The company is going to let me know if they want to see me again for a second interview, with CEO.
I feel they're going to see quite some other candidates who either could have better technical background or more stable school c... | 2015/12/10 | [
"https://workplace.stackexchange.com/questions/59151",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/37663/"
] | Firstly, if you are planning on sending your letter in English then please get someone to proofread it before you send it. It is clear English is not your first language and it does not come across well.
Secondly, if I were an employer and I received a letter like this from a candidate during an unfinished interview p... | Here is your "motivation letter" and the only appropriate thing to do: send them a message after a reasonable time has passed to be sure that you did not miss a communication from them. Lost emails or missed calls can happen. During your interview, as you exit, you should always ask what the expectation is for reaching... |
59,151 | I've had an interview at company X. It went good, I got a coding assignment and did okay. The company is going to let me know if they want to see me again for a second interview, with CEO.
I feel they're going to see quite some other candidates who either could have better technical background or more stable school c... | 2015/12/10 | [
"https://workplace.stackexchange.com/questions/59151",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/37663/"
] | Personally, I think that this sounds both quite arrogant and also comes across as a bit desperate. Regardless of how desperate you actually are, it's never a good idea to look it.
I think sending a letter like this is more likely to harm your chances with the company than to improve them. If your interview went well, ... | Here is your "motivation letter" and the only appropriate thing to do: send them a message after a reasonable time has passed to be sure that you did not miss a communication from them. Lost emails or missed calls can happen. During your interview, as you exit, you should always ask what the expectation is for reaching... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | Visit <https://services.gradle.org/distributions> and download the desired gradle version (in your case gradle-2.10-all.zip) and place it in "C:\Users\your\_user\_name\ .gradle\wrapper\dists\gradle-2.10-all\a4w5fzrkeut1ox71xslb49gst\put\_it\_here" folder and sync project again. | The steps given below may solve your problem :
1) Create a new Android project.
2) Then open the build.gradle(Module:app) file(of your new project).
3) copy the dependencies
example :
```
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:cardview-v7:24.1.1'
... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | >
> Error:C:\Users\Aman.gradle\caches\3.3\scripts-remapped\build\_9xilmbs31p63j7oau8p3qxxmv\d0u1sorhwxy5ca3j4lgnxtkce\cp\_proj1efd45104ffa2d33563b85b9edda76e3\cache.properties
> (The system cannot find the file specified)
>
>
>
Solution: just go to gradle.wrapper.properties and then,
```
distributionUrl=https\:/... | The steps given below may solve your problem :
1) Create a new Android project.
2) Then open the build.gradle(Module:app) file(of your new project).
3) copy the dependencies
example :
```
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:cardview-v7:24.1.1'
... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | The steps given below may solve your problem :
1) Create a new Android project.
2) Then open the build.gradle(Module:app) file(of your new project).
3) copy the dependencies
example :
```
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:cardview-v7:24.1.1'
... | I have similar problem when i was open my previous project. It just download Gradle 3.3 all from Online and after that i found that Error.
In my case I solved that issue just Change
>
> distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
>
>
>
to
>
> distributionUrl=https://services.gr... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | Visit <https://services.gradle.org/distributions> and download the desired gradle version (in your case gradle-2.10-all.zip) and place it in "C:\Users\your\_user\_name\ .gradle\wrapper\dists\gradle-2.10-all\a4w5fzrkeut1ox71xslb49gst\put\_it\_here" folder and sync project again. | >
> Error:C:\Users\Aman.gradle\caches\3.3\scripts-remapped\build\_9xilmbs31p63j7oau8p3qxxmv\d0u1sorhwxy5ca3j4lgnxtkce\cp\_proj1efd45104ffa2d33563b85b9edda76e3\cache.properties
> (The system cannot find the file specified)
>
>
>
Solution: just go to gradle.wrapper.properties and then,
```
distributionUrl=https\:/... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | Visit <https://services.gradle.org/distributions> and download the desired gradle version (in your case gradle-2.10-all.zip) and place it in "C:\Users\your\_user\_name\ .gradle\wrapper\dists\gradle-2.10-all\a4w5fzrkeut1ox71xslb49gst\put\_it\_here" folder and sync project again. | I have similar problem when i was open my previous project. It just download Gradle 3.3 all from Online and after that i found that Error.
In my case I solved that issue just Change
>
> distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
>
>
>
to
>
> distributionUrl=https://services.gr... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | Visit <https://services.gradle.org/distributions> and download the desired gradle version (in your case gradle-2.10-all.zip) and place it in "C:\Users\your\_user\_name\ .gradle\wrapper\dists\gradle-2.10-all\a4w5fzrkeut1ox71xslb49gst\put\_it\_here" folder and sync project again. | you should download the appropriate version from <https://services.gradle.org/distributions/>
and then place the zip file inside c:\users\your name.gradle\wrapper\dists[gradle-v-all\guid]
[](https://i.stack.imgur.com/XFQCe.png)
so when you open your ... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | >
> Error:C:\Users\Aman.gradle\caches\3.3\scripts-remapped\build\_9xilmbs31p63j7oau8p3qxxmv\d0u1sorhwxy5ca3j4lgnxtkce\cp\_proj1efd45104ffa2d33563b85b9edda76e3\cache.properties
> (The system cannot find the file specified)
>
>
>
Solution: just go to gradle.wrapper.properties and then,
```
distributionUrl=https\:/... | I have similar problem when i was open my previous project. It just download Gradle 3.3 all from Online and after that i found that Error.
In my case I solved that issue just Change
>
> distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
>
>
>
to
>
> distributionUrl=https://services.gr... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | >
> Error:C:\Users\Aman.gradle\caches\3.3\scripts-remapped\build\_9xilmbs31p63j7oau8p3qxxmv\d0u1sorhwxy5ca3j4lgnxtkce\cp\_proj1efd45104ffa2d33563b85b9edda76e3\cache.properties
> (The system cannot find the file specified)
>
>
>
Solution: just go to gradle.wrapper.properties and then,
```
distributionUrl=https\:/... | you should download the appropriate version from <https://services.gradle.org/distributions/>
and then place the zip file inside c:\users\your name.gradle\wrapper\dists[gradle-v-all\guid]
[](https://i.stack.imgur.com/XFQCe.png)
so when you open your ... |
39,127,912 | I recently updated my Android Studio to the recent version of 2.1.3 and also did some other update that popped up, only to obtain this error below for all my already existing projects on my android studio.
>
> Error:C:\Program Files\Android\Android Studio1\gradle\gradle-2.2.1\wrapper\dists\gradle-2.10-all\a4w5fzrkeut... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39127912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936574/"
] | you should download the appropriate version from <https://services.gradle.org/distributions/>
and then place the zip file inside c:\users\your name.gradle\wrapper\dists[gradle-v-all\guid]
[](https://i.stack.imgur.com/XFQCe.png)
so when you open your ... | I have similar problem when i was open my previous project. It just download Gradle 3.3 all from Online and after that i found that Error.
In my case I solved that issue just Change
>
> distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
>
>
>
to
>
> distributionUrl=https://services.gr... |
63,150,655 | ```
ListView.builder(
padding: EdgeInsets.all(15),
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(top: 10),
child: Row(
children: <Widget>[
Expanded(
child: Icon(
Icons.info,
color: randomColor,
),
... | 2020/07/29 | [
"https://Stackoverflow.com/questions/63150655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14014887/"
] | I think of a monospace font when i read your question.
I also found an article, where there seems to be a solution that is worth trying:
```
style: TextStyle(
fontFeatures: [
FontFeature.tabularFigures(),
]
),
```
Reference: <https://medium.com/flutter-community/font-features-in-flutter-320222fc171d... | I think jaop's answer is correct.
Nice monospaced fonts available here: <https://fonts.google.com/?category=Monospace&preview.text=1234&preview.text_type=custom>
In pubspec.yaml:
```
flutter:
fonts:
- family: RobotoMono
fonts:
- asset: fonts/RobotoMono-Regular.ttf
```
In widget:
```
child: Text(
... |
3,001,793 | I have an input text box for search of input, the id of the text box is: id="search".
if a user enters 'cat' at first and hit search.
In the function, I get the value 'cat' by using the syntax:
```
var input = document.getElementById("search").value;
```
After that, the user enter 'dog' in the search box and hit... | 2010/06/08 | [
"https://Stackoverflow.com/questions/3001793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | I would think it might be useful to use a VIEW. Simple create a view with your query for ID's, then join to that view via ID. That will limit your results to the required subset of ID's without an expensive IN statement.
I do know that the IN statement is more expensive then an EXISTS statement would be. | I think the join with the criteria to select the id's will be more efficient because the query optimizer has more options to do the right thing. Use the explain plan to see how postgresql will approach it. |
3,001,793 | I have an input text box for search of input, the id of the text box is: id="search".
if a user enters 'cat' at first and hit search.
In the function, I get the value 'cat' by using the syntax:
```
var input = document.getElementById("search").value;
```
After that, the user enter 'dog' in the search box and hit... | 2010/06/08 | [
"https://Stackoverflow.com/questions/3001793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | One technique I've used in the past is to put the IDs into a temp table, and then use that to drive a sequence of queries. Something like:
```
BEGIN;
CREATE TEMP TABLE search_result ON COMMIT DROP AS
SELECT entity_id
FROM entity /* long complicated search joins and conditions ... */;
-- Fetch primary entities
SELE... | I think the join with the criteria to select the id's will be more efficient because the query optimizer has more options to do the right thing. Use the explain plan to see how postgresql will approach it. |
3,001,793 | I have an input text box for search of input, the id of the text box is: id="search".
if a user enters 'cat' at first and hit search.
In the function, I get the value 'cat' by using the syntax:
```
var input = document.getElementById("search").value;
```
After that, the user enter 'dog' in the search box and hit... | 2010/06/08 | [
"https://Stackoverflow.com/questions/3001793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | One technique I've used in the past is to put the IDs into a temp table, and then use that to drive a sequence of queries. Something like:
```
BEGIN;
CREATE TEMP TABLE search_result ON COMMIT DROP AS
SELECT entity_id
FROM entity /* long complicated search joins and conditions ... */;
-- Fetch primary entities
SELE... | I would think it might be useful to use a VIEW. Simple create a view with your query for ID's, then join to that view via ID. That will limit your results to the required subset of ID's without an expensive IN statement.
I do know that the IN statement is more expensive then an EXISTS statement would be. |
3,001,793 | I have an input text box for search of input, the id of the text box is: id="search".
if a user enters 'cat' at first and hit search.
In the function, I get the value 'cat' by using the syntax:
```
var input = document.getElementById("search").value;
```
After that, the user enter 'dog' in the search box and hit... | 2010/06/08 | [
"https://Stackoverflow.com/questions/3001793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | I would think it might be useful to use a VIEW. Simple create a view with your query for ID's, then join to that view via ID. That will limit your results to the required subset of ID's without an expensive IN statement.
I do know that the IN statement is more expensive then an EXISTS statement would be. | You are almost certainly better off with a join, however, another option is to use a sub select, i.e.
```
SELECT ... --complicated stuff
WHERE ... --more stuff
AND id IN (select distinct id from Foo where ...)
``` |
3,001,793 | I have an input text box for search of input, the id of the text box is: id="search".
if a user enters 'cat' at first and hit search.
In the function, I get the value 'cat' by using the syntax:
```
var input = document.getElementById("search").value;
```
After that, the user enter 'dog' in the search box and hit... | 2010/06/08 | [
"https://Stackoverflow.com/questions/3001793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | One technique I've used in the past is to put the IDs into a temp table, and then use that to drive a sequence of queries. Something like:
```
BEGIN;
CREATE TEMP TABLE search_result ON COMMIT DROP AS
SELECT entity_id
FROM entity /* long complicated search joins and conditions ... */;
-- Fetch primary entities
SELE... | You are almost certainly better off with a join, however, another option is to use a sub select, i.e.
```
SELECT ... --complicated stuff
WHERE ... --more stuff
AND id IN (select distinct id from Foo where ...)
``` |
2,349,960 | Let $x,y∈(0,1)$. Prove that if $x \ne y$, then $ \frac{x}{x^2+1} ≠ \frac{y}{y^2+1}$
Contrapositive: $\frac{x}{x^2+1} =\frac{y}{y^2+1} => x=y$
Suppose $¬Q$ happens
$\frac{x}{x^2+1} =\frac{y}{y^2+1}$
$x(y^2+1) = y(x^2+1)$
$xy^2+x = yx^2+y$
$x=y$
How do i conclude my solution? | 2017/07/07 | [
"https://math.stackexchange.com/questions/2349960",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/453868/"
] | $$xy^2-yx^2 = y-x$$
$$xy(y-x)=y-x$$
$$(y-x)(xy-1)=0$$
Suppose $y -x \neq 0$, then we have $xy-1=0$, which means $xy=1$. This is impossible since $x,y \in (0,1)$. Hence $y-x=0$, that is $y=x$. | Let $f (x)=\frac {x}{x^2+1} $ for $0 <x <1$.
suppose there exist $(x ,y)\in (0,1)^2$ such that $f (x)=f (y) $ and $x\ne y $.
$f $ is differentiable at $[0,1] $, then by Rolle's Theorem,
$$\exists c\in (x,y)\; :\; f'(c)=0$$
but
$$f'(c)=\frac {1-c^2}{(c^2+1)^2}\ne 0$$
since $0 <c <1$
hence $x=y $. |
34,391,941 | The question is, how can i change the color blue of all elements in the following screenshots to the green color:
[](https://i.stack.imgur.com/i0FjE.png)
[](https://i.stack.imgur.com... | 2015/12/21 | [
"https://Stackoverflow.com/questions/34391941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5068746/"
] | **My explanation is a little different.**
Instance methods are sent to an `INSTANCE` of a class. An instance of a class is a concrete thing. It has state data that persists for the life of the object. When you send a message to an object, it can use that state data to do things, and it can remember information for lat... | This is not a matter of advantage. It's like asking if there is any advantage using a hammer instead of a saw. The question is nonsense; you use a hammer for hammering and a saw for sawing.
You use instance methods for things relating an instance of the class.
You use class methods for things relating to the class a... |
119 | I have a very bad reaction to poison ivy. I take extraordinary measures to avoid any and all contact with it. I wear long socks and full pants in the middle of summer but I still end up getting it on my hands.
Is there a spray or cream that I can use to create a barrier on my skin? | 2012/01/24 | [
"https://outdoors.stackexchange.com/questions/119",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/79/"
] | I have researched this occasionally over the years. Ivy Block, Tecnu, and Ivarest all have preventative lotions. The oil may still spread, but it is a good first step. As an alternative, the forest service has recommended spray deodorant as well. The active ingredient, aluminum chlorohydrate, may prevent absorption by ... | There are no creams that will prevent poison ivy. Avoidance and long clothes are best.
One thing you *can* do is wash it off. Usually if you catch it within a couple of hours, you can scrub off the oil on your skin with soap and water and a washcloth. You can't see the oil, but it seems to require about the same amoun... |
119 | I have a very bad reaction to poison ivy. I take extraordinary measures to avoid any and all contact with it. I wear long socks and full pants in the middle of summer but I still end up getting it on my hands.
Is there a spray or cream that I can use to create a barrier on my skin? | 2012/01/24 | [
"https://outdoors.stackexchange.com/questions/119",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/79/"
] | I have researched this occasionally over the years. Ivy Block, Tecnu, and Ivarest all have preventative lotions. The oil may still spread, but it is a good first step. As an alternative, the forest service has recommended spray deodorant as well. The active ingredient, aluminum chlorohydrate, may prevent absorption by ... | I have a similar extreme reaction, so this is what I have learned:
[Tecnu](http://rads.stackoverflow.com/amzn/click/B000ZK3V7E) works pretty well after you have been exposed, but before the rash develops (I realize that is a pretty short window of opportunity). It can also help to stop the oils from spreading. It work... |
18,532,596 | I have a set of Scrapy spiders. They need to be run daily from a desktop application.
What is the simplest way (from user's point of view) to install and run it on another windows machine? | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1347527/"
] | Create a script (e.g. **run\_spider.py**) which runs `scrapy crawl <spider_name>` as a system command.
**run\_spider.py**
```
from os import system
output_file_name = 'results.csv'
system('scrapy crawl myspider -o ' + output_file_name + ' -t csv')
```
Then feed that script to PyInstaller:
```
pyinstaller run_spid... | The simplest way is write a script in python for them I guess...
If you are running a Windows Server you can even schedule the comand that you use (scrapy crawl yoursprider) to run the spiders. |
18,532,596 | I have a set of Scrapy spiders. They need to be run daily from a desktop application.
What is the simplest way (from user's point of view) to install and run it on another windows machine? | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1347527/"
] | Create a script (e.g. **run\_spider.py**) which runs `scrapy crawl <spider_name>` as a system command.
**run\_spider.py**
```
from os import system
output_file_name = 'results.csv'
system('scrapy crawl myspider -o ' + output_file_name + ' -t csv')
```
Then feed that script to PyInstaller:
```
pyinstaller run_spid... | Here is another possibility to run your spider as standalone script or executable
```
import scrapy
from scrapy.crawler import CrawlerProcess
class MySpider(scrapy.Spider):
# Your spider definition
...
process = CrawlerProcess({
'USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'
})
proce... |
32,227,143 | I'm using ASP.NET MVC (with Razor) and JQuery
I have a list of strings in my controller and I render the partial view passing in the model with the below list.
```
List<string> list = new List<string>();
list.Add("Texas");
list.Add("New York");
```
On client in my cshtml file side I have:
```
<div id = "test", tes... | 2015/08/26 | [
"https://Stackoverflow.com/questions/32227143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1527762/"
] | Put your JSON between single quote **NOT** double quote characters:
```
<div id = "test" test-att = '@Html.Raw(Json.Encode(Model.list))' />
``` | Content of cshtml file will be like as bellow
```
<div id = "test" test-att = "@Html.Raw(Json.Encode(Model.list))" />
``` |
32,227,143 | I'm using ASP.NET MVC (with Razor) and JQuery
I have a list of strings in my controller and I render the partial view passing in the model with the below list.
```
List<string> list = new List<string>();
list.Add("Texas");
list.Add("New York");
```
On client in my cshtml file side I have:
```
<div id = "test", tes... | 2015/08/26 | [
"https://Stackoverflow.com/questions/32227143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1527762/"
] | Put your JSON between single quote **NOT** double quote characters:
```
<div id = "test" test-att = '@Html.Raw(Json.Encode(Model.list))' />
``` | There seems to be 2 issues with what you have :
1. The Json encoder uses " (double quotes) to delimitate strings. It's not gonna work since in XML double quote are used to delimitate attributes.
For this issue you have 2 solutions the easiest one would probably be replacing every " in the Json Encoded string by
`<... |
32,227,143 | I'm using ASP.NET MVC (with Razor) and JQuery
I have a list of strings in my controller and I render the partial view passing in the model with the below list.
```
List<string> list = new List<string>();
list.Add("Texas");
list.Add("New York");
```
On client in my cshtml file side I have:
```
<div id = "test", tes... | 2015/08/26 | [
"https://Stackoverflow.com/questions/32227143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1527762/"
] | Put your JSON between single quote **NOT** double quote characters:
```
<div id = "test" test-att = '@Html.Raw(Json.Encode(Model.list))' />
``` | It seems to me the culprit is `@Html.Raw`. If you use the following -
```
<div id='dd' data-att="@Json.Encode(list)">
```
Then parsing with javascript doesn't fail.
```
var a = document.getElementById('dd');
JSON.parse(a.dataset.att);
```
Single quote or double quote doesn't matter. But if you use `@Html.Raw` the... |
28,544,968 | Let's say I have this string, `"%%%%%ABC"`, I would like to replace all the `"%"` with just one `"%"`, so it should be `"%ABC"`.
If its `"%%%A%%B%%C%%"`, it should be `"%A%B%C%"`
How should I do this? | 2015/02/16 | [
"https://Stackoverflow.com/questions/28544968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4399709/"
] | There is a solution with `Regex.Replace` method:
```
private static string TruncatePercents(string input)
{
return Regex.Replace(input, @"%+", "%");
}
``` | Use this if you want to replace one or more non-word characters with the single same non-word character.
```
string result = Regex.Replace(str, @"(\W)+", "$1");
``` |
28,544,968 | Let's say I have this string, `"%%%%%ABC"`, I would like to replace all the `"%"` with just one `"%"`, so it should be `"%ABC"`.
If its `"%%%A%%B%%C%%"`, it should be `"%A%B%C%"`
How should I do this? | 2015/02/16 | [
"https://Stackoverflow.com/questions/28544968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4399709/"
] | There is a solution with `Regex.Replace` method:
```
private static string TruncatePercents(string input)
{
return Regex.Replace(input, @"%+", "%");
}
``` | This'll sort it:
```
string ProcessText(string s)
{
return Regex.Replace(s, @"%+", "%");
}
```
**Edit** Got beaten to the punch, so to make mine slightly different and to offer scope for varying delimeters:
```
private void button1_Click(object sender, EventArgs e)
{
label1.Text =... |
28,544,968 | Let's say I have this string, `"%%%%%ABC"`, I would like to replace all the `"%"` with just one `"%"`, so it should be `"%ABC"`.
If its `"%%%A%%B%%C%%"`, it should be `"%A%B%C%"`
How should I do this? | 2015/02/16 | [
"https://Stackoverflow.com/questions/28544968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4399709/"
] | There is a solution with `Regex.Replace` method:
```
private static string TruncatePercents(string input)
{
return Regex.Replace(input, @"%+", "%");
}
``` | Try regular expression.
```
string strTest = "%%%A%%B%%C%%";
string strPattern = "%+";
RegexOptions opt = RegexOptions.IgnoreCase;
var reg = new Regex(strPattern, opt);
var strReplaceResult = reg.Replace(strTest, "%");
```
result will be "%A%B%C%" |
28,544,968 | Let's say I have this string, `"%%%%%ABC"`, I would like to replace all the `"%"` with just one `"%"`, so it should be `"%ABC"`.
If its `"%%%A%%B%%C%%"`, it should be `"%A%B%C%"`
How should I do this? | 2015/02/16 | [
"https://Stackoverflow.com/questions/28544968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4399709/"
] | This'll sort it:
```
string ProcessText(string s)
{
return Regex.Replace(s, @"%+", "%");
}
```
**Edit** Got beaten to the punch, so to make mine slightly different and to offer scope for varying delimeters:
```
private void button1_Click(object sender, EventArgs e)
{
label1.Text =... | Use this if you want to replace one or more non-word characters with the single same non-word character.
```
string result = Regex.Replace(str, @"(\W)+", "$1");
``` |
28,544,968 | Let's say I have this string, `"%%%%%ABC"`, I would like to replace all the `"%"` with just one `"%"`, so it should be `"%ABC"`.
If its `"%%%A%%B%%C%%"`, it should be `"%A%B%C%"`
How should I do this? | 2015/02/16 | [
"https://Stackoverflow.com/questions/28544968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4399709/"
] | Use this if you want to replace one or more non-word characters with the single same non-word character.
```
string result = Regex.Replace(str, @"(\W)+", "$1");
``` | Try regular expression.
```
string strTest = "%%%A%%B%%C%%";
string strPattern = "%+";
RegexOptions opt = RegexOptions.IgnoreCase;
var reg = new Regex(strPattern, opt);
var strReplaceResult = reg.Replace(strTest, "%");
```
result will be "%A%B%C%" |
28,544,968 | Let's say I have this string, `"%%%%%ABC"`, I would like to replace all the `"%"` with just one `"%"`, so it should be `"%ABC"`.
If its `"%%%A%%B%%C%%"`, it should be `"%A%B%C%"`
How should I do this? | 2015/02/16 | [
"https://Stackoverflow.com/questions/28544968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4399709/"
] | This'll sort it:
```
string ProcessText(string s)
{
return Regex.Replace(s, @"%+", "%");
}
```
**Edit** Got beaten to the punch, so to make mine slightly different and to offer scope for varying delimeters:
```
private void button1_Click(object sender, EventArgs e)
{
label1.Text =... | Try regular expression.
```
string strTest = "%%%A%%B%%C%%";
string strPattern = "%+";
RegexOptions opt = RegexOptions.IgnoreCase;
var reg = new Regex(strPattern, opt);
var strReplaceResult = reg.Replace(strTest, "%");
```
result will be "%A%B%C%" |
280,407 | I am working on a project right now, that utilises the low-power mode of the ATmega328-P. This essentially sleeps the micro-controller when it is not in use. I have a Fluke 79 series ii DMM, which is what I use to measure how much current my ATmega is drawing in its low-power state. It gives the figure of 0.007 mA, or ... | 2017/01/15 | [
"https://electronics.stackexchange.com/questions/280407",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/135997/"
] | Making a measurement with a DMM disturbs the circuit you connect it to. Making a voltage measurement draws a load current. Making a current measurement inserts a voltage drop into the path. However, in most situations, the load current tends to be insignificant, whereas the voltage drop can easily be a concern. In eith... | It does inserts a resistance in series which does cause a voltage drop. If your circuit "downstream" compensates for the voltage drop and consume more current or if it exhibits a more linear behavior depends on the circuit in question. For most applications this is negligible and the two outlets, A and mA on the DMM is... |
280,407 | I am working on a project right now, that utilises the low-power mode of the ATmega328-P. This essentially sleeps the micro-controller when it is not in use. I have a Fluke 79 series ii DMM, which is what I use to measure how much current my ATmega is drawing in its low-power state. It gives the figure of 0.007 mA, or ... | 2017/01/15 | [
"https://electronics.stackexchange.com/questions/280407",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/135997/"
] | Making a measurement with a DMM disturbs the circuit you connect it to. Making a voltage measurement draws a load current. Making a current measurement inserts a voltage drop into the path. However, in most situations, the load current tends to be insignificant, whereas the voltage drop can easily be a concern. In eith... | Yes, the current measurement is accurate (to the precision that the meter reads). The meter has its own power supply.
What is changed by inserting the meter is supply voltage, rather than operating at 3.3V, your circuit actually gets 3.2V (or similar). This will mean reduced leakage, more active current if there is an... |
573,032 | I have a refrigerator which I want to use to store electrical device (I don't want them to get hot). I have successfully drilled a hole through the refrigerator door so that I can supply the electricity inside. The problem is that the refrigerator is causing moisture to condense into drop and it has the potential of da... | 2021/06/27 | [
"https://electronics.stackexchange.com/questions/573032",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/289849/"
] | moisture doesn't come from nowhere, if you leave the door closed there will be no condensation except on the evaporator, and that will drain out of the box.
even replacing the thermostat with one that goes up to 20 will not prevent condensation if there is sufficiently high humidity outside the refrigerator. | "*... if you leave the door closed there will be no condensation except on the evaporator.*" That will be true if you put a warm object in. The temperature of the objects will be above the dew point in the fridge. If you open the door and let most air in when the devices have chilled then you will get condensation on t... |
3,881,794 | I have a thread that does a WMI query for me and I need to access some variables in the thread after it has executed the query.
The thread is created as follows ...
```
procedure TFormMain.RunThread;
var
WMIQ: TThreadWmiQuery;
begin
WMIQ := TThreadWmiQuery.Create(True);
...
WMIQ.OnTerminate := WMIQThreadOnTe... | 2010/10/07 | [
"https://Stackoverflow.com/questions/3881794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82070/"
] | Who told you that? Did they give any reasons?
OnTerminate is there to query a thread instance after it has finished executing and before it is destroyed. In fact, when you set TThread's FreeOnTerminate to True, you have no other place to access the thread's variables.
Other mechanisms:
* global variable set by the t... | I see no problem with that approach.
The only place you store a reference to the thread object is in a local variable, so the thread object is inaccessible while it's running. That's good; it means nothing can access the thread's public properties or fields until the thread has finished calculating their values.
Make... |
3,881,794 | I have a thread that does a WMI query for me and I need to access some variables in the thread after it has executed the query.
The thread is created as follows ...
```
procedure TFormMain.RunThread;
var
WMIQ: TThreadWmiQuery;
begin
WMIQ := TThreadWmiQuery.Create(True);
...
WMIQ.OnTerminate := WMIQThreadOnTe... | 2010/10/07 | [
"https://Stackoverflow.com/questions/3881794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82070/"
] | Who told you that? Did they give any reasons?
OnTerminate is there to query a thread instance after it has finished executing and before it is destroyed. In fact, when you set TThread's FreeOnTerminate to True, you have no other place to access the thread's variables.
Other mechanisms:
* global variable set by the t... | I don't see anything wrong in your code, where is no need to improve it. But if you still want to improve it make notice that TThread.OnTerminate code is executed in the context of main thread using TThread.Syncronize. That means that your WMIQThread enters a wait state, sleeps until the main thread executed TThread.On... |
39,454,505 | I am running into a weird CSRF where I am trying to access a javascript file uploaded on my rails server. I have a controller such as:
```
class SomeController < ApplicationController
def show
some_path = "/some/js/file/on/disk.js"
send_file(some_path, type: "text/javascript", disposition: :inline)
end
en... | 2016/09/12 | [
"https://Stackoverflow.com/questions/39454505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1658810/"
] | As error message says, you need to disable forgery protection for this action.
```
class SomeController < ApplicationController
skip_before_action :verify_authenticity_token, only: :show
def show
some_path = "/some/js/file/on/disk.js"
send_file(some_path, type: "text/javascript", disposition: :inline)
e... | Some suggestions:
1) Make sure to add `<%= csrf_meta_tag %>`in your layout
2) Make sure that you are including the csrf-token hidden field. For instance if you are using a form in the show view. Normally the form builders do it automatically.
3) Set `application/javascript"` in the send\_file
```
if request.format... |
39,454,505 | I am running into a weird CSRF where I am trying to access a javascript file uploaded on my rails server. I have a controller such as:
```
class SomeController < ApplicationController
def show
some_path = "/some/js/file/on/disk.js"
send_file(some_path, type: "text/javascript", disposition: :inline)
end
en... | 2016/09/12 | [
"https://Stackoverflow.com/questions/39454505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1658810/"
] | I won't ask why you're using a controller to send a javascript file to the browser even though that doesn't seem like a good idea. I hope these suggestions help.
You could try
```
class SomeController < ApplicationController
def show
some_path = "/some/js/file/on/disk.js"
respond_to do |format|
forma... | Some suggestions:
1) Make sure to add `<%= csrf_meta_tag %>`in your layout
2) Make sure that you are including the csrf-token hidden field. For instance if you are using a form in the show view. Normally the form builders do it automatically.
3) Set `application/javascript"` in the send\_file
```
if request.format... |
39,454,505 | I am running into a weird CSRF where I am trying to access a javascript file uploaded on my rails server. I have a controller such as:
```
class SomeController < ApplicationController
def show
some_path = "/some/js/file/on/disk.js"
send_file(some_path, type: "text/javascript", disposition: :inline)
end
en... | 2016/09/12 | [
"https://Stackoverflow.com/questions/39454505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1658810/"
] | As error message says, you need to disable forgery protection for this action.
```
class SomeController < ApplicationController
skip_before_action :verify_authenticity_token, only: :show
def show
some_path = "/some/js/file/on/disk.js"
send_file(some_path, type: "text/javascript", disposition: :inline)
e... | Checking out the conditions that fire the error:
```
marked_for_same_origin_verification? && non_xhr_javascript_response?
```
I went to the [source](https://github.com/rails/rails/blob/a0e0b67b5afbb02d9ea9e48d71ae80b3efb8c0ac/actionpack/lib/action_controller/metal/request_forgery_protection.rb#L222) and found:
```
... |
39,454,505 | I am running into a weird CSRF where I am trying to access a javascript file uploaded on my rails server. I have a controller such as:
```
class SomeController < ApplicationController
def show
some_path = "/some/js/file/on/disk.js"
send_file(some_path, type: "text/javascript", disposition: :inline)
end
en... | 2016/09/12 | [
"https://Stackoverflow.com/questions/39454505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1658810/"
] | I won't ask why you're using a controller to send a javascript file to the browser even though that doesn't seem like a good idea. I hope these suggestions help.
You could try
```
class SomeController < ApplicationController
def show
some_path = "/some/js/file/on/disk.js"
respond_to do |format|
forma... | Checking out the conditions that fire the error:
```
marked_for_same_origin_verification? && non_xhr_javascript_response?
```
I went to the [source](https://github.com/rails/rails/blob/a0e0b67b5afbb02d9ea9e48d71ae80b3efb8c0ac/actionpack/lib/action_controller/metal/request_forgery_protection.rb#L222) and found:
```
... |
39,984,393 | Dense\_Rank is taking everything into account. Is there a way to exclude the null values so the next rank after 1 would be 2 and not 3.
This is what the table looks like now:
```
A | DENSE_R
--------------
1 | 1
--------------
2 | null
--------------
3 | 3
--------------
4 | 4
... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39984393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6074722/"
] | Use `partition by` the same `**Condition**` as you used already.
```
WITH CTE AS
(
SELECT A
FROM A1
)
SELECT A,
CASE
WHEN **Condition**
THEN DENSE_RANK() OVER (Partition by (case when **Condition** then 1 else 0 end) Order by [A] ASC)
END
AS 'DENSE_R'
FROM CTE
``` | You can use `case` like this:
```
select A,
(case when A is not null
then dense_rank() over (partition by (case when A is not null then 1 else 0 end)
order by a desc
)
end) as dr
from A1;
``` |
69,333,915 | (Please note I searched and couldn't find an answer for this type of nested, with dict and lists, and with keeping keys names and values).
I'm trying to create a new dict from existing dict with specific keys-value pairs that I need.
Example/origin dict:
```
{
"test1":{
"test2":[
]
},
"t... | 2021/09/26 | [
"https://Stackoverflow.com/questions/69333915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17007278/"
] | Try a dictionary comprehension with `isinstance` `list`:
```
>>> {k: ([{'in2': i['in2']} for i in v] if isinstance(v, list) else v) for k, v in dct.items() if not isinstance(v, int) and v}
{'test1': {'test2': []},
'test4': {'test5': 0, 'what': {'in': '2', 'out': '4'}},
'test12': [{'in2': 'a'}, {'in2': 'a33'}]}
>>>
... | I don't think there is one "pythonic" way to do what you want here as there is an infinite number of possible values for your nested dict.
Here is a start of answer that you can adapt to your need !
```
import copy
def _transform(source_dict: dict, keys_to_keep: list):
dict_copy = copy.deepcopy(source_dict) # no... |
3,523,310 | [](https://i.stack.imgur.com/6U33j.png)
What would be the method to express the solid curve as a sum of sines in the form $$\Psi(x)=5(\sin(2 \pi a x) + \sin(2 \pi b x))$$
By calculating $\Psi(0.1)=5$, I used the properties of sine as an odd function ... | 2020/01/26 | [
"https://math.stackexchange.com/questions/3523310",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/737935/"
] | Just use $\sin(2\pi ax)+\sin(2\pi bx)=2\sin(2\pi\frac{a+b}2)\cos(2\pi\frac{a-b}2)$. For $a\approx b$, the second term is the envelope of the oscillation (dashed line). | Consider the two seperate oscillators:
$$\Phi\_1 (x)=5sin(2\pi a x)=- 5cos(2\pi ax+\frac{\pi}{2})=-5 Re(e^{i(2\pi ax+\frac{\pi}{2})})$$
$$\Phi\_2 (x)=sin(2\pi bx)=- cos(2\pi bx+\frac{\pi}{2})=-Re(e^{i(2\pi bx+\frac{\pi}{2})})$$
In physics, we usually add the complex versions of those seperate oscillators (by putting ... |
15,204,039 | I have a class with an variable of array of array.
```
private double * array[4][4];
```
Can I initialize it this way?
```
void RealMatrix::init(int i, int j) {
this->array[i][j] = new double;
*(this->array[i][j]) = 0;
}
``` | 2013/03/04 | [
"https://Stackoverflow.com/questions/15204039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674132/"
] | This will dynamically allocate a single `double` and set the pointer that is element `[i][j]` of the 2D array to point to that `double`. It then assigns the value 0 to that `double`. You can do this in a single line with:
```
this->array[i][j] = new double(); // value-initialization
```
Or you can more explicitly se... | Yes, you can. However, if I were in your shoes, I'd get rid of the `double` pointer (unless there are some specific reasons you're doing things this way). |
15,204,039 | I have a class with an variable of array of array.
```
private double * array[4][4];
```
Can I initialize it this way?
```
void RealMatrix::init(int i, int j) {
this->array[i][j] = new double;
*(this->array[i][j]) = 0;
}
``` | 2013/03/04 | [
"https://Stackoverflow.com/questions/15204039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674132/"
] | Yes, you can. However, if I were in your shoes, I'd get rid of the `double` pointer (unless there are some specific reasons you're doing things this way). | I'd use a `vector<double>`.
```
class Matrix {
std::vector<double> values;
const unsigned int width;
public:
Matrix(unsigned int width, unsigned int height)
: values(width * height), width(width) {
}
double& value(unsigned int i, unsigned int j) {
return values[i + (width * j))];
}... |
15,204,039 | I have a class with an variable of array of array.
```
private double * array[4][4];
```
Can I initialize it this way?
```
void RealMatrix::init(int i, int j) {
this->array[i][j] = new double;
*(this->array[i][j]) = 0;
}
``` | 2013/03/04 | [
"https://Stackoverflow.com/questions/15204039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674132/"
] | This will dynamically allocate a single `double` and set the pointer that is element `[i][j]` of the 2D array to point to that `double`. It then assigns the value 0 to that `double`. You can do this in a single line with:
```
this->array[i][j] = new double(); // value-initialization
```
Or you can more explicitly se... | I'd use a `vector<double>`.
```
class Matrix {
std::vector<double> values;
const unsigned int width;
public:
Matrix(unsigned int width, unsigned int height)
: values(width * height), width(width) {
}
double& value(unsigned int i, unsigned int j) {
return values[i + (width * j))];
}... |
41,491,467 | I have this line of code that organizes the words in *list* into *dictionary* by the first letter:
```
for a in list: dictionary[a[0]].append(a)
```
The problem is, this requires the dictionary keys to each individually have empty list values. I could do this by adding a few extra lines of code previously, but I wan... | 2017/01/05 | [
"https://Stackoverflow.com/questions/41491467",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5759631/"
] | You can use a [`defaultdict`](https://docs.python.org/2/library/collections.html#collections.defaultdict) and not have to change your line of code at all:
```
from collections import defaultdict
dictionary = defaultdict(list)
for a in list: dictionary[a[0]].append(a)
``` | You can do this with `collections.defaultdict`
```
>>> import collections
>>> dict_of_lists = collections.defaultdict(list)
>>> dict_of_lists['foo'].append('bar')
>>> print(dict_of_lists)
defaultdict(<class 'list'>, {'foo': ['bar']})
>>>
``` |
99,623 | This puzzle stems from these type of questions by Dimity Kamenetsky.
[Creating the hardest 7x7 maze](https://puzzling.stackexchange.com/questions/98655/creating-the-hardest-7x7-maze)
[Creating the hardest 6x6 maze](https://puzzling.stackexchange.com/questions/98590/creating-the-hardest-6x6-maze)
I wanted to know how t... | 2020/07/02 | [
"https://puzzling.stackexchange.com/questions/99623",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/69665/"
] | A different approach to the slides yields an improved solution:
>
> [](https://i.stack.imgur.com/eTWQo.png)
>
> The optimal solution has the goal sequence of BL-TR-BR and requires a total of 54 steps.
>
>
> | My solution:
>
> N = 52
>
>
>
Part 1
>
> My solution for the standard 7x7 is 46, though a greater number may be possible.
>
> [](https://i.stack.imgur.com/CsAyk.png)
>
>
>
Part 2
>
> Adding in the special squares
>
> [![enter ima... |
54,817 | Luke hid his Lightsaber in R2D2 to aid in the rescue.
So, how did Luke know that Jabba would bring R2D2 where they would be executed?
I could guess "Force vision", but I'm looking for canon confirmation. | 2014/04/23 | [
"https://scifi.stackexchange.com/questions/54817",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/976/"
] | As Valorum points out, it is very like a Hutt Crime Lord to flaunt his spoils. This is a person known for keeping a giant carnivore under his living room for the express purpose of taunting and executing people who displease him. Everything else we see Jabba do confirms this trait:
* Hanging Han Solo on the wall.
* En... | Frankly, their plan stinks.
**It should have worked something like this;**
* The droids arrive and deliver their message (and themselves) to Jabba. As a Jedi, Luke is honour-bound to give him the opportunity to simply surrender and more importantly this puts the lightsaber in easy reach if Luke should need it.
+ La... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | I think you're right, it's not possible to implement `memmove` efficiently in standard C.
The only truly portable way to test whether the regions overlap, I think, is something like this:
```
for (size_t l = 0; l < len; ++l) {
if (src + l == dst) || (src + l == dst + len - 1) {
// they overlap, so now we ca... | For two memory areas to be valid and overlapping, I believe you would need to be in one of the defined situations of 6.5.8.5. That is, two areas of an array, union, struct, etc.
The reason other situations are undefined are because two different objects might not even be in the same kind of memory, with the same kind ... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | For two memory areas to be valid and overlapping, I believe you would need to be in one of the defined situations of 6.5.8.5. That is, two areas of an array, union, struct, etc.
The reason other situations are undefined are because two different objects might not even be in the same kind of memory, with the same kind ... | For starters, the C standard is notorious for having problems in the details like this. Part of the problem is because C is used on multiple platforms and the standard attempts to be abstract enough to cover all current and future platforms (which might use some convoluted memory layout that's beyond anything we've eve... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | For two memory areas to be valid and overlapping, I believe you would need to be in one of the defined situations of 6.5.8.5. That is, two areas of an array, union, struct, etc.
The reason other situations are undefined are because two different objects might not even be in the same kind of memory, with the same kind ... | >
> I would still like to use this example as proof that the standard goes too far with undefined behaviors, if it is true that memmove cannot be implemented efficiently in standard C
>
>
>
But it's not proof. There's absolutely no way to guarantee that you can compare two arbitrary pointers on an arbitrary machin... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | For two memory areas to be valid and overlapping, I believe you would need to be in one of the defined situations of 6.5.8.5. That is, two areas of an array, union, struct, etc.
The reason other situations are undefined are because two different objects might not even be in the same kind of memory, with the same kind ... | Here's another idea, but I don't know if it's correct. To avoid the `O(len)` loop in Steve's answer, one could put it in the `#else` clause of an `#ifdef UINTPTR_MAX` with the cast-to-`uintptr_t` implementation. Provided that cast of `unsigned char *` to `uintptr_t` commutes with adding integer offsets whenever the off... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | I think you're right, it's not possible to implement `memmove` efficiently in standard C.
The only truly portable way to test whether the regions overlap, I think, is something like this:
```
for (size_t l = 0; l < len; ++l) {
if (src + l == dst) || (src + l == dst + len - 1) {
// they overlap, so now we ca... | For starters, the C standard is notorious for having problems in the details like this. Part of the problem is because C is used on multiple platforms and the standard attempts to be abstract enough to cover all current and future platforms (which might use some convoluted memory layout that's beyond anything we've eve... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | I think you're right, it's not possible to implement `memmove` efficiently in standard C.
The only truly portable way to test whether the regions overlap, I think, is something like this:
```
for (size_t l = 0; l < len; ++l) {
if (src + l == dst) || (src + l == dst + len - 1) {
// they overlap, so now we ca... | >
> I would still like to use this example as proof that the standard goes too far with undefined behaviors, if it is true that memmove cannot be implemented efficiently in standard C
>
>
>
But it's not proof. There's absolutely no way to guarantee that you can compare two arbitrary pointers on an arbitrary machin... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | I think you're right, it's not possible to implement `memmove` efficiently in standard C.
The only truly portable way to test whether the regions overlap, I think, is something like this:
```
for (size_t l = 0; l < len; ++l) {
if (src + l == dst) || (src + l == dst + len - 1) {
// they overlap, so now we ca... | Here's another idea, but I don't know if it's correct. To avoid the `O(len)` loop in Steve's answer, one could put it in the `#else` clause of an `#ifdef UINTPTR_MAX` with the cast-to-`uintptr_t` implementation. Provided that cast of `unsigned char *` to `uintptr_t` commutes with adding integer offsets whenever the off... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | For starters, the C standard is notorious for having problems in the details like this. Part of the problem is because C is used on multiple platforms and the standard attempts to be abstract enough to cover all current and future platforms (which might use some convoluted memory layout that's beyond anything we've eve... | >
> I would still like to use this example as proof that the standard goes too far with undefined behaviors, if it is true that memmove cannot be implemented efficiently in standard C
>
>
>
But it's not proof. There's absolutely no way to guarantee that you can compare two arbitrary pointers on an arbitrary machin... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | For starters, the C standard is notorious for having problems in the details like this. Part of the problem is because C is used on multiple platforms and the standard attempts to be abstract enough to cover all current and future platforms (which might use some convoluted memory layout that's beyond anything we've eve... | Here's another idea, but I don't know if it's correct. To avoid the `O(len)` loop in Steve's answer, one could put it in the `#else` clause of an `#ifdef UINTPTR_MAX` with the cast-to-`uintptr_t` implementation. Provided that cast of `unsigned char *` to `uintptr_t` commutes with adding integer offsets whenever the off... |
4,023,320 | From the man page on my system:
>
> void \*memmove(void \*dst, const void \*src, size\_t len);
>
>
> DESCRIPTION
>
> The memmove() function copies len bytes from string src to string dst.
>
> **The two strings may overlap**; the copy is always done in a non-destructive
>
> manner.
>
>
>
From the C9... | 2010/10/26 | [
"https://Stackoverflow.com/questions/4023320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139746/"
] | Here's another idea, but I don't know if it's correct. To avoid the `O(len)` loop in Steve's answer, one could put it in the `#else` clause of an `#ifdef UINTPTR_MAX` with the cast-to-`uintptr_t` implementation. Provided that cast of `unsigned char *` to `uintptr_t` commutes with adding integer offsets whenever the off... | >
> I would still like to use this example as proof that the standard goes too far with undefined behaviors, if it is true that memmove cannot be implemented efficiently in standard C
>
>
>
But it's not proof. There's absolutely no way to guarantee that you can compare two arbitrary pointers on an arbitrary machin... |
701 | [this question](https://electronics.stackexchange.com/questions/15363/controlling-home-automation-using-blackwidow) reappeared at the top of the top questions with the notification "community - 1 hour ago". But when I go to have a look at it I can't see any new answers, nor edits in question nor answers. What happened ... | 2011/07/13 | [
"https://electronics.meta.stackexchange.com/questions/701",
"https://electronics.meta.stackexchange.com",
"https://electronics.meta.stackexchange.com/users/2064/"
] | There is a "community user" that goes around and bumps stuff to the front page that it thinks needs more attention. This question has only 1 answer with 0 up votes so it is considered unanswered.
Learn more about this user here: <https://electronics.stackexchange.com/users/-1/community>
Also take note of their flag w... | There does seem to be an issue with how it is determined for questions to be brought to the front page.
[Most affordable FPGA dev kit for learning VHDL and FPGA theory?](https://electronics.stackexchange.com/questions/4962/most-affordable-fpga-dev-kit-for-learning-vhdl-and-fpga-theory) was just bumped to the front pag... |
14,409,562 | Trying to teach myself Rails and have come across something that was easy in PHP but have got confused and stuck on this one area.
I have a form with a number of drop downs. I have managed to get the drop downs to display a value and store the id of that value into another table. Now I would like to view the new recor... | 2013/01/18 | [
"https://Stackoverflow.com/questions/14409562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1991945/"
] | ```
<%= @finding.skill.skill_desc %>
```
`@finding.skill` returns the `Skill` object associated with that finding, upon which you can call `skill_desc` to retrieve said value. | ```
@finding.skill.skill_desc
```
If you wanted to find the findings of a skill, you would need to use
`@skill.findings` to return an array of the findings objects associated with that skill object.
In sql, it might look something like this
```
SELECT * FROM findings WHERE ID EQ 23 JOIN skills ON findings.skill_id... |
4,203,279 | I'm using Paperclip 2.3.5 within a Rails app to store PDF documents on Amazon S3. For every PDF a JPG thumbnail is generated by ImageMagick. Im' using this configuration in the model:
```
has_attached_file :file,
:styles => { :thumb => { :geometry => "200x200>",
... | 2010/11/17 | [
"https://Stackoverflow.com/questions/4203279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57950/"
] | I had to overcome this, not the most elegant solution but I forked Paperclip and hold the patch in my own git repo - <https://github.com/svetzal/paperclip>
It is a direct replacement for Paperclip, just put in your environment.rb
gem 'twm\_paperclip', :lib => 'paperclip' | This is fixed in paperclip >= 2.7, as you can see here:
<https://github.com/thoughtbot/paperclip/blob/v2.7/lib/paperclip/storage/s3.rb#L290>
the mime-type of the file that is written to S3 is determined specifically before uploading. |
4,203,279 | I'm using Paperclip 2.3.5 within a Rails app to store PDF documents on Amazon S3. For every PDF a JPG thumbnail is generated by ImageMagick. Im' using this configuration in the model:
```
has_attached_file :file,
:styles => { :thumb => { :geometry => "200x200>",
... | 2010/11/17 | [
"https://Stackoverflow.com/questions/4203279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57950/"
] | This is how we fixed it on [brighterplanet.com/research](http://brighterplanet.com/research), which has pdf documents and png previews:
```
has_attached :pdf_document,
:storage => :s3,
# [... other settings ...]
# PDFs work better in Windows 7 / IE if you give them content-type: attachment
:s3_headers => { 'Co... | This is fixed in paperclip >= 2.7, as you can see here:
<https://github.com/thoughtbot/paperclip/blob/v2.7/lib/paperclip/storage/s3.rb#L290>
the mime-type of the file that is written to S3 is determined specifically before uploading. |
31,041,201 | I downloaded fuelphp 1.7.3 from [its website](http://fuelphp.com/). When I run `composer update`, I'm requested to enter a token. What token I will have to provide?
>
> $ composer update
>
> Loading composer repositories with package information
>
>
> Could not fetch <https://api.github.com/repos/fuel/docs>, pl... | 2015/06/25 | [
"https://Stackoverflow.com/questions/31041201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179841/"
] | 1. Use the official Zip file.
2. Wait until GitHub API limits reset (60 hits/one hour). | If you have a github account, use it, |
31,041,201 | I downloaded fuelphp 1.7.3 from [its website](http://fuelphp.com/). When I run `composer update`, I'm requested to enter a token. What token I will have to provide?
>
> $ composer update
>
> Loading composer repositories with package information
>
>
> Could not fetch <https://api.github.com/repos/fuel/docs>, pl... | 2015/06/25 | [
"https://Stackoverflow.com/questions/31041201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179841/"
] | As others said this has nothing to do with FuelPHP itself, but there is a valid point though that users without Github account should still be able to use FuelPHP.
As others also pointed, this error is caused by the [Github API rate limit](https://developer.github.com/v3/#rate-limiting), which is 50/hour AFAIK.
What ... | If you have a github account, use it, |
31,041,201 | I downloaded fuelphp 1.7.3 from [its website](http://fuelphp.com/). When I run `composer update`, I'm requested to enter a token. What token I will have to provide?
>
> $ composer update
>
> Loading composer repositories with package information
>
>
> Could not fetch <https://api.github.com/repos/fuel/docs>, pl... | 2015/06/25 | [
"https://Stackoverflow.com/questions/31041201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179841/"
] | * Login to your GitHub account
* Go to <https://github.com/settings/tokens>
* Create a token
* In "C:/Users/Singtech/AppData/Roaming/Com poser/auth.json" put:
>
>
> ```
> {
> "config": {
> "github-oauth": {
> "github.com": "YOUR_TOKEN"
> }
> }
> }
>
> ```
>
> | If you have a github account, use it, |
31,041,201 | I downloaded fuelphp 1.7.3 from [its website](http://fuelphp.com/). When I run `composer update`, I'm requested to enter a token. What token I will have to provide?
>
> $ composer update
>
> Loading composer repositories with package information
>
>
> Could not fetch <https://api.github.com/repos/fuel/docs>, pl... | 2015/06/25 | [
"https://Stackoverflow.com/questions/31041201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179841/"
] | As others said this has nothing to do with FuelPHP itself, but there is a valid point though that users without Github account should still be able to use FuelPHP.
As others also pointed, this error is caused by the [Github API rate limit](https://developer.github.com/v3/#rate-limiting), which is 50/hour AFAIK.
What ... | 1. Use the official Zip file.
2. Wait until GitHub API limits reset (60 hits/one hour). |
31,041,201 | I downloaded fuelphp 1.7.3 from [its website](http://fuelphp.com/). When I run `composer update`, I'm requested to enter a token. What token I will have to provide?
>
> $ composer update
>
> Loading composer repositories with package information
>
>
> Could not fetch <https://api.github.com/repos/fuel/docs>, pl... | 2015/06/25 | [
"https://Stackoverflow.com/questions/31041201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179841/"
] | As others said this has nothing to do with FuelPHP itself, but there is a valid point though that users without Github account should still be able to use FuelPHP.
As others also pointed, this error is caused by the [Github API rate limit](https://developer.github.com/v3/#rate-limiting), which is 50/hour AFAIK.
What ... | * Login to your GitHub account
* Go to <https://github.com/settings/tokens>
* Create a token
* In "C:/Users/Singtech/AppData/Roaming/Com poser/auth.json" put:
>
>
> ```
> {
> "config": {
> "github-oauth": {
> "github.com": "YOUR_TOKEN"
> }
> }
> }
>
> ```
>
> |
4,563,764 | In my local environment I have many small PHP files in different folders. I use "include" or "require once" to run them together.
I'm going to upload my little project to the web but I only want to upload it as one PHP file. I need to merge the files together.
I found a nice function that makes an include as a string... | 2010/12/30 | [
"https://Stackoverflow.com/questions/4563764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148496/"
] | I would heartily suggest heading to [Google's Android Developers Page](http://developer.android.com/index.html). A large amount of resources are available, including sample code. | You'll need to bind to the onClick() method of your images and speficy an onClickListener object that updates the TextView/EditText. |
4,563,764 | In my local environment I have many small PHP files in different folders. I use "include" or "require once" to run them together.
I'm going to upload my little project to the web but I only want to upload it as one PHP file. I need to merge the files together.
I found a nice function that makes an include as a string... | 2010/12/30 | [
"https://Stackoverflow.com/questions/4563764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148496/"
] | You'll need to bind to the onClick() method of your images and speficy an onClickListener object that updates the TextView/EditText. | If your list of images is being managed by an adapter, match the list with a list or array of names which you can then use to update the TextView by using the position of the image clicked in the list. I use a similar approach with a Gallery of icons and a TextView :
```
final TextView name = (TextView)findViewById(R.... |
4,563,764 | In my local environment I have many small PHP files in different folders. I use "include" or "require once" to run them together.
I'm going to upload my little project to the web but I only want to upload it as one PHP file. I need to merge the files together.
I found a nice function that makes an include as a string... | 2010/12/30 | [
"https://Stackoverflow.com/questions/4563764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148496/"
] | I would heartily suggest heading to [Google's Android Developers Page](http://developer.android.com/index.html). A large amount of resources are available, including sample code. | If your list of images is being managed by an adapter, match the list with a list or array of names which you can then use to update the TextView by using the position of the image clicked in the list. I use a similar approach with a Gallery of icons and a TextView :
```
final TextView name = (TextView)findViewById(R.... |
4,563,764 | In my local environment I have many small PHP files in different folders. I use "include" or "require once" to run them together.
I'm going to upload my little project to the web but I only want to upload it as one PHP file. I need to merge the files together.
I found a nice function that makes an include as a string... | 2010/12/30 | [
"https://Stackoverflow.com/questions/4563764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148496/"
] | I would heartily suggest heading to [Google's Android Developers Page](http://developer.android.com/index.html). A large amount of resources are available, including sample code. | Just to toss this out there ... if you have not checked out [**Google's Android App Inventor**](http://appinventor.googlelabs.com/) yet then definitely take a moment to see the tools they have freely available. Along with the tools they have several neat [**tutorials**](http://appinventor.googlelabs.com/learn/tutorials... |
4,563,764 | In my local environment I have many small PHP files in different folders. I use "include" or "require once" to run them together.
I'm going to upload my little project to the web but I only want to upload it as one PHP file. I need to merge the files together.
I found a nice function that makes an include as a string... | 2010/12/30 | [
"https://Stackoverflow.com/questions/4563764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148496/"
] | Just to toss this out there ... if you have not checked out [**Google's Android App Inventor**](http://appinventor.googlelabs.com/) yet then definitely take a moment to see the tools they have freely available. Along with the tools they have several neat [**tutorials**](http://appinventor.googlelabs.com/learn/tutorials... | If your list of images is being managed by an adapter, match the list with a list or array of names which you can then use to update the TextView by using the position of the image clicked in the list. I use a similar approach with a Gallery of icons and a TextView :
```
final TextView name = (TextView)findViewById(R.... |
34,074 | For those unfamiliar with the game, to select Zero Suit Samus you have to choose (normal) Samus as your character, and then hold down certain buttons when someone presses start. (For example, with the Gamecube controller, holding down the L and R shoulder buttons works.) Now that's all well and good, but what am I supp... | 2011/11/03 | [
"https://gaming.stackexchange.com/questions/34074",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/7448/"
] | You could try using Training Mode and the Up/Down/Up taunt sequence to do it.
1. Start training mode, selecting Samus as your opponent.
2. Set CPU to control.
3. Pick up player two's controller and *very* quickly perform an up taunt, down taunt, and up taunt. This will cause Samus to lose her suit. (If this is difficu... | Here's another solution using [Pity Final Smashes](http://www.ssbwiki.com/Pity_Final_Smash#Pity_Final_Smash):
1. Set item frequency to Off, but leave the Smash Ball item on.
2. Start a timed match with infinite time against a Samus CPU. (Alternately, start a stock match with around ten or more stocks.)
3. KO Samus a f... |
34,074 | For those unfamiliar with the game, to select Zero Suit Samus you have to choose (normal) Samus as your character, and then hold down certain buttons when someone presses start. (For example, with the Gamecube controller, holding down the L and R shoulder buttons works.) Now that's all well and good, but what am I supp... | 2011/11/03 | [
"https://gaming.stackexchange.com/questions/34074",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/7448/"
] | Selecting a CPU ZSS uses the same method as a human one: Hold down specific buttons while pressing Start on the character selection screen. The key is that you need to use whatever controller is attached to the CPU player's slot.
So, with CPU Samus as P2, use the P2 controller to hold down the specific button, and you... | You could try using Training Mode and the Up/Down/Up taunt sequence to do it.
1. Start training mode, selecting Samus as your opponent.
2. Set CPU to control.
3. Pick up player two's controller and *very* quickly perform an up taunt, down taunt, and up taunt. This will cause Samus to lose her suit. (If this is difficu... |
34,074 | For those unfamiliar with the game, to select Zero Suit Samus you have to choose (normal) Samus as your character, and then hold down certain buttons when someone presses start. (For example, with the Gamecube controller, holding down the L and R shoulder buttons works.) Now that's all well and good, but what am I supp... | 2011/11/03 | [
"https://gaming.stackexchange.com/questions/34074",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/7448/"
] | Selecting a CPU ZSS uses the same method as a human one: Hold down specific buttons while pressing Start on the character selection screen. The key is that you need to use whatever controller is attached to the CPU player's slot.
So, with CPU Samus as P2, use the P2 controller to hold down the specific button, and you... | Here's another solution using [Pity Final Smashes](http://www.ssbwiki.com/Pity_Final_Smash#Pity_Final_Smash):
1. Set item frequency to Off, but leave the Smash Ball item on.
2. Start a timed match with infinite time against a Samus CPU. (Alternately, start a stock match with around ten or more stocks.)
3. KO Samus a f... |
12,351,783 | I want to create entire website based on 2 columns only. So I want to remove all one column and 3 column layouts.
I want to remove these options even from the administration area.
How to do this? | 2012/09/10 | [
"https://Stackoverflow.com/questions/12351783",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/452432/"
] | You need to rewrite (whether by using app/code/local or by using a module) Mage\_Page\_Model\_Source\_Layout::getOptions() like this:
```
/**
* Retrieve page layout options
*
* @return array
*/
public function getOptions()
{
// Array of layout codes that are allowed
$allowedLayoutCodes = array('empty', 't... | For Remove Layout option from administrative area, you have to edit core file. For this pls comment required layouts in app\code\core\Mage\Page\etc\config.xml.
Please Make sure that you have removed all removed layout references from your frontend theme. |
30,709,480 | In my application I log the file opening in the following table:
```
TESTID SITE LATEST_READ READ_COUNT FILE_ORIGIN_ID
------------- ---------- ----------- ---------- --------------
File1 |Site1 |02/05/13 | 2| 1
File1 |Site2 |22/01/14 | 3| ... | 2015/06/08 | [
"https://Stackoverflow.com/questions/30709480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2307070/"
] | It seems that you have Display Zoom setting equals 150% on your Windows system. OpenGL isn't aware about it, you need to scale manually.
```
(define/override (on-size width height)
...
(let ([scale (get-display-backing-scale)]
[scaled-width (exact-truncate (* width scale))]
[scaled-height (exact-tr... | It seems that you are not using `(gl-ortho -1 1 -1 1 -1 1)` directly but instead you additionally multiply left and right values by `aspect` in `(gl-ortho (* aspect -1) (* aspect 1) -1 1 -1 1)`. It is wrong, as -1 and 1 will always point to left and right border (if other values are as specified) independently of your ... |
11,410,691 | I have a test class extending `junit.framework.TestCase` with several test methods.Each method opens a HTTP connection to server and exchange request and response json strings.One method gets a response with a string called UID(similar to sessionId) which i need to use in subsequent requests to the server.
I was previ... | 2012/07/10 | [
"https://Stackoverflow.com/questions/11410691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1304824/"
] | You will need a static variable for this because each test gets its own instance of the test class.
Use this pattern:
```
private static String uuid;
private void login() {
// Run this only once
if (null != uuid) return;
... talk to your server ...
uuid = responseFromServer.getUuid();
}
@Test
publi... | JUnit will create a new instance of the class for each test. Consequently you should likely set up and store this info as static to the class, using a [@BeforeClass](http://junit.sourceforge.net/javadoc/org/junit/BeforeClass.html) annotated static method.
See [this SO answer](https://stackoverflow.com/a/3353183/12960)... |
53,603,208 | Can someone help me understand how this event handler is structured? Why do they have two arrow functions lined up?
```
const callAll = (...fns) => (...args) => fns.forEach(fn => fn && fn(...args));
``` | 2018/12/03 | [
"https://Stackoverflow.com/questions/53603208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3735816/"
] | It's a higher-order function - a function that returns another function. In this particular case, your function, when given an list of functions, returns a new function that applies these functions in turn to its argument(s). This higher-order function is usually called `compose` or `pipe`, because this is what it does... | It's a function that accepts *n* functions, and returns a function that when called with *n* arguments calls each of the supplied functions with those arguments.
Here's the code expanded:
```js
// Accept functions
function callAll(...fns) {
// Return a function that accepts arguments
return function (...args)... |
25,278,344 | I'm automating tests for our webapp in Selenium WebDriver for C#. One of our test scenarios identified an issue with clicking the save button multiple times resulting in multiple identical records.
The standard `IWebElement.Click()` causes Selenium to block until the page is fully loaded. That means by the time our se... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25278344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3213885/"
] | You could either wait for a predetermined amount of time for the page to load:
```
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
```
...or to be more dynamic and wait for your button to appear:
```
var driver = new WebDriver();
var wait = new WebDriverWait(driver, TimeSpan(0, 1, 0));
wait.Unt... | What you need to do is click via javascript. In java this is done like this:
```
IJavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", driver.findElement(By.id("gbqfd")));
executor.executeScript("arguments[0].click();", driver.findElement(By.id("gbqfd")));
```
I a... |
25,278,344 | I'm automating tests for our webapp in Selenium WebDriver for C#. One of our test scenarios identified an issue with clicking the save button multiple times resulting in multiple identical records.
The standard `IWebElement.Click()` causes Selenium to block until the page is fully loaded. That means by the time our se... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25278344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3213885/"
] | If we use JavaScript to send our click events, Selenium will not be blocked and we can click multiple times. However, because our click triggers a page load, we cannot reference the element directly. Instead, we need to specify the location to click and then fire our click events.
Because our WebApp uses JQuery, I was... | You could either wait for a predetermined amount of time for the page to load:
```
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
```
...or to be more dynamic and wait for your button to appear:
```
var driver = new WebDriver();
var wait = new WebDriverWait(driver, TimeSpan(0, 1, 0));
wait.Unt... |
25,278,344 | I'm automating tests for our webapp in Selenium WebDriver for C#. One of our test scenarios identified an issue with clicking the save button multiple times resulting in multiple identical records.
The standard `IWebElement.Click()` causes Selenium to block until the page is fully loaded. That means by the time our se... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25278344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3213885/"
] | If we use JavaScript to send our click events, Selenium will not be blocked and we can click multiple times. However, because our click triggers a page load, we cannot reference the element directly. Instead, we need to specify the location to click and then fire our click events.
Because our WebApp uses JQuery, I was... | What you need to do is click via javascript. In java this is done like this:
```
IJavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", driver.findElement(By.id("gbqfd")));
executor.executeScript("arguments[0].click();", driver.findElement(By.id("gbqfd")));
```
I a... |
396,787 | how is it possible to correct the spacing of column 1 and the other spaces?
The MWE:
```
\documentclass{article}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\usepackage{array}
\usepackage{graphicx}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\... | 2017/10/18 | [
"https://tex.stackexchange.com/questions/396787",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/95076/"
] | You can split the contents of a cell with an inner tabular:
```
\documentclass{article}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\usepackage{array}
\usepackage{graphicx}
\newcommand{\splitcell}[2][c]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
\newcommand{\ccell}[2]{\cellcolor[HTML]{#1}{#2}}
\begin{document}
... | like this?
[](https://i.stack.imgur.com/pHjlV.png)
```
\documentclass{article}
\usepackage{rotating}
\usepackage[table]{xcolor}
\usepackage{array, booktabs, makecell}
\renewcommand\theadfont{\normalsize\bfseries}
\usepackage{graphicx}
\newcolumntyp... |
3,824,462 | Suppose that $x,y\in [0,1]$. Prove that $\frac{1}{\sqrt{1+x^2}}+\frac{1}{\sqrt{1+y^2}}\leq \frac{2}{\sqrt{1+xy}}.$
I suppose that this problem can be solved by some application of AM-GM inequality. I was trying to do the following: since $xy\leq \frac{x^2+y^2}{2}$ then $\frac{2}{\sqrt{1+xy}}\geq \frac{2}{\sqrt{1+x^2/2... | 2020/09/13 | [
"https://math.stackexchange.com/questions/3824462",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99694/"
] | We have
$$\left(\frac{1}{\sqrt{1+x^2}}+\frac{1}{\sqrt{1+y^2}}\right)^2 = \frac{1}{1+x^2}+\frac{1}{1+y^2}+\frac{2}{\sqrt{(1+x^2)(1+y^2)}}$$
Using the AM-GM we have
$$\frac{2}{\sqrt{(1+x^2)(1+y^2)}} \leqslant \frac{1}{1+x^2}+\frac{1}{1+y^2}.$$
Therefore, we need to prove
$$\frac{1}{1+x^2}+\frac{1}{1+y^2}\leqslant \frac{2... | Apply Jensen's inequality to
$$f(t)=\frac{1}{\sqrt{1+e^{-t}}}.$$
One has
$$f'(t)=\frac{e^{-t}}{2(1+e^{-t})^{3/2}}$$
and
$$f''(t)=\frac{3e^{-2t}}{4(1+e^{-t})^{5/2}}-\frac{e^{-t}}{2(1+e^{-t})^{3/2}}
=\frac{e^{-2t}-2e^{-t}}{4(1+e^{-t})^{5/2}}<0$$
for $t>0$.
So $f$ is concave, and $f(2t)+f(2u)\le f(t+u)$ for $t$, $u\ge0$.... |
25,055,648 | I have a silly problem and I am possibly going about this the wrong way.
I want to add a property to a class to change a field. I am thinking that this is not possible due to the Class level of protection.
SEE: [Microsoft.SPOT.Hardware.PWM](http://msdn.microsoft.com/en-us/library/microsoft.spot.hardware.pwm(v=vs.102)... | 2014/07/31 | [
"https://Stackoverflow.com/questions/25055648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1183804/"
] | Yes of course : `List.add(item)` returns a `boolean` and your answer returns a `String`. | It's not possible to violate the return type of the method you are mocking. The return value of `mockedList.add()` is boolean so your mock should also be boolean other than `"called with arguments: " + args` |
26,045 | Is it possible to in-flight receive navigation data on an electronic device (like smartphone and/or tablet) present in the cockpit?
I refer to General Aviation aircraft and navigation data like airspeed (not groundspeed), GPS and AHRS data. | 2016/03/11 | [
"https://aviation.stackexchange.com/questions/26045",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/13903/"
] | *EDIT: This answer applies to large commercial aircraft.*
As a normal passenger? No. As @mins said, this data is captured, processed, and displayed within the aircraft's avionics system, but this data is not available to passengers (it's not transmitted outside the avionics system).
When aircraft are being develope... | Yes but only with certain avionics. [Avidyne recently released an SDK](http://www.avidyne.com/news/press.asp?release=320) that allows third party developers (tablet/smart phone) to interface with their [IDF440 and 540 units](http://www.avidyne.com/products/ifd/index.html). There are two levels of access (read only and ... |
26,045 | Is it possible to in-flight receive navigation data on an electronic device (like smartphone and/or tablet) present in the cockpit?
I refer to General Aviation aircraft and navigation data like airspeed (not groundspeed), GPS and AHRS data. | 2016/03/11 | [
"https://aviation.stackexchange.com/questions/26045",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/13903/"
] | Garmin has a product called [Connext](http://www8.garmin.com/aviation/brochures/connext.pdf) that allows you to stream in-flight avionics data to mobile devices. They are pushing that product as a move towards connected components and a "Bring your own device" approach to cockpit automation.
So is it possible in gener... | Yes but only with certain avionics. [Avidyne recently released an SDK](http://www.avidyne.com/news/press.asp?release=320) that allows third party developers (tablet/smart phone) to interface with their [IDF440 and 540 units](http://www.avidyne.com/products/ifd/index.html). There are two levels of access (read only and ... |
33,465,495 | I assume that is function overloading since it has diff type of parameter .My question is
Two functions, which has diff type of parameter, diff return type will be considered as Function Overloading?
```
public class Header {
public int addTwoNumbers(int a, int b){
return a+b;
}
public double addTwoNumbers(double... | 2015/11/01 | [
"https://Stackoverflow.com/questions/33465495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5513241/"
] | We can try
```
1:5 + rep(0:4,each=5)
#[1] 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9
``` | Or like this?
```
c(sapply(1:5, function(x) seq(x,x+4)))
[1] 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9
``` |
33,465,495 | I assume that is function overloading since it has diff type of parameter .My question is
Two functions, which has diff type of parameter, diff return type will be considered as Function Overloading?
```
public class Header {
public int addTwoNumbers(int a, int b){
return a+b;
}
public double addTwoNumbers(double... | 2015/11/01 | [
"https://Stackoverflow.com/questions/33465495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5513241/"
] | We can try
```
1:5 + rep(0:4,each=5)
#[1] 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9
``` | Just for the sports of it, adding a `data.table` version using it's `shift` function
```
unlist(data.table(1:10)[, shift(V1, 5:1)][6:10], use.names = FALSE)
# [1] 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9
``` |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | C 140 ~~177 235~~
=================
Good old procedural style, no fancyness.
It counts (no write) 11,459,252,883 names in 8 minutes.
Next edit with the runtime and size of names file. Watch the sky...
**Runtime** 57 minutes, file size 126,051,781,713 (9 chars+crlf per row). Please tell me the monks' email a... | [Pyth](https://github.com/isaacg1/pyth/blob/master/pyth.py), 34 characters
==========================================================================
```
Kf<T"n"GJKFbJI>lb9Bb~Jm+bdfXVb*Y3K
```
Explanation:
```
Kf<T"n"G K = list of letters in the alphabet before n.
JK J = copy of K
FbJ ... |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | Perl, 70 68 66 50 characters
============================
```
$"=",";map/(.)\1{3}/||say,glob$i.="{@a}"for@a=A..M
```
Usage:
```
$ perl -E 'code' > output_file
```
The nice thing is that the prints are buffered, so you get all 1-character solutions printed first, followed by 2-character words and so on. | [Japt](https://github.com/ETHproductions/japt), 21 bytes
========================================================
```
Ep9 osE kè/0|(.)\1{3}
```
[Try it online!](https://ethproductions.github.io/japt/?v=2.0a0&code=RXA0IG9zRSBr6C8wfCguKVwxezN9&input=LVI=) (the link only computes up to `14**4`.)
### How it works
```
... |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | Golfscript, ~~58~~ 47 characters
================================
```
"A"13
9?,{13base{65+}%n+}%{`{\4*/,}+78,1/%1-!},
```
Thanks to Peter Taylor, I am spared from the seppuku from not beating the Ruby solution! [Run the code up to 10 yourself](http://golfscript.apphb.com/?c=ICAgICJBIjEwLHsxM2Jhc2V7NjUrfSVuK30le2B7XD... | Perl - 35 bytes
---------------
```perl
#!perl -l
/(.)\1{3}|[N-Z]/||print for A..1x9
```
Counting the shebang as one byte.
This is a loose translation of [histocrat's answer](https://codegolf.stackexchange.com/a/28840/4098).
`A..1x9` is a bit of an oddity; this is shorthand for `'A'..'111111111'`. The accumulator ... |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | [Pyth](https://github.com/isaacg1/pyth/blob/master/pyth.py), 34 characters
==========================================================================
```
Kf<T"n"GJKFbJI>lb9Bb~Jm+bdfXVb*Y3K
```
Explanation:
```
Kf<T"n"G K = list of letters in the alphabet before n.
JK J = copy of K
FbJ ... | [Japt](https://github.com/ETHproductions/japt), 21 bytes
========================================================
```
Ep9 osE kè/0|(.)\1{3}
```
[Try it online!](https://ethproductions.github.io/japt/?v=2.0a0&code=RXA0IG9zRSBr6C8wfCguKVwxezN9&input=LVI=) (the link only computes up to `14**4`.)
### How it works
```
... |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | C 140 ~~177 235~~
=================
Good old procedural style, no fancyness.
It counts (no write) 11,459,252,883 names in 8 minutes.
Next edit with the runtime and size of names file. Watch the sky...
**Runtime** 57 minutes, file size 126,051,781,713 (9 chars+crlf per row). Please tell me the monks' email a... | Python 2 - 212 bytes
====================
```
from itertools import chain,product as p
a='ABCDEFGHIJKLM'
q={c*4 for c in a}
c=0
for n in chain(*(p(*([a]*l)) for l in range(1,10))):
n=''.join(n)
if not any(u in n for u in q):print n
c+=1
if c==10**9:break
``` |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | C 140 ~~177 235~~
=================
Good old procedural style, no fancyness.
It counts (no write) 11,459,252,883 names in 8 minutes.
Next edit with the runtime and size of names file. Watch the sky...
**Runtime** 57 minutes, file size 126,051,781,713 (9 chars+crlf per row). Please tell me the monks' email a... | Perl - 35 bytes
---------------
```perl
#!perl -l
/(.)\1{3}|[N-Z]/||print for A..1x9
```
Counting the shebang as one byte.
This is a loose translation of [histocrat's answer](https://codegolf.stackexchange.com/a/28840/4098).
`A..1x9` is a bit of an oddity; this is shorthand for `'A'..'111111111'`. The accumulator ... |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | Ruby, 46
========
```
?A.upto(?M*9){|s|s[/(.)\1{3}|[N-Z]/]||puts(s)}
```
My original, similar solution was longer and wrong (it output base13 numbers, which isn't quite all of them due to leading zeroes), but I'll leave it here because it got votes anyway.
```
1.upto(13**9){|i|(s=i.to_s 13)[/(.)\1{3}/]||puts(s)}
`... | Python 2 - 212 bytes
====================
```
from itertools import chain,product as p
a='ABCDEFGHIJKLM'
q={c*4 for c in a}
c=0
for n in chain(*(p(*([a]*l)) for l in range(1,10))):
n=''.join(n)
if not any(u in n for u in q):print n
c+=1
if c==10**9:break
``` |
28,838 | The 9 Billion Names of God is a short story by Arthur C. Clarke. It's about a group of Tibetan monks whose order is devoted to writing down all the possible names of God, written in their own alphabet. Essentially, they are devoted to writing every possible permutation of their alphabet, restricted by a few rules. In t... | 2014/05/30 | [
"https://codegolf.stackexchange.com/questions/28838",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/19462/"
] | Ruby, 46
========
```
?A.upto(?M*9){|s|s[/(.)\1{3}|[N-Z]/]||puts(s)}
```
My original, similar solution was longer and wrong (it output base13 numbers, which isn't quite all of them due to leading zeroes), but I'll leave it here because it got votes anyway.
```
1.upto(13**9){|i|(s=i.to_s 13)[/(.)\1{3}/]||puts(s)}
`... | Perl - 35 bytes
---------------
```perl
#!perl -l
/(.)\1{3}|[N-Z]/||print for A..1x9
```
Counting the shebang as one byte.
This is a loose translation of [histocrat's answer](https://codegolf.stackexchange.com/a/28840/4098).
`A..1x9` is a bit of an oddity; this is shorthand for `'A'..'111111111'`. The accumulator ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.