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 |
|---|---|---|---|---|---|
22,880,876 | I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication.
```
passport.use(new FacebookStrategy({
clientID: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET',
callbackURL: "http://www.example.com/auth/facebook/callback"
},
function ... | 2014/04/05 | [
"https://Stackoverflow.com/questions/22880876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2063691/"
] | I would like to add more information here.
While adding `profileFields: ['emails']` while creating FacebookStrategy and `passport.authorize('facebook', { scope : ['email'] })` solves issue for most of the users.
There are other possible reasons where you will not get user's email after authentication.
* No e-mail a... | Make sure you're providing the scope parameter into the first .authenticate() call, not the callback.
Like this:
```
router.get("/auth/facebook", passport.authenticate("facebook", {
scope: [ "email" ], // scope goes here, not below
}));
router.get("/auth/facebook/callback",
passport.authenticate("facebook",... |
22,880,876 | I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication.
```
passport.use(new FacebookStrategy({
clientID: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET',
callbackURL: "http://www.example.com/auth/facebook/callback"
},
function ... | 2014/04/05 | [
"https://Stackoverflow.com/questions/22880876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2063691/"
] | Make sure these two things are in your code:
```
passport.use(new FacebookStrategy({
clientID: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET',
callbackURL: "http://www.example.com/auth/facebook/callback"
passReqToCallback : true,
profileFields: ['id', 'emails',... | ```
passport.use(new FacebookStrategy({
clientID: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET',
callbackURL: "http://www.example.com/auth/facebook/callback"
},
function (accessToken, refreshToken, profile, done) {
process.nextTick(function () {
... |
40,091,971 | I am having a really hard time determining what is wrong with my code. I am trying to create a service class to connect to my separate database application which exposes an open (unsecure) REST API.
If I connect to the address in my browser I can correctly see the results, and a connection is logged on my server. How... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40091971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1172412/"
] | You have a quotes problem as @Robiseb mentioned in the **[above comment](https://stackoverflow.com/questions/40091944/change-elements-innertext-with-php/40092063#comment-67456562)**, use :
```
echo "<script>$('#element').text('" . $variable . "');</script>"
//Or
echo "document.getElementsById('element').textContent = ... | Use
```
document.getElementById('element').innerHTML = $variable;
```
or
```
$('#element').html($variable);
``` |
69,415,684 | I am Global Administrator of the Azure subscription I own.
Steps:
* I logged into Azure Portal using my credentials.
* I created an Azure SQL database (including initiating a new Azure SQL Server instance).
* I set the database security to permit both SQL Login and AAD Auth.
* I set my AAD account to be SQL Admin of ... | 2021/10/02 | [
"https://Stackoverflow.com/questions/69415684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9152608/"
] | You need the same preprocessing steps in the training and validation. You didn't rescale your test data. You can start by dividing it by 255:
```
img_array = keras.preprocessing.image.img_to_array(img) / 255
``` | You have a problem with your rescaling. In `load_data()`, you are rescaling the train and `val` datasets. In your model you have a rescaling layer which rescales the `val` and train again when they are fed into the model. Your test dataset is rescaled only when it's fed into to model. You need to delete the rescaling p... |
44,836,076 | I need to run a one way ANOVA on every column in a data frame based on another column. My data frame has 57 columns, so it is very time consuming to type out every column name. Here is part of my data frame.

So basically, I need this function run for every column
```
aov(df$... | 2017/06/29 | [
"https://Stackoverflow.com/questions/44836076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8204767/"
] | For reproducibility, the code below uses the built-in `mtcars` data frame and returns a list in which each list element is an `aov` model of `mtcars$cyl` with every other column in the data frame. We use `map` from the `purrr` package (which is part of the `tidyverse` suite of packages) to take care of successively run... | It can be done without installing `tidyverse` package.
This is the example for `mtcars` data frame.
```
aov.models <- lapply(setdiff(names(mtcars), "cyl"), function(s) {
aov(as.formula(paste(s, " ~ cyl")),mtcars)
})
``` |
8,491 | This is with reference to a [News Article](http://timesofindia.indiatimes.com/india/Mystery-plane-gives-jitters-to-international-airliners-near-Mumbai/articleshow/41897554.cms) that I read today. I find it scary that radars would not be able to detect an aircraft. Is it really possible? If yes, how can ATCs manage this... | 2014/09/07 | [
"https://aviation.stackexchange.com/questions/8491",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/3446/"
] | Some military aircraft reflect little enough radar energy to be effectively undetectable. Note that the actual details are likely classified, but even the modern F-22 still has a radar cross-section of [about the size of a steel marble](http://www.f-16.net/f-22-news-article3275.html). Still, the B-2, an older stealth a... | This is possible, and actually fairly common and expected.
Primary radars, as you most likely know, works by picking up reflected EM waves from an object. But many people do not realize that in engineering (as opposed to science), **things are never perfect**. Radars *always* pick up "ghost images", caused by reflecti... |
38,435,097 | I am facing problem with Firebase "registration\_ids". When I send the request from Rest Client i get the successful response.
```
{"multicast_id":4650719213012935695,"success":2,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1468837777484579%214918aff9fd7ecd"},{"message_id":"0:1468837777484484%214918aff9fd... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38435097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5063886/"
] | I used `to` rather than sending array of Firebase tokens as `registration_ids`. Cause `registration_ids` having the limit of 1000 number of firebase tokens only <https://firebase.google.com/docs/cloud-messaging/http-server-ref>.
```
function fetchFirebaseTokenUsers($message) {
$query = "SELECT token FROM fir... | If you Used `registration_ids` you need to passed data in array as follow:
**PHP**:
```
$fields = array(
'registration_ids' => array($registration_ids),
'data' => $message,
);
``` |
38,435,097 | I am facing problem with Firebase "registration\_ids". When I send the request from Rest Client i get the successful response.
```
{"multicast_id":4650719213012935695,"success":2,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1468837777484579%214918aff9fd7ecd"},{"message_id":"0:1468837777484484%214918aff9fd... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38435097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5063886/"
] | I used `to` rather than sending array of Firebase tokens as `registration_ids`. Cause `registration_ids` having the limit of 1000 number of firebase tokens only <https://firebase.google.com/docs/cloud-messaging/http-server-ref>.
```
function fetchFirebaseTokenUsers($message) {
$query = "SELECT token FROM fir... | I had the similar scenario where I had to create a GCM group for user's registration tokens & that error occurred. I figured it out later that i was not following corrent JSON format mentioned on f[ire-base](https://firebase.google.com/docs/cloud-messaging/android/device-group)
**Solution:**
Create a model
```
pub... |
38,435,097 | I am facing problem with Firebase "registration\_ids". When I send the request from Rest Client i get the successful response.
```
{"multicast_id":4650719213012935695,"success":2,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1468837777484579%214918aff9fd7ecd"},{"message_id":"0:1468837777484484%214918aff9fd... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38435097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5063886/"
] | I used `to` rather than sending array of Firebase tokens as `registration_ids`. Cause `registration_ids` having the limit of 1000 number of firebase tokens only <https://firebase.google.com/docs/cloud-messaging/http-server-ref>.
```
function fetchFirebaseTokenUsers($message) {
$query = "SELECT token FROM fir... | If registration\_ids is just one Token as stated at
<https://firebase.google.com/docs/cloud-messaging/http-server-ref>
you should use the field 'to'.
FCM requires registered\_ids to be a JSON Array with indexes starting from 0.
I have the same error because the indexes where not these. I solved it using the PHP funct... |
38,435,097 | I am facing problem with Firebase "registration\_ids". When I send the request from Rest Client i get the successful response.
```
{"multicast_id":4650719213012935695,"success":2,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1468837777484579%214918aff9fd7ecd"},{"message_id":"0:1468837777484484%214918aff9fd... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38435097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5063886/"
] | If you Used `registration_ids` you need to passed data in array as follow:
**PHP**:
```
$fields = array(
'registration_ids' => array($registration_ids),
'data' => $message,
);
``` | I had the similar scenario where I had to create a GCM group for user's registration tokens & that error occurred. I figured it out later that i was not following corrent JSON format mentioned on f[ire-base](https://firebase.google.com/docs/cloud-messaging/android/device-group)
**Solution:**
Create a model
```
pub... |
38,435,097 | I am facing problem with Firebase "registration\_ids". When I send the request from Rest Client i get the successful response.
```
{"multicast_id":4650719213012935695,"success":2,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1468837777484579%214918aff9fd7ecd"},{"message_id":"0:1468837777484484%214918aff9fd... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38435097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5063886/"
] | If you Used `registration_ids` you need to passed data in array as follow:
**PHP**:
```
$fields = array(
'registration_ids' => array($registration_ids),
'data' => $message,
);
``` | If registration\_ids is just one Token as stated at
<https://firebase.google.com/docs/cloud-messaging/http-server-ref>
you should use the field 'to'.
FCM requires registered\_ids to be a JSON Array with indexes starting from 0.
I have the same error because the indexes where not these. I solved it using the PHP funct... |
38,435,097 | I am facing problem with Firebase "registration\_ids". When I send the request from Rest Client i get the successful response.
```
{"multicast_id":4650719213012935695,"success":2,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1468837777484579%214918aff9fd7ecd"},{"message_id":"0:1468837777484484%214918aff9fd... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38435097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5063886/"
] | If registration\_ids is just one Token as stated at
<https://firebase.google.com/docs/cloud-messaging/http-server-ref>
you should use the field 'to'.
FCM requires registered\_ids to be a JSON Array with indexes starting from 0.
I have the same error because the indexes where not these. I solved it using the PHP funct... | I had the similar scenario where I had to create a GCM group for user's registration tokens & that error occurred. I figured it out later that i was not following corrent JSON format mentioned on f[ire-base](https://firebase.google.com/docs/cloud-messaging/android/device-group)
**Solution:**
Create a model
```
pub... |
41,016,917 | I am sending a post request to server via ajax:
**result.ejs**
```
$.ajax({
type: "POST",
url: "/result",
data: { score: score, rank: rank, name: name, email: email, historyLog: historyLog }
});
```
I am reciveing it and saving data to the database:
**resultController.js**
```
app.post('/result', ur... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41016917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4038579/"
] | AJAX is usually used precisely when you *don't* want to navigate elsewhere, but talk to the server in the background instead. To still do it your way, use `res.send("done");` *inside* the save callback, right after `console.log('User saved successfully!);`, then add this to your ajax request:
```
success: function () ... | If you want to render page after saving - add it in saving callback, like this
```html
app.post('/result', urlencodedParser, function(req, res) {
var user = new User({
name: req.body.name,
email: req.body.email,
score: req.body.score,
rank: req.body.rank,
historyLog... |
41,016,917 | I am sending a post request to server via ajax:
**result.ejs**
```
$.ajax({
type: "POST",
url: "/result",
data: { score: score, rank: rank, name: name, email: email, historyLog: historyLog }
});
```
I am reciveing it and saving data to the database:
**resultController.js**
```
app.post('/result', ur... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41016917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4038579/"
] | AJAX is usually used precisely when you *don't* want to navigate elsewhere, but talk to the server in the background instead. To still do it your way, use `res.send("done");` *inside* the save callback, right after `console.log('User saved successfully!);`, then add this to your ajax request:
```
success: function () ... | This is working fine to post.
Better use form to post.
```
app.post('/result', function(req, res) {
new user({
name: req.body.name,
email: req.body.email,
score: req.body.score,
rank: req.body.rank,
historyLog: req.body.historyLog
}).save(function(err,doc) {
if (err) throw err;
else {... |
41,016,917 | I am sending a post request to server via ajax:
**result.ejs**
```
$.ajax({
type: "POST",
url: "/result",
data: { score: score, rank: rank, name: name, email: email, historyLog: historyLog }
});
```
I am reciveing it and saving data to the database:
**resultController.js**
```
app.post('/result', ur... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41016917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4038579/"
] | This is working fine to post.
Better use form to post.
```
app.post('/result', function(req, res) {
new user({
name: req.body.name,
email: req.body.email,
score: req.body.score,
rank: req.body.rank,
historyLog: req.body.historyLog
}).save(function(err,doc) {
if (err) throw err;
else {... | If you want to render page after saving - add it in saving callback, like this
```html
app.post('/result', urlencodedParser, function(req, res) {
var user = new User({
name: req.body.name,
email: req.body.email,
score: req.body.score,
rank: req.body.rank,
historyLog... |
448,075 | Show that this sequence $\large f\_n(x)={x^n\over n}$ on
a) $\left]-\infty,\infty\right[ $ is not uniformly convergent.
I have tried showing that the given sequence doesn't converge in this interval and hence not uniformly convergent.
b) $[0,1]$ is uniformly convergent.
I have reached this far :
$$|f\_n(x)-f(x)|=\... | 2013/07/20 | [
"https://math.stackexchange.com/questions/448075",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/74167/"
] | a) Yes since $(f\_n)$ isn't convergent on $\mathbb R$ so itsn't uniformly convergent.
b) To complete:
$$\forall x\in[0,1],\quad|f\_n(x)-f(x)|=|{x^n\over n}-0|\leq \frac{1}{n}\to0$$ | **Hint**: for b)
what is $\lim n \to \infty $ of $x^n$ on $[0,1]$ ? Can you find the pointwise covergence on your own after knowing this limit?
unfiorm convergence : what is the $\sup$ of $ \ \dfrac{x^n} {n } $ on $[0,1]$ ? |
52,062,667 | I am working with an app which embeds a WebGL Player.
```
<body>
<div class="application_layout">
<header class="header clearfix">
<nav class="header__left">
<ul class="clearfix">
<li class="menu__item menu__item--back">
<a title="Back" class="link--back"></a>
</li>... | 2018/08/28 | [
"https://Stackoverflow.com/questions/52062667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033737/"
] | You shouldn't be trying to simulate clicks - you should just tell Capybara to do the click. If you need the click to be offset use the options available to the click method.
```
element.click(x: 200, y: 100)
```
Any time you resort to using JS to fire events on the page you're making your tests less useful/valid sin... | Another option is to use the `rumouse` gem. But it doesn't work with headless, it requires the window focus and the coordinates are system-wide. |
42,709,661 | There is always a `#` in the first column of my header:
```
np.savetxt((self.foldername + '/' + 'XYZ.csv'), XYZ, fmt='%1.6f', delimiter=',',header="X(um),Y(um),Z(nm))
```
I got the header like this
```
#X(um),Y(um),Z(nm)
```
How to avoid the `#`. | 2017/03/10 | [
"https://Stackoverflow.com/questions/42709661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7687979/"
] | Here is the relevant bit from the `loadtxt` docstring describing the `comments` keyword and its effect on the header and other things.
>
> comments : str, optional
> String that will be prepended to the `header` and `footer` strings,
> to mark them as comments. Default: '# ', as expected by e.g.
> `numpy.loadtxt`.... | it inserts the # because that line is a comment, and the default character for comments is the symbol #, as you can read in the documentation [here](https://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html).
If you want to get rid of it, pass comments='' as option to savetxt.
from:
[numpy.savetxt witho... |
36,297,559 | I am new to JBPM. Is there a web based alternative to the JBPM form [modeler](https://github.com/droolsjbpm/jbpm-form-modeler)?
I am looking into customizing a web based form modeler for simple user-customizable form applications. | 2016/03/30 | [
"https://Stackoverflow.com/questions/36297559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1708349/"
] | The JBPM Form Modeller is now part of the Business Central Application (formerly Workbench). But it not changed much.
I know that you can change the render engine and provide complete custom UI implementations (e.g angular UI) that leverage the JBPM-Server REST-Endpoints. But in my experience there exists no alternati... | Take a look at <https://bpmn.io/>
It is a web modeling framework that supports BPMN.
It is the basis for the Camunda web based modeler but can easily be customized for your purposes. |
31,072,414 | I have 3 different model/controllers. I tried to make something like
```
// routes.rb
get ':type' => ':type#show'
```
but as expected, it did not work. I want to route to a controller according to the type specified in URL. How to achieve that? | 2015/06/26 | [
"https://Stackoverflow.com/questions/31072414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974787/"
] | you could create a generic controller and use redirect\_to there to read `params[:type]` and redirect accordingly, but I don't see why you could not just use proper routes in the first place, eg.
```
get '/some_path/:id', to: 'mycontroller#method'
```
if they are standard CRUD controllers, you'd want to consider usi... | It sounds like you're looking to use rails Optional Segment Keys. Rails 3 introduced this syntax for defining optional parts of the URL pattern. Try something like:
```
match ':controller(/:show(/:id))', via: 'get'
```
Put this route last in your routes file since it will act as a catch-all for almost all routes in ... |
31,072,414 | I have 3 different model/controllers. I tried to make something like
```
// routes.rb
get ':type' => ':type#show'
```
but as expected, it did not work. I want to route to a controller according to the type specified in URL. How to achieve that? | 2015/06/26 | [
"https://Stackoverflow.com/questions/31072414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974787/"
] | you could create a generic controller and use redirect\_to there to read `params[:type]` and redirect accordingly, but I don't see why you could not just use proper routes in the first place, eg.
```
get '/some_path/:id', to: 'mycontroller#method'
```
if they are standard CRUD controllers, you'd want to consider usi... | You can use ***constraints***.
```
#routes.rb
get "/type" => "controller_A#show",
:constraints => lambda { |request| request.params[:type] == "A" }
get "/type" => "controller_B#show",
:constraints => lambda { |request| request.params[:type] == "B" }
get "/type" => "controller_C#show",
:constraints => lambda... |
12,661,273 | I have an image model with an attribute :description which is a text, formatted as html text (e.g. with a few
in the text), which I display in a view as follows:
```
simple_format(@image.description)
```
raw(@image.description) will do mainly the same I think. How can I add a link\_to helper with a link into tha... | 2012/09/30 | [
"https://Stackoverflow.com/questions/12661273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/929062/"
] | Use ERB:
```
<%= raw ERB.new(@image.description).result(binding) %>
```
Wrap it in a helper method:
```
module ApplicationHelper
def simple_format(content)
ERB.new(content).result(binding).html_safe
end
end
```
And use it like:
```
<%= simple_format(@image.description) %>
```
Some example content you c... | You can do this with this bit of code
```
link_to raw(@image.description), @image.link
```
If you need select only one random word:
```
words = @image.description.split
link_to raw(words.sample), @image.link
```
**UPDATE:**
For example when you create description you can add special symbols to word which you ca... |
12,292,761 | So, I see a few questions on stackoverflow asking in one way or another how to "kill" a future, a la the deprecated Thread.stop(). I see answers explaining why it's impossible, but not an alternative mechanism to solve similar problems.
For example: [Practical use of futures? Ie, how to kill them?](https://stackoverfl... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349540/"
] | Rename your .php file to .html and add this line in your .htaccess
```
AddType application/x-httpd-php .html .htm
``` | You need to add /ver1/ in both places - "^(.*).php$" -> "^/ver1/(.*).php$"
But that line just turns off the .php version - you never copied the line that tells it to actually serve the PHP files under the different extension (RewriteRule ^(.\*).html$ $1.php)
```
RewriteEngine on
RewriteRule ^/ver1/(.*)\.html$ /ver1/... |
12,292,761 | So, I see a few questions on stackoverflow asking in one way or another how to "kill" a future, a la the deprecated Thread.stop(). I see answers explaining why it's impossible, but not an alternative mechanism to solve similar problems.
For example: [Practical use of futures? Ie, how to kill them?](https://stackoverfl... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349540/"
] | You need to add /ver1/ in both places - "^(.*).php$" -> "^/ver1/(.*).php$"
But that line just turns off the .php version - you never copied the line that tells it to actually serve the PHP files under the different extension (RewriteRule ^(.\*).html$ $1.php)
```
RewriteEngine on
RewriteRule ^/ver1/(.*)\.html$ /ver1/... | ```
RewriteRule ^(.*)\.html$ $1.php [nc]
``` |
12,292,761 | So, I see a few questions on stackoverflow asking in one way or another how to "kill" a future, a la the deprecated Thread.stop(). I see answers explaining why it's impossible, but not an alternative mechanism to solve similar problems.
For example: [Practical use of futures? Ie, how to kill them?](https://stackoverfl... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349540/"
] | Rename your .php file to .html and add this line in your .htaccess
```
AddType application/x-httpd-php .html .htm
``` | Are you looking for "How do I rewrite .php to .html using .htaccess rules"????????????????
If yes, use
```
RewriteEngine on
RewriteRule ^(.*)\.html$ /ver1/$1.php [nc]
``` |
12,292,761 | So, I see a few questions on stackoverflow asking in one way or another how to "kill" a future, a la the deprecated Thread.stop(). I see answers explaining why it's impossible, but not an alternative mechanism to solve similar problems.
For example: [Practical use of futures? Ie, how to kill them?](https://stackoverfl... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349540/"
] | Rename your .php file to .html and add this line in your .htaccess
```
AddType application/x-httpd-php .html .htm
``` | ```
RewriteRule ^(.*)\.html$ $1.php [nc]
``` |
12,292,761 | So, I see a few questions on stackoverflow asking in one way or another how to "kill" a future, a la the deprecated Thread.stop(). I see answers explaining why it's impossible, but not an alternative mechanism to solve similar problems.
For example: [Practical use of futures? Ie, how to kill them?](https://stackoverfl... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349540/"
] | Rename your .php file to .html and add this line in your .htaccess
```
AddType application/x-httpd-php .html .htm
``` | Try it on .htaccess:
```
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*)\.html$ /$1.php
``` |
12,292,761 | So, I see a few questions on stackoverflow asking in one way or another how to "kill" a future, a la the deprecated Thread.stop(). I see answers explaining why it's impossible, but not an alternative mechanism to solve similar problems.
For example: [Practical use of futures? Ie, how to kill them?](https://stackoverfl... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349540/"
] | Are you looking for "How do I rewrite .php to .html using .htaccess rules"????????????????
If yes, use
```
RewriteEngine on
RewriteRule ^(.*)\.html$ /ver1/$1.php [nc]
``` | ```
RewriteRule ^(.*)\.html$ $1.php [nc]
``` |
12,292,761 | So, I see a few questions on stackoverflow asking in one way or another how to "kill" a future, a la the deprecated Thread.stop(). I see answers explaining why it's impossible, but not an alternative mechanism to solve similar problems.
For example: [Practical use of futures? Ie, how to kill them?](https://stackoverfl... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/349540/"
] | Try it on .htaccess:
```
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*)\.html$ /$1.php
``` | ```
RewriteRule ^(.*)\.html$ $1.php [nc]
``` |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | EDIT (For others):
Using the `sdkmanager` tool instead of the deprecated `android` tool prevents the validation error. It looks like someone at Google forgot to update the checksums of SDK Platform 8.1.0 for the `android` tool.
EDIT (For Travis CI):
Current recommended workaround is to add
```
before_install:
- y... | I had the exact same issue. A clear cache (tools->options..->Clear cache) and restart of sdk manager solved it. |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | Leo Li's instructions worked for me, too. Thanks for the info!
When download fails, you can notice a temp folder for this path:
"C:\Program Files (x86)\Android\android-sdk\temp".
There should be a file called platform-27\_r01.zip. Copy it out and extract the android-8.1.0 folder.
The next step, rename it to androi... | Had this same issue three weeks ago. Tried again last week. SDK 8.1 installed properly with Android SDK Manager. Google apparently included an incorrect checksum that has been subsequently corrected. Try the download again, it should work. |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | EDIT (For others):
Using the `sdkmanager` tool instead of the deprecated `android` tool prevents the validation error. It looks like someone at Google forgot to update the checksums of SDK Platform 8.1.0 for the `android` tool.
EDIT (For Travis CI):
Current recommended workaround is to add
```
before_install:
- y... | Leo Li's instructions worked for me, too. Thanks for the info!
When download fails, you can notice a temp folder for this path:
"C:\Program Files (x86)\Android\android-sdk\temp".
There should be a file called platform-27\_r01.zip. Copy it out and extract the android-8.1.0 folder.
The next step, rename it to androi... |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | When download fails, you can notice a temp folder for this path:"C:\Program Files (x86)\Android\android-sdk\temp". There should be a file called "platform-27\_r01.zip". Copy it out and extract the "android-8.1.0" folder.
The next step, rename it to "android-27". Then, copy it to the path "C:\Program Files (x86)\Android... | EDIT (For others):
Using the `sdkmanager` tool instead of the deprecated `android` tool prevents the validation error. It looks like someone at Google forgot to update the checksums of SDK Platform 8.1.0 for the `android` tool.
EDIT (For Travis CI):
Current recommended workaround is to add
```
before_install:
- y... |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | Leo Li's instructions worked for me, too. Thanks for the info!
When download fails, you can notice a temp folder for this path:
"C:\Program Files (x86)\Android\android-sdk\temp".
There should be a file called platform-27\_r01.zip. Copy it out and extract the android-8.1.0 folder.
The next step, rename it to androi... | Leo Li
Thank you so much, it work for me ;-)
When download fails, you can notice a temp folder for this path:
```
"C:\Program Files (x86)\Android\android-sdk\temp".
```
There should be a file called `platform-27_r01.zip`. Copy it out and extract the `android-8.1.0` folder.
The next step, rename it to `android... |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | When download fails, you can notice a temp folder for this path:"C:\Program Files (x86)\Android\android-sdk\temp". There should be a file called "platform-27\_r01.zip". Copy it out and extract the "android-8.1.0" folder.
The next step, rename it to "android-27". Then, copy it to the path "C:\Program Files (x86)\Android... | Leo Li
Thank you so much, it work for me ;-)
When download fails, you can notice a temp folder for this path:
```
"C:\Program Files (x86)\Android\android-sdk\temp".
```
There should be a file called `platform-27_r01.zip`. Copy it out and extract the `android-8.1.0` folder.
The next step, rename it to `android... |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | EDIT (For others):
Using the `sdkmanager` tool instead of the deprecated `android` tool prevents the validation error. It looks like someone at Google forgot to update the checksums of SDK Platform 8.1.0 for the `android` tool.
EDIT (For Travis CI):
Current recommended workaround is to add
```
before_install:
- y... | Leo Li
Thank you so much, it work for me ;-)
When download fails, you can notice a temp folder for this path:
```
"C:\Program Files (x86)\Android\android-sdk\temp".
```
There should be a file called `platform-27_r01.zip`. Copy it out and extract the `android-8.1.0` folder.
The next step, rename it to `android... |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | I had the exact same issue. A clear cache (tools->options..->Clear cache) and restart of sdk manager solved it. | Had this same issue three weeks ago. Tried again last week. SDK 8.1 installed properly with Android SDK Manager. Google apparently included an incorrect checksum that has been subsequently corrected. Try the download again, it should work. |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | Leo Li
Thank you so much, it work for me ;-)
When download fails, you can notice a temp folder for this path:
```
"C:\Program Files (x86)\Android\android-sdk\temp".
```
There should be a file called `platform-27_r01.zip`. Copy it out and extract the `android-8.1.0` folder.
The next step, rename it to `android... | Had this same issue three weeks ago. Tried again last week. SDK 8.1 installed properly with Android SDK Manager. Google apparently included an incorrect checksum that has been subsequently corrected. Try the download again, it should work. |
47,719,427 | I have a module "test.js" which looks like this;
```
export default function main(){
sub_main();
}
export function sub_main(){
//Do something
}
```
I would like to test the method `sub_main` in Jasmine. I have tried to import sub\_main() function to test in Jasmine using `import` statement but Jasmine complies ... | 2017/12/08 | [
"https://Stackoverflow.com/questions/47719427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092629/"
] | When download fails, you can notice a temp folder for this path:"C:\Program Files (x86)\Android\android-sdk\temp". There should be a file called "platform-27\_r01.zip". Copy it out and extract the "android-8.1.0" folder.
The next step, rename it to "android-27". Then, copy it to the path "C:\Program Files (x86)\Android... | Leo Li's instructions worked for me, too. Thanks for the info!
When download fails, you can notice a temp folder for this path:
"C:\Program Files (x86)\Android\android-sdk\temp".
There should be a file called platform-27\_r01.zip. Copy it out and extract the android-8.1.0 folder.
The next step, rename it to androi... |
2,480,919 | How do I remove the first element from a list, in Scheme?
Suppose I have the following list
```
'((apple bob car) (cat dig) (e)))
```
How would I just get rid of `apple` and leave the rest alone? | 2010/03/19 | [
"https://Stackoverflow.com/questions/2480919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The three fundamental list operations in Scheme are
* `cdr`, which means 'rest' or 'give me the list, without the first item'
* `car`, which means 'first' or 'give me the first item in the list'
* `cons`, which means append lists
assuming that s is the list ((apple bob car) (cat dig) (e))
The intermediate steps
``... | `(cdr x)` (where 'x' is a list) will give you all of the list except the first element. The problem with applying it to what you have above is that `apple` isn't the first element of :`'((apple bob car) (cat dig) (e)))`. What you've given is a list of lists, and the first element of the outer list is the list `(apple b... |
2,480,919 | How do I remove the first element from a list, in Scheme?
Suppose I have the following list
```
'((apple bob car) (cat dig) (e)))
```
How would I just get rid of `apple` and leave the rest alone? | 2010/03/19 | [
"https://Stackoverflow.com/questions/2480919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The three fundamental list operations in Scheme are
* `cdr`, which means 'rest' or 'give me the list, without the first item'
* `car`, which means 'first' or 'give me the first item in the list'
* `cons`, which means append lists
assuming that s is the list ((apple bob car) (cat dig) (e))
The intermediate steps
``... | In addition to the other answers, there's a flavor of mutation to your question, and lists in Scheme are generally immutable -- even lists within lists. That's why all the other answers returned a new list sans the element you wanted to be rid of. You can assign a list to a variable, and then assign a different list to... |
2,480,919 | How do I remove the first element from a list, in Scheme?
Suppose I have the following list
```
'((apple bob car) (cat dig) (e)))
```
How would I just get rid of `apple` and leave the rest alone? | 2010/03/19 | [
"https://Stackoverflow.com/questions/2480919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | First, recognise that your question is a bit inconsistent. If you want to remove the first element in the list, you'll be left with
```
((cat dig) (e))
```
because the first element in the list is `(apple bob car)`.
If you're trying to get rid of just `apple`, then if the head (car) of the list is *itself* a list... | `(cdr x)` (where 'x' is a list) will give you all of the list except the first element. The problem with applying it to what you have above is that `apple` isn't the first element of :`'((apple bob car) (cat dig) (e)))`. What you've given is a list of lists, and the first element of the outer list is the list `(apple b... |
2,480,919 | How do I remove the first element from a list, in Scheme?
Suppose I have the following list
```
'((apple bob car) (cat dig) (e)))
```
How would I just get rid of `apple` and leave the rest alone? | 2010/03/19 | [
"https://Stackoverflow.com/questions/2480919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | First, recognise that your question is a bit inconsistent. If you want to remove the first element in the list, you'll be left with
```
((cat dig) (e))
```
because the first element in the list is `(apple bob car)`.
If you're trying to get rid of just `apple`, then if the head (car) of the list is *itself* a list... | In addition to the other answers, there's a flavor of mutation to your question, and lists in Scheme are generally immutable -- even lists within lists. That's why all the other answers returned a new list sans the element you wanted to be rid of. You can assign a list to a variable, and then assign a different list to... |
2,480,919 | How do I remove the first element from a list, in Scheme?
Suppose I have the following list
```
'((apple bob car) (cat dig) (e)))
```
How would I just get rid of `apple` and leave the rest alone? | 2010/03/19 | [
"https://Stackoverflow.com/questions/2480919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In addition to the other answers, there's a flavor of mutation to your question, and lists in Scheme are generally immutable -- even lists within lists. That's why all the other answers returned a new list sans the element you wanted to be rid of. You can assign a list to a variable, and then assign a different list to... | `(cdr x)` (where 'x' is a list) will give you all of the list except the first element. The problem with applying it to what you have above is that `apple` isn't the first element of :`'((apple bob car) (cat dig) (e)))`. What you've given is a list of lists, and the first element of the outer list is the list `(apple b... |
13,554,333 | I have a table `person` in my PostgresSQL database, which contains data of different users.
I need to write a test case, which ensures that some routine does modify the data of user 1, and does not modify data of user 2.
For this purpose, I need to
a) calculate a hash code of all rows of user 1 and those of user 2,... | 2012/11/25 | [
"https://Stackoverflow.com/questions/13554333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/399457/"
] | The simplest way - just concat all the string form `md5` with `string_agg`. But to use this aggregate correctly you must specify `ORDER BY`.
Or use `md5(string_agg(md5(CAST((f.*)AS text)),''))` with some `ORDER BY` - it will change if any field of `f.*` changes and it is cheap to compare. | An even simpler way to do it
```
SELECT user_id, md5(textin(record_out(A))) AS hash
FROM person A
``` |
60,048,382 | I'm coding a PWA for the first time and wonder if my `.htaccess` cache policy isn't about to conflict with my Service Worker Stategies. Here is how it looks in my `.htaccess` file
```
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/gif "access p... | 2020/02/03 | [
"https://Stackoverflow.com/questions/60048382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5075502/"
] | We did testing on Azure and it seems you don't have to configure anything at all as the latest version available on the host machine will be picked up. We hosted another API for which we enabled TLS 1.2 only and made a call from our API to the other one.
Worth noting that the setting on app service for TLS version is o... | You would have to use framework-specific settings to force outbound calls to use TLS 1.2. Based on .NET Core docs, would need to explicitly create and configure an instance of <https://learn.microsoft.com/en-us/dotnet/api/system.net.http.socketshttphandler?view=netcore-2.2>, configuring the SslOptions property on the o... |
46,660,681 | Need to bind my form elements separately for different buttons. Using allowBlank in elements for sending binding conditions and formBind in buttons for binding the buttons. Need to do this like in this simplest way. (ExtJs 4.2.1 Classic)
**Example**
```
Ext.create('Ext.form.Panel', {
......
items: [
Ext.create('E... | 2017/10/10 | [
"https://Stackoverflow.com/questions/46660681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5198305/"
] | I created a fiddle here that I think should accomplish what you're trying to do. The idea to use an event listener on the combobox, instead of the `formBind` config of the `Download` button:
<https://fiddle.sencha.com/#view/editor&fiddle/289a>
```
Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
itemId:... | I have created a [fiddle](https://fiddle.sencha.com/#view/editor&fiddle/283g) for you. The code uses `bind` and `formBind` respectively for the two different buttons. May be you want something like this. |
46,660,681 | Need to bind my form elements separately for different buttons. Using allowBlank in elements for sending binding conditions and formBind in buttons for binding the buttons. Need to do this like in this simplest way. (ExtJs 4.2.1 Classic)
**Example**
```
Ext.create('Ext.form.Panel', {
......
items: [
Ext.create('E... | 2017/10/10 | [
"https://Stackoverflow.com/questions/46660681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5198305/"
] | There is no standard quick way to do this, you might want to write a plugin for this. I've put together one:
```
Ext.define('App.plugin.MultiDisableBind', {
extend: 'Ext.AbstractPlugin',
alias: 'plugin.multidisablebind',
/**
* @cfg
* Reference to the fields that this button depends on.
* Ca... | I have created a [fiddle](https://fiddle.sencha.com/#view/editor&fiddle/283g) for you. The code uses `bind` and `formBind` respectively for the two different buttons. May be you want something like this. |
46,660,681 | Need to bind my form elements separately for different buttons. Using allowBlank in elements for sending binding conditions and formBind in buttons for binding the buttons. Need to do this like in this simplest way. (ExtJs 4.2.1 Classic)
**Example**
```
Ext.create('Ext.form.Panel', {
......
items: [
Ext.create('E... | 2017/10/10 | [
"https://Stackoverflow.com/questions/46660681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5198305/"
] | There is no standard quick way to do this, you might want to write a plugin for this. I've put together one:
```
Ext.define('App.plugin.MultiDisableBind', {
extend: 'Ext.AbstractPlugin',
alias: 'plugin.multidisablebind',
/**
* @cfg
* Reference to the fields that this button depends on.
* Ca... | I created a fiddle here that I think should accomplish what you're trying to do. The idea to use an event listener on the combobox, instead of the `formBind` config of the `Download` button:
<https://fiddle.sencha.com/#view/editor&fiddle/289a>
```
Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
itemId:... |
7,644,943 | Today we can writhe huge web pages that contains many user controls, jquery plugins and a lot of html elements.
Sometimes there is a jquery plugin that create a div and assign Id to it. When using this kind of plugin more then one time - the is situation where two elements has the same id.
Does using "name" is bett... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7644943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | Id and Name have different meanings in the html / DOM standard. Please have a look at the question [Difference between id and name attributes in HTML](https://stackoverflow.com/questions/1397592/difference-between-id-and-name-tag-attributes-html) for more info :) | I believe using classes for jquery elements helps avoid a lot of issues.
Using names, especially with ASP.NET, can cause issues if the controls are ran server side, and therefore rendered differently in the HTML. |
7,644,943 | Today we can writhe huge web pages that contains many user controls, jquery plugins and a lot of html elements.
Sometimes there is a jquery plugin that create a div and assign Id to it. When using this kind of plugin more then one time - the is situation where two elements has the same id.
Does using "name" is bett... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7644943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | There should be no two elements with the same id on a page. For example when you use an id Selector in jQuery like this
```
$('#id')
```
it always returns only one element, regardless of the number of elements with the same id. If you must clone elements, use elements with classes or gerate ids dynamically.
Name i... | I believe using classes for jquery elements helps avoid a lot of issues.
Using names, especially with ASP.NET, can cause issues if the controls are ran server side, and therefore rendered differently in the HTML. |
7,644,943 | Today we can writhe huge web pages that contains many user controls, jquery plugins and a lot of html elements.
Sometimes there is a jquery plugin that create a div and assign Id to it. When using this kind of plugin more then one time - the is situation where two elements has the same id.
Does using "name" is bett... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7644943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | Plugin that generates same ID for DOM elements by design is not worth using - it shows poor programming. Good plugins will always use unique ID, for example by adding some index.
So, just don't use such plugins.
Name is not really relevant for elements outside of a web form - for example `<div>` should not have `na... | I believe using classes for jquery elements helps avoid a lot of issues.
Using names, especially with ASP.NET, can cause issues if the controls are ran server side, and therefore rendered differently in the HTML. |
7,644,943 | Today we can writhe huge web pages that contains many user controls, jquery plugins and a lot of html elements.
Sometimes there is a jquery plugin that create a div and assign Id to it. When using this kind of plugin more then one time - the is situation where two elements has the same id.
Does using "name" is bett... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7644943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | Plugin that generates same ID for DOM elements by design is not worth using - it shows poor programming. Good plugins will always use unique ID, for example by adding some index.
So, just don't use such plugins.
Name is not really relevant for elements outside of a web form - for example `<div>` should not have `na... | Id and Name have different meanings in the html / DOM standard. Please have a look at the question [Difference between id and name attributes in HTML](https://stackoverflow.com/questions/1397592/difference-between-id-and-name-tag-attributes-html) for more info :) |
7,644,943 | Today we can writhe huge web pages that contains many user controls, jquery plugins and a lot of html elements.
Sometimes there is a jquery plugin that create a div and assign Id to it. When using this kind of plugin more then one time - the is situation where two elements has the same id.
Does using "name" is bett... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7644943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | Plugin that generates same ID for DOM elements by design is not worth using - it shows poor programming. Good plugins will always use unique ID, for example by adding some index.
So, just don't use such plugins.
Name is not really relevant for elements outside of a web form - for example `<div>` should not have `na... | There should be no two elements with the same id on a page. For example when you use an id Selector in jQuery like this
```
$('#id')
```
it always returns only one element, regardless of the number of elements with the same id. If you must clone elements, use elements with classes or gerate ids dynamically.
Name i... |
31,407,584 | So Im trying to create a camo unlocker but I have never had trouble with getting process id through findwindow
but now Im trying to find black ops 2's proc id but the window name doesn't work
Call of Duty®: Black Ops II
CODE:
```
#include <iostream>
#include <Windows.h>
#include <tchar.h>
using namespace std;
int... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31407584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3742860/"
] | `FindWindow` works correctly. The possible causes for your problem are:
1. You have an encoding error. You should use the Unicode API:
```
HWND hWnd = FindWindowW(NULL, L"Call of Duty®: Black Ops II - Multiplayer");
```
2. There is no top level window with that window text. Use a tool like Spy++ to check that.
You ... | It looks like the registered symbol could be unicode, you'll want to use [`FindWindowW()`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499.aspx):
>
> Unicode and ANSI names
>
> FindWindowW (Unicode) and FindWindowA (ANSI)
>
>
>
Alternatively, you could use [`FindWindowEx()`](https://msdn.mic... |
31,407,584 | So Im trying to create a camo unlocker but I have never had trouble with getting process id through findwindow
but now Im trying to find black ops 2's proc id but the window name doesn't work
Call of Duty®: Black Ops II
CODE:
```
#include <iostream>
#include <Windows.h>
#include <tchar.h>
using namespace std;
int... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31407584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3742860/"
] | It looks like the registered symbol could be unicode, you'll want to use [`FindWindowW()`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499.aspx):
>
> Unicode and ANSI names
>
> FindWindowW (Unicode) and FindWindowA (ANSI)
>
>
>
Alternatively, you could use [`FindWindowEx()`](https://msdn.mic... | I would try to find the window by class as an application may change its title and class names usually do not have fancy characters. If you do not know them look for some tool (Spy++ + i think it comes with Visual Studio) or create a list with a simple tool using `EnumWindows` and `GetClassName` |
31,407,584 | So Im trying to create a camo unlocker but I have never had trouble with getting process id through findwindow
but now Im trying to find black ops 2's proc id but the window name doesn't work
Call of Duty®: Black Ops II
CODE:
```
#include <iostream>
#include <Windows.h>
#include <tchar.h>
using namespace std;
int... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31407584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3742860/"
] | It looks like the registered symbol could be unicode, you'll want to use [`FindWindowW()`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499.aspx):
>
> Unicode and ANSI names
>
> FindWindowW (Unicode) and FindWindowA (ANSI)
>
>
>
Alternatively, you could use [`FindWindowEx()`](https://msdn.mic... | FindWindowA worked for me :) so I just changed from tchar to the normal HWND hWnd = FindWindowA(0, ("Call of Duty®: Black Ops II - Multiplayer")); |
31,407,584 | So Im trying to create a camo unlocker but I have never had trouble with getting process id through findwindow
but now Im trying to find black ops 2's proc id but the window name doesn't work
Call of Duty®: Black Ops II
CODE:
```
#include <iostream>
#include <Windows.h>
#include <tchar.h>
using namespace std;
int... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31407584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3742860/"
] | `FindWindow` works correctly. The possible causes for your problem are:
1. You have an encoding error. You should use the Unicode API:
```
HWND hWnd = FindWindowW(NULL, L"Call of Duty®: Black Ops II - Multiplayer");
```
2. There is no top level window with that window text. Use a tool like Spy++ to check that.
You ... | I would try to find the window by class as an application may change its title and class names usually do not have fancy characters. If you do not know them look for some tool (Spy++ + i think it comes with Visual Studio) or create a list with a simple tool using `EnumWindows` and `GetClassName` |
31,407,584 | So Im trying to create a camo unlocker but I have never had trouble with getting process id through findwindow
but now Im trying to find black ops 2's proc id but the window name doesn't work
Call of Duty®: Black Ops II
CODE:
```
#include <iostream>
#include <Windows.h>
#include <tchar.h>
using namespace std;
int... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31407584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3742860/"
] | `FindWindow` works correctly. The possible causes for your problem are:
1. You have an encoding error. You should use the Unicode API:
```
HWND hWnd = FindWindowW(NULL, L"Call of Duty®: Black Ops II - Multiplayer");
```
2. There is no top level window with that window text. Use a tool like Spy++ to check that.
You ... | FindWindowA worked for me :) so I just changed from tchar to the normal HWND hWnd = FindWindowA(0, ("Call of Duty®: Black Ops II - Multiplayer")); |
31,407,584 | So Im trying to create a camo unlocker but I have never had trouble with getting process id through findwindow
but now Im trying to find black ops 2's proc id but the window name doesn't work
Call of Duty®: Black Ops II
CODE:
```
#include <iostream>
#include <Windows.h>
#include <tchar.h>
using namespace std;
int... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31407584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3742860/"
] | I would try to find the window by class as an application may change its title and class names usually do not have fancy characters. If you do not know them look for some tool (Spy++ + i think it comes with Visual Studio) or create a list with a simple tool using `EnumWindows` and `GetClassName` | FindWindowA worked for me :) so I just changed from tchar to the normal HWND hWnd = FindWindowA(0, ("Call of Duty®: Black Ops II - Multiplayer")); |
383,152 | Why would we use iron filings to display a magnetic field interaction and then teach this as the unaffected field of a magnet?
Iron affects the field itself. This is analogous to an observer affecting a quantum event through observation.
Magnetic mappers that contain iron anywhere near the proximity of the target to ... | 2018/07/04 | [
"https://electronics.stackexchange.com/questions/383152",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/192802/"
] | There's a general problem in physics that you can't measure anything without changing it. Any attempt to introduce a measuring instrument into an experiment changes the experimental setup, and so alters the results.
So the aim is to choose a measuring instrument that changes the results as little as possible. For exam... | Yes, the filings affect the field. No argument there.
I think the value of this experiment is that physical objects which are familiar, iron filings and a magnet, are used to show the effects of something you cannot see.
Further, I would claim that because the filings line up with lines of flux, they do not change t... |
383,152 | Why would we use iron filings to display a magnetic field interaction and then teach this as the unaffected field of a magnet?
Iron affects the field itself. This is analogous to an observer affecting a quantum event through observation.
Magnetic mappers that contain iron anywhere near the proximity of the target to ... | 2018/07/04 | [
"https://electronics.stackexchange.com/questions/383152",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/192802/"
] | There's a general problem in physics that you can't measure anything without changing it. Any attempt to introduce a measuring instrument into an experiment changes the experimental setup, and so alters the results.
So the aim is to choose a measuring instrument that changes the results as little as possible. For exam... | >
> Could they really be different than what we have been taught?
>
>
>
(I can't say anything about what you have been taught. So I must broaden your question into "Could [X] really be different than what modern theory says, as interpreted by those people most informed on [X], and where applying modern theory abou... |
3,063,319 | I am using google site to retrieve weather information , I want to find values between XML tags. Following code give me weather condition of a city , but I am unable to obtain other parameters such as temperature and if possible explain working of split function implied in the code:
```
import urllib
def getWeather(c... | 2010/06/17 | [
"https://Stackoverflow.com/questions/3063319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366850/"
] | [USE](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454)
[A](https://stackoverflow.com/questions/335250/parsing-xml-with-regex-in-java/335446#335446)
[PARSER](https://stackoverflow.com/questions/2426812/how-can-i-match-xml-tags-and-attributes-with-a-reg... | XML is structured data. You can do *much* better than using string manipulation to fetch data out of it. There are the [sax](http://docs.python.org/library/xml.sax.html), [dom](http://docs.python.org/library/xml.dom.html) and [elementree](http://docs.python.org/library/xml.etree.elementtree.html) modules in the standar... |
3,063,319 | I am using google site to retrieve weather information , I want to find values between XML tags. Following code give me weather condition of a city , but I am unable to obtain other parameters such as temperature and if possible explain working of split function implied in the code:
```
import urllib
def getWeather(c... | 2010/06/17 | [
"https://Stackoverflow.com/questions/3063319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366850/"
] | [USE](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454)
[A](https://stackoverflow.com/questions/335250/parsing-xml-with-regex-in-java/335446#335446)
[PARSER](https://stackoverflow.com/questions/2426812/how-can-i-match-xml-tags-and-attributes-with-a-reg... | I would suggest using an XML Parser, just like Hank Gay suggested. My personal suggestion would be [lxml](http://codespeak.net/lxml/), as I'm currently using it on a project and it extends the very usable ElementTree interface already present in the standard lib (xml.etree).
Lxml includes added support for xpath, xslt... |
3,063,319 | I am using google site to retrieve weather information , I want to find values between XML tags. Following code give me weather condition of a city , but I am unable to obtain other parameters such as temperature and if possible explain working of split function implied in the code:
```
import urllib
def getWeather(c... | 2010/06/17 | [
"https://Stackoverflow.com/questions/3063319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366850/"
] | [USE](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454)
[A](https://stackoverflow.com/questions/335250/parsing-xml-with-regex-in-java/335446#335446)
[PARSER](https://stackoverflow.com/questions/2426812/how-can-i-match-xml-tags-and-attributes-with-a-reg... | Well, here goes - a non-full parser solution for your *particular* case:
```
import urllib
def getWeather(city):
''' given city name or postal code,
return dictionary with current weather conditions
'''
url = 'http://www.google.com/ig/api?weather='
try:
f = urllib.urlopen(url + urllib.... |
3,063,319 | I am using google site to retrieve weather information , I want to find values between XML tags. Following code give me weather condition of a city , but I am unable to obtain other parameters such as temperature and if possible explain working of split function implied in the code:
```
import urllib
def getWeather(c... | 2010/06/17 | [
"https://Stackoverflow.com/questions/3063319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366850/"
] | XML is structured data. You can do *much* better than using string manipulation to fetch data out of it. There are the [sax](http://docs.python.org/library/xml.sax.html), [dom](http://docs.python.org/library/xml.dom.html) and [elementree](http://docs.python.org/library/xml.etree.elementtree.html) modules in the standar... | Well, here goes - a non-full parser solution for your *particular* case:
```
import urllib
def getWeather(city):
''' given city name or postal code,
return dictionary with current weather conditions
'''
url = 'http://www.google.com/ig/api?weather='
try:
f = urllib.urlopen(url + urllib.... |
3,063,319 | I am using google site to retrieve weather information , I want to find values between XML tags. Following code give me weather condition of a city , but I am unable to obtain other parameters such as temperature and if possible explain working of split function implied in the code:
```
import urllib
def getWeather(c... | 2010/06/17 | [
"https://Stackoverflow.com/questions/3063319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366850/"
] | I would suggest using an XML Parser, just like Hank Gay suggested. My personal suggestion would be [lxml](http://codespeak.net/lxml/), as I'm currently using it on a project and it extends the very usable ElementTree interface already present in the standard lib (xml.etree).
Lxml includes added support for xpath, xslt... | Well, here goes - a non-full parser solution for your *particular* case:
```
import urllib
def getWeather(city):
''' given city name or postal code,
return dictionary with current weather conditions
'''
url = 'http://www.google.com/ig/api?weather='
try:
f = urllib.urlopen(url + urllib.... |
7,349,284 | I'm using [date.js.](http://www.datejs.com/)
The line `time_container.innerHTML = Date.now().toString('T');` worked fine, briefly, and is now throwing errors in the Firebug console: `radix must be an integer at least 2 and no greater than 36`. It was certainly working earlier.
Note: The date.js `toString()` function ... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7349284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/209139/"
] | ECMAScript 5 already has a `Date.now()` function that returns the number of milliseconds since January 1, 1970. You're apparently calling that version so the `toString('T')` call is on a number, not a `Date` object. `Number.prototype.toString` can only take a number from 2 to 36 as its argument, which is where the erro... | I had a same error in FireFox.
By changing .toString() method to .toDateString() seems like took care of that problem.
Example: `Date.now().toDateString('M/d/yyyy HH:mm')` |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | Saying that there is no solution is **absolutely** an answer. It's an answer that often needs some sort of explanation as to why it's not possible, but it is certainly an answer to the question. It may or may not be the correct answer, but it's certainly *an* answer.
As for the link, the post is clearly an answer even... | "You can't do that, because of `<link>`" is on the border to a link only answer. This is not a good answer and there is really no valuable information in it. I think I would have flagged this as a link-only answer too. The poster needs to learn to add more information to their answer, to make it meaningful, otherwise t... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | Saying that there is no solution is **absolutely** an answer. It's an answer that often needs some sort of explanation as to why it's not possible, but it is certainly an answer to the question. It may or may not be the correct answer, but it's certainly *an* answer.
As for the link, the post is clearly an answer even... | I declined your flag.
Answers are posts that address the question.
Some questions are simply unanswerable, or at best, [the answer is "This is not possible."](https://stackoverflow.com/questions/14143339/how-can-i-increase-xml-data-type-in-sql-server-2008)
This is one of those answers.
The Not an answer flag should... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | Saying that there is no solution is **absolutely** an answer. It's an answer that often needs some sort of explanation as to why it's not possible, but it is certainly an answer to the question. It may or may not be the correct answer, but it's certainly *an* answer.
As for the link, the post is clearly an answer even... | The answer you flagged doesn't say that there is no answer, it says there is no **guaranteed** way to achieve what the OP wants. The [top answer](https://stackoverflow.com/a/2632297/3920237) in the link you provided uses similar phrasing:
>
> You can't directly determine the location of the main script being
> execu... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | Saying that there is no solution is **absolutely** an answer. It's an answer that often needs some sort of explanation as to why it's not possible, but it is certainly an answer to the question. It may or may not be the correct answer, but it's certainly *an* answer.
As for the link, the post is clearly an answer even... | I'm the author of the reply in question, and I thought I'd try to explain why I answered as I did, and see if it changes either of our opinions. I'd also definitely appreciate feedback from any other participant in this dialogue. (I hope this is an appropriate direction to take this meta post in.)
* In my opinion, it'... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | I declined your flag.
Answers are posts that address the question.
Some questions are simply unanswerable, or at best, [the answer is "This is not possible."](https://stackoverflow.com/questions/14143339/how-can-i-increase-xml-data-type-in-sql-server-2008)
This is one of those answers.
The Not an answer flag should... | "You can't do that, because of `<link>`" is on the border to a link only answer. This is not a good answer and there is really no valuable information in it. I think I would have flagged this as a link-only answer too. The poster needs to learn to add more information to their answer, to make it meaningful, otherwise t... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | The answer you flagged doesn't say that there is no answer, it says there is no **guaranteed** way to achieve what the OP wants. The [top answer](https://stackoverflow.com/a/2632297/3920237) in the link you provided uses similar phrasing:
>
> You can't directly determine the location of the main script being
> execu... | "You can't do that, because of `<link>`" is on the border to a link only answer. This is not a good answer and there is really no valuable information in it. I think I would have flagged this as a link-only answer too. The poster needs to learn to add more information to their answer, to make it meaningful, otherwise t... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | I'm the author of the reply in question, and I thought I'd try to explain why I answered as I did, and see if it changes either of our opinions. I'd also definitely appreciate feedback from any other participant in this dialogue. (I hope this is an appropriate direction to take this meta post in.)
* In my opinion, it'... | "You can't do that, because of `<link>`" is on the border to a link only answer. This is not a good answer and there is really no valuable information in it. I think I would have flagged this as a link-only answer too. The poster needs to learn to add more information to their answer, to make it meaningful, otherwise t... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | I declined your flag.
Answers are posts that address the question.
Some questions are simply unanswerable, or at best, [the answer is "This is not possible."](https://stackoverflow.com/questions/14143339/how-can-i-increase-xml-data-type-in-sql-server-2008)
This is one of those answers.
The Not an answer flag should... | The answer you flagged doesn't say that there is no answer, it says there is no **guaranteed** way to achieve what the OP wants. The [top answer](https://stackoverflow.com/a/2632297/3920237) in the link you provided uses similar phrasing:
>
> You can't directly determine the location of the main script being
> execu... |
277,272 | I flagged this as not an answer:
<https://stackoverflow.com/a/2652160/901641>
For your convenience, I've copied the contents below:
>
> The short answer is that **there is no guaranteed way to get the
> information you want**, however there are heuristics that work almost
> always in practice. You might look at
> ... | 2014/11/19 | [
"https://meta.stackoverflow.com/questions/277272",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/901641/"
] | I'm the author of the reply in question, and I thought I'd try to explain why I answered as I did, and see if it changes either of our opinions. I'd also definitely appreciate feedback from any other participant in this dialogue. (I hope this is an appropriate direction to take this meta post in.)
* In my opinion, it'... | The answer you flagged doesn't say that there is no answer, it says there is no **guaranteed** way to achieve what the OP wants. The [top answer](https://stackoverflow.com/a/2632297/3920237) in the link you provided uses similar phrasing:
>
> You can't directly determine the location of the main script being
> execu... |
8,617,058 | If a user performs an operation, such as deleting items, it removes them from the UI right away and then deletes them from the database on a background thread using TPL. The problem is if the user exits the application before the background thread finishes, the item never actually gets deleted.
Is there a standard way... | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302677/"
] | There is no standard way but since you create a specific Task here it should be easy to put that in a List and build some Exit-logic to Wait for all Tasks in that List.
OK, a sample. Untested and incomplete:
```
// untested
static class CriticalTasks
{
static HashSet<Task> tasks = new HashSet<Task>();
static... | You could store reference to your Task, and wait for it when application is quitting (on Exit events for example).
You could also create a normal thread, make sure you set [IsBackground](http://msdn.microsoft.com/en-us/library/system.threading.thread.isbackground.aspx) to `false` (default value). Process will not quit... |
8,617,058 | If a user performs an operation, such as deleting items, it removes them from the UI right away and then deletes them from the database on a background thread using TPL. The problem is if the user exits the application before the background thread finishes, the item never actually gets deleted.
Is there a standard way... | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302677/"
] | There is no standard way but since you create a specific Task here it should be easy to put that in a List and build some Exit-logic to Wait for all Tasks in that List.
OK, a sample. Untested and incomplete:
```
// untested
static class CriticalTasks
{
static HashSet<Task> tasks = new HashSet<Task>();
static... | ```
var x = Task.Factory.StartNew(() => DAL<MyEntities>.DeleteObject(obj));
```
In form close event:
```
while(!x.IsCompleted){hide form}
```
Or
```
if(!x.IsCompleted)
//cancel exit
``` |
8,617,058 | If a user performs an operation, such as deleting items, it removes them from the UI right away and then deletes them from the database on a background thread using TPL. The problem is if the user exits the application before the background thread finishes, the item never actually gets deleted.
Is there a standard way... | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302677/"
] | There is no standard way but since you create a specific Task here it should be easy to put that in a List and build some Exit-logic to Wait for all Tasks in that List.
OK, a sample. Untested and incomplete:
```
// untested
static class CriticalTasks
{
static HashSet<Task> tasks = new HashSet<Task>();
static... | In lieu of a crappy code example. The answer is you simply cannot. If the application domain begins terminating you have a finite window to perform cleanup tasks before all such tasks are forcefully terminated. Your best course of action is to have some sort of job control that you statefully queue the work into. This ... |
31,740,029 | I am new to Yii framework and I want to know how can I get the module name along with its controller and actions
```
$modules = \Yii::$app->getModules();
```
But I did't get satisfactory result | 2015/07/31 | [
"https://Stackoverflow.com/questions/31740029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4906924/"
] | Why not just use nginx build-in [ngx\_http\_limit\_req\_module](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html)?
e.g. We limit not more than 2 requests per minute from one IP address。
```
http {
limit_req_zone $binary_remote_addr zone=one:10m rate=2r/m;
...
server {
...
location /search/ {
... | Also you can use `resty.limit.conn` and/or `resty.limit.req` modules via Lua <https://nginx-extras.getpagespeed.com/lua/limit-traffic/> |
13,094,373 | Im totally new to assembly and believe it or not, our first assignment is to create snake in assembly. How should i store the snake? should i have it in the stack, or should i place it into some register? I have done some research about this "terrible" language for about 3 days, but cant figure out a good way to start.... | 2012/10/26 | [
"https://Stackoverflow.com/questions/13094373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1195745/"
] | **The head of the snake can be tracked with one pairs of x,y coordinates. And of course you need the current direction of the head.** (The tail needs more than just an x,y pair, probably a circular buffer of x,y pairs is the best bet. Then you don't actually need a tail x,y separate from the history buffer.)
**As @Dan... | >
> How should i store the snake? should i have it in the stack, or should i place it into some register?
>
>
>
Assuming you are talking about a Snake animation / game, the answer is probably neither. You most likely use a 2-D array to represent the cells on the "screen", and represent the snake's body as cells of... |
13,094,373 | Im totally new to assembly and believe it or not, our first assignment is to create snake in assembly. How should i store the snake? should i have it in the stack, or should i place it into some register? I have done some research about this "terrible" language for about 3 days, but cant figure out a good way to start.... | 2012/10/26 | [
"https://Stackoverflow.com/questions/13094373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1195745/"
] | **The head of the snake can be tracked with one pairs of x,y coordinates. And of course you need the current direction of the head.** (The tail needs more than just an x,y pair, probably a circular buffer of x,y pairs is the best bet. Then you don't actually need a tail x,y separate from the history buffer.)
**As @Dan... | I hope that after 6 years it's not an issue any longer, but in my case I based on the pixels. For example, there was the pixel that was assigned to be the head of the snake. I always saved it's location (x axis and y axis), and checked within a loop if there is any painted pixel in the direction of the snake:
* If it ... |
34,788,854 | I have a table in Postgresql with:
```
id qty
1 10
2 11
3 18
4 17
```
I want to add each row a number starting from 1
meaning I want:
```
id qty
1 11 / 10+1
2 13 /11 +2
3 21 /18 +3
4 21 /17+4
```
first row gets +1, second row +2 , third row +3 etc...
It should be something like:
```
upd... | 2016/01/14 | [
"https://Stackoverflow.com/questions/34788854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1712099/"
] | Using windowed function `ROW_NUMBER` will handle gaps in `id`:
```
CREATE TABLE Table_a(id INT PRIMARY KEY, qty INT);
INSERT INTO Table_a(id, qty)
SELECT 1 , 10
UNION ALL SELECT 2 , 11
UNION ALL SELECT 3 , 18
UNION ALL SELECT 4 , 17;
WITH cte AS
(
SELECT *, ROW_NUMBER() OVER(ORDER BY id) AS r
FROM Table_a
)
UP... | If your ID's are continuously , than basically the easiest way to do it and the most efficient one:
```
UPDATE table set qty = qty+id;
``` |
34,788,854 | I have a table in Postgresql with:
```
id qty
1 10
2 11
3 18
4 17
```
I want to add each row a number starting from 1
meaning I want:
```
id qty
1 11 / 10+1
2 13 /11 +2
3 21 /18 +3
4 21 /17+4
```
first row gets +1, second row +2 , third row +3 etc...
It should be something like:
```
upd... | 2016/01/14 | [
"https://Stackoverflow.com/questions/34788854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1712099/"
] | If column ID is unique then you can use the following way
```
UPDATE Table_a a
SET qty = qty + b.rn
FROM (
SELECT id,ROW_NUMBER() OVER (ORDER BY id) rn
FROM Table_a
) b
WHERE a.id = b.id
```
---
[`ROW_NUMBER()`](http://www.postgresql.org/docs/9.4/static/functions-window.html)
>
> assigns unique number... | Using windowed function `ROW_NUMBER` will handle gaps in `id`:
```
CREATE TABLE Table_a(id INT PRIMARY KEY, qty INT);
INSERT INTO Table_a(id, qty)
SELECT 1 , 10
UNION ALL SELECT 2 , 11
UNION ALL SELECT 3 , 18
UNION ALL SELECT 4 , 17;
WITH cte AS
(
SELECT *, ROW_NUMBER() OVER(ORDER BY id) AS r
FROM Table_a
)
UP... |
34,788,854 | I have a table in Postgresql with:
```
id qty
1 10
2 11
3 18
4 17
```
I want to add each row a number starting from 1
meaning I want:
```
id qty
1 11 / 10+1
2 13 /11 +2
3 21 /18 +3
4 21 /17+4
```
first row gets +1, second row +2 , third row +3 etc...
It should be something like:
```
upd... | 2016/01/14 | [
"https://Stackoverflow.com/questions/34788854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1712099/"
] | If column ID is unique then you can use the following way
```
UPDATE Table_a a
SET qty = qty + b.rn
FROM (
SELECT id,ROW_NUMBER() OVER (ORDER BY id) rn
FROM Table_a
) b
WHERE a.id = b.id
```
---
[`ROW_NUMBER()`](http://www.postgresql.org/docs/9.4/static/functions-window.html)
>
> assigns unique number... | If your ID's are continuously , than basically the easiest way to do it and the most efficient one:
```
UPDATE table set qty = qty+id;
``` |
147,460 | I'm trying to get a gist of how much a large ec2 instant ( 64bit 4GB RAM ) would cost, without the bandwidth & incoming/outgoing requests.
If i were to start an instant and keep it running for a day, how much would it cost me ? | 2010/06/02 | [
"https://serverfault.com/questions/147460",
"https://serverfault.com",
"https://serverfault.com/users/32518/"
] | $8.16 \*ix, $11.52 Windows. | As Matthew said.
See <http://aws.amazon.com/ec2/#pricing> |
147,460 | I'm trying to get a gist of how much a large ec2 instant ( 64bit 4GB RAM ) would cost, without the bandwidth & incoming/outgoing requests.
If i were to start an instant and keep it running for a day, how much would it cost me ? | 2010/06/02 | [
"https://serverfault.com/questions/147460",
"https://serverfault.com",
"https://serverfault.com/users/32518/"
] | Depends on whether you want a fixed price instance, in which case the current daily rate is as Matthew says, or if you're prepared to use a [spot priced instance](http://aws.amazon.com/ec2/spot-instances/), where you bid a maximum price and get a running instance as long as Amazon's spot price for that instance type (w... | As Matthew said.
See <http://aws.amazon.com/ec2/#pricing> |
1,446,316 | Let $X$ be a metrisable (compact) topological space and $f\colon X\to X$ continuous.
>
>
> >
> > Show: If $A$ is an attractor for $f$, then there exists an open neighborhood $V$ of $A$ such that $\omega(x)\subset A$ for all $x\in V$.
> >
> >
> >
>
>
>
---
Here are the involved definitions:
>
>
> >
> > ... | 2015/09/22 | [
"https://math.stackexchange.com/questions/1446316",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/251995/"
] | An idea: $\def\cl #1{\overline{#1}}$Suppose that $N = 1$. Put $B\_n(x) := \{f^{n\_k}(x): n\_k ≥ n\}$. We have $B\_n(x) ⊆ f^n(V)$ and $ω(x) ⊆ \cl{B\_n} ⊆ \cl{f^n(V)} = f^n(\cl{V})$. Hence, $ω(x) ⊆ \bigcap\_{n ∈ ω} f^n(\cl{V})$. | Suggestion: Suppose that $f$ is a homeomorphism.
Let's first assume that $V$ is closed.
Let $f^N(V)\subset V$, $N$ arbitrary and consider
$$
V'=\bigcap\_{n=0}^{N-1}f^n(V).
$$
Then $V'$ is closed, $A\subset V'$, $f(V')\subset V'$, $A=\bigcap\_{n\in\mathbb{N}}f^n(V')$ and $V'$ is a neighborhood of $A$. To see the latte... |
2,962,745 | I read this quote in one of the webpages:
>
> If you are writing a large
> application, consider dividing it into
> a suite of applications and services.
> Smaller applications load faster and
> use fewer resources. Making a suite of
> applications, content providers, and
> services makes your code more open to... | 2010/06/03 | [
"https://Stackoverflow.com/questions/2962745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82368/"
] | Well technically this has no `best` answer.
But I would go with many small apps:
* easier to update (you update only components you need, less bandwidth too)
* more spot in the Market for your products
* more rating to your person as a developer
* increased monetization
* keep as many sub apps as possible to old SDK ... | As for me I also prefer many small applications instead of *one big to rule them all*. Depending on the requirements the one big approach has one advantage and that is:
* You only need to install one app.
Apart from that I can't see any other reason. |
57,523,683 | I am following the guide of 'Automate the Boring Stuff with Python'
practicing a project called 'Project: “I’m Feeling Lucky” Google Search'
but the CSS selector returns nothing
```
import requests,sys,webbrowser,bs4,pyperclip
if len(sys.argv) > 1:
address = ' '.join(sys.argv[1:])
else:
address = pyperclip.p... | 2019/08/16 | [
"https://Stackoverflow.com/questions/57523683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11935728/"
] | To get version of HTML where it's defined class `r`, it's necessary to set `User-Agent` in headers:
```
import requests
from bs4 import BeautifulSoup
address = 'linux'
headers={'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0'}
res = requests.get('http://google.com/search?... | The reason why Google blocks your request is because default requests user-agent is [`python-requests`](https://github.com/psf/requests/blob/589c4547338b592b1fb77c65663d8aa6fbb7e38b/requests/utils.py#L808-L814). [Check what's your `user-agent`](https://www.whatismybrowser.com/detect/what-is-my-user-agent) thus blocking... |
49,420,337 | I have an Access Query which is built using 1 Raw Data Table to look at credit and cancellation charges.
**I am trying to populate a 'Reason Code' field in this Query by searching the 'Description' field for various keywords.**
For example, if the 'Description' field contains 'Error' then the 'Reason Code' field sh... | 2018/03/22 | [
"https://Stackoverflow.com/questions/49420337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5416380/"
] | `sortedVolts = volts` does not create a copy of the array, it creates another variable which references the same array.
To make it work, you need to make atleast a shallow copy of `volts`, which can be done my `sortedVolts = [ ...volts ]`
```js
var volts = [];
var sortedVolts;
for (var count = 0; count < 3; count+... | You are assigning `volts` to the `sortedVolts` variable. You should copy the array instead using `slice()`. Answered in [this question](https://stackoverflow.com/questions/7486085/copying-array-by-value-in-javascript). |
49,420,337 | I have an Access Query which is built using 1 Raw Data Table to look at credit and cancellation charges.
**I am trying to populate a 'Reason Code' field in this Query by searching the 'Description' field for various keywords.**
For example, if the 'Description' field contains 'Error' then the 'Reason Code' field sh... | 2018/03/22 | [
"https://Stackoverflow.com/questions/49420337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5416380/"
] | You are assigning `volts` to the `sortedVolts` variable. You should copy the array instead using `slice()`. Answered in [this question](https://stackoverflow.com/questions/7486085/copying-array-by-value-in-javascript). | It's happening because of the **call by sharing** evaluation strategy used by JavaScript.
Both variables are pointing to same address in the memory.
Create a copy of volts array and then sort it with Array.sort |
49,420,337 | I have an Access Query which is built using 1 Raw Data Table to look at credit and cancellation charges.
**I am trying to populate a 'Reason Code' field in this Query by searching the 'Description' field for various keywords.**
For example, if the 'Description' field contains 'Error' then the 'Reason Code' field sh... | 2018/03/22 | [
"https://Stackoverflow.com/questions/49420337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5416380/"
] | `sortedVolts = volts` does not create a copy of the array, it creates another variable which references the same array.
To make it work, you need to make atleast a shallow copy of `volts`, which can be done my `sortedVolts = [ ...volts ]`
```js
var volts = [];
var sortedVolts;
for (var count = 0; count < 3; count+... | It's happening because of the **call by sharing** evaluation strategy used by JavaScript.
Both variables are pointing to same address in the memory.
Create a copy of volts array and then sort it with Array.sort |
24,190,065 | Using Selenium / C#
I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it.
I have the below to try and select this:
```
public static void Userloggedin()
{
var us... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24190065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3451887/"
] | Per documentation: <http://wiki.helioviewer.org/wiki/Apache_Cassandra_Installation>
>
> **Set JAVA\_HOME**
>
>
> Make sure JAVA\_HOME is set: echo $JAVA\_HOME
>
>
>
So make sure `JAVA_HOME` is pointing to `/path/to/jdk7` | I have faced a similar issue when installing DSE 4.6 on Linux. Issue is resolved when you set JAVA\_HOME (as root) to the directory where JRE 1.7.x installed. |
24,190,065 | Using Selenium / C#
I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it.
I have the below to try and select this:
```
public static void Userloggedin()
{
var us... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24190065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3451887/"
] | See this [CASSANDRA-11716](https://issues.apache.org/jira/browse/CASSANDRA-11716) issue. The solution posted there worked for me. | I have faced a similar issue when installing DSE 4.6 on Linux. Issue is resolved when you set JAVA\_HOME (as root) to the directory where JRE 1.7.x installed. |
24,190,065 | Using Selenium / C#
I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it.
I have the below to try and select this:
```
public static void Userloggedin()
{
var us... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24190065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3451887/"
] | I got the same error message when trying to start Cassandra. But I notised that I only got the error when starting Cassandra as root. It worked when I started Cassandra as my local user.
It turned out that java only was configured for my local user:
```
$ java -version
java version "1.7.0_60"
Java(TM) SE Runtime Envi... | See this [CASSANDRA-11716](https://issues.apache.org/jira/browse/CASSANDRA-11716) issue. The solution posted there worked for me. |
24,190,065 | Using Selenium / C#
I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it.
I have the below to try and select this:
```
public static void Userloggedin()
{
var us... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24190065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3451887/"
] | To resolve this problem I changed $JAVA\_HOME environment variable to the path I found it from:
```
System Preferences -> Java -> java (tab in Java Control Panel) -> View -> Path
```
I had two version of java and the default one was the old version of java. | I have faced a similar issue when installing DSE 4.6 on Linux. Issue is resolved when you set JAVA\_HOME (as root) to the directory where JRE 1.7.x installed. |
24,190,065 | Using Selenium / C#
I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it.
I have the below to try and select this:
```
public static void Userloggedin()
{
var us... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24190065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3451887/"
] | I got the same error message when trying to start Cassandra. But I notised that I only got the error when starting Cassandra as root. It worked when I started Cassandra as my local user.
It turned out that java only was configured for my local user:
```
$ java -version
java version "1.7.0_60"
Java(TM) SE Runtime Envi... | This is caused by a bug in Cassandra: <https://issues.apache.org/jira/browse/CASSANDRA-11661> |
24,190,065 | Using Selenium / C#
I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it.
I have the below to try and select this:
```
public static void Userloggedin()
{
var us... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24190065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3451887/"
] | Per documentation: <http://wiki.helioviewer.org/wiki/Apache_Cassandra_Installation>
>
> **Set JAVA\_HOME**
>
>
> Make sure JAVA\_HOME is set: echo $JAVA\_HOME
>
>
>
So make sure `JAVA_HOME` is pointing to `/path/to/jdk7` | This is caused by a bug in Cassandra: <https://issues.apache.org/jira/browse/CASSANDRA-11661> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.