Using Views: how to display all node edits made by user X while excluding the "first time created" nodes (original node revision)

Question: For my content type I have enabled support for revisions. When I make view it displays the revisions along with nodes created by user. Is there any way to get only the list of edited nodes. If user created node and then edited it, I just want to show users edits only.  please suggest?
UPDATE EXPORT VIEWS CODE :
<code>$view = new view();
$view->name = 'tetstststst';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'tetstststst';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'tetstststst';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '200';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
  'title' => 'title',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
  'title' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
);
/* Header: Global: Result summary */
$handler->display->display_options['header']['result']['id'] = 'result';
$handler->display->display_options['header']['result']['table'] = 'views';
$handler->display->display_options['header']['result']['field'] = 'result';
$handler->display->display_options['header']['result']['content'] = 'Displaying  @total';
/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Field: Content revision: Title */
$handler->display->display_options['fields']['title_1']['id'] = 'title_1';
$handler->display->display_options['fields']['title_1']['table'] = 'node_revision';
$handler->display->display_options['fields']['title_1']['field'] = 'title';
$handler->display->display_options['fields']['title_1']['label'] = '';
$handler->display->display_options['fields']['title_1']['alter']['path'] = '[link_to_revision] ';
$handler->display->display_options['fields']['title_1']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title_1']['link_to_node_revision'] = TRUE;
/* Field: Content: Updated date */
$handler->display->display_options['fields']['changed']['id'] = 'changed';
$handler->display->display_options['fields']['changed']['table'] = 'node';
$handler->display->display_options['fields']['changed']['field'] = 'changed';
$handler->display->display_options['fields']['changed']['date_format'] = 'long';
$handler->display->display_options['fields']['changed']['second_date_format'] = 'long';
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Contextual filter: User: Uid */
$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'users';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['relationship'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_action'] = 'default';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'user';
$handler->display->display_options['arguments']['uid']['default_argument_options']['user'] = FALSE;
$handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'link' => 'link',
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'tetstststst';
</code>
EXPORT VIEWS CODE [updated - taken from oksana-c's example]:
<code>$view = new view();
$view->name = 'content_revisions';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node_revision';
$view->human_name = 'Content Revisions';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Content Revisions';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'view revisions';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
  'timestamp' => 'timestamp',
  'title' => 'title',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
  'timestamp' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'title' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
);
/* Relationship: Content revision: Content */
$handler->display->display_options['relationships']['vid']['id'] = 'vid';
$handler->display->display_options['relationships']['vid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['vid']['field'] = 'vid';
/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Field: Content revision: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node_revision';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['title']['link_to_node_revision'] = TRUE;
/* Field: Content revision: Updated date */
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['table'] = 'node_revision';
$handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['timestamp']['alter']['ellipsis'] = FALSE;
/* Sort criterion: Content revision: Updated date */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'node_revision';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
/* Contextual filter: User: Uid */
$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'users';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['relationship'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_action'] = 'default';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'user';
$handler->display->display_options['arguments']['uid']['default_argument_options']['user'] = FALSE;
$handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Post date */
$handler->display->display_options['filters']['created']['id'] = 'created';
$handler->display->display_options['filters']['created']['table'] = 'node';
$handler->display->display_options['filters']['created']['field'] = 'created';
$handler->display->display_options['filters']['created']['relationship'] = 'vid';
$handler->display->display_options['filters']['created']['operator'] = 'empty';

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block_1');
</code>
RESULTS FROM UPDATED VIEW
Comment: Just need list of all nodes edited by user. I am not sure what is unclear with question, please comment I can explain. By default node_revisions table store first revision whenever node is created but I need only edits made by user. So I just want to exclude that first revision which get created whenever any user creates node  and trying to get list of edits made by user. Thanks !
Comment: The problem is solved and many thanks to [oksana-c](http://drupal.stackexchange.com/users/49935/oksana-c) who made this working and really appreciate his efforts and starting discussion in chat !!
Answer: UPDATE: Original answer was completely overridden as the embedded view export did not produce desired results. Below is the View Export that produced desired results and some insight on

how to display all node edits made by user X while excluding the
  "first time created" nodes (original node revision).

Here's a little PROLOGUE:
Every time the node is edited - a new revision is created (you can bring your revisioning methods one level up by installing Revisioning module). So essentially each edit is a revision including the original node version, which also has it's own revision number. Even though revision info ais accessible through Views, there is no default method to differentiate the Original Revision (revision where node was created first) from other revisions in Views. This is because there are no fields that you can query that will tell you that the revision is the original node version. The only field that one can use for differentiating original version from revisioned version is "Node's Created Date". Unfortunately we cannot query this field in Views when we use revisioning and the only way to filter out the original versions of nodes from a View is to compare "created" date and "updated date".
SOLUTION:
This task requires a custom Views filter, which will query "created date" of each node and compare it with "updated date" from the node's revision.
The quick way of doing this is to install Views PHP module and use Global:PHP filter in View to query and compare dates. Warning: Views PHP may affect View performance significantly depending on the amount of results that should be processed.
The right way of doing this is to create custom Views filter handler. Some info on it here and here.
So here it is - the updated View Export that displays all revisions + dates of user X while filtering out Original Node Version. This View requires Views PHP module.
<code>    $view = new view();
$view->name = 'content_revisions';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node_revision';
$view->human_name = 'Content Revisions';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Content Revisions';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'view revisions';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '200';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
  'timestamp' => 'timestamp',
  'title' => 'title',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
  'timestamp' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'title' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
);
/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Relationship: Content revision: Content */
$handler->display->display_options['relationships']['vid']['id'] = 'vid';
$handler->display->display_options['relationships']['vid']['table'] = 'node_revision';
$handler->display->display_options['relationships']['vid']['field'] = 'vid';
/* Field: Content revision: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node_revision';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['link_to_node_revision'] = TRUE;
/* Field: Content revision: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node_revision';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['exclude'] = TRUE;
$handler->display->display_options['fields']['nid']['element_label_colon'] = FALSE;
/* Field: Content revision: Updated date */
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['table'] = 'node_revision';
$handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['fields']['timestamp']['date_format'] = 'custom';
$handler->display->display_options['fields']['timestamp']['custom_date_format'] = 'm/d/y H:i:s T';
$handler->display->display_options['fields']['timestamp']['second_date_format'] = 'long';
/* Sort criterion: Content revision: Updated date */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'node_revision';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
/* Contextual filter: User: Uid */
$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'users';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['relationship'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_action'] = 'default';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'user';
$handler->display->display_options['arguments']['uid']['default_argument_options']['user'] = FALSE;
$handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
/* Contextual filter: Content: Nid */
$handler->display->display_options['arguments']['nid']['id'] = 'nid';
$handler->display->display_options['arguments']['nid']['table'] = 'node';
$handler->display->display_options['arguments']['nid']['field'] = 'nid';
$handler->display->display_options['arguments']['nid']['relationship'] = 'vid';
$handler->display->display_options['arguments']['nid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Global: PHP */
$handler->display->display_options['filters']['php']['id'] = 'php';
$handler->display->display_options['filters']['php']['table'] = 'views';
$handler->display->display_options['filters']['php']['field'] = 'php';
$handler->display->display_options['filters']['php']['use_php_setup'] = 0;
$handler->display->display_options['filters']['php']['php_filter'] = '$node = node_load($row->nid);
$timestamp_original = $node->created;
$timestamp_edit = $row->timestamp;
if ($timestamp_original != $timestamp_edit) { return FALSE; }
else return TRUE;';
</code>
Comment: Thanks for try I have voted 1 for your efforst and help. but when I tired more details it shows only revision created of own content not the revisions or edits made on nodes of other people or own.
Comment: that is weird. That same view for me shows title and the date of performed edit of all nodes that are edited by the user, whether nodes were created by that user or other users.  You said you tried to add more details to the view? Can you show the export of the modified view? And can you explain where you showing this view? I assume on user's profile, because otherwise Context Filter of User ID from URL wouldnt make much sense.
Comment: I have not done much changes but I have tried and I am very sure that its not showing all edits. Please let me know I am doing something wrong. I have updated question with view code. Thanks
Comment: Like in screenshot I passed uid 735 and it shows only 4 nodes but I have made revisions on few nodes now for testing by user login 735 so those edits are not displaying in my case. For more details when edit made on own link it displays but when edit made on others link it doesn't.
Comment: I have updated question with new export code which is showing all relevant edits, can you please look at that one to remove node created ie: first time created nodes as revision entery
Comment: Ok, I see that with my filter "Post Date = empty) the view doesnt show the last edit, so that filter will not work as the last edit has Post Date and all other archived revisions dont have it. So my version of the view needs work. Your updated code shows only last revision (can be either last edit or node that wasn't edited yet, but it is published) - because of the filter "Content Published: Yes". So you approach with filter "Publushed - Yes" will not work because it will not list "all" edits made by user.
Comment: Please clarify - you need to list ALL edits made by user even if it means that nodes with multiple edits will show up in your view multiple times? And also remove nodes that weren't edited at all (a.k.a. "first time created")?
Comment: yes your last comment is exactly I am after, need to show all edits wether on own node or o other users node's. Its not a problem if repeted node shown as those will be revisions and   And also remove nodes that weren't edited at all (a.k.a. "first time created"). Please suggest if we can make something like this.
Comment: updated the answer, hope it helps you to reach your goals
Comment: I am very thankful for your efforts, please let me what kind of filter I need to create as when I import view it gives this **Field handler node.number_of_revisions is not available.** , I have already installed views php and will make custom filter later as you mentioned. Is something I need to before importing this view, please suggest . Thanks!
Comment: I also do not have installed *Revisioning module* but just  in D7 content type I have checked that revisions are allowed for content type like in my screenshot in updated question. And all loged-in users ie: editors have permissions to make revisions.
Comment: I updated the answer again, my view contained some fields that Revisioning module provides. It is not necessary to install it to produce the results that you want. Try updated export
Comment: Thanks again ! this view worked but now one more problem occurred. It removed the user nodes which have no revisions ie: first time revision when node is created.  **Problem:  but now the nodes of user which have revisions ie: edited but by other users keep appearing in view. ie: Node created by user appear if someone else has edited his node.** Hope you can suggest something to solve this.
Comment: ie: logic to remove nodes which have not being edited worked but if node is edited by other users and not edited by owner or viewed user or current user, node keeps appearing.
Comment: The View that I attached is tested on two different websites with completely different configurations of modules and it works as expected. The problem you describing must be connected to your setup or your modifications on the view. Keep in mind that one User Id must be provided as context for this View to show edits of only one User.
Comment: Yes thanks again but I think I am not able to clear my point  , suppose user id 7 has node and we are currently viewing user 7 with our this view. Node of user 7 is not edited by himself but suppose user 8 edited it then the node is showing in current view although it's not edit made by user 7 please try like this. Ideal solution I think is to check uid of user made edit and current uid for which we fetch view. Hope I am able to clear my point. Again thanks for continued efforts , I am also trying. You really helping lot , I will soon mark accept to help others as well, once I got it on place.
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/34439/discussion-between-oksana-c-and-jas).


Multipart Form Fields - Taxonomy Included

Question: I'm starting out a new project and I think I've come across something like it before but I can't think of the right search terms or something along those lines...
What I'd like is a module to add multiple fields to one node field. So like a text field and a taxonomy field where I can add multiple of both the taxonomy value and the combined row of the text and taxonomy fields.
I'm near certain I once dealt with something like this once before but I cannot think of it for the life of me.
I have found this: https://www.drupal.org/project/multifield but the problem with this is that it only allows for only ONE value in each field (aka ruining my chances for using it with taxonomy).
So if anyone's run into something similar or can think of a solution to my predicament I would be incredibly grateful for some help. Thanks!
Answer: You can use Field collection module
Tutorial:
Using Field Collection In Drupal 7


Is a $0$-category best viewed as a set, or a setoid?

Question: I'm way, WAY out of my depth with this question, but curiosity got the better of me.
Anyway.
I've heard that $0$-categories are basically just sets. This seems wrong to me, since sets are kind of like "skeletal" setoids. Thus, since we don't assume every $1$-category is skeletal, similarly I don't think we should assume that every $0$-category is a set.
So, are $0$-categories best viewed as sets, or setoids?
Please keep answers as non-technical as possible, since I know absolutely nothing about the subject matter.
Answer: When talking about categories, one often considers that things that aren't preserved by equivalence are things that don't really matter to begin with.
Even without appealing to the category theoretic point of view, one might claim that ordinary sets are best viewed as setoids. To wit, many of the sets one deals with in practice are presented as quotient sets. For example, when doing with modular arithmetic, it is (IMO) somewhat more convenient to work with integers modulo an equivalence relation, rather than working with equivalence classes or reduced representatives.
Comment: Thanks; I think I get it now. A good definition of *set* is "setoid, up to equivalence." Similarly, a good definition of *(weak) category* is "strict category, up to equivalence." These aren't skelatality assumptions so much as quotients, as your answer somewhat emphasizes.


Simulation of ARMA-GARCH in R (garchSim versus ugarchsim)

Question: I am trying to simulate an ARMA-GARCH process. From the literature I have consulted, it seems there are two functions for doing this in R: garchSim (from "fGarch" package) and ugarchsim (from "rugarch" package). I have used both of them but I get different results.
When should I use garchSim and when should I use ugarchsim?
Comment: I edited the function names because `garchFit` is not for simulation while `rugarch` is not even a function but a package. You may undo the edit if it changes the meaning of your question.
Answer: Both are valid functions for simulating an ARMA-GARCH series. It is not uncommon to find functions in different packages in R that serve the same purpose. However, they differ in some details. ugarchsim appears to be a little more flexible as it gives the user a little more control over the simulation process. See the help file for ugarchsim for all the optional parameters.


Android WebView does not load a page without attaching to xml

Question: I need to load dynamic generated pages in the background and then get the result html. I would use WebView for this, but it does not work wihout attaching to xml layout.
This sample does not work:
val browser = WebView(this)
browser.visibility = View.INVISIBLE
browser.settings.javaScriptEnabled = true
browser.settings.blockNetworkImage = false
browser.settings.domStorageEnabled = true
browser.settings.cacheMode = WebSettings.LOAD_NO_CACHE
browser.settings.loadsImagesAutomatically = true
browser.webViewClient = object : WebViewClient() {
       override fun onPageFinished(view: WebView, url: String) {
           Log.e("page", "finished")
           val javascript = "javascript:window.JSBridge.showHTML(''+document.getElementsByTagName('html')[0].innerHTML+'');"
           if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                browser.evaluateJavascript(javascript, null)
           } else {
                browser.loadUrl(javascript)
           }
        }
    }
browser.loadUrl("https://github.com")

But this works:
val browser = findViewById<WebView>(R.id.browser)
browser.visibility = View.INVISIBLE
browser.settings.javaScriptEnabled = true
browser.settings.blockNetworkImage = false
browser.settings.domStorageEnabled = true
browser.settings.cacheMode = WebSettings.LOAD_NO_CACHE
browser.settings.loadsImagesAutomatically = true
browser.webViewClient = object : WebViewClient() {
       override fun onPageFinished(view: WebView, url: String) {
           Log.e("page", "finished")
           val javascript = "javascript:window.JSBridge.showHTML(''+document.getElementsByTagName('html')[0].innerHTML+'');"
           if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                browser.evaluateJavascript(javascript, null)
           } else {
                browser.loadUrl(javascript)
           }
        }
    }
browser.loadUrl("https://github.com")

So, is there any way to load pages by WebView without attaching to xml layout file?
Answer: I find the solution, I have to create WebView in the Application class, using application context and then use it as a singleton. This solves the problem.


If $|f(x)-f(y)|\le c|x-y|^{\beta}$, then $f$ is constant

Question: Let $\beta>1$ and $c\in \mathbb R$. If $f:U\to \mathbb R^n$, defined in the open subset $U\subset \mathbb R^m$.
I'm trying to prove that if $f$ holds the condition $|f(x)-f(y)|\le c|x-y|^{\beta}$ for any $x,y\in U$, then $f$ is constant in each component of $U$.
The only thing I could discover was $f$ must be continuous because of the inequality above (the way to prove is similar to prove every Lipschitz function is continuous).
The book I'm studying has only explained so far basic facts of several variables vector-valued functions. So the tools I have in my pocket are the only ones when either $n=1$ or $m=1$.
Answer: Hint:
Take two points $x,y$ on the same component of $U$ such that the segment joining them is in $U$. Consider the segment $\gamma$ from $x$ to $y$. Evaluate
$$\lim_{h\to 0}\frac{f(\gamma(t+h))-f(\gamma(t))}h$$
Can any two points in the same component of $U$ be joined by a finite sequence of segments, all of them in $U$? (Hint for this: you can join the points with a continuous path $\gamma:[0,1]\to U$ and $[0,1]$ is compact).
Comment: Why is there such a $\gamma$? the open set $U$ is not necessarily path-connected. Thank you for your answer
Comment: @user42912 Because the end points are in the same component of $U$.
Comment: Yes, but is this component path-connected?
Answer: It helps to prove it first in the case of $n=1$ and you will notice there is nothing special about this case. The same argument works just as well for higher dimensions. The idea is to show that $f$ is differentiable at every point and its derivative is zero so it must be constant. Toward this, fix $x \in \mathbb{R}$ then by assumption $$\frac{|f(x) - f(y)|}{|x-y|} \leq c|x-y|^{\beta - 1} = c|x-y|^{\epsilon}$$ where $\epsilon > 0$. Now taking a limit as $y \rightarrow x$ on the left is nothing more than the derivative of $f$ which exists and is equal to 0 by the squeeze theorem. Hence, $f'(x) = 0$ for any $x \in \mathbb{R}$ proving $f$ is constant.


Configuring weblogic server console with external server urls, etc

Question: there are obviously various 'canned' configuration options in oracle's weblogic server console for setting up data sources, jms queues, ldap servers etc, etc.
What i want however is a way to configure other servers, mostly server urls, etc, in the console as well, and allow web applications running on the web server to access those configuration settings at runtime, probably through jndi names. Things like a document management server, a workflow server, etc.
However I'm at a loss for how to configure custom jndi 'data sources' within wls' console. Is this possible?
Answer: Apparently weblogic server can't do this by itself...
It looks like this addition will do what i want:
http://code.google.com/p/weblogic-jndi-startup/
Comment: Glad you resolved this issue. Please be sure to mark your answer as "accepted" when you are able.


International notation system

Question: I would like to know if there is a special order for notes in English and/or an international notation system.
In french, our order is Do Ré Mi Fa Sol La Si which is equivalent to C D E F G A B, what about the rest of the world? Do you use A B C D E F G or something else?
Answer: As per your comment on Michael's answer, I would suggest localizing for the countries that have different systems. The common one is C-D-E-etc, and you already know the fixed-Do French system.
Germany's system is slightly different, they go C-D-E-F-G-A-B (instead of Bb)-H (instead of B natural).
There is a chart on this Wikipedia page that you may find useful.
Answer: All traditionally notated Western music works the same way.  Eastern countries (Asia most notably) and Africa have very different music cultures than those of us in the West, thus have very different notation systems and a completely different sense of tonality meaning they do not hear our major scale (do, re, me, etc.) as a standard scale. Hope that helps.
Comment: Good, so I should use the "C D E F G A B" sorting for my buttons in the game i'm programming?
Comment: Yes. That would be the most commonly understood way of identifying the notes, all over the world.
Answer: You ask whether it should start  C D E.. or A B C .. etc - it could be any of them.
Do does not have to be C - it could be any of A, B, C, D, E, F or G. It depends on the key you are in - Do is the root.
Comment: The French Do Re Mi system is used -instead- of C D E: it's a fixed-Do system.
Comment: @Dr Mayhem: you are correct about no tone being the "first one". Traditionally when naming all the tone names, you start on Do, though. This must have to do with the fact that C major is the one major scale with no accidentals. I think this is what OP refers to.
Answer: Unfortunately, the names for the white keys on the piano are somewhat deceptive concerning the international agreement. As soon as you are no longer in C major or need the name for a black key, situation becomes complex, since nearly each language has its own set of suffixes, which may be glued onto or stay as separate word as c sharp (English) vs. cis (German).

International notation system


How to replace the variable in Json format string in Python?

Question: I have the following json format string as below.
json_data_string = "{\"size\":0,\"query\":{\"bool\":{\"must\":[{\"range\":{\"@timestamp\":{\"time_zone\":\"+09:00\",\"gte\":\"2023-01-24T00:00:00.000Z\",\"lt\":\"2023-01-25T00:00:00.000Z\"}}},{\"term\":{\"serviceid.keyword\":{\"value\":\"430011397\"}}}]}},\"aggs\":{\"by_day\":{\"auto_date_histogram\":{\"field\":\"@timestamp\",\"minimum_interval\":\"minute\"},\"aggs\":{\"agg-type\":{\"terms\":{\"field\":\"nxlogtype.keyword\",\"size\":1000},\"aggs\":{\"my-sub-agg-name\":{\"avg\":{\"field\":\"size\"}}}}}}}}"

In this field, there is gte field which is the starting time.
I would like to put this value by variable, not by the constant string as shown above.
For example, I want to generate many json format string by using the for-loop as below.
fmt = '%Y-%m-%d %H:%M:%S'
d1 = datetime.strptime('2010-01-01 00:00:00', fmt)
d2 = datetime.strptime('2010-01-02 00:00:00', fmt)
minutesDiff = (d2 - d1).days * 24 * 60

for n in range(minutesDiff):
    print(json_data_string_variable.format(datetime.strptime(str(d1 + timedelta(minutes=n)),fmt)))

By using the iterative style, I think that I can generate the multiple json string but I don't have idea to insert variable format in the json_data_string. I have googled it and tried to use {} syntax in the json_data_string but it did not work.
How to achieve it?
Thanks.
Answer: You could use the older modulo formatting. Replace the gte field with %s:
json_data_string = "{\"size\":0,\"query\":{\"bool\":{\"must\":[{\"range\":{\"@timestamp\":{\"time_zone\":\"+09:00\",\"gte\":\"%s\",\"lt\":\"2023-01-25T00:00:00.000Z\"}}},{\"term\":{\"serviceid.keyword\":{\"value\":\"430011397\"}}}]}},\"aggs\":{\"by_day\":{\"auto_date_histogram\":{\"field\":\"@timestamp\",\"minimum_interval\":\"minute\"},\"aggs\":{\"agg-type\":{\"terms\":{\"field\":\"nxlogtype.keyword\",\"size\":1000},\"aggs\":{\"my-sub-agg-name\":{\"avg\":{\"field\":\"size\"}}}}}}}}"

Then use % to format the string
for n in range(minutesDiff):
    print(json_data_string % (datetime.strptime(str(d1 + timedelta(minutes=n)),fmt)))

Answer: Convert the string representation of JSON to a Python dictionary. You can then access the 'gte' and 'lt' values as follows:
json_data_string = "{\"size\":0,\"query\":{\"bool\":{\"must\":[{\"range\":{\"@timestamp\":{\"time_zone\":\"+09:00\",\"gte\":\"2023-01-24T00:00:00.000Z\",\"lt\":\"2023-01-25T00:00:00.000Z\"}}},{\"term\":{\"serviceid.keyword\":{\"value\":\"430011397\"}}}]}},\"aggs\":{\"by_day\":{\"auto_date_histogram\":{\"field\":\"@timestamp\",\"minimum_interval\":\"minute\"},\"aggs\":{\"agg-type\":{\"terms\":{\"field\":\"nxlogtype.keyword\",\"size\":1000},\"aggs\":{\"my-sub-agg-name\":{\"avg\":{\"field\":\"size\"}}}}}}}}"

j = json.loads(json_data_string)

timestamp = j['query']['bool']['must'][0]['range']['@timestamp']

gte = timestamp['gte']
lt = timestamp['lt']

print(gte, lt)

Output:
2023-01-24T00:00:00.000Z 2023-01-25T00:00:00.000Z


Update the same view with the next item of a list

Question: I'm creating a quiz app in Swift. Each quiz has an array of question, which are represented in a QuestionView. A "next" button should take to the same view "QuestionView", but with the next question of the array. But instead, the QuestionView always shows the same question.
Here's the QuestionView :
struct QuestionView: View {

var quiz: Quiz
var question: Question

@State private var isFinished = false
@State private var success = true

var body: some View {
    VStack(spacing: 40) {
        VStack {
            Text(quiz.name)
                .font(.title3)
                .bold()

            HStack(spacing: 20) {
                ProgressBar(progress: 250 / CGFloat(quiz.questions.count) * CGFloat(quiz.progress))
                Text("\(quiz.progress + 1)/\(quiz.questions.count)")
                    .bold()
            }
        }

        Text(question.questionText)
            .font(.title)
            .fontWeight(.semibold)
            .frame(width: 300)

        Spacer()

        LazyVGrid(columns: [GridItem(.adaptive(minimum: 160, maximum: 240))], spacing: 10) {
            ForEach(question.answers) { index in
                AnswerRow(answer: index)
                    .onTapGesture {
                        if index.isCorrect && success == true {
                            self.quiz.score += 1
                            self.quiz.progress += 1
                            isFinished = true
                        } else if index.isCorrect {
                            self.quiz.progress += 1
                            isFinished = true
                        } else {
                            success = false
                        }
                    }
            }
        }

        NavigationLink {
            QuestionView(quiz: quiz, question: quiz.questions[quiz.progress])
        } label: {
            PrimaryButton(text: "Continuer")
        }
        //.disabled(!isFinished)

    }
    .padding(.vertical, 60)
    .navigationBarHidden(true)
}
}

Here's the Quiz model :
class Quiz: Identifiable {
let id = UUID()
let name: String
let illustration: String
let difficulty: Difficulty
let questions: [Question]
var score: Int
var progress: Int

init(name: String, illustration: String, difficulty: Difficulty, questions: [Question], score: Int, progress: Int) {
    self.name = name
    self.illustration = illustration
    self.difficulty = difficulty
    self.questions = questions
    self.score = score
    self.progress = progress
}
}

extension Quiz {
static let examples: [Quiz] = [
    Quiz(
        name: "Quiz n°1",
        illustration: "Picture1",
        difficulty: .easy,
        questions: Question.allQuestions1,
        score: 0,
        progress: 0
    ),

    Quiz(
        name: "Quiz n°2",
        illustration: "Picture2",
        difficulty: .intermediate,
        questions: Question.allQuestions2,
        score: 0,
        progress: 0
    ),

    Quiz(
        name: "Quiz n°3",
        illustration: "Picture3",
        difficulty: .advanced,
        questions: Question.allQuestions3,
        score: 0,
        progress: 0
    )
]
}

Comment: You're not passing the next question.
Comment: What is Question.allQuestions1 and Question.allQuestions2 and Question.allQuestions3? In theory, if these were all the same question, you would be showing something "new", but always the same.
Comment: Those are different arrays of questions, which are each associated with different quiz.
Answer: Maybe you could try using an array of questions. [Question]
Something like this:
var questions = [Question(questionText: "Some text",
                          possibleAnswers: ["Option 1", "Option 2", "Option 3"]
                          correctAnswer: "Option 2"),

                 Question(questionText: "Some other text",
                          possibleAnswers: ["Option 1", "Option 2", "Option 3"]
                          correctAnswer: "Option 1")]

And have a question number variable that increases every time the user goes to the next question
Something like:
@State private var questionNumber = 0

Then, to display the questions one at a time:
// The actual question
Text(questions[questionNumber].questionText)

// All the possible answers
ForEach(questions[questionNumber].possibleAnswers, id: \.self) { answer in
        // Some view that takes in a string (the answer) and display it
        Text(answer)
}

Now all is left to do is to increment the question number (questionNumber += 1). I belive in your case it will be done with a "Next" button:
Button("Next") {
    questionNumber += 1
}

Hope this helps you!

Note

I haven't tested the above code, it's just to help you figure things out  (The code may work though)


Melhor forma de escrever uma função JavaScript

Question: Qual a melhor forma de escrita da função a seguir?
Esta?
function DOMtoString(document_root) {
    var html = '',
        node = document_root.firstChild;
    while (node) {
        switch (node.nodeType) {
        case Node.ELEMENT_NODE:
            html += node.outerHTML;
            break;
        case Node.TEXT_NODE:
            html += node.nodeValue;
            break;
        case Node.CDATA_SECTION_NODE:
            html += '<![CDATA[' + node.nodeValue + ']]>';
            break;
        case Node.COMMENT_NODE:
            html += '';
            break;
        case Node.DOCUMENT_TYPE_NODE:
            // (X)HTML documents are identified by public identifiers
            html += "<!DOCTYPE " + node.name + (node.publicId ? ' PUBLIC "' + node.publicId + '"' : '') + (!node.publicId && node.systemId ? ' SYSTEM' : '') + (node.systemId ? ' "' + node.systemId + '"' : '') + '>\n';
            break;
        }
        node = node.nextSibling;
    }
    return html;
}

Ou esta?
function DOMtoString(a) {
    var b = "",
        c = a["firstChild"];
    while (c) {
        switch (c["nodeType"]) {
            case Node["ELEMENT_NODE"]:
                b += c["outerHTML"];
                break;
            case Node["TEXT_NODE"]:
                b += c["nodeValue"];
                break;
            case Node["CDATA_SECTION_NODE"]:
                b += "<![CDATA[" + c["nodeValue"] + "]]>";
                break;
            case Node["COMMENT_NODE"]:
                b += "";
                break;
            case Node["DOCUMENT_TYPE_NODE"]:
                b += "<!DOCTYPE " + c["name"] + (c["publicId"] ? " PUBLIC \"" + c["publicId"] + "\"" : "") + (!c["publicId"] && c["systemId"] ? " SYSTEM" : "") + (c["systemId"] ? " \"" + c["systemId"] + "\"" : "") + ">";
                break;
        }
        c = c["nextSibling"];
    }
    return b;
}

Comment: O que você vê de positivo na segunda versão. A impressão que tenho é que a primeira (com os nomes maiores e comentários) é a original e a segunda passou por um minificador de código.
Answer: Usa a notação com ponto para propriedades defenidas e a notação com colchetes/parenteses retos em propriedades programáticas, que recebes via  variáveis.
Ou seja no caso de document_root.firstChild a notação com ponto é o uso correto, mais usado.
No caso de
var prop = element.tagName == 'INPUT' ? 'value' : 'innerHTML';
var valor = element[prop];

deves usar a notação com colchetes/parenteses retos, que é a única maneira de aceder a propriedades do elemento/objeto que variam programáticamente.
Comment: Amigos, entendi perfeitamente as explicações, e @Hugomg,  a segunda versão passou sim por um minificador, vc adivinhou! :D. Como pretendo usar a versão minificada, gostaria de saber se irá funcionar da mesma forma que a primeira versão?
Comment: @Cloud.NET em termos programáticos (ou seja de leitura do programa) é indiferente. Podes usar qualquer um deles. Mas se precisares de descobrir problemas no código o primeiro é bem melhor de trabalhar/ler.
Comment: OK. Então em termos de funcionalidade, tanto faz usar um ou outro que vão funcionar da mesma forma e chegar ao mesmo objetivo pretendido, correto?
Comment: @Cloud.NET correto. Mas repara que se o objetivo dessa segunda versão é minificar o código usar `["..."]` traz mais caracteres ao código que não usar. Sugiro que uses outro minificador como o UglifyJS.
Comment: ♦, muito obrigado pela sugestão de minificador.
Answer: Claramente a primeira está melhor escrita porque tem nomes de variáveis melhores.  O código deve ser auto documentável. Por isso pode-se afirmar que o primeiro é melhor.
O estilo de acesso ao membros de Node como membros de objeto (no primeiro) e não elementos do array (no segundo) parece ser um pouco mais legível, mas é gosto. O uso como membro do array só seria interessante se precisasse usar uma variável como "índice" de acesso, o que não é o caso.
Fora isto não vejo diferenças relevantes.
Ambos funcionam perfeitamente de forma idêntica. É só uma questão de legibilidade. O segundo carregará de forma ligeiramente mais rápida por ser menor, mas o ganho é ínfimo neste caso.
Answer: Até onde sei, a melhor forma é usar a notação com ponto para o uso normal dos objetos e a notação com colchetes quando vamos modificar o objeto programaticamente..
No seu caso portanto a 1a notação é mais correta. Caso vc queira acesso a todos os membros do objeto, remover ou adicioná-los, vc pode usar a notação por colchetes.


Can I derive the sum of squares formula without induction and through the formula for series?

Question: I have $1^2+2^2+...+n^2$ and I want to prove the sum is $\frac{m(m+1)(2m+1)}{6}$. So for proving the formula for $1+3+5+7+... = n^2$ this is how i got the formula:
the common difference is 2, so the formula for $a_n = 2n-1$
The sum of an arithmetic series is $\frac{n(a_{1}+a_{n})}{2}$ so I have $\frac{n(1+(2n-1)}{2}$ so its $n^2$.
For the sum of the squares, I know that the term for $a_n$ is $n^2$. But since it's not an arithmetic sequence, I can't use my previous formula. Is there an analogous method?
I already know how to prove this by induction and i understand the visual proofs. But if you see how I formulated my sum for the first consecutive odd integers, can you please show me how I can do this for the sum of the squares in the same way or just tell me it's not possible if it isn't. Thank you!
Comment: Not sure if this is what you're asking for - but one possibility is $\sum_{k=1}^n k^2 = \sum_{k=1}^n \left( 2\binom{k}{2} + k \right) = 2 \binom{n+1}{3} + \binom{n+1}{2}$.
Comment: thanks! that is what I meant in terms of finding another method but I didn't want to use binomial coefficient. basically im trying to explain this to a kid in algebra II who just learned sequences and series so he doesn't know how to compute that
Answer: hint
Your approach
$$1^2=1$$
$$2^2=1+3$$
$$3^2=1+3+5$$
$$4^2=1+3+5+7$$
$$n^2=1+3+5+...+(2n-1)$$
thus
$$1^2+2^2+...+n^2=n+3(n-1)+5(n-2)+...+2(2n-3)+(2n-1)$$
it complicate things.
an other approach
$$(n+1)^3=n^3+3n^2+3n+1$$
$$n^3=(n-1)^3+3(n-1)^2+3(n-1)+1$$
$$(n-1)^3=(n-2)^3+3(n-2)^2+3(n-2)+1$$
...
$$2^3=1^3+3+3+1$$
$$1^3=1$$
by sum
$$(n+1)^3=3(1^1+2^2+...+n^2)+3(1+2+...+n)+(n+1)$$
the result is
$$\frac{(n+1)((n+1)^2-1-\frac 32 n)}{3}$$
Comment: interesting, thank you! could you explain to me how you got the $(n+1)^3$ on the second to last line?
Comment: @user8290579 we sum the $n$ equalities .
Answer: It comes down to whether you can prove $\sum_{i=0}^n\binom{i}{j}=\binom{n+1}{j+1}$ without induction. Since $i^2=2\binom{i}{2}+i$, $$\sum_{i=0}^n i^2=2\binom{n+1}{3}+\binom{n+1}{2}=\frac{n(n+1)}{6}(2(n-1)+3)=\frac{n(n+1)(2n+1)}{6}.$$So let's try a combinatorial proof of that sum in binomial coefficients (an inductive proof is trivial). The right-hand side is the $x^{j+1}$ coefficient in $(1+x)^{n+1}$. Numbering the $n+1$ linear factors from $0$ to $n$ inclusive, if the final coefficient to contribute an $x$ factor towards an $x^{j+1}$ term is factor $i$, we must choose $x$ from $j$ of the first $i$ factors (i.e. those numbered from $0$ to $i-1$).
Comment: Or, split the $j+1$-element subsets of $\{ 1, 2, \ldots, n+1 \}$ according to their maximum element: there are $\binom{k-1}{j}$ such subsets with maximum element $k$.
Answer: Not really. The reason you get a nice easy formula for adding arithmetic series is distributivity.
Notice $\sum_{i=1}^{n}a_i$ where $a_i=mi+k$ is just $$\sum_{i=1}^n(mi+k)=(\sum_{i=1}^nmi)+(\sum_{i=1}^nk)=m(\sum_{i=1}^ni)+nk=m\frac{n(n+1)}{2}+nk=n\frac{(m(n+1)+2k)}{2}=n\frac{(mn+k+m+k)}{2}=\frac{n(a_1+a_k)}{2}$$
The reason this works is because the terms of an arithmetic series are extremely basic and so you can use commutativity and distributivity to reduce the problem to just summing the first $n$ integers and playing around with that. When you are trying to add squares there is no easy way to factor out so that you get to such a basic form. Notice that even here the hard part really was the one we left out and that's adding the first $n$ integers.


What is the angle of a point?

Question: I had a question in my test:
"The sum of angles at a point is________. (A) 0; (B) 360; (C) 90; (D) 180;"
I feel that since there are no angles or rays drawn at the point in the first place, the answer can't be 360, but that is the correct answer for this question. How is this possible?
Comment: +1 since you are right to be confused. Its a vague and lazily formulated question.
Comment: I'd complain to whoever wrote that question.
Answer: The point of the question must be that if you do draw some rays from your point and add up all of the angles between neighboring rays, then the sum will be 360° -- no matter how many rays or their directions.
Answer: This a perfect example of a stupid question, for following reasons
1.The question is ambiguous : all and any answer given to this question can be justified to be correct or wrong.
2.it serves no purpose but to give the impression of there is a correct answer to awarded with points. A sad case of education being reduced to teachers discretion with/out in/proper justification.
Nobody should waste time on nonsense like this question or similar type of questions, e.g. given n numbers what is the next number, or given n pictures what is the next correct picture.
Note : this answer is just as stupid as the question, and many points for or against it can be pointed out.
Btw , is the point also a circle? can the points of boundary be inside the circle on the centre? or is the point an sphere? on the sphere we can draw triangles with angles greater than 270, so the angle of the point is the sum of the angles of the triangles  on the sphere of diameter 0.
the point can also be a triangle, square or hexagon of size 0, having 180, 360 or more angles or less angles.

What is the angle of a point?


Host (A) record (DNS) updated with wrong IP address

Question: I recently installed a new Domain Controller running Windows Server 2012 (called "srv3") in a domain with two existents DCs that are running Windows Server 2003 (called "srv1" and "srv2"). All roles (DHCP, AD and DNS) have been migrated to the new server and are operational.
The issue is that the A record for "svr1"
I have some network connection problems though, and found out that the host (A) record of "srv1" in the forward lookup zone takes the ip address of "srv3".
I should have :
srv3      Host (A)    xx.xxx.6.4
srv1      Host (A)   xx.xxx.6.1

But I have :
srv3      Host (A)    xx.xxx.6.4
srv1       Host (A)    xx.xxx.6.4

Today I demoted both "srv1" and "srv2", turned them off and deleted the A record for "srv1" but it is still being registered back in DNS and it points to srv3's IP address (which is odd). The owner of svr1's A record appears to be "svr3"
Why would "svr3" create a record for "svr1" (and tie it to svr3's IP address)?
ADDITIONAL INFORMATION

The output for
netdom computername srv3 /ENUMerate

is
All the names of the computer are :
srv3.myDomain.local
srv1.myDomain.local

I don't find any reference for srv1 in the content of the netlogon.dns file.
Procedures followed : After installing and setting Windows Server 2012 on a new server, I installed AD, DNS and DHCP roles using "Add roles and Features". Then I transferred FSMO roles. After setting the new DNS, I found out that client's IP configuration (using ipconfig /all was good (implying new DNS), but the output of nslookup was Default Server: UnKnown. I discovored that the client's group policy was setting "srv1" as DNS. After getting rid of this parameter, some of the clients were connecting well and other not.

EDIT 26/09/2014 15:56 (UTC+2)
I checked that "srv3" is the primary name by executing the command netdom computername srv3 /ENUMerate:PRIMARY.
"srv1" was listed within alternate names (netdom computername srv3 /ENUMerate:ALTERNATENAMES).
I executed the following command :
    netdom computername srv3 /remove:srv1

and now I'm waiting to see if "srv1" will be registered again.
Does someone know why "srv3" have taken the name of "srv1" in the first place ?
Comment: I don't understand. What's coming back? The A record for srv3 or the A record for srv1?
Comment: The A record for srv3 is fine. But the A record for srv1 is coming back with the IP address of srv3... I guess it is created by srv3 since it is the owner of the record ?
Comment: I don't know why srv3 would be registering an A record for srv1. Is srv1 turned off?
Comment: srv1 is turned off. That's why I'm thinking that the record is created by srv3. I guess there is an error of configuration somewhere who leads into this
Comment: Is it possible to identify who creates this record ? Maybe in DNS debug log ? Thanks for the reply btw
Comment: How did you demote srv1 and srv2?
Comment: Using dcpromo on each server. I though it could resolve the problem who existed before I demoted them.
Comment: What's the output of `netdom computername %computername% /ENUMerate`
Comment: Just for the heck of it check the contents of the netlogon.dns file on srv3 at `C:\Windows\System32\config` for any reference to srv1.
Comment: Thanks both of you for your help. I'm not at work anymore so I will answer that in the morning. I will detail the procedures that I followed and try to give more informations, put some screenshots if it can help. And thanks for the edit of the original post...
Answer: The problem seems to be resolved. I don't know why "srv3" took "srv1" as an alternate name in the first place, but that's why "srv1" was being registered in the forward lookup zone with "srv3"'s IP address.
I removed "srv1" from the alternates names of "srv3" with the command :
netdom computername srv3 /remove:srv1

Since "srv1" is not registered anymore.


Formula Complexity of $\models_n$

Question: I want to show $\models_0$ is $\Sigma_1$, and $\forall n \geq 1, \models_n$ is $\Sigma_n$.
So for the base case, $\models_0 \ulcorner \phi \urcorner$ is true iff $\ulcorner \phi \urcorner \in Formulas$, $\ulcorner \phi \urcorner \in \Delta_0$ and $ \exists M (M$ is transitive and $(M , \in ) \models \phi$). So, I have to show that those three conditions can be expressed as $\Sigma_1$ formulas. I think the first two be expressed as $\Delta_0$ under any reasonable coding, correct? And I'm having trouble with expressing the last condition, particularly with expressing $(M , \in ) \models \phi$ as $\Delta_0$ or $\Sigma_1$.
Once we have the base case, the inductive step follows pretty easily since  $\models_n \ulcorner \exists x\phi \urcorner$ is true iff $\ulcorner \phi \urcorner \in Formulas$, $\ulcorner \phi \urcorner \in \Pi_{n-1}$ and $\exists a \neg \models_{n-1} \neg \phi(a)$. That the first two are expressible as $\Sigma_n$ would again follow from a reasonable coding procedure and the last is $\Sigma_n$ since we are just prefixing an $\exists$ and a $\neg$ to a $\Sigma_{n-1}$ formula.
Any general advice for approaching formula complexity problems would also be appreciated. Sometimes what we are trying to express as a formula can get fairly ugly formula-wise. It seems like the only strategy here is to memorize at which formula complexity a lot of the fundamental notions are and then to try to reduce the problem at hand to those fundamental notions, right?
Comment: The definitions are basically what I wrote in the first sentences of the first two main paragraphs. They are introduced on page 186 of Jech's Set Theory.
Comment: What is $\models_n$? I mean, I know what $\models$ is, but I don't quite understand what the subscript is doing there.
Answer: I highly recommend Chapter I.9 of Devlin's "Constructibility", where many of the subtleties of this are worked out.  It takes about 6 pages to show that "$\varphi$ is a formula" is $\Delta_1$; see Lemma 9.4.  For each fixed (meta-mathematical) natural number $n\geq 1$, the sentence "$\varphi$ is $\Sigma_n$" is also $\Delta_1$, and is sketched in Lemma 9.13.  Satisfiability for sets $M$ is definitely the most involved part; this is completed in Lemma 9.10 and shown to be $\Delta_1$.  I think Jech was expecting students to just take these three facts for granted, as he never specifies a fixed definition of $Form$.

Formula Complexity of $\models_n$


Redirect Permanent and https

Question: I just set up https on my server, and I have an issue with redirect permanent.
If I have a link for example http://domain.com/index.html it redirect me on
https://www.domain.comindex.html

The / is missing and I can't figure out how to fix it.
It's work with http://www.domain.com/index.html
Here is my httpd.conf
<VirtualHost *:80>
  ServerName domain.com
Redirect permanent / https://www.domain.com/
</VirtualHost>
<VirtualHost *:80>
  ServerName www.domain.com
  Redirect permanent / https://www.domain.com/
</VirtualHost>

<VirtualHost *:443>
  DocumentRoot /var/www/domain/
  ServerName www.domain.com
  SSLEngine on
  SSLCertificateFile ssl.crt
  SSLCertificateKeyFile ssl.key
</VirtualHost>

Answer: <VirtualHost *:80>
  ServerName www.domain.com
  ServerAlias domain.com
  Redirect permanent / https://www.domain.com/
</VirtualHost>

Get rid of the second one.
Your original problem was a typo in the target; the source and target of a redirect must have matching slashes.
Browser cache persistence explains the rest.
Also note that in apache 2.2, NameVirtualHost *:80 is not optional, if you have more than one vhost.
In apache 2.4, it guesses what you mean and does the right thing.
Answer: Why are you duplicating your virtual hosts definitions? You can just use a line like:
ServerAlias www.domain.com domain.com

Here is the reference. So, one of the VH should be enough instead of two (of port 80). You can keep the working one :)

Redirect Permanent and https


Chernoff Bound: Prove that $P[u \geq \alpha] \leq (e^{-s\alpha} U(s))^N$

Question: Let $u_1, ..., u_N$ be random variables, and let $u = \frac{1}{N} \sum_{n=1}^N u_n$. If $U(s) = E_{u_n}(e^{su_n})$ (for any $n$), prove that $P[u \geq \alpha] \leq (e^{-s\alpha} U(s))^N$.
$s > 0$ and $\alpha$ is a positive constant. E is the expectation. P is the probability.
I can show that for one variable case, $P(u \geq \alpha) \leq e^{-s\alpha}E_{u}(e^{su})$. However, I can't relate it to the case when we take the weighted average of the random variable.
Comment: Please add the `[self-study]` tag & read its
[wiki](http://stats.stackexchange.com/tags/self-study/info).
Comment: The random variables should be independent too?  A suggestion/plea- use upper case letters for random variables!  How have you tried to generalise your $N=1$ proof?
Answer: Assuming your random variables are independent:
$$
\mathbb{P}\!\left( \sum_{i=1}^N u_i / N \ge \alpha \right) = \mathbb{P}\!\left( s\sum_{i=1}^N u_i / N \ge s\alpha\right) = \mathbb{P}\!\left( e^{s\sum_{i=1}^N u_i} \ge e^{Ns\alpha}\right) \\
\le \mathbb{E}\!\left[ e^{s\sum_{i=1}^N u_i}\right] e^{-Ns\alpha} = \mathbb{E}\!\left[\prod_{i=1}^N e^{su_i}\right] e^{-Ns\alpha} \\
 = \prod_{i=1}^N \mathbb{E}[ e^{su_i}] e^{-Ns\alpha}.
$$
The last equality follows from $\mathbb{E}[g(X)h(Y)] = \mathbb{E}[g(X)]\mathbb{E}[h(Y)]$ for $X,Y$ independent.
Comment: +1 Actually, the last equality follows from $\mathbb{E}[g(X)h(Y)] = \mathbb{E}[g(X)]\mathbb{E}[h(Y)]$ for $X, Y$ independent.  $\mathbb{E}[XY] = \mathbb{E}[X]\mathbb{E}[Y]$ also holds for _uncorrelated_ random variables $X$ and $Y$, but the Chernoff bound does not follow from this.
Comment: Well, if $X$ and $Y$ are independent random variables then $g(X)$ and $h(Y)$ are also independent random variables :)
Comment: (I accept your point though, and have edited accordingly!)


How do I send an email to the administrator users when a specific link is clicked?

Question: I'm working on a new site built with Drupal 6, and I have to program a specific action on the node pages.
I have a page that shows the product information for users. Following the information, I have a button labeled "order now"; when this button is clicked, two scenarios are possible:

if the user is not logged in, he is redirect to the login form
if the user is logged in, an e-mail is sent to the administrator with the current product information and the information of the user who clicked the button
Answer: Rules Module can do this for you.
Answer: Check out the Drupal Commerce module, or simply try the Commerce Kickstart installation profile.
It is a complete commerce solution which is highly integrated with the Rules module, so you can easily define what you described in your question.
Comment: thanks for your quick reply, but i don't like to install a hole complex module for that because it's not an e-commerce web site , i'd like a very simple hook or cutom module to run this function.
Answer: You can just use a submit callback for the button and check the current user with global $user;. Just add $form['button']['#submit'] = array('mymodule_submit_callback'); to the button's array and use the callback to do your work.
function mymodule_submit_callback($form, &$form_state) {
  global $user;
  if ($user->uid == 0) {
    // Send the user to the login page if user is anonymous.
    drupal_goto('user');
  }
  else {
    drupal_mail(); // Send an email to the administrator.
  }
}

So, here you have access to the user that clicked the button as well as any form data in $form_state['values']. Check out the drupal_mail API reference for information on how use this function to send mail.
Alternatively, if you want to just provide a link you could also just use a menu callback.
function mymodule_menu() {
  $items['path/to/callback/%user'] = array(
    'title' => t('Send mail'),
    'type' => MENU_CALLBACK,
    'page callback' => 'mymodule_mail_callback',
    'page arguments' => array(3),
  );
  return $items;
}

function mymodule_mail_callback($user) {
  // Check if this is an anonymous user and redirect if necessary.
  if ($user->uid == 0) {
    drupal_goto('user');
  }
  else {
    drupal_mail(); // Etc.
  }
}

Then, the link on the node form can be done like this
function mymodule_form_alter($form, &$form_state, $form_id) {
  // Ensure this is the form you want with a conditional.
  global $user;
  // Add your "Order now" link to the form, linking to your menu callback.
  $form['mail_link'] = array('#value' => l(t('Order now'), 'path/to/callback/' . $user->uid));
  return $form;
}

Alternatively, you could disclude the user ID from the menu callback path and just get the global $user variable from within the menu callback itself.


Como trazer uma aplicação para a frente(do background para foreground)?

Question: Estou finalizando um app onde a pessoa o executa mas, normalmente, ele fica minimizado, rodando em segundo plano.
A pessoa o executa, mas grande parte do tempo a pessoa pode ficar mexendo em outras coisas do celular.
Gostaria que esse app, respondendo a um determinado evento (uma resposta de um webservice, por exemplo), reapareça para o usuário, mesmo que esse usuário esteja mexendo em outros aplicativos.
Podemos dizer que esse aplicativo em determinados momentos tem prioridade máxima e precisa ser exibido ao usuário, interrompendo qualquer ação que ele esteja fazendo.
Comment: Já deu uma olhada no [JobScheduler](https://developer.android.com/reference/android/app/job/JobScheduler)?
Answer: O mecanismo usado no Android para indicar ao utilizador que uma aplicação necessita da sua atenção são as notificações.
O aplicativo lança a notificação, o utilizador quando entender lê a mensagem e actua em conformidade.
Essa é a forma aconselhada, por ser pouco invasiva.
Se de facto quer trazer a sua Activity para a frente, sem o consentimento do utilizador, use o startActivity().
Intent it = new Intent(this, MyActivity.class);
it.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(it);


What kind of Non-parametric test to use when huge difference between two sample sizes?

Question: I have Type I CD protein data which consists of 27 Enzymes and 217 non-enzymes. I want to determine if there is a significant difference in the length of enzymes versus non-enzyme. What type of non-parametric test should I use if there is a huge difference between the sample size of enzymes versus non-enzyme?
Answer: Use whichever nonparametric test is suited for your particular null and alternative.
None of the usual tests suitable for two independent samples will care that one sample is larger than the other.
Note that "difference in the length" is sort of vague -- if that's as specific as you can be, I'd lean toward a general one like a Wilcoxon Mann-Whitney (I presume you have ties though), but if you have a particular measure of location you're interested in that can be done fairly easily (e.g. via permutation tests).
So you if you want to see if there's a difference in mean length, you could do that with a nonparametric test (or by adding some assumptions to an existing test).
[What's perhaps less immediately clear, though, is how to construe this as a suitable situation for a hypothesis test in terms of random selection from populations (since clearly there's no random assignment to treatment); it seems to be fairly standard to just charge ahead regardless. I hope someone has constructed appropriate justifications somewhere.]


aws cloudformation - Launch ec2 instance in my vpc

Question:   EC2Instance:
    Type: 'AWS::EC2::Instance'
    Properties:
      InstanceType: !Ref InstanceType
      SubnetId: !Ref SubnetAPublic
      SecurityGroups:
        - !Ref InstanceSecurityGroup
      KeyName: !Ref KeyName
      ImageId: !FindInMap
        - AWSRegionArch2AMI
        - !Ref 'AWS::Region'
        - !FindInMap
          - AWSInstanceType2Arch
          - !Ref InstanceType
          - Arch
  InstanceSecurityGroup:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: Enable SSH access via port 22
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: '22'
          ToPort: '22'
          CidrIp: !Ref SSHLocation

If I remove "SubnetId:! Ref SubnetAPublic" from the EC2Instance entry, it works fine.
What is the reason?
[Full Code]
https://raw.githubusercontent.com/syLee1111/test/master/public%20and%20private%20subnets%20in%20two%20availability%20zones.yaml
Answer: Got it. That's because the subnet is part of the vpc , but your security group is not.
It should work if you create the security group inside the vpc.
You can do so by setting VpcId parameter to the security group.
also you should use SecurityGroupIds instead of SecurityGroups
EC2Instance:
  Type: 'AWS::EC2::Instance'
  Properties:
    InstanceType: !Ref InstanceType
    SubnetId: !Ref SubnetAPublic
    SecurityGroupIds:
      - !Ref InstanceSecurityGroup
    KeyName: !Ref KeyName
    ImageId: !FindInMap
      - AWSRegionArch2AMI
      - !Ref 'AWS::Region'
      - !FindInMap
        - AWSInstanceType2Arch
        - !Ref InstanceType
        - Arch

Hope this helps.
Comment: I added `VpcId: !Ref VPC` to `InstanceSecurityGroup:` but it's still the same.
Comment: The parameter groupName cannot be used with the parameter subnet (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: b736cf6d-35e5-49e7-b583-ee75370353b3)
Comment: updated the answer, you should use `SecurityGroupIds` instead of `SecurityGroups`
Comment: happy to help ;)


What does this particular bessel with a superscript and ordered pair mean?

Question: I was evaluating this on WolframAlpha: https://www.wolframalpha.com/input?i2d=true&i=Integrate%5BDivide%5Bcos%5C%2840%292%CF%80%5C%2840%29Divide%5B1%2Cx%5D%2B1x%5C%2841%29%5C%2841%29%2Cx%5D%2C%7Bx%2C0%2C%E2%88%9E%7D%5D
And the following function
appears. Are there some resources on what this function is? I've looked through the Wolfram documentation, but I couldn't find it. I tried to type it into WolframAlpha, and ChatGPT was useless.
Comment: In the notation of Mathematica and Wolfram Research, if $F:\mathbb R^n\to\mathbb R^m$, $F^{(a_1,\dots,a_n)}$ is taken to mean $$\frac{\partial^{a_1+\dots+a_n}F}{{\partial x_1}^{a_1}\dots{\partial x_n}^{a_n}}$$
Answer: Superscript $(1,0)$ means derivative with respect to the first variable in Wolfram's notation. Here $\mathrm{BesselJ}(\nu,z)$ is a funcion of two arguments, where $\nu$ is the order, so
$\mathrm{BesselJ^{(1,0)}}(\nu,z)$ = $\frac{\partial}{\partial \nu}J_{\nu}(z)$. Hence, $$\mathrm{BesselJ^{(1,0)}}(0, 4\pi) = \frac{\partial}{\partial \nu}J_{\nu}(4\pi)\Big|_{\nu=0}$$
According to DLMF (eq. 10.15.3),
$$
\frac{\partial}{\partial \nu}J_\nu(z)\Big|_{\nu=n} =
\frac{\pi}{2} Y_n(z) + \frac{n!}{2\left(z/2\right)^n} \sum_{k=0}^{n-1} \frac{\left(z/2\right)^k J_k(z)}{k!(n-k)},
$$
where $Y_n$ is the Bessel Function of the Second Kind. So, for $\nu = 0$:
$\frac{\partial}{\partial \nu}J_{\nu}(z)\Big|_{\nu=0} = \frac{\pi}{2} Y_0(z)$.
Answer: I found the following integral in Gradshteyn and Ryzhik's Table of Integrals, Series, and Products (p. 480, formula 3.868.2):
$$
\int_0^{\infty}\cos\left(a^2x+\frac{b^2}{x}\right)\frac{dx}{x}=-\pi Y_0(2ab)\qquad[a>0, b>0], \tag{1}
$$
where $Y_0$ is the Bessel function of the second kind and order zero.
When $a=b=\sqrt{2\pi}$, Eq. $(1)$ reduces to your integral:
$$
\int_0^{\infty}\cos\left(2\pi\left(x+\frac{1}{x}\right)\right)\frac{dx}{x}=-\pi Y_0(4\pi). \tag{2}
$$
Therefore, apparently $\text{BesselJ}^{(1,0)}(0,x)=\frac{\pi}{2}Y_0(x)$.


Is MLB Statcast data permanently archived somewhere?

Question: Major League Baseball has begun collecting a set of physics data under the name "Statcast", including such information as the exit velocity of notable home runs.  I would like to know if this data is permanently archived somewhere, so that I can give stable references to it (e.g. in a paper).
All I have found so far is the "Statcast Leaderboard", which shows, e.g. the longest or fastest home runs of the season (or postseason) to date.  But presumably the leaderboard data will eventually be replaced with next season's data.  Even during a season, a particular home run might "fall off" the leaderboard.  So if I refer to that particular home run in my paper, readers may eventually not be able to find the data to verify it, unless I can give a link to some permanent home for the data.
Is there such a "permanent home" for this data, provided either by MLB or someone else?
Answer: The data are not generally publicly available, at least not yet.  The stuff that is available can be found here:http://baseballsavant.com/pitchfx_search.php.  I don't know how "permanent" it is.  You can read a lot about Statcast at my own web site:  http://baseball.physics.illinois.edu.
Answer: Raw statcast data isn't available to the public, but one hack is to use the JSON files that the MLB AtBat App uses to populate its feed. These are accessible from: statsapi.mlb.com/api/v1/game/[GAME_PK]/feed/color, where GAME_PK can be found in the boxscore.xml of a standard gameday directory(i.e. gd2.mlb.com/components/game/mlb/year_2015/month_09/day_10/gid_2015_09_10_detmlb_clemlb_1/)
From this JSON file, you can use some simple regex to get exit velocities, batted ball distances and launch angles.
I've developed some simple scripts to parse and import statcast, pitchfx and gameday data into a database. You can find those here: https://github.com/brianhuey/mlbatbat_pgsql


Suppose $x^2+y^2=4$ and $z^2+t^2=9$ and $xt+yz=6$. What are $x,y,z,t$?

Question: Let $x^2+y^2=4$ and $z^2+t^2=9$ and $xt+yz=6$.
What are $x,y,z,t$?
Comment: Hint : Equality in the Cauchy Schwarz inequality.
Comment: A single solution can be easily found, e.g. (x,y,z,t) = (0,2,3,0). Do you want all solutions? All integer solutions? All complex solutions?
Comment: Different hint parametric equation
Comment: @астонвіллаолофмэллбэрг Please more guide.
Comment: With three equations and four unknowns, it seems unlikely that the solution over complex numbers will be unique.
Answer: Consider
$$
(x^2+y^2)(z^2+t^2)-(xt+yz)^2=0
$$
Expanding the left-hand side you get
$$
x^2z^2+\color{red}{y^2z^2}+\color{red}{x^2t^2}+y^2t^2
-\color{red}{x^2t^2}-2xyzt-\color{red}{y^2z^2}=0
$$
that simplifies to
$$
(xz-yt)^2=0
$$
so $xz=yt$.
Now consider the linear system in the unknowns $z$ and $t$:
\begin{cases}
yz+xt=6 \\
xz-yt=0
\end{cases}
With standard methods you get
$$
z=\frac{6y}{x^2+y^2}=\frac{3}{2}y,
\qquad
t=\frac{6x}{x^2+y^2}=\frac{3}{2}x
$$
Now any pair of numbers $x,y$ with $x^2+y^2=4$ will do.

Alternatively, consider the complex numbers
$$
A=x+yi,\qquad B=z+ti
$$
Then the hypotheses yield $|A|=2$, $|B|=3$ and that the imaginary part of $AB$ is $6$, that is
$$
AB=C+6i
$$
with $C$ real. Then $\bar{A}\bar{B}=C-6i$ and multiplying gives
$$
A\bar{A}B\bar{B}=C^2+36
$$
Thus $36=C^2+36$ and so $C=0$. Therefore
$$
AB=6i
$$
and
$$
z+ti=\frac{6i}{x+yi}=\frac{6i}{x-yi}{4}=\frac{3}{2}i(x-yi)=\frac{3}{2}(y+xi)
$$
whence again $z=\frac{3}{2}y$ and $t=\frac{3}{2}x$.
Comment: @lhf Yes, of course; OTOH, I don't think an [tag:algebra-precalculus] question can rely on CS.
Comment: +1, The first part is of course essentially a proof of the Cauchy Schwarz inequality mentioned by @астон.
Answer: Presumably, this should be solved over $\Bbb R$.
In this case the easiest way to think about this is that you have two (real) vectors $v = (x,y)$ and $w = (t,z)$.
Then,
$$\|v\| = \sqrt{x^2+y^2} = \sqrt 4 = 2,$$
$$\|w\| = \sqrt{t^2+z^2} = \sqrt 9 = 3,$$
$$v\cdot w = xt + yz = 6.$$
If we denote with $\varphi$ the angle between $v$ and $w$, we have
$$\cos\varphi =\frac{v\cdot w}{\|v\|\|w\|} = 1\implies \varphi = 0\implies w =\lambda v,\ \lambda>0.$$
Since $\|w\| = \lambda\| v\|$, we conclude that $\lambda = \frac 32$.
Considering polar coordinates, we can write $v = r(\cos\alpha,\sin\alpha)$, $w = \frac 32 r(\cos\alpha,\sin\alpha)$, where $\alpha\in[0,2\pi)$. Note that $$\|v\| =r\sqrt{\cos^2\alpha + \sin^2\alpha} = r\implies r = 2,$$ meaning that $v = 2(\cos\alpha,\sin\alpha)$, $w = 3(\cos\alpha,\sin\alpha)$, or
\begin{array}{cc}
\begin{align}
x &= 2\cos\alpha,\\
y &= 2\sin\alpha,\\
t &= 3\cos\alpha,\\
z &= 3\sin\alpha.
\end{align}&\tag{1}\end{array}
Returning to the original system we get
$$x^2+y^2 = 4\cos^2\alpha+4\sin^2\alpha = 4,$$
$$t^2+z^2 = 9\cos^2\alpha+9\sin^2\alpha = 9,$$
$$xt+yz = 6\cos^2\alpha + 6\sin^2\alpha = 6,$$
and thus, all (real) solutions are given by $(1)$.
Answer: Putting the parametric equation for both circles
$$x=2\sin a,y=2\cos a,z=3\sin b,t=3\cos b\\$$From this you get$$xt-yz=6\sin a\cos b+6\sin b\cos a=6\sin(a+b)=6\\\sin(a+b)=1\\a+b=\frac{\pi}{2}+2k
\pi$$
Which implies $x=2\sin(\pi/2-b)=2\cos b$ and $y=2\cos(\pi/2-b)=2\sin b$
From this we see that $(x,y,z,t)=(2\cos b,2\sin b,3\sin b,3\cos b)$ for each $b$


A query on $F$-homomorphism.

Question: Let $K/F$ be a field extension and $S=\{ s_1,\ldots , s_m\}\subset K$.
Does there exist a unique $F$-homomorphism $\psi: F[t_i]_{i=1}^m\to F[S]$ s.t $\psi(t_i)=s_i$?
Does there exist a unique $F$-homomorphism $\psi: F(t_i)_{i=1}^m\to F(S)$ s.t $\psi(t_i)=s_i$?
I think that the answer to the first question is yes and to the second that no; but I am not sure how to prove it?
Any input on this question?
Thanks!
Answer: The answer to the first question is yes: it is the universal property of polynomial rings.
As far as the other part is concerned, I assume that $F(t_1,\dots,t_m)$ is the ring of quotients of $F[t_1,\dots,t_m]$. Then $\psi$ can be extended to a homomorphism $F(t_1,\dots,t_m)\to F(S)$ (the codomain is the ring of quotients of $F[S]$) if and only if it is injective.
If you want a specific counterexample, take $m=1$ and $s_1=0$.

A query on $F$-homomorphism.


how to find out if something in general(scalar, function, vector) is in the span of a set

Question: im pretty sure that if a vector is in the span of a set of vectors, then it can be written as a linear combination of the vectors in the set, whch you can find out by setting up a system of equations. But what if you have an arbitrary object and want to find out if it is in the span of a set?
such as this:
$S = \{\cos^2x, \sin^2x, \tan^2x\}$
a) $1$
b) $\sec^2x$
c) $\cos2x$
d) $0$
which of these is in the span of this set? I want to say that $1$ can't be written as a linear combination of the three functions, but don't know how to find out concretely, I also want to say $0$ can be, because you can have $k1,k2,k3 = 0$, but am I allowed to have all scalars be $0$? and I'm not sure how to concretely figure out if the other functions or a value in general is in the span of this set. what is the most guaranteed way to find out whether something spans a set or not?
Comment: Please learn some latex
Answer: You do it the same way as with Euclidean vectors --  you check if you can represent a given function (/vector) by a linear combination of your basis:
That is, you try to solve:
$a)\ 1=a\cos^2(x)+b\sin^2(x)+c\tan^2(x)$
$b)\ \sec^2(x)=a\cos^2(x)+b\sin^2(x)+c\tan^2(x)$
$c)\ \cos(2x)=a\cos^2(x)+b\sin^2(x)+c\tan^2(x)$
$d)\ 0=a\cos^2(x)+b\sin^2(x)+c\tan^2(x)$
NOTE: the $a$'s, $b$'s, and $c$'s need not be the same for each problem.
If there is at least one solution $(a,b,c)$ to any of these, then that function is in the space spanned by $\cos^2(x)$, $\sin^2(x)$, and $\tan^2(x)$.
You should also note that some sort of $0$ (scalar, function, n-tuple, etc) will ALWAYS be in your space precisely because you can always have $a=b=c=0$.
So let's do $(a)$:
Remember that we have the Pythagorean identity: $\sin^2(x) + \cos^2(x) =1$.  So clearly one solution is $1=(1)\cos^2(x)+(1)\sin^2(x)+(0)\tan^2(x)$, AKA $(a,b,c) = (1,1,0)$.  Because we were able to find this solution, it means that $1 \in \text{span}(\cos^2(x),\sin^2(x),\tan^2(x))$.
Comment: With function spaces it's generally not as straightforward to tell if a given function is in your span.  You'll need to remember trig identities and other transforms.
Comment: @JL So can you see that all $4$ of these test functions are actually in your span?
Comment: Spoilers (if you want to figure it out on your own, read no further): for $(b)$ you use another version of the Pythagorean identity: $\tan^2(x) + 1 = \sec^2(x)$ (to derive that, just divide the regular identity by $\cos^2(x)$).  For $(c)$ you use the identity: $\cos(2x) = \cos^2(x) - \sin^2(x)$.
Comment: how do you solve for the first one, or find out if you can't solve it?
Comment: i see how a) and d) are, but the other two arent quite as obvious to me at this moment
Comment: Both require a trig substitution.
Comment: thank you! I'm in another class right now but I can take it from here later.


