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 |
|---|---|---|---|---|---|
58,247 | Say I have a disease that is autosomal recessive. If one was heterozygous for this trait, could the recessive gene still be expressed?
I know sickle cell anemia has a heterozygous advantage so it must be possible but what are the conditions for this to happen and also to what degree?
EDIT: This isn't asking how a gen... | 2017/04/10 | [
"https://biology.stackexchange.com/questions/58247",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/31455/"
] | Others have already explained. I add some clarifications. You said that you know the molecular mechanism of dominance; revisiting them will answer your queries.
Gene expression means the formation of the gene product in whatever form it is active – protein or RNA. If an allele is recessive it can:
* Not form the pro... | There are a couple of distinctions to make here. You can have an allele which is 'Phenotypically Expressed', that is it's visible at the organism level by some feature. In that case, no, recessive alleles by definition do not express that particular phenotype.
Now at the molecular level things can be different. You ha... |
5,544,790 | For example, I am calling my executable in ubuntu:
./foo temp/game1.txt temp/game2 txt
I am using realpath() to find the path to the game1.txt.
Using it however will give me the full path including the game1.txt name.
For example, it will come out as
/home/*\**/Download/temp/game1.txt
I want to erase game1.txt on ... | 2011/04/04 | [
"https://Stackoverflow.com/questions/5544790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/461025/"
] | You can use the dirname function for this: <http://linux.die.net/man/3/dirname>
Note that dirname will erase the trailing slash (except for the root directory); you'll have to append the slash back in when you append the filename.
Also, you don't actually need to use realpath for this purpose, you could simply use th... | ```
man -S3 dirname
```
should do what you want |
5,544,790 | For example, I am calling my executable in ubuntu:
./foo temp/game1.txt temp/game2 txt
I am using realpath() to find the path to the game1.txt.
Using it however will give me the full path including the game1.txt name.
For example, it will come out as
/home/*\**/Download/temp/game1.txt
I want to erase game1.txt on ... | 2011/04/04 | [
"https://Stackoverflow.com/questions/5544790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/461025/"
] | Don't really know Linux, but a general way for your second question:
```
#include <string>
#include <iostream>
int main(){
std::string fullpath("/home/*/Download/temp/game1.txt");
size_t last = fullpath.find_last_of('/');
std::string path = fullpath.substr(0,last+1);
std::cout << path;
}
```
[See on Ideone... | ```
man -S3 dirname
```
should do what you want |
5,544,790 | For example, I am calling my executable in ubuntu:
./foo temp/game1.txt temp/game2 txt
I am using realpath() to find the path to the game1.txt.
Using it however will give me the full path including the game1.txt name.
For example, it will come out as
/home/*\**/Download/temp/game1.txt
I want to erase game1.txt on ... | 2011/04/04 | [
"https://Stackoverflow.com/questions/5544790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/461025/"
] | Don't really know Linux, but a general way for your second question:
```
#include <string>
#include <iostream>
int main(){
std::string fullpath("/home/*/Download/temp/game1.txt");
size_t last = fullpath.find_last_of('/');
std::string path = fullpath.substr(0,last+1);
std::cout << path;
}
```
[See on Ideone... | You can use the dirname function for this: <http://linux.die.net/man/3/dirname>
Note that dirname will erase the trailing slash (except for the root directory); you'll have to append the slash back in when you append the filename.
Also, you don't actually need to use realpath for this purpose, you could simply use th... |
5,544,790 | For example, I am calling my executable in ubuntu:
./foo temp/game1.txt temp/game2 txt
I am using realpath() to find the path to the game1.txt.
Using it however will give me the full path including the game1.txt name.
For example, it will come out as
/home/*\**/Download/temp/game1.txt
I want to erase game1.txt on ... | 2011/04/04 | [
"https://Stackoverflow.com/questions/5544790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/461025/"
] | You can use the dirname function for this: <http://linux.die.net/man/3/dirname>
Note that dirname will erase the trailing slash (except for the root directory); you'll have to append the slash back in when you append the filename.
Also, you don't actually need to use realpath for this purpose, you could simply use th... | The cross-platform solution is
```
QFileInfo target_file_name(argv[1]);
QString absolute_path = target_file_name.absolutePath()
// e.g. /home/username/
QString some_other_file = QString("%1/another_file.txt").arg(absolute_path)
// => /home/username/another_file.txt
```
Boost.Filesystem can also do this easily. I... |
5,544,790 | For example, I am calling my executable in ubuntu:
./foo temp/game1.txt temp/game2 txt
I am using realpath() to find the path to the game1.txt.
Using it however will give me the full path including the game1.txt name.
For example, it will come out as
/home/*\**/Download/temp/game1.txt
I want to erase game1.txt on ... | 2011/04/04 | [
"https://Stackoverflow.com/questions/5544790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/461025/"
] | Don't really know Linux, but a general way for your second question:
```
#include <string>
#include <iostream>
int main(){
std::string fullpath("/home/*/Download/temp/game1.txt");
size_t last = fullpath.find_last_of('/');
std::string path = fullpath.substr(0,last+1);
std::cout << path;
}
```
[See on Ideone... | The cross-platform solution is
```
QFileInfo target_file_name(argv[1]);
QString absolute_path = target_file_name.absolutePath()
// e.g. /home/username/
QString some_other_file = QString("%1/another_file.txt").arg(absolute_path)
// => /home/username/another_file.txt
```
Boost.Filesystem can also do this easily. I... |
2,540,153 | How to solve the following differential equation:
$$f'(x)+af^{2}(x)+bf(x)+c=0,$$
where $a,b,c\in\mathbb{R}\backslash\{0\}$.
Comment: I edited my question. First version was trivial. | 2017/11/27 | [
"https://math.stackexchange.com/questions/2540153",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/286717/"
] | The edited ODE is a [Riccati equation](https://en.wikipedia.org/wiki/Riccati_equation). For $y=f(x)$:
$$
y'=-c-by-ay^2
$$
Then $v=-ay$ satisfies: $$v'=v^2+bv+ac.$$
Let $v=\frac{-u'}{u}$. Then $u$ satisfies:
$$
u''+bu'+acu=0
$$
which can easily be solved (I can edit my answer to add the solution if required). A soluti... | $$f'(x)=-(ax^2+bx+c)$$
$$\frac{\mathrm{d}f(x)}{\mathrm{d}x}=-(ax^2+bx+c)$$
Integrate both sides with respect to x:
$$f(x)=-\frac{a}{3}x^3-\frac{b}{2}x^2-cx+k$$
Where k is a constant. |
49,203,863 | I am new to Android Java (and java). I am trying to modify a package I am using in my react-native app.
Currently when in landscape mode my `EditText` is getting cutoff like in screenshot below.
I was trying to modify this library, so I modified the `alertDialog.setView` call here - <https://github.com/shimohq/react-... | 2018/03/09 | [
"https://Stackoverflow.com/questions/49203863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1828637/"
] | >
> Apparently this is "extra space". I changed it to:
>
>
> alertDialog.setView(input, 50, 0, 50, 0);
>
>
>
According [documentation](https://developer.android.com/reference/android/app/AlertDialog.html#setView(android.view.View,%20int,%20int,%20int,%20int)), next 4 params after your view are used for extra spa... | Here's a sample of an EditText I have in my app
```
<EditText
android:id="@+id/et_edit_name"
android:hint="Edit Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:maxLines="1"
android:scrollbars="vertical"
android:layout_margi... |
2,077,224 | I didn't understand this example in the [Spivak's calculus book](http://computo.fismat.umich.mx/~fhernandez/Cursos/Calculo2015/spivak.pdf) (page 413):
>
> At first sight this corollary appears to have unnecessarily complicated hypotheses; it might seem that the existence of the polynomial $P$ would automatically impl... | 2016/12/30 | [
"https://math.stackexchange.com/questions/2077224",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/42912/"
] | Hint:
-----
$$\left|\frac{f(x)}{x^i}\right|<\epsilon\ \forall\ \epsilon>0,\ |x|<\epsilon^{1/(n+1-i)}$$
what can you conclude from this? | Consider the function $g\_i(x) = f(x)/x^i$ for $i=0,\dotsc,n$. Then
$$
g\_i(x) =
\begin{cases}
x^{n+1-i} & \text{if } x \text{ is irrational}\\
0 & \text{if } x \text{ is rational}.
\end{cases}
$$
Let $\epsilon >0$ and pick $\delta = \min\{1,\epsilon\}>0$. If $|x| < \delta$ then $|x| < 1$, so $|x^k| = |x|^k \le |x|$ ... |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | SpTBXFormPopupMenu from the spTBXLib does the job.
Go to <http://www.silverpointdevelopment.com/sptbxlib/index.htm> and look for "Form Popup"
The key seems to be that the container 'popuped' must inherit TPopupMenu. But the handling is very complex, you can see it by yourself in the code. My recommendation is to use ... | I found one that does almost exactly what I want: [TAdvStickyPopupMenu](http://www.tmssoftware.com/site/atbdev10.asp) |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | In order to prevent a window from getting focus, you must either specify the `WS_EX_NOACTIVATE` extended window style (Windows 2000 and up) or handle `WM_MOUSEACTIVATE` and return `MA_NOACTIVATE`. | I can use this to not lose focus:
```
SetWindowPos(Form2.Handle, HWND_TOP, 0, 0, 0, 0,
SWP_SHOWWINDOW or SWP_NOACTIVATE or SWP_NOSIZE or SWP_NOMOVE);
```
The second part I didn't understand very well. |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | I found the solution myself here. Thank you all!:
[Keep Window Inactive In Appearance Even When Activated](https://stackoverflow.com/questions/813745/keep-window-inactive-in-appearance-even-when-activated) | I can use this to not lose focus:
```
SetWindowPos(Form2.Handle, HWND_TOP, 0, 0, 0, 0,
SWP_SHOWWINDOW or SWP_NOACTIVATE or SWP_NOSIZE or SWP_NOMOVE);
```
The second part I didn't understand very well. |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | I found the solution myself here. Thank you all!:
[Keep Window Inactive In Appearance Even When Activated](https://stackoverflow.com/questions/813745/keep-window-inactive-in-appearance-even-when-activated) | I found one that does almost exactly what I want: [TAdvStickyPopupMenu](http://www.tmssoftware.com/site/atbdev10.asp) |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | The easiest solution I had found for "1" is to send a WM\_NCACTIVATE to the calling form as soon as the popup-form gets activated (in a WM\_ACTIVATE handler), so that the calling form would draw its caption with the active colors. You'll have to have a reference for the calling form in the popup-form to achieve this.
... | I found the solution myself here. Thank you all!:
[Keep Window Inactive In Appearance Even When Activated](https://stackoverflow.com/questions/813745/keep-window-inactive-in-appearance-even-when-activated) |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | In order to prevent a window from getting focus, you must either specify the `WS_EX_NOACTIVATE` extended window style (Windows 2000 and up) or handle `WM_MOUSEACTIVATE` and return `MA_NOACTIVATE`. | I found one that does almost exactly what I want: [TAdvStickyPopupMenu](http://www.tmssoftware.com/site/atbdev10.asp) |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | I can use this to not lose focus:
```
SetWindowPos(Form2.Handle, HWND_TOP, 0, 0, 0, 0,
SWP_SHOWWINDOW or SWP_NOACTIVATE or SWP_NOSIZE or SWP_NOMOVE);
```
The second part I didn't understand very well. | I found one that does almost exactly what I want: [TAdvStickyPopupMenu](http://www.tmssoftware.com/site/atbdev10.asp) |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | The easiest solution I had found for "1" is to send a WM\_NCACTIVATE to the calling form as soon as the popup-form gets activated (in a WM\_ACTIVATE handler), so that the calling form would draw its caption with the active colors. You'll have to have a reference for the calling form in the popup-form to achieve this.
... | SpTBXFormPopupMenu from the spTBXLib does the job.
Go to <http://www.silverpointdevelopment.com/sptbxlib/index.htm> and look for "Form Popup"
The key seems to be that the container 'popuped' must inherit TPopupMenu. But the handling is very complex, you can see it by yourself in the code. My recommendation is to use ... |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | The easiest solution I had found for "1" is to send a WM\_NCACTIVATE to the calling form as soon as the popup-form gets activated (in a WM\_ACTIVATE handler), so that the calling form would draw its caption with the active colors. You'll have to have a reference for the calling form in the popup-form to achieve this.
... | I can use this to not lose focus:
```
SetWindowPos(Form2.Handle, HWND_TOP, 0, 0, 0, 0,
SWP_SHOWWINDOW or SWP_NOACTIVATE or SWP_NOSIZE or SWP_NOMOVE);
```
The second part I didn't understand very well. |
2,178,494 | When window A is show, I want to show another none-modal popup window B, but:
1. I don't want window A to become inactive due to window B becomes the front window;
2. I want that when window B is focused, I pull down a combo box control on window A with one click (generally you have to click twice, one for moving the ... | 2010/02/01 | [
"https://Stackoverflow.com/questions/2178494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | In order to prevent a window from getting focus, you must either specify the `WS_EX_NOACTIVATE` extended window style (Windows 2000 and up) or handle `WM_MOUSEACTIVATE` and return `MA_NOACTIVATE`. | I found the solution myself here. Thank you all!:
[Keep Window Inactive In Appearance Even When Activated](https://stackoverflow.com/questions/813745/keep-window-inactive-in-appearance-even-when-activated) |
577,899 | Very often you hear people preface what they're about to say with **I tell you what**. Or is it **I'll tell you what**?
Is it correct to say a straight **I tell you what** as that interjection, or do you have to mark the "L" sound at least implicitly meaning that the correct version is **I'll tell you what**?
This is... | 2021/11/03 | [
"https://english.stackexchange.com/questions/577899",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/411785/"
] | "I'll tell you what" is correct term because the speaker is indicating what they will do ("I'll" is short for "I will"), which is to "tell you what." However, some people skip the " 'll," so you are likely to hear both, but "I'll" is the correct one. | There's no standard/"correct" version of this phrase. The phrase is informal, and both versions are used linguistically. The "I" is also often dropped: "Tell you what, you can have a cookie if you finish your broccoli." |
12,937,627 | I love Subversion's blame operation (which shows for each line in the source file the commit that last changed it). Alas, we recently reformatted our entire source code, and now blame just shows that every line was last modified by this commit.
Can I somehow instruct blame to show me when the line was last changed bef... | 2012/10/17 | [
"https://Stackoverflow.com/questions/12937627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/183406/"
] | God I *am* slow today. At the bottom of the dialog that "Show Annotate" pops up is the setting "To revision". Setting that to the last revision prior to the reformat performs as expected, i.e. blame reports the commits before the reformat.
I guess since I never before needed to change the defaults in that dialog, I au... | You can open history of the file and then you can show annotation on specific revision using context menu in history view. |
11,293,041 | In my application I want to store some of my data in ServletContext as its going to be used through out the application. Data are saved in a database. All the configurations are made through integrating struts2, spring, hibernate. Problem is that, I am finding difficulties to fetch the data from the database. Spring is... | 2012/07/02 | [
"https://Stackoverflow.com/questions/11293041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142540/"
] | Try this
```
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class MyListener implements ServletContextListener
{
/**
* @see javax.servlet.ServletContextListener#contextInitialized
* (javax.servlet.ServletCon... | The best approach would be to implement Spring's ServletContextAware interface and then use an @PostConstruct or afterPropertiesSet method to add items to the servlet context. |
45,198,909 | [](https://i.stack.imgur.com/uumcK.png)
I have a EB instance that I want to connect to a domain and I bought the domain from Route 53. The domain should go to the same index page as the original envname.xxxxxx.us-east-2.elas...lk.com url for the insta... | 2017/07/19 | [
"https://Stackoverflow.com/questions/45198909",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2973405/"
] | Found the solution!
The Nameservers under Domains -> Registered Domains didn't match the ones that were auto populated when I tried to create a new Hosted Zone. I replaced the "NS" servers above with the ones listed under Domains -> Registered Domains -> Name Servers | Check if you can open the Site when in Incognito Mode (press Ctrl+Shift+n). If you can, there's likely a Extension the source of the Problem
Enter this in the Address Bar, chrome://net-internals/#dns, then click the button "Clear Host Cache"
Open a Command Window (Press Ctrl+Esc, then enter cmd), then type this command... |
4,091,425 | For an exam I have later today I am studying an old exam question which is accompanied by a solution. The question, and solution, are as follows:
Consider the following initial value problem:
$$x'(t) = (t + 1)e^{-x(t)}, t \geq 0, \text{with } x(0) = 1.$$
Multiplying both sides with $e^{x(t)}$ yields $x'(t)e^{x(t)} =... | 2021/04/06 | [
"https://math.stackexchange.com/questions/4091425",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/637253/"
] | (1) Note, that the derivative of $e^{x(t)}$ is $x'(t)e^{x(t)}$. Hence, by the fundamental theorem of calculus, we have
$$ \int\_0^t x'(s)e^{x(s)} \, ds = e^{x(t)} - e^{x(0)} $$
(2) For the right hand side, just integrate,
$$ \int\_0^t s+1\,ds = \frac{t^2}2 + t = \frac{t^2 + 2t}2= \frac{(t+1)^2 - 1}2 $$ | Remember $(e^{u(t)})'=u'(t)e^{u(t)}$ |
4,091,425 | For an exam I have later today I am studying an old exam question which is accompanied by a solution. The question, and solution, are as follows:
Consider the following initial value problem:
$$x'(t) = (t + 1)e^{-x(t)}, t \geq 0, \text{with } x(0) = 1.$$
Multiplying both sides with $e^{x(t)}$ yields $x'(t)e^{x(t)} =... | 2021/04/06 | [
"https://math.stackexchange.com/questions/4091425",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/637253/"
] | (1) Note, that the derivative of $e^{x(t)}$ is $x'(t)e^{x(t)}$. Hence, by the fundamental theorem of calculus, we have
$$ \int\_0^t x'(s)e^{x(s)} \, ds = e^{x(t)} - e^{x(0)} $$
(2) For the right hand side, just integrate,
$$ \int\_0^t s+1\,ds = \frac{t^2}2 + t = \frac{t^2 + 2t}2= \frac{(t+1)^2 - 1}2 $$ | You can notice that
$$
x’(s)\mathrm{e}^{x(s)}= \dfrac{d}{ds} \mathrm{e}^{x(s)}
$$
Which hopefully you can see means we can integrate it out. |
45,293,394 | i have no ideal for initialization code c++ before windows shutdown. For protect algorithm of my code when running. Any ideal here? | 2017/07/25 | [
"https://Stackoverflow.com/questions/45293394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8353104/"
] | I am not sorry to report you cannot do this reliably. You can handle WM\_QUERYENDSESSION or WM\_ENDSESSION Windows messages, but that really traps logoff not shutdown. Alternately you could try a Windows service and react to the stop signal. But that is exactly that, your service being stopped.
HOWEVER; none of this h... | I think you should create an `object` of your own `class` and write something inside the `destructor` (or `~YourClass()`). |
32,216 | This canopy was found near [Wetumka, Oklahoma](https://en.wikipedia.org/wiki/Wetumka,_Oklahoma) in a small creek running through my best friend's property. The canopy is about 12 feet long. Can anyone tell me what aircraft it came from, or who I could contact to ask?
A [loving cup](https://en.wikipedia.org/wiki/Loving... | 2016/10/09 | [
"https://aviation.stackexchange.com/questions/32216",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/17418/"
] | This canopy probably came off a Boeing B-47.
[](https://i.stack.imgur.com/2MELe.jpg)
I do know of at least two mishaps involving B-47s in Oklahoma but both occurred in places other than Wetumka. I'll do a little more investigating on this.
Another p... | It looks like one of the F series. The oldest aircraft I can find with a canopy like this is the F9 Cougar, though other aircraft in the series also use this kind of canopy. |
12,947,742 | I'd like to follow the development of JDK8, but what I see in the [repo](http://hg.openjdk.java.net/jdk8/jdk8) is strange at best:
```
6 days ago katleman Added tag jdk8-b60 for changeset e07f499b9dcc default tip changeset | manifest
7 days ago katleman Merge jdk8-b60 changeset | manifest
```
Most changes... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12947742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581205/"
] | As per Mercurial, tagging and merge changesets usually don't have any substantial code changes. Adding a tag changes the local `.hgtags` file in the repository and commits it immediately. Merges may have substantial code changes if code was actually changed *during* the merge, such as when the files being merged are in... | The [repo](http://hg.openjdk.java.net/jdk8/jdk8) you're looking at is the "root" or "top" repo of the JDK8 source tree. It contains mostly makefiles and other configuration files, so that's why there's not much of interest in the changeset history. There are nested repositories that contain the interesting source code.... |
12,947,742 | I'd like to follow the development of JDK8, but what I see in the [repo](http://hg.openjdk.java.net/jdk8/jdk8) is strange at best:
```
6 days ago katleman Added tag jdk8-b60 for changeset e07f499b9dcc default tip changeset | manifest
7 days ago katleman Merge jdk8-b60 changeset | manifest
```
Most changes... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12947742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581205/"
] | Perhaps this answer is overkill, but I hope that you at least find it useful.
I typically download the code and build it myself. There are tools to see what are the actual changes (like TortoiseHG). This is what I do:
How to Build the JDK 8
----------------------
The following guide describes how to build the [Open ... | The [repo](http://hg.openjdk.java.net/jdk8/jdk8) you're looking at is the "root" or "top" repo of the JDK8 source tree. It contains mostly makefiles and other configuration files, so that's why there's not much of interest in the changeset history. There are nested repositories that contain the interesting source code.... |
52,322,892 | Often times, when I try to run the **, Fix all auto-fixable issues** command on my Javascript files, the app goes into a never-ending loop of moving the tabs/spaces around, but never really getting satisfied:
) {
onApplicationStart();
}
</cfscript>
```
But how in Application.cfm, not sure, please guide
Thanks | 2013/08/31 | [
"https://Stackoverflow.com/questions/18547639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2485109/"
] | Firstly, running `onApplicationStart()` no more restarts the application than running an `onClick()` mouse-click event handler causes your mouse button to depress. `onApplicationStart()` is called *as a result* of the application starting, not the other way around.
Secondly, Application.cfm has nothing to do with the ... | In OnRequestStart() put something like this:
```
param name='url.reloadApp' default='no';
if(url.reloadApp == 'yes')
{
applicationStop();
}
``` |
43,038 | I've never seen anyone do that until yesterday. So I wanted to know is this appropriate for when preparing apples for any meal, how about other fruits? Unlike plates, fruits can absorb chemicals. | 2014/03/26 | [
"https://cooking.stackexchange.com/questions/43038",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/20968/"
] | No, you would not use a detergent or soap when washing fruit.
Normally, you would just wash them with water, using a brush on thick skinned produce.
See, for example, [Best Ways to Wash Fruits and Vegetables](http://umaine.edu/publications/4336e/) from the University of Maine extension. | Just soak your fruits in mild hot water and that should take out any residual items on the fruit |
43,038 | I've never seen anyone do that until yesterday. So I wanted to know is this appropriate for when preparing apples for any meal, how about other fruits? Unlike plates, fruits can absorb chemicals. | 2014/03/26 | [
"https://cooking.stackexchange.com/questions/43038",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/20968/"
] | No, you would not use a detergent or soap when washing fruit.
Normally, you would just wash them with water, using a brush on thick skinned produce.
See, for example, [Best Ways to Wash Fruits and Vegetables](http://umaine.edu/publications/4336e/) from the University of Maine extension. | Yes, I've done it for decades using unscented, clear dish detergent (such as Seventh Generation). Just a tiny drop with lots of water. |
43,038 | I've never seen anyone do that until yesterday. So I wanted to know is this appropriate for when preparing apples for any meal, how about other fruits? Unlike plates, fruits can absorb chemicals. | 2014/03/26 | [
"https://cooking.stackexchange.com/questions/43038",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/20968/"
] | No, you would not use a detergent or soap when washing fruit.
Normally, you would just wash them with water, using a brush on thick skinned produce.
See, for example, [Best Ways to Wash Fruits and Vegetables](http://umaine.edu/publications/4336e/) from the University of Maine extension. | I suggest using an unscented liquid castile soap like Dr. Bronner's. It is all natural and non-toxic. Unscented commercial dish liquid can still contain toxic chemicals and preservatives, even 7th Gen. |
43,038 | I've never seen anyone do that until yesterday. So I wanted to know is this appropriate for when preparing apples for any meal, how about other fruits? Unlike plates, fruits can absorb chemicals. | 2014/03/26 | [
"https://cooking.stackexchange.com/questions/43038",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/20968/"
] | Yes, I've done it for decades using unscented, clear dish detergent (such as Seventh Generation). Just a tiny drop with lots of water. | Just soak your fruits in mild hot water and that should take out any residual items on the fruit |
43,038 | I've never seen anyone do that until yesterday. So I wanted to know is this appropriate for when preparing apples for any meal, how about other fruits? Unlike plates, fruits can absorb chemicals. | 2014/03/26 | [
"https://cooking.stackexchange.com/questions/43038",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/20968/"
] | Yes, I've done it for decades using unscented, clear dish detergent (such as Seventh Generation). Just a tiny drop with lots of water. | I suggest using an unscented liquid castile soap like Dr. Bronner's. It is all natural and non-toxic. Unscented commercial dish liquid can still contain toxic chemicals and preservatives, even 7th Gen. |
29,603,382 | I have a problem with understanding one thing.
I have:
```
List<Map> resultList = new ArrayList<Map>();
```
Then this `resultList` is filled with some data
```
resultList.addAll(somemethod(something, something, else));
```
Later in the method I have this kind of code:
```
Map timeSpan = someMethod(resultList, d... | 2015/04/13 | [
"https://Stackoverflow.com/questions/29603382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4012392/"
] | You have to remember that `resultList` is a *reference* to an object. You can copy this reference around and use it in many way, in many places but there is only one object. This means when you alter the object, there is only one view of this object. | Java objects are always instantiated as a reference to a memory space. If you create a second object from the first object, both will point to the same memory space:
```
Map a = new HashMap();
Map B=b = a;
```
Here, we first create an instance A which points to a HashMap which is created somewhere in memory. Next, w... |
29,603,382 | I have a problem with understanding one thing.
I have:
```
List<Map> resultList = new ArrayList<Map>();
```
Then this `resultList` is filled with some data
```
resultList.addAll(somemethod(something, something, else));
```
Later in the method I have this kind of code:
```
Map timeSpan = someMethod(resultList, d... | 2015/04/13 | [
"https://Stackoverflow.com/questions/29603382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4012392/"
] | Java objects are always instantiated as a reference to a memory space. If you create a second object from the first object, both will point to the same memory space:
```
Map a = new HashMap();
Map B=b = a;
```
Here, we first create an instance A which points to a HashMap which is created somewhere in memory. Next, w... | `addAll()` will copy all the elements to the current list from the Collection/List you passed as an argument to this method. In your case, as each element is a reference to `Map` object, after copying, you have 2 references pointing to same `Map` object, so changes done using any one reference are visible through the o... |
29,603,382 | I have a problem with understanding one thing.
I have:
```
List<Map> resultList = new ArrayList<Map>();
```
Then this `resultList` is filled with some data
```
resultList.addAll(somemethod(something, something, else));
```
Later in the method I have this kind of code:
```
Map timeSpan = someMethod(resultList, d... | 2015/04/13 | [
"https://Stackoverflow.com/questions/29603382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4012392/"
] | Java objects are always instantiated as a reference to a memory space. If you create a second object from the first object, both will point to the same memory space:
```
Map a = new HashMap();
Map B=b = a;
```
Here, we first create an instance A which points to a HashMap which is created somewhere in memory. Next, w... | The short answer is yes, put() for timeSpan is affecting resultList, because when a method returns a Map, which is got from the List, it returns a reference to the heap where map elements are located. |
29,603,382 | I have a problem with understanding one thing.
I have:
```
List<Map> resultList = new ArrayList<Map>();
```
Then this `resultList` is filled with some data
```
resultList.addAll(somemethod(something, something, else));
```
Later in the method I have this kind of code:
```
Map timeSpan = someMethod(resultList, d... | 2015/04/13 | [
"https://Stackoverflow.com/questions/29603382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4012392/"
] | You have to remember that `resultList` is a *reference* to an object. You can copy this reference around and use it in many way, in many places but there is only one object. This means when you alter the object, there is only one view of this object. | `addAll()` will copy all the elements to the current list from the Collection/List you passed as an argument to this method. In your case, as each element is a reference to `Map` object, after copying, you have 2 references pointing to same `Map` object, so changes done using any one reference are visible through the o... |
29,603,382 | I have a problem with understanding one thing.
I have:
```
List<Map> resultList = new ArrayList<Map>();
```
Then this `resultList` is filled with some data
```
resultList.addAll(somemethod(something, something, else));
```
Later in the method I have this kind of code:
```
Map timeSpan = someMethod(resultList, d... | 2015/04/13 | [
"https://Stackoverflow.com/questions/29603382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4012392/"
] | You have to remember that `resultList` is a *reference* to an object. You can copy this reference around and use it in many way, in many places but there is only one object. This means when you alter the object, there is only one view of this object. | The short answer is yes, put() for timeSpan is affecting resultList, because when a method returns a Map, which is got from the List, it returns a reference to the heap where map elements are located. |
36,870,701 | I have the below simple code for inserting some failed login values in my database, but I have some problems:
1- The ip address is being saved in the database as zero no success whatever I do (going crazy on this).
2- I used current time stamp to get the date and time in a simple query, now that I use prepared stateme... | 2016/04/26 | [
"https://Stackoverflow.com/questions/36870701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6243608/"
] | >
> I am forced to use date('Y-m-d H:i:s'); which gives out the wrong
> time.
>
>
>
Have you tried setting the `date_default_timezone_set`, i.e.:
```
date_default_timezone_set('America/Los_Angeles');
```
---
You cannot use an `int` to store a var containing **dots** ans **colons**.
Change the DB `ip_address` ... | Also maybe to get IP(ish):
```
(string)$ip_address = getRealIpAddr();
function getRealIpAddr() {
(string)$ip='';
if (array_key_exists('HTTP_CLIENT_IP', $_SERVER) && !empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet
$ip .= filter_input(INPUT_SERVER, 'HTTP_CLIENT_IP');
} elseif (a... |
70,186,533 | I am looking for the best way to combine two tables in a way that will remove duplicate records based on email with a priority of replacing any duplicates with the values in "Table 2", I have considered full outer join and UNION ALL but Union all will be too large as each table has several 1000 columns. I want to creat... | 2021/12/01 | [
"https://Stackoverflow.com/questions/70186533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17389636/"
] | If I understand your question correctly you want to join two large tables with thousands of columns that (hopefully) are the same between the two tables using the email column as the join condition and replacing duplicate records between the two tables with the records from Table 2.
I had to do something similar a ... | try using a FULL OUTER JOIN between the two tables and then a COALESCE function on each resultset column to determine from which table/column the resultset column is populated |
17,290,240 | I would like to know if there is a way to declare a local variable inside a sequence expression in Javascript. I want to declare the variable as a part of the sequence expression and not as a separate statement.
For example, I want to do something like this
`temp = "1", var a, ++i;`
Thanks for the help guys! ... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17290240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181919/"
] | Indeed you must begin with the `var` keyword followed by declarations and a semi-column. Then you can start your sequence.
If you really don't like it or do not want to use a semi-column (for whatever reason) you can try to make anonymous functions and use arguments as local variables :
```
(function(temp, a, i){ i=a... | ```
var temp="1", a , i=0;
++i;
```
is a clean way to do it |
17,290,240 | I would like to know if there is a way to declare a local variable inside a sequence expression in Javascript. I want to declare the variable as a part of the sequence expression and not as a separate statement.
For example, I want to do something like this
`temp = "1", var a, ++i;`
Thanks for the help guys! ... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17290240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181919/"
] | Indeed you must begin with the `var` keyword followed by declarations and a semi-column. Then you can start your sequence.
If you really don't like it or do not want to use a semi-column (for whatever reason) you can try to make anonymous functions and use arguments as local variables :
```
(function(temp, a, i){ i=a... | I still don't feel like your question makes any sense but what is wrong with this:
```
var a, i = 1, temp = "1"
```
If doesn't make sense to increment a variable you only just declared, the value would always be 1 anyway if it where possible ( assuming a default value of 0 )
If you have to increment you could do th... |
17,290,240 | I would like to know if there is a way to declare a local variable inside a sequence expression in Javascript. I want to declare the variable as a part of the sequence expression and not as a separate statement.
For example, I want to do something like this
`temp = "1", var a, ++i;`
Thanks for the help guys! ... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17290240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181919/"
] | Indeed you must begin with the `var` keyword followed by declarations and a semi-column. Then you can start your sequence.
If you really don't like it or do not want to use a semi-column (for whatever reason) you can try to make anonymous functions and use arguments as local variables :
```
(function(temp, a, i){ i=a... | Maybe you mean this?
```
var temp="1",a,i=i+1;
```
I think you cannot use 'var' in any other way syntactically. |
17,290,240 | I would like to know if there is a way to declare a local variable inside a sequence expression in Javascript. I want to declare the variable as a part of the sequence expression and not as a separate statement.
For example, I want to do something like this
`temp = "1", var a, ++i;`
Thanks for the help guys! ... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17290240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181919/"
] | Indeed you must begin with the `var` keyword followed by declarations and a semi-column. Then you can start your sequence.
If you really don't like it or do not want to use a semi-column (for whatever reason) you can try to make anonymous functions and use arguments as local variables :
```
(function(temp, a, i){ i=a... | Apperently you want the statement `var a = this.b` to be changed into something like this:
```
var a = this.b;
var lhs = a;
var rhs = this.b;
if(rhs == 1){
};
lhs = rhs;
```
To achieve this, you can write a separate function:
```
function xy(){
var a = this.b;
var lhs = a;
var rhs = this.b;
if(rhs ... |
60,272,488 | I found a tutorial on youtube about the selenium webdriver in windows using php. I already setup the xampp, installed some dependencies, and others like the jar files and geckodriver. And when I execute the php code. I got this error.
```
Notice: Undefined property: stdClass::$ELEMENT in C:\xampp\htdocs\sample1\phpwe... | 2020/02/18 | [
"https://Stackoverflow.com/questions/60272488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7367942/"
] | I have the same problem but I solve this error by debugging the code.
Go to the inside phpwebdriver folder and find the file webElement.php.
In-line number 28 you will get the code:-
```
parent::__construct($root . "/element/" . $element->ELEMENT);
```
Replace this line to:-
```
foreach ($element as $ele){
parent:... | If you use this [WebDriver](https://github.com/php-webdriver/php-webdriver) it should be ok.
I think you can not use require\_once = `phpwebdriver/WebDriver` because it should be replaced by `vendor/autoload.php` like in [this original example](https://github.com/php-webdriver/php-webdriver/blob/master/example.php).
... |
56,492,656 | I need to reimport module `integration-test/integration` upon every run as this module can have code dynamically changed in it at run time. I am using NodeJS with experimental modules in order to be able to run ES6 Javascript.
It seems `require` enables you to delete modules after you require them with the following c... | 2019/06/07 | [
"https://Stackoverflow.com/questions/56492656",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7758630/"
] | You can use query string to ignore cache. See <https://github.com/nodejs/help/issues/1399>.
Here is the sample code.
```js
// currentTime.mjs
export const currentTime = Date.now();
```
```js
// main.mjs
(async () => {
console.log('import', await import('./currentTime.mjs'));
// wait for 1 sec
await new Promi... | I ran into this issue while making an app that basically allowed developers to actively try out their code and make quick on-the-fly changes without recompiling the rest of the project every time. I didn’t want to have to reload the whole app every time a change was made.
Using a query string (which is the current acce... |
69,394,364 | It is a simple program . i am trying to use a material UI search icon . i have installed both material UI core and material UI icons . Im still unable to use them . can someone explain me why.
```
import React from 'react';
import "../style components/Header.css";
import SearchIcon from '@mui/icons-material/Search';
... | 2021/09/30 | [
"https://Stackoverflow.com/questions/69394364",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15372946/"
] | Using this sample `DF`:
```
>>> df
+-----+-----+-----+-----+-----+
|col_a|col_b|col_c|col_d|col_f|
+-----+-----+-----+-----+-----+
| a| b| c| d| 1|
| a| b| c| d| 2|
| j| h| k| l| 3|
| a| b| c| d| 4|
+-----+-----+-----+-----+-----+
```
You can `groupBy.agg`,... | You should check out [pandas.groupby](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.groupby.html).
In your case it would look something like (pandas):
```
df.groupby([col_a,col_b,_col_c,col_d]).sum()
```
Or with [PySpark](https://sparkbyexamples.com/pyspark/pyspark-groupby-explained-with-example/):
... |
15,443,410 | I am using [fine uploader](https://github.com/Widen/fine-uploader) to handle the uploading of files in a web application I have. Is there some sort of callback for when the last file has finished processing? I found the `onComplete` callback, but this is fired when every file completes. I need to know when *all* files ... | 2013/03/15 | [
"https://Stackoverflow.com/questions/15443410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/226897/"
] | With `use JMS\Serializer\SerializerBuilder;` in place you should address the class just as `SerializerBuilder`. Without it, use the fully qualified name `\JMS\Serializer\SerializerBuilder` (notice the leading backslash!)
Further reference: <http://www.php.net/manual/en/language.namespaces.basics.php> | I personnaly had to use `$this->container->get('serializer');` instead of `$serializer = $container->get('jms_serializer');` |
15,443,410 | I am using [fine uploader](https://github.com/Widen/fine-uploader) to handle the uploading of files in a web application I have. Is there some sort of callback for when the last file has finished processing? I found the `onComplete` callback, but this is fired when every file completes. I need to know when *all* files ... | 2013/03/15 | [
"https://Stackoverflow.com/questions/15443410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/226897/"
] | That's because you don't use namespaces correctly. An use statements generates an alias for a specific namespace. The `use JMS\Serializer\SerializerBuilder;` statement means that `SerializerBuilder` is an alias for the `JMS\Serializer\SerializerBuilder` class.
When doing `$serializer = JSM\Serializer\SerializerBuilder... | I personnaly had to use `$this->container->get('serializer');` instead of `$serializer = $container->get('jms_serializer');` |
54,503,213 | this is the tutorial I'm following, the link
<https://thinkster.io/tutorials/django-json-api/authentication>
As the title says, I'm getting this error "Invalid format string" at this line:
'exp': int(dt.strftime('%s'))
of \_generate\_jwt\_token.
I looked at the documentation of strftime and there is no such format... | 2019/02/03 | [
"https://Stackoverflow.com/questions/54503213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7015816/"
] | It should be:
```
token = jwt.encode({
'id': self.pk,
'exp': dt.utcfromtimestamp(dt.timestamp()) #CHANGE HERE
}, settings.SECRET_KEY, algorithm='HS256')
```
This is because jwt compares the expiration times to the utc time. You can double check your secret key is correct by using the... | I also got stuck here and it was the %s that is platform specific that caused the bug. I changed is to %S (note capital) |
71,414,009 | I cannot find a way to add environment values to `Azure Container App` in the portal.
How can I add within `Azure Portal`? | 2022/03/09 | [
"https://Stackoverflow.com/questions/71414009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9042256/"
] | Azure Container App is in Preview and currently, not all settings are available in the Portal. You can use the CLI to add env variables:
```
az containerapp update -n MyContainerapp -g MyResourceGroup -v myenvvar=foo,anotherenvvar=bar
```
Refer to the CLI doc:
```
az containerapp --help
``` | Create and update are slightly different...
```
az containerapp create ... \
--env-vars "FOO_BAR_1=secretref:foo-bar-1" "FOO_BAR_2=$FOO_BAR_2"
```
and
```
az containerapp update ... \
--set-env-vars "FOO_BAR_2=$FOO_BAR_2"
``` |
64,224,023 | I could get deleted records from Netsuite using below script.
But I could not get id.
```
var customSearch = search.create({
type: "deletedrecord",
columns: ["context", "deletedby", "deleteddate", "externalid", "name"],
filters: [
["recordtype", "is", "customer"]
]
});
var resultSet = cust... | 2020/10/06 | [
"https://Stackoverflow.com/questions/64224023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5040685/"
] | Single quotes are your issue
```
id=218; mysql -uuser -psecret -e "use DevicesPool; SELECT * FROM Dirs_and_Names WHERE LNR=$id;"
# or
id=218; mysql -uuser -psecret -e 'use DevicesPool; SELECT * FROM Dirs_and_Names WHERE LNR='$id';'
# or
id=218
query="SELECT * FROM Dirs_and_Names WHERE LNR=$id;"
mysql -uuser -psecret... | After you semi-colon ";" the variable vanishes unless you export it using
```
export id=218; mysql -uuser -psecret -e "use DevicesPool; SELECT * FROM Dirs_and_Names WHERE LNR=$id;"
```
Please also note the double quotes wrapping the SQL statement, for pash to substitue the variable. |
55,844,486 | I'm using pgAdmin4 on Linux, but for some reason I'm not able to list my stored connections anymore. It worked on a fresh install for a few days and then suddenly stopped working after a reboot (no installations/updates done beforehand). I experienced this on multiple machines with similar setups.
System info:
* Ker... | 2019/04/25 | [
"https://Stackoverflow.com/questions/55844486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3632673/"
] | This was a bug due to new release of psycopg2 module, It has been fixed with latest release of pgAdmin4 v4.5, Please upgrade it to latest version.
<https://www.pgadmin.org/download/pgadmin-4-python-wheel/>
Ref: <https://redmine.postgresql.org/issues/4143> | You can solve this issue by installing psycopg2 version 2.7.7 by executing the below command
(As I installed PgAdmin4 in Python3.6 so my command will be like as below)
```
sudo python3.6 -m pip install psycopg2==2.7.7
```
OS: Ubuntu 18.04
Python v: 3.6
psycopg2 Current v: 2.9 |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | As a variant on [baptiste's answer](https://stackoverflow.com/a/14568822/892313), with `data` defined as you have and the columns that you want to put together defined in `cols`
```
cols <- c("b", "c", "d")
```
You can add the new column to `data` and delete the old ones with
```
data$x <- do.call(paste, c(data[col... | I'd construct a new data.frame:
```
d <- data.frame('a' = 1:3, 'b' = c('a','b','c'), 'c' = c('d', 'e', 'f'), 'd' = c('g', 'h', 'i'))
cols <- c( 'b' , 'c' , 'd' )
data.frame(a = d[, 'a'], x = do.call(paste, c(d[ , cols], list(sep = '-'))))
``` |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | I benchmarked the answers of Anthony Damico, Brian Diggs and data\_steve on a small sample `tbl_df` and got the following results.
```
> data <- data.frame('a' = 1:3,
+ 'b' = c('a','b','c'),
+ 'c' = c('d', 'e', 'f'),
+ 'd' = c('g', 'h', 'i'))
> data <- tbl_df... | I know this is an old question, but thought that I should anyway present the simple solution using the paste() function as suggested to by the questioner:
```
data_1<-data.frame(a=data$a,"x"=paste(data$b,data$c,data$d,sep="-"))
data_1
a x
1 1 a-d-g
2 2 b-e-h
3 3 c-f-i
``` |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | ```
# your starting data..
data <- data.frame('a' = 1:3, 'b' = c('a','b','c'), 'c' = c('d', 'e', 'f'), 'd' = c('g', 'h', 'i'))
# columns to paste together
cols <- c( 'b' , 'c' , 'd' )
# create a new column `x` with the three columns collapsed together
data$x <- apply( data[ , cols ] , 1 , paste , collapse = "-" )
#... | I'd construct a new data.frame:
```
d <- data.frame('a' = 1:3, 'b' = c('a','b','c'), 'c' = c('d', 'e', 'f'), 'd' = c('g', 'h', 'i'))
cols <- c( 'b' , 'c' , 'd' )
data.frame(a = d[, 'a'], x = do.call(paste, c(d[ , cols], list(sep = '-'))))
``` |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | I'd construct a new data.frame:
```
d <- data.frame('a' = 1:3, 'b' = c('a','b','c'), 'c' = c('d', 'e', 'f'), 'd' = c('g', 'h', 'i'))
cols <- c( 'b' , 'c' , 'd' )
data.frame(a = d[, 'a'], x = do.call(paste, c(d[ , cols], list(sep = '-'))))
``` | I know this is an old question, but thought that I should anyway present the simple solution using the paste() function as suggested to by the questioner:
```
data_1<-data.frame(a=data$a,"x"=paste(data$b,data$c,data$d,sep="-"))
data_1
a x
1 1 a-d-g
2 2 b-e-h
3 3 c-f-i
``` |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | I'd construct a new data.frame:
```
d <- data.frame('a' = 1:3, 'b' = c('a','b','c'), 'c' = c('d', 'e', 'f'), 'd' = c('g', 'h', 'i'))
cols <- c( 'b' , 'c' , 'd' )
data.frame(a = d[, 'a'], x = do.call(paste, c(d[ , cols], list(sep = '-'))))
``` | Simple and straightforward code with `unite` from `{tidyr} v1.2.0`
Solution with `{tidyr v1.2.0}`
==============================
```
library(tidyr)
data %>% unite("x", b:d, remove = T, sep = "-")
```
* `"x"` is the name of the new column.
* `b:d` is a selection of what columns we want to merge, using `<tidy-select... |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | As a variant on [baptiste's answer](https://stackoverflow.com/a/14568822/892313), with `data` defined as you have and the columns that you want to put together defined in `cols`
```
cols <- c("b", "c", "d")
```
You can add the new column to `data` and delete the old ones with
```
data$x <- do.call(paste, c(data[col... | Simple and straightforward code with `unite` from `{tidyr} v1.2.0`
Solution with `{tidyr v1.2.0}`
==============================
```
library(tidyr)
data %>% unite("x", b:d, remove = T, sep = "-")
```
* `"x"` is the name of the new column.
* `b:d` is a selection of what columns we want to merge, using `<tidy-select... |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | Using `tidyr` package, this can be easily handled in 1 function call.
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
tidyr::unite_(data, paste(colnames(data)[-1], collapse="_"), colnames(data)[-1])
... | In my opinion the `sprintf`-function deserves a place among these answers as well. You can use `sprintf` as follows:
```
do.call(sprintf, c(d[cols], '%s-%s-%s'))
```
which gives:
```
[1] "a-d-g" "b-e-h" "c-f-i"
```
And to create the required dataframe:
```
data.frame(a = d$a, x = do.call(sprintf, c(d[cols], '%s... |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | Using `tidyr` package, this can be easily handled in 1 function call.
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
tidyr::unite_(data, paste(colnames(data)[-1], collapse="_"), colnames(data)[-1])
... | I'd construct a new data.frame:
```
d <- data.frame('a' = 1:3, 'b' = c('a','b','c'), 'c' = c('d', 'e', 'f'), 'd' = c('g', 'h', 'i'))
cols <- c( 'b' , 'c' , 'd' )
data.frame(a = d[, 'a'], x = do.call(paste, c(d[ , cols], list(sep = '-'))))
``` |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | I benchmarked the answers of Anthony Damico, Brian Diggs and data\_steve on a small sample `tbl_df` and got the following results.
```
> data <- data.frame('a' = 1:3,
+ 'b' = c('a','b','c'),
+ 'c' = c('d', 'e', 'f'),
+ 'd' = c('g', 'h', 'i'))
> data <- tbl_df... | ```
library(plyr)
ldply(apply(data, 1, function(x) data.frame(
x = paste(x[2:4],sep="",collapse="-"))))
# x
#1 a-d-g
#2 b-e-h
#3 c-f-i
# and with just the vector of names you have:
ldply(apply(data, 1, function(x) data.frame(
x = paste(x[c('b','c','d')],sep="",colla... |
14,568,662 | I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows:
```
data <- data.frame('a' = 1:3,
'b' = c('a','b','c'),
'c' = c('d', 'e', 'f'),
'd' = c('g', 'h', 'i'))
i.e.
a b c d
1 a d g
... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14568662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1165199/"
] | ```
# your starting data..
data <- data.frame('a' = 1:3, 'b' = c('a','b','c'), 'c' = c('d', 'e', 'f'), 'd' = c('g', 'h', 'i'))
# columns to paste together
cols <- c( 'b' , 'c' , 'd' )
# create a new column `x` with the three columns collapsed together
data$x <- apply( data[ , cols ] , 1 , paste , collapse = "-" )
#... | In my opinion the `sprintf`-function deserves a place among these answers as well. You can use `sprintf` as follows:
```
do.call(sprintf, c(d[cols], '%s-%s-%s'))
```
which gives:
```
[1] "a-d-g" "b-e-h" "c-f-i"
```
And to create the required dataframe:
```
data.frame(a = d$a, x = do.call(sprintf, c(d[cols], '%s... |
70,202,249 | I am trying to create 1 json from a DF which has 3 entries for 1 Customer,
```
+----------+---------------+---------+-----------------+-----------+---------------+---------+-----------------+--------------------+------------------+------+
|CustomerId|EmailPreference|EmailType|AddressPreference|AddressType|PhonePrefer... | 2021/12/02 | [
"https://Stackoverflow.com/questions/70202249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16396174/"
] | These metaprogramming operators, including `{{…}}`, `!!` and `!!!` only work in quasiquotation functions. That is, functions whose arguments explicitly support tidy evaluation. In general, such function will explicitly mention quasiquotation support in their documentation.
Amongst these functions is `ggplot2::aes`, be... | Konrad did an excellent job explaining why the function fails. I just want to make note of `rlang::inject()`, which allows you to introduce quasiquotation / non-standard evaluation to any function:
```
gg = gg + rlang::inject(ggplot2::geom_point( !!! params_lang ))
plot(gg) # Now works
```
As a side note, your "T... |
4,040,879 | I have a field with product name
```
abc® product1
```
If I get the data from the database and databind it to the dropdownlist. It becomes
```
<option value="2">abc &reg; product1</option>
```
I don't want ASP.net to escape the `®` to `%amp;reg`.
What should I do? | 2010/10/28 | [
"https://Stackoverflow.com/questions/4040879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64873/"
] | In your database you shouldn't store `abc® product1` but `abc® product1`. Then when this value is rendered on the page you need to HTML encode it which happens automatically if you use `<asp:DropDownList`. | You want to [HTML encode](http://dotnetperls.com/encode-html-string) the string prior to it being shown in the HTML. This will preserve its name |
4,040,879 | I have a field with product name
```
abc® product1
```
If I get the data from the database and databind it to the dropdownlist. It becomes
```
<option value="2">abc &reg; product1</option>
```
I don't want ASP.net to escape the `®` to `%amp;reg`.
What should I do? | 2010/10/28 | [
"https://Stackoverflow.com/questions/4040879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64873/"
] | i'm using such thing (see below), maybe it will help you
first i'm encoding data (special symbols) in **numeric entites**, when push data in database
when i receive it from database, i write such thing in View:
```
<% =Html.TextBox("test", Model.test).ToString().Replace("&#", "&#")%>
```
point is, that when yo... | In your database you shouldn't store `abc® product1` but `abc® product1`. Then when this value is rendered on the page you need to HTML encode it which happens automatically if you use `<asp:DropDownList`. |
4,040,879 | I have a field with product name
```
abc® product1
```
If I get the data from the database and databind it to the dropdownlist. It becomes
```
<option value="2">abc &reg; product1</option>
```
I don't want ASP.net to escape the `®` to `%amp;reg`.
What should I do? | 2010/10/28 | [
"https://Stackoverflow.com/questions/4040879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64873/"
] | As the above person mentioned, abc® is a REALLY bad feild name.
Does it HAVE to be that? | You want to [HTML encode](http://dotnetperls.com/encode-html-string) the string prior to it being shown in the HTML. This will preserve its name |
4,040,879 | I have a field with product name
```
abc® product1
```
If I get the data from the database and databind it to the dropdownlist. It becomes
```
<option value="2">abc &reg; product1</option>
```
I don't want ASP.net to escape the `®` to `%amp;reg`.
What should I do? | 2010/10/28 | [
"https://Stackoverflow.com/questions/4040879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64873/"
] | i'm using such thing (see below), maybe it will help you
first i'm encoding data (special symbols) in **numeric entites**, when push data in database
when i receive it from database, i write such thing in View:
```
<% =Html.TextBox("test", Model.test).ToString().Replace("&#", "&#")%>
```
point is, that when yo... | As the above person mentioned, abc® is a REALLY bad feild name.
Does it HAVE to be that? |
4,040,879 | I have a field with product name
```
abc® product1
```
If I get the data from the database and databind it to the dropdownlist. It becomes
```
<option value="2">abc &reg; product1</option>
```
I don't want ASP.net to escape the `®` to `%amp;reg`.
What should I do? | 2010/10/28 | [
"https://Stackoverflow.com/questions/4040879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64873/"
] | i'm using such thing (see below), maybe it will help you
first i'm encoding data (special symbols) in **numeric entites**, when push data in database
when i receive it from database, i write such thing in View:
```
<% =Html.TextBox("test", Model.test).ToString().Replace("&#", "&#")%>
```
point is, that when yo... | You want to [HTML encode](http://dotnetperls.com/encode-html-string) the string prior to it being shown in the HTML. This will preserve its name |
62,500 | I lost a password for an ethereum wallet at the end of 2016. Computer immediately shutdown and password was not recoverable.
I know there are many potential avenues for narrowing my search for what my password could have been, but I am wondering if the number of characters can be determined from the encrypted file?
... | 2018/09/19 | [
"https://crypto.stackexchange.com/questions/62500",
"https://crypto.stackexchange.com",
"https://crypto.stackexchange.com/users/61943/"
] | No. Password cannot be used to encrypt anything directly unless it is exactly of a certain size, and then it will be likely weak. Encryption passwords are hashed, with a slow hash hopefully, and the output is used as key. | No it is not possible to determine the password used to encrypt the file by analyzing the file.
AES is a block cypher which uses a fixed length encryption key (which is not your password) to create fixed blocks of encrypted bytes. This means the designers of the cryptographic system you used had to take a variable len... |
9,869,075 | I have a question regarding the design of two tables.
Table 1: The main table, called Batch. Values are added here from parsing files.
Table 2: This table works like a log table, every row that is deleted from table 1 goes here.
Example
Table 1
```
ID text
1 'bla1'
2 'bla2'
3 'bla3'
```
Delete row where id is... | 2012/03/26 | [
"https://Stackoverflow.com/questions/9869075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930191/"
] | You can try with `NSRegularExpression`, e.g.:
```
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@" src='([^.]*)'" options:NSRegularExpressionCaseInsensitive error:&error];
```
then check [`NSRegularExpression` reference](http://developer.apple.com/library/mac/#documentation/Foundatio... | You can also try the dirty way : splitting the string at some markers you spotted (here I use the `src='` and then the last quote). It works with the string you gave, but it is not very safe. You should prefer the regex method given before.
Here is the piece of code you could try :
```
NSMutableArray *retArray =... |
42,885,801 | In Umbraco 7.5, I want to develop a custom 'module' (or whatever it is called in Umbraco) to maintain a product catalog. Products can have images, categories and attributes. Of course, I could make some document types and templates but I don't want to add products as content items. I need to be able to maintain a list ... | 2017/03/19 | [
"https://Stackoverflow.com/questions/42885801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2573661/"
] | There is not single place to get all those knowledge. Following articles will be helpful to you to getting started.
Extending backoffice:
<http://www.enkelmedia.se/blogg/2013/11/22/creating-custom-sections-in-umbraco-7-part-1.aspx>
<http://www.enkelmedia.se/blogg/2013/11/22/custom-sections-in-umbraco-7-%E2%80%93-par... | I think Ucommerce is the best to use in your situation and it works great with Umbraco.
Here are few links. Hope it helps!
[Ucommerce Developer Section](http://www.ucommerce.net/en/products/developer/)
[Products Catalog doc](http://docs.ucommerce.net/ucommerce/v7.5/getting-started/catalog-foundation/catalog-library.... |
305,587 | I would like to ask if there's an easy way to query OSM changesets' information like user, timestamp, comment and hashtags in that changeset.
In particular I would like to retrieve all the user names of the users which modified an area saving their changesets with a particular hashtag (similarly to default hashtags in ... | 2018/12/10 | [
"https://gis.stackexchange.com/questions/305587",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/126190/"
] | Changeset data is provided in a separate [Changeset Dump](https://wiki.openstreetmap.org/wiki/Changeset#Changeset_Dump): [Latest Weekly Changesets](https://planet.openstreetmap.org/planet/changesets-latest.osm.bz2) (2.5 GB) on [planet.openstreetmap.org](https://planet.openstreetmap.org/) (not aware of extracts).
Besid... | Eventually this code answered exactly my question:
```
import osmium as osm
import pandas as pd
class ChangesetHandler(osm.SimpleHandler):
def __init__(self):
osm.SimpleHandler.__init__(self)
self.elements = []
def add_elements(self, e, elem_type):
comment=e.tags.get("comment")
... |
72,406,230 | I have a raster in R, I need to select the highest cell values up until 30% of the raster area is selected.
The way that I've tried to accomplish this is by calculating the average cell area, and then calculating how many cells I need to meet this 30% target (I know this is not entirely accurate). Then I sort the rast... | 2022/05/27 | [
"https://Stackoverflow.com/questions/72406230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18963844/"
] | Group the items of the input `ListView` by the values of the second `ColumnHeader` (index = 1) to get `IEnumerable<IGrouping<string, ListViewItem>>`, then use the elements (of type `IGrouping<string, ListViewItem>`) `Key` property and `Count` method to create the `ListViewItem` objects of the output `ListView`.
Here's... | The outcome you want can be achieved using `System.Linq.GroupBy` for the logic and `DataGridView` (Winforms Example) for the views:
[](https://i.stack.imgur.com/B2yX3.png)
The amount of code to write is small! Just use Data Binding [Winforms](https:/... |
72,406,230 | I have a raster in R, I need to select the highest cell values up until 30% of the raster area is selected.
The way that I've tried to accomplish this is by calculating the average cell area, and then calculating how many cells I need to meet this 30% target (I know this is not entirely accurate). Then I sort the rast... | 2022/05/27 | [
"https://Stackoverflow.com/questions/72406230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18963844/"
] | Group the items of the input `ListView` by the values of the second `ColumnHeader` (index = 1) to get `IEnumerable<IGrouping<string, ListViewItem>>`, then use the elements (of type `IGrouping<string, ListViewItem>`) `Key` property and `Count` method to create the `ListViewItem` objects of the output `ListView`.
Here's... | So if I understand you want to have another listview with duplicates and the count?
If so you can create a List<> and then add that item into the list in this case will be a string I believe, maybe something like this? This is just a console app for demonstration.
```
List<string> myList = new List<string>();
myList... |
72,406,230 | I have a raster in R, I need to select the highest cell values up until 30% of the raster area is selected.
The way that I've tried to accomplish this is by calculating the average cell area, and then calculating how many cells I need to meet this 30% target (I know this is not entirely accurate). Then I sort the rast... | 2022/05/27 | [
"https://Stackoverflow.com/questions/72406230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18963844/"
] | Group the items of the input `ListView` by the values of the second `ColumnHeader` (index = 1) to get `IEnumerable<IGrouping<string, ListViewItem>>`, then use the elements (of type `IGrouping<string, ListViewItem>`) `Key` property and `Count` method to create the `ListViewItem` objects of the output `ListView`.
Here's... | Given the next list:
```
List<myClass> items = new List<myClass>()
{
new myClass() { Name = "John Doe", Item = "Shoes" },
new myClass() { Name = "John Doe", Item = "T-Shirt" },
new myClass() { Name = "John Doe", Item = "Jeans" },
new myClass() { Name = "Rick Astley", Item = "Baseball bat" },
new my... |
1,581,457 | Is it possible for PHP to take a URL, wait for the redirects to go through, and then fetch the url of the page it's on? | 2009/10/17 | [
"https://Stackoverflow.com/questions/1581457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89334/"
] | ```
$cr = curl_init("http://example.com");
curl_setopt($cr, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cr, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($cr);
$info = curl_getinfo($cr);
echo "url=".$info["url"];
``` | see <http://www.php.net/manual/en/wrappers.http.php>
-j |
1,581,457 | Is it possible for PHP to take a URL, wait for the redirects to go through, and then fetch the url of the page it's on? | 2009/10/17 | [
"https://Stackoverflow.com/questions/1581457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89334/"
] | ```
$cr = curl_init("http://example.com");
curl_setopt($cr, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cr, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($cr);
$info = curl_getinfo($cr);
echo "url=".$info["url"];
``` | You also can use a wget / curl wrapper.
<http://php.net/manual/en/book.curl.php> |
16,737,496 | Recently I am working on the python extension of gdb7, I just want to use it to write a small tool to display the contents of C++ containers (such as list) friendly while debugging.But I got trouble when dealing with list. This is my C++ code for test use:
```
int main() {
list<int> int_lst;
for (int i = 0; i < 10; ++... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16737496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2417830/"
] | It is difficult to say what went wrong without more information.
GDB is trying to use the RTTI information to find the full object for that field. This is failing for some eason. You can try to reproduce the problem from the CLI by using "set print object on" and then printing the field in question.
Alternatively, is... | I see the same error from **dynamic\_cast()** as well. Using **cast()** instead of **dynamic\_cast()** there works:
**list-pretty-print.cc**
```
#include <iostream>
#include <list>
/* https://github.com/scottt/debugbreak */
#include "debugbreak/debugbreak.h"
using namespace std;
int main()
{
list<int> int_lst;... |
27,474,131 | I have a flexigrid table
and inside of it there are some href links with an image
I have two types of hrefs
```
<a href="add/11111111111111111111112" class=" crud-action" title="ADD R"><img src="http://www.gmurgente.es/imagenes/portada/google+.png" alt="ADD R" /></a>
```
and
```
<a href="remove" class=" crud-ac... | 2014/12/14 | [
"https://Stackoverflow.com/questions/27474131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265519/"
] | You can remove elements by selecting them, and using the `.remove()` jQuery function ([docs](http://api.jquery.com/remove/)).
Something like the code below, where I select on the content of the `href` attribute:
```
$('a[href="remove"]').remove()
```
---
**EDIT: See snippet, works perfectly**
```html
<script src=... | This will work, with plain javascript:
---
```js
var table = document.getElementById('flex1');
var a = table.getElementsByTagName('a');console.log(a);
for (var i= 0;i<a.length;i++) {
var b = a[i].getAttribute('href');
if (b == 'remove')
{
var row = a[i].parentNode.parentNode.parentNode;
row.dele... |
27,474,131 | I have a flexigrid table
and inside of it there are some href links with an image
I have two types of hrefs
```
<a href="add/11111111111111111111112" class=" crud-action" title="ADD R"><img src="http://www.gmurgente.es/imagenes/portada/google+.png" alt="ADD R" /></a>
```
and
```
<a href="remove" class=" crud-ac... | 2014/12/14 | [
"https://Stackoverflow.com/questions/27474131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265519/"
] | You can remove elements by selecting them, and using the `.remove()` jQuery function ([docs](http://api.jquery.com/remove/)).
Something like the code below, where I select on the content of the `href` attribute:
```
$('a[href="remove"]').remove()
```
---
**EDIT: See snippet, works perfectly**
```html
<script src=... | An elegant ECMAScript 5 solution would be the following three-liner:
```js
[].slice.call(flex1.getElementsByTagName("a"), 0).
filter(function(a) { return a.getAttribute("href") == "remove" }).
forEach(function(a) { a.removeChild(a.children[0]) });
```
```html
<div class="flexigrid" style='width: 100%;' data-u... |
27,474,131 | I have a flexigrid table
and inside of it there are some href links with an image
I have two types of hrefs
```
<a href="add/11111111111111111111112" class=" crud-action" title="ADD R"><img src="http://www.gmurgente.es/imagenes/portada/google+.png" alt="ADD R" /></a>
```
and
```
<a href="remove" class=" crud-ac... | 2014/12/14 | [
"https://Stackoverflow.com/questions/27474131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265519/"
] | An elegant ECMAScript 5 solution would be the following three-liner:
```js
[].slice.call(flex1.getElementsByTagName("a"), 0).
filter(function(a) { return a.getAttribute("href") == "remove" }).
forEach(function(a) { a.removeChild(a.children[0]) });
```
```html
<div class="flexigrid" style='width: 100%;' data-u... | This will work, with plain javascript:
---
```js
var table = document.getElementById('flex1');
var a = table.getElementsByTagName('a');console.log(a);
for (var i= 0;i<a.length;i++) {
var b = a[i].getAttribute('href');
if (b == 'remove')
{
var row = a[i].parentNode.parentNode.parentNode;
row.dele... |
1,462,040 | Long introduction (I'm sorry), but very short question
You take the proper subset of $\mathbb{N}$ made by all and only numbers
of the form $4n + 1$, when $n = 0,1,2,\ldots$ and obtain the set :
$A = \{1,5,9,13,17,21,25,29,33,\ldots\}$
$A$ is closed with ordinary product because for any $n$,$m$ of $\mathbb{N}$:
... | 2015/10/03 | [
"https://math.stackexchange.com/questions/1462040",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/276421/"
] | Pardon me for dropping the $A$ prefixes, which just make the notation clunky. You are looking for integers $n,m,y \equiv 1 \mod 4$ such that $n^2 = y m^2$, but with $y \ne p^2$ for any $p \equiv 1 \mod 4$.
Since these are integers, $y = k^2$ for some $k$. By the condition on $y$, $k \not \equiv 1 \mod 4$. But since $y... | Let $P\_1$ be the set of primes $\equiv 1\pmod 4$ and $P\_3$ the set of primes $\equiv 3\pmod 4$. Then we can write any $n\in\mathbb N$ as
$$ n=2^r\cdot\prod\_{p\in P\_1}p^{s\_p}\cdot\prod\_{p\in P\_3}p^{t\_p}.$$
Note that
$$n\in A\iff r=0\text{ and }\sum s\_p\text{ is even} $$
$$n\text{ is a perfect square}\iff 2|r\te... |
28,837,660 | I am wondering if it is possible to replace in files statements like:
```
#include "foo\bar\something\else"
#include "..\..\foo.h"
```
with
```
#include "foo/bar/something/else"
#include "../../foo.h"
```
I can use Perl pie or sed multiple times with:
```
s|(\#include.*)\\|\1/|
```
But I would like to know i... | 2015/03/03 | [
"https://Stackoverflow.com/questions/28837660",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2612235/"
] | Using `perl`:
```
perl -pe 's~(?:#include|(?!^)\G)[^\\]*\K\\~/~g' file
#include "foo/bar/something/else"
#include "../../foo.h"
```
Using `sed`:
```
sed '/#include/s~\\~/~g' file
#include "foo/bar/something/else"
#include "../../foo.h"
```
Or if you want to replace all `\` with `/` then use `tr`:
```
tr '\\' "/"... | Yo can use `sed`
```
sed 's|\|/||g' file
#include "foo\bar\something\else"
#include "..\..\foo.h"
```
Replace only in lines with `#include`
```
sed '/#include/s|\\|/|g' file
#include "foo/bar/something/else"
#include "../../foo.h"
```
```
awk '/^#include/ {gsub(/\\/,"/")}1' file
#include "foo/bar/something/else"
... |
28,837,660 | I am wondering if it is possible to replace in files statements like:
```
#include "foo\bar\something\else"
#include "..\..\foo.h"
```
with
```
#include "foo/bar/something/else"
#include "../../foo.h"
```
I can use Perl pie or sed multiple times with:
```
s|(\#include.*)\\|\1/|
```
But I would like to know i... | 2015/03/03 | [
"https://Stackoverflow.com/questions/28837660",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2612235/"
] | ```
perl -pe'tr{\\}{/} if /^\s*#\s*include/'
```
Some of the text is matched against twice, but the amount is very minor. The alternative (as seen in anubhava's answer) is rather messy and probably ends up being no faster than matching against some of the text twice.
A `sed` version of this approach has since been a... | Yo can use `sed`
```
sed 's|\|/||g' file
#include "foo\bar\something\else"
#include "..\..\foo.h"
```
Replace only in lines with `#include`
```
sed '/#include/s|\\|/|g' file
#include "foo/bar/something/else"
#include "../../foo.h"
```
```
awk '/^#include/ {gsub(/\\/,"/")}1' file
#include "foo/bar/something/else"
... |
113,250 | [Bigby's Hand](https://www.dndbeyond.com/spells/bigbys-hand) counts as an object, but if it is adjacent to an enemy who then moves away, can you use your reaction to take an opportunity attack? | 2018/01/11 | [
"https://rpg.stackexchange.com/questions/113250",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/23024/"
] | The hand is an object (PHB 218) and thus does not have any actions, including reactions, that it can perform on its own. Thus it cannot perform an Opportunity Attack. | No - objects created by spells only have the abilities granted to them in their descriptions
============================================================================================
**The hand is an object created by a spell effect and is not granted the ability to take an opportunity attack**
Unfortunately, Bigb... |
22,635 | Прочитав [Правила русской орфографии и пунктуации (1956 г.)](http://new.gramota.ru/biblio/readingroom/rules/139-prop) п.96-99, я так и не смог понять, следует ли писать с заглавной буквы выдуманные автором названия существ или рас. Например, если взять зергов из игры Warhammer, то по-русски они должны быть Зерги или зе... | 2020/07/16 | [
"https://russian.stackexchange.com/questions/22635",
"https://russian.stackexchange.com",
"https://russian.stackexchange.com/users/14793/"
] | First of all, answering your direct question: I personally think that yes, you should spell *зерги* with the lowercase, by analogy with the names of Earth animals, nations and races: *волки, овцы; китайцы, русские; негры, индейцы* etc.
The problem with applying this rule book is deciding whether or not we subscribe to... | Для начала тут просто не важно, вымышленные они или нет (вы же как бы погружаетесь в данную вымышленную Вселенную и принимаете её "реалии"), речь просто идет о названии индивидов(!) вида, либо,если хотите,народа;
В обычных ситуациях подобные названия пишутся со строчной буквы.
Как тут выше сказали, в случае, если речь... |
24,379,651 | I am dealing with very strange issue of dealing with garbage in iterating through variable which has been cast to an array
```
$arr = (array)$var; // problem
$arr = array($var); // ok
```
The first method seems to work fine on values with integers, but not with strings. Is there any documented difference and does ph... | 2014/06/24 | [
"https://Stackoverflow.com/questions/24379651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/757808/"
] | If `$var` is a scalar, it's documented that both lines do the same:
>
> For any of the types: integer, float, string, boolean and resource, converting a value to an array results in an array with a single element with index zero and the value of the scalar which was converted. In other words, **(array)$scalarValue is... | There are two ways to cast a variable in PHP as a specific type.
1. using the settype() function
2. using (int) (bool) (float) etc
More Info : <http://www.electrictoolbox.com/type-casting-php/> |
40,765,232 | Why is the following illegal in C++?
```
auto x = unsigned int(0);
```
Whereas the following are all OK:
```
auto y = int(0);
auto z = unsigned(0);
auto w = float(0);
```
or in general:
```
auto t = Type(... c-tor-args ...);
```
(with the exception of `Type` being `unsigned int`). | 2016/11/23 | [
"https://Stackoverflow.com/questions/40765232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/984786/"
] | The syntax is [Explicit type conversion (functional notation)](http://en.cppreference.com/w/cpp/language/explicit_cast#Explanation) here. According to the grammatical rule, it only works with simple type specifier or typedef specifier (i.e. a single-word type name).
(emphasis mine)
>
> 2) The functional cast express... | Because of parsing priority. The compiler is lost because `int(0)` is matched before `unsigned int`.
You have to enclose your type in parentheses:
```
auto x = (unsigned int)(0);
```
or use a typedef:
```
typedef unsigned int uint;
auto x = uint(0);
``` |
55,119,643 | How find sum of all value in that object? In object included array with another object with value and may be "next" array with similar structure object.
```
{
value: 4,
next: [
{
value: 3,
next: [...]
},
{
value: 3,
next: [...]
},
...
]
}
``` | 2019/03/12 | [
"https://Stackoverflow.com/questions/55119643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6289878/"
] | You would need recursion to deal with the arbitrary nesting of your object:
```js
const nestedSum = o => (o.next || []).reduce((acc, o) => acc + nestedSum(o), o.value);
// Demo
const data = {
value: 4,
next: [{
value: 3,
next: [{value: 5}]
}, {
value: 3,
next: []
},
]
... | You need a recursive function and check if the value of a key is a number then add with the variable , else if it is an array like `next` then iterate through it and again call the same function with a new object
```js
let data = {
value: 4,
next: [{
value: 3,
next: [{
value: 4
}, {... |
55,119,643 | How find sum of all value in that object? In object included array with another object with value and may be "next" array with similar structure object.
```
{
value: 4,
next: [
{
value: 3,
next: [...]
},
{
value: 3,
next: [...]
},
...
]
}
``` | 2019/03/12 | [
"https://Stackoverflow.com/questions/55119643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6289878/"
] | You would need recursion to deal with the arbitrary nesting of your object:
```js
const nestedSum = o => (o.next || []).reduce((acc, o) => acc + nestedSum(o), o.value);
// Demo
const data = {
value: 4,
next: [{
value: 3,
next: [{value: 5}]
}, {
value: 3,
next: []
},
]
... | Use [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) and [Object.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) to sum the values recursively:
```js
const obj = {
value: 4,
next: [{
value: 3,
... |
55,119,643 | How find sum of all value in that object? In object included array with another object with value and may be "next" array with similar structure object.
```
{
value: 4,
next: [
{
value: 3,
next: [...]
},
{
value: 3,
next: [...]
},
...
]
}
``` | 2019/03/12 | [
"https://Stackoverflow.com/questions/55119643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6289878/"
] | You would need recursion to deal with the arbitrary nesting of your object:
```js
const nestedSum = o => (o.next || []).reduce((acc, o) => acc + nestedSum(o), o.value);
// Demo
const data = {
value: 4,
next: [{
value: 3,
next: [{value: 5}]
}, {
value: 3,
next: []
},
]
... | ```js
function sum(obj, current = 0) {
const nextSum = (obj.next || []).reduce((nextSum, obj) => nextSum + sum(obj, current), 0)
return current + nextSum + obj.value
}
const example = {
value: 4,
next: [
{
value: 3,
next: [{
value: 7
}]
},
{
value: 3
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.