Gatling compilation fails for simulation with nothingFor function

Question: I am trying to run simulation with nothingFor function under Gatling 3.4.1. However, compilation fails with the error could not find implicit value for evidence parameter of type io.gatling.core.controller.inject.InjectionProfileFactory[Product with Serializable]
Simulation
package abs

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class DefaultSimulation extends Simulation {

  ...

  val httpProtocol = http
    .baseUrl(Setting.baseUrl)
    .userAgentHeader("Gatling/3.4.1")

  setUp(
    getScenario.inject(
      nothingFor(20 seconds),
      rampConcurrentUsers(0) to(20) during(10 seconds),
      constantConcurrentUsers(20) during (600 seconds)
    ),
    setScenario.inject(
      rampConcurrentUsers(0) to(20) during(30 seconds),
      constantConcurrentUsers(20) during (600 seconds)
    )
  ).protocols(httpProtocol)
}

Compilation error
[ERROR] i.g.c.ZincCompiler$ - C:/Installation/gatling-3.4.1/user-files/simulations/DefaultSimulation.scala:50:30: could not find implicit value for evidence parameter of type io.gatling.core.controller.inject.InjectionProfileFactory[Product with Serializable]
    getScenario.inject(
                      ^
[ERROR] i.g.c.ZincCompiler$ - one error found
[ERROR] i.g.c.ZincCompiler$ - Compilation crashed
xsbt.InterfaceCompileFailed: null
        at xsbt.CachedCompiler0.handleErrors(CompilerBridge.scala:183)
        at xsbt.CachedCompiler0.run(CompilerBridge.scala:172)
        at xsbt.CachedCompiler0.run(CompilerBridge.scala:134)
        at xsbt.CompilerBridge.run(CompilerBridge.scala:39)
        at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:89)
        at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:185)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:240)
        at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:175)
        at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:156)
        at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:232)
        at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:156)
        at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:203)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:571)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:571)
        at sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:174)
        at sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:172)
        at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:459)
        at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:115)
        at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
        at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
        at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:248)
        at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:414)
        at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:499)
        at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:401)
        at sbt.internal.inc.Incremental$.apply(Incremental.scala:166)
        at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:571)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:489)
        at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
        at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:419)
        at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
        at io.gatling.compiler.ZincCompiler$.doCompile(ZincCompiler.scala:258)
        at io.gatling.compiler.ZincCompiler$.delayedEndpoint$io$gatling$compiler$ZincCompiler$1(ZincCompiler.scala:265)
        at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:40)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1$adapted(App.scala:80)
        at scala.collection.immutable.List.foreach(List.scala:431)
        at scala.App.main(App.scala:80)
        at scala.App.main$(App.scala:78)
        at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:40)
        at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)

I have tried to implicitly specify imports, but compilation fails with the same exception
import io.gatling.core.Predef.{nothingFor, rampConcurrentUsers, constantConcurrentUsers, _}
This simulation compiles and works without nothingFor(20 seconds).
Answer: Gatling has 2 different families of injection profiles steps:

open, where you control users arrival rate
closed where you control the number of concurrent users

You can't mix them because those are 2 completely different and incompatible behaviors.
nothingFor belongs to the open family while rampConcurrentUsers belongs to the closed one.
Use constantConcurrentUsers(0) during (20) instead.


How to calculate $\lim\limits_{x \to 0 } \frac{x}{\sin{\pi(x+2)}}$

Question: I divided the limit by the product of the two limits.
The first limit is found, but how to calculate second:
$\lim\limits_{x \to 0 } \frac{x}{\sin{\pi(x+2)}}$
Comment: use the periodicity of the sin function: $\sin(a+2\pi)=\sin(a)$
Comment: Thank you, I need understand why $\lim_{x \to 0}\frac{\sin(x)}{x}$ is $1$...
Comment: @divisor. the expansion of $sin(x)$ is $x - \frac{x^3}{3!} + \frac{x^5}{5!}...$. Factor out x and, you get - $x[1 - \frac{x^2}{3!} + \frac{x^4}{5!}...]$. In the parantheses, set all terms except the $1$ to zero as $x$ tends to zero. The $x$ is now divided out by the $x$ in the denominator.
Answer: hint
$$\sin(\pi(x+2))=\sin(x\pi+2\pi)$$
$$=\sin(x\pi )$$
$$\lim_{X\to 0}\frac{X}{\sin(X)}=1$$
Comment: I know that $\lim_{x \to 0}\frac{\sin(x)}{x}=1$, why $\lim_{x \to 0}\frac{\sin(x)}{x}$ is $1$ too?
Comment: L'Hopital for example.
Comment: Sorry, L'Hopital rule is unavailable, I needed $\lim_{x\to 0}\frac{1}{\pi}\left(\frac{\sin\pi x}{\pi x}\right)^{-1}$
Answer: Assume we already know $\lim_{x \rightarrow 0 \frac{x}{sinx}}=1$.
$\lim_{x \rightarrow 0 \frac{x}{sin{\pi (x+2)}}}
= \lim_{x \rightarrow 0} \frac{x}{sin{\pi x}}
= \lim_{\pi x \rightarrow 0} \frac{\pi x}{sin{\pi x}} \cdot \frac{1}{\pi}
= \frac{1}{\pi} \lim_{u \rightarrow 0} \frac{u}{sinu}
= \frac{1}{\pi}$
As for $\lim_{x \rightarrow 0 \frac{x}{sinx}}=1$, it needs another proof.
Comment: I know that $\lim_{x \to 0}\frac{\sin(x)}{x}=1$, why $\lim_{x \to 0}\frac{\sin(x)}{x}$ is $1$ too?
Comment: $\lim_{x\to 0}\frac{1}{\pi}\left(\frac{\sin\pi x}{\pi x}\right)^{-1}$
Comment: Do you mean we already know $\lim_{x \rightarrow 0} \frac{sinx}{x}=1$, why $lim_{x \rightarrow 0} \frac{x}{sinx} = 1$? The limit has its multiplication property and division property.
Comment: Like that, $1=\lim_{x \rightarrow 0} \frac{sinx}{x} \frac{x}{sinx} = \lim_{x \rightarrow 0} \frac{sinx}{x} \lim_{x \rightarrow 0} \frac{x}{sinx} = 1 \cdot \lim_{x \rightarrow 0} \frac{x}{sinx}$. Maybe it is not serious.
Comment: Sorry, $\lim_{x \rightarrow 0} \frac{sinx}{x} \frac{x}{sinx}$ it's my stupidity...
Comment: I would like to increase more, but I can increase only once :(
Answer: $$\begin{align}
\lim_{x\to 0}\frac{x}{\sin\pi(x+2)}&=\lim_{x\to 0}\frac{x}{\sin(\pi x+2\pi)}\\
&=\lim_{x\to 0}\frac{x}{\sin\pi x}\\
&=\lim_{x\to 0}\frac{1}{\pi}\left(\frac{\sin\pi x}{\pi x}\right)^{-1}\\
&=\frac{1}{\pi}1^{-1}=\frac{1}{\pi}.
\end{align}
$$
Comment: @divisor very much welcome
Answer: with the help of the rules of L'Hospital we obtain
$$\lim_{x \to 0}\frac{x}{\sin(\pi(x+2))}=\lim_{x \to 0}\frac{1}{\pi\cos(\pi(x+2))}=...$$
Comment: you are missing a $\pi$ when you derivate $\sin$
Comment: L'Hopital rule is unavailable...


Can Hand-Edited sendmail.cf actually be generated from sendmail.mc?

Question: I have two CentOS systems, version 5 and 6. Because our firewall has blocked off unsolicited port 25 traffic, we have a little Perl script that logs into our email server as a valid user to send email off our Linux systems. That works fine in CentOS.
I have an Ubuntu 12.04 workstation, which was recently updated, and I had lost the ability to send email off the system until I added this to /etc/mail/sendmail.cf, taking it from one of the CentOS /etc/mail/sendmail.cf files.
<code>Msmtpredir,          P=/usr/sbin/SMTPRedirect, F=DFMnSu,
                     S=EnvFromSMTP/HdrFromSMTP,
                     R=EnvToSMTP,
                     T=DNS/RFC822/SMTP,
                     A=SMTPRedirect $h $f $u
</code>
/usr/sbin/SMTPRedirect is a perl script that logs into our email system as a legitimate client without the need for password.
Can Msmtpredir be configured in sendmail.mc?
Answer: The short answer is YES you can and I think it is relatively easy.  I've done a lot of tinkering with sendmail.mc configuration files in the past.....But I'd have to dig into the sendmail.mc documentation to tell you how.  That would be a good place for you to start your research.
From the sendmail cf.README text file:
"
+--------------------------------+
| ADDING NEW MAILERS OR RULESETS |
+--------------------------------+
Sometimes you may need to add entirely new mailers or rulesets.  They
should be introduced with the constructs MAILER_DEFINITIONS and
LOCAL_RULESETS respectively.  For example:
<code>    MAILER_DEFINITIONS
    Mmymailer, ...
    ...

    LOCAL_RULESETS
    Smyruleset
    ...
</code>
Local additions for the rulesets srv_features, try_tls, tls_rcpt,
tls_client, and tls_server can be made using LOCAL_SRV_FEATURES,
LOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER,
respectively.  For example, to add a local ruleset that decides
whether to try STARTTLS in a sendmail client, use:
<code>    LOCAL_TRY_TLS
    R...
</code>
Note: you don't need to add a name for the ruleset, it is implicitly
defined by using the appropriate macro.
"


How to solve system equations that are composed of fractions

Question: I'm trying to figure how to solve this particular system of equations.
$$
A = \frac{1}{x}, B = \frac{1}{y}
$$
$$
\frac{12}{x}-\frac{12}{y} = 7\\
   \frac{3}{x}+\frac{4}{y} = 0
$$
Comment: Make the substitution $B = 1/y$, and forget the $C$.
Comment: Then $12A - 12B = 7, 3A + 4B = 0$. Solve $A$ and $B$, then solve $x = 1/A, y = 1/B$.
Comment: @Yuki.F I'm kind of confused. Could you elaborate?
Comment: Now you substitute $A = 1/x, B = 1/y$ into the 2 equations you have, so the equations become what I typed above. Then use eliminations to get the value of $A$ and $B$ -- like what @lennon310 did in his response.
Answer: $12A - 12B = 7$         (1)
$12A + 16B = 0$         (2)
Use (1) - (2) : $B = -1/4$
then pass $B$ to (2) (or (1)),  you can get $12A - 16 \cdot 1/4 = 0$, so $A = 1/3$).
Comment: after you get $B$ you can pass the value to either (1) or (2) to solve $A$
Comment: Does it matter where we pass it on? And how did $-1/4$ become $1/4$?
Comment: it doesn't matter, you can pass it to (1) too: $12A - 12(-1/4) = 7$ and get the same result. For (2) it is $12A + 16(-1/4) = 12A - 16(1/4)$
Comment: And in $(1)$ are we eliminating $12B$ to isolate $12A$?
Comment: yup, or in fact it is adding $12B$ on both side of the equation (1) to isolate $12A$
Comment: Adding $12B$ in order to cancel $12B$ in $(1)$, that means we have to add $12B$ to $7+12$?
Comment: It is $12A - 12B + 12B = 7 + 12B$
Comment: is $12B(-1/4)$ same as $12*(-0.25)=-3$, then $(-3)+3=0$ and $7+3=10$ what do we do with $12A$?
Comment: You need to add $-3$ on both side not $3$, so it's $12A - (-3) + (-3) = 7 + (-3)$
Comment: I apologise. I did put $(-3)$ in the begging, but changed it to $3$. Anyway. $12A = 4$ by simplifying the equation $12A/12A = 4 / 12$  we get $A = 3$ or $A = 1/3$
Comment: $A = 1/3$ so $x = 3$


