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 |
|---|---|---|---|---|---|
10,264,705 | I'm looking to have users upload an image and then it will be cropped to a set size. What I'd like to have happen is essentially a div that's set to the specific crop size and the image inside that box. The user would then be able to slide the image around and whatever was visible in that div is what the image would be... | 2012/04/22 | [
"https://Stackoverflow.com/questions/10264705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1197720/"
] | I would recomend "Guillotine": <http://github.com/matiasgagliano/guillotine>
It's a jQuery plugin that does just what you are asking, it also throws in rotation and zoom.
It supports touch devices and it's responsive.
Check out the demo: <http://matiasgagliano.github.io/guillotine> | You can use the JCrop plugin.
[Jcrop Plugin](http://deepliquid.com/content/Jcrop_Download.html) |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | I have no experience with Foxit, however I can confirm this capability does not exist in Adobe Reader.
It is **very** simple in Adobe Acrobat, if you can access that software. Tools->Header and Footer->Add Header and footer. | Using PDF Reader:
1. Click the [Sign] option (fountain pen)on the top toolbar.
2. Click in your document where you want to put the file name (you may have to click twice), and then type the text. You can also make your text larger/smaller, expand it, insert a bullet, etc.
3. You can then select [Next] and save your do... |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | To the late googlers, I made a program that will do this for free, sourcecode included:
[Youtube video](https://www.youtube.com/watch?v=HivH8cNQRDY)
[Site](http://www.saintjohnny.com/)
[Download link](http://www.saintjohnny.com/pdffilenamelabeler/files/pdffilenamelabeler.zip) | Using PDF Reader:
1. Click the [Sign] option (fountain pen)on the top toolbar.
2. Click in your document where you want to put the file name (you may have to click twice), and then type the text. You can also make your text larger/smaller, expand it, insert a bullet, etc.
3. You can then select [Next] and save your do... |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | To the late googlers, I made a program that will do this for free, sourcecode included:
[Youtube video](https://www.youtube.com/watch?v=HivH8cNQRDY)
[Site](http://www.saintjohnny.com/)
[Download link](http://www.saintjohnny.com/pdffilenamelabeler/files/pdffilenamelabeler.zip) | if you are willing to use a [commercial application](http://www.printandshare.info):
1. Go to the Get More Editor
2. Click "Insert text with parameters"
3. Add "Print job name"
[](https://i.stack.imgur.com/4rgD3.png)
video: <https://www.youtube.com/... |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | if you are willing to use a [commercial application](http://www.printandshare.info):
1. Go to the Get More Editor
2. Click "Insert text with parameters"
3. Add "Print job name"
[](https://i.stack.imgur.com/4rgD3.png)
video: <https://www.youtube.com/... | Using PDF Reader:
1. Click the [Sign] option (fountain pen)on the top toolbar.
2. Click in your document where you want to put the file name (you may have to click twice), and then type the text. You can also make your text larger/smaller, expand it, insert a bullet, etc.
3. You can then select [Next] and save your do... |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | To the late googlers, I made a program that will do this for free, sourcecode included:
[Youtube video](https://www.youtube.com/watch?v=HivH8cNQRDY)
[Site](http://www.saintjohnny.com/)
[Download link](http://www.saintjohnny.com/pdffilenamelabeler/files/pdffilenamelabeler.zip) | I know this may be a bit of a late response:
Irfanview <https://www.irfanview.com/> is a image editor and PDF viewer. I have been using it for various reasons for 15 years or more, most recently to convert PDF pages to JPG format.
In the Print dialog (when printing a PDF) you can add a header with $D for directory an... |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | Yes, you can use Adobe Reader by writing a filename in notes:
1. Add a Sticky note
2. Write a filename
3. Go to Comments and then to the option icon
4. Go to Comments preferences
5. Mark "Print notes and pop-ups".
*I'm using portuguese written Adobe Reader, so it maybe not be exactly like an english one.* | if you are willing to use a [commercial application](http://www.printandshare.info):
1. Go to the Get More Editor
2. Click "Insert text with parameters"
3. Add "Print job name"
[](https://i.stack.imgur.com/4rgD3.png)
video: <https://www.youtube.com/... |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | To the late googlers, I made a program that will do this for free, sourcecode included:
[Youtube video](https://www.youtube.com/watch?v=HivH8cNQRDY)
[Site](http://www.saintjohnny.com/)
[Download link](http://www.saintjohnny.com/pdffilenamelabeler/files/pdffilenamelabeler.zip) | Yes, you can use Adobe Reader by writing a filename in notes:
1. Add a Sticky note
2. Write a filename
3. Go to Comments and then to the option icon
4. Go to Comments preferences
5. Mark "Print notes and pop-ups".
*I'm using portuguese written Adobe Reader, so it maybe not be exactly like an english one.* |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | Yes, you can use Adobe Reader by writing a filename in notes:
1. Add a Sticky note
2. Write a filename
3. Go to Comments and then to the option icon
4. Go to Comments preferences
5. Mark "Print notes and pop-ups".
*I'm using portuguese written Adobe Reader, so it maybe not be exactly like an english one.* | Using PDF Reader:
1. Click the [Sign] option (fountain pen)on the top toolbar.
2. Click in your document where you want to put the file name (you may have to click twice), and then type the text. You can also make your text larger/smaller, expand it, insert a bullet, etc.
3. You can then select [Next] and save your do... |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | To the late googlers, I made a program that will do this for free, sourcecode included:
[Youtube video](https://www.youtube.com/watch?v=HivH8cNQRDY)
[Site](http://www.saintjohnny.com/)
[Download link](http://www.saintjohnny.com/pdffilenamelabeler/files/pdffilenamelabeler.zip) | I have no experience with Foxit, however I can confirm this capability does not exist in Adobe Reader.
It is **very** simple in Adobe Acrobat, if you can access that software. Tools->Header and Footer->Add Header and footer. |
452,363 | My home network has a router/NAT (WNR3500L) and a wireless repeater (WN2500RP) of the same brand (Netgear).
Since the repeater has a dynamic IP, the manufacturer put in place a special web address that directly resolves to the current repeater IP. The mechanism is stated to work with the majority of routers.
Using "di... | 2012/07/22 | [
"https://superuser.com/questions/452363",
"https://superuser.com",
"https://superuser.com/users/104568/"
] | I know this may be a bit of a late response:
Irfanview <https://www.irfanview.com/> is a image editor and PDF viewer. I have been using it for various reasons for 15 years or more, most recently to convert PDF pages to JPG format.
In the Print dialog (when printing a PDF) you can add a header with $D for directory an... | Using PDF Reader:
1. Click the [Sign] option (fountain pen)on the top toolbar.
2. Click in your document where you want to put the file name (you may have to click twice), and then type the text. You can also make your text larger/smaller, expand it, insert a bullet, etc.
3. You can then select [Next] and save your do... |
18,206,137 | So I'm trying to add text inside a variable and the variable together. But every time I add new text I want it to be added on another line. So when it's spread on multiple lines instead of it being just on one line.
Here is the code I have for it so far. How do I put the old sResults on the lower lines?
```
sResults ... | 2013/08/13 | [
"https://Stackoverflow.com/questions/18206137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2677373/"
] | if you are using javascript then try this way :
```
sResults = ("You Are The Boss" + sResults)
sResult=sResult+"<br>";
``` | To force a new line in HTML then you need to use the [br tag](http://www.w3schools.com/tags/tag_br.asp). |
7,121,890 | I have been trying to find an answer to this question for months, but even Android documentation directs to Java naming convention document which does not say anything (which is logical) about Android-specific elements like TextView, EditView, etc. It also seems that stackoverflow does not have an answer to this questi... | 2011/08/19 | [
"https://Stackoverflow.com/questions/7121890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/437039/"
] | Are you referring to the ids in the xml layouts?
I name mine based on the layout name, type of view and functionality. For example if I have a `signup.xml` layout, I would name the elements inside:
`[layout]_[view]_[object's purpose]`
```
signup_text_user
signup_edit_user
signup_text_pass
signup_edit_pass
signup_btn_... | try this:
<http://source.android.com/source/code-style.html#follow-field-naming-conventions> |
165,084 | ```
You drop a dwarvish mattock. Your movements are now unencumbered.
You see here a tin. KAABLAMM!!! You triggered a land mine! Your movements are slowed slightly because of your load. You fall into a pit!
```
Why did this happen? I picked up some scale mail, and became burdened. So I dropped my dwarvish mattock (I ... | 2014/04/20 | [
"https://gaming.stackexchange.com/questions/165084",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/49683/"
] | It did not increase your weight; it gave you [wounded legs](http://nethackwiki.com/wiki/Wounded_legs), which decreases your carrying capacity. You'll get better after a few turns. | >
> Wounded legs is an intrinsic property generally considered undesirable. With wounded legs, your dexterity is reduced by one and abused every five turns. You are unable to jump, kick, or ride anything, **and you become significantly more burdened**. However, it is temporary, lasting usually only a few turns. After ... |
6,774,525 | I'm fairly new to jquery and so far i have got my code to toggle and slide a html menu. heres my code
```
<script type="text/javascript">
$(document).ready(function () {
$('li').each(function(){
$('li.menuheader').hover(function(){
$('ul.submenu').slideToggle('slow', function(){})
});
});
});
</script>
</hea... | 2011/07/21 | [
"https://Stackoverflow.com/questions/6774525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665892/"
] | Maybe this is what you are looking for (n need to use slideToggle i think):
```
$('ul.submenu').hide();
$('li').each(function() {
$('li.menuheader').hover(function() {
$(this).find('ul.submenu').show('slow')
}, function() {
$(this).find('ul.submenu').hide('slow')
});
});
```
fiddle here: ... | Your code shows all `ul.submenu` because they all match the selector. Use `$(this).find('ul.submenu')` to find the appropriate ones for each `li`.
Secondly, for each `li` you bind a `hover` handler for each `li.menuheader`. That's unnecessary.
Also, `hover` triggers at mouseenter and mouseout. `mouseenter` should suf... |
6,774,525 | I'm fairly new to jquery and so far i have got my code to toggle and slide a html menu. heres my code
```
<script type="text/javascript">
$(document).ready(function () {
$('li').each(function(){
$('li.menuheader').hover(function(){
$('ul.submenu').slideToggle('slow', function(){})
});
});
});
</script>
</hea... | 2011/07/21 | [
"https://Stackoverflow.com/questions/6774525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665892/"
] | Maybe this is what you are looking for (n need to use slideToggle i think):
```
$('ul.submenu').hide();
$('li').each(function() {
$('li.menuheader').hover(function() {
$(this).find('ul.submenu').show('slow')
}, function() {
$(this).find('ul.submenu').hide('slow')
});
});
```
fiddle here: ... | `$('li.menuheader')` ==> this will select all the `menuheaders`. Filter them with `this`.
```
$(document).ready(function () {
$('li').each(function(){
$(this).('menuheader').hover(function(){
$(this).children('ul.submenu').slideToggle('slow', function(){
....
})
... |
62,452,491 | I have a problem with Json returned by my REST api GET method.
That's how my entities looks like:
```
@Entity
public class Employee {
...
@ManyToOne(fetch = FetchType.EAGER, optional = false)
@JoinColumn(name = "department_id", nullable = true)
private Department department;
}
@Entity
public class De... | 2020/06/18 | [
"https://Stackoverflow.com/questions/62452491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11480186/"
] | A good practice is to define a DTO that represents the data that is exposed by your API.
This should be decoupled from your domain (Employee) as it will offer you more flexibility, just like what you want to achieve.
```
class EmployeeDTO extends RepresentationModel {
private long id;
private String surname;... | **`@JsonIgnoreProperties`**
To just get department id without changing any implementation you may use `@JsonIgnoreProperties({"name", "room"})` as following
```
@ManyToOne(fetch = FetchType.EAGER, optional = false)
@JoinColumn(name = "department_id", nullable = true)
@JsonIgnoreProperties({"name", "room"})
private D... |
60,823,032 | How to put condition when sometimes there's popUp window but sometimes it does not appear. | 2020/03/23 | [
"https://Stackoverflow.com/questions/60823032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12986522/"
] | just add once option to the event listener to execute it one time.
```
window.addEventListener('scroll', () => {
const vh = window.innerHeight;
const scrolled = window.scrollTop;
if (scrolled > vh) {
const scrollTextAnimation = anime.timeline();
scrollTextAnimation
.ad... | You can remove the event listener after your logic executes in order to stop it from ever firing again. You can do this in two ways:
1) Use the `once` option as defined in the parameters for `addEventListener` [here](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener). This option automatica... |
60,823,032 | How to put condition when sometimes there's popUp window but sometimes it does not appear. | 2020/03/23 | [
"https://Stackoverflow.com/questions/60823032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12986522/"
] | I just added a bool that change the statement to false when I make a scrollY more than innerHeight/2. "Once" option in addEventListener was not working, don't know why. Is there a better solution how to fix that?
The code below is working:
```
let myBool = true;
window.addEventListener('scroll', () => {
if (windo... | You can remove the event listener after your logic executes in order to stop it from ever firing again. You can do this in two ways:
1) Use the `once` option as defined in the parameters for `addEventListener` [here](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener). This option automatica... |
1,476,495 | Very Simple Question but I am finding it hard to get a good answer
If I wanted to remove certain divs when IE8 is used to view my webpage how would I do this ?
could you give me a coded example please.
Thanks | 2009/09/25 | [
"https://Stackoverflow.com/questions/1476495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123663/"
] | You can use [conditional comments](http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx) like this:
```
<!--[if !IE 8]>
<div></div>
<![endif]-->
``` | the need of conditional comments in IE8 is very small.
Maybe you want to get in touch with "Reset Stylesheets"
In Addition to that question i want to provide some of my questions since they belong to same type of topic:
[Will Conditional Comments always be needed?](https://stackoverflow.com/questions/1356665/will-co... |
18,741,020 | There's any way to re-provision a local database without losing the local data, (using Sync framework 2.1) ?
My scenario is:
1. Add a new column on Remote DB
2. Re-provisioning the Remote DB (to include the new column on the synchronization template)
3. Re-provisioning the LOCAL DB.
My problems start at step 3 becau... | 2013/09/11 | [
"https://Stackoverflow.com/questions/18741020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2177545/"
] | deprovisioning doesnt remove data, it only removes metadata/objects associated associated with a scope. If its database deprovisioning, it removes all Sync Fx created objects.
so the good side, you don't lose data.
the bad side, if you reprovision a new scope on the same table, they already have data. But new scope do... | You don’t need to drop the databases. de provision both databases. And add new columns for data table and run the sync. This should work. This is how you deprovison.
```
SqlSyncScopeDeprovisioning scopeDeprovisioning = new SqlSyncScopeDeprovisioning((SqlConnection)_peerProvider.Connection);
scopeDeprovi... |
1,145,167 | I am using QT4 and dynamically adding entries to a QMenu. Is it possible to sort the entries in the QMenu without deleting it and creating a new one?
I originally thought there was a function to insert at a specific location so I could sort on insert, but I have not been able to locate it. | 2009/07/17 | [
"https://Stackoverflow.com/questions/1145167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49436/"
] | Once added, I don't think you can reorder. While you are creating though you could use the [QWidget::insertAction](http://doc.qtsoftware.com/4.5/qwidget.html#insertAction) method to place it exactly where you want it.
```
void QWidget::insertAction ( QAction * before, QAction * action )
```
Otherwise you could use [... | In one of my codes, I save the QActions into a separate List and generate the menus and submenus on demand. In theory, I can add "weight" to the items and have them re-ordered, but I have not implemented this yet.
Project page is available here: <http://code.google.com/p/qtedit4/wiki/qmdilib>
Please note that the act... |
316,049 | I have a text file named `t1.txt`, it contains:
```
300
400
500
600
```
Now I want to find how many numbers in this text are less than 450
And I give the following code:
```
b=0
for i in $(cat t1.txt)
do
if [$i -lt 450]
then
((b=b+1))
fi
done
echo b
```
but it doesn't work.
What should I do?
Thank you. | 2016/10/12 | [
"https://unix.stackexchange.com/questions/316049",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/194777/"
] | ```
b=0
for i in $(cat t1.txt)
do
# convert float to int
i=$(echo $i | cut -d. -f1)
if [ $i -lt 450 ] # comment: need spaces next to the the square brackets
then
((b=b+1))
fi
done
echo $b # comment: need to $
``` | ```
#!/bin/bash
while read line
do
if [ "${line}" -lt "450" ]
then
count=$((count+1))
fi
done < t.txt
echo ${count}
``` |
316,049 | I have a text file named `t1.txt`, it contains:
```
300
400
500
600
```
Now I want to find how many numbers in this text are less than 450
And I give the following code:
```
b=0
for i in $(cat t1.txt)
do
if [$i -lt 450]
then
((b=b+1))
fi
done
echo b
```
but it doesn't work.
What should I do?
Thank you. | 2016/10/12 | [
"https://unix.stackexchange.com/questions/316049",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/194777/"
] | Awk is good at this:
```
$ awk '$1<450{c++} END{print c+0}' t1.txt
2
```
How it works:
* `$1<450 {c++}`
For any line for which the first field is less than 450, the variable `c` is incremented by one.
* `END{print c+0}`
After we have read in all the lines, the value of `c` is printed.
The numbers can be integer ... | ```
#!/bin/bash
while read line
do
if [ "${line}" -lt "450" ]
then
count=$((count+1))
fi
done < t.txt
echo ${count}
``` |
28,585,138 | I am trying to check if server is online in android.
I have following code on a button onclick listener block:
```
boolean exists = false;
try {
SocketAddress sockaddr = new InetSocketAddress("google.com", 80);
// Create an unbound socket
Soc... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28585138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2033139/"
] | This line:
```
pt1 = (i, j) # I have added spaces per the style guide
```
assigns a new **tuple** object to the name `pt1` (see [the docs](https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange), [the tutorial](https://docs.python.org/2/tutorial/datastructures.... | Because pt1 is a tuple and doesn't have `x` or `y` attributes . You probably want:
```
pt2 = (pt1[0] + 5, pt1[1] + 5)
``` |
28,585,138 | I am trying to check if server is online in android.
I have following code on a button onclick listener block:
```
boolean exists = false;
try {
SocketAddress sockaddr = new InetSocketAddress("google.com", 80);
// Create an unbound socket
Soc... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28585138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2033139/"
] | This line:
```
pt1 = (i, j) # I have added spaces per the style guide
```
assigns a new **tuple** object to the name `pt1` (see [the docs](https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange), [the tutorial](https://docs.python.org/2/tutorial/datastructures.... | You can't access plain tuples like that, you need to change
```
pt2=(pt1.x+5,pt1.y+5)
```
to
```
pt2=(pt1[0] + 5, pt1[0] + 5)
```
However, Python does have a [namedtuple](https://docs.python.org/2/library/collections.html#namedtuple-factory-function-for-tuples-with-named-fields) which can be accessed via attribu... |
28,585,138 | I am trying to check if server is online in android.
I have following code on a button onclick listener block:
```
boolean exists = false;
try {
SocketAddress sockaddr = new InetSocketAddress("google.com", 80);
// Create an unbound socket
Soc... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28585138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2033139/"
] | This line:
```
pt1 = (i, j) # I have added spaces per the style guide
```
assigns a new **tuple** object to the name `pt1` (see [the docs](https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange), [the tutorial](https://docs.python.org/2/tutorial/datastructures.... | You are trying to access an `x` attribute in `pt1`, but `pt1` is a tuple and tuple have no `x` attribute. You could either
* Write a Custom Point class
* Use a [named tuple](https://docs.python.org/3/library/collections.html#collections.namedtuple)
The second solution could look like the following:
```
from collecti... |
51,407,779 | I trying to learn spark on databricks.
I set up a databricks account.
when I try to import a notebook from url I get a message:
Import failed with error: Failed to import <https://databricks-prod-cloudfront.cloud.databricks.com/public/4027ec902e239c93eaaa8714f173bcfc/6244269837918943/3546103630347710/4066658260255490... | 2018/07/18 | [
"https://Stackoverflow.com/questions/51407779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9317408/"
] | The problem was in the naming of the bucket - there should be no dots '.' in the name. Now the bucket has name without dots and import works fine! | Edit: It is not a problem with importing notebooks via URL.
This is a problem with importing notebooks via URL. Can you instead download the page using your web browser, download "Just the HTML" and then you'll be able to import it using file-based notebook import. |
19,539,187 | I want to count all the `mouseclicks` that are made in a window. I want the counter to increase on every single object i click on, even if its a button, the form it self or a `textbox` etc. etc.
I have this so far but I cant seem to get it to work:
```
int mouseCounter = 0;
private void Form1_Load(object sender, Even... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19539187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2752375/"
] | You may use a message filter, to filter out mouse clicks on your (main)form.
You basically get the message before it is dispatched to the control and may do whatever you want (in your case: increase a counter).
The return value of `PreFilterMessage(ref Message m)` determines wether the message will be dispatched to th... | You have to use some `Application-Wide Click message` with an `IMessageFilter` like this:
```cs
public partial class Form1 : Form, IMessageFilter
{
int mouseCounter;
public Form1()
{
InitializeComponent();
Application.AddMessageFilter(this);
}
public bool PreFilterMessage(ref Mes... |
19,539,187 | I want to count all the `mouseclicks` that are made in a window. I want the counter to increase on every single object i click on, even if its a button, the form it self or a `textbox` etc. etc.
I have this so far but I cant seem to get it to work:
```
int mouseCounter = 0;
private void Form1_Load(object sender, Even... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19539187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2752375/"
] | You have to use some `Application-Wide Click message` with an `IMessageFilter` like this:
```cs
public partial class Form1 : Form, IMessageFilter
{
int mouseCounter;
public Form1()
{
InitializeComponent();
Application.AddMessageFilter(this);
}
public bool PreFilterMessage(ref Mes... | Use this:
```
namespace TicTacToe
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
button1.Visible = false;
}
}
}
``` |
19,539,187 | I want to count all the `mouseclicks` that are made in a window. I want the counter to increase on every single object i click on, even if its a button, the form it self or a `textbox` etc. etc.
I have this so far but I cant seem to get it to work:
```
int mouseCounter = 0;
private void Form1_Load(object sender, Even... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19539187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2752375/"
] | You may use a message filter, to filter out mouse clicks on your (main)form.
You basically get the message before it is dispatched to the control and may do whatever you want (in your case: increase a counter).
The return value of `PreFilterMessage(ref Message m)` determines wether the message will be dispatched to th... | Use this:
```
namespace TicTacToe
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
button1.Visible = false;
}
}
}
``` |
80,518 | The checkboxes that appear to be changeable under the **Edit / Software Sources** dialog box cannot be changed. I click on them and they just turn gray and stay at their current setting.
**Update:**
When I run software-center from a terminal window and try to change one of the checkbox settings, I get:
```
Traceback... | 2011/11/18 | [
"https://askubuntu.com/questions/80518",
"https://askubuntu.com",
"https://askubuntu.com/users/4197/"
] | What do you mean by Ubuntu + LXDE Desktop Environment Package?
Is it Ubuntu mini + lxde package (as `sudo apt-get install lxde`) or which way did you get this?
Lubuntu is (I guess) Ubuntu mini + `sudo apt-get install lubuntu-desktop`, not exactly just clean lxde package.
Lubuntu should work pretty fast on your comp... | Yes ubuntu + lxde=lubuntu and i really recommend that you download lubuntu for a cleaner ubuntu install I have a dell d600 laptop running lubuntu pentium m and 768 ram 30 gigs in Hard drive and I'm very happy with it.
Download from [HERE](http://lubuntu.net/) |
80,518 | The checkboxes that appear to be changeable under the **Edit / Software Sources** dialog box cannot be changed. I click on them and they just turn gray and stay at their current setting.
**Update:**
When I run software-center from a terminal window and try to change one of the checkbox settings, I get:
```
Traceback... | 2011/11/18 | [
"https://askubuntu.com/questions/80518",
"https://askubuntu.com",
"https://askubuntu.com/users/4197/"
] | Lubuntu also comes with lighter applications than the ones from Ubuntu, that affects your experience too. | Yes ubuntu + lxde=lubuntu and i really recommend that you download lubuntu for a cleaner ubuntu install I have a dell d600 laptop running lubuntu pentium m and 768 ram 30 gigs in Hard drive and I'm very happy with it.
Download from [HERE](http://lubuntu.net/) |
80,518 | The checkboxes that appear to be changeable under the **Edit / Software Sources** dialog box cannot be changed. I click on them and they just turn gray and stay at their current setting.
**Update:**
When I run software-center from a terminal window and try to change one of the checkbox settings, I get:
```
Traceback... | 2011/11/18 | [
"https://askubuntu.com/questions/80518",
"https://askubuntu.com",
"https://askubuntu.com/users/4197/"
] | What do you mean by Ubuntu + LXDE Desktop Environment Package?
Is it Ubuntu mini + lxde package (as `sudo apt-get install lxde`) or which way did you get this?
Lubuntu is (I guess) Ubuntu mini + `sudo apt-get install lubuntu-desktop`, not exactly just clean lxde package.
Lubuntu should work pretty fast on your comp... | Lubuntu also comes with lighter applications than the ones from Ubuntu, that affects your experience too. |
56,717,812 | When I implement
```
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
```
The Manifest not Sync, Error message like this:
ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) ... | 2019/06/22 | [
"https://Stackoverflow.com/questions/56717812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3833192/"
] | Firebase migrated to AndroidX in the latest release.
It means that you are using both, support libraries and androidx libraries.
You can:
* migrate to androidx as described below
* downgrade your firebase dependencies (but it is not a real solution because you have to migrate before or after)
You can check the [off... | I just got the same problem like you. And this is how I solve it. You can try it: (i'm using newest android version of 2019)
I change this:
```
implementation 'com.google.firebase:firebase-core:17.0.0'
```
implementation 'com.google.firebase:firebase-auth:18.0.0'
into this:
```
implementation 'com.google.firebas... |
56,717,812 | When I implement
```
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
```
The Manifest not Sync, Error message like this:
ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) ... | 2019/06/22 | [
"https://Stackoverflow.com/questions/56717812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3833192/"
] | I just got the same problem like you. And this is how I solve it. You can try it: (i'm using newest android version of 2019)
I change this:
```
implementation 'com.google.firebase:firebase-core:17.0.0'
```
implementation 'com.google.firebase:firebase-auth:18.0.0'
into this:
```
implementation 'com.google.firebas... | You firebase versions are incompatible. You can check the latest releases for compatibility or you can use this
```
implementation 'com.google.firebase:firebase-firestore:19.0.2'
implementation 'com.google.firebase:firebase-auth:17.0.0'
``` |
56,717,812 | When I implement
```
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
```
The Manifest not Sync, Error message like this:
ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) ... | 2019/06/22 | [
"https://Stackoverflow.com/questions/56717812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3833192/"
] | Firebase migrated to AndroidX in the latest release.
It means that you are using both, support libraries and androidx libraries.
You can:
* migrate to androidx as described below
* downgrade your firebase dependencies (but it is not a real solution because you have to migrate before or after)
You can check the [off... | You firebase versions are incompatible. You can check the latest releases for compatibility or you can use this
```
implementation 'com.google.firebase:firebase-firestore:19.0.2'
implementation 'com.google.firebase:firebase-auth:17.0.0'
``` |
27,309,066 | I am a new developer and I am having an SQLite issue. Some reason I am not able to add two columns (table\_row\_three, and table\_row\_four) to my SQLite data table. When I read the database file currently, it has a table with "id", "table\_row\_one", and "table\_row\_two", but is missing "table\_row\_three" and "table... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27309066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4126657/"
] | Missing ',' in create statement :
```
String newTableQueryString = "create table " +
TABLE_NAME +
" (" +
TABLE_ROW_ID + " integer primary key autoincrement not null," +
TABLE_ROW_ONE + " text," +
TABLE_ROW_TWO + " text," +
TABLE_ROW_THREE + " text," +
TABLE_ROW_FOUR + " text" +
... | ```
TABLE_ROW_TWO + " text" +
TABLE_ROW_THREE + " text" +
TABLE_ROW_FOUR + " text" +
```
put , after text
```
TABLE_ROW_TWO + " text," +
TABLE_ROW_THREE + " text," +
TABLE_ROW_FOUR + " text" +
``` |
27,309,066 | I am a new developer and I am having an SQLite issue. Some reason I am not able to add two columns (table\_row\_three, and table\_row\_four) to my SQLite data table. When I read the database file currently, it has a table with "id", "table\_row\_one", and "table\_row\_two", but is missing "table\_row\_three" and "table... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27309066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4126657/"
] | ```
TABLE_ROW_TWO + " text" +
TABLE_ROW_THREE + " text" +
TABLE_ROW_FOUR + " text" +
```
put , after text
```
TABLE_ROW_TWO + " text," +
TABLE_ROW_THREE + " text," +
TABLE_ROW_FOUR + " text" +
``` | Change CustomSQLiteOpenHelper code like this,
```
private class CustomSQLiteOpenHelper extends SQLiteOpenHelper
{
public CustomSQLiteOpenHelper(Context context)
{
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db)
{
String newTableQu... |
27,309,066 | I am a new developer and I am having an SQLite issue. Some reason I am not able to add two columns (table\_row\_three, and table\_row\_four) to my SQLite data table. When I read the database file currently, it has a table with "id", "table\_row\_one", and "table\_row\_two", but is missing "table\_row\_three" and "table... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27309066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4126657/"
] | ```
String newTableQueryString = "create table " +
TABLE_NAME +
" (" +
TABLE_ROW_ID + " integer primary key autoincrement not null," +
TABLE_ROW_ONE + " text," +
TABLE_ROW_TWO + " text" +
TABLE_ROW_THREE + " text" +
TABLE_ROW_FOUR + " t... | ```
TABLE_ROW_TWO + " text" +
TABLE_ROW_THREE + " text" +
TABLE_ROW_FOUR + " text" +
```
put , after text
```
TABLE_ROW_TWO + " text," +
TABLE_ROW_THREE + " text," +
TABLE_ROW_FOUR + " text" +
``` |
27,309,066 | I am a new developer and I am having an SQLite issue. Some reason I am not able to add two columns (table\_row\_three, and table\_row\_four) to my SQLite data table. When I read the database file currently, it has a table with "id", "table\_row\_one", and "table\_row\_two", but is missing "table\_row\_three" and "table... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27309066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4126657/"
] | Missing ',' in create statement :
```
String newTableQueryString = "create table " +
TABLE_NAME +
" (" +
TABLE_ROW_ID + " integer primary key autoincrement not null," +
TABLE_ROW_ONE + " text," +
TABLE_ROW_TWO + " text," +
TABLE_ROW_THREE + " text," +
TABLE_ROW_FOUR + " text" +
... | Change CustomSQLiteOpenHelper code like this,
```
private class CustomSQLiteOpenHelper extends SQLiteOpenHelper
{
public CustomSQLiteOpenHelper(Context context)
{
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db)
{
String newTableQu... |
27,309,066 | I am a new developer and I am having an SQLite issue. Some reason I am not able to add two columns (table\_row\_three, and table\_row\_four) to my SQLite data table. When I read the database file currently, it has a table with "id", "table\_row\_one", and "table\_row\_two", but is missing "table\_row\_three" and "table... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27309066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4126657/"
] | Missing ',' in create statement :
```
String newTableQueryString = "create table " +
TABLE_NAME +
" (" +
TABLE_ROW_ID + " integer primary key autoincrement not null," +
TABLE_ROW_ONE + " text," +
TABLE_ROW_TWO + " text," +
TABLE_ROW_THREE + " text," +
TABLE_ROW_FOUR + " text" +
... | ```
String newTableQueryString = "create table " +
TABLE_NAME +
" (" +
TABLE_ROW_ID + " integer primary key autoincrement not null," +
TABLE_ROW_ONE + " text," +
TABLE_ROW_TWO + " text" +
TABLE_ROW_THREE + " text" +
TABLE_ROW_FOUR + " t... |
27,309,066 | I am a new developer and I am having an SQLite issue. Some reason I am not able to add two columns (table\_row\_three, and table\_row\_four) to my SQLite data table. When I read the database file currently, it has a table with "id", "table\_row\_one", and "table\_row\_two", but is missing "table\_row\_three" and "table... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27309066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4126657/"
] | ```
String newTableQueryString = "create table " +
TABLE_NAME +
" (" +
TABLE_ROW_ID + " integer primary key autoincrement not null," +
TABLE_ROW_ONE + " text," +
TABLE_ROW_TWO + " text" +
TABLE_ROW_THREE + " text" +
TABLE_ROW_FOUR + " t... | Change CustomSQLiteOpenHelper code like this,
```
private class CustomSQLiteOpenHelper extends SQLiteOpenHelper
{
public CustomSQLiteOpenHelper(Context context)
{
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db)
{
String newTableQu... |
6,490,592 | I m making an iOS notification service. But my device dont receive anything, i just take one tutorial from internet and make it.
I send more than 1 notification at time, maybe its this the problem? I have my app properly implemented (i can see it in settings).
The correct question for me is... Are there some methods ... | 2011/06/27 | [
"https://Stackoverflow.com/questions/6490592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/736384/"
] | In the [Apple Documentation](http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW2), look at :
>
> Table 5-1 Codes in error-response
> packet
>
>
>
You will find what you se... | Hi There are few methods in pushnotification whice are as below
First register your device by
```
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
```
Then use its delegate methods
```
- (voi... |
25,149,882 | For this code, I have the user input however many students' he/she wants then asks them to enter their names and test scores.
```
#include <iostream>
using namespace std;
int main ()
{
int count = 0, students, names, scores;
//Ask for number of students
cout << "How many students are there?" << endl;
cin >> students... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25149882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3894241/"
] | You would throw everything in a while loop, and then break it when the user wants to quit. But how do you know when the user wants to quit? For something like grabbing names and ages, it could be when the user enters "-1" for the name, which would look like:
```
std::vector<std::string> names;
std::vector<int> ages;
w... | Create a variable to store answer from user. Work in a loop. Ask input from user as answer in every loop. Put the condition to check the choice of user.
**For example:**
```
int x = 1;//to store answer of user
int age;
do{
cout<<"Enter the age";
cin>>age;
//similarly for name
cout<<"You want to do again (1/0)?";
cin... |
25,149,882 | For this code, I have the user input however many students' he/she wants then asks them to enter their names and test scores.
```
#include <iostream>
using namespace std;
int main ()
{
int count = 0, students, names, scores;
//Ask for number of students
cout << "How many students are there?" << endl;
cin >> students... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25149882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3894241/"
] | You would throw everything in a while loop, and then break it when the user wants to quit. But how do you know when the user wants to quit? For something like grabbing names and ages, it could be when the user enters "-1" for the name, which would look like:
```
std::vector<std::string> names;
std::vector<int> ages;
w... | your this function:
```
for (count = 0; count < students; count++)
{
cout << "What are their names?" << endl;
cin >> names;
cout << "What are their scores?" << endl;
cin >> scores;
}
```
can be:
```
vector<std::string> name_list(students);
vector<int> marks_list(students);
for (count = 0; count < s... |
3,480,882 | Please help me understand 2 things I found in this C code:
First, there is the whole code:
```
usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
static uchar dataBuffer[4]; /* buffer must stay valid when usbFunctionSetup returns */
if(rq->bRequest == CUSTOM_RQ_ECHO){ /* ec... | 2010/08/13 | [
"https://Stackoverflow.com/questions/3480882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/307797/"
] | [memcached](http://memcached.org/) is a popular way to solve this problem. You just need to get it up and running (easy) and update your php.ini file to tell it to use memcached as the session storage.
In php.ini you would modify:
```
session.save_handler = memcache
session.save_path = ""
```
For the general idea: ... | >
> Should I maintain my db on a third
> server and write sessions to it?
>
>
>
Yes, one way to handle it is to have a 3rd machine running the database that both webservers use for the application. I've done that for several projects in the past and its worked well. The question with that approach is... is the bo... |
3,480,882 | Please help me understand 2 things I found in this C code:
First, there is the whole code:
```
usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
static uchar dataBuffer[4]; /* buffer must stay valid when usbFunctionSetup returns */
if(rq->bRequest == CUSTOM_RQ_ECHO){ /* ec... | 2010/08/13 | [
"https://Stackoverflow.com/questions/3480882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/307797/"
] | [memcached](http://memcached.org/) is a popular way to solve this problem. You just need to get it up and running (easy) and update your php.ini file to tell it to use memcached as the session storage.
In php.ini you would modify:
```
session.save_handler = memcache
session.save_path = ""
```
For the general idea: ... | Another option is to use the sticky sessions feature on your load balancer. What this will do is keep users on certain servers. So when user 1 comes to the site, they will be directed to server X. Every subsequent request will also be directed to server X. This allows you to not worry about persisting sessions between ... |
36,796,381 | How can I get the current page's URL?
I have tried:
```
{{ site.url }}
```
But this fails to out put anything. | 2016/04/22 | [
"https://Stackoverflow.com/questions/36796381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1013512/"
] | You need to define that in your `_config.yml`.
It's empty by default.
Once defined you might want something like `{{site.url}}{{page.url}}` to get the whole path.
To capture the whole path in a variable you can use
`{% capture url_path %}{{site.url}}{{page.url}}{% endcapture %}` | It can work out of the box in GitHub Pages at least using `{{ page.url | absolute_url }}`. See [Page Variables doc](https://jekyllrb.com/docs/variables/#page-variables) in conjunction with the [Absolute URL filter](https://jekyllrb.com/docs/liquid/filters/#:%7E:text=Absolute%20URL). |
30,752,159 | How to avoid updating the file content at each run
```
#include <iostream>
#include <fstream>
#include <math>
using namespace std;
int main() {
ofstream file("file.txt");
v2 = rand() % 100 + 1;
file<< v2;
file.close();
return 0 ;
}
```
I am looking to add a new line at each run containing the new random... | 2015/06/10 | [
"https://Stackoverflow.com/questions/30752159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4965756/"
] | You need to specify the "append" mode when opening the file:
```
#include <iostream>
#include <fstream>
#include <math>
int main() {
std::ofstream file("file.txt", std::ios_base::app);
v2 = rand() % 100 + 1;
file << v2;
file.close();
return 0 ;
}
```
See <http://en.cppreference.com/w/cpp/io/basic_ofstream... | By default opening a file for writing overwrites the existing file, if there is any. You need to specify an [open mode](http://en.cppreference.com/w/cpp/io/ios_base/openmode) that leaves the file as is. For example `ate` or `app` (which one to pick depends on your use-case).
[This `std::ofstream::open` reference](http... |
70,335,950 | **Client/App.js:**
```
import React, { useState, useEffect } from "react";
import Axios from "axios";
const App = () => {
const [movieName, setmovieName] = useState("");
const [movieReview, setmovieReview] = useState("");
const [getReview, setgetReview] = useState([]);
useEffect(() => {
Axios.get("http://... | 2021/12/13 | [
"https://Stackoverflow.com/questions/70335950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14667358/"
] | 1. In your `useEffect`, you're passing a callback to `Axios.get` - this is not consistent with the [Axios API](https://axios-http.com/docs/api_intro) (you even do it correctly in the `submitReview` function!):
```
useEffect(() => {
// change to Promise.then() chain
Axios.get("http://localhost:3001/api/get").th... | As you are dealing with the promise and have used the thenable syntax while submitting the values but you are not using it while getting the values. try using the below code and check whether this resolves your problem. One more concise method to deal with promises is to use async/await try to use the below code hopes ... |
70,335,950 | **Client/App.js:**
```
import React, { useState, useEffect } from "react";
import Axios from "axios";
const App = () => {
const [movieName, setmovieName] = useState("");
const [movieReview, setmovieReview] = useState("");
const [getReview, setgetReview] = useState([]);
useEffect(() => {
Axios.get("http://... | 2021/12/13 | [
"https://Stackoverflow.com/questions/70335950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14667358/"
] | 1. In your `useEffect`, you're passing a callback to `Axios.get` - this is not consistent with the [Axios API](https://axios-http.com/docs/api_intro) (you even do it correctly in the `submitReview` function!):
```
useEffect(() => {
// change to Promise.then() chain
Axios.get("http://localhost:3001/api/get").th... | Your useEffect is returning a **promise** try to use async await or .then on your code.
Try to change it from:
```
useEffect(() => {
Axios.get("http://localhost:3001/api/get", (result) => {
console.log(result.data);
setgetReview(result.data);
});
}, []);
```
To:
```
useEff... |
209,880 | For example:
>
> -- You should move your car out of the way.
>
>
> -- This is not **my car** but someone else's **car.**
>
>
>
I want to get rid of the redundancy in the sentence which is presented by the second "car". So how can it be rephrased with being grammatically correct?
I thought of:
>
> This is no... | 2019/05/08 | [
"https://ell.stackexchange.com/questions/209880",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/80554/"
] | Your first attempt is perfectly natural and understandable.
*Someone else* is a noun phrase, so it's quite appropriate to simply add an apostrophe and and *s* after it to indicate possession.
You also don't need to repeat the noun *car* because it's understood by parallelism as having been mentioned at the start of t... | What you should say, and feel comfortable saying, is
>
> This is not my car but someone else's.
>
>
>
The object in question is a car, and both possessives refer to it. Suppose we replaced "someone else's" with a possessive pronoun:
>
> This is not my car but his.
>
>
>
I think this makes the relationship a... |
667,165 | >
> Show that $${n\choose r}2^r 3^{n-r}=\sum\_{k=r}^{n} {n \choose k} {k \choose r}2^k$$
>
>
>
Please help me showing the above identity. I tried to solve it in algebraic way and in combinatoric way, but didn't manage.
Thanks! | 2014/02/07 | [
"https://math.stackexchange.com/questions/667165",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/111334/"
] | We are going to show that both sides count the same number of possibilities and therefore have to be equal for the equation:
$$
\binom nr 2^r3^{n-r}=\sum\_{k=r}^n \binom nk\binom kr2^k
$$
Suppose there are $n$ people and we want to choose $r$ people from them who form team $1$. The other $n-r$ people form team $2$. Eve... | $$\sum\_{k=r}^{n}\binom{n}{k}\binom{k}{r}2^{k}=\binom{n}{r}2^{r}\sum\_{k=r}^{n}\binom{n-r}{k-r}2^{k-r}=\binom{n}{r}2^{r}\sum\_{k=0}^{n-r}\binom{n-r}{k}2^{k}1^{n-r-k}=\binom{n}{r}2^{r}3^{n-r}$$ |
667,165 | >
> Show that $${n\choose r}2^r 3^{n-r}=\sum\_{k=r}^{n} {n \choose k} {k \choose r}2^k$$
>
>
>
Please help me showing the above identity. I tried to solve it in algebraic way and in combinatoric way, but didn't manage.
Thanks! | 2014/02/07 | [
"https://math.stackexchange.com/questions/667165",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/111334/"
] | We are going to show that both sides count the same number of possibilities and therefore have to be equal for the equation:
$$
\binom nr 2^r3^{n-r}=\sum\_{k=r}^n \binom nk\binom kr2^k
$$
Suppose there are $n$ people and we want to choose $r$ people from them who form team $1$. The other $n-r$ people form team $2$. Eve... | Or, if you wanted to consider a combinatorial approach to this problem:
We have a set of $n$ people, of which we want to select $r$ officers for a committee of size at least $r$, and in the committee choose any amount of people to have some certain quality (say they are "special").
On the LHS, we first select the offi... |
744,469 | I'm not sure what is the best word to put forward for this since I'm connected to my wireless router and by that definition I was assuming the **ifconfig** to list my ip in **wlan0** section but it display the my ip in en1 section
I'm pretty lame to understand this
Here my ifconfig output
```
lo0: flags=8049<UP,L... | 2014/04/22 | [
"https://superuser.com/questions/744469",
"https://superuser.com",
"https://superuser.com/users/134461/"
] | Different Unix-like OSes have different conventions for low-level interface naming.
OS X calls all Ethernet-like interfaces "enX". When 802.11 wireless Ethernet chipsets first appeared, they presented themselves to host OSes as Ethernet interfaces, because those OSes didn't have any special 802.11-specific support bui... | I couldn't much any reference for standard "interface name" formats (like "en0", etc.). Perhaps like you, I've always assumed "en" was short for Ethernet, and perhaps it once was. However, wi-fi connections will show up as "en" interfaces too, at least on my Mac minis. If you use `ifconfig -v`, you'll see that it lists... |
12,562,405 | I am using the pagesrcoller demo and trying to make some changes.
```
<div class="pageScrollerNav topNav light">
<ul>
<li><img style="padding: 25px 145px 30px 0px" src="./images/logo_demo.png" height="25" /></li>
<li><a href="#">index</a></li>
<li><a href="#">item1</a></li>
<li>... | 2012/09/24 | [
"https://Stackoverflow.com/questions/12562405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1665381/"
] | Remove the space between **.active** & .**bloger** class.Write like this:
```
.topNav li.active.bloger a{....}
```
Instead of this:
```
.topNav li.active .bloger a{....}
``` | ***[Demo](http://tinkerbin.com/diAuhERC)***
Hi now
**replace**
```
.topNav li.active .bloger a
```
**into this**
```
.topNav .bloger a
```
***[Live demo](http://tinkerbin.com/diAuhERC)***
-----------------------------------------
-----------------------------------------
--------------------------------... |
12,562,405 | I am using the pagesrcoller demo and trying to make some changes.
```
<div class="pageScrollerNav topNav light">
<ul>
<li><img style="padding: 25px 145px 30px 0px" src="./images/logo_demo.png" height="25" /></li>
<li><a href="#">index</a></li>
<li><a href="#">item1</a></li>
<li>... | 2012/09/24 | [
"https://Stackoverflow.com/questions/12562405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1665381/"
] | Remove the space between **.active** & .**bloger** class.Write like this:
```
.topNav li.active.bloger a{....}
```
Instead of this:
```
.topNav li.active .bloger a{....}
``` | Editing multiple classes is simple.
All you have to do is delineate them with a comma!
Example:
HTML:
```
<div class='box1'></div>
<div class='box2'></div>
```
CSS:
```
.box1,.box2{
color:red;
}
``` |
4,966,990 | I configure my repo as */home/repo/gitrepo/myproj.git* on redmine.
Now, i want to clone it on my laptop but i cannot see the *url*
what url should i use? | 2011/02/11 | [
"https://Stackoverflow.com/questions/4966990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612722/"
] | If you're doing this for personal use, you could be well done with accessing your repository via ssh.
```
git clone repo@machine.address.com:gitrepo/myproj.git
```
However, you might want to search for a more powerful Redmine plugin for Git support, or use repository management system, such as [gitosis](http://scie.... | It is better to use some git repositories manager to do this, and I recommend to use [gitolite](https://github.com/sitaramc/gitolite) for small case, see guideline <http://progit.org/book/ch4-8.html>, then you can do as follow
1. mostly use git user to do git clone, so migrate /home/repo/gitrepo/myproj.git to /home/gi... |
4,966,990 | I configure my repo as */home/repo/gitrepo/myproj.git* on redmine.
Now, i want to clone it on my laptop but i cannot see the *url*
what url should i use? | 2011/02/11 | [
"https://Stackoverflow.com/questions/4966990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612722/"
] | If you're doing this for personal use, you could be well done with accessing your repository via ssh.
```
git clone repo@machine.address.com:gitrepo/myproj.git
```
However, you might want to search for a more powerful Redmine plugin for Git support, or use repository management system, such as [gitosis](http://scie.... | How to clone a git repository in windows ?
* Install git bash to the computer
* Open git bash command prompt
* Go to the correct folder location :
+ cd /F -> (for change to the F partition)
+ Using cd got to the location path :- Sunburst
+ Create folder :- mkdir Source
+ Type :- git clonehttps://integritas.git.be... |
4,966,990 | I configure my repo as */home/repo/gitrepo/myproj.git* on redmine.
Now, i want to clone it on my laptop but i cannot see the *url*
what url should i use? | 2011/02/11 | [
"https://Stackoverflow.com/questions/4966990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612722/"
] | It is better to use some git repositories manager to do this, and I recommend to use [gitolite](https://github.com/sitaramc/gitolite) for small case, see guideline <http://progit.org/book/ch4-8.html>, then you can do as follow
1. mostly use git user to do git clone, so migrate /home/repo/gitrepo/myproj.git to /home/gi... | How to clone a git repository in windows ?
* Install git bash to the computer
* Open git bash command prompt
* Go to the correct folder location :
+ cd /F -> (for change to the F partition)
+ Using cd got to the location path :- Sunburst
+ Create folder :- mkdir Source
+ Type :- git clonehttps://integritas.git.be... |
37,018,257 | I store the date in **UTC** long and displayed in user timezone. But when I try to store only days without time it misleading to different dates.
Eg: Scheduling event on 05/06/2016 (06 May 2016). This date is unique for all regions without timezone. If user from GMT+5:30 timezone trying to add a event on **05/06/2016... | 2016/05/04 | [
"https://Stackoverflow.com/questions/37018257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1507442/"
] | Java 8 provides the solution for your problem. If you can use Java 8, use [java.time.LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) which represents only the date without the time. Store the `long` value returned by [toEpochDay](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDa... | Always store the whole `timestap`.
Whenever you want to display just convert the timestamp to whichever timezone you want to convert it to & display it.
These would help in conversions: (Time-stamp to Date or viseversa)
```
// timestamp to Date
long timestamp = 5607059900000; //Example -> in ms
Date d = new Date(time... |
161,622 | It's a question (not hw) I bumped into few years back. Couldn't make any real progress with. Maybe you can help?
$$\frac{1}{\sqrt{4}+\sqrt{6}+\sqrt{9}}+\frac{1}{\sqrt{9}+\sqrt{12}+\sqrt{16}}+\frac{1}{\sqrt{16}+\sqrt{20}+\sqrt{25}}=?$$
Thanks. | 2012/06/22 | [
"https://math.stackexchange.com/questions/161622",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22409/"
] | The case of cube roots is probably more interesting than square roots; namely, simplifying
$$\frac{1}{\sqrt[3]{4}+\sqrt[3]{6}+\sqrt[3]{9}}+\frac{1}{\sqrt[3]{9}+\sqrt[3]{12}+\sqrt[3]{16}}+\frac{1}{\sqrt[3]{16}+\sqrt[3]{20}+\sqrt[3]{25}}. \tag{$\circ$}$$
To evaluate this, as sos440 did in the comments, one notes the ... | [Wolfram Alpha](http://www.wolframalpha.com/input/?i=%5Cfrac%7B1%7D%7B%5Csqrt%7B4%7D%2b%5Csqrt%7B6%7D%2b%5Csqrt%7B9%7D%7D%2b%5Cfrac%7B1%7D%7B%5Csqrt%7B9%7D%2b%5Csqrt%7B12%7D%2b%5Csqrt%7B16%7D%7D%2b%5Cfrac%7B1%7D%7B%5Csqrt%7B16%7D%2b%5Csqrt%7B20%7D%2b%5Csqrt%7B25%7D%7D "Wolfram Alpha") provides the alternative form
$$\... |
161,622 | It's a question (not hw) I bumped into few years back. Couldn't make any real progress with. Maybe you can help?
$$\frac{1}{\sqrt{4}+\sqrt{6}+\sqrt{9}}+\frac{1}{\sqrt{9}+\sqrt{12}+\sqrt{16}}+\frac{1}{\sqrt{16}+\sqrt{20}+\sqrt{25}}=?$$
Thanks. | 2012/06/22 | [
"https://math.stackexchange.com/questions/161622",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22409/"
] | The case of cube roots is probably more interesting than square roots; namely, simplifying
$$\frac{1}{\sqrt[3]{4}+\sqrt[3]{6}+\sqrt[3]{9}}+\frac{1}{\sqrt[3]{9}+\sqrt[3]{12}+\sqrt[3]{16}}+\frac{1}{\sqrt[3]{16}+\sqrt[3]{20}+\sqrt[3]{25}}. \tag{$\circ$}$$
To evaluate this, as sos440 did in the comments, one notes the ... | For your original question, it might be worth noting that
$$\frac{1}{\sqrt{k^2}+\sqrt{k(k+1)}+\sqrt{(k+1)^2}}=\frac{1}{2k+1+\sqrt{k(k+1)}}=\frac{2k+1-\sqrt{k(k+1)}}{4k^2+4k+1-k^2-k}=\frac{2k+1-\sqrt{k(k+1)}}{3k^2+3k+1}$$
Thus
$$\frac{1}{\sqrt{4}+\sqrt{6}+\sqrt{9}}+\frac{1}{\sqrt{9}+\sqrt{12}+\sqrt{16}}+\frac{1}{\sq... |
68,339,368 | I've been following this [tutorial](https://learn.microsoft.com/en-us/visualstudio/ide/how-to-create-multi-project-templates?view=vs-2019) of creating a multi-project template. It was successful, even if I am using a newer version (3, not 2).
The thing is, that I would like to have some projects in some folders. So wh... | 2021/07/11 | [
"https://Stackoverflow.com/questions/68339368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3383324/"
] | It is ultimately up to you what you prefer, however I highly recommend using the stripe-php library. It is at its core just an abstraction of cURL calls wrapped up with some quality of life functionality for you in an easy to use manner.
It also provides many features that you wouldn't get from cURL. For instance [aut... | This is their library and how to install it <https://stripe.com/docs/libraries>
Terminal:
>
> #Install the PHP library via Composer
>
>
>
```
composer require stripe/stripe-php
```
Then there are some usage examples here
<https://cartalyst.com/manual/stripe/2.0>
You shouldn't even be able to go around the API... |
24,989,155 | I was trying to create a link with the username on it (i.e. dynamic data), and couldn't manage to get the `StringResourceModel` to work with a `Link`.
My code looked something like:
Properties:
```
some.key=User name is: {0}
```
Java:
```
StringResourceModel model =
new StringResourceModel("some.key", this... | 2014/07/28 | [
"https://Stackoverflow.com/questions/24989155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3400481/"
] | The `model` parameter in the `Link` constructor isn't meant to be used as a display value. To set the text of the link you need to explicitly add a `Label` to it:
```
Link<Void> link = new Link<Void>("link");
link.add(new Label("label", model);
add(link);
```
and in HTML:
```
<a wicket:id="link"><span wicket:id="la... | In your first example, you aren't telling wicket to replace the text. You just apply a model to the link without telling wicket what to do with it.
To fix this, you'd need to replace your HTML with something along the lines of
```
<a wicket:id="someid"><wicket:message key="some.key">some text to replace</wicket:messa... |
66,093,154 | I have two files (Examples: A.txt and B.txt), where "A.txt" is very large. I would like to avoid reading the full file into memory, and read it line by line before merging those matching from "B.txt". Both files have headers as well.
My current code looks like this:
```
import os
import pandas as pd
contigs=pd.read_... | 2021/02/07 | [
"https://Stackoverflow.com/questions/66093154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159675/"
] | ```java
String timezone = "Africa/Lagos"; // "timezone":"Africa/Lagos"
long dt = 1612779720L; // "dt":1612779720
long sunriseTime = 1612763455L; // "sunrise":1612763455
long sunsetTime = 1612805901L; // "sunset":1612805901
double temp = 304.15D; // "temp":304.15 (in Kelvin).
SimpleDateFormat sdf = new SimpleDateFormat... | Just create a date object with that value as parameter:
```java
java.util.Date time=new java.util.Date(((long)timeStamp)*1000);
```
As java is expecting milliseconds as a parameter, you need to multiply your value (in seconds) by 1000. |
66,093,154 | I have two files (Examples: A.txt and B.txt), where "A.txt" is very large. I would like to avoid reading the full file into memory, and read it line by line before merging those matching from "B.txt". Both files have headers as well.
My current code looks like this:
```
import os
import pandas as pd
contigs=pd.read_... | 2021/02/07 | [
"https://Stackoverflow.com/questions/66093154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159675/"
] | It seems you need to obtain the right date patterns right from the information returned in the `WeatherResponse` and related classes.
For this purpose, you need to customize the Gson library you are using in your code to deserialize the information returned by the openweathermap API by Retrofit.
There are several way... | Just create a date object with that value as parameter:
```java
java.util.Date time=new java.util.Date(((long)timeStamp)*1000);
```
As java is expecting milliseconds as a parameter, you need to multiply your value (in seconds) by 1000. |
66,093,154 | I have two files (Examples: A.txt and B.txt), where "A.txt" is very large. I would like to avoid reading the full file into memory, and read it line by line before merging those matching from "B.txt". Both files have headers as well.
My current code looks like this:
```
import os
import pandas as pd
contigs=pd.read_... | 2021/02/07 | [
"https://Stackoverflow.com/questions/66093154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159675/"
] | ```java
String timezone = "Africa/Lagos"; // "timezone":"Africa/Lagos"
long dt = 1612779720L; // "dt":1612779720
long sunriseTime = 1612763455L; // "sunrise":1612763455
long sunsetTime = 1612805901L; // "sunset":1612805901
double temp = 304.15D; // "temp":304.15 (in Kelvin).
SimpleDateFormat sdf = new SimpleDateFormat... | You can use [`Instant#ofEpochSecond`](https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html#ofEpochSecond-long-) to get the `Instant` which you can convert into `ZonedDateTime` for the specified timezone ID and then format the obtained `ZonedDateTime` using `DateTimeFormatter`.
```
import java.time.Instant;... |
66,093,154 | I have two files (Examples: A.txt and B.txt), where "A.txt" is very large. I would like to avoid reading the full file into memory, and read it line by line before merging those matching from "B.txt". Both files have headers as well.
My current code looks like this:
```
import os
import pandas as pd
contigs=pd.read_... | 2021/02/07 | [
"https://Stackoverflow.com/questions/66093154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159675/"
] | It seems you need to obtain the right date patterns right from the information returned in the `WeatherResponse` and related classes.
For this purpose, you need to customize the Gson library you are using in your code to deserialize the information returned by the openweathermap API by Retrofit.
There are several way... | You can use [`Instant#ofEpochSecond`](https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html#ofEpochSecond-long-) to get the `Instant` which you can convert into `ZonedDateTime` for the specified timezone ID and then format the obtained `ZonedDateTime` using `DateTimeFormatter`.
```
import java.time.Instant;... |
66,093,154 | I have two files (Examples: A.txt and B.txt), where "A.txt" is very large. I would like to avoid reading the full file into memory, and read it line by line before merging those matching from "B.txt". Both files have headers as well.
My current code looks like this:
```
import os
import pandas as pd
contigs=pd.read_... | 2021/02/07 | [
"https://Stackoverflow.com/questions/66093154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159675/"
] | It seems you need to obtain the right date patterns right from the information returned in the `WeatherResponse` and related classes.
For this purpose, you need to customize the Gson library you are using in your code to deserialize the information returned by the openweathermap API by Retrofit.
There are several way... | ```java
String timezone = "Africa/Lagos"; // "timezone":"Africa/Lagos"
long dt = 1612779720L; // "dt":1612779720
long sunriseTime = 1612763455L; // "sunrise":1612763455
long sunsetTime = 1612805901L; // "sunset":1612805901
double temp = 304.15D; // "temp":304.15 (in Kelvin).
SimpleDateFormat sdf = new SimpleDateFormat... |
17,350,485 | I've done a great deal of research on how to workaround Wordpress's iframe restrictions and I've been able to get it to work using various plugins with common services (google maps, youtube, etc.). However, all of these methods have not worked for embedding one of my published webApps. My most recent efforts have been ... | 2013/06/27 | [
"https://Stackoverflow.com/questions/17350485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2088613/"
] | The [Inline Google Spreadsheet Viewer](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/), despite the name, is a plugin for WordPress that can embed the output of any public Google Apps Script Web App without an `iframe`. | The Inline Google Spreadsheet Viewer doesn't work for Webapp.
I think the only way to communicate with google app script from your own website is to use this solution :
<https://www.youtube.com/watch?v=JRGzVdliQOQ>
Take a look at this discussion :
<https://code.google.com/p/google-apps-script-issues/issues/detail?... |
17,350,485 | I've done a great deal of research on how to workaround Wordpress's iframe restrictions and I've been able to get it to work using various plugins with common services (google maps, youtube, etc.). However, all of these methods have not worked for embedding one of my published webApps. My most recent efforts have been ... | 2013/06/27 | [
"https://Stackoverflow.com/questions/17350485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2088613/"
] | To save others digging for this answer, it is possible by using `setXFrameOptionsMode`:
<https://developers.google.com/apps-script/reference/html/html-output#setxframeoptionsmodemode> | The [Inline Google Spreadsheet Viewer](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/), despite the name, is a plugin for WordPress that can embed the output of any public Google Apps Script Web App without an `iframe`. |
17,350,485 | I've done a great deal of research on how to workaround Wordpress's iframe restrictions and I've been able to get it to work using various plugins with common services (google maps, youtube, etc.). However, all of these methods have not worked for embedding one of my published webApps. My most recent efforts have been ... | 2013/06/27 | [
"https://Stackoverflow.com/questions/17350485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2088613/"
] | To save others digging for this answer, it is possible by using `setXFrameOptionsMode`:
<https://developers.google.com/apps-script/reference/html/html-output#setxframeoptionsmodemode> | The Inline Google Spreadsheet Viewer doesn't work for Webapp.
I think the only way to communicate with google app script from your own website is to use this solution :
<https://www.youtube.com/watch?v=JRGzVdliQOQ>
Take a look at this discussion :
<https://code.google.com/p/google-apps-script-issues/issues/detail?... |
8,310 | >
> Series **A** and **B** below can be viewed in two different ways to annulate an ethano-bridge onto four-, five-, and six-membered rings. Using the $\Delta\_\mathrm{f}H^\circ$ values given (in kcal/mol), how can one calculate the strain energy for each compound?
>
>
> ![2 different ways to annulate an ethano-brid... | 2014/02/06 | [
"https://chemistry.stackexchange.com/questions/8310",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/4445/"
] | Typically, ring strain energies (RSE) are calculated as the difference of the heat of formation of *cyclic* starting materials and *less cyclic* products in **homodesmic** reactions.
For cyclopropane, the RSE would be calculated using the following reaction:
$$\ce{(CH2)3 + 3 CH3-CH3 -> 3 CH3-CH2-CH3}$$ | I ran out of space in the comment...to the comment (user9596)...to Klaus' answer.
Klaus is right. The example with cyclopropane is certainly homodesmotic (HD2). In my opinion, this should now be called RC4 based on a new scheme in a 2009 paper by Wheeler Houk, Schleyer and Allen. You may reference <http://www.ncbi.nlm... |
15,528,836 | I'm new to programming and trying to simplify some jquery/javascript code but I'm not having much success. I tried to adapt the solution found here: [jQuery Simplify](https://stackoverflow.com/questions/11911551/jquery-simplify)
...but again, no success.
Here's my jquery code:
```
<script>
$(document).ready(function... | 2013/03/20 | [
"https://Stackoverflow.com/questions/15528836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2191612/"
] | I would change the HTML to this:
```
<button class="btn_hide" data-id="01">Hide</button>
<button class="btn_show" data-id="01">Show</button>
<button class="btn_hide" data-id="02">Hide</button>
<button class="btn_show" data-id="02">Show</button>
<p id="content01">Content 01</p>
<p id="content02">Content 02</p>
```
... | Well with jQuery you can stack selectors IE:
```
$("#hide01, #show01").click(function(){
$(".content01").hide();
});
```
But personally i would, rather than using ID's, use a class for this:
```
<button id="hide01" class="hide">Hide</button>
<button id="show01" class="show">Show</button>
<button id="hid... |
44,233,350 | I have a VSTO Outlook ribbon (context menu), which works as expected:
```
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<contextMenus>
<contextMenu idMso="ContextMenuMailItem">
<button id="DoThis"
label="Label"
... | 2017/05/29 | [
"https://Stackoverflow.com/questions/44233350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68936/"
] | Do not use both `label` and `getLabel`. Also, enable addin errors in `File | Options | Advanced | Developer` to see all ribbon XML errors. | Well, while writing the question, I tried removing the label attribute for the context menu using getLabel, and that does resolve the issue; context menu works fine after that. I (initially) thought it might make sense to keep label as a default.
The [documentation](https://msdn.microsoft.com/en-us/library/dd925416(v=... |
24,873,109 | Im new to ruby and I am currently learning classes.
If I were to have a class
```
class Book
private
def BookTitle
puts "this books title"
end
end
a = Book.new
a.BookTitle
```
`produces a NoMethodError`
Is the only way I can access class methods is with this line?
`attr_accessor :BookTitle` | 2014/07/21 | [
"https://Stackoverflow.com/questions/24873109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1815710/"
] | In your example, `BookTitle` is not defined as a class method.
To define a class method, you prefix the method name with `self.` (there are also other methods, though perhaps not worth worrying about for now). However, I think you are referring to instance methods rather than class methods.
You cannot directly call y... | your method is private, thus you can not access it in global scope (see this irb extract):
```
irb(main):001:0> class Book
irb(main):002:1> private
irb(main):003:1> def BookTitle
irb(main):004:2> puts "this books title"
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0>
irb(main):008:0* a = Bo... |
24,873,109 | Im new to ruby and I am currently learning classes.
If I were to have a class
```
class Book
private
def BookTitle
puts "this books title"
end
end
a = Book.new
a.BookTitle
```
`produces a NoMethodError`
Is the only way I can access class methods is with this line?
`attr_accessor :BookTitle` | 2014/07/21 | [
"https://Stackoverflow.com/questions/24873109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1815710/"
] | In your example, `BookTitle` is not defined as a class method.
To define a class method, you prefix the method name with `self.` (there are also other methods, though perhaps not worth worrying about for now). However, I think you are referring to instance methods rather than class methods.
You cannot directly call y... | You have set BookTitle to be a `private` method. A `private` method is one that can only be called within the class itself or by instances of the class (there are exceptions). If you take the `private` out, it should work.
Some side notes: Ruby convention has method names as lower-case, with words separated by unders... |
24,873,109 | Im new to ruby and I am currently learning classes.
If I were to have a class
```
class Book
private
def BookTitle
puts "this books title"
end
end
a = Book.new
a.BookTitle
```
`produces a NoMethodError`
Is the only way I can access class methods is with this line?
`attr_accessor :BookTitle` | 2014/07/21 | [
"https://Stackoverflow.com/questions/24873109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1815710/"
] | In your example, `BookTitle` is not defined as a class method.
To define a class method, you prefix the method name with `self.` (there are also other methods, though perhaps not worth worrying about for now). However, I think you are referring to instance methods rather than class methods.
You cannot directly call y... | You have set
```
private
```
on the second line which is what is preventing you from accessing this method. You could declare the method above the private line and it would be public. |
25,966,686 | I am trying to learn extjs 4.1 MVC. I have a controler with multiple ajax calls. When the code runs on Firefox I can see all the ajax calls are made but the alert of only one of the sucess method is coming up. While the data is available in view for all 4 calls. Any sugestions what I am doing wrong ?
Code below:
```
E... | 2014/09/22 | [
"https://Stackoverflow.com/questions/25966686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3113593/"
] | I would guess what's happening is ext only has a single instance of the MessageBox component and it is getting called four times...But you can only see the last one. If you just want some form of feedback I'd go with using console.log instead of Ext.Msg.alert. | just do it like this, put the next ajax request on success response
```
Ext.define('App.controller.StartupController', {
extend : 'Ext.app.Controller',
models : [ 'BasicModel' ],
stores : [ 'UserStore','RoleStore','RegionStore','ProductStore','FunctionStore' ],
views : [ 'FooterContainer', 'BodyContainer' ],
i... |
4,945,835 | I'm looking for an easy way to convert all variables and function names from lower\_case to upperCase in a java code. There's really a lot of code, refactoring the names one by one isn't a good idea.
It means that this function
```
public void create_table(String table_name)
{
int useless_var = 0;
useless_fu... | 2011/02/09 | [
"https://Stackoverflow.com/questions/4945835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/533552/"
] | You want the RouteInstances in the end? If so:
```
var query = DataContext.RoutingLocationHistory
.Where(rlh => rlh.RouteTakenTime >= new System.DateTime(2011,2,4)
&& rlh.RouteTakenTime <= new System.DateTime(2011,2,5))
.Select(rlh => rlh.RoutingLocation.RouteInstanceRule... | i tested a scenario like yours and got the same results
you may select many without join, sth like:
```
var query = from ri in RouteInstance
from rir in RouteInstanceRules
from rl in RoutingLocation
from rlh in RoutingLocationHistory
where ri.RouteIn... |
4,945,835 | I'm looking for an easy way to convert all variables and function names from lower\_case to upperCase in a java code. There's really a lot of code, refactoring the names one by one isn't a good idea.
It means that this function
```
public void create_table(String table_name)
{
int useless_var = 0;
useless_fu... | 2011/02/09 | [
"https://Stackoverflow.com/questions/4945835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/533552/"
] | i tested a scenario like yours and got the same results
you may select many without join, sth like:
```
var query = from ri in RouteInstance
from rir in RouteInstanceRules
from rl in RoutingLocation
from rlh in RoutingLocationHistory
where ri.RouteIn... | Check for associations in the dbml designer. If it noticed your foreign keys, it will create the associations automatically. If not - you can add them yourself (even when the foreign key does not exist or is not enforced).
By querying the association property, you can hide your relationship details.
```
query =
fro... |
4,945,835 | I'm looking for an easy way to convert all variables and function names from lower\_case to upperCase in a java code. There's really a lot of code, refactoring the names one by one isn't a good idea.
It means that this function
```
public void create_table(String table_name)
{
int useless_var = 0;
useless_fu... | 2011/02/09 | [
"https://Stackoverflow.com/questions/4945835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/533552/"
] | You want the RouteInstances in the end? If so:
```
var query = DataContext.RoutingLocationHistory
.Where(rlh => rlh.RouteTakenTime >= new System.DateTime(2011,2,4)
&& rlh.RouteTakenTime <= new System.DateTime(2011,2,5))
.Select(rlh => rlh.RoutingLocation.RouteInstanceRule... | Check for associations in the dbml designer. If it noticed your foreign keys, it will create the associations automatically. If not - you can add them yourself (even when the foreign key does not exist or is not enforced).
By querying the association property, you can hide your relationship details.
```
query =
fro... |
54,040,061 | I'm creating a Node JS script that needs to get all Git tags from the repository, along with the message and date the tag was created, and then save them as a entries in a JSON file. For example:
```
[{
"tag": "v1.1.0",
"message": "Add navigation",
"date": "Tue Oct 4 10:19:12 2018 +0100"
}, {
"tag": "v1.1.1",
... | 2019/01/04 | [
"https://Stackoverflow.com/questions/54040061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1261316/"
] | I think you not getting **form data** with `var postData = $(this).serialize()`.
Try like this `$("#create_delivery").serialize()`
If there is no `<input type="file">` in form don't use `enctype="multipart/form-data"`
```
$(document).ready(function(){
$("#create_delivery").submit(function(evt){
evt.preventDefault(... | Try these
```
$first_address = $_POST['first_address'];
$second_address = $_POST['second_address'];
$description = $_POST['description'];
$Weight = $_POST['weight'];
$price = $_POST['price'];
```
Instead of
```
$first_address= $this->input->post('first_address');
$second_address= $this->input->post('second_addre... |
54,040,061 | I'm creating a Node JS script that needs to get all Git tags from the repository, along with the message and date the tag was created, and then save them as a entries in a JSON file. For example:
```
[{
"tag": "v1.1.0",
"message": "Add navigation",
"date": "Tue Oct 4 10:19:12 2018 +0100"
}, {
"tag": "v1.1.1",
... | 2019/01/04 | [
"https://Stackoverflow.com/questions/54040061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1261316/"
] | I think you not getting **form data** with `var postData = $(this).serialize()`.
Try like this `$("#create_delivery").serialize()`
If there is no `<input type="file">` in form don't use `enctype="multipart/form-data"`
```
$(document).ready(function(){
$("#create_delivery").submit(function(evt){
evt.preventDefault(... | you need change 'type' to 'method'
```
$.ajax({
url: baseURL + "Trips/create_trip",
method:'POST',
data:postData,
dataType:'json',
success:function(data){
alert('Trip created');
}
});
``` |
54,040,061 | I'm creating a Node JS script that needs to get all Git tags from the repository, along with the message and date the tag was created, and then save them as a entries in a JSON file. For example:
```
[{
"tag": "v1.1.0",
"message": "Add navigation",
"date": "Tue Oct 4 10:19:12 2018 +0100"
}, {
"tag": "v1.1.1",
... | 2019/01/04 | [
"https://Stackoverflow.com/questions/54040061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1261316/"
] | I think you not getting **form data** with `var postData = $(this).serialize()`.
Try like this `$("#create_delivery").serialize()`
If there is no `<input type="file">` in form don't use `enctype="multipart/form-data"`
```
$(document).ready(function(){
$("#create_delivery").submit(function(evt){
evt.preventDefault(... | .serialize(); is used to create get method string ... if you want to post data use ajax change your js with
```
$("#create_delivery").submit(function(evt){
evt.preventDefault();
var first_address = $( "input[name='first_address']" ).val();
var second_address = $( "input[name='second_address']" ).val();
var weight =... |
51,244,688 | I would like to check the status of two log files using the below content.
```
SET/A WAITCNT=0
:WAIT
SET /a WAIT_TIME=%ADMIN_TIME%/%TIME_OUT%
IF %WAITCNT% GTR %WAIT_TIME% GOTO PROBLEM
SET/A WAITCNT=%WAITCNT%+1
TIMEOUT /T %TIME_OUT% /nobreak
FINDSTR /C:"<Running>" %HOME_1%\%LOG_FILE%
if... | 2018/07/09 | [
"https://Stackoverflow.com/questions/51244688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3413906/"
] | Your `PolstForm` class doesn't match your Json's structure.
I would've written it this way for example:
```
public class PolstForm
{
public int StatusCode { get; set; }
public CustomData[] Data { get; set; }
}
public class CustomData
{
public int MemberId {get;set;}
public int CreaterUserId {get;set;... | As you know,
the json String can't parse to a String data; [public string Data { get; set; }]
```
[
{
"MemberId":1,
"CreaterUserId":5,
"FirstName":"Saravanan",
"LastName":"Subramanian",
"Title":"Physician\u0019s Assistant",
"License":"A 123447",
"Email":"saravanan.radhamani@gmai... |
365,220 | The symbol (or whatever classifies it): | | 2016/12/26 | [
"https://english.stackexchange.com/questions/365220",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/212449/"
] | Its name is ***pipe*** or ***bar***. You can see the name of other special characters on the keyboard [here](http://coolefriend.com/productivity/know-names-of-symbols-in-your-computer-keyboard/). | It’s called ***pipe*** or ***vertical bar***.
You can find this detail [here](http://www.computerhope.com/keys.htm). |
365,220 | The symbol (or whatever classifies it): | | 2016/12/26 | [
"https://english.stackexchange.com/questions/365220",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/212449/"
] | Its name is ***pipe*** or ***bar***. You can see the name of other special characters on the keyboard [here](http://coolefriend.com/productivity/know-names-of-symbols-in-your-computer-keyboard/). | It's generically called a [bar](https://www.englishforums.com/content/resources/did-you-know-all-the-computer-keyboards-names-in-english.htm).
Some characters take special meaning in certain contexts. For instance /./ is traditionally called a *period*, but the use of *dot* came into fashion for websites. Similarly, t... |
365,220 | The symbol (or whatever classifies it): | | 2016/12/26 | [
"https://english.stackexchange.com/questions/365220",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/212449/"
] | It’s called ***pipe*** or ***vertical bar***.
You can find this detail [here](http://www.computerhope.com/keys.htm). | It's generically called a [bar](https://www.englishforums.com/content/resources/did-you-know-all-the-computer-keyboards-names-in-english.htm).
Some characters take special meaning in certain contexts. For instance /./ is traditionally called a *period*, but the use of *dot* came into fashion for websites. Similarly, t... |
446,487 | Is there a command line tool that will simply evaluate a cron expression and return a bool response if it is supposed to be running right now? I'm looking for something I can use as a utility in another bash script. Something like so:
```
run_script=$(/tools/evaluate-cron-expression "02 4 * * *")
if [ "$run_script" -e... | 2012/11/07 | [
"https://serverfault.com/questions/446487",
"https://serverfault.com",
"https://serverfault.com/users/129576/"
] | This looks like an attack by some malicious user (or infected PC or botnet or whatever) that is now trying to find out if your machine has public available proxy features. If you had a real open proxy running there, the attacker could successfully hide behind your IP address. Don't worry though, those scans are fully a... | It would be interesting to understand what Apache is doing in those cases – is it really acting as a proxy? If it is, you should disable that. You can find a similar case discussed in [this question](https://serverfault.com/questions/445499/apache2-return-404-for-proxy-requests-before-reaching-wsgi/445603#445603). |
66,913,167 | I've created a flask+react application deployed on Heroku and it was all working fine until I tried to add a database and tried to solve the circular import problem. Now, my structure is as below:
`api/__init__.py`
```
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
f... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66913167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14561622/"
] | You haven't specified the type of your lists, therefore they're inferred as a list of generic objects (`List<Object>`), not a list of people (`List<Person>`). Therefore the compiler doesn't know that any element you retrieve with `get()` is a `Person`, hence the `getColors()` method not being shown.
You should be decl... | try switching to the following:
```
ArrayList<Object> trySmthg = new ArrayList();
//loops through the first ArrayList
for(int h = 0; h < bioBook.getColors().size(); h++){ // get the fields where you have the
//arrayList of arraList
for(int g = 0; g < bi... |
66,913,167 | I've created a flask+react application deployed on Heroku and it was all working fine until I tried to add a database and tried to solve the circular import problem. Now, my structure is as below:
`api/__init__.py`
```
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
f... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66913167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14561622/"
] | You haven't specified the type of your lists, therefore they're inferred as a list of generic objects (`List<Object>`), not a list of people (`List<Person>`). Therefore the compiler doesn't know that any element you retrieve with `get()` is a `Person`, hence the `getColors()` method not being shown.
You should be decl... | Your array list does not have a type.
For example if I have:
ArrayList persons = new ArrayList<>()
I will be able to do persons.get(1).getName() |
66,913,167 | I've created a flask+react application deployed on Heroku and it was all working fine until I tried to add a database and tried to solve the circular import problem. Now, my structure is as below:
`api/__init__.py`
```
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
f... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66913167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14561622/"
] | You haven't specified the type of your lists, therefore they're inferred as a list of generic objects (`List<Object>`), not a list of people (`List<Person>`). Therefore the compiler doesn't know that any element you retrieve with `get()` is a `Person`, hence the `getColors()` method not being shown.
You should be decl... | Java sees ArrayList members as objects by default. You can either type cast them to the Person object, or define the type of object going into the ArrayList.
To specify an array list of the `Person` class:
```
ArrayList<Person> bioBook = new ArrayList<Person>();
```
Or alternatively, when you pull an object out of ... |
66,913,167 | I've created a flask+react application deployed on Heroku and it was all working fine until I tried to add a database and tried to solve the circular import problem. Now, my structure is as below:
`api/__init__.py`
```
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
f... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66913167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14561622/"
] | Java sees ArrayList members as objects by default. You can either type cast them to the Person object, or define the type of object going into the ArrayList.
To specify an array list of the `Person` class:
```
ArrayList<Person> bioBook = new ArrayList<Person>();
```
Or alternatively, when you pull an object out of ... | try switching to the following:
```
ArrayList<Object> trySmthg = new ArrayList();
//loops through the first ArrayList
for(int h = 0; h < bioBook.getColors().size(); h++){ // get the fields where you have the
//arrayList of arraList
for(int g = 0; g < bi... |
66,913,167 | I've created a flask+react application deployed on Heroku and it was all working fine until I tried to add a database and tried to solve the circular import problem. Now, my structure is as below:
`api/__init__.py`
```
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
f... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66913167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14561622/"
] | Java sees ArrayList members as objects by default. You can either type cast them to the Person object, or define the type of object going into the ArrayList.
To specify an array list of the `Person` class:
```
ArrayList<Person> bioBook = new ArrayList<Person>();
```
Or alternatively, when you pull an object out of ... | Your array list does not have a type.
For example if I have:
ArrayList persons = new ArrayList<>()
I will be able to do persons.get(1).getName() |
12,393,606 | I am very new to creating and manipulating databases and I seem to be stuck, my logcat keeps telling me that it cannot open the database?
>
> 09-12 13:02:31.823: I/SqliteDatabaseCpp(7213): sqlite returned: error code = 14, msg = cannot open file at line 27701 of [8609a15dfa], db=/data/data/net.learn2develop.Database... | 2012/09/12 | [
"https://Stackoverflow.com/questions/12393606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1552475/"
] | You should always post all of your Logcat errors, but I think I see the problem.
You have already opened the SQLiteDatabase behind the scenes in your DatabaseHelper constructor, now you want to access it. Try this:
```
public void openDataBase() throws SQLException{
myDataBase = getWritableDatabase();
}
```
--... | This is sample Databse Helper which i used, it works,
```
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Set;
import org.example.db.R;
import org.example.model.contact;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.... |
25,561,373 | I am using jsPlumb and form2js. There are input fields inside the shapes, my problem is I cannot get the data from these input fields.
This flowchart editor is based [here](https://stackoverflow.com/questions/20620719/save-and-load-jsplumb-flowchart-including-exact-anchors-and-connections)
This is the html for the di... | 2014/08/29 | [
"https://Stackoverflow.com/questions/25561373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3917058/"
] | Use `position: relative;` like this:
```
.underline:after {
content:"";
border-bottom: 1px dashed #ff0000;
display: block;
position: relative;
top: 2px;
}
``` | I'm not sure why you don't want to use box-shadow (unless its a browser problem) But it would solve the problem.
```
box-shadow: 0px 10px #888888;
.underline {
color: #444;
font-size: 250%;
box-shadow: 0px 10px 10px #888888;
display:inline-block;
border-bottom: 1px dashed #444;
}
```
hope this helps |
53,320,491 | I am quite new to Prolog and have had some trouble understanding it.
I have some facts named '**problem**' I wish to first print out these facts to the user and then ask them to input a value, this value is then read and used later.
From my understanding thus far, it would be best to use a forall to print out these fa... | 2018/11/15 | [
"https://Stackoverflow.com/questions/53320491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8924847/"
] | Note: This answer uses SWI-Prolog.
>
> How do I read in the input from the user regarding the problem?
>
>
>
You are doing that already with `read(X)`, however [read/1](http://www.swi-prolog.org/pldoc/man?predicate=read/1) reads terms (terms end with periods) and you probably want to read characters. If you are u... | The easiest to write out the facts of problem/1,
is to use the builtin listing/[0,1]. This builtin
accepts a so called predicate indicator. You can
write out the facts via:
```
?- listing(problem/1).
```
The predicate is supported by many Prolog systems
such as GNU Prolog, etc.. For how to read input see
for exampl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.