Cross-correlation of two non-stationary time series?

Question: I wish to test the cross-correlation of two time series to measure how "instantaneously related" my time series are. However, I am not quite sure if I should difference my time series first, and make them stationary? Because they obviously aren't:

And the cross-correlation I get is very different if I difference my time series, or not.
Cross-correlation cff() on original non-differenced data:

Cross-correlation cff() on differenced data with diff():

Which one is right? Am I supposed to use cff() on stationary data only? Thank you for the help.
Answer: why don't you post your data and I will try and help you. Box and Jenkins suggested pre-filtering where the differencing operator identified as part of the ARIMA process was used as part of the filter to identify model form via the resultant cross-correlation .    See https://web.archive.org/web/20160216193539/https://onlinecourses.science.psu.edu/stat510/node/75/ AND  http://www.math.cts.nthu.edu.tw/download.php?filename=569_fe0ff1a2.pdf&dir=publish&title=Ruey+S.+Tsay-Lec1 AND http://autobox.com/cms/images/dllupdate/TFFLOW.png . However if both X and Y are I(1) .. it is still possible that Y and X can related without any differencing at all which suggests that alternative approaches to incorporating differencing in the TF model or not be on the table.


Guitar getting out of tune quickly

Question: I have a Procraft guitar (made in China) that gets out of tune very quickly - especially after 2-3 minutes of strumming.  Specifically, the 4th and 5th strings get out of tune more than the other strings.
I noticed the bridge of the guitar has come up a bit. I have glued it, and have kept the guitar detuned for 24 hours.  Hopefully, this will solve the issue.
If this does not solve the issue, do I need to change the strings?  The bridge?  Something else?
Answer: Cheap strings also do not keep their tune as well as the better quality ones, meaning this relates to tensile strength and elasticity of the materials used.
On new strings, one solution is to up tight them some amount and leave overnight, and then tune-down instead of tune up. On Cheaper strings more than one consecutive night may be needed.
Also, if you reglued the bridge, depending on the glue used, and how you clamped it, 24 hours of drying time may not be enough. You should use carpenter glue for guitar, white one, would say, and clean and rough up the joint areas a little so glue absorbs into the wood. Clamping is very important to force the glue into the wood fibers, but not to be overdone.
Comment: I wouldn't try the trick of over-tuning on a cheap guitar, it might not bear up to the extra strain. But otherwise agree. +1 Welcome to the site!
Answer: If the bridge was coming up then that was probably the problem, so check to see if your fix has sorted it out.
The other likely causes of getting out of tune on cheap guitars:

