text:
Q: What could cause scrollTop to malfunction? I'm have been dealing with a weird bug for the last few hours.  Totally losing my mind on this one.  Hopefully it is something simple that I am just overlooking.  Hope someone can help.
Part of the complexity of the page is I am using Twitter Bootstrap with a fixed header and i am trying to use anchor links on the page as well to link to some things in this rather long page.  I actually had this working before I completed some mobile optimizations to the website today then all of a sudden my anchor links stopped working.
What's happening is when i click the anchor links, the page slides up, but no matter what link i click it always stops on the same link.  I checked and all of my href's are properly closed.  I've tried renaming all of the anchors and the targets to something unique just in case there was some naming conflict, but it still does the same thing.  Pretty much stops where the first anchor.
Here is my HTML:

option 1

option 2

option 3

option 4

And then my anchor looks like this:

And then there is content and divs between each of the anchors.
Here is the javascript i am using:
jQuery('.subnav-module a[href*=#]:not([href=#])').click(function() {

if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {

  // grab the anchor link name, the hash
  var href = jQuery.attr(this, 'href');
  var target = jQuery(this.hash);

  target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
  if (target.length) {
    jQuery('html,body').animate({
      scrollTop: target.offset().top - 150 //offsets for fixed header
    }, 1000, function () { window.location.hash = href; });
    return false;
   }
 }
});

I attempted a console.log(scrollTop) after that line and it returned the same number when i clicked each anchor link.  So, i think it is miscalculating the position on the page of these divs.
But, what would cause this script to miscalculate that?
Other things I've tried:

*

*Removed all of the media queries from the stylesheet - didnt help.

*Removed rather sections and blocks of css from the stylesheet (mainly classes related to the header and to this page) - didnt help.

Does anyone have any suggestions for anything else i can try?

A: Problem Solved.
Here is the solution if by some chances someone else has this same problem.
Add a class to your anchor targets

The CSS for the anchor class needed this:
a.anchors, a.anchors:link { display:block; clear:both;  }

