How is the "change password at next logon" requirement supposed to work with RDP using Network Level Authentication?

Question: We have a Windows server (2008 R2) with the "Remote Desktop Services" feature installed and no Active Directory domain. Remote desktop is set up to <code>"Allow connections only from computers running Remote Desktop with Network Level Authentication (more secure)"</code>. This means that before the remote screen is displayed, the connection is authenticated in a "Windows Security: Enter your credentials" window.
The only two role services installed on this server is the RD Session Host and Licensing.

When the "User must change password at next logon" checkbox is selected in the properties for a local user on this server, the following displays on a client computer after attempting to connect using the credentials that were last valid:

On some other servers using RDP for admin access (but without the Remote Desktop Services role installed), the behavior is different -- the session begins and the user is given a change password prompt on the remote screen. What do I need to do to replicate this behavior on the Remote Desktop Services server?
Comment: I have disabled password expiration on accounts that use RDP for this exact reason. Also: You can't change your password when connecting via an RD Broker. (Also password expiration does little except annoy users and increases helpdesk tickets, but that's a discussion for another day)
Comment: I don't think I'm using the connection broker. On the second point, I agree, but in some situations it's required for PCI compliance, and here I just want to force a password change for a user's initial login with whatever default I set for them.
Comment: No, you might not be. It's a problem with NLA *and* the connection broker (even without NLA)
Comment: Could you try using tsconfig.msc, right-click and edit the properties of the RDP-Tcp connection, change the security layer drop-down menu to 'RDP Security Layer,' and see if that helps?
Answer: I'm going to posit that you can't do this. With NLA (network-level authentication) enforced, a user cannot log in remotely and change his or her password.
You can use tsconfig.msc on the Remote Desktop server, right-click the RDP-Tcp connection and choose Properties, and change the security layer drop-down menu to 'RDP Security Layer,' but then you lose NLA. Unfortunately the two settings are mutually exclusive.
If you must have NLA, then you need to establish an alternate method for users to change expired passwords, such as through Outlook Anywhere, or RDWeb Access, or a physical console of a domain-joined workstation, etc.
This is sort of a catch-22 situation, because by design, NLA will not even allocate the system resources necessary to create a Remote Desktop session for you until after your credentials have been verified to be valid. But you would have to connect to a full session, have a desktop created, LogonUI.exe spawned for you, etc., in order to change your password. But you can't have a session because your password is expired. Allowing this would, I believe, open a hole in NLA where a user could bypass NLA and get a session anyway, even though they don't have a good (i.e. not expired) password.
http://support.microsoft.com/kb/2648402 says:

In the protocol specification for CredSSP, there is no reference to the ability to change the user's password while NLA is running. Therefore, the observed behavior can be considered "by design."
CredSSP is the underlying technology that enables NLA, and it does not support password changes. Therefore, password changes are not enabled in MSTSC. Other RD clients that support NLA should be unable to change the user's password.
Comment: It probably wasn't clear from my comment, but actually after I changed that setting to RDP security and then changed it _back_, I am no longer getting the error that I showed in my question. Instead, it is starting a session with the same "you must change your password" screen one would get were they to log on in person.
Comment: Ugh, no, I was wrong about that. The "only" box was unchecked and "negotiate" was selected.
Comment: FYI, I ran into the same issue where the only computers I could RDP to in the domain required NLA and my new account had "must change password at next login" checked. I was able to change my password by downloading MIT Kerberos for Windows and using that from my workstation to get a Kerberos ticket which prompted me to change my password.

This is the thread where I found out that AD requires you to use Kerberos to change initial password which pointed me to the eventual solution: http://www.perlmonks.com/?node_id=752162
Answer: PLEASE, who knows anything about the farm, absolutely:

Doesn't work with policy: network level authentication - disabled, restarting the desktop id service.

Doesn't work with tsconfig.msc on ALL machines in the farm setting protocol: RDP instead of NLA (negotiation), restart desktop account service.

Doesn't work when unchecked: only connect when client is running on network authentication..., set on ALL farm machines, restart desktop services.
ANYWHERE on the connection GATEWAY-BROKER-TEMINAL is a bug with the involvement of the protocol NLA or something else, but LOGON when using a farm gateway (the role of the gateway + broker + Web RD on one machine) - NO! I.e. once you check the box: user must change password at next login, you no longer get logon and therefore cannot change user password!!!
Who knows where to dig in the GATEWAY-BROKER-TEMINAL bundle, somewhere in the innards of the protocol, somewhere in the policies or somewhere else?
Comment: If you have a new question, please ask it by clicking the [Ask Question](https://serverfault.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/late-answers/502425)
Answer: In short! Here's the solution!

Make an account that will not be in any group of the domain, or rather make the group empty and put it the main user, removing even from the group domain users.

We add this user to the remote desktop group on the farm gateway only.

Then we write in ANY client properties of this user together with login, password, domain, ONLY in the gateway section.

In the same connection settings write the PC (usually the 1st PC in the farm), which needs to connect.

Everything. Profit. Thank you all. The solution was found by the collective mind of my team, for which she and I, including a BIG THANK YOU!


MySQL Order rows by date

Question: I'm trying to order my rows by the date that each row has.
One row has 2016-09-15 15:36 and one has 2016-08-15 13:12 How would i order them so that the highest one is at top?
Their row is called th_activity and i know that in a normal query, you would do something like SELECT * FROM threads ORDER BY th_activity DESC but i believe i know the problem. I use varchar as the type for the row. I'm not really sure what the length/value should be for date if that's what i must use.
If someone can explain how i would order this properly, i'd appreciate it.
Comment: I don't quite get why this is a problem for you. the beauty of ISO 8601-like date/time is that it can be sorted by alphabetical rules and still make sense...so even if the column is varchar, you should still get it sorted. if not, there may be whitespace characters before the date
Answer: If your date is year-month-day hour:minute, you can order alphabetically without any problems, so ORDER BY th_activity DESC should work fine.
Answer: You could have set the type of column as timstamp instead of varchar, which doesn't care about the length of data (only that while inserting data take care about the format).
Check this question to ordery by timestamp:
MYSQL - Order timestamp values ascending in order, from newest to oldest?
SELECT th_activity
FROM tableName
ORDER BY timestamp desc;

Comment: Thanks, Works perfect now!
Answer: could be you need a str_to_date conversion
select * from threads
ORDER BY str_to_date(th_activity, '%Y-%m-%d %h:%i') DESC

Answer: I would use a data type
datetime

and use the same select you wrote in the question :
order by th_activity DESC

MySQL Order rows by date


Addition and Subtraction of Convergent Series

Question: I have a simple question and I can't find the answer of it: If a series $a_{n}$ can be proven to converge and a series $b_{n}$ too, will the series $a_{n}+b_{n}$ converge? Same goes with the subtraction of them.
Thank you
Comment: Just straightforwardly input everyhting in the $(\varepsilon, \delta)$ definition of the limit and compute what comes out.
Comment: Yes, always. However, the sum of a divergent and a divergent **can** sometimes converge.
Answer: $\{a_n\},\{b_n\}$ converge implies $\exists a,b $ such that given any $\epsilon>0$, there exists $n_0\in \Bbb N$ such that $|a_n-a|<\epsilon/2,|b_n-b|<\epsilon/2$ $\forall n\gt n_0$
Then, for $|a_n+b_n-(a+b)|\leq |a_n-a|+|b_n-b|<\epsilon/2+\epsilon/2=\epsilon$
Therefore, $\{a_n+b_n\}$ converges to $a+b$
Comment: This is a good answer yet it may be the OP won't be able to see at once the relation between his question on series and this addressing *sequences* . Perhaps a little explanation about the sequence of partial sums of a series would be good.


Exibir categorias de cada postagem via JSON JS

Question: To usando o blogger, e preciso "gerar" as categorias de cada postagem.
function posts(json) {
 for (var i = 0; i < 11; i++) {
    var post = json.feed.entry[i];
    var postLabels = [];
  }
  for (var b = 0; b < post.category.length; b++) {
     postLabels.push(post.category[b].term);
   }
    document.write(''+postLabels.join(', ')+'');
  }
}

Funciona, porém mostra apenas a primeira categoria de cada postagem. Preciso que exiba todas, como faço?
  "published": {
            "$t": "2014-09-06T22:43:00.001-07:00"
        }
        ,
        "updated": {
            "$t": "2018-04-15T13:24:56.217-07:00"
        }
        ,
        "category":[ {
            "scheme": "http://www.blogger.com/atom/ns#", "term": "Car"
        }
        ,
        {
            "scheme": "http://www.blogger.com/atom/ns#", "term": "Gallery"
        }
        ,
        {
            "scheme": "http://www.blogger.com/atom/ns#", "term": "People"
        }
        ,
        {
            "scheme": "http://www.blogger.com/atom/ns#", "term": "Technology"
        }
        ,
        {
            "scheme": "http://www.blogger.com/atom/ns#", "term": "Teste"
        }
        ],
        "title": {
            "type": "text", "$t": "Photodune Vintage Car"
 }

