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 |
|---|---|---|---|---|---|
2,003 | There have been a lot of one or two line answers (very brief) on the main site. Most of them, almost all of them IMO, only suggest one or two things to do and never explain why they would work. Though, such answers might be correct, but since sometimes they get upvoted and stick around longer, it is projecting an image... | 2017/11/02 | [
"https://interpersonal.meta.stackexchange.com/questions/2003",
"https://interpersonal.meta.stackexchange.com",
"https://interpersonal.meta.stackexchange.com/users/29/"
] | The [accepted answer](https://interpersonal.meta.stackexchange.com/a/2019/9053) says,
>
> Provide some evidence, experience or back-up for their suggestions
>
>
>
I'd like to reference [Good Subjective, Bad Subjective](https://stackoverflow.blog/2010/09/29/good-subjective-bad-subjective/) -- which suggests that g... | >
> Should we be more strict about one-line answers?
>
>
>
One line answer: If the answer is simply "Try this: ..." and there is no "irrefutable source" (Example: [Help Center > Answering](https://interpersonal.stackexchange.com/help/how-to-answer)) then we run the risk of going against [the purpose of the Stack E... |
14,326,870 | I have a vector of strings each containing last and first name of one or more authors. I would like to extract the last names of each author in each string. What I know is that the name that comes first is always the last name of an author (the first author), and the last names of the other authors are everything that ... | 2013/01/14 | [
"https://Stackoverflow.com/questions/14326870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1972884/"
] | ```
> sub(",.*$", "", strsplit(tutu, ";[ ]+")[[1]])
[1] "goulenok" "meune" "gossec" "dougados" "kahan" "allanore"
``` | This is a bit more blunt but also works:
```
sapply(unlist(lapply(strsplit(tutu, ";"), strsplit, ",")), "[", 1)
``` |
14,326,870 | I have a vector of strings each containing last and first name of one or more authors. I would like to extract the last names of each author in each string. What I know is that the name that comes first is always the last name of an author (the first author), and the last names of the other authors are everything that ... | 2013/01/14 | [
"https://Stackoverflow.com/questions/14326870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1972884/"
] | ```
> sub(",.*$", "", strsplit(tutu, ";[ ]+")[[1]])
[1] "goulenok" "meune" "gossec" "dougados" "kahan" "allanore"
``` | Here is an approach that uses the gsubfn package:
```
library(gsubfn)
unlist(strapplyc(tutu, "(?:^|;) *([^,]+)"))
``` |
14,326,870 | I have a vector of strings each containing last and first name of one or more authors. I would like to extract the last names of each author in each string. What I know is that the name that comes first is always the last name of an author (the first author), and the last names of the other authors are everything that ... | 2013/01/14 | [
"https://Stackoverflow.com/questions/14326870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1972884/"
] | Here is an approach that uses the gsubfn package:
```
library(gsubfn)
unlist(strapplyc(tutu, "(?:^|;) *([^,]+)"))
``` | This is a bit more blunt but also works:
```
sapply(unlist(lapply(strsplit(tutu, ";"), strsplit, ",")), "[", 1)
``` |
42,384,453 | I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-
```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);
In activity inside onc... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42384453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7279695/"
] | Like it was told to you in a comment, macros aren't functions. They are a token substitution mechanism. So you do not return from them as you would a function.
```
#define round(N) (((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5))
```
The changes I made include:
1. Making it an expression. This involves replacing the cu... | You don't need the `return` keyword, it's not a function. Get rid of it.
Quoting `C11`, chapter §6.8.6.4
>
> A `return` statement terminates execution of the **current function and returns control to
> its caller.** [...]
>
>
>
which is **not** the purpose of your MACRO definition. Inclusion of `return` keyword... |
42,384,453 | I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-
```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);
In activity inside onc... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42384453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7279695/"
] | Because after preprocessing, your code will look similar to that:
```
a[i] = { return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; }
```
If you like to stick to macro, declare it as:
```
#define round(N) ((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5)
```
But this is still not really correct because of int/float m... | Like it was told to you in a comment, macros aren't functions. They are a token substitution mechanism. So you do not return from them as you would a function.
```
#define round(N) (((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5))
```
The changes I made include:
1. Making it an expression. This involves replacing the cu... |
42,384,453 | I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-
```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);
In activity inside onc... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42384453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7279695/"
] | Macro-replacement is basically what it sounds like, it replaces the macro with the body of the macro, quite literally.
So when you have
```
a[i] = round(a[i]);
```
It will be replaced by
```
a[i] = { return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; };
```
That's not valid syntax. The right-hand side of an... | You don't need the `return` keyword, it's not a function. Get rid of it.
Quoting `C11`, chapter §6.8.6.4
>
> A `return` statement terminates execution of the **current function and returns control to
> its caller.** [...]
>
>
>
which is **not** the purpose of your MACRO definition. Inclusion of `return` keyword... |
42,384,453 | I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-
```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);
In activity inside onc... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42384453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7279695/"
] | Because after preprocessing, your code will look similar to that:
```
a[i] = { return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; }
```
If you like to stick to macro, declare it as:
```
#define round(N) ((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5)
```
But this is still not really correct because of int/float m... | Macro-replacement is basically what it sounds like, it replaces the macro with the body of the macro, quite literally.
So when you have
```
a[i] = round(a[i]);
```
It will be replaced by
```
a[i] = { return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; };
```
That's not valid syntax. The right-hand side of an... |
42,384,453 | I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-
```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);
In activity inside onc... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42384453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7279695/"
] | Because after preprocessing, your code will look similar to that:
```
a[i] = { return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; }
```
If you like to stick to macro, declare it as:
```
#define round(N) ((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5)
```
But this is still not really correct because of int/float m... | You don't need the `return` keyword, it's not a function. Get rid of it.
Quoting `C11`, chapter §6.8.6.4
>
> A `return` statement terminates execution of the **current function and returns control to
> its caller.** [...]
>
>
>
which is **not** the purpose of your MACRO definition. Inclusion of `return` keyword... |
42,384,453 | I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-
```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);
In activity inside onc... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42384453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7279695/"
] | If you insist on writing this yourself, you should replace the icky macro with a safer, cleaner function:
```
inline int int_round (double d)
{
return (int) ( d >= 0 ? d+0.5 : d-0.5 );
}
```
This should yield the very same machine code. | You don't need the `return` keyword, it's not a function. Get rid of it.
Quoting `C11`, chapter §6.8.6.4
>
> A `return` statement terminates execution of the **current function and returns control to
> its caller.** [...]
>
>
>
which is **not** the purpose of your MACRO definition. Inclusion of `return` keyword... |
42,384,453 | I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-
```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);
In activity inside onc... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42384453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7279695/"
] | Because after preprocessing, your code will look similar to that:
```
a[i] = { return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; }
```
If you like to stick to macro, declare it as:
```
#define round(N) ((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5)
```
But this is still not really correct because of int/float m... | If you insist on writing this yourself, you should replace the icky macro with a safer, cleaner function:
```
inline int int_round (double d)
{
return (int) ( d >= 0 ? d+0.5 : d-0.5 );
}
```
This should yield the very same machine code. |
26,176,451 | What is the regex to match the following strings:
```
base.string
a.base.string
b.base.string
cde.base.string
```
This should not match:
```
a.b.c.d.base.string
abase.string
bbase.string
cdebase.string
.base.string
```
I want to match and capture a, b, cde, and the empty string from "base.string"
(a, b, cde are ... | 2014/10/03 | [
"https://Stackoverflow.com/questions/26176451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60800/"
] | Nothing in `AbstractRoutingDataSource` forces you to use a static map of `DataSourceS`. It is up to you to contruct a bean implementing `Map<Object, Object>`, where key is what you use to select the `DataSource`, and value is a `DataSource` or (by default) a String referencing a JNDI defined data source. You can even m... | The datasource used by a thread might change from time to time.
Should pay attention to concurrency, applications might get concurrency issues in concurrent environment.
[thread-bound AbstractRoutingDataSource sample](https://spring.io/blog/2007/01/23/dynamic-datasource-routing/) |
26,176,451 | What is the regex to match the following strings:
```
base.string
a.base.string
b.base.string
cde.base.string
```
This should not match:
```
a.b.c.d.base.string
abase.string
bbase.string
cdebase.string
.base.string
```
I want to match and capture a, b, cde, and the empty string from "base.string"
(a, b, cde are ... | 2014/10/03 | [
"https://Stackoverflow.com/questions/26176451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60800/"
] | Nothing in `AbstractRoutingDataSource` forces you to use a static map of `DataSourceS`. It is up to you to contruct a bean implementing `Map<Object, Object>`, where key is what you use to select the `DataSource`, and value is a `DataSource` or (by default) a String referencing a JNDI defined data source. You can even m... | It can be achieved with AbstractRoutingDataSource and keeping the information in the thread-local Variable. Here is a beautiful working example you can refer to:
[Multi-tenancy: Managing multiple datasources with Spring Data JPA](https://stackoverflow.com/questions/49759672/multi-tenancy-managing-multiple-datasources-w... |
26,176,451 | What is the regex to match the following strings:
```
base.string
a.base.string
b.base.string
cde.base.string
```
This should not match:
```
a.b.c.d.base.string
abase.string
bbase.string
cdebase.string
.base.string
```
I want to match and capture a, b, cde, and the empty string from "base.string"
(a, b, cde are ... | 2014/10/03 | [
"https://Stackoverflow.com/questions/26176451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60800/"
] | The datasource used by a thread might change from time to time.
Should pay attention to concurrency, applications might get concurrency issues in concurrent environment.
[thread-bound AbstractRoutingDataSource sample](https://spring.io/blog/2007/01/23/dynamic-datasource-routing/) | It can be achieved with AbstractRoutingDataSource and keeping the information in the thread-local Variable. Here is a beautiful working example you can refer to:
[Multi-tenancy: Managing multiple datasources with Spring Data JPA](https://stackoverflow.com/questions/49759672/multi-tenancy-managing-multiple-datasources-w... |
55,067,835 | In the following solution [link](https://github.com/aspnet/SignalR-samples/tree/master/ChatSample/ChatSample) SignalR is installed version 1.0.1
SignalR does not appear in the list of NuGet packages so I don't know how to upgrade it. It appears under `SDK -> Microsoft.AspNetCore.App (2.1.1)` so it is installed as a de... | 2019/03/08 | [
"https://Stackoverflow.com/questions/55067835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/750216/"
] | ASP.NET Core SignalR is a component of ASP.NET Core, so you don't upgrade it separately. ASP.NET Core is bundled in the hosting platform. Therefore, to upgrade ASP.NET Core SignalR (or ASP.NET Core), you download a newer .NET SDK and build/run your app with the newer runtime (change `global.json`'s sdk section, if you ... | Try deleting the the signalR .dll files from the NugetFallbackFolder, I would then expect it to look for the relevant .dll files in the non-fallback folder |
66,323,872 | I have a bash script .sh file in which I am accessing a MySQL database that contains a table called "Foo". I am having trouble with the MySQL syntax to perform an update query to set the value in column "Bar" only if "Bar" exists in table "Foo" and else, update values in other columns in "Foo" without column "Bar". The... | 2021/02/22 | [
"https://Stackoverflow.com/questions/66323872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15223641/"
] | My issue came from the fact that for some reason, the lib does not prompt download when you put a local image inside of the pdf generated.
I had img/image.png inside of my pdf-content that is why it was not working. | The only problem is that you didnt import the js file into your html.
I added it and worked perfectly
```
<script src="script.js"></script>
``` |
17,287,250 | I have two different versions of python installed on my machine: 2.4 and 2.7. I'm trying to install OpenCV(2.4.5) for the 2.7 version.
```
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
```
It detects the python 2.4 as the current installa... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17287250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/624074/"
] | There are some Cmake flags which allow you to explicitly specify which version of Python to use. You will need to set the values of these flags to the correct location for your installation of Python.
The flag names and likely locations are below:
```
PYTHON_EXECUTABLE=/usr/bin/python2.7/
PYTHON_INCLUDE=/usr/include/... | Use [virtualenv](http://www.virtualenv.org/en/latest/)
```
virtualenv -p python2.7 env
source env/bin/activate
python --version # prints «Python 2.7.3»
pip install pyopencv
```
If you need support of 2.4 (or other version), just create new environment. |
17,287,250 | I have two different versions of python installed on my machine: 2.4 and 2.7. I'm trying to install OpenCV(2.4.5) for the 2.7 version.
```
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
```
It detects the python 2.4 as the current installa... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17287250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/624074/"
] | Use [virtualenv](http://www.virtualenv.org/en/latest/)
```
virtualenv -p python2.7 env
source env/bin/activate
python --version # prints «Python 2.7.3»
pip install pyopencv
```
If you need support of 2.4 (or other version), just create new environment. | This is a low-quality answer but it is still very useful if you have been trying for ten hours and need some new ideas.
---
This issue took me a day and I still am unsure how I solved it, but here are a few pointers in case the given answers alone don't help:
Originally, I was following [this guide](https://tutorial... |
17,287,250 | I have two different versions of python installed on my machine: 2.4 and 2.7. I'm trying to install OpenCV(2.4.5) for the 2.7 version.
```
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
```
It detects the python 2.4 as the current installa... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17287250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/624074/"
] | There are some Cmake flags which allow you to explicitly specify which version of Python to use. You will need to set the values of these flags to the correct location for your installation of Python.
The flag names and likely locations are below:
```
PYTHON_EXECUTABLE=/usr/bin/python2.7/
PYTHON_INCLUDE=/usr/include/... | This is a low-quality answer but it is still very useful if you have been trying for ten hours and need some new ideas.
---
This issue took me a day and I still am unsure how I solved it, but here are a few pointers in case the given answers alone don't help:
Originally, I was following [this guide](https://tutorial... |
50,719,808 | I am using 'translate3d' with 'transition' on hover to move a div into view.
This is working correctly upon hover, but on exit, I would like it to transition back to out of view. Currently, it just disappears.
Everything I have tried isn't working, so I was hoping someone may be able to point out the glaring mistake... | 2018/06/06 | [
"https://Stackoverflow.com/questions/50719808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2054343/"
] | Use `"transition: all 0.35s;"` instead of `"transition: transform 0.35s;"` on
```
a.box-item .text {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 20px;
... | Use `transition: transform 2s, opacity 1s 1s;` on .text element
```
transition: transform 2s, opacity 1s 1s;
a.box-item .text {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 20px;
margin: ... |
50,719,808 | I am using 'translate3d' with 'transition' on hover to move a div into view.
This is working correctly upon hover, but on exit, I would like it to transition back to out of view. Currently, it just disappears.
Everything I have tried isn't working, so I was hoping someone may be able to point out the glaring mistake... | 2018/06/06 | [
"https://Stackoverflow.com/questions/50719808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2054343/"
] | Use `"transition: all 0.35s;"` instead of `"transition: transform 0.35s;"` on
```
a.box-item .text {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 20px;
... | Use **"transition: all 0.35s;" instead of "transition: transform 0.35s;"**. it will work.
```
a.box-item .text {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 20px;
margin: 0;
opacity: ... |
170,522 | I see more and more articles about logging in JSON. You can also find one on NodeJS blog. Why does everyone like it so much? I can only see more operations getting involved:
* A couple new objects being created.
* Stringifying objects, which either involves calculating string length or multiple string allocations.
* G... | 2012/10/19 | [
"https://softwareengineering.stackexchange.com/questions/170522",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/53462/"
] | JSON logging gives you the ability to parse the log file programmatically even if the format **has changed in time**.
A good example is Apache logs. By default Apache uses `common` format for access.log:
```
"%h %l %u %t \"%r\" %>s %b"
```
Say that you have built an offline parser that takes one of those log files ... | If your machine runs so close to its limits that such issues really would matter, you most likely have more serious problems. While there may be exceptional situations where this makes some difference, many applications (maybe most) run on machines for which the difference if you log JSON, simple text or records to a d... |
60,589,111 | I am puzzled by this inheritance example found in a quizz from a Coursera Java course:
* class B is a subclass of class A
* class B `getPrefix()` method overrides class' A method
* class B `number` attribute overrides class' A attribute
```
class ClassA {
protected int number;
public ClassA() {
numbe... | 2020/03/08 | [
"https://Stackoverflow.com/questions/60589111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4541412/"
] | >
> Can you explain how come class A number attribute is printed, and not class B?
>
>
>
`ClassB` does not inherit `ClassA.number` field, but rather *hides* it.
---
See:
* [The Java™ Tutorials - Hiding Fields](https://docs.oracle.com/javase/tutorial/java/IandI/hidevariables.html)
>
> Within a class, a field t... | Yeah so you can override a method from a super class but you cannot declare another class member with the same name. You're creating a new class member with the name number. It would only refer to 10, the value from the super class #number if you used super.number instead of this.number. |
589,160 | I have already installed Windows XP Service Pack 3 and downloaded the sound and display driver from the manufacturer website but when I try and install it, I get an error message that it was not successfully installed and it demand Windows XP Service Pack 3 CD.
I don't have the Windows XP service pack 3 CD.
Is ther... | 2013/04/29 | [
"https://superuser.com/questions/589160",
"https://superuser.com",
"https://superuser.com/users/220736/"
] | You must run this as sudo:
```
# add-apt-repository ppa:gnome3-team/gnome3 && apt-get -f update
# apt-get -f install gdm gnome-shell gnome-tweak-tool
```
You will be asked to configure the display manager and you must choose gdm (however there is no need to uninstall lightdm, I still use it because I'm running plymo... | <http://www.webupd8.org/2013/03/gnome-38-beta-available-in-ppa-for.html>
I believe you can always go back to unity on login screen as well as uninstall installed packages. |
589,160 | I have already installed Windows XP Service Pack 3 and downloaded the sound and display driver from the manufacturer website but when I try and install it, I get an error message that it was not successfully installed and it demand Windows XP Service Pack 3 CD.
I don't have the Windows XP service pack 3 CD.
Is ther... | 2013/04/29 | [
"https://superuser.com/questions/589160",
"https://superuser.com",
"https://superuser.com/users/220736/"
] | Repositories
The way repositories are added and used on Ubuntu, is the main reason why I believe this distribution is the easiest and fastest way to give GS 3.8 a try. You basically need to add two more repos, or three if you are adventurous!
The first repository is the Gnome 3 Team repo that contains all things miss... | <http://www.webupd8.org/2013/03/gnome-38-beta-available-in-ppa-for.html>
I believe you can always go back to unity on login screen as well as uninstall installed packages. |
589,160 | I have already installed Windows XP Service Pack 3 and downloaded the sound and display driver from the manufacturer website but when I try and install it, I get an error message that it was not successfully installed and it demand Windows XP Service Pack 3 CD.
I don't have the Windows XP service pack 3 CD.
Is ther... | 2013/04/29 | [
"https://superuser.com/questions/589160",
"https://superuser.com",
"https://superuser.com/users/220736/"
] | Repositories
The way repositories are added and used on Ubuntu, is the main reason why I believe this distribution is the easiest and fastest way to give GS 3.8 a try. You basically need to add two more repos, or three if you are adventurous!
The first repository is the Gnome 3 Team repo that contains all things miss... | You must run this as sudo:
```
# add-apt-repository ppa:gnome3-team/gnome3 && apt-get -f update
# apt-get -f install gdm gnome-shell gnome-tweak-tool
```
You will be asked to configure the display manager and you must choose gdm (however there is no need to uninstall lightdm, I still use it because I'm running plymo... |
40,777,789 | I know this question has been asked in various ways before but I've read them all and I can't get it to work with the below:
Here is a doc example:
```
"_id" : ObjectId("583659c5be5f0e6f70c95633"),
"firstName" : "da",
"lastName" : "ksk",
"email" : "papap@aol.com",
"surveyResults" : [
{
"mouseTracking" : [... | 2016/11/24 | [
"https://Stackoverflow.com/questions/40777789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5645445/"
] | They are totally different concepts.
A remote is basically a location where a copy of the repository is stored. So for example you could have one remote in GitHub, another in BitBucket, another in Kelly's PC, etc.
A branch in your repository means that you have temporarily made some changes that you don't want to put... | Branches can be local or remote. Local branches are tracked by remote branches. |
40,777,789 | I know this question has been asked in various ways before but I've read them all and I can't get it to work with the below:
Here is a doc example:
```
"_id" : ObjectId("583659c5be5f0e6f70c95633"),
"firstName" : "da",
"lastName" : "ksk",
"email" : "papap@aol.com",
"surveyResults" : [
{
"mouseTracking" : [... | 2016/11/24 | [
"https://Stackoverflow.com/questions/40777789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5645445/"
] | To be precise here, let's use Git's own [documentation on What a Branch Is](https://git-scm.com/book/en/v1/Git-Branching-What-a-Branch-Is):
>
> A branch in Git is simply a lightweight movable pointer to one of these commits.
>
>
>
A branch in Git is just a pointer to a commit. Typically, this commit will in turn ... | Branches can be local or remote. Local branches are tracked by remote branches. |
40,777,789 | I know this question has been asked in various ways before but I've read them all and I can't get it to work with the below:
Here is a doc example:
```
"_id" : ObjectId("583659c5be5f0e6f70c95633"),
"firstName" : "da",
"lastName" : "ksk",
"email" : "papap@aol.com",
"surveyResults" : [
{
"mouseTracking" : [... | 2016/11/24 | [
"https://Stackoverflow.com/questions/40777789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5645445/"
] | To be precise here, let's use Git's own [documentation on What a Branch Is](https://git-scm.com/book/en/v1/Git-Branching-What-a-Branch-Is):
>
> A branch in Git is simply a lightweight movable pointer to one of these commits.
>
>
>
A branch in Git is just a pointer to a commit. Typically, this commit will in turn ... | They are totally different concepts.
A remote is basically a location where a copy of the repository is stored. So for example you could have one remote in GitHub, another in BitBucket, another in Kelly's PC, etc.
A branch in your repository means that you have temporarily made some changes that you don't want to put... |
60,086,509 | It is taking 40+ minutes to move a 20G file to a google bucket using the java storage api. It took 4 minutes when using gsutil cp. Any idea where I might be going wrong with the java storage api?
First attempt with Java API.
```
BlobInfo blobInfo = null;
try (BufferedInputStream inputStream = new BufferedInpu... | 2020/02/06 | [
"https://Stackoverflow.com/questions/60086509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12848908/"
] | GSutil has built in feature for optimizing the large file upload, especially by splitting it and by sending in parallel several parts to optimize the bandwidth.
More detail [here](https://cloud.google.com/blog/products/gcp/optimizing-your-cloud-storage-performance-google-cloud-performance-atlas)
Similar features are ... | You have to increase the buffer size.
With a 100MB buffer I am reaching an upload rate of 120MB/s. |
9,733,696 | I am using ASIFormDataRequest to send a POST request and at the same time upload a couple pictures. Strangely, the same request just worked fine on emulator but not on the real device. And I am getting 400 returned from server side for the device one. From what I can tell the only difference is that on the emulator the... | 2012/03/16 | [
"https://Stackoverflow.com/questions/9733696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/180862/"
] | Please go through the following links :
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>
<http://en.wikipedia.org/wiki/List_of_HTTP_status_codes>
<http://www.checkupdown.com/status/E400.html>
<http://www.codestyle.org/sitemanager/FAQ.shtml#correct400>
Hope this might help you.............. | I am not sure what your problem is but you shouldnt encounter any difference between taking the photo from the camera or the album. Anyway, I would suggest you change ASIHttp, which is discontinued, by another similar one such as AFNetworking (https://github.com/AFNetworking/AFNetworking). |
160,206 | I don't get what this phrase means. I tried googling it, but the answers weren't satisfactory.
Could someone please tell me its meaning? I'm guessing it has something to do with TV shows (I first saw it [here:](http://www.urbandictionary.com/define.php?term=nuke%20the%20fridge) in the Urban Dictionary.) | 2014/03/27 | [
"https://english.stackexchange.com/questions/160206",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/49094/"
] | It refers to a previously well-regarded series (of films, television shows, books etc) suddenly including a very strange or illogical event. Such an event is often interpreted as an indicator that the series has lost its way and declined in quality.
The name comes from a scene in the fourth "Indiana Jones" film, "Indi... | [*Nuke the Fridge Con*](http://www.yelp.com/biz/nuke-the-fridge-con-rowland-heights) is a sponsor of comic book/media "conventions". The show itself usually occurs twice a week - on Wednesdays and Saturdays - making it more of a collectibles swap-meet/flea-market than an actual convention.
The TV/Movie trope, [Nuke t... |
44,417 | I've been playing violin for four years now and every now and then the bow will get stuck on the strings and not move or produce a sound that doesn't sound right. I don't know whether it's a humidity thing or if I'm the one to blame.
Any suggestions welcome.
:) | 2016/05/13 | [
"https://music.stackexchange.com/questions/44417",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/28581/"
] | First of all, there are many muscles and membranes and other tissues involved in the process of singing - from the muscles that control the diaphragm to the muscles that control parts of your face and tongue and all points in between. And all muscles and tissues in the human body tend to atrophy and lose elasticity as ... | The vocal folds and related musculature change with age, as do all tissues in the body. Excercise will help maintain muscle tone, muscle mass, and tissue flexibility, but it is impossible to maintain your range forever, just as it is impossible for an athlete to maintain the same level of performance forever. |
38,954,843 | Its baffling how one get host ip address on windows (boot2docker) by just issuing this command: docker-machine ip
But same doesn't work on ubuntu using same command. It always says :
"docker-machine: command not found"
Any idea on why its not working? or is there different command to find the host ip while running ub... | 2016/08/15 | [
"https://Stackoverflow.com/questions/38954843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1785231/"
] | Instead of using docker-machine commands you could use regular docker commands.
For example if you run the following container
```
docker run --name some-postgres -p 5432:5432 -d postgres
```
You can access the container through localhost in port 5432 or you can use docker inspect to find the containers IP
```
doc... | If you need to install docker-machine, the installation instructions are on [the release page](https://github.com/docker/machine/releases/). So for the 0.8 release, the install command is:
```
curl -L https://github.com/docker/machine/releases/download/v0.8.0/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker... |
567,383 | In the newest release of Dropbox, the background of the icon is black (in the system tray). So no matter which theme you use, unless it's a black theme, the icon looks awful. Does anyone know the cause? | 2014/12/31 | [
"https://askubuntu.com/questions/567383",
"https://askubuntu.com",
"https://askubuntu.com/users/160725/"
] | (Are you using nvidia drivers? from <http://crunchbang.org/forums/viewtopic.php?id=38154&p=2>, slightly updated)
This happens because nvidia driver overrode OpenGL library (libGL.so). This workaround works for me on kubuntu 14.04 [and linux mint 17].
1) close dropbox session
```
$ dropbox stop
```
2) find your nvi... | Are you using `LC_NUMERIC=C`?
Open a terminal and try the following:
```
dropbox stop
export LC_NUMERIC=es_ES (Put here your language)
dropbox start
```
That work for me. |
54,088,171 | I am creating a customer registration rest service using ballerina and the use case related to this is when the customer get registered successfully I need to send a sms to the customer.When I used the Twilio Connector in ballerina to send the sms I get the following error.
```
404 Not Found-:The requested resource /2... | 2019/01/08 | [
"https://Stackoverflow.com/questions/54088171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8532014/"
] | You forgot about one little but important detail: The [JavaScript modifier](https://www.regular-expressions.info/javascript.html) `g`. You might want to consider `i` for case insensitivity as well. | for me this is the one its worked
```
pasteCleanup: {
custom: function (html)
{
html = html.replace(/<\s*br\/*>/gi, '');
html = html.replace(/<\s*a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 (Link - $1) ");
html = html... |
12,287,790 | If I have a string like **MCCORMIC 3H R Final 08-26-2011.dwg** or even **MCCORMIC SMITH 2N L Final 08-26-2011.dwg** and I wanted to capture the **R** in the first string or the **L** in the second string in a variable, what is the best method for doing so? I was thinking about trying the below statement but it does not... | 2012/09/05 | [
"https://Stackoverflow.com/questions/12287790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/947119/"
] | Just split by space:
```
var parts = filename.Split(new [] {' '},
StringSplitOptions.RemoveEmptyEntries);
WhichArea = parts[parts.Length - 3];
```
It looks like the file names have a very specific format, so this will work just fine.
Even with any number of spaces, using `StringSplitOp... | I had to do something similar, but with Mirostation drawings instead of Autocad. I used regex in my case. Here's what I did, just in case you feel like making it more complex.
```
string filename = "MCCORMIC 3H R Final 08-26-2011.dwg";
string filename2 = "MCCORMIC SMITH 2N L Final 08-26-2011.dwg";
Console.WriteLine(... |
12,287,790 | If I have a string like **MCCORMIC 3H R Final 08-26-2011.dwg** or even **MCCORMIC SMITH 2N L Final 08-26-2011.dwg** and I wanted to capture the **R** in the first string or the **L** in the second string in a variable, what is the best method for doing so? I was thinking about trying the below statement but it does not... | 2012/09/05 | [
"https://Stackoverflow.com/questions/12287790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/947119/"
] | Just split by space:
```
var parts = filename.Split(new [] {' '},
StringSplitOptions.RemoveEmptyEntries);
WhichArea = parts[parts.Length - 3];
```
It looks like the file names have a very specific format, so this will work just fine.
Even with any number of spaces, using `StringSplitOp... | I don't think [Oded's answer](https://stackoverflow.com/a/12287810/388664) covers all cases. The first example has two words before the wanted letter, and the second one has three words before it.
My opinion is that the best way to get this letter is by using RegEx, assuming that the word `Final` always comes after th... |
48,021,889 | I would like to use the old value of a cell to calculate its new value (hence, the equivalent of the '+=' operator in programming languages) while using excel solver.
How can I achieve that ? What do I have to write in the cell ?
Thanks.
EDIT : as it seems the question is not that clear, I will expand it. So here is... | 2017/12/29 | [
"https://Stackoverflow.com/questions/48021889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8252462/"
] | You just need to group by `agentId` and month\_year:
```
SELECT
AgentID,
FORMAT(CompletedDate,'MMMM yyyy') as MonthYear,
COUNT(CASE WHEN TypeID=50 then 1 ELSE NULL END) as "Type1",
COUNT(CASE WHEN TypeID=51 then 1 ELSE NULL END) as "Type2",
COUNT(*) AS Total
FROM RAW_DATA
group by AgentID, FORMAT(Complete... | Just add Count(\*) as "monthelyAgentcount" in your query ie
```
SELECT AgentID,FORMAT(CompletedDate,'MMMM yyyy') as Date,datepart(year,CompletedDate) YearNr,datepart(month,CompletedDate) MonthNr,
COUNT(CASE WHEN TypeID=50 then 1 ELSE NULL END) as "Type1",
COUNT(CASE WHEN TypeID=51 then 1 ELSE NULL END) as ... |
6,758,081 | How can I set the `innerHTML`, or the whole content of an HTML document using javascript?
For example my document would look like this:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6758081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | If you don't want to use innerHTML you could use `document.write(newDocument);`.
If the document hasn't completely loaded, you'll need to put `document.open()` as well (thanks bažmegakapa). | `document.innerHTML` is new in HTML5 and isn’t supported in all browsers.
`document.documentElement` refers to the root element of your document, which in this case is the `<html>` element.
So, you could set `document.documentElement.innerHTML`. Note that since the DOCTYPE falls outside of that, so there’s no need to... |
6,758,081 | How can I set the `innerHTML`, or the whole content of an HTML document using javascript?
For example my document would look like this:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6758081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | `document.innerHTML` is new in HTML5 and isn’t supported in all browsers.
`document.documentElement` refers to the root element of your document, which in this case is the `<html>` element.
So, you could set `document.documentElement.innerHTML`. Note that since the DOCTYPE falls outside of that, so there’s no need to... | Use this code (after current document has been loaded) :
```
document.open("text/html", "replace");
document.write(htmlCode); // htmlCode is the variable you called newDocument
document.close();
```
Live exemple here :
<http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_doc_open>
hope this help ;) |
6,758,081 | How can I set the `innerHTML`, or the whole content of an HTML document using javascript?
For example my document would look like this:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6758081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | `document.innerHTML` is new in HTML5 and isn’t supported in all browsers.
`document.documentElement` refers to the root element of your document, which in this case is the `<html>` element.
So, you could set `document.documentElement.innerHTML`. Note that since the DOCTYPE falls outside of that, so there’s no need to... | Simple:
```
document.body.parentElement.innerHTML = '<html><body><div>Your code</div></body></html>';
```
Note that it will not interpret js code embedded in your html code. |
6,758,081 | How can I set the `innerHTML`, or the whole content of an HTML document using javascript?
For example my document would look like this:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6758081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | If you don't want to use innerHTML you could use `document.write(newDocument);`.
If the document hasn't completely loaded, you'll need to put `document.open()` as well (thanks bažmegakapa). | Use this code (after current document has been loaded) :
```
document.open("text/html", "replace");
document.write(htmlCode); // htmlCode is the variable you called newDocument
document.close();
```
Live exemple here :
<http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_doc_open>
hope this help ;) |
6,758,081 | How can I set the `innerHTML`, or the whole content of an HTML document using javascript?
For example my document would look like this:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6758081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | If you don't want to use innerHTML you could use `document.write(newDocument);`.
If the document hasn't completely loaded, you'll need to put `document.open()` as well (thanks bažmegakapa). | Simple:
```
document.body.parentElement.innerHTML = '<html><body><div>Your code</div></body></html>';
```
Note that it will not interpret js code embedded in your html code. |
6,758,081 | How can I set the `innerHTML`, or the whole content of an HTML document using javascript?
For example my document would look like this:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6758081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552067/"
] | Use this code (after current document has been loaded) :
```
document.open("text/html", "replace");
document.write(htmlCode); // htmlCode is the variable you called newDocument
document.close();
```
Live exemple here :
<http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_doc_open>
hope this help ;) | Simple:
```
document.body.parentElement.innerHTML = '<html><body><div>Your code</div></body></html>';
```
Note that it will not interpret js code embedded in your html code. |
33,414,045 | I am working with C# and i am loading a jquery file 1.8.1 in the layout, but there is a module pulling through which is adding another jquery file 1.6.1 is there any way for me to remove it without physically going in and remove it so i need to remove it dynamically.
Thanks. | 2015/10/29 | [
"https://Stackoverflow.com/questions/33414045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4453130/"
] | You are changing the `src` attribute of the `<div class="image_cell" id="1">`, which is non-existent. What you want to do is to access its child node (the `<img>`) instead:
```
document.getElementById("1").querySelector("img").src = "StarOn.gif";
``` | jsFiddle : <https://jsfiddle.net/CanvasCode/z1fru5f0/>
You need to assign your img tags the id and not the div, if you assign the divs the id then you need to check its childNodes.
Html
```
<div class="image_line" >
<div class="image_cell">
<img id="1" src ="http://www.gamingevolution.info/screenshots/ma... |
33,414,045 | I am working with C# and i am loading a jquery file 1.8.1 in the layout, but there is a module pulling through which is adding another jquery file 1.6.1 is there any way for me to remove it without physically going in and remove it so i need to remove it dynamically.
Thanks. | 2015/10/29 | [
"https://Stackoverflow.com/questions/33414045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4453130/"
] | You are changing the `src` attribute of the `<div class="image_cell" id="1">`, which is non-existent. What you want to do is to access its child node (the `<img>`) instead:
```
document.getElementById("1").querySelector("img").src = "StarOn.gif";
``` | I noticed that `correct_answer` is a Number so I converted it to a String (using `toString`) so it can be used to match the `.image_cell` `id`. I added an `input` to demonstrate it actually functions.
See Snippet
```js
var correct_answer = 0;
function starOn(correct_answer) {
var x = correct_answer.toString();
... |
33,414,045 | I am working with C# and i am loading a jquery file 1.8.1 in the layout, but there is a module pulling through which is adding another jquery file 1.6.1 is there any way for me to remove it without physically going in and remove it so i need to remove it dynamically.
Thanks. | 2015/10/29 | [
"https://Stackoverflow.com/questions/33414045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4453130/"
] | You assigned the id to the div tag, but you need to assign the id to the img tag. Then you should get the reference to the image and can then change its src:
`<div class="image_cell">
<img src ="StarOff.gif" id="1"/>
</div>` | jsFiddle : <https://jsfiddle.net/CanvasCode/z1fru5f0/>
You need to assign your img tags the id and not the div, if you assign the divs the id then you need to check its childNodes.
Html
```
<div class="image_line" >
<div class="image_cell">
<img id="1" src ="http://www.gamingevolution.info/screenshots/ma... |
33,414,045 | I am working with C# and i am loading a jquery file 1.8.1 in the layout, but there is a module pulling through which is adding another jquery file 1.6.1 is there any way for me to remove it without physically going in and remove it so i need to remove it dynamically.
Thanks. | 2015/10/29 | [
"https://Stackoverflow.com/questions/33414045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4453130/"
] | You assigned the id to the div tag, but you need to assign the id to the img tag. Then you should get the reference to the image and can then change its src:
`<div class="image_cell">
<img src ="StarOff.gif" id="1"/>
</div>` | I noticed that `correct_answer` is a Number so I converted it to a String (using `toString`) so it can be used to match the `.image_cell` `id`. I added an `input` to demonstrate it actually functions.
See Snippet
```js
var correct_answer = 0;
function starOn(correct_answer) {
var x = correct_answer.toString();
... |
25,643,509 | I have a working ORM and been able to map objects to my database. So its up an running.
I've created a web service that looks like this:
```
@Stateless
@Path("user")
@LocalBean
public class userFacade {
@PersistenceContext(unitName = "Fakebook3")
private EntityManager em;
public userFacade() {
// TODO Auto-gene... | 2014/09/03 | [
"https://Stackoverflow.com/questions/25643509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4003818/"
] | There has been PR to the framework exactly for this: <https://github.com/laravel/framework/pull/4267>
```
$b = B::find($id);
$as = A::hasIn('relationB', $b)->get();
```
However Taylor didn't merge it, so you need `whereHas`:
```
// to get all As related to B with some value
$as = A::whereHas('relationB', function ... | `A::has('B')->get();`
As shown in the laravel docs: <http://laravel.com/docs/eloquent#querying-relations> |
10,693,955 | I am using the new Web API bits in a project, and I have found that I cannot use the normal `HttpMessageRequest`, as I need to add client certificates to the request. As a result, I am using the `HttpClient` (so I can use `WebRequestHandler`). This all works well, except that it isn't stub/mock friendly, at least for R... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10693955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443927/"
] | As an alternative to the excellent ideas already presented by @Raj, it may be possible to go a step lower and to mock/fake the `HttpMessageHandler` instead.
If you make any class that needs an `HttpClient` accept it as a dependency injection parameter in the constructor, then when unit testing you can pass in an `Http... | I use Moq and I can stub out the HttpClient. I think this the same for Rhino Mock (I haven’t tried by myself).
If you just want to stub the HttpClient the below code should work:
```cs
var stubHttpClient = new Mock<HttpClient>();
ValuesController controller = new ValuesController(stubHttpClient.Object);
```
Please... |
10,693,955 | I am using the new Web API bits in a project, and I have found that I cannot use the normal `HttpMessageRequest`, as I need to add client certificates to the request. As a result, I am using the `HttpClient` (so I can use `WebRequestHandler`). This all works well, except that it isn't stub/mock friendly, at least for R... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10693955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443927/"
] | As an alternative to the excellent ideas already presented by @Raj, it may be possible to go a step lower and to mock/fake the `HttpMessageHandler` instead.
If you make any class that needs an `HttpClient` accept it as a dependency injection parameter in the constructor, then when unit testing you can pass in an `Http... | I released a library a few months ago called [MockHttp](http://www.nuget.org/packages/RichardSzalay.MockHttp/) which might be useful. It uses a custom `HttpMessageHandler` with a fluent (and extensible) API. You can inject the mocked handler (or HttpClient) into your service class and it will respond as it was configur... |
17,855,529 | I would like to ask you a question.
I am creating a simple program that scans numbers (people's grades) and checks if they are at a certain range (say, 75% to 90%) and if they are at a certain range, do the following command; here's the code.
(More text below the code)
```
@echo off
color a
title Happy Factor Decode... | 2013/07/25 | [
"https://Stackoverflow.com/questions/17855529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2583333/"
] | I don't know the units of your calculations, but you can check a range from lowest to high:
```
@ECHO OFF &SETLOCAL
REM some calculation here
IF %BDF1% leq 25 GOTO :sad
IF %BDF1% leq 50 GOTO :kindasad
IF %BDF1% leq 75 GOTO :kindahappy
IF %BDF1% leq 100 GOTO :happy
ECHO uups!
goto:eof
:sad
ECHO sad
goto:eof
:kindasad... | One `number` between `min`and `max` is just `number>=max AND number<=min`, right???
```
IF %BDF1% GEQ 80 IF %BFD1% LEQ 90 GOTO :HAPPY
``` |
23,003,121 | I'm trying to stay on the same page after submitting a form button.
Depending on the button the user clicks, I want to display certain information on that same page the button was clicked.
For some reason it keeps redirecting me back to my "ask\_login.php" page after I click on the button.
I've read around and some pe... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23003121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3390361/"
] | `<form action="#">`. no action means 'submit to current url', the pound sign mean 'the current document' and should not navigate. though i'm not sure forms semantically allow this.
I would recommend posting the form data over ajax though. Its not hard to do, Jquery offers the most used ajax function and you basically l... | i think it shout be
```
<?php
if($_POST)
{
$username = $_POST['username'];
$password = $_POST['password'];
if($username && $password) {
//info is provided
$queryget = mysql_query("SELECT * FROM users WHERE id='$username' AND password='$password'");
$numrows = mysql_num_rows($queryget);
if($n... |
23,003,121 | I'm trying to stay on the same page after submitting a form button.
Depending on the button the user clicks, I want to display certain information on that same page the button was clicked.
For some reason it keeps redirecting me back to my "ask\_login.php" page after I click on the button.
I've read around and some pe... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23003121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3390361/"
] | `<form action="#">`. no action means 'submit to current url', the pound sign mean 'the current document' and should not navigate. though i'm not sure forms semantically allow this.
I would recommend posting the form data over ajax though. Its not hard to do, Jquery offers the most used ajax function and you basically l... | you can use jquery to process the form
```
$.post( "test.php", $( "#testform" ).serialize(),function(e){alert(e);} );
```
test.php
```
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if($username && $password) {
//info is provided
$queryget = mysql_query("SELECT * ... |
23,003,121 | I'm trying to stay on the same page after submitting a form button.
Depending on the button the user clicks, I want to display certain information on that same page the button was clicked.
For some reason it keeps redirecting me back to my "ask\_login.php" page after I click on the button.
I've read around and some pe... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23003121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3390361/"
] | I think this following code is not correct...
if($username && $password)
Try this
```
if(!empty($username) && !empty($password))
``` | i think it shout be
```
<?php
if($_POST)
{
$username = $_POST['username'];
$password = $_POST['password'];
if($username && $password) {
//info is provided
$queryget = mysql_query("SELECT * FROM users WHERE id='$username' AND password='$password'");
$numrows = mysql_num_rows($queryget);
if($n... |
23,003,121 | I'm trying to stay on the same page after submitting a form button.
Depending on the button the user clicks, I want to display certain information on that same page the button was clicked.
For some reason it keeps redirecting me back to my "ask\_login.php" page after I click on the button.
I've read around and some pe... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23003121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3390361/"
] | I think this following code is not correct...
if($username && $password)
Try this
```
if(!empty($username) && !empty($password))
``` | you can use jquery to process the form
```
$.post( "test.php", $( "#testform" ).serialize(),function(e){alert(e);} );
```
test.php
```
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if($username && $password) {
//info is provided
$queryget = mysql_query("SELECT * ... |
14,876,961 | I have Zebra LP2824 printer. It is working properly on Windows XP, but It is not working properly on Windows 7. On windows 7 it prints the Test page on printer properties, but it is not printing in my application. It seems, that it can't find the port, the printer is using. On the same application, but on Windows XP it... | 2013/02/14 | [
"https://Stackoverflow.com/questions/14876961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1263802/"
] | The one thing you will want to make sure of here is that you have a sort on the query you wish to use to garnish your records. If no sort is used it will actually use find order, which is not `$natural` order.
Find order can differ between queries so if you run the query twice within the period of 2 minutes you might ... | One thing, I want to clear you. Unlike MYSQL, MongoDB is not give gurantee to the position. I mean, MongoDB will give you different sort at different time. So compare adjacent document may give different result, on every reading.
If you are fine with that and you want to compare then try with MongoDB's MapReduce <http... |
14,876,961 | I have Zebra LP2824 printer. It is working properly on Windows XP, but It is not working properly on Windows 7. On windows 7 it prints the Test page on printer properties, but it is not printing in my application. It seems, that it can't find the port, the printer is using. On the same application, but on Windows XP it... | 2013/02/14 | [
"https://Stackoverflow.com/questions/14876961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1263802/"
] | I don't know whether this was true when the question was asked seven years ago, but this can be solved completely within the aggregation framework. Assuming the collection name is `AdjacentDocument`, the following aggregation will get the results you're looking for:
```js
db.AdjacentDocument.aggregate(
{$sort: {ti... | One thing, I want to clear you. Unlike MYSQL, MongoDB is not give gurantee to the position. I mean, MongoDB will give you different sort at different time. So compare adjacent document may give different result, on every reading.
If you are fine with that and you want to compare then try with MongoDB's MapReduce <http... |
14,876,961 | I have Zebra LP2824 printer. It is working properly on Windows XP, but It is not working properly on Windows 7. On windows 7 it prints the Test page on printer properties, but it is not printing in my application. It seems, that it can't find the port, the printer is using. On the same application, but on Windows XP it... | 2013/02/14 | [
"https://Stackoverflow.com/questions/14876961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1263802/"
] | The one thing you will want to make sure of here is that you have a sort on the query you wish to use to garnish your records. If no sort is used it will actually use find order, which is not `$natural` order.
Find order can differ between queries so if you run the query twice within the period of 2 minutes you might ... | Assuming those 3 objects are coming through in an array, you could do something like the below:
```
var prevTime;
var currentTime;
for(var i = 0; i < records.length; i++)
{
currentTime = new Date(records[i].time).getTime();
records[i].time_difference = currentTime - prevTime;
prevTime = currentTime;
}
``... |
14,876,961 | I have Zebra LP2824 printer. It is working properly on Windows XP, but It is not working properly on Windows 7. On windows 7 it prints the Test page on printer properties, but it is not printing in my application. It seems, that it can't find the port, the printer is using. On the same application, but on Windows XP it... | 2013/02/14 | [
"https://Stackoverflow.com/questions/14876961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1263802/"
] | I don't know whether this was true when the question was asked seven years ago, but this can be solved completely within the aggregation framework. Assuming the collection name is `AdjacentDocument`, the following aggregation will get the results you're looking for:
```js
db.AdjacentDocument.aggregate(
{$sort: {ti... | Assuming those 3 objects are coming through in an array, you could do something like the below:
```
var prevTime;
var currentTime;
for(var i = 0; i < records.length; i++)
{
currentTime = new Date(records[i].time).getTime();
records[i].time_difference = currentTime - prevTime;
prevTime = currentTime;
}
``... |
14,876,961 | I have Zebra LP2824 printer. It is working properly on Windows XP, but It is not working properly on Windows 7. On windows 7 it prints the Test page on printer properties, but it is not printing in my application. It seems, that it can't find the port, the printer is using. On the same application, but on Windows XP it... | 2013/02/14 | [
"https://Stackoverflow.com/questions/14876961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1263802/"
] | I don't know whether this was true when the question was asked seven years ago, but this can be solved completely within the aggregation framework. Assuming the collection name is `AdjacentDocument`, the following aggregation will get the results you're looking for:
```js
db.AdjacentDocument.aggregate(
{$sort: {ti... | The one thing you will want to make sure of here is that you have a sort on the query you wish to use to garnish your records. If no sort is used it will actually use find order, which is not `$natural` order.
Find order can differ between queries so if you run the query twice within the period of 2 minutes you might ... |
4,999,869 | is it possible to randomize the bricks in the JQuery plugin Masonry so that every time the page loads a different arrangement is viewed? There is no option for random as far as I can tell.
Thanks! | 2011/02/15 | [
"https://Stackoverflow.com/questions/4999869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/617202/"
] | I found an answer over on the jQuery forums and I tweaked it a bit for my needs. In short - you pull the HTML bits inside your masonry() holder and you randomize the collection, then you put it back:
```
$(document).ready(function(){
var ar = $('#masonry').children();
ar.sort(function(a,b){
// Get a ra... | ```
(function($) {
$.fn.randomize = function(childElem) {
return this.each(function() {
var $this = $(this);
var elems = $this.children(childElem);
elems.sort(function() { return (Math.round(Math.random())-0.5); });
$this.remove(childElem);
for(var i=0; i < elems.length; i++)
... |
4,999,869 | is it possible to randomize the bricks in the JQuery plugin Masonry so that every time the page loads a different arrangement is viewed? There is no option for random as far as I can tell.
Thanks! | 2011/02/15 | [
"https://Stackoverflow.com/questions/4999869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/617202/"
] | I found an answer over on the jQuery forums and I tweaked it a bit for my needs. In short - you pull the HTML bits inside your masonry() holder and you randomize the collection, then you put it back:
```
$(document).ready(function(){
var ar = $('#masonry').children();
ar.sort(function(a,b){
// Get a ra... | I think a more appropriate plugin for your would be [Isotope](http://isotope.metafizzy.co/), it's built the same way as Masonry (and by the same guy!) but has sorting and filtering features built-in |
4,999,869 | is it possible to randomize the bricks in the JQuery plugin Masonry so that every time the page loads a different arrangement is viewed? There is no option for random as far as I can tell.
Thanks! | 2011/02/15 | [
"https://Stackoverflow.com/questions/4999869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/617202/"
] | I think a more appropriate plugin for your would be [Isotope](http://isotope.metafizzy.co/), it's built the same way as Masonry (and by the same guy!) but has sorting and filtering features built-in | ```
(function($) {
$.fn.randomize = function(childElem) {
return this.each(function() {
var $this = $(this);
var elems = $this.children(childElem);
elems.sort(function() { return (Math.round(Math.random())-0.5); });
$this.remove(childElem);
for(var i=0; i < elems.length; i++)
... |
32,399,661 | I have been trying to develop a query to solve a problem but its been hard.
Table 1:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 2 |
| B | 1 |
| B | 5 |
| C | 8 |
+------+----+
```
Table 2:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 4 |
| B | 3 |... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32399661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713922/"
] | You might wanna try this:
EDIT: replaced table1 and table2 with a simple subqueries in WITH clause.
```
WITH table1 AS
(
SELECT
DECODE(LEVEL,1, 'A',2, 'A',3, 'B',4, 'B',5, 'C') AS name
,DECODE(LEVEL,1, 1,2, 2,3, 1,4, 5,5, 8) AS id
FROM
dual
CONNECT BY LEVEL < 6
)
,table2 AS
(
SELECT
DECODE(LEVEL,1, 'A',2, 'A'... | You can use a NOT EXISTS or similar:
```
SELECT t2.*
FROM Table2 t2
WHERE NOT EXISTS
(
SELECT 1
FROM Tabl1 t1
WHERE t1.Name = t2.Name
AND t1.Id = t2.Id
);
``` |
32,399,661 | I have been trying to develop a query to solve a problem but its been hard.
Table 1:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 2 |
| B | 1 |
| B | 5 |
| C | 8 |
+------+----+
```
Table 2:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 4 |
| B | 3 |... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32399661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713922/"
] | I would do:
```
with t1 as (select 'A' name, 1 id from dual union all
select 'A' name, 2 id from dual union all
select 'B' name, 1 id from dual union all
select 'B' name, 5 id from dual union all
select 'C' name, 8 id from dual),
t2 as (select 'A' name, 1 id from du... | You can use a NOT EXISTS or similar:
```
SELECT t2.*
FROM Table2 t2
WHERE NOT EXISTS
(
SELECT 1
FROM Tabl1 t1
WHERE t1.Name = t2.Name
AND t1.Id = t2.Id
);
``` |
32,399,661 | I have been trying to develop a query to solve a problem but its been hard.
Table 1:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 2 |
| B | 1 |
| B | 5 |
| C | 8 |
+------+----+
```
Table 2:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 4 |
| B | 3 |... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32399661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713922/"
] | You might wanna try this:
EDIT: replaced table1 and table2 with a simple subqueries in WITH clause.
```
WITH table1 AS
(
SELECT
DECODE(LEVEL,1, 'A',2, 'A',3, 'B',4, 'B',5, 'C') AS name
,DECODE(LEVEL,1, 1,2, 2,3, 1,4, 5,5, 8) AS id
FROM
dual
CONNECT BY LEVEL < 6
)
,table2 AS
(
SELECT
DECODE(LEVEL,1, 'A',2, 'A'... | ```
SELECT T1.ID,T1.NAME
FROM TABLE2 T1 INNER JOIN TABLE1 T2 ON T1.NAME = T2.NAME
LEFT JOIN TABLE1 T3 ON T3.ID = T1.ID
WHERE T3.ID IS NULL
``` |
32,399,661 | I have been trying to develop a query to solve a problem but its been hard.
Table 1:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 2 |
| B | 1 |
| B | 5 |
| C | 8 |
+------+----+
```
Table 2:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 4 |
| B | 3 |... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32399661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713922/"
] | I would do:
```
with t1 as (select 'A' name, 1 id from dual union all
select 'A' name, 2 id from dual union all
select 'B' name, 1 id from dual union all
select 'B' name, 5 id from dual union all
select 'C' name, 8 id from dual),
t2 as (select 'A' name, 1 id from du... | ```
SELECT T1.ID,T1.NAME
FROM TABLE2 T1 INNER JOIN TABLE1 T2 ON T1.NAME = T2.NAME
LEFT JOIN TABLE1 T3 ON T3.ID = T1.ID
WHERE T3.ID IS NULL
``` |
32,399,661 | I have been trying to develop a query to solve a problem but its been hard.
Table 1:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 2 |
| B | 1 |
| B | 5 |
| C | 8 |
+------+----+
```
Table 2:
```
+------+----+
| NAME | ID |
+------+----+
| A | 1 |
| A | 4 |
| B | 3 |... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32399661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713922/"
] | You might wanna try this:
EDIT: replaced table1 and table2 with a simple subqueries in WITH clause.
```
WITH table1 AS
(
SELECT
DECODE(LEVEL,1, 'A',2, 'A',3, 'B',4, 'B',5, 'C') AS name
,DECODE(LEVEL,1, 1,2, 2,3, 1,4, 5,5, 8) AS id
FROM
dual
CONNECT BY LEVEL < 6
)
,table2 AS
(
SELECT
DECODE(LEVEL,1, 'A',2, 'A'... | I would do:
```
with t1 as (select 'A' name, 1 id from dual union all
select 'A' name, 2 id from dual union all
select 'B' name, 1 id from dual union all
select 'B' name, 5 id from dual union all
select 'C' name, 8 id from dual),
t2 as (select 'A' name, 1 id from du... |
58,336,168 | I have this update function I'm aware the `findOrFail` call returns a model not found exception sent to the user. Is there a way you can add some code to catch this if an ID is not found or does the call do that for me? Here is the function it needs applying too.
```
public function update(string $id)
{
$this->us... | 2019/10/11 | [
"https://Stackoverflow.com/questions/58336168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try `ng build --configuration=production` as this is what your angular json has defined as a "production configuration". | Looks like you'r storing your configuration in `environment` and do not add `fileReplacements` in production configuration so check your `angular.json` production config `fileReplacements` it should be
```
"production": {
"fileReplacements": [
{
"replace": "src/environme... |
46,540,730 | At first I tried normal insert into target table from temporary table.
```
INSERT /*+ APPEND */ INTO RDW10DM.INV_ITEM_LW_DM
SELECT
*
FROM
RDW10PRD.TMP_MDS_RECLS_INV_ITEM_LW_DM
;
COMMIT;
```
It tooks only 17 min to load.Total count in temp table TMP\_MDS\_RECLS\_INV\_ITEM\_LW\_DM is 16491650.
Plan for Executi... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46540730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1022188/"
] | Do a test with Stopwatch like I mentioned. This answer is here because I believe that the result in your answer is wrong.
Below is a simple performance test script that uses loop since your algorithm involves many loops:
```
void Start()
{
int iterations = 10000000;
//TEST 1
Stopwatch stopwatch1 = Stop... | It depends on your target platform.
In the Editor, where you're running .NET code that hasn't been optimized, `(int)` is much faster than `Mathf.Floor()` because the latter includes the extra expense of function calls.
However, when you compile a build, your code may be optimized differently depending on your target ... |
36,903 | Ok, so here's the rundown. I have a site with three child sites, and I am trying to get a rollup of content from these three sites. Each site has the same list of "Initiatives" and on the parent site the client would like to see All of the initiatives. This works fantastically in FF, however i just get an exception thr... | 2012/05/24 | [
"https://sharepoint.stackexchange.com/questions/36903",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/6728/"
] | My guess is that something gets screwed up in this line:
webURL: "/"+subSite[i]+"" as the error states: There is no Web named "/**undefined**/\_vti\_bin/Lists.asmx
If you debug the for loop, are you getting results for all the iterations? | An easy fix (and better codeing practice) would be to change your for loop to something like this:
```
for(i=0;i<subSite.count();i++){
```
Based on your code it seems like you want to loop through every site returned, not 4 sites regardless of how many sites are returned. As far as why a different number of sites ... |
36,903 | Ok, so here's the rundown. I have a site with three child sites, and I am trying to get a rollup of content from these three sites. Each site has the same list of "Initiatives" and on the parent site the client would like to see All of the initiatives. This works fantastically in FF, however i just get an exception thr... | 2012/05/24 | [
"https://sharepoint.stackexchange.com/questions/36903",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/6728/"
] | You don't have `async: false,` on the first SPServices call to get the sites, so IE is probably just behaving as expected and continues to make the new requests without anything entered into subSites.
I don't know why FF fails to run the request async, but that just shows you shouldn't use that if you want right behav... | My guess is that something gets screwed up in this line:
webURL: "/"+subSite[i]+"" as the error states: There is no Web named "/**undefined**/\_vti\_bin/Lists.asmx
If you debug the for loop, are you getting results for all the iterations? |
36,903 | Ok, so here's the rundown. I have a site with three child sites, and I am trying to get a rollup of content from these three sites. Each site has the same list of "Initiatives" and on the parent site the client would like to see All of the initiatives. This works fantastically in FF, however i just get an exception thr... | 2012/05/24 | [
"https://sharepoint.stackexchange.com/questions/36903",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/6728/"
] | You don't have `async: false,` on the first SPServices call to get the sites, so IE is probably just behaving as expected and continues to make the new requests without anything entered into subSites.
I don't know why FF fails to run the request async, but that just shows you shouldn't use that if you want right behav... | An easy fix (and better codeing practice) would be to change your for loop to something like this:
```
for(i=0;i<subSite.count();i++){
```
Based on your code it seems like you want to loop through every site returned, not 4 sites regardless of how many sites are returned. As far as why a different number of sites ... |
42,694 | It seems that any modification you can do to a weapon on the Item Modification Table can also be done from Inventory.
Why are there so many tables and why would I want to use them? | 2011/12/19 | [
"https://gaming.stackexchange.com/questions/42694",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/16160/"
] | UPDATE: New features to the game including customizing augments. This feature requires the Item Modification Tables now. See Matthew Read's answer. The original answer that applies to the game as it was originally released, is still included here:
ORIGINAL:
It is a remnant from earlier item modification game mechani... | Here's what I have noticed: For example, I have 2 guns in my inventory that are non-mod. However, they pop up when I use the modification stations, allowing me to add and extract modifications there when I was unable to in my inventory. |
42,694 | It seems that any modification you can do to a weapon on the Item Modification Table can also be done from Inventory.
Why are there so many tables and why would I want to use them? | 2011/12/19 | [
"https://gaming.stackexchange.com/questions/42694",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/16160/"
] | UPDATE: New features to the game including customizing augments. This feature requires the Item Modification Tables now. See Matthew Read's answer. The original answer that applies to the game as it was originally released, is still included here:
ORIGINAL:
It is a remnant from earlier item modification game mechani... | The Item Modification Stations are now required to add Augments to your gear. When you buy an Augmentation Kit you have to take it to one of the stations and pay to apply it to your gear, giving you an augment slot. You can then use the station to add an augment or simply modify the gear as normal with Ctrl + Right Cli... |
42,694 | It seems that any modification you can do to a weapon on the Item Modification Table can also be done from Inventory.
Why are there so many tables and why would I want to use them? | 2011/12/19 | [
"https://gaming.stackexchange.com/questions/42694",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/16160/"
] | The Item Modification Stations are now required to add Augments to your gear. When you buy an Augmentation Kit you have to take it to one of the stations and pay to apply it to your gear, giving you an augment slot. You can then use the station to add an augment or simply modify the gear as normal with Ctrl + Right Cli... | Here's what I have noticed: For example, I have 2 guns in my inventory that are non-mod. However, they pop up when I use the modification stations, allowing me to add and extract modifications there when I was unable to in my inventory. |
61,336 | I'm from Palestine (or West Bank). Now I'm applying to Boston University (the deadline unfortunately is just ***a few hours from now***), and my country is not listed in their online application.
What can I do? There is not even an "others" option listed. Could I safely choose the nearest country to mine (Jordan), whe... | 2016/01/08 | [
"https://academia.stackexchange.com/questions/61336",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/44452/"
] | The United States [does not recognize the statehood of Palestine](https://en.wikipedia.org/wiki/International_recognition_of_the_State_of_Palestine#No_diplomatic_recognition) (meaning technically that can't *be* your home country as far as that government is concerned), which makes it somewhat unsurprising that an Amer... | First, this is just an error on their part, and not an issue of politics or policy. Contact them and they'll fix it, and in the meantime pick something close, as said in comments.
That said, it might be best to just pick Jordan anyway. If you were to be accepted, which passport would you use to get a visa? As a practi... |
4,795 | Are LEGO Junior bricks bigger than regular LEGO?
I can't decide between Junior LEGO and Duplo for my son who is just over 3. I had thought the Junior sets might constitute a happy medium, but am now less sure. | 2014/12/02 | [
"https://bricks.stackexchange.com/questions/4795",
"https://bricks.stackexchange.com",
"https://bricks.stackexchange.com/users/4229/"
] | [LEGO Juniors](http://www.lego.com/en-us/juniors/about) sets use normal LEGO System bricks. In other words, they are exactly the same size as the "normal" LEGO bricks.
However, the Junior sets are specifically designed for younger children. They often have large single-use pieces (for example, for walls or frames), a... | Lego Juniors is fine for 3-year-olds who know not to put toys in their mouths. My son, when he was three, was playing with regular System Lego (of which Juniors is a subset) and it was okay. If it's important to you that your son have things like vehicles, or minifigs, and that he build the whole set himself, then Juni... |
41,732,904 | I would like to insert same id with different value into database. Basically it is a form which allow the user to add new scholarship with some criteria. Not all scholarships will be applicable to all courses. Hence there will be two tables, `scholarship` which will take the new scholarships, and `scholarshipCourse` wh... | 2017/01/19 | [
"https://Stackoverflow.com/questions/41732904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7438683/"
] | `SCOPE_IDENTITY` is a possible solution.
**Description of SCOPE\_IDENTITY:** <https://msdn.microsoft.com/en-us/library/ms190315.aspx>
Basically you insert into the scholarship table and get the id (with SCOPE\_IDENTITY). Then, using that id, you insert into the scholarshipCourse table. Something like this (based on y... | You can use the [`OUTPUT`](https://msdn.microsoft.com/en-us/library/ms177564.aspx) clause to capture the values of the newly-inserted record, including identity values:
```
INSERT INTO user (name)
OUTPUT INSERTED.ID
VALUES ('John Smith');
```
The `INSERT` statement will produce a result set which contains the ID of ... |
41,732,904 | I would like to insert same id with different value into database. Basically it is a form which allow the user to add new scholarship with some criteria. Not all scholarships will be applicable to all courses. Hence there will be two tables, `scholarship` which will take the new scholarships, and `scholarshipCourse` wh... | 2017/01/19 | [
"https://Stackoverflow.com/questions/41732904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7438683/"
] | `SCOPE_IDENTITY` is a possible solution.
**Description of SCOPE\_IDENTITY:** <https://msdn.microsoft.com/en-us/library/ms190315.aspx>
Basically you insert into the scholarship table and get the id (with SCOPE\_IDENTITY). Then, using that id, you insert into the scholarshipCourse table. Something like this (based on y... | Just replace you inline select statement with scope\_identity function.
```
INSERT INTO user (name) VALUES ('John Smith');
INSERT INTO user_details (id, weight, height) VALUES (scope_identity(), 83, 185);
```
and if you want to insert more than one detail row
you can declare a variable and set it's value to scope\_i... |
9,028,384 | How to display a simple ListView in Java? Could you please give me a simple sample code on how to create ListView? | 2012/01/27 | [
"https://Stackoverflow.com/questions/9028384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1172661/"
] | Do you mean [JList](http://www.google.com.sa/url?sa=t&rct=j&q=JList&source=web&cd=2&ved=0CDMQFjAB&url=http://docs.oracle.com/javase/6/docs/api/javax/swing/JList.html&ei=exAiT8zzAtHQsgaN6OnJDg&usg=AFQjCNHF2QzUAhmLWN7mxTNHeggj4Kx-Lw&sig2=s0W7wJlH-RljBZb58xXKLw)?, see java tutorials: [How to Use Lists](http://docs.oracle.... | Have a look at [Java swing tutorial](http://docs.oracle.com/javase/tutorial/ui/overview/demo.html) and [ListView](http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/text/html/ListView.html) API reference - Its an implementation of `<html>` list - `<ol><li>`.
Sample :
```
public class Sample extends JFrame {
... |
9,028,384 | How to display a simple ListView in Java? Could you please give me a simple sample code on how to create ListView? | 2012/01/27 | [
"https://Stackoverflow.com/questions/9028384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1172661/"
] | Do you mean [JList](http://www.google.com.sa/url?sa=t&rct=j&q=JList&source=web&cd=2&ved=0CDMQFjAB&url=http://docs.oracle.com/javase/6/docs/api/javax/swing/JList.html&ei=exAiT8zzAtHQsgaN6OnJDg&usg=AFQjCNHF2QzUAhmLWN7mxTNHeggj4Kx-Lw&sig2=s0W7wJlH-RljBZb58xXKLw)?, see java tutorials: [How to Use Lists](http://docs.oracle.... | According tho the JavaDocs it is used when rendering HTML, so using it is is just a matter of loading some HTML that uses an HTML list (`<ul>` or `<ol>`).

```
import java.awt.*;
import javax.swing.*;
class ShowHtmlList {
public static void main(String[] args... |
9,028,384 | How to display a simple ListView in Java? Could you please give me a simple sample code on how to create ListView? | 2012/01/27 | [
"https://Stackoverflow.com/questions/9028384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1172661/"
] | Have a look at [Java swing tutorial](http://docs.oracle.com/javase/tutorial/ui/overview/demo.html) and [ListView](http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/text/html/ListView.html) API reference - Its an implementation of `<html>` list - `<ol><li>`.
Sample :
```
public class Sample extends JFrame {
... | According tho the JavaDocs it is used when rendering HTML, so using it is is just a matter of loading some HTML that uses an HTML list (`<ul>` or `<ol>`).

```
import java.awt.*;
import javax.swing.*;
class ShowHtmlList {
public static void main(String[] args... |
31,266,532 | I am using netsuite builder for creating a website. I want to create a mysql table in it but it does not allow me to do so. Please suggest how to create custom mysql table in netsuite database. | 2015/07/07 | [
"https://Stackoverflow.com/questions/31266532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4250996/"
] | In the admin role, go to the menu
Customization>List,Records & Fields>Record Types> New
Give it a name and ID, alongwith any other options. Save the record. Once the record has been saved, it gives you the option to add fields to the record.
Note: this would be a NetSuite table or to be precise - Custom Record Type. | If you have access to the NetSuite account, you can create custom records. |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | **Evaluation**
First an Audit, then the specific answers.
1. This is not a Data Model. This is not a Database. It is a bucket of fish, with each fish drawn as a rectangle, and where the fins of one fish are caught in the the gills of another, there is a line. There are masses of duplication, as well as masses of miss... | This 2 extra tables enables you to have address history per one person.
You can have them both in one table, but since staff and client are separated, it is better to separate them as well (b/c client id =1 and staff id =1 can't be used on the same table of address).
there is no "single" solution to a design problem... |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | >
> 3) Along the lines of
> normalization...Since both
> date\_address\_from and date\_address\_to
> are the same in the Client\_Addresses
> and Staff\_Addresses table should those
> fields just not be included in the
> main Address table?
>
>
>
No. But you did find a problem.
The designer has decided that ... | This 2 extra tables enables you to have address history per one person.
You can have them both in one table, but since staff and client are separated, it is better to separate them as well (b/c client id =1 and staff id =1 can't be used on the same table of address).
there is no "single" solution to a design problem... |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | 1) In each of those tables the primary key is a compound key consisting of three attributes: (staff\_id, address\_id, date\_address\_from) and (client\_id, address\_id, date\_address\_from). This presumably means that the mapping of clients/staff to addresses is expected to change over time and that the history of thos... | This 2 extra tables enables you to have address history per one person.
You can have them both in one table, but since staff and client are separated, it is better to separate them as well (b/c client id =1 and staff id =1 can't be used on the same table of address).
there is no "single" solution to a design problem... |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | **Evaluation**
First an Audit, then the specific answers.
1. This is not a Data Model. This is not a Database. It is a bucket of fish, with each fish drawn as a rectangle, and where the fins of one fish are caught in the the gills of another, there is a line. There are masses of duplication, as well as masses of miss... | >
> 3) Along the lines of
> normalization...Since both
> date\_address\_from and date\_address\_to
> are the same in the Client\_Addresses
> and Staff\_Addresses table should those
> fields just not be included in the
> main Address table?
>
>
>
No. But you did find a problem.
The designer has decided that ... |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | **Evaluation**
First an Audit, then the specific answers.
1. This is not a Data Model. This is not a Database. It is a bucket of fish, with each fish drawn as a rectangle, and where the fins of one fish are caught in the the gills of another, there is a line. There are masses of duplication, as well as masses of miss... | Viewing the data model, i think:
1) PF means that the field is both part of the primary key of the table and foreign key with other table.
2) In the same way, the primary key of Staff\_Addresses is {staff\_id,address\_id,date\_adderess\_from} not just date\_adderess\_from
3) The same that 2) |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | This 2 extra tables enables you to have address history per one person.
You can have them both in one table, but since staff and client are separated, it is better to separate them as well (b/c client id =1 and staff id =1 can't be used on the same table of address).
there is no "single" solution to a design problem... | In reference to Staff\_Addresses table, the Primary Key on date\_address\_from basically prevents a record with the same staff\_id/address\_id entered more than once. Now, i'm no DBA, but i like my PKs to be integers or guids for performance reasons/faster indexing. If i were to do this i would make a new column, say, ... |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | This 2 extra tables enables you to have address history per one person.
You can have them both in one table, but since staff and client are separated, it is better to separate them as well (b/c client id =1 and staff id =1 can't be used on the same table of address).
there is no "single" solution to a design problem... | Viewing the data model, i think:
1) PF means that the field is both part of the primary key of the table and foreign key with other table.
2) In the same way, the primary key of Staff\_Addresses is {staff\_id,address\_id,date\_adderess\_from} not just date\_adderess\_from
3) The same that 2) |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | **Evaluation**
First an Audit, then the specific answers.
1. This is not a Data Model. This is not a Database. It is a bucket of fish, with each fish drawn as a rectangle, and where the fins of one fish are caught in the the gills of another, there is a line. There are masses of duplication, as well as masses of miss... | In reference to Staff\_Addresses table, the Primary Key on date\_address\_from basically prevents a record with the same staff\_id/address\_id entered more than once. Now, i'm no DBA, but i like my PKs to be integers or guids for performance reasons/faster indexing. If i were to do this i would make a new column, say, ... |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | 1) In each of those tables the primary key is a compound key consisting of three attributes: (staff\_id, address\_id, date\_address\_from) and (client\_id, address\_id, date\_address\_from). This presumably means that the mapping of clients/staff to addresses is expected to change over time and that the history of thos... | In reference to Staff\_Addresses table, the Primary Key on date\_address\_from basically prevents a record with the same staff\_id/address\_id entered more than once. Now, i'm no DBA, but i like my PKs to be integers or guids for performance reasons/faster indexing. If i were to do this i would make a new column, say, ... |
4,663,366 | Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail.
Barry Williams from databaseanswers has this schema posted.
[Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm... | 2011/01/11 | [
"https://Stackoverflow.com/questions/4663366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/527298/"
] | >
> 3) Along the lines of
> normalization...Since both
> date\_address\_from and date\_address\_to
> are the same in the Client\_Addresses
> and Staff\_Addresses table should those
> fields just not be included in the
> main Address table?
>
>
>
No. But you did find a problem.
The designer has decided that ... | Viewing the data model, i think:
1) PF means that the field is both part of the primary key of the table and foreign key with other table.
2) In the same way, the primary key of Staff\_Addresses is {staff\_id,address\_id,date\_adderess\_from} not just date\_adderess\_from
3) The same that 2) |
3,599,053 | The exercise is the following:
>
> Let $\phi:A\longrightarrow B$ be a ring homomorphism. Let $X = Spec(A)$ and $Y = Spec(B)$. If $\mathfrak{q} \in Y$, then $\phi^{-1}(\mathfrak{q})$ is a prime ideal of $A$. Hence $\phi$ induces a mapping $\phi^\*:Y \longrightarrow X$. Show that:
>
> [...]
>
> iii) If $\mathfr... | 2020/03/28 | [
"https://math.stackexchange.com/questions/3599053",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/365199/"
] | First, I will make some statements without proof. For an ideal $\mathfrak{a} \unlhd A$, $\sqrt{\mathfrak{a}} = \cap\_{\substack{p \in Spec(A) \\ p \supset a}} p$. Also, $V(\mathfrak{a}) \subset Spec(A)$ is a closed set for any $\mathfrak{a} \unlhd A$. Lastly, for $\phi : A \rightarrow B$ a ring homomorphism, $\mathfrak... | $$
\begin{align\*}
\overline{\phi^\*(V(\mathfrak{b}))}
&= V\left(\bigcap \phi^\*(V(\mathfrak{b}))\right) && \text{as you observed,} \\
&= V\left(\bigcap\_{\mathfrak{q} \in V(\mathfrak{b})} \mathfrak{q}^c\right) && \text{because $\phi^\*(\mathfrak{q}) = \mathfrak{q}^c$ by definition,} \\
&= V\left(\left(\bigcap\_{\mathf... |
38,884,880 | How can I make a vector of (non-sparse) matrices in Julia? Then I want to use push! to add elements to that.
So if the name of the vector is V, then V[1] will be a matrix or Array{Float64,2}.
I know this works if the elements of the vector are sparse:
V = Array(SparseMatrixCSC). | 2016/08/10 | [
"https://Stackoverflow.com/questions/38884880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5703783/"
] | You can use the `Matrix` alias (`Array{T, 2}`):
```rb
julia> v = Matrix{Float64}[]
0-element Array{Array{Float64,2},1}
julia> x = rand(2, 2)
2×2 Array{Float64,2}:
0.0877254 0.256971
0.719441 0.653947
julia> push!(v, x)
1-element Array{Array{Float64,2},1}:
[0.0877254 0.256971; 0.719441 0.653947]
julia> v[1]
2×... | I just tried this and it worked:
V = Array(Array{Float64,2}, 0);
edit: As @pkofod suggested, this way is prefered:
T = Array{Float64,2};
V = Array{T}(0)
other options: V = Array{Float64,2}[ ] or V = Matrix{Float64}[ ] |
53,657,923 | **Note: This is not just about summing phone time, phone time needs to calculated seperately through PHP function**
I am currently having following code
```
$i = array(1,2,3,4,5,6,7,8,9,10,11,12);
$j = array();
foreach ($i as $item) {
$month_query_phonetime = $conn->query("SELECT phone_time FROM bigscreen_daily... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53657923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4978285/"
] | If I understood correctly and you're attempting to sum the `phone_time` for each `user_id`, why not let the database do the heavy lifting for you and use an aggregate query:
```
SELECT user_id, SUM(phone_time) AS sum_phone_time
FROM bigscreen_daily_data
GROUP BY user_id
```
Chances are it would also execute fa... | Getting MySQL to group by the month and restrict the data set to this year:
```
SELECT MONTH(work_date) AS m,SUM(phone_time) AS sum_phone_time
FROM bigscreen_daily_data
WHERE user_id = 28 AND work_date >= MAKEDATE(year(now()),1);
GROUP BY m
``` |
53,657,923 | **Note: This is not just about summing phone time, phone time needs to calculated seperately through PHP function**
I am currently having following code
```
$i = array(1,2,3,4,5,6,7,8,9,10,11,12);
$j = array();
foreach ($i as $item) {
$month_query_phonetime = $conn->query("SELECT phone_time FROM bigscreen_daily... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53657923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4978285/"
] | If I understood correctly and you're attempting to sum the `phone_time` for each `user_id`, why not let the database do the heavy lifting for you and use an aggregate query:
```
SELECT user_id, SUM(phone_time) AS sum_phone_time
FROM bigscreen_daily_data
GROUP BY user_id
```
Chances are it would also execute fa... | Ended up attaching query to a loop where I want it to be and now its showing intended results
```
foreach ($data as $obj)
{
$month_query_phonetime = $conn->query("SELECT phone_time FROM bigscreen_daily_data WHERE MONTH(work_date) = {$obj->mon} AND YEAR(work_date) = YEAR(CURDATE()) AND user_id = {$userid} ");
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.