Git Objects appears to be quite sparse

Question: I just cloned a repository used to teach a Git course.
There are a lot of files.
C:\udacity-git-project\course-git-blog-project>git ls-files -s
100644 779f99a12b5c71692ad6d6908d6d2fc3bdba485d 0       .editorconfig
100644 60bbd99bef24135db73624cd32bbbcb73f5676a5 0       .eslintrc.json
100644 ebf1b6ef3591e9b76a1e1a25c26401e3e2bebc64 0       .gitattributes
100644 7fbd1b9f6cbac68e0eba136e58c5000d0975c826 0       .github/workflows/manual.yml
100644 370ba7865aae52e2554c61ae14612be8eeffc620 0       .gitignore
100644 37398011dd64092b22bb120c30804b4eb319ab16 0       .htmlhintrc
100644 4c9f58ce3c76f4f1ca394eb00f92ec704210b2a2 0       .stylelintrc
100644 957f44639c661958595fcb986190500493c44428 0       README.md
100644 3cbd0b856634d2ed60e295c0c717c90c87e0855c 0       css/app.css
100644 452a01fd62ba8ca3069f895dfc122d43a2f58950 0       css/normalize.min.css
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       img/.gitkeep
100644 01b90404216bdf242800b864dc89a377c2c33d61 0       img/chasing-the-snow.jpg
100644 3b939d342dd81153cb989d8719902aa09aec4c87 0       img/headerimage.jpg
100644 8aaf2ec26b503240d23c7fadb294687d0c657e6d 0       img/profilepic.jpg
100644 ba03fa8fdf5c562b65127c4aa394e3c0f4d15a42 0       img/seeing-clearly.png
100644 e86eedc5ec5a84414b48863f57c1c2f815637085 0       img/social-google.png
100644 960844320146b0ce43f8aef256e667aad5d0c6ac 0       img/social-instagram.png
100644 6bbd0e143045149de4cb87a61e9b10da63b2c5fc 0       img/social-twitter.png
100644 aed964fe33086765d93a1621b42e1b420d7593ac 0       img/something-to-remember.jpg
100644 368146cdf4b7d5b5af89c980f2aa6027af4358d8 0       img/village-in-the-valley.jpg
100644 5419b8c92479af667a6fd05c7b0f8314597cac63 0       index.html
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       js/app.js

So when I went into .git\objects, I was expecting to see lots of object foders related to these objects.  i.e. a folder for each of the first two characters of all the sha numbers generated.  But I only have a very small number.
I am running Git on windows.
C:\udacity-git-project\course-git-blog-project\.git\objects>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 36E9-84F4

 Directory of C:\udacity-git-project\course-git-blog-project\.git\objects

02/07/2021  12:00    <DIR>          .
02/07/2021  12:00    <DIR>          ..
02/07/2021  12:00    <DIR>          32
02/07/2021  11:59    <DIR>          54
02/07/2021  12:00    <DIR>          a8
01/07/2021  09:15    <DIR>          b7
30/06/2021  16:06    <DIR>          info
30/06/2021  16:06    <DIR>          pack
               0 File(s)              0 bytes
               8 Dir(s)  99,794,542,592 bytes free

Comment: Great, thanks for this.
Answer: The other objects are packed in your .git/objects/pack here. (see doc)
Git periodically packs objects to save space.
Use git verify-pack -v .git/objects/pack/<some_pack> to check contents of a pack.

Git Objects appears to be quite sparse


Android - imagem de ImageButton não é exibida

Question: Estou tentando colocar 3 ImageButton em um LinearLayout. A imagem de fundo que estou utilizando são imagens drawable que adicionei clicando na seguinte sequencia no Android Studio (2.2.2): Botão direito na pasta drawable, new, vector asset e escolho qual o ícone a ser adicionado. Após isso adiciono no arquivo activity_main.xml um LinearLayout e dentro dele adiciono os 3 ImageButton. No meu design do Android Studio fica assim:

Porém quando executo um teste, seja no celular ou no próprio emulador do Android, fica dessa forma, os botões não aparecem. Apenas parte deles é exibida:

Abaixo segue o arquivo acitivity_main.xml
<?xml version="1.0" encoding="utf-8"?>

<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:background="@android:color/background_dark"
android:id="@+id/myMainActivity"
tools:context="com.example.root.dtvplayer.MainActivity">

<FrameLayout
    android:id="@+id/video_surface_frame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:foregroundGravity="clip_horizontal|clip_vertical"
    tools:ignore="true">

    <SurfaceView
        android:id="@+id/video_surface"
        android:layout_width="1dp"
        android:layout_height="1dp" />

    <ViewStub
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout="@layout/activity_subtitles_surface"
        android:id="@+id/subtitles_stub" />

</FrameLayout>

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom">

    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:srcCompat="@drawable/ic_expand_less_black_24dp"
        android:id="@+id/imageButton24"
        android:layout_weight="1" />

    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:srcCompat="@drawable/ic_expand_more_black_24dp"
        android:id="@+id/imageButton25"
        android:layout_weight="1" />

    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:srcCompat="@drawable/ic_youtube_searched_for_black_24dp"
        android:id="@+id/imageButton26"
        android:layout_weight="1" />
</LinearLayout>

Onde estou me equivocando ?
COMO FICOU COM AS ALTERAÇÕES SUGERIDAS
    <?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:background="@android:color/background_dark"
android:id="@+id/myMainActivity"
tools:context="com.example.root.dtvplayer.MainActivity">

    <FrameLayout
        android:id="@+id/video_surface_frame"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:foregroundGravity="clip_horizontal|clip_vertical"
        tools:ignore="true">

        <SurfaceView
            android:id="@+id/video_surface"
            android:layout_width="1dp"
            android:layout_height="1dp" />

        <ViewStub
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout="@layout/activity_subtitles_surface"
            android:id="@+id/subtitles_stub" />

    </FrameLayout>

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:id="@+id/linearLayoutControls">

        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:src="@android:drawable/arrow_up_float"
            android:id="@+id/imgBtnUpChannel"
            android:contentDescription="" />

        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:src="@android:drawable/arrow_down_float"
            android:id="@+id/imgBtnDownChannel"
            android:contentDescription="" />

        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:src="@android:drawable/ic_menu_search"
            android:id="@+id/imgBtnSearchChannel"
            android:contentDescription="" />
    </LinearLayout>

</FrameLayout>

Comment: já tentou colocar uma imagem padrão do android? por exemplo o @android/drawable/ic_menu_add ou colocar uma cor sólida.
Comment: Você está colocando os ImageButton todos no mesmo lugar, ou seja, você esta sobrepondo um embaixo do outro. Acredito que seja isso olhando o código xml.
Comment: Estou colocando os ImageButton dentro de um mesmo LinearLayout justamente para que eles não sejam "encavalados" um sobre o outro. O LinearLayout se encarrega de distribui-los de forma igual.
Se eu fizer exatamente a mesma coisa com botoẽs Button, esse efeito de cortar o componente não acontece. Só acontece com ImageButton. Veja que no designer do Android Studio os 3 botões aparecem por inteiro.
Comment: a propriedade weight se não me engano tem que ser definida no linearLayout que voce abriu antes do imageButton, pois voce está utilizando ela nos image mas não está definindo qual é o total de peso do linearLayout. Não sei se ficou bem esclarecido.
Comment: tenta colocar essa propriedade na tag do LinearLayout... android:weightSum="3"
Comment: Fiz o que você sugeriu Felipe, mas não deu certo. Continuou do mesmo jeito.
Comment: testa com essa proprieade do ImageButton
android:layout_gravity="right"
Comment: faz um teste. Ao invés de você setar o Linear como wrap coloca match e testa
Comment: Se não der certo Emerson usa o RelativeLayout.
Comment: É, com o match não rolou...Vou tentar com o RelativeLayout
Answer: Modifique os 3 app:srcCompat para android:src
Comment: Funcionou Rodrigo. Aplicando a sua sugestão e lendo a resposta do amigo @ramaral consegui o efeito que eu queria. Porém não pude usar o app:srcCompat, tive que utilizar o android:src. Por quê será?


Why are there pairs of wind instruments in a symphonic orchestra?

