qid int64 1 74.7M | question stringlengths 0 70k | date stringlengths 10 10 | metadata list | response stringlengths 0 115k |
|---|---|---|---|---|
35,652,459 | First I would like to note that I'm quite a beginner in using MATLABalthough I have some idea of syntax. I am working on a project trying to map the displacement of a particle in the environment. I have already manipulated all the data so it's all down to estetics.
So basically I have two matrices 12 by 19 by 15, in w... | 2016/02/26 | [
"https://Stackoverflow.com/questions/35652459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5986166/"
] | `org.springframework.web.context.ContextLoaderListener` is a class from Spring framework. As it implements the `ServletContextListener` interface, the servlet container notifies it at startup (`contextInitialized`) and at shutdown (`contextDestroyed`) of a web application.
It is specifically in charge of bootstrapping... |
36,899,591 | I have a query that takes over 2 seconds.
Here is my table schema:
```
CREATE TABLE `vouchers` (
`id` int(11) NOT NULL,
`voucher_dealer` int(11) NOT NULL,
`voucher_number` varchar(20) NOT NULL,
`voucher_customer_id` int(11) NOT NULL,
`voucher_date` date NOT NULL,
`voucher_added_date` datetime NOT NULL,
... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36899591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4588796/"
] | You'll want to use MySQLs "EXPLAIN" to determine what's going on and why.
<http://dev.mysql.com/doc/refman/5.7/en/explain.html>
To do so, simply add "EXPLAIN " prior to your statement like this:
```
EXPLAIN select *
from vouchers
where voucher_customer_id = **
and voucher_date between date and date
```
It wi... |
1,568,444 | >
> Let $X$ be locally compact, Hausdorff and non compact. Prove that if $X$ has one “end”, then $X^\wedge - X$ , (where $X^\wedge$ is any Hausdorff compactification), is a continuum (=compact, connected).
>
>
>
**Definition**
Let $X$ be a topological space. An "end" of $X$ assigns, to each compact subspace $K$ of... | 2015/12/09 | [
"https://math.stackexchange.com/questions/1568444",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/289289/"
] | This isn't true in general. For instance, suppose $X=[0,\infty)\sqcup D$, where $D$ is an infinite discrete space. Then $X$ has only one end (the one coming from $[0,\infty)$, since every connected component in $D$ is compact). But you can compactify $X$ as $X^\wedge=[0,\infty]\sqcup E$ for any compactification $E$ of ... |
67,084,877 | I had been working on a project that uses Firebase Authentication.
Everything worked fine until I updated to Flutter 2.
Now it's telling me that "User" isn't a type. I can't find anything in their changelog that might have caused this error.
```
splashScreenFunction: () async {
//// check if login
... | 2021/04/14 | [
"https://Stackoverflow.com/questions/67084877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14710307/"
] | try prefixing firebase\_auth import (like firebase\_auth)
```
import 'package:firebase_auth/firebase_auth.dart' as firebase_auth;
.
.
.
//Change
firebase_auth.User result = firebase_auth.FirebaseAuth.instance.currentUser;
``` |
70,510 | We recently changed IP schemes from `192.168.x.x` to `10.x.x.x` In doing so, I noticed that the prior network engineer had `ip default-gateway` in the configuration pointing to an old default gateway that no longer exist. I happened to notice this after our maintenance window ended.
```
ip default-gateway 192.168.10.1... | 2020/10/15 | [
"https://networkengineering.stackexchange.com/questions/70510",
"https://networkengineering.stackexchange.com",
"https://networkengineering.stackexchange.com/users/46890/"
] | A router that is configured to route does not use the `ip default-gateway`. It uses the default route, and you have that in the configuration.
Cisco has a document that explains the differences: *[Configuring a Gateway of Last Resort Using IP Commands](https://www.cisco.com/c/en/us/support/docs/ip/routing-information-... |
12,992,681 | I don't know if this is possible, I've never really used html canvas, but I am aware of
```
var imgPixels = canvasContext.getImageData(0, 0, canvas.width, canvas.height);
```
but how do I use this to get for example all the pixels with a certain color and change these pixels to white?
So let's say I have a pixel co... | 2012/10/20 | [
"https://Stackoverflow.com/questions/12992681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/926978/"
] | Do something like this (here's the [canvas cheat sheet](https://websitesetup.org/wp-content/uploads/2015/11/Infopgraphic-CanvasCheatSheet-Final2.pdf)):
```js
const canvas = document.querySelector("canvas");
const context = canvas.getContext("2d");
const { width, height } = canvas;
const gradient = context.createL... |
122,130 | How do I detect a click on a layer and find out information about the layer that was clicked?
Currently I can do the usual binding a popup and adding a click handler on the layer:
```
L.geoJson(data.streets, {
onEachFeature: function(feature, featureLayer) {
featureLayer.bindPopup(feature.properties.name... | 2014/11/14 | [
"https://gis.stackexchange.com/questions/122130",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/39543/"
] | I was assigning layers to a featureGroup, I needed to put the click handler on the featureGroup in order to get a layer reference returned. Putting it on the individual layer didn't work. |
39,158,502 | In our TFS server 2013 we have several projects
(Eg : P1, P2, **P3**, P4)
When i'm going to **check in** the codes to a single project **Eg : P3** i'm getting below listed errors in output window of visual studio 2013.
(but team connecting and other source control functions are working fine)
>
> All of the change... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39158502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2810828/"
] | It looks like something is intercepting the call and blocking it. TFS would normally always return a reponse type of `soap+xml`, `xml` or `json`, the fact you're seeing `text/html` indicates that a HTML error page is presented for some reason.
I suspect it's your Virus scanner locally (if it provides web traffic prote... |
31,421,844 | How can I get File Object from absolute Path?
The object is like when I get from `$request->file('fileInput')`.
So i can use method like `$file->getClientOriginalName()` or `$file->getClientOriginalExtension()` or something like that.
I can only find the way to get the File Object using `File::allFiles($absoluteFold... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31421844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4243035/"
] | **Request::file()** method returns objects of the class **UploadedFile**. You can create such object yourself, but it kind of kills the purpose of the class, as it's supposed to be used for, well, uploaded files :) You should use the File class instead that is the parent class of the UploadedFile. You can create such o... |
467,197 | Let $X = \operatorname{Spec} k[x]\_{(x)}$ which consists of two elements, the generic point $\zeta$ corresponding to the zero ideal and the closed point $(x)$. Define an $\mathcal{O}\_X$-module $\mathcal{F}$ by setting $\mathcal{F}(X) = \{0\}$ and $\mathcal{F}(\zeta) = k(x).$ Now $\mathcal{F}$ is not a quasi-coherent s... | 2013/08/14 | [
"https://math.stackexchange.com/questions/467197",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let $R$ be a discrete valuation ring and $X=\mathrm{Spec}(R)$. Hence, as a set, we have $X=\{\eta,x\}$. The topology is such that $x$ is closed, but $\eta$ is not (in other words, it is the Sierpinski space). The structure sheaf is given by $\mathcal{O}(\emptyset)=0$, $\mathcal{O}(\{\eta\})=\mathcal{O}\_{\eta} = K$, th... |
68,421,527 | I would like to scrape all the comments in this reddit page and then write the data into a csv file. I have written this code.
I noticed that all comments were 'div' elements with a class of 'RichTextJSON-root'.
Code written:
```
from bs4 import BeautifulSoup
import requests
import csv
# Reddit
source = requests.g... | 2021/07/17 | [
"https://Stackoverflow.com/questions/68421527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16467488/"
] | Very close. The reshaping operation should be a [`pivot_table`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.pivot_table.html) with the aggfunc set to count rather than [`pivot`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.pivot.html):
```
plot_df = (
df_winter_start.pivot_ta... |
540,937 | What does the `apt-get install ...` command do?
When I enter `apt-get install ...` command, there are some texts appearing on the screen, but that does not have enough information for me. I want to know if any file is created / edited, any service is started and other activities...
Is there any `.sh` file executed wh... | 2014/10/24 | [
"https://askubuntu.com/questions/540937",
"https://askubuntu.com",
"https://askubuntu.com/users/277876/"
] | Mostly, `apt-get` does the following things:
* checks for dependencies (and asks to install them),
* downloads the package, verifies it and then tells `dpkg` to install it.
`dpkg` will:
* extract the package and copy the content to the right location, and check for pre-existing files and modifications on them,
* run... |
31,499 | Is it possible to attain the first jhana, then remain in first jhana, while walking, talking, eating and performing other daily activities?
Or does one remain in first jhana only while in sitting meditation, then he has to leave the jhana and meditation, before he is able to perform daily activities such as walking, t... | 2019/03/12 | [
"https://buddhism.stackexchange.com/questions/31499",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/471/"
] | From [AN3.63](https://suttacentral.net/an3.63/en/sujato):
>
> With the giving up of pleasure and pain, and the ending of former happiness and sadness, I enter and remain in the fourth absorption, without pleasure or pain, with pure equanimity and mindfulness.
>
>
> When I’m practicing like this, if I **walk** medit... |
2,585,429 | It is possible to access bits of MATLAB's internal java code to programmatically change MATLAB itself. For example, you can programmatically open a document in the editor using
```
editorServices = com.mathworks.mlservices.MLEditorServices;
editorServices.newDocument() %older versions of MATLAB seem to use new()
```... | 2010/04/06 | [
"https://Stackoverflow.com/questions/2585429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/134830/"
] | There is no official documentation nor support for these classes. Moreover, these classes and internal methods represent internal implementation that may change without notice in any future Matlab release. This said, you can use my [uiinspect](http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-... |
10,121,715 | I am trying to increment progress bar and show percentage on a label. However, both remains without changes when "incrementaProgres" function is called. `IBOutlets` are properly linked on `xib` and also tested that, when function is called, variables have proper value. Thanks
from delegate:
```
loadingViewController ... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10121715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1238934/"
] | Progress bar's [progress](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIProgressView_Class/Reference/Reference.html) value is between `0.0` and `1.0`, your code sets it in the increments of `15.0`, which is out of range. Your increment should be `0.15`, not `15.0`. |
27,503,621 | I have the following code:
```
ids = set()
for result in text_results:
ids.add(str(result[5]))
for result in doc_results:
ids.add(str(result[4]))
```
Both `text_results` and `doc_results` are lists that contain other lists as items as you might have already guessed. Is there a more efficient way to do this u... | 2014/12/16 | [
"https://Stackoverflow.com/questions/27503621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864413/"
] | I would probably write:
```
ids = set(str(result[5]) for result in text_results)
ids.update(str(result[4]) for result in doc_results)
```
As for efficiency, if you want to squeeze every possible bit of performance then you first need a realistic dataset, then you can try things like `map` (or `itertools.imap` in Pyt... |
59,030,684 | I am trying to see test coverage line by line in a class, however, only the first line is highlighted.
[](https://i.stack.imgur.com/uW3o7.png)
The *Show Inline Statistics* setting is enabled.
[
Step 2 -
Generate coverage report - click on icon as shown in above image (yellow highlighted) give exported path to generate html file.
Step 3 - Click on index.html file to view report.
... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | I assume that you'd like to extract the first of two numbers in each string.
You may use the `stri_extract_first_regex` function from the [stringi](http://stringi.rexamine.com) package:
```
library(stringi)
stri_extract_first_regex(c("Pic 26+25", "Pic 1,2,3", "no pics"), "[0-9]+")
## [1] "26" "1" NA
``` |
30,778,140 | Hi I am using `gem 'carmen-rails'`
In my view I have written this
```
<%= f.country_select :country, prompt: 'Please select a country',
:id=>'curr-country' %>
```
but its not taking this id 'curr-country'. Please guide how to give id in this.
Thanks in advance. | 2015/06/11 | [
"https://Stackoverflow.com/questions/30778140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739770/"
] | You'll have to pass a second hash with the HTML options:
```
<%= f.country_select :country,
{ prompt: 'Please select a country' },
{ id: 'curr-country' } %>
```
The `carmen-rails` gem doesn't document this explicitly (it is documented [in code](https://github.com/jim/carmen-r... |
203,578 | As the question says, where do each of the browsers store their offline data, be it cache, offline storage from html5, images, flash videos or anything web related that gets stored locally. | 2012/10/20 | [
"https://askubuntu.com/questions/203578",
"https://askubuntu.com",
"https://askubuntu.com/users/7035/"
] | Firefox store the offline data in `~/.mozilla` directory, to be more specific in `~/.mozilla/profiles/xxxxxxxx.default` directory.
Chrome uses `~/.cache/google-chrome` directory for storing cache. Google chrome also uses `~/.config/google-chrome/Default` directory for storing recent history, tabs and other things.
L... |
17,718,922 | I have two classes
* Author with attributes id, papers (Paper relationship), ...
* Paper with attributes id, mainAuthor (Author relationship), authors (Author relationship) ...
and want to map some JSON to it
```
"authors": [
{
"id": 123,
"papers": [
{
"id": 1,
... | 2013/07/18 | [
"https://Stackoverflow.com/questions/17718922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184245/"
] | This is exactly what foreign key mapping is for. It allows you to temporarily store the 'identity' value that you're provided with and then RestKit will find the appropriate object and complete the relationship. |
12,157,558 | I am learning matlab myself andI have made an animated plot using matlab;now i want to save it as an video file.can you tell me how to convert my animation into a video file in matlab.Below is my code
```
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
A(i) = getframe... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12157558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/996366/"
] | use avifile:
```
aviobj = avifile('example.avi','compression','None');
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
aviobj = addframe(aviobj,gcf);
drawnow
end
viobj = close(aviobj)
``` |
71,941,740 | I have installed Visual Studio 2022 on my PC today. I have an old app, which targets .NET 4.5. I see this error when attempting to build/compile the project:
"Error MSB3644 The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this ... | 2022/04/20 | [
"https://Stackoverflow.com/questions/71941740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/937440/"
] | Because you might install a higher version of .net framework firstly, so installer might stop you install a lower version of .net framework
There is another way can try to fix it without reinstalling.
1. Download [Microsoft.NETFramework.ReferenceAssemblies.net45](https://www.nuget.org/packages/microsoft.netframework.... |
29,268,013 | I am having MAJOR usort() issues! :( So basically I want to sort my array by their values. I would like the values to display in this order: Platinum, Gold, Silver, Bronze, Complete, None, Uncomplete. Now I can sort them well, but I would like to preserve their key (is that possible?). here is my code:
```
function co... | 2015/03/25 | [
"https://Stackoverflow.com/questions/29268013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4492877/"
] | Just use `uasort` intead of `usort`. Definition of `uasort` is
>
> Sort an array with a user-defined comparison function and maintain
> index association.
>
>
>
There is an example of code with your comparing function and uasort:
```
$list = array('post1' => 'Gold', 'post2' => 'None', 'post3' => 'Platinum');
... |
4,563,993 | This is a problem that was shared to me by my old high school friend from Japan. While I did solve the problem and show him the solution, he remarked that it was a little complicated and he'd prefer a more "algebraic" approach (not sure what that means). This is why, I'm sharing it here. I'll post my own approach as an... | 2022/10/28 | [
"https://math.stackexchange.com/questions/4563993",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1092912/"
] | This is my approach. I'll add an explanation as well!
[](https://i.stack.imgur.com/vnSCr.png)
Here's how I go about it:
1.) Label the triangle $\triangle ABC$ and label the internal point $O$. Now, rotate $\triangle BOC$ by $60$ degrees clockwise su... |
8,314,823 | I have the following Linq-to-SQL query. On line #5 I'm trying to get the number of records from my Packages table where the conditions listed in my Where statement are satisfied. I think everything is correct in this code except for line #5. What did I do wrong?
```
var Overage = from s in db.Subscriptions
join p ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8314823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549273/"
] | I prefer inheritance and events too :-) Try this:
```
class MyEntryElement : EntryElement {
public MyEntryElement (string c, string p, string v) : base (c, p, v)
{
MaxLength = -1;
}
public int MaxLength { get; set; }
static NSString cellKey = new NSString ("MyEntryElement");
pr... |
46,341,399 | I have a web application that uses Apache Wicket. After the submitting of a form, I need to intercept the browser's back button, in order to redirect to the initial page, or to a expired page. How can I implement this? I try with
```
@Override
protected void setHeaders(WebResponse response) {
response.se... | 2017/09/21 | [
"https://Stackoverflow.com/questions/46341399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7465987/"
] | Interesting question!
In the screenshot you've provided, the **Name** column is cut off, so I can't tell what resource is still being served from disk cache. I'll assume that it's a service worker script, based on the description in your "EDIT".
The question I'll answer, then, is "how does the browser cache service w... |
22,800,104 | Is it possible to extract properties of a `HTML tag` using Javascript.
For example, I want to know the values present inside with the `<div>` which has `align = "center"`.
```
<div align="center">Hello</div>
```
What I know is:
```
var division=document.querySelectorAll("div");
```
but it selects the elements bet... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22800104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045807/"
] | You are looking for the [getAttribute](https://developer.mozilla.org/en-US/docs/Web/API/Element.getAttribute) function. Which is accessible though the element.
You would use it like this.
```
var division = document.querySelectorAll('div')
for(var i=0,length=division.length;i < length;i++)
{
var element = divisio... |
55,911,955 | I try:
```
public interface I { abstract void F(); }
```
I get:
>
> The modifier 'abstract' is not valid for this item in C# 7.3. Please
> use language version 'preview' or greater.
>
>
>
However I can find no mention of this feature ie in <https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8>
... | 2019/04/29 | [
"https://Stackoverflow.com/questions/55911955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460084/"
] | C# 8.0 will allow modifiers and default implementations for interface members. You can see discussion [here](https://github.com/dotnet/csharplang/issues/288) and details [here](https://github.com/dotnet/csharplang/blob/master/proposals/default-interface-methods.md)
However, the `abstract` modifier in an interface meth... |
8,706,597 | I have a nice default-value check going and client wants to add additional functionality to the `onBlur` event. The default-value check is global and works fine. The new functionality requires some field-specific values be passed to the new function. If it weren't for this, I'd just tack it onto the default-check and b... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8706597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/901426/"
] | Just store the custom variable in a [custom data attribute](http://ejohn.org/blog/html-5-data-attributes/). Not technically standards-compliant [in HTML 4], but it works:
```
<input type='text' id='field_01' value='default data' data-customvar="variableForThisField">
$(document.body).getElements('input[type=text],tex... |
8,405,711 | I would like to load an image previously loaded using GDI+ into Direct X; is it possible? I know that I can save the image to disk and then load it using:
```
D3DXLoadSurfaceFromFile
```
But I would like to use
```
D3DXLoadSurfaceFromMemory
```
with the GDI+ image loaded in memory; the GDI+ image is a *GdiPlus*::... | 2011/12/06 | [
"https://Stackoverflow.com/questions/8405711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1007264/"
] | The problem is that WebBrowser has airspace concerns. You can't overlay content on top of a WebBrowser control.
For details, see the [WPF Interop page on Airspace](http://msdn.microsoft.com/en-us/library/aa970688%28v=vs.85%29.aspx). |
30,265,728 | I have eliminated labels on the y axis because only the relative amount is really important.
```
w <- c(34170,24911,20323,14290,9605,7803,7113,6031,5140,4469)
plot(1:length(w), w, type="b", xlab="Number of clusters",
ylab="Within-cluster variance",
main="K=5 eliminates most of the within-cluster variance",
... | 2015/05/15 | [
"https://Stackoverflow.com/questions/30265728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2573061/"
] | Try setting `ylab=""` in your `plot` call and use `title` to set the label of the y-axis manually. Using `line` you could adjust the position of the label, e.g.:
```
plot(1:length(w), w, type="b", xlab="Number of clusters", ylab="",
main="K=5 eliminates most of the within-cluster variance",
cex.main=1.5,
... |
2,733,830 | Sorry - my question title is probably as inept at my attempt to do this.
I have the following (well, similar) in a table in a CMS
```
pageID key value
201 title Page 201's title
201 description This is 201
201 author Dave
301 title Page 301's tit... | 2010/04/28 | [
"https://Stackoverflow.com/questions/2733830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311757/"
] | Quick hack may be
```
select a.pageID, a.value as Title, b.value as Description, c.value as Author from Table a
left outer join Table b on a.pageID = b.pageID and b.key = 'description'
left outer join Table c on a.pageID = c.pageID and c.key = 'author'
where a.key = 'title'
```
May not be the best solution, ... |
67,868,509 | When the user typing a text in Textformfield, **onChanged** callback is triggered per character and **onFieldSubmitted** callback is triggered if the user presses enter button after finish the typing. But, I want different behavior than onChanged and onFieldSubmitted.
(What I mean by **outside** in the following is ba... | 2021/06/07 | [
"https://Stackoverflow.com/questions/67868509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12306259/"
] | As described on Media.Plugin:
>
> Xamarin.Essentials 1.6 introduced official support for picking/taking
> [photos and videos](https://learn.microsoft.com/xamarin/essentials/media-picker?WT.mc_id=friends-0000-jamont) with the new Media Picker API.
>
>
> |
563,340 | ```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{mathtools}
\begin{document}
\renewcommand{\arraystretch}{1.2}
\newcommand{\minus}{\scalebox{0.4}[1.0]{$-$}}
\[
\begin{bmatrix*}[r]
0& \minus\frac{1}{2} &\frac{1}{2} \\
\minus\frac{1}{2}& 0&\minus\frac{1}{2}\\
\frac{1}{2}& \minus\fr... | 2020/09/19 | [
"https://tex.stackexchange.com/questions/563340",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/221248/"
] | I wouldn't reduce the size of the `0` numerals. If you believe that they look too big in relation to the text-style `\frac{1}{2}` expressions, maybe what's *really* needed is to replace the `\frac` terms with their decimal representations -- of course while aligning the numbers on their (explicit or implicit decimal ma... |
144,739 | Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed? | 2008/09/27 | [
"https://Stackoverflow.com/questions/144739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23087/"
] | Yes, it's possible. I have several combinations in my servers. I have one server that has both SQL Server 2000 and 2005 installed side by side. My desktop at work is a Windows 2003 Server, and I have SQL Server 2005 and 2008 installed side by side.
What you want is called a named instance. There will be a screen durin... |
19,343 | I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:
```
series1|Series 1 Name
series2|Series 2 Name
```
correspond to the images names and the tokeniz... | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19343",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1691/"
] | "Promoted to front page" can be used as a views filter. So you could create views based on that (so it displays node teasers that have a certain taxonomy and are "Promoted to front page").
Another simple way to mimic "Promoted to front page" is to add a taxonomy select field to your content types, and then the taxonom... |
43,633,263 | I have a Spring boot project that uses spring-kafka. In this project I've built some event driven components that wrap spring-kafka beans (namely KafkaTemplate and ConcurrentKafkaListenerContainer). I want to make this project a reusable library accross a set of Spring boot applications. But when I add dependency to th... | 2017/04/26 | [
"https://Stackoverflow.com/questions/43633263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3484517/"
] | Im found work around to solve this problem by creating AutowireHelper.java and AutowireHelperConfig.java
Put it under spring config folder > util
>
> AutowireHelper.java
>
>
>
```
package com.yourcompany.yourapplicationname.config.util;
import org.springframework.context.ApplicationContext;
import org.springfra... |
8,495,507 | When I draw lines in my program the position is perfect, but when I use those same coordinates for a square or oval they are way off the mark. My code is:
```
g2d.drawRect(one1, one2, two1, two2);
g2d.drawOval(one1, one2, two1, two2);
```
And the points are gather by:
```
one1 = (int)e.getX();
one2 = (int)e.getY();... | 2011/12/13 | [
"https://Stackoverflow.com/questions/8495507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/639627/"
] | Alright, I got what your problem is. If you see the below image, the way that the parameters taken by oval and sqaure are different from the line.
To draw a line --> You will have to specify the starting point and the ending point. Just passing them directly to the Graphics object would do the job for you. However for... |
31,164,883 | I want to click on a checkbox and if I click this box it should run a function what gets an ID and saves it into an array or deletes it from the array if it still exists in the array.
That works, but if I click on the text beside the box the function runs twice. It first writes the ID into the array and then deletes i... | 2015/07/01 | [
"https://Stackoverflow.com/questions/31164883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5068532/"
] | Looks like the AWS Node JS has a bug, in that we need not mention the data type for the keys.
I tried this and it worked well
```
{
"RequestItems":{
"<TableName>":{
"Keys":[
{"<HashKeyName>":"<HashKeyValue1>", "<RangeKeyName>":"<RangeKeyValue2>"},
{"<HashKeyName>":"<HashKeyValue2>", "<RangeKey... |
30,311,640 | The error message of gcc 4.9.2 is:
```
could not convert from '<brace-enclosed initializer list>' to 'std::vector<std::pair<float, float> >'
```
of this code:
```
vector<pair<GLfloat, GLfloat>> LightOneColorsPairVec {{0.5f, 0.5f, 0.5f, 1.0f}, {0.0f, 0.0f, 1.0f, 1.0f}};
```
The code is compiled with 'std=c++11' co... | 2015/05/18 | [
"https://Stackoverflow.com/questions/30311640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3163389/"
] | First of all because [`std::pair`](http://en.cppreference.com/w/cpp/utility/pair) doesn't have [constructor](http://en.cppreference.com/w/cpp/utility/pair/pair) that takes a [`std::initializer_list`](http://en.cppreference.com/w/cpp/utility/initializer_list). Secondly because `std::pair` is a *pair*, it only have two v... |
59,674,527 | Before registering Product Variations (myVariations), I need to check if variations already exist.
*One*:
I want to register variation 2 and 6. I need to look in the *allVariations* array for this variation that contains the same *product\_detail\_id*
*Two*:
2 and 6 would return true because both belong to the same p... | 2020/01/10 | [
"https://Stackoverflow.com/questions/59674527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12686390/"
] | Took me a while, probably has a better way but this works as it supposed to:
Also works while for more than 2 elements
```js
const allVariations = [
{ product_detail_id: 1, variation_id: 2 },
{ product_detail_id: 1, variation_id: 5 },
{ product_detail_id: 2, variation_id: 4 },
{ product_detail_id: 2, vari... |
40,349,778 | I hava a list of sings:
```
var sings = [",",".",":","!","?"]
```
How do I check if a word contains one of these signs and return it?
For example:
```
"But,"
return ","
"Finished."
return "."
"Questions?"
return "?"
``` | 2016/10/31 | [
"https://Stackoverflow.com/questions/40349778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583481/"
] | You could solve that with a regular expression:
```js
function match(input) {
var regex = /([,\.\:!\?])/;
var matches = input.match(regex);
return matches ? matches[0] : false;
}
console.log(match("foo?")); // "?"
console.log(match("bar.")); // "."
console.log(match("foobar")); // false
``` |
14,635,594 | Is there any extension or feature in VS2010 for previewing in multiple browsers (at the same time) the same as there is in Microsoft Expression Web 4? I know there is the "Default Browser Switcher" extension but this only lets you view one browser at a time.
Cheers
Will | 2013/01/31 | [
"https://Stackoverflow.com/questions/14635594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1510736/"
] | When you right click on the page to do the "Browse With...", you can set multiple defaults. Once you have added in multiple browsers to the list, you can CTRL Click each one you want (to highlight multiples). Once the desired ones are highlighted, click "Set as Default". From then on, whenever you hit "Browse" it shoul... |
891,714 | We have application which is using some additional files from one catalog. Right now when some of this file is changed we need to log in to each application container clone repository and copy files to catalog. We want to automate this process without rebuilding/restarting whole application.
Is there some native appro... | 2018/01/11 | [
"https://serverfault.com/questions/891714",
"https://serverfault.com",
"https://serverfault.com/users/278626/"
] | Have a look at PersistentVolume [Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) matrix. What you are looking for is either ROX or RWX support. ROX is more common but you'll need some side process to update the content. RWX give you full access to change content on these volu... |
1,532,937 | I know this is a pretty simple question, but I'm just not getting the textbook... I'm taking a basic CS course and on one of the problems (not an assigned homework problem, just one I'm practicing on), it says that
>
> on the set of all integers, the relation $x \ne$ y is symmetric but not transitive where $(x,y) \i... | 2015/11/17 | [
"https://math.stackexchange.com/questions/1532937",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/264450/"
] | Let $f(x)=x^p$
By convexity $$f(\frac{X+Y}{2})\leq \frac{1}{2} f(X)+\frac{1}{2} f(Y) \implies \frac{(X+Y)^p}{2^p}\leq\frac{1}{2} X^p+\frac{1}{2}Y^p$$
The result follows. |
104,851 | We started learning about electromagnetism in physics class, and the Right Hand Rule comes in handy as seems easy to use, but I'm curious as to how it actually works. I guess it's more of a math question since I think it just involves solving the cross product of the velocity of the charge and the magnetic field. I don... | 2014/03/23 | [
"https://physics.stackexchange.com/questions/104851",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/41058/"
] | The formula for the force of a particle due to its magnetic field is $F = q \vec v \times \vec B$. The cross product has the property that its result is always perpendicular to both arguments.
Its direction is simply a result of how the cross product function is defined and the sign of electric charge (an electron is ... |
16,810,876 | I have an Iphone application in which I had 10 tab items in the tab bar.
I don't want to add the more button behaviour of the tab bar here.
Instead of that **I need to make my tab bar as scrollable**.
Can anybody had the idea or links to illustrate this?
Can anybody guide me in the right direction? | 2013/05/29 | [
"https://Stackoverflow.com/questions/16810876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/834925/"
] | But You can not use the `UITabbar`. You need to create custom `UITabbar` that behave the same.
Here are links of some projects will help you more.
1. [Infinte Tab Bar](https://www.cocoacontrols.com/controls/infinitabbar)
2. [Scrollable Tab Bar](https://github.com/jasarien/JSScrollableTabBar) |
13,155,318 | Can somebody please suggest me when would I need a Level-Order Traversal (to solve some practical/real-life scenario)? | 2012/10/31 | [
"https://Stackoverflow.com/questions/13155318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | [Level order traversal](http://en.wikipedia.org/wiki/Tree_traversal#Queue-based_level_order_traversal) is actually a Breadth First Search, which is not recursive by nature.
From: <http://en.wikipedia.org/wiki/Breadth-first_search>
Breadth-first search can be used to solve many problems in graph theory, for example:
... |
275,272 | If I build a module with a indexer, is Magento going to run the reindex automatically each night or do I need to create a cronjob for it? | 2019/05/20 | [
"https://magento.stackexchange.com/questions/275272",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/40598/"
] | If you want the reindex happen automatically, you need to set a cronjob for that. Please refer [here](https://magento.stackexchange.com/questions/269624/how-to-check-whether-the-reindex-working-or-not-in-magento) for detailed explanations: |
528,999 | I have two servers in a pool with Nginx, PHP5-FPM and Memcached. For some reason, the first server in the pool seems to inexplicably lose about 2GB of RAM. I can't explain where it's going.
A reboot gets everything back to normal, but after a few hours the RAM is used again.
At first I thought it was down to memcach... | 2013/08/06 | [
"https://serverfault.com/questions/528999",
"https://serverfault.com",
"https://serverfault.com/users/123168/"
] | The machine is a virtual guest running on **ESXi** hypervisor. What about **memory ballooning**? First of all, I would recommend you to check ESXi/vCenter memory/balloon statistics of this guest.
It can happen that the hypervisor asked the guest to "inflate" the balloon in order to allocate some additional memory, e.... |
40,128,449 | Hi I remove my ssl cert from my website. I fixed the database from showing HTTPS and remove the necessary lines from htaccess file . but for now - anyone how trying to enter to my wordpress website get an error message (because the ssl...) How can I forward the user from HTTPS TO HTTP?
htaccess below:
```
text/x-gene... | 2016/10/19 | [
"https://Stackoverflow.com/questions/40128449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7041592/"
] | An approach I use when creating a table where I know all the possible sections is with enums. You create an enum for each of the possible section types:
`enum SectionTypes { case sectionA, sectionB, sectionC }`
And then create a variable to hold the sections:
`var sections: [SectionTypes]`
When you have your data... |
11,460,673 | Bellow is a PHP script.
I tried to implement the Observer pattern (without MVC structure)... only basic.
The error which is encountered has been specified in a comment.
First I tried to add User objects to the UsersLibrary repository. There was a error such as User::update() does not exists or something.
Why is that... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11460673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1393475/"
] | Your `User` class is not implementing `interface IObserver` and therefore is not forced to have the method `update()`.
You have to instantiate a `new User()` in order to add it to the `UsersLibrary`:
```
$library = new UsersLibrary();
$user = new User(1, "Demo");
$library->add($user);
```
Also, you are mixing **Use... |
35,336,711 | I have this array of objects.
```
[ { geom: '{"type":"Point","coordinates":[-3.81086160022019,50.4619066354793]}' },
{ geom: '{"type":"Point","coordinates":[-4.038333333,51.17166667]}' },
{ geom: '{"type":"Point","coordinates":[-4.286666667,50.99666667]}' },
{ geom: '{"type":"Point","coordinates":[-4.006666667,5... | 2016/02/11 | [
"https://Stackoverflow.com/questions/35336711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3346163/"
] | You can do this without `underscore` as well. You just have to loop over array and return `currentObj.geom`. Also, `currentObj.geom` is a string, so you would need `JSON.parse`
```js
var a = [ { geom: '{"type":"Point","coordinates":[-3.81086160022019,50.4619066354793]}' },
{ geom: '{"type":"Point","coordinates":[-4... |
1,465,880 | This is quoted from Feynman's lectures [The Dependence of Amplitudes on Position](http://www.feynmanlectures.caltech.edu/III_16.html)
:
>
> In Chapter 13 we then proposed that the amplitudes $C(x\_n)$ should vary with time in a way described by the Hamiltonian equation. In our new notation this equation is
> $$iℏ\fr... | 2015/10/05 | [
"https://math.stackexchange.com/questions/1465880",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | HINT:
[Taylor's Theorem](https://en.wikipedia.org/wiki/Taylor%27s_theorem#Statement_of_the_theorem) with the Peano form of the remainder is
$$C(x\pm b)=C(x)\pm C'(x)b+\frac12 C''(x)b^2+h(x;b)b^2 \tag 1$$
where $\lim\_{b\to 0}h(x;b)=0$.
Now, add the positve and negative terms in $(1)$ and see what happens. |
52,521,159 | I tried to adapt the 2d platformer character controller from this live session: <https://www.youtube.com/watch?v=wGI2e3Dzk_w&list=PLX2vGYjWbI0SUWwVPCERK88Qw8hpjEGd8>
Into a 2d top down character controller. It seemed to work but it is possible to move into colliders with some combination of keys pressed that I couldn'... | 2018/09/26 | [
"https://Stackoverflow.com/questions/52521159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10419464/"
] | simplifying, unity checks for collision each frame in a synchronized way (for the sake of frame drop compensation), if your object is moving fast (covering a great distance in a short time), there's a chance of your object pass through a wall in that exactly time gap of a collision check and another.
as well stated and... |
34,633,844 | I need to create a XAML `textbox` immediately after another `textbox` using code-behind. Maybe something like this:
Before
```
<StackPanel>
<TextBox Name="TextBox1"/>
<TextBox Name="TextBox2"/>
<TextBox Name="TextBox3"/>
</StackPanel>
```
After
```
<StackPanel>
<TextBox Name="TextBox1"/>
<TextB... | 2016/01/06 | [
"https://Stackoverflow.com/questions/34633844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5719584/"
] | You need to name the `StackPanel` to reference it in code, and you need the index of the preceding `TextBox`:
```
var index = this.stackPanel1.Children.IndexOf(TextBox2);
this.stackPanel1.Children.Insert(index + 1, new TextBox { Name = "InsertedTextBox" });
``` |
17,266,818 | Trying to split the `http://` from `http://url.com/xxyjz.jpg` with the following:
```
var imgUrl = val['url'].split(/(^http:\/\/)/);
```
And, even though I can get my desired result with the code above, I get some extra parameters that I would like not to have.
Output:
>
> ["", "http://", "url.com/xxyjz.jpg"]
> ... | 2013/06/24 | [
"https://Stackoverflow.com/questions/17266818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971392/"
] | You could use `match` instead of `split`:
```
var matches = str.match(/(http:\/\/)(.*)/).slice(1);
```
That will give you the array you want. |
433,810 | I have trouble displaying an abbreviation nicely.
Removing largesmallcaps is a small improvement, but looks really bad in full document. I want normal numbers in the rest of the document.
How can I make the zero appear the correct size and differentiate it nicely from the O?
MWE:
```
\documentclass{article}
\usepac... | 2018/05/28 | [
"https://tex.stackexchange.com/questions/433810",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/81219/"
] | This can be achieved by combining `multirow` from the eponymous package with `rotatebox` from the `graphicx` package as follows:
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
\begin{table}[!ht]
\centering
\begin{tabular}{llll... |
13,074,250 | I am trying to display the correct button and link depending on what device the user browses to a page on. If android display android app store button if ios display apple store button.
I cannot seem to get it to swap at all even though im making the function default to swap it from android to apple button.
Here is t... | 2012/10/25 | [
"https://Stackoverflow.com/questions/13074250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1775052/"
] | Keep in mind, I do NOT program gmp, but a tail-dynamic buffer in a struct is usually implemented something like this (adapted to how I think you want to use it):
```
typedef struct
{
size_t length; //length of the array
size_t numbits; //number of bits allocated per val in vals
mpz_t vals[1]; //flexible array ... |
112,536 | I found myself in an interesting puzzle. Here is the simplified version:
I have a flight from A to C, connecting through B. I decide that from B I actually want to go to D, so I buy a separate ticket for that journey\*. The B-C and B-D flights are around the same time and with the same airline\*\*. Will there be a pro... | 2018/04/06 | [
"https://travel.stackexchange.com/questions/112536",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/62048/"
] | **No**, there won't be any problem. Separate bookings are separate bookings and don't affect each other, even on the same airline.
I will note, however, that if you make a habit of buying A-B-C tickets and getting off at B, and give your frequent flyer number every time, the airline will eventually get grumpy. However... |
18,456,454 | we have a client application that plays flash files (.swf). This works on all other mobiles except iphone as Apple doesn't support Flash. Is there any workaround to play these flash files in iphone using HTML5 or any other tweaking? Since there aren't any answers to this question recently, I am submiting this question. | 2013/08/27 | [
"https://Stackoverflow.com/questions/18456454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2682102/"
] | No, there is no way to display a Flash file (SWF) in the iPhone browser.
If you have access to the source of the Flash files in the application, it may be possible to export them as HTML5 from the Flash builder. There's no way to do this conversion just from the SWFs, though.
As an aside: your application won't work ... |
32,785,066 | I'm trying to read some French character from the file but some symbols comes if letter contains à é è.
Can anyone guide me how to get actual character of the file.
Here is my main method
```
public static void main(String args[]) throws IOException
{
char current,org;
//String strPath = "C:/Documents a... | 2015/09/25 | [
"https://Stackoverflow.com/questions/32785066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4485283/"
] | You're trying to read UTF-8 character actually using ASCII. Here's an example of how to implement your feature:
```
public class Test {
private static final FILE_PATH = "c:\\temp\\test.txt";
public static void main(String[] args){
try {
File fileDir = new File(FILE_PATH);
BufferedReader i... |
14,639,130 | My JSON data is like
```
{
"Brand":["EM-03","TORRES"],
"Price":["5.00000","10.00000","15.00000"],
"Country":["US","SG"]
}
```
I want to loop that JSON data to get
```
Brand =
EM-03 -
TORRES
Price =
5.00000 -
10.00000 -
15.00000
Country = US - SG
``` | 2013/02/01 | [
"https://Stackoverflow.com/questions/14639130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474420/"
] | With [`$.each`](http://api.jquery.com/jQuery.each/)
```
$.each(data, function(key, value){
console.log(value);
});
``` |
358,755 | **I'm pretty sure this happens to someone out there now and then:**
You've read a question, done the work with writing a pretty decent answer, at least you think you have, then you find some detail in the question, either edited in at a later time or maybe not clearly defined in the title or pointed out in the context... | 2020/12/26 | [
"https://meta.stackexchange.com/questions/358755",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/201397/"
] | It can respond to another answer, but you still need to give at least a partial answer to the question.
Thus, answering like this is okay:
>
> My experience about @X's answer (link) is negative, although I used a newer version of (...). Instead, what I did is (explanation), and now it works.
>
>
>
[(example)](ht... |
40,059 | I would like to say in German,
>
> I would love to talk sometime.
>
>
>
So far I have this,
>
> Ich würde gerne mal reden.
>
>
>
Is *reden* the right verb here? How would you say it? | 2017/11/05 | [
"https://german.stackexchange.com/questions/40059",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/21516/"
] | Your translation works.
Another possibility would be
>
> Ich würde mich gerne mal mit dir unterhalten
>
>
>
Which is a way to ask for a conversation some time in the future. The “dir“ is used when talking to a friend or close co-worker while it can be exchanged with “Ihnen“ to suit a more formal setting. |
25,406,330 | I have a star image in my activity. Now when the user clicks on that star image, that image should change to **ON Star image**, Same as favorite star image. For this I use the following code :
```
ImageView star=(ImageView)findViewById(R.id.favorite);
star.setOnTouchListener(new OnTouchListener()
{
... | 2014/08/20 | [
"https://Stackoverflow.com/questions/25406330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3898113/"
] | Use an OnClickListener instead of an OnTouchListener.
```
ImageView star=(ImageView)findViewById(R.id.favorite);
star.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
star.setImageResource(android.R.drawable.star_big_on);
}
});
... |
43,278,020 | In the success part of my ajax each result gets put into columns.
What I am trying to achive is every 4 columns it will create a new row.
Question: On success part of ajax how to make it so every after every 4 columns will create a new row?
```
<script type="text/javascript">
$("#select_category").on('keyup', functi... | 2017/04/07 | [
"https://Stackoverflow.com/questions/43278020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4419336/"
] | Remove one line from your css
```
tbody {
height: 100%;
display: block;//<--- Remove this line
width: 100%;
overflow-y: auto;
}
``` |
6,110,068 | **Assuming an invariant culture**, is it possible to define a different group separator in the format - than the comma?
```
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Console.WriteLine(String.Format("{0:#,##0}", 2295));
```
Output:
```
2,295
```
Desired output:
```
2.295
```
The inva... | 2011/05/24 | [
"https://Stackoverflow.com/questions/6110068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77884/"
] | When you have different format strings, this does not mean that you have to use InvariantCulture. If you have a format string for germany e.g. you format this string using the Culture("de-de"):
```
String.Format(CultureInfo.GetCultureInfo( "de-de" ), "{0:0},-", 2295) //will result in 2.295,-
String.Format(CultureInfo.... |
601,834 | I need to terminate an unused op amp and plan to use the [recommended circuit](https://youtu.be/gwQiFuckMz0?t=727) below with +3.3V. How do I choose the resistor values? The op amp I'm using is the [MCP6002](https://www.microchip.com/en-us/product/MCP6002) ([datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/MC... | 2021/12/26 | [
"https://electronics.stackexchange.com/questions/601834",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/303644/"
] | The op-amp has rail-to-rail input capabilities hence, you can tie the unused input to either: -
* 3V3 or
* 0 volts
Noting this from the DS: -
[](https://i.stack.imgur.com/T7p9M.png)
I'd probably tie IN+ to 0 volts.
>
> *What determines a reasonab... |
6,598,247 | I made a survey and gave to certain user Contribute permission to answer the survey.
Appears that even if you give to user "Read" permissions Action bar is still available.
Is there any chance to hide "Action bar" for limited permission users? | 2011/07/06 | [
"https://Stackoverflow.com/questions/6598247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/671141/"
] | Try using the `onbeforeunload()` function or jQuery [unload()](http://api.jquery.com/unload/) |
46,182,318 | I am trying to make a simple 'Simon Game'. I am currently stuck trying to add a class 'on' to a div for one second, then remove that class for the same amount of time.
So I have four divs that I am blinking on and off depending on a sequence of numbers, e.g. `[0, 1, 2, 3]`. This would blink `div[0]` on for one second ... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46182318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4030469/"
] | I think you could turn a list of buttons into a sequence of commands. Then you could use a single `setInterval` to play commands until it runs out of commands. The `setInterval` could use 1 second intervals if you want on and off to take just as long, but you could also set it to a little faster to easily allow for dif... |
7,188,989 | >
> **Possible Duplicate:**
>
> [Set array key as string not int?](https://stackoverflow.com/questions/3231318/set-array-key-as-string-not-int)
>
>
>
I know you can do something like
`$array["string"]` in php but can you also do something like this in C# instead of using arrays with numbers? | 2011/08/25 | [
"https://Stackoverflow.com/questions/7188989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/911848/"
] | Arrays in PHP are in reality more like dictionaries in C#. So yes, you can do this, using a [**`Dictionary<string, YourValueType>`**](http://msdn.microsoft.com/en-us/library/xfhwa508.aspx):
```
var dict = new Dictionary<string, int>();
dict["hello"] = 42;
dict["world"] = 12;
``` |
48,273,719 | I'm new to programming. Here is the code I try to use:
```
<div style="width: 300px;">
texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext
</div>
```
So, the problem is the text won't break after `300px`. Why and how can I fix that? | 2018/01/16 | [
"https://Stackoverflow.com/questions/48273719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9222224/"
] | this also work
```css
div{
word-wrap: break-word;
width: 300px;
}
```
```html
<div>
texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext
</div>
``` |
73,901,048 | Very simple, I want to round my 'base\_price' and 'entry' with the precision, here 0.00001. It doesn't work because it converts it to a scientific number.
How do I do this; I have been stuck for 1 hour.
Some post says to use `output="{:.9f}".format(num)` but it adds some zero after the last 1.
It work with `precision... | 2022/09/29 | [
"https://Stackoverflow.com/questions/73901048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18578687/"
] | If you want to round to a precision given by a variable, you can just do
```py
precision = 0.00001
entry = 0.031525
entry_price = round(entry / precision) * precision
``` |
42,339,632 | I am not able to understand the forced need of permission check in my code.
Moreover, even after doing that, the location is null.
This is the code of my onCreate method:
Please help!!
```
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layo... | 2017/02/20 | [
"https://Stackoverflow.com/questions/42339632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7591842/"
] | In D3 4.0 the [callback function for the `.on()` method is passed 3 arguments](https://github.com/d3/d3-selection#handling-events): the current datum (d), the current index (i), and the current group (nodes).
Within the mouseover callback, you can `selectAll("rect")`, and filter out items which are in the current grou... |
12,863,043 | I've looking looking at this with no success so far. I need a regular expression that returns me the string after the one in a phone number. Let me give you the perfect example:
phone number (in exact format i need): 15063217711
return i need: 5063217711 --> so the FIRST char if its a 1 is removed. I need a regular e... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12863043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/835883/"
] | For a playlist DEFINITELY the database. The preferences is just a simple key-value pair. |
55,763,548 | I have following docker file.
```
MAINTANER Your Name "youremail@domain.tld"
RUN apt-get update -y && \
apt-get install -y python-pip python-dev
# We copy just the requirements.txt first to leverage Docker cache
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
CO... | 2019/04/19 | [
"https://Stackoverflow.com/questions/55763548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1972924/"
] | One solution could be to use a docker-entrypoint.sh script. Basically that entrypoint would allow you to define a set of commands to run to initialize your program.
For example, I could create the following docker-entrypoint.sh:
```
#!/bin/bash
set -e
if [ "$1" = 'app' ]; then
sh /run-my-other-file.sh
exec pyt... |
465,096 | Hello we have an SQL server application running over a low bandwith connection.
We use ADO.NET.
I was wondering if anybody has any tips on minimizing traffic over the channel.
Im looking for answers on ADO.NET/SQL-Server specific tips that make it more efficient.
Not obvious answers like "dont fetch many records".
E... | 2009/01/21 | [
"https://Stackoverflow.com/questions/465096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44894/"
] | I would use the OUTPUT clause present in SQL SERVER 2008 onwards...
[**OUTPUT Clause (Transact-SQL)**](http://msdn.microsoft.com/en-us/library/ms177564.aspx)
Something like...
```
BEGIN TRANSACTION
DELETE [table] OUTPUT deleted.* WHERE [woof]
ROLLBACK TRANSACTION
```
INSERTs and UPDATEs can use the 'inserted' t... |
41,084,005 | I have three divs red, black and green. I want red div whose height is 45mm and next black div on its right whose height is 55mm and then green div just below the red div and green div height is 50mm.
I am using the code
```
<div style="height:45mm;width:30mm;border:1mm solid red;float:left;position:relative;">
</div... | 2016/12/11 | [
"https://Stackoverflow.com/questions/41084005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6482428/"
] | This uses a flexbox with direction of column, wrap, and tight constraints (height and width). I've used `order` to change the order of the elements, but you can just switch the order in the HTML.
```css
#container {
display: flex;
flex-direction: column;
flex-wrap: wrap;
width: 35mm;
height: 105mm;
}
... |
73,667,680 | My program is loading some news article from the web. I then have an array of html documents representing these articles. I need to parse them and show on the screen only the relevant content. That includes converting all html escape sequences into readable symbols. So I need some function which is similar to `unEscape... | 2022/09/09 | [
"https://Stackoverflow.com/questions/73667680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18572447/"
] | There are several packages at CRAN that may help:
* [Ryacas](https://cran.r-project.org/package=Ryacas) interfacing yacas
* its predecessor [Ryacas0](https://cran.r-project.org/web/packages/Ryacas0/index.html)
* [rim](https://cran.r-project.org/web/packages/rim/index.html) interfacing maxima
* [caracas](https://cran.r... |
41,368,915 | I want to use sqlite with the json extension so I've installed it with homebrew. When I run `which sqlite` though, the one that is being used is the anaconda install. If I try and use pythons sqlite library I have the same issue. It's linked to the Anaconda version and the JSON functions aren't available. How do I repl... | 2016/12/28 | [
"https://Stackoverflow.com/questions/41368915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6862111/"
] | Sqlite installed by Homebrew is keg-only, which is not linked to /usr/local/... .
This is because system already have older version of `sqlite3`.
If you really want to invoke Homebrew's sqlite binary, specify full path as below.
```
$ /usr/local/opt/sqlite/bin/sqlite3
```
(All Homebrew package is symlinked under... |
3,004 | I swear that for the past couple of weeks or so the speed of responses on serverfault.com has really degraded from what it used to be. Is it time to beef that site up a little? | 2012/02/23 | [
"https://meta.serverfault.com/questions/3004",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/1592/"
] | Are you sure it's nothing at your end? I've noticed no difference here. |
20,113,314 | I have database having hundreds of tables with relations. I want to look a db design for understanding tables relations in a single place. Any idea how I can do this?
Regards | 2013/11/21 | [
"https://Stackoverflow.com/questions/20113314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/966709/"
] | If it is displaying a different hour you may need to set the default timezone after setting the dateFormat (this happens only after ios7)
```
[dateFormat setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
```
it seems that the default timezone is the one the device has, so if you no specify the default timez... |
60,942,686 | Brand new to Python and could use some help importing multiple Excel files to separate Pandas dataframes. I have successfully implemented the following code, but of course it imports everything into one frame. I would like to import them into df1, df2, df3, df4, df5, etc.
Anything helps, thank you!
```
import pandas... | 2020/03/31 | [
"https://Stackoverflow.com/questions/60942686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13160761/"
] | The easiest way to do that is to use a list. Each element of the list is a dataframe
```
def get_files():
directory_path = input('Enter directory path: ')
filenames = glob.glob(directory_path + '/*.xlsx')
number_of_files = len(filenames)
df_list = []
for f in filenames:
data = pd.read_excel... |
201,164 | a few weeks ago, we setup a cronjob that wipes the entire contents of /tmp every Sunday at 5am. I wasn't really convinced that this is a good idea. Today we discovered that a certain task depended on an existing directory inside /tmp - the task was broken, and worse, it remained silence about why it failed. The questio... | 2010/11/12 | [
"https://serverfault.com/questions/201164",
"https://serverfault.com",
"https://serverfault.com/users/39808/"
] | It's not a bad idea to do something about stale old files in /tmp, but I'm not sure that nuking the contents is the best thing you could do.
My CentOS servers use something called tmpwatch, which runs daily and can be configured to remove only files that haven't been accessed in a certain period (30 days is a popular ... |
56,406,047 | I have a table view which has card kind of cells as shown in picture.
I have set the content Inset so that I can get the cells with 20px spacing in left,right and top.
[](https://i.stack.imgur.com/zEaDl.png)
tableVw.contentInset = UIEdgeInsets(top: 2... | 2019/06/01 | [
"https://Stackoverflow.com/questions/56406047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4253261/"
] | Have a look at the [API for the datasets](https://docs.ckan.org/en/2.7/api/) that will likely be the easiest way to do this.
In the meantime, here is how you can get the API links at id level from those pages and store the entire package info for all packages in one list, `data_sets`, and just the info of interest in ... |
59,837,873 | I have a problem that should be easy to solve but I simply cannot figure it out. I have a huge dataset with groups and a variable. Some groups are empty for this variable (filled only with NAs) and some contains values but also NAs.
For example:
```
ID <- c("A1","A1","A1","A1","B1","B1","B1","B1", "B1", "C1", "C1", "... | 2020/01/21 | [
"https://Stackoverflow.com/questions/59837873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9804952/"
] | You can use a simple if` statement, i.e.
```
library(dplyr)
library(tidyr)
data %>%
group_by(ID) %>%
mutate(Value1 = if (all(is.na(Value1))){Value1}else{replace_na(Value1, 0)})
```
which gives,
>
>
> ```
> # A tibble: 12 x 2
> # Groups: ID [3]
> ID Value1
> <fct> <dbl>
> 1 A1 0
> 2 A1 ... |
2,914 | Specifically for the SpaceX SES-8 mission going on right now. But, generally, how long does it take for a satellite to reach GEO at a minimum? | 2013/11/25 | [
"https://space.stackexchange.com/questions/2914",
"https://space.stackexchange.com",
"https://space.stackexchange.com/users/603/"
] | In theory, the shortest practical time from spacecraft separation would be about five and a quarter hours, which is half of a geosynchronous transfer orbit. At apogee, which is carefully placed to occur over the equator, a single burn raises the perigee and changes the inclination of the orbit, and you're there. All ea... |
68,473,791 | ```
#include <iostream>
using namespace std;
int main(){
int a=0 , b=0;
cin>>a>>b;
for(int i = a+1;i < b;i++){
int counter = 0;
for(int j = 2;j <= i / 2;j++){
if(i % j == 0){
counter++;
break;
}
}
if(counter == 0 && i!= ... | 2021/07/21 | [
"https://Stackoverflow.com/questions/68473791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16497151/"
] | You haven't provided any code so, I may not give you exact answer but you can try this:
```
st={'captchaId': '67561984031', 'code': '03AGdBq26D5XwT-p6LuAwftuZ3gUcvj0dB7lhZUT7OOfKIZU_wZzN03CCVZAaRGzzD0rXVbsJOjTBN1Ed2d0v0X6Tl2wQQPbT_R1lRHOkh5FFU46MN3tfVbajIFyZfZHUHZAt_h-5yY0cVqfJTy1_fwebyr-ilN_N1R04214z9WVXg9-cuSYJD9a2c... |
32,037 | I'm using a tablet with Android 2.2. Is there something like `Tab` to switch to the next form field? | 2012/10/19 | [
"https://android.stackexchange.com/questions/32037",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/18840/"
] | Is this what you are looking for [paid app]: <https://play.google.com/store/apps/details?id=com.vmlite.vncserver&hl=en>
However, if you are willing to go through a lengthy process [but free], you can follow the tutorial [here](http://www.howtogeek.com/howto/42491/how-to-remote-view-and-control-your-android-phone/) to... |
26,697,879 | I have a "rawqueryset" object that its fields can be vary in term of some business rules. How can I access to its count and name of fields in corresponding template?
View.py
```
objs=MyModel.objects.raw(sql)
return list(objs)
```
template.py
```
{%for obj in objs%}
{{obj.?}}
{{obj.?}}
.
?
{%en... | 2014/11/02 | [
"https://Stackoverflow.com/questions/26697879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1843934/"
] | I solved this issue using two filters:
template.py:
```
{% load my_tags %}
{%for obj in objs%}
{%for key in obj|get_dict %}
{% with d=obj|get_dict %}
{{key}} - {{ d|get_val:key }}
{% endwith %}
{%endfor%}
{%endfor%}
```
my\_tags.py:
```
@register.filter(name='get_dict')
def ge... |
17,254,122 | I'm making a core data model, and I have a Client entity that has a to-many relationship to an Appointment entity. An Appointment can turn into a Transaction (if it has been paid for etc.), and I need to keep track of the Appointments of Clients that have turned into Transactions (where Transaction is an entity along w... | 2013/06/22 | [
"https://Stackoverflow.com/questions/17254122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/362840/"
] | It sounds like the ajax call is made when one of the elements is clicked, but you need to pass different values in the ajax call depending on which element is clicked. Rather than use an "onclick" attribute, you could do the following:
HTML:
```
<div class="test" data-param1="value1a" data-param2="value2a">hi</div>
<... |
608,991 | I have setup a Remote Desktop Gateway server using Windows Server 2012 R2. I am using the Remote Desktop Gateway as an intermediary between to provide the remote desktop session over 443 since 3389 is blocked at many client locations.
However, I ran into a problem with a client who's network seems to be using an web p... | 2014/06/30 | [
"https://serverfault.com/questions/608991",
"https://serverfault.com",
"https://serverfault.com/users/228593/"
] | As of 2008 [a Microsoft employee indicated there was "no official way" to accomplish this](http://social.technet.microsoft.com/Forums/windowsserver/en-US/a341fda4-10ef-4c4c-8646-3ff10bea3a38/connecting-to-ts-gateway-through-a-web-proxy?forum=winserverTS). Given the six intervening years you'd like to think there has be... |
73,315,389 | I am trying to create a new data frame using R from a larger data frame. This is a short version of my large data frame:
```
df <- data.frame(time = c(0,1,5,10,12,13,20,22,25,30,32,35,39),
t_0_1 = c(20,20,20,120,300,350,400,600,700,100,20,20,20),
t_0_2 = c(20,20,20,20,120,300,350,400,600,700... | 2022/08/11 | [
"https://Stackoverflow.com/questions/73315389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7033156/"
] | You could calculate the time difference for each column with `summarise(across(...))`, and then transform the data to long.
```r
library(tidyverse)
df %>%
summarise(across(-time, ~ sum(diff(time[.x > 300])))) %>%
pivot_longer(everything(), names_to = c(".value", "height"), names_pattern = "t_(.+)_(.+)")
# # A ti... |
3,739,753 | I'm trying to figure out how to unit test my object that persists itself to session state.
The controller does something like...
```
[HttpPost]
public ActionResult Update(Account a)
{
SessionManager sm = SessionManager.FromSessionState(HttpContext.Current.Session);
if ( a.equals(sm.Accoun... | 2010/09/17 | [
"https://Stackoverflow.com/questions/3739753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69983/"
] | Here's an idea: Create a session manager "persistence" interface:
```
public interface ISessionManagerPersist
{
SessionManager Load();
void Save(SessionManager sessionManager);
}
```
Create an HTTPSession-based implementation of your persistence:
```
public class SessionStatePersist : ISessionManagerPersist... |
653,858 | I've just been wondering because I see this on ubiquity and want to know how this is better during the installation of Ubuntu. | 2015/07/28 | [
"https://askubuntu.com/questions/653858",
"https://askubuntu.com",
"https://askubuntu.com/users/409520/"
] | If you are not plugged, then your laptop battery may be dead before the
installation is finished, if you have a laptop. **;)**
The result can be a ruined or incomplete installation and you have to start over. Assuming your hard drive still functions. |
2,477 | Many people learn foreign languages at school, which often involves [learning vocabulary lists](https://languagelearning.stackexchange.com/q/2462/800). Others learn languages through [immersion](https://languagelearning.stackexchange.com/questions/tagged/immersion). Each method has its benefits and drawbacks.
What ar... | 2016/12/09 | [
"https://languagelearning.stackexchange.com/questions/2477",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/800/"
] | In a [YouTube video from September 2016](https://www.youtube.com/watch?v=A6IIH49dt-g), the British polyglot Olly Richards explains that he had been learning **Cantonese without learning to read and write**. He had been following the advice to focus on oral skills first, and he found that it kept the **momentum** going ... |
24,080,285 | I gave margin 20px for both the div inside sidebar div. But for some reason the gap between two div's us just 20px, which should be 40px. 20px from box1 and 20px from box2. Am I missing some minor thing. please point it out.
**Fiddle:**
<http://jsfiddle.net/3UJWf/>
**HTML:**
```
<div class="sidebar">
<div clas... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24080285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2177755/"
] | [Check Demo](http://jsfiddle.net/3UJWf/3/)
[CSS Margin Collapsing](https://stackoverflow.com/questions/102640/css-margin-collapsing)
`float:left;` or `display: inline-block` solves the above issue
Let’s explore exactly what the consequences of collapsing margins are, and how they will affect elements on the page.
*... |
2,036,862 | I have a mapping defined where a parent object has a collection of child objects. In my design, I'd like to be able to delete the child objects without having to remove them from the collection on the parent object and re-saving the parent object. However, when I try this, I get the "deleted object would be re-created ... | 2010/01/10 | [
"https://Stackoverflow.com/questions/2036862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/129648/"
] | It is doable, no problem.
There is the `$_REQUEST` array that merges GET, POST, and COOKIE values but the better way would be to handle GET and POST manually in your script.
Just have your engine check both `$_GET["variable"]` and `$_POST["variable"]` and use whichever is set. If a variable is set in both methods, y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.