machine heads slipping (can be fixed with a locking nut)
nut sticking (rub graphite in the grooves)

Guitar getting out of tune quickly


Como importar uma pagina html em outro html?

Question: Tenho uma página inicial onde existe um menu que abre diálogos. Hoje a está tudo em um html só, mas eu gostaria de separar, ou seja, desacoplar e deixar esse html do dialog separado da página inicial.
Comment: Já pensou em usar iframe?
Answer: Se não quiser importar o js da w3schools para usar o atributo "w3-include-html" que a Patrícia mencionou, você pode fazer isso utilizando o  do html mesmo. Ou até utilizar uma linguagem de programação para fazer o "include" de um arquivo separado (php ou .NET por exemplo) o qual eu, particularmente, acho mais recomendável.
Abraço!
Answer: Olá, é possível fazer isso usando JQuery, através da função load.
Exemplo:
$(document).ready(function() {
    $('#modal').load('modal.html');
});

Abraços...
Answer: Pode utilizar o attributo w3-include-html. Exemplo retirado do site https://www.w3schools.com/howto/howto_html_include.asp:
<!DOCTYPE html>


Centralizar texto em elemento, proporcionalmente

Question: No exemplo abaixo usa-se,  transform: translate(-50%,-50%);
para manter um texto no meio do elemento. Mas não é uma solução que funciona em todos os navegadores. Gostaria de fazer mesmo, mas com css simples ou até mesmo com jquery.