Can enums hold classes as members?

Question: I'm trying to add classes to an enum, but I can't find a way to make it work.
I have a "main" class (let's call it Product) which should hold some other different classes, that hold different properties, under a single enum (let's call it Property). The Property enum should contain multiple different classes which fall under the Product class, so that I can use one of them, depending on which product is in question. However, when I try to include a class under an enum, it's not being recognized as a class at all.
Is there way to include classes as members under an enum?
Comment: Even if they could (which they don't), how would you expect to use them? maybe you just want a switch statement, or if you really need you could use `Dictionary` or a factory pattern, or anything else
Answer: There is not.
See enum-Reference:

Every enumeration type has an underlying type, which can be any
  integral numeric type.

An enum type is always numeric.
Answer: No, this not what enums are build for.
Enums are like primitve classes (like int) and should be used in this way.
Comment: I could have wrote that, can you please elaborate, show alternatives, and make this a little more well, qualitative
Comment: Its a closed question. I dont know exactly what you like to do, but I can answer the question of the title. Can you provide a code-example for us?

Can enums hold classes as members?


How to hide all nodes of a particular content type?

Question: I have a site that used to run polls, but has stopped doing so.  I'd like to keep the poll nodes in the database, just in case things change in the future, but otherwise hide the nodes.  I guess this means returning a 403 or 404 if someone or a search bot requests the page, so that local users will be unable to see them and bots will eventually remove them from their indices.
I've disabled the poll module and disabled all the user permissions having to do with polls, so no new polls will get created.  However, if someone requests the page via its URL, they get a normally-themed page with the poll's title (but no other content).  I tried marking one of the polls as "not published", which comes pretty close to what I want: a normally-themed 403/access denied page.  This would require my hacking the "published" state of all the poll nodes to "false", which I guess is better than nothing, but I was hoping for a hook function that would produce the same result, but without messing around in the database.  Any advice out there?  Thanks!
Comment: try something like in template.php:  function theme_preprocess_page() {
  $type =  node_type_get_name($node);
  if($type == 'your_content_type') {
    drupal_go_to('some_url');
  }
}
Answer: Try the Rabbit Hole module:

Rabbit Hole is a module that adds the ability to control what should happen when an entity is being viewed at its own page.
Perhaps you have a content type that never should be displayed on its own page, like an image content type that's displayed in a carousel. Rabbit Hole can prevent this node from being accessible on its own page, through node/xxx.
Answer: The quickest way to achieve this would be to add Views Bulk Operations module to augment Views with new actions (including a 'select all results'), then creating an administrative View that shows all Polls, with a bulk action to change its published status.
With the nodes unpublished, they are retained in the system. Without "view unpublished nodes" permission, non-admin users will just see a Page Not Found 404 message.
From here, you may want to consider creating a redirect either with .htaccess if you are on Apache or add Rabbit Hole module to edit the Poll content type and changes its behavior when loaded (if they are already unpublished, this may not fire anyway).


Como abrir e fechar modals com jQuery

Question: Eu estou a tentar abrir um modal, esperar 3 segundos e fechá-lo dentro do $( document ).ready().
Quando uso $('#myModal').modal('show'); o modal aparece mas quando faço $('#myModal').modal('show').delay(3000).modal('hide'); ele nem sequer aparece.
Answer: Não creio que seja possível fazer chain dessa maneira. Não estou 100% certo disso.
De qualquer maneira pode fazer assim:
$('#myModal1').modal('show');
setTimeout(function () {
    $('#myModal1').modal('hide')
}, 2000);

Exemplo
Answer: O teu problema é que estás a fazer uso do método .delay() de forma incorreta. O mesmo só afeta a queue de animações e não outros métodos, funções, eventos, etc. que não estejam na queue.
Solução
Bootstrap > 3.0.0
Podes executar determinado código quando uma modal é apresentada, fazendo uso do evento shown.bs.modal:
$('#myModal1').on('shown.bs.modal', function() {

    var $me = $(this);

    $me.delay(3000).hide(0, function() {
        $me.modal('hide');
    });
});

Assim, quando a modal for aberta, o código anexado a esse evento será executado. No exemplo em cima, existe uma pausa de 3 segundos e depois a própria modal é fechada.
Como o método .delay() só afeta a queue de animações, o parâmetro 0 no método .hide() é passado para que o mesmo passe a constar da queue de animações e assim esperar pelo .delay() indicado, sem o parâmetro ele não faz parte da queue pelo que é executado de imediato.
Exemplo
Exemplo em baixo também no JSFiddle.

$(function() {

  $('#myModal1').on('shown.bs.modal', function() {

    var $me = $(this);

    $me.delay(3000).hide(0, function() {
      $me.modal('hide');
    });
  });
});

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Modal title

        ...

        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>

<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal1">
 Abrir, deve fechar ao fim de 3 segundos
</button>

Como abrir e fechar modals com jQuery


How to redirect the root URL of parked domains, using a variable

Question: I need 1000 parked domains to redirect to a corresponding page.
For example, if one of the parked domains is "parkeddomain.com", then it must be redirected to http://example.com/landingpage/parkeddomain-com
Conditions:

Only the root URL of the parked domains must be redirected, not
example.com
The browser url address must stay the same
"parkeddomain.com"

The purpose is to create a simple system for a domain broker to host domains, each with one landing page per domain.

I will try to make this look less complicated, sorry. The idea is: redirect every domain to /landingpage/[thedomainname] except from the primary domain since that shows the homepage of the company website.
Comment: What do you mean exactly by "root URL of the parked domains must be redirected, not example.com"?  What would the "not example.com" redirect be that you want to prevent? Why wouldn't a simple web server configuration with a virtual host for every domain work for this purpose?
Comment: Thanks for your comment...I see that people are not happy with this question, propably because I didnt add my own coding effort, I'll try to add something to the question. About your comment: In my case the parked domains are coming and going on a regular basis, I sell and buy domains and have a landing pages on one and the same drupal website. So working with variables/wildcards in the rewriterules might work better than a large list of virtual hosts
Comment: So redirection of the root URL of the parked domains, i.e. "parked1.com" which is parked on top of the primary domain "example.com".
Comment: That still doesn't still answer the "not example.com" redirect question above. I can't understand what is the exact redirect you don't want to happen. Show some sample URLs in form: source.url -> destination.url which you want to happen and source.url -> destination.url which you do not want to happen.
Comment: @TeroKilkanen I guess he doesn't want `example.com` get redirected to `example.com/example-com` - but I don't get what _The browser url address must stay the same "parkeddomain.com"_ should tell me - I would really suggest using virtual hosts
Answer: Something like the following.
<code># Rewrite Request for parked domains '/' to landing page
RewriteCond %{HTTP_HOST} !=example.com
RewriteCond %{HTTP_HOST} (.+)\.(\w+)
RewriteRule ^/?$ /landingpage/%1-%2  [L]
</code>
To do it generically for a FQDN with two or more components would be more complex.
Comment: Your rewrite rule works very well. The only issue I now have is that my server needs triple the amount of RAM when I have 2000 parked domains. Could that have to do with the fact that this rewrite rule eliminates Apache? The server uses Opcache and Memcache.
Comment: I tested this but it has not effect. I think that something else in my 'out of the box' Drupal 7 .htaccess file prevents this from working.
Comment: Then you'll need mod_rewrite logging to debug, or if you are using Apache v2.4 you can place this at the top of the Drupal htaccess file and change the `[L]` to `[End]`, thouhg it might break if the request needs to be processed by Drupal itself.
Comment: Okay I found it: Drupal uses 'clean urls' but I still need to include the query string So this works: RewriteRule ^/?$ ?q=landingpage/%1-%2 [L]


derivative of the integral with chain rule applied

Question: I'm having difficulty seeing the answer to the following question on one of the practice Calculus MC practice problems:
$$d/dx \left(\int_0^{x^2} \sin(t^3)\,dt\right)= 2x\sin(x^6)$$
The chain rule is applied to the $x^2$ part?
Answer: According to the FTC, if we denote the antiderivative of $\sin(t^{3})$ by $F(t)$, we have that
\begin{align*}
\int_{0}^{x^{2}}\sin(t^{3})\mathrm{d}t = F(x^{2}) - F(0)
\end{align*}
Applying the derivative to both sides, we get that
\begin{align*}
\frac{\mathrm{d}}{\mathrm{d}x}\int_{0}^{x^{2}}\sin(t^{3})\mathrm{d}t = 2xF'(x^{2}) = 2x\sin((x^{2})^{3}) = 2x\sin(x^{6})
\end{align*}
and we are done.
Hopefully this helps!
Comment: Thank you.  Took me a moment to see that.
Comment: You are welcome ! I am glad to be of help.
Answer: With FTC $\frac{d}{dx} \int_a^{x} f(t)dt= f(x)$ and chain rule:
\begin{align}\frac{d}{dx} \left(\int_0^{x^2} \sin(t^3)\,dt\right)= \frac{d}{dx^2} \left(\int_0^{x^2} \sin(t^3)\,dt\right)\times\frac{d x^2}{dx}=\sin(x^2)^3 \times 2x=2x\sin x^6\end{align}


DNS resolution fails in some countries

Question: I am checking website via wordwide DNS checker.
DNS resolution is incorrect in some countries.
What is the cause of this problem?

No problem in my other websites only this

Web site: downvids.net
System: Centos 7
Control Panel: directadmin

Wordwide DNS checker results

22.214.171.124 and 18.104.22.168 not my ip addresses! What is this?
Comment: I am going to hazard a guess that your DNS provider is failing, and those two random IP addresses is Verizon hijacking `nxdomain` responses and putting advertising on them. Some of the DNS servers still have your records cached, which is why they are working, but others are not. Did you make any changes to your glue records, or to your registrar records?
Comment: Thank yo for comment,  why does my DNS provider fail? How to check dns ?
Comment: Something has changed. Did you change anything? Did you pay your bills on time? Have you let your domain registration lapse?
Comment: I can see that you are using vanity nameservers (i.e. nameservers that are on the same domain that they are serving). This means you must be using glue records with your domain registrar. Did you change your glue records? I do not see any records for `ns1.downvids.net` or `ns2.downvids.net` so I'm guessing you have done something to remove your glue records. I also see `Updated Date: 2017-02-21T16:49:46Z` in your whois, which means you did _something_ to that domain very recently.
Comment: Changed name server since 2 year ago and there was no problem when I checked it.
Answer: There does not appear to be a delegation for downvids.net in DNS, ie the net TLD nameservers claim that there is no such domain (NXDOMAIN status).
$ dig @a.gtld-servers.net downvids.net NS +norec

; <<>> DiG 9.10.4-P6-RedHat-9.10.4-4.P6.fc25 <<>> @a.gtld-servers.net downvids.net NS +norec
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 41296
;; flags: qr aa; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;downvids.net.                  IN      NS

;; AUTHORITY SECTION:
net.                    900     IN      SOA     a.gtld-servers.net. nstld.verisign-grs.com. 1487705761 1800 900 604800 86400

;; Query time: 0 msec
;; SERVER: 2001:503:a83e::2:30#53(2001:503:a83e::2:30)
;; WHEN: Tue Feb 21 19:36:32 UTC 2017
;; MSG SIZE  rcvd: 114

$

Looking up your domain in whois, one can see:
Domain Status: clientHold

The clientHold EPP status code in itself is quite cryptic but looking up the explanation one finds:

This status code tells your domain's registry to not activate your
  domain in the DNS and as a consequence, it will not resolve. It is an
  uncommon status that is usually enacted during legal disputes,
  non-payment, or when your domain is subject to deletion

Ie, there is some form of problem with your domain registration rather than with DNS itself.

As for the strange response from the Verizon/Level3 server, try navigating to that address (eg http://22.214.171.124/) and everything about the behavior in combination with how you got that address for no good reason from their resolver servers suggests that it's a search page built with NXDOMAIN hijacking.

As a further sidenote, the way that Wordwide DNS checker have named their service and present the results are quite misleading compared to how the technology actually works.
Geography is not a factor, all the "worldwide" and flags and stuff is irrelevant.
It's actually all about what specific caching servers happen to have in their cache, so unless you know that you or your clients happen to be using the exact same server that they used in their test (they don't say which one they actually used, just a city/country and the name of the ISP in very fine print) it's really just a handful of examples that don't mean a whole lot and definitely don't mean much about the current results in said countries beyond one unspecified caching server of that specific ISP.
Comment: Looking at the domain in archive.org, I suspect you are correct re the clientHold status. I didn't even notice that when I was looking at the whois.
Comment: Thank you for best of comment. I contact name.com for "ClientHold" status. I write the results here. Thanks again
Answer: Running a whois on your domain reveals that you are using vanity nameservers - that is, name servers that are being served from the same domain that they are serving.
To get around this, you must be using glue records, but querying for your glue records (ns1.downvids.net) is returning no records. The reason Verizon is showing some random IP addresses there is because they do this really scummy thing called "nxdomain hijacking" which redirects your failed domain to a search engine or some other page.
The whois also indicates that you did change your domain today:
Updated Date: 2017-02-21T16:49:46Z

We can't tell what you changed, but if it was anything related to DNS, then change it back.
Also name.com did have a DNS outage not long ago, so maybe it's just that they're having another outage.
The reasons some regions of the world are still getting a response for your IP address is either because they have something cached, or because name.com is having an outage that is only affecting certain regions in the world.
Answer: If you change the Records recently, it may take about 24 to 46 hours to propagated around the world.

DNS resolution fails in some countries


Criptografia de parâmetros de requisição GET e POST

Question: Sou iniciante em java e estou estudando java web, principalmente Servlets e JSP. E preciso desenvolver uma aplicação web como trabalho de faculdade, focado na segurança. Pra isso gostaria de encriptografar os parâmetros das URL's (no GET) e também os parâmetros passados no header via POST. Gostaria de fazer isso manualmente, sem uso de HTTPS.
Mas a dúvida é como funcionaria essa arquitetura (chamar classe que encriptografa/descriptografa toda vez que entrar em uma página). Alguém já fez algo parecido? Teria uma dica?
Comment: Se você quer fazer isso com fins de aprendizado, há várias bibliotecas JavaScript que realizam a criptografia, e com o HTML5 há inclusive uma solução nativa - o WebCrypto - que oferece vários algoritmos. Na prática, no entanto, a arquitetura seria complexa e há muitos detalhes chatos, demais pra explicar numa resposta, pra fazer certo demandaria um livro. O HTTPS (HTTP sobre TLS/SSL) funciona porque todos esses detalhes já foram bem pensados e a criptografia funciona a nível de transporte, ou seja, tudo o que é transmitido, inclusive os parâmetros do GET e do POST, já vai encriptado.
Answer: Você utilizaria algum algoritmo de chave assimétrica, e com ele encriptaria a query string do GET ou o corpo da requisição POST usando a chave pública antes de enviá-lo ao servidor (use javascript para fazer isso). No servidor você recupera a informação original descriptografando ela com a chave privada.
Entretanto, eu não recomendo você seguir essa linha para o seu trabalho de faculdade. Isso que você está tentando é apenas uma forma de reinventar uma roda quadrada. Ou seja, uma solução caseira e medíocre para um problema para o qual já existe uma solução muito superior, padronizada e amplamente conhecida.
Comment: @Mehrune Você pode procurar por aí a função de encriptar que você preferir. Procure por criptografia de chave assimétrica em javascript. Entretanto, você só vai poder encriptar a query string da URL, e não a URL completa, senão o navegador não entenderia essa URL e não poderia utilizá-la. O HTTPS já supera todos esses problemas.
Comment: Muito obrigado pela resposta!

Mas existe algum meio simples e já existente de encryptografar a URL no GET ? Esse padrão já existente, você se refere ao HTTPS ?


Backbone pushState routes

Question: I'm trying to deal with backbone.js pushState for change hashtags on pretty urls. Using localhost and the path to my script is http://localhost/test/backbone/test.html.  But each time the click is throwing me to the localhost/login. What am I doing wrong?
var AppRouter = Backbone.Router.extend({
    routes: {
        "login": "getPost",
        "*actions": "defaultRoute"
    }
});

var app_router = new AppRouter;

app_router.on('route:getPost', function (id) {
    alert( "login" );
});

app_router.on('route:defaultRoute', function (actions) {
    alert( actions );
});

app_router.navigate("/login", {trigger: true});
Backbone.history.start({pushState: true, root: '/login/'});

Comment: which `click` and where ?
Comment: possible duplicate of http://stackoverflow.com/questions/16966321/how-to-properly-use-html5-pushstate-in-backbone-js
Comment: `login` Maybe I don't understand something? Should I add handler for click (for example return false or prevent.default for links?)
Answer: You need add:
$(document).delegate("a", "click", function(evt) {
    var href = $(this).attr("href");
    var protocol = this.protocol + "//";

    if (href.slice(protocol.length) !== protocol && protocol !== 'javascript://' &&      href.substring(0, 1) !== '#') {
        evt.preventDefault();

        Backbone.history.navigate(href, true);
    }
});

And last 2 strings should be:
app_router.navigate("/login", {trigger: true}); // <- should remove this string
Backbone.history.start({pushState: true, root:"test/backbone/test.html"});

Backbone pushState routes


Can a model be complicated enough to overfit every validation fold during a k-fold cross validation process?

Question: During k-fold cross-validation, is it possible that a model is so sophisticated (e.g., with many hyperparameters to be grid searched) that it gives a good score on almost every validation fold? It's like the model is intricate enough to somehow leak out to fit the validation set every time (there are k times), essentially overfitting the whole training set (because the sum of the k validation folds is just the whole training set).
If this is possible, then I feel like it's also possible that this best model will eventually have a high generalization error when tested on the final test set, essentially making cross-validation useless. Did I miss anything here?
Answer: I don't think model can "somehow leak out to fit the validation set every time", what however can (and does) happen is that you test many models and choose the one with best score on k-fold. If the models are complex enough and you test many of them, some will fit the validation fold simply by chance.
The model chosen by cross-validation can thus have a high generalization error on completely new data.


How can I throw an exception for an illegal reflective access warning?

Question: How can I throw an exception for an illegal reflective access warning? For example, consider the following code:
import org.apache.commons.lang3.builder.*;

class Test {
    public static void main(String[] args) {
        System.out.println(ReflectionToStringBuilder.toString(Boolean.TRUE));
    }
}

This code prints the following warning to System.err:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.commons.lang3.builder.ReflectionToStringBuilder (file:/Users/brianschack/eclipse-workspace/User%20Libraries/com
mons-lang3-3.7/commons-lang3-3.7.jar) to field java.lang.Boolean.value
WARNING: Please consider reporting this to the maintainers of org.apache.commons.lang3.builder.ReflectionToStringBuilder
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Boolean.TRUE is such a simple value that I don't really need ReflectionToStringBuilder. But more complex types (such as HashMap) print the same warning. I chose Boolean.TRUE in order to simplify this example.
When I searched for this warning message, I found suggestions to report it to the package maintainer, avoid the warning, or disable it altogether (JDK9: An illegal reflective access operation has occurred. org.python.core.PySystemState).
I would like to throw an exception for the warning in order to get a stack trace of where the illegal access occurred. Then I could change the code to avoid the illegal access that caused the warning. I would also like to make a unit test that would check for the warning in the future.
I tried to test for printing to System.err according to the StackOverflow question, JUnit test for System.out.println(). This involves setting System.err to a ByteArrayOutputStream and then examining the contents. But unfortunately, according to How to hide warning "Illegal reflective access" in java 9 without JVM argument?, the IllegalAccessLogger gets a reference to System.err during JVM bootstrap before I can change it.
I also tried closing System.err, but it seems that printing to a closed stream silently fails instead of throwing an exception. Notice that the output for the following code does not contain the string "err-2":
Code:
class Test {
    public static void main(String[] args) {
        System.out.println("Start");
        System.err.println("err-1");
        System.err.close();
        System.err.println("err-2");
        System.out.println("End");
    }
}

Output:
Start
err-1
End

Comment: `--illegal-access=deny` will cause the expected IllegalAccessException or InaccessibleObjectException to be thrown. If you just want the stack traces then `--illegal-access=debug` is what you are looking for.
Comment: I opened an issue in the Apache Commons issue tracker: https://issues.apache.org/jira/browse/LANG-1383
Comment: @AlanBateman Thank you, I will try this command-line argument!
Answer:
Open the Eclipse development environment.
Choose Run menu –> Run Configurations... –> Java Application –> (your configuration) –> Arguments.
In the VM arguments text box, type "--illegal-access=deny" [0].
Click the Apply button.
Click the Run button.
Illegal access will throw the java.lang.reflect.InaccessibleObjectException [1].

[0] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-May/012673.html
[1] http://docs.oracle.com/javase/9/docs/api/java/lang/reflect/InaccessibleObjectException.html
Comment: Keep in mind to set all of the other settings when creating a configuration.  I'm used to running it straight w/out the config.  Looking through the settings I had to set the JRE, directory, Main type, compiler version etc.


clustering based on web pages viewed together

Question: Let us say I know the number of pages users generally looked at in the same session over a period of time. I can obtain data like this:
P1, P2, 1000
P1, P3, 10
P1, P4, 0
P2, P3, 100
P2, P4, 0

Here
P1, P2, 1000

Means that Page1 and Page2 were looked at 1000 time by all users in the chosen time period.
Looking at the tiny sample above one could, for example, deduce that Page4 seems to be disjointed/very distant to the other pages, whereas P1 and P2 are close/similar.
I am just wondering whether the above could somehow be exploited to cluster similar pages. Ultimately, a page pair with a large number corresponds to some closeness.
What clustering algorithm could I use for this? I am only familiar with SOMs/k-means. Any feedback would be very much appreciated. Thanks.
Comment: What is your overall goal, and what is the full dataset available,  eg do you have the pages viewed in each session?
Comment: The overall is to put pages viewed together into the same cluster. Sorry if this is not clear.
Comment: My question was why do you want to cluster the web pages together - if you don't specify that then its hard to identify the correct clustering.
Comment: You tagged your Q as `hierarchical clustering`. What prevents you to consider the option in your Q?
Answer: I would first think of the data as a graph i.e. the edge (P1, P2) would have weight 1000 in your example. You might already be doing this given the way your formatted the question.
After this, there are several graph clustering algorithms and libraries in the world. The Markov Clustering Algorithm seems to be the way to go about this even though I have never done it myself
http://www.cs.ucsb.edu/~xyan/classes/CS595D-2009winter/MCL_Presentation2.pdf
Comment: Thanks. I thought about this as a graph as well. I will have a look.


l1 and l2 regularizations

Question: What do the red ellipses mean to us in the chart below? Does it have a relationship with RMSE values?

Figure 3.11 from Elements of Statistical Learning by Hastie, Tibshirani, and Friedman
Comment: Does this answer your question? [Why L1 norm for sparse models](https://stats.stackexchange.com/questions/45643/why-l1-norm-for-sparse-models) in particular, the answer which includes the exact same diagram
Comment: This is copied from a book or paper apparently, and without knowing the context of the book it's impossible to say.
Comment: See also: https://stats.stackexchange.com/questions/414491/understanding-lasso-regressions-sparsity-geometrically
Answer: The ellipses are the level sets of the loss function, which would be square loss (the loss function in OLS), which looks like an up-opening parabola that is spun around. Here is the equation for the simple linear regression depicted in your image.
$$L(y,\hat{\beta})=\sum_{i=1}^n \bigg( y_i-\big(\hat{\beta}_0+\hat{\beta}_1x_i\big)\bigg)^2$$
Yikes! But it's actually not that bad because:
1) A computer is going to do the heavy lifting.
2) It just means the sum of the squared residuals. (Do you see why?)
The level sets are the shapes formed by intersecting horizontal planes with the function. Think about slicing a bowl this way; it would be a bunch of circles. Now compress the bowl so it's rim is elliptical instead of circular; the slices are ellipses.
Note that L1 and L2 regularization apply in more generality than a regression that uses square loss. You can regularization in GLMs like logistic regression, for instance.
Comment: If there are n points in the validation data, should I consider these ellipses as graphic representation of the residues of these points? I may have asked with mixed and incomplete information, sorry.
Comment: The $n$ refers to the points in the training set  you then find the $\beta$ giving the smallest value of the loss function. (In OLS, that is the familiar $\beta=(X^TX)^{-1}X^T$.) So no, the ellipses have nothing to do with the points in the validation set, and the number of ellipses has nothing to do with the number of points used for training. Are you familiar with either loss functions or multivariable calculus? (Univariate calculus?)
Comment: When I say residues, I actually meant the loss function value. thanks for the explanation and help. Yes, I'm familiar with the topics, but sometimes it can get confused.