A: It appears to me that the selector you have chosen a[href*=#]:not([href=#]) seems contradictory.
Have you tried something like:
$('#opt1, #opt2, #opt3, #opt4' ).click(function() {
// your code.
});
???


text:
Q: Algorithm as Equation I have developed an algorithm that counts the number of times a particular block (within a 2D Matrix) crosses zero. Here's an example:
Matrix = {
            1, 2, -1, -0.1,
            4, 3, -6, -12,
            12, 2, -5, 19,
            8, -1, 12, -9,
          }

Then the matrix is split into sub-matrices (or blocks)
B1 = {
        1, 2,
        4, 3
     }

B2 = {
        -1, -0.1,
        -6, -12,
     }

...,

...,

...

An example summing up each of the blocks is:
Ex=∑n|x[n]|2
Find the signum value of each element within the block (will return "1", "-1", "0") respectively.
If the signum value returns -1 then count increments by 1.
This will repeat until the there is no blocks, however, will only produce 1 value per block.
I am looking for a way to put all this process into an equation so I can demonstrate this rather than having to explain the processes in written text everytime. Is this possible?

A: If data is $B=(b_1, b_2, \ldots, b_n)$ and all numbers are nonzero then the number of zero cross-overs will be
$N(B)=\sum_{i=1}^{n-1} \frac{1}{2}|\mathrm{sgn} b_i - \mathrm{sgn} b_{i+1} |$
If you have zeros in the data, you should remove them before applying this, otherwise a closed-form equation would be too cumbersome.

A: Suppose your data is $x_1,...,x_n$, then let $C(x) = | \{i | i=0,...,n-1,\ \mathbb{sgn}\, x_i \neq \mathbb{sgn}\, x_{i+1} \}  |$.
Unfortunately the above is wrong when $x$ contains zeros. The fix is cumbersome:
$$ C(x) = | \{i | i < n,\,  \exists j >i,\,  j\leq n,\, |\mathbb{sgn}\, x_i -\mathbb{sgn}\, x_j|=2, \, x_{i+1} = \cdots = x_{j-1} = 0 \}  |$$
This presumes that $\mathbb{sgn}\, 0 = 0$.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Error accessing Azure AD Graph explorer I want to access the Azure AD Graph Explorer using my administrator account. When I try to access it, it shows this error:

Selected user account does not exist in tenant graphExplorerMT and cannot access the application d3ce4cf8-6810-442d-b42e-375e14710095 in that tenant. The account needs to be added as an external user in the tenant first. Please use a different account.

What shall I do?

A: You should probably try with a user that is internal to the AAD or add your MS account as an external user to it.
The Azure subscription admin is not necessarily part of the Azure Active Directory.

A: For Azure AD Graph Explorer, you can only use the member account(internal) to sign in, such as xxx.onmicrosoft.com.
You cannot use a guest user account(external) to sign in AAD Graph Explorer.
Solutions:
Try to sign in AAD Graph Explorer with a member account.

A: According to this answer on Microsoft's forum, this does not work with Microsoft accounts.

Are you trying to sign in using a Microsoft account (outlook/live)  into https://graphexplorer.azurewebsites.net/ ?
Azure AD Graph explorer cannot authenticate social accounts and only works with work or school accounts in Azure AD.
You would have to use the latest MS graph, if you want to use MSA accounts


text:
Q: Find Equation for Line Bounding Bottom of Scatter Plot I have a scatter plot and I am trying to get the equation of a line that best fits the bottom bound of the data.
I started by taking some guesses for the best form of the boundary equation and used the FindFit[] command to test out each. Once I found a good shape I used it to split the data and create a subset of the data that was closest to the bottom boundary. I then used the FindFit[] command again with the same form for the equation and got a line that more closely fit the bottom boundary.
When I took the sum of the squares error for this line with my data I got a number over 100 which isn't great. Is there a better way to do this? I tried to follow what I found in these posts here and here and I was unsuccessful. Any suggestions are appreciated.
The code for my data to fit and resulting fit line are as follows.
datatofit = {{6.737172338, 3.363690623}, {7.050660212,
3.373736489}, {7.045260043, 2.970956386}, {7.029287617,
2.9525655}, {7.004950478, 2.879583858}, {6.974853608,
2.86146603}, {6.941458132, 2.818494481}, {6.906952777,
2.893338455}, {6.872201926, 2.940551101}, {6.837925451,
3.397634859}, {6.803204973, 3.552844431}, {6.766544775,
3.244249901}, {6.71850745, 3.302987412}, {6.684253549,
3.167875865}, {6.66670728, 3.150775565}, {6.654886001,
3.152303268}, {6.647275038, 3.151626188}, {6.643345749,
3.151580709}, {6.64064312, 3.151574041}, {7.046091938,
3.120075363}, {7.040626586, 2.771751037}, {7.024372252,
2.799740928}, {6.999594641, 2.669548897}, {6.968712172,
2.676528958}, {6.934228877, 2.624395294}, {6.898397676,
2.652516685}, {6.861701263, 3.106205768}, {6.824856341,
3.256504668}, {6.786708972, 3.083377532}, {6.744894076,
3.219777785}, {6.68699347, 3.464187669}, {6.644085885,
3.056803258}, {6.621036724, 3.03776599}, {6.60495429,
3.03613608}, {6.593188858, 3.028994499}, {6.584495417,
3.032142225}, {6.578697835, 3.032760756}, {7.043005505,
2.879433241}, {7.037448284, 2.673586176}, {7.021021612,
2.731079036}, {6.995891975, 2.566450694}, {6.964546514,
2.600742648}, {6.92940586, 2.532713837}, {6.892545224,
2.547549465}, {6.854596368, 2.771142903}, {6.816023846,
3.123130369}, {6.775368031, 3.093750555}, {6.7299056,
3.183432893}, {6.664947098, 3.667093691}, {6.615699834,
2.983366728}, {6.588638333, 3.392473696}, {6.569315509,
2.950492375}, {6.554261586, 2.941110252}, {6.542808184,
2.941959397}, {6.533554849, 2.93893594}, {7.040691711,
2.698683379}, {7.035116631, 2.621157784}, {7.018574159,
2.700002587}, {6.993203755, 2.511981159}, {6.961459733,
2.560957061}, {6.925824728, 2.487887417}, {6.888304185,
2.509698731}, {6.849403353, 3.013369851}, {6.809502199,
3.030071466}, {6.767022251, 3.453330064}, {6.718737756,
3.093764566}, {6.648469337, 3.580313549}, {6.593848593,
2.877026086}, {6.563586948, 3.152084598}, {6.541449976,
2.830720899}, {6.524255063, 2.827916495}, {6.510411715,
2.826588059}, {6.498860923, 2.824406461}, {7.038955285,
2.578493867}, {7.033340199, 2.612255811}, {7.016687959,
2.735690273}, {6.991143306, 2.508233093}, {6.959143325,
2.555844374}, {6.923117192, 2.49172362}, {6.88506039,
2.536450569}, {6.845406911, 3.071325015}, {6.804569678,
3.193536334}, {6.760718398, 3.28270189}, {6.710350047,
2.531280794}, {6.635755922, 3.20519061}, {6.57698951,
2.26708585}, {6.543796226, 2.457274245}, {6.519703559,
2.229251888}, {6.500484118, 2.68381051}, {6.484778548,
2.226266777}, {6.471324049, 2.229252698}, {7.037601367,
2.5107129}, {7.031963505, 2.564917697}, {7.015230995,
2.700816343}, {6.989544414, 2.815891687}, {6.957335874,
2.507864027}, {6.920995503, 2.851306634}, {6.882559183,
2.500670143}, {6.842343633, 2.927637977}, {6.800739526,
2.597890463}, {6.755802639, 3.059142293}, {6.703736537,
2.526782669}, {6.625558242, 2.932715688}, {6.563584803,
2.196284669}, {6.528268014, 2.276971557}, {6.502230053,
2.142517738}, {6.481350429, 2.280845624}, {6.464057366,
2.127040407}, {6.449274977, 3.210672349}, {7.036520362,
2.48691801}, {7.030859594, 2.567515379}, {7.014069926,
2.658174137}, {6.988285965, 2.773057218}, {6.955909261,
2.509486114}, {6.919324165, 2.811164587}, {6.880558873,
2.524767089}, {6.839891932, 2.917997801}, {6.797684653,
2.617454777}, {6.751920865, 3.12821285}, {6.698498976,
2.265103094}, {6.617668027, 2.851725101}, {6.552843345,
1.914902384}, {6.515720946, 1.997611706}, {6.488148018,
1.858929325}, {6.465919878, 1.961247735}, {6.447365016,
1.841455432}, {6.431261185, 1.991596183}, {7.035653479,
2.441673234}, {7.029979193, 2.642091664}, {7.013143124,
2.779600057}, {6.987259413, 2.655408023}, {6.954754304,
2.747056288}, {6.917982547, 2.690503028}, {6.878965321,
2.671670335}, {6.837984295, 2.792041578}, {6.795288058,
2.699023107}, {6.748789425, 2.994343796}, {6.69434619,
2.75154734}, {6.611333377, 2.416987663}, {6.544183314,
1.670533864}, {6.505492489, 1.745627845}, {6.4767104,
1.592734733}, {6.453310046, 1.646655847}, {6.433635399,
1.566881917}, {6.416503415, 1.6386405}, {7.034954678,
2.430667632}, {7.029269788, 2.655392115}, {7.012381848,
2.779696857}, {6.986424477, 2.677937026}, {6.953816738,
2.767393148}, {6.916904312, 2.738390317}, {6.877678574,
2.521709116}, {6.836410168, 2.903247296}, {6.793320608,
2.691670804}, {6.746267116, 2.973871121}, {6.690902848,
2.8373169}, {6.606132978, 2.004034878}, {6.537142696,
1.358901692}, {6.497198187, 1.492049861}, {6.467300528,
1.202542717}, {6.443067018, 1.278133712}, {6.422348331,
1.139119465}, {6.404380246, 1.193699038}, {7.034360231,
2.423314873}, {7.028676326, 2.546343642}, {7.011758013,
2.70421933}, {6.985764669, 2.732327838}, {6.953065808,
2.492944411}, {6.916027603, 2.828091797}, {6.87662091,
2.502793251}, {6.835117845, 2.956424635}, {6.791725157,
2.785362746}, {6.744227722, 2.725070054}, {6.688177644,
2.952462805}, {6.601925407, 1.871037226}, {6.531483793,
3.299572125}, {6.490419284, 1.205062821}, {6.459686231,
0.924268761}, {6.43460432, 1.072051642}, {6.41317736,
0.799702673}, {6.394433027, 0.874613658}, {7.033887306,
2.414621979}, {7.028191073, 2.584108445}, {7.011251342,
2.677415351}, {6.98520808, 2.591920501}, {6.952431456,
2.728131626}, {6.915295189, 2.606394808}, {6.875752864,
2.764029792}, {6.834058649, 2.629637742}, {6.790420478,
3.07524121}, {6.742551507, 2.963775838}, {6.685933428,
3.052845912}, {6.598483391, 1.771794681}, {6.526679942,
3.711712717}, {6.484933022, 1.110138892}, {6.453429566,
2.880676607}, {6.427598138, 0.827650948}, {6.405553788,
0.631667532}, {6.386130329, 0.760793308}, {7.033485774,
2.424465446}, {7.027784029, 2.542896896}, {7.010825267,
2.676392444}, {6.984727707, 2.426663261}, {6.951895818,
2.503322157}, {6.914674556, 2.668239461}, {6.87504636,
2.71191227}, {6.833198996, 2.515308877}, {6.789335686,
2.708438633}, {6.741153283, 2.490874554}, {6.684096853,
3.032019326}, {6.59566427, 1.686277852}, {6.522838247,
2.919478967}, {6.480288152, 0.986717582}, {6.448176753,
2.068486954}, {6.421847708, 0.625051368}, {6.39926062,
1.922526712}, {6.379303182, 0.356377592}, {7.033156909,
2.411926653}, {7.027450152, 2.541483248}, {7.010464596,
2.678526802}, {6.984341108, 2.740824687}, {6.951478592,
2.794615538}, {6.914169479, 2.558769959}, {6.874430575,
2.843349391}, {6.832468962, 2.465629313}, {6.788452692,
2.980813388}, {6.740044845, 2.796268712}, {6.682518511,
2.973088953}, {6.593055138, 1.602870812}, {6.519532175,
2.67604757}, {6.476504456, 0.922451616}, {6.44392189,
1.551595069}, {6.417042066, 0.524349666}, {6.394007742,
1.335879104}, {6.373604641, 0.204979694}, {7.032874567,
2.410828768}, {7.027159736, 2.607313012}, {7.010167791,
2.626230999}, {6.984022698, 2.525194094}, {6.951121482,
2.676686105}, {6.913762616, 2.432960144}, {6.873943192,
2.602109532}, {6.831868118, 2.424174076}, {6.787698864,
2.833240042}, {6.739079714, 2.429085504}, {6.681285512,
3.080801999}, {6.516860422, 2.105024931}, {6.473298911,
0.874160363}, {6.440230786, 1.285081302}, {6.413106094,
0.456291156}, {6.389685571, 0.973943373}, {6.368894179,
0.098754837}, {7.032645935, 2.405591528}, {7.026910561,
2.372253613}, {7.009913701, 2.487133006}, {6.983737617,
2.364848558}, {6.950791466, 2.524420007}, {6.91340328,
2.364589563}, {6.873512579, 2.823145133}, {6.831364697,
2.400296221}, {6.787055213, 2.679382786}, {6.738285943,
2.409901849}, {6.68016282, 2.899877109}, {6.514641322,
1.9369223}, {6.470610335, 0.836101475}, {6.437300126,
1.129164882}, {6.409790246, 0.405443991}, {6.38602318,
0.686981094}, {6.364910446, 0.028242141}, {7.032440554,
2.405579999}, {7.026721599, 2.360197275}, {7.009694316,
2.478204395}, {6.983510617, 2.348796858}, {6.950549463,
2.522441741}, {6.913104044, 2.350943474}, {6.873169546,
2.634773752}, {6.830937015, 2.392838217}, {6.786543993,
2.839201002}, {6.737598664, 2.397235599}, {6.679324934,
2.832339738}, {6.512784374, 1.713420067}, {6.468415156,
0.803487782}, {6.43476251, 1.036945302}, {6.40702598,
0.362975169}, {6.382961843,
0.599796071}, {6.361672483, -0.033748511}, {7.032269629,
2.404195798}, {7.026546953, 2.311238526}, {7.009518105,
2.44643103}, {6.983325046, 2.315294417}, {6.950301954,
2.511458327}, {6.912841213, 2.336852323}, {6.872860057,
2.641195519}, {6.830569453, 2.385042086}, {6.786088247,
2.688150649}, {6.737051299, 2.385137509}, {6.678553276,
2.699520498}, {6.511231072, 1.604350357}, {6.466562622,
0.77860391}, {6.432747844, 1.093028664}, {6.404695153,
0.331838296}, {6.380443334,
0.610163948}, {6.358866139, -0.073129957}, {7.021387848,
3.541701984}, {7.017318549, 3.366268739}, {7.004005224,
3.379362555}, {6.983608703, 3.310765727}, {6.957981545,
3.372186381}, {6.9300328, 3.238677971}, {6.901310421,
3.513454512}, {6.873579569, 3.38958335}, {6.84697077,
3.448019292}, {6.822146907, 3.672250607}, {6.797997064,
3.421691746}, {6.773159504, 3.408306056}, {6.755629533,
3.409602569}, {6.746650751, 3.405713642}, {6.742636776,
3.405360568}, {6.74038778, 3.405358496}, {6.738733887,
3.405358717}, {6.737366301, 3.405358714}, {7.009119349,
3.333399632}, {7.004912836, 2.99492421}, {6.990923136,
2.974801307}, {6.969367763, 2.896208713}, {6.942122197,
2.879163429}, {6.91185393, 2.820121984}, {6.880016883,
2.965103286}, {6.848151481, 2.961425017}, {6.81626398,
3.386735289}, {6.784651895, 3.441177003}, {6.751090931,
3.280806418}, {6.712540883, 3.506529359}, {6.682764581,
3.234167522}, {6.665778087, 3.219308724}, {6.654539923,
3.220829707}, {6.647345542, 3.220185319}, {6.643545231,
3.220137592}, {6.641009464, 3.220132845}, {7.00275519,
3.104026368}, {6.998431434, 2.788884407}, {6.984162424,
2.806069462}, {6.962097894, 2.686021977}, {6.93390774,
2.681217719}, {6.902432022, 2.632561023}, {6.868884985,
2.670789886}, {6.834996486, 3.073172065}, {6.800221064,
3.278592264}, {6.764769929, 3.217612391}, {6.726026299,
3.234278978}, {6.679223478, 3.566967796}, {6.642084036,
3.132144621}, {6.620080487, 3.116832626}, {6.604457483,
3.115273601}, {6.592882502, 3.108860221}, {6.584419577,
3.111700897}, {6.578710123, 3.112401791}, {6.998453514,
2.884078687}, {6.994040671, 2.676144008}, {6.979589633,
2.722120393}, {6.957083533, 2.575196145}, {6.928331939,
2.598627047}, {6.895995935, 2.541203344}, {6.861383373,
2.557500226}, {6.826040369, 2.772999508}, {6.789260743,
3.149417027}, {6.751169366, 3.225516519}, {6.708668456,
3.19683746}, {6.655960276, 3.63032235}, {6.613106365,
3.074207024}, {6.587176578, 3.395948961}, {6.568288904,
3.045830522}, {6.553591418, 3.037174422}, {6.542342907,
3.037655551}, {6.533478246, 3.034637296}, {6.995257836,
2.710463265}, {6.990840026, 2.612485842}, {6.976156825,
2.681489905}, {6.95344572, 2.513754005}, {6.924218623,
2.557578841}, {6.891257737, 2.496164396}, {6.855802202,
2.516896036}, {6.819340411, 3.03692985}, {6.781177105,
3.053046016}, {6.741178178, 3.155774023}, {6.695804347,
3.098114561}, {6.638516975, 3.342320661}, {6.590926409,
2.992880091}, {6.561614268, 3.240979384}, {6.540231203,
2.947801818}, {6.523550665, 2.945132883}, {6.509802935,
2.943379145}, {6.498535038, 2.940797565}, {6.99284548,
2.571171245}, {6.988381018, 2.538146306}, {6.973591929,
2.708241023}, {6.950678304, 2.439909927}, {6.921097543,
2.504480264}, {6.88768125, 2.876971639}, {6.851603753,
2.472316264}, {6.814325066, 2.797995352}, {6.775012875,
2.718968741}, {6.733477612, 2.880545781}, {6.685861511,
2.172919922}, {6.624807712, 2.797501221}, {6.573655321,
1.823490126}, {6.541745821, 2.163771856}, {6.518234088,
1.74777426}, {6.499406713, 2.52076469}, {6.484056326,
1.726976337}, {6.470895399, 1.71411499}, {6.990983255,
2.492374661}, {6.986505805, 2.521507171}, {6.971605514,
2.691000161}, {6.94848282, 2.423092642}, {6.918675658,
2.483312647}, {6.884913274, 2.726465955}, {6.848353042,
2.472908418}, {6.810431393, 2.730279131}, {6.770206766,
2.592288305}, {6.727600214, 2.86105508}, {6.67812493,
2.257416686}, {6.614139375, 2.606553397}, {6.559854955,
1.926487703}, {6.525922737, 2.04205007}, {6.500692551,
1.858306873}, {6.4801801, 2.052948153}, {6.463153087,
1.836944653}, {6.448645105, 3.186252252}, {6.989486885,
2.447788691}, {6.984961003, 2.51823223}, {6.970017249,
2.621197985}, {6.946754224, 2.654136753}, {6.916724071,
2.722538609}, {6.882707695, 2.660782622}, {6.845750492,
2.486855827}, {6.807332509, 2.705607007}, {6.766441258,
2.616313927}, {6.722798257, 2.789726234}, {6.671931189,
2.266686188}, {6.605619456, 2.582709675}, {6.548886496,
1.971415758}, {6.513142743, 2.042152732}, {6.486316292,
1.908717509}, {6.464518697, 1.996837852}, {6.446212182,
1.889947327}, {6.430375826, 2.015387471}, {6.988286989,
2.442797784}, {6.983753986, 2.523709108}, {6.968764455,
2.815435814}, {6.945394744, 2.696070989}, {6.915228657,
2.571777841}, {6.880977312, 2.736142572}, {6.843719044,
2.625985493}, {6.804812407, 2.846609949}, {6.763408347,
2.702631955}, {6.719175614, 2.725144312}, {6.666998881,
2.812838126}, {6.598727966, 2.217421041}, {6.539968152,
1.68036073}, {6.502715394, 1.753586116}, {6.47470821,
1.609945838}, {6.451696211, 1.661851878}, {6.432379608,
1.585905749}, {6.415510904, 1.653235924}, {6.987325382,
2.428485538}, {6.982762868, 2.520642611}, {6.967719299,
2.812619236}, {6.944097527, 2.716088442}, {6.913954197,
2.543537804}, {6.87951661, 2.782685466}, {6.842022117,
2.524040008}, {6.802835042, 2.960676849}, {6.761005457,
2.699207732}, {6.715960506, 2.649555904}, {6.663108202,
2.937761994}, {6.593322988, 1.891491441}, {6.532799258,
1.360130197}, {6.494335951, 1.493722149}, {6.4652259,
1.215214833}, {6.441309979, 1.286996334}, {6.420946513,
1.155820892}, {6.403239809, 1.20877977}, {6.986517798,
2.418721529}, {6.981959967, 2.516103273}, {6.966871231,
2.707231238}, {6.943365135, 2.418431508}, {6.912955104,
2.481041434}, {6.878336136, 2.864718778}, {6.84063932,
2.493227818}, {6.80119304, 3.043388324}, {6.758959301,
2.777887654}, {6.713480217, 2.578313592}, {6.659925271,
3.0554261}, {6.588805235, 1.767714977}, {6.526893155,
3.45736794}, {6.48731299, 1.206367522}, {6.457408188,
0.945768081}, {6.432749806, 1.0869155}, {6.411664902,
0.833238974}, {6.393075558, 0.900365879}, {6.985868568,
2.39792015}, {6.981309469, 2.448437951}, {6.966163453,
2.532392349}, {6.942630126, 2.462298954}, {6.912118892,
2.711297056}, {6.877386636, 2.492756468}, {6.839524414,
2.779518238}, {6.799848732, 2.562641964}, {6.757354724,
3.094399317}, {6.711435272, 2.62743483}, {6.657060781,
3.174913746}, {6.585146237, 1.688094305}, {6.521969739,
3.41364081}, {6.48164058, 1.13711006}, {6.450958698,
2.846539242}, {6.425646606, 0.896185308}, {6.403861401,
0.744364294}, {6.384737069, 0.845871862}, {6.985337571,
2.399150046}, {6.980746124, 2.606605224}, {6.965589764,
2.677156504}, {6.941988084, 2.639323645}, {6.911420561,
2.724689307}, {6.876596508, 2.702502904}, {6.838626888,
2.812464811}, {6.798769366, 2.632561509}, {6.755966001,
2.737586457}, {6.70970576, 2.511833139}, {6.654946343,
2.978520481}, {6.581822314, 1.600239559}, {6.517952253,
2.712632523}, {6.476923884, 0.981958276}, {6.445659866,
2.035336396}, {6.419767371, 0.643196925}, {6.397498621,
1.944480114}, {6.377793288, 0.403246413}, {6.98488373,
2.405672661}, {6.980285513, 2.506241622}, {6.965115695,
2.68036809}, {6.941468071, 2.766335724}, {6.91082076,
2.853747521}, {6.875961946, 2.567132928}, {6.837833066,
2.885985043}, {6.797828896, 2.459373833}, {6.754837292,
2.742977197}, {6.708347546, 2.42044813}, {6.653122793,
2.906196311}, {6.579265379, 1.526810823}, {6.514604203,
2.500879394}, {6.473015497, 0.905592505}, {6.441240019,
1.525323353}, {6.414919186, 0.515710199}, {6.392173836,
1.320588181}, {6.372018259, 0.205196385}, {6.984495737,
2.401439557}, {6.979931063, 2.627776046}, {6.964701582,
2.672227083}, {6.941031686, 2.539974864}, {6.910324882,
2.717804569}, {6.875406259, 2.436626084}, {6.837170521,
2.601983053}, {6.797076282, 2.411391368}, {6.753928413,
2.862968749}, {6.707237176, 2.387636149}, {6.651656207,
2.949589832}, {6.511835988, 1.988418613}, {6.469758781,
0.855749384}, {6.437618252, 1.281756011}, {6.410839786,
0.445009267}, {6.387699425, 0.953176956}, {6.36717515,
0.094736261}, {6.984166098, 2.394056378}, {6.979581812,
2.51976677}, {6.964358662, 2.578668676}, {6.940664454,
2.50945657}, {6.909937511, 2.657961257}, {6.874914928,
2.621988611}, {6.836650401, 2.630219135}, {6.796406011,
2.617593723}, {6.753107947, 2.617818296}, {6.706181283,
2.610073938}, {6.650287374, 2.776940244}, {6.509566677,
1.856344851}, {6.467052204, 0.816069506}, {6.434436932,
1.113129647}, {6.407397081, 0.389667533}, {6.383938828,
0.675287851}, {6.36320708, 0.013796113}, {6.983901887,
2.394277751}, {6.979300989, 2.350943153}, {6.964083028,
2.442414337}, {6.940335188, 2.34079414}, {6.909601437,
2.534763847}, {6.874551906, 2.341245184}, {6.836169757,
2.65065494}, {6.795903763, 2.373474174}, {6.752482957,
2.894138331}, {6.705386817, 2.323014233}, {6.649273702,
2.888122523}, {6.507589265, 1.655459882}, {6.464839239,
0.784409443}, {6.431964994, 1.021987115}, {6.404557351,
0.349725216}, {6.380898844,
0.585498495}, {6.359823197, -0.042474931}, {6.983659377,
2.392955434}, {6.97906581, 2.301237496}, {6.963837288,
2.396246737}, {6.94008025, 2.306048454}, {6.909340835,
2.524239683}, {6.874201695, 2.325594093}, {6.8358115,
2.656288849}, {6.795409868, 2.364834796}, {6.751950885,
2.692288624}, {6.704754512, 2.300977942}, {6.648361564,
2.635953782}, {6.505973336, 1.572561081}, {6.462881392,
0.758794965}, {6.429805958, 1.083726553}, {6.402195244,
0.3172726}, {6.378271874,
0.591334001}, {6.356973385, -0.084955223}, {6.992214922,
3.176493752}, {6.988810316, 3.282279458}, {6.977223644,
3.329380539}, {6.959304463, 3.228229582}, {6.936189756,
3.344283466}, {6.911058348, 3.203824492}, {6.885410299,
3.440714169}, {6.859699948, 3.404569564}, {6.835646283,
3.394310454}, {6.813240258, 3.673407136}, {6.791815033,
3.375189449}, {6.770521883, 3.36525816}, {6.755107451,
3.366630444}, {6.746585121, 3.363286485}, {6.742720128,
3.362921189}, {6.740516803, 3.362920996}, {6.73891736,
3.362921781}, {6.73764641, 3.362921834}, {6.976464727,
3.354189316}, {6.972851195, 2.955448686}, {6.960584373,
2.944559515}, {6.941451688, 2.856659177}, {6.916453466,
2.872523801}, {6.888799322, 2.83725635}, {6.859788043,
3.462034734}, {6.829831408, 3.067748609}, {6.800294453,
3.291632175}, {6.771101337, 3.457157338}, {6.740897032,
3.213113902}, {6.707725781, 3.515985268}, {6.681497064,
3.173971992}, {6.665355376, 3.160608058}, {6.65468603,
3.162314592}, {6.647604098, 3.161899782}, {6.643547369,
3.161854192}, {6.640893501, 3.161851331}, {6.968326079,
3.092400997}, {6.964612152, 2.758367581}, {6.952001524,
2.779234508}, {6.9322402, 2.664730667}, {6.906213587,
2.671555346}, {6.877184042, 2.65580265}, {6.846503142,
2.693272953}, {6.814180361, 3.12673241}, {6.781763158,
3.277419627}, {6.748761911, 3.325077833}, {6.713427999,
3.165498903}, {6.672982025, 3.617645559}, {6.640172368,
3.073737955}, {6.61895858, 3.060384346}, {6.603999622,
3.059159648}, {6.592635503, 3.052986431}, {6.584381499,
3.056034427}, {6.578769034, 3.056624963}, {6.962765024,
2.859040582}, {6.958993815, 2.645943758}, {6.946128126,
2.686453784}, {6.925882664, 2.564846554}, {6.899303274,
2.59155271}, {6.869369267, 2.575220391}, {6.837434536,
2.598298152}, {6.803458093, 3.159433557}, {6.769012522,
3.133085967}, {6.733400968, 3.207552825}, {6.694528099,
3.167679581}, {6.648736976, 3.639779884}, {6.610545781,
3.012325574}, {6.585669918, 3.369481906}, {6.567311158,
2.987407431}, {6.553357577, 2.979041898}, {6.541958516,
2.98001569}, {6.533118606, 2.977127321}, {6.958681796,
2.685039585}, {6.954859829, 2.58113644}, {6.941793162,
2.641290454}, {6.92124671, 2.510725273}, {6.894135677,
2.56837116}, {6.86351419, 2.539615257}, {6.830740051,
2.57673396}, {6.79550934, 3.018180298}, {6.759495118,
3.029310982}, {6.721877721, 3.130597252}, {6.680281944,
3.066498713}, {6.630124678, 3.306008097}, {6.587790205,
2.903931905}, {6.559954274, 3.178817182}, {6.53923098,
2.866788717}, {6.522652585, 2.865335777}, {6.509287055,
2.864630931}, {6.498349444, 2.862792046}, {6.955585336,
2.593915033}, {6.95174978, 2.582057423}, {6.93853889,
2.730687172}, {6.917790428, 2.520559153}, {6.890254007,
2.56596699}, {6.859138592, 2.988364424}, {6.825643863,
2.599462725}, {6.789483734, 3.079088874}, {6.752400691,
2.752097758}, {6.713179097, 3.32088671}, {6.669315007,
2.443270308}, {6.615825438, 2.806002432}, {6.570298127,
2.294253166}, {6.539806323, 2.443447679}, {6.516895962,
2.266062601}, {6.498533237, 2.690492488}, {6.483227365,
2.265815138}, {6.470474898, 2.269815209}, {6.953178801,
2.498106873}, {6.949285214, 2.516910941}, {6.93598529,
2.683738574}, {6.915053741, 2.858631419}, {6.887239263,
2.509337756}, {6.855741275, 2.903255918}, {6.821623854,
2.552429882}, {6.784845617, 3.003888991}, {6.746764429,
2.685175038}, {6.706291623, 3.179205594}, {6.660628221,
2.327311259}, {6.60472103, 2.590040214}, {6.556327746,
2.104446758}, {6.523727251, 2.189169716}, {6.499091783,
2.057764678}, {6.47911554, 2.19327725}, {6.462279634,
2.043622143}, {6.447935747, 3.213002481}, {6.951259341,
2.481056969}, {6.947350991, 2.516970762}, {6.933950342,
2.608136516}, {6.912852778, 2.817791209}, {6.884822947,
2.515328488}, {6.853015076, 2.860983232}, {6.818524707,
2.56694289}, {6.781112069, 2.967621489}, {6.742290315,
2.726788293}, {6.700939985, 2.6594261}, {6.653852707,
2.12231287}, {6.595713829, 2.443114105}, {6.544929444,
1.870272903}, {6.510609749, 1.950211337}, {6.484530162,
1.816173267}, {6.463227703, 1.910042526}, {6.445058198,
1.798471589}, {6.429532184, 1.936866545}, {6.949732547,
2.425818733}, {6.945798062, 2.647872884}, {6.932376272,
2.813944879}, {6.911149817, 2.661534012}, {6.882908577,
2.762892226}, {6.850826742, 2.69687097}, {6.816023411,
2.671563593}, {6.778192368, 2.790164386}, {6.738669474,
2.761900904}, {6.696527895, 2.559816741}, {6.648353304,
2.878873278}, {6.588525125, 2.154850826}, {6.535861648,
1.629850271}, {6.500140174, 1.707699189}, {6.472835011,
1.556257492}, {6.450336086, 1.610651685}, {6.43113596,
1.530743306}, {6.414550213, 1.598507617}, {6.948483336,
2.41512146}, {6.944577711, 2.672779495}, {6.931058541,
2.807931751}, {6.909720324, 2.696789596}, {6.881332699,
2.772042308}, {6.849049771, 2.759730298}, {6.813964267,
2.607154141}, {6.775752408, 2.91460007}, {6.735821461,
2.776517102}, {6.693007547, 2.474779395}, {6.643919249,
3.061882146}, {6.582312632, 1.828557981}, {6.52842868,
1.318150806}, {6.491511525, 1.46145624}, {6.46309646,
1.168606532}, {6.439606376, 1.243184131}, {6.41968226,
1.105699476}, {6.402124113, 1.161187379}, {6.947464035,
2.407289049}, {6.943514178, 2.484775976}, {6.929981953,
2.685880014}, {6.908572716, 2.767078431}, {6.880065636,
2.844733616}, {6.847637996, 2.866394864}, {6.812345227,
2.558133726}, {6.77383994, 2.964282557}, {6.733409678,
2.852804017}, {6.690050977, 2.401487661}, {6.640309135,
3.177482755}, {6.577518339, 1.706039542}, {6.522368289,
3.513245993}, {6.484454258, 1.166829801}, {6.455123055,
0.894187456}, {6.430959859, 1.048593245}, {6.410139145,
0.771835548}, {6.391867922, 0.842580556}, {6.946644327,
2.394509865}, {6.942665889, 2.597720865}, {6.929076585,
2.643707164}, {6.907644583, 2.591481111}, {6.879023116,
2.793249539}, {6.846438269, 2.575657911}, {6.810953093,
2.819561121}, {6.772199415, 2.558582859}, {6.731529537,
2.813200376}, {6.687766819, 2.528568343}, {6.637297718,
3.257931369}, {6.573540851, 1.622223537}, {6.517353699,
3.275267407}, {6.478605976, 1.070037293}, {6.448562749,
2.799185077}, {6.423782982, 0.794084741}, {6.402317371,
0.599477411}, {6.383344134, 0.734462636}, {6.945928126,
2.405343228}, {6.941975511, 2.47826747}, {6.928360481,
2.665457982}, {6.906830577, 2.803411106}, {6.878134187,
2.774331285}, {6.845468321, 2.617861868}, {6.809857123,
2.686404041}, {6.770833356, 2.478964041}, {6.730039181,
2.725768607}, {6.685847795, 2.305261446}, {6.634854335,
2.923746224}, {6.570388073, 1.546405144}, {6.513219843,
2.61325003}, {6.473760638, 0.948137439}, {6.443185493,
1.995912996}, {6.417729533, 0.596728631}, {6.395706918,
1.976153715}, {6.376280034, 0.334535519}, {6.94534765,
2.392308781}, {6.941393529, 2.477487831}, {6.927735761,
2.671098121}, {6.906201481, 2.669899429}, {6.877462342,
2.836139305}, {6.844631395, 2.511605154}, {6.808860414,
2.835869359}, {6.769732478, 2.419971558}, {6.728702049,
2.710203756}, {6.684097748, 2.260339238}, {6.632641469,
2.838537027}, {6.567704107, 1.476304786}, {6.509759459,
2.39030416}, {6.469765684, 0.882194919}, {6.438657748,
1.494315494}, {6.412729015, 0.492519209}, {6.390337529,
1.30024496}, {6.370388325, 0.177167498}, {6.9448677,
2.388479281}, {6.940905607, 2.530093893}, {6.927250447,
2.554735541}, {6.905617196, 2.467264542}, {6.876843774,
2.679963867}, {6.843960337, 2.393308753}, {6.808117903,
2.574092056}, {6.768842931, 2.371032047}, {6.727473167,
2.838215747}, {6.682770336, 2.223367174}, {6.631018912,
2.835450039}, {6.565479648, 1.419552194}, {6.506871279,
1.926955165}, {6.46635346, 0.833560503}, {6.434938146,
1.283391272}, {6.4086394, 0.423734393}, {6.385775385,
0.925330872}, {6.365540926, 0.069801878}, {6.944457784,
2.383420748}, {6.940474486, 2.336793071}, {6.926811707,
2.420448091}, {6.905164352, 2.330982551}, {6.876319134,
2.526546277}, {6.843440116, 2.326598993}, {6.807441403,
2.89697162}, {6.768073313, 2.342206415}, {6.726614565,
2.62499806}, {6.681711802, 2.188854817}, {6.629657497,
2.681773662}, {6.504470027, 1.806784862}, {6.463621864,
0.794606643}, {6.431730104, 1.09406179}, {6.405195745,
0.370542987}, {6.381998443,
0.659540632}, {6.361366672, -0.006277668}, {6.944114718,
2.383243601}, {6.940127989, 2.318491247}, {6.926429223,
2.408388294}, {6.904803241, 2.31285621}, {6.875861967,
2.524762582}, {6.842892749, 2.312357128}, {6.806905814,
2.639766472}, {6.767447262, 2.332406084}, {6.72580953,
2.850519321}, {6.680802637, 2.158377068}};

bottomfitline = Table[{x, 10.6008*Sin[x] + 16.2661*Cos[x] - 16.9753 - .08}, {x, 6.3,
 7, .1}];
ListPlot[{datatofit, bottomfitline}, Joined -> {False, True},
 Axes -> True, PlotRange -> All,
 AxesLabel -> (Style[#, 10] &) /@ {"x", "y"}]

A: You could try constructing a fit manually by producing your own cost function. Here I use the square difference residuals if the points error to the upside of the curve, just like least squares. But if the points fall below it I make the costs harsher by using an exponentially rising cost and penalty multiplier. Here $\varepsilon$ is the absolute residual, the $x_i,y_i$ are the points, $p$ is the penalty and $f$ is the model to fit.
$$
\varepsilon=\left|y_i-f(x_i)\right|\\\text{cost}(x_i,y_i|f)=
\begin{cases}
 \varepsilon^2 & y_i\geq f(x_i) \\
 \exp(p \varepsilon) & \text{otherwise}
\end{cases}
$$
We then minimize the total costs. A higher penalty leads to a flatter line which is less tolerant of any points falling below the curve, while a lower penalty creates a more curvy line that allows a few points to fall below:
residual[f_, data_, penalty_] := Sum[
  With[{fy = f[p[[1]]], y = p[[2]], x = p[[1]]},
   Piecewise[{{(fy - y)^2, y >= fy}}, Exp[penalty*(fy - y)]]
   ],
  {p, data}, Method -> "Procedural"]

f[x_] := a*Sin[x] + b*Cos[x] - c

{err, sol} = NMinimize[residual[f, datatofit, 15.], {a, b, c},
   Method -> "SimulatedAnnealing"];

fittedmodel = f[x] /. sol

Show[
 ListPlot[datatofit, PlotRange -> All,
  AxesLabel -> (Style[#, 10] &) /@ {"x", "y"}],
 Plot[fittedmodel, {x, Min[datatofit[[All, 1]]],
   Max[datatofit[[All, 1]]]}]
 ]

A: Because you have no theoretical model to represent the "bottom bound of the data", that feature is in the eye of the beholder.  It seems that there are two tasks:  (1) Find a set of data points that represent the bottom bound of the data, and (2) Attempt to find a curve that adequately describes that set of bounding data.
While you could just draw in a bottom bound that satisfies the definition in your mind, the excellent link you gave (https://community.wolfram.com/groups/-/m/t/607510 with answer by Marco Theil can get you task 1.
(* Interpolate the raw data so that you have an approximation of that data on a fine and regular grid *)
f = Interpolation[data, InterpolationOrder -> 1];
t = Table[{x, f[x]}, {x, 6.35, 7.05, 0.0001}];

(* Estimate the "bottom" of the curve based on the excellent post you mentioned *)
σ0 = 50;  (* You need to decide on this value *)
base = EstimatedBackground[TimeSeries[t], σ0, Method -> {"SNIP", 0}];
ListLinePlot[{data, base}]

Now you need to determine a curve form that adequately describes the bottom bound.  Two linear segments with sines and cosines seems promising.


text:
Q: Ranking Rows in Tableau Is it possible to create a RANK number as below?

Thanks for your help in advance,

A: You can create a calculated field and use the rank function.

*

*Create calculated field(Analysis->Create Calculated Field

*Name the calculation field(going to call it "rank")

*In the body of the calc field call the rank function, something like this
rank(SUM([Number of Records]))

Here I am ranking on the number of records.

*Select okay and pull your new calc field on to the view in question.


text:
Q: How to make the message queues in Shuttle-ESB accessible from other machines on network? I'm experimenting with Shuttle-ESB these days. So far I have been able to create components that work on single machine perfectly. However whenever I try to move the components on different machines on the same network it just stops working. The client fails on Bus.Create().
What to do to make Shuttle-ESB create public queues?

A: Any endpoint using Shuttle.Esb.Msmq would require the inbox to be on the local machine.  This is due to the fact that a Msmq transaction is used to get the message from the queue via a behind-the-scenes journal queue.
One cannot read remote private transactional queues: https://msdn.microsoft.com/en-us/library/ms699854%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
You will need to have Msmq enabled on the local machine.  As I mentioned in the comments, public queues may help but there is currently no implementation and public queues would come with their own set of challenges.
If installing Msmq on the local endpoint machine is a hassle you may want to consider the Shuttle.Esb.RabbitMQ.  RabbitMQ is a broker so it does not need to be installed locally; although you may still want to do so to enable/use an outbox (optional).


text:
Q: How can I solve ModuleNotFoundError in Jupyter Lab? Here is my code about sentiment analysis in python so I had a problem on jupyter lab error is no module name but I had everything about the installing part pip install vaderSentiment  and enviroment variable stuff. So What should I do?
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()

def sentiment_analyzer_scores(sentence):
    score = analyser.polarity_scores(sentence)
    print("{:-<40} {}".format(sentence, str(score)))

 ModuleNotFoundError                       Traceback (most recent call last)
    <ipython-input-22-f1fda500aee5> in <module>
    ----> 1 from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
          2 analyser = SentimentIntensityAnalyzer()
          3
          4 def sentiment_analyzer_scores(sentence):
          5     score = analyser.polarity_scores(sentence)

    ModuleNotFoundError: No module named 'vaderSentiment'

A: Try installing its full master branch zip file and unzip it in your main file location then either try importing the same way you did or try this other line of code to import it.
from vaderSentiment import SentimentIntensityAnalyzer

Also check if you have only one version of python installed and not multiple.
Do try to upgrade pip, python and vaderSentiment to latest versions.
pip install --upgrade vaderSentiment


text:
Q: Can I make a Class just has methods? I want to make a class for File operation like read, write, delete and update
This class will have just methods
I have this maindrive
public class HW10 {

    public static void main(String[] args) {

        final String STUDENTS_FILE = "C:\\data\\students.dat";

        RandomAccessFile studentsFile = null ;
        .
        .
        .
        studentsFile = new RandomAccessFile(STUDENTS_FILE, "rw");
        Student student = new Student(1,100,"John","Smith","CIS",3.1) ;
        .
        .
        // write student object to studentsFile
        writeData( studentsFile, student );
        .
        .
        // read from studentsFile
        Student readRecord = new Student() ;
        studentsFile.seek(0);
        readData( studentsFile, readRecord );

}

    // read date methods
    private static void readData( RandomAccessFile studentsFile, Student readRecord)
        {
         ....   read code
        }
    // write data methods
        private static void writeData( RandomAccessFile studentsFile, Student anItem)
        {
        ... write code
        }

How to convert readData and writeData methods to another class like DataAccessFile, So DataAccessFile has all file operation like that
public class DataAccessFile {
    public void writeData(RandomAccessFile studentsFile,Student record){
     .......
    }
  public void readData(RandomAccessFile studentsFile,Student record){
     .....
    }

  public void updateData(RandomAccessFile studentsFile,Student record){
......
}
public void deleteData(RandomAccessFile studentsFile,Student record){
}

}

The Student Class
public class Student {
    // class attributes
    private int    recordStatus ;
    private int studentID ;
    private String lastName ;
    private String firstName ;
    private String majorCode ;
    private double gpa ;
    public Student(int recordStatus, int studentID, String firstName, String lastName ,String majorCode, double gpa) {
        setRecordStatus(recordStatus) ;
        setStudentID(studentID);
        setLastName(lastName);
        setFirstName(firstName);
        setMajorCode(majorCode);
        setGpa(gpa);
    }

    public Student() {
        setRecordStatus(0) ;
        setStudentID(0);
        setLastName("");
        setFirstName("");
        setMajorCode("");
        setGpa(0);
    }
    // getter
    .
    .
    // setter
    .
    .

}

A: Yes, you can do this; such a class is normally called an utility class. Your DataAccessFile class is a good start, but perhaps FileUtils would be a more fitting name. Here are some general principles for utility classes:

*

*Make the class final; there shouldn't be a reason to create subclasses from a utility class.

*Make the class non-instantiable by declaring the constructor private.

*Make all methods static. Client code should use the utility by referencing the class name, e.g.: FileUtils.writeData(...)


text:
Q: How to have a Vim multiline syntax highlight clause? I'm trying to write the syntax highlight module for a tiny text format that includes three different kinds of list elements (starting with -, o and x respectively), and I'd like to highlight entries based on their kind. For single lines it's easy, I just use a syn match myGroup /^\s\+- .\+/ and I'm done.
Problem is, I've been trying to do it so that the next lines without a list marker keep the same colour as the starting list item line, to no success. I've been trying to do it with syntax regions, but I can't seem to understand how they work.
To be more precise, this is the output I'm trying to reach:

If any change is needed in the file format so that it is easier/possible, I have liberty to change it.
Any clue of how can I get it?

A: You can try something along these lines
syntax region Minus_Region start=/^\s\+-/ end=/;/
hi Minus_Region guifg='Yellow'

syntax region O_Region start=/^\s\+o/ end=/;/
hi O_Region guifg='Green'

syntax region X_Region start=/^\s\+x/ end=/;/
hi X_Region guifg='Gray'

You define region by its start and its end (in this case ;), no matter how many lines are involved.
For more information, see help

*

*:h syn-region
If you want to finish the regions without having a end marking character (in this case ;), you could do it using the match-end (me) option on the end argument of the regions, and having the regions end on the next region-start marker. Example:
syntax region Minus_Region start=/^\s\+- / end=/^\s\+[-ox] /me=s-1

syntax region O_Region start=/^\s\+o /  end=/^\s\+[-ox] /me=s-1

syntax region X_Region start=/^\s\+x /  end=/^\s\+[-ox] /me=s-1

The me=s-1 part means "The real match ends at one character to the left of the start position of the pattern match".


text:
Q: Pairwise comparisons for probabilities from multinomial model Q. How can I do pairwise comparisons for probabilities and associated CI's obtained from a multinomial model?
The simple example.
We have been conducting some experiments for sediment preference for fish. In short, 4 trials of approx. ~50 (i.e. 49, 51, 51 and 52) individuals were introduced into the experimental setup and counted. The setup consisted of four sediments replicated twice in a total of eight trays. Each position was randomly moved after each trial.
We use following data matrix (4*4 table).
Sed2$Sed_ID <- paste(Sed2$TrayID, Sed2$ID, sep = "_")
tab_Sed2 <- xtabs(Count~Sed_ID+Experiment, data=Sed2)
tab_Sed2

Experimental trial

Tray ID
1
2
3
4

0.7-2.1mm
17
20
10
16

50%
10
16
15
18

75%
15
13
23
15

Gravel
7
2
3
3

Now we build multinomial models that has four levels for each sediment, and get probabilities. We use TMB and build our own model.
data <- list()
data$X <- as.matrix(tab_Sed2)
param <- list()
param$alpha <- c(0,0,0,0)
param$alphaDev <- matrix(0,nrow=nrow(tab_Sed1), ncol=ncol(tab_Sed2))
param$logSigmaDev <- 0
obj1 <- MakeADFun(data, param, DLL="raw3", random=c("alphaDev"), map=list(alpha=factor(c(NA,1,2,3))))
opt1 <- nlminb(obj1$par, obj1$fn, obj1$gr)
summary(sdreport(obj1))

If can plot my probabilities.


text:
Q: Adicionar um array dentro de outro ja criado JavaScript Eu consigo criar uma array dentro de outro da seguinte maneira:
var meuArray = [["1","2","3"],["4","5","6"]];

Com isso eu consigo verificar fácil as posições apenas chamando meuArray[x][y], onde x é qual o array que eu quero e y qual posição, por exemplo o numero dois corresponde a meuArray[0][1], ou o numero 6 corresponde a meuArray[1][2].
Até ai tudo bem, agora como eu faço para adicionar mais um array dentro do meu array? por exemplo tenho o seguinte array:
var meuSegundoArray = ["7","8","9"];

E quero adiciona-lo em meuArray, para que fique assim:
meuArray=[["1","2","3"],["4","5","6"],["7","8","9"]];

Ja tentei fazer:
meuArray += meuSegundoArray

nao deu certo, tanto quanto push.
Alguém tem alguma solução para este problema?

A: É bem simples, utilize o push pra fazer isso:
var meuArray = [["1","2","3"],["4","5","6"]];
var meuSegundoArray = ["7","8","9"];

meuArray.push(meuSegundoArray);

A: // Tenta usar o concat
var array1 = ['1','2','3']
var array2 = ['4','5','6']
var array3 = ['7','8','9']
var arrayTudo = array1.concat(array2, array3)
console.log(arrayTudo)


text:
Q: Get values from one table and put in another table I need to take some values from one table and save them into anther table.
Values from users(id, first_name, last_name) and cars(id, makers, model) into third table. I've tried something, but i always get error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
This is my code:
<?php
include "db_connection.php";
session_start();

$res=mysql_query("SELECT * FROM users WHERE id_user=".$_SESSION['user']);
$userRow=mysql_fetch_array($res);

if(isset($_POST["btn"]))
{
    $maker=$_POST["maker"];
    $model=$_POST["model"];
    $year=$_POST["year"];
    $fuel=$_POST["fuel"];
    $power=$_POST["power"];

    $sql2="insert into models values (0,'$maker','$model','$year','$fuel','$power')";
    $query2=mysql_query($sql2);

    $query = ("SELECT id_user, f_name, l_name FROM users WHERE id_user=".$_SESSION['user']);
    $result = mysql_query($query);
    if(!$result) { die($query."
".mysql_error()); }

    while($row = mysql_fetch_assoc($result))
    {
         $data[]=$row;
    }

     if (!mysql_select_db("car")) { die(mysql_error()); }

     foreach($data as $row)
     {
         $query  = "INSERT INTO evidencija (id_k,ime,prezime,'$maker','$model') VALUES ('";
         $query .= mysql_real_escape_string($row['id_user'])."','";
         $query .= mysql_real_escape_string($row['f_name'])."','";
         $query .= mysql_real_escape_string($row['l_name'])."'";

         if(!mysql_query($query)) { die($query."
".mysql_error()); }
      }
}
include "header.php";
?>

A: Please change $query to:
    $query  = "INSERT INTO evidencija (id_k,ime,prezime,maker,model) VALUES ('";
     $query .= mysql_real_escape_string($row['id_user'])."','";
     $query .= mysql_real_escape_string($row['f_name'])."','";
     $query .= mysql_real_escape_string($row['l_name'])."','";
     $query .= mysql_real_escape_string($maker)."','";
     $query .= mysql_real_escape_string($model)."')";


text:
Q: Testing tool: is there alternative than expect? Our current testing is a simple in-house tool which runs the named target, logs its output and compares it with a expected output. The expected output and real output are both text files.
This has an obvious downside, if some changes of line number change which has no function effect is regarded as failure.
We are thinking to use tools like expect to do this, but we like to know if there are some other alternatives. Googling does not return any immediate answers.
Our platform is linux; the users of this tool does not need to write testing code, basically they currently just provide a plain text file of expected result and we should not ask them to write code or some complex form.
Thanks for your inputs.


text:
Q: Javascript: Detecting script load completion I'm dynamically adding script usign:
var el = document.createElement("script");
document.getElementsByTagname("head")[0].appendChild(el);

It seems neither script.onload nor document.onreadystatechange could be used to determine the end of loading process. How should I catch dynamic script load completion?

A: The onload event needs to be attached before setting the script's src, which is what causes the script to start loading.
Example:
var el = document.createElement("script");
el.onload = function() {
    // Script is loaded
}
el.src = ...

A: I think you want something very similar to this: Trying to fire the onload event on script tag
$body.append(yourDynamicScriptElement);
yourDynamicScriptElement.onload = function() { //...
yourDynamicScriptElement.src = script;


text:
Q: How to Determine if Div is Toggled Jquery I'm using the example found here: https://stackoverflow.com/a/18110473/4847069, but I also want to check if a div is toggled or not. I'm not too familiar with Jquery, so I'm having trouble adding an if condition to the example provided. Any help will be greatly appreciated! Thanks!

A: Use $(obj).is(':visible') to determine if an object obj has been toggled as "visible."
Using the example in your linked post:

$('.orange').hide();

$('.gray, .orange').on('click', function() {
  $('.gray, .orange').toggle();

  if($('.gray').is(':visible')) {
    $('#output').html('gray');
  }
  else {
    $('#output').html('orange');
  }
});
.blue{
  height:100px;
  width:250px;
  background:#1ecae3;
  float:left;
}
.gray{
  height:100px;
  width:100px;
  background:#eee;
  float:left;
}

.orange{
  height:100px;
  width:150px;
  background:#fdcb05;
  float:left;
}

#output {
  clear: both;
}

 Show -->

 -- Hide


text:
Q: Accessing a combo box property inside a datagrid in wpf I have a datagrid which has four columns of combobox in wpf. At the starting, the first combobox is enabled. After making a selection on the first combobox, the second combobox gets enabled. I am unable to access the combobox name property in my xaml.cs file so that I can enable the next combobox column after successful selection of the first one. Can you suggest how to access the combobox property which is present inside a datagrid in my xaml.cs file ?
This is my xaml code
<DataGridTemplateColumn
    Header ="Example 9">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <ComboBox ItemsSource="{Binding PartIds, RelativeSource={RelativeSource AncestorType=Window}}" SelectedItem ="{Binding PartId,UpdateSourceTrigger=PropertyChanged}" />
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

A: Assuming you have two columns in your DataGrid, the first column contains a combobox, and its selecteditem is bound to a property named PartId, the second column contains also a combobox with a selecteditem bound to a property named PartId2, your model should look something like that:
public class Model
{
    public string PartId { get; set; }
    public string PartId2 { get; set; }
}

Now, assuming your DataGrid's itemsource is bound to an ObservableCollection named DgCollection:
 private ObservableCollection<Model> _dgCollection;
 public ObservableCollection<Model> DgCollection
    {
        get { return _dgCollection; }
        set
        {
            if (Equals(value, _dgCollection)) return;
            _dgCollection = value;
            OnPropertyChanged();
        }
    }

The second column could use a DataTrigger to activate its combobox once the selecteditem of the first column is set, like so:
<DataGrid ItemsSource="{Binding DgCollection}" AutoGenerateColumns="False">
    <DataGrid.Columns>
        <DataGridTemplateColumn
    Header ="Example 9">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <ComboBox ItemsSource="{Binding PartIds, RelativeSource={RelativeSource AncestorType=Window}}" SelectedItem ="{Binding PartId,UpdateSourceTrigger=PropertyChanged}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTemplateColumn
            Header ="Example 10">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <ComboBox x:Name="FirstCbx" ItemsSource="{Binding PartIds, RelativeSource={RelativeSource AncestorType=Window}}" SelectedItem ="{Binding PartId2,UpdateSourceTrigger=PropertyChanged}" >
                        <ComboBox.Style>
                            <Style TargetType="ComboBox">
                                <Setter Property="IsEnabled" Value="True"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PartId}" Value="{x:Null}">
                                        <Setter Property="IsEnabled" Value="False"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ComboBox.Style>
                    </ComboBox>
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
    </DataGrid.Columns>
</DataGrid>

You could generalize this to four columns easily.


text:
Q: Arbitrary Constants in Differential Equations Question:
Trouble understanding which constants are arbitrary and need to be eliminated while forming Differential Equation (DE) from its general solution (In contrast to constants which are fine to be left un-eliminated).
Example:
Given general solution** and we need to find it's DE$$y=A sin(\omega t + \phi)$$
We then differentiate it twice $$y'=-A\omega cos(\omega t + \phi)$$ $$y''=-A \omega^2sin(\omega t + \phi)$$
and get the final DE as
$$y''=-y\omega^2     \qquad....(1)$$
Problems with Final DE [i.e (1)]

*

*It contains $\omega$ which i considered to be an arbitary constant. This goes against my understanding (see below)

*what is the difference in $\omega$, $A$ and $\phi$ as constants? Why $A$ and $\phi$ were eliminated but not $\omega$?

*According to my understanding, Final DE should have been of order 3 but that turns out to be wrong. Why?

My Understanding:
If we have a general solution with say, 2 arbitrary constants then we need to differentiate the general solution 2 times and eliminate ALL of the arbitrary constants to get the DE free of arbitrary Constants.
Is this correct?
P.S

*

*** It is taken from equation of SHM (y being the displacement).

*But forgetting our knowledge of physics, how can we mathematically justify $\omega$ in (1).

A: Omega is not an arbitrary constant: it is an important parameter in SHM (called the natural frequency). Every SHM is characterized by its natural frequency and an external force (which is not present in your equation).
As a general rule, the solution space of a second order linear DE with constant coefficients has dimension 2: i.e. the general solution has two arbitrary constants.

A: To some extent, determining which symbols represent "parameters", "arbitrary constants" and "variables" is a combination of convention and relation to real-world systems. Technically, there's nothing inherent to $y = A \sin (\omega t + \phi)$ that says that $y$ is the dependent variable, $t$ the dependent, $\omega$ the parameter and $A$ and $\phi$ the arbitrary constants. We could just as easy declare that this is an implicit definition of $\omega$ as a function of $\phi$, with $y, t, A$ as parameters.
Even following the convention that this is describing $y$ as a function of $t$, we can write the most general possible DE for this system, which will look something like $y y''' = y' y''$.
From a physical perspective, the distinction between $A$, $\omega$ and $\phi$ has more to do with the system itself. For example, if we have simple harmonic motion coming from a mass on a spring, then $\omega$ will be the natural frequency of the system which depends on the physical properties of the mass and the spring, whereas $A$ and $\phi$ are related to the initial conditions - you can set the spring in motion in different ways to vary $A$ and $\phi$, but you can't change $\omega$ without changing the system itself, and from a measurement perspective you're probably more interested in understanding $\omega$ than the other variables.
There's also a small argument towards $y'' = -\omega^2 y$ being the "natural" DE that describes the system from the fact that it's a linear differential equation, where $y y''' = y' y''$ is not, and in most commonly encountered DE theory you'll see linear and mostly linear equations much more often than non-linear ones.

A:
But forgetting our knowledge of physics, how can we mathematically justify  in (1).

You can't. It's fair to take $y$ and $t$ to be the dependent and independent variables here, but we don't have any information beyond that to disambiguate this. From experience, or maybe by the ease with which it falls out, you might assume or conclude that $\omega$ is meant to be left as a parameter.
However, there's no mathematical reason that you couldn't ask this same exact question where any combination of $A,\omega,\phi$ are taken as arbitrary or not.
If I didn't immediately recognize this problem, my first instinct would be to take all constants as arbitrary. This would lead to a third-order equation. If we knew that the result should definitely be second-order (or first-order), it would really be a toss-up which constants should be considered arbitrary.
Basically, I would consider this a malformed problem. If this is your first or second brush with differential equations -- the prime time to be asked a question like this -- you likely lack the experience and context to immediately recognize that $\omega$ should be distinguished as a parameter.


text:
Q: YASR - Yet another search and replace question Environment: asp.net c# openxml
Ok, so I've been reading a ton of snippets and trying to recreate the wheel, but I'm hoping that somone can help me get to my desination faster.  I have multiple documents that I need to merge together... check... I'm able to do that with openxml sdk. Birds are singing, sun is shining so far.  Now that I have the document the way I want it, I need to search and replace text and/or content controls.
I've tried using my own text - {replace this} but when I look at the xml (rename docx to zip and view the file), the { is nowhere near the text.  So I either need to know how to protect that within the doucment so they don't diverge or I need to find another way to search and replace.
I'm able to search/replace if it is an xml file, but then I'm back to not being able to combine the doucments easily.
Code below... and as I mentioned... document merge works fine... just need to replace stuff.
* Update * changed my replace call to go after the tag instead of regex.  I have the right info now, but the .Replace call doesn't seem to want to work.  Last four lines are for validation that I was seeing the right tag contents.  I simply want to replace those contents now.
    protected void exeProcessTheDoc(object sender, EventArgs e)
    {
        string doc1 = Server.MapPath("~/Templates/doc1.docx");
        string doc2 = Server.MapPath("~/Templates/doc2.docx");
        string final_doc = Server.MapPath("~/Templates/extFinal.docx");

        File.Delete(final_doc);
        File.Copy(doc1, final_doc);

        using (WordprocessingDocument myDoc = WordprocessingDocument.Open(final_doc, true))
        {
            string altChunkId = "AltChunkId2";

            MainDocumentPart mainPart = myDoc.MainDocumentPart;
            AlternativeFormatImportPart chunk = mainPart.AddAlternativeFormatImportPart(
            AlternativeFormatImportPartType.WordprocessingML, altChunkId);
            using (FileStream fileStream = File.Open(doc2, FileMode.Open))
            chunk.FeedData(fileStream);
            AltChunk altChunk = new AltChunk();
            altChunk.Id = altChunkId;
            mainPart.Document.Body.InsertAfter(altChunk, mainPart.Document.Body.Elements<Paragraph>().Last());
            mainPart.Document.Save();
        }
        exeSearchReplace(final_doc);
    }

    public static void GetPropertyFromDocument(string document, string outdoc)
    {
        XmlDocument xmlProperties = new XmlDocument();

        using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(document, false))
        {
            ExtendedFilePropertiesPart appPart = wordDoc.ExtendedFilePropertiesPart;

            xmlProperties.Load(appPart.GetStream());
        }
        XmlNodeList chars = xmlProperties.GetElementsByTagName("Company");
        chars.Item(0).InnerText.Replace("{ClientName}", "Penn Inc.");

        StreamWriter sw;
        sw = File.CreateText(outdoc);
        sw.WriteLine(chars.Item(0).InnerText);
        sw.Close();
     }
}

}

A: If I'm reading this right, you have something like "{replace me}" in a .docx and then when you loop through the XML, you're finding things like <t>{replace</t><t> me</><t>}</t> or some such havoc. Now, with XML like that, it's impossible to create a routine that will replace "{replace me}".
If that's the case, then it's very, very likely related to the fact that it's considered a proofing error. i.e. it's misspelled as far as Word is concerned. The cause of it is that you've opened the document in Word and have proofing turned on. As such, the text is marked as "isDirty" and split up into different runs.
The two ways about fixing this are:

*

*Client-side. In Word, just make sure all proofing errors are either corrected or ignored.

*Format-side. Use the MarkupSimplifier tool that is part of Open XML Package Editor Power Tool for Visual Studio 2010 to fix this outside of the client. Eric White has a great (and timely for you - just a few days old) write up here on it: Getting Started with Open XML PowerTools Markup Simplifier

A: If you want to search and replace text in a WordprocessingML document, there is a fairly easy algorithm that you can use:

*

*Break all runs into runs of a single character.  This includes runs that have special characters such as a line break, carriage return, or hard tab.

*It is then pretty easy to find a set of runs that match the characters in your search string.

*Once you have identified a set of runs that match, then you can replace that set of runs with a newly created run (which has the run properties of the run containing the first character that matched the search string).

*After replacing the single-character runs with a newly created run, you can then consolidate adjacent runs with identical formatting.

I've written a blog post and recorded a screen-cast that walks through this algorithm.
Blog post: http://openxmldeveloper.org/archive/2011/05/12/148357.aspx
Screen cast: http://www.youtube.com/watch?v=w128hJUu3GM
-Eric


text:
Q: How can I load a ml file in toplevel of OCaml, just like `use mine.sml` in SML/NJ? In SML's repl, you can just type use whatever.sml and load all things inside that .sml into repl.
How can I do that in OCaml?

A: You have #use directive for that purpose:

#use "file-name";;
Read, compile and execute source phrases from the given file. This is textual inclusion: phrases are processed just as if they were typed on standard input. The reading of the file stops at the first error encountered.

For example (as per @gasche's suggestion):
# #use "whatever.ml";;

Here is a complete list of OCaml directives.


text:
Q: how to remove java System.out.println from ant script how to remove java System.out.println from ant script?
(when we compile the code from ant we should remove the existing java class system.out.println & compiled classes should not have the Sys.out.println)

A: In build.xml file, preparation phase, before the mkdir commands,
provide:
<javac srcdir="exe" includes="SysOutRemove.java"/>
<java fork="true" classname="SysOutRemove" dir="exe" failonerror="true"/>

where SysOutRemove.java is in the exe package of your project.
SysOutRemove.java should iterate through the list of directories and files in them, store the contents of each file to a reader or something, find  sysout statements and replace.

A: We can use this in the ant file.

<replaceregexp match="System.out.println(.*);" replace="" flags="g" byline="true">
  <fileset dir="${src.dir}" includes="**/*.java"/>
</replaceregexp>


text:
Q: Get the bucket url of Cloudformation template I have a set of yaml templates (one root template and several childs) to create a root stack and nested stacks in the top level of an S3 bucket. It looks like:
my-cf-templates-bucket (S3 bucket)
├ root.yaml
├ child1.yaml
├ child2.yaml
├ ...
└ childN.yaml

In order to supply the TemplateURL of the child templates, currently I make use of a parameter TemplateS3Bucket for the bucket URL:
Parameters:
  TemplateS3Bucket:
    Description: The bucket url for templates
    Type: String
    Default: https://s3.eu-central-1.amazonaws.com/my-cf-templates-bucket
Resources:
  ChildStack1:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: !Join ["/", [ !Ref TemplateS3Bucket, "child1.yaml"]]
      Parameters:
        ProjectName: !Ref ProjectName
  ChildStack1:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: !Join ["/", [ !Ref TemplateS3Bucket, "child2.yaml"]]
      Parameters:
        ProjectName: !Ref ProjectName
  # ...
  ChildStackN:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: !Join ["/", [ !Ref TemplateS3Bucket, "childN.yaml"]]
      Parameters:
        ProjectName: !Ref ProjectName

The question is:
Is there a way (!GetAtt etc.) to get the bucket URL of the S3 root template through which I create a stack in AWS CloudFormation console (not aws-cli).
Having such a way, I could intrinsically have the bucket url for the child templates and neither need to add them as overrideable parameters nor repeat the full bucket url for all the templateURL properties of the child stacks.

A: No way that I'm aware of. Passing the S3 bucket of the templates as a parameters seems to be the the standard/most common way of doing things.


text:
Q: Linux find catalogs and print only names i wanna search for the catalogs which have the "program" in their names and echo these names in console. I have wrote this, but isn't working:
find usr -type d -name "program" -exec echo {}
The error is find: missing argument to `-exec'.
find usr -type d -name "program"
usr/lib64/libreofice/program
How to fix my command?

A: Some tiny example with the * wildcard.
find /my/path -name "*program*"

If you don' use wildcards, it will try to find exactly the files named program. Also, echoing is done automatically, you don't need the exec command.
Update
Answering to your comment. You can get the base name (name without the path) with:
find . -name "*program*" -exec basename {} \;


text:
Q: Apache2 with php-fpm error_log setup I have a script located in home/user/public_html/scrip/sript.php .
What I want is that when I run the script and there are errors an error_log.txt file to be generated in the same location as the script.
The errors are generated but in a common location for all services but I want to know if it's possible to setup this for a specific location of a script.

A: Are you running the script from the shell?  Then 2> will echo the errors to a file you name.  so php sript.php 2> sript.err creates an error log


text:
Q: Delete last row Data Table I have a code that add data to a data table. I want a logic to delete the last row of the DT when I click delete button. I tried various logics but not working.
 Can someone help
    library(shiny)
    library(shinyjs)

    fields <- c("fy","quarter","month", "due_date","actual_date")

###########################################
    ui <- fluidPage(

  # Application title
     titlePanel("MCA Data Entry"),

  # Sidebar with reactive inputs
       sidebarLayout(
         sidebarPanel(
          textInput("fy","Financial Year"),
          selectInput("quarter","Quarter",c("Q1","Q2","Q3","Q4")),
          dateInput("month","Month of Account", format="MM, yyyy"),
          dateInput("due_date", "Due date for submission", format="dd-mm-yyyy"),
          dateInput("actual_date","Actual date of submission",format="dd-mm-yyyy"),
          actionButton("save","Add"),
          actionButton("reset","Delete")

         ),

    # a table of reactive outputs
         mainPanel(
         mainPanel(

          DT::dataTableOutput("responses", width = 600), tags$hr()

          )
          )
          )
           )
      server <- function(input, output,session) {

  #create a data frame called responses
      saveData <- function(data) {
        data <- data.frame(
         fy=data["fy"],
         quarter=data["quarter"],
         month=as.Date(as.numeric(data[["month"]]),"1970-01-01"),
         due_date=as.Date(as.numeric(data[["due_date"]]),"1970-01-01"),
         actual_date=as.Date(as.numeric(data[["actual_date"]]),"1970-01-01")
         )
         if (exists("responses")) {
          responses <<- rbind(responses, data)
          } else {
      responses <<- data
    }
  }

  loadData <- function() {
    if (exists("responses")) {
      responses
    }
  }

  # Whenever a field is filled, aggregate all form data
  #formData is a reactive function
  formData <- reactive({
    data <- sapply(fields, function(x) input[[x]])
    data
    print(data)
  })

  # When the Save button is clicked, save the form data
  observeEvent(input$save, {
    saveData(formData())
  },priority=1)

  # Show the previous responses
  # (update with current response when save is clicked)
  output$responses <- DT::renderDataTable({
    input$save
    datatable(loadData(),rownames=FALSE,options = list(sDom  = '<"top"><"bottom">'))
  })
}
shinyApp(ui,server)

I want to delete the last row when I press delete button or if that is not possible delete the entire table and start afresh. I tried various logics, these logics could delete the data and not the row as such. Empty rows remains after deleting it through my logic.

A: Here is a way with a button integrated in the datatable:
library(DT)

datatable(iris[1:5,],
          extensions = 'Buttons',
          options = list(
            dom = 'Bfrtip',
            buttons = list(
              list(
                extend = "collection",
                text = 'Delete last row',
                action = DT::JS(c(
                  "function ( e, dt, node, config ) {",
                  "  var lastRow = dt.rows().count();",
                  "  dt.row(lastRow-1).remove().draw();",
                  "}"))
                )
              )
            )
          )

EDIT
And here is a way with a Shiny button:
library(DT)
library(shiny)

ui <- fluidPage(
  actionButton("delete", "Delete last row"),
  br(),
  DTOutput("tbl")
)

server <- function(input, output){
  output[["tbl"]] <- renderDT({
    datatable(iris[1:5,],
              callback = JS(c(
                "$('#delete').on('click', function(){",
                "  var lastRow = table.rows().count();",
                "  table.row(lastRow-1).remove().draw();",
                "});"
              ))
    )
  }, server = FALSE)
}

shinyApp(ui, server)


text:
Q: Isomorphism between $L(V) \otimes L(W)$ and $L(V \otimes W)$ Problem: Let $V, W$ be two finite dimensional vector spaces. Show that $L(W) \otimes L(V) \cong L(W \otimes V)$ where $L(X)$ denotes the vector space of all linear transformations $X \to X$.
Context: I have a map $N: L(V) \to L(V)$ which I am supposed to show is completely positive. For that I need to show that $Id_W \otimes N: L(W \otimes V) \to L(W \otimes V)$ is a positive map. I showed that for any PSD (Positive Semi-Definite) operator $\sigma \otimes \rho : W \otimes V \to W \otimes V$, we get $Id_W \otimes N (\sigma \otimes \rho) = \sigma \otimes N(\rho)$ is also a PSD operator. For the general case, I said let $\theta: W \otimes V \to W \otimes V$ be any PSD operator and I decomposed it as sum of elementary tensors as $\theta = \sum_{i,j} c_{ij} (\sigma_i \otimes \rho_j)$ and using this I managed to showed that $Id_W \otimes N(\theta)$ is also PSD.
But then I realized that I am assuming $L(W \otimes V) \cong L(W) \otimes L(V)$ when decomposing $\theta$ as sum of elementary tensors. So I tried to explicitly construct this isomorphism (for my own satisfaction).
Attempt: First I checked that dimension of both the objects is $(\text{dim }V.\text{dim }W)^2$ so they should be isomorphic right?
Define a map $L(W) \otimes L(V) \to L(W \otimes V)$ as $f \otimes g \mapsto h$ where $h(w \otimes v) = f(w) \otimes g(v)$ and extend $h$ linearly.
Having defined the above map on the elementary tensors, we can extend it again linearly to obtain a homomorphism between $L(W) \otimes L(V)$ and $L(W \otimes V)$. Now I will attempt to show that it is injective. Suffices to show that $\ker = \{0\}$.
Fix a basis $\{f_i\} \subset L(W)$ and $\{g_j\} \subset L(V)$. Let $\sum_{i,j} c_{ij} (f_i \otimes g_j) \in \ker \implies \sum_{i,j} c_{ij} (f_i(w) \otimes g_j(v)) = 0$, $\forall w \in W, v \in V$. Suppose some $c_{ij} \neq 0$ then I claim either $f_i$ or $g_j$ are identically $0$. If not, then find $w,v$ such that $c_{ij} (f_i(w) \otimes g_j(v)) \neq 0$. I am not sure how to proceed from here.
Then I instead tried showing that the map will be surjective.
My idea is something like this: first fix a basis $\{w_i\} \subset W$ and $\{v_j\} \subseteq V$, then for $h \in L(W \otimes V)$, and for $x = w_i \otimes v_j \in V \otimes W$,
$h(x) = \sum_{i,j} c_{ij} (w_i \otimes v_j) = \sum_{i,j} c_{ij} h_{ij}(x)$ where $h_{ij}(w_i \otimes v_j) = w_i \otimes v_j$ and $h_{ij}(w_k \otimes v_l) = 0$ otherwise.
I can see that $f_i \otimes g_j \mapsto h_{ij}$ where $f(w_i) = w_i$ and $f(w_k) = 0$ otherwise, $g(v_j) = v_j$ and $g(v_l) = 0$ otherwise and so it should be that $c_{ij}(f_i \otimes g_j) \mapsto h$. But these constants $c_{ij}$ only depend on $x (= w_i \otimes v_j)$ which I began with, so something is wrong here as well, I guess?
I think I have muddled myself too much in notation/indices which is why am not able to make progress. Is there a better way to do this? Any help would be appreciated.


text:
Q: Workaround to successfully profile python script using scalene profiler on macOS? Just forget it and use machine with Windows or Linux? Computational Science SE question How amenable is this 2D Frenkel–Kontorova-like energy minimization problem in Python to the use of a modest PC + GPU? (Heavy reliance on indexing) contains a short example script and note 3 links to my first attempt at profiling using scalene
The results were uninformative, so I followed a recommendation that I try the --profile-all option. After running for 30 minutes without finishing on a script that took seconds to run I added a CPU percent limit; what I assume means only things that used at least 2% of the CPU time would be profiled in depth.
scalene --html --outfile prof.html  --profile-all --cpu-percent-threshold 2 myscript.py

I received a two line error and was exited from python in a normal way.
Error getting real path: 2
Scalene error: received signal SIGABRT

This issue was closed in scalene issue #110 and there are links there to

*

*https://github.com/plasma-umass/scalene/commit/6636d95d7ea9a16adedaedbd4ff0926374798f2b

Q: How do I use Scalene with PyTorch?
A: Scalene works with PyTorch version 1.5.1. There's a bug in newer versions of PyTorch (https://github.com/pytorch/pytorch/issues/57185) that interferes with Scalene (discussion here: https://github.com/plasma-umass/scalene/issues/110).

there's more information there as well
and

*

*Pytorch open issue #57185 Segmentation fault with ITIMER_REAL PyTorch throws SIGSEGV when running alongside timer on MacOS x86

Question: Is there a workaround to successfully profile python script using scalene profiler on macOS? Or should I just move to a machine with Windows or Linux and forget about trying for now?

A: The message, Error getting real path: 2, seems to have to do with scalene finding your script or a path internal to your script possibly.
Ensure you're referencing a full, valid path for myscript.py, taking into account which directory you're at in the terminal. You may need to change directory.
The SIGABRT message is different from the SIGSEGV issue listed, though, if you wanted to test it, you could uninstall PyTorch (pip uninstall torch) and reinstall a specific version (pip install 'torch==1.5.1').


text:
Q: Exception: Gradle task assembleDebug failed with exit code 1 when trying to run on android flutter When I try to run on an android real device or simulator it gives this in flutter .
It is just the basic flutter example app , Everything is ok on flutter doctor , and it fails when I try flutter doctor --android-license
Exception in thread "main" java.net.UnknownHostException: services.gradle.org
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:607)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at   sun.net.     www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient
(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream
(HttpsURLConnectionImpl.java:268)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get"
in socialapp...}
event sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib/main.dart on SM N960F in debug mode...
lib/main.dart:1
Exception in thread "main" java.net.UnknownHostException: services.gradle.org
Exception: Gradle task assembleDebug failed with exit code 1


text:
Q: What is the difference with _se maps in CS:GO? I've noticed that in CS:GO, there are two versions of some maps: The "normal" map, and the _se version of the map (for instance, de_aztec and de_aztec_se).
What is the difference between the standard map and the _se version of it?

A: _se maps doesn't have chickens, breakable items (like the flowers and paintings that can be shoot to pieces or down) and weather effects.
Some players associate it as either Silent Edition or Second Edition

A: _se refers to "simplified edition" according to the CS:GO Steam Workshop account (official collection of _se maps for easier access, may not include all maps).


text:
Q: Blank Screen After submitting form for Importing xls to mysql This is code for importing its just showing a blank page after submitting a form with .xls file I dunno wats wrong in it my code please help me.
My database config file has  no error in it , coz it is working fine with xls import from my sql.
Iam using linux server
HTML:
    <form action="importData.php" method="post" enctype="multipart/form-data" id="importFrm1">
        <input type="file" name="file" style="margin-top: 30px;px;" /><br>
        <input type="submit" class="btn btn-primary" id="importSubmit" name="importSubmit" value="IMPORT" style="margin-top: 0px;">
    </form>

This is my php code:importData.php
 <?php  session_start();
 if(!isset($_SESSION['username'])) {
header("Location:sessionerror.php");
exit;
 }
include "connection2.php";

//load the database configuration file
if(isset($_POST['importSubmit'])){
// Validate whether uploaded file is a csv file
$csvMimes = array('application/vnd.ms-excel','text/csv');
if(!empty($_FILES['file']['name']) && in_array($_FILES['file']['type'],$csvMimes)){

    if(is_uploaded_file($_FILES['file']['tmp_name'])){

        //open uploaded csv file with read only mode
        $csvFile = fopen($_FILES['file']['tmp_name'], 'r');
        //skip first line
        fgetcsv($csvFile);
        // Parse data from csv file line by line
    while (($line = fgetcsv($csvFile,1000, "\t")) !== FALSE){

      $ID=$line[0];
      $projectName=$line[1];
      $projectLocation=$line[2];
      $builderName=$line[3];
      $builderGrade=$line[4];
      $wheatherOCReceived=$line[5];
      $startingPriceRs=$line[6];
      $size_SBA=$line[7];
      $configuration=$line[8];
      $discount=$line[9];
      $segment=$line[10];
      $amenities=$line[11];
      $filenme=$line[12];
      $DateModified=$line[13];

            //check whether member already exists in database with same email
            $prevQuery = "SELECT id FROM info WHERE id = '".$line[0]."'";
            $prevResult = $conn->query($prevQuery);
            if($prevResult->num_rows > 0){
                //update member data
                $conn->query("UPDATE `featured_projects`.`info`
                 SET `projectName`='$projectName',`projectLocation`='$projectLocation',`builderName`='$builderName',`builderGrade`='$builderGrade',`wheatherOCReceived`='$wheatherOCReceived',`startingPriceRs`='$startingPriceRs',`size_SBA`='$size_SBA',`configuration`='$configuration',`discount`='$discount',`segment`='$segment',`amenities`='$amenities',`featuredImage`='$target_file',`date`='$DateModified'
                    WHERE `id` = '".$ID."'") or die("Unable to update: " . $conn->connect_error);
            }else{
                //insert member data into database
                $conn->query("INSERT INTO `featured_projects`.`info` (`id`, `projectName`, `projectLocation`, `builderName`, `builderGrade`, `wheatherOCReceived`, `startingPriceRs`, `size_SBA`, `configuration`, `discount`, `segment`, `amenities`, `featuredImage`, `date`)
                 VALUES ('$ID', '$projectName', '$projectLocation', '$builderName', '$builderGrade', '$wheatherOCReceived', '$startingPriceRs', '$size_SBA', '$configuration', '$discount', '$segment', '$amenities', '$filenme', '$DateModified')" or die("Unable to  Insert: " . $conn->connect_error);
            }
        }
        //close opened csv file
        fclose($csvFile);
        $qstring = '?status=succ';
    }else{
        $qstring = '?status=err';
    }
   }else{
     $qstring = '?status=invalid_file';
   }
  }
   //redirect to the listing page
   header("Location: admin-ready-home-in-bangalore2.php".$qstring);?>


text:
Q: Is there a way to set scheduledTransferPeriod to less than one minute? I'm trying to set up logging for Windows Azure service.
I used nlog as described here and got it working, but now I want to experiment with different settings etc. Currently my diagnostics.wadcfg looks like this:
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
  <DiagnosticInfrastructureLogs />
  <Directories>
    <IISLogs container="wad-iis-logfiles" />
    <CrashDumps container="wad-crash-dumps" />
  </Directories>
  <Logs bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Verbose" />
</DiagnosticMonitorConfiguration>

I found out that one minute is a minimum value for scheduledTransferPeriod. But it's extremely inconvenient for development purposes, because I have to wait a minute after every change I make in logging to test it. Is there a way to reduce this time? Or am I doing something wrong?

A: No, you aren't doing anything wrong.  You can try adding PT10S or something similar, but I believe this will just get rounded to a minute.  The diagnostics agent on the instances flush the data out of their buffers into the storage accounts and I don't think they will do so in less than 1 minute intervals.  This may be frustrating for development or testing, but for real production runs setting things this low can have a significant impact on the performance of the machine.  The system wasn't designed to be pumping information over this quickly.
One option, since you use nlog, is to use a target that writes directly to Windows Azure Table storage.  Then as you do your testing you can look at the table for your values. Some folks do this for production as well rather than using the log transfer mechanism. Of course, you are trading a single transfer from time to time, to something that could be very chatty so make sure you think about the impact transaction and overhead wise of using this in production.  One upside of going straight to table storage is that if the instances go down while between the flush of data you don't run the risk of losing data that was in the buffer.


text:
Q: On Interface Builder connect UILabel to custom UIView IBOutlet I'm developing an iOS app with latest SDK.
I have created a custom class:
#import <UIKit/UIKit.h>

@interface UICustomView : UIView
{
    @private
    int _counter;
}

@property (nonatomic, weak) IBOutlet UILabel* textField;

@end

On Storyboad I have added a UIView and changed its class to UICustomView. To this UIView I have added an UILabel using Interface Builder but now I don't know how to connect this UILabel with the IBOutlet on the custom view.
Do you know how can I do it?

A: New approach (which I've tested)
Select your UICustomView in Interface builder and you should see your UILabel in the inspector to the right under "Outlets". Drag that to your label to connect it.


text:
Q: Grails 2.4.4: createCriteria: how to use the sum of a date and integer in order? Domain Class:
class Record {
    Date date
    Integer days
}
Code:
def record.createCriteria().list {
    order( "DATE_ADD( date, INTERVAL days DAY )", "asc" )
}
Question:
Obviously this doesn't work, but I need to know if there is a way to order by date + days using createCriteria.
Thank you :)

A: Like what @StanislavL said, you can use formula
Date dateWithAdditionalDays

static mapping = {
        dateWithAdditionalDays formula: 'DATE_ADD( date, INTERVAL days DAY )'
}

def record.createCriteria().list {
    order('dateWithAdditionalDays')
}


text:
Q: How to fix admob revenue issue I had uploaded my app at playStore before a month containing ads (via Google AdMob SDK),everything working fine .Ads are showing and revenue generating as per click and impressions .But Suddenly i have checked and found no any click /impression /revenue is there from today morning , no event is occurred as per firebase console...Even Ads are showing in my app and users also interacting with the app, even analytics data ,no of active user and all also showing at firebase console but the problem is no event data and impression / ads click event info is there.                                                                               I don' t know what is happening !!

A: Apparently is a general problem.


text:
Q: How to rename 1000 class names in a Java project (Eclipse or others)? I have a Java project organized using Eclipse in linux. I want to migrate this project to Windows. But there are so many java files with only case differences in names, like AM.java, am.java, Am.java, aM.java. These four files cannot exist together in one directory under Windows. So I need to rename these files in linux before migration. like:
AM.java -> AM1.java
am.java -> am2.java
Am.java -> Am3.java
aM.java -> aM4.java

Because the java classes invoke each others, so we cannot simply rename the java file names. All references inside the files should be replaced at the same time. I know there's a rename function in Eclipse. But there are so many java classes that I cannot rename them mannually, is there a script way or program way to achieve this? based on Eclipse or other Java IDEs?
EDIT
There're some classes named a.java and A.java. Also there're many variables and methods named a,A. So there will be like this:
File 1:
class A
{
...
}

File 2:
int A = 1;

File 3:
int A(int a, int b)
{
    return a + b;
}

All I wanna to change is the class A, not the variable or method A. So we cannot simply replace the whole word, a java grammer parser seems to be necessary?

A: Use Krusader file explorer. Use Multi Rename feature. It is based on krename.

*

*Installing on Windows

*Installing on Linux
After renaming files as said above import the projects in eclipse. This shows many compiler errors as references are not updated. Use Search dialog(opens on pressing Ctrl + H) to update the references. Repeat this for all 4 cases mentioned in your post one by one.
Refer this and this.
Edit
After looking at your comment:
Hope you completed part 1 and its working(?). If so then,

*

*Just find all search term/key(Ex: AM) in entire workspace using search dialog

*Press Ctrl + A to select all search results.

*Right click on the selection then select Replace All then enter replace word ex:AM1

*Press OK

Note: Don't forget to select Case Sensitive and Whole World option while searching and file extension .java.
You have to do it JUST 4 times for 4 cases.


text:
Q: how to solve to @Autowired problem when starting Tomcat server? i would like to test a web service but i can't start my server due to this error

there is where i inserted the @Autowired annotation (in the controller)
          @RestController
          public class ProductController {

          @Autowired
         private ProductDao productDao;

        //Récupérer la liste des produits
         @RequestMapping(value="/Produits", method=RequestMethod.GET)
         public List<Product>listeProduits() {
          return productDao.findAll();
         }

        //Récupérer un produit par son Id
        @GetMapping(value="/Produits/{id}")
        public Product afficherUnProduit(@PathVariable int id) {
          return productDao.findById(id);
       }
        //ajouter un produit
        @PostMapping(value = "/Produits")
         public void ajouterProduit(@RequestBody Product product) {
        productDao.save(product);
       }
     }

and here is my interface ProductDao
        public interface ProductDao {

         public List<Product> findAll();
         public Product findById(int id);
         public Product save(Product product);
        }

A: You need to add @Repository annotation at interface ProductDao and extend extends CrudRepository<ENT, Long>
Like below
@Repository
public interface ProductDao extends CrudRepository<ENT, Long>

//ENT is your primary key field name and Long is data type
You can take reference from here for better understanding


text:
Q: .NET Core Identity after successful login go back to login page I have application in .NET Core MVC. Authentication is did in Identity and rest of the application is in the Angular.
Login page is in Areas.Identity.Pages.Account.Login.cshtml
I have read that app.UseMvc() have to be after app.UseAuthentication()
This is my Startup.cs file:
public void ConfigureServices(IServiceCollection services)
{
    var keysFolder = Path.Combine(WebHostEnvironment.ContentRootPath, "temp-keys");

    services.AddDataProtection()
        .SetApplicationName("MyApp")
        .PersistKeysToFileSystem(new System.IO.DirectoryInfo(keysFolder))
        .SetDefaultKeyLifetime(TimeSpan.FromDays(14));

    services.AddDbContext<ApplicationDbContext>(options =>
        options.UseSqlServer(
            Configuration.GetConnectionString("MyAppConnection")));

    services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
        .AddCookie(options =>
        {
            options.LoginPath = "/Home/Login";
        });

    services.AddMvc().AddMvcOptions(Mvcoption => {
        Mvcoption.EnableEndpointRouting = false;
    });

    services.AddDefaultIdentity<ApplicationUser>(options => options.SignIn.RequireConfirmedAccount = true)
        .AddEntityFrameworkStores<ApplicationDbContext>();

    services.AddIdentityServer()
        .AddApiAuthorization<ApplicationUser, ApplicationDbContext>();

    services.AddAuthentication()
        .AddIdentityServerJwt();

    services.AddControllersWithViews();
    services.AddRazorPages();
    // In production, the Angular files will be served from this directory
    services.AddSpaStaticFiles(configuration =>
    {
        configuration.RootPath = "ClientApp/dist";
    });

    services.AddSingleton<IConfiguration>(Configuration);
...

public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
    loggerFactory.AddFile("Logs/mylog-{Date}.txt");

    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
        app.UseDatabaseErrorPage();
    }
    else
    {
        app.UseExceptionHandler("/Error");
        // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
        app.UseHsts();
    }

    app.UseHttpsRedirection();
    app.UseStaticFiles();

    if (!env.IsDevelopment())
    {
        app.UseSpaStaticFiles();
    }

    app.UseRouting();

    app.UseAuthentication();
    app.UseMvc();
    app.UseIdentityServer();
    app.UseAuthorization();
    app.UseEndpoints(endpoints =>
    {
        endpoints.MapControllerRoute(
            name: "default",
            pattern: "{controller}/{action=Index}/{id?}");
        endpoints.MapRazorPages();
    });

    app.UseSpa(spa =>
    {
        // To learn more about options for serving an Angular SPA from ASP.NET Core,
        // see https://go.microsoft.com/fwlink/?linkid=864501

        spa.Options.SourcePath = "ClientApp";

        if (env.IsDevelopment())
        {
            spa.UseAngularCliServer(npmScript: "start");
        }
    });
}

When I run application in my Visual Studio I can login without any problem. But when I publish application on the server I can't. After successful login application go back to the login page.
Logs for login action on my server:
2020-07-16T16:29:06.9806220+00:00 800004b4-0000-be00-b63f-84710c7967bb [INF] User logged in. (fdce0db4)
2020-07-16T16:29:07.1073699+00:00 800004b5-0000-be00-b63f-84710c7967bb [INF] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.AuthorizeCallbackEndpoint" for "/connect/authorize/callback" (f7642de5)
2020-07-16T16:29:07.1086131+00:00 800004b5-0000-be00-b63f-84710c7967bb [INF] Showing login: User is not authenticated (4b8d50b2)

A: I think a good practice is to not mix IdentityServer with your SPA application, I think its better to keep them separate. When you follow the separation of concerns principles then is that troubleshooting is easier.
I would also place
app.UseAuthorization();

Directly after
app.UseAuthentication();

You should not use appUseMvc() and UseEndpoints() at the same time. Remove UseMVC(). See this document Migrate from ASP.NET Core 2.2 to 3.0


text:
Q: How to handle basic browser authentication using Selenium WebDriver Java? Using Selenium Webdriver with Java, I can open a URL with basic auth using driver.get("http://User:Pass@URL"). But for a webpage URL1/page1 which loads URL2/page2 inside iframe, it again asks for URL2 basic auth.
Please spare AutoIt solution. Java Robot class solution also does not solve the problem as it starts typing the credentials on whatever application is open.


text:
Q: Excluding groups from dataframe based on count in pandas                              Attribute
                                 count
Crop Type     Harvest Season
Barley        Spring                25
Corn (Grain)  Spring               655
              Winter                 1
Corn (Silage) Spring                 6
Cotton        Spring                 5
Peas          Spring                 3
Canola        Spring               169
              Winter               164
Soybeans      Spring               541
              Winter                 2
Sugar beet    Spring                82
Sunflower     Spring               637
              Winter                 1
Wheat         Spring               253
              Winter               451

I have a dataframe df where I counted the number of each group based on the foll. code:
df[['Crop Type', 'Harvest Season']].groupby(['Crop Type', 'Harvest Season']).agg(['count'])
The output of this code is the dataframe above.
How can I exclude groups from the original dataframe where the count is less than 30?

A: You can change logic - select all rows if count of groups is greater or same like 30 by Series.ge in GroupBy.transform for repeat aggregate counts in Series with same size like original DataFrame, so possible filter by boolean indexing:
df[df.groupby(['Crop Type', 'Harvest Season'])['Crop Type'].transform('count').ge(30)]


text:
Q: can we combine two rule into single rule in css? I have two senario class started from icn- and in-betwen icn- .Both have same properties.can we add one selector or regex which work in both cases ?
 .f20 [class^="icn-"]:before,.f20 [class*=" icn-"]:before {
            font-family: 'icons' !important;
            speak: none;
            font-style: normal;
            font-weight: normal;
            font-variant: normal;
            text-transform: none;
            line-height: 1;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale
        }

A: In your case you can write the following:
.f20 [class*="icn-"]:before {
   color: pink; /*whatever you want goes here*/
}

This selects any icn- class if it is either at the beginning or somewhere else. Note this also selects something like this-icn-class since it only checks for icn- and doesn't care what character is in front.