Search is not available for this dataset
qid int64 1.35k 73.7M | question stringlengths 83 22.1k | date stringlengths 10 10 | metadata sequence | response_j stringlengths 32 15.5k | response_k stringlengths 32 9.22k |
|---|---|---|---|---|---|
836,058 | If $0\le\alpha\le\frac{\pi}{2}$, then which of the following is true?
A) $\sin(\cos(\alpha))<\cos(\sin(\alpha))$
B) $\sin(\cos(\alpha))\le \cos(\sin(\alpha))$ and equality holds for some $\alpha\in[0,\frac{\pi}{2}]$
C) $\sin(\cos(\alpha))>\cos(\sin(\alpha))$
D) $\sin(\cos(\alpha))\ge \cos(\sin(\alpha))$ and equalit... | 2014/06/16 | [
"https://math.stackexchange.com/questions/836058",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/155795/"
] | 
[peterwhy](https://math.stackexchange.com/users/89922/peterwhy) has proved what the plot shows. | Let $a=\cos{x}$, $b=\sin{x}$, and $a,b \in[0,1]$. We are now going to see which one ($\sin{a}$ or $\cos{b}$) is larger?
Noticg that $a$ and $b$ satisfy $a^2+b^2=1$, and if we regard the value $a$ and $b$ as a pair $(a,b)$ on the $(a,b)$-plane, it should be a circle with radius $1$ in the first quadrant.
If $\sin{a}=\... |
15,209,574 | Given the following HTML...
```
<div class="tester">
<div>a</div>
<div>abcd efgh ijkl mnop qrst abcd efgh ijkl mnop qrst abcd efgh ijkl mnop qrst abcd efgh ijkl mnop qrst </div>
<div>c</div>
</div>
```
How would I change this css to make the 3 divs above appear in a single row? The middle div I wish to c... | 2013/03/04 | [
"https://Stackoverflow.com/questions/15209574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/131270/"
] | Use display inline, here's a little demo:
[Demo](http://jsfiddle.net/B9ttJ/6/)
HTML:
```
<div class="tester">
<div>a</div>
<div>abcd efgh ijkl mnop qrst abcd efgh ijkl mnop qrst abcd efgh ijkl mnop qrst abcd efgh ijkl mnop qrst
<div>c</div>
</div>
```
CSS:
```
.tester div {
display:inline;
}
```
... | use the display property
```
display: inline-block;
``` |
11,795,498 | I'm having this situation and I'm wondering if i could do it with regex:
I have a string in this format:
```
{{We all}} love {{stackoverflow}}.
```
My question is how can I use regex replace to get:
```
match1 love match2
``` | 2012/08/03 | [
"https://Stackoverflow.com/questions/11795498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/715283/"
] | You do need to add `/socket.io/socket.io.js` anywhere. If you have installed socket.io via `npm install socket.io` your application knows how to handle it. I played around with socket.io myself a few months back and this is a very simple "chat" that I came up with and it worked. So it might help you out! (I am using Ex... | **I finally resolved this**
The socket.io script doesn't exists as flat file. It is **generated by node.js server** and served to browser. So. including it by:
`<script src="/socket.io/socket.io.js"></script>`
Works only if node.js server is started on the same port as the web server with web application. If you try... |
445,910 | i write program that parse text with regular expression. Regular expression should be obtained from user. I deside to use glob syntax for user input, and convert glob string to the regular expression internally. For example:
```
"foo.? bar*"
```
should be converted to
```
"^.*foo\.\w\bar\w+.*"
```
Somehow, i n... | 2009/01/15 | [
"https://Stackoverflow.com/questions/445910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42371/"
] | no need for incomplete or unreliable hacks. there's a function included with python for this
```
>>> import fnmatch
>>> fnmatch.translate( '*.foo' )
'.*\\.foo$'
>>> fnmatch.translate( '[a-z]*.txt' )
'[a-z].*\\.txt$'
``` | In R, there's the `glob2rx` function included in the base distribution:
<http://stat.ethz.ch/R-manual/R-devel/library/utils/html/glob2rx.html> |
59,505,221 | I'm trying to send a uint8\_t and two floats as bytes (not as the actual characters in the numbers) from a Python program over a serial connection to an Arduino (ATtiny1614 using megaTinyCore). Currently, on the Python side, I have this:
```py
Serial.write(b"\x01" + struct.pack("<ff", float1, float2))
```
On the Ard... | 2019/12/27 | [
"https://Stackoverflow.com/questions/59505221",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5282060/"
] | It seems that my serial port connection was unreliable. I was using the built-in connection on a Jetson Nano (/dev/ttyTHS1). When I switched to a USB to Serial adapter, the code worked perfectly. | Another approach is to use an existing protocol library like Firmata (which is supported for Arduino, Python, and many other platforms) to transfer your data. It takes care of synchronization, encoding, parsing, and decoding for you, so you don't have to worry about representation, packing, endedness, etc. |
46,096,941 | This line:
```
using (FileStream fs = File.Open(src, FileMode.Open, FileAccess.Read, FileShare.Read))
```
throws:
>
> System.IO.IOException: The process cannot access the file 'X' because
> it is being used by another process.
>
>
>
When I replace the line with:
```
File.Copy(src, dst, true);
using (FileStre... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46096941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2224701/"
] | When you open a file there is a check for access modes and sharing modes. The access modes of any process must be compatible with the sharing modes of others. So if A wants access to read, others must have allowed reading in sharing mode. Same for writing.
If process A has opened a file for writing and you say `Shari... | >
> But why I can copy, which surely reads the whole content of file
>
>
>
Well, conceptually it reads the whole file, though it can happen at a lower level than copying streams. On Windows it's a call to the [`CopyFileEx`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363852(v=vs.85).aspx) system fun... |
13,432,941 | I want to ask is there a way to get information from JCheckBox without actionListener. In my code I scan a file of strings and each line has data which, if selected, should be added to an array in my program. Problem is that i will never know how many JCheckBoxes I will have, it depends from file.
So, my question is h... | 2012/11/17 | [
"https://Stackoverflow.com/questions/13432941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1832175/"
] | Add your checkboxes to a collection, and when the button is pressed, iterate through the checkboxes and get the text associated with each checked checkbox:
```
private List<JCheckBox> checkBoxes = new ArrayList<JCheckBox>();
...
while ((info = Buffer.readLine()) != null) {
if (info != null) {
J... | If you store the checkboxes (e.g. in a `List`) you can loop over them and query their selected state when the OK button is pressed.
To obtain the `String` from the checkbox, you could opt to use the `putClientProperty` and `getClientProperty` methods, as explained in the class javadoc of `JComponent` |
3,510,059 | Series $$\sum\_{n=1}^{\infty}\left(\frac{1}{3}\right)^n\cdot\left(\frac{n+1}{n}\right)^{n^2}$$
I tried Abel, Dirichlet theorems and it seems like divergent series but I don’t know the series a can compare to (for proving of divergence)
//i’m sorry that I can’t post images cuz due to reputation, this is my first quest... | 2020/01/15 | [
"https://math.stackexchange.com/questions/3510059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/742144/"
] | Use <https://en.m.wikipedia.org/wiki/Root_test>
to find $$\dfrac13\cdot \lim\_{n\to\infty}\left(1+\dfrac1n\right)^n=\dfrac e3<1$$ | $0 < (1/3)^n[(1+1/n)^n]^n <$
$(1/3)^ne^n=(e/3)^n=:a^n$, where $a<1$.
$\sum a^n$ is convergent, now use comparison test.
Used: $(1+1/n)^n$ is increasing, bounded from above by $e$.
Recall: $\lim\_{n\rightarrow \infty}(1+1/n)^n=e.$
[Show that $\left(1+\dfrac{1}{n}\right)^n$ is monotonically increasing](https://math.... |
52,322,314 | How to verify if the invisible web page is loaded or not .
Because of problems in Internet connection or loading the page from the website i get error in display like "the web page can't display" in Internet Explorer for XP or windows 7 or 10 .
Need for way to tell me if web page loaded successfully or have problem... | 2018/09/13 | [
"https://Stackoverflow.com/questions/52322314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5399258/"
] | A bit clueless here, it works for me in this reproduction:
```js
import { ComponentFixture, TestBed, } from '@angular/core/testing';
import { Component, Injectable, OnInit } from '@angular/core';
import { of, forkJoin } from 'rxjs';
@Injectable({providedIn: 'root'})
export class Service { // service to be mocked
re... | It's from a bit that this question was did but i'll hope that in any case it will help.
This should works fine:
```
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import { TestComponent } from 'someLoca... |
3,764,858 | What is the difference in these two statements in python?
```
var = foo.bar
```
and
```
var = [foo.bar]
```
I think it is making var into a list containing foo.bar but I am unsure. Also if this is the behavior and foo.bar is already a list what do you get in each case?
For example: if foo.bar = [1, 2] would I g... | 2010/09/21 | [
"https://Stackoverflow.com/questions/3764858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/330013/"
] | `[]` is an empty list.
`[foo.bar]` is creating a new list (`[]`) with `foo.bar` as the first item in the list, which can then be referenced by its index:
```
var = [foo.bar]
var[0] == foo.bar # returns True
```
So your guess that your assignment of `foo.bar = [1,2]` is exactly right.
If you haven't already, I re... | >
> I think it is making var into a list containing foo.bar but I am unsure. Also if this is the behavior and foo.bar is already a list what do you get in each case?
>
>
>
* Yes, it creates a new list.
* If `foo.bar` is already a list, it will simply become a list, containing one list.
```
h[1] >>> l = [1, 2]
h[1... |
1,418 | I currently have a tomato plant planted in a pot on my porch. It is doing quite nicely and is tied to a 6' bamboo cane. Unfortunately my cane has started to lean a bit and I am afraid that as the plant continues to grow and eventually starts bearing fruit that the cane will not be able to do its job, or that the pot ma... | 2011/07/22 | [
"https://gardening.stackexchange.com/questions/1418",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/36/"
] | Add another cane =) (or stick)
Adding a cane inside the pot should reinforce the first one and prevent mechanical failure.
This doesn't address the issue of the pot becoming top heavy and unstable. If it looks like it might fall over, add another cane (or two) so that the cane(s) rest on the ground outside the pot ... | For tomato plants, a conical cage that looks like this is the best way to go. This way, you provide support at each stage of the plant's growth and there are multiple points (on each circle) for you to tie the fruits to.

However, this requires that ... |
29,357,327 | I have the following Ruby script which is supposed to insert the names of the files into the *contents* array:
```
filelist = Dir.glob('C:\Users\abc\Desktop\drg\*.*')
print filelist
filelist.each do |filepathname|
contents = IO.read(filepathname)
puts contents
end
```
For the above code, I get no output for ... | 2015/03/30 | [
"https://Stackoverflow.com/questions/29357327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/588855/"
] | Use File#join
-------------
In your current string, the backslash acts as an escape character, not a path separator. A more verbose, but potentially more canonical, approach is to use [File#join](http://ruby-doc.org/core-2.2.0/File.html#method-c-join) to join the parts of your path using File::SEPARATOR. For example:
... | [Dir.glob](http://ruby-doc.org/core-2.2.1/Dir.html#method-c-glob) uses the backslash as an escape character, so the path will not be what you think it is. To quote:
>
> Escapes the next metacharacter.
>
>
> Note that this means you cannot use backslash on windows as part of a glob, i.e. Dir["c:\foo\*"] will not wor... |
364,139 | Here is a version of differential pair:
[](https://i.stack.imgur.com/UoHAG.png)
I can understand the working principle of differential pair above. When Ic1 increases Ic2 decreases that's the thing. And for that to happen the tail current must be cons... | 2018/03/23 | [
"https://electronics.stackexchange.com/questions/364139",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/125197/"
] | An ideal current source has infinite output impedance (i.e. \$dV/dI = \infty\$). A real current source is equivalent to an ideal current source in parallel with some finite output impedance Ro.
A current source in parallel with a resistor is equivalent to a voltage source in series with a resistor ([source transforma... | The resistor keeps the tail current fairly constant, constant enough.
If the magnitude of V- is much more than the of Vin range, then the current is fairly constant indeed.
There is a common mode gain, RC/2RE, but it's much smaller than the differential gain, RC/2(Qx intrinsic Re), and for many purposes, this degree ... |
142,609 | A player of mine had an interesting concept where two parties who are opposed to each other would play at the same time in the same session. In essence the plot would be a group of thieves have been hired to steal some kind of magical artefact from a castle, and the first part of the session would be this group infiltr... | 2019/03/06 | [
"https://rpg.stackexchange.com/questions/142609",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/52858/"
] | Sounds like [Epic Adventures](http://dndadventurersleague.org/start-here/conventions) from Adventurers League.
>
> D&D Epics are exciting multi-table events where participants cooperate in a “mass raid” of truly EPIC proportions; as every table works toward the same goal, individual tables act as squads that might ta... | With two opposing parties the game will go painfully slowly for both.
=====================================================================
The Basic [loop](https://www.dndbeyond.com/compendium/rules/basic-rules/introduction#HowtoPlay) of D&D is:
1. The DM describes the environment.
2. The players describe what they ... |
52,695 | In a vlog made by a Chinese vlogger about the possibility of working and earning money in Germany, he said, “德国的社会制度就象一个熨斗,当你刚开始想卷的时候,它一下子就把你烫平了。”
What does the sentence mean? What does the word 卷 here mean? | 2022/10/09 | [
"https://chinese.stackexchange.com/questions/52695",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/17398/"
] | I would say both EEQ and Tang Ho are correct. 卷 originally means curling up. This sentence uses the iron as a metaphor, so the society prevents people from "curling up".
But what does the author mean when they says a person curls up? That's related to EEQ's explanation of 卷 as a Internet shorthand for 内卷 (involution, ... | "德国的社会制度就象一个熨斗,当你刚开始想卷的时候,它一下子就把你烫平了。"
German's social system is like a smoothing iron, when the society(you) starts to **roll up/curl(卷)**, it will immediately iron/smooth it(you) down.
The sentence means, in Germany, when a new societal trend/wave **goes against the norm (卷)**, it is likely will be put down/straigh... |
3,200,050 | I was thinking $f(n)=|n|$, but realized that would be a surjection. I'm not sure of how to solve this. Thank you. | 2019/04/24 | [
"https://math.stackexchange.com/questions/3200050",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/638602/"
] | Let $f(n)=2(n+1)$ if $n\ge0$ and $-2n-1$ if $n<0$.
This maps {$0,1,2,...$} to {$2,4,6,...$} and {$-1,-2,-3,...$} to {$1, 3, 5, ...$};
i.e., {$..., -3, -2, -1, 0, 1, 2, ...$} to {$1,2,3,4,5,6,...$}.
The inverse map is $f^{-1}(m)=\dfrac m 2 -1 $ if $m$ is even and $-\dfrac{m+1}2$ if $m$ is odd. | Here's another solution: let $f(n)=2^n $ if $n>0, 2^{-n}-1$ otherwise. |
61,441 | Suppose S is a genus g surface with n punctures satisfying the hyperbolicity condition 2g + n - 2 > 0. If n > 0 the fundamental group of the surface is a free group on 2g + n - 1 := m generators.
If we look the universal covers of different punctured surfaces with the same m (e.g., thrice-punctured sphere and once-pu... | 2011/04/12 | [
"https://mathoverflow.net/questions/61441",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14314/"
] | The simplest case, where $g=0, n=3$ and $g = n = 1$ yield isomorphic groups (free of rank 2), can be written explicitly using a little $2 \times 2$ matrix calculation. We choose a fundamental domain in the upper half-plane made out of two vertical lines with real parts $-1$ and $1$, and two semicircles whose diameters ... | For the thrice-punctured sphere, there is a generating set where both generators are parabolic. For the once-punctured torus only the commutator (and its conjugates) is parabolic. Hence any element that can be part of a generating set is hyperbolic.
Thinking in the upper half-plane model of $\mathbb H$, the Farey set... |
56,092,725 | I need help writing this next() method in this class. I've tried several stuff, but I keep getting that I'm not returning the next value, but rather null.
The instructions for this class reads: This class should be public, non-static, and should implement java.util.Iterator. It's index instance variable should be ini... | 2019/05/11 | [
"https://Stackoverflow.com/questions/56092725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10572727/"
] | First of all, my understanding is, that your data is inside elementData and size gives the number of elements stored inside.
iterator() gives you an iterator. Your Iterator implementation has index as a point to the current element.
What do you plan to store inside index? I see 2 possibilities:
a) it is giving you th... | Like this:
```
public class MHPQIterator implements java.util.Iterator<E>
{
private int index=0;
public boolean hasNext()
{
return (index < size);
}
public E next()
{
return elementData[index++];
}
}
``` |
37,319,736 | I have the below hibernate native query as shown below the idea is not to use the native query and switch to hibernate criteria api
```
<![CDATA[select count(iilnmp.INV_LINE_NOTE_ID) from IOA_INV_LINE_NOTE_MAP iilnmp ,
IOA_INVOICE_LINE_NOTES iiln , IOA_INVOICE_LINE... | 2016/05/19 | [
"https://Stackoverflow.com/questions/37319736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6355442/"
] | You shouldn't use `commandLine` + `args` together in a Gradle `Exec` task. Either use `commandLine` with executable and all arguments as the value, or `executable` + `args` which is the better alternative usually. | My gradle file contained a snippet to get the aws auth token and I was getting the same failure - `Caused by: java.io.IOException: error=2, No such file or directory`
In my case, the issue was not caused due to caching.
It was due to gradle not being able to find the aws binary.
What worked for me - Use the `which a... |
29,991,407 | I want to run `x` function for `n` seconds. What I tried:
```
var stop = false;
setTimeout(function(){stop = true}, n);
while(!stop) x();
```
but this didn't work... As I understood the reason is that setTimeout waiting until no task is running and then executes the function. Is that right?
Another way to do thi... | 2015/05/01 | [
"https://Stackoverflow.com/questions/29991407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3546760/"
] | ```
var stop = false;
setTimeout(function(){stop = true}, n);
var interval = setInterval(function(){
if(!stop){x();}else{clearInterval(interval);}
}, 0);
```
the while statement will block the timeout function, if you don't mind using setInterval, you can do it like this. | You can schedule it repeatedly while time's not up:
```
var runRepeatedly = function(f, secs) {
var start = Date.now();
var reschedule = function() {
var now = Date.now();
if (now - start < secs * 1000) {
setTimeout(repeat, 0)
}
}
var repeat = function() {
f();
reschedule();
};
re... |
48,737,886 | With ES5 constructor and prototype approach I can add public (prototype) properties as below:
```
function Utils(){}
Utils.prototype.data = {};
var utils = new Utils();
console.log(utils.data); //{}
```
The ES6 `class` allows me to define only public methods in the class. I build an app with a class-approach and I... | 2018/02/12 | [
"https://Stackoverflow.com/questions/48737886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5388390/"
] | You can use AJAX to fetch content from the server and display that content in the second column. Below is a sample application illustrating this concept:
**app.py**
```
from flask import Flask, render_template
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
app.config['DEBUG'] = True
@app.route('/')
def... | Answer is not short, and I cannot accomplish it fully with just parts of code that you've provided, but I can give you some guidance so you can continue.
Change your /PLOT route to return json instead of rendering template.
```
@app.route('/plot')
def plot():
...
return flask.jsonify(jsongraph)
```
Then you... |
47,270 | I thought about posting this in English.SE, but since it occurs in a university setting, I decided to post here - hopefully it's on-topic.
I have been working on a project that is being transitioned to another group member so she could take over the project. The project involves the design, development, and applicati... | 2015/06/16 | [
"https://academia.stackexchange.com/questions/47270",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/35916/"
] | I have typically seen the word "Draft" used, as in:
>
> Draft Model of X (Date)
>
>
>
If you want to track multiple drafts over time, then you can give a version number as well:
>
> Draft Model of X (Version N, Date)
>
>
> | I suggest using term *"intermediate"*, as it IMHO most accurately reflects the incomplete status of the project. Therefore, the title of the corresponding report might be formulated like the following:
>
> "[Topic of the report]: Intermediate technical report by [group name].
> Version x.y.z from [date]"
>
>
> |
58,039,133 | i'm using GPS NEO 6m with esp8266(NODEMCU) and uploading data to firebase
Using
" Serial.print(gps.location.lat(), 6);" shows "Latitude= 34.200271"
But How to save **Latitude as local variable with 6 decimal degits ?**
using " float latitude=(gps.location.lat()); only saves 34.20 "
and " float latitude=(gps.location.... | 2019/09/21 | [
"https://Stackoverflow.com/questions/58039133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12098976/"
] | When using a Trusted Web Activity with the recommended [android-browser-helper library](https://github.com/GoogleChrome/android-browser-helper/), the application will check for an installed browser that supports Trusted Web Activity, giving preference to the user's preferred browser.
If there's no browser that support... | I just checked my TWA and it is working for particular browsers as follows:
* Chrome without any problem
* Edge on first launch shows message running in edge, later works as expected
* Opera working as expected
* Samsung browser - asks to open in browser, but works fine in browser. hides address bar if opened in brows... |
69,299,586 | I suddenly get this error and not sure why.I did not change the `"react-router-dom": "^6.0.0-beta.4"` version. But the `"react-dom": "^16.8.4"`" had changed to `"react-dom": "^16.13.1"`,
Dunno if that had anything to do with I don't know but the `useRoutes` comes from `"react-router-dom"` and that's where the error ori... | 2021/09/23 | [
"https://Stackoverflow.com/questions/69299586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11749004/"
] | I have had a similar issue with material kit ui, and i fixed it simply just write `path:""`. leaving the path empty will fix the problem | I have seen the error message and it clearly explains that path "/" should not be given under route "app".So try changing the path to some other valid name or remove it. |
12,483 | >
> (As for women past child-bearing, who have no hope of marriage) and do
> not need to get married, (it is no sin for them) for such women (if
> they discard their (outer) clothing) in front of strange people (in
> such a way as not to show adornment) without adorning themselves or
> showing their adornment to s... | 2014/04/16 | [
"https://islam.stackexchange.com/questions/12483",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/3775/"
] | God wants women to hide from strangers anything that might be attractive for them, but he says it's no blame if an old woman doesn't put on outer garment. but not to the extent that they also show anything attractive.
`زینه` = anything attractive!
**Q\*.1**
Anything that might be attractive!
**Q1.2**
The logi... | Here is the translation:
>
> And women of post-menstrual age who have no desire for marriage -
> there is no blame upon them for putting aside their **outer garments**
> [but] not displaying adornment. But to modestly refrain [from that] is
> better for them. And Allah is Hearing and Knowing.
>
>
>
Please note... |
29,056 | We already have a large list of the [Best book ever on Number Theory](https://math.stackexchange.com/questions/329/best-ever-book-on-number-theory), but I'm looking for a more targeted response for analytic number theory.
Specifically, I'm taking a trip on which I may or may not have access to internet resources, nor... | 2011/03/25 | [
"https://math.stackexchange.com/questions/29056",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/7346/"
] | Of course, the second book in their sequence: [Montgomery and Vaughn Chapters 16-27 draft version](http://www-personal.umich.edu/%7Ehlm/math775/handouts.html) (online only)
Here are some other well known titles (in no particular order):
>
> H. Iwaniec and E. Kowalski, Analytic Number Theory
>
>
> H. Davenport, Mul... | I would also add to Eric's answer that Tenenbaum's "Introduction to Analytic and Probabilistic Number" is a great resource if one is limited to the number of books you can carry. |
3,699,154 | I have a demo server where I put samples of my apps, I send potential customers links to those apps. Is it possible to use htaccess to track visitors, *without* adding tracking capability to the apps themselves? The data I'm interested in are:
1. date and time of page visit
2. ip of visitor
3. url of the page visited
... | 2010/09/13 | [
"https://Stackoverflow.com/questions/3699154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/66580/"
] | That entirely depends on your webserver, what options it provides for htaccess overrides.
For Apache, the access log logs what you are looking for
<http://httpd.apache.org/docs/current/logs.html#accesslog>
but is **not configurable via htaccess**. | I know this thread has been quiet for a while, but i it not possible to use the ***prepend***?? directive that prepends a script to all visits to track site/page visits ?
I have not got the code (tried something similarthough was not successfull) but I used the prepend directive to prepend a script that "switches" on ... |
16,383,242 | I'm very new to Android development (have some Obj-C experience with Cocoa Touch though). I was testing my first Android app as I encountered these syntax errors:
>
> Syntax error on token "100000", invalid VariableDeclaratorId
>
>
> Syntax error on token "11", delete this token
>
>
> Syntax error on token "2", d... | 2013/05/05 | [
"https://Stackoverflow.com/questions/16383242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2024727/"
] | You cannot declare variable names starting with numbers. | Take a look at the RES directories. You might have a file with the numerical sequence mentioned above, eg 00000002. To solve the problem, simply remove it from the folder. |
2,938,969 | I would like to know how to translate the following code to codebehind instead of XAML:
```
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip"
Value="{Binding RelativeSource={RelativeSource Self},
Path=(Validation.Errors)[0].ErrorContent}"/... | 2010/05/30 | [
"https://Stackoverflow.com/questions/2938969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99367/"
] | I think I finally found a solution:
First, in a header file, declare `memset()` with a pragma, like so:
```
extern "C" void * __cdecl memset(void *, int, size_t);
#pragma intrinsic(memset)
```
That allows your code to call `memset()`. In most cases, the compiler will inline the intrinsic version.
Second, in a sepa... | Just name the function something slightly different. |
37,319,736 | I have the below hibernate native query as shown below the idea is not to use the native query and switch to hibernate criteria api
```
<![CDATA[select count(iilnmp.INV_LINE_NOTE_ID) from IOA_INV_LINE_NOTE_MAP iilnmp ,
IOA_INVOICE_LINE_NOTES iiln , IOA_INVOICE_LINE... | 2016/05/19 | [
"https://Stackoverflow.com/questions/37319736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6355442/"
] | You shouldn't use `commandLine` + `args` together in a Gradle `Exec` task. Either use `commandLine` with executable and all arguments as the value, or `executable` + `args` which is the better alternative usually. | I had similar issue.. With Vampire's solution, I was able to step up.. However the issue seems to be the sh file not able to point to the exact file location.
Meaning, even with workingDir (wherein actual sh file resides) set properly, still was getting the following exception.
```
Caused by: java.io.IOException: err... |
85,127 | According to <https://www.google.com/design/spec/style/icons.html#icons-system-icons>, icon size should be 24dp.
This size is pretty elegant looking, yet doesn't make icon recognition difficult, as material styled icons are minimalist design. There isn't much detail inside the icon body.
But, is this rule applicable,... | 2015/09/28 | [
"https://ux.stackexchange.com/questions/85127",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/27708/"
] | I think the issue you're having is because you're sticking to guidelines as laws on one side, and you're misunderstanding things a little bit (I admit Google Material is not clear about this, it's more like inference after viewing, studying and working on lots of Material design apps). A clue is given on the [same page... | I think the thing to remember here is that the material design guidelines are just that, guidelines - and good design and common sense should always override them.
In your example - whilst most flag designs are recognisable when small, the 32dp clearly flows better and the larger size does not obstruct your design.
T... |
3,377,464 | I have a Chipmunk shape, with a body, in a space. I am removing the body from the space so that I can position it and not have it fall due to gravity etc. I need to be able to make this body move, so I am not making it static.
I need the body to update it's position according to the position of a Cocos2D sprite in the... | 2010/07/31 | [
"https://Stackoverflow.com/questions/3377464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407371/"
] | That depends on what environment the JS is running in.
If you are in a browser which supports mp3 and the HTML5 audio API, then you can load the mp3 in an `<audio>` element and access the [duration property](http://www.w3.org/TR/html5/media-elements.html#dom-media-duration) via the DOM. If you are using some sort of F... | There is actually a library that can run client-side, attempting to fetch just enough of the MP3 to read the ID3 tags:
<http://github.com/aadsm/JavaScript-ID3-Reader>
Since you are using server-side JavaScript, you can directly read files from the server and do pretty much anything you want. If you can't find any lib... |
316,352 | In Java, you can qualify local variables and method parameters with the final keyword.
```
public static void foo(final int x) {
final String qwerty = "bar";
}
```
Doing so results in not being able to reassign x and qwerty in the body of the method.
This practice nudges your code in the direction of immutabilit... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32174/"
] | My personal opinion is that it is a waste of time. I believe that the visual clutter and added verbosity is not worth it.
I have never been in a situation where I have reassigned (remember, this does not make objects immutable, all it means is that you can't reassign another reference to a variable) a variable in erro... | Why would you want to? You wrote the method, so anyone modifying it could always remove the final keyword from qwerty and reassign it. As for the method signature, same reasoning, although I'm not sure what it would do to subclasses of your class... they may inherit the final parameter and even if they override the met... |
6,758,706 | It just appears like this in Google Chrome:
```
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1 align="center">Hello World!<br/>Welcome to My Web Server.</h1>
</body>
</html>
```
Why isn't it transforming as expected?
Edit: Yes the file does have an .html filename. I'm not sure it should need a header ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6758706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/812013/"
] | It should be rendered by the browser, not the webserver. Check the HTTP headers "Content-Type". It should read something like "Content-Type: text/html; charset=utf-8".
Given your using Chrome, load up developer tools using the following steps;
1. Right click the page -> Choose "Inspect Element"
2. Go to the network t... | From the file content you posted contains the explanation:
```
<meta name="Generator" content="Cocoa HTML Writer">
```
Basically, your text editor thought you wanted to *convert* the "text" you had entered to a webpage. So it saved it as a webpage that displays exactly what you have entered.
How did you save the f... |
3,200,050 | I was thinking $f(n)=|n|$, but realized that would be a surjection. I'm not sure of how to solve this. Thank you. | 2019/04/24 | [
"https://math.stackexchange.com/questions/3200050",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/638602/"
] | Let $f(n)=2(n+1)$ if $n\ge0$ and $-2n-1$ if $n<0$.
This maps {$0,1,2,...$} to {$2,4,6,...$} and {$-1,-2,-3,...$} to {$1, 3, 5, ...$};
i.e., {$..., -3, -2, -1, 0, 1, 2, ...$} to {$1,2,3,4,5,6,...$}.
The inverse map is $f^{-1}(m)=\dfrac m 2 -1 $ if $m$ is even and $-\dfrac{m+1}2$ if $m$ is odd. | Define $f$ as follows:
$$
f(n) = \left\{\begin{array}{lr}
2^n , & \text{when } n \ge 0 \\
3^{|n|} , & \text{when } n \lt 0
\end{array}\right\}
$$ |
3,020,746 | >
> [](https://i.stack.imgur.com/wacyF.gif)
>
>
> Given that ABC is an isosceles triangle, $[BD]$ is angle bisector, $\angle BDA = 120^\circ$. Evaluate the degree of $\angle A $
>
>
>
Could you help me approach this problem using sine law?
Her... | 2018/11/30 | [
"https://math.stackexchange.com/questions/3020746",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/533847/"
] | Let $x$ be the measure of $\angle ABD$
and $y$ be the measure of $\angle BAC$
$x+y+ 120 = 180\\
4x + y = 180$
And solve the system of equations.
Regrading law of sines.. that might be useful you knew more side lengths. Right now all you know is that the triangle is isosceles. | We have that since $\angle BDC=60° \implies \angle ACB=\angle ABC=80\*$ and $\angle BAC=20°$.
To find the result by law of sine let
* $BC=a $
* $AB=AC=b$
* $BD=x$
* $DC=y$
* $\angle BAC=\alpha$
then we have to solve the following systems of $5$ equations in $5$ unknowns
* $\frac{a}{\sin \alpha}=\frac{b}{\sin 80}$
*... |
66,884,049 | Is it possible somehow to preform logical functions on arrays like eg.
```
a= [1,2,3,4,5,6]
b= [1,3,5,7]
c= a and b
resulting in c=[1,3,5]
```
so only the values that are present in both the arrays.
The same with or eg:
```
d = a OR b
resulting in b=[1,2,3,4,5,6,7]
```
Is this possible somehow in python or ar... | 2021/03/31 | [
"https://Stackoverflow.com/questions/66884049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3851151/"
] | Lists do not support logical operations , but you can do it in sets:
```
a= [1,2,3,4,5,6]
b= [1,3,5,7]
c = list(set(a) | set(b))
d = list(set(a) & set(b))
print(c)
# OUTPUT: [1, 2, 3, 4, 5, 6, 7]
print(d)
# OUTPUT: [1, 3, 5]
``` | Here is your snippet:
```
def and_array(a, b):
return [a[i] for i in range(min(len(a), len(b))) if a[i] in b or b[i] in a]
def or_array(a, b):
return a + [element for element in b if not element in a]
a= [1,2,3,4,5,6]
b= [1,3,5,7]
c = and_array(a, b)
d = or_array(a, b)
print(c)
print(d)
```
Result:
```
[1,... |
39,130,015 | Following simplified table
```
CustNr OrderNr Date Price Curry
1 555 030316 2,4 EUR
1 666 030316 2,5 EUR
1 777 030316 2,3 EUR
1 777 030316 1,9 USD
1 888 030316 2,3 EUR
1 888 030316 2,4 EUR
```
Desired output:
```
CustNr OrderNr Date Price... | 2016/08/24 | [
"https://Stackoverflow.com/questions/39130015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4977744/"
] | You should use left join instead of inner join and filter by Curry
```
SELECT * FROM TEST T1 LEFT JOIN TEST T2 ON (T1.OrderNr = T2.OrderNr
AND T1.Curry <> T2.Curry )
``` | You need a top-level query that represents unique order numbers:
```
select
t.OrderNr,
t1.*,
t2.*
from (select distinct OrderNr from test) t
cross apply (select top 1 * from test t1 where t1.OrderNr = t.OrderNr order by Curry) t1
outer apply (select top 1 * from test t2 where t2.OrderNr = t.OrderNr and t2.Curry <> t1... |
9,694,863 | I'm attempting to learn XML in order to parse GChats downloaded from GMail via IMAP. To do so I am using lxml. Each line of the chat messages is formatted like so:
```
<cli:message to="email@gmail.com" iconset="square" from="email@gmail.com" int:cid="insertid" int:sequence-no="1" int:time-stamp="1236608405935" xmlns:i... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9694863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723212/"
] | You can also do it without AVFoundation and it is in my opinion an easier way to implement it using only the UIImagePickerController.
There are 3 conditions:
1. Obviously the device needs to have a camera
2. You must hide the camera controls
3. Then simply use the takePicture method from UIImagePickerController
Below... | [VLBCameraView](https://github.com/verylargebox/VLBCameraView) is a library that uses AVFoundation to take photo.
A preview is shown in the view, which you can then call the method VLBCameraView#takePicture programmatically to take a photo.
Comes with CocoaPods. |
7,230,820 | I'm looking at a Git hook which looks for print statements in Python code. If a print statement is found, it prevents the Git commit.
I want to override this hook and I was told that there is a command to do so. I haven't been able to find it. Any thoughts? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/558699/"
] | Maybe (from [`git commit` man page](https://git-scm.com/docs/git-commit)):
```
git commit --no-verify -m "commit message"
^^^^^^^^^^^
-n
--no-verify
```
>
> This option bypasses the pre-commit and commit-msg hooks. See also [githooks(5)](http://git-scm.com/docs/githooks).
>
>
>
As commented by [Bla... | For some reason, `--no-verify` does not work for me with this particular hook: `prepare-commit-msg`
If you too are running into this issue, try:
```bash
SKIP=prepare-commit-msg git commit
``` |
27,891,646 | I am converting date to day, but if I just println() the current selected date in the datepicker, I get wrong time and wrong date.
```
@IBOutlet weak var datepicker: UIDatePicker!
@IBAction func displayDay(sender: AnyObject) {
var chosenDate = self.datepicker.date
println(chosenDate)
```
I've following dat... | 2015/01/11 | [
"https://Stackoverflow.com/questions/27891646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/682321/"
] | Use this method to get correct date:
```
func getDateStamp(date:String)-> String{
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss +SSSS"
dateFormatter.timeZone = TimeZone(abbreviation: "UTC")
guard let date = dateFormatter.date(from: date) else {
// assert... | Swift 5
```
let yourLocalDate = Date().description(with: .current)
``` |
8,615,265 | I want to change the background color of Days in my [FullCalendar](http://arshaw.com/fullcalendar)
How can i do this..? | 2011/12/23 | [
"https://Stackoverflow.com/questions/8615265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875214/"
] | OPTION 1
there is class in each cell
```
.fc-past
.fc-today
.fc-future
```
You can use them in your css and make some colors for past, today and future.
OPTION 2
You can loop for each day cell and do some check's
Here is example with month view
```
$('.fc-day').each(function(){
if($(this).is('.fc-today')) retu... | Do it in css, as simple as
```
.fc-past {
background-color: #F5F5F6
}
``` |
7,660,328 | I can't understand why I'm not able to use an additional local in my partial.
In my parent view:
```
<%= render :partial => 'content', :locals => { :post => post, :summary => true } %>
```
And in my partial:
```
<%= summary ? post_content(post, 220) : post_content(post) %>
```
Results in an error, where the va... | 2011/10/05 | [
"https://Stackoverflow.com/questions/7660328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/608171/"
] | I think you have to make the test expression more explicit, because the system is trying to find a method called summary? instead of using ? as ternary operator. Try changing it to:
```
<%= summary == true ? post_content(post, 220) : post_content(post) %>
``` | Can you please confirm that in your partial you indeed have `summary <space> ?` instead of `summary?` |
39,869,571 | So I have this Team Services shared project which I've pulled locally. I am connecting to a remote DB which requires credentials in order to do anything with it. Everything works fine, and my `connectionString` is as follows:
```
<add name="PluginSchedulerContext"
connectionString="metadata=res://*/PluginSchedulerD... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39869571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2841351/"
] | The better way is that, you can change connectionstring to connect to another database (test database), then you can replace connectionstring through [Replace Token task](https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens) to connect to actual database when you deploy app to the server through [bui... | If you use Windows Authentication (client and database access using same Windows login) you don't need the username and password in your source code.
Or you'll need to edit the configuration when you deploy.
Otherwise the credentials are in your project's configuration in your VCS. |
50,507,235 | How to access nested dictionary in python. I want to access '**type**' of both card and card1.
```
data = {
'1': {
'type': 'card',
'card[number]': 12345,
},
'2': {
'type': 'wechat',
'name': 'paras'
}}
```
I want only type from both the dictionary. how can i get.
I use the following code but getting error:
```
>>> ... | 2018/05/24 | [
"https://Stackoverflow.com/questions/50507235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8211382/"
] | You can use:
```
In [120]: for item in data.values():
...: print(item['type'])
card
wechat
```
Or list comprehension:
```
In [122]: [item['type'] for item in data.values()]
Out[122]: ['card', 'wechat']
``` | [](https://i.stack.imgur.com/SvAMJ.png)
from a nested python dictionary like this, if I want to access lets, say article\_url, so I have to program like this
```
[item['article_url'] for item in obj.values()]
``` |
46,105,620 | I have this dataframe:
```
df:
id . city . state . person1 . P1phone1 . P1phone2 . person2 . P2phone1 . P2phone2
1 . Ghut . TY . Jeff . 32131 . 4324 . Bill . 213123 . 31231
2 . Ffhs . TY . Ron . 32131 . 4324 . Bill . 213123 . 31231
3 . Tyuf . TY . Jeff . 321... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46105620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5606352/"
] | You can just slice the dataframe into two:
```
In [20]: df1 = df[['city','state','person1','P1phone1','P1phone2']]
In [21]: df2 = df[['city','state','person2','P2phone1','P2phone2']]
```
and then make sure they have the same columns:
```
In [27]: df1.columns = ['city','state','person','phone1','phone2']
In [28]: ... | This is a typically `pd.wide_to_long` question
Try this
```
df=df.rename(columns={'P1phone1':'phone1P1','P1phone2':'phone2P1','P2phone1':'phone1P2','P2phone2':'phone2P2'})
pd.wide_to_long(df,['person','phone1P','phone2P'],i=['id','city','state'],j='age').reset_index().drop('age',1)
Out[364]:
id city state ... |
68,194,716 | I made a HTML email layout using table, the design is working fine in my machine but when I put the code to test in **putsmail** the footer moves to the left when I view the mail in the dekstop.
It should come like this:
[](https://i.stack.imgur.com/II... | 2021/06/30 | [
"https://Stackoverflow.com/questions/68194716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It’s safer to use inline CSS for email templates, I also don’t think any email clients supports the `align-content` property or even `max-content` on `width`. Maybe try it like this:
```html
<table width="100%">
<tr width="100%">
<td style="padding: 50px;background-color:#f7f7f7">
<div style="margin-left:a... | Use `width: 100%` for the table. |
40,772,620 | i need your help with some regex. I have a .csv file with fields separated with pipes and i want a regex that starts working from the n occurrence of that pipe and delete the element after including the next '|' . For Example, start from the third pipe:
```
elem1 | elem2 | elem3 | elem4 | elem5 | elem6
... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40772620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4350639/"
] | Below is the short working example with handling for 3 types of errors:
1) passed to `next()` handler,
2) throw-ed inside route handler,
3) unhandled error inside callback of some function called from route handler.
(1) and (2) are captured using custom error middleware handler (A) and (3) is captured by `uncaughtExce... | I think the problem is on the routing definitions
As you said you are using this
```
app.get('/test_feature', function (req, res) {
throw new Error("asdasdad");
res.send("Done");
});
```
Try using this:
```
app.get('/test_feature', function (req, res, next) {
next(new Error("asdasdad"));
});
```
And... |
975,995 | I have this problem with Cocoa, I am calling a function and passing an Array to it:
Some where I call the function:
```
[self processLabels:labels];
```
And the function is as follow:
```
- (void)processLabels:(NSMutableArray*)labs{
labs = [[NSMutableArray alloc] init];
[labs addObject:@"Random"];
....
}
... | 2009/06/10 | [
"https://Stackoverflow.com/questions/975995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | 'labs' should be initialized before you pass it to processLabels, and then it shouldn't be re-initialized.
If you can't initialize the array beforehand for whatever reason and you want processLabels to create it, you need to pass a pointer to a pointer:
```
[self processLabels:&labels];
```
and the method would cha... | Will is correct, both about correcting the existing method, and about it being a bad idea. Storing back to a by-reference parameter is certainly valid, and it's used frequently in plain C programs, but in this case it adds needless complexity. In Objective-C, the preferred idiom is to return objects using the return va... |
18,984 | What are your opinions on developing for the command line first, then adding a GUI on after the fact by simply calling the command line methods?
eg.
>
> W:\ todo AddTask "meeting with John, re: login peer review" "John's office" "2008-08-22" "14:00"
>
>
>
loads `todo.exe` and calls a function called `AddTask` t... | 2008/08/20 | [
"https://Stackoverflow.com/questions/18984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1588/"
] | If you do your development right, then it should be relatively easy to switch to a GUI later on in the project. The problem is that it's kinda difficult to get it right. | In addition to what [Stu](https://stackoverflow.com/questions/18984/what-do-you-think-of-developing-for-the-command-line-first#18990) said, having a shared library will allow you to use it from web applications as well. Or even from an IDE plugin. |
16,214,133 | Is it ever best practise or recommended to use a table of the following?
```
id, uid, fieldname, fieldvalue
4, 12, gender, male
5, 12, age, 21-30
6, 12, location, 5
7, 13, gender, female
8, 13, age, 31-40
9, 13, location, 5
10, 14, gender, female
11, 14, age, 31-40
12, 14, locatio... | 2013/04/25 | [
"https://Stackoverflow.com/questions/16214133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2118666/"
] | Thanks for the very thorough answers above! None of the responses, quite did what I was looking for though. I followed up on DarkOtter's suggestion in the comment the question, and used `unsafeCoerce` avoid the type checker. The basic idea is that we create a GADT that packages up Haskell functions with their types; th... | Would something along these lines meet your needs?
```
import Control.Monad.Random
randomFunction :: (RandomGen r, Random a, Num a, Floating a) => Rand r (a -> a)
randomFunction = do
(a:b:c:d:_) <- getRandoms
fromList [(\x -> a + b*x, 1), (\x -> a - c*x, 1), (\x -> sin (a*x), 1)]
-- Add more functions as need... |
40,712,574 | I have 2 dataframes `df_1` and `df_2`. Both have an index `datetimecode`which is a `pd.datetime64` object, and a `temp` column. I want to iterate through `df_1` and replace all the NaN temperature values with the corresponding temp from `'df_2'`.
Something like this:
```
for index, row in df_1.iterows():
row['t... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40712574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6567949/"
] | This will give you the file name and full name. The difference is full name includes the complete path and name is just the file name.
```
Get-ChildItem c:\users\somefolder -Recurse -filter "*.pem" | foreach{
$name = $_.Name
$fullName = $_.FullName
Write-Output $name
Write-Output $fullName
}
```
If you... | try Something like this
```
$msbuild = "C:\pathofexefile\WinSCP.com"
$formatstring="/keygen {0} /output={1}.ppk"
Set-Location "c:\temp"
gci -file -Filter "*.txt" | %{$arguments=($formatstring -f $_.FullName, $_.BaseName);start-process $msbuild $arguments }
``` |
3,641,737 | can I get description of an exception caught by
```
catch(...)
```
block? something like **.what()** of std::exception. | 2010/09/04 | [
"https://Stackoverflow.com/questions/3641737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/395573/"
] | If you know you only throw std::exception or subclasses, try
```
catch(std::exception& e) {...e.what()... }
```
Otherwise, as DeadMG wrote, since you can throw (almost) everything, you cannot assume anything about what you caught.
Normally catch(...) should only be used as the last defense when using badly written ... | Quoting [bobah](https://stackoverflow.com/questions/315948/c-catching-all-exceptions)
```
#include <iostream>
#include <exception>
#include <typeinfo>
#include <stdexcept>
int main()
{
try {
throw ...; // throw something
}
catch(...)
{
std::exception_ptr p = std::current_exception();
... |
43,793,622 | How can I remove this square from tooltip?
[](https://i.stack.imgur.com/whK6l.jpg)
I would prefer if I could manage to just have it one line like this: February - 2
```
var data = {
labels: ['January', 'February', 'March'],
datasets:... | 2017/05/04 | [
"https://Stackoverflow.com/questions/43793622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2769517/"
] | Add this in your `options` object
```
tooltips: {
displayColors: false
}
```
**Update for version 3 or greater** (from @hanumanDev below):
Remove 's' from tooltips
```
tooltip: {
displayColors: false
}
``` | In version 3.8.0 of the chart.js plugin the tooltip config needs to go in the plugins config object, like this:
```js
options: {
plugins: {
tooltip: {
displayColors: false
}
}
}
``` |
12,438 | I have the following issue with accent insensitive search in Czech language. My database is set to `Czech_CI_AI` collation. For some diacritics system works correctly (ie. `I`), but for some does not (ie. `R`). In my database there are several `'DVORA*'` records:
```
SELECT contact_name
FROM CONTCTSM1
WHERE CONT... | 2012/02/08 | [
"https://dba.stackexchange.com/questions/12438",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/2899/"
] | R and Ř are different letters, as opposed to modified base letters(?) like German umlauts with ö vs o
From [Czech language on Wikipedia](http://en.wikipedia.org/wiki/Czech_alphabet) (my bold)
>
> The acute accent (čárka) letters (Á, É, Í, Ó, Ú, Ý) and the kroužek letter Ů all indicate long vowels. They have the **sa... | SQL collation seems not very useful accent insensitive search.
The best solution seems to be to convert the string to varchar with collation SQL\_Latin1\_General\_CP1251\_CI\_AS.
Either as a persistent column holding varchar value with the 1251 collation or cast the value directly in query (if you don't care that it ... |
69,299,586 | I suddenly get this error and not sure why.I did not change the `"react-router-dom": "^6.0.0-beta.4"` version. But the `"react-dom": "^16.8.4"`" had changed to `"react-dom": "^16.13.1"`,
Dunno if that had anything to do with I don't know but the `useRoutes` comes from `"react-router-dom"` and that's where the error ori... | 2021/09/23 | [
"https://Stackoverflow.com/questions/69299586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11749004/"
] | I have had a similar issue with material kit ui, and i fixed it simply just write `path:""`. leaving the path empty will fix the problem | In the case you are nesting `Routes`, one workaround is to group them together:
From
```
<BrowserRouter>
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="products" element={<Foo/>}
<Route path="/" element={<Bar/>}/>
<Route path=":id" element=... |
61,441 | Suppose S is a genus g surface with n punctures satisfying the hyperbolicity condition 2g + n - 2 > 0. If n > 0 the fundamental group of the surface is a free group on 2g + n - 1 := m generators.
If we look the universal covers of different punctured surfaces with the same m (e.g., thrice-punctured sphere and once-pu... | 2011/04/12 | [
"https://mathoverflow.net/questions/61441",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14314/"
] | For the thrice-punctured sphere, there is a generating set where both generators are parabolic. For the once-punctured torus only the commutator (and its conjugates) is parabolic. Hence any element that can be part of a generating set is hyperbolic.
Thinking in the upper half-plane model of $\mathbb H$, the Farey set... | I strongly recommend you look at:
MR0795536 (86j:11069)
Series, Caroline(F-IHES)
The geometry of Markoff numbers.
Math. Intelligencer 7 (1985), no. 3, 20–29.
11J06 (11J13 11J70) |
490,387 | I've been using TortoiseSVN with Subversion for a while now. Its pretty easy to use and most of the time I just use the Update and Commit functions....and occasionally if I need to track down the author of a particular line of code I use Blame or Show Log.
Recently though, I made the mistake of directly copying folder... | 2009/01/29 | [
"https://Stackoverflow.com/questions/490387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39532/"
] | * [the most forgotten feature](http://tortoisesvn.net/most-forgotten-feature) (right-drag)
* [unversion a working copy](http://tortoisesvn.net/unversion.html)
* [extended context menu](http://tortoisesvn.net/extendedcontextmenu.html)
* [repair moves/renames](http://tortoisesvn.net/repairmoves.html) | I've found the [export](http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-cli-main.html#tsvn-cli-export) command to be invaluable several times. It gives you a clean (no .svn directories) copy of whatever directory you want. |
37,547,951 | I'm trying to increment my counter every time but when the html is clicked the counter grows exponentially like +1, +2, +3, +4.

```
$('.dates').click(function(){
$('... | 2016/05/31 | [
"https://Stackoverflow.com/questions/37547951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4256605/"
] | Most likely, you are registering a new click event listener every time you click.
Please check and post the code that surrounds the line `$('.dates').click(...)`.
Make sure this line is called only once in your code, and not again later. | May be it is considering it as string. Use `parseInt` to parse the value as an integer instead of using String Concatenation:
```
$('.dates').click(function() {
$('#output').html(function(i, val) {
return parseInt(val, 10) + 1;
});
});
```
Working snippet:
```js
$('.dates').click(function() {
$('#output'... |
19,187,457 | Please look at the following: <http://jsfiddle.net/ran5000/uZ7dD/>
the `header` div has a fixed height of 40px, I want that the `content` div will use the remaining height of the screen without scroll and regardless of the screen height.
any ideas? | 2013/10/04 | [
"https://Stackoverflow.com/questions/19187457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553823/"
] | I generally use `position:absolute` for this, and then set the top value to start at the bottom of the header.
<http://jsfiddle.net/uZ7dD/4/>
```
.content {
background-color: yellow;
position:absolute;
top:40px; bottom:0; left:0; right:0;
}
``` | For css3 browsers just use:
```
.content {
width: 100%;
background-color: yellow;
height: -moz-calc(100% - 40px);
height: -webkit-calc(100% - 40px);
height: -o-calc(100% - 40px);
height: calc(100% - 40px);
}
```
for non-css3 browsers use this workaround,
HTML:
... |
37,319,736 | I have the below hibernate native query as shown below the idea is not to use the native query and switch to hibernate criteria api
```
<![CDATA[select count(iilnmp.INV_LINE_NOTE_ID) from IOA_INV_LINE_NOTE_MAP iilnmp ,
IOA_INVOICE_LINE_NOTES iiln , IOA_INVOICE_LINE... | 2016/05/19 | [
"https://Stackoverflow.com/questions/37319736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6355442/"
] | Try stopping the gradle daemon with `./gradlew --stop`
I had the same problem with something as simple as:
```
commandLine = [ "node", "--version"]
```
It came down to the gradle daemon having a cached location of node which no longer existed (I had updated node sometime before). | My gradle file contained a snippet to get the aws auth token and I was getting the same failure - `Caused by: java.io.IOException: error=2, No such file or directory`
In my case, the issue was not caused due to caching.
It was due to gradle not being able to find the aws binary.
What worked for me - Use the `which a... |
29,761,871 | I am working with an existing application that I would like to add angular to. The application is using a custom proprietary SPA framework + dojo. The application is built with mainly dojo modules and heavily utilizes AMD modules.
I have imported angular in the head with
```
<script type="text/javascript" src="lib/a... | 2015/04/21 | [
"https://Stackoverflow.com/questions/29761871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2141336/"
] | Update this css class or override it to:
```
.bootstrap-switch.bootstrap-switch-focused
{
outline: none;
box-shadow: none;
}
``` | css:
```
.bootstrap-switch:focus {
outline: none;
}
``` |
4,105,042 | im a newbie here and would like some advice on C# programming
i would like to store values from a textbox into a database.
so far, i have the following:
```
string connectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Customers.mdf;Integrated Security=True;User Instance=True";
SqlConnection ... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4105042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498209/"
] | Do you have 'Copy to Output Directory' property set to 'Copy Always' for the database file?
Because this would overwrite your database file everytime you build. | if your **ProjectStartDate** and dates in general are datetime values in the DB, then you will get an error when inserting data with the '.
It should be like:
```
String thisQuery = "INSERT INTO ProjectList (ProjectName, BiddingDueDate, Status, ProjectStartDate, ProjectEndDate, AssignedTo, PointsWorth, StaffCredits) V... |
44,625,081 | I want to create update procedure and I get the following error;
Msg 102, Level 15, State 1, Procedure sp\_name, Line 30 [Batch Start Line 9]
Incorrect syntax near 'update '.
How can write proper procedure please help me?
I can not solve the problem
My procedure as follows;
```
@tablo nvarchar(100),
@kayit nvarchar... | 2017/06/19 | [
"https://Stackoverflow.com/questions/44625081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | you can leave it blank but imho It's better this:
```
if(!in_array($productName, array_keys($_SESSION["cart_item"]))) {
$_SESSION['cart_item'] = array_merge($_SESSION['cart_item'],$itemArray);
}
```
You can add `!` to specifiy a `NOT` operation so you can delete else condition and you don't need to leave an ... | If you have blank code block after `IF`, then simply use negation `!`.
```
if (!in_array($productName, array_keys($_SESSION["cart_item"]))) {
```
Then code should be more easily to read by other developers. |
40,772,620 | i need your help with some regex. I have a .csv file with fields separated with pipes and i want a regex that starts working from the n occurrence of that pipe and delete the element after including the next '|' . For Example, start from the third pipe:
```
elem1 | elem2 | elem3 | elem4 | elem5 | elem6
... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40772620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4350639/"
] | Note: your error handler middleware MUST have 4 parameters: error, req, res, next. Otherwise your handler won't fire.
I was fighting this problem until I've discovered this. | I think the problem is on the routing definitions
As you said you are using this
```
app.get('/test_feature', function (req, res) {
throw new Error("asdasdad");
res.send("Done");
});
```
Try using this:
```
app.get('/test_feature', function (req, res, next) {
next(new Error("asdasdad"));
});
```
And... |
57,574,910 | So I am working on a simple CRUD.
I organize my form in a separate page view so I can just insert it on my create and edit views.
Here's how my field view:
```
<div class="form-group row">
<label class="col-sm-2 col-form-label"for="room_id">Room</label>
<div class="col-sm-10">
<select nam... | 2019/08/20 | [
"https://Stackoverflow.com/questions/57574910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can add `isset` to check for the ternary operation,
```
{{ isset($booking->is_paid) ? 'checked' : '' }}
``` | Change the input line for the checkbox to read:
```html
<input type="checkbox" class="form-check-input" name="is_paid" value="1"
{{(isset($booking->is_paid)) && $booking->is_paid == 1 ? 'checked ' : ' '}}/>
```
Create, show, and edit should all work. |
50,859,498 | ```
SqlDataAdapter sda = new SqlDataAdapter("Select * from salestable where empid='"
+ txtsid.Text
+ "'between'"
+ datepick1.Value.ToString("MM/dd/yyyy")
+ "'And'"
+ datepick2.Value.ToString("MM/dd/yyyy")
+ "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
``` | 2018/06/14 | [
"https://Stackoverflow.com/questions/50859498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9932627/"
] | try use parameters on sqlDataAdapter:
```
string SQLsentence = @"
SELECT *
FROM salestable
WHERE empid=@Employe
AND [datesale(your column with date)] between @fDate And @lDate
";
SqlDataAdapter sda = new SqlDataAdapter ( SQLsentence , con );
sda.SelectCommand.Parameters.Add ( new SqlPara... | You don't seem to be testing a field for the between. It looks like the sql rendored will be something like:
```
Select * from salestable where empid='x'between'mm/dd/yy'and'mm/dd/yyyy'
```
you aren't testing anything as being between those two date values. Plus your spacing makes the sql hard to read |
495,352 | Hey I recently got interested in number theory and proved the following inequality:
\begin{align}
x^m-y^m > p\_n^2 + 4p\_n + 3 > 1\ \text{(corrected again)}
\end{align}
where
$x-y\neq1$ and m in an integer >1
and
\begin{align}
\gcd(x,y)&=1 \\
xy&= 2\*3\*5\*..\*p\_n
\end{align}
So my question is ... Does thi... | 2013/09/16 | [
"https://math.stackexchange.com/questions/495352",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/43620/"
] | The inequality deals with the primorial function
$$
p\_n\#=2\cdot3\cdot5\cdots p\_n=\prod\_{p\le p\_n,\ p\in \mathbb{P}}p,
$$
where $p\_n$ is the $n$th prime.
[Asymptotically we have the result](http://mathworld.wolfram.com/ChebyshevFunctions.html) that
$$
\lim\_{n\to\infty}\frac{\ln p\_n\#}{p\_n}=1.
$$
Early on the pr... | Modulo small values of $n,$ you do not need to assume that $x-y\ne 1$ as well as asymptotic on the primorial function. Instead, you can get away with Bertrand's postulate stating that $p\_{n}<2p\_{n-1}$ or $p\_{n-1}\ge p\_n/2.$ Indeed, if $m\ge 2,$ then
$$x^m-y^m=(x-y)(x^{m-1}+...+y^{m-1})\ge (x-y)(x+y)\ge x+y\ge 2\sq... |
34,361 | Abraham is said to have arrived at the existence of Gd in [Gen Rabah 39:](http://www.tsel.org/torah/midrashraba/lechlecha.html)
>
> אמר רבי יצחק משל לאחד שהיה עובר ממקום למקום וראה בירה אחת דולקת אמר
> תאמר שהבירה זו בלא מנהיג הציץ עליו בעל הבירה אמר לו אני הוא בעל הבירה
> כך לפי שהיה אבינו אברהם אומר תאמר שהעולם הזה... | 2014/01/02 | [
"https://judaism.stackexchange.com/questions/34361",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/4682/"
] | This answer is taken mostly from this shiur by [R. Ezra Bick](http://vbm-torah.org/archive/midrash/01bira.doc) from VBM
I just want to point out that this Midrash is not saying what Mideval logicians used to argue about Gd's existence.
While the argument here is similar to the [watchmaker argument](http://en.wikipedia... | Abraham realized that everything has a cause, and complex systems don't arise out of nothingness; Someone has to create them. |
4,146,234 | **Problem**
I am not able to refresh the page with **window.location.reload()** which is used inside the success call made to yahoo.
Any hints how it can be fixed.
The whole of the code is working fine it is making call to cse server getting contents from there saving on yahoo. but i have to manually refresh the pag... | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1272852/"
] | You have to use `DeviceInfo.getDeviceId();` as shown [here](http://supportforums.blackberry.com/t5/Java-Development/Method-to-get-device-ID/m-p/205656) | Have you read [this article](http://www.blackberryforums.com/developer-forum/1620-retrieve-model-info-java.html) and read the [DeviceInfo.getDeviceName() and DeviceInfo.getDeviceId() documentation](http://www.blackberry.com/developers/docs/4.0.2api/net/rim/device/api/system/DeviceInfo.html)? |
35,296,907 | I have a generic class that looks something like this:
```
template <class T>
class Example
{
private:
T data;
public:
Example(): data(T())
Example(T typeData): data(typeData)
~Example()
// ...
};
```
I'm a bit confused about how to implement a deconstructor for something like this. Specifi... | 2016/02/09 | [
"https://Stackoverflow.com/questions/35296907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/996249/"
] | The simplest answer is: don't. Don't try to second-guess the user and do something they might not expect. Adopt the same policy as standard containers do: assume `T` cleans up after itself correctly.
If the client code is written correctly, it will use RAII classes (such as smart pointers) for automatic and correct ma... | You can use Template Specialization.
```
template <class T>
class Example
{
private:
T data;
public:
Example()
: data(T())
{}
Example(T typeData): data(typeData)
{}
};
template <class T>
class Example<T*>
{
private:
T* data;
public:
Example() : data(nullptr){}
Example(... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3