Question: Why is it so that there are often two identical oboes, two identical clarinets, two identical bassoons and two identical trombones in a symphonic orchestra?
Is it just because one instrument is not loud enough and both are always playing exactly the same line? Or does each one of the pair play different lines?
Comment: Probably would be better worded as "what is the history behind the makeup of a "standard"  symphonic orchestra?"
Comment: Is your question about number of players per part comparing winds to strings? Pairs for the winds, but many more players for the strings.
Comment: @MichaelCurtis - My knowledge about symphonic orchestra is rather limited. Somebody told me in the past that many violins in an orchestra is solely for the sake of volume. So, I just wanted to find out if it was also the case with the winds.
Comment: Tradition plays a big part.  Just like the String Quartet is a standard, but there are pieces written with a second cello added, or a bass added.   Random works exist for mixed string-wind sextets and octets, and so on but the quartet and the trio (violin , cello, piano)  are far more common.
Answer: Both. When they play in unison it's louder. When they play separate lines it's a richer sound. There's also usually two flutes, two trumpets, and four French horns.
And I think the word "identical" might be overstating it. Yes, generally the second chair will be asked or expected to play the same or similar make and model of instrument, but no two instruments or players are identical. Having the slightly different tone between the two instruments adds to the richness of the orchestra.
It's similar to there being two violin sections. And 6-10 violins in each section. They can play together or divisi or one can play solo, etc.
The overall size of the orchestra is to fill the concert hall so everyone can hear in a time before electronic amplification. The relative numbers of instruments create a mostly balanced level across the orchestra, at least within reason.
Studying scores while listening carefully to symphonic works will help make this all clearer. Also going to see live symphonic music would give you a first hand understanding.
Comment: @Aaron If I'm reading the Wikipedia article right, the popularity of pairs of winds and brass comes from Beethoven's specifications for his symphonies. It claims that the standard of four horns comes from his ninth symphony. I can only guess that the romantic composers often used the Beethoven orchestra as their starting point. Certainly by the 20th century things got much more eclectic (e.g., Ravel's Bolero). And for those who don't know, three of each wind and brass and 6-8 horns is common in film scoring orchestras today.
Comment: I cannot believe this answer is voted up so highly when it's almost 100% wrong.  I challenge anyone out there to identify the difference in tone between a Selmer and a Buffet clarinet  (unless radically different mouthpieces are used).      It's easy for a trumpet or French horn, or clarinet  to play over {the entire violin section playing forte} .     Volume balance comes from everyone adjusting their sound level so the music as a whole has the desired balance among all themes & backgrounds written in the score.
Comment: It would be interesting to also explain why there aren't more than two (typically). Two is richer than one, but then why not twelve (as the norm)?
Comment: @Aaron beginning in the mid to late 19th century it was common to have three or more instruments of each woodwind family; the first piece I looked at as a quick sanity check was Parsifal.  Todd, as to the fashion for pairs arising with Beethoven, that can't be right. Look at Mozart's and Haydn's symphonies and at late baroque orchestral works.  They often have winds in pairs.  Even the standard woodwind choir of pairs of flutes, oboes, clarinets, and bassoons predates Beethoven -- See Haydn's London symphonies, written before Beethoven was 5.
Comment: @CarlWitthoft In every symphony that I've reviewed, there are unison passages and non-unison passages for pretty much every wind and brass pair/group except for horns, where rarely do all four horns play unison (although it does happen). So you're right that the entire *parts* are never identical, but there **are** many unison passages. And of course the final balance of the orchestra is created by the playing, not the instrumentation. Also keep in mind that this answer is pitched to the apparent level of understanding of the asker, so I've over simplified many concepts.
Comment: Remember that symphonies are a small part of a symphone orchestra's repertoire.  Having put in many years as a clarinetist (and a bunch more as cellist) I can say that overall unison is not that common.  Parallel thirds or other harmonic matching lines, yes.
Comment: @Aaron I'm sure a lot of orchestras today have a permanent staff sufficient for the majority of romantic and classical works and then on-call lists for special situations. As to why there was no significant orchestral "arms race" between 1780 and 1830 or so, I don't know. There are situations where there **are** more than two, but for reasons I don't really know, Beethoven and Mozart and Brahms all wrote for similar sizes and compositions of orchestras and many popular works can be okayed by fairly similar ensembles.
Comment: That seems a worthy add to the main post, at least under the label of educated guess. It certainly a strong hypothesis that, given the Romantic composers' reverence for Beethoven, they would go with his orchestration.
Comment: @phoog Yeah I was paraphrasing Wikipedia. Perhaps the point that the Wikipedia editor was trying to make is why people didn't go beyond pairs (and four horns) for most of the 19th century?
Comment: No.   The two parts (or 3 or four for trombones, French Horns)  are very rarely if ever the same.
Comment: @CarlWitthoft The requirement to follow the leader on clarinet brand is more political than tonal, from what I understand. That said, I stand by the assertion that no two players sound identical no matter what instruments they use. They will sound identical enough to the audience, and perhaps that's what the asker is getting at, and maybe that's the point you're making. My own (admittedly narrow) literature review suggests that your comment about "the two parts are very rarely if ever the same" doesn't hold up. Or maybe we're saying different things.
Comment: @ToddWilcox  I didn't make any claim about the actual choice of maker in an orchestral setting. Just wanted to state that  any difference in tone is due to mouthpiece and player, not the instrument.  But I doubt there's any such thing going on , seeing as the violin section will have axes from 50 different makers (for 12 players :-) ).   If one trombonist wants a  copper bell I would be shocked if the section or the director disallowed that.
Comment: @CarlWitthoft I've never sat in a professional orchestra as a wind player, but I've read multiple accounts from pros saying they were asked to follow the leader on make. This makes a lot more sense in horns where the wrap can make a clear difference in tone, but I've been told it can apply with woodwinds also. FWIW, I'm also a bit surprised this is currently the highest voted answer. I didn't put a lot of thought or research into it.
Answer: Much (?) more frequently they play different voices; note, that as for all wind instruments only one tone can be produced at the same time. So if the composer desires an additional tone of that same color, there is no choice but to add another player.
The first position typically has a bit more to play, especially in pianissimo he/she may play alone.
(For super-difficult passages the conductor may even instruct the player of second instrument to stay silent in unison passages, since differences are far easier to spot than wrong notes. This, as correctly commented, is no issue for professional orchestras, but applies to student and amateur ensembles.)
Comment: @brilliant One errant note may not be noticed by people unfamiliar with the piece, a wrong note/rhythm may fit into the context of the music and not sound obviously wrong. But if two players playing the exact same line suddenly play something different, it's more obvious that one of them is wrong.
Comment: @brilliant  I agree with you.  What he should have written is that two identical instruments in unison will sound worse when slightly out of tune than two instruments (in unison) from different sections of the orchestra.
Comment: "since differences are far easier to spot than wrong notes" - Can you, please, elaborate on this sentence?
Comment: I suspect your last point may be more true in student ensembles. I would expect this to be less of a problem with professional musicians.
Answer: My understanding is you have enough players per instrument to cover the number of written parts, except for the string which used large numbers of players, not because there were many more written parts, but for the special timbral quality of a large group of strings.
Lots of classical symphonies have just two parts per wind instruments. Two parts meaning two notes to be played simultaneously. So just two players was enough to handle to two written parts.
Strings were different. Especially the violins. Lots of violins were used. Not because there were many more written parts, not for volume, but for timbre. The group sound is "richer", "warmer", also the bow attack become a little softer, more diffused. However you describe it a large group of strings sounds timbrally different that just one string player per part.
You can also think of it in terms of instrumental genres too. The symphonic orchestra is essentially a string orchestra and the winds just augment that string orchestra for timbral color. The large group of strings distinguishes the symphony orchestra from instrumental groupings like a concertino group in a concerto or chamber ensembles like a string quartet. So, many strings versus single string players distinguishes some genres, but the number of wind players doesn't. You only need the number of wind players to fit the number of wind parts.
In my mind that makes the distinguishing factor about how many players per instrument to be mostly about the timbral expectations of various instrumental genres.
Comment: How true -- since a "wind ensemble" aka "concert band"  might have 6 flutes, 6 to 12 clarinets,  and yet only one or two tubas, one bari sax,   and so on.   3 trumpets plus 3 cornets
Comment: This is also why a solo violin sounds different from the ensemble. A great example of this is the first allegro from Vivaldi's _La primavera_, which alternates between duet violins and tutti sections. In a good recording, you can really notice the difference in timbre.
Answer: Reed instruments have keyed pitches.  As opposed to bowed strings (and incidentally, trombones) that means that to a certain degree the pitch relations between instruments with purportedly identical pitch are mostly fixed, but since expressiveness and volume typically impacts pitch as well, expressive melody lines don't add up to a rich complex texture like with violins (also aided by a comparatively rich overtone spectrum) but contain some non-organic semi-systematic beatings.  At the same time, any multiplication of instruments diminishes expressivity by averaging it out.
2 is a compromise that still provides redundancy (and differentiation from a solo voice, even though orchestral woodwinds are all expected to be able to carry a solo, something not to equal degree the case with strings) while not attempting to compose a complex sound texture which does not work all as convincingly with reed instruments as with some others.
I am fuzzy about trombones.


flash game development AS3

Question: I am developing a game in flash AS3 in which multiple items are falling down and have to be caught it at the bottom using the mouse.
just want to brief you regarding the game.
This is the link for similar game  : http://www.playitontheweb.com/games/Catch-Falling-Fruit-game.htm
At frame 1 > Preloader
At frame 2 > Game front page.
At frame 3 > Game introduction.
At frame 4 > user will b playing the game.
At frame 5 > Final Score.

This is what i want to make it in functionality wise.
Here is the script script(AS3) which plays the game in all frames. From 1 to 5 which i dont want: Please help......
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.Timer;
import flash.utils.getDefinitionByName;

public class CatchingGame extends MovieClip {
    var catcher:Catcher;
    var nextObject:Timer;
    var objects:Array = new Array();
    var score:int = 0;
    const speed:Number = 7.0;

    public function CatchingGame() {
        catcher = new Catcher();
        catcher.y = 350;
        addChild(catcher);
        setNextObject();
        addEventListener(Event.ENTER_FRAME, moveObjects);
    }

    public function setNextObject() {
        nextObject = new Timer(1000+Math.random()*1000,1);
        nextObject.addEventListener(TimerEvent.TIMER_COMPLETE,newObject);
        nextObject.start();
    }

    public function newObject(e:Event) {
        var goodObjects:Array = ["Circle1","Circle2"];
        var badObjects:Array = ["Square1","Square2"];
        if (Math.random() < .5) {
            var r:int = Math.floor(Math.random()*goodObjects.length);
            var classRef:Class = getDefinitionByName(goodObjects[r]) as Class;
            var newObject:MovieClip = new classRef();
            newObject.typestr = "good";
        } else {
            r = Math.floor(Math.random()*badObjects.length);
            classRef = getDefinitionByName(badObjects[r]) as Class;
            newObject = new classRef();
            newObject.typestr = "bad";
        }
        newObject.x = Math.random()*500;
        addChild(newObject);
        objects.push(newObject);
        setNextObject();
    }

    public function moveObjects(e:Event) {
        for(var i:int=objects.length-1;i>=0;i--) {
            objects[i].y += speed;
            if (objects[i].y > 400) {
                removeChild(objects[i]);
                objects.splice(i,1);
            }
            if (objects[i].hitTestObject(catcher)) {
                if (objects[i].typestr == "good") {
                    score += 5;
                } else {
                    score -= 1;
                }
                if (score < 0) score = 0;
                scoreDisplay.text = "Score: "+score;
                removeChild(objects[i]);
                objects.splice(i,1);
            }
        }

        catcher.x = mouseX;

    }
}
}

Also would like to ask you can we add a timer in that of 60 sec?
as soon as the timer gets over it goes to the last frame to shaw the final score.
Answer:
call stop() to stay within current frame, call nextFrame() to advance to next scene
global function getTimer() gives you number of milliseconds passed from swf launch, you can measure time with it.
Answer: Use gotoAndStop() to go to the frame you want and stop there. I would recommend that command over stop() simply because it bundles both the frame changing and stop behaviors into one; otherwise they are the same thing.

flash game development AS3


Standard error and explanatory (independent) variables

Question: Can explanatory variables determine standard error of the intercept and the coefficients in a least squares regression? if we have more explanatory variables, standard error is going to be small?
Comment: You didn't answer my question. Standard error of what?
Comment: The standard error of what?
Comment: thank you for the comment. i fitting two multiple regression models and comparing the results. for the first multiple regression model i have 5 explanatory variables and one dependent variable, the result also give me the estimated value, p-value and standard error. for the second multiple regression i used the same variables but here i add two additional significant explanatory variables and i get slightly different results and smaller standard error actually it is obvious to get different results since there is aditional explanatory variables.
Comment: My question is if we have more explanatory variables in the model does it mean the standard error is going to be smaller every time?
Comment: Standard error of the intercept and the coefficients(explanatory variables).
Answer: If the independent variables are uncorrelated, the SEs are not affected, e.g. R code:
set.seed(1234)  #Sets a random number seed

x1 <- rnorm(100)  #Random noise
x2 <- rnorm(100)
x3 <- rnorm(100)

y1 <- x1 + x2 + rnorm(100, 0, 3)  #Only x1 and x2 involved
m1 <- lm(y1~x1+x2)
summary(m1)
m2 <- lm(y1~x1 + x2 + x3) #x3 not involved
summary(m2) #SEs almost identical for intercept, x1, x2

y2 <- x1 + x2 + x3 + rnorm(100,0,3)
m3 <- lm(y2~x1+x2)
summary(m3)
m4 <- lm(y2~x1+x2+x3)
summary(m4)

But, in observational studies, the variables usually are at least a little correlated (and sometimes quite correlated) and here, the SEs are affected:
x4 <- rnorm(100)
x5 <- x4 + rnorm(100,0,5)
x6 <- x5 + rnorm(100,0,5)
y3 <- x4 + x5 + x6 + rnorm(100,0,3)
m5 <- lm(y3~x4+x5)
summary(m5)
m6 <- lm(y3~x4+x5+x6)
summary(m6)


How do I change the base URL?