Comment: Você já tentou console.log(json); para verificar se todas as informações estão chegando?
Comment: Edite a pergunta e coloque o retorno do console.log para facilitar na resposta.
Comment: Sim. Falta algo no código, acredito não ser difícil, eu que sou iniciante mesmo.
Answer: Só esta a exibir apenas uma categoria, porque dentro do primeiro laço for você declara a variável postLabels sendo um array, logo em seguida no segundo laço for, você define novamente ela e define seu valor como uma string, sendo que o correto é adicionar o valor em postLabels.
Você deve alterar a linha:
var postLabels = post.category[b].term;

para:
postLabels.push(post.category[b].term);

E altere também:
document.write(''+postLabels+'');

para:
document.write(''+postLabels.join(', ')+'');

Exemplo funcionando:

let json = {
  "feed": {
    "entry": [
      {
        "published": { "$t": "2014-09-06T22:43:00.001-07:00" },
        "category": [
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Car" },
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Gallery" },
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "People" },
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Technology" },
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Teste" }
        ],
        "title": {"type": "text", "$t": "Teste A" }
      },
      {
        "published": { "$t": "2014-09-06T22:43:00.001-07:00" },
        "category": [
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Car" },
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Teste" }
        ],
        "title": {"type": "text", "$t": "Teste B" }
      },
      {
        "published": { "$t": "2014-09-06T22:43:00.001-07:00" },
        "category": [
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Teste A" },
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Teste B" },
          { "scheme": "http://www.blogger.com/atom/ns#", "term": "Teste C" }
        ],
        "title": {"type": "text", "$t": "Teste C" }
      }
    ]
  }
};
function posts(json) {
  for (var i = 0; i < json.feed.entry.length; i++) {
    var post = json.feed.entry[i];
    var postTitle = post.title.$t;
    var postLabels = [];

    for (var b = 0; b < post.category.length; b++) {
      postLabels.push(post.category[b].term);
    }

    document.write('
');
    document.write('
'+postTitle+'
');
    document.write(''+postLabels.join(', ')+'');
    document.write('
');
  }
}
posts(json)

O problema de estar repetindo as tags.
Note o seu código as linhas que comentei:
for (var k = 0; k < post.link.length; k++) {
  if (post.link[k].rel == 'alternate') {var postUrl = post.link[k].href;}
  if (post.link[k].rel == 'enclosure') {
    // post miniatura ↓
    if(post.link[k].type == 'poster imagem'){var postImage = post.link[k].href;}
    if(post.link[k].type == 'miniatura video'){var postImage = post.link[k].href;}
    if(post.link[k].href == 'http://subtitulo.com'){
      var enclosureLinkSubtitulo = post.link[k].type;
    }
    if(post.link[k].type == 'tempo real'){
      var enclosureLinkSubtitulo = "TEMPO REAL"
      }
    // types icons ↓
    if(post.link[k].type == 'icone video'){var enclosureIcon = "";}
  }
  for (var u = 0; u < post.author.length; u++) {
    var postAuthor = post.author[u].name.$t;
  }

  // O PROBLEMA ESTA AQUI, ESTE FOR TEM QUE ESTAR FORA
  // DO FOR ATUAL.
  for (var b = 0; b < post.category.length; b++) {
      postLabels.push(post.category[b].term);
  }
}

Comment: Seria interessante se você [editar](https://pt.stackoverflow.com/posts/291773/edit) sua pergunta e colocar um trecho do JSON.
Comment: Veja o exemplo que coloquei na resposta! Ele esta funcionando normalmente. O motivo de estar repetindo nesse código que você colocou, é porque ele esta dentro de outro `for (var k = 0; k < post.link.length; k++)`
Comment: Blz, fico feliz em poder ajudar.
Comment: Funcionou meio termo. Ele até exibiu todas as tags, no entanto ele fica repetindo elas. Por exemplo: Tag1, Tag2, Tag1, Tag2, Tag1, Tag2, Tag1, Tag2...
Comment: Coloquei o código completo.
Comment: Desculpa se não entendi, mas isso ajuda?
Comment: Pronto. Coloquei, mas acontece como disse antes, ele exibe todas as tags, mas fica repetindo elas sem parar.
Comment: Certo. Resolveu^^


sort numerical array inside associative array php

Question: I have an associative array in following this format:
Array
(
    [214] => Array
    (
        [0] => 500 [1] => 350
    )
    [215] => Array
    (
        [0] => 500 [1] => 350
    )

I need to sort the array in ascending order, this is what I need:
Array
(
    [214] => Array
    (
        [0] => 350 [1] => 500
    )
    [215] => Array
    (
        [0] => 350 [1] => 500
    )

This is what I have tried so far:
foreach($array_tarifa_dia as $row => $values)
{
    foreach($values as $row1 => $values1)
    {
        $array[$row1] = $values;
    }
}
 array_multisort($array, SORT_ASC, $array_tarifa_dia);

function cmp($a, $b)
{
    if ($a == $b)
    {
         return 0;
     }
    return ($a < $b) ? -1 : 1;
}
uasort($array_tarifas1, 'cmp');

function cmp($a, $b)
{
   if ($a[214] == $b[214])
   {
       return 0;
   }
   return ($a[214] < $b[214]) ? -1 : 1;
}
uasort($array_tarifas1, 'cmp');

Comment: [Have you tried anything?](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=sort%20array%20php)
Comment: uasort array multisort foreach
Comment: foreach($array_tarifa_dia as $row => $values){
  foreach($values as $row1 => $values1){
   $array[$row1]  = $values;
 }

}

array_multisort($array, SORT_ASC, $array_tarifa_dia);
Comment: function cmp($a, $b) {
    if ($a == $b) {
        return 0;
    }
    return ($a < $b) ? -1 : 1;
}

uasort($array_tarifas1, 'cmp');
Comment: function cmp($a, $b) {
    if ($a[214] == $b[214]) {
        return 0;
    }
    return ($a[214] < $b[214]) ? -1 : 1;
}

uasort($array_tarifas1, 'cmp');
Comment: You will get an better response if you include all of your attempts in the question itself.
Answer: Use sort() on each array within the array.
foreach ($arr as $key=>$val) {
    if (is_array($val)) {
        sort($arr[$key]);
    }
}

See demo


Good rational approximations using continued fractions?

Question: My textbook claims that the best rational approximations (relative the size of the numerator and denominator) of an irrational number by using continued fraction are those whose expansions are terminated after a relatively large number.
Concretely, we know that $\pi = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, \ldots]$
So my textbook claims that good approximations would be
\begin{align*}
  x_5 & = [3, 7, 15, 1, 292] =  \frac{103993}{33102} & |\pi - x_5| = 5.78\cdot 10^{-10}\\
  x_{13} & = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14] = \frac{80143857}{25510582} & |\pi - x_{13}| = 5.79\cdot 10^{-16}
\end{align*}
But isn't it just the case that
\begin{align*}
  x_4 & = [3, 7, 15, 1] =  \frac{355}{113} & |\pi - x_4| = 2.67\cdot 10^{-7}\\
  x_{12} & = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1] = \frac{5419351}{1725033} & |\pi - x_{12}| = 2.21\cdot 10^{-14}
\end{align*}
are also pretty good relative to the size of the numerator and denominator?
Comment: Actually, if the *next* term in the continued fraction for $r$ is $n$, then $\frac1{n+2}\le q^2\left|\frac pq-r\right|\le\frac1n$. Thus, the approximant gotten by truncating the continued fraction for $r$ just before a large term is good in the sense that $q^2\left|\frac pq-r\right|$ is small. For example, $113^2\left|\frac{355}{113}-\pi\right|=\frac1{293.572643}$.
Answer: The CFEs are the best rational approximation to a number in the sense that if $\frac pq\in\mathbb Q$ is a convergent of $x\in\mathbb R$ and $\gcd(p,q) = 1$ then
$$\left|\frac pq - x\right| = \min_{p'\in\mathbb Z, 1\le q'\le q} \left|\frac{p'}{q'} - x\right|$$
So yes, all convergents are good approximations.


Fitting 3 Point Exponential Equation with Inverse Power

Question: I am trying to calculate the parameters of the Vogel−Fulcher−Tamman Equation. $T$ is temperature and $a,b,c$ are constants to be found.
$$\eta = a\exp(\frac{b}{T-c})$$
The experimental values are below

Temp /k
Viscosity $\eta$

293
313.9

313
75.6

373
7.6

I have tried the following:
$$\ln \eta = \ln a + \frac{b}{T-c}$$
If it was $\ln \eta = \ln a + \frac{b}{T}$, I could plot $\ln \eta$ against $\frac{1}{T}$ and the gradient would give b and the y-intercept would give me $\ln a$.
I don't know how to account for the $T-c$ in the denominator?
Comment: Which variable are you solving for?
Comment: @TymaGaidash I am solving for a, b and c. I am given $\eta$, viscosity, and T, temperature, which in reality would be measured experimentally at various temperatures with the viscosity of the fluid measured..
Answer: I don't think there's a closed form solution.
You have three equations in three unknowns $x$, $y$ and $z$ of the form
$$
x - r_i = \frac{y}{s_i - z}
$$
for known values corresponding to $i = 1,2,3$.
If you subtract the first from the second and the third you have two equations
$$
r_1 - r_2 = y\left(\frac{1}{s_2-z} - \frac{1}{s_1-z} \right)
$$
$$
r_1 - r_3 = y\left(\frac{1}{s_3-z} - \frac{1}{s_1-z} \right) .
$$
Then the ratio of those two equations is a single ugly nonlinear equation in $z$.
Solve it numerically and work backwards to get $y$ and then $x$.


How to add the datepicker jQuery UI element to Highcharts in a Drupal site?

Question: I am creating a Highstock (Highcharts) page in a Drupal site and I cannot seem to add the datepicker element. I have successfully implemented it in a non-Drupal environment here:
https://jsfiddle.net/MrSnrub/g7u14p10/
...but when I try to migrate it to a Drupal module, it fails. As I understand it, both jQuery and jQuery UI are installed by default in Drupal, is there a specific version that I need to worry about?  When I load up Firebug, it does not give me an error about the datepicker, so it must be interpreting it correctly, but when I load the page and click on the textbox, no datepicker appears. I have jquery_update module installed, and I'm running Drupal 7.  Here is my relevant Highstock JavaScript code:
$('#div-highstock-container').highcharts('StockChart', {
  chart: {
    renderTo: 'div-highstock-container',
    events: {
      load: create_new_legend
    }
  },

  // ...

  series: seriesOptions
},
function(chart) {
  // apply the date pickers
  setTimeout(function() {
    $('input.highcharts-range-selector', $('#' + chart.options.chart.renderTo)).datepicker()
  }, 0)
});

HTML:

PHP (in hook_page):
drupal_add_library('system', 'ui.datepicker');
drupal_add_js('
  jQuery(document).ready(
    function() {
      jQuery( ".highcharts-input-group" ).datepicker({
        autoSize: true
      });
    }
  );
', 'inline');

Do I need to call the datepicker() method in the PHP code or in the JavaScript code at the end of the highcharts() object creation function call, or both?
UPDATE: I changed the PHP code to the following, but the datepicker is still not showing:
drupal_add_js('
  (function ($) {
    Drupal.behaviors.addHighStockDatepicker = {
      attach: function(context, settings) {
        $( ".highcharts-range-selector" ).datepicker();
      }
    }
  })(jQuery);
', 'inline');

If I change the element from ".highcharts-range-selector" to "#div-highstock-container" the datepicker does appear in the main container (therefore, I know I am loading the jQuery library datepicker file successfully), so why does it not appear when I try to apply it to all elements with class "highcharts-range-selector"?
Answer: The datepicker was being displayed, it was just hidden by the Highchart. Adding z-index: 9999 !important; to the .ui-datepicker CSS solved it.
Answer: You need to wrap your JS code with Drupal behaviors, which can ensure your JS run after all required DOM elements in page are ready.
(function ($) {
  Drupal.behaviors.exampleModule = {
    attach: function (context, settings) {
      // Code to be run on page load, and
      // on ajax load added here
    }
  };
}(jQuery));

Also, you are not sure how to know if the jQuery is working. You can add console.log to output the jQuery object in console.
var obj = jQuery( ".highcharts-input-group" );
console.log(obj);

Comment: Is ALL of my JavaScript code supposed to go in Drupal.behaviors or just the call to the datepicker() function?
Comment: @MrSnrub Yes. But there is exception. If you want to define some helper function or global JS object. You should not write them into `Drupal.behaviors`.


postfix disable smtpd error notifications

Question: How can i disable postfix smtpd error notifications? Here is message headers:
From - Wed Oct 24 20:16:05 2012
Return-Path: <email@example.com>
Received: from mnl-latvia.lv ([unix socket])
     by localhost (Cyrus v2.x.xxx-Debian-2.x.xx-xxxx) with LMTPA;
     Wed, 24 Oct 2012 18:45:44 +0300
X-Sieve: CMU Sieve 2.xxx
Received: by example.com (ESMTP daemon)
    id D9F5315F5A8; Wed, 24 Oct 2012 18:45:44 +0300 (EEST)
Date: Wed, 24 Oct 2012 18:45:44 +0300 (EEST)
From: firstname.lastname@example.com (Mail Delivery System)
To: email@example.com (Postmaster)
Subject: ESMTP daemon SMTP server: errors from 130-12.104-92.cust.bluewin.ch[188.8.131.52]
Message-Id: <firstname.lastname@example.com>

Transcript of session follows.

 Out: 220 mnl-latvia.lv ESMTP daemon ready
 In:  EHLO
 Out: 501 Syntax: EHLO hostname
 In:  HELO
 Out: 501 Syntax: HELO hostname
 In:  QUIT
 Out: 221 2.0.0 Bye

Answer: looks like i found answer here:
i removed protocol from notify_classes directive
protocol
Send the postmaster a transcript of the SMTP session in case of client or server protocol errors. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster).

Comment: If you provided an answer to your question, feel free to mark it as accepted.
Comment: i need to wait 2 days :)


How to Attribute encode a PartialView in MVC (Razor)

Question: I'm using PartialViews to store the HTML for a tooltip in my ASP.NET MVC application.  My initial thought was that Razor would automatically attribute encode anything sat between quotes in my HTML.  Unfortunately this doesn't appear to be the case and so my workaround for now is to use single quotation marks to encapsulate my PartialViews HTML.  As below:

Some content

This works just dandy but obviously I have problems if there are any single quotation marks within my PartialView.
Does anyone know the proper approach to resolve this?  The closest I've got is the below:

Some content

Unfortunately this doesn't quite work because the output of a Partial is an MvcHtmlString rather than a straight string.
Anyone got a better idea?
Comment: What about `@HttpUtility.HtmlAttributeEncode(Html.Partial("_MyTooltipInAPartial").ToHtmlString())`?
Comment: Thanks - I tried this but VS complained :-(
Answer: Thanks to nemesv for the suggestion - it didn't pan out.  After a little pondering I ended up scratching my own itch by writing an HTML helper method called PartialAttributeEncoded.
For anyone interested, here's how you use the helper:

Some content

And here's the helper:
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;

namespace My.Helpers
{
    ///
    /// MVC HtmlHelper extension methods - html element extensions
    ///
    public static class PartialExtensions
    {
        ///
        /// Allows a partial to be rendered within quotation marks.
        /// I use this with jQuery tooltips where we store the tooltip HMTL within a partial.
        /// See example usage below:
        ///
Some content

        ///
        /// <param name="helper"></param>
        /// <param name="partialViewName"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        public static MvcHtmlString PartialAttributeEncoded(
          this HtmlHelper helper,
          string partialViewName,
          object model = null
        )
        {
            //Create partial using the relevant overload (only implemented ones I used)
            var partialString = (model == null)
                ? helper.Partial(partialViewName)
                : helper.Partial(partialViewName, model);

            //Attribute encode the partial string - note that we have to .ToString() this to get back from an MvcHtmlString
            var partialStringAttributeEncoded = HttpUtility.HtmlAttributeEncode(partialString.ToString());

            //Turn this back into an MvcHtmlString
            var partialMvcStringAttributeEncoded = MvcHtmlString.Create(partialStringAttributeEncoded);

            return partialMvcStringAttributeEncoded;
        }
    }
}

Comment: I ended up turning this into a blog post which you can find here: http://icanmakethiswork.blogspot.co.uk/2012/08/how-to-attribute-encode-partialview-in.html


Why is the alignment of notes written this way?

Question: I've been playing a song wrong for a while now, and it's only when I took the time to slow down the music that I learned why. The alignment of the notes on the sheet music is different to how it the music sounds. However, when put through MuseScore, it plays the sheet music how the music sounds, indicating that it's not a mistake that the sheet music is written this way. I'm wondering if there are any symbols I don't know the meaning of, or if I'm missing some piece of basic music theory knowledge.
Looking at the sheet music, why is it written the way it is?
I'm including two photos. The first is the actual sheet music, the second is how that sheet music sounds.

If you want to hear the song, the part I'm having trouble with occurs at 2:20. On musescore this is called mabinogi saga login theme.
Comment: It's kind of embarrassing, because before I knew the correct alignment of the notes, I had to use my feet or nose to hit all the right keys.
Comment: Don't believe everything you see on the screen. Computers are not infallible truth machines, and the playback in a program like Musescore is just a robot acting upon mechanical commands. Commands that might be complete mis-interpretations from what was actually intended for producing graphical notation for a human reader. Actual sheet music doesn't sound like anything, unless someone or something reads and interprets it. :) The Musescore robot has its own very special interpretation of things, and it's not the same as person X or Y's interpretation. :)
Answer: I would say: the author of the score on musescore.com intended the notes for playback by a human, and did not care to hack around in Musescore to get its playback exactly "right". ("Right" as in, to sound like they would play it themselves, or like in the original recording they did the transcription from.) The score in Musescore is a bit different from the one in the "OST" Youtube video, and the program's playback is probably not even what was intended. I can't hear much of an arpeggio on Youtube.
This is what it sounds like on Youtube (relevant part at around 2:20):

This is the playback in Musescore 2.3.2

Would any human player interpret the notes anywhere near like that? If the Youtube link to the original sound track is what was transcribed, then Musescored playback is plain wrong. Even the transcription is inaccurate, because I don't think there are any arpeggios. Maybe a different original soundtrack version was used for the transcription.
Replacing the grace notes with acciaccaturas changes the Musescore robot's programming, try it and you'll see. You could also add arpeggio lines, which are wavy lines in the "Arpeggios & Glissandos" palette.
See Different types of grace notes
Apparently, getting Musescore's playback to sound exactly "right" (i.e. in some particular way) needs some hacking around with hidden markings and plugins, to play back things like ritardando
https://musescore.org/en/handbook/tempo#ritardando-accelerando
For comparison, here's how Sibelius 6 interprets the same score, opened from MusicXML format (and after resetting layout and spacing). This is very close to how I would play it myself, except that the "rit." marking should be some kind of slowing-down (ritardando or ritenuto), but it doesn't seem to do anything.
Comment: The key point is that these notes are written as ornaments; there is no "exactly right."
Comment: @DavidBowling Truth be told, Musescore's playback was quite far out. But as we can see from this question, now in the computer age, to some extent, there is one perceived de-facto "exactly right" for everything, and that is: what the computer says. ;)
Comment: I hadn't yet listened to the Musescore playback, but that is pretty mechanical.... There is often too much emphasis on what is "correct" or "proper" in music already, and computers don't always help us with that ;)
Comment: Thanks for the awesome, easy to understand answer.
Answer: These are arpeggios, (one example many ornaments)
Imagine you are playing the harp accompanying a singer. Where would you place your chord? Before the beat, accurately with the beat, or delayed?
All will be o.k. It's just a question of interpretation and performance, or agreements between soloists, conductor and orchestra.
List and Examples of Music Ornaments
http://musicofyesterday.com/historical-music-theory/list-and-examples-of-music-ornaments/
Comment: That they are arpeggios should be irrelevant. Single notes in those positions would behave similarly counterintuituvely.
Comment: @Dekkado:  answer edit in respect of your post concerning arpeggios a one example of treating ornaments in general.


