qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
66,329,515 | I am trying to output the progress of an import of an `.sql` file inside a mariadb docker container.
I have the following file/directory setup:
```none
│- docker-compose.yml
│- Dockerfile
│- import.sh
└── sql
- test.sql (rather big: ~ 1GB)
```
My `docker-compose.yml` is as simple as...
```yaml
services:
... | 2021/02/23 | [
"https://Stackoverflow.com/questions/66329515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7987318/"
] | Background
----------
First let's understand how `pv` is able to render a moving progress bar on a text-only output to the terminal: `pv` actually just prints plain text to its stdout with each progress update:
```
"[==> ] 25%\r"
"[======> ] 50%\r"
"[=========> ] 76%\r"
"[============>] 100%\n"
``... | I found a somewhat okayish solution:
Adding the `--numeric` flag to my `pv` command.
[From the man page of pv](https://linux.die.net/man/1/pv):
>
> -n, --numeric
>
>
>
>
> Numeric output. **Instead of giving a visual indication of progress, pv
> will give an integer percentage, one per line**, on standard erro... |
18,010,581 | I am calling a function in one file
```
a = fun(a,b);
```
I am having the #define of that function in other file
```
#define fun fun1
```
I am defining that function in another file
```
static int fun1(int a, int b)
{
-------------
-------------
}
```
But compiler complaints
>
> 'fun1' defined but ... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18010581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2505251/"
] | ```
static int fun1(int a, int b)
```
`static`means that this function can be only used in this file. Remove the `static` and try again. | You have two problems here: The first about that warning, because in the other source file you don't actually *use* the function. The second problem is that you marked the function as `static`, which means that it will only be available in that specific source file.
If you want to be able to call functions defined in ... |
4,872,155 | I have subclassed NSException class to create CustomException class.
Whenever I catch an exception in code (in @catch), i want to initialize an object of CustomException (subclass of NSException) with the object of NSException that is passed as a parameter to @catch.
Something like this
```
@catch (NSException * e) ... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4872155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/588924/"
] | You need to pass an appropriate -I option to the compiler (by setting CPPFLAGS or CFLAGS, for example). `-I/usr/include/nvidia-current` sounds like it'd work. | I saw this thread from [compile opencl program using CL/cl.h file](https://stackoverflow.com/questions/21301905/compile-opencl-program-using-cl-cl-h-file?answertab=votes#tab-top)
I installed 7.5 and added below link in /usr/include, it works for my opencl program. looks like CUDA forget to implement this link after th... |
4,872,155 | I have subclassed NSException class to create CustomException class.
Whenever I catch an exception in code (in @catch), i want to initialize an object of CustomException (subclass of NSException) with the object of NSException that is passed as a parameter to @catch.
Something like this
```
@catch (NSException * e) ... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4872155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/588924/"
] | You need to pass an appropriate -I option to the compiler (by setting CPPFLAGS or CFLAGS, for example). `-I/usr/include/nvidia-current` sounds like it'd work. | Are you using [Ubuntu](https://packages.ubuntu.com/search?keywords=opencl-headers&searchon=names) or [Debian](https://packages.debian.org/search?keywords=opencl-headers&searchon=names&suite=stable§ion=all) distro? Then now you can use this package:
```
sudo apt-get install opencl-headers
``` |
50,932,857 | I'm still trying to update my older programs to modern C++, and I have another question related to templates.
I'm using libconfig++ to handle program configuration, writing plain text data to a configuration file.
You can choose the type of data you want to write to the file, and the library uses an enum to do this (ie... | 2018/06/19 | [
"https://Stackoverflow.com/questions/50932857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9880028/"
] | You don't explain here how the object root.add() is able to assign from an arbitrary type, but that does not appear to be the problem you are currently asking us to solve...
The problem you are currently tackling is specifically translating the template type to the appropriate enum index, and for that in c++11 I would... | After some research based on @gem-taylor answer, I ended up with the following version which is working as I wanted. It still needs some tweaking to include std::string version, but it's not essential.
```
template <class T> struct ToMySetting;
template <> struct ToMySetting<bool> { static constexpr libconfig::... |
11,217,432 | I've got this code:
```
function openFile(_title, file, id, _height, _width)
{
$.fx.speeds._default = 500;
$(document).ready(function()
{
if (_height == '')
_height = 250;
if (_width == '')
_width = 500;
var dialogOpts = {
title: _title,
... | 2012/06/26 | [
"https://Stackoverflow.com/questions/11217432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1277308/"
] | There are infinitely many languages that no TM can decide. Indeed, "most" languages are undecidable; there are countably many decidable languages, but uncountably many languages (hence, uncountably many undecidable ones).
Rice's theorem allows you to come up with lots of examples of languages which are undecidable. Se... | The turing machine accepts all the language even though they are recursively enumerable. Recursive means repeating the same set of rules for any number of times and enumerable means a list of elements. The TM also accepts the computable functions, such as addition, multiplication, subtraction, division, power function,... |
31,162,920 | >
> How to add a row on top of the table and below (<-th->) ?
>
>
>
```
<table id="mytable" cellpadding="0" cellspacing="0">
<tr>
<th>Name</th>
<th>Place</th>
<th>Country</th>
</tr>
```
>
> Here I need to add rows dynamically....
> is it possible?
>
>
>
```
<tr>
<... | 2015/07/01 | [
"https://Stackoverflow.com/questions/31162920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4799833/"
] | Use `tbody` to `prepend` new row. Otherwise, new row will be added before `th`.
```
$('#but').on('click', function(e) {
$('#mytable tbody')
// ^^^^^
.prepend('<tr><td>newcol1</td><td>newcol2</td><td>newcol3</td></tr>');
});
``` | I don't know what exactly you want to achieve,but if you are trying,to add a same row to top of table as well the end then try this,
```
$('#but').on('click', function(e){
$('#mytable')
.prepend('<tr><td>newcol1</td><td>newcol2</td><td>newcol3</td></tr>');
$('#mytable')
.append('<tr><td>newcol... |
165,013 | They are 3,500 out of the 4,000 of the latest messages. They are always of the form:
```
1/5/15 1:07:38.307 PM discoveryd[49]: Basic Sockets Couldn't set IP_BOUND_IF on socket fd[73] scopeID[11] errno[22] result[-1]
1/5/15 1:07:40.487 PM discoveryd[49]: Basic Sockets Couldn't set IP_BOUND_IF on socket fd[68] scopeID[1... | 2015/01/05 | [
"https://apple.stackexchange.com/questions/165013",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/30921/"
] | Long term, the way to fix this is to opt in to sharing your logs and crashes with Apple and reporting this as a bug at <http://bugreport.apple.com>
Short term, you can choose a different network (probably a bad option) or suppress IPv6 (also probably bad long term) or try and disable the error logging entirely (probab... | When i get these messages any DNS lookups made using discoveryd fail (Chrome and nslookup work). Workaround:
```
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
``` |
1,116 | In usual $(t, n)$ secret sharing schemes, a secret $S$ is split into $n$ parts so that any $t$ out of $n$ parts reconstruct the original secret. So, suppose that there is a group of $n$ participants each one has a secret $x\_i$ ($x\_i$ may be its private key). My question is, is it possible to create a secret $S$ using... | 2011/11/01 | [
"https://crypto.stackexchange.com/questions/1116",
"https://crypto.stackexchange.com",
"https://crypto.stackexchange.com/users/1030/"
] | On a general basis, no. If $t \lt n$, then the first $t$ values $x\_1$ to $x\_t$ are sufficient to rebuild the secret $S$, *regardless* of the values of $x\_{t+1}$ to $x\_n$. Therefore, those last values have no influence whatsoever on $S$. On the other hand, values $x\_{n-t+1}$ to $x\_n$ should be sufficient to also r... | EDIT: $\,$ This only works when t=1, as your previous question makes me believe you are most interested in.
Yes, see [Can one generalize the Diffie-Hellman key exchange to three or more parties?](https://crypto.stackexchange.com/questions/1025/can-one-generalize-the-diffie-hellman-key-exchange-to-three-or-more-parties... |
1,116 | In usual $(t, n)$ secret sharing schemes, a secret $S$ is split into $n$ parts so that any $t$ out of $n$ parts reconstruct the original secret. So, suppose that there is a group of $n$ participants each one has a secret $x\_i$ ($x\_i$ may be its private key). My question is, is it possible to create a secret $S$ using... | 2011/11/01 | [
"https://crypto.stackexchange.com/questions/1116",
"https://crypto.stackexchange.com",
"https://crypto.stackexchange.com/users/1030/"
] | I'd like to suggest a potentially interesting reformulation (or variant) of the problem as a form of secure multi-party computation:
>
> Given $k$, $n$ and $m$, is there a protocol by which $n$ participants $i \in \lbrace 1, \dotsc, n \rbrace$ may, without the help of a trusted external party, each compute a share $s... | EDIT: $\,$ This only works when t=1, as your previous question makes me believe you are most interested in.
Yes, see [Can one generalize the Diffie-Hellman key exchange to three or more parties?](https://crypto.stackexchange.com/questions/1025/can-one-generalize-the-diffie-hellman-key-exchange-to-three-or-more-parties... |
1,116 | In usual $(t, n)$ secret sharing schemes, a secret $S$ is split into $n$ parts so that any $t$ out of $n$ parts reconstruct the original secret. So, suppose that there is a group of $n$ participants each one has a secret $x\_i$ ($x\_i$ may be its private key). My question is, is it possible to create a secret $S$ using... | 2011/11/01 | [
"https://crypto.stackexchange.com/questions/1116",
"https://crypto.stackexchange.com",
"https://crypto.stackexchange.com/users/1030/"
] | I'd like to suggest a potentially interesting reformulation (or variant) of the problem as a form of secure multi-party computation:
>
> Given $k$, $n$ and $m$, is there a protocol by which $n$ participants $i \in \lbrace 1, \dotsc, n \rbrace$ may, without the help of a trusted external party, each compute a share $s... | On a general basis, no. If $t \lt n$, then the first $t$ values $x\_1$ to $x\_t$ are sufficient to rebuild the secret $S$, *regardless* of the values of $x\_{t+1}$ to $x\_n$. Therefore, those last values have no influence whatsoever on $S$. On the other hand, values $x\_{n-t+1}$ to $x\_n$ should be sufficient to also r... |
57,706,176 | I'm new to redux and trying to make a simple react-native app.
Actions are being mapped to props (mapDispatchToProps) but they are not being dispatched to reducers. When I do console.log() in the Action Creators, they are being called but when I do console.log() in the CounterReducer, they are not called.
App.js
```... | 2019/08/29 | [
"https://Stackoverflow.com/questions/57706176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Got the solution to the problem, the following is the aggs part which returns the composite buckets by indices
```
GET index1,index2,index3/type/_search
"aggs": {
"my_buckets": {
"composite": {
"size": 3,
"sources": [
{
"indexAgg": {
"terms": {
... | In the `sources` array, you can add a `terms` aggregation on the `_index` field:
```
"sources":[
{
"index":{
"terms":{
"field":"_index"
}
}
},
{
"checksumField":{
"terms":{
"field":"checkSum.keyword"
... |
23,468 | I am using the default Apache and PHP installs that are present in OS X Lion. But I would like to make some settings (like adding Virtual Hosts to Apache) using a GUI interface. Is there such a thing?
I know of OS X Server of course, and also I think MAMP Pro has this. But I would like to keep using the stock servers ... | 2011/08/29 | [
"https://apple.stackexchange.com/questions/23468",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/10457/"
] | There's no *built-in* GUI, but there are third party ones. One that I know of for managing virtual hosts is called VirtualHostX: <http://clickontyler.com/virtualhostx/> | No, there is no GUI for the built-in apache. This is how I just set mine up so I can add my own VirtualHosts more easily:
```
sudo -s
mkdir /etc/apache2/vhosts
chgrp admin /etc/apache2/vhosts
chmod g+w /etc/apache2/vhosts
cat << EOF >> /etc/apache2/extra/httpd-vhosts.conf
#
# Load user-defined vhosts
#
Include /privat... |
23,468 | I am using the default Apache and PHP installs that are present in OS X Lion. But I would like to make some settings (like adding Virtual Hosts to Apache) using a GUI interface. Is there such a thing?
I know of OS X Server of course, and also I think MAMP Pro has this. But I would like to keep using the stock servers ... | 2011/08/29 | [
"https://apple.stackexchange.com/questions/23468",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/10457/"
] | No, there is no GUI for the built-in apache. This is how I just set mine up so I can add my own VirtualHosts more easily:
```
sudo -s
mkdir /etc/apache2/vhosts
chgrp admin /etc/apache2/vhosts
chmod g+w /etc/apache2/vhosts
cat << EOF >> /etc/apache2/extra/httpd-vhosts.conf
#
# Load user-defined vhosts
#
Include /privat... | There's another GUI for built-in apache: [WebMon for Mountain Lion](http://cutedgesystems.com/software/WebMonForMountainLion/ "WebMon For Mountain Lion"). But this one is not as simple as VirtualHostX. |
23,468 | I am using the default Apache and PHP installs that are present in OS X Lion. But I would like to make some settings (like adding Virtual Hosts to Apache) using a GUI interface. Is there such a thing?
I know of OS X Server of course, and also I think MAMP Pro has this. But I would like to keep using the stock servers ... | 2011/08/29 | [
"https://apple.stackexchange.com/questions/23468",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/10457/"
] | There's no *built-in* GUI, but there are third party ones. One that I know of for managing virtual hosts is called VirtualHostX: <http://clickontyler.com/virtualhostx/> | There's another GUI for built-in apache: [WebMon for Mountain Lion](http://cutedgesystems.com/software/WebMonForMountainLion/ "WebMon For Mountain Lion"). But this one is not as simple as VirtualHostX. |
8,072,899 | I'm implementing a Timer such that the time spent on different kinds of events are categorized and listed. The class declaration goes something as follows:
```
#include "timer_event.h"
#include <boost/timer.hpp>
#include <vector>
class Timer {
private:
class TimedEvent;
public:
static TimedEvent* Time(TimerEven... | 2011/11/09 | [
"https://Stackoverflow.com/questions/8072899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/634042/"
] | That's a compiler error, not a linker error.
Presumably your `Time` was supposed to look like this:
```
TimedEvent* Timer::Time(TimerEvent e) {
TimedEvent* ret = new TimedEvent(watch_.elapsed(),e);
return ret;
}
```
I really dislike how everything starts with "Time", by the way!
Now, inside the function you ... | In the source file, you should implement `Time` as:
```
Timer::TimedEvent Timer::Time( TimerEvent e ) { ... }
``` |
4,320,776 | I'm trying get all the button child widgets of a window. The buttons were created through **QDialogButtonBox**. How do I get the which one is the cancel/ok/save button?
I have:
```
QWidget *pWin = QApplication::activeWindow();
QList<QPushButton *> allPButtons = pWin->findChildren<QPushButton *>();
QListIterator<QPu... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4320776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94815/"
] | You should use the [QDialogButtonBox::button()](http://doc.trolltech.com/4.7/qdialogbuttonbox.html#button) method, to get the button of the corresponding [role](http://doc.trolltech.com/4.7/qdialogbuttonbox.html#StandardButton-enum).
For instance :
```
QPushButton* pOkButton = pButtonBox->button(QDialogButtonBox::Ok)... | One way is by `text` parameter from constructor such as `QPushButton(const QString & text, QWidget * parent = 0)`:
```
QPushButton* buttonSave = new QPushButton("Save");
// etc..
while( i.hasNext() )
{
//identify which button is cancel/ok/save button here
if(i.next()->text() == "Save") {
// do something to sav... |
4,320,776 | I'm trying get all the button child widgets of a window. The buttons were created through **QDialogButtonBox**. How do I get the which one is the cancel/ok/save button?
I have:
```
QWidget *pWin = QApplication::activeWindow();
QList<QPushButton *> allPButtons = pWin->findChildren<QPushButton *>();
QListIterator<QPu... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4320776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94815/"
] | You should use the [QDialogButtonBox::button()](http://doc.trolltech.com/4.7/qdialogbuttonbox.html#button) method, to get the button of the corresponding [role](http://doc.trolltech.com/4.7/qdialogbuttonbox.html#StandardButton-enum).
For instance :
```
QPushButton* pOkButton = pButtonBox->button(QDialogButtonBox::Ok)... | Another alternative solution:
Use QDialogButtonBox's [buttons](https://doc.qt.io/qt-5/qdialogbuttonbox.html#buttons) function to return a list of all the buttons that have been added to the button box, then iterate over the list and identify each button using QDialogButtonBox's [standardButton](https://doc.qt.io/qt-5/... |
219,851 | I login as root and can not see the screen created by other others using `screen -ls`. I think the root user could have way to access those screen, but I can't find useful options of screen:
```
Use: screen [-opts] [cmd [args]]
or: screen -r [host.tty]
Options:
-4 Use IPv4.
-6 Use IPv6.
-a ... | 2015/08/03 | [
"https://unix.stackexchange.com/questions/219851",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/124489/"
] | Unless the screen session in question is created with `multiuser on`, you can't. Even if you set your `SCREENDIR` variable to point at the other user's socket directory, screen will just complain that you don't own the directory and quit when you try to use it.
Of course, you can simply `su` to the other user and use ... | You can see all screens on your machine via:
```
ls -laR /var/run/screen/
```
This will at least list the sockets with screen sessions and the user who owns it. If you have permissions to the socket it will list all the screens in use by that user as well.
from [here](https://stackoverflow.com/a/537980/2270568) |
150,284 | I am reading Sipser's *Introduction to the Theory of Computation*, and encountered two propositions:
1. $A = \{0^k1^k \mid k ≥ 0\}$ is nonregular language (pumping lemma).
2. Any language that can be decided in $o(n\log n)$ time on a single-tape Turing machine is regular.
The author shows how to construct a Turing ma... | 2022/04/01 | [
"https://cs.stackexchange.com/questions/150284",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/102145/"
] | You misunderstood $O$ vs $o$.
Specifically, for every function $f(n)$ it holds that $f(n)\in O(f(n))$, but $f(n)\notin o(f(n))$ (because $\lim\_{n\to \infty} \frac{f(n)}{f(n)}=1\neq 0$).
There is indeed a theorem showing that a language that is decidable in $o(n\log n)$ time is regular, and the example above shows tha... | Here is a similar example.
>
> Claim: If a language is recognized by a Turing machine running in $o(n)$, then it is accepted by a Turing machine running in $O(1)$.
>
>
>
For the proof, find $n\_0$ such that on inputs of size $n\_0$, the Turing machine $M$ terminates in time less than $n\_0$. For every input $x$ o... |
63,375 | [This article on the decline of laugh tracks](http://www.nydailynews.com/entertainment/laugh-track-sitcoms-continue-decline-article-1.2444242) twice contrasts "multi-camera sitcoms" with sitcoms that use laugh tracks.
Is that literal? I.e., is there a custom or technical reason that sitcoms with laugh tracks literally... | 2016/11/16 | [
"https://movies.stackexchange.com/questions/63375",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/20456/"
] | **It's a matter of logistics.** Let's assume the producer wanted the finished episode to include the sounds of an audience laughing.
* A multi-camera sitcom could have a "live studio audience" to laugh at the jokes, because the scene is shot from multiple angles simultaneously and edited together later. The actors and... | Actually, probably all "laugh track" sitcoms, which are often shot before a "live, studio audience" use multiple cameras. (This is partly because they are shot in studios, which are designed to allow multiple cameras to move around during shooting.)
Non-laughtrack shows such as **Curb Your Enthusiasm** and **Louie** a... |
63,375 | [This article on the decline of laugh tracks](http://www.nydailynews.com/entertainment/laugh-track-sitcoms-continue-decline-article-1.2444242) twice contrasts "multi-camera sitcoms" with sitcoms that use laugh tracks.
Is that literal? I.e., is there a custom or technical reason that sitcoms with laugh tracks literally... | 2016/11/16 | [
"https://movies.stackexchange.com/questions/63375",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/20456/"
] | **It's a matter of logistics.** Let's assume the producer wanted the finished episode to include the sounds of an audience laughing.
* A multi-camera sitcom could have a "live studio audience" to laugh at the jokes, because the scene is shot from multiple angles simultaneously and edited together later. The actors and... | The article actually confused the term (or the OP). Having had a chance to talk to some producers I now understand: "Multi-camera" productions are those that are shot live, or in front of an audience. The idea is that you only get one take, and so you shoot it from all the angles you might want so that you can cut to d... |
39,783,638 | In R, I have a data frame which includes a ID column. I need to find all the rows that have the same ID but are different in the X1 variable.
For example,
```
d
ID X1 X2
a 19 F
b 19 F
c 16 T
a 16 T
a 19 T
d 17 T
b 15 F
b 19 F
c 17 T
c... | 2016/09/30 | [
"https://Stackoverflow.com/questions/39783638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6457405/"
] | ```
t <- table(d$X1, d$ID)
t[t>1] <- 1
t <- apply(t,2,sum)
t <- t[t>1]
d1 <- data.frame(ID = names(t))
d1 <- merge(d1, d, by = "ID", all.x=T,all.y=F)
d1 <- unique(d1[,1:2])
d1
```
>
>
> ```
> ID X1
> 1 a 19
> 2 a 16
> 4 b 15
> 5 b 19
> 7 c 16
> 8 c 17
>
> ```
>
>
We can include the 3rd c... | Does this work?
```
df1[rownames(unique(df1[,c("ID","X1")])),]
``` |
39,783,638 | In R, I have a data frame which includes a ID column. I need to find all the rows that have the same ID but are different in the X1 variable.
For example,
```
d
ID X1 X2
a 19 F
b 19 F
c 16 T
a 16 T
a 19 T
d 17 T
b 15 F
b 19 F
c 17 T
c... | 2016/09/30 | [
"https://Stackoverflow.com/questions/39783638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6457405/"
] | We can remove the single ids first. Then get a count of the ids left. If there is a single id left we remove it:
```
newdf <- df1[duplicated(df1$ID, fromLast=TRUE),]
tbl <- table(newdf$ID)
newdf[!newdf$ID %in% names(tbl[tbl < 2]),]
# ID X1 X2
# 1 a 19 FALSE
# 2 b 19 FALSE
# 3 c 16 TRUE
# 4 a 16 TRUE
# 7 b ... | Does this work?
```
df1[rownames(unique(df1[,c("ID","X1")])),]
``` |
39,783,638 | In R, I have a data frame which includes a ID column. I need to find all the rows that have the same ID but are different in the X1 variable.
For example,
```
d
ID X1 X2
a 19 F
b 19 F
c 16 T
a 16 T
a 19 T
d 17 T
b 15 F
b 19 F
c 17 T
c... | 2016/09/30 | [
"https://Stackoverflow.com/questions/39783638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6457405/"
] | ```
t <- table(d$X1, d$ID)
t[t>1] <- 1
t <- apply(t,2,sum)
t <- t[t>1]
d1 <- data.frame(ID = names(t))
d1 <- merge(d1, d, by = "ID", all.x=T,all.y=F)
d1 <- unique(d1[,1:2])
d1
```
>
>
> ```
> ID X1
> 1 a 19
> 2 a 16
> 4 b 15
> 5 b 19
> 7 c 16
> 8 c 17
>
> ```
>
>
We can include the 3rd c... | We can remove the single ids first. Then get a count of the ids left. If there is a single id left we remove it:
```
newdf <- df1[duplicated(df1$ID, fromLast=TRUE),]
tbl <- table(newdf$ID)
newdf[!newdf$ID %in% names(tbl[tbl < 2]),]
# ID X1 X2
# 1 a 19 FALSE
# 2 b 19 FALSE
# 3 c 16 TRUE
# 4 a 16 TRUE
# 7 b ... |
12,361,830 | Can anyone give me an example of code or project that uses because I want to animate a full screen image(iPhone) with 200+ of images without crashing the device.
`+ (UIImage *)animatedImageNamed:(NSString *)name duration:(NSTimeInterval)duration`
Also on how to call it for example like `[self (method)]` and regarding... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12361830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1528839/"
] | Make the iframe not fullscreen but fullpage:
```js
function fullscreen() {
var vid = document.getElementById("vid");
vid.style.position = "absolute";
vid.style.width = "100vw";
vid.style.height = "100vh";
vid.style.top = "0px";
vid.style.left = "0px";
... | Try the following in Webkit browsers:
```
if (typeof iframe.webkitRequestFullScreen === 'function') {
button.addEventListener('click', function () {
iframe.webkitRequestFullScreen();
}, false);
}
```
Note that this won't work without a user gesture (in this case, 'click'). |
12,361,830 | Can anyone give me an example of code or project that uses because I want to animate a full screen image(iPhone) with 200+ of images without crashing the device.
`+ (UIImage *)animatedImageNamed:(NSString *)name duration:(NSTimeInterval)duration`
Also on how to call it for example like `[self (method)]` and regarding... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12361830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1528839/"
] | Make the iframe not fullscreen but fullpage:
```js
function fullscreen() {
var vid = document.getElementById("vid");
vid.style.position = "absolute";
vid.style.width = "100vw";
vid.style.height = "100vh";
vid.style.top = "0px";
vid.style.left = "0px";
... | You can use this library [XCDYouTubeKit](https://github.com/0xced/XCDYouTubeKit) instead of iframe player.
Its very simple and powerful. Supports full-screen as well as non full-screen. |
12,361,830 | Can anyone give me an example of code or project that uses because I want to animate a full screen image(iPhone) with 200+ of images without crashing the device.
`+ (UIImage *)animatedImageNamed:(NSString *)name duration:(NSTimeInterval)duration`
Also on how to call it for example like `[self (method)]` and regarding... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12361830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1528839/"
] | Try the following in Webkit browsers:
```
if (typeof iframe.webkitRequestFullScreen === 'function') {
button.addEventListener('click', function () {
iframe.webkitRequestFullScreen();
}, false);
}
```
Note that this won't work without a user gesture (in this case, 'click'). | You can use this library [XCDYouTubeKit](https://github.com/0xced/XCDYouTubeKit) instead of iframe player.
Its very simple and powerful. Supports full-screen as well as non full-screen. |
2,386,952 | I've already found the solution, but I was wondering if there is a faster or alternative method. My solution is found below:
$$\sqrt[3]{m+9}=3+\sqrt[3]{m-9}$$
$$(m+9)^\frac{1}{3}-(m-9)^\frac{1}{3}=3$$
$$\bigl((m+9)^\frac{1}{3}-(m-9)^\frac{1}{3}\bigr)^3=27$$
$$(m+9)-3(m+9)^\frac{2}{3}(m-9)^\frac{1}{3}+3(m+9)^\frac{1}{3... | 2017/08/08 | [
"https://math.stackexchange.com/questions/2386952",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/406951/"
] | Let $\sqrt[3]{m+9}=a$, $-3=b$ and $-\sqrt[3]{m-9}=c$.
Hence, we have
$$a+b+c=0.$$
But $$a^3+b^3+c^3-3abc=a^3+3a^2b+3ab^2+b^3+c^3-3a^2b-3ab^2-3abc=$$
$$=(a+b)^3+c^3-3ab(a+b+c)=(a+b+c)((a+b)^2-(a+b)c+c^2-3ab)=$$
$$=(a+b+c)(a^2+b^2+c^2-ab-ac-bc).$$
We see that $$ a^2+b^2+c^2-ab-ac-bc=\frac{1}{2}((a-b)^2+(a-c)^2+(b-c)^2),... | Hint:
Let $\sqrt[3]{m+3}=a$ and $\sqrt[3]{m-3}=b$
$a-b=?$
$a^3-b^3=?$
Can you find $ab$ and $a^3+b^3=(a+b)\{(a-b)^2+ab\}$ |
2,386,952 | I've already found the solution, but I was wondering if there is a faster or alternative method. My solution is found below:
$$\sqrt[3]{m+9}=3+\sqrt[3]{m-9}$$
$$(m+9)^\frac{1}{3}-(m-9)^\frac{1}{3}=3$$
$$\bigl((m+9)^\frac{1}{3}-(m-9)^\frac{1}{3}\bigr)^3=27$$
$$(m+9)-3(m+9)^\frac{2}{3}(m-9)^\frac{1}{3}+3(m+9)^\frac{1}{3... | 2017/08/08 | [
"https://math.stackexchange.com/questions/2386952",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/406951/"
] | Let $\sqrt[3]{m+9}=a$, $-3=b$ and $-\sqrt[3]{m-9}=c$.
Hence, we have
$$a+b+c=0.$$
But $$a^3+b^3+c^3-3abc=a^3+3a^2b+3ab^2+b^3+c^3-3a^2b-3ab^2-3abc=$$
$$=(a+b)^3+c^3-3ab(a+b+c)=(a+b+c)((a+b)^2-(a+b)c+c^2-3ab)=$$
$$=(a+b+c)(a^2+b^2+c^2-ab-ac-bc).$$
We see that $$ a^2+b^2+c^2-ab-ac-bc=\frac{1}{2}((a-b)^2+(a-c)^2+(b-c)^2),... | Go ahead and cube:
$$m+9=27+27\sqrt[3]{m-9}+9\sqrt[3]{(m-9)^2}+m-9.$$
Denote: $\sqrt[3]{m-9}=t$ to get:
$$t^2+3t+1=0 \Rightarrow t=\frac{-3\pm \sqrt{5}}{2}$$
Now:
$$m-9=t^3$$
will produce the answers. |
106,952 | I'm planning a trip to Aruba and so I was checking out the passport requirements. [I found them here](https://www.visitaruba.com/traveling-to-aruba/entry-requirements-and-visas/). Near the top, it says, "During their stay in Aruba tourists are **not allowed to work**" (emphasis theirs)
Does this mean that I can't so m... | 2017/12/18 | [
"https://travel.stackexchange.com/questions/106952",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/30347/"
] | There are two issues here:
1. **"not allowed to work"**
This refers (normally) to taking [illegal] employment in-country on a tourist visa. And thus avoiding the whole employment visa process, and paying taxes. FYI, here's how Aruba defines [work](https://www.dimasaruba.aw/en/applicants/work/).
Generally speaking, I... | *De jure* there are dozens of complex laws and regulations regarding remote employment, under which you may or may not need a special visa in order to work in a given country. Tax laws are an additional complication, where countries such as the UK can deem you as a tax resident for [spending as little as 16 days](https... |
106,952 | I'm planning a trip to Aruba and so I was checking out the passport requirements. [I found them here](https://www.visitaruba.com/traveling-to-aruba/entry-requirements-and-visas/). Near the top, it says, "During their stay in Aruba tourists are **not allowed to work**" (emphasis theirs)
Does this mean that I can't so m... | 2017/12/18 | [
"https://travel.stackexchange.com/questions/106952",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/30347/"
] | The [link you cited](https://www.visitaruba.com/traveling-to-aruba/entry-requirements-and-visas/) states the following:
>
> Persons who are considered a tourist are those who travel to Aruba for one of the following purposes: vacation and relaxation, sport, health reasons, family matters, study, religious purposes or... | *De jure* there are dozens of complex laws and regulations regarding remote employment, under which you may or may not need a special visa in order to work in a given country. Tax laws are an additional complication, where countries such as the UK can deem you as a tax resident for [spending as little as 16 days](https... |
22,586,137 | I'm new to Java and I'm trying to get the first step of the bingo game done, random call, which is a Random letter from B, I, N, G, O. With a random corresponding letter, but it's not working, error:
```
MISSING RETURN STATEMENT.
```
Can someone help me? Here is my code:
```
import java.util.Random;
public class r... | 2014/03/23 | [
"https://Stackoverflow.com/questions/22586137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3120509/"
] | Think about what happens if `symbol` contains, say, `' OR '' = '` -- an attacker could insert completely arbitrary criteria for the query. This is of particular concern if you have information about other customers' accounts in the same table, or are doing an update.
Also, <http://xkcd.com/327/> | This creates an [SQL injection vulnerability](https://www.owasp.org/index.php/SQL_Injection) if `symbol` contains user-supplied or untrusted data.
To be safe, always do it like this (as mentionned in the same page you're reading) :
```
symbol = ('RHAT',)
c.execute('SELECT * FROM stocks WHERE symbol=?', symbol)
```
... |
1,781,431 | I'm just starting out with Python and have practiced so far in the IDLE interface. Now I'd like to configure Python with MAMP so I can start creating really basic webapps — using Python inside HTML, or well, vice-versa. (I'm assuming HTML is allowed in Python, just like PHP? If not, are there any modules/template engin... | 2009/11/23 | [
"https://Stackoverflow.com/questions/1781431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | I think probably the easiest way for you to get started is to work with something like [Django](http://docs.djangoproject.com/en/dev/intro/tutorial01/). It's a top-to-bottom web development stack which provides you with everything you need to develop and run a backend server. Things can be very simple in that world, no... | Django is definitely not the easiest way.
check out pylons. <http://pylonshq.com/>
also check sqlalchemy for sql related stuff. Very cool library.
On the other hand, you can always start with something very simple like mako for templating. <http://www.makotemplates.org/> |
1,781,431 | I'm just starting out with Python and have practiced so far in the IDLE interface. Now I'd like to configure Python with MAMP so I can start creating really basic webapps — using Python inside HTML, or well, vice-versa. (I'm assuming HTML is allowed in Python, just like PHP? If not, are there any modules/template engin... | 2009/11/23 | [
"https://Stackoverflow.com/questions/1781431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | I think probably the easiest way for you to get started is to work with something like [Django](http://docs.djangoproject.com/en/dev/intro/tutorial01/). It's a top-to-bottom web development stack which provides you with everything you need to develop and run a backend server. Things can be very simple in that world, no... | You asked whether HTML is allowed within Python, which indicates that you still think too much in PHP terms about it. Contrary to PHP, Python was not designed to create dynamic web-pages. Instead, it was designed as a stand-alone, general-purpose programming language. Therefore you will not be able to put HTML into Pyt... |
1,781,431 | I'm just starting out with Python and have practiced so far in the IDLE interface. Now I'd like to configure Python with MAMP so I can start creating really basic webapps — using Python inside HTML, or well, vice-versa. (I'm assuming HTML is allowed in Python, just like PHP? If not, are there any modules/template engin... | 2009/11/23 | [
"https://Stackoverflow.com/questions/1781431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | You asked whether HTML is allowed within Python, which indicates that you still think too much in PHP terms about it. Contrary to PHP, Python was not designed to create dynamic web-pages. Instead, it was designed as a stand-alone, general-purpose programming language. Therefore you will not be able to put HTML into Pyt... | Django is definitely not the easiest way.
check out pylons. <http://pylonshq.com/>
also check sqlalchemy for sql related stuff. Very cool library.
On the other hand, you can always start with something very simple like mako for templating. <http://www.makotemplates.org/> |
24,514,694 | Please check my demo .I have been trying to implement [this please hover above any plan block](http://jsfiddle.net/EG7v9/1/embedded/result/) with different grid size i have some how managed to make it work all the grid sizes except col-xg(<768px).Here on hover the div breaks and shows irregular behavior.Below i have ad... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24514694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3127499/"
] | There is this framework that allows you to add mocking functionality to your spring xml file - <https://bitbucket.org/kubek2k/springockito/wiki/Home> | I would use the profile concept of spring; from spring 3.2.X there is the "profile" concept in Spring and you can use it to mock your bean for test scope |
24,514,694 | Please check my demo .I have been trying to implement [this please hover above any plan block](http://jsfiddle.net/EG7v9/1/embedded/result/) with different grid size i have some how managed to make it work all the grid sizes except col-xg(<768px).Here on hover the div breaks and shows irregular behavior.Below i have ad... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24514694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3127499/"
] | Generally, you don't mock parent beans, you mock each bean you want to mock.
As I understand your problem:
* you have many beans
* than use some common functionality
* you want to mock that common functionality
While the theory generally discourages refactoring for testing, the specific needs of the tests allow you ... | I would use the profile concept of spring; from spring 3.2.X there is the "profile" concept in Spring and you can use it to mock your bean for test scope |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | All I needed to do was to create a table with the same name and one dummy column. Then when I migrated, django remade all of the columns for me. | Finally, it worked for me. I have to delete my all tables and then deleted migrations files.
Then tried the below *commands* manually :
```
python manage.py makemigrations [appname]
python manage.py migrate [appname]
``` |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | Drop the tables in the db using the below code
```
python manage.py migrate app_name zero
```
Then again migrate
```
python manage.py migrate app_name
```
The reason is that there is already a table present, and when you do a "initial migration",Django will see that the initial migration has already been applied... | finally this worked for me:
```
python manage.py makemigrations [app_name]
python manage.py migrate [app_name]
``` |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | What helped finally was deleting the whole migrations folder from the project's folder. Saw some south responses as well, but haven't tried. | A necro by me, but if you dropped a table on a project with existing data and active migrations (Django, Postgres), your best bet is to drop the entire database (of course proceed with caution), recreate it, and then run manage.py migrate to re-initialize your environment.
It's the fastest way to soft reset and get in... |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | AFAIK, you should not directly delete a table from the DB before the migration. If you change your model, then `manage.py migrate` will do the thing.
django cannot detect the direct change of DB; only knows the change of model script. Therefore if you drop a table, then django does not detect the change, so django kee... | A necro by me, but if you dropped a table on a project with existing data and active migrations (Django, Postgres), your best bet is to drop the entire database (of course proceed with caution), recreate it, and then run manage.py migrate to re-initialize your environment.
It's the fastest way to soft reset and get in... |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | AFAIK, you should not directly delete a table from the DB before the migration. If you change your model, then `manage.py migrate` will do the thing.
django cannot detect the direct change of DB; only knows the change of model script. Therefore if you drop a table, then django does not detect the change, so django kee... | finally this worked for me:
```
python manage.py makemigrations [app_name]
python manage.py migrate [app_name]
``` |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | All I needed to do was to create a table with the same name and one dummy column. Then when I migrated, django remade all of the columns for me. | What I did for me was to fake migration using the command below
```
python3 manage.py migrate yourapp --fake
``` |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | I was able to solve this issue by the following steps
1. when I was running this command
`python manage.py migrate app_name zero`
it was complaining about that some table is missing. so I've created a dummy table with a dummy column.
2. I've run the command again
`python manage.py migrate app_name zero`
3. I've app... | A necro by me, but if you dropped a table on a project with existing data and active migrations (Django, Postgres), your best bet is to drop the entire database (of course proceed with caution), recreate it, and then run manage.py migrate to re-initialize your environment.
It's the fastest way to soft reset and get in... |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | What helped finally was deleting the whole migrations folder from the project's folder. Saw some south responses as well, but haven't tried. | finally this worked for me:
```
python manage.py makemigrations [app_name]
python manage.py migrate [app_name]
``` |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | What I did for me was to fake migration using the command below
```
python3 manage.py migrate yourapp --fake
``` | Finally, it worked for me. I have to delete my all tables and then deleted migrations files.
Then tried the below *commands* manually :
```
python manage.py makemigrations [appname]
python manage.py migrate [appname]
``` |
36,087,665 | this code return an error
preg\_replace\_callback(): Requires argument 2, 'Array', to be a valid callback
```
$tPattern = array(
"/\\\(\d{1,3})/",
"/\\\\\(/",
"/\\\\\)/"
);
$tCallback = array(
function($m) { return chr(octdec($m[1])); },
function($m) { return '('; }... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36087665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552210/"
] | What helped finally was deleting the whole migrations folder from the project's folder. Saw some south responses as well, but haven't tried. | Finally, it worked for me. I have to delete my all tables and then deleted migrations files.
Then tried the below *commands* manually :
```
python manage.py makemigrations [appname]
python manage.py migrate [appname]
``` |
133,814 | How to get from
$$\lim\_{n\to\infty} \frac{\cot{\frac{2}{n}}+n\csc{\frac{3}{n^3}}}{\csc{\frac{3}{n}} + n\cot{\frac{2}{n^2}}} = \lim\_{n\to\infty} \frac{\frac{\frac{2}{n}}{\tan{\frac{2}{n}}}\cdot\frac{1}{2n^2}+\frac{\frac{3}{n^2}}{\sin{\frac{3}{n^2}}}\cdot\frac{1}{3}}{\frac{\frac{3}{n}}{\sin{\frac{3}{n}}}\cdot \frac{1... | 2012/04/19 | [
"https://math.stackexchange.com/questions/133814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2006/"
] | As you've already noticed, the series must be absolutely convergent for this to be true. To see even better that all hell breaks loose when the series is only conditionally convergent, consider [Riemann series theorem](http://en.wikipedia.org/wiki/Riemann_series_theorem): if $\sum a\_n$ is a conditionally convergent se... | Yes ,it can write as that,because $\sum\_{k=1}^{2n}a\_k=\sum\_{k=1}^n a\_{2k-1}+\sum\_{k=1}^n a\_{2k}$, when $n \to \infty$,
then we have
$\sum\_{k=1}^\infty a\_k=\sum\_{k=1}^\infty a\_{2k-1}+\sum\_{k=1}^\infty a\_{2k}$, **if when $n \to \infty$, $\sum\_{k=1}^\infty a\_{2k-1}$ and $\sum\_{k=1}^\infty a\_{2k}$ exist**... |
133,814 | How to get from
$$\lim\_{n\to\infty} \frac{\cot{\frac{2}{n}}+n\csc{\frac{3}{n^3}}}{\csc{\frac{3}{n}} + n\cot{\frac{2}{n^2}}} = \lim\_{n\to\infty} \frac{\frac{\frac{2}{n}}{\tan{\frac{2}{n}}}\cdot\frac{1}{2n^2}+\frac{\frac{3}{n^2}}{\sin{\frac{3}{n^2}}}\cdot\frac{1}{3}}{\frac{\frac{3}{n}}{\sin{\frac{3}{n}}}\cdot \frac{1... | 2012/04/19 | [
"https://math.stackexchange.com/questions/133814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2006/"
] | In general: If you have two *convergent* series:
$$\sum\_{k=1}^{\infty} b\_k \quad\text{and}\quad \sum\_{k=1}^{\infty} c\_k.
$$
Then the series
$$
\sum\_{k=1}^{\infty}(b\_k + c\_k)
$$
is also convergent. So for example if $b\_k$ and $c\_k$ are given by $b\_k = a\_{2k-1}$ and $c\_k = a{2k}$, then indeed you get a conve... | Yes ,it can write as that,because $\sum\_{k=1}^{2n}a\_k=\sum\_{k=1}^n a\_{2k-1}+\sum\_{k=1}^n a\_{2k}$, when $n \to \infty$,
then we have
$\sum\_{k=1}^\infty a\_k=\sum\_{k=1}^\infty a\_{2k-1}+\sum\_{k=1}^\infty a\_{2k}$, **if when $n \to \infty$, $\sum\_{k=1}^\infty a\_{2k-1}$ and $\sum\_{k=1}^\infty a\_{2k}$ exist**... |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | Take a look at anchor tags. You can create an anchor with
```
<div id="anchor-name">Heading Text</div>
```
and refer to it later with
```
<a href="http://server/page.html#anchor-name">Link text</a>
``` | Create an anchor:
```
<a name="anchor" id="anchor"></a>
```
then link to it:
```
<a href="http://server/page.html#anchor">Link text</a>
``` |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | Take a look at anchor tags. You can create an anchor with
```
<div id="anchor-name">Heading Text</div>
```
and refer to it later with
```
<a href="http://server/page.html#anchor-name">Link text</a>
``` | You can add **hash info** in next page url to move browser at specific position(any html element), after page is loaded.
This is can done in this way:
add hash in the url of next\_page : example.com#**hashkey**
```
$( document ).ready(function() {
##get hash code at next page
var hashcode = window.location.hash... |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | Take a look at anchor tags. You can create an anchor with
```
<div id="anchor-name">Heading Text</div>
```
and refer to it later with
```
<a href="http://server/page.html#anchor-name">Link text</a>
``` | You simply combine the ideas of a link to another page, as with `href=foo.html`, and a link to an element on the same page, as with `href=#bar`, so that the fragment like `#bar` is written immediately after the URL that refers to another page:
```
<a href="foo.html#bar">Some nice link text</a>
```
The target is spec... |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | Take a look at anchor tags. You can create an anchor with
```
<div id="anchor-name">Heading Text</div>
```
and refer to it later with
```
<a href="http://server/page.html#anchor-name">Link text</a>
``` | ```
<a href="./container.html">
<div>anything
<h1>hello stcakoverflow<h1>
<div>
</a>
```
>
> now doing thos this all div are clickcable
>
>
> |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | You can add **hash info** in next page url to move browser at specific position(any html element), after page is loaded.
This is can done in this way:
add hash in the url of next\_page : example.com#**hashkey**
```
$( document ).ready(function() {
##get hash code at next page
var hashcode = window.location.hash... | Create an anchor:
```
<a name="anchor" id="anchor"></a>
```
then link to it:
```
<a href="http://server/page.html#anchor">Link text</a>
``` |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | You simply combine the ideas of a link to another page, as with `href=foo.html`, and a link to an element on the same page, as with `href=#bar`, so that the fragment like `#bar` is written immediately after the URL that refers to another page:
```
<a href="foo.html#bar">Some nice link text</a>
```
The target is spec... | Create an anchor:
```
<a name="anchor" id="anchor"></a>
```
then link to it:
```
<a href="http://server/page.html#anchor">Link text</a>
``` |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | You simply combine the ideas of a link to another page, as with `href=foo.html`, and a link to an element on the same page, as with `href=#bar`, so that the fragment like `#bar` is written immediately after the URL that refers to another page:
```
<a href="foo.html#bar">Some nice link text</a>
```
The target is spec... | You can add **hash info** in next page url to move browser at specific position(any html element), after page is loaded.
This is can done in this way:
add hash in the url of next\_page : example.com#**hashkey**
```
$( document ).ready(function() {
##get hash code at next page
var hashcode = window.location.hash... |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | You can add **hash info** in next page url to move browser at specific position(any html element), after page is loaded.
This is can done in this way:
add hash in the url of next\_page : example.com#**hashkey**
```
$( document ).ready(function() {
##get hash code at next page
var hashcode = window.location.hash... | ```
<a href="./container.html">
<div>anything
<h1>hello stcakoverflow<h1>
<div>
</a>
```
>
> now doing thos this all div are clickcable
>
>
> |
20,565,644 | I'd like that a specific link goes to a certain header on another page. I know how to do it on the current page. | 2013/12/13 | [
"https://Stackoverflow.com/questions/20565644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2754599/"
] | You simply combine the ideas of a link to another page, as with `href=foo.html`, and a link to an element on the same page, as with `href=#bar`, so that the fragment like `#bar` is written immediately after the URL that refers to another page:
```
<a href="foo.html#bar">Some nice link text</a>
```
The target is spec... | ```
<a href="./container.html">
<div>anything
<h1>hello stcakoverflow<h1>
<div>
</a>
```
>
> now doing thos this all div are clickcable
>
>
> |
32,471 | ```
$ ./configure
configure: configuring for GNU Wget 1.11
checking build system type... i686-apple-darwin10.0.0
checking host system type... i686-apple-darwin10.0.0
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... gcc
```
Is there a way to ski... | 2009/08/30 | [
"https://superuser.com/questions/32471",
"https://superuser.com",
"https://superuser.com/users/2084/"
] | ./configure can be told to cache the results of the checks with the option `-C`, see [here](http://www.astro.gla.ac.uk/~norman/star/ssn78/ssn78.htx/N-a2b1c5.html). | autoconf is used to provide a way of determining the capabilities of the host on which the application is being compiled. Skipping these checks would imply it doesn't know what the capabilities of the build target.
As mentioned above, you can cache the results but you'd need to run it at least once to prime the cache. |
69,125,984 | How can I remove the item in an array that is selected by the random?.
Instead of giving me two different items in an array it's just printing the same item selected by the random.
```
String[] names = {"jey","abby","alyssa","cole","yzabel","miho"};
Random rand = new Random();
String names_rand = names[rand.n... | 2021/09/10 | [
"https://Stackoverflow.com/questions/69125984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12767841/"
] | If EF would automatically load related items, you would literally load the whole database because it would not know where to stop.
Hence, you must manually decide which related items to load. Using the ".include" function to declare which items to include.
In this case, i.e.
```cs
_context.TodoItemTs.Include(x => x.... | Try to add foreign key attribute also on your navigation property matching your foreign key property name. Anyway I would go for fluent definition of relationships between the tables, this way I think you are missing a relationship. |
69,125,984 | How can I remove the item in an array that is selected by the random?.
Instead of giving me two different items in an array it's just printing the same item selected by the random.
```
String[] names = {"jey","abby","alyssa","cole","yzabel","miho"};
Random rand = new Random();
String names_rand = names[rand.n... | 2021/09/10 | [
"https://Stackoverflow.com/questions/69125984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12767841/"
] | Lazy loading is one of breaking changes you need to keep in mind when moving from EF6 to EF.Core.
In EF6 it worked automatically by default with the value `LazyLoadingEnabled` set to `true` by default.
See this post [Lazy and Eager Loading in Entity Framework](https://www.c-sharpcorner.com/UploadFile/dacca2/lazy-... | If EF would automatically load related items, you would literally load the whole database because it would not know where to stop.
Hence, you must manually decide which related items to load. Using the ".include" function to declare which items to include.
In this case, i.e.
```cs
_context.TodoItemTs.Include(x => x.... |
69,125,984 | How can I remove the item in an array that is selected by the random?.
Instead of giving me two different items in an array it's just printing the same item selected by the random.
```
String[] names = {"jey","abby","alyssa","cole","yzabel","miho"};
Random rand = new Random();
String names_rand = names[rand.n... | 2021/09/10 | [
"https://Stackoverflow.com/questions/69125984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12767841/"
] | Entity Framework doesn't load related lists (otherwise, how does it know where to stop). You need to specify explicitly:
```
return await _context.TodoItemTs.Include("SubItems").ToListAsync();
```
There are various ways to accomplish that. Please refer to [Loading Related Entities](https://learn.microsoft.com/en-us/... | Try to add foreign key attribute also on your navigation property matching your foreign key property name. Anyway I would go for fluent definition of relationships between the tables, this way I think you are missing a relationship. |
69,125,984 | How can I remove the item in an array that is selected by the random?.
Instead of giving me two different items in an array it's just printing the same item selected by the random.
```
String[] names = {"jey","abby","alyssa","cole","yzabel","miho"};
Random rand = new Random();
String names_rand = names[rand.n... | 2021/09/10 | [
"https://Stackoverflow.com/questions/69125984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12767841/"
] | Lazy loading is one of breaking changes you need to keep in mind when moving from EF6 to EF.Core.
In EF6 it worked automatically by default with the value `LazyLoadingEnabled` set to `true` by default.
See this post [Lazy and Eager Loading in Entity Framework](https://www.c-sharpcorner.com/UploadFile/dacca2/lazy-... | Entity Framework doesn't load related lists (otherwise, how does it know where to stop). You need to specify explicitly:
```
return await _context.TodoItemTs.Include("SubItems").ToListAsync();
```
There are various ways to accomplish that. Please refer to [Loading Related Entities](https://learn.microsoft.com/en-us/... |
69,125,984 | How can I remove the item in an array that is selected by the random?.
Instead of giving me two different items in an array it's just printing the same item selected by the random.
```
String[] names = {"jey","abby","alyssa","cole","yzabel","miho"};
Random rand = new Random();
String names_rand = names[rand.n... | 2021/09/10 | [
"https://Stackoverflow.com/questions/69125984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12767841/"
] | Lazy loading is one of breaking changes you need to keep in mind when moving from EF6 to EF.Core.
In EF6 it worked automatically by default with the value `LazyLoadingEnabled` set to `true` by default.
See this post [Lazy and Eager Loading in Entity Framework](https://www.c-sharpcorner.com/UploadFile/dacca2/lazy-... | Try to add foreign key attribute also on your navigation property matching your foreign key property name. Anyway I would go for fluent definition of relationships between the tables, this way I think you are missing a relationship. |
72,639,790 | I am developing a local package for my flutter project, it's basically a UI library which includes a lot of image assets.
I don't want to load the assets in the package from my main project.
I want to load the assets in the package itself.
Here's what I did,
asset location: package\_name/lib/assets
pubspec.yaml: p... | 2022/06/16 | [
"https://Stackoverflow.com/questions/72639790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11470112/"
] | Try to change your filter like this:
```
find({
"$or": [
{"$and": [
{"$expr": {"$eq": [{"$month": "$birthday"}, today.month]}},
{"$expr": {"$gte": [{"$dayOfMonth": "$birthday"}, today.day]}}
]},
{"$and": [
{"$expr": {"$eq": [{"$month": "$birthday"}, one_m... | I needed to make it so it found all days where `(month == today.month && day >= today.day) || (month == one_month_from_today.month && day <= one_month_from_today.day)` |
143,317 | I tried to create a Stack Overflow account for testing, so I can temporarily step into the shoes of a new user. During registration I entered my OpenID email, so when I log in, I get my main account.
Given the fact that I only have one permanent email account, is there a way to sign up for a new Stack Overflow account... | 2012/08/13 | [
"https://meta.stackexchange.com/questions/143317",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/183013/"
] | Since you are using Gmail and assuming your email is `username@gmail.com`, you can use `username+whatever@gmail.com` for the test account. Gmail ignores everything after the plus sign, and will redirect all emails send there to your regular account. After you register you will be asked if you want to associate the two ... | You can simply use a not registered account: Browse on Stack Overflow using a browser you have never used to log in on Stack Overflow, and you can create a not registered account.
This works if you are going to ask a question, or answering a question. If you don't plan to do that, then [Yannis Rizos's suggestion](htt... |
24,044,252 | I have a turn based game and am trying to end the game when someone forfeits from Game Center out of turn. I can't figure out what is called when the player out of turn actually presses the "forfeit" button. I want to implement,
```
participantQuitOutOfTurnWithOutcome:withCompletionHandler:
```
but don't know where ... | 2014/06/04 | [
"https://Stackoverflow.com/questions/24044252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754512/"
] | The `$jokes[]` syntax is appending the joke text string to the `$jokes` array. If the array doesn't exist, it will be created.
It's the same as doing:
```
array_push($jokes, $result['joketext']);
```
If you don't need to create a new array, you can just work with the joke text directly in the `$results` foreach, if... | `$jokes[] =` appends a new value to an array and is the same as doing `$jokes[count($jokes)]` (not completely correct but is a simple way of explaining it).
Technically, you don't **have** to put all the values in a new array, you could use the original loop instead.
`array_push` has the same functionality, you can r... |
24,044,252 | I have a turn based game and am trying to end the game when someone forfeits from Game Center out of turn. I can't figure out what is called when the player out of turn actually presses the "forfeit" button. I want to implement,
```
participantQuitOutOfTurnWithOutcome:withCompletionHandler:
```
but don't know where ... | 2014/06/04 | [
"https://Stackoverflow.com/questions/24044252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754512/"
] | The `$jokes[]` syntax is appending the joke text string to the `$jokes` array. If the array doesn't exist, it will be created.
It's the same as doing:
```
array_push($jokes, $result['joketext']);
```
If you don't need to create a new array, you can just work with the joke text directly in the `$results` foreach, if... | your query only selects for one column `joketext` so you don't have any of the other column data in your result set.
Using `$jokes[] = ..` is a shorthand way of assigning a value to a new element in the `$jokes` array. You don't necessarily need to do this. It is just commonly done so that you can use the data later ... |
24,044,252 | I have a turn based game and am trying to end the game when someone forfeits from Game Center out of turn. I can't figure out what is called when the player out of turn actually presses the "forfeit" button. I want to implement,
```
participantQuitOutOfTurnWithOutcome:withCompletionHandler:
```
but don't know where ... | 2014/06/04 | [
"https://Stackoverflow.com/questions/24044252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754512/"
] | The `$jokes[]` syntax is appending the joke text string to the `$jokes` array. If the array doesn't exist, it will be created.
It's the same as doing:
```
array_push($jokes, $result['joketext']);
```
If you don't need to create a new array, you can just work with the joke text directly in the `$results` foreach, if... | If I understand you correctly then I believe you are correct. The second `foreach` is not needed, you can simply `echo` the `$result['joketext']` during the first `foreach` and skip the second one altogether.
so delete the second `foreach` and edit the first one as follows:
```
foreach ($results as $result){
echo... |
24,044,252 | I have a turn based game and am trying to end the game when someone forfeits from Game Center out of turn. I can't figure out what is called when the player out of turn actually presses the "forfeit" button. I want to implement,
```
participantQuitOutOfTurnWithOutcome:withCompletionHandler:
```
but don't know where ... | 2014/06/04 | [
"https://Stackoverflow.com/questions/24044252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754512/"
] | your query only selects for one column `joketext` so you don't have any of the other column data in your result set.
Using `$jokes[] = ..` is a shorthand way of assigning a value to a new element in the `$jokes` array. You don't necessarily need to do this. It is just commonly done so that you can use the data later ... | `$jokes[] =` appends a new value to an array and is the same as doing `$jokes[count($jokes)]` (not completely correct but is a simple way of explaining it).
Technically, you don't **have** to put all the values in a new array, you could use the original loop instead.
`array_push` has the same functionality, you can r... |
24,044,252 | I have a turn based game and am trying to end the game when someone forfeits from Game Center out of turn. I can't figure out what is called when the player out of turn actually presses the "forfeit" button. I want to implement,
```
participantQuitOutOfTurnWithOutcome:withCompletionHandler:
```
but don't know where ... | 2014/06/04 | [
"https://Stackoverflow.com/questions/24044252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1754512/"
] | your query only selects for one column `joketext` so you don't have any of the other column data in your result set.
Using `$jokes[] = ..` is a shorthand way of assigning a value to a new element in the `$jokes` array. You don't necessarily need to do this. It is just commonly done so that you can use the data later ... | If I understand you correctly then I believe you are correct. The second `foreach` is not needed, you can simply `echo` the `$result['joketext']` during the first `foreach` and skip the second one altogether.
so delete the second `foreach` and edit the first one as follows:
```
foreach ($results as $result){
echo... |
20,853,520 | In Non-uniform memory access, does each cpu has it's own I/O controller? I understand that in NUMA, each CPU has their local RAM. It's like each processor is running an individual process. They can speak to each other using IPC mechanism like Socket, etc. I was just wondering just like each local RAM, do they have loca... | 2013/12/31 | [
"https://Stackoverflow.com/questions/20853520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2735434/"
] | Nodes in a NUMA system have local RAM and can have local I/O. The later depends heavily on how the system is configured at the hardware level. If memory interchanges are performed by I/O accesses, then obviously each CPU must have its own I/O controller.
Here you have an example of an (old) NUMA system with local I/O ... | The answer is No. However, different hardware generations might have different architectures. please see the following for architecture diagrams which might help answering u'r question:
[NUMA diagrams](http://www.sqlskills.com/blogs/jonathan/understanding-non-uniform-memory-accessarchitectures-numa/) |
56,284,217 | I whant to I make 2 values work simultaneously
example:
I whant **X** go from 0 to 100 and **Y** from 500 to -200
variable
with my code only works on **X\_start** and **X\_end** it go from (0, 1,2...100)
but the **Y\_start** and **Y\_end** don't work that way, it goes (500,500...500,-200) and what I need it to do is ... | 2019/05/23 | [
"https://Stackoverflow.com/questions/56284217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11547466/"
] | I Jason, i think this code help you.
CODE:
```
DataSet ds = new DataSet();
string query = "select * from tab_menu";
SqlConnection sqlConnection = new SqlConnection(@"Persist Security Info=False;User ID=sa;Password=sa;Initial Catalog=EasyAdmin;Data Source=.");
SqlCommand sqlCommand = n... | Ok so enable to do this i just hid the column holding the string to the photo, and kept the code to add a button to the rows..so thank you for the help Silvio...appreciate it
```
private void frmRepoPremier_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
string query =... |
6,927 | I have several pieces of documentation *about* libraries, but I am not yet able to infer what steps are needed to compile and deploy a library and then a contract that uses it. The behavior of the library within solidity is quite clear, but compiling and linking is not obvious to me.
Resources I have consulted:
* <ht... | 2016/07/07 | [
"https://ethereum.stackexchange.com/questions/6927",
"https://ethereum.stackexchange.com",
"https://ethereum.stackexchange.com/users/1366/"
] | First, let's save both of those files in the same directory and run `solc --optimize --bin MetaCoin.sol`. The output is:
```
======= MetaCoin =======
Binary:
606060405260018054600160a060020a031916331790557f9447fa1700000000000000000000000000000000000000000000000000000000606090815260006064819052600260845273__TestLib___... | To add, it's possible to manually link contracts (if you wish to deploy both library and contract together.) The simplest way is just to replace all occurrences of the placeholders with the address.
An example, taken from my own (modified) code:
```
var linkedMetaCoinCode = metaCoinBytecode.replace(
/_+TestLib_+/g,... |
8,830,233 | I am new to symfony 2. I have just setup with basic FOSuserbundle. But I have a few problems:
1. I have setup the new layout template but I could not find where to change the form template for login, registration, profile
2. I could not find how to edit the user profile. I can view the profile using /profile but I cou... | 2012/01/12 | [
"https://Stackoverflow.com/questions/8830233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/767244/"
] | Answers on your questions you can find inside [documentation](https://github.com/FriendsOfSymfony/FOSUserBundle/tree/master/Resources/doc). Here are some points:
1. Copy templates you want to modify from `FOSUserBundle/Resources/views` into your bundle and do changes you want.
2. If you need to make a custom profile f... | @Anton has the correct answer for the first part of your question but to answer the second part, if you can view your profile from `/profile` you can edit by going to `/profile/edit` in your browser.
There is no edit link on the default profile form. If you want one, you'll need to take the advice of @Anton and copy t... |
55,332,765 | I have been stuck on what to do with this for loop inside an istream operator, i dont understand why it doesnt find >> operator.
Error C2679 binary '>>': no operator found which takes a right-hand operand of type 'Result' (or there is no acceptable conversion)
any help would be madly appreciated.
```
#include "pch... | 2019/03/25 | [
"https://Stackoverflow.com/questions/55332765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8814023/"
] | No, You can't achieve this in iOS. According to Apple about biometric
>
> Touch ID doesn't store any images of your fingerprint. It stores only
> a mathematical representation of your fingerprint. It isn't possible
> for someone to reverse engineer your actual fingerprint image from
> this mathematical representa... | No, there's no way for you to know how many and which finger was used for biometrics, the secure enclave only lets you know if the biometric check has passed or not. |
28,617,421 | I Have two programs a.jar and b.jar, b.jar is a console application that i can't change, a.jar is a gui application that needs to send commands to b.jar that will then be interpreted there. a.jar also needs to receive the output of b.jar. I usually run b.jar in command prompt and type the commands for the program to ru... | 2015/02/19 | [
"https://Stackoverflow.com/questions/28617421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4088794/"
] | A combination of [`substr`](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr)s and string concatenations should do the trick:
```
UPDATE my_table
SET col1 = CONCAT('xxx-xxx-' , SUBSTR(col1, 9))
WHERE col1 LIKE '%abc%'
``` | try this:
```
IF(col LIKE '%abc%', REPLACE(col, 'abc-def', 'xxx-xxx'), col)
``` |
175,792 | **Bug partially fixed in 12.1** [CASE:4081592]
`ImageResolution` now works correctly for `Image`, but not for `Image3D`.
---
Does *Mathematica* have a feature to set the pixel aspect ratio of 2D images?
For example,
```
Image3DSlices[ExampleData[{"TestImage3D", "CThead"}], 100, 3]
```
.
---
Original answer
---------------
*Note*: I've sent a suggestion for improvement to the tech support with a link to this post ([CASE:4081592]).
*Mat... | This might have been overlooked in the implementation of `Image`. When I see this right, then the correct way to handle this would be to respect the setting of `ImageResolution` and acknowledge that it can be different for different directions
[](htt... |
175,792 | **Bug partially fixed in 12.1** [CASE:4081592]
`ImageResolution` now works correctly for `Image`, but not for `Image3D`.
---
Does *Mathematica* have a feature to set the pixel aspect ratio of 2D images?
For example,
```
Image3DSlices[ExampleData[{"TestImage3D", "CThead"}], 100, 3]
```
 [`ImageSize`](http://reference.wolfram.com/language/ref/ImageSize) syntax could be used:
```
img = Image3DSlices[ExampleData[{"TestImage3D","CThead"}],100,3];
Show[img, ImageSize -> 1 -> {1,2}]
```
[](htt... |
175,792 | **Bug partially fixed in 12.1** [CASE:4081592]
`ImageResolution` now works correctly for `Image`, but not for `Image3D`.
---
Does *Mathematica* have a feature to set the pixel aspect ratio of 2D images?
For example,
```
Image3DSlices[ExampleData[{"TestImage3D", "CThead"}], 100, 3]
```
.
---
Original answer
---------------
*Note*: I've sent a suggestion for improvement to the tech support with a link to this post ([CASE:4081592]).
*Mat... | It is indeed surprisingly difficult. We have to set explicit `AspectRatio` and `ImageSize` (and optionally `Magnification`) after conversion into the corresponding `Graphics` object:
```
pixelAspectRatio = 2;
img = Image3DSlices[ExampleData[{"TestImage3D", "CThead"}], 100, 3];
Show[img,
AspectRatio -> pixelAspectRa... |
175,792 | **Bug partially fixed in 12.1** [CASE:4081592]
`ImageResolution` now works correctly for `Image`, but not for `Image3D`.
---
Does *Mathematica* have a feature to set the pixel aspect ratio of 2D images?
For example,
```
Image3DSlices[ExampleData[{"TestImage3D", "CThead"}], 100, 3]
```
 [`ImageSize`](http://reference.wolfram.com/language/ref/ImageSize) syntax could be used:
```
img = Image3DSlices[ExampleData[{"TestImage3D","CThead"}],100,3];
Show[img, ImageSize -> 1 -> {1,2}]
```
[ after conversion into the corresponding `Graphics` object:
```
pixelAspectRatio = 2;
img = Image3DSlices[ExampleData[{"TestImage3D", "CThead"}], 100, 3];
Show[img,
AspectRatio -> pixelAspectRa... |
175,792 | **Bug partially fixed in 12.1** [CASE:4081592]
`ImageResolution` now works correctly for `Image`, but not for `Image3D`.
---
Does *Mathematica* have a feature to set the pixel aspect ratio of 2D images?
For example,
```
Image3DSlices[ExampleData[{"TestImage3D", "CThead"}], 100, 3]
```
 [`ImageSize`](http://reference.wolfram.com/language/ref/ImageSize) syntax could be used:
```
img = Image3DSlices[ExampleData[{"TestImage3D","CThead"}],100,3];
Show[img, ImageSize -> 1 -> {1,2}]
```
[.
---
Original answer
---------------
*Note*: I've sent a suggestion for improvement to the tech support with a link to this post ([CASE:4081592]).
*Mat... |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | The problem is this line:
`File "C:\Python27\lib\site-packages\guardian\management\__init__.py", line 33, in create_anonymous_user
User.objects.get(**lookup)`
`guardian\management\__init__.py` is calling `User` before it is defined.
Why is it called before it is defined?
...well, it is called by `makemigrations` to... | This occurs whenever the tables are not created, or the tables are not available in the database to which this application is pointed in `settings.py`.
So create the migration files by using this command:
```
python manage.py makemigrations
```
After the migration files are created, you need to migrate them:
```
p... |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | ```
python manage.py migrate --run-syncdb
```
This command will look into which tables were not created and will create all the needed tables. | I have came across same error while working with chatrooms.
I resolved using deleting the **db.sqlite3** file and deleting the **0001\_initial.py** file in the migrations folder of the app and then i executed the following statements:-
```
python manage.py makemigrations
python manage.py migrate
```
then i was able ... |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | ```
python manage.py migrate --run-syncdb
```
This command will look into which tables were not created and will create all the needed tables. | RUN: python3 manage.py migrate |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | I was get same error and to fix the same, I checked if the mentioned table in error is present in connected DB or not. It was not. Applied migration again and it worked.
```
python manage.py migrate
python manage.py makemigrations
``` | I have came across same error while working with chatrooms.
I resolved using deleting the **db.sqlite3** file and deleting the **0001\_initial.py** file in the migrations folder of the app and then i executed the following statements:-
```
python manage.py makemigrations
python manage.py migrate
```
then i was able ... |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | The problem is this line:
`File "C:\Python27\lib\site-packages\guardian\management\__init__.py", line 33, in create_anonymous_user
User.objects.get(**lookup)`
`guardian\management\__init__.py` is calling `User` before it is defined.
Why is it called before it is defined?
...well, it is called by `makemigrations` to... | I have came across same error while working with chatrooms.
I resolved using deleting the **db.sqlite3** file and deleting the **0001\_initial.py** file in the migrations folder of the app and then i executed the following statements:-
```
python manage.py makemigrations
python manage.py migrate
```
then i was able ... |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | ```
./manage.py migrate
```
if your Django version is 1.9 or lower, use
```
./manage.py syncdb
```
then
```
python manage.py createsuperuser
```
more details on <https://github.com/django/django/blob/master/django/contrib/auth/forms.py>
May it help | I was get same error and to fix the same, I checked if the mentioned table in error is present in connected DB or not. It was not. Applied migration again and it worked.
```
python manage.py migrate
python manage.py makemigrations
``` |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | I was get same error and to fix the same, I checked if the mentioned table in error is present in connected DB or not. It was not. Applied migration again and it worked.
```
python manage.py migrate
python manage.py makemigrations
``` | RUN: python3 manage.py migrate |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | ```
./manage.py migrate
```
if your Django version is 1.9 or lower, use
```
./manage.py syncdb
```
then
```
python manage.py createsuperuser
```
more details on <https://github.com/django/django/blob/master/django/contrib/auth/forms.py>
May it help | ```
python manage.py migrate --run-syncdb
```
This command will look into which tables were not created and will create all the needed tables. |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | ```
./manage.py migrate
```
if your Django version is 1.9 or lower, use
```
./manage.py syncdb
```
then
```
python manage.py createsuperuser
```
more details on <https://github.com/django/django/blob/master/django/contrib/auth/forms.py>
May it help | This occurs whenever the tables are not created, or the tables are not available in the database to which this application is pointed in `settings.py`.
So create the migration files by using this command:
```
python manage.py makemigrations
```
After the migration files are created, you need to migrate them:
```
p... |
39,071,093 | After I install Django-userena,there is an error
my django version :1.9.5
I just install django-userena step by step ,but when i migrate it ,an error happend and I don't how to solve it.
```
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39071093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6737897/"
] | ```
./manage.py migrate
```
if your Django version is 1.9 or lower, use
```
./manage.py syncdb
```
then
```
python manage.py createsuperuser
```
more details on <https://github.com/django/django/blob/master/django/contrib/auth/forms.py>
May it help | The problem is this line:
`File "C:\Python27\lib\site-packages\guardian\management\__init__.py", line 33, in create_anonymous_user
User.objects.get(**lookup)`
`guardian\management\__init__.py` is calling `User` before it is defined.
Why is it called before it is defined?
...well, it is called by `makemigrations` to... |
2,452,347 | I have question in memory management (objective C). There are two ideal scenario.
============================= scenario 1 ========================================
```
(void) funcA
{
MyObj *c = [otherObj getMyObject];
[c release];
}
-(MyObj *) getMyObject //(this method is available in other OtherObj.m file... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2452347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/228202/"
] | The second approach is preferable. The convention is that only "alloc" and "copy" methods should return an object that is the caller's responsibility to release. This convention is for ease of maintenance and has nothing to do with efficiency.
Efficiency (of the memory kind) only really comes into play if you're consi... | May I suggest [the documentation](http://developer.apple.com/iPhone/library/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html "the documentation") on memory management for the iPhone? |
24,147,107 | I'm working with Hadoop Paradigm and i want to configure the rack awarness files.
So i've created a topology.sh script and topology.data file and i populated it with my nodes.
But when i start my cluster and type hadoop dfsadmin -report command it doesn't show the rack of any node.
Can any one help me with this.
he... | 2014/06/10 | [
"https://Stackoverflow.com/questions/24147107",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3477771/"
] | Since `BasicServiceObserver` is a protocol, not a class, it should not be forward-declared in this situation at all. Declaring it as a `@class` misleads the compiler into thinking that there would be an `@interface BasicServiceObserver` somewhere when there is no such interface.
Here is how you should get this to a st... | As others have pointed out, a class and a protocol are not the same thing.
Sometimes you do want to define both, e.g. the system UITableView class and the UITableViewDelegateProtocol protocol.
If you are going to have both a protocol and a class, I suggest adding the word protocol to the name of the protocol:
```
@p... |
43,345,040 | In HTML we usually do comments alike:
```
<!-- Comment here -->
```
Why is the comment not symmetrical as in:
```
<!-- Comment here --!>
```
I'm looking for the historical answer. | 2017/04/11 | [
"https://Stackoverflow.com/questions/43345040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/480212/"
] | The Angular module system can be confusing at first glance, but is pretty straightforward once you get used to it.
There are some simple rules to follow:
1. Every component/directive/pipe *(i.e. items you use in templates aka declarables)* must be declared in one and only one module *(not an issue for you)*
2. If you... | You need to export the directive in module
```
@NgModule({
......,
exports:[HighlightDirective]
})
export class AppModule { }
``` |
9,736,936 | I got a simple POJO class that i wish to display / update in a form
Using the BeanItem class and the binding of component data, i was able to quickly display the first attributes of may data class. However i've hit a wall for tow related attributes :
my class posses a set of available status, as a list of object 'A... | 2012/03/16 | [
"https://Stackoverflow.com/questions/9736936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49804/"
] | I suggest my way to resolve this. I don't think this is the nicest way, but it's works.
The beanItem class contains all you need.
I did the following in a simple project and it's work verry well :
```
ComboBox status = new ComboBox("ComboBox");
status.setImmediate(true);
status.setNullSelectionAllow... | From the [vaadin demo site](http://demo.vaadin.com/sampler#FormBasic) you can get this sample that show how to fill a combobox with countries. You could do the same i would guess (not sure I understand your problem 100%):
```
myForm.setFormFieldFactory(new MyFormFieldFactory ());
private class MyFormFieldFactory exte... |
216,207 | I use OpenVPN Connect. When VPN connection is active Google Play can show pages, pictures, video, but does not download the application: "pending...".
To begin download I need to disable VPN, then it works. Tell me how to research a problem and make GPlay work over VPN? | 2019/08/26 | [
"https://android.stackexchange.com/questions/216207",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/286337/"
] | "Since VPNs basically spoof your location, it may lead Google Play Store to think you aren’t in the country where you should be according to your device, and it can pause your downloads.
If that’s the case, there really isn’t much you need to do to fix the issue. All you need to do is disable the VPN app on your phone... | After all, I found [Aurora Store](https://f-droid.org/en/packages/com.aurora.store/). It is like Google's Play Store, but has some cool features like anonymous apk download, sharing, version selection, etc. |
40,713,095 | I am facing an issue while sharing the same model between a view and its multiple partial views.
I have a main view `MainView` which has its own model `MainViewModel`. In this `MainView`, I have a few controls which are bound to properties in the `MainViewModel`.
On a button click I am opening a partial view from thi... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40713095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5621607/"
] | Check Below Code for passing model data through JSON :
```css
//Your Master Model Properties
public partial class YourMasterModel
{
public List<YourModel> YourMasterModelList{ get; set; }
public YourModel YourModel{ get; set; }
}
//Your Model Properties
pub... | If you want to pass parameter into post method use below technique:
```
@using (Ajax.BeginForm("action", "controller", null, new AjaxOptions() { OnSuccess = "" }, new { @class = "form-horizontal", role = "form", id = "id" }))
{
//put partial view code into the these brackets
}
```
If you want to do ajax, then ... |
20,780,583 | I am new to VBA. I have made a look-up function using vba and it works so fine. Here is what I wanted, I want to call my subroutine (that contains the look-up) when the `Enter` key is pressed. How am I going to do this? How does an event like this in VBA work? | 2013/12/26 | [
"https://Stackoverflow.com/questions/20780583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2839164/"
] | As you are using kivy's portable bundle for windows, you have to install the libraries in the python installation that's shipped with it. To do so, you just have to start the kivy.bat, and use `pip install` inside of it, the libraries installed this way will be available for the kivy applications.
The alternative solu... | You have to edit `PYTHONPATH` to include the folders where python can find `fbconsole` and `twitter`.
That way [import](http://docs.python.org/2/reference/simple_stmts.html#the-import-statement)
will find them in `sys.modules`. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.