qid int64 1 74.7M | question stringlengths 0 70k | date stringlengths 10 10 | metadata list | response stringlengths 0 115k |
|---|---|---|---|---|
50,882,897 | This is a simple problem that is hard for me to put into words because I'm not too familiar with Python's syntax. I have a class called "Quadrilateral" that takes 4 points, and I'm trying to make a method called "side\_length" that I want to use to compute the length of the line between two of the vertices on the quadr... | 2018/06/15 | [
"https://Stackoverflow.com/questions/50882897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9948429/"
] | Is you looking for multiple index slice ?
```
df.loc[pd.IndexSlice['bar',:],:]
Out[319]:
0 1 2 3
bar one 0.807706 0.07296 0.638787 0.329646
two -0.497104 -0.75407 -0.943406 0.484752
``` |
39,988 | The `Devices menu` -> `CD/DVD Devices` contains `VBoxGuestAdditions.iso`
**But ticking the above menu option doesn't show any menu to select anything from.**
The `kernel-devel` is already there.
The host is `openSUSE 11.3` 64 bit. The guest is `Slackware 13.37` 32 bit.
What's the way round now? | 2012/06/04 | [
"https://unix.stackexchange.com/questions/39988",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/8706/"
] | You should try [Redmine](http://www.redmine.org/).
>
> Some of the main features of Redmine are:
>
>
>
> ```
> Multiple projects support
> Flexible role based access control
> Flexible issue tracking system
> Gantt chart and calendar
> News, documents & files management
> Feeds & email notifications
> Per project ... |
18,423,853 | I want to validate url before redirect it using Flask.
My abstract code is here...
```
@app.before_request
def before():
if request.before_url == "http://127.0.0.0:8000":
return redirect("http://127.0.0.1:5000")
```
Do you have any idea?
Thanks in advance. | 2013/08/24 | [
"https://Stackoverflow.com/questions/18423853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1113655/"
] | Use [urlparse (builtin module)](http://docs.python.org/2/library/urlparse.html). Then, use the builtin flask [redirection methods](http://flask.pocoo.org/docs/api/?highlight=redirect#flask.redirect)
```
>>> from urlparse import urlparse
>>> o = urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
>>> o
ParseResult... |
258,422 | I have developed two web services. The main service is a RESTful service (using DB), and another UI service that uses the RESTful service.
Say I want to test the UI for now (integration tests), every test will makes changes in the prod DB. More then that, if in the RESTful service, there are one-way functions for secu... | 2014/10/08 | [
"https://softwareengineering.stackexchange.com/questions/258422",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/110245/"
] | First of all, you shouldn't be testing against your production database. If you ever need to rerun your tests after the application has gone live (and you *will* need to do that), you run a serious risk of losing or corrupting data that is vital to the business.
So, instead of testing against the production database, ... |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | In italiano ogni nome appartiene a un genere, maschile o femminile. Alcuni nomi cambiano genere passando dal singolare al plurale, l'esempio più famoso è
>
> *il carcere*, *le carceri*
>
>
>
e *i carceri* non è comunemente accettato. Più frequente è il doppio genere al plurale:
1. *il braccio*, *le braccia* (del... |
28,492 | How does IE register ActiveX controls for use in the browser?
Does it just run regsvr32 for the DLL? | 2009/08/24 | [
"https://superuser.com/questions/28492",
"https://superuser.com",
"https://superuser.com/users/2503/"
] | ActiveX components register themselves, triggered by a well known DLL entry point (`DllRegisterServer`).
`regsvr32` is just a wrapper around loading the DLL and calling that entry point. Other tools can do this directly. Installers sometimes just directly update the registry (having recorded the changes to make when b... |
94,357 | I'm using i8n to host a bilingual site and I only like to display the inactive language in the top bar. What php code do I need to detect the current language so I place the inactive language in the template?
Thanks:
```
<a href=
<?php
global $language;
if (($language -> name) == 'English') {
print "\"http://www.ma... | 2013/11/15 | [
"https://drupal.stackexchange.com/questions/94357",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/23730/"
] | Use the global variable `$language`
<https://api.drupal.org/api/drupal/developer%21globals.php/global/language/7> |
35,059,719 | I have created a channel on Azure Media Services, I correctly configured it as an RTMP channel and streamed a live video with Android + FFMpeg libraries.
The problem is the client end-point latency.
I need a maximum latency ~2 seconds, but now I have about ~25 seconds!
I'm using Azure Media Player in a browser page... | 2016/01/28 | [
"https://Stackoverflow.com/questions/35059719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2014144/"
] | ```
Label dynamiclabel = new Label();
dynamiclabel.Location = new Point(38, 30);
dynamiclabel.Name = "lbl_ques";
dynamiclabel.Text = question;
//dynamiclabel.AutoSize = true;
dynamiclabel.Size = new System.Drawing.Size(900, 26);
dynamic... |
44,123,504 | I hope to make some Class D heritage and implements all properties and methods of Interfaces A,B and C. Please help-me with an example in Delphi.
I use Delphi Xe7
**How One class Implement Many Interfaces?**
I'm trying something like:
```
Unit1
Type
IRefresher = Interface
['{B289720C-FFA4-4652-9F16-0826550DF... | 2017/05/22 | [
"https://Stackoverflow.com/questions/44123504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6695319/"
] | Try this:
```
success: function (result) {alert(JSON.stringify(result)); }
```
From the error you have posted in comments below, it appears Dictionary is not serializable. Try setting `AllowGet` as mentioned in other answers. If doesn't work, you will need to convert Dictionary to some other object that is seri... |
15,941,999 | Can I set some space inside 'EditText' in the beginning and at the end? If possible, then how? Actually, I have done some customization on my 'EditText' view and now it shows like this, as shown in the below image:

In my case, as you see, in my "description... | 2013/04/11 | [
"https://Stackoverflow.com/questions/15941999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1739882/"
] | Use `padding left` like
`editText.setPadding (int left, int top, int right, int bottom);` |
13,670,253 | The past 3 days I've tried to get this simple example to work but whatever I try I just can't seem to understand where I'm going wrong...
HTML:
```
<input type="text" id="textEntry" /> <button>Go</button>
<ul id="list">
<li>Text from the input field will appear below</li>
</ul>
```
jQUERY:
```
$('button').clic... | 2012/12/02 | [
"https://Stackoverflow.com/questions/13670253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/933252/"
] | If the schema contains serial or sequence columns, you should reset these to the max value that occurs in the corresponding column. (normally you should not import the serials from a file, but give them the freedom to autoincrement.)
For all imported tables you should identify the sequence fields and run the following... |
488,019 | For most ML models we say they suffer from high bias or high variance, then we correct for it. However, in DL do neural networks suffer from the same concept in the sense that they initially have high bias or high variance and then you correct through regularization and/or dropout? I would argue they initially suffer f... | 2020/09/18 | [
"https://stats.stackexchange.com/questions/488019",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/72773/"
] | In general NNs are prone to overfitting the training set, which is case of a [high variance](https://datascience.stackexchange.com/questions/45578/why-underfitting-is-called-high-bias-and-overfitting-is-called-high-variance). Your train of thought is generally correct in the sense that the proposed solutions (regulariz... |
9,327,400 | I've create a c# winforms form,
It has a bunch of labels positioned and a flowlayoutpanel.
on certain occasions i set one of the labels and the flowlayoutpanel to visible =false.
As a result i want all labels beneath them to be pushed up - at the moment there is a gap where they were.
Also, I'd like the flowlayoutp... | 2012/02/17 | [
"https://Stackoverflow.com/questions/9327400",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66975/"
] | If I got you correctly, I would suggest using a TableLayoutPane with two rows. The top row will contain a docked panel with all the controls that may be hidden. The bottom row will contain a docked panel with all the rest.
Set the top row's SizeType to AutoSize and the bottom row's to 100%.
When you want to hide the ... |
192,935 | I want to say :
>
> Analysis **conducted at a** insurance company showed that...
>
> or
>
> Analysis **into a** insurance company showed that...
>
>
>
What is the best way to phrase this? | 2014/08/23 | [
"https://english.stackexchange.com/questions/192935",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/89164/"
] | I would make it slightly less passive:
*"An analysis performed by the insurance company ..."*
or other material to indicate *who* performed the analysis and *where* it was performed as well as the issue being analyzed. If you or your associates performed the analysis, you might phrase it:
*"An analysis performed by ... |
52,259,592 | We are hosting our website in Azure. During the deployment(TFS) we will do the below Steps as the part of the deployment pipeline.
1. Stop the WebApp
2. Deploy Web App Service
3. Start the WebApp
After the 1st step, if anyone tries to access our website, then by default Azure will return the below page
[![enter imag... | 2018/09/10 | [
"https://Stackoverflow.com/questions/52259592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7073340/"
] | Messing with `sys.path` is rarely a good idea.
Since your plan seems to be to use both `foo` and `test` from `notebooks` (that will probably just contain Jupyter notebooks), the cleanest solution would be to install `foo` and `test` as packages.
Remove the `__init__.py` from your top level directory and `notebooks`, ... |
52,819,018 | This code should count the number of prime numbers based on user input. If user input is 10, then I should get 4. However, I only get 0. Why does the second loop not run?
```
#include<stdio.h>
#include<math.h>
int main()
{
int N;
scanf("%d", &N);
int numprime;
numprime = 0;
int P=1;
for (P; P<N... | 2018/10/15 | [
"https://Stackoverflow.com/questions/52819018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10502481/"
] | `flex-direction: column`
========================
The major problem (besides some bad syntax on background shorthand) is that the `flex-direction` was at default which is `row` (horizontal). The flex items (`.logo` and `.copy`) are stacked vertically thus the `flex-direction` should be `column`.
---
Demo
----
**Det... |
20,852,167 | I am new to php. I have tried the following code to redirect the page when sign In button is clicked, but it is not happening. please help me editing the code. probably, there is an error in header() function. Have I used the header() function correctly?
```
<body>
<?php
$emailErr = $passwordErr = "";
$email = $p... | 2013/12/31 | [
"https://Stackoverflow.com/questions/20852167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3131191/"
] | Add `@ob_start();` top of the page,
```
if (isset($_POST["sign"])) {
header('Location:signInform.php');
}
``` |
12,025,173 | Here is the main problem:
```
dig maktabkhooneh.info +trace
```
works perfectly fine and returns the right answer.
```
dig maktabkhooneh.info
```
(without +trace) returns:
```
; <<>> DiG 9.8.1-P1 <<>> maktabkhooneh.info
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id... | 2012/08/19 | [
"https://Stackoverflow.com/questions/12025173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1380812/"
] | `dig +trace` follows the whole chain from the beginning - it queries root servers, then .info servers then your namservers. Thus it avoids any caching resolvers, and also avoids propagation issues.
`dig +notrace` (the default) queries your default DNS resolver (on Linux, whatever specified in `/etc/resolv.conf`).
The... |
38,574,785 | I need to extract values from the below JSON response I am receiving from a web service response.
```
{"ns4:SearchSA_PartyReturn": {
"xmlns:ns1": "urn:cs-base",
"xsi:type": "ns4:SearchSA_PartyReturn",
"ns4:object": {
"xmlns:ns2": "urn:co-base",
"recordCount": 3,
"xmlns:ns0": "urn:cs... | 2016/07/25 | [
"https://Stackoverflow.com/questions/38574785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6116467/"
] | It looks like you're trying to get `document.getElementById("setting").value` but the actual ID is "Setting" as per
```
<select name="Setting">
<option value="Office">Office</option>
<option value="HOPD">HOPD</option>
</select>
```
Try changing the getElementById to `document.getElem... |
58,567,334 | I'm trying to turn a Huffman tree and a stream of bits into a list of characters plus a boolean indicating whether or not the output consumed all the input bits. Here's an example:
```
decode xyz_code [True,False,True,True,True,False,False,True] =
("yzyx",False)
```
Here's what I have so far, but it doesn't work. W... | 2019/10/26 | [
"https://Stackoverflow.com/questions/58567334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12276493/"
] | I think no, Authorization server is out of their roadmap. Starting from november the 13th every class in spring security which worked with Authorization server features become deprecated.
[Spring Security OAuth 2.0 Roadmap Update](https://spring.io/blog/2019/11/14/spring-security-oauth-2-0-roadmap-update#no-authorizat... |
74,370 | I have an Ubuntu 6.06 server that needs to be replaced by an Ubuntu 9.04 server clean setup, I already copied the entire samba file server directory to the new 9.04 server using rsync. I need to know how to migrate the existing user accounts (machine accounts) to the new server so as when I physically transfer the conn... | 2009/10/14 | [
"https://serverfault.com/questions/74370",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | ```
passdb backend = tdbsam
```
means you have your samba accounts in a `passdb.tdb` file in `SAMBA_DIR/private`.
As long as you copy it with rsync you are fine.
There are two caveats:
* Unix users: a samba user has to be a unix user as well, so you have to copy all files @churnd told you;
* timing: machine accoun... |
71,435,759 | I am trying to add a new recipe to install new packages in my image. I need the next packages libnfc5 libnfc-bin libnfc-examples, I have found these packages in this page: <http://ftp.de.debian.org/debian/pool/main/libn/libnfc/>, so I am using the next commands to install the packages:
* devtool add libnfc5 <http://ft... | 2022/03/11 | [
"https://Stackoverflow.com/questions/71435759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18352597/"
] | `PIVOT` relational operator is an option:
Sample data:
```
SELECT *
INTO Company
FROM (VALUES
(1, 'Frodo B (manager), Gandalf G (director), Batman C (cleaner)'),
(2, 'John Doe (secretary), Mark Jacobs (manager), Lilly Hopes (director), Rihanna Williams (cleaner), Maddy James (supervisor), Merry Poppins (HR)'),
... |
66,986,874 | Have some data stored in different directory paths in databricks file system. Need to rename some folders. Is it possible to rename folders in DBFS? If so, what's the command? | 2021/04/07 | [
"https://Stackoverflow.com/questions/66986874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8500105/"
] | You can use `mv` with `%fs` magic, or `dbutils.fs` to do this. This command is used for renaming and/or moving files and directories
`%fs mv -r /path/to/folder /path/to/new_folder_name`
the `-r` is to do recursive move with directories.
It's documented in the [dbutils](https://docs.databricks.com/_static/notebooks/d... |
73,695,925 | I'm going nuts trying to connnect in Selenium4 to Chrome instance on a localhost.
I invoked chrome from bash using
```
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=6666 --user-data-dir=/Users/h/Desktop/MY/chrome-profile
```
and next i tried to connect from Selenium4
```
f... | 2022/09/12 | [
"https://Stackoverflow.com/questions/73695925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995273/"
] | You can use the format below:
```
PARSE_DATETIME('%m/%d/%Y %l:%M %p', "7/13/2022 9:46 AM")
```
The output:
[](https://i.stack.imgur.com/i07A9.png) |
72,506,798 | Hello there I try to align some text in a container to the left but it won't work even when there is free space. As you can see there is some free space directly next to the image which isn't used for no reason. Right here I show you a picture and also the style. Thanks in advance if anyone can help.
![enter image des... | 2022/06/05 | [
"https://Stackoverflow.com/questions/72506798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17032453/"
] | You could use interfaces with default implementations which were introduced in C# 8. Then you could derive from these interfaces.
Here's an example of how you could you provide default implementations for the `MoveForward()` and `StartBroadcast()` methods:
```cs
public interface IVehicle
{
void MoveForward()
... |
3,051,606 | I need to find minimum point of hanging rope with two known points $p\_1, p\_2$ (start and end point of the rope) and known rope length.
I want to model all rope shapes with different length and start and end point.
Do I have to use numerical methods?
Does it have any closed form solution?
Known $\to L,(x\_1,y\_1),... | 2018/12/24 | [
"https://math.stackexchange.com/questions/3051606",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/629130/"
] | Starting from @Cesareo answer, considering
$$L^2-v^2 = 4a^2\sinh^2\left(\frac{h}{2a}\right)$$ let $x=\frac{h}{2a}$ to make the equation
$$\frac{L^2-v^2}{h^2}=\frac{\sinh^2(x) }{x^2}\implies k=\sqrt{\frac{L^2-v^2}{h^2}}=\frac{\sinh(x) }{x}$$
Consider that you look for the zero of $$f(x)=\frac{\sinh(x) }{x}-k$$ It varie... |
28,078,756 | So I've typed a command (pacman -S perl-) and I hit tab and see that there are a whole bunch of completions (about 40), and I realize that I want to run every single completion (so I don't accidentally install from CPAN what is already a builtin).
How do I run all completions of a command?
BONUS: How do I run more th... | 2015/01/21 | [
"https://Stackoverflow.com/questions/28078756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2851917/"
] | Here is my own solution to deal with,
* To apply matching for completion results.
* To insert all the completion matches into the command line.
* To activate menu selection and select the completion more than one.
---
**To apply matching for completion results**, it could be done with the [`_match`](http://zsh.sourc... |
344,872 | It hadn’t properly registered yet with Arthur that the council wanted to knock it down" - what's the meaning of register with someone here? | 2016/08/26 | [
"https://english.stackexchange.com/questions/344872",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/193168/"
] | This would be dependent on whether the speaker was referring to the group/entity of the Club or to the location of Sunnyside Country Club.
For instance if you removed the words 'Sunnyside' and 'Country' and just left the word Club, a speaker would be more likely to choose the term "to".
I was accepted for membership... |
96,015 | Can you help me to find and count sub-sequences of consecutive, identical integer members of a long list (at least 1000 members)? By sub-sequences I mean runs like `0, 0` or `5, 5, 5`. | 2015/10/02 | [
"https://mathematica.stackexchange.com/questions/96015",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/34540/"
] | If the `List` is named `lst`, then
```
rept = Cases[Split[lst], z_ :> z /; Length[z] > 1]
```
finds all runs of repeated integers, and
```
Length[rept]
```
finds the number of them. Applied to
```
lst = {1, 2, 3, 3, 4, 5, 5, 5, 6, 4}
```
they give
```
(* {{3, 3}, {5, 5, 5}} *)
(* 2 *)
```
If only the numbe... |
66,802 | And in particular, when you play with 2 players do you deal out all the cards the from the deck? Or is there some undealt part that players draw from during the game? I mean, if you deal them all then you'll just know what's in your opponent's hand?
This is going to sound trivial, but actually it's part of this theory... | 2022/05/14 | [
"https://anime.stackexchange.com/questions/66802",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/4484/"
] | **Yes, it is possible to play *Shichi Narabe* with only 2 players.**
First of all, there is no exact requirement for the number of players, though most sites recommend at least 3 or 4 players:
* [English Wikipedia](https://en.wikipedia.org/wiki/Domino_(card_game)): 3-7 (intro body) / 3-8 (infobox)
* [Japanese Wikiped... |
19,970,356 | We can extract distinct value set from a list by using following code
```
List<Person> distinctPeople = allPeople
.GroupBy(p => new {p.PersonId, p.FavoriteColor} )
.Select(g => g.First())
.ToList();
```
Assume person has PersonId, FavoriteColor, age, address, etc..... My requirement is I would like to get a se... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19970356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2288789/"
] | As other devs mentioned email clients do not load external css, so you have to inline it. Inlining css manually is poor decision. There are libraries to inline css. One of them is [django-inlinecss](https://github.com/roverdotcom/django-inlinecss "django-inlinecss"). You can keep you code exactly as it is. All you need... |
3,377,238 | There is the circle group which is specifically a set of points comprising the boundary of the unit disc in the complex plane which turns out to be a compact set.
However, is the set of points forming a circle of any arbitrary radius also compact in the complex plane? | 2019/10/01 | [
"https://math.stackexchange.com/questions/3377238",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/709298/"
] | Sure. Any two circles in the complex plane are homeomorphic. So, if one of them is compact, then all of them are. |
18,746,129 | I am trying to make a `left outer join` query that also has a `custom comparator`.
I have the following lists:
```
List<ColumnInformation> list1;
List<ColumnInformation> list2;
```
These hold information about an SQL column (datatype, name, table, etc). I have overrided `Equals` for the class, and made a `operator ... | 2013/09/11 | [
"https://Stackoverflow.com/questions/18746129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1043380/"
] | The way you do that is with a `GroupJoin` and `SelectMany` (to flatten the results):
```
ColumnComparer cc = new ColumnComparer();
var joinedList = list1
.GroupJoin(list2,
x => x,
y => y,
(x, g) => new {x, g},
cc)
.SelectMany(
z => z.g.DefaultIfEmpty(),
(z, b) =>... |
59,397 | As established [in a previous question](https://chemistry.stackexchange.com/q/31276), coordination compounds typically have a *field split* between the $\mathrm{t\_{2g}}$ and the $\mathrm{e\_g}$ d-orbitals.[1] This energy difference can be explained by the crystal field theory which assumes negative point-charges appro... | 2016/09/20 | [
"https://chemistry.stackexchange.com/questions/59397",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/7475/"
] | I currently happen to have the book by Figgis that Max mentioned. Chapter 2 is devoted to a mathematical formulation of crystal field theory, which I did not bother reading in detail because I do not understand any of it. *(The corollary is: If you have a better answer, please post it!)* It seems that both $D$ and $q$ ... |
26,632,644 | I am newbie to java db coding...
This is my java code
```
Connection conn = null;
Statement stmt = null;
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Connecting to database...");
conn = DriverManager.getConnection("jdbc:mysql://localhost/EMP",USER,PASS);
System.out.println("Creating statement...");
stm... | 2014/10/29 | [
"https://Stackoverflow.com/questions/26632644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1079065/"
] | You are using the wrong driver for the database. Every database (MySQL, PostgreSQL, SQL Server, Oracle etc.) has a different driver which is what connects between JDBC and the particular database's communication protocol.
You need the Microsoft SQL Server driver. You can download and install it from here if you don't ... |
3,367,553 | Is $S$ linearly dependent on $\textsf V = \mathcal{F}(\Bbb R,\Bbb R)$ and $S = \{t, e^t ,\sin(t)\}$.
How to prove that a set of functions are linearly dependent? | 2019/09/24 | [
"https://math.stackexchange.com/questions/3367553",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/708009/"
] | Here is a another way to skin the cat:
Suppose $\alpha\_1 t + \alpha\_2 e^t + \alpha\_3 \sin t = 0$ for all $t$.
If we differentiate twice and set $t = 0$, we get $\alpha\_2 e^{\pi \over 2} = 0$ and so $\alpha\_2 = 0$.
If we differentiate twice and set $t = -{\pi \over 2}$, we get $\alpha\_3 = 0$.
Finally, set $t=1... |
16,917,821 | I'm trying to implement simple ScopedExit class. Here's the code:
```
#include <iostream>
#include <functional>
template<class R, class... Args>
class ScopedExit
{
public:
ScopedExit(std::function<R(Args...)> exitFunction)
{
exitFunc_ = exitFunction;
}
~ScopedExit()
{
exitFunc_()... | 2013/06/04 | [
"https://Stackoverflow.com/questions/16917821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/644350/"
] | >
> How to pass exit's function arguments to it? For example, I bind BarExitFunc with two integer arguments: 18 and 11. So how can I pass it to the exitFunc\_ in the destructor?
>
>
>
I can see no reason whatsoever to pass arguments to `exitFunc_` at call time in the destructor. Whatever you do, you'll have to pro... |
656,271 | I am using Bluez bluetooth Manager, after I send the files from my Android device to the Laptop which contains Linux Mate with the standard File System. I cannot seem to find the files which a received in this manner. The Bluez documentation does not specify where do these files go. | 2015/08/04 | [
"https://askubuntu.com/questions/656271",
"https://askubuntu.com",
"https://askubuntu.com/users/431035/"
] | Grub allows you to password protect its config and console, as well as individual operating system entries. Please note that this *will not* stop dedicated individuals, especially the ones that know what they are doing. But I assume you know that. Lets get started.
generate a password hash..
-------------------------... |
2,793,312 | When we use the cylindrical coordinate system $(r, \theta, z)$ where $r$ is the distance from the point in the $xy$-plane, $\theta$ is the angle with the $x$ axis and $z$ is the heigth. As can been seen in the picture
[](https://i.stack.imgur.com/lKIQ... | 2018/05/23 | [
"https://math.stackexchange.com/questions/2793312",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/221950/"
] | **Hint:**
You discover the rules by working backwards.
First consider polynomials, say of the third degree, like $ax^3+bx^2+cx+d$. The first derivative is a second degree polynomial, so that the LHS of a first order equation would yield
$$\alpha y+\beta y'=\alpha ax^3+(\alpha b+3\beta a)x^2+(\alpha c+2\beta b)x+(\al... |
477,931 | How can I create a table like this in Latex?
[](https://i.stack.imgur.com/4MYki.png)
I have tried but it didn't work. I need also that it is enumerated so that it appears in the List of Tables. It doesn't matter if it is not coloured, as long as the ... | 2019/03/05 | [
"https://tex.stackexchange.com/questions/477931",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/182855/"
] | I suggest you to use `booktabs` for professional tables.
```
\documentclass[11pt,openright]{book}
\usepackage{array}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\renewcommand{\arraystretch}{1.2}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{caption}
\begin{document}
\listoftables
\chapter{My chapter}
... |
923,813 | Show that it is not true in general that
(i) for any sets A,B, one has P(A union B) is a subset of P(A) union P(B)
Show that it is true in general that
(ii) for any sets A , B , one has P(A) union P(B) is a subset of P(A union B).
For part (i) and part (ii), can you help me verify my proof? i didnt use elements fo... | 2014/09/08 | [
"https://math.stackexchange.com/questions/923813",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/174559/"
] | Easier way to prove part two: set inclusion. The proof is mostly definition chasing.
Let $S \in \mathbf{P}[A]\cup \mathbf{P}[B]$. Then either $S \subseteq A$ or $S \subseteq B$. In either case, $S \in \mathbf{P}[A \cup B]$ by noting that $$S \subseteq A \implies S \subseteq A \cup B \implies S \in \mathbf{P}[A \cup B]... |
26,017,705 | I have an azure website and database. I'm running an ASP.NET MVC 4 / EF 5 app localy and trying to put some data to the azure database before to deploy the app. But I have a TargetInvocationException : {"The ASP.NET Simple Membership database could not be initialized. For more information, please see <http://go.microso... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26017705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2660758/"
] | The following works for me:
```
<add name="coupdpoAPEkowswAEntities" connectionString="Server=tcp:myserver.database.windows.net,1433;Database=mydatabase;User ID=cdptest@myserver;Password=*****;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.EntityClient"/>
```
Use Server inst... |
37,097,643 | The server hosting the api is returning http for absolute urls even though the page was loaded using https, does this have something to do with django rest framework? because there doesn't seem any obvious way to remedy this.
It's the url field in the Meta class that is relevant
```
class NewsSerializer(serializers.H... | 2016/05/08 | [
"https://Stackoverflow.com/questions/37097643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567198/"
] | You need to make sure nginx forwards the client's request scheme because it'll make a regular http request to Django. You'll need to add the following line to your vhost definition:
```
proxy_set_header X-Forwarded-Proto $scheme;
``` |
28,768,715 | For a project I am working on, one of the things we're implementing is something that we have code for in some of my teams older ASP.NET and MVC projects - an `Application_Error` exception catcher that dispatches an email to the development team with the exception experience and most relevant details.
Here's how it lo... | 2015/02/27 | [
"https://Stackoverflow.com/questions/28768715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1404206/"
] | Abstract out your error handling logic from `Application_Error` into its own function. Create a [Web API exception filter](http://www.asp.net/web-api/overview/error-handling/exception-handling).
```
//register your filter with Web API pipeline
//this belongs in the Application_Start event in Global Application Handler... |
6,091,451 | So I have this code that pops up a file chooser and reads the file:
```
JFileChooser chooser = new JFileChooser();
File file = null;
int returnValue = chooser.showOpenDialog( null ) ;
if( returnValue == JFileChooser.APPROVE_OPTION ) {
file = chooser.getSelectedFile() ;
}
if(file != null) {
String filePath ... | 2011/05/22 | [
"https://Stackoverflow.com/questions/6091451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/765039/"
] | I don't know what your `ReadFile` thing is, but it looks like it takes a string representing the file path. In which case, you probably want to give it `file.getPath()`. |
17,525,935 | i have created an application called "xyz.msi" and installed. Now i created another application called "abc.msi" and trying to install.
But my question is if "xyz.msi" is installed already then it shouldn't allow to install "abc.msi".
Thanks in advance | 2013/07/08 | [
"https://Stackoverflow.com/questions/17525935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2560586/"
] | Take a look at the [Upgrade table](http://msdn.microsoft.com/en-us/library/windows/desktop/aa372379%28v=vs.85%29.aspx). You can use this to define the search criteria along with the msidbUpgradeAttributesOnlyDetect attribute to cause your action property to be assigned the ProductCode property that is found. Then you c... |
45,935,003 | I have a string pipe of values, which I want to modify. the string pipe has a range from 0-5 values, so I made the following:
```js
new Vue({
el: '#app',
data: {
valuesString: ""
},
computed: {
values: {
get() {
var values = this.valuesString ? this.valuesString.split("-") : [];
... | 2017/08/29 | [
"https://Stackoverflow.com/questions/45935003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1826106/"
] | I'm not entirely sure I understand what you are looking for, but I think this will do the trick:
* Parse the piped string and place it in an array
+ See the computed property unpiped
* loop through the array and place the value in the selectbox
+ the loop should occur on the . The result is bound to valuesString
* ... |
3,755,892 | Does anyone know if there is an extension or plugin for Visual Studio ( any version ) that will recognize Perl syntax highlighting? I want to edit the Perl files in my vs projects, but it gets hard to read sometimes. Thanks. | 2010/09/20 | [
"https://Stackoverflow.com/questions/3755892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/387203/"
] | [Visual Studio Update 1 RTM](http://blogs.msdn.com/b/visualstudio/archive/2015/11/30/visual-studio-update-1-rtm.aspx) now (2015) has Perl support, along with Go, Java, R, Ruby, and Swift. |
8,626,880 | On Android when I am mapping an address on a Mapview I have to wait for that action to return and then my user is given control back so I was wondering how can I send that function of to another thread?
```
mapLocationButton.setOnClickListener(new OnClickListener() {
@Override
public void onCl... | 2011/12/24 | [
"https://Stackoverflow.com/questions/8626880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/690851/"
] | Android provides the AsyncTask class to do that. Read <http://developer.android.com/reference/android/os/AsyncTask.html> |
83,697 | In X-Men Origins, Scott Summers lost his eyes, which were then put into Deadpool. After this event, in X-Men 1 through X-Men 3 Scott was still able to fire lasers, implying that the mutant ability was not related to the eyes? Yet Deadpool was able to fire the lasers with Scott's eyes. In addition Deadpool was able to c... | 2015/03/12 | [
"https://scifi.stackexchange.com/questions/83697",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/42794/"
] | >
> Why is Deadpool able to shoot lasers with eyes and Cyclops without? Why is Deadpool able to control the lasers without the technology Cyclops has?
>
>
>
Because Cyclops origin story involves trauma (either mental psychological trauma, or actual head injury) that prevents him from controlling his powers. His br... |
3,101,684 | Been back and forth on this recently. Trying to attach a SSH tunnel from a localhost port on my machine to an internal port on the other side of an Internet accessible SSH server using Putty. Putty does not check if the port is available. Before I open the Putty connection, I would like to verify the port is free.
It ... | 2010/06/23 | [
"https://Stackoverflow.com/questions/3101684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/344271/"
] | There will always be a race condition if you are checking with one program and expecting to use the port in another. If you were doing everything from within one program You can create a socket and bind to port 0 and the system will select a free port for you so you will never clash with another process. |
5,900,627 | I am trying to pass an object from one page to another page using `<asp:hyperlink>` without any success. I was trying to invoke a C# method and put that object into a session but then I realized you can't invoke a method using `<asp:hyperlink>`. Then I thought about using `<asp:linkbutton>` but then I need to open the ... | 2011/05/05 | [
"https://Stackoverflow.com/questions/5900627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386195/"
] | >
> Then I thought about using `<asp:linkbutton>` but then I need to
> open the new webpage in a new window.
>
>
>
You do not need to open a new window... add this to your server side `LinkButton` handler:
```
<asp:LinkButton id="btnYourLinkButton" runat="server"
OnClick="btnYourLinkButton_Click">Test</asp:... |
24,342,687 | I am trying to clear a session. Below is a little sample code I wrote to check with `SessionStatus`.
```
@Controller
@SessionAttributes(value={"sessAttr1","sessAttr2","sessAttr3"})
public class SessionController {
@RequestMapping(value="index")
public ModelAndView populateSession(){
ModelAndView modelVie... | 2014/06/21 | [
"https://Stackoverflow.com/questions/24342687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1317840/"
] | `setComplete` is used to mark a session attribute as not needed *after* the request has been processed by the controller: It does not immediately modify the session, and it overall sounds like it's a poor fit for your use case. It's intended to be used in a situation like a POST where the data is intended to be used du... |
54,616,879 | I have a file directory `music/artist/{random_name}/{random_music}.ogg`
There's a lot of folder in `{random_name}` and different kind of music title `{random_music}`.
So, I wanted to rename the `{random_music}.ogg` to `music.ogg`. Each `{random_name}` folder only have one .ogg files.
I've tried with the Bash script... | 2019/02/10 | [
"https://Stackoverflow.com/questions/54616879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8061434/"
] | Your pattern replacement is incorrect. Because all your paths start with `..`, `.*.ogg` actually matches *the entire path*, so *every* file gets turned into `music.ogg` in your current directory.
You want `${f/\/*.ogg/music.ogg}` instead, or better yet, `${f%/*}/music.ogg`. That's the rough equivalent of `"$(dirname "... |
6,346 | I hope to observe planets like Jupiter and Saturn, and moons. I am a novice when it comes to telescopes and I know images in magazines are not taken with at least 12-inch telescope in a middle of nowhere. Is it possible to view Saturn in little yellowish and Mars in little reddish using following telescopes? I am going... | 2014/09/13 | [
"https://astronomy.stackexchange.com/questions/6346",
"https://astronomy.stackexchange.com",
"https://astronomy.stackexchange.com/users/2410/"
] | Go with Option 1 (135mm) as it has bigger light collecting area, i.e. diameter of primary mirror. It will enable you to see faint objects and it will also help you to see the dim objects under a greater zoom eyepiece, e.g. 4mm or 10mm.
Also, don't fool yourself with the bigger numbers advertized by telescope vendors l... |
123,285 | I have a 20 amp circuit going directly from the panel to the kitchen with 20 amp receptacles and subsequent 12 gauge wire. There are only 4 outlets on that circuit (one being a GFI). I am installing under-cabinet lights and lights above the sink, well within the total amperage and volts allowed for the 20 amp circuit. ... | 2017/09/13 | [
"https://diy.stackexchange.com/questions/123285",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/75416/"
] | Switches are not circuit breakers (overcurrent protection). They cannot protect wire and do not make it ok to use smaller wire past them.
If any 14AWG wire is used, you must downgrade the breaker to 15A, and downgrade the countertop receptacles to 15A. The other wire can remain 12AWG. This will mean it is not one of ... |
7,238,330 | I have following code
```
$.ajax({ type: 'POST',
url: 'index.jsp',
data: 'id=111',
dataType: 'jsonp',
success: function(data) {
alert(data.result);
},
error: function( err1, err2, err3 )
{
... | 2011/08/30 | [
"https://Stackoverflow.com/questions/7238330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/608576/"
] | try adding a contentType
```
$.ajax({
type: 'POST',
url: 'index.jsp',
data: {id:'111'},
contentType: "application/json; charset=utf-8",
dataType: 'jsonp',
success: function(data) {
alert(data.result);
},
error: function( err1, err2, err3 )
{
alert('Error:' + ... |
25,948,218 | My java project has files which have same name but different cases (Test.java & test.java). I have setup a case sensitive file system on my mac and am able to view/edit them via CLI. However, Intellij Idea does not regard them as different and compilation fails. How can I fix Intellij Idea to honor cases for a file nam... | 2014/09/20 | [
"https://Stackoverflow.com/questions/25948218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/367890/"
] | I filed a support request at JetBrains. Here is the answer:
>
> add "idea.case.sensitive.fs=true" to bin/idea.properties file (<https://intellij-support.jetbrains.com/entries/23395793> ), perform File | Invalidate Caches and restart the IDE.
>
>
>
It solved the issue for me.
update: 2015-02-14 / Idea 14.0.3
It ... |
963,370 | I'm trying to install the SSRS data connector for my CRM4 implementation.
I'm using the [Method 2: Modify the Install-config.xml file from this page](http://support.microsoft.com/kb/947060). But keep getting the same error message:
>
> Unable to validate SQL Server Reporting Services Report Server
> installation. Pl... | 2009/06/08 | [
"https://Stackoverflow.com/questions/963370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You may need to post more details regarding this issue:
1) The 2nd method described in this link : [here](http://support.microsoft.com/kb/947060) is used when the Reporting Server database is installed using the SQL Server named instance. Are you installing the Reporting Server database in the default instance or named... |
3,873,110 | I have a table with two number columns, and a unique constraint over them both. I would like to insert a new pair of values UNLESS the pair already exists. What is the simplest way to do this?
If I do
```
insert into TABLE values (100,200)
```
and the pair already exists I get a ORA-00001 error, so I would like t... | 2010/10/06 | [
"https://Stackoverflow.com/questions/3873110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64082/"
] | You can use [MERGE](http://psoug.org/reference/merge.html) |
4,162,930 | Let it be $\alpha=1+\sqrt[3]{5}\,i$ and $f(x)$ the minimal polynomial of $\alpha$ in $\mathbb{Q}$.
Is $\mathbb{Q}(\alpha)$ the splitting field of $\alpha$?
I generally know how to deal with splitting field when the roots are simple but I dont know how to deal with this or in general when minimal polynomial aren't tha... | 2021/06/04 | [
"https://math.stackexchange.com/questions/4162930",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/918258/"
] | For your example, let $\beta=\sqrt[3]5i$, then we have $\beta^6=-25$. Clearly $\beta$ has degree 6 over $\mathbb Q$, and its conjugates are given by $\beta\zeta^k$, $k=0,\dots,5$, where $\zeta=\frac{1+\sqrt3i}2$ is a primitive sixth root of unity. Therefore, the extension $\mathbb Q(\beta)/\mathbb Q$ is not Galois, bec... |
20,981,466 | I'm facing problem with jquery
here is my code
```
<script type='text/javascript' src='jquery-1.10.2.min.js'></script>
<script type="text/javascript">
$(function() {
$(".more2").click(function() {
var element = $(this);
var msg = element.attr("id");
$.ajax({
type: "POST",
url: "insta2.php",
... | 2014/01/07 | [
"https://Stackoverflow.com/questions/20981466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69821/"
] | Looking at the [source](https://github.com/thquinn/DraggableGridView) you provided, the `DraggableGridView` class is already under `src`. So adding the jar that contains the same is redundant and dex will complain about duplicate definitions.
To fix it, just remove the `DraggableGridView.jar` from your project. |
34,379,584 | I shoul use setText() but how should I use it instead of System.out.println()?
I want to print the result in a TextView. The code is a json reader. sorry I need to write some text to let me post my question.
```
public class JsonReader extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
... | 2015/12/20 | [
"https://Stackoverflow.com/questions/34379584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5184742/"
] | You will need to print the result in a TextView if you want to view the result on phone instead of LogCat console as suggested by johnrao07.
To print result in a TextView first add a TextView widget in activity\_main.xml layout file.
```
<TextView
android:id="@+id/text_view_id"
android:layout_width="... |
39,041,257 | How optimize an API call in symfony?
I call with Guzzle bundle, but the time in some situations is very long.
In client application call a function from the server.
In server application extract the objects from the database and send back to the client.
In client creat the new object with properties from server resp... | 2016/08/19 | [
"https://Stackoverflow.com/questions/39041257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | One of the ways to improve your API calls is to use caching. In Symfony there are many different ways to achieve this. I can show you one of them (`PhpFileCache` example):
In **services.yml** create cache service:
```
your_app.cache_provider:
class: Doctrine\Common\Cache\PhpFileCache
arguments: ["%kernel.cach... |
86,352 | ```
> CREATE TABLE test(foo FLOAT);
> INSERT INTO test VALUES(1.2899999);
> SELECT * FROM test;
+------+
| foo |
+------+
| 1.29 |
+------+
```
While it's obvious that FLOAT is not a precise data type, it is still rounding this data too arbitrarily. Let's check if it's actually able to store it:
```
> ALTER TABLE t... | 2014/12/16 | [
"https://dba.stackexchange.com/questions/86352",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/9479/"
] | I hate precision-based issues. I dealt with one before: [Data Truncated for Column](https://dba.stackexchange.com/questions/4091/data-truncated-for-column/4094#4094)
You may have do the ALTER TABLE manually
```
CREATE TABLE test_new LIKE test;
ALTER TABLE test_new MODIFY foo DOUBLE;
INSERT INTO test_new (foo) SELECT ... |
34,494 | I have a data-set of genetic variants which I'm trying to use as predictors for a simple phenotype, and for starters I use a binary logistic regression in SPSS. I have around 900 individuals, and for each individual around 50 variations and a phenotype.
However, I get an unreasonably high amount of removed values when... | 2012/08/17 | [
"https://stats.stackexchange.com/questions/34494",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/12259/"
] | SPSS removes cases [list-wise](http://en.wikipedia.org/wiki/Listwise_deletion) by default, and in my experience this is the case for the majority of statistical procedures. So if a case is missing data for any of the variables in the analysis it will be dropped entirely from the model. For generating correlation matric... |
74,309,944 | I have a db like this:
```
tibble(Q1 = c("0","A"),
Q2 = c("A","A"),
Q3 = c("0","A"),
C1 = c("A","0")
) -> DB
```
I aim to add a new column which is a count of how many `"0"` are detected in the row when the column starts with `"Q"`.
In this case, this column would be like
```
DB %>%
mutate(S =... | 2022/11/03 | [
"https://Stackoverflow.com/questions/74309944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17122831/"
] | ```r
DB %>%
rowwise() %>%
mutate(S = sum(c_across(starts_with("Q")) == "0")) %>%
ungroup()
# # A tibble: 2 x 5
# Q1 Q2 Q3 C1 S
# <chr> <chr> <chr> <chr> <int>
# 1 0 A 0 A 2
# 2 A A A 0 0
``` |
20,928,413 | I am getting odd redirection in general. It works in development but not production. Here are the responses for an update. The same things happens on a create.
DEVELOPMENT
```
Redirected to http://localhost:3000/trackers
Completed 302 Found in 43ms (ActiveRecord: 18.7ms)
Started GET "/trackers" for 127.0.0.1 at 2014... | 2014/01/05 | [
"https://Stackoverflow.com/questions/20928413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1938097/"
] | `$scope.$digest()` is what processes all of the `$watch` events that are on the current and children scope. It essentially manually tells the scope to check if a scope variable has changed. You don't generally want to use this when you are inside of a controller or a directive, because the `$scope.$apply()` function ca... |
13,279,390 | Write a program that reads in a series of first names and eliminates duplicates by storing them in a Set. Allow the user to search for a first name.
(Trust me, I am not taking any Java classes. So, not my homework).
My issue is to implement this: **Allow the user to search for a first name.**
Everything else works, ... | 2012/11/07 | [
"https://Stackoverflow.com/questions/13279390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1415064/"
] | Use `language.ShowDialog();`. Per [MSDN](http://msdn.microsoft.com/en-us/library/c7ykbedk.aspx), the code following it is not executed until after the dialog box is closed. |
1,600,597 | Suppose the following code:
```
foreach(Item i on ItemCollection)
{
Something s = new Something();
s.EventX += delegate { ProcessItem(i); };
SomethingCollection.Add(s);
}
```
Of course, this is wrong because all the delegates points to the same Item. The alternative is:
```
foreach(Item i on ItemCollection... | 2009/10/21 | [
"https://Stackoverflow.com/questions/1600597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40441/"
] | UPDATE: There is extensive analysis and commentary on this issue here:
<http://ericlippert.com/2009/11/12/closing-over-the-loop-variable-considered-harmful-part-one/>
---
This is an extremely frequently reported issue; usually it is reported as a compiler bug, but in fact the compiler is doing the right thing accord... |
471,949 | Let's take the function $f(x)=x^{-1}$. My question is this: Is the sum $$\frac{1}{x-a}+\frac{1}{x+a}$$ as $a\rightarrow 0$ near the point $x=0$ equal 0? And how would I proove this anytime I encounter this kind of limit? How would this work with derivatives or integrals? | 2013/08/20 | [
"https://math.stackexchange.com/questions/471949",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/47567/"
] | The quantity you seem to be asking about is $$\lim\_{a\to 0}\frac{1}{x-a}+\frac{1}{x+a}$$ "near" $x=0.$ Well, assuming that $x$ is not $0,$ then this is simply $$\lim\_{a\to 0}\frac{1}{x-a}+\frac{1}{x+a}=\frac1x+\frac1x=\frac2x$$ by continuity. Now, if $x=0,$ then we have $$\lim\_{a\to 0}\frac{1}{x-a}+\frac{1}{x+a}=\li... |
118,606 | I am a 15-year-old female, and I am currently a high soprano. I can currently sing from a low C4 to a high F above the bar. Is there a way I could get higher and become a coloratura soprano or gain an octave? | 2021/11/18 | [
"https://music.stackexchange.com/questions/118606",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/83089/"
] | You already have a full soprano range: C4 to F6. Coloratura is a vocal quality, not a range. Coloratura voices generally have a light quality to them, as opposed to the more powerful voice of a dramatic soprano. Coloraturas specialize in highly decorative passages with lots of runs, trills, and other ornaments.
So col... |
18,529,965 | Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18529965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11421/"
] | I got the same issue and implemented some code after doing some search but having no ready-to-use stuff. There is a package on nuget [MiniProfiler.Integrations](https://www.nuget.org/packages/MiniProfiler.Integrations/) I would like to share.
**Update V2**: it supports to work with other database servers, for MySQL it... |
2,507,595 | I'm using Google Test Framework to set some unit tests. I have got three projects in my solution:
* FN (my project)
* FN\_test (my tests)
* gtest (Google Test Framework)
I set FN\_test to have FN and gtest as references (dependencies), and then I think I'm ready to set up my tests (I've already set everyone to /MTd ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2507595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241161/"
] | I found the answer to be a rather simple one. After two days of intense headknocking, it's this:
**You have to compile your main project as `.lib` and not `.exe`**
After doing this, all linking went as a bliss. I thought Visual Studio would do this automatically for me, since I declared a dependency to FN from FN\_te... |
23,880,663 | What we take for granted in other languages and almost expect it to work in go, won't work - its almost so natural to do this, so why isn't the compiler happy? Just feeling like bailing out of go sometimes.
The only way to increment the value is to put it in its own separate line?
<http://play.golang.org/p/_UnpZVSN9... | 2014/05/27 | [
"https://Stackoverflow.com/questions/23880663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/901460/"
] | `++` and `--` are statements in golang, not expressions |
1,483,068 | The charset is Unicode. I want to write a string of CString type into a file, and then read it out from the file afterwards.
I write the string into a file with CFile::Write() method:
```
int nLen = strSample.GetLength()*sizeof(TCHAR);
file.Write(strSample.GetBuffer(), nLen);
```
Here is the question: I want to obta... | 2009/09/27 | [
"https://Stackoverflow.com/questions/1483068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87955/"
] | ```
UINT nBytes = (UINT)file.GetLength();
int nChars = nBytes / sizeof(TCHAR);
nBytes = file.Read(strSample.GetBuffer(nChars), nBytes);
strSample.ReleaseBuffer(nChars);
``` |
551,535 | Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC... | 2021/03/06 | [
"https://electronics.stackexchange.com/questions/551535",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/257550/"
] | Good question, here's my attempt. You still have to convert your input signal from the time domain to s domain, then do the math, then convert the result back to the time domain. That pole just tells you where the resonance is, the behavior of the resonance is usually "growing infinitely forever" - but the exact behavi... |
7,327,164 | I am developing a node.js app, and I want to use a module I am creating for the node.js server also on the client side.
An example module would be circle.js:
```
var PI = Math.PI;
exports.area = function (r) {
return PI * r * r;
};
exports.circumference = function (r) {
return 2 * PI * r;
};
```
and you do a... | 2011/09/06 | [
"https://Stackoverflow.com/questions/7327164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101909/"
] | This seems to be how to make a module something you can use on the client side.
<https://caolan.org/posts/writing_for_node_and_the_browser.html>
mymodule.js:
```
(function(exports){
// your code goes here
exports.test = function(){
return 'hello world'
};
})(typeof exports === 'undefined'? this... |
31,424,294 | say I have the following code:
```
var rightPane = $("#right");
// Draw the right pane
rightPane.html('<h2>' + task.task + '<h2> <hr />' +
'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' +
'data2: <input type="text" id="data2" value="' + ta... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31424294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1798362/"
] | In the current version of JavaScript, you can do this by escaping the newlines at the ends of lines, which is a *bit* better but note that leading whitespace will be included in the string, and you still have to use concatenation to swap in your values:
```
var rightPane = $("#right");
// Draw the right pane
rightPane... |
102,246 | The elementary "opposite over hypotenuse" definition of the sine function defines the sine of an angle, not a real number. As discussed in the article "A Circular Argument" [Fred Richman, The College Mathematics Journal Vol. 24, No. 2 (Mar., 1993), pp. 160-162. Free version [here](http://www.maa.org/sites/default/files... | 2012/07/14 | [
"https://mathoverflow.net/questions/102246",
"https://mathoverflow.net",
"https://mathoverflow.net/users/18805/"
] | I made two corrections in your formula for $D.$ It is now consistent with the 1974 Acta Arithmetica paper.
Some examples. If $\alpha, \beta, \gamma$ are all $0,$ we have a quadratic form, which is required primitive. For positive forms, the proportion of primes represented is a constant times the full count of primes,... |
27,975,841 | I need to write in a pure JavaScript function which will execute only for 5 seconds and will stop if either one of the following conditions (whichever comes first)
1. 5 seconds has elapsed
2. user inputted a field
I could only do condition 2 but can't figure out how to break the loop after 5 seconds:
```
function be... | 2015/01/16 | [
"https://Stackoverflow.com/questions/27975841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4459865/"
] | Javascript tends to be very callback oriented, since by default all the Javascript on a page runs in a single thread, which means that the UI isn't responsive while other code is busy running. So rather than looping in a function and looking for input on each loop, you likely want to register a callback function which ... |
65,047,655 | I am following [this thread](https://stackoverflow.com/questions/7707074/creating-dynamic-button-with-click-event-in-javascript) which shows how to generate DOM elements dynamically.
Suppose I have this snippet that generate a series of buttons:
```
for(var i = 0; i < result.length;i++){
var menuCatButton = docu... | 2020/11/28 | [
"https://Stackoverflow.com/questions/65047655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10765455/"
] | You can add the class the element using `classList.add()`.
**Demo:**
```js
var result = [1,2];
var menuMgtCategoryButtons = document.getElementById('menuMgtCategoryButtons');
for(var i = 0; i < result.length;i++){
var menuCatButton = document.createElement("button");
menuCatButton.id = "menu-mgt-button-"+result[i... |
1,659,348 | `For example:`
Suppose we have an impulsive force $f(t)$ lasting from $t=t\_0$ until $t=t\_1$ which is applied to a mass $m$. Then by Newtons Second law we have $$\int\_{t=t\_0}^{t=t\_1}f(t)\,\mathrm{d}t=\int\_\color{red}{t=t\_0}^\color{red}{t=t\_1}m\color{blue}{\frac{\mathrm{d}v}{\mathrm{d}t}}\mathrm{d}t=\int\_\color... | 2016/02/17 | [
"https://math.stackexchange.com/questions/1659348",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/144533/"
] | The fundamental reason to change the limits of integration is that
the *variable* of integration has changed.
Substitution is an obvious case in which this is likely to occur.
For example, substitute $u = x - 2$ in $\int (x - 2) dx$:
$$
\int\_0^2 (x - 2) dx = \int\_{-2}^0 u\; du.
$$
The intuition I follow on this is t... |
55,011,833 | Other people who have asked this question had answers about downloading Vim from Vim.org, but that website doesn't respond.
Are there other ways to use Vi on Windows? | 2019/03/05 | [
"https://Stackoverflow.com/questions/55011833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10496528/"
] | Use a mutation observer to watch the list item instead of watching the document as a whole.
```js
// The item we want to watch
var watch = document.querySelector('.active')
// The new observer with a callback to execute upon change
var observer = new MutationObserver((mutationsList) => {
console.log(new Date().... |
3,933,744 | When I closed MySql server, how can I understand that mysql server is gone away from my Qt program?
**Edit:**
Here my trial:
When I close MySql, I get these results, and I can't catch that MySql is closed.
My Code Snippet is
```
QSqlQuery query(db);
query.exec("SELECT * From RequestIds");
qDebug()<<query.lastError... | 2010/10/14 | [
"https://Stackoverflow.com/questions/3933744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311762/"
] | There is a bug related with QSqlDatabase::isOpen() in Qt.
<https://bugreports.qt.io/browse/QTBUG-223> |
45,852,012 | So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th... | 2017/08/24 | [
"https://Stackoverflow.com/questions/45852012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4902004/"
] | Any selector-only solution requires you to make assumptions about your markup that may or may not be within your control since the specificity of two contextual selectors is always the same regardless of how close the ancestor is to each descendant that is matched, and any solution that makes use of inheriting the actu... |
24,774,890 | I am using Codeigniter and I have a function like this .
```
function total_income(){
$data['total_income'] = $this->mod_products->total_income();
echo"<pre>";
print_r($data['total_income']);
}
```
The above code return an array like this.
```
Array
(
[0] => stdClass Object
... | 2014/07/16 | [
"https://Stackoverflow.com/questions/24774890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3766509/"
] | ```
$sum = 0;
foreach ($array as $obj) {
$sum += ($obj->quantity * $obj->sub_product_price);
}
``` |
36,688,254 | My question maybe unheard of or may even be impractical.
But, I believe it is practical and acceptable.
**Problem: PHP request and response in background thread.**
Problem constraints:
1. You know it uses POST method.
2. It has two fields fname and lname as html ids that need to be filled.
3. You get response in the... | 2016/04/18 | [
"https://Stackoverflow.com/questions/36688254",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2298251/"
] | use [this link](http://www.androidhive.info/2012/01/android-json-parsing-tutorial/) for best solution of calling web service without using WebView.
In this example fname and lname sent in namevaluepairs we get responce in json formet and parse json and get data also json parse defined in examples. |
105,305 | quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog... | 2020/09/30 | [
"https://music.stackexchange.com/questions/105305",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/72239/"
] | The scale/chords are good clues to the key of a song, but at least as important is the *tonal center*. That's not as easy to define but generally it's where the song comes back to a place of less musical tension.
IMHO the chord played when the song in question returns to a "rest" state is A major. Which means I would ... |
239,209 | On OS from win 2000 or later (any language) can I assume that this path will always exists?
For example I know that on win xp in some languages the "Program Files" directory have a different name.
So is it true for the System32 folder?
Thanks.
Ohad. | 2008/10/27 | [
"https://Stackoverflow.com/questions/239209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17212/"
] | You definitely cannot assume that: Windows could be installed on a different drive letter, or in a different directory. On a previous work PC Windows was installed in D:\WINNT, for example.
The short answer is to use the API call GetSystemDirectory(), which will return the path you are after.
The longer answer is to ... |
44,951,581 | I have a requirement where in the function takes different parameters and returns unique objects. All these functions perform the same operation.
ie.
```
public returnObject1 myfunction( paramObject1 a, int a) {
returnObject1 = new returnObject1();
returnObject1.a = paramObject1.a;
return returnObject1;
}
public r... | 2017/07/06 | [
"https://Stackoverflow.com/questions/44951581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6512806/"
] | Make `interface Foo` and implement this `interface` in both `paramObject1` and `paramObject2` class. Now your method should be look like:
```
public Foo myFunction(Foo foo, int a){
//Rest of the code.
return foo;
}
``` |
37,723,804 | I have to search a contact by name, surname or telephone number.
how can i do that?
I think i can't use java 8 stream in this case...
Another thing... I have to press "2" two times in order to see all the contact list but the if implementation seems right to me.
The code:
```
import java.util.ArrayList;
import java.u... | 2016/06/09 | [
"https://Stackoverflow.com/questions/37723804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6444835/"
] | This could be done in Java 8 as next:
```
Optional<Contatto> result = cont.stream().filter(c ->
(nome == null || nome.equalsIgnoreCase(c.getNome()))
&& (cognome == null || cognome.equalsIgnoreCase(c.getCognome()))
&& (num_Tel == null || num_Tel.equals(c.getNum_Tel()))
).findFirst();
```
Assuming ... |
11,276,112 | Does anyone know if its possible to add specific files uncompressed to a Android APK file during the ANT build process using build.xml? All my files live in the *assets* folder and use the same extension. I do realise that i could use a different extension for the files that i don't want to be added compressed and spec... | 2012/06/30 | [
"https://Stackoverflow.com/questions/11276112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1184595/"
] | Have a look [here](http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/)
>
> The only way (that I’ve discovered, as of this writing) to control
> this behavior is by using the -0 (zero) flag to aapt on the command
> line. This flag, passed without any accompanying argument, will tell... |
62,043,889 | When I tried to use keras to build a simple autoencoder, I found something strange between keras and tf.keras.
```
tf.__version__
```
2.2.0
```
(x_train,_), (x_test,_) = tf.keras.datasets.mnist.load_data()
x_train = x_train.astype('float32') / 255.
x_test = x_test.astype('float32') / 255.
x_train = x_train.resha... | 2020/05/27 | [
"https://Stackoverflow.com/questions/62043889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9909121/"
] | The true culprit is the default learning rate used by [`keras.Adadelta`](https://github.com/keras-team/keras/blob/master/keras/optimizers.py#L401) vs [`tf.keras.Adadelta`](https://github.com/tensorflow/tensorflow/blob/r2.2/tensorflow/python/keras/optimizer_v2/adadelta.py#L63): `1` vs `1e-4` - see below. It's true that ... |
17,357,665 | I have **two tables** for one is `category` and another one is `sub-category`. that two table is assigned to `FK` for many table. In some situation we will move one record of **sub-category** to **main category**. so this time occur constraints error because that **key** associated with other table. so i would not crea... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17357665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1089410/"
] | There might be a problem if you have multiple levels in the tree, and want to find all the subcategories of any category. This would require either multiple queries, or a recursive one.
You could instead look into the ["Nested Sets"](http://www.codeproject.com/Articles/4155/Improve-hierarchy-performance-using-nested-s... |
35,317,633 | I'm trying to write what must be the simplest angular directive which displays a Yes/No select list and is bound to a model containing a boolean value. Unfortunately the existing value is never preselected. My directive reads
```
return {
restrict: 'E',
replace: true,
template: '<select class... | 2016/02/10 | [
"https://Stackoverflow.com/questions/35317633",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1298045/"
] | There is no need for a custom sentinel image, or messing with the network. See my [redis-ha-learning](https://github.com/asarkar/spring/tree/master/redis-ha-learning) project using [Spring Data Redis](https://docs.spring.io/spring-data/data-redis/docs/current/reference/html/#reference), [bitnami/redis](https://hub.dock... |
319,327 | 
This problem has bothered me for quite some time and I can't solve it. I have even tried to make a construction, but it sometimes tips to the left and sometimes tips to the right :).
When we submerge the body in the water the water pushes it up. Tha... | 2017/03/16 | [
"https://physics.stackexchange.com/questions/319327",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/145936/"
] | The balance will be maintained because there is no EXTERNAL force applied on left or right side. This is because of the same reason you can't push a car while sitting in it! |
11,878,292 | i want to find out total number of android APIs (Classes and Methods) used in my android application source code. but i want to do it programmatically. can any one suggest me how can i do so??
Thanks in Advance | 2012/08/09 | [
"https://Stackoverflow.com/questions/11878292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/631803/"
] | You can do it with [Reflections API](http://code.google.com/p/reflections/).
You can get the list of classes using the following code :
```
Reflections ref = new Reflections("package_name");
Set<Class<?>> classes = ref.getSubTypesOf(Object.class);
```
Then by using the [Class.getDeclaredMethods()](http://docs.orac... |
47,678,197 | I tried asking this question before but was it was poorly stated. This is a new attempt cause I haven't solved it yet.
I have a dataset with winners, losers, date, winner\_points and loser\_points.
For each row, I want two new columns, one for the winner and one for the loser that shows how many points they have scor... | 2017/12/06 | [
"https://Stackoverflow.com/questions/47678197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5434602/"
] | ```
winner <- c(1,2,3,1,2,3,1,2,3)
loser <- c(3,1,1,2,1,1,3,1,2)
date <- c("2017-10-01","2017-10-02","2017-10-03","2017-10-04","2017-10-05","2017-10-06","2017-10-07","2017-10-08","2017-10-09")
winner_points <- c(2,1,2,1,2,1,2,1,2)
loser_points <- c(1,0,1,0,1,0,1,0,1)
test_data <- data.frame(winner, loser, date = as.Da... |
47,902,057 | I have a text as follows.
```
mytext = "This is AVGs_ABB and NMN_ABB and most importantly GFD_ABB This is so important that you have to CLEAN the lab everyday"
```
I want to convert it to lowercase, except the words that has `_ABB` in it.
So, my output should look as follows.
```
mytext = "this is AVGs_ABB an... | 2017/12/20 | [
"https://Stackoverflow.com/questions/47902057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can use a one liner splitting the string into words, check the words with `str.endswith()` and then join the words back together:
```
' '.join(w if w.endswith('_ABB') else w.lower() for w in mytext.split())
# 'this is AVGs_ABB and NMN_ABB and most importantly GFD_ABB this is so important that you have to clean the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.