Question: In Drupal 7, we can quickly change the base URL of the website.
How can I do this, in Drupal 8?
Answer: In Drupal 8 this option has been removed. You don't have to configure  base_url to run your site. Drupal 8 can detect this without your help. If not, you should first check your webserver configuration.
Instead of base_url you should configure trusted_host_patterns in settings.php. This is not needed to run the site, but important for security reasons.
More info: Removed base_url option from settings.php and New setting for trusted hostname configuration
Edit:
There are some special use cases when running drupal from command line or reverse proxy, that used $base_url in the past. This can no longer be supported in the same way because of symfony. There is a discussion going on how to provide a solution for these cases. This does not mean that you cannot run drupal from the command line or reverse proxy. The standard way is of course possible without problems.
You can follow the development here: https://www.drupal.org/node/2753591
Answer: I thought once some kind of tweaks were needed when moving between production (http:// example.com/) and dev (http:// localhost/~aviram/example.com/). But no, D8 is smart enough to fix links automatically.
After moving a complete site (PHP files and DB dump), just go through the D8 database update process (http://example.com/update.php) even if there is no update for the database model. This fixes the problem.
I learned this is a Drupal 8 cache-related problem probably because some pre-rendered content is kept in sites/default/files/php/. And the update.php process somehow cleans this cache.
Comment: Yes, /update.php always clears the cache, even if there are no updates to run. This is a nice trick to get a site running after moving it to a new place, if you don't want or can't access another method to clear the cache.

How do I change the base URL?


Where do I find an icon of a mouse pointer?

Question: I want my WPF application to have a ToggleButton that contains an image of the mouse pointer in it.  The idea is that the user will choose one of three different cursors (the normal mouse cursor, the hand cursor, and a "zoom" cursor) by clicking on a ToggleButton.  I want the cursor image to show on the ToggleButton.
How do I get these icons onto my button?
Tony
Answer: If there are only three options, why don't you search for three images, and check the mouse around the, say, 30 secs and adjust the button, if needed.
Comment: so, google for the images, so you don't have to get them programmatically.
Comment: Yep, that's what I ended up doing.  Thanks


What's the difference between Collection and Fieldset in ZendFramework?

Question: can someone explain me the difference?
Collection can be many fieldsets? And fieldsets is the "collection" of elements?
I'm right?
Comment: Brief questions like this are probably best hyperlinking to the relevant pages in the manual, so readers can be assured you've read the basic definitions. It also helps people to easily find those pages, so they can offer their own interpretations of the material within.
Answer: HTML allows you to group related form fields with the help of the <fieldset> tag, as shown in the example below. The optional <legend> tag allows you to define the caption for the group.
<fieldset>
  <legend>Choose a payment method:</legend>
  <input type="radio" name="payment" value="paypal">PayPal</input>
  <input type="radio" name="payment" value="card">Credit Card</input>
</fieldset>

In Zend Framework 2, the term "fieldset" means the same thing as in HTML - it allows you to define a group of form elements. Moreover, the entire form can be considered as a fieldset.
In Zend Framework 2, the term "collection" is analogous to fieldset,
because it allows you to group related form elements. But, it is designed for adding form elements dynamically by binding an array of objects to the form elements.


NTP Servers Not Syncing At Boot

Question: Backstory: I have a couple of internal startum 1 NTP clocks with GPS receivers, and 2 public NTP servers that are virtualized on top of VMware ESXi which take time from the S1 clocks and distribute it. Otherwise this setup works rather fine and provides good time when compared to other public servers.
Problem:
When I reboot the virtual machines, they do not start syncing properly, and get stuck in an unsynchronised state. Below is the ntpq -p output after a reboot.
root@server:~$ ntpq -p
 remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 192.168.1.40    .GPS.            1 u   27   64    3    1.533  -258.43 5948.73
 192.168.2.40    .GPS.            1 u   24   64    3    1.118  -258.47 6138.19
 192.168.3.42    .GPS.            1 u   24   64    3    0.709  -258.42 5655.02
 126.96.36.199  126.96.36.199   2 u   22   64    3    8.124  -258.74 7131.65
 gbg1.ntp.se     .PPS.            1 u   26   64    3   21.856  -258.43 4876.90
 ntp2.sptime.se  .PPS.            1 u   23   64    3   19.991  -258.42 7764.97
 ntp1.sptime.se  .PPS.            1 u   27   64    3   20.489  -258.41 8574.46

If I then run ntp service restart I get this:
root@server:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 192.168.1.40    .GPS.            1 u    2   64    1    1.517  -258.45   0.065
 192.168.2.40    .GPS.            1 u    1   64    1    1.126  -258.46   0.025
 192.168.3.42    .GPS.            1 u    2   64    1    0.719  -258.42   0.020
 184.108.40.206  184.108.40.206   2 u    5   64    1    8.041  -258.72   0.000
 gbg1.ntp.se     .PPS.            1 u    6   64    1   21.839  -258.41   0.000
 ntp2.sptime.se  .PPS.            1 u    4   64    1   19.968  -258.41   0.000
 ntp1.sptime.se  .PPS.            1 u    3   64    1   20.418  -258.43   0.000

A second later it steps:
root@server:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 192.168.1.40    .STEP.          16 u    2   64    0    0.000    0.000   0.000
 192.168.2.40    .STEP.          16 u    2   64    0    0.000    0.000   0.000
 192.168.3.42    .STEP.          16 u    8   64    0    0.000    0.000   0.000
 126.96.36.199  184.108.40.206   2 u    -   64    1    7.976   -0.261   0.000
 gbg1.ntp.se     .PPS.            1 u    -   64    1   21.840    0.060   0.000
 ntp2.sptime.se  .STEP.          16 u    6   64    0    0.000    0.000   0.000
 ntp1.sptime.se  .STEP.          16 u    6   64    0    0.000    0.000   0.000

And after that we're back to normal operation:
root@server:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 192.168.1.40    .GPS.            1 u    1   64    1    1.474    0.044   0.017
*192.168.2.40    .GPS.            1 u    1   64    1    1.102    0.030   0.005
 192.168.3.42    .GPS.            1 u    1   64    1    0.674    0.049   0.009
 126.96.36.199  220.127.116.11   2 u    8   64    1    7.976   -0.261   0.000
 gbg1.ntp.se     .PPS.            1 u    8   64    1   21.840    0.060   0.000
 ntp2.sptime.se  .PPS.            1 u    6   64    1   19.979    0.059   0.000
 ntp1.sptime.se  .PPS.            1 u    5   64    1   20.440    0.048   0.000

So it seems that after reboot the system clock is off by quite a bit, which is to be expected, but why ntpd doesn't panic and just steps the clock is a bit hard for me to understand.
Here's my ntp.conf
tinker panic 0
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

# Enable this if you want statistics to be logged.
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example

# pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will
# pick a different set every time it starts up.  Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
server 192.168.1.40  iburst
server 192.168.2.40 iburst
server 192.168.3.42 iburst
server time1.mikes.fi
server ntp1.gbg.netnod.se
server ntp2.sptime.se
server ntp1.sptime.se

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust

# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient

Answer: ntpd default step threshold is 0.125 s, and panic threshold after the first packet is 1000 s. In other words, out of design conditions includes an offset jumping by 15+ minutes.
You captured the initial packet, the step, and eventually peer selection. Takes a minute or two to establish, due to how the NTP algorithms work, even if you use the iburst option. Reach of 3   indicates only two packets were received so far. Wait longer, if you are not dropping NTP packets.
If the initial offsets or stepping is not acceptable, you can wait until ntpd or the operating system reports synchronized.  For systemd on Linux, try depending on systemd-time-wait-sync.service.
Comment: @Stuggi, but you should still definitely add the `iburst` option. It should still help to get sync faster than if you don't have it.  Also make sure your ESXi host has a good NTP configuration (and that guest-to-host clock syncing is off) so that the VM has the best possible start.

NTP Servers Not Syncing At Boot


C# Mongo Driver error: Cannot deserialize a 'Int32' from BsonType 'Document'

Question: Following MongoDB query run fine on Robo3T 1.2 and return correct 'count'.
db.runCommand( {
aggregate: "User",
pipeline: [
{$unwind: '$UserSubscriptions'},
{$group: {
    _id: '$_id',
    codes: {$addToSet: '$UserSubscriptions.Subscription.Publication'}
}},
{$unwind: '$codes'},
{$group: {
    _id: '$codes',
    count: {$sum: 1}
}}
]
} )

I m trying to convert above query to C# MongoDriver query like this
 var unwind = new BsonDocument { { "$unwind", "$UserSubscriptions" } };
        var group1 = new BsonDocument
            {
                { "$group",
                    new BsonDocument
                        {
                            { "_id", new BsonDocument
                                         {
                                             {
                                                 "Id","$_id"
                                             }
                                         }
                            },
                            {
                                "codes", new BsonDocument
                                             {
                                                 {
                                                     "$addToSet","$UserSubscriptions.Subscription.Publication.Code"
                                                 }
                                             }
                            }
                        }
              }
            };
        var unwindCode = new BsonDocument { { "$unwind", "$codes" } };
        var group2 = new BsonDocument
            {
                { "$group",
                    new BsonDocument
                        {
                            { "_id", new BsonDocument
                                         {
                                             {
                                                 "Id","$codes"
                                             }
                                         }
                            },
                            {
                                "codes", new BsonDocument
                                             {
                                                 {
                                                     "$sum",1
                                                 }
                                             }
                            }
                        }
              }
            };
        var pipeline = new[] { unwind, group1 , unwindCode , group2 };
    var result = coll.Aggregate<T>(pipeline);

But getting error Cannot deserialize a 'Int32' from BsonType 'Document'.
Id is a primary key in collection
public int Id { get; set; }

Please advise how to achieve this.
(Robo 3T 1.2.1) (MongoDB.Driver 2.4.4)
Comment: Any reason why you are declaring group1 two times, instead of group1 and group2?
Comment: That was typo, edited my question.
Comment: `{ "_id", new BsonDocument { { "Id","$_id" } } }` , should be just `{"_id", "$_id"}`
Comment: @AlexBlex, still getting same error
Comment: btw, the `group2` is very different from `group` stage of the js pipeline
Answer: You are trying to deserialize a BsonDocument to 'Int32' by creating a BsonDocument for "_id". You just need to do this:
var group1 = new BsonDocument
{
    {
        "$group", new BsonDocument
        {
            {
                "_id", "$_id"
            },
            {
                "codes", new BsonDocument
                {
                     {
                        "$addToSet", "$UserSubscriptions.Subscription.Publication.Code"
                     }
                }
            }
        }
    }
};

var group2 = new BsonDocument
{
    {
        "$group", new BsonDocument
        {
            {
                "_id", "$codes"
            },
            {
                "count", new BsonDocument
                {
                     {
                        "$sum", 1
                     }
                }
            }
        }
    }
};


Calculate $z^m + z^{-m},$ if $z^1 + z^{-1} = 2 \cos\phi$

Question: I was given a task to calculate $z^m + z^{-m},$ if $z^1 + z^{-1} = 2  \cos\phi$. I found a similar question, but there were no explanations, so I did not understand the solutions. Please clarify how can I solve this.
I tried multiple approaches but it leads nowhere.
Comment: $z + z^{-1} = 2\cos(\theta) \implies z^2 - 2z\cos(\theta) + 1 = 0.$  Applying the quadratic formula you have that $$z = \frac{1}{2} \left[2\cos(\theta) \pm \sqrt{4\cos^2(\theta) - 4}~\right] = \cos(\theta) \pm \left[i ~\sqrt{\sin^2(\theta)}~\right].$$  Here, the two possible roots represent interchanging $z$ and $z^{-1}.$ Note also that $\sqrt{\sin^2(\theta)} = |\sin(\theta)|.$
Comment: The $z+z^{-1}=2\cos\theta$ equation can be solved.
Comment: Hello welcome to MSE! What have you tried to solve the problem? Edit your attempts into your post.
Answer: From the question we obtain $|z + 1/z| = |2\cos\phi| \le 2$, which yields $z$ is complex. Any complex number can be written as $z = r(\cos \phi + i \sin \phi)$ for some $r >0$. Note that $$z + 1/z = r (\cos\phi + i \sin \phi) + \frac{1}{r(\cos\phi + i \sin\phi)} = r(\cos \phi + i \sin \phi) + 1/r (\cos \phi - i \sin \phi) $$
$$ = (r + 1/r) \cos \phi + i \sin \phi (r - 1/r) = 2\cos\phi $$
Comparing the imaginary parts, we obtain $r = 1$ ($r = - 1$ is not permitted). Hence $z = (\cos \phi + i \sin \phi)$ and finally by DeMoivre we have
$$ z^m + \frac{1}{z^m} = (\cos m\phi + i \sin m \phi) + (\cos m\phi-i\sin m \phi) = 2 \cos m \phi $$
Comment: Great answer! I just have 2 questions. 1) Why is $|z + 1/z| = |2\cos\phi| \le 2$ ?
Comment: 2) Why is $\frac{1}{cosx+sinx} = cosx−sinx$
Comment: @RasadevX Note that $-1 \le \cos \phi \le 1$, thus $|\cos\phi|\le 1$. The rest follows. For the next question, at first, it's either a typing mistake or a conceptual mistake in understanding the solution. *I did not say $\frac{1}{\cos x + \sin x} = \cos x - \sin x$*, what I said was: $$ \frac{1}{\cos x + i \sin x} = \cos x - i \sin x$$ It's fairly easy to see. $$ \frac{1}{\cos x + i \sin x} = \frac{\cos x - i \sin x}{(\cos^2 x + \sin^2 x)} = \cos x - i \sin x $$


