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 |
|---|---|---|---|---|---|
30,013,719 | I have the following Symfony form field, it's a drop down that loads from an entity:
```
->add('measureunit', 'entity', array('label' => 'Measure Unit',
'class' => 'TeamERPBaseBundle:MeasureUnit',
'expanded' => false, 'empty_value' => '',
'multiple' => false, 'property' => 'abreviat... | 2015/05/03 | [
"https://Stackoverflow.com/questions/30013719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4517170/"
] | In your form type override the function [`finishView`](http://api.symfony.com/3.2/Symfony/Component/Form/Extension/Core/Type/TimezoneType.html#method_finishView):
```
public function buildForm(FormbuilderInterface $builder, array $options){
$builder->add('measureunit', EntityType::class, array(
'label' =>... | In addition to accepted answer:
If you choose the added option you will get validation error (because it's not valid entity), the following snippet can be used to overcome this error:
```
$builder->addEventListener(
FormEvents::PRE_SUBMIT,
function (FormEvent $event) {
if ($event->getData(... |
51,455,961 | I have a List of Strings. For each string i wish to see if the first occurrence of the word "joe" is present. I am separating by white space as I do not wish to count the word "joey", for example.
My current code counts every occurrence of the word "joe", how do I edit it so it only counts the first occurrence of the ... | 2018/07/21 | [
"https://Stackoverflow.com/questions/51455961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9972481/"
] | A regular expression also works and makes this code a little shorter.
```
public int counter(List<String> comments) {
String regex = "(.* )?joe( .*)?";
return (int) comments.stream().filter(s -> s.matches(regex)).count();
}
```
**Edit:**
The regex of @Paelle is slightly better, use `.*\\bjoe\\b.*` instead. | In your code you just need to add `break;` line just after `count++;` line.
Something like the following:
```
public int counter(List<String> comments) {
int count = 0;
String word = "joe";
for (String comment : comments) {
String a[] = comment.split(" ");
for (int j = 0; j < a.length; j++... |
51,455,961 | I have a List of Strings. For each string i wish to see if the first occurrence of the word "joe" is present. I am separating by white space as I do not wish to count the word "joey", for example.
My current code counts every occurrence of the word "joe", how do I edit it so it only counts the first occurrence of the ... | 2018/07/21 | [
"https://Stackoverflow.com/questions/51455961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9972481/"
] | You can use regular expressions to check whether the entire String contains the word without the need to split it into individual words first.
A regular expression that matches the word "joe" but not "joey" would be the following:
```
\bjoe\b
```
The `\b` matches the bounds of a word, so the whole expression matche... | In your code you just need to add `break;` line just after `count++;` line.
Something like the following:
```
public int counter(List<String> comments) {
int count = 0;
String word = "joe";
for (String comment : comments) {
String a[] = comment.split(" ");
for (int j = 0; j < a.length; j++... |
51,455,961 | I have a List of Strings. For each string i wish to see if the first occurrence of the word "joe" is present. I am separating by white space as I do not wish to count the word "joey", for example.
My current code counts every occurrence of the word "joe", how do I edit it so it only counts the first occurrence of the ... | 2018/07/21 | [
"https://Stackoverflow.com/questions/51455961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9972481/"
] | You can use regular expressions to check whether the entire String contains the word without the need to split it into individual words first.
A regular expression that matches the word "joe" but not "joey" would be the following:
```
\bjoe\b
```
The `\b` matches the bounds of a word, so the whole expression matche... | A regular expression also works and makes this code a little shorter.
```
public int counter(List<String> comments) {
String regex = "(.* )?joe( .*)?";
return (int) comments.stream().filter(s -> s.matches(regex)).count();
}
```
**Edit:**
The regex of @Paelle is slightly better, use `.*\\bjoe\\b.*` instead. |
16,720,545 | I am not able to customize a url using .htaccess. I applied all changes in .htaccess but this one stuck with me for long time.
I have a URL :
```
product.php?act=pro&cat=1&category=Nokia
```
I want to change it to:
```
product/1/Nokia.html
```
I used following rule:
```
RewriteRule ^product/?([a-zA-Z_]+)/([a-zA... | 2013/05/23 | [
"https://Stackoverflow.com/questions/16720545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1387359/"
] | You're capturing only 2 groups and using $1, $2, $3.
Change your code to this:
```
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^product/([^/]+)/([^.]+)\.html$ /product.php?act=pro&cat=$1&category=$2 [QSA,L,NC]
``` | Pattern that matches cat should have 0-9 in it |
16,720,545 | I am not able to customize a url using .htaccess. I applied all changes in .htaccess but this one stuck with me for long time.
I have a URL :
```
product.php?act=pro&cat=1&category=Nokia
```
I want to change it to:
```
product/1/Nokia.html
```
I used following rule:
```
RewriteRule ^product/?([a-zA-Z_]+)/([a-zA... | 2013/05/23 | [
"https://Stackoverflow.com/questions/16720545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1387359/"
] | Try this:
```
RewriteRule ^/product/([0-9]+)/(.*).html$ ^/product.php?act=pro&cat=$1&category=$2 [NC,L]
``` | Pattern that matches cat should have 0-9 in it |
16,720,545 | I am not able to customize a url using .htaccess. I applied all changes in .htaccess but this one stuck with me for long time.
I have a URL :
```
product.php?act=pro&cat=1&category=Nokia
```
I want to change it to:
```
product/1/Nokia.html
```
I used following rule:
```
RewriteRule ^product/?([a-zA-Z_]+)/([a-zA... | 2013/05/23 | [
"https://Stackoverflow.com/questions/16720545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1387359/"
] | You're capturing only 2 groups and using $1, $2, $3.
Change your code to this:
```
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^product/([^/]+)/([^.]+)\.html$ /product.php?act=pro&cat=$1&category=$2 [QSA,L,NC]
``` | Try this:
```
RewriteRule ^/product/([0-9]+)/(.*).html$ ^/product.php?act=pro&cat=$1&category=$2 [NC,L]
``` |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | There are some cases when calling System.gc() is useful:
* You're going to run some benchmark, so you need to start in a well-defined state.
* You're expecting some heavy load and want to get prepared as good as possible.
* You have multiple servers and want to avoid pauses by scheduling GC on them periodically [like ... | What version of Java are we talking about here? In 6, I'd never call it explicitly. As a general rule of thumb the garbage collector is good enough to know when best to clean up resources and it's got enough configurable VM options. I've certainly never felt the need to call it in code, and I'd say unless you were doin... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | The best way, in my opinion, to think of the `System.gc()` method is as a "hint" to the VM that garbage collection should run. That said, much like a large percentage of "optimizations" people think they are performing, it's usually best to just let the system take care of things on its own. Systems are evolving etc, e... | ```
It is said that we cannot force the garbage collection process in java.
```
That is a very popular belief, which is totally wrong.
Several applications do that on a regular basis and some even have shiny buttons you can click that do **really** perform a GC. In other words: they don't "hint" the GC that they'd l... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | The best way, in my opinion, to think of the `System.gc()` method is as a "hint" to the VM that garbage collection should run. That said, much like a large percentage of "optimizations" people think they are performing, it's usually best to just let the system take care of things on its own. Systems are evolving etc, e... | Not intending to answer the question, calling the garbage collector explicitly is a bad, bad practice, however some code in java does rely on finalization... and attempts to enforce it. Calling it is useful in some profiling scenarios as well.
No standard JVM ignores System.gc(). Sure, it can be disabled. However, b/c... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | What version of Java are we talking about here? In 6, I'd never call it explicitly. As a general rule of thumb the garbage collector is good enough to know when best to clean up resources and it's got enough configurable VM options. I've certainly never felt the need to call it in code, and I'd say unless you were doin... | ```
It is said that we cannot force the garbage collection process in java.
```
That is a very popular belief, which is totally wrong.
Several applications do that on a regular basis and some even have shiny buttons you can click that do **really** perform a GC. In other words: they don't "hint" the GC that they'd l... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | You answered half of your question: is it worth it? No, because you can't force it.
>
> Runs the garbage collector. Calling this method suggests that the Java virtual machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse.
>
>
>
This is al... | Not intending to answer the question, calling the garbage collector explicitly is a bad, bad practice, however some code in java does rely on finalization... and attempts to enforce it. Calling it is useful in some profiling scenarios as well.
No standard JVM ignores System.gc(). Sure, it can be disabled. However, b/c... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | >
> Q: why we call the System.gc( );
> function explicitly ?
>
>
> A: Because somebody wrote bad code.
>
>
>
I think most people would agree that you *shouldn't* call `System.gc()` explicitly.
Let the system manage memory as it's supposed to. Any code relying on that for performance is most likely broken. Also... | ```
It is said that we cannot force the garbage collection process in java.
```
That is a very popular belief, which is totally wrong.
Several applications do that on a regular basis and some even have shiny buttons you can click that do **really** perform a GC. In other words: they don't "hint" the GC that they'd l... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | You answered half of your question: is it worth it? No, because you can't force it.
>
> Runs the garbage collector. Calling this method suggests that the Java virtual machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse.
>
>
>
This is al... | What version of Java are we talking about here? In 6, I'd never call it explicitly. As a general rule of thumb the garbage collector is good enough to know when best to clean up resources and it's got enough configurable VM options. I've certainly never felt the need to call it in code, and I'd say unless you were doin... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | You answered half of your question: is it worth it? No, because you can't force it.
>
> Runs the garbage collector. Calling this method suggests that the Java virtual machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse.
>
>
>
This is al... | It is an `anti-pattern to use System.gc()` explicitly, though we use it to suggest JVM for sweeping garbage but it is up to the JVM whether it will or not, it further imposes some criteria that it look into when `System.gc()` occurs. If criteria follows then it acts; otherwise not. |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | >
> Q: why we call the System.gc( );
> function explicitly ?
>
>
> A: Because somebody wrote bad code.
>
>
>
I think most people would agree that you *shouldn't* call `System.gc()` explicitly.
Let the system manage memory as it's supposed to. Any code relying on that for performance is most likely broken. Also... | What version of Java are we talking about here? In 6, I'd never call it explicitly. As a general rule of thumb the garbage collector is good enough to know when best to clean up resources and it's got enough configurable VM options. I've certainly never felt the need to call it in code, and I'd say unless you were doin... |
4,784,990 | I am having difficulty aligning SNS buttons using CSS on this page giantmango.com/news. I am using the exact css and html, but I cannot align giantmango.com/news SNS buttons like the giantmango.com ones. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4784990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567954/"
] | Not intending to answer the question, calling the garbage collector explicitly is a bad, bad practice, however some code in java does rely on finalization... and attempts to enforce it. Calling it is useful in some profiling scenarios as well.
No standard JVM ignores System.gc(). Sure, it can be disabled. However, b/c... | What version of Java are we talking about here? In 6, I'd never call it explicitly. As a general rule of thumb the garbage collector is good enough to know when best to clean up resources and it's got enough configurable VM options. I've certainly never felt the need to call it in code, and I'd say unless you were doin... |
18,239,476 | I am currently programming a simple Android app that asks the user a series of questions and then tells them how many they got correct. I have one class that has a global variable (called "score") that is private and I have getter and setter methods for it. When the user gets the answer correct, the score is incremente... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18239476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1831081/"
] | >
> **Set** the Score, **before** getting the Score.
>
>
>
```
public ClassB {
private ClassA eg = new ClassA();
eg.setScore(5);
private int score = eg.getScore();
System.out.println(score);
}
```
Hope this helps. | Make sure to actually increment the score in `ClassB`. Also make `score` a `static` variable. |
18,239,476 | I am currently programming a simple Android app that asks the user a series of questions and then tells them how many they got correct. I have one class that has a global variable (called "score") that is private and I have getter and setter methods for it. When the user gets the answer correct, the score is incremente... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18239476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1831081/"
] | >
> **Set** the Score, **before** getting the Score.
>
>
>
```
public ClassB {
private ClassA eg = new ClassA();
eg.setScore(5);
private int score = eg.getScore();
System.out.println(score);
}
```
Hope this helps. | Edit your code like this :
```
public ClassA {
private static int score = 0;
public void setScore(int s) {
this.score = s;
}
public int getScore() {
return score;
}
}
public ClassB {
private ClassA eg = new ClassA();
int score = 0;
if(answerCorrect())
{
... |
18,239,476 | I am currently programming a simple Android app that asks the user a series of questions and then tells them how many they got correct. I have one class that has a global variable (called "score") that is private and I have getter and setter methods for it. When the user gets the answer correct, the score is incremente... | 2013/08/14 | [
"https://Stackoverflow.com/questions/18239476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1831081/"
] | Make sure to actually increment the score in `ClassB`. Also make `score` a `static` variable. | Edit your code like this :
```
public ClassA {
private static int score = 0;
public void setScore(int s) {
this.score = s;
}
public int getScore() {
return score;
}
}
public ClassB {
private ClassA eg = new ClassA();
int score = 0;
if(answerCorrect())
{
... |
892,799 | I started using Visual Studio for writing my XUL, because it gives me intellisense and validation, as I use a special XUL xml-schema.
There are still some problems with this approach, that I want to fix to make VS a more usable XUL-IDE.
VS doesn't know anything about the chrome-protocol and gives me an error ("The UR... | 2009/05/21 | [
"https://Stackoverflow.com/questions/892799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110464/"
] | I would try the following:
1. Use another Doctype tag on the next
line below the Chrome one, except
that this one uses the file:// URI
scheme.
2. If that does not work try
using the file URI by itself
replacing the chrome URI altogether.
There are situations where more than one doctype tag is allowed. | Dive into Program Files, under the Visual Studio installation directory appropriate for your installation.
You'll find a subdirectory for Xml, and within that one for Schemas.
For example, on my system the directory is:
>
> C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas
>
>
>
Any schema file you put i... |
37,117,900 | I'm new to MVC and now working on a small project but actually I don't know how to organize my project specially I'm using database first approach and I'm wondering where to put Entity framework data model in Model layer or in data access layer.
My project is divided to these layers.
* Data access layer (Class library... | 2016/05/09 | [
"https://Stackoverflow.com/questions/37117900",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3898474/"
] | Well, you've got too many layers for one, which is part of why you're getting confused. `Model` and `Data access` are the same thing. Your entities should coexist with your method of retrieving them and working with them. Your `Business` layer could likely be rolled in as well, since "business logic" is often the same ... | My suggestion would be to put views, controllers and view models in the main web project, EF models and data access in a data layer class library and your business layer in a third class library. It's debatable how many layers you really need for a small project but separating web/business/data is good practice and is ... |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | As much as I understood, answer of your question would be like this..
1) Take a certain size of file(file A)
2) Now you will have a screen with transparent background. without doing anything else further, first of all take a screen shot of such screen.
[](https://i.stack.imgur.com/AeDSi.png) |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | As of Photoshop CC 2015.5 you can now have artboards with transparent backgrounds.
Either create a new Artboard and select `Transparent` under the `Background Contents` menu or, if you have an existing artboard, simply select it in the layers panel, open up the properties windows and change the background with the `Ar... | Set artboard background
In the Properties panel (Window > Properties) for the artboard, set the desired value for Artboard Background Color field. You can also set the artboard background to transparent. |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | Select the background layer.
Double click so it is no longer locked, it will rename as layer 0.
select all within your canvas (cmd + a) and delete. | Window -> Properties.
Make sure Artboard is selected.
See properties panel (that should be visible now) -> In the Artboard background color dropdown select: **Transparent** (white is selected by default).
You can check a quick (12sec) video here:
<https://www.youtube.com/watch?v=C9sgajjbrZk> |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | As much as I understood, answer of your question would be like this..
1) Take a certain size of file(file A)
2) Now you will have a screen with transparent background. without doing anything else further, first of all take a screen shot of such screen.
[ -> In the Artboard background color dropdown select: **Transparent** (white is selected by default).
You can check a quick (12sec) video here:
<https://www.youtube.com/watch?v=C9sgajjbrZk> |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | Set artboard background
In the Properties panel (Window > Properties) for the artboard, set the desired value for Artboard Background Color field. You can also set the artboard background to transparent. | Window -> Properties.
Make sure Artboard is selected.
See properties panel (that should be visible now) -> In the Artboard background color dropdown select: **Transparent** (white is selected by default).
You can check a quick (12sec) video here:
<https://www.youtube.com/watch?v=C9sgajjbrZk> |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | As much as I understood, answer of your question would be like this..
1) Take a certain size of file(file A)
2) Now you will have a screen with transparent background. without doing anything else further, first of all take a screen shot of such screen.
[ . |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | As of Photoshop CC 2015.5 you can now have artboards with transparent backgrounds.
Either create a new Artboard and select `Transparent` under the `Background Contents` menu or, if you have an existing artboard, simply select it in the layers panel, open up the properties windows and change the background with the `Ar... | You can take a screen shot and then open it as image. It's simple and you don't have to worry about [white background](https://www.youtube.com/watch?v=xbSWDx5fcms) . |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | As much as I understood, answer of your question would be like this..
1) Take a certain size of file(file A)
2) Now you will have a screen with transparent background. without doing anything else further, first of all take a screen shot of such screen.
[ for the artboard, set the desired value for Artboard Background Color field. You can also set the artboard background to transparent. |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | While you create a new file (menu > NEW). Select "Background Contents" drop to Transparent... Now you will get a transparent artboard. | Window -> Properties.
Make sure Artboard is selected.
See properties panel (that should be visible now) -> In the Artboard background color dropdown select: **Transparent** (white is selected by default).
You can check a quick (12sec) video here:
<https://www.youtube.com/watch?v=C9sgajjbrZk> |
65,818 | I love the Photoshop artboard feature, however I'm used to seeing the transparent background grid. Is there any way to show this in my artboards in Photoshop?
And yes, I know it will still save with a transparent background, but I like having the grid that way if I were to use a white background for something I would ... | 2016/01/21 | [
"https://graphicdesign.stackexchange.com/questions/65818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/57771/"
] | ....Or you could create the board from the outset:
[](https://i.stack.imgur.com/AeDSi.png) | Window -> Properties.
Make sure Artboard is selected.
See properties panel (that should be visible now) -> In the Artboard background color dropdown select: **Transparent** (white is selected by default).
You can check a quick (12sec) video here:
<https://www.youtube.com/watch?v=C9sgajjbrZk> |
44,050,242 | I installed w3m on Termux on Android and then opened google.com using the statement `w3m https://google.com/`. I would like know how to get out of w3m back to the Terminal window.[](https://i.stack.imgur.com/LoCbf.jpg) | 2017/05/18 | [
"https://Stackoverflow.com/questions/44050242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6921594/"
] | Simply use 'q'(without quotes) | [](https://i.stack.imgur.com/P3tFJ.png)
For Exiting the w3m Browser and going back to the Terminal window.
Press CTRL + Q on your keyboard and you will be back on your terminal window. |
30,888,647 | Here is my code
<http://jsfiddle.net/8fsmcc7b/>
And I pasted it below:
```js
setTimeout(function(){$("div").hover()}, 1000)
```
```css
div {
background: grey;
width: 20px;
}
div:hover {
width: 200px;
}
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>... | 2015/06/17 | [
"https://Stackoverflow.com/questions/30888647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1272683/"
] | You can expand it by this simple way.
Create a CSS class with the 200px width (here you can add also CSS3 animations). Use `.hover(handler1, handler2)` function from jQuery or `.mouseenter()` / `.mouseleave()`. The first handler for hover function, will be for the mouse entering that element, and just add the class, a... | [Hover](http://api.jquery.com/hover/) binds mouseover and mouseout handlers! I Don't think It triggers mouseover event.
If you want to apply a style you can do it by adding a class like bellow
```
div:hover,div.hoverd {
width: 200px;
}
<script>
setTimeout(function(){
$("div").addClass('hoverd');
setTimeo... |
583,640 | I installed 14.04 a month ago and have not been able to get my Nvidia graphics card to work since that time. Currently the system thinks it is using the Nvidia driver.
Output of `lshw -c video` is as follows :
```
description: VGA compatible controller
product: NV36 [GeForce FX 5700]
vendor: NVIDIA Corporation
... | 2015/02/10 | [
"https://askubuntu.com/questions/583640",
"https://askubuntu.com",
"https://askubuntu.com/users/335293/"
] | If you look at your [NVidia card compared to modern equivalents](http://www.videocardbenchmark.net/gpu.php?gpu=GeForce+FX+5700) I would say: disable it in the BIOS if a laptop, remove it from the PC if a desktop and run Xubuntu (or Lubuntu). Your performance is going to be much better in that case.
The only other way ... | Your Ubuntu is using Nvidia driver for the card, but that doesn't mean Ubuntu is using Nvidia card. Maybe you didn't switch to Nvidia card after installing the propriety driver.
Instructions on how to switch between Intel and Nvidia card can be found on my blog: <https://www.linuxbabe.com/desktop-linux/switch-intel-n... |
3,377,556 | >
> **Possible Duplicate:**
>
> [Type List vs type ArrayList in Java](https://stackoverflow.com/questions/2279030/type-list-vs-type-arraylist-in-java)
>
>
>
Why is it recommended to do this:
```
List<String> myArrayList = new ArrayList<String>
```
or same with Map interface and HashMap class
rather than:
... | 2010/07/31 | [
"https://Stackoverflow.com/questions/3377556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231917/"
] | Because the consuming code of the `myArrayList` variable won't be tied to a particular implementation of this interface. | With the first (preferred) line you say, that your code needs a List, with the second line you say your code needs an ArrayList. Usually, you path variable instances around. If you now change the myArrayList instance for some reason you would have to change too much code. |
3,377,556 | >
> **Possible Duplicate:**
>
> [Type List vs type ArrayList in Java](https://stackoverflow.com/questions/2279030/type-list-vs-type-arraylist-in-java)
>
>
>
Why is it recommended to do this:
```
List<String> myArrayList = new ArrayList<String>
```
or same with Map interface and HashMap class
rather than:
... | 2010/07/31 | [
"https://Stackoverflow.com/questions/3377556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231917/"
] | Because the consuming code of the `myArrayList` variable won't be tied to a particular implementation of this interface. | You should not use:
```
List<String> myArrayList = new ArrayList<String>
```
Why you should use the type List instead of ArrayList (unless you really need feature of the ArrayList that is missing in the List interface) is already explained in the other answer.
But I think it is even more important to use proper nam... |
58,449,436 | I'm trying to find a specific value in my JSON.
this my json
```
[
{
"airportName" : "Simon Mwansa Kapwepwe Intl",
"longitude" : 28.664999999999999,
"geometry" : {
"type" : "Point",
"coordinates" : [
28.664999999999999,
-12.994999999999999
]
},
"countryCode" : ... | 2019/10/18 | [
"https://Stackoverflow.com/questions/58449436",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9962676/"
] | Make an explicit call for `BotMan` in the function closure dependency injection to avoid confusion with current namespace
```php
$botman->hears('intent-action-name', function (\BotMan\BotMan $bot) {
$extras = $bot->getMessage()->getExtras();
$apiReply = $extras['apiReply'];
$apiAction = $extras['apiAction'];
... | using \BotMan\BotMan worked instead of using Botman importing use BotMan\BotMan; .Thanks @sally 3301 it worked |
18,090,059 | I'm lost :-( I receive a successful response from an AJAX request via CORS, but I have no idea how to actually use the JSON file I'm acquiring.
All of my alerts are working. How would I cache the received JSON file as a function/variable?
```
$(function(){
var pulseRestApiGetQueryUri = "https://doesntmatter/api/v... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18090059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2275042/"
] | You can use [QApplication::focusWidget()](http://qt-project.org/doc/qt-5.0/qtwidgets/qapplication.html#focusWidget) function to see which widget currently has focus.
Or you can use the [QWidget::hasFocus()](http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#focus-prop) function to see if your text box has focus.
... | The previous answer is right but just in case you want to monitor more components you can use
```
QWidget * QApplication::focusWidget ()
```
to get widget with focus.
This approach will allow you to make cleaner code if you wanted to have more widgets monitored. Instead of having a ladder of ifs just use some kind ... |
39,103,847 | We have upgraded our DB from 9 to 12c. I did not see ojdbc14.jar and classes12.jar. Does this mean we have to move to ojdbc5.jar, Ojdbc7.jar? | 2016/08/23 | [
"https://Stackoverflow.com/questions/39103847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/214131/"
] | You should strongly consider upgrading to JDK 8. All earlier versions of Java have passed the end of their support life. JDK 9 is coming. It's time to upgrade.
The number in the Oracle JDBC JAR driver name refers to the JDK version it is written for. classes12.jar is *hopelessly* out of date - that's JDK 1.2.
There's... | I faced the same issue with my old legacy code.
I renamed the ojdbc8.jar as classes12.jar, and it is working great without any code migration. |
19,787,997 | I create a 3-level CSS megamenu on a responsive website. It works fine on the desktop size, but on the mobile version if I click on the menu, instead of showing the submenu, it follows the link added in `href=""` attribute.
Here is the screenshot of the mobile menu (to make this screenshot I removed the anchor tag to ... | 2013/11/05 | [
"https://Stackoverflow.com/questions/19787997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can do this in at least 4 ways.
* Set the `href` attribute to `#` (will make your page scroll to top tho)
* Set the `href` attribute to `javascript:void(0);`
* Remove the `href` attribute but add `cursor:pointer` for each `a` element with css `li.menu > a { cursor:pointer; }` (I suggest this)
* Use [`e.preventDefa... | did you try :
```
$("li.menu > a").on("click", function(e) {
e.preventDefault();
functionToShowTheMenu();
});
``` |
68,612,328 | In Rust a tuple can be indexed using a dot (e.g.: `x.0`), while an array can be indexed with square brackets (e.g.: `x[0]`). At first glance this seems to me as if it would make it harder to refactor existing code, without serving any actual purpose. However, I am probably just missing something. Did the creators of Ru... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68612328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7130273/"
] | This tuple field access syntax was introduced in [RFC 184](https://rust-lang.github.io/rfcs/0184-tuple-accessors.html) ([discussion thread](https://github.com/rust-lang/rfcs/pull/184)). Before that, you had to destructure all tuples (and tuple structs) to access their values, or use special traits in the standard libra... | I haven't seen any explicit mention of the reasoning behind the decision but it makes sense considering the original meaning of the indexing syntax. Dating back to C, arrays were contiguous meaning they stored data such that each byte of data began as the previous one left off. When you accessed the Nth element of an a... |
24,590,830 | I am getting this warning:
>
> Deprecated: Function `ereg()` is deprecated in
>
>
>
PHP Code:
```
if ($kill_bullets == 0 || !$kill_bullets || ereg('[^0-9]',$kill_bullets)){
echo "Invalid Bullets!";
} elseif ($kill_bullets != 0 || $kill_bullets || !ereg('[^0-9]',$kill_bullets)) {
}
``` | 2014/07/05 | [
"https://Stackoverflow.com/questions/24590830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3808505/"
] | ```
if (!$kill_bullets || !ctype_digit($kill_bullets)) {
echo "Invalid Bullets!";
}
```
---
>
> When i click sumbit button nothing happens?
>
>
>
Try this snippet.
```
if (!$kill_bullets || !ctype_digit($kill_bullets)) {
echo "Invalid Bullets!";
} else {
echo "Valid Bullets. okay.";
}
``` | The POSIX compatible regexps [are deprecated](http://de3.php.net/manual/en/intro.regex.php). You should use the PCRE instead.
[preg\_match](http://www.php.net/manual/en/function.preg-match.php) would be the equivalent to ereg with a little bit different syntax. |
25,792,284 | I'm using a new Swift language for develop IOS application. Suddenly i got an error from my XCode.
```
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
cd /Users/bobo/Des... | 2014/09/11 | [
"https://Stackoverflow.com/questions/25792284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084015/"
] | I found solution, but it's not a best way. After reinstall XCode this issue was fixed. | I had the same problem, then I use git checkout old versions to find which commit cause the problem, and try to find the key problem code. My key problem code is something like this
```
func afunc() {
class AClass() {
}
let ac = AClass()
//....
}
```
Other code could make the same problem, occur in S... |
25,792,284 | I'm using a new Swift language for develop IOS application. Suddenly i got an error from my XCode.
```
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
cd /Users/bobo/Des... | 2014/09/11 | [
"https://Stackoverflow.com/questions/25792284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084015/"
] | Did you try removing your project folder in the DerivedData folder before reinstalling xCode?
I had the same problem updating from beta 6 to beta 7, and that solved the problem. | I had the same problem, then I use git checkout old versions to find which commit cause the problem, and try to find the key problem code. My key problem code is something like this
```
func afunc() {
class AClass() {
}
let ac = AClass()
//....
}
```
Other code could make the same problem, occur in S... |
9,238,932 | My pass in LLVM generates an `IR` like this:
```
%5 = icmp eq i32 %4, 0
%7 = or i1 %5, %5
...
```
Since the `or` instruction is actually not needed(dead code), I replaced all occurrences of `%7` with `%5`. Now, the `or` instruction should get deleted. Can I call *Dead Code Elimination* pass of LLVM from my pass, or ... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9238932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/802651/"
] | A solution that is more aligned with LLVM's design philosophy is, instead of doing the substitution in **your** pass, let [InstCombine](http://llvm.org/docs/Passes.html#instcombine-combine-redundant-instructions) do the job. Then you will not need to worry about running DCE.
For example:
```
>cat foo.ll
define i32 @f... | Why don't you just schedule DCE to run after your pass in the pass manager. Let it do its analysis and decide what it wants to throw away. |
1,730,875 | I'm trying to transform some *XML* into *HTML* using *XSLT*.
**Problem:**
I can't get it to work. Can someone tell me what I'm doing wrong?
**XML:**
```
<ArrayOfBrokerage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.test.com/">
<Brokerage>
<BrokerageID>91</BrokerageID>
... | 2009/11/13 | [
"https://Stackoverflow.com/questions/1730875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/176742/"
] | You need to provide a namespace prefix in your xslt for the elements you are transforming. For some reason (at least in a Java JAXP parser) you can't simply declare a default namespace. This worked for me:
```
<xsl:stylesheet version="1.0" xmlns:t="http://www.test.com/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"... | How do you execute the transformation? Maybe you forgot to link the XSLT stylesheet to XML document using:
```
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
```
at the beginning of XML document. [More explanation here](http://www.w3schools.com/xsl/xsl_transformation.asp). |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | Include http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html#hashCode(java.lang.Object[]) as part of the hashCode() implementation. | It depends on what your criteria for equality are. Is the *order* in the array important? If so, you'll probably want to make the hash code depend on the order of the nodes in the array. If not, you may want to do something like XOR-ing the hash codes of all the nodes within the array. Presumably some of the values may... |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | Include http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html#hashCode(java.lang.Object[]) as part of the hashCode() implementation. | You can use `Arrays.hashCode()` and `Arrays.equals()` methods. |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | Include http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html#hashCode(java.lang.Object[]) as part of the hashCode() implementation. | A few of points to add to the current answers, if performance is of any concern.
First, you need to decide whether *order* of the child nodes in a node matter. If they don't, you cannot use the hashcode for an array. Consider fashioning your hashcode function around that defined by `java.util.Set`. Also consider using... |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | >
> I'm trying to check if the two nodes
> are the same, meaning that they have
> the same number of children, and that
> those children lead to the exact same
> states. Therefore, I'm effectively
> trying to compare the subtrees at the
> two node. I'm wondering if I can use
> hashing to do this equality check.... | It depends on what your criteria for equality are. Is the *order* in the array important? If so, you'll probably want to make the hash code depend on the order of the nodes in the array. If not, you may want to do something like XOR-ing the hash codes of all the nodes within the array. Presumably some of the values may... |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | It depends on what your criteria for equality are. Is the *order* in the array important? If so, you'll probably want to make the hash code depend on the order of the nodes in the array. If not, you may want to do something like XOR-ing the hash codes of all the nodes within the array. Presumably some of the values may... | A few of points to add to the current answers, if performance is of any concern.
First, you need to decide whether *order* of the child nodes in a node matter. If they don't, you cannot use the hashcode for an array. Consider fashioning your hashcode function around that defined by `java.util.Set`. Also consider using... |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | >
> I'm trying to check if the two nodes
> are the same, meaning that they have
> the same number of children, and that
> those children lead to the exact same
> states. Therefore, I'm effectively
> trying to compare the subtrees at the
> two node. I'm wondering if I can use
> hashing to do this equality check.... | You can use `Arrays.hashCode()` and `Arrays.equals()` methods. |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | You can use `Arrays.hashCode()` and `Arrays.equals()` methods. | A few of points to add to the current answers, if performance is of any concern.
First, you need to decide whether *order* of the child nodes in a node matter. If they don't, you cannot use the hashcode for an array. Consider fashioning your hashcode function around that defined by `java.util.Set`. Also consider using... |
5,887,449 | I know there are other questions about the general best practices while over riding hashCode and equals, but I have a very specific question.
I have a class that has as an instance variable, an array of the same class. To be more explicit, here's the code:
```
Class Node{
Node arr[] = new Node[5];
}
```
I need... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5887449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384108/"
] | >
> I'm trying to check if the two nodes
> are the same, meaning that they have
> the same number of children, and that
> those children lead to the exact same
> states. Therefore, I'm effectively
> trying to compare the subtrees at the
> two node. I'm wondering if I can use
> hashing to do this equality check.... | A few of points to add to the current answers, if performance is of any concern.
First, you need to decide whether *order* of the child nodes in a node matter. If they don't, you cannot use the hashcode for an array. Consider fashioning your hashcode function around that defined by `java.util.Set`. Also consider using... |
15,125,680 | Let's say we have a message that is signed with an HMAC, then that message and the HMAC are encrypted, then that is sent over a TCP socket:
```
// endpoint info excluded
TcpClient client = new TcpClient();
var stream = client.GetStream();
// assume pre-shared keys are used and set at this point
AesManaged aes = new A... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15125680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164430/"
] | You really should perform encryption before MAC to create a secure solution, *especially* if you send the data over a socket (as you may be vulnerable to padding oracle attacs). So although your question is valid, it it better to change the order of the streams. | So I put a hack in place that seems to be working for the moment. I created a stream wrapper class called `ProtectedStream`. Here's the gist:
```
public class ProtectedStream : Stream
{
private Stream stream;
public ProtectedStream(Stream stream)
{
if(stream == null)
throw new ArgumentNullException("s... |
15,125,680 | Let's say we have a message that is signed with an HMAC, then that message and the HMAC are encrypted, then that is sent over a TCP socket:
```
// endpoint info excluded
TcpClient client = new TcpClient();
var stream = client.GetStream();
// assume pre-shared keys are used and set at this point
AesManaged aes = new A... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15125680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164430/"
] | Since I'm dealing with similar topics atm, I'll put an answer here:
Like Maarten Bodewes wrote, I suggest you do encrypt-then-MAC.
You could then write the HMAC-Bytes after doing `FlushFinalBlock()` on the `aesStream`.
Don't forget to dispose the CryptoStreams and Algorithms objects!
```
var stream = client.GetStre... | So I put a hack in place that seems to be working for the moment. I created a stream wrapper class called `ProtectedStream`. Here's the gist:
```
public class ProtectedStream : Stream
{
private Stream stream;
public ProtectedStream(Stream stream)
{
if(stream == null)
throw new ArgumentNullException("s... |
16,517,642 | I am trying to create an object that gets returned without the `new` keyword in javascript?
My code structure so far;
```
myLib.func = (function() {
"use strict";
function func() {
this._init();
};
func.prototype._init = function() {
this.someVar = 5;
};
Return func;
})(... | 2013/05/13 | [
"https://Stackoverflow.com/questions/16517642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2251919/"
] | In [strict mode](https://developer.mozilla.org/en/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode), the `this` will be `undefined` by default. You can account for this feature by adding it to your condition:
```
if (window === this || undefined === this) {
return new myLib.func();
} ... | If you don't really need public / private methods, you can use object literal
```
var myLib = {};
myLib.func = {
_init: function() {
this.someVar = 5;
},
doSomething: function(a, b) {
return a + b;
}
};
```
This will be a singleton object, usually it's enough for javascript appl... |
16,517,642 | I am trying to create an object that gets returned without the `new` keyword in javascript?
My code structure so far;
```
myLib.func = (function() {
"use strict";
function func() {
this._init();
};
func.prototype._init = function() {
this.someVar = 5;
};
Return func;
})(... | 2013/05/13 | [
"https://Stackoverflow.com/questions/16517642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2251919/"
] | If `myLib.func` is your class name, you cannot call it like `var func = myLib.func();`.
However, you could wrap this latter into another function, such that you get
```
var factory = function(){
var func = myLib.func();
return func;
}
``` | If you don't really need public / private methods, you can use object literal
```
var myLib = {};
myLib.func = {
_init: function() {
this.someVar = 5;
},
doSomething: function(a, b) {
return a + b;
}
};
```
This will be a singleton object, usually it's enough for javascript appl... |
16,517,642 | I am trying to create an object that gets returned without the `new` keyword in javascript?
My code structure so far;
```
myLib.func = (function() {
"use strict";
function func() {
this._init();
};
func.prototype._init = function() {
this.someVar = 5;
};
Return func;
})(... | 2013/05/13 | [
"https://Stackoverflow.com/questions/16517642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2251919/"
] | In [strict mode](https://developer.mozilla.org/en/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode), the `this` will be `undefined` by default. You can account for this feature by adding it to your condition:
```
if (window === this || undefined === this) {
return new myLib.func();
} ... | If `myLib.func` is your class name, you cannot call it like `var func = myLib.func();`.
However, you could wrap this latter into another function, such that you get
```
var factory = function(){
var func = myLib.func();
return func;
}
``` |
25,985,547 | I'm trying to convert some form in my application over to symfony forms. I have a birthday value that i want to have empty values for and the empty values should be 'month' 'day' 'year' respectively and would display the translated versions of those words depending on your local. Right now i'm trying this with twig.
`... | 2014/09/23 | [
"https://Stackoverflow.com/questions/25985547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1190203/"
] | Doesn't appear to be possible, though [the documentation](https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensibilityPG.pdf) doesn't explicitly state so. Two points are in conflict with each other, which might provide some insight.
>
> The displayed name of your app extensio... | Double click Project, select Target "extension" > Click Info
By setting name for "`Bundle display name (CFBundleDisplayName)`", the iOS share extension name can be changed to suit your need.
Using Xcode 7.2.1
Deployment Target 9.2 |
46,470,041 | So I have a variable containing rotation in degrees, and I have an ideal rotation, and what I want is the percentage of accuracy within 20 degrees in either direction.
```
var actualRotation = 215
var idealRotation = 225
var accuracy = magicFunction(actualRotation, idealRotation)
```
In this case, the `actualRotati... | 2017/09/28 | [
"https://Stackoverflow.com/questions/46470041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/951402/"
] | Try this (just run code snippet):
```js
function magicFunction(actualRotation , idealRotation ) {
var diff = Math.abs(actualRotation - idealRotation);
var accurrancy = 1 - (diff / 20);
accurrancy = accurrancy < 0 ? 0 : accurrancy;
return accurrancy;
}
console.log("225, 225: ", magicFunction(225, ... | The previous answers were good, but they don't handle the case where the difference crosses the zero-singularity.
E.g. when the angles are **5** and **355**, you expect a difference of 10, but a simple subtraction gives 350. To rectify this, subtract the angle from 360 if it is bigger than 180.
For the above to work,... |
46,470,041 | So I have a variable containing rotation in degrees, and I have an ideal rotation, and what I want is the percentage of accuracy within 20 degrees in either direction.
```
var actualRotation = 215
var idealRotation = 225
var accuracy = magicFunction(actualRotation, idealRotation)
```
In this case, the `actualRotati... | 2017/09/28 | [
"https://Stackoverflow.com/questions/46470041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/951402/"
] | ```
var actualRotation = 215
var idealRotation = 225
var diff = abs(actualRotation - idealRotation);
if (diff > 20)
console.log(0);
else{
accuracy = 1 - (diff/ 20);
console.log(accuracy);
}
``` | The previous answers were good, but they don't handle the case where the difference crosses the zero-singularity.
E.g. when the angles are **5** and **355**, you expect a difference of 10, but a simple subtraction gives 350. To rectify this, subtract the angle from 360 if it is bigger than 180.
For the above to work,... |
35,993,377 | I want to bind sysdate function in my PDO prepared query :
```
$db = new PDO('oci:dbname=database;charset=UTF8', 'user', 'pass');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = $db->prepare('SELECT :func FROM DUAL');
$query->execute(array(':func' => 'SYSDATE()'));
var_dump($query->fetch());
`... | 2016/03/14 | [
"https://Stackoverflow.com/questions/35993377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2165216/"
] | Your example, *and* the provided answer "that works" is vulnerable to [SQL injection attacks](https://www.owasp.org/index.php/SQL_Injection). *Please* read up on this dangerous practice. I am therefore suggesting you do not use it.
You want to use a [`PreparedStatement`](http://docs.oracle.com/javase/tutorial/jdbc/ba... | Change `"select * from "+tableName+"where id='"+id+"'"` to `"select * from " + tableName + " where id='" + id + "'"`
Notice the space before where clause. |
10,793,673 | ```
deflator <- nominalGDP/realGDP
WARNINING MSG In Ops.factor(nominalGDP, realGDP)
```
The question is to get:
```
deflator = nominal/real
```
Use nominalGDP and realGDP to calculate deflator values.
You should end up with a numeric vector called deflator that looks like this:
```
> deflator
[1] 0.9628929 0.95... | 2012/05/29 | [
"https://Stackoverflow.com/questions/10793673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1422878/"
] | Your `realGDP` is of factor class. I think this is because you have comma as a decimal point and R treats it as factor (not numeric). You should use parameter `dec=','` when reading data or change commas to points in your input file. | The clue is at the end of the printed representation of `realGDP". It's a factor variable. You need to do this:
```
readGDP <- as.numeric(as.character(realGDP))
```
... then you will have two numeric vectors. |
122,766 | I have created a provider hosted app for a SharePoint Online site and want to use JavaScript for most of the front end logic, rather than ASP.NET MVC
I have run into Cross domain problems trying to query REST endpoints from the SharePoint Online domain. [this article](http://blogs.msdn.com/b/officeapps/archive/2012/11... | 2014/12/01 | [
"https://sharepoint.stackexchange.com/questions/122766",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/35609/"
] | I came across this scenario a little while back. If i'm not mistaken, I think you will need to 'create' an App Web as a proxy for your REST calls.
You also need to alter the AppManifest.xml to add the following entry:
`<Internal AllowedRemoteHostUrl="~remoteAppUrl"/>` in place of `<RemoteWebApplication ClientId="*" /... | You definitely need an app web, because you need to use `SP.RequestExecutor.js` to make the cross domain calls using javascript -- this depends on having an app web to perform the cross site communication.
Something else worth noting is that the terminology used sometimes can be confusing on the webs...
* HostWeb: yo... |
27,235,806 | I have been searching the web for a link to a good tutorial about what I am about to describe, but I haven't found it yet. My hope is that someone here already has an idea where to find it and can post a link to it here.
I want to know how to use OSGi/Equinox to build an application (game, business, or otherwise) that... | 2014/12/01 | [
"https://Stackoverflow.com/questions/27235806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3605835/"
] | You are looking for OSGi services. In OSGi you can register services in one bundle and use those services in another bundle. You can also track services that appear in an OSGi container and use them if they meet your needs.
There are many tutorials on the NET that explains how you can use OSGi services. E.g.: <http://... | The main OSGi API to look at to embed an OSGi framework into your application and then dynamically load OSGi bundle plugin libraries to be loaded is the `org.osgi.framework.launch.Framework`. You may find poking around the source code of my <https://github.com/vorburger/ch.vorburger.minecraft.osgi/> project of interest... |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | my millenial daughter uses the term FOMO. It's a person who suffers from a severe Fear Of Missing Out. | Possibly a little dated, but "[a man about town](http://www.dictionary.com/browse/man--about--town)" could be used. |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | [***Man About Town***](http://www.abbreviationfinder.org/fr/acronyms/mat_man-about-town.html)
>
> A man who frequently attends fashionable social functions, as in *Fred is quite the **man about town** these days*. This expression, first recorded in 1734, uses town in the sense of “a sophisticated place” as opposed to... | Possibly a little dated, but "[a man about town](http://www.dictionary.com/browse/man--about--town)" could be used. |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | gadabout
========
>
> A habitual pleasure-seeker.
>
>
>
I think this is a great, fun word that doesn't get enough play. | [***Man About Town***](http://www.abbreviationfinder.org/fr/acronyms/mat_man-about-town.html)
>
> A man who frequently attends fashionable social functions, as in *Fred is quite the **man about town** these days*. This expression, first recorded in 1734, uses town in the sense of “a sophisticated place” as opposed to... |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | gadabout
========
>
> A habitual pleasure-seeker.
>
>
>
I think this is a great, fun word that doesn't get enough play. | **Eventgoer** (or event-goer) — [Wiktionary](https://en.wiktionary.org/wiki/event-goer)
>
> One who attends an event.
>
>
>
This should work just like **partygoer** — [M-W](http://www.merriam-webster.com/dictionary/partygoer)
>
> a person who attends a party or who attends parties frequently
>
>
> "*chauffeur... |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | my millenial daughter uses the term FOMO. It's a person who suffers from a severe Fear Of Missing Out. | Perhaps [**bon vivant**](http://www.merriam-webster.com/dictionary/bon%20vivant) is what you're looking for?
>
> a person who likes going to parties and other social occasions and who enjoys good food, wine, etc.
>
>
> |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | **event**eur - from **entrepre**neur | Perhaps [**bon vivant**](http://www.merriam-webster.com/dictionary/bon%20vivant) is what you're looking for?
>
> a person who likes going to parties and other social occasions and who enjoys good food, wine, etc.
>
>
> |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | [***Man About Town***](http://www.abbreviationfinder.org/fr/acronyms/mat_man-about-town.html)
>
> A man who frequently attends fashionable social functions, as in *Fred is quite the **man about town** these days*. This expression, first recorded in 1734, uses town in the sense of “a sophisticated place” as opposed to... | Perhaps [**bon vivant**](http://www.merriam-webster.com/dictionary/bon%20vivant) is what you're looking for?
>
> a person who likes going to parties and other social occasions and who enjoys good food, wine, etc.
>
>
> |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | my millenial daughter uses the term FOMO. It's a person who suffers from a severe Fear Of Missing Out. | Glitterati popped into my head, although it might just apply to the smartly dressed attendees. |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | You may be looking for **party animal**
>
> (informal) someone who enjoys parties and party activities very much and goes to as many as possible: *Sarah's a real party animal - she likes to dance all night.* — [Cambridge](http://dictionary.cambridge.org/dictionary/english/party-animal)
>
>
> | Possibly a little dated, but "[a man about town](http://www.dictionary.com/browse/man--about--town)" could be used. |
322,524 | I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)
**Edit**
The word will serve as a new term t... | 2016/04/29 | [
"https://english.stackexchange.com/questions/322524",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/172861/"
] | You may be looking for **party animal**
>
> (informal) someone who enjoys parties and party activities very much and goes to as many as possible: *Sarah's a real party animal - she likes to dance all night.* — [Cambridge](http://dictionary.cambridge.org/dictionary/english/party-animal)
>
>
> | [***Man About Town***](http://www.abbreviationfinder.org/fr/acronyms/mat_man-about-town.html)
>
> A man who frequently attends fashionable social functions, as in *Fred is quite the **man about town** these days*. This expression, first recorded in 1734, uses town in the sense of “a sophisticated place” as opposed to... |
12,901,021 | I am making a quiz program in c for a school project.I was storing question and answers in a text file.The text file contains 1 question and followed by 4 choices and a correct answer(each in a new line) and so on.The code for file handling is
```
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12901021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1747872/"
] | It's difficult to say without seeing your input file, but I suspect that your array declarations are backwards. For example, you have:
```
char ques[500][20];
```
This declares an array of 500 elements, where each element can be up to 20 characters. You probably want:
```
char ques[20][500];
```
This declares a... | There are several problems here but your immediate problem is this:
```
strcpy(anse[ans5],line);
```
(And all the other strcpy calls like it.)
You are copying line to the array beginning at anse[1][0]. If line contains more than 20 characters, it will overwrite memory past the end of anse. For example, if line cont... |
33,921,445 | I try to figure out which direction the user have "mousewheeled" using a binding on a `mousewheel` event for my element.
You can see in the following snippet, when mousewheeling your mouse over the grey rectangle, the event is triggered.
[**JSFiddle**](https://jsfiddle.net/qexb1207/)
**HTML**
```
<div class="rect... | 2015/11/25 | [
"https://Stackoverflow.com/questions/33921445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3753055/"
] | The properties wheelDelta and detail are what you need, as below:
```
if (event.originalEvent.wheelDelta > 0 || event.originalEvent.detail < 0) {
// Scroll up
}
else {
// Scroll down
}
```
I've updated your [jsfiddle](https://jsfiddle.net/qexb1207/1/) with this code.
Also, note that the **mousewheel** event... | ```
$(document).ready(function(){
$('#foo').bind('mousewheel', function(e){
if(e.originalEvent.wheelDelta > 0) {
$(this).text('scrolling up !');
}
else{
$(this).text('scrolling down !');
}
});
});
```
Watch this : [Get mouse wheel events in jQuery?](htt... |
22,624,666 | I am simply trying to get a program to write "Test" to a created file. However, when I run the code below there is no file in the working directory. I am running this code on a Mac and compiling using gcc from Terminal.
```
// writing on a text file
#include <iostream>
#include <fstream>
using namespace std;
int ... | 2014/03/25 | [
"https://Stackoverflow.com/questions/22624666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2260346/"
] | The problem your facing is that your CSS code is not adressing the < a >s because they have a different className. Two options:
#1 - Switch the classNames in your CSS file:
```
.unslider-arrow.prev {...}
.unslider-arrow.next {...}
```
#2 - Switch the classes in the < a >s to the ones you're using in your CSS file:
... | Please check my unslider.com example html file:
```
<!-- The HTML -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Unslider.com example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://ajax.googleapis.com/ajax/l... |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | **Check your version editor and correct it**
[](https://i.stack.imgur.com/svT7P.png)
[](https://i.stack.imgur.com/C0hk3.png) | You should import the View Class you want to Test. Then put the cursor in the test method. |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | Had the same issue on Xcode 8.3.
I have removed the `tearDown` method
```
override func tearDown() {
super.tearDown()
}
```
As didn't need to use it. As soon as I added it back the record button was enabled. | It immediately came back when I switched to the right scheme. Ensure that you're on the `UI testing` scheme as the UI test recorder can't work on any other one. |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | To enable the red button, you have to have the cursor on the test method:
[](https://i.stack.imgur.com/tADAo.gif) | I did a few things to enable my record button:
1. (Optional, Recommended) - Delete all TEST schemes and TEST targets for your project, start fresh by creating a new UITest Target.
2. Make sure that your UITest scheme and main project run scheme point to the same target.
3. Try deleting your other UITest schemes if the... |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | A test method has to begin with the word `test` for Xcode to recognize it and allow recording when the cursor is inside the method.
One indication that Xcode recognized the method is a rhombus appearing left to the method name:
[](https://i.stack.img... | When I created a UITest Target, a new scheme was not simultaneously created. So, I had to create a new scheme with the test target that I had created. This enabled the record button. |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | FWIW: I had this problem and it turns out I was trying to run the simulator in the wrong OS.
I was trying to use iOS 8, and UITesting only works in iOS 9+.
Switch the simulator version, and the record button appears. | This is kind of silly, but missed out in some articles I read.
Make sure you have a UITesting Target, a regular Test target didn't do it for me. |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | To enable the red button, you have to have the cursor on the test method:
[](https://i.stack.imgur.com/tADAo.gif) | **Check your version editor and correct it**
[](https://i.stack.imgur.com/svT7P.png)
[](https://i.stack.imgur.com/C0hk3.png) |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | FWIW: I had this problem and it turns out I was trying to run the simulator in the wrong OS.
I was trying to use iOS 8, and UITesting only works in iOS 9+.
Switch the simulator version, and the record button appears. | Be sure to only have one subclass of `XCTestCase` per file. You want the filename and class names to match.
In my experience, even when you have UI tests working, if you add a new subclass of your working XCTestCase subclass in the same file, the record button will be disabled (although all other testing UI will conti... |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | I had the same issue and my setup was correct, iOS >= 9.0, target was added.
The problem was Xcode indexing which took for a while (about 1h), after indexing was done, recording button becomes active. | For me, the problem was the "Version Editor" pane was open. As soon as I switched back to the Assistant Editor, it worked. |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | FWIW: I had this problem and it turns out I was trying to run the simulator in the wrong OS.
I was trying to use iOS 8, and UITesting only works in iOS 9+.
Switch the simulator version, and the record button appears. | Had the same issue on Xcode 8.3.
I have removed the `tearDown` method
```
override func tearDown() {
super.tearDown()
}
```
As didn't need to use it. As soon as I added it back the record button was enabled. |
31,874,868 | I work with **RDBMS MySQL** version:
```
+------------+
| version() |
+------------+
| 5.5.24-log |
+------------+
```
In this database I have two tables `dotablezones` and `dotableusers`.
I have problem with one query JOIN on this two tables.
If tried this simple SELECT query on MySQL I have the right output:
... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3969244/"
] | I got stuck on this for a while too. In order to record, you have to be in a class that Xcode recognizes as containing tests. Add a file to your UI testing target with something like:
```
import Foundation
import XCTest
class MyTests: XCTestCase {
func testSomething() {
}
}
```
Save the file, clean your pr... | **Check your version editor and correct it**
[](https://i.stack.imgur.com/svT7P.png)
[](https://i.stack.imgur.com/C0hk3.png) |
47,543,754 | I have calculated SIFT descriptors for Image A and B with python 2.7 using openCV python.
Image A has 16X128 (=2048) descriptors and Image B has 10X128 (=1280).
now I got stuck because I don't know how to generate a similarity score.
I would appreciate you if you can help me.
score or similarity term is the measuremen... | 2017/11/29 | [
"https://Stackoverflow.com/questions/47543754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1647014/"
] | The number of SIFT descriptors in an image varies with different images as the key points detected across different images varies. In your case, Image A has 16 key points and Image B has 10 key points. A SIFT descriptor of 128 values is computed for each key point and so you get a total of 2048 and 1280 descriptor valu... | If you are trying to develop a dissimilarity function between images, you should probably be looking at **global** rather than **local** descriptors (SIFT is a local one). E.g., [GIST](http://people.csail.mit.edu/torralba/code/spatialenvelope/) or [CENTRIST](http://dovgalecs.com/blog/centrist-visual-descriptor-for-indo... |
39,029 | Why we require high voltage swing at the output of line drivers? ( My knowledge in this area is limited and please correct me if am asking an irrelevant question ) just like + or - 15V at the output of a line driver even though the pro audio line voltage swing is only 3.47Vpp ?[. That never happens in the real world.. 0 on the meters is an averaged level, so with real-world audio signals you will have peaks far higher than 0VU.
A peak of +20 (+24 dBu) wou... | 600 ohm line driver IC's such as the SSM2142 have supply rails of +/- 18 vdc. The output voltage of this IC is +/- 10 volts into a 600 ohm load. These are often use for long signal runs, such as a 100 foot 'snake' from stage to mixer, or in some studios. This wide voltage helps over come EMI noise and 'ghost' sounds fr... |
38,967,721 | I want to display top rated products in magento 2
My block Toprated.php
```
public function getTesting()
{
$collection = $this->_productCollectionFactory->create();
foreach($collection as $eachColl)
{
$storeId = $eachColl->getStore()->getId();
$reviewSum = $this->reviewSummaryFactory-... | 2016/08/16 | [
"https://Stackoverflow.com/questions/38967721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Where do you want to show the new block ?
It is possible by edit/add a layout file in view/frontend/layout/
```
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<refer... | create layout file in view -> frontend -> templates -> layout ,
file name should be your routname\_controllernamespace\_controllername (controller->Index->index.php)
ex. blog\_index\_index file should be look like this
`<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"... |
63,855 | Got a bike 3 weeks ago. It now slips gears WITHOUT shifting. only slipping when I pedal hard or uphill.. It shifts good. I weigh 250lbs.
edit: with a new derailleur | 2019/08/26 | [
"https://bicycles.stackexchange.com/questions/63855",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/45080/"
] | Even if a derailleur appears to shift well, it could be out of adjustment. My shifter cable recently snapped and I replaced it. I put on a new one, and after adjusting it to the point of the shifting being "good", there was still some skipping when pedaling up a steep hill; some finer adjusting took care of it (while a... | I'm guessing that this is a used bike as you specifically point out it has a new derailleur.
The most likely cause is worn chain and sprockets. When you pedal hard you are literally pulling the chain off of the sprocket teeth. A new derailleur won't do anything to fix this.
Another possibility of ghost shifting - whe... |
63,855 | Got a bike 3 weeks ago. It now slips gears WITHOUT shifting. only slipping when I pedal hard or uphill.. It shifts good. I weigh 250lbs.
edit: with a new derailleur | 2019/08/26 | [
"https://bicycles.stackexchange.com/questions/63855",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/45080/"
] | Even if a derailleur appears to shift well, it could be out of adjustment. My shifter cable recently snapped and I replaced it. I put on a new one, and after adjusting it to the point of the shifting being "good", there was still some skipping when pedaling up a steep hill; some finer adjusting took care of it (while a... | what about your gear or sprocket . is there any clogs or it might been use for so long and have misalignment or become gear too sharp as when you pedaling it hard easily make the chain loose .. a picture of it will help to understand |
63,855 | Got a bike 3 weeks ago. It now slips gears WITHOUT shifting. only slipping when I pedal hard or uphill.. It shifts good. I weigh 250lbs.
edit: with a new derailleur | 2019/08/26 | [
"https://bicycles.stackexchange.com/questions/63855",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/45080/"
] | I'm guessing that this is a used bike as you specifically point out it has a new derailleur.
The most likely cause is worn chain and sprockets. When you pedal hard you are literally pulling the chain off of the sprocket teeth. A new derailleur won't do anything to fix this.
Another possibility of ghost shifting - whe... | what about your gear or sprocket . is there any clogs or it might been use for so long and have misalignment or become gear too sharp as when you pedaling it hard easily make the chain loose .. a picture of it will help to understand |
33,679,789 | I have this short all in one Angular script
```
<script src="http://code.angularjs.org/1.2.14/angular.min.js"></script>
<script>
var myApp = angular.module('myApp', []);
myApp.controller('MainController', ['$scope', '$http', function($scope, $http) {
var getContent = function(filename){
var fc = 'empty'... | 2015/11/12 | [
"https://Stackoverflow.com/questions/33679789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5472754/"
] | $http.get sends an asynchronous request to the server. It does not wait for the response. Function getContents continues and returns 'empty'. After a while, when the response arrives, fc = data is executed, but this is not assigned to $scope.content.
Instead, getContents should return a promise object and the caller s... | Your function returns a promise, not the result of the function itself as that is executed asynchronously.
You want something close to:
```
getContent($scope.filename).then(function(response){ $scope.content = response; });
```
As a side note, it is better to avoid $scope, and to use the controllerAs syntax instead... |
53,369 | When someone says: `chotto matte te`, why does the `te` mean "... and I'll be back shortly". What's **the logic** behind it?
Why aren't there special expressions such as `chotto matte X`, where X could mean "I'll give food to my cat" or "I'll need sign an important document for Toyota" or "I'll fix my laptop which wa... | 2017/09/20 | [
"https://japanese.stackexchange.com/questions/53369",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/25785/"
] | ちょっと待ってて (chotto matte te) literally means "Keep waiting for a while (please)." That て (te) at the end does **not** mean "I'll be back shortly", at least grammatically.
ちょっと (chotto) just means "for a while", "a little", etc. 待ってて (matte te) is constructed as follows:
* **待つ** (matsu): simple intransitive verb, "to w... | >
> (1) chyotto matte tte
>
> (2) why does the tte mean "... and I'll be back shortly".
>
>
>
(1) ちょっと待{ま}ってって
↓
「ちょっと待{ま}って」って
↓
「ちょっと待って(ください)」って
↓
「ちょっと待って(ください)」と
↓
「ちょっと待って(ください)」と(私{わたし}が言{い}ってるのに、あなたはなぜ待ってくれないの?)
↓
「ちょっと待って(ください)」と(私が言ってるのに、あなたはなぜ待ってくれないの?)
「I'll be bac... |
53,369 | When someone says: `chotto matte te`, why does the `te` mean "... and I'll be back shortly". What's **the logic** behind it?
Why aren't there special expressions such as `chotto matte X`, where X could mean "I'll give food to my cat" or "I'll need sign an important document for Toyota" or "I'll fix my laptop which wa... | 2017/09/20 | [
"https://japanese.stackexchange.com/questions/53369",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/25785/"
] | >
> (1) chyotto matte tte
>
> (2) why does the tte mean "... and I'll be back shortly".
>
>
>
(1) ちょっと待{ま}ってって
↓
「ちょっと待{ま}って」って
↓
「ちょっと待って(ください)」って
↓
「ちょっと待って(ください)」と
↓
「ちょっと待って(ください)」と(私{わたし}が言{い}ってるのに、あなたはなぜ待ってくれないの?)
↓
「ちょっと待って(ください)」と(私が言ってるのに、あなたはなぜ待ってくれないの?)
「I'll be bac... | * ちょっと待っていてください -> ちょっと待っていて -> ちょっと待ってて(chotto matte te)
* ちょっと待ってと言っているでしょう -> ちょっと待ってと -> ちょっと待ってって(chotto matte tte)
These two phrase are similar, but not the same. |
53,369 | When someone says: `chotto matte te`, why does the `te` mean "... and I'll be back shortly". What's **the logic** behind it?
Why aren't there special expressions such as `chotto matte X`, where X could mean "I'll give food to my cat" or "I'll need sign an important document for Toyota" or "I'll fix my laptop which wa... | 2017/09/20 | [
"https://japanese.stackexchange.com/questions/53369",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/25785/"
] | >
> (1) chyotto matte tte
>
> (2) why does the tte mean "... and I'll be back shortly".
>
>
>
(1) ちょっと待{ま}ってって
↓
「ちょっと待{ま}って」って
↓
「ちょっと待って(ください)」って
↓
「ちょっと待って(ください)」と
↓
「ちょっと待って(ください)」と(私{わたし}が言{い}ってるのに、あなたはなぜ待ってくれないの?)
↓
「ちょっと待って(ください)」と(私が言ってるのに、あなたはなぜ待ってくれないの?)
「I'll be bac... | It's short for ちょっと待っていて, literally "wait and stay there". There's nothing about coming back, but of course it is inferred. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.