.artigo-content {
    background: #fff;
    color: #666666;
    border: 1px solid #F0F0F0;
    padding: 0 30px;
    height: 100%;
    text-align: center;
    position: relative;
    height:300px;
}

.artigo-inner {
    width: 90%;
    margin: auto;
    position: absolute;
    top: 50%; left: 50%;
    -webkit-transform: translate(-50%,-50%);
    -ms-transform: translate(-50%,-50%);
    transform: translate(-50%,-50%);
}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at eleifend leo. Praesent eu ex ligula.

Abril 26, 2018

Comment: O mais simples é mesmo `display:flex`
Comment: @Isac realmente a forma mais simples é com Flex indiscutível. Mas o suporte dos browsers ao Flex é ainda pior que ao Transform https://caniuse.com/
Comment: @hugocsl Embora o suporte ainda não seja a 100%. Todos eles suportam a partir de determinadas versões. O único patinho feio é o mesmo do costume, o IE, mas ai já seria de esperar. Com vendor prefixes ainda vai mais atrás nas versões.
Comment: @Isac Pois é o maldito IE sempre ele, mas muitas empresas só homologam para ele, pois isso pensando no que o autor da pergunta falou fiz o comentário.
Comment: Se está a utilizar o [`Bootstrap 4`](https://getbootstrap.com/docs/4.0/getting-started/browsers-devices/), então você já está dando suporte apenas ao `IE 10`, e o IE desde a versão 9 dá suporte a [`transformações 2d`](https://caniuse.com/#feat=transforms2d)
Answer: A versão para esse tipo de alinhamento mais antiga que conheço seria com display:table, com isso vc não precisa usar tamanhos fixos. (usando valores fixos também da para alinhar no centro)

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}
.artigo-main {
    height: 100%;
    width: 100%;
    display: table;
    text-align: center;
}
.artigo-content {
    display: table-cell;
    vertical-align: middle;
    background: #fff;
    color: #666666;
    border: 1px solid #F0F0F0;
}
.artigo-inner {
    margin: auto;
    width: 90%;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at eleifend leo. Praesent eu ex ligula.

Abril 26, 2018

Comment: @JohnQuimera ótimo, quanto menos interferir nos estilos nativos do Bootstrap melhor! Boa sorte com o projeto []'s Vi que vc está usando o Bootstrap 4 né, depois pesquise sobre a classe "d-flex" pode te ajudar com esses alinhamentos, é com flex, mas é nativo do BS4
Comment: Solução perfeita.
Comment: É possivel usar isso dentro de uma grid do bootstrap? Estou tentando aqui, mas não funciona.
Comment: John tente colocar !important em todos os estilos que vc usar para fazer esse customização principalmente no que for display, vc vai ter que substituir as classes default do bootstrap por isso precisa do !important.
Comment: funciona bem sem precisar fazer nada, eu reproduzir o demo no codepen: https://codepen.io/johnquimera/full/PRjpOY/
Comment: usarei certamente em algum momento, mas sua solução resolve o problema com outros navegadores. Agora eu queria ver se seria possível colocar uma imagem de fundo nesse texto, mas sem ser com 'background-image', mas com `` de modo que seja responsivo,. e o texto centralizado sempre se adapte ao tamanho da imagem.
Comment: @JohnQuimera cria uma pergunta nova para não bagunçar essa que já foi respondida e eu te ajudo lá. Provavelmente isso é possível de fazer sim! Vc quer que a imagem ocupe 100% da altura e largura de onde está dentro? Cria uma pergunta nova ai que eu te dou uma foça se estiver ao meu alcance.
Comment: acabei de criar. https://pt.stackoverflow.com/q/286090/95735


Cannot add a self signed certificate in Firefox

Question: I need to set up an IIS webserver that will be accessed by a small, finite number of users. I was considering using a self-signed certificate only, and manually installing it on the user's systems.
So I generated the certificate with IIS tools, installed it on the webserver, and exported it in a .cer file.
Adding it the Trusted Authorities in windows settings works well with Internet Explorer : it removes the unsecure warning.
In firefox, I can't make it work. Enabling the security.enterprise_roots.enabled option doesn't help. In Firefox Certificate settings, I can't import it to the Authorities panel, I get an error message :

This is not a certificate authority certificate, so it can't be
  imported into the certificate authority list

What can I do? I don't want to add an exception in Firefox, as it permanently disables any certificate checking on the URL, which means any man in the middle attack becomes straightforward. I want the user being blocked from accessing the website if the certificate changes on the server.
Comment: @LexLi: Your affiliation with Jexus Manager = `© Copyright 2015, Lex Li.`
Comment: If your site is public, do use Let's Encrypt free certificates. If internal, consult your network administrators to get internal certificates (from AD or other sources). Those are way better than the self-signed ones, especially when IIS Manager does not generate good enough test certificates, as the answer below shows.
Comment: If you do want to use self-signed certificates, Jexus Manager generates better ones, https://www.jexusmanager.com/en/latest/tutorials/self-signed.html
Answer: In order to be added to the certificate authority list in Firefox a certificate must have X509v3 extension CA:TRUE, e.g.
    X509v3 extensions:
        X509v3 Key Usage: critical
            Certificate Sign, CRL Sign
        X509v3 Basic Constraints: critical
            CA:TRUE

This would be the case if you had your own private CA certificate used for signing your server certificates: you could import it and use it for signing all your private server certificates, making them trusted in the browser at once.
With self-signed certificates the simplest solution is to add an exception, instead. Shortcut: chrome://pippki/content/exceptionDialog.xul. This makes an exception for THIS certificate alone. You'll still get a warning for untrusted certificate if the certificate changes.

It has peen possible to allow Firefox to trust CAs from Windows since Firefox 49 (Bug 1265113). The configuration parameter is security.enterprise_roots.enabled. It won't be set to true by default (Bug 1314010), but having this as a configuration preference makes it possible to distribute it via Group Policy, which makes it a perfect extension for CA certificates installed via GPO.
Currently by default general.config.filename seems already set to mozilla.cfg. You just need to add this line to file (replace it using Group Policy) %ProgramFiles%\Mozilla Firefox\Mozilla.cfg:
pref("security.enterprise_roots.enabled", true);

To lock the setting so that users can't modify it using about:config, use lockPref(), instead.
Comment: Thanks for the answer... This means self-signed certificates can't be used in firefox. URL Exception is totally unsecure (whereas installing a self signed certificate is, if done properly).
Comment: `chrome://pippki/content/exceptionDialog.xul` doesn't work for me (FF72, MacOS10.15).
Comment: It's not an URL exception but a certificate exception! If the certificate changes, it will show a new alert.


A problem with regex (non wanted end)

Question: I have the following pattern:
<code>(name|id)\s*=\s*('|")([a-zA-Z\-\_])+('|")
</code>
And I have to get all attributes name="a" or id="ab_c" which does not have the structure name="a-element" or id="a-element" (finishes with -element), I tried with:
<code>(name|id)\s*=\s*('|")([a-zA-Z\_][^-element])+('|")
</code>
but it does not work, what is the mistake??
Comment: Is this string part of some XML or HTML?  If so, don't parse it with a regex (http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454).  Instead, use `DOMElement` (http://php.net/manual/en/class.domelement.php) (or another XML parser).
Answer: You want negative look-arounds, like this:
<code>(name|id)\s*=\s*('|")([a-zA-Z\-_](?!-element))+('|")
</code>
(But keep in mind that you probably shouldn't be parsing XML manually.)

A problem with regex (non wanted end)


Proof of $Gal(K_1K_2/K_1)\cong Gal(K_2/(K_1\cap K_2))$

Question: Let $K_1/K$ and $K_2/K$ be Galois field extensions, and consider the compositum $K_1K_2$. Then $K_1K_2/K$ is Galois. We have then a natural map
$$\varphi: \operatorname{Gal}(K_1K_2/K_1)  \to \operatorname{Gal}(K_2/K)$$
given by restricting to $K_2$. It is easy to see that the image of $\varphi$ lies inside the subgroup $\operatorname{Gal}(K_2/(K_1\cap K_2))$, and that the morphism is injective, as an element in the kernel is an automorphism fixing $K_1$ and $K_2$, hence in must fix $K_1K_2$.
Now, I guess that the image of $\varphi$ should be $\operatorname{Gal}(K_2/(K_1\cap K_2))$, and this could be deduced proving that the groups $\operatorname{Gal}(K_2/(K_1\cap K_2))$ and $\operatorname{Gal}(K_1K_2/K_1)$ have the same cardinal.

My question is then: how can one prove that  $$|\operatorname{Gal}(K_2/(K_1\cap K_2))|=|\operatorname{Gal}(K_1K_2/K_1)|?$$
Comment: See also [this post](https://math.stackexchange.com/questions/2242292/question-in-proof-of-mathrmgalk-1k-2-f-cong-h-leq-mathrmgalk-1-f-t?rq=1).
Comment: @DietrichBurde In that post it is not solved my problem, as far as I see. I deduct from there that my guess should be correct, but in there it is not proved that part that I need.
Answer: I will rephrase your question to a more general case. Let $K \subset \Omega$ be an arbitrary field extension and assume that there exist two intermediate fields $M$ and $L$, such that $K \subset L$ is a finite Galois extension. There is a different way you can prove that $\text{Gal}(ML/M) \cong \text{Gal}(L/L\cap M)$.
Convince yourself that the extension $M \subset ML$ is a finite Galois extension and that $M \cap L$ is a field. Consider the restriction map $\text{res}:\text{Gal}(ML/M) \to \text{Gal}(L/K)$ that sends $\tau \mapsto \tau|_L$ and notice that this is an injective homomorphism. Therefore the image of $\text{Gal}(ML/M)$ is isomorphic to some subgroup of $\text{Gal}(L/K)$ and because of the Galois correspondence this image will be of the form $\text{Gal}(L/F)$ for some intermediate field $K \subset F \subset L$. Now, this $F$ is exactly the field that is fixed by the automorphisms $\tau|_L$ with $\tau \in \text{Gal}(ML/M)$, where $\tau$ fixes $M$ as an automorphism of $ML$ (you should reread this sentence a couple of times, because nothing really exceptional happens). Therefore, $F = L \cap M$. And you conclude that $\text{Gal}(ML/M) \cong \text{Gal}(L/L\cap M)$.