Group values into bins and then plot using plotly (R, Dplyr)

Question: I have a dataset, df,  which is telling us that X is the frequency and Category is the 'bin
in which the X value belongs. So X is telling us how many times the Category occurs. (This is a small sample of the actual dataset)
Fig.1
                     Category         X
                     100              5
                     101              10
                     110              20
                     120              5
                     125              2
                     150              1

I created the above output using this code from another dataset that looked like Fig.3
 Fig. 2    df1 <- aggregate(df$gr, by=list(Category=data$Duration), FUN=length)

 Fig. 3     gr             Duration
            Outdata1        100
            Outdata2        101
            Outdata3        110
            Outdata4        120
            Outdata5        125
            Outdata6        150

Here is a sample of my plotly graph:

      p <- plot_ly(data = df,
         x = ~Category,
         y = ~x,
         name = "name",
         type = "bar",
         orientation = 'v'

        )%>%
         layout(
         title = "title",
         xaxis = list(title = "Time in Seconds" , categoryorder = "ascending",tickangle = -45 ),
         yaxis = list(title = "example",
         barmode = "group"
        ))

  [![enter image description here][1]][1]

However, instead of the Category displaying as individual values, I want to group them in 'bins' like a histogram, like this:

So that the Category reveals bins in increments of 10, so the Category would be like:
100 110 120 130 140 150 , vs. 100 101 110 120 125 150
Here is the dput for Fig. 1
   structure(list(Category = structure(c(0, 1, 2, 3, 4, 5, 6, 7,
  8, 9, 10, 11, 12, 13, 14, 15, 19, 20, 21, 22, 23, 24, 25, 26,
  27, 28, 29, 30, 31, 32, 33, 34, 36, 38, 39, 40, 42, 43, 44, 47,
  48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 60, 63, 65, 66, 67, 68,
  69, 70, 71, 72, 74, 77, 79, 80, 82, 84, 87, 89, 90, 91, 96, 97,
  98, 103, 110, 114, 116, 124, 125, 126, 133, 134, 143, 149, 152,
  154, 155, 157, 158, 161, 163, 164, 173, 177, 179, 183, 184, 185,
  189, 190, 193, 196, 198, 201, 207, 211, 214, 217, 227, 229, 234,
  235, 248, 265, 270, 285, 293, 307), class = "difftime", units = "secs"),
  x = c(1L, 1L, 1L, 5L, 4L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 7L,
  2L, 2L, 4L, 3L, 3L, 3L, 1L, 1L, 3L, 1L, 4L, 3L, 2L, 1L, 1L,
  1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 3L, 1L, 1L, 4L, 2L, 2L, 4L,
  1L, 2L, 2L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 3L, 1L,
  1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L,
  1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 3L, 1L, 1L, 1L, 2L, 1L,
  1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L,
  1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L
  )), row.names = c(NA, -118L), class = "data.frame")

Answer: So based on what you are doing, I did not filter for any kind of data. But using tidyverse package, here is what I would do:
dfs %>%
mutate(newvar = as.numeric(gsub(" secs", "", Category)),
new_cat = cut(newvar, breaks = seq(0,round(max(newvar), -1), by = 10), include.lowest = T)) %>%
group_by(new_cat) %>%
summarise(Counts = sum(x)) %>%
ungroup() %>%
ggplot(aes(x = new_cat, y = Counts)) +
geom_bar(stat = "identity")

Comment: Yes that's the 'cut' function
Comment: `geom_bar(stat = "identity", fill = "blue")`
Comment: Ok I will try this, and this is essentially using ggplot to create a histogram with bins that are grouped by increments of 10? thank you!
Comment: This worked! Is there a way to style the color? col = "blue" ??


Failed to parse file highlighted_text_material.xml

Question: I run the app and got this problem every time I do. I've been trying to fix this cus at first, it says failed cus of other failures and I've changed Android Version to

API 21:Android API 21

render and got this error.
Failed to parse file
C:..\AppData\Local\Android\sdk\platforms\android-23\data\res\color\highlighted_text_material.xml

highlighted_text_material.xml is shown below
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:alpha="0.4"
          android:color="?attr/colorAccent" />
</selector>

Has anyone had the same problem?
Comment: I've edited with the xml file...
Answer: If you see the path C:..\AppData\Local\Android\sdk\platforms\android-23\data\res\color\highlighted_text_material.xml, it is using android-23, so you probably need to change the api to 23 and try to compile.
Comment: Right, Got it... Thanks mate. I've fixed some others but just got confused with this silly error... Thanks for the help


Update a team photo with Microsoft Graph PowerShell SDK

Question: I want to update the photo of team with Microsoft Graph PowerShell Cmdlets.
run  Connect-MgGraph successfully, and also Update-MgTeam.
but there is a error when I run Get-MgTeamPhoto
Error:

Get-MgTeamPhoto: The term'Get-MgTeamPhoto' is the name of a cmdlet,
function, script file, or operable program. Not recognized as before.
Make sure the name is written correctly, and if it contains a path,
make sure it is correct Please try again.
Answer: Get-MgTeamPhoto is a part of the "beta" version of the Microsoft Graph SDK API. You have to change your Microsoft Graph profile to the "beta" version before you connect in order to access the beta version of the API:
Select-MgProfile -Name "beta"

PS C:\> Get-MgProfile

Name Description
---- -----------
v1.0 A snapshot of the Microsoft Graph v1.0 API for the Global cloud.

PS C:\> Select-MgProfile -Name "beta"
PS C:\> Get-MgProfile

Name Description
---- -----------
beta A snapshot of the Microsoft Graph beta API for the Global cloud.

PS C:\> Connect-MgGraph
Welcome To Microsoft Graph!
PS C:\> Get-MgTeamPhoto -TeamId 12345678-fa70-419b-1122-7da1246bbda9

Id      Height Width
--      ------ -----
648X648 648    648

Comment: Thank you for your answer.I changed my  profile to the "beta" version,run Get-MgTeamPhoto,not successfully.

Error:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ TeamId = 1d25...ndProperty =  }:<>f__AnonymousType47`3) [Get-MgTeam
   Photo_Get]、RestException`1
    + FullyQualifiedErrorId : Forbidden,Microsoft.Graph.PowerShell.Cmdlets.GetMgTeamPhoto_Get


Mostrar conteúdos diferentes ao selecionar um dos botões

Question: Como posso fazer com que a div troque ao apertar um botão? no caso eu tenho 3 botoes, o primeiro vai fazer com que seja exibida a primeira div, o segundo com que apareça a segunda div e o terceiro fazer com que apareça a terceira div.
Algo parecido com o que isso faz, mas só pode aparecer um por vez, se a div 1, que é a que fica aparecendo por padrao, aparecer, a 2 e a 3 não podem ser exibidas.

$( "#Clique1" ).click(function() {
  $("#opcao1").css("display","block");
});
$( "#Clique2" ).click(function() {
  $("#opcao2").css("display","block");
});
$( "#Clique3" ).click(function() {
  $("#opcao3").css("display","block");
});
#opcao2{
    display:none;
}
#opcao3{
    display:none;
}

    Eu apareço

    Eu irei aparecer se ele sumir

    Eu também irei aparecer se ele sumir

<button id="Clique">troca para a opcao1</button>
<button id="Clique2">troca para a opcao2</button>
<button id="Clique3">troca para a opcao3</button>

http://jsfiddle.net/fjfe3v4g/
Answer: Com html5 veio os atributos data. Acho que se devia aproveitar disso, alterei um pouco o html:

$('.opcao:gt(0)').hide();
$('[data-opt]').on('click', function() {
  var optId = $(this).data('opt');
  $('.opcao').hide();
  $(optId).show();
});

    Eu apareço

    Eu irei aparecer se ele sumir

    Eu também irei aparecer se ele sumir

<button data-opt="#opcao1" id="Clique">troca para a opcao1</button>
<button data-opt="#opcao2" id="Clique2">troca para a opcao2</button>
<button data-opt="#opcao3" id="Clique3">troca para a opcao3</button>

Not que em vez da primeira linha $('.opcao:gt(0)').hide();, pode adicionar no css: #opcao2, #opcao3: {display: none;}
Answer: Você pode deixar display:none para as demais em cada click:

$( "#Clique1" ).click(function() {
  $("#opcao1").css("display","block");
  $("#opcao2").css("display","none");
  $("#opcao3").css("display","none");
});
$( "#Clique2" ).click(function() {
  $("#opcao1").css("display","none");
  $("#opcao2").css("display","block");
  $("#opcao3").css("display","none");
});
$( "#Clique3" ).click(function() {
  $("#opcao1").css("display","none");
  $("#opcao2").css("display","none");
  $("#opcao3").css("display","block");
});
#opcao2{
    display:none;
}
#opcao3{
    display:none;
}

    Eu apareço

    Eu irei aparecer se ele sumir

    Eu também irei aparecer se ele sumir

<button id="Clique">troca para a opcao1</button>
<button id="Clique2">troca para a opcao2</button>
<button id="Clique3">troca para a opcao3</button>
Comment: isso mesmo, obrigado, ainda sou leigo com javascript. Assim que der eu já marco a resposta com correta
Comment: Entendi. De nada :)
Answer: Uma das maravilhas dos seletores CSS ou jquery, é que eles podem ser agrupados, e isso serve para evitar a repetição de código desnecessariamente.
Particularmente eu prefiro sempre trabalhar com classes, mas segue abaixo uma forma de selecionar vários IDs diferentes com um seletor simples:

$("[data-target]").click(function() {
  $("[id^=opcao]").hide(); // ocultar todos os IDs iniciados por opcao
  $($(this).data('target')).show(); // exibir o elemento indicado no atributo data-target
});
#opcao2,
#opcao3 {
  display: none;
}

  Eu apareço

  Eu irei aparecer se ele sumir

  Eu também irei aparecer se ele sumir

<button data-target="#opcao1">troca para a opcao1</button>
<button data-target="#opcao2">troca para a opcao2</button>
<button data-target="#opcao3">troca para a opcao3</button>


For a 3 sets' tennis game, would you bet on it finishing in 2 sets or 3 sets, assuming each player has an equal probability of winning a set?

Question: Obviously the various permutations are:
AA
BB
ABB
BAB
ABA
BAA.
Nevertheless, I'm still confused because I can reason to myself both ways so any help would be much appreciated.
Answer: Assuming each set is independent from those before, we can see, that it doesn't matter, who wins first.
The decision to play a third set will be made, by the end of the second. If the player of the first (whoever that is) has won (which is 50%), the game is over.
If he lost the second set (again 50%) we will see another one.
So the odds for winning this bet are 50-50!

Edit: The number of permutations does not really matter here. You could (if you want to go by that way) extend the two-set-wins by a third set (assuming they played a third set and determined afterwards, that the game was won before that). By that, you will get $AAA$, $AAB$, $BBA$, $BBB$ as two set wins and $ABA$, $ABB$, $BAA$, $BAB$ as games over the whole distance.
Answer: The disjoint-event probabilities are:

$P(AA)=\frac12\cdot\frac12=\frac14$
$P(BB)=\frac12\cdot\frac12=\frac14$
$P(ABA)=\frac12\cdot\frac12\cdot\frac12=\frac18$
$P(ABB)=\frac12\cdot\frac12\cdot\frac12=\frac18$
$P(BAA)=\frac12\cdot\frac12\cdot\frac12=\frac18$
$P(BAB)=\frac12\cdot\frac12\cdot\frac12=\frac18$

Hence:

The probability of a $2$-set match is $\frac14+\frac14=\frac12$
The probability of a $3$-set match is $\frac18+\frac18+\frac18+\frac18=\frac12$

Hence a $2$-set match and a $3$-set match are equally likely to happen.
Answer: Probability of each 2-set game is $\left(\frac{1}{2}\right)^2=\frac{1}{4}$, and probability of each 3-set game is $\left(\frac{1}{2}\right)^3=\frac{1}{8}$.
There are $2$ 2-set games, so probability of 2-set game is $2\cdot\frac{1}{4}=\frac{1}{2}$, and $4$ 3-set games, so probability of 3-set game is $4\cdot\frac{1}{8}=\frac{1}{2}$.
Therefore chance to win this bet is $50\%$, no matter of your choice.


If $C$ is a compact set and $(a,b)$ is any open interval, then $C\setminus (a,b)$ is a compact set.

Question: Is this proof fine or does it lack rigor? Please help me spot mistakes or improve on it. Thanks!
Proof Attempt:
Let $C$ be compact, so it must be closed and bounded due to the Heine-Borel Theorem. Consider the open interval $(a,b)$ and, w.l.o.g., suppose that $C\cap(a,b)=[a,x]$. Then $(a,x]\nsubseteq C\setminus (a,b)$, but $a\in C\setminus (a,b)$. For the sake of contradiction, suppose $C\setminus (a,b)$ is not closed, then $C\setminus (a,b)$ does not contain all its points of closure; that is $\exists$ a point $p$ of $C\setminus (a,b)$ such that $\in(a,x]$, then $a<p\leq x$ which implies $\exists\delta>0$ such that $(p-\delta, p+\delta)\cap C\setminus (a,b)=\emptyset$. So $\forall y\in(a,x]$, $y$ cannot be a point of closure of $C\setminus (a,b)$ ~ a contradiction.
EDIT
Attempt(Direct Approach): Let $U$ be an open cover of $C\setminus (a,b)$ such that $C$ is closed and bounded. Since $U\cup\{(a,b)\}$ is an open cover of $C$. But, $C$ is compact so $U\cup\{(a,b)\}$ has a finite subcover. Knowing that $\{(a,b)\}$ does not cover $C\setminus (a,b)$ then $U$ must be finite.
Comment: $C$ is closed (because it's compact). $C\setminus (a, b)$ is closed, it's intersection of $(a, b)^c$ and $C$, two closed sets. Now, we have a closed subset $C\setminus (a, b)$ of $C$, a compact set. So $C\setminus (a, b)$ is compact
Comment: Why can we suppose that $C\cap(a,b)$ is an interval? What if, say, $C=\left\{\frac1n\,\middle|\,n\in\mathbb N\right\}$?
Comment: Don't use Heine-Borel. The definition of $C\setminus(a,b)$ makes it perfectly suited for a direct argument with open covers
Comment: @TheLastCipher As Adam's argument shows, in general removing an open set $U$ from a closed set $F$ gives a closed set, as $F \setminus U = F \cap U^\mathsf{c}$ is an intersection of closed sets.
Comment: I was thinking of considering a compact set $C$ such that $C\setminus (a,b)$ is not empty
Comment: What has that to do with what I wrote? With my $C$, $C\cap(a,b)$ may well be non-empty.
Comment: No, $C\setminus (a,b)$ is not empty and $C\cap (a,b)$ is also not empty.
Comment: With my $C$, both $C\setminus(0,1)$ and $C\cap(0,1)$ are non-empty.
Comment: I know your question was about checking your proof, but I think it's worth mentioning that there is a one line proof: $C\setminus (a,b)$ is a closed subset of a compact set ($C$) and hence compact itself.
Comment: @Hayden: That is what I saw immediately after seeing the problem, but I am having difficulty showing $C\setminus (a,b)$ is closed.
Comment: Closed subset of a compact set is compact. Try proving it
Comment: @Adam:I already know how to do that. But where do I apply that? Thanks.
Answer: You seem to be assuming that $C\cap (a,b)$ is a closed interval. That is not at all the case. For instance, what if $C=\{1,2,3,\ldots, n\}$ for some $n$? Or $C=\{0,\frac11, \frac12,\frac13,\ldots\}$? Or the Cantor set? As you can see, it doesn't even have to be a union of closed intervals in any nice way. As a general intuition, open sets look "nice", but closed sets can be quite "ugly".
However, if $C$ is closed and bounded, what can you say about $C\setminus (a,b)$? Is it closed? Is it bounded?
You can do it a lot more directly from the definition of compact as well. Let $\mathcal U$ be an open cover of $C\setminus (a,b)$. Then $\mathcal U\cup \{(a,b)\}$ is an open cover of $C$. Can you do the rest?
Comment: +1 Started typing then saw your answer. Lol.
Comment: I want to say that $C\setminus (a,b)$ is closed before I've written this proof attempt. But was unsure how to show.
Comment: @TheLastCipher It's easier to show that $\Bbb R\setminus (C\setminus(a,b))$ is open, using that $(a,b)$ and $\Bbb R\setminus C$ are both open.
Comment: I'll also give the direct approach a try. I'll comment if I have any more problems. Thank you.
Comment: To the proposer: The point of the last paragraph of this Answer is that if $ C$ is a compact subset of any space $X$  and if $U$ is an open subset of $X$ then $C$ \ $U$ is compact.
Comment: @Arthur: Just woke up and added in the direct approach. Thanks!


Como somar elementos do servidor

Question: Ola, gostaria de saber como faço para somar valores que me passam do servidor.
Eu criei um sistema que controla os gastos/contas, você cadastra uma de suas contas.
EX:

Nome: Carro
Valor: R$ 10.000 (por mês)
Vezes: 5
Total: $valor * vezes.(R$ 50.000)

Nome: Casa
Valor: R$ 20.000 (por mês)
Vezes: 5
Total: $valor * vezes.(R$ 100.000)

TOTAL GERAL ...(COMO FAZER ?)
Só que agora eu quero somar o total da primeira 'conta' com o total da segunda 'conta'. Como faço isso ? Código:

session_start();
 include("includes/conexa.php");
require_once 'init.php';
require 'check.php';
$voce = $_SESSION['user_name'];
$id = $_SESSION['user_id'];
include("includes/topotw.php");
echo "$voce e Seu ID: $id";

echo "";
include('includes/conexa.php');
$consulta = $PDO->query("SELECT * FROM  `contas`  WHERE id_pessoa LIKE '%".$id."%'");
    while($linha = $consulta ->fetch(PDO::FETCH_ASSOC)) {
      header('Content-Type: text/html; charset=utf-8');
     Conta: {$linha['nome_conta']}
     Valor: R$ {$linha['valor_conta']}
      Vezes a Pagar:{$linha['vezes_conta']}
      $vl = $linha['valor_conta'];
            $vx = $linha['vezes_conta'];
            $total = $vl * $vx;
            Total:  $total
    }

?>
Comment: Andre Junior, mostra o código
Comment: Ok, vou editar.
Answer: Crie uma variável fora do loop e depois dentro do loop vá somando com cada total, e exiba fora do loop:
<code>session_start();
 include("includes/conexa.php");
require_once 'init.php';
require 'check.php';
$voce = $_SESSION['user_name'];
$id = $_SESSION['user_id'];

$totalGeral = 0;
include("includes/topotw.php");
echo "$voce e Seu ID: $id";

echo "";
include('includes/conexa.php');
$consulta = $PDO->query("SELECT * FROM  `contas`  WHERE id_pessoa LIKE '%".$id."%'");
    while($linha = $consulta ->fetch(PDO::FETCH_ASSOC)) {
      header('Content-Type: text/html; charset=utf-8');

Conta:

{$linha['nome_conta']}

Valor:

R$ {$linha['valor_conta']}

Vezes a Pagar:

{$linha['vezes_conta']}

      $vl = $linha['valor_conta'];
            $vx = $linha['vezes_conta'];
            $total = $vl * $vx;

Total:

 {$total}

$totalGeral += $total;

    }

 TOTAL GERAL: <?php echo $totalGeral;?>
?>
</code>
Comment: Está "funcionando" só que na primeira aparece o erro "Notice: Undefined variable: totalGeral in /home/u603863053/public_html/sistema_conta/contas.php on line 26
"
Comment: Estranho.. Teria como postar o seu código no pastebin.com ?
Comment: https://pastebin.com/V3CRJ1zR

Como somar elementos do servidor


Is weak convergence in $H^1$ invariant by translations?

Question: Let $(f_n)_{n\in\mathbb{N}}\subset H^1(\mathbb{R}^d)$ such that $f_n\rightharpoonup 0$ weakly in $H^1$ and let $(x_n)_{n\in\mathbb{N}}\subset\mathbb{R}^d$. Is it true that $f_n(\cdot+x_n)\rightharpoonup 0$ weakly in $H^1$?.
Edit: if in addition $f_n\rightarrow0$ also strongly in $L^p$, $2\le p<2^*$?
Comment: Welcome to [math.se] SE. Take a [tour]. You'll find that simple "Here's the statement of my question, solve it for me" posts will be poorly received. What is better is for you to add context (with an [edit]): What you understand about the problem, what you've tried so far, *etc.*; something both to show you are part of the learning experience and to help us guide you to the appropriate help. You can consult [this link](https://math.meta.stackexchange.com/q/9959) for further guidance.
Answer: No: Take any function $f\in C_c^\infty(\mathbb{R}^d)$ and $0\neq v\in \mathbb{R}^d$. Define $f_n:=f(\cdot +nv)$, then $f_n\rightharpoonup 0$, but with $x_n=-nv$, the sequence $f_n(\cdot +x_n)=f$ for all $n$.


Problema com configuração de customErrors ASP.NET MVC 4

Question: Preciso configurar um página de erro genérica para o meu site, adicionei o seguinte código no web config:
<system.web>
  <trust level="Full" />
  <customErrors mode="On" defaultRedirect="~/Views/Error/index.cshtml">
    <error redirect="~/Views/Error/index.cshtml" statusCode="500" />
  </customErrors>
</system.web>

Criei o Controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SiteTeste.Controllers
{
    public class ErrorController : Controller
    {

        public ActionResult Index()
        {
            return View();
        }

    }
}

Criei a View:
@{
  ViewBag.Title = "Index";
  Layout = "~/Views/Shared/_Layout.cshtml";
}

Ocorreu um erro durante a requisição.

    Ocorreu um erro interno, por gentileza repita o processo ou @Html.ActionLink("Entre em contato","ContactUs","Home") caso o erro persista.

Porém quando acontece um erro o que aparece para mim é a mensagem:

Error.
An error occurred while processing your request.
Answer: Em seu template padrão, o mvc vai redirecionar o erro para ~\Views\Shared\Error.cshml. Você pode simplesmente substituir essa view pela sua e não precisará mais se preocupar com isso.
Se você olhar no método  Application_Start() verá que existe uma linha chamando
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

Que por sua vez registra o filter
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
  filters.Add(new HandleErrorAttribute());
}

