qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
52,324,863 | For example, turn this:
```
const enums = { ip: 'ip', er: 'er' };
const obj = {
somethingNotNeeded: {...},
er: [
{ a: 1},
{ b: 2}
],
somethingElseNotNeeded: {...},
ip: [
{ a: 1},
{ b: 2}
]
}
```
Into this:
```
[
{ a: 1},
{ b: 2},
{ a: 1},
{ b: 2}
]
```
I'm already doing this i... | 2018/09/14 | [
"https://Stackoverflow.com/questions/52324863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391600/"
] | Get the `enums` properties with [`Object.values()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Object/values) (or [`Object.keys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) if they are always identical). Use [`Array.map()`](https... | Since you're not using the `key` of the `enums` in the final output, we could simply use an `Array` instead of an object.
```
const enums = ['ip', 'er'];
const obj = {
somethingNotNeeded: {},
er: [
{ a: 1 },
{ b: 2 },
],
somethingElseNotNeeded: {},
ip: [
{ a: 1 },
{ b: 2 }
]
};
const res... |
55,094,997 | I want to export outlook **NON-HTML Email Body** into excel with a click of a button inside excel. Below are my codes. Appreciate if anyone could assist me on this.
This is the code that I use to print the **plain text email body** but I get a lot of unwanted text
>
> sText = **StrConv(OutlookMail.RTFBody, vbUnicode... | 2019/03/11 | [
"https://Stackoverflow.com/questions/55094997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954825/"
] | An email can have several bodies or none. Outlook recognises text, Html and RTF bodies. No email I have examined in recent years contained a RTF body. Once it was the only option if you wanted to format your message. Today, Html and CSS offer far more functionality than RTF and I doubt if any smartphone accepts RTF. I ... | Excel does not not support RTF directly, but plain text `MailItem.Body` should work fine, I have never seen `MailItem.Body` raising an exception. Do you save the message first? |
55,094,997 | I want to export outlook **NON-HTML Email Body** into excel with a click of a button inside excel. Below are my codes. Appreciate if anyone could assist me on this.
This is the code that I use to print the **plain text email body** but I get a lot of unwanted text
>
> sText = **StrConv(OutlookMail.RTFBody, vbUnicode... | 2019/03/11 | [
"https://Stackoverflow.com/questions/55094997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954825/"
] | Thank you for all the answers, I have improved my codes and I have figured out the issue. It is due to the "=" symbols that is generated from the script and sent to my email. Excel treat the "=" sign differently that's why it didn't allow me to extract properly. Once I changed the "=" symbol to "#" symbol, I can extrac... | Excel does not not support RTF directly, but plain text `MailItem.Body` should work fine, I have never seen `MailItem.Body` raising an exception. Do you save the message first? |
8,832,464 | I can target all browsers using this code:
```
<link rel="stylesheet" media="screen and (min-device-width: 1024px)" href="large.css"/>
<link rel='stylesheet' media='screen and (min-width: 1023px) and (max-width: 1025px)' href='medium.css' />
<link rel='stylesheet' media="screen and (min-width: 419px) and (max-width: ... | 2012/01/12 | [
"https://Stackoverflow.com/questions/8832464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/771291/"
] | Use this jQuery snipet to set a class on the BODY tag:
```
$(document).ready(function(){
var width = $(window).width();
var class = 'small';
if(width > 1024) {
class = 'large';
} else if(width > 1023 && width < 1025) {
class = 'medium';
}
$('body').addClass(class);
});
```
With appropriate clas... | I really recommend using a javascript alternative like syze for example.
<http://rezitech.github.com/syze/> |
8,832,464 | I can target all browsers using this code:
```
<link rel="stylesheet" media="screen and (min-device-width: 1024px)" href="large.css"/>
<link rel='stylesheet' media='screen and (min-width: 1023px) and (max-width: 1025px)' href='medium.css' />
<link rel='stylesheet' media="screen and (min-width: 419px) and (max-width: ... | 2012/01/12 | [
"https://Stackoverflow.com/questions/8832464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/771291/"
] | There are a number of [polyfills listed on the moderizer wiki](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills) that includes several claiming to support media queries. | I really recommend using a javascript alternative like syze for example.
<http://rezitech.github.com/syze/> |
1,125,931 | The spherical Bessel equation is:
$$x^2y'' + 2xy' + (x^2 - \frac{5}{16})y = 0$$
If I seek a Frobenius series solution, I will have:
\begin{align\*}
&\quad y = \sum\_{n = 0}^{\infty} a\_nx^{n + r} \\
&\implies y' = \sum\_{n = 0}^{\infty} (n + r)a\_nx^{n + r - 1} \\
&\implies y'' = \sum\_{n = 0}^{\infty} (n + r)(n ... | 2015/01/30 | [
"https://math.stackexchange.com/questions/1125931",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/115703/"
] | The main indicial is the the first equation. You get two roots from the first equation so you should set $a\_1=0$. If there is a common root between the first and second equations, then you can consider that root and set both $a\_1$ and $a\_0$ nonzero. | You set the value of $r$ found in the first equation into the second equation. It then defines $a\_n$ in terms of $a\_{n-2}$ for all $n \geq 2$. So, once we know $a\_0$, $a\_1$ we get $a\_2$ from the second equation and so on. |
19,846,817 | It seems like `require` calls are executed asynchronously, allowing program flow to continue around them. This is problematic when I'm trying to use a value set within a `require` call as a return value. For instance:
main.js:
```
$(document).ready(function() {
requirejs.config({
baseUrl: 'js'
});
... | 2013/11/07 | [
"https://Stackoverflow.com/questions/19846817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1040915/"
] | Yes, require calls are executed `asynchronously`. So your example won't work, because
```
function test() {
var returnValue = 'firstValue';
requirejs(['other2'], function(other2) { // <-- ASYNC CALL
other2.doSomething();
returnValue = 'secondValue';
})
return returnValue; // <-- RET... | It looks like before `other1` returns, you want `other2` to be present, and you want to call a method on `other2` which will affect what you return for `other1`.
I think you'll want to-rethink your dependencies. `other2` appears to be a **dependency** of `other1`; it needs to be defined as such:
```
//in other1.js
d... |
57,215,753 | I have a link that is placed in `li` and when you hover on it, a block should appear with links that I will indicate in it
```
<li id="dropdown" class="li">
<a href="/news/">Lessons</a>
</li>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
``` | 2019/07/26 | [
"https://Stackoverflow.com/questions/57215753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11714641/"
] | In this case, you don't have to declare `global`. Simply indent your `submitBtn` function inside `entry_Fn`:
```
def entry_Fn():
level_1 = Toplevel(root)
Label( level_1, text = "level one").pack()
entry_1 = Entry(level_1)
entry_1.pack()
entry_2 = Entry(level_1)
entry_2.pack()
def submitBtn(... | For your case, you can simply pass the two entries to `submitBtn()` function:
```
def submitBtn(entry_1, entry_2):
....
```
Then update the `command=` for the submit button inside `entry_Fn()`:
```
Button(level_1, text="submit", command=lambda: submitBtn(entry_1, enter_2)).pack()
``` |
57,215,753 | I have a link that is placed in `li` and when you hover on it, a block should appear with links that I will indicate in it
```
<li id="dropdown" class="li">
<a href="/news/">Lessons</a>
</li>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
``` | 2019/07/26 | [
"https://Stackoverflow.com/questions/57215753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11714641/"
] | For your case, you can simply pass the two entries to `submitBtn()` function:
```
def submitBtn(entry_1, entry_2):
....
```
Then update the `command=` for the submit button inside `entry_Fn()`:
```
Button(level_1, text="submit", command=lambda: submitBtn(entry_1, enter_2)).pack()
``` | You can subclass `tk.TopLevel`, and use a `tk.IntVar` to transfer the data back to root:
```
import tkinter as tk
class EntryForm(tk.Toplevel):
def __init__(self, master, sum_var):
super().__init__(master)
tk.Label(self, text="level one").pack()
self.sum_var = sum_var
self.entry_1... |
57,215,753 | I have a link that is placed in `li` and when you hover on it, a block should appear with links that I will indicate in it
```
<li id="dropdown" class="li">
<a href="/news/">Lessons</a>
</li>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
``` | 2019/07/26 | [
"https://Stackoverflow.com/questions/57215753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11714641/"
] | In this case, you don't have to declare `global`. Simply indent your `submitBtn` function inside `entry_Fn`:
```
def entry_Fn():
level_1 = Toplevel(root)
Label( level_1, text = "level one").pack()
entry_1 = Entry(level_1)
entry_1.pack()
entry_2 = Entry(level_1)
entry_2.pack()
def submitBtn(... | You can subclass `tk.TopLevel`, and use a `tk.IntVar` to transfer the data back to root:
```
import tkinter as tk
class EntryForm(tk.Toplevel):
def __init__(self, master, sum_var):
super().__init__(master)
tk.Label(self, text="level one").pack()
self.sum_var = sum_var
self.entry_1... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | Other answers are great, but I'll add my experience. When playing live with a band, you have a lot going on at the same time. So mistakes may be masked by the rest of the band.
Most importantly though, is that you roll with it. Not just from the perspective that mistakes can still work, but that if you let it get to y... | No. Professionals are so perfect they never hit a single note wrong, and if you try to play like they do and they find out you make mistakes, they will come to your house at night and you will be banned from playing in front of people until the end of your life (or the end of the world, whatever comes first.)
Ok, now ... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | If you are talking about mistakes made during a live performance, all guitarists make them and most of the time they will not play solos note for note as recorded on the studio version (see the many Youtube videos of Steve Vai's original and several live versions of "Tender Surrender").
If you are talking about a reco... | Other answers are great, but I'll add my experience. When playing live with a band, you have a lot going on at the same time. So mistakes may be masked by the rest of the band.
Most importantly though, is that you roll with it. Not just from the perspective that mistakes can still work, but that if you let it get to y... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | I would expect that the musicians in top bands play extremely consistently, due to sheer repetition and the fact that it's their career.
However, your question touches on a trickier idea: What exactly is a "mistake"? If the exact notes and rhythms are prescribed, then any deviation from that clearly constitutes a mist... | I am not a guitarist myself, but I know a really great one and he assures me that he has never played all the way through a song without making a mistake, nor has he ever played a piece through exactly the same way twice. He's always tweaking things here and there. If you're comparing yourself to recordings, you have t... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | 'Perfectly': never. 'Very Good': usually. Professionals tend to want to show you what they can do, rather than what they can't; it's their meal ticket, after all.
One of the skills in being an instrumentalist though is to practice techniques that allow you *to* power through small mistakes without disrupting the rhyth... | I am not a guitarist myself, but I know a really great one and he assures me that he has never played all the way through a song without making a mistake, nor has he ever played a piece through exactly the same way twice. He's always tweaking things here and there. If you're comparing yourself to recordings, you have t... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | If you are talking about mistakes made during a live performance, all guitarists make them and most of the time they will not play solos note for note as recorded on the studio version (see the many Youtube videos of Steve Vai's original and several live versions of "Tender Surrender").
If you are talking about a reco... | No. Professionals are so perfect they never hit a single note wrong, and if you try to play like they do and they find out you make mistakes, they will come to your house at night and you will be banned from playing in front of people until the end of your life (or the end of the world, whatever comes first.)
Ok, now ... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | 'Perfectly': never. 'Very Good': usually. Professionals tend to want to show you what they can do, rather than what they can't; it's their meal ticket, after all.
One of the skills in being an instrumentalist though is to practice techniques that allow you *to* power through small mistakes without disrupting the rhyth... | I'll talk about live performances since, as other posters have mentioned, recorded performances can easily be fixed with editing.
Mistakes? Yes. Always.
But don't let them stop you!
As a not-top-notch performer I can tell you that there is a stark difference between your (the performer's) perception of the performan... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | 'Perfectly': never. 'Very Good': usually. Professionals tend to want to show you what they can do, rather than what they can't; it's their meal ticket, after all.
One of the skills in being an instrumentalist though is to practice techniques that allow you *to* power through small mistakes without disrupting the rhyth... | No. Professionals are so perfect they never hit a single note wrong, and if you try to play like they do and they find out you make mistakes, they will come to your house at night and you will be banned from playing in front of people until the end of your life (or the end of the world, whatever comes first.)
Ok, now ... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | I would expect that the musicians in top bands play extremely consistently, due to sheer repetition and the fact that it's their career.
However, your question touches on a trickier idea: What exactly is a "mistake"? If the exact notes and rhythms are prescribed, then any deviation from that clearly constitutes a mist... | I'll talk about live performances since, as other posters have mentioned, recorded performances can easily be fixed with editing.
Mistakes? Yes. Always.
But don't let them stop you!
As a not-top-notch performer I can tell you that there is a stark difference between your (the performer's) perception of the performan... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | Other answers are great, but I'll add my experience. When playing live with a band, you have a lot going on at the same time. So mistakes may be masked by the rest of the band.
Most importantly though, is that you roll with it. Not just from the perspective that mistakes can still work, but that if you let it get to y... | “Never lose the groove in order to find a note.”
― Victor L. Wooten, The Music Lesson: A Spiritual Search for Growth Through Music
This acknowledges that musicians do play "wrong" notes, but what's more important is the flow of the piece. As for "wrong," it depends on how formalized the piece is. Some classical music... |
53,874 | I playing guitar since a couple of years (but not regularly) and I always wondered if guitarist from known bands always play their songs/solos perfectly?
Especially when the songs are fast paced, is it easier to make mistakes that no one will notice? When I play solos I am never really satisfied with my performance sin... | 2017/02/28 | [
"https://music.stackexchange.com/questions/53874",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/37313/"
] | If you are talking about mistakes made during a live performance, all guitarists make them and most of the time they will not play solos note for note as recorded on the studio version (see the many Youtube videos of Steve Vai's original and several live versions of "Tender Surrender").
If you are talking about a reco... | I'll talk about live performances since, as other posters have mentioned, recorded performances can easily be fixed with editing.
Mistakes? Yes. Always.
But don't let them stop you!
As a not-top-notch performer I can tell you that there is a stark difference between your (the performer's) perception of the performan... |
60,145,379 | I have this issue when trying to read my data which is json encoded from the php page to the swift page.
this is the code I am using
```
import Foundation
protocol HomeModelProtocol: class {
func itemsDownloaded(items: NSArray)
}
class HomeModel: NSObject, URLSessionDataDelegate {
//properties
weak v... | 2020/02/10 | [
"https://Stackoverflow.com/questions/60145379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6024981/"
] | You get this error, because the json response you receive is not an array but a dictionary.
EDIT: as pointed out in a comment, you first need to fix your json response in your php code. There is ":" missing after "connectedinside".
It should look like this:
`{\"connectedinside\":[{\"name\":\"One\",\"add\":"One... | The problem was on my php side and I fixed it.it is working now. |
25,879,652 | Is there a way in Eclipse to easily find all appearances of a variable in a file without having to manually search (CTRL + F) for it? | 2014/09/16 | [
"https://Stackoverflow.com/questions/25879652",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | with the cursor on the variable, press ctrl-shift-g. Works for variables, classes, methods, works across the entire project. If you just click on the variable, eclipse will highlight all uses of the variable in the current file, and mark the scrollbar with the places that are highlighted. | There is a search with many features accessible with `Control`+`G`, but it does not support variables inside of a function.
There is also another search, which occurs when you select a variable or other thing and press `Control`+`Shift`+`G`. |
25,879,652 | Is there a way in Eclipse to easily find all appearances of a variable in a file without having to manually search (CTRL + F) for it? | 2014/09/16 | [
"https://Stackoverflow.com/questions/25879652",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | with the cursor on the variable, press ctrl-shift-g. Works for variables, classes, methods, works across the entire project. If you just click on the variable, eclipse will highlight all uses of the variable in the current file, and mark the scrollbar with the places that are highlighted. | In case you want to find all occurrences of variable to rename it, you can do it using `Alt`+`Shift`+`R`. |
25,879,652 | Is there a way in Eclipse to easily find all appearances of a variable in a file without having to manually search (CTRL + F) for it? | 2014/09/16 | [
"https://Stackoverflow.com/questions/25879652",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | There is a search with many features accessible with `Control`+`G`, but it does not support variables inside of a function.
There is also another search, which occurs when you select a variable or other thing and press `Control`+`Shift`+`G`. | In case you want to find all occurrences of variable to rename it, you can do it using `Alt`+`Shift`+`R`. |
30,877,355 | I want to change the 'csproj' file of my unity project in order to be able to access a specific library as [this](https://stackoverflow.com/questions/5694/the-imported-project-c-microsoft-csharp-targets-was-not-found) answer sugests.
I am manually editing the file but every time i reload the project, the 'csproj' file... | 2015/06/16 | [
"https://Stackoverflow.com/questions/30877355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754152/"
] | As far as I know, you cannot prevent Unity from overwriting your csproj files upon recompilation of your scripts.
When working with larger code bases and Unity3D I tend to put most of my code into separate .Net assemblies (DLLs). This helps me when I'm sharing code between multiple projects and game servers, and Unit... | As Suigi suggested, i have created a .dll file with the help of a .Net IDE ([SharpDevelop](http://www.icsharpcode.net/OpenSource/SD/Download/)) and just copied it in the 'Assets' folder of unity.
([How do i create a .dll file with SharpDevelop](http://community.sharpdevelop.net/forums/p/14349/38210.aspx))
Here is the... |
30,877,355 | I want to change the 'csproj' file of my unity project in order to be able to access a specific library as [this](https://stackoverflow.com/questions/5694/the-imported-project-c-microsoft-csharp-targets-was-not-found) answer sugests.
I am manually editing the file but every time i reload the project, the 'csproj' file... | 2015/06/16 | [
"https://Stackoverflow.com/questions/30877355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754152/"
] | As far as I know, you cannot prevent Unity from overwriting your csproj files upon recompilation of your scripts.
When working with larger code bases and Unity3D I tend to put most of my code into separate .Net assemblies (DLLs). This helps me when I'm sharing code between multiple projects and game servers, and Unit... | Just for completeness:
There is an undocumented feature in Unity which allows you to edit the generated `.csproj` files (programmatically), by using an `AssetPostprocessor`:
Inside any folder under `Assets` named `Editor`, create a class with the following structure:
```
public class CsprojPostprocessor : AssetPostp... |
30,877,355 | I want to change the 'csproj' file of my unity project in order to be able to access a specific library as [this](https://stackoverflow.com/questions/5694/the-imported-project-c-microsoft-csharp-targets-was-not-found) answer sugests.
I am manually editing the file but every time i reload the project, the 'csproj' file... | 2015/06/16 | [
"https://Stackoverflow.com/questions/30877355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754152/"
] | Just for completeness:
There is an undocumented feature in Unity which allows you to edit the generated `.csproj` files (programmatically), by using an `AssetPostprocessor`:
Inside any folder under `Assets` named `Editor`, create a class with the following structure:
```
public class CsprojPostprocessor : AssetPostp... | As Suigi suggested, i have created a .dll file with the help of a .Net IDE ([SharpDevelop](http://www.icsharpcode.net/OpenSource/SD/Download/)) and just copied it in the 'Assets' folder of unity.
([How do i create a .dll file with SharpDevelop](http://community.sharpdevelop.net/forums/p/14349/38210.aspx))
Here is the... |
3,784,607 | **Purpose of the app:**
A simple app that draws a circle for every touch recognised on the screen and follows the touch events. On a 'high pressure reading' `getPressure (int pointerIndex)` the colour of the circle will change and the radius will increase. Additionally the touch ID with `getPointerId (int pointerIndex... | 2010/09/24 | [
"https://Stackoverflow.com/questions/3784607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/400022/"
] | I hate to tell you this, but it's your hardware.
The touch panel used in the Nexus One (which I believe is the same hardware used in the HTC Desire) is known for this particular artifact. We did some work to alleviate the "jumps to other finger's axis" problem around the ACTION\_POINTER\_UP/DOWN events for Android 2.2... | Anyone tried **[this fix for multitouch gestures](http://code.google.com/p/android-multitouch-controller/)** on older androids before? I am planning to evaluate it for [my own project](https://github.com/Philzen/WebView-MultiTouch-Polyfill), as it also deals with android 1.x/2.x buggy multitouch.
Luke seems to have co... |
69,903 | How do you cite a background map layer that is used in ArcMap that is retrieved from ArcGIS Online? For example the background layer is suppose to be credited from the U.S. Geological Survey and in the description it was digitized from the U.S. Geological Survey Professional Paper 1183. | 2013/08/27 | [
"https://gis.stackexchange.com/questions/69903",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/21471/"
] | According to the help topic ["Defining parameter data types in a Python toolbox"](http://resources.arcgis.com/en/help/main/10.1/index.html#/Defining_parameter_data_types_in_a_Python_toolbox/001500000035000000/), you should use `"DEFeatureClass"`. | **What is the difference between DEFeatureClass and IFeatureClass?**
First a short explanation of **Interface** vs. **Implementation**: DEFeatureClass is a CoClass ID, meaning it is an implementation of IDEFeatureClass. In COM, interfaces are separated from implementations. To get a DEFeatureClass, you must first decl... |
102,059 | Because of certain reasons, I'm sometimes tied to an extremely slow internet connection. What I realized with this, is that certain sites (for example, any subdomain of blog.hu) works in a way that needs a certain part of the site be loaded before comments are loaded too. I assume it's because of an AJAX operation, as ... | 2016/12/01 | [
"https://ux.stackexchange.com/questions/102059",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/76708/"
] | There are physical limits as to how long a line of text can be before it gets difficult to process. Much like breathing while speaking, the mind needs periodic breaks to process the string of letters and numbers it has just taken in. Line breaks provide an opportunity for this to occur. A general rule that I have heard... | @JoshDoebbert has a good point on the text legibility. [This other question](https://ux.stackexchange.com/questions/34120/relationship-between-font-size-and-width-of-container) has some interesting information on the topic.
I just wanted to add that percentages are good to let the content adapt to smaller screen size.... |
102,059 | Because of certain reasons, I'm sometimes tied to an extremely slow internet connection. What I realized with this, is that certain sites (for example, any subdomain of blog.hu) works in a way that needs a certain part of the site be loaded before comments are loaded too. I assume it's because of an AJAX operation, as ... | 2016/12/01 | [
"https://ux.stackexchange.com/questions/102059",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/76708/"
] | There are physical limits as to how long a line of text can be before it gets difficult to process. Much like breathing while speaking, the mind needs periodic breaks to process the string of letters and numbers it has just taken in. Line breaks provide an opportunity for this to occur. A general rule that I have heard... | * **Content Display**
Think about this: you make a site with content prepared for full width, no max-width. This will work relatively OK for common sizes, but full screen images for big screens will add a massive load OR they will get pixelated. Just choose your poison. And this is easily fixed by... max-width
* **Le... |
102,059 | Because of certain reasons, I'm sometimes tied to an extremely slow internet connection. What I realized with this, is that certain sites (for example, any subdomain of blog.hu) works in a way that needs a certain part of the site be loaded before comments are loaded too. I assume it's because of an AJAX operation, as ... | 2016/12/01 | [
"https://ux.stackexchange.com/questions/102059",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/76708/"
] | @JoshDoebbert has a good point on the text legibility. [This other question](https://ux.stackexchange.com/questions/34120/relationship-between-font-size-and-width-of-container) has some interesting information on the topic.
I just wanted to add that percentages are good to let the content adapt to smaller screen size.... | * **Content Display**
Think about this: you make a site with content prepared for full width, no max-width. This will work relatively OK for common sizes, but full screen images for big screens will add a massive load OR they will get pixelated. Just choose your poison. And this is easily fixed by... max-width
* **Le... |
6,803,762 | Is it possible to get list of translations (from virtual pages into physical pages) from TLB (Translation lookaside buffer, this is a special cache in the CPU). I mean modern x86 or x86\_64; and I want to do it in programmatic way, not by using JTAG and shifting all TLB entries out. | 2011/07/23 | [
"https://Stackoverflow.com/questions/6803762",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/196561/"
] | The linux kernel has no such dumper, there is page from linux kernel about cache and tlb: <https://www.kernel.org/doc/Documentation/cachetlb.txt> "Cache and TLB Flushing Under Linux." David S. Miller
There was an such TLB dump in 80386DX (and 80486, and possibly in "Embedded Pentium" 100-166 MHz / "[Embedded Pentium M... | You can get the list of VA-PA translations stored in TLB but you may have to use a processor emulator like `qemu`. You can download and install qemu from <http://wiki.qemu.org/Main_Page>
You can boot a kernel which is stored in a disk image (typically in qcow2 or raw format) and run your application. You may have to tw... |
17,200,445 | I am new to coding and I ran in trouble while trying to make my own fastq masker. The first module is supposed to trim the line with the + away, modify the sequence header (begins with >) to the line number, while keeping the sequence and quality lines (A,G,C,T line and Unicode score, respectively).
```
class Import_... | 2013/06/19 | [
"https://Stackoverflow.com/questions/17200445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2501764/"
] | used `class="ball"` as id should be unique, *but you get the point, how to create 100 div*
```
$(document).ready(function () {
var $newdiv;
for (var i = 0; i < 100; i++) {
$newdiv = $('<div class="ball" />').text(i);
$('body').append($newdiv);
}
});
```
Demo `--->` <http://jsfiddle.net/Uq... | **ID is supposed to be unique on your Page**. So use **class instead.**
Next , if you var `$newdiv = $('<div/>'` to create a div outside the for loop , it would only create a single instance of the div as it already is available on the page and cached.
So need to move the creation to inside the `for loop`
```
$(doc... |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | Selenium is more designed for doing end-to-end testing, where it simulates actions within a browser. Jasmine and QUnit are both unit testing frameworks for testing the code. If you're looking to do end-to-end tests that are more compatible with JS, check out Protractor—it's made for AngularJS apps. Otherwise, if you're... | You can use this approach - "**VISUAL REGRESSION TESTING USING JEST, CHROMELESS AND AWS LAMBDA**" <https://novemberfive.co/blog/visual-regression-testing-jest-chromeless-lambda> |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | Selenium is a UI automation library whereas libraries like Jasmine is a general javascript test framework which can be utilized for the unit as well as UI testing automation for the assertions.
If you are purely unit testing, then probably you don't need selenium. | Selenium is more designed for doing end-to-end testing, where it simulates actions within a browser. Jasmine and QUnit are both unit testing frameworks for testing the code. If you're looking to do end-to-end tests that are more compatible with JS, check out Protractor—it's made for AngularJS apps. Otherwise, if you're... |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | **TL;DR**: Selenium is just to slow, compared to for example [Karma](https://karma-runner.github.io/2.0/index.html).
---
I guess most UI Frameworks manipulate the DOM. So verifying that the manipulation was correct is also done in the DOM. Most UI Frameworks seem to use Karma for cross-browser testing the DOM. By run... | Selenium is more designed for doing end-to-end testing, where it simulates actions within a browser. Jasmine and QUnit are both unit testing frameworks for testing the code. If you're looking to do end-to-end tests that are more compatible with JS, check out Protractor—it's made for AngularJS apps. Otherwise, if you're... |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | The reason is quick feedback. unit tests run much faster and selenium/protractor being e2e solutions runs slower. There is a clear separation between unit test and end to end testing.
Please let us know in specific what you need to understand. | You can use this approach - "**VISUAL REGRESSION TESTING USING JEST, CHROMELESS AND AWS LAMBDA**" <https://novemberfive.co/blog/visual-regression-testing-jest-chromeless-lambda> |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | Selenium is a UI automation library whereas libraries like Jasmine is a general javascript test framework which can be utilized for the unit as well as UI testing automation for the assertions.
If you are purely unit testing, then probably you don't need selenium. | You can use this approach - "**VISUAL REGRESSION TESTING USING JEST, CHROMELESS AND AWS LAMBDA**" <https://novemberfive.co/blog/visual-regression-testing-jest-chromeless-lambda> |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | **TL;DR**: Selenium is just to slow, compared to for example [Karma](https://karma-runner.github.io/2.0/index.html).
---
I guess most UI Frameworks manipulate the DOM. So verifying that the manipulation was correct is also done in the DOM. Most UI Frameworks seem to use Karma for cross-browser testing the DOM. By run... | You can use this approach - "**VISUAL REGRESSION TESTING USING JEST, CHROMELESS AND AWS LAMBDA**" <https://novemberfive.co/blog/visual-regression-testing-jest-chromeless-lambda> |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | Selenium is a UI automation library whereas libraries like Jasmine is a general javascript test framework which can be utilized for the unit as well as UI testing automation for the assertions.
If you are purely unit testing, then probably you don't need selenium. | The reason is quick feedback. unit tests run much faster and selenium/protractor being e2e solutions runs slower. There is a clear separation between unit test and end to end testing.
Please let us know in specific what you need to understand. |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | **TL;DR**: Selenium is just to slow, compared to for example [Karma](https://karma-runner.github.io/2.0/index.html).
---
I guess most UI Frameworks manipulate the DOM. So verifying that the manipulation was correct is also done in the DOM. Most UI Frameworks seem to use Karma for cross-browser testing the DOM. By run... | The reason is quick feedback. unit tests run much faster and selenium/protractor being e2e solutions runs slower. There is a clear separation between unit test and end to end testing.
Please let us know in specific what you need to understand. |
34,119 | I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS*... | 2018/06/07 | [
"https://sqa.stackexchange.com/questions/34119",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/28240/"
] | **TL;DR**: Selenium is just to slow, compared to for example [Karma](https://karma-runner.github.io/2.0/index.html).
---
I guess most UI Frameworks manipulate the DOM. So verifying that the manipulation was correct is also done in the DOM. Most UI Frameworks seem to use Karma for cross-browser testing the DOM. By run... | Selenium is a UI automation library whereas libraries like Jasmine is a general javascript test framework which can be utilized for the unit as well as UI testing automation for the assertions.
If you are purely unit testing, then probably you don't need selenium. |
11,736,349 | I`m trying to create a loading windows with faded ( Blured ) background , that lock all the other windows
any issue for fade the background to lock other windows ?! | 2012/07/31 | [
"https://Stackoverflow.com/questions/11736349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1565157/"
] | Following are the methods from BaseAGIScript class which can be used to play sound files.
* `controlStreamFile` - Plays the sound file, user can interrupt by
pressing any key.
* `getOption` - Plays the given sound file and waits
for user option.
* `getData` - Plays the given sound file and waits for
user enter data. | This should provide the functionality you're looking for: [org.asteriskjava.fastagi.AgiChannel#streamFile](http://www.asterisk-java.org/1.0.0.M3/apidocs/org/asteriskjava/fastagi/AgiChannel.html#streamFile%28java.lang.String%29) |
151,700 | Almost on every tutorial video, I watched about `Thermal Expansion` tesseracts, receiving one can output items to build craft transport pipes (gold or stone). The thing is I use `Thermal Expansion 3.0.0.2` mod which has only one type of tesseracts (Not energy, fluid and item like was earlier. Now it's three in one.). A... | 2014/01/21 | [
"https://gaming.stackexchange.com/questions/151700",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/52979/"
] | I think that they are not compatible with buildcrafts pipes yet, you need to use a fluiduct(you're free to use a pipe after that i think). | Have you tried without using a wooden transport pipe (connecting your gold / stone transport pipes directly to the tesseract)? I ask because certain machines do not require a wooden transport pipe to pull items out, they push to pipes themselves, and a wooden transport pipe would actually hinder their ability to do so. |
71,467,087 | I'm following this tutorial: <https://learn.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-sign-user-overview?tabs=aspnetcore>
According to other docs, I can use the 'state' parameter to pass in custom data and this will be returned back to the app once the user is logged in
However, OIDC also use... | 2022/03/14 | [
"https://Stackoverflow.com/questions/71467087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5003392/"
] | ```
# The following code should work:
df.NACE_code = df.NACE_code.astype(str)
df.NACE_code = df.NACE_code.str.replace('.', '')
``` | Use `astype('str')` to convert columns to string type before calling `str.replace.`
Without regex:
```
df['NACE_code'].astype('str').str.replace(r".", r"", regex=False)
``` |
59,309,998 | I have a script that runs every 15 seconds and it creates a new thread every time. Now and then this thread gets stuck and blockes the synchronisation process of my program. Now i want to kill the process with a specific name if the thread is stuck for 20 loops. Here is my code:
```
public void actionPerformed(ActionE... | 2019/12/12 | [
"https://Stackoverflow.com/questions/59309998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12526527/"
] | Ok, after a bit of work I believe I have a solution.
As part of my CI (Continuous Integration) job I run:
```
cdk synth
```
I then save the contents of the cdk.out folder to a repository (I'm using Octopus Deployment).
As part of my CD (Continuous Deployment) job I have the following (Powershell):
```
$Env:AWS_AC... | One option is to generate a CloudFormation ChangeSet using CDK and then deploy that ChangeSet later. To create the ChangeSet run `cdk deploy <StackName> --execute false`. This will synthesize the stack as well as upload templates and assets to S3. The ChangeSet can then be executed at anytime without CDK. |
59,309,998 | I have a script that runs every 15 seconds and it creates a new thread every time. Now and then this thread gets stuck and blockes the synchronisation process of my program. Now i want to kill the process with a specific name if the thread is stuck for 20 loops. Here is my code:
```
public void actionPerformed(ActionE... | 2019/12/12 | [
"https://Stackoverflow.com/questions/59309998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12526527/"
] | Ok, after a bit of work I believe I have a solution.
As part of my CI (Continuous Integration) job I run:
```
cdk synth
```
I then save the contents of the cdk.out folder to a repository (I'm using Octopus Deployment).
As part of my CD (Continuous Deployment) job I have the following (Powershell):
```
$Env:AWS_AC... | >
> For this you execute cdk like cdk --app cdk.out deploy and it uses the already created cloud assembly in the specified folder instead of running synth.
>
>
>
<https://github.com/aws/aws-cdk/issues/18790> |
59,309,998 | I have a script that runs every 15 seconds and it creates a new thread every time. Now and then this thread gets stuck and blockes the synchronisation process of my program. Now i want to kill the process with a specific name if the thread is stuck for 20 loops. Here is my code:
```
public void actionPerformed(ActionE... | 2019/12/12 | [
"https://Stackoverflow.com/questions/59309998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12526527/"
] | One option is to generate a CloudFormation ChangeSet using CDK and then deploy that ChangeSet later. To create the ChangeSet run `cdk deploy <StackName> --execute false`. This will synthesize the stack as well as upload templates and assets to S3. The ChangeSet can then be executed at anytime without CDK. | >
> For this you execute cdk like cdk --app cdk.out deploy and it uses the already created cloud assembly in the specified folder instead of running synth.
>
>
>
<https://github.com/aws/aws-cdk/issues/18790> |
29,079 | What is correct format for using XPath?
Does XPath vary with the browser?
```
drchrome.findElement(By.xpath("//a[contains(.,'Google')]")).click();
``` | 2017/08/16 | [
"https://sqa.stackexchange.com/questions/29079",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/27487/"
] | As far as i know xpath doesn't depends on any browser. Make sure you have created correct xpath it will work.
Second : It's depend on your tag which attribute it has and how efficient you are in xpath.
For example this is the simple hyperlink:
```
<a href="https://stackexchange.com/questions?tab=hot" name="hotnetwor... | When you want to locate Hyperlink Element try **linkText** element Locator or **Partial LinkText**.
Example using linktext:
```
driver.findElement(By.linkText("click here")).click();
```
Example using partial linktext:
```
driver.findElement(By.partialLinkText("here")).click();
``` |
29,079 | What is correct format for using XPath?
Does XPath vary with the browser?
```
drchrome.findElement(By.xpath("//a[contains(.,'Google')]")).click();
``` | 2017/08/16 | [
"https://sqa.stackexchange.com/questions/29079",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/27487/"
] | Whenever you are trying to locate Hyperlink Element & you have `'/a'` attribute, just forget about the XPath method and try using **linkText** element Locator.
```
<html>
<head>
<title>My Page</title>
<body>
<a href="http://www.google.com">Google</a>
<body>
</html>
```
In this situation use... | When you want to locate Hyperlink Element try **linkText** element Locator or **Partial LinkText**.
Example using linktext:
```
driver.findElement(By.linkText("click here")).click();
```
Example using partial linktext:
```
driver.findElement(By.partialLinkText("here")).click();
``` |
6,089,673 | i'm new in the iphone and json world . i have this json structure . You can see it clearly by putting it here <http://jsonviewer.stack.hu/> .
```
{"@uri":"http://localhost:8080/RESTful/resources/prom/","promotion":[{"@uri":"http://localhost:8080/RESTful/resources/prom/1/","descrip":"description
here","keyid":"1","na... | 2011/05/22 | [
"https://Stackoverflow.com/questions/6089673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/761812/"
] | First off, You need this line after you load the JSON
```
NSLog(@" json %@ : ",[json description]);
```
That will tell you what you have.
Secondly, you can't call objectAtIndex: on a dictionary. If it works, its because promotionDict is really an NSArray. (The NSLog will tell you). In Objective - C you can... | The JSON says:
```
..."promotion":[{"@u...
```
That "`[`" there means that "promotion" is keyed to an array, not a dictionary.
So really your code should be:
```
NSDictionary *json = [myJSON JSONValue];
NSArray *promotions = [json objectForKey:@"promotion"];
NSLog(@"res: %@",[promotions objectAtIndex:0]);
`... |
63,063,279 | I have this code, which is slightly different than the some of the other code with the same question on this site:
```
public void printAllRootToLeafPaths(Node node,ArrayList path) {
if(node==null){
return;
}
path.add(node.data);
if(node.left==null && node.right==null)
{
System.out... | 2020/07/23 | [
"https://Stackoverflow.com/questions/63063279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13985180/"
] | Yes, all that copying needs to be accounted for.
Those copies are not necessary; it's easy to write functions which either:
* use a (singly) linked list instead of ArrayList, or
* use a single ArrayList, overwriting previous paths when they're not needed any more.
With non-copying algorithms, the cost of the algorit... | I think you're missing the time complexity of copying the entire array to a new one.
---
At root node: `one element is added, but 2 new arrays are created`.
At left child node of root node: `one element is added, but 2 new arrays are created with 2 elements`.
.
.
.
At last but one level: `one element is added, but... |
43,721,320 | The following code loops when the page loads and I can't figure out why it is doing so. Is the issue with the onfocus?
```
alert("JS is working");
function validateFirstName() {
alert("validateFirstName was called");
var x = document.forms["info"]["fname"].value;
if (x == "") {
alert("First name ... | 2017/05/01 | [
"https://Stackoverflow.com/questions/43721320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7569925/"
] | There were several issues with the approach you were taking to accomplish this, but the "looping" behavior you were experiencing is because you are using a combination of `alert` and `onFocus`. When you are focused on an input field and an alert is triggered, when you dismiss the alert, the browser will (by default) re... | Not tested but you can try this
```
fn.addEventListener('focus', validateFirstName);
ln.addEventListener('focus', validateLastName);
``` |
52,267,256 | I have a Pandas dataframe, `old`, like this:
```
col1 col2 col3
0 1 2 3
1 2 3 4
2 3 4 5
```
I want to make a new dataframe, `new`, that copies `col2` from `old` and fills in `-1` as dummy values for its other columns:
```
col2 new_col1 new_col3
0 2 -1 -1
1 3 -1 -1
2 4 -... | 2018/09/11 | [
"https://Stackoverflow.com/questions/52267256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1316501/"
] | You can do `reindex` .
```
df.reindex(columns=['col2','newcol1','newcol3'],fill_value=-1)
Out[183]:
col2 newcol1 newcol3
0 2 -1 -1
1 3 -1 -1
2 4 -1 -1
``` | IIUC:
```
new = old.copy()
new[['col1','col3']] = -1
>>> new
col1 col2 col3
0 -1 2 -1
1 -1 3 -1
2 -1 4 -1
```
Or more generally, to change all columns besides `col2` to `-1`:
```
new = old.copy()
new[list(set(new.columns) - {'col2'})] = -1
``` |
52,267,256 | I have a Pandas dataframe, `old`, like this:
```
col1 col2 col3
0 1 2 3
1 2 3 4
2 3 4 5
```
I want to make a new dataframe, `new`, that copies `col2` from `old` and fills in `-1` as dummy values for its other columns:
```
col2 new_col1 new_col3
0 2 -1 -1
1 3 -1 -1
2 4 -... | 2018/09/11 | [
"https://Stackoverflow.com/questions/52267256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1316501/"
] | You can do `reindex` .
```
df.reindex(columns=['col2','newcol1','newcol3'],fill_value=-1)
Out[183]:
col2 newcol1 newcol3
0 2 -1 -1
1 3 -1 -1
2 4 -1 -1
``` | Maybe:
```
new=pd.DataFrame({'col2':old['col2'],'new_col2':-1,'new_col3':-1})
print(new)
```
Output:
```
col2 new_col2 new_col3
0 2 -1 -1
1 3 -1 -1
2 4 -1 -1
```
@sacul Thanks for telling me |
52,267,256 | I have a Pandas dataframe, `old`, like this:
```
col1 col2 col3
0 1 2 3
1 2 3 4
2 3 4 5
```
I want to make a new dataframe, `new`, that copies `col2` from `old` and fills in `-1` as dummy values for its other columns:
```
col2 new_col1 new_col3
0 2 -1 -1
1 3 -1 -1
2 4 -... | 2018/09/11 | [
"https://Stackoverflow.com/questions/52267256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1316501/"
] | ### `assign`
```
df[['col2']].assign(new_col1=-1, new_col3=-1)
``` | IIUC:
```
new = old.copy()
new[['col1','col3']] = -1
>>> new
col1 col2 col3
0 -1 2 -1
1 -1 3 -1
2 -1 4 -1
```
Or more generally, to change all columns besides `col2` to `-1`:
```
new = old.copy()
new[list(set(new.columns) - {'col2'})] = -1
``` |
52,267,256 | I have a Pandas dataframe, `old`, like this:
```
col1 col2 col3
0 1 2 3
1 2 3 4
2 3 4 5
```
I want to make a new dataframe, `new`, that copies `col2` from `old` and fills in `-1` as dummy values for its other columns:
```
col2 new_col1 new_col3
0 2 -1 -1
1 3 -1 -1
2 4 -... | 2018/09/11 | [
"https://Stackoverflow.com/questions/52267256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1316501/"
] | ### `assign`
```
df[['col2']].assign(new_col1=-1, new_col3=-1)
``` | Maybe:
```
new=pd.DataFrame({'col2':old['col2'],'new_col2':-1,'new_col3':-1})
print(new)
```
Output:
```
col2 new_col2 new_col3
0 2 -1 -1
1 3 -1 -1
2 4 -1 -1
```
@sacul Thanks for telling me |
13,142,384 | probably had these questions a thousand times already.
For a school project I want to make a HTML5 game where you can challenge someone and play against. Now I'm pretty new to game development. I don't now exactly where to start off. There is so much information/technologies on the net that I don't know which to use. ... | 2012/10/30 | [
"https://Stackoverflow.com/questions/13142384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1785932/"
] | Since you're working in a .NET environment, take a look at SignalR, <http://signalr.net>. It's a very nice API around websockets (with fallbacks to other methods for older servers and browsers) that lets you do client-to-server and server-to-client communication.
Code on the client can invoke a Javascript function tha... | You will need a central server to relay messages between the two players.
WebSockets (and anything else you might find that plugs into a browser) are unsuitable for direct peer-to-peer communications. |
22,127,174 | Hello my software should print the abc but unfortunately it does not work I think the problem is related to the line 19 so if someone could tell me why this is happening I appreciate it
My code-
```
#include <stdio.h>
#include <string.h>
#define NUM_ABC_LET 27
void ABC(char abc[NUM_ABC_LET]);
int main()
{
char... | 2014/03/02 | [
"https://Stackoverflow.com/questions/22127174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3318856/"
] | That's because you're just writing to a copy of the string you're passing to the function. Try this:
```
void ABC(char *abc)
{
int n=0;
char letter;
for (letter = 'a'; letter <= 'z'; ++letter, ++n)
{
abc[n] = letter;
}
abc[n] = '\0';
}
```
This way, you don't write to a copy of your s... | The second parameter of [srtcat](http://www.cplusplus.com/reference/cstring/strcat/) should be a `char *`.
```
void ABC(char abc[NUM_ABC_LET])
{
char letter[2]="a";
for (; *letter <= 'z'; (*letter)++)
{
strcat(abc, letter);
}
}
``` |
22,127,174 | Hello my software should print the abc but unfortunately it does not work I think the problem is related to the line 19 so if someone could tell me why this is happening I appreciate it
My code-
```
#include <stdio.h>
#include <string.h>
#define NUM_ABC_LET 27
void ABC(char abc[NUM_ABC_LET]);
int main()
{
char... | 2014/03/02 | [
"https://Stackoverflow.com/questions/22127174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3318856/"
] | If you enable warnings in your compiler (e.g. `gcc -Wall -Wextra -Werror`) it will tell you the problem straight away: you are using strcat in a nonsensical way. | The second parameter of [srtcat](http://www.cplusplus.com/reference/cstring/strcat/) should be a `char *`.
```
void ABC(char abc[NUM_ABC_LET])
{
char letter[2]="a";
for (; *letter <= 'z'; (*letter)++)
{
strcat(abc, letter);
}
}
``` |
22,127,174 | Hello my software should print the abc but unfortunately it does not work I think the problem is related to the line 19 so if someone could tell me why this is happening I appreciate it
My code-
```
#include <stdio.h>
#include <string.h>
#define NUM_ABC_LET 27
void ABC(char abc[NUM_ABC_LET]);
int main()
{
char... | 2014/03/02 | [
"https://Stackoverflow.com/questions/22127174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3318856/"
] | The problem is that the function `stdcat()` expects a null terminated string as second argument.
```
#include <stdio.h>
#include <string.h>
#define NUM_ABC_LET 27
void ABC(char abc[NUM_ABC_LET]);
int main()
{
char abcString[NUM_ABC_LET] = "";
ABC(abcString);
puts(abcString);
}
void ABC(char abc[NUM_ABC... | The second parameter of [srtcat](http://www.cplusplus.com/reference/cstring/strcat/) should be a `char *`.
```
void ABC(char abc[NUM_ABC_LET])
{
char letter[2]="a";
for (; *letter <= 'z'; (*letter)++)
{
strcat(abc, letter);
}
}
``` |
6,226,081 | >
> **Possible Duplicate:**
>
> [Pyramid of asterisks program in Python](https://stackoverflow.com/questions/4911341/pyramid-of-asterisks-program-in-python)
>
>
>
I've written a program in C++ that displays a pyramid of asterisk (see below) and now I'd like to see how it's done in Python but it's not as easy a... | 2011/06/03 | [
"https://Stackoverflow.com/questions/6226081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/782550/"
] | Disclaimer: This may not work in Python 3.x:
```
Python 2.7.1 (r271:86832, May 27 2011, 21:41:45)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print ''' * 1
... *** 3
... ***** 5'''
* 1
*** 3
***** 5
``` | It's not that difficult..
```
>>> lower = 1
>>> higher = 19
>>> for i in xrange(lower,higher,2):
... print ' ' * [Calculation Here] + '*' * i
...
*
***
*****
*******
*********
***********
*************
***************
*****************
``` |
6,226,081 | >
> **Possible Duplicate:**
>
> [Pyramid of asterisks program in Python](https://stackoverflow.com/questions/4911341/pyramid-of-asterisks-program-in-python)
>
>
>
I've written a program in C++ that displays a pyramid of asterisk (see below) and now I'd like to see how it's done in Python but it's not as easy a... | 2011/06/03 | [
"https://Stackoverflow.com/questions/6226081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/782550/"
] | Disclaimer: This may not work in Python 3.x:
```
Python 2.7.1 (r271:86832, May 27 2011, 21:41:45)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print ''' * 1
... *** 3
... ***** 5'''
* 1
*** 3
***** 5
``` | ```
import pprint
def get_vals(mVal):
return map(lambda x: ' ' * (mVal - x - 1) + ('*' * x) + ' %i' % x, xrange(1, mVal, 2))
pprint.pprint(get_vals(12))
``` |
6,226,081 | >
> **Possible Duplicate:**
>
> [Pyramid of asterisks program in Python](https://stackoverflow.com/questions/4911341/pyramid-of-asterisks-program-in-python)
>
>
>
I've written a program in C++ that displays a pyramid of asterisk (see below) and now I'd like to see how it's done in Python but it's not as easy a... | 2011/06/03 | [
"https://Stackoverflow.com/questions/6226081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/782550/"
] | It's not that difficult..
```
>>> lower = 1
>>> higher = 19
>>> for i in xrange(lower,higher,2):
... print ' ' * [Calculation Here] + '*' * i
...
*
***
*****
*******
*********
***********
*************
***************
*****************
``` | ```
import pprint
def get_vals(mVal):
return map(lambda x: ' ' * (mVal - x - 1) + ('*' * x) + ' %i' % x, xrange(1, mVal, 2))
pprint.pprint(get_vals(12))
``` |
43,843,463 | Within the scope of a new project in Qt/QML, We are currently looking for an application architecture. We are thinking about an implementation of the Flux architecture from Facebook.
I found this good library which makes it in some ways : <https://github.com/benlau/quickflux>
In our case, we would like to manage Stor... | 2017/05/08 | [
"https://Stackoverflow.com/questions/43843463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7979527/"
] | My answer may be outdated, but perhaps will help someone having the same question...
You can try to use C++/Qt implementation of Flux-like application pattern <https://github.com/eandritskiy/flux_qt>
Please check QML example.
There are only 2 classes that are exported to QML engine: ActionProvider and Store. Action... | It makes sense to consider a Flux-like app architecture as Ben Lau suggests.
However, for simple QML-driven apps an easier implementation of the same pattern is also possible. Especially since the introduction of Qt Quick Compiler, there's really no need to dive into complex C++ code.
You can find a simple guide for ... |
15,214 | Today, I reached 200 rep, but 20 of them came from a now-deleted post (a duplicate answer posted really close in time to the first answer). I stopped getting rep from my answers after this was deleted and I hit 180 reputation on posted answers today (180 + the 20 from the deleted = the cap of 200).
After a rep recalcu... | 2009/08/18 | [
"https://meta.stackexchange.com/questions/15214",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/572/"
] | If you keep getting rep for today then it will count toward the limit for the day after the recalc. So if you got a total of 220 today but 20 went away in a recalc then you would still get 200 for the day. The system still tracks your rep for the day even after you hit the limit. It just doesn't apply more than 200 per... | I think so, a rep recalc computes all your reputation from scratch, so the rep cap would be taken into account without counting the now deleted post and you'd get the reputation from the subsequent posts |
15,214 | Today, I reached 200 rep, but 20 of them came from a now-deleted post (a duplicate answer posted really close in time to the first answer). I stopped getting rep from my answers after this was deleted and I hit 180 reputation on posted answers today (180 + the 20 from the deleted = the cap of 200).
After a rep recalcu... | 2009/08/18 | [
"https://meta.stackexchange.com/questions/15214",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/572/"
] | I believe that *in theory* it should work like that, yes.
A few times I've had a rep recalc and still had what appeared to be some oddities. Here's a sample timeline:
* 2am: 5 genuine votes
* 3am: 20 upvotes from one user, hit cap after the first 15 of them
* 6am: Get online, post answers, get more upvotes, report vo... | If you keep getting rep for today then it will count toward the limit for the day after the recalc. So if you got a total of 220 today but 20 went away in a recalc then you would still get 200 for the day. The system still tracks your rep for the day even after you hit the limit. It just doesn't apply more than 200 per... |
15,214 | Today, I reached 200 rep, but 20 of them came from a now-deleted post (a duplicate answer posted really close in time to the first answer). I stopped getting rep from my answers after this was deleted and I hit 180 reputation on posted answers today (180 + the 20 from the deleted = the cap of 200).
After a rep recalcu... | 2009/08/18 | [
"https://meta.stackexchange.com/questions/15214",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/572/"
] | I think you should get that rep back. I want to believe that if you got 25 upvotes in a day, you should cap at 200. If you had an answer deleted that subtracted 2 upvotes that left you with 180, you should still in theory have 230 rep worth of upvotes, so during a recalc you should still make the 200 points. | I think so, a rep recalc computes all your reputation from scratch, so the rep cap would be taken into account without counting the now deleted post and you'd get the reputation from the subsequent posts |
15,214 | Today, I reached 200 rep, but 20 of them came from a now-deleted post (a duplicate answer posted really close in time to the first answer). I stopped getting rep from my answers after this was deleted and I hit 180 reputation on posted answers today (180 + the 20 from the deleted = the cap of 200).
After a rep recalcu... | 2009/08/18 | [
"https://meta.stackexchange.com/questions/15214",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/572/"
] | I believe that *in theory* it should work like that, yes.
A few times I've had a rep recalc and still had what appeared to be some oddities. Here's a sample timeline:
* 2am: 5 genuine votes
* 3am: 20 upvotes from one user, hit cap after the first 15 of them
* 6am: Get online, post answers, get more upvotes, report vo... | I think you should get that rep back. I want to believe that if you got 25 upvotes in a day, you should cap at 200. If you had an answer deleted that subtracted 2 upvotes that left you with 180, you should still in theory have 230 rep worth of upvotes, so during a recalc you should still make the 200 points. |
15,214 | Today, I reached 200 rep, but 20 of them came from a now-deleted post (a duplicate answer posted really close in time to the first answer). I stopped getting rep from my answers after this was deleted and I hit 180 reputation on posted answers today (180 + the 20 from the deleted = the cap of 200).
After a rep recalcu... | 2009/08/18 | [
"https://meta.stackexchange.com/questions/15214",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/572/"
] | I believe that *in theory* it should work like that, yes.
A few times I've had a rep recalc and still had what appeared to be some oddities. Here's a sample timeline:
* 2am: 5 genuine votes
* 3am: 20 upvotes from one user, hit cap after the first 15 of them
* 6am: Get online, post answers, get more upvotes, report vo... | I think so, a rep recalc computes all your reputation from scratch, so the rep cap would be taken into account without counting the now deleted post and you'd get the reputation from the subsequent posts |
15,214 | Today, I reached 200 rep, but 20 of them came from a now-deleted post (a duplicate answer posted really close in time to the first answer). I stopped getting rep from my answers after this was deleted and I hit 180 reputation on posted answers today (180 + the 20 from the deleted = the cap of 200).
After a rep recalcu... | 2009/08/18 | [
"https://meta.stackexchange.com/questions/15214",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/572/"
] | Well, if you **really want**, add a comment here and I'll try it. **However** You'd need to accept that you might actually *lose more rep* from other deleted posts etc.
The other day somebody requesting a rep recalc lost ~450 points.
On your head be it; there is no preview nor undo. Let me know. | I think so, a rep recalc computes all your reputation from scratch, so the rep cap would be taken into account without counting the now deleted post and you'd get the reputation from the subsequent posts |
15,214 | Today, I reached 200 rep, but 20 of them came from a now-deleted post (a duplicate answer posted really close in time to the first answer). I stopped getting rep from my answers after this was deleted and I hit 180 reputation on posted answers today (180 + the 20 from the deleted = the cap of 200).
After a rep recalcu... | 2009/08/18 | [
"https://meta.stackexchange.com/questions/15214",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/572/"
] | I believe that *in theory* it should work like that, yes.
A few times I've had a rep recalc and still had what appeared to be some oddities. Here's a sample timeline:
* 2am: 5 genuine votes
* 3am: 20 upvotes from one user, hit cap after the first 15 of them
* 6am: Get online, post answers, get more upvotes, report vo... | Well, if you **really want**, add a comment here and I'll try it. **However** You'd need to accept that you might actually *lose more rep* from other deleted posts etc.
The other day somebody requesting a rep recalc lost ~450 points.
On your head be it; there is no preview nor undo. Let me know. |
58,254,657 | Consider an array: `10 2 4 14 1 7`
Traversing the input array for each valid i, I have to find all the elements which are divisible by the i-th element. So, first I have to find all the elements which are greater than the i-th element.
Example output:
```
10 -> null
2 -> 10
4 -> 10
14 -> null
1 -> 14,4,2,10
7 -> 14,1... | 2019/10/06 | [
"https://Stackoverflow.com/questions/58254657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11459802/"
] | you can try this:
```
#include<stdio.h>
#include<string.h>
int main(){
int i,len,j=0;
char mainword[100], reverseword[100];
scanf("%s",mainword);
len = strlen(mainword);
for(i=len; i>=0; i--){
reverseword[j] = mainword[i-1];
j++;
}
reverseword[j] = '\0';
if(strcmp... | instead of this:
```
for(i=len; i>=0; i--){
printf("%c",reverseword[i]);
// I just need here to save the output without printing it. So, that later I can compare it.
}
```
you'd better use just this:
```
for( i=0; i<len; i++) {
reverseword[i] = mainword[len-i-1];
}
```
And it will magically wo... |
29,403,878 | My Friends,
using python 2.7.3
i want to write some ipaddrss in file1.txt manual, each line one ip.
how to using python read file1.txt all ipaddress, put it into file2.txt save as file3.txt?
file1.txt
```
1.1.1.1
2.2.2.2
3.3.3.3
...
5.5.5.5
...
10.10.10.10
```
file2.txt
```
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0... | 2015/04/02 | [
"https://Stackoverflow.com/questions/29403878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4740563/"
] | I don't understand your question. Why do you need to initialize it? You don't even need the variable.
This code works as you want
```
public int getBackground(){
Random generate = new Random();
int randomNumber = generate.nextInt(mBackground.length);
return mBackground[randomNumber];
}
```
However, if y... | There is no such thing as an empty int in the context you have given, an empty string is a String containing a sequence of 0 length. int is a primitive data type and can't take any value outside the parameters of either a signed or unsigned 32-bit integer unless you want to declare as an Integer boxed Object in which c... |
29,403,878 | My Friends,
using python 2.7.3
i want to write some ipaddrss in file1.txt manual, each line one ip.
how to using python read file1.txt all ipaddress, put it into file2.txt save as file3.txt?
file1.txt
```
1.1.1.1
2.2.2.2
3.3.3.3
...
5.5.5.5
...
10.10.10.10
```
file2.txt
```
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0... | 2015/04/02 | [
"https://Stackoverflow.com/questions/29403878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4740563/"
] | If you must assign your `int background` variable a default value for some reason, `-1` is often workable. You cannot assign an `int` variable to anything other than an integer value (`""` is a `String` so won't work).
```
int background = -1;
// ...
if (background < 0) {
// handle invalid value, p... | There is no such thing as an empty int in the context you have given, an empty string is a String containing a sequence of 0 length. int is a primitive data type and can't take any value outside the parameters of either a signed or unsigned 32-bit integer unless you want to declare as an Integer boxed Object in which c... |
3,138,095 | I'm taking an introductory course in finance but I don't understand how to do this question:
A used car may be purchased for 7600 cash or 600 down and 20 monthly payments of 400 each,the first payment to be made in 6 months. What annual effective rate of interest does the installment plan use?
What I tried to do was ... | 2019/03/06 | [
"https://math.stackexchange.com/questions/3138095",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/651443/"
] | You have not taken account of the delay in receiving payments. There should be another factor $(1+i)^{-5}$ to take account of the five months with no payments. Then solving for $i$ requires a numeric approach. A spreadsheet will do it for you or you can use bisection. $i=0$ is too low and you can easily find an $i$ tha... | Start by letting $i$ be the monthly interest rate, not the annual rate. The answer to the question will be $(1+i)^{12} - 1$ |
20,006,951 | In my `routes.rb` I have:
```
resources :workouts
```
In my workouts controller I have:
```
def show
respond_to do |format|
format.html
format.json { render :json => "Success" }
end
end
```
But when I go to /workouts/1.json, I receive the following:
>
> Template is missing
> -------------------
>
>... | 2013/11/15 | [
"https://Stackoverflow.com/questions/20006951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2410513/"
] | Looks at the source code of `render`
```
elsif options.include?(:json)
json = options[:json]
json = ActiveSupport::JSON.encode(json) unless json.is_a?(String)
json = "#{options[:callback]}(#{json})" unless options[:callback].blank?
response.content_type ||= Mime::JSON
rend... | You would try with /workouts.json |
56,565,575 | I am adding new entity by creating the instance using inline syntax.
```
public async Sys.Task<IEnumerable<Car>> CreateCars()
{
for (int i = 0; i < 2; i++)
{
await _dbContext.Cars.AddAsync(new Car()
{
// set properties here
})... | 2019/06/12 | [
"https://Stackoverflow.com/questions/56565575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3862378/"
] | Use the [`Local`](https://learn.microsoft.com/en-us/dotnet/api/system.data.entity.dbset.local?view=entity-framework-6.2.0) property of your `Cars` DbSet. I contains a local view of the tracked entities. | There doesn't seem to be a built-in function for that. You could make a generic extension method though.
```
public static class DbSetExtensions
{
public static async Task<T[]> AddRangeAsyncExt<T>(this DbSet<T> dbSet, params T[] entities) where T : class
{
await dbSet.AddRangeAsync(entities);
r... |
13,078,302 | I have to pass the following object to a method, have that method modify it so that after the method call I can move on with my modified object.
```
AVMutableCompositionTrack *compositionVideoTrack[2];
```
passing it like this currently:
```
[self buildShow:&compositionVideoTrack];
```
the buildshow method looks ... | 2012/10/25 | [
"https://Stackoverflow.com/questions/13078302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/825711/"
] | Just pass it like this:
```
[self buildShow:compositionVideoTrack];
```
When you declare it like this:
```
AVMutableCompositionTrack * __autoreleasing compositionVideoTrack[2];
```
It's already an array of pointers, so it's compatible with the type of the parameter (`AVMutableCompositionTrack**`). | Unless you're working with a property, you ought to do it like this (note that the method now returns the object of the same type):
method constructor:
```
-(AVMutableCompositionTrack *)buildShow:(AVMutableCompositionTrack *)videoTracks {
// do something
return newVideoTracks;
}
```
And, method call:
```
n... |
297,333 | this is my first post here. I am new to FPGAs. I would like to implement a NOT gate on the BASYS (Spartan3E-100) FPGA. I've been looking at the tutorial [HERE](https://docs.numato.com/kb/learning-fpga-verilog-beginners-guide-part-4-synthesis/) to work my way towards a synthesis. I wish to keep everything on-board, i.e.... | 2017/04/08 | [
"https://electronics.stackexchange.com/questions/297333",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/144681/"
] | Find a different tutorial!
The tutorial you're reading is written for a completely different board -- it's written for the Mimas v2, from Numato Labs. This board has almost nothing in common with the Basys, beyond that they both have Xilinx FPGAs on them.
Some of the general concepts will line up, but the details of ... | If you come with programming background, then probably FPGA-s will have some surprises for you. However I assume you know how to use ISE WebPack or whatever environment you use right now.
What you need is schematics for your board (probably delivered by Digilent). Second this is knowledge of constraint files. This fil... |
165,636 | The question is:
>
>
> >
> > Seats for Math,Physics and biology in a school are in ratio 5:7:8. There is a proposal to increase these seats by 40%,50% and 75% respectively.What will be ratio of increased seats?
> >
> >
> >
>
>
>
Apparently I am currently increasing 5 by 40% and 7 by 50% and 8 by 75% . But th... | 2012/07/02 | [
"https://math.stackexchange.com/questions/165636",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/29209/"
] | 3rd edit: I have now typed things up in a slightly more streamlined way:
<http://relaunch.hcm.uni-bonn.de/fileadmin/geschke/papers/ConvexOpen.pdf>
-------------------------------------------------------------------------
Old answer:
How about this: Call a set $U\subseteq\mathbb R^n$ star-shaped
if there is a point $... | There is a pitfall which seems easy to forget, so I think it is worth adding some clarity. This text is not an answer, but a problem with an intuitive proof.
Below is an image of a bounded set in $\mathbb{R}^2$ (of course, the set is simply the inside of my curve), which I must admit is not convex, where scaling from ... |
165,636 | The question is:
>
>
> >
> > Seats for Math,Physics and biology in a school are in ratio 5:7:8. There is a proposal to increase these seats by 40%,50% and 75% respectively.What will be ratio of increased seats?
> >
> >
> >
>
>
>
Apparently I am currently increasing 5 by 40% and 7 by 50% and 8 by 75% . But th... | 2012/07/02 | [
"https://math.stackexchange.com/questions/165636",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/29209/"
] | 3rd edit: I have now typed things up in a slightly more streamlined way:
<http://relaunch.hcm.uni-bonn.de/fileadmin/geschke/papers/ConvexOpen.pdf>
-------------------------------------------------------------------------
Old answer:
How about this: Call a set $U\subseteq\mathbb R^n$ star-shaped
if there is a point $... | Here is a fairly complete proof for the existence of a
diffeomorphism in the star-shaped case. This was gleaned
from old, incomplete answers (not on math stackexchange)
to this question. Getting a diffeomorphism is only
slightly harder than getting a homeomorphism.
The idea is to push points outwards radially relative... |
20,591,758 | ```
<input maxlength="12" name="name" value="" Size="12" Maxlength="12" AutoComplete="off" >
</td>
</tr>
<tr>
<td colspan="2" nowrap valign="top">
<input type="checkbox" name="CHK_NOCACHE" value="on">
<b><span class="tg">Thanks for visitng.</a>.</span></b>
</td>
</tr>
<tr>
<td colspan="2">
<div>
<input type="submit" na... | 2013/12/15 | [
"https://Stackoverflow.com/questions/20591758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3103772/"
] | try this
```
from io import BytesIO
``` | Check if there's no your own version of `io.py` using following command.
```
C:\> python -c "import io; print io.__file__"
c:\python27\lib\io.pyc
```
You should see similar output.
If there's your own version, it shadows builtin version of `io` package. Rename your own module with a name that does not collide with ... |
20,591,758 | ```
<input maxlength="12" name="name" value="" Size="12" Maxlength="12" AutoComplete="off" >
</td>
</tr>
<tr>
<td colspan="2" nowrap valign="top">
<input type="checkbox" name="CHK_NOCACHE" value="on">
<b><span class="tg">Thanks for visitng.</a>.</span></b>
</td>
</tr>
<tr>
<td colspan="2">
<div>
<input type="submit" na... | 2013/12/15 | [
"https://Stackoverflow.com/questions/20591758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3103772/"
] | Check if there's no your own version of `io.py` using following command.
```
C:\> python -c "import io; print io.__file__"
c:\python27\lib\io.pyc
```
You should see similar output.
If there's your own version, it shadows builtin version of `io` package. Rename your own module with a name that does not collide with ... | in my case.
import io
from googleapiclient.http import MediaIoBaseDownload |
20,591,758 | ```
<input maxlength="12" name="name" value="" Size="12" Maxlength="12" AutoComplete="off" >
</td>
</tr>
<tr>
<td colspan="2" nowrap valign="top">
<input type="checkbox" name="CHK_NOCACHE" value="on">
<b><span class="tg">Thanks for visitng.</a>.</span></b>
</td>
</tr>
<tr>
<td colspan="2">
<div>
<input type="submit" na... | 2013/12/15 | [
"https://Stackoverflow.com/questions/20591758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3103772/"
] | try this
```
from io import BytesIO
``` | in my case.
import io
from googleapiclient.http import MediaIoBaseDownload |
37,724,794 | I've created a branch named `<title>-changes` by:
`git checkout -b <title>-changes` and did a commit on that branch. Later I checkout to `another-branch` started working on `another-branch`. Now I want to checkout to the previous branch (`<title>-changes`) but I can't do that now through:
```
git checkout <title>-cha... | 2016/06/09 | [
"https://Stackoverflow.com/questions/37724794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4015856/"
] | You have to escape both `<` and `>` because bash treats them as special symbols.
In order to do that, prepend the backward slash `\` to each of them:
```
git checkout \<title\>-changes
```
This is what I did to test this, and it worked.
```
mkdir test
cd test/
git init
git branch \<title\>-changes
touch empty
git ... | Apart from **@Ferran Rigual**'s answer there is another solution. Like **@Matthieu Moy** said I had an extra space in the branch name. Removing it solved it too.ie,
I changed `git checkout '<title>-changes '` to `git checkout '<title>-changes'`
And for the record: `git checkout '<title>-changes' --` worked too. But I... |
67,712,861 | I have two visuals in the report stacked on top of each other
by default, both of the visuals occupy 50% of the space.
I want functionality like 2 buttons to focus on each visual.
Now, when I click on the 1st button it should make the 1st visual 3 times the size of the 2nd visual. Similarly, when I click on the 2nd bu... | 2021/05/26 | [
"https://Stackoverflow.com/questions/67712861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14200074/"
] | I was having the same issue, and it was caused by calling `toBe()` or `toEqual()` on an HTMLElement. So your most likely culprit is here, since `getByTestId` returns an HTMLElement:
`expect(getByTestId('dateRange')).toBe(dateRange);`
I fixed my issue by testing against the element's text content instead.
`expect(get... | Hi I had the same issue after spending some time googling around i found this: [github issues forum](https://github.com/facebook/jest/issues/10577)
it turned out that this issue is caused by node12 version i downgraded my one to version 10 and everything worked i have also upgraded to version 14 and that also works.
... |
67,712,861 | I have two visuals in the report stacked on top of each other
by default, both of the visuals occupy 50% of the space.
I want functionality like 2 buttons to focus on each visual.
Now, when I click on the 1st button it should make the 1st visual 3 times the size of the 2nd visual. Similarly, when I click on the 2nd bu... | 2021/05/26 | [
"https://Stackoverflow.com/questions/67712861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14200074/"
] | I was having the same issue, and it was caused by calling `toBe()` or `toEqual()` on an HTMLElement. So your most likely culprit is here, since `getByTestId` returns an HTMLElement:
`expect(getByTestId('dateRange')).toBe(dateRange);`
I fixed my issue by testing against the element's text content instead.
`expect(get... | I had the same bug but I was able to fix it by importing `'@testing-library/jest-dom'` as follows in my test file:
```
import '@testing-library/jest-dom'
```
It turned out that the package above is a peerDependency for '@testing-library/react'. Thus the error. |
67,712,861 | I have two visuals in the report stacked on top of each other
by default, both of the visuals occupy 50% of the space.
I want functionality like 2 buttons to focus on each visual.
Now, when I click on the 1st button it should make the 1st visual 3 times the size of the 2nd visual. Similarly, when I click on the 2nd bu... | 2021/05/26 | [
"https://Stackoverflow.com/questions/67712861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14200074/"
] | I was having the same issue, and it was caused by calling `toBe()` or `toEqual()` on an HTMLElement. So your most likely culprit is here, since `getByTestId` returns an HTMLElement:
`expect(getByTestId('dateRange')).toBe(dateRange);`
I fixed my issue by testing against the element's text content instead.
`expect(get... | I ran into this error while testing to see if a `<select>` had the right number of options, when using this:
```js
expect(container.querySelectorAll('option')).toBe(2);
```
@testing-library/react must be trying to do something strange to get the length of the HTML collection, I have. So I added `.length` to the quer... |
3,432,172 | The [following tutorial](http://tech-fyi.net/2010/07/21/wp7-hello-world/) shows how to take the text from a text box and display it in a text block when the user hits a button. Simple enough... but what I want to do is instead of hitting a button that adds the text I want the enter button to do it.
Searching here, I f... | 2010/08/07 | [
"https://Stackoverflow.com/questions/3432172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413528/"
] | You can intercept the enter key from the on screen keyboard, but not from the keyboard of a PC running the emulator.
Here's some code to prove it works:
Create a new Phone Application.
Add the following to the content grid
```
<ListBox Height="276" HorizontalAlignment="Left" Margin="14,84,0,0" Name="listBox1" Vertic... | You'll need to wire this event handler to the textboxes KeyDown event if you haven't done so already. You can do so via the Events tab in the properties window, while the textbox is targeted - or you can double click there and VS will create a new event handler for you which you can put the above code into. |
3,432,172 | The [following tutorial](http://tech-fyi.net/2010/07/21/wp7-hello-world/) shows how to take the text from a text box and display it in a text block when the user hits a button. Simple enough... but what I want to do is instead of hitting a button that adds the text I want the enter button to do it.
Searching here, I f... | 2010/08/07 | [
"https://Stackoverflow.com/questions/3432172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413528/"
] | You'll need to wire this event handler to the textboxes KeyDown event if you haven't done so already. You can do so via the Events tab in the properties window, while the textbox is targeted - or you can double click there and VS will create a new event handler for you which you can put the above code into. | @Court from the answer you gave @Trees i can assume you are not really sure if the `KeyDown` is wired. Do you have the following code in the XAML file?
```
<TextBox Height="32" HorizontalAlignment="Left" Margin="13,-2,0,0" Name="textBox1" Text="" VerticalAlignment="Top" Width="433" KeyDown="textBox1_KeyDown" />
```
... |
3,432,172 | The [following tutorial](http://tech-fyi.net/2010/07/21/wp7-hello-world/) shows how to take the text from a text box and display it in a text block when the user hits a button. Simple enough... but what I want to do is instead of hitting a button that adds the text I want the enter button to do it.
Searching here, I f... | 2010/08/07 | [
"https://Stackoverflow.com/questions/3432172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413528/"
] | You'll need to wire this event handler to the textboxes KeyDown event if you haven't done so already. You can do so via the Events tab in the properties window, while the textbox is targeted - or you can double click there and VS will create a new event handler for you which you can put the above code into. | Looks like you need to handle the KeyUp event instead. |
3,432,172 | The [following tutorial](http://tech-fyi.net/2010/07/21/wp7-hello-world/) shows how to take the text from a text box and display it in a text block when the user hits a button. Simple enough... but what I want to do is instead of hitting a button that adds the text I want the enter button to do it.
Searching here, I f... | 2010/08/07 | [
"https://Stackoverflow.com/questions/3432172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413528/"
] | You can intercept the enter key from the on screen keyboard, but not from the keyboard of a PC running the emulator.
Here's some code to prove it works:
Create a new Phone Application.
Add the following to the content grid
```
<ListBox Height="276" HorizontalAlignment="Left" Margin="14,84,0,0" Name="listBox1" Vertic... | @Court from the answer you gave @Trees i can assume you are not really sure if the `KeyDown` is wired. Do you have the following code in the XAML file?
```
<TextBox Height="32" HorizontalAlignment="Left" Margin="13,-2,0,0" Name="textBox1" Text="" VerticalAlignment="Top" Width="433" KeyDown="textBox1_KeyDown" />
```
... |
3,432,172 | The [following tutorial](http://tech-fyi.net/2010/07/21/wp7-hello-world/) shows how to take the text from a text box and display it in a text block when the user hits a button. Simple enough... but what I want to do is instead of hitting a button that adds the text I want the enter button to do it.
Searching here, I f... | 2010/08/07 | [
"https://Stackoverflow.com/questions/3432172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/413528/"
] | You can intercept the enter key from the on screen keyboard, but not from the keyboard of a PC running the emulator.
Here's some code to prove it works:
Create a new Phone Application.
Add the following to the content grid
```
<ListBox Height="276" HorizontalAlignment="Left" Margin="14,84,0,0" Name="listBox1" Vertic... | Looks like you need to handle the KeyUp event instead. |
4,277,070 | I'm writing a small PHP script to grab the latest half dozen Twitter status updates from a user feed and format them for display on a webpage. As part of this I need a regex replace to rewrite hashtags as hyperlinks to search.twitter.com. Initially I tried to use:
```
<?php
$strTweet = preg_replace('/(^|\s)#(\w+)/', '... | 2010/11/25 | [
"https://Stackoverflow.com/questions/4277070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517824/"
] | ```
(^|\s)#(\w*[a-zA-Z_]+\w*)
```
PHP
```
$strTweet = preg_replace('/(^|\s)#(\w*[a-zA-Z_]+\w*)/', '\1#<a href="http://twitter.com/search?q=%23\2">\2</a>', $strTweet);
```
This regular expression says a # followed by 0 or more characters [a-zA-Z0-9\_], followed by an alphabetic character or an underscore (1 or more... | I have devised this: `/(^|\s)#([[:alnum:]])+/gi` |
4,277,070 | I'm writing a small PHP script to grab the latest half dozen Twitter status updates from a user feed and format them for display on a webpage. As part of this I need a regex replace to rewrite hashtags as hyperlinks to search.twitter.com. Initially I tried to use:
```
<?php
$strTweet = preg_replace('/(^|\s)#(\w+)/', '... | 2010/11/25 | [
"https://Stackoverflow.com/questions/4277070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517824/"
] | ```
(^|\s)#(\w*[a-zA-Z_]+\w*)
```
PHP
```
$strTweet = preg_replace('/(^|\s)#(\w*[a-zA-Z_]+\w*)/', '\1#<a href="http://twitter.com/search?q=%23\2">\2</a>', $strTweet);
```
This regular expression says a # followed by 0 or more characters [a-zA-Z0-9\_], followed by an alphabetic character or an underscore (1 or more... | It's actually better to search for characters that aren't allowed in a hashtag otherwise tags like "#Trentemøller" wont work.
The following works well for me...
```
preg_match('/([ ,.]+)/', $string, $matches);
``` |
4,277,070 | I'm writing a small PHP script to grab the latest half dozen Twitter status updates from a user feed and format them for display on a webpage. As part of this I need a regex replace to rewrite hashtags as hyperlinks to search.twitter.com. Initially I tried to use:
```
<?php
$strTweet = preg_replace('/(^|\s)#(\w+)/', '... | 2010/11/25 | [
"https://Stackoverflow.com/questions/4277070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517824/"
] | ```
(^|\s)#(\w*[a-zA-Z_]+\w*)
```
PHP
```
$strTweet = preg_replace('/(^|\s)#(\w*[a-zA-Z_]+\w*)/', '\1#<a href="http://twitter.com/search?q=%23\2">\2</a>', $strTweet);
```
This regular expression says a # followed by 0 or more characters [a-zA-Z0-9\_], followed by an alphabetic character or an underscore (1 or more... | I found Gazlers [answer](https://stackoverflow.com/a/4277114/1050507) to work, although the regex added a blank space at the beginning of the hashtag, so I removed the first part:
```
(^|\s)
```
This works perfectly for me now:
```
#(\w*[a-zA-Z_0-9]+\w*)
```
Example here: <http://rubular.com/r/dS2QYZP45n> |
4,277,070 | I'm writing a small PHP script to grab the latest half dozen Twitter status updates from a user feed and format them for display on a webpage. As part of this I need a regex replace to rewrite hashtags as hyperlinks to search.twitter.com. Initially I tried to use:
```
<?php
$strTweet = preg_replace('/(^|\s)#(\w+)/', '... | 2010/11/25 | [
"https://Stackoverflow.com/questions/4277070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517824/"
] | It's actually better to search for characters that aren't allowed in a hashtag otherwise tags like "#Trentemøller" wont work.
The following works well for me...
```
preg_match('/([ ,.]+)/', $string, $matches);
``` | I have devised this: `/(^|\s)#([[:alnum:]])+/gi` |
4,277,070 | I'm writing a small PHP script to grab the latest half dozen Twitter status updates from a user feed and format them for display on a webpage. As part of this I need a regex replace to rewrite hashtags as hyperlinks to search.twitter.com. Initially I tried to use:
```
<?php
$strTweet = preg_replace('/(^|\s)#(\w+)/', '... | 2010/11/25 | [
"https://Stackoverflow.com/questions/4277070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/517824/"
] | It's actually better to search for characters that aren't allowed in a hashtag otherwise tags like "#Trentemøller" wont work.
The following works well for me...
```
preg_match('/([ ,.]+)/', $string, $matches);
``` | I found Gazlers [answer](https://stackoverflow.com/a/4277114/1050507) to work, although the regex added a blank space at the beginning of the hashtag, so I removed the first part:
```
(^|\s)
```
This works perfectly for me now:
```
#(\w*[a-zA-Z_0-9]+\w*)
```
Example here: <http://rubular.com/r/dS2QYZP45n> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.