l1 and l2 regularizations


How do I hide some fields to registered users?

Question: This is my use case:

If an anonymous user completes an order, the order shows profile type A. When user completes that order, the system creates a new user, and fulfill his profile with the profile2 type A order information.
If a registered user completes an order, it does not show any profile2 information.

I want to make my checkout process shorter for already registered users, and I want for the anonymous users to have a profile filled with the order information.
I get the first part of the use case working (the anonymous user workflow) with the excellent Commerce Order Profile2 Checkout Panes module, but I have no idea on what to do to avoid it appears for registered users. The problem is that the fiels in question are profile fields, so I need to grant registered users permission to view/edit them, and I can't hide them there with field permissions or CSS styles because they wouldn't be available to anonymous users too.
What could I do?
Comment: Why it has been voted negatively?
Comment: I would like to know that too.
Answer: Though I haven't used profile2 for any commerce site, but the mechanism behind the checkout process for asking profile info for anonymous user is to create account for him on site.
If some information in the profile is mandatory then it will be asked on the time of checkout..& register user won't get those fields at time of checkout.
I use address-field for collecting address for shipping as well as billing, which always keep the old address and its possible to make some address default...so that registered user doesn't find it irritating..
If you must have to use profile2 field then please check whether its required field & if it is...then why some registered users profile is not filled with those information...