Se você quiser um tratamento diferenciado você pode implementar o seu próprio handler com os tratamentos e direcionamentos que achar pertinente.
Comment: Agora entendi de onde veio essa pagina, porém não resolveu o problema, como alterar essa página. :/
Comment: Você editou a `~\Views\Shared\Error.cshml` ou não conseguiu redirecionar para a sua?
Comment: Eu criei uma View Error


How to define no upper limit in JavaFX's Spinner

Question: I am trying to make a numerical Spinner. I don't want to define a max value. The following code gives me an error because Spinner(int min, int max, int initalValue) does not accept null values.
Spinner<Integer> spinner = new Spinner<Integer>(1, null, 1);

In Swing, I can pass null values for this, how would I do the same in JavaFX?
Answer: Long story short, you can't!
Reasons

The spinner is not designed to take null values. The spinner takes primitive data types as parameters and calls SpinnerValueFactory internally whose constructors, again, accept primitive data-types. You can't pass null to primitive types.
Even if you defined Spinner spinner = new Spinner(), you will have to use setValueFactory() for it to work.

Solution
Your best bet is to use INTEGER.MAX_VALUE in case you are using a SpinnerValueFactory.IntegerSpinnerValueFactory, which IMHO should be enough ;)
Spinner<Integer> spinner = new Spinner<Integer>(1,Integer.MAX_VALUE, 1);

If you need even higher values go with DoubleSpinnerValueFactory.
Comment: This is exactly what I was looking for. This should have been a feature.
Comment: "No upper limit" is somewhat misleading though. If the value is represented by an integer, it can't possibly go beyond `Integer.MAX_VALUE`, and the results you would get if you tried would be unexpected and hard to debug. Better to explicitly state what the maximum storable value is.


How to share React components in monorepo, by source?

Question: I have a monorepo containing 3 different React projects:
- SHARED_COMPONENTS
  src
    Button.tsx
  package.json
- APP_A
  src
    main.ts
  package.json
- APP_B
  src
    main.ts
  package.json

How can I import the Button(.tsx) module from both main.ts files? E.g. I want to define my shared components inside the SHARED_COMPONENTS folder, and use these components inside APP_A and APP_B.
I do not want to compile the Button (and share it with tools like bit.dev or npm registry). I want to include the source file of Button.tsx, and let each individual build script (the ones for APP_A, and APP_B) compile/transpile the source of Button.tsx.
In other words, Button.tsx should become part of the source code of f.e. APP_A. I do not want to include it as a compiled component.
All projects (SHARED_COMPONENTS, APP_A, APP_B) are created with CRA. But if necessary the webpack config can be overridden, or we can eject and go manual.
I believe the main problem is that ../SHARED_COMPONENTS lays outside of the src directory for each individual APP project, and hence we cannot include the source code from shared components.
Are there solutions for this? Links to a guide or a thorough explanation would be much appreciated. I've tried searching extensively but the material I find often suggests packaging the shared components and share them with bit.dev/npm registry, which is what we don't want. We try this at the moment, and it's very cumbersome for the development cycle.
Comment: I would love to know what the latest thinking on this is.
Answer: I have used craco to solve issues like this in the past.
The general idea was to have craco modify the webpackConfig to include the directory of your SHARED_COMPONENTS in babel-loader's setup. You also need to add an alias for your SHARED_COMPONENTS so that you can import them easily. Here is what it might look like:
Follow the directions to install craco from its README:
https://www.npmjs.com/package/@craco/craco#installation
Then install craco-babel-loader. This will help you add files outside of your /src directory for compilation despite CRA's default rules.
npm install craco-babel-loader
Then go to your craco.config.js file and make the following changes
// APP_A/craco.config.js

const path = require("path");
const fs = require("fs");
const cracoBabelLoader = require("craco-babel-loader");

/**
 * CRA has a ModuleScopePlugin that prohibits imports outside of the /src
 * directory. If you have code outside this directory (e.g. components shared
 * between multiple projects) then this becomes an issue. This plugin takes
 * options: {path: "/asbolute-path", name: "alias-you-want"} NOTE: For this to
 * work, the directory that you point to must have a package.json file
 */
const enableImportOutsideSrcDir = {
  overrideWebpackConfig: function enableImportOutsideSrcDir({
    webpackConfig,
    pluginOptions,
    context: { paths, name },
  }) {
    const absolutePath = path.join(paths.appPath, pluginOptions.path);
    const moduleScopePlugin = webpackConfig.resolve.plugins.find(
      (plugin) => plugin.appSrcs && plugin.allowedFiles
    );

    if (moduleScopePlugin) {
      moduleScopePlugin.appSrcs.push(absolutePath);
    }

    webpackConfig.resolve.alias = Object.assign(webpackConfig.resolve.alias, {
      [pluginOptions.name]: absolutePath,
    });

    return webpackConfig;
  },
};

// Handle relative paths to sibling packages
const appDirectory = fs.realpathSync(process.cwd());
const resolvePackage = (relativePath) =>
  path.resolve(appDirectory, relativePath);

module.exports = {
  plugins: [
    {
      // enable compilation for the following directories outside of CRA's /src
      plugin: cracoBabelLoader,
      options: {
        includes: [resolvePackage("../SHARED_COMPONENTS")],
      },
    },
    {
      // now that we're compiling these files, enable importing them
      plugin: enableImportOutsideSrcDir,
      options: { path: "../SHARED_COMPONENTS", name: "sharedcomponents" },
    },
  ],
};