Widget Onclick is not working

Question: I am trying to create an app which updates every half an hour. and presently trying to launch on more activity on widget click, but its not working
following is my provider.java class
<code>public class Provider extends AppWidgetProvider {
public static void updateAppWidget(Context paramContext,
        AppWidgetManager localAppWidgetManager, int i, String string) {

    ComponentName thiswidget = new ComponentName(paramContext,
            Provider.class);

    AppWidgetManager manager = AppWidgetManager.getInstance(paramContext);
    int[] allWidgetIds = manager.getAppWidgetIds(thiswidget);

    for (int widgetId : allWidgetIds) {

        Intent in = new Intent(paramContext, display_widget.class);

        PendingIntent pendingIntent = PendingIntent.getBroadcast(
                paramContext, 0, in, 0);

        RemoteViews remoteViews = new RemoteViews(
                paramContext.getPackageName(), R.layout.main);

        remoteViews.setOnClickPendingIntent(R.id.Main, pendingIntent);
        localAppWidgetManager.updateAppWidget(widgetId, remoteViews);

    }

}

public void onUpdate(Context paramContext,
        AppWidgetManager paramAppWidgetManager, int[] paramArrayOfInt) {
    int i = paramArrayOfInt.length;

    for (int j = 0;; j++) {
        if (j >= i) {
            return;
        }
        int k = paramArrayOfInt[j];

        updateAppWidget(paramContext, paramAppWidgetManager, k,
                "soome string");
    }
}
</code>
}
thanks in advance.. :)
Comment: use `PendingIntent.getActivity(paramContext, 0, in, 0);`
Answer: Try using PendingIntent.FLAG_UPDATE_CURRENT
<code>        Intent intent = new Intent(paramContext, display_widget.class);
        intent.setAction(ACTION_BUTTON);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(paramContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
        views.setOnClickPendingIntent(R.id.widget_button, pendingIntent);
</code>

Widget Onclick is not working


What is the largest $n$ for which $n+5$ divides $n^5+5$

Question: The largest $n$ for which $n+5$ divides $n^5+5$ is? $n$ being a natural number.
Answer: Notice $(n+5)$ divides $n^5+5^5$(because $a+b$ always divides $a^n+b^n$ for odd $n$). So $n+5$ divides $n^5+5$ if and only if It divides $(n^5+5^5)-(n^5+5)=5^5-5=3120$.
The máximum is obtained by taking $n+5=3120$.
Comment: can you elaborate please:)
Comment: I got the answer though.it is 3115.
Comment: I did it as follows: (n^5)+5=(n+5-5)^5+5. and then using binomial expansion you can come to the answer.
Comment: Elaborated ${}{}{}{}{}$
Comment: typo mate, its gotta be if and only if divides...
Comment: Why you wrote, "So n+5 divides $n^5+5$ if and only if It divides $(n^5+5^5)−(n^5+5)=5^5−5=3120$" ?


Practice Problems on the Elimination of Quantifiers

Question: In a recent answer, JDH gave a remarkable proof that the integers are not definable in the structure $(\mathbb{Q},+,<)$ using Quantifier Elimination.
Since I already have the old Enderton book, are there other texts that provide problems that can give the reader some practice using Quantifier Elimination? Thanks!
Answer: Model theory texts typically have a section devoted to quantifier elimination.
For example, David Marker's book (google books link) shows quantifier elimination for the theories of dense linear orders, divisible abelian groups, presburger arithmetic, algebraically closed fields, and real closed fields all in the section pointed to there.  The exercises for that particular chapter have some simple theories to work out quantifier elimination for yourself as well.
Other parts of the book have scattered results on some other theories, and some general theorems that can help with proving quantifier elimination.
Comment: I second Marker's book. It is quite well-written and enjoyable.
Comment: Great! Many thanks to all.


Cannot read property 'length' of undefined Uncaught TypeError:?

Question: i am trying to print the object name in the y has its key value but getting an error.
please help me...
this is my java script code
var object = {
    name: "venu",
    id: 99,
    age: 100,
    "x": [
        "balaji",
        22,
        11
    ],
    "y": {
        name: "balu",
        id: 55,
        age: 22
    }
};

var g = object.x;
for (var i = 0; i < g.length; i++) {
    for (var k = 0; k < g[i].y.length; k++) {
        console.log(g[i].y.name);
    }
}

Comment: what are you trying to achieve in this code?
Comment: 1. There is no object with an property `y` in `object.x`/`g` 2. `object.y` would be an object and has no property `length`
Comment: JSON format is wrong, there is no property y in x.
Answer: var object = {
name: "venu",
id: 99,
age: 100,
"x": [
    "balaji",
    22,
    11
],
/*>>>not inside the x>>>*/ "y": {
    name: "balu",
    id: 55,
    age: 22
}
};

var g = object.x;
for (var i = 0; i < g.length; i++) {
for (var k = 0; k < g[i].y.length; k++) { //object.x.y.length is undefined as y is not something in x
    console.log(g[i].y.name);
}
}

Comment: Any reasonable explanation why?
Comment: i removed the double quoutes from the x and the y and i didn't get my answer
Comment: @balajiunnam Issue is not with quotes. Please refer @`Andreas`'s comment. That should be enough


Java annotation to create constructor

Question: I am using PageFactory page object model for my Automation Framework. Now for every page class I have to create a constructor. For example:
public class StudentProfile {

    public StudentProfile (WebDriver driver) {
        this.driver = driver;
        PageFactory.initElements(driver, this);
    }
}

