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 |
|---|---|---|---|---|---|
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | I am using this method (Works in IE9+), although it will not parse `<td>` or some other invalid direct childs of body:
```
function stringToEl(string) {
var parser = new DOMParser(),
content = 'text/html',
DOM = parser.parseFromString(string, content);
// return element
return DOM.body.chi... | Example with latest JS:
```
<template id="woof-sd-feature-box">
<div class="woof-sd-feature-box" data-key="__KEY__" data-title="__TITLE__" data-data="__OPTIONS__">
<h4>__TITLE__</h4>
<div class="woof-sd-form-item-anchor">
<img src="img/move.png" alt="">
</div>
</div>
</template>
<script>
create(e... |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | Use [insertAdjacentHTML()](https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML). It works with all current browsers, even with IE11.
```js
var mylist = document.getElementById('mylist');
mylist.insertAdjacentHTML('beforeend', '<li>third</li>');
```
```html
<ul id="mylist">
<li>first</li>
... | For certain html fragments like `<td>test</td>`, div.innerHTML, DOMParser.parseFromString and range.createContextualFragment (without the right context) solutions mentioned in other answers here, won't create the `<td>` element.
jQuery.parseHTML() handles them properly (I extracted [jQuery 2's parseHTML function into ... |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | Newer DOM implementations have [`range.createContextualFragment`](https://developer.mozilla.org/en/DOM/range.createContextualFragment), which does what you want in a framework-independent way.
It's widely supported. To be sure though, **check its compatibility** down in the same MDN link, as it will be changing. As of... | Here's my code, and it works:
```
function parseTableHtml(s) { // s is string
var div = document.createElement('table');
div.innerHTML = s;
var tr = div.getElementsByTagName('tr');
// ...
}
``` |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | Why don't do with native js?
```
var s="<span class='text-muted' style='font-size:.75em; position:absolute; bottom:3px; left:30px'>From <strong>Dan's Tools</strong></span>"
var e=document.createElement('div')
var r=document.createRange();
r.selectNodeContents(e)
var f=r.createContextualFragment(s);... | Here's my code, and it works:
```
function parseTableHtml(s) { // s is string
var div = document.createElement('table');
div.innerHTML = s;
var tr = div.getElementsByTagName('tr');
// ...
}
``` |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | HTML 5 introduced the `<template>` element which can be used for this purpose (as now described in the [WhatWG spec](https://html.spec.whatwg.org/multipage/scripting.html#the-template-element) and [MDN docs](https://developer.mozilla.org/en/docs/Web/HTML/Element/template)).
A `<template>` element is used to declare fr... | I am using this method (Works in IE9+), although it will not parse `<td>` or some other invalid direct childs of body:
```
function stringToEl(string) {
var parser = new DOMParser(),
content = 'text/html',
DOM = parser.parseFromString(string, content);
// return element
return DOM.body.chi... |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | No need for any tweak, you got a native API:
```
const toNodes = html =>
new DOMParser().parseFromString(html, 'text/html').body.childNodes[0]
``` | I've linked from this article.( [Converting HTML string into DOM elements?](https://stackoverflow.com/q/3103962/) )
For me, I want to find a way to convert a string into an HTML element. If you also have this need, you can try the following
```js
const frag = document.createRange().createContextualFragment(
`<a href=... |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | Why don't do with native js?
```
var s="<span class='text-muted' style='font-size:.75em; position:absolute; bottom:3px; left:30px'>From <strong>Dan's Tools</strong></span>"
var e=document.createElement('div')
var r=document.createRange();
r.selectNodeContents(e)
var f=r.createContextualFragment(s);... | Late but just as a note;
It's possible to add a trivial element to target element as a container and remove it after using.
// Tested on chrome 23.0, firefox 18.0, ie 7-8-9 and opera 12.11.
```
<div id="div"></div>
<script>
window.onload = function() {
var foo, targetElement = document.getElementById('div')
... |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | HTML 5 introduced the `<template>` element which can be used for this purpose (as now described in the [WhatWG spec](https://html.spec.whatwg.org/multipage/scripting.html#the-template-element) and [MDN docs](https://developer.mozilla.org/en/docs/Web/HTML/Element/template)).
A `<template>` element is used to declare fr... | **Solution** - works with all browsers since IE 4.0
```
var htmlString = `<body><header class="text-1">Hello World</header><div id="table"><!--TABLE HERE--></div></body>`;
var tableString = `<table class="table"><thead><tr><th>th cell</th></tr></thead><tbody><tr><td>td cell</td></tr></tbody></table>`;
var doc = docum... |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | You can create valid DOM nodes from a string using:
`document.createRange().createContextualFragment()`
The following example adds a button element in the page taking the markup from a string:
```js
let html = '<button type="button">Click Me!</button>';
let fragmentFromString = function (strHTML) {
return docume... | Fastest solution to render DOM from string:
```
let render = (relEl, tpl, parse = true) => {
if (!relEl) return;
const range = document.createRange();
range.selectNode(relEl);
const child = range.createContextualFragment(tpl);
return parse ? relEl.appendChild(child) : {relEl, el};
};
```
And [here](https:/... |
494,143 | I have an HTML string representing an element: `'<li>text</li>'`. I'd like to append it to an element in the DOM (a `ul` in my case). How can I do this with Prototype or with DOM methods?
(I know i could do this easily in jQuery, but unfortunately we're not using jQuery.) | 2009/01/30 | [
"https://Stackoverflow.com/questions/494143",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56829/"
] | For the heck of it I thought I'd share this over complicated but yet simple approach I came up with... Maybe someone will find something useful.
```
/*Creates a new element - By Jamin Szczesny*/
function _new(args){
ele = document.createElement(args.node);
delete args.node;
for(x in args){
if(type... | Example with latest JS:
```
<template id="woof-sd-feature-box">
<div class="woof-sd-feature-box" data-key="__KEY__" data-title="__TITLE__" data-data="__OPTIONS__">
<h4>__TITLE__</h4>
<div class="woof-sd-form-item-anchor">
<img src="img/move.png" alt="">
</div>
</div>
</template>
<script>
create(e... |
21,944,166 | In my ubuntu PC, and by python script, I need to get the default path of icon of specific file type.
as :
```
def get_icon_path(extenstion):
...
...
return icon_path
```
>
> get\_icon\_path("py")
>
>
> /usr/share/icons/Humanity/mimes/48/text-x-python.svg
>
>
>
N.B: I read this question, which ac... | 2014/02/21 | [
"https://Stackoverflow.com/questions/21944166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3231979/"
] | GNU/Linux desktop environments do not assign icons to filename suffixes (extensions). Rather, they assign icons to Internet media types (MIME types), and a file’s type may or may not be determined by its filename suffix (content sniffing may also be involved). You can use the [`mimetypes`](http://docs.python.org/2.7/li... | For GTK3, use
```
from gi.repository import Gtk, Gio
def get_icon_path(mimetype, size=32):
icon = Gio.content_type_get_icon(mimetype)
theme = Gtk.IconTheme.get_default()
info = theme.choose_icon(icon.get_names(), size, 0)
if info:
print(info.get_filename())
``` |
60,453,105 | ```
takeEveryNth :: [Int] -> Int -> [Int]
takeEveryNth g destination
| [] destination == []
| otherwise = [g !! destination] ++ takeEveryNth (drop (destination+1) g) destination
```
I keep getting the error message in the title for line 4 of this code ( | otherwise =…)
I have tried changing the indentation but ... | 2020/02/28 | [
"https://Stackoverflow.com/questions/60453105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12979649/"
] | The reason it doesn't work is because your first guard expression does not evaluate to a boolean expression where `=` follows.
I think this should do it:
```
takeEveryNth :: [Int] -> Int -> [Int]
takeEveryNth g destination
| length g <= destination = []
| otherwise = [g !! destination] ++ takeEveryNth (drop (de... | The reason that this does not work is because the parser expects a *singe* `=`, not a `==` for a guard. That being said, you use guards as if they are patterns. Guards work with expressions that have type `Bool`. So a guard like `| [] destination = ...` makes no sense.
You likely want to implement something like:
```... |
213,163 | I have an MSI laptop with an integrated webcam and I need the camera to function using Nox Player. I've read everywhere that the camera is supposed to work out of the box with Nox. However, it doesn't.
I installed BlueStacks to check and it worked with BlueStacks.
On Nox, whatever app I install, it acts as if there is... | 2019/06/02 | [
"https://android.stackexchange.com/questions/213163",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/297738/"
] | MEMU is suspect and is "not safe" to use in my experience, and my camera has sync issues with that emulator that messes up my apps and network settings.
My understanding is the latest NOX version uses Android 7. The webcam at this time is not supported.
That's all the info I can find on this. And sadly, BlueStacks re... | So I gave [MEMU](https://www.memuplay.com/) a try, and it has all Nox features + the camera works.
MEMU is an Android emulator very similar to Nox Player. Installation is straightforward, nothing special is needed, and the camera works out of the box. |
213,163 | I have an MSI laptop with an integrated webcam and I need the camera to function using Nox Player. I've read everywhere that the camera is supposed to work out of the box with Nox. However, it doesn't.
I installed BlueStacks to check and it worked with BlueStacks.
On Nox, whatever app I install, it acts as if there is... | 2019/06/02 | [
"https://android.stackexchange.com/questions/213163",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/297738/"
] | Install "CPU X" app on Nox, then go to "Camera" menu and back. that's all.
It may correct your problem. | So I gave [MEMU](https://www.memuplay.com/) a try, and it has all Nox features + the camera works.
MEMU is an Android emulator very similar to Nox Player. Installation is straightforward, nothing special is needed, and the camera works out of the box. |
213,163 | I have an MSI laptop with an integrated webcam and I need the camera to function using Nox Player. I've read everywhere that the camera is supposed to work out of the box with Nox. However, it doesn't.
I installed BlueStacks to check and it worked with BlueStacks.
On Nox, whatever app I install, it acts as if there is... | 2019/06/02 | [
"https://android.stackexchange.com/questions/213163",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/297738/"
] | You can try [ManyCam](https://manycam.com/). ManyCam comes with additioanly several features. For example: It can be reflect desktop screen in camera for Qr code read process. | So I gave [MEMU](https://www.memuplay.com/) a try, and it has all Nox features + the camera works.
MEMU is an Android emulator very similar to Nox Player. Installation is straightforward, nothing special is needed, and the camera works out of the box. |
213,163 | I have an MSI laptop with an integrated webcam and I need the camera to function using Nox Player. I've read everywhere that the camera is supposed to work out of the box with Nox. However, it doesn't.
I installed BlueStacks to check and it worked with BlueStacks.
On Nox, whatever app I install, it acts as if there is... | 2019/06/02 | [
"https://android.stackexchange.com/questions/213163",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/297738/"
] | MEMU is suspect and is "not safe" to use in my experience, and my camera has sync issues with that emulator that messes up my apps and network settings.
My understanding is the latest NOX version uses Android 7. The webcam at this time is not supported.
That's all the info I can find on this. And sadly, BlueStacks re... | Install "CPU X" app on Nox, then go to "Camera" menu and back. that's all.
It may correct your problem. |
213,163 | I have an MSI laptop with an integrated webcam and I need the camera to function using Nox Player. I've read everywhere that the camera is supposed to work out of the box with Nox. However, it doesn't.
I installed BlueStacks to check and it worked with BlueStacks.
On Nox, whatever app I install, it acts as if there is... | 2019/06/02 | [
"https://android.stackexchange.com/questions/213163",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/297738/"
] | MEMU is suspect and is "not safe" to use in my experience, and my camera has sync issues with that emulator that messes up my apps and network settings.
My understanding is the latest NOX version uses Android 7. The webcam at this time is not supported.
That's all the info I can find on this. And sadly, BlueStacks re... | You can try [ManyCam](https://manycam.com/). ManyCam comes with additioanly several features. For example: It can be reflect desktop screen in camera for Qr code read process. |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | No we dont unfortunately..........
You can do: Ctrl + K, Crtl + C
To uncomment ctrl+k ctrl+u | you can do on all visual studio version ..
```
#Region "mycomment"
'comment line1
'comment line2
#End Region
```
you will be able to hide and show the entire block
[](https://i.stack.imgur.com/EowKQ.png) |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | Not possible.
Write your chunk, select it and press Ctrl+K, Ctrl+C to comment it.
But it doesn't always matter as often you use ''' in front of a method or property to describe it. Then it will automatically create the comments for you. | you can do on all visual studio version ..
```
#Region "mycomment"
'comment line1
'comment line2
#End Region
```
you will be able to hide and show the entire block
[](https://i.stack.imgur.com/EowKQ.png) |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | No we dont unfortunately..........
You can do: Ctrl + K, Crtl + C
To uncomment ctrl+k ctrl+u | Only single-line comments are possible in VB, unlike C/C++ and it's derivatives (Java, JavaScript, C#, etc.). You can use the apostrophe " ' " or REM (remark) for comments like this:
```
Sub Main()
' This is a comment
REM This is also a comment
End Sub
```
But there is no multi-line comment operator... |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | In Visual Basic .Net 2008 and 2010, I use the following C++ Workaround.
`#If AFAC Then`
`#End if`
For english speaking AFAC = "à effacer" = "to delete"
I alreay use `#If COMMENT` or `#If TODO`
The **#if COMMENT then** solution is more power than the C++/Java/C# `/* text */` solution because it is possible to imbri... | Just hold "alt"+"shift" and move cursor up or down to select lines, and press " ' " |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | In Visual Basic .Net 2008 and 2010, I use the following C++ Workaround.
`#If AFAC Then`
`#End if`
For english speaking AFAC = "à effacer" = "to delete"
I alreay use `#If COMMENT` or `#If TODO`
The **#if COMMENT then** solution is more power than the C++/Java/C# `/* text */` solution because it is possible to imbri... | Only single-line comments are possible in VB, unlike C/C++ and it's derivatives (Java, JavaScript, C#, etc.). You can use the apostrophe " ' " or REM (remark) for comments like this:
```
Sub Main()
' This is a comment
REM This is also a comment
End Sub
```
But there is no multi-line comment operator... |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | In Visual Basic .Net 2008 and 2010, I use the following C++ Workaround.
`#If AFAC Then`
`#End if`
For english speaking AFAC = "à effacer" = "to delete"
I alreay use `#If COMMENT` or `#If TODO`
The **#if COMMENT then** solution is more power than the C++/Java/C# `/* text */` solution because it is possible to imbri... | Not possible.
Write your chunk, select it and press Ctrl+K, Ctrl+C to comment it.
But it doesn't always matter as often you use ''' in front of a method or property to describe it. Then it will automatically create the comments for you. |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | No we dont unfortunately..........
You can do: Ctrl + K, Crtl + C
To uncomment ctrl+k ctrl+u | Not possible.
Write your chunk, select it and press Ctrl+K, Ctrl+C to comment it.
But it doesn't always matter as often you use ''' in front of a method or property to describe it. Then it will automatically create the comments for you. |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | No we dont unfortunately..........
You can do: Ctrl + K, Crtl + C
To uncomment ctrl+k ctrl+u | Just hold "alt"+"shift" and move cursor up or down to select lines, and press " ' " |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | Not possible.
Write your chunk, select it and press Ctrl+K, Ctrl+C to comment it.
But it doesn't always matter as often you use ''' in front of a method or property to describe it. Then it will automatically create the comments for you. | Only single-line comments are possible in VB, unlike C/C++ and it's derivatives (Java, JavaScript, C#, etc.). You can use the apostrophe " ' " or REM (remark) for comments like this:
```
Sub Main()
' This is a comment
REM This is also a comment
End Sub
```
But there is no multi-line comment operator... |
5,083,248 | I have an asp.net site whose target framework is currently 2.0. I've recently moved it all to 4.0. Asp.net impersonation & Windows authentication is set to true. Its on a new app pool targeting the 4.0 framework using the same identity as the old app pool (NetworkService). When I browse to the migrated site I see a HTT... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67545/"
] | Just hold "alt"+"shift" and move cursor up or down to select lines, and press " ' " | Not possible.
Write your chunk, select it and press Ctrl+K, Ctrl+C to comment it.
But it doesn't always matter as often you use ''' in front of a method or property to describe it. Then it will automatically create the comments for you. |
5,345,310 | I have an aspx page and UserControl [ it contains a button,textbox ]
and userControl is added onto aspx page
So When i click button in aspx page it should make a Jquery ajax call to the Controller to open a dialog .
how can i do this....in this we have to make a call to controller | 2011/03/17 | [
"https://Stackoverflow.com/questions/5345310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/646751/"
] | It's pretty easy
- you create a partialview that will be the actual dialog content (let's call it MyDialogPV)
- you create a method in the controller that returns the PartialView (GetMyDialogPV)
- you use ajax to call the PartialView and render it at runtime as a dialog (in the example I use the JqueryUI plugin).
Cont... | Will this help you?
[How to open a partial view by using jquery modal popup in asp.net MVC?](https://stackoverflow.com/questions/1554542/how-to-open-a-partial-view-by-using-jquery-modal-popup-in-asp-net-mvc) |
29,461,420 | I'm going through the Lynda.com course "Ruby on Rails 4 Essential Training". It uses the creation of a simple CMS to teach the framework. In this CMS, users can create `Subjects` and `Pages`. Each `Subject` has many `Pages`. When clicking a link to view the pages that belong to a particular subject, it passes the subje... | 2015/04/05 | [
"https://Stackoverflow.com/questions/29461420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/411954/"
] | It depends first whether you need both the @subject and the @pages object. You are right that your proposal is more performant, now this may or may not make a real difference for your user - you'll need profiling to be sure.
Finally, it is possible to make a slight change to the tutorial code to make it as performant ... | If you dont want your @subject or basically the subject record, there is not need to use former, you can directly access pages with what you have written in your later approach. |
69,345,267 | I want to make a long press on an item in the recyclerview and have the two options "Edit Data" and "Delete data" appear.
I have the code below already written but I don't understand how it works.
The error appears in `View.OnLongClickListener()`
Error: `Class 'Anonymous class derived from OnLongClickListener' must e... | 2021/09/27 | [
"https://Stackoverflow.com/questions/69345267",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12380167/"
] | ```
Class 'Anonymous class derived from OnLongClickListener' must either be declared abstract or implement abstract method 'onLongClick(View)' in 'OnLongClickListener
```
`View.OnLongClickListener` must need to override `onLongClick` for a long click to work. You are overriding `onItemClick` which is not an abstract ... | Please don't use onLongClickListener directly on recycler view. Use callback from the adapter and implement it in activity. I think this will definitely work.
Put this code in adapter and use it while item long press :
```
interface OnItemLongClickListener {
fun onItemLongClick(position: Int)
}
```
imp... |
17,729,355 | I am currently running an MVC application written with C#/Razor. Thus far it is quite simple - I have a database created, and am cycling through it to print all of the values. If the user is an admin or if domain account of the user equals the name in the database, then they may edit that row in the database.
When I r... | 2013/07/18 | [
"https://Stackoverflow.com/questions/17729355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/963156/"
] | Hope this pic explain everything. The data is generated by [bandwidthTest](http://docs.nvidia.com/cuda/cuda-samples/#bandwidth-test) in CUDA samples. The hardware environment is PCI-E v2.0, Tesla M2090 and 2x Xeon E5-2609. Please note both axises are in log scale.
Given this figure, we can see that the overhead of lau... | The [latency plot](https://i.stack.imgur.com/C7YqG.jpg) would be more clear in this case. Small transactions aren't more expensive than big ones. The only problem with them is that they can't saturate the bus. Therefore it's possible to transfer bigger messages at almost the same time. That is why transferring one 512 ... |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | Great couple of software to install to get a fully functional PiP feature in OSX from a Chrome browser :
* install [Helium](http://heliumfloats.com) or [HeliumLift](https://itunes.apple.com/us/app/heliumlift/id1018899653?mt=12)
* install Chrome extension :
[Open in Helium](https://chrome.google.com/webstore/detail/ope... | For Chrome and Firefox you need to install a plugin which you can find by search on the store.
**Chrome**
<https://chrome.google.com/webstore/detail/picture-in-picture-viewer/efaagmolahogmekmnmkigonhfcdiemnl>
**Firefox**
<https://addons.mozilla.org/en-GB/firefox/addon/pip-picture-in-picture-video-f/> |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | To be clear, the answer to the OP's question is that **no, you cannot use macOS' native PiP mode in any browser other than Safari**.
I wish there were some way around that, as I love using the Video Speed Controller Chrome extension to 2x videos. I use this dozens of times a day. But I also love Safari's PiP feature. ... | For Chrome and Firefox you need to install a plugin which you can find by search on the store.
**Chrome**
<https://chrome.google.com/webstore/detail/picture-in-picture-viewer/efaagmolahogmekmnmkigonhfcdiemnl>
**Firefox**
<https://addons.mozilla.org/en-GB/firefox/addon/pip-picture-in-picture-video-f/> |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | To be clear, the answer to the OP's question is that **no, you cannot use macOS' native PiP mode in any browser other than Safari**.
I wish there were some way around that, as I love using the Video Speed Controller Chrome extension to 2x videos. I use this dozens of times a day. But I also love Safari's PiP feature. ... | **Update** : there is a new nice official *google extension for PIP in Chrome* : <https://chrome.google.com/webstore/detail/picture-in-picture-extens/hkgfoiooedgoejojocmhlaklaeopbecg>
Personally, I am using both : the Helium extension for its transparent feature and the Google extension for its speed. |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | Great couple of software to install to get a fully functional PiP feature in OSX from a Chrome browser :
* install [Helium](http://heliumfloats.com) or [HeliumLift](https://itunes.apple.com/us/app/heliumlift/id1018899653?mt=12)
* install Chrome extension :
[Open in Helium](https://chrome.google.com/webstore/detail/ope... | To be clear, the answer to the OP's question is that **no, you cannot use macOS' native PiP mode in any browser other than Safari**.
I wish there were some way around that, as I love using the Video Speed Controller Chrome extension to 2x videos. I use this dozens of times a day. But I also love Safari's PiP feature. ... |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | Picture in Picture for macOS: <https://itunes.apple.com/ru/app/picture-in-picture-floating/id1099477261> | For Chrome and Firefox you need to install a plugin which you can find by search on the store.
**Chrome**
<https://chrome.google.com/webstore/detail/picture-in-picture-viewer/efaagmolahogmekmnmkigonhfcdiemnl>
**Firefox**
<https://addons.mozilla.org/en-GB/firefox/addon/pip-picture-in-picture-video-f/> |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | Great couple of software to install to get a fully functional PiP feature in OSX from a Chrome browser :
* install [Helium](http://heliumfloats.com) or [HeliumLift](https://itunes.apple.com/us/app/heliumlift/id1018899653?mt=12)
* install Chrome extension :
[Open in Helium](https://chrome.google.com/webstore/detail/ope... | **Update** : there is a new nice official *google extension for PIP in Chrome* : <https://chrome.google.com/webstore/detail/picture-in-picture-extens/hkgfoiooedgoejojocmhlaklaeopbecg>
Personally, I am using both : the Helium extension for its transparent feature and the Google extension for its speed. |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | To be clear, the answer to the OP's question is that **no, you cannot use macOS' native PiP mode in any browser other than Safari**.
I wish there were some way around that, as I love using the Video Speed Controller Chrome extension to 2x videos. I use this dozens of times a day. But I also love Safari's PiP feature. ... | Picture in Picture for macOS: <https://itunes.apple.com/ru/app/picture-in-picture-floating/id1099477261> |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | Great couple of software to install to get a fully functional PiP feature in OSX from a Chrome browser :
* install [Helium](http://heliumfloats.com) or [HeliumLift](https://itunes.apple.com/us/app/heliumlift/id1018899653?mt=12)
* install Chrome extension :
[Open in Helium](https://chrome.google.com/webstore/detail/ope... | Chrome 69 now natively supports PiP [here.](https://9to5google.com/2018/09/04/google-chrome-69-mac-windows-stable-release/) |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | Chrome 69 now natively supports PiP [here.](https://9to5google.com/2018/09/04/google-chrome-69-mac-windows-stable-release/) | Picture in Picture for macOS: <https://itunes.apple.com/ru/app/picture-in-picture-floating/id1099477261> |
254,701 | Is is possible to use the new macOS Sierra PiP (Picture-in-Picture) feature in browsers other than Safari?

*Nope?* | 2016/09/26 | [
"https://apple.stackexchange.com/questions/254701",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/97009/"
] | Picture in Picture for macOS: <https://itunes.apple.com/ru/app/picture-in-picture-floating/id1099477261> | **Update** : there is a new nice official *google extension for PIP in Chrome* : <https://chrome.google.com/webstore/detail/picture-in-picture-extens/hkgfoiooedgoejojocmhlaklaeopbecg>
Personally, I am using both : the Helium extension for its transparent feature and the Google extension for its speed. |
13,005,958 | I'm pretty new at MySQL and database structure and I was wondering if anyone could help with the best way to design this database. The application is essentially an online exercise book. It will have exercises for students to complete and have the results stored in the database.
A Parent will be able to view their chi... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13005958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1712587/"
] | I have created a schema for this:-
```
DROP TABLE IF EXISTS `class`;
CREATE TABLE `class` (
`class_id` int(11) NOT NULL AUTO_INCREMENT,
`class_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`class_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
/*Data for the table `class` */
insert into `class`... | Things are much easier, if you look at your application from another angle.
First of all, there's user entity, which provides all that authorisation functions, if user must have different functions — you better make different type of users:
```
Users:
id (int)
user_type_id int
username varchar
password ... |
145,264 | How do you log out in the most recent version of Ubuntu from a local terminal? | 2010/05/25 | [
"https://superuser.com/questions/145264",
"https://superuser.com",
"https://superuser.com/users/68921/"
] | I use this:
```
gnome-session-save --logout-dialog
``` | `sudo /etc/init.d/gdm stop`
or `restart` if you want to log in as a different user:
`sudo /etc/init.d/gdm restart` |
4,487,727 | What is the difference between using the term ‘determined’ vs ‘uniquely determined’? The definition supplied by Google is
Mathematics: Specify the value, position, or form of (a mathematical or geometric object) **uniquely**.
It seems as though the uniqueness is built into the definition of the word determined, howev... | 2022/07/07 | [
"https://math.stackexchange.com/questions/4487727",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/899012/"
] | This terminology just means there is a choice of possible solutions.
For example, the angle $\theta$ is determined by $\sin\theta = 0$ to be $n\pi$, where $n$ is an arbitrary constant, but the angle $\theta$ is **uniquely determined** by $\sin\theta=0$ and $-\pi<\theta<\pi$ to be $0$. The integral $\int x^2=\frac13 x^... | The number $i$ is determined by the equation $i^2 = -1$, but it is *not* uniquely determined. Indeed, $-i$ is another root.
The importance of the word "uniquely" is that it guarantees we can define a function associating to each input the *unique* object determined by some relation. In the reals for instance, for ever... |
46,956,284 | I start investigating BotFramework and encountered one annoying issue.
1. Created "Hello world" bot.
Here if the code
```
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity.Type == ActivityTypes.Message)
{
ConnectorClient connector = new ConnectorClient(new Uri... | 2017/10/26 | [
"https://Stackoverflow.com/questions/46956284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/774416/"
] | I assume you already followed the steps in <https://learn.microsoft.com/en-us/bot-framework/deploy-dotnet-bot-visual-studio> for deployment to Azure.
Have you seen this <https://learn.microsoft.com/en-us/bot-framework/debug-bots-emulator> with regards to debugging remotely using ngrok?
If you are using Visual Studio,... | Internal server error generally means there is some sort of issue with your code. Try debugging locally using [ngrok](https://ngrok.com/download). You can change your endpoint in the [dev portal](https://dev.botframework.com/bots/settings?id=IhorAndriyBohdanIhor) to the one that ngrok generates when you use this comman... |
23,260 | I've a Commerce store with orders dating back to September and have the following in my config:
```
'purgeInactiveCarts' => true,
'purgeInactiveCartsDuration' => 'P1M',
```
The docs say that the purging should be triggered by me visiting the Inactive carts area of the Commerce order section, but it isn't. Does anyon... | 2017/12/20 | [
"https://craftcms.stackexchange.com/questions/23260",
"https://craftcms.stackexchange.com",
"https://craftcms.stackexchange.com/users/167/"
] | The mistake was not reading the docs properly and putting the config values in general.php. Instead, I needed to create a commerce.php config file and put the values in that. As soon as I did, the orders were purged. | >
> 1. The trigger is time limited, e.g. is only called once a day?
>
>
>
Nope. That logic runs every time the order index page is loaded.
>
> 2. There are any known issues with the purging of inactive carts?
>
>
>
Nothing I'm aware of.
>
> 3. Anything else I could look at?
>
>
>
Here's the method and ... |
22,782,419 | I want to represent two time series with Highcharts. My problem is that one has large values and the other one low values. When I plot them together, the one with low values appear as a straight line. I want to be able to plot them with two different scales, but find it impossible to do it. I put what I already have he... | 2014/04/01 | [
"https://Stackoverflow.com/questions/22782419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/767760/"
] | You can use to yAxis, like in the example
```
yAxis:[{
},{
opposite:true
}],
```
<http://jsfiddle.net/S2uyp/1/> | As the difference between high values and low values is very high so the chart is looking like this but if you try with the following values then you will see that the chart looks good
```
$(function() {
$('#container').highcharts('StockChart', {
rangeSelector : {
selected : 1,
inputEnabled: $('#container').wi... |
22,782,419 | I want to represent two time series with Highcharts. My problem is that one has large values and the other one low values. When I plot them together, the one with low values appear as a straight line. I want to be able to plot them with two different scales, but find it impossible to do it. I put what I already have he... | 2014/04/01 | [
"https://Stackoverflow.com/questions/22782419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/767760/"
] | You can use to yAxis, like in the example
```
yAxis:[{
},{
opposite:true
}],
```
<http://jsfiddle.net/S2uyp/1/> | [this](http://www.highcharts.com/demo/combo-multi-axes) is exactly what you want I guess. |
22,782,419 | I want to represent two time series with Highcharts. My problem is that one has large values and the other one low values. When I plot them together, the one with low values appear as a straight line. I want to be able to plot them with two different scales, but find it impossible to do it. I put what I already have he... | 2014/04/01 | [
"https://Stackoverflow.com/questions/22782419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/767760/"
] | You can use to yAxis, like in the example
```
yAxis:[{
},{
opposite:true
}],
```
<http://jsfiddle.net/S2uyp/1/> | Since you have an answer telling you how to accomplish specifically what you asked, let me add one that addresses the issue more fundamentally.
This is a classic example of when what you really need is two separate charts (generally, aligned vertically one above the other works best for line charts, where they can wor... |
28,937,288 | I am updating a record in `Sqlite` database through the function given below.Their is only 1 Table and a number of columns.Initially i am updating 3 columns. Problem i am facing :
1) The Problem is that in `Logcat` initial data is shown but updated data is not showing. Also `Logcat` not showing any error.
2) When i a... | 2015/03/09 | [
"https://Stackoverflow.com/questions/28937288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3519331/"
] | You can do
```
for output in /home/myComputer/Desktop/*
do
echo $output
done
```
If there's any risk that `/home/myComputer/Desktop` is empty, please follow @JIDs advice in the comments below. | The next solution also works when the dir is empty.
```
ls /home/myComputer/Desktop/ 2>/dev/null |while read -r output; do
echo ${output}
done
```
This construction is nice to know, for when you want to split the input lines in some fields:
```
cat someFile | while read -r field1 field2 remainingfields; do
``` |
24,755,103 | If we pass null pointer in ioctl from user space to kernel space what will happen? how to handle this scenario?
I am expecting the solution would be using copy\_to\_user/copy\_from\_user on the pointer which performs a check on pointer to be valid or not. I want to know whether am I right.
Any further inputs would b... | 2014/07/15 | [
"https://Stackoverflow.com/questions/24755103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3737133/"
] | The null pointer can be a completely valid virtual address (user-space) as far as the kernel is concerned. Consider that the page at address zero can be `mmap()`ed with:
```
mmap(NULL, sysconf(_SC_PAGE_SIZE), PROT_READ | PROT_WRITE, MAP_FIXED, fd, 0);
```
as the superuser.
You should handle NULL pointers in the use... | Yes, copy\_from\_user / copy\_to\_user is the right way to handle this. If the pointer you're given is not valid, a non-zero return will result (at which point, the kernel code should be returning EFAULT [actually usually -EFAULT]).
A null value isn't typically used as a valid pointer in either kernel mode or user mo... |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | This error **happens on your side** and NOT the other side. If the other side reset the connection, then the exception message should say:
```
java.net.SocketException reset by peer
```
The cause is the connection inside `HttpClient` is stale. Check stale connection for SSL does not fix this error. Solution: dump yo... | I know this thread is little old, but would like to add my 2 cents.
We had the same "connection reset" error right after our one of the releases.
The root cause was, our `apache` server was brought down for deployment. All our third party traffic goes thru `apache` and we were getting connection reset error because o... |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | This is an old thread, but I ran into `java.net.SocketException: Connection reset` yesterday.
The server-side application had its throttling settings changed to allow only 1 connection at a time! Thus, sometimes calls went through and sometimes not. I solved the problem by changing the throttling settings. | I was getting this error because the port I tried to connect to was closed. |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | I get this error all the time and consider it normal.
It happens when one side tries to read when the other side has already hung up. Thus **depending on the protocol this may or may not designate a problem**.
If my client code specifically indicates to the server that it is going to hang up, then both client and serv... | FWIW, I was getting this error when I was accidentally making a GET request to an endpoint that was expecting a POST request. Presumably that was just that particular servers way of handling the problem. |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | I did also stumble upon this error. In my case the problem was I was using JRE6, with support for [TLS1.0](https://stackoverflow.com/questions/10500511/how-to-find-what-ssl-tls-version-is-used-in-java). The server only supported TLS1.2, so this error was thrown. | This is an old thread, but I ran into `java.net.SocketException: Connection reset` yesterday.
The server-side application had its throttling settings changed to allow only 1 connection at a time! Thus, sometimes calls went through and sometimes not. I solved the problem by changing the throttling settings. |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | The javadoc for SocketException states that it is
>
> Thrown to indicate that there is an error in the underlying protocol such as a TCP error
>
>
>
In your case it seems that the connection has been closed by the server end of the connection. This could be an issue with the request you are sending or an issue at... | In my case, this was because my Tomcat was set with an insufficient `maxHttpHeaderSize` for a particularly complicated SOLR query.
Hope this helps someone out there! |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | I did also stumble upon this error. In my case the problem was I was using JRE6, with support for [TLS1.0](https://stackoverflow.com/questions/10500511/how-to-find-what-ssl-tls-version-is-used-in-java). The server only supported TLS1.2, so this error was thrown. | FWIW, I was getting this error when I was accidentally making a GET request to an endpoint that was expecting a POST request. Presumably that was just that particular servers way of handling the problem. |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | The javadoc for SocketException states that it is
>
> Thrown to indicate that there is an error in the underlying protocol such as a TCP error
>
>
>
In your case it seems that the connection has been closed by the server end of the connection. This could be an issue with the request you are sending or an issue at... | FWIW, I was getting this error when I was accidentally making a GET request to an endpoint that was expecting a POST request. Presumably that was just that particular servers way of handling the problem. |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | I got this error when the text file I was trying to read contained a string that matched an antivirus signature on our firewall. | I was getting this error because the port I tried to connect to was closed. |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | If you experience this trying to access Web services deployed on a Glassfish3 server, you might want to tune your http-thread-pool settings. That fixed SocketExceptions we had when many concurrent threads was calling the web service.
1. Go to admin console
2. Navigate to "Configurations"->"Server config"->"Thread pool... | In my case, this was because my Tomcat was set with an insufficient `maxHttpHeaderSize` for a particularly complicated SOLR query.
Hope this helps someone out there! |
585,599 | We are seeing frequent but intermittent `java.net.SocketException: Connection reset` errors in our logs. We are unsure as to where the `Connection reset` error is actually coming from, and how to go about debugging.
The issue appears to be unrelated to the messages we are attempting to send.
Note that the message is *... | 2009/02/25 | [
"https://Stackoverflow.com/questions/585599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39709/"
] | If you experience this trying to access Web services deployed on a Glassfish3 server, you might want to tune your http-thread-pool settings. That fixed SocketExceptions we had when many concurrent threads was calling the web service.
1. Go to admin console
2. Navigate to "Configurations"->"Server config"->"Thread pool... | I get this error all the time and consider it normal.
It happens when one side tries to read when the other side has already hung up. Thus **depending on the protocol this may or may not designate a problem**.
If my client code specifically indicates to the server that it is going to hang up, then both client and serv... |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | I would go for the **jsonlite** package in combination with the usage of **mapply**, a **transformation function** and data.table's **rbindlist**.
```
# data
raw_df <- data.frame(id = 1:2, json = c('{"user": "xyz2", "weightmap": {"P1":100,"P2":0}, "domains": ["a2","b2"]}', '{"user": "xyz1", "weightmap": {"P1":0,"P2":... | Could not get the flatten parameter to work as I expected so needed to unlist and then "re-list" before rbinding with do.call:
```
library(jsonlite)
do.call( rbind,
lapply(raw_df$json,
function(j) as.list(unlist(fromJSON(j, flatten=TRUE)))
) )
user weightmap.P1 weigh... |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | Here's a tidyverse solution (also using jsonlite) if you're happy to work in a long format (for `domains` in this case):
```
library(jsonlite)
library(dplyr)
library(purrr)
library(tidyr)
d <- data.frame(
id = c(1, 2),
json = c(
'{"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]}',
'{"u... | I would go for the **jsonlite** package in combination with the usage of **mapply**, a **transformation function** and data.table's **rbindlist**.
```
# data
raw_df <- data.frame(id = 1:2, json = c('{"user": "xyz2", "weightmap": {"P1":100,"P2":0}, "domains": ["a2","b2"]}', '{"user": "xyz1", "weightmap": {"P1":0,"P2":... |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | I would go for the **jsonlite** package in combination with the usage of **mapply**, a **transformation function** and data.table's **rbindlist**.
```
# data
raw_df <- data.frame(id = 1:2, json = c('{"user": "xyz2", "weightmap": {"P1":100,"P2":0}, "domains": ["a2","b2"]}', '{"user": "xyz1", "weightmap": {"P1":0,"P2":... | ```
library(jsonlite)
json = c(
'{"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]}',
'{"user":"xyz2","weightmap": {"P1":100,"P2":0}, "domains":["a2","b2"]}'
)
json <- lapply( paste0("[", json ,"]"),
function(x) jsonlite::fromJSON(x))
df <- data.frame(matrix... |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | I would go for the **jsonlite** package in combination with the usage of **mapply**, a **transformation function** and data.table's **rbindlist**.
```
# data
raw_df <- data.frame(id = 1:2, json = c('{"user": "xyz2", "weightmap": {"P1":100,"P2":0}, "domains": ["a2","b2"]}', '{"user": "xyz1", "weightmap": {"P1":0,"P2":... | Using tidyjson
<https://cran.r-project.org/web/packages/tidyjson/vignettes/introduction-to-tidyjson.html>
```
install.packages("tidyjson")
library(tidyjson)
json_as_df <- raw_df$json %>% spread_all
# retain columns
json_as_df <- raw_df %>% as.tbl_json(json.column = "json") %>% spread_all
``` |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | Here's a tidyverse solution (also using jsonlite) if you're happy to work in a long format (for `domains` in this case):
```
library(jsonlite)
library(dplyr)
library(purrr)
library(tidyr)
d <- data.frame(
id = c(1, 2),
json = c(
'{"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]}',
'{"u... | Could not get the flatten parameter to work as I expected so needed to unlist and then "re-list" before rbinding with do.call:
```
library(jsonlite)
do.call( rbind,
lapply(raw_df$json,
function(j) as.list(unlist(fromJSON(j, flatten=TRUE)))
) )
user weightmap.P1 weigh... |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | Could not get the flatten parameter to work as I expected so needed to unlist and then "re-list" before rbinding with do.call:
```
library(jsonlite)
do.call( rbind,
lapply(raw_df$json,
function(j) as.list(unlist(fromJSON(j, flatten=TRUE)))
) )
user weightmap.P1 weigh... | ```
library(jsonlite)
json = c(
'{"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]}',
'{"user":"xyz2","weightmap": {"P1":100,"P2":0}, "domains":["a2","b2"]}'
)
json <- lapply( paste0("[", json ,"]"),
function(x) jsonlite::fromJSON(x))
df <- data.frame(matrix... |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | Could not get the flatten parameter to work as I expected so needed to unlist and then "re-list" before rbinding with do.call:
```
library(jsonlite)
do.call( rbind,
lapply(raw_df$json,
function(j) as.list(unlist(fromJSON(j, flatten=TRUE)))
) )
user weightmap.P1 weigh... | Using tidyjson
<https://cran.r-project.org/web/packages/tidyjson/vignettes/introduction-to-tidyjson.html>
```
install.packages("tidyjson")
library(tidyjson)
json_as_df <- raw_df$json %>% spread_all
# retain columns
json_as_df <- raw_df %>% as.tbl_json(json.column = "json") %>% spread_all
``` |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | Here's a tidyverse solution (also using jsonlite) if you're happy to work in a long format (for `domains` in this case):
```
library(jsonlite)
library(dplyr)
library(purrr)
library(tidyr)
d <- data.frame(
id = c(1, 2),
json = c(
'{"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]}',
'{"u... | ```
library(jsonlite)
json = c(
'{"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]}',
'{"user":"xyz2","weightmap": {"P1":100,"P2":0}, "domains":["a2","b2"]}'
)
json <- lapply( paste0("[", json ,"]"),
function(x) jsonlite::fromJSON(x))
df <- data.frame(matrix... |
41,988,928 | How do I come from here ...
```
| ID | JSON Request |
==============================================================================
| 1 | {"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]} |
--------------------------------------------------... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41988928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288917/"
] | Here's a tidyverse solution (also using jsonlite) if you're happy to work in a long format (for `domains` in this case):
```
library(jsonlite)
library(dplyr)
library(purrr)
library(tidyr)
d <- data.frame(
id = c(1, 2),
json = c(
'{"user":"xyz1","weightmap": {"P1":0,"P2":100}, "domains":["a1","b1"]}',
'{"u... | Using tidyjson
<https://cran.r-project.org/web/packages/tidyjson/vignettes/introduction-to-tidyjson.html>
```
install.packages("tidyjson")
library(tidyjson)
json_as_df <- raw_df$json %>% spread_all
# retain columns
json_as_df <- raw_df %>% as.tbl_json(json.column = "json") %>% spread_all
``` |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | Just use plain JavaScript.
```
list.insertBefore(li,list.firstChild);
```
Screw jQuery. | I don't know if jquery is an option for you, but looks like you should be able to find the first li and then call insertBefore:
<http://api.jquery.com/insertBefore/>
edit: Looking at the source for insertBefore, it looks nontrivial to implement. |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | You can use [`Node.insertBefore(newElement, referenceElement)`](https://developer.mozilla.org/en/insertBefore).
[**Example**](http://jsfiddle.net/RZRJq/)
```
var els = document.getElementById('els');
var counter = 0;
function newel() {
var x = document.createElement('li');
x.innerHTML = "This is really cool :... | I don't know if jquery is an option for you, but looks like you should be able to find the first li and then call insertBefore:
<http://api.jquery.com/insertBefore/>
edit: Looking at the source for insertBefore, it looks nontrivial to implement. |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | Just use plain JavaScript.
```
list.insertBefore(li,list.firstChild);
```
Screw jQuery. | How about this ?
```
var els = document.getElementById('els');
var counter = 5;
function newel() {
var x = document.createElement('li');
x.innerHTML = "This is really cool : " + counter;
return x;
}
var si = setInterval(function() {
//var cur = els.innerHTML;
//els.firstChild = newel();
els.app... |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | You can use [`Node.insertBefore(newElement, referenceElement)`](https://developer.mozilla.org/en/insertBefore).
[**Example**](http://jsfiddle.net/RZRJq/)
```
var els = document.getElementById('els');
var counter = 0;
function newel() {
var x = document.createElement('li');
x.innerHTML = "This is really cool :... | How about this ?
```
var els = document.getElementById('els');
var counter = 5;
function newel() {
var x = document.createElement('li');
x.innerHTML = "This is really cool : " + counter;
return x;
}
var si = setInterval(function() {
//var cur = els.innerHTML;
//els.firstChild = newel();
els.app... |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | Just use plain JavaScript.
```
list.insertBefore(li,list.firstChild);
```
Screw jQuery. | I have no idea how to implement it using raw JS, nut you could use jQuery which is the easiest way (IMO) to use JavaScript.
There are many functions to manipulate DOM which can be found here:
<http://api.jquery.com/category/manipulation/> |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | You can use [`Node.insertBefore(newElement, referenceElement)`](https://developer.mozilla.org/en/insertBefore).
[**Example**](http://jsfiddle.net/RZRJq/)
```
var els = document.getElementById('els');
var counter = 0;
function newel() {
var x = document.createElement('li');
x.innerHTML = "This is really cool :... | I have no idea how to implement it using raw JS, nut you could use jQuery which is the easiest way (IMO) to use JavaScript.
There are many functions to manipulate DOM which can be found here:
<http://api.jquery.com/category/manipulation/> |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | Just use plain JavaScript.
```
list.insertBefore(li,list.firstChild);
```
Screw jQuery. | If you can't use JQuery's [prepend](http://api.jquery.com/prepend/) function, then you can write your own implementation using just plain old Javascript. Another answer suggests using `insertBefore`, but I would advise against using this approach since it would require selecting the first `li` element instead of the li... |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | You can use [`Node.insertBefore(newElement, referenceElement)`](https://developer.mozilla.org/en/insertBefore).
[**Example**](http://jsfiddle.net/RZRJq/)
```
var els = document.getElementById('els');
var counter = 0;
function newel() {
var x = document.createElement('li');
x.innerHTML = "This is really cool :... | If you can't use JQuery's [prepend](http://api.jquery.com/prepend/) function, then you can write your own implementation using just plain old Javascript. Another answer suggests using `insertBefore`, but I would advise against using this approach since it would require selecting the first `li` element instead of the li... |
7,864,824 | I am trying to add new `<li>` elements to the top (instead of at the bottom). I have come up with basic code which makes use of `document.appendChild()`. Since there is no `prependChild()` I couldn't figure out a way to get it done.
Here is the demo. <http://jsfiddle.net/pwpSx/>
Once you run it. All `<li>` elements a... | 2011/10/23 | [
"https://Stackoverflow.com/questions/7864824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009278/"
] | Just use plain JavaScript.
```
list.insertBefore(li,list.firstChild);
```
Screw jQuery. | You can use [`Node.insertBefore(newElement, referenceElement)`](https://developer.mozilla.org/en/insertBefore).
[**Example**](http://jsfiddle.net/RZRJq/)
```
var els = document.getElementById('els');
var counter = 0;
function newel() {
var x = document.createElement('li');
x.innerHTML = "This is really cool :... |
15,527,654 | I have the following table...
```
<table>
<tbody>
<tr class="trclass">
<td class="tdclass">Test1</td>
<td class="tdclass">Test2</td>
<td class="tdclass">Test3</td>
</tr>
<tr class="trclass">
<td class="tdclass">Test4</td>
<... | 2013/03/20 | [
"https://Stackoverflow.com/questions/15527654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902402/"
] | You can do like this:
```
$("tr.trclass").each(function() {
var className = $(this).find("td:eq(1)").text();
$(this).find("td:eq(1)").after("<td class=" + className + ">NewText</td>");
});
```
Demo: <http://jsfiddle.net/ECu36/> | I think it would be easy to control by css attribute as follows:
```
$('tr.trclass').find('td:nth-child(2)').after('<td>testing123</td>');
``` |
10,744,103 | The following query is working fine without ',MAX(Row)'
```
WITH QResult AS
(SELECT
ROW_NUMBER() OVER (ORDER BY Ad_Date DESC) AS Row,
*
FROM [vw_ads]
)
SELECT *, MAX(Row)
FROM QResult
```
When `MAX(Row)` is added, SQL Server 2008 is throwing the following error :
>
> Column 'QResult.Row' is invalid i... | 2012/05/24 | [
"https://Stackoverflow.com/questions/10744103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/510558/"
] | When using an aggregate function like `SUM`, `COUNT` or `MAX`, and you want to also select other columns from your data, then you need to group your data by the other column(s) used in your query.
So you need to write something like:
```
WITH QResult AS
(SELECT
ROW_NUMBER() OVER (ORDER BY Ad_Date DESC) AS Row,... | You will need to decide why you are obtaining MAX(Row). Is it the max row by Ad\_Date? Is the max row overall?
If you change it to:
```
WITH QResult AS (SELECT ROW_NUMBER() OVER (ORDER BY Ad_Date DESC) AS Row,* FROM [vw_ads])
SELECT Ad_Date, MAX(Row) from QResult
GROUP BY Ad_Date
```
...that will return you the m... |
38,991,315 | **Scenario**:
I'm trying to debug asp.net core project on Visual Studio Code under Sabayon Linux. When I hit F5, I'm getting the following message:
>
> Run 'Debug: Download .NET Core Debugger' in the Command Palette or open a .NET project directory to download the .NET Core Debugger
>
>
>
Opening Command Pall... | 2016/08/17 | [
"https://Stackoverflow.com/questions/38991315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6725152/"
] | [BugFinder](https://stackoverflow.com/users/687262/bugfinder)'s comment helped me resolve the same issue on Visual Studio Code under Debian 9:
1. Delete the entire csharp extension directory at ~/.vscode/extensions/ms-vscode.csharp- and then reinstall the latest version of C# extension
2. View the status of the debugg... | I also faced the same type of issue on Windows OS.
Please try this if you're having issue in installing debugger:
1. Open User Settings file by clicking on setting icon in bottom left
2. Add: `"http.proxyStrictSSL": false,`
3. Add: `"http.proxy": "https://proxyuser:proxypassword@proxyip:proxyport"` |
39,938 | ```
A: 这儿的辣子鸡丁和糖醋鱼都不错。
B: 那就一样来一个吧。
```
(1) How can 那就一样来一个吧 be translated into English?
(2) What is the meaning of 来? I think it means "bring to (us)". | 2020/07/06 | [
"https://chinese.stackexchange.com/questions/39938",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/23928/"
] | 那就一样来一个吧 is a shortened sentence. In day to day speech, it is a common practice to omit some elements that are presumed to be understood or strongly implied.
You can understand the sentence as "**那就**(每)**一样**(种类)(都給我)(各)**来一个吧** " --> "Then bring me one each from each kind"
* "每一样" (each kind ) refers to 辣子鸡丁 and 糖醋... | >
> (1) How can 那就一样来一个吧 be translated into English?
>
>
>
It means ***Then [I will have] one of each***. The important part is "一样来一个" means "one of each". In this case, B is ordering one 辣子鸡丁 (spicy chicken) and one 糖醋鱼 (sweet and sour fish).
The 那 might be translated to "then", and indicates it's in response t... |
39,938 | ```
A: 这儿的辣子鸡丁和糖醋鱼都不错。
B: 那就一样来一个吧。
```
(1) How can 那就一样来一个吧 be translated into English?
(2) What is the meaning of 来? I think it means "bring to (us)". | 2020/07/06 | [
"https://chinese.stackexchange.com/questions/39938",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/23928/"
] | (1) 那就一样来一个吧 means "give me one of each"
(2) [Collins dictionary](https://www.collinsdictionary.com/dictionary/chinese-english/%E6%9D%A5) has an entry for this usage:
>
> 3. (泛指做事)
>
> ⇒ 请来碗面条。 (Qǐng lái wǎn miàntiáo.) A bowl of noodles, please.
>
> ⇒ 你累了,让我来。 (Nǐ lèi le, ràng wǒ lái.) You're tired — let me do... | >
> (1) How can 那就一样来一个吧 be translated into English?
>
>
>
It means ***Then [I will have] one of each***. The important part is "一样来一个" means "one of each". In this case, B is ordering one 辣子鸡丁 (spicy chicken) and one 糖醋鱼 (sweet and sour fish).
The 那 might be translated to "then", and indicates it's in response t... |
39,938 | ```
A: 这儿的辣子鸡丁和糖醋鱼都不错。
B: 那就一样来一个吧。
```
(1) How can 那就一样来一个吧 be translated into English?
(2) What is the meaning of 来? I think it means "bring to (us)". | 2020/07/06 | [
"https://chinese.stackexchange.com/questions/39938",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/23928/"
] | 那就一样来一个吧 is a shortened sentence. In day to day speech, it is a common practice to omit some elements that are presumed to be understood or strongly implied.
You can understand the sentence as "**那就**(每)**一样**(种类)(都給我)(各)**来一个吧** " --> "Then bring me one each from each kind"
* "每一样" (each kind ) refers to 辣子鸡丁 and 糖醋... | 来 is used as this sense:
>
> 6 . 表示做某个动作(代替意义具体的动词)
>
>
> 你搬不动,我来吧 / 唱得真好,再来一个 / 不要跟我来这一套。
>
>
>
For translation, you can take any verb that can make sense. In your example, *take, bring, etc* can work. |
39,938 | ```
A: 这儿的辣子鸡丁和糖醋鱼都不错。
B: 那就一样来一个吧。
```
(1) How can 那就一样来一个吧 be translated into English?
(2) What is the meaning of 来? I think it means "bring to (us)". | 2020/07/06 | [
"https://chinese.stackexchange.com/questions/39938",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/23928/"
] | (1) 那就一样来一个吧 means "give me one of each"
(2) [Collins dictionary](https://www.collinsdictionary.com/dictionary/chinese-english/%E6%9D%A5) has an entry for this usage:
>
> 3. (泛指做事)
>
> ⇒ 请来碗面条。 (Qǐng lái wǎn miàntiáo.) A bowl of noodles, please.
>
> ⇒ 你累了,让我来。 (Nǐ lèi le, ràng wǒ lái.) You're tired — let me do... | 来 is used as this sense:
>
> 6 . 表示做某个动作(代替意义具体的动词)
>
>
> 你搬不动,我来吧 / 唱得真好,再来一个 / 不要跟我来这一套。
>
>
>
For translation, you can take any verb that can make sense. In your example, *take, bring, etc* can work. |
79,129 | Is the following pseudo code, being executed within the browser, compatible with GDPR?
```
sha256(fonts + useragent + plugins + ..)
```
Notice: It doesnt store the actual attributes on the server, only the hash of these is transferred, so that the server cant conclude what the real values were. | 2022/04/06 | [
"https://law.stackexchange.com/questions/79129",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/44591/"
] | It doesn’t make you exempt from the GDPR if that’s what you’re asking
---------------------------------------------------------------------
The hash you produce is linked to one (or a small number) of computers and it therefore serves as an ID number. Because that ID number is linked to the owner of the computer it is... | There are two concerns here: GDPR and ePrivacy. Such fingerprints are personal data. It is likely that you would need to get the user's consent before creating the fingerprint.
Per the GDPR, personal data is any information relating to an identifiable natural person. Per Recital 26, being able to single out a person (... |
5,922,865 | **MysQL (table1):**
```
+----+--------+-------+--------+
| id | itemid | title | status |
+----+--------+-------+--------+
| 1 | 2 | title | 0 |
+----+--------+-------+--------+
| 2 | 2 | title | 1 |
+----+--------+-------+--------+
| 3 | 3 | title | 1 |
+----+--------+-------+--------... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5922865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | you should use join for this.
[Mysql join](http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php)
or have a look how to use control flow functions in select statements:
[Control flow functions](http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html) | I would just like to assert that if you've got any if-then-else logic, any further processing of the data that you have stored in a database, use a programming language for that. There's nothing stopping you from writing all this logic in PHP, Java, C#, etc. There are far too many questions here about if-then-else stuf... |
5,922,865 | **MysQL (table1):**
```
+----+--------+-------+--------+
| id | itemid | title | status |
+----+--------+-------+--------+
| 1 | 2 | title | 0 |
+----+--------+-------+--------+
| 2 | 2 | title | 1 |
+----+--------+-------+--------+
| 3 | 3 | title | 1 |
+----+--------+-------+--------... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5922865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | you should use join for this.
[Mysql join](http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php)
or have a look how to use control flow functions in select statements:
[Control flow functions](http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html) | I'd like to expand on the previous answers a bit with some conceptual background: remember that SQL is declarative, not procedural. What this means is that you basically use SQL to tell the database what you want your result table to look like, and it figures out how to give it to you. When you're thinking about if/the... |
69,677,358 | Our application take a very long time to compile. Any change to the Dockerfile triggers a full-recomplile (which takes a very long time) The Dockerfile is a muli-stage build. I'm trying to work on the second stage. Is there any way to tell `docker build` to begin at the second stage?
```
FROM debian:latest AS builder
... | 2021/10/22 | [
"https://Stackoverflow.com/questions/69677358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | You could do:
```
data %>%
rowwise() %>%
mutate(age = c_across(all_of(vector_of_names))[position])
id position one two three age
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1 1 32 45 NA 32
2 2 1 34 67 NA 34
3 3 2 56 87 NA 87
4 ... | Base R vectorized option using matrix subsetting.
```
data$age <- data[vector_of_names][cbind(1:nrow(data), data$position)]
data
# id position one two three age
#1 1 1 32 45 NA 32
#2 2 1 34 67 NA 34
#3 3 2 56 87 NA 87
#4 4 2 77 NA NA NA
#5 5 1 87 33 ... |
18,626,164 | I need to take MAX of my count but it does not work,
Oracle does not allow to deep aggregation..
this is results without MAX:
```
187 1 2
187 3 1
159 1 1
159 3 1
159 2 8
188 2 9
188 1 2
188 3 1
187 2 9
select tt.token_id, tt.tag_variable_type_id, max(count(*)) as usage
from tokens tt
left outer j... | 2013/09/05 | [
"https://Stackoverflow.com/questions/18626164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801192/"
] | Try
```
select token_id,
MIN(tag_variable_type_id) KEEP (DENSE_RANK LAST ORDER BY usage) AS tag_variable_type_id,
MAX(usage) AS usage from ( select tt.token_id, tt.tag_variable_type_id, count(*) as usage from tokens tt left outer join token_xref ttx on ttx.token_id = tt.token_id where tag_variable_type_id in (... | So you'll just need to wrap another select around what you already have:
```
select token_id, max(usage) from (
select tt.token_id, tt.tag_variable_type_id, max(count(*)) as usage
from tokens tt
left outer join token_xref ttx on ttx.token_id = tt.token_id
where tag_variable_type_id in (1, 2, 3) and ttx.template_id... |
18,626,164 | I need to take MAX of my count but it does not work,
Oracle does not allow to deep aggregation..
this is results without MAX:
```
187 1 2
187 3 1
159 1 1
159 3 1
159 2 8
188 2 9
188 1 2
188 3 1
187 2 9
select tt.token_id, tt.tag_variable_type_id, max(count(*)) as usage
from tokens tt
left outer j... | 2013/09/05 | [
"https://Stackoverflow.com/questions/18626164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801192/"
] | You need to match lines from your original result set with another query on the same result set that gets the max of usage.
We'll be using a `WITH` clause for clarity :
```
WITH result_count as (select tt.token_id, tt.tag_variable_type_id, count(*) as usage
from tokens tt
left outer join token_xref ttx on ... | So you'll just need to wrap another select around what you already have:
```
select token_id, max(usage) from (
select tt.token_id, tt.tag_variable_type_id, max(count(*)) as usage
from tokens tt
left outer join token_xref ttx on ttx.token_id = tt.token_id
where tag_variable_type_id in (1, 2, 3) and ttx.template_id... |
18,626,164 | I need to take MAX of my count but it does not work,
Oracle does not allow to deep aggregation..
this is results without MAX:
```
187 1 2
187 3 1
159 1 1
159 3 1
159 2 8
188 2 9
188 1 2
188 3 1
187 2 9
select tt.token_id, tt.tag_variable_type_id, max(count(*)) as usage
from tokens tt
left outer j... | 2013/09/05 | [
"https://Stackoverflow.com/questions/18626164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801192/"
] | Try
```
select token_id,
MIN(tag_variable_type_id) KEEP (DENSE_RANK LAST ORDER BY usage) AS tag_variable_type_id,
MAX(usage) AS usage from ( select tt.token_id, tt.tag_variable_type_id, count(*) as usage from tokens tt left outer join token_xref ttx on ttx.token_id = tt.token_id where tag_variable_type_id in (... | [ROW\_NUMBER](http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions156.htm#i86310) can be used to assign unique row number to each row.
```
select token_id,tag_variable_type_id,usage
from(
select tt.token_id token_id,
tt.tag_variable_type_id tag_variable_type_id,
count(*... |
18,626,164 | I need to take MAX of my count but it does not work,
Oracle does not allow to deep aggregation..
this is results without MAX:
```
187 1 2
187 3 1
159 1 1
159 3 1
159 2 8
188 2 9
188 1 2
188 3 1
187 2 9
select tt.token_id, tt.tag_variable_type_id, max(count(*)) as usage
from tokens tt
left outer j... | 2013/09/05 | [
"https://Stackoverflow.com/questions/18626164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801192/"
] | You need to match lines from your original result set with another query on the same result set that gets the max of usage.
We'll be using a `WITH` clause for clarity :
```
WITH result_count as (select tt.token_id, tt.tag_variable_type_id, count(*) as usage
from tokens tt
left outer join token_xref ttx on ... | [ROW\_NUMBER](http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions156.htm#i86310) can be used to assign unique row number to each row.
```
select token_id,tag_variable_type_id,usage
from(
select tt.token_id token_id,
tt.tag_variable_type_id tag_variable_type_id,
count(*... |
2,831,908 | If $a+b =5, ab = 6 $ what will be the proper way to find the individual value of $a$ and $b$?
PS. I am not asking for hit & trial method. | 2018/06/25 | [
"https://math.stackexchange.com/questions/2831908",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/556842/"
] | Use a substitution. If $a+b=5$ and $ab=6$, then you know that $b=5-a$, and so $a(5-a)=6$. This is simply a quadratic, and can be solved using factoring or the quadratic formula:
$$a(5-a)=6\iff a^2-5a+6=0\iff a=2\space\text{or}\space 3$$
Thus, we can see that the only two solution pairs $(a,b)$ are $(2,3)$ and $(3,2)$. | 1) Solve for one variable in terms of the other. You have four options.
i $a = 5-b;$ ii $b = 5-a;$ iii $a = \frac 6b;$ iv) $b = \frac 6a$.
2) Plug that into the other equation:
i $(5-b)b = 6$; ii $a(5-a)= 6;$ iii $\frac 6b + b = 5$ iv $a + \frac 6a = 5$.
3) Solve:
i $b^2 - 5b + 6=0$ so $b = 2,3$.
ii) $a^2 - 5a + ... |
2,831,908 | If $a+b =5, ab = 6 $ what will be the proper way to find the individual value of $a$ and $b$?
PS. I am not asking for hit & trial method. | 2018/06/25 | [
"https://math.stackexchange.com/questions/2831908",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/556842/"
] | Remark that $a,b$ are solutions of the polynomial $(x-a)(x-b)=0$
When you develop it, this gives: $x^2-(a+b)x+ab=0$
So we are calling $\begin{cases} s=a+b &\text{the sum of a and b}\\ p=ab &\text{the product of a and b}\end{cases}$
Then $a,b$ are solutions of $$\boxed{x^2-sx+p=0}$$
Applying it to $s=5$ and $p=6$, ... | 1) Solve for one variable in terms of the other. You have four options.
i $a = 5-b;$ ii $b = 5-a;$ iii $a = \frac 6b;$ iv) $b = \frac 6a$.
2) Plug that into the other equation:
i $(5-b)b = 6$; ii $a(5-a)= 6;$ iii $\frac 6b + b = 5$ iv $a + \frac 6a = 5$.
3) Solve:
i $b^2 - 5b + 6=0$ so $b = 2,3$.
ii) $a^2 - 5a + ... |
61,294,195 | **Aim:** to save the latest 5 dates from a very large bank of dates without storing all dates. This will be run on an Arduino style microcontroller, but thought it is more relevant to the C language in general.
My current method is to copy the 6 digit char array of the date (yymmdd) into the last position of a 6 date ... | 2020/04/18 | [
"https://Stackoverflow.com/questions/61294195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2295295/"
] | Here's some code that keeps the array of pointers
```
char *latestDates[] = {"200418","991201","020718","050607","121030","000000"};
char newDate[] = "551122";
latestDates[5] = malloc(strlen(newDate) + 1);
strcpy(latestDates[5], newDate);
```
I'm not claiming it's good code or anything, but it's legal. | Try this (if there is no need to be a pointer)
```
char latestDates[][7] = {"200418","991201","020718","050607","121030","000000"};
``` |
13,212,224 | i have an image which i have read in and its pixel values are stored in a matrix. I am trying to get a frequency table for the matrix of which i intend to plot a histogram. I am trying to do this using only matrix expressions(i.e no for loops/ imhist function). I looked at a function called histc() that can count the v... | 2012/11/03 | [
"https://Stackoverflow.com/questions/13212224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1173951/"
] | try:
```
hist(image(:),min(image(:)):max(image(:)));
```
this will plot a histogram of the pixel values including the entire range of values that the image has. | Though this is an old post, we can also use `accumarray`:
```
h = accumarray(double(im(:))+1, 1, [double(intmax(class(im)))+1 1]);
```
`h` will contain a histogram / frequency count of how many pixels are encountered per intensity level. We take all of the values in `im` and offset by `1` as MATLAB indexes arrays st... |
88,007 | I understand that energy is NEEDED to BREAK bonds. But don't chemical bonds already have some form of potential energy in them already? So wouldn't it make sense that even though energy is required to break them, their potential energy is also RELEASED once they are broken?
In other words, shouldn't the bond breaking... | 2017/12/28 | [
"https://chemistry.stackexchange.com/questions/88007",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/56907/"
] | **Bond breaking does NOT release energy!!**
-------------------------------------------
In the course of a chemical reaction, you typically break some bonds and form some new bonds. **The bond breaking is always endothermic**. The formation of new bonds is exothermic, so depending on whether the old bonds or the new b... | A bond is always some local energy minimum. You definitely need to add some energy to get out of there, but when you separate the remaining parts to infinity, you *might* get more energy back than you put into it. Certainly not if you split water or sodium chloride.
So you're principally correct, but the two (or more... |
28,340,680 | ```
def lists(): #Where list is stored
List = ["Movie_Name",[""],"Movie_Stars",[""],"Movie_Budget",[""]]
print ("Your Movies")
amount_in_list = int(input("How many Movies? "))
x = 1
while x <= amount_in_list:
film = input ("Name of film ... ")
stars = input ("Main stars ...")
... | 2015/02/05 | [
"https://Stackoverflow.com/questions/28340680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3813197/"
] | A better answer than one which answers your question directly would be: You don't. You definitely need a dictionary for this situation (unless your program develops to a point where you'd prefer creating a custom object)
As a simple demonstration:
```
def getMovies():
movieinfo = {"Movie_Name": [], "Movie_Stars"... | I would store the movie information in an object. This way your code will be easier to extend, make changes and reuse. you could easily add methods to your movie class to do custom stuff or add more properties without having to change your code to much.
```
class Movie:
def __init__(self, name='', actors=[]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.