One useful thing to note is that SHARED_COMPONENTS must have its own package.json. This is true even though it has no dependencies and you're directly importing the source files. Otherwise you'll get errors when trying to run npm run start complaining that ModuleScopePlugin threw an error.
I had to repeat this setup for each project. So you'd install craco and the above craco.config.js for APP_A and APP_B.
Answer: I personally plan now to have my APP_A and APP_B together in one react app with a switch close to the root deciding on which one is enabled based on an environment variable. That's after trying to have a go at this same exact problem several times in the last two years.
CRA can't include files outside its project as you mentioned, and as I recall there are whole frameworks being developed by 3rd parties to have JS monorepos working, including React code sharing, but none seemed mainstream and mature enough for me to commit to.
So I will trade bundle size (not a concern for our small web apps) and just have one CRA app.
(I wanted to comment but I don't have enough reputation for it.)
Comment: Just found this blog post describing a solution for this env var based app splitting:
https://blog.logrocket.com/multiple-entry-points-in-create-react-app-without-ejecting/
Comment: And code splitting might even take care of the bundle size problem https://reactjs.org/docs/code-splitting.html
Comment: While the solution I posted below worked, on a new project this was solved using NextJS and Lerna. This allows for importing the source file. In Next each page is its own route and inherently gets its own code splitting as well. Because it's a monorepo you also avoid having to make PRs in separate repos and keep versions in sync.


Utility of the Bayesian Cramer-Rao Bound (van Trees inequality)

Question: In frequentist statistics, one can hardly take a sip of coffee without someone mentioning Fisher information and the Cramer-Rao lower bound. On the other hand, from my limited experience in the field of statistics, the analogous van Trees inequality (sometimes referred to as the Bayesian Cramer-Rao lower bound) isn't mentioned nearly as much.
Is this just my (mis)perception? Or is there some good reason why Bayesians don't care as much about such inequalities? Perhaps it is simply because it is harder to compute?
Answer: I would wager that this has a lot to do with the fact that many Bayesian models do not have tractable posterior distributions so that the van Trees inquality is likely to be of little use. Additionally, a major thrust of Bayesian research over the last 30 years or so has been on Markov chain Monte Carlo (MCMC) methods. MCMC methods are a collection of methods to draw samples from the posterior distribution. With enough of these samples you can calculate the numeric value of any variances you want and do not need to worry about using the van Trees inequality.


General formula for the partial sums

Question: I m having trouble figuring out how to find the general formula for partial sums of the following two series.

$\sum_{i=2}^n \frac{1}{i^2-1} = \frac{3}{4}-\frac{1}{2n}-\frac{1}{2(n+1)}$
$\lim_{n\to\infty} \frac{4n^2 -n^3}{10+2n^3} = -\frac{1}{2} $

Both are in convergence and divergence section in the link at example-2 and example-5 respectively.
Let me know how those are being derived
thanks
Comment: Make it telescopic. Notice that $\frac{1}{i^2-1}=\frac{1}{2}(\frac{1}{i-1}-\frac{1}{i+1})$. You can achieve this by looking for an expression of the form $\frac{1}{i^2-1}=\frac{A}{i-1}+\frac{B}{i+1}$ and then determining $A$ and $B$ by plugging in different values for $x$. Then add and subtract $\frac{1}{i}$ to make it telescopic to calculate the sum. For the second one, factor out $n^3$ in the numerator and the denominator.
Answer: Make it telescopic. For the first one, notice that:$$\frac{1}{i^2-1}=\frac{1}{2}(\frac{1}{i-1}-\frac{1}{i}+\frac{1}{i}-\frac{1}{i+1})$$
This is obtained by noting that $i^2-1$ in the denominator can be factored into two linear terms, namely $i+1$ and $i-1$. Then we assume we have a factorization in the form of:
$$\frac{1}{i^2-1}=\frac{A}{i-1}+\frac{B}{i+1}$$
This gives:
$$A(i+1)+B(i-1)=1$$
which has to hold for any value of $i$. Plug in $i=-1$ and $i=+1$ to see that $A=\frac{1}{2}$ and $B=-\frac{1}{2}$.
This gives
$$\frac{1}{i^2-1}=\frac{1}{2}\left(\frac{1}{i-1}-\frac{1}{i+1}\right)$$
Now this looks very close to our goal. We are just one step away. Add and subtract $\frac{1}{i}$ and you will obtain the desired telescopic form.
For the second one, factor out the highest power and use what you know about limits when $n$ goes to infinity. This is how it's done:
$$\lim_{n\to \infty}\frac{4n^2-n^3}{10+2n^3}=\lim_{n\to \infty}\frac{n^3(\frac{4}{n}-1)}{n^3(\frac{10}{n^3}+2)}=\frac{-1}{2}$$
Note that $n^3$ in the numerator and the denominator are cancelled and you are left with something that goes to zero except for the constant terms.
Comment: For the first one, please let me know the full derivation. i tried but failed. For the second one after factoring out n3, i get  $\frac{\frac{4}{n} - 1}{ \frac{10}{n^3} +2}$ and then as  $\lim_{n\to\infty} $ the result is $-\frac{1}{2} $?
Comment: Hi, Please show me the full derivation of the first one.Thanks
Comment: @user3352074: Yes. You're right on the second one. I added more explanation on how to obtain the first one. Don't hesitate to ask for more explanations if you needed.

General formula for the partial sums


Understanding the Behrens–Fisher problem

Question: This section of this article says:

Ronald Fisher in 1935 introduced fiducial inference in order to apply it to this problem. He referred to an earlier paper by W. V. Behrens from 1929. Behrens and Fisher proposed to find the probability distribution of
  $$ T \equiv {\bar x_1 - \bar x_2 \over \sqrt{s_1^2/n_1 + s_2^2/n_2}}$$
  where $\bar x_1$ and $\bar x_2$ are the two sample means, and $s_1$ and $s_2$ are their standard deviations. [ . . . ]  Fisher approximated the distribution of this by ignoring the random variation of the relative sizes of the standard deviations,
  $$ {s_1 / \sqrt{n_1} \over \sqrt{s_1^2/n_1 + s_2^2/n_2}}.$$

I find that I am disinclined to believe this.  (Hence, Wikipedia is fallible!)  At some point in the next couple of weeks I'm going to read what Fisher and Behrens and Bartlett wrote about this in th 1930s.  For now, I'm looking at Fisher's book Statistical Methods and Scientific Inference.  As with Edwin Jaynes, I'm getting the impression that the fact that he was occasionally an idiot in no way alters the fact that he was a great genius, but he didn't always express himself in the way that was best for communicating with lesser mortals.  On page 97, Fisher writes about Bartlett:

[...]the reference set [...] has not been limited to the subset having the ratio $s_1/s_2$ observed, but was eagerly seized upon by M. S. Bartlett, as though it were a defect in the test of significance of the composite hypothesis, that in special cases the criterion of rejection is less frequently attained by chance than in others.  On reflexion I do not think one should expect anything else,[...]

Thus it seems to me that Fisher did not intend to "ignore" the "random variation of" the ratio $s_1/s_2$ as a means of approximation, but rather, he thought one should condition on $s_1/s_2$.  This does seem like "conditioning on an ancillary statistic", which Fisher employed so successfully in other contexts.
If I recall correctly, I first heard of Bartlett when I read about this in the Encyclopedia of Statistical Science, which said simply that Bartlett was the first to show that fiducial intervals are not the same thing as confidence intervals, by showing that the fiducial intervals that Fisher had derived in this problem did not have constant coverage rates.  That statement didn't leave me with the impression that there was some controversy about this.
So here's my question: Which is closer to the truth: the Wikipedia article or my suspicion?

Fisher, R. A. (1935) "The fiducial argument in statistical inference", Annals of Eugenics, 8, 391–398.
Answer: I may have mentioned this on the site once before.  I will try to find a link to a post where I discussed this.  Around 1977 when I was a graduate student at Stanford we had a Fisher seminar that I enrolled in.  A number of Stanford professors and visitors participated including Brad Efron and visitors Seymour Geisser and David Hinkley. Jimmie Savage had just at that time published an article with the title "On Rereading R. A. Fisher" in Annal of Statistics I think.  Since you are so interested in Fisher I recommend you find and read this paper.
Motivated by the paper the seminar was designed to reread many of Fisher's famous papers.  My assignment was the article on the Behrens-Fisher problem.  My feeling is that Fisher was vain and stubborn but never foolish.  He had great geometric intuition and at times had difficulty communicating with others.  He had a very cordial relationship with Gosset but harsh disagreements with Karl Pearson (maximum likelihood vs method of moments) and with Neyman and Egon Pearson (significance testing via fiducial inference vs the Neyman-Pearson approach to hypothesis testing).  Although the fiducial argument is generally considered to be Fisher's only big flaw and has been discredited, the approach is not totally dead and there has been new research in it in recent years.
I think that fiducial inference was Fisher's way to try to be an "objective Bayesian".  I am sure he thought long and hard about the statistical foundations.  He didn't accept the Bayesian approach but also did not see the idea of basing inference on considering the possible samples that you didn't draw as making sense either.  He believed that inference should be based only on the data at hand.  This idea is a lot like Bayesian inference in that the Bayesians draw inference based soley on the data (the likelihood) and the parameters (the prior distribution). Fisher in my view was thinking a lot like Jeffreys except that he wanted inference to be based on the likelihood and wanted to dispense with the prior altogether. That is what led to fiducial inference.
A Link to the Savage article
The Biography by Fisher's daughter Joan Fisher Box
R A Fisher An Appreciation, Hinkley and Feinberg editors
A book by Erich Lehmann about Fisher and Neyman and the birth of Classical Statistics
This is a link to an earlier post that I commented on that you also posted. Behrens–Fisher problem
In conclusion I think I need to address your short question.  If the statement you quoted "Fisher approximated the distribution of this by ignoring the random variation of the relative sizes of the standard deviations" is what you are referring to I think that is totally false.  Fisher never ignored variation.  I reiterate that I think the fiducial argument was grounded in the idea that the observed data and the likelihood function should be the basis of inference and not the other samples that you could have gotten from the population distribution. So I would side with you on this one.  With respect to Bartlett as I recall from my study of this so many years ago, they also had heated debates on this and Bartlett made a good case and held his own in the debate.


Dificuldade em colocar uma cor na fonte em CSS

Question: Observem o seguinte código:

logo tipo

Home

Home

Home

Home

css
.faxa_menu {
    color:#fff;
    position:relative;
    top:30px;
    background: black;
    filter: alpha(opacity = 27);
    -moz-opacity: .27;
    opacity: .27;
}
.navbar {
    color: #fff;
}
.navbar ul {
    list-style: none;
    padding: 0px;
    margin: 0px;
}
.navbar ul li {
    float: left;
}
.navbar ul li a {
    display: block;
    width: 100px;
    text-align: center;
    text-decoration: none;
}

Não consigo mudar a cor dos links no menu para branco, aceito sugestões. Estou usando Bootstrap.
Answer: Coloca assim:

.navbar ul li a {
    display: block;
    width: 100px;
    text-align: center;
    text-decoration: none;
    color:#fff;
}

Fiz um fiddle para você ver. No fiddle o Home some porque está com o fundo branco, basta marcar o texto que você vai ver que ele ficou com a cor branca, acredito que no seu site, com html completo, ele fica em cima da barra cinza.
Answer: Tenta isso, fiz um teste e funcionou perfeitamente.
.navbar ul li a {
    color: #fff;
}


How to print the last value of every list in a list, python

Question: lets say this is my list
ticket=[['vvip',2,400],['vip',1,150],['side',2,200]]

I want to print the last item of every list in ticket
I know i can just print it like this
print(ticket[0][2],ticket[1][2],ticket[2][2])

but I want it to be in a loop, because the ticket list can have infinite list in the list
Comment: So… have you tried writing a loop?
Answer: Use a list comprehension:
print([item[-1] for item in ticket])


Plot a subtree from a big decision tree

Question: I am working on my thesis using decision trees. I am presenting the resulting tree to show how they help in exploring data. My issue is that since the tree is big, I want to break it down into parts, e.g. print the first 4 levels, then to go deeper. I am using the R package rpart, then plot.rpart(prp)).
I tried coercing the rpart object to party, to print a subtree from a given node - but I did not manage to obtain a nice looking tree with no errors at the terminal nodes. I only want the predicted count to be visible and that the nodes don't overlap.
How can I obtain a nice looking yet error free tree?
library(rpart)
library(rpart.plot)
library("partykit")

reg.tree<-rpart(formula,data=mydata.train,method="anova",cp=0.001)
#AK first coerce the rpart tree to party
pfit <- as.party(reg.tree)

#AK OR Another route is to subset the subtree starting from node 83
#AK and then taking the data from that:
pfit40 <- pfit[83]

plot(pfit40, main = "subtree from node 31",type =  "simple",
    tp_args = list(),
    inner_panel = node_inner,
    edge_panel = edge_simple, ep_args = list(),
    drop_terminal = NULL,
    tnex = NULL, pop = FALSE, gp = gpar(fontsize = 7))