How can I add a pattern attribute to a phone field?

Question: I am trying add pattern attribute to phone field of drupal's core feedback form. I am trying to do like this in mytheme.theme
function mytheme_form_alter(array &$form, FormStateInterface $form_state, $form_id) {

  if('contact_message_feedback_form' == $form_id){
    $form['field_phone']['#attributes'][] = ['pattern' => '\+[0-9]?()[0-9](\s|\S)(\d[0-9]{9})'];
   }
}

but pattern attribute not showing up (also cleared caches).
I am using 9.1.4.
Answer: Maybe it's not an array, try to use a Attribute object :
use Drupal\Core\Template\Attribute;
if (empty($form['field_phone']['#attributes']) {
    $form['field_phone']['#attributes'] = new Attribute();
}

if (is_a($form['field_phone']['#attributes'], Attribute::class)) {
    $form['field_phone']['#attributes']->setAttribute('pattern', '\+[0-9]?()[0-9](\s|\S)(\d[0-9]{9})');
}
else {
    $form['field_phone']['#attributes'][] = ['pattern' => '\+[0-9]?()[0-9](\s|\S)(\d[0-9]{9})'];
}

Edit:
I checked on a D8 instance I got on my IDE and I managed to have it working with the following code :
$form['elements']['phone']['#attributes']['pattern'] = '#^+[0-9]?()[0-9](\s|\S)(\d[0-9]{9})$#';

You may need to replace 'phone' by the field name you set in the IDE.
Comment: unfortunately it is not working. You can check once try adding `phone` field in website feedback form.


Vue compile ao inserir no DOM

Question: Eu preciso inserir um elemento compilado no DOM, porém ele será inserido em um lugares aleatórios, não em um lugar pré definido como está documentação...
var res = Vue.compile('
{{ msg }}
')
new Vue({
  data: {
    msg: 'hello'
  },
  render: res.render,
  staticRenderFns: res.staticRenderFns
})

Todas as abordagens com v-for, v-if/show não me servirão pois também necessitam de elementos pré-definidos.
tentei algo assim...
document.getElementById('elPai').insertAdjacentHTML('beforeend', Vue.compile('
{{ msg }}
'));

Ele retorna um objeto contendo render e staticRenderFns, porém não achei o resultado compilado nesses objetos, me parece que ele está gravado em uma promisse, que é desencadeada quando o elemento é pré-definido no DOM.
Por fim, há como inserir elementos compilados no DOM com vue 2?
Answer: Consegui resolver
Primeiro de tudo, creio eu que componentes adicionados dinamicamente não conseguem se comunicar aos métodos internos da instância vue mas sim com seus próprios métodos, por fim, para adicionar um componente ao DOM usei $mount...

let comp = Vue.component('comp', {
  template: '
Hello!
',
  methods : {
   alert () {
     alert('hello');
    }
  }
})

new Vue({
 el: '#app',
  methods : {
    replace () {
     new comp().$mount('#test');
    }
  },
  components : {
   comp
  }
})

    test

Referência Andrejs Abrickis Medium

Vue compile ao inserir no DOM


How to put site in 'Safe-Mode' to troubleshoot Drupal if site encounters problem?

Question: If site goes caput. Quite a few modules have been installed. Site was running perfectly fine until you need to upgrade a few dozen modules now. (I have not been updating my drupal site for quite a few months - imagine how many modules needs updating!) Update was ran, site stopped working. I don't know where to start troubleshooting. Site would not even go to admin/structure pages. It just refuses to cooperate.
I feel there should be a way. Like, looking from the database itself what tables should I delete (should I delete module tables? Would this not entertain more problems?), or is there any specific tables I should look at only and safely delete the contents that should force Drupal to run in 'safe-mode'?
I guess there should be a safe-mode option for Drupal in cases like these but if none, what is the best course of action to put it into 'safe-mode'.
Notes:

I have searched in "advise for managing and troubleshooting modules" but this is not enough for me.
"Drupal error. Drupal safe mode possible?" also is closer but I don't know how to use drush or at least as far as I know drush is difficult on windows.
Comment: Look for a PHP Parse error in the server log (syslog). Otherwise restore your site to its original state and do the updates one at a time.
Answer: First of all, I reccomend you install drush. It provides a ton of handy command line operations for Drupal that will allow you to do things if your site goes belly-up.

You should troubleshoot by turning off modules with drush
pm-disable. Look in your error logs to see if any modules in
particular are the culprit.
You can also enable and disable modules in the database, instructions
are here. You can also get some major issues if you move a
module to another location and don't rebuild the module registry,
which can be done with drush rr.
Make a backup of your DB (and in general, ensure backups are made on
a regular basis) before doing anything. Do NOT drop any tables or
delete any rows if you don't know what you're doing!

When doing updates, I would advise that you update each module one at a time in a development version of your site, using drush pm-update. Once the module is updated, run drush updatedb and also drush cc all, then check around the site quickly to make sure no major errors have occured.
Generally it's best to do core, then security updates, then version updates. It's also worth checking the version jump (especially with important modules such as Features, or Context) and making sure there are no drastic changes. As an example, Features 2 recently changed the way it stored field settings and it requires some clean up operations that will have to be done manually.
So take great care when updating modules!


If conditional expectation is equal to unconditional expectation does that mean the random variables are independent?

Question: If $E\left(Y|X\right) = E(Y)$ can we state that $X$ and $Y$ are independent? And vice verse, if $X$ and $Y$ are independent can we state that $E\left(Y|X\right) = E(Y)$?
Comment: See e.g. https://stats.stackexchange.com/questions/188242/for-intuition-what-are-some-real-life-examples-of-uncorrelated-but-dependent-ra/188248#188248 for a related (counter-)example, in that it addresses uncorrelated but dependent random variables.
Answer:
If conditional expectation is equal to unconditional expectation does
that mean the random variables are independent?

Not necessarily.
If $X$ and $Y$ are independent we can say that surely $E[Y|X]=E[Y]$ and $E[X|Y]=E[X]$.
If $E[Y|X]=E[Y]$ we can say that $Y$ is mean independent of $X$ but not necessarily them are completely independent; Indeed it is not implied neither $E[X|Y]=E[X]$.
Comment: Thanks, I found this too https://math.stackexchange.com/questions/2815227/is-there-any-counterexample-to-show-that-x-y-are-two-random-variables-and-ex?rq=1 for mean independent random variables that are not independent.


Why $\limsup_{t\rightarrow s} \frac{B_t-B_s}{f(t-s)}$ is not $\mathcal F_s$ measurable?

Question: Let $(B_t)_{t\geq 0}$ be a Brownian motion equipped with its natural filtraton $\mathcal F_t = \sigma(B_s, 0 \leq s\leq t)$ and let $f$ be a measurable function such that $f(x) >0$ for all $x >0$. Prove that the random variable $\limsup_{t\rightarrow s} \frac{B_t-B_s}{f(t-s)}$ is not $\mathcal F_t$-measurable but $\mathcal F_t^+$-measurable. Here $\mathcal F_t^+ = \cap_{u>t}F_u$.
This is a problem I encountered while reading a book on Brownian motion. I know that it is $\mathcal F_s^+$-measurable by writing
$$\{ \limsup_{t\rightarrow s^+} \frac{B_t-B_s}{f(t-s)} < a \} = \bigcap_{n \geq 1} \bigcup_{k\geq n} \{ B_{s+\frac{1}{k}} - B_s < a f(1/k) \} \in \mathcal F_s^+.$$
But I dont see a contradiction for the first part, any help is highly appreciated. Thank you for your opinions.
Edit: Additional context: I got this from a tutor, who told me that this is not $\mathcal F_s$ measurable but I guess what he meant is "this is not usually" measurable.
Comment: You should write $t \to s+$. $\limsup_{t\rightarrow s+} \frac{B_t-B_s}{f(t-s)}$ is independent of $\mathcal F_s$ and not a constant, so it cannot be $\mathcal F_s$ measurable.
Comment: I forgot to mention another doubt: for example, let $f= 1$ then clearly $\limsup B_t -B_s = 0$ a.s and if we require the continuity of sample paths (not a.s continuity), it is again 0 identically, so $\mathcal F_t$ measurable. What is wrong here?
Comment: You are right about $f=1$. But in general, you don't have measurability.
Comment: That's what im looking for: a counter example. Do you have anything in mind?
Answer: That random variable is not $\mathcal F_s$-measurable in general, even in canonical space. For example, take $f(t) = t$ and let our measure space be the canonical space, i.e,
$$ \Omega = C[0, \infty), \quad B_t(\omega) = \omega_t,$$
and so the filtration $\mathcal F_s$ is generated by the sets of the form $$A_{t_0,...,t_n} = \{ \omega \in \Omega: \omega(t_i) \in B_i, \forall i = 0,...,n \}, \ t_i \in [0,s], \quad B_i \in \mathcal B(\mathbb R ). $$
We will show that the event (for example)
$$\left\{ \limsup_{t\rightarrow s^+}\frac{B_t-B_s}{t-s} \leq 0  \right\} = \left\{ \omega \in \Omega:  \limsup_{t\rightarrow s^+}\frac{\omega_t-\omega_s}{t-s} \leq 0 \right\} =: N$$
is not in $\mathcal F_s$. Indeed, you can show that the sets in $\mathcal F_s$ all have the following property
$$ A \in \mathcal F_s \iff  \big[ f \in \Omega, f(u) = g(u), \forall u \in [0,s] \ \text{for some} \ g \in A \implies f \in A \big]. \quad (*)$$
Now take $ \omega \in N$, we pick one function $f \in \Omega$ such that $ f(u) = \omega(u), \forall u \in [0,s]$ but $ \limsup_{t\rightarrow s^+}\frac{f(t)-f(s)}{t-s} = 1$ (for example) so that $f \notin N$. This shows $N$ does not have the property $(*)$ and therefore it cannot be in $\mathcal F_s$.
For a proof of $(*)$, you can start with proving the collection $\mathcal A$ that contains all subsets of $\mathcal F_s$ that has property $(*)$ is a $\sigma$-algebra and note that it contains $A_{t_0,...,t_n}$ above.


Have can I have a view grouped by nested hierarchy?

Question: I have a nested taxonomy as follows:

Some forms will only have the taxonomy of "Basic Forms", some will have taxonomy of "overtime forms", etc.
So I want my Forms view to look like this example:

How can I get my view to recognize my nested taxonomy?
EDIT TO ADD:
I have made some progress and what I have is repeating the parent taxonomy:

Forms_IT is the parent term-I'd like to start at the next one but can't seem to figure that part out either.
General & Quincy are on the same level.  OT Approval is a subcategory to General but it is not appearing as such and it is repeating the parent and child taxonomy when it lists out the nodes.
This is how I want it:

Any ideas on this?  Is it simply a sorting issue?
7/25 - Edited again to add a pic of my setup and group by.
Answer:
Create a list of all nodes that you want in your Views,
add the field for their taxonomy terms to show where they belong,
add the Parent relatinship for your taxonomy reference field to your Views. You may need to first add the relationship to the taxonomy reference field first, to get the Parent one to show as an option, in which case you'll en up with two relationships, the second one set to use the first one.
Add the Taxonomy Name field and set it to use the Parent Relationship. This field will show the parent term of the one the node is tagged with
Under Format use the "Group by field" option and set the first one to the Parent Field, and the second "Group by field" to the (sub-term) regular taxonomy field.

This should get you fairly close, I can't predict OTOMH where the nodes that have been tagged with only the parent taxonomy.
Comment: Thank you so much.  SInce I made some headway, I edited my original post.  I did basically what you said, and as you say, you couldn't predict how it would display tagged as parent.  It is kind of repeating.  I wish I could leave off the parent taxonomy (Forms_IT) but tried to do that for awhile and couldn't get that either.  Please read my edits and see if you can offer any ideas.  Thanks again.
Comment: apparently there was a similar question awhile back   (https://drupal.stackexchange.com/questions/268386/how-to-create-a-view-of-hierarchical-taxonomy-terms-and-their-nodes) and @kwadz ran into this same problem.  I tried to comment there to see if this person ever resolved but I don't have enough points to comment.  None of the modules suggested have a working version in 8 as far as I can tell either....
Comment: You've changed the question with your edit, you only had 2 levels in taxonomy originally, the edit is showing 3 levels. This means you have to add another Relationship for the grandparent level. The same logic applies. You haven't shown your field and grouping configuration. I think you may need to modify the query manually, sorting has nothing to do with structuring hierarchy so it won't help.
Comment: Thank you so much.  Yes, I decided to paste in my actual example instead of my pseudo-example.  I indeed did have the 3rd level.  I have now added the images so you can see my field and grouping configuration.  Thank you for taking a look.
Comment: Your Views is of the "Taxonomy term" type, while my answer focuses on the "Content" type Views. Maybe your approach is even easier to solve with the term views. But you have too many levels added, the first level isn't Parent, it's the lowest term field and you don't need a Relationship for it. Grouping is then done with Parent 2, Parent 1, and Term fields.


Patch for module applies with patch command but not composer

Question: I have encountered a weird issue in which a patch I rolled for Commerce does not apply with Composer; it gives no errors, but the patch is not actually applied.
  "extra": {
    "patches": {
      "drupal/commerce" : {
        "Allow order types to have no cart": "https://www.drupal.org/files/issues/commerce-direct-checkout-2.2-2810723-37.patch"
      },

However, the same patch applies correctly after downloading and using the patch command:
/web/modules/contrib/commerce$ patch -p1 < ../../../../patches/commerce-direct-checkout-2.2-2810723-37.patch
patching file modules/cart/src/Form/AddToCartForm.php
patching file modules/cart/tests/src/Functional/AddToCartFormTest.php
patching file modules/cart/tests/src/Functional/CartBrowserTestBase.php
patching file modules/product/config/schema/commerce_product.schema.yml
patching file modules/product/src/Plugin/Field/FieldFormatter/AddToCartFormatter.php
patching file modules/product/src/ProductLazyBuilders.php

What is wrong with my patch that makes it fail in Composer?
Comment: That is a weird issue. I added your patch in my composer.json file and it was applied correctly. I noticed that you have a comma at the end of the drupal/commerce patch entry in your composer.json and am assuming you have other patches. Do they get applied correctly with composer?
Comment: @Patrick Kenny if below answer doesn't work for you try to remove /web from patch file when applying with composer since it tries to apply it based on Drupal/core repo
Answer: It turns out this is an issue with Drupal patches for composer when using an older version of Git.  The problem is with composer-patches 1.6.3.
Three possible solutions for now until the bug gets fixed.
Force 1.6.2
In composer.json, specify 1.6.2:
"require": {
"composer/installers": "^1.0.20",
"cweagans/composer-patches": "1.6.2",

Force git clone with 1.6.3
In composer.json, instead of "dist", use "source":
"config": {
    "preferred-install": "source"
  },

Update git to the latest version
Answer: The above didn't work for me but I debugged this issue by running composer install -v for verbosity.
It will show you, for example that it is running the command
patch '-p1' --no-backup-if-mismatch -d 'web/core' < '/my/path/to/patch.patch'

I believe the -d indicates that we are running the patch from the web/core directory. When I look at this patch it looked like:
diff --git a/web/core/modules/quickedit/js/quickedit.js b/web/core/modules/quickedit/js/quickedit.js
index 4548c013a..f930746b3 100644
--- a/web/core/modules/quickedit/js/quickedit.js
+++ b/web/core/modules/quickedit/js/quickedit.js
@@ -170,7 +170,10 @@
   // code here

The a/b indicates the location of the files to patch. Since we are already in the web/core folder, it cannot find the web/core directory inside there and so fails. If we edit those two lines without that in there, it worked. ie
diff --git a/web/core/modules/quickedit/js/quickedit.js b/web/core/modules/quickedit/js/quickedit.js
index 4548c013a..f930746b3 100644
--- a/modules/quickedit/js/quickedit.js
+++ b/modules/quickedit/js/quickedit.js
@@ -170,7 +170,10 @@
// code here


How do I describe the rhythm in these songs?

Question: Pop music, and especially house, seems to be enamored of this beat on top of the "4 on the floor" and the closest I can get to a description of it is "tropical" which is unsatisfactory. I'm looking for a more technical description of this rhythm.
Cheap Thrills (Sia) the electronic marimba? throughout the song (starts at 0:23) -

Where Have You Been (Rihanna), synth at 2:17 -

Shape of You (Ed Sheeran), electronic marimba throughout the song -

The best I can do is say that the subdivision of two beats is 3+3+2 sixteenth notes, but does this very common subdivision have a better name?
Or for the visually inclined, over four beats the asterisks represent accented sixteenth notes:
<code>* . . * . . * . * . . * . . * .
</code>
Answer: This is actually called the tresillo.
There's a lot to check out in that link, from explanations of its origin to its use in various genres. But basically, the tresillo approximates a triplet without actually being a triplet. It's also an instance of a "maximally even" rhythm, which means that, given a particular level of subdivision, the three articulations are as symmetrically spread apart from each other as possible ("maximally even") without actually being completely even.
Edit: Though not a duplicate, be sure to also check out What is this beat and why is it so popular
Comment: That does seem to be it, but there's a surprising (to me) lack of reference to its widespread modern usage in popular music on the wikipedia page.


[Informatica][ODBC 20101 driver][Microsoft SQL Server]Invalid operator for data type. Operator equals minus, type equals varchar

Question: REPLACE(T.FirstName, ' ', '') + '.' +
REPLACE(REPLACE(T.LastName, ' ', ''), '''', '') + '.' + SUBSTRING(CONVERT(varchar(50), T1.Id), 1, 8) +
'@outlook.com' AS 'EmailAddress'

EmailAddress is the one of the column which has above logic. Informatica workflow failing due to conversion with below error. Can any one help me how to handle this.
Source is SQL Server, and target is Oracle
I get this error:

[Informatica][ODBC 20101 driver][Microsoft SQL Server]Invalid operator for data type. Operator equals minus, type equals varchar.
Comment: You are using Oracle or SqlServer  .. ????
Comment: in Oracle concatenation is "||" and not "+"
Comment: SQL server is the source and I need to load data to oracle table. And this email column is from source query. Informatica throwing error for this column. I'm thinking it's comparability issue .
Comment: someone has a hyphenated name?
Comment: i ran this SQL with sample values and its working. Is data a problem?
REPLACE('abcd', ' ', '') + '.' +
REPLACE(REPLACE('pqr', ' ', ''), '''', '') + '.' + SUBSTRING(CONVERT(varchar(50), 'xx'), 1, 8) +
'@outlook.com' AS 'EmailAddress'
Comment: Query runs perfectly fine in SQL server !! When it comes to source qualifier  (I'm using the same sqlserver query in source qualifier).  - informatica throwing the error for this expression.           Sample data in source from this query firstname.lastname@example.com
Comment: This can be ODBC error. To check if this related to ODBC - you can dump data from sql server into a file and use the file to read from. This can also be related to UTF data - like chinese, hindi, french, japnese. To test it, may be keep only 100rows in source and see if thats working. If yes, it means, its a data issue.
Answer: This is not Informatica error. This is an error thrown by MS SQL Server and passes on to Informatica.
This means, the error is thrown by the query. Debug the query on your source system. It seems it some part results in a minus that is then interpreted as substraction by the Query Optimizer.
Answer:  {FN CONCAT( {FN CONCAT({FN CONCAT({FN CONCAT( {FN CONCAT(REPLACE(T.FirstName,' ',''), '.')}, REPLACE(REPLACE(
      T.LastName,' ',''),'''',''))},'.' )}, SUBSTRING(convert(varchar(50),T1.PersonId),1,8))},'@Outlook.com')} AS 'EmailAddress'

Made the changes as above. SQL Server doesnt have any issue with '+' or 'CONCAT'. inforamtica was throwing error for '+' for concatenation in query. Now im able to load the data to Oracle table from SQL Server. Thanks all for the responses and help.


I accidently ran rm -rf /

Question: I was writing a bash script to automate deleting something.
I used the code rm -rf $path/*
accidently i ran the script without passing path variable and since path variable is null , the command which executed was rm -rf /* as sudo, now everything is removed on my server which was hosting more then 150 websites, i have backup of 1 week old . Linux is so big, it must have some workaround for this situation.
Comment: Does this answer your question? [Monday morning mistake: sudo rm -rf --no-preserve-root /](https://serverfault.com/questions/587102/monday-morning-mistake-sudo-rm-rf-no-preserve-root)
Comment: happy Christmas and i am sorry hopefully you have backups, usually you never need -f on most cases
Answer: There are no shortcuts with this. Linux is so powerful because it lets you do anything, including stupid things like removing everything.
You are lucky as you have backups. The next task is to install a fresh server and recover the data from your backups. While it would be possible to try and recover some data using data recovery software, the data on the backups has way better integrity. However, if you might need some data from the old installation anyway, you should not reuse the same disk, but buy a new one.
This will affect your business, so wise communication with your customers is crucial. Do not try and cover up anything. Be honest that there will be some downtime due to human error, and tell that they should not worry, because you had backups. Naturally it would have been better if they were from the last night, instead. After the incident you can revise your backup plans.
Also, when writing scripts, always validate the variables before passing them to rm -rf. There could also have been other errors with your $path causing the same outcome, e.g. rm -rf /some/directory /*, if the variable had a tailing space.
Comment: Any script that invokes `rm` with a variable should really `set -u`. It won't safeguard against set but empty variable but will already catch the most common case of unset variable and/or typos.
Comment: Thanks @Ginnungagap for your advice, i restored my server from backup, will take care of this thing said my you next time writing bash scripts. But can you elaborate what 'set -u' and 'set -i' do in bash script, what will they do when a variable is empty, do they throw any error or something.
Comment: `-u` will `Treat unset variables and parameters other than the special parameters '@' or '*' as an error when performing parameter expansion. An error message will be written to the standard error, and a non-interactive shell will exit.` I don't know what `-i` is.
Answer: If you didn't touch anything much further there's a good chance to recover a lot of data with testdisc/photorec, but this isn't funny. Be sure not to mess around on the hardrive you deleted the files on, cause any time you write something to the disc your old data gets overwritten. The rm command usually just deletes the info of where a file is located on the drive, like erasing the toc of a book an leaving the pages untouched. Therefore your formerly files are now free space for the system.
So mount it seperately for recovery and don't write on it. You can recover a lot of files by photorec/testdisc. Don't be confused by the name photorec, it actually can recover a whole bunch of filetypes and not only photos. But in many cases only the data gets recovered and the filename is lost. So you have to be creative.
You can see a some examples here.
Comment: That's useful for recovering individual files on a personal computer, but not suitable for servers with multiple websites. The structure is as important as the contents. Therefore, restoring from backups is the only real solution to this. File recovery tools might be useful only if something crucial but limited is missing from the latest backup.
Comment: Thanks for your advice, but i restored my backup which was some days old

I accidently ran rm -rf /