But I want to create a custom annotation. So that I don't have to repeat it again and again for each Page Class
@InitElements(driver)
public class StudentProfile {

        // to do
    }

@InitElements(driver)
public class SchoolHomePage {

        // to do
    }

I have gone through following tuts, but couldn't understand how am I going to implement it?

https://www.baeldung.com/java-custom-annotation

Can I make a constructor for a custom annotation?
Answer: You basically cannot. The annotation API offers only two primitives:

Have the annotations be runtime-inspectable. This is great if you want to write a tool that, say, takes an instance of some class and uses annotations written on the fields of that class as guidance for serializing that instance into an XML or JSON blob. It does absolutely nothing for this use-case; you can't just add constructors to things at runtime and have that be useful (the constructors therefore do not exist at compile time which is obviously when you want them).

Have an annotation processor plug into the compilation process and it can see them. But, out of the box and by the API, annotation processors can generate new files; it cannot modify existing ones. Thus, it cannot add that constructor either.

There is a third option: Project Lombok which uses annotations and can generate code in existing files on-the-fly. But it's rocket science - we (I'm one of the core contributors) write custom code for various compilers and do some barely (to straight up un-)supported shenanigans along with a lot of maintenance effort to make sure everything keeps working.
This sounds like a fine task for a custom, just-for-your-project-and-no-others lombok addition which we don't meaningfully support. You can of course fork lombok off of github and add this if you must, but we have no tutorials for how to do that, and we don't recommend it.
Other than lombok (which is tricky), this is a straight up -impossible-, unfortunately.

Java annotation to create constructor


When did keyboard partitions start to use the G-clef for the upper staff ?

Question: When you look at very old sheetmusic (for harpsichord or organ), you see that the upper staff has a C-clef, first line. The lower one is the familiar bass F-clef, fourth line.
Why and when did the habits change?
Can you still find sheetmusic printed like this?
Are there still people using the C-clef, first line position?
Comment: You may be interested in reading http://www.jstor.org/stable/905327 and http://www.jstor.org/stable/905443
Comment: @Willie Wong: I certainly would, but they are behind a paywall.
Comment: drop me an e-mail (my e-mail should be available in my profile; if not, click on "network profile" and look for it on my webpage), and I can send you copies. They are both relatively short.
Comment: would someone with access be willing to quote the relevant parts of these articles in an answer?
Comment: JSTOR now allows for [individual, free access](https://support.jstor.org/hc/en-us/articles/360046231254-Benefits-of-an-Individual-JSTOR-account). There is a per-month article limit.
Comment: @Eric  If you live in the U.S., your local public library should be able to get you access.
Answer: Many pieces of music written in the renaissance and baroque periods were governed by rules of counterpoint.  Especially in the early forms of counterpoint (Renaissance period) one of the guidelines followed by composers was a limited range, generally not exceeding the distance of a fifth.  Avoiding leger lines was a strong rule when possible.
The C-clef is also referred to as the soprano clef.  In these early pieces it was most likely employed to avoid leger lines or just to better accommodate the range of notes the instrument would be playing in that particular piece.  The Harvard Dictionary of Music gives an explanation (under the definition of clefs) of the very numerous different clefs used in early music, which basically amounts to the idea of avoiding leger lines.
As music history moved forward into the classical, romantic and 20th century musical periods, many things became standardized.  While the alto and tenor clefs are still used for certain instruments, many of the other C-clef placements were phased out over time and musical natural selection left us with the repertory of clefs you see in our standard music literature today.
You may be able to find some more avante garde 20th century composers experimenting with things like archaic clefs but other than that i don't believe you'll find many composers today using them.
Comment: "many of the other C-clef placements were phased out over time" - I had asked a related question to drill more into the details for when exactly soprano/alto/tenor parts were all replaced with a variant of G clef
https://music.stackexchange.com/questions/52537/when-did-voice-parts-start-using-treble-clef
Answer: It is convenient to use a treble (G) clef over a bass (F) clef as adding a single leger line in between gives one a pretty good range that is easy to read quickly.


Cauchy Product - Power Series Representation

Question: Question
Use Cauchy product to find a power series representation of
$$ (1+x^2+x^3+\cdots)(1-x^2+x^3-\cdots)$$
Solution
$$ (1+x^2+x^3+\cdots)=\frac{1}{1-x}= \sum_{n=0}^\infty x^n $$
$$ (1-x^2+x^3-\cdots)=\frac{1}{1+x}= \sum_{n=0}^\infty (-1)^nx^n $$
The Cauchy Product states:
$$
\left(\sum_{n=0}^\infty a_n x^n\right)\left(\sum_{n=0}^\infty b_n x^n\right)
=\sum_{n=0}^\infty\left(\sum_{j=0}^n a_jb_{n-j}\right)x^n\tag{2}
$$
and
$$\sum_{j=0}^n a_jb_{n-j}=\sum_{j=0}^n (-1)^{n-j}= \begin{cases} 0 & \text{even} \\ 1 & \text{odd} \end{cases}$$
But now I am stuck and not sure quite what to do even though I know the answer is just
$$\frac{1}{1+x}\cdot\frac{1}{1-x}=\frac{1}{1-x^2} = 1+x^2+x^4+\cdots=\sum_{n=0}^\infty x^{2n}$$
Any advice would be helpful thank you in advance
Comment: You did a little mistake. Sine the sum runs through $j=0$ to $n$, if $n=2k+1$, then there are $2k+2$ terms which are alternating. So the Caucy coefficient is 0 when $n$ odd and $1$ when $n$ even.
Comment: The sum $1+x^2+x^4 + \cdots $ converges to $\dfrac 1 {1-x^2}$, not $\dfrac 1 {1+x^2}$. ${}\qquad{}$
Comment: @Tom . In Equation (2) the superscript k should be n. Then apply the next line to it.
Answer: Hint. Since
$$
\frac{1+(-1)^n}2= \left\{\begin{array}{ll}1 &\quad n = 2k\\ 0 &\quad n=2k+1, \end{array} \right.
$$ why not just write
$$
\frac{1}{1+x}\times\frac{1}{1-x}=\frac{1}{1-x^2} =\sum_{n=0}^{\infty}{x^{2n}}=\sum_{n=0}^{\infty}\frac{1+(-1)^n}2x^{n}, \quad |x|<1,
$$ the latter series being a power series representation?


Share of variance explained by one variable

Question: I have two independent variables, x1 and x2.
If I fit a linear model using only x1, I get this result

Model 1: R^2  = 0.66, p value = 4.34E-10 (***)

If I fit a linear model using both x1 and x2, I get this result

Model 2: R^2  = 0.66, p value x1 = 9.68E-05 (***), p value x2 = 0.56 ( )

Given that there is no increase in R^2 from Model 1 to Model 2, and considering that x2 is not significant, I would say that x2 explains 0% of the variance of the dependent variable.
However, if I fit a linear model using only x2, I get this result

Model 3: R^2  = 0.48, p value = 1.17E-06 (***)

In Model 3 x2 alone explains 48% of the variance, and it is highly significant.
So, what is the share of variance explained by x2: 0% or 48%?
Note: the two variables are also correlated, with Pearson r = 0.75
Comment: You wrote that the variable are independent in the beginning, then at the end of the post stated that the correlation was 0.75.
Comment: I mean independent w.r.t. to y, the dependent variable
Answer: You've actually stumbled on a pretty interesting idea that gets explained in linear regression classes. The answer to your question ("what is the share....") is that it depends on which model you're using.
Because your variables are highly correlated, they explain much of the same variance in the data you're trying to model. That means that while both variables are useful in predicting y on their own, when you put them both into to the model at the same time they're "explaining the same variance" and so only one of them will seem to be "significant".
As an extreme example, imagine fitting a model $y = \beta_{0}x_{1}+\beta_{1}x_{1}+\epsilon$ (this is unrealistic, since your variables are totally co-linear you would run into a slew of issues but it illustrates the idea) and looking to see which of the two variables were useful in predicting y. Of course in the separate models $y = \beta_{0}x_{1}+\epsilon$ and $y = \beta_{1}x_{1}+\epsilon$ you would find that both $x_{1}$ and $x_{1}$ were useful in predicting y. But in the general model, since they both explain the exact same variance in y, you could set either $\beta_{0}$ or $\beta_{1}$ to 0 and predict y just as well.


Printing in UWP app - different layout on different devices

Question: I've created printing solution for my XAML UWP MVVM application using example described on this link: https://xamlbrewer.wordpress.com/2016/10/25/a-recipe-for-printing-in-uwp-mvvm-apps/  (The source code is on the link: https://github.com/XamlBrewer/XamlBrewer.Uwp.PrintService )
Print preview that I get on my laptop is different than the one I get on the toughbook Panasonic CF-20. On the thoughbook layout gets messed up.
On the laptop (looks exactly the same on several laptops/PCs):
laptop_print
On the thoughbook:
thoughbook_print
My report page (page I use for preview/printing):
<code><Page
    x:Class="WK.Drf.FrontOffice.App.UI.DossierHandling.HandoverPrintReport"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WK.Drf.FrontOffice.App.UI.DossierHandling"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <RichTextBlock Height="640" VerticalAlignment="Bottom">
        <Paragraph TextAlignment="Left" Margin ="55,0,0,0">
            <Run Text="Overdracht" FontSize="30" FontWeight="Bold" />
            <LineBreak />
        </Paragraph>
        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="55"/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock TextWrapping="WrapWholeWords" FontWeight="Bold" Grid.Column="1" Grid.Row="0">RAV Kennemerland</TextBlock>
                    <TextBlock Text="{Binding AmbulanceNumber}" TextWrapping="WrapWholeWords"  Grid.Column="1" Grid.Row="1" />
                    <TextBlock Text="{Binding ParamedicCode}" TextWrapping="WrapWholeWords" Grid.Column="1" Grid.Row="2" />
                    <TextBlock Text="{Binding DriverCode}" TextWrapping="WrapWholeWords"  Grid.Column="1" Grid.Row="3" />
                    <TextBlock Text="{Binding ThirdPersonCode}" TextWrapping="WrapWholeWords"  Grid.Column="1" Grid.Row="4" />

                    <TextBlock Text="{Binding PatientName}" TextWrapping="WrapWholeWords" FontWeight="Bold" Grid.Column="2" Grid.Row="0" />
                    <TextBlock Text="{Binding PatientDateOfBirth}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="1" />
                    <TextBlock Text="{Binding PatientAddress1}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="2" />
                    <TextBlock Text="{Binding PatientAddress2}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="3" />

                    <TextBlock Text="{Binding PatientBsn}" TextWrapping="WrapWholeWords" Grid.Column="3" Grid.Row="0" />
                    <TextBlock Text="{Binding PatientInsuranceCompany}" TextWrapping="WrapWholeWords" Grid.Column="3" Grid.Row="1"/>
                    <TextBlock Text="{Binding PatientInsuranceNo}" TextWrapping="WrapWholeWords" Grid.Column="3" Grid.Row="2" />
                    <TextBlock Text="{Binding PatientEmail}" TextWrapping="WrapWholeWords" Grid.Column="3" Grid.Row="3" />
                    <TextBlock Text="{Binding PatientPhoneNumber}" TextWrapping="WrapWholeWords" Grid.Column="3" Grid.Row="4" />

                    <TextBlock TextWrapping="WrapWholeWords" FontWeight="Bold" Grid.Column="4" Grid.Row="0" />
                    <TextBlock TextWrapping="WrapWholeWords" Grid.Column="4" Grid.Row="1" />

                </Grid>

            </InlineUIContainer>
        </Paragraph>

        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="500"/>
                    </Grid.ColumnDefinitions>

                    <Rectangle Grid.Column="0" Height="1" Fill="DarkGray"></Rectangle>
                </Grid>
            </InlineUIContainer>
        </Paragraph>

        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="55"/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock FontSize="30" FontWeight="Bold" Grid.Column="0" Grid.RowSpan="8" TextAlignment="Left">S</TextBlock>

                    <TextBlock Grid.Column="1" Grid.Row="0" FontWeight="Bold" Visibility="{Binding Accident, Converter={StaticResource StringToVis}}">Ongeval:</TextBlock>
                    <TextBlock Text="{Binding Accident}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="0" Visibility="{Binding Accident, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="1" FontWeight="Bold" Visibility="{Binding AmpleEvents, Converter={StaticResource StringToVis}}">Situatie:</TextBlock>
                    <TextBlock Text="{Binding AmpleEvents}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="1" Visibility="{Binding AmpleEvents, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="2" FontWeight="Bold" Visibility="{Binding AirwayS, Converter={StaticResource StringToVis}}">A:</TextBlock>
                    <TextBlock Text="{Binding AirwayS}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="2" Visibility="{Binding AirwayS, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="3" FontWeight="Bold" Visibility="{Binding BreathingS, Converter={StaticResource StringToVis}}">B:</TextBlock>
                    <TextBlock Text="{Binding BreathingS}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="3" Visibility="{Binding BreathingS, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="4" FontWeight="Bold" Visibility="{Binding CirculationS, Converter={StaticResource StringToVis}}">C:</TextBlock>
                    <TextBlock Text="{Binding CirculationS}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="4" Visibility="{Binding CirculationS, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="5" FontWeight="Bold" Visibility="{Binding DisabilityS, Converter={StaticResource StringToVis}}">D:</TextBlock>
                    <TextBlock Text="{Binding DisabilityS}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="5" Visibility="{Binding DisabilityS, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="6" FontWeight="Bold" Visibility="{Binding ExposureS, Converter={StaticResource StringToVis}}">E:</TextBlock>
                    <TextBlock Text="{Binding ExposureS}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="6" Visibility="{Binding ExposureS, Converter={StaticResource StringToVis}}"/>

                </Grid>
            </InlineUIContainer>
        </Paragraph>
        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="500"/>
                    </Grid.ColumnDefinitions>

                    <Rectangle Grid.Column="0" Height="1" Fill="DarkGray"></Rectangle>
                </Grid>
            </InlineUIContainer>
        </Paragraph>

        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="55"/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock FontSize="30" FontWeight="Bold" Grid.Column="0" Grid.RowSpan="6" TextAlignment="Left">B</TextBlock>

                    <TextBlock Grid.Column="1" Grid.Row="0" FontWeight="Bold" Visibility="{Binding Allergy, Converter={StaticResource StringToVis}}">Allergie:</TextBlock>
                    <TextBlock Text="{Binding Allergy}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="0" Visibility="{Binding Accident, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="1" FontWeight="Bold" Visibility="{Binding Medication, Converter={StaticResource StringToVis}}">Medicatie:</TextBlock>
                    <TextBlock Text="{Binding Medication}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="1" Visibility="{Binding Medication, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="2" FontWeight="Bold" Visibility="{Binding PastIllnesses, Converter={StaticResource StringToVis}}">Verleden ziekten:</TextBlock>
                    <TextBlock Text="{Binding PastIllnesses}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="2" Visibility="{Binding PastIllnesses, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="3" FontWeight="Bold" Visibility="{Binding Insulation, Converter={StaticResource StringToVis}}">Isolatie:</TextBlock>
                    <TextBlock Text="{Binding Insulation}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="3" Visibility="{Binding Insulation, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="4" FontWeight="Bold" Visibility="{Binding InfectionRisk, Converter={StaticResource StringToVis}}">Besmettingsrisico:</TextBlock>
                    <TextBlock Text="{Binding InfectionRisk}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="4" Visibility="{Binding InfectionRisk, Converter={StaticResource StringToVis}}"/>

                </Grid>
            </InlineUIContainer>
        </Paragraph>

        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="500"/>
                    </Grid.ColumnDefinitions>

                    <Rectangle Grid.Column="0" Height="1" Fill="DarkGray"></Rectangle>
                </Grid>
            </InlineUIContainer>
        </Paragraph>

        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="55"/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock FontSize="30" FontWeight="Bold" Grid.Column="0" Grid.RowSpan="8" TextAlignment="Left">A</TextBlock>

                    <TextBlock  Grid.Column="1" Grid.Row="0" FontSize="20" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Bevindingen</TextBlock>

                    <TextBlock Grid.Column="1" Grid.Row="1" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Hoofd en gelaat:</TextBlock>
                    <TextBlock Text="{Binding HeadAndFace}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="1" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="2" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Nek/Hals/CWK:</TextBlock>
                    <TextBlock Text="{Binding Neck}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="2" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="3" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Rug:</TextBlock>
                    <TextBlock Text="{Binding Back}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="3" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="4" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Thorax:</TextBlock>
                    <TextBlock Text="{Binding Thorax}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="4" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="5" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Arm:</TextBlock>
                    <TextBlock Text="{Binding Arms}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="5" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="6" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Abdomen:</TextBlock>
                    <TextBlock Text="{Binding Abdomen}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="6" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="7" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Bekken:</TextBlock>
                    <TextBlock Text="{Binding Pelvis}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="7" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="8" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Been:</TextBlock>
                    <TextBlock Text="{Binding Legs}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="8" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="9" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Uitscheiding:</TextBlock>
                    <TextBlock Text="{Binding Secreteion}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="9" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="10" FontWeight="Bold" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}">Verloskundig:</TextBlock>
                    <TextBlock Text="{Binding Gynecology}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="10" Visibility="{Binding HeadAndFace, Converter={StaticResource StringToVis}}"/>

                </Grid>
            </InlineUIContainer>
        </Paragraph>
        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="55"/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <TextBlock  Grid.Column="1" Grid.Row="0" FontSize="20" Visibility="{Binding TreatmentSectionVisibility}">Behandeling</TextBlock>

                    <TextBlock Grid.Column="1" Grid.Row="1" FontWeight="Bold" Visibility="{Binding AirwayT, Converter={StaticResource StringToVis}}">A:</TextBlock>
                    <TextBlock Text="{Binding AirwayT}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="1" Visibility="{Binding AirwayT, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="2" FontWeight="Bold" Visibility="{Binding BreathingT, Converter={StaticResource StringToVis}}">B:</TextBlock>
                    <TextBlock Text="{Binding BreathingT}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="2" Visibility="{Binding BreathingT, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="3" FontWeight="Bold" Visibility="{Binding CirculationT, Converter={StaticResource StringToVis}}">C:</TextBlock>
                    <TextBlock Text="{Binding CirculationT}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="3" Visibility="{Binding CirculationT, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="4" FontWeight="Bold" Visibility="{Binding DisabilityT, Converter={StaticResource StringToVis}}">D:</TextBlock>
                    <TextBlock Text="{Binding DisabilityT}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="4" Visibility="{Binding DisabilityT, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="5" FontWeight="Bold" Visibility="{Binding ExposureT, Converter={StaticResource StringToVis}}">E:</TextBlock>
                    <TextBlock Text="{Binding ExposureT}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="5" Visibility="{Binding ExposureT, Converter={StaticResource StringToVis}}"/>

                </Grid>
            </InlineUIContainer>
        </Paragraph>
        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="500"/>
                    </Grid.ColumnDefinitions>

                    <Rectangle Grid.Column="0" Height="1" Fill="DarkGray"></Rectangle>
                </Grid>
            </InlineUIContainer>
        </Paragraph>
        <Paragraph>
            <InlineUIContainer>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="55"/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock FontSize="30" FontWeight="Bold" Grid.Column="0" Grid.RowSpan="6" TextAlignment="Left">R</TextBlock>

                    <TextBlock  Grid.Column="1" Grid.Row="0" FontSize="20" Visibility="{Binding AdditionalExplanation, Converter={StaticResource StringToVis}}">Verklaring Geen Vervoer</TextBlock>

                    <TextBlock Grid.Column="1" Grid.Row="1" FontWeight="Bold" Visibility="{Binding AdditionalExplanation, Converter={StaticResource StringToVis}}">Reden:</TextBlock>
                    <TextBlock Text="{Binding AdditionalExplanation}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="1" Visibility="{Binding AdditionalExplanation, Converter={StaticResource StringToVis}}"/>

                    <TextBlock Grid.Column="1" Grid.Row="2" FontWeight="Bold" Visibility="{Binding AdditionalExplanationText, Converter={StaticResource StringToVis}}">Toelichting:</TextBlock>
                    <TextBlock Text="{Binding AdditionalExplanationText}" TextWrapping="WrapWholeWords" Grid.Column="2" Grid.Row="2" Visibility="{Binding AdditionalExplanationText, Converter={StaticResource StringToVis}}"/>

                </Grid>
            </InlineUIContainer>
        </Paragraph>

    </RichTextBlock>
</Page>
</code>
What should I fix to get normal looking print layout on the thoughbook?
Comment: What are the differences in layout? Width? Fonts? Pagination? Line spacing? Margins?
Comment: TextBlocks with fix text are on the same positions, but the content that I'm getting from bindings is moved - spaces between lines are much bigger, some lines are overlapped and everything is moved to the right.
Comment: It need a testing on my side, but the data is too much for me to create a  reproduce page. Could you please give me a sample record?(For example, a sample data for Airway, BreatingT, CirculationT and so on are given)?
Comment: all of them are simple strings with a lot of characters. so you can basically use the same property that returns 300 characters long random string for all of them.
Comment: I've managed to fix my solution - I've put all of the TextBlocks inside of the Border with  Padding="0" Margin="0" and now everything looks nice on the laptop and toughbook as well
Comment:
Answer: I've managed to fix my solution - I've put all of the TextBlocks inside of the Border with Padding="0" Margin="0" and now everything looks nice on the laptop and toughbook as well:
<code><Border Padding="0" Margin="0" Grid.Column="0" Grid.Row="1">
 <TextBlock Padding="0" Margin="0" Text="{Binding AmbulanceNumber}"
 TextWrapping="WrapWholeWords"/>
</Border>
</code>


Determine the Function from the drawn function

Question: I  draw a function. Can any body help me what is the equation of the drawn function. I just attach the photo. Please visit the link. I think it is $f(x)=\dfrac{-x^2}{x^2+1}$, but it is not the exact function that I am looking.
Comment: For what value of $y$ lies the dashed line $y= ? $.
Comment: There is a horizontal Asymptote at y=1 so it exists to y<1
Comment: There is a vertical Asymptote at x=o, the function is even function, they are symmetric at y axis.
Comment: Then clearly your guess is wrong, because at $x=0$, $f(x) = y = 0$.  Hence, with your suggested function, $(0, 0)$ ought to be intersected by the graph of the function.
Comment: Sorry, the suggested function would be -(x²+1)/x²
Comment: In my suggested function, there is a horizontal function at y=-1 but I need to have y=1
Answer: Is it
$$y=\frac{2x^2-1}{x^2}$$
If one square in your picture is half a unit, then subtract one from this to get
$$y=\frac{2x^2-1}{x^2}-1 = \frac{x^2-1}{x^2}$$
And if you want it more "tight" put a scaling $r>0$ in it:
$$\frac{(rx)^2-1}{(rx)^2}$$
Comment: f(x)=x²-1/x² yes it is the function


Loading Java classes where package is not known in advance

Question: I have been using the below code to load the classes where I knew the package to load.
ClassLoader classLoader = ClassLoader.getSystemClassLoader();

Class<?> myClass = classLoader.loadClass(classNameToBeLoaded);

There is now change in the folder/package structure.
The variable classNameToBeLoaded can be from any package which I can't know in advance as the class name comes from an user provided Excel sheet.
For example the value of classNameToBeLoaded can be "Utils", "FileValidation" etc as read from Excel file.
This class can be from different packages like "com.iyaffle.utils" or like "com.testing.validation" or anything so.
How can I make the class to be loaded automatically when we don't know the package name?
Other similar thread which does not have concrete answers:

Load all classes in a specific folder without knowing package name - java
Comment: You can't. Make the user provide the package name.
Comment: @EJP :
There will be only couple of packages that will be used and it has no methods with same name.
Comment: Why not just call `loadClass` for one package, and if it fails call it for the other package?
Answer: You do need to know the fully qualified name to load the classes, there are lots of classes that have the same class name, and the only thing that keeps them distinct is the package name.
A good example is the following:

java.awt.List
java.util.List

If the classes do not have common methods you need to call you can just load them like you are doing now, but adding on the package name.
The safest way to call common methods is to have a static interface or abstract class that all your dynamic classes extend, so that you can then treat the dynamically loaded class instances as instances that implement the common methods.
Comment: You could have a map from short class name to full class name, this would also help reduce your attack surface, as it would stop an attacker loading arbitrary classes, possibly running arbitrary code
Comment: There will be only couple of packages that will be used and it has no methods with same name.


A limit involving $\cot$ that seemingly shouldn't exist

Question: According to Wolfram Alpha, $$\lim_{x \to \infty} \frac{x - \cot x}{x} =1.$$
But does the limit even exist? Isn't $\frac{x - \cot x}{x}$ unbounded near $x= n \pi$ for all $n \in \mathbb{N}$?
Assuming that the limit doesn't actually exist, what might explain why Wolfram Alpha thinks that it does exist?
Comment: If you try to do it numerically then most likely you won't actually hit $n\pi$ so it will, numerically, appear to converge to $1$.
Comment: Sounds like its just wrong, clearly you have a sequence on which the limit does not exist, so the whole limit cannot. No idea how it does limits, possibly a truncated taylor series which it doesn't pay enough attention to radii of convergence?
Comment: Maple 17 returns "undefined". Best possible answer. (Mathematica returning the original limit might mean the limit doesn't exist, or that it doesn't know how to do the limit.)
Comment: Maybe Wolfram has a sense of humor: If you can't tell when it's bleepin' obvious that an expression is unbounded in every neighborhood of $a,$ it returns $1$ as the limit of the expression as $x\to a.$
Comment: Just to point it out, the question isn't whether the limit exists or not, but rather why does WA think it exists. **Edit:** Not only does the limit not exist, but also it doesn't even make sense to question it because limits at infinity are only defined when the domain of the function contains $[a,+\infty[$, for some real $a$ and, as the OP pointed out, this isn't the case.
Comment: For what it's worth, *Mathematica* v10.4 returns the limit unevaluated.  So I'm not sure why WolframAlpha is concluding that the limit exists.  Seems to be a bug on their part.
Comment: I tried that link just now - it spent five minutes saying "computing", then I gave up.
Comment: @DavidC.Ullrich For me it returns $1$ after about 10 seconds.
Answer: When we ask Mathematica (10.4) to compute a power series for $f(x) = \frac{x - \cot(x)}{x}$ around $x = \infty$ (of order 10), we get $$  1 + \cot(x)\left(\frac{-1}{x} + O\left(x^{-12}\right) \right) + O\left(x^{-11}\right)  \text{.}  $$  If we imagine that cotangent was a very nice function (heh), we'd say it is getting crushed by $-1/x$ as $x \rightarrow \infty$ and similarly for the big-O residuals.  This just leaves the "$1$" in the limit.  (This property of Mathematica's Series[] function to use some simple transcendental functions rather than expand them into the series is frequently irritating.)
If we ask Mathematica to evalute the limit, it stares at us blankly
In:  Limit[(x - Cot[x])/x, x -> \infty ]

Out:  Limit[(x - Cot[x])/x, x -> \infty ]

If we ask Wolfram Alpha to do expand $f$ in a series around $\infty$, it stares at us blankly
Series[(x - Cot[x])/x,{x,\infty,2}]

(no series expansion available)

So I can't guarantee that Alpha is using the above expansion to arrive at the wrong limit.  But I'd bet a dollar that it does.


Floyd Rose Bridge Fine tuner knobs pitch goes up and then down

Question: So i recently got a new guitar which has Floyd Rose tuning system. I had tuned it low when i got it and then went back up to E Standard tuning. Since then i noticed that when i adjust the fine tune knobs, the pitch goes up then down when i let it go. I did raise the bridge up when i tuned it low because the strings were rattling on the frets so lowering the bridge down a bit did help a lot but it is still doing this.
Any ideas of what could be causing this? I saw in videos on how to restring a floyd rose, they recommend to level the bridge with the guitar but doing that makes the bridge float a lot less and stiffens the whammy. And yes, the knobs still make the pitch go up then down when i let go.
Comment: How much does the pitch change when you adjust the fine tuners?  Is it a few cents, or more?
Comment: Almost half step sometimes
Answer: Ok so i figured out my problem. Its actually quite silly...
The "issue" was simply, i was pressing on the bridge while turning the knob making the bridge bend back a little, lol. So this time i simply was more careful and also followed this guide from Floyd Rose on how to tune the guitars which helped me properly adjust the bridge while tuning.
https://floydrose.com/blogs/tech-talk/string-tuning-instructions
Step 1:
Loosen the three string clamps at the nut
Step 2:
Set your fine tuner screws on the bridge to the middle of their adjustment range.
Step 3:
Tune the strings to your desired pitch (this can be drop tuning, open tuning, or standard pitch, the procedure is the same for any tuning) with an electronic tuner starting with the low 'E'.
Step 4:
When you have finished tuning all of the strings, check the tuning on the low 'E' again. If the low 'E' is now flat, re-tune the strings starting again with the low 'E' but this time tune the E, A, D, G, and B strings a little bit sharp, then the high 'E' to pitch. If the low 'E' is sharp, re-tune as just described only tuning the first five strings a little flat. You must tune the strings a little sharp or flat to get to your tuning because every time you change the tension (or pitch) of one string, the other strings change pitch in the opposite direction.
Step 5:
Repeat step 4 until all the strings are at the desired pitch.
Step 6:
When the strings are at the desired pitch, check to see if the bridge base plate is sitting parallel with the top surface of the guitar. If the base plate is tilted forward away from the body, you must tighten the tremolo springs tension by turning the spring claw screws clockwise and repeat step 4. If the base plate is tilted back toward the body, you must loosen the tremolo springs tension by turning the spring claw screws counterclockwise and repeat step 4. [Step 6 only needs to be done on initial setup of the bridge or if you change to another gauge of strings or change to a different tuning.]
Step 7:
When the bridge is sitting parallel to the face of the guitar and the strings are tuned to the desired pitch, re-clamp the three nut clamps and re-tune (if necessary) once again using only the fine tuners.
Step 8:
When tuning is complete, check the action of the strings off the neck. If your action is to high or to low, adjust the action with the two rocker screws (bridge pivot screws) using the 3mm Allen wrench. This adjustment will slightly change your tuning. If your fine tuners run out of range you must repeat steps 1 through 7.
Answer: Another option: you can add a stop block that prevents this (and also blocks pull-ups). You can still dive bomb. I used this option because I tend to rest my right hand occasionally on the Floyd Rose bridge.
There's also this option, which allows you to switch between a totally blocked   whammy, the option I described above, or an unblocked whammy:


Algebra - rings $2\mathbb Z$ and $\mathbb Z_3$

Question: Can anyone tell what's the difference between these two rings: $2\mathbb Z$ and $\mathbb Z_3$ ?
I think that ring $2\mathbb Z$ represents remainders when dividing with two, can anyone help? Thanks for your time!
Comment: Do you mean $2\Bbb Z$ and $\Bbb Z_3$? Or $\Bbb Z^3$? Or $3\Bbb Z$? Or something else?
Comment: @Haus ...... and it is not any of those Arthur listed? Surely you could say which ones were the relevant ones, if so.  The way to type those, respectively is `$2\mathbb Z$` `$\mathbb Z_3$` `$\mathbb Z^3$` and `$3\mathbb Z$`
Comment: @Haus Whenever you are asked for clarification, you can respond in the comments, but then you should *also fix your question*. Use the edit button.
Comment: Thank you. I am still learning how to write tasks here.
Comment: $2\mathbb Z$ and $\mathbb Z_3$.
Comment: $\Bbb Z_{\Large 2}\,$ is the ring of residues (remainders) $\bmod 2.\,$ It is also denoted by $\,\Bbb Z/2\Bbb Z,\,\ \Bbb Z/2,\,\ \Bbb Z\bmod 2\ \ $  Furthermore, $\, 2\Bbb Z\,$ is the set (= ideal) of all integer multiples of $\,2\ \ $
Answer: $2\Bbb Z $ is the set of all multiples of  $2$ whereas  $\Bbb{Z}_3$ is the set of all equivalence classes under the relation $\text{R}$ on $\Bbb Z $ such that $a\text{R}b $ if and only if $3|(b-a) $.
Edit: $\mathbb Z_3$ is also the standard notation for $3$-adic integers.
Courtesy :@rschwieb
Comment: Some people are going to complain that $\mathbb Z_3$ is also standard notation for $3$-adic integers, so you should probably also add that.
Comment: https://en.wikipedia.org/wiki/P-adic_number  Well, if you feel like improving your answer and hedging against that, there you go.  I'm not really sure you'd need to do anything more than mention it, if you wanted.
Comment: @rschwieb I'm completely ignorant of the meaning/definition of  $3$-adic integers.
Comment: @rschwieb Thank you for your suggestion. I've edited my answer.


How to get authProvider for OneNote API

Question: I'm using MS.Graph and trying to get a list of my OneNote Notebooks.
Here is the code I'm using.
<code>IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithTenantId(tenantID)
.WithClientSecret(clientSecret)
.Build();

ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var notebooks = await graphClient.Me.Onenote.Notebooks
    .Request()
    .GetAsync();
</code>
I can get the clientID, but where/how to I get the tenantID and clientSecret?
Answer: You might be able to get more info through this reference: https://learn.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=CS#client-credentials-provider
Answer: I used Microsoft.Graph.Auth (Pre-Release) from NuGet.  That fixed the problem

How to get authProvider for OneNote API


How to configure ant pattern in jenkins for email attachments?

Question: I am trying to give the following ant pattern for attachments.
I believe my base directory could be /var/lib/jenkins/workspace/

I have  error.log.gz file in directory /var/lib/jenkins/workspace/error/
The email is coming with no attachments. Can some one please tell where its going wrong, or could you please share a sample ant xml pattern for attachments in jenkins?
Comment: Usually base directory for a job is: /var/lib/jenkins/jobs//workspace. Can you check it?
Answer: Try this pattern-

<attachments>
  <fileset dir="dist">
    <include name="**/*.gz" />
  </fileset>
</attachments>
Comment: Thanks for your comments, I have tried using the above pattern in attachments field, it didn't work.
Also I have tried changing the base directory as /var/lib/jenkins/jobs// there is no folder called workspace inside the specific job folder by default.
Please let me know if anybody has tried this attachments in their projects!
Answer: Try this below pattern in Editable Email Notification,it will send the attachment in email
**/error/error.log.gz