Comment: This question might be better suited for SO.
Answer: One obvious option is, of course, to make the plotting device larger so that all the nodes have enough space on the device. Another possible way to save space is to just show the prediction in the terminal nodes (without the (n = ..., err = ...) part. This is possible through the FUN argument to the node_terminal panel function. For example, you could try:
plot(as.simpleparty(pfit40),
  tp_args = list(FUN = function(info)
    format(round(info$prediction, digits = 1), nsmall = 1)
  )
)

The first line has a similar effect as type = "simple" that you used. However, it also enriches the info available for printing. The second and third line set up the function that computes the information for display in the terminal node. In my example, it just shows the predicted mean (rounded to 1 digit).
(Additional remark: In your particular case it might be worth to explore different specifications of MonthNr/Hour. Currently, these are apparently unordered factors which leads to many splits.)
Answer: Here's an approach using the nodeprune() functiion. BUT it insists on renumbering all the node_ids. Not always desirable!
# to find parents of nodes see "2.5. Methods and other utilities" in https://cran.r-project.org/web/packages/partykit/vignettes/partykit.pdf
#<--- get list of terminal node ids \ get list of all node ids \ get list of non-terminal node ids \
#      loop through non-terminal node-ids \ for each list out its terminal node ids \ if target node id is there, mark that node safe from pruning etc.
#<--- but when pruning off the node_ids not marked safe, do so in *reverse* numeric order so that we won't try to prune a node that is not there!
node_ids_leaves <- nodeids(fit_ctree, terminal = TRUE)
node_ids_all <- nodeids(fit_ctree)
node_ids_not_leaves<-node_ids_all [!(node_ids_all %in% node_ids_leaves)]
node_id_target <- 7
df_prune<-NULL
for(node_id in node_ids_not_leaves) {
  df_prune<-rbind(data.frame(df_prune),  c(node_id, (
                                                    node_id_target %in% (nodeids(fit_ctree[node_id], terminal = TRUE)-1+node_id))
                                                    )
                  )
}
names(df_prune)<-c("node_id","prune_if_zero")
df_prune<-df_prune %>% filter(prune_if_zero==0) %>% arrange(desc(node_id))
fit_ctree_pruned<-fit_ctree
fit_ctree_pruned<-nodeprune(fit_ctree_pruned, df_prune$node_id)
### begin ### experiment to see if original node_ids are preserved as names ------------
nodeids(fit_ctree)
names(fit_ctree)
nodeids(fit_ctree_pruned)
names(fit_ctree_pruned)
# the original node names are not preserved!
### end ### experiment to see if original node_ids are preserved as names ------------
paste("node_id:",node_id_target)
plot(fit_ctree_pruned, main=paste("node_id:",node_id_target)
     , terminal_panel = node_barplot(obj=fit_ctree_pruned, id=FALSE , fill = c("blue","dark grey")      )
    )
# sadly, the node_ids in the plot are re-numbered. https://cran.r-project.org/web/packages/partykit/partykit.pdf

Comment: Thank you @rwinkel2000, I am actually writing a paper based on my thesis so this will be helpful.

Plot a subtree from a big decision tree


Sobre fallback para CDN

Question: Algumas pessoas recomendam utilizar a seguinte técnica (fallback) para carregar bibliotecas Javascript localmente caso o CDN esteja fora do ar:

A minha dúvida é: Se o CDN estiver mesmo fora do ar, o navegador não vai demorar vários segundos até considerar timeout e carregar a versão local? Isso tornaria a navegação lenta, pois a cada mudança de página ele tentaria novamente.
Answer: Na maioria dos tipos de downtime, sim, ficará lenta a página, mas ao menos funcionará.
Se o downtime for do tipo que responde rapidamente a indisponibilidade, como por exemplo, um erro interno, isto se resolverá rapidamente.
Quando ocorre downtime de servidores google, é muito comum vermos serviços como compra de passagens aéreas deixando de funcionar, então, o seu fallback é bem válido, como medida de contenção de danos.
Comment: Fora que a grande aposta ao se usar CDN é que o arquivo já exista em cache no browser, então o downtime pode acabar nem sendo notado.
Comment: o 2o script pode apontar para um outro CDN tbm ````

Sobre fallback para CDN


PHP Permission denied in PrestaShop, not even chmod 777 working

Question: i have problem with permissions.
I getting error
PHP message: PHP Warning:  require(./public_html/shop/modules/dhlexpress/vendor/alfallouji/dhl_api/DHL/Entity/AM/GetQuote.php): failed to open stream: Permission denied in ./public_html/shop/modules/dhlexpress/vendor/alfallouji/dhl_api/vendor/autoloadManager/autoloadManager.php

I tried to set 777 recursive for whole dhlexpress folder. Also i tried to set 755 for folders and 644 for php files. Same error.
Owner of all files is ok.
Dump from ls -al for ./public_html/shop/modules/dhlexpress/vendor/alfallouji/dhl_api/vendor/autoloadManager/:
drwxrwxr-x 2 master_qfremheqwx www-data  4096 Aug 23 07:29 .
drwxrwxr-x 3 master_qfremheqwx www-data  4096 Aug 23 07:29 ..
-rwxrwxrwx 1 master_qfremheqwx www-data 13945 Jan  6  2017 autoloadManager.php
-rw-rw-r-- 1 master_qfremheqwx www-data  3755 Jan  6  2017 README.md

Dump from ls -al for ./public_html/shop/modules/dhlexpress/vendor/alfallouji/dhl_api/DHL/Entity/AM/ :
drwxrwxr-x 2 master_qfremheqwx www-data  4096 Aug 23 07:30 .
drwxrwxr-x 6 master_qfremheqwx www-data  4096 Aug 23 07:30 ..
-rw-rw-r-- 1 master_qfremheqwx www-data  2137 Jan  6  2017 GetQuote.php

I am hopeless. That permissions is killing me.
EDIT:
I also tried to set 777 for whole dhlexpress folder and sub-folders and files.
dhlexpress folder:
777 -rwxrwxrwx 1 master_qfremheqwx www-data 30134 Aug 23 21:51 dhlexpress.php
777 drwxrwxrwx 4 master_qfremheqwx www-data  4096 Aug 24 08:44 vendor

dhlexpress/vendor/alfallouji/dhl_api/DHL/Entity/AM/ folder:
777 -rwxrwxrwx 1 master_qfremheqwx www-data  2137 Jan  6  2017 GetQuote.php

dhlexpress/vendor/alfallouji/dhl_api/vendor/autoloadManager/ folder:
777 -rwxrwxrwx 1 master_qfremheqwx www-data 13945 Jan  6  2017 autoloadManager.php
777 -rwxrwxrwx 1 master_qfremheqwx www-data  3755 Jan  6  2017 README.md

Answer: can you require file in 'modules' folder?
may be php don't have permission for 'modules' folder
Comment: Hi, that would be strange, in modules folder  are another 40 modules for prestashop which works just fine.
Answer: Try changing the permissions from the modules folder or even better from the public_html, most servers works perfect with permissions as:

Folders: 0755
Files: 0644
Comment: Did, without efect. Strange is i have on same server another clone of this app with this same module. With same permissions, same owner, same group . And there its working.
Comment: Then maybe it could be something in the code directly in the module, since I suppose one store is in a sub-folder and the other not, because if they are cloned stores the only things that change are the paths.
Answer: Okay, done. Problem was in my autoloader from developer. I manualy make bunch of require_once and now its working
Answer: For modules and files you need to put the rights in this form:
755 for directories/folders
644 for files


Alternate method to use mysql date_sub(now(),interval 1 day) in php?

Question: Alternate method to use mysql date_sub(now(),interval 1 day) in php?
Actually I want this alternative because in zend where clause second parameter is date_sub function and it is taking it as string.  Below shows exact query
->where("FROM_UNIXTIME(qnas.cdate,'%Y-%m-%d %h:%i:%s')>?" ,"date_sub(now(),interval 1 day)");

second parameter date_sub(now(),interval 1 day) is mysql function to show record greater than previous day date.
Answer: ->where("FROM_UNIXTIME(qnas.cdate,'%Y-%m-%d %h:%i:%s') > DATE_SUB(NOW(), INTERVAL 1 day)");

If the value is not a user supplied parameter, there's no point in trying to bind it like one. Just write it into the query. Also, if your cdate column is any sort of date/time column, you don't need the FROM_UNIXTIME conversion.


Get taxonomy terms page based on exposed filters value

Question: I've created two taxonomy vocabs: Language and Genre. LANGUAGE consists of the following terms: English,Spanish,French,etc and GENRE consists of Rock,Pop,etc.
Am using the taxonomy term page view with exposed filters for language and genre.
When am in a page that list all songs under the term english, the filter for genre and language also appears. All good till here.
Now, If i select spanish from the filter..i want the term page to reload and show the relative results.
 How can i work this out???
Comment: Take a look at this, I did something similar to what you're asking. If it helps upvote please. http://drupal.stackexchange.com/questions/31906/related-terms-block-based-on-terms-fields
Comment: not even close...neways thanks for the reply man..
Answer: It will be easier if you will use just one vocabulary. Smt like this:
English
- Rock
- Pop
- etc.
Spanish
- Pop
- Rock
- etc.

Then you can use hierarchical_select module to filter exposed lists automatically.
If you can't change vocabulary structure, you should use hook_form_alter() ...
Comment: with my structure if i list songs with rock term all rock songs from all languages will get displayed...yeah your structure won't do but did gave me a different approach, will be helpful in some other project...Well was hoping there must be some module to magically do that...thanks


Table of 2D and 3D Fourier transforms

Question: There is good book "Tables of Integral Transforms" by Bateman & Erdélyi where a lot of commonly used Fourier integrals are collected.
Is there a similar comprehensive collection of 2D and 3D Fourier transforms of functions occurring in physics and mathematics?
Update:
Below I give a few examples of Fourier transforms, which (and similar to which) I was hoping to find.
$$
\frac1{\omega^2-k_x^2-b^2},\;\;\;\;
\frac1{\omega^2-k_x^2-k_y^2-b^2}, \; b\in\mathbb{C}
$$
$$
\exp\left\{{\rm i} z \sqrt{\omega^2 - k_x^2}\right\}, \;\;\;\;
\exp\left\{{\rm i} z \sqrt{\omega^2 - k_x^2 - k_y^2}\right\}
$$
The Fourier transform here is to be calculated with respect to $\omega$, $k_x$ and $k_y$.
All these integrals can be calculated and have quite simple closed form.
Answer: For 2D and 3D transforms of functions with radial symmetry, the Fourier transform reduces to a Hankel Transform which is one dimensional in the radial variable.  See the first part of this answer https://math.stackexchange.com/a/3029986/441161 and https://en.wikipedia.org/wiki/Hankel_transform .  Chapter VIII of the book you reference has tables of Hankel Transforms.
For 2D and 3D transforms with no special symmetry, the Fourier transform is taken by treating each cartesian coordinate variable separately.  So again a table of 1D Fourier transforms will usually suffice.
In Bracewell's book The Fourier Transform and Its Applications, Bracewell does have a chapter where he discusses the multi-dimensional Fourier Transform, its relation to the Hankel Transform, and a small selection of 2D Fourier Transform examples depicted graphically.
Comment: Indeed, the table of 1D Fourier transforms is usually suffice. However, usually it takes quite some time to make the derivations. I was hoping that somewhere commonly occurring integrals (like the ones I presented in the updated question) are collected together.
Answer: Based on Andy Walls' answer I threw together some Mathematica code to implement the Fourier transform of a radial function as a Hankel transform.
f[r_] := 1/r
n = 2;
(2 \[Pi])^(n/2)/k^(n/2 - 1)
  HankelTransform[f[r] r^(n/2 - 1), r, k, n/2 - 1]

Here I used the conventions from the wikipage on Hankel transforms for which the Fourier transform reads
$$F(\mathbf k)=\int_{\mathbb R^n}\mathrm d\mathbf rf(\mathbf r)e^{-i\mathbf k\cdot \mathbf r}$$
This means the code above is equivalent to
FourierTransform[1/Sqrt[x^2 + y^2], {x, y}, {kx, ky},
 FourierParameters -> {1, -1}]

Note that for $n=3$ the regular Fourier transform is so slow it doesn't seem to evaluate but the Hankel transform evaluates instantaneously. Also I checked if everything works but if you catch any errors please let me know.

Update: I modified the function so it works with a more general Fourier transform (that handles all the conventions)
$$\hat f(\mathbf k)=\left(\frac{|b|}{(2\pi)^{1-a}}\right)^{n/2}\int \text{d}^n\mathbf x\, e^{ib\mathbf k\cdot\mathbf x}f(x)$$
in accordance with [the Mathematica definition of Fourier parameters][2]
The updated code is now
Options[RadialFourierTransform] = {FourierParameters -> {1, -1}}
RadialFourierTransform[expr_, r_, k_, n_Integer,
  opts : OptionsPattern[]] :=
 With[{a = OptionValue[FourierParameters][[1]],
   b = OptionValue[FourierParameters][[2]]},
  (2 \[Pi])^(n/2)/q^(n/2 - 1) (Abs[b]/(2 \[Pi])^(1 - a))^(n/2)
       HankelTransform[expr r^(n/2 - 1), r, q, n/2 - 1] /. q -> b k //
     Normal // Simplify
  ]

How to use:
RadialFourierTransform[1/(\[Omega]^2 - r^2), r, k, 3,
  FourierParameters -> {1, -1}] // FullSimplify

Output:
$$\frac{2\pi^2\cos k\omega}{k}$$
Comment: The code in the updated section may contain errors (like sign errors) so use at your own caution.

Table of 2D and 3D Fourier transforms