Does $(\pm(5\cdot\frac{4}{5}), 0)$ indicate the points $(4,0)$ and $(-4,0)$?

Question: Can I write $(\pm(5\cdot\frac{4}{5}), 0)$ to indicate the points $(4,0)$ and $(-4,0)$? Is putting brackets inside of the brackets indicating an ordered pair allowed, i.e I'm asking if putting brackets around $5\cdot\frac{4}{5}$ in $(\pm(5\cdot\frac{4}{5}), 0)$ allowed or not.
It'd be awfully helpful if I was allowed to write like this.

Related
Comment: yes, no problem here.
Comment: *Why* do you want to do that?!
Comment: @Logic presumably as part of a larger computation (i.e. presumably OP is asking if $(\pm (5\cdot 4/5) , 0) =(\pm 4,0)$. To which the answer of course is yes)
Comment: Strictly speaking, $(\pm4,0)$ indicates two *possible* points, and if $P=(\pm4,0),$ then $P$ is not (simultaneously) $(4,0)$ *and* $(-4,0),$ but rather $(4,0)$ *or* $(-4,0).$
Comment: @Logic I was finding the foci of an ellipse.
Answer: That's allowed. You can use parentheses wherever you like to group arithmetic operations. That said, it's hard to parse. It would be easier if you were not also using parentheses for the vector.
In this particular case, $\pm(4,0)$ or $(\pm4, 0)$ would be much better.
In general, your goal choosing notation should be to help your reader.
Comment: I was put off initially by your usage of the word "vector". After some digging, I've come to know that vectors and points are the same [thing](https://math.stackexchange.com/q/645672/768162).
Answer: Formally speaking yes it is fine, indeed $(\pm5\times4/5,0)=(\pm4,0)$, but the former is unclean and unorderly, so writing in the simplest form is always the cleanest, unless of course you are showing in some computation that the former is the same as the latter, in which case it's an explanation for the reader.


Para que serve exatamente o Model em uma aplicação PHP?

Question: Uma classe Model pode ser usada para armazenar as colunas de uma tabela do banco de dados?
Ou ela apenas armazena os métodos para a regra de negócio? Se ela não armazena as colunas, qual a parte da aplicação responsável por armazenar as colunas de uma tabela?
Comment: https://pt.stackoverflow.com/questions/55486/o-que-%c3%a9-mvcmodel-view-controller
Comment: Leia minha pergunta, o título foi apenas para chamar atenção, os links que você forneceu não me ajudam a responder a minha dúvida específica, eu quero saber o que está no corpo da pergunta.
Answer: O model é a parte que tem que ter a lógica de Modelo de dados, independente se for uma base de dados SQL , NoSQL, Graph etc.
O model não deve ter regras de negócio , isso pertence a camada controller,  no caso mais simples ela serve como uma representação do modelo de dados no banco, então vamos dizer que temos a Tabela Products contendo as colunas Id,Name,Price um model dessa tabela seria a classe ProductsModel com as propriedades Id,Name,Price.
Num mundo ideal você poderia simplesmente trocar forma de persistencia (SQL, NoSQL, Graph , Arquivo TXT)  e esse model conseguiria funcionar normalmente - mas em geral isso não é assim.


How do I provide one-time access to a downloads page to anonymous users?

Question: Our company wants to have a secured downloads area for software.  We want to send a link to a customer via email, after they have purchased a license for the software.  We don't want to create a site account for every customer; we just want them to click the link to get one-time access to the downloads page.  All the modules I have seen for one-time use links either assume that the link is something used for password reset, etc., or the module is not ready for prime-time.
Any ideas?
Thanks!
Answer: You need write a module to do this job,
I wrote a module that do something like this ( count download times )
<code><?php

/**
* Implements hook_menu();
*/
function bicuk_downloadounter_menu() {

    $items=array();
    $items['download/%']=array(
        'title' => 'increase Download counter ',
        'description' => t('callback url for increse Downloading count'),
        'page callback' => 'downloadcounter_tickup',
        'page arguments' =>array(1),
        'type' => MENU_CALLBACK,
        'access callback' =>true,

    );
    return $items;
}

/* call back function to increase counter
 * @param $fid , file id
 */
function downloadcounter_tickup($fid){

   if(!is_numeric($fid))
              drupal_goto();
   $file=file_load($fid);
   if(!isset($file->fid))
            drupal_goto();
   $acceptable_ext=unserialize(variable_get('bicuk_downloadounter_valid_extensions'));
   $file_path=file_create_url($file->uri);
   $pathinfo=  pathinfo($file_path);
   $extension=$pathinfo['extension'];
 if(!in_array(strtolower($extension), $acceptable_ext))
             drupal_goto();
   $query=  db_select('bicuk_downloadcounter_counter','bdc')->fields('bdc',array('count'));
   $query->condition('fid',$fid, '=');
   $count=$query->execute()->fetchField();
if($count)
{
    $query=  db_update('bicuk_downloadcounter_counter')->fields(array('count'=>$count+1));
    $query->condition('fid',$fid, '=');
    $query->execute();
}
else
  {
    $query=  db_insert('bicuk_downloadcounter_counter')->fields(array('name','count','fid'),array($file->filename,1,$fid));
    $query->execute();
  }
   drupal_goto($file_path);
}

/**
 *
 * @param type $fid fid
 * @return type int count
 */

function downloadcounter_get($fid){
   $query=  db_select('bicuk_downloadcounter_counter','bdc')->fields('bdc',array('count'));
   $query->condition('fid',$fid, '=');
   $count=$query->execute()->fetchField();
   return $count;
}
</code>
you can  get idea from this code to achieve your job,instead of counting download time try to check downlading time by IP and do your limitation
Comment: Thanks ! Did you have to create new tables/databases to activate this ?
Answer: No need to write a new module. One of the modules that I referred to as "not ready for prime-time" is a module called "Deep link". I had said that because there seemed to be some bugs with the use of one-time-only links. After looking at the code for a few days, I was able to fix a couple issues and submitted patches back to the project page. The module now works well enough to suit my purpose, and I would recommend it!


An Example Of A Banach space.

Question: Consider the linear space $\mathcal{L}_\infty$ and let $x\in\mathcal{L}_\infty$ where $x=(a_1,a_2,...,a_n)$ and taking the norm of $x$ to be $\sup x_i$.   My questions are:
1). When defining $x$ in this space, is it $x=(a_1,a_2,...,a_n,...)$ or is it as it is above?
2). In showing that the norm is actually a norm, how can I show that the supremum of a sum is less than or equal to the sum of supremum.
Comment: To "show that the supremum of a sum is less than or equal to the sum of supremum" you would use the definition of supremum.
Comment: What do you mean by "is it as it is above"?
Comment: I mean in this space, how can $x$ be defined, is it $x=(a_1,a_2,...,a_n)$  or $x=(a_1,a_2,...,a_n,...)$?
Comment: In most cases I'm aware of, it is the second, i.e., $x$ is an infinite sequence.
Comment: Ok. Any help on the second question?
Answer:
The elements of $\ell_\infty$ are infinite sequences.
To show $\|x+y\|_\infty\le \| x\|_\infty+\| y\|_\infty$, use the following strategy:
a)  for every $n$, $|x_n|\le \| x\|_\infty$ and $|y_n|\le \| y\|_\infty$.
b) Use the above to estimate $|x_n+y_n|$.
c) Now you have an upper bound for $|x_n+y_n|$; the supremum is less than or equal to an upper bound.

An Example Of A Banach space.


Simple joint probability distribution table calculations

Question: Given this joint probability distribution table
     |   A   |   B   |   C
X    | 0.15  | 0.03  | 0.07
notX | 0.05  | 0.25  | 0.45

I've to calc the following probabilities
P(B or X) = ?
P(C or notX) = ?

So far I got this solution:
P(B or X) = 0.15 + 0.03 + 0.07 + 0.25
P(C or notX) = 0.07 + 0.45 + 0.05 + 0.25

but I'm very unsure...
Comment: I agree with Jonathan. What you did to compute P(B or X) was to take P(X and A)+P(X and B) + P(X and C) to get P(X).  Then you need to count all the probabilities associated with B occurring but not X ( you do this to avoid double counting). That is the term with the value 0.25. You use the same idea for the second probability.
Comment: This looks fine to me, though this isn't so much a question as it is procedural confirmation.
Comment: ok, sorry for that!
Answer: By addition theorem of probability,
P(A U B) = P(A) + P(B) – P(A ⋂ B)
U denotes union of events, and ⋂ denotes intersection of events.
In other words,
P(A or B) = P(A) + P(B) – P(A and B)
So, your calculations are correct. Here's the proof
P(B or X) = P(B) + P(X) - P(B and X)

          = (0.03 + 0.25) + (0.15 + 0.03 + 0.07) - 0.03

          = 0.15 + 0.03 + 0.07 + 0.25

Similarly,
P(C or not X) = 0.07 + 0.45 + 0.05 + 0.25


Ng-repeat passando um numero

Question: Quero montar um select cujos os options serão gerados por um ng-repeat, mas para isto quero passar um numero, por exemplo se eu passar o numero 5 na variável vão ser montados 5 options com valores 1,2,3,4,5.
<md-select ng-disabled="!novoCadastro.curso" required ng-model="novoCadastro.periodo">
 <md-option ng-value=""></md-option>
 <md-option ng-value="periodo" ng-repeat="periodo in novoCadastro.curso.periodo">{{periodo}}</md-option>
</md-select>

No meu novoCadastro.curso.periodo vai ser onde eu irei declara um numero.
Answer: Não é uma boa prática o value ser gerado dinamicamente. Aconselho criar uma lista de dicionários ou de tuplas e indicar o value e o text.
// dicionario
novoCadastro.curso.periodo = [{1: 'Primeiro'}, {2: 'Segundo'}, ...];
// ou tupla
novoCadastro.curso.periodo = [(1, 'Primeiro'), (2, 'Segundo'), ...];

Se ainda sim quiser gerar o value pelo contador do loop, você pode usar $index;
<md-option ng-value="$index+1" ng-repeat="periodo in novoCadastro.curso.periodo">{{periodo}}</md-option>

O $index começa a contar em 0.
Comment: Ok, muito obrigado, já que não é uma boa pratica vou fazer conforme me falou.
Comment: @ErickZanetti não esquece depois de marcar como resposta aceita se resolver o seu problema. Valeu.

Ng-repeat passando um numero


Installing foundation 3 with scss

Question: I am trying to download and use foundation 3 with compass and scss, but I can't understand the instructions that is on the following page:
http://foundation.zurb.com/docs/compass.php
It says that i have to write the following "[sudo] gem install zurb-foundation". But where, in my browser, in my css document, in my php documents?
I now that this might sound stupid, but I need help.
Answer: Got it. It seems that you need to install ruby. Here is how I did it:

Go to http://rubyinstaller.org/downloads/
Download the latest version of the rubyinstallers (for me it was Ruby 2.0.0-p0)
Run the .exe installer when it has downloaded (check all 3 boxes during the install)
After the install is finished, find the rubycatalog in your startmenu (on your computer)
Klick on "start commandprompt with ruby"
in the commandprompt, type "gem update zurb-foundation" leave out the [sudo] part, it gave me an error, don't know what it is fore anyway.
foundation with sass is installing :)

Installing foundation 3 with scss


Tricky complex contour integration

Question: Show that $$\int_{0}^{2\pi} \frac{\cos^2{(\theta)}}{13-5\cos{(2\theta)}} \; d\theta = \frac{\pi}{10}$$ using complex contour integration.
I let $z = e^{i\theta}$ which means $dz = ie^{i\theta} \; d\theta = iz \; d\theta$ (meaning we know integrate over the unit circle $C$). Hence,
$$\int_{0}^{2\pi} \frac{\cos^2{(\theta)}}{13-5\cos{(2\theta)}} \; d\theta = \oint_{C} \frac{1/4\left(z+1/z\right)^2}{13-5/2\left(z^2+1/z^2\right)} \; \frac{dz}{iz} = -\frac{i}{2}\oint_{C}\frac{z(z^2+1)^2}{(z^3-5)(5z^3-1)} \; dz.$$
Not sure what to do next. Is it to find the poles that are in the unit circle? Thanks!!!
Comment: How do you get the cubes in the denominator?
Comment: I'd start
$$\int_0^{2\pi}\frac{\cos^2\theta}{13-5\cos2\theta}\,d\theta
=\frac12\int_0^{2\pi} \frac{1+\cos2\theta}{13-5\cos2\theta}\,d\theta
=\int_0^{2\pi}\frac{1+\cos\phi}{13-5\cos\phi}\,d\phi=\cdots.
$$
Comment: Did you use a change of variables to get the $\phi$'s?
Answer: On the last step, you should have
$$I=\frac i2\oint_C\frac{(z^2+1)^2}{\color{red}z(z^{\color{red}2}-5)(5z^{\color{red}2}-1)}~\mathrm dz$$
Now use the two roots in the unit circle from $5z^2-1=0\Rightarrow z=\pm\sqrt5/5$ and $z=0$, which are first order poles, to get
$$I=\frac\pi{10}$$
Comment: Don't think that substitution's quite correct either. I ended up with $z(5z^4-26z^2+5)$ as the denominator.
Comment: Oh nevermind. I'm stupid. That's the same denominator.

Tricky complex contour integration


How to memorize seventh chords and inversions on piano?

Question: These past few months I've been teaching myself how to play piano, using my background in guitar and a basic knowledge of music theory I've picked up from that. I am having difficulty "memorizing" seventh chords and inversions. I know how to formulate any type of chord technically, but I want to be able to play chords quickly and not need to figure out each note.
To be more specific, I'll list what I already know and try to explain the next step I want to take. I'd greatly appreciate any tips on how to achieve that next step, or what intermediate steps I'm missing.
On piano, I'm already comfortable 'quickly' playing:

the 12 major scales starting at the root
the 12 major chords in root position
And of course, flatting my middle finger (the third) to play the 12 minor chords

By quickly, I mean my hands can somewhat instinctively find whatever I'm looking for. If I want to play a B major, I don't have to think about what's the major third and what's the perfect fifth from B, I just know what shape to make. I'm having trouble extending this to seventh chords. If I'm playing a seventh using my left hand, I currently make the shape using my pinky (root), middle (third), and thumb (fifth), then move my thumb to the (major or minor) seventh, and awkwardly shift my ring and index fingers to the notes I was holding with my middle and thumb fingers previously. That's obviously untenable. The two methods I'm aware of for memorizing chords are either to memorize the four-finger shapes (which seems a bit scary but perhaps I should knuckle down and try to do it) or use chord stacking, where for instance to play a major seventh, I'd play the root and then play a minor chord based off of the third. This seems like a "lot" to think about while playing however, and so I'm concerned this isn't the right way to approach 'memorizing' chords to be able to play them quickly. Is there another method or should I just try one of these two (or both) and slowly keep practicing?
Anyone have a practice regimen they prefer? Just learn a few sevenths at a time? How could I introduce memorizing inversions, ninth chords, augmented chords, etc into this? In short, my brain knows what it wants to play but my hands are too clumsy to move my fingers around quickly, and without the comfort of movable chord shapes that I've been spoiled by on the guitar, I've found myself at an impasse for continuing to teach myself piano. Thanks (and sorry for the verbosity).
Comment: Hi.  Did you have any success with the tips you got here?  I'm beginning on the same path and I'm trying to get some good information.
Comment: You seem to have to work on developing you muscle memory. This takes patience and a whole lot of practice. Also try and work on your sight reading. That should help as well.
Answer: You should memorize the shapes.  You shouldn't need to think about anything when playing these chords.
One method to build familiarity is to pick a particular chord and play it, then play the first inversion, then the second, the third, and back to root (an octave higher).  Then come back down.  You quickly pick up which notes are involved in the chord and how the finger positions differ, and you won't have your middle finger in the way or be confused about where your thumb goes.
You can play arpeggios the same way, going through the inversions.  The rough shape of how you need to hold your hand is the same for every 7th chord in the same inversion — e.g., it's only a minor change to play C#7 in root instead of C7 in root, really — and doing these exercises for multiple keys will help you burn the differences into muscle memory.  You want to have your hands form the shape automatically when you go to play a chord, no thought required.
Comment: Thanks. This confirms my suspicions. Would you agree it's best to learn all the seventh chords in root position first, and then use these drills to learn inversions? I feel like that at least would provide a quicker reward, as my repertoire of songs would increase. Also how extensible is this? Do you tend to memorize the shapes of all the other chord flavors (augmented chords, 9ths, etc) using exercises or just through a matter of playing them enough?
Comment: @snackdefend I think it could probably work to go either way; I believe I learnt them one at a time (learning all 4 positions before moving to the next).  I would use the same method for other chords, yes.
Answer: For memorizing chord shapes, nothing beats practice. Keep working at it until they fall naturally under your fingers. Practice 2-5-1 in the circle of fifths, practice 2-5-1 in random keys, practice songs.
For inversions, however, a simple technique can yield great benefits. Instead of building the chord in root position and then moving notes up or down octaves, simply start with the correct finger on the root for that inversion and build the chord out from that finger. For example, to play a second inversion Bb7 chord in the left hand, place the second finger (index finger) on Bb and then build the chord up to D with the thumb and down to the F with the pinky.
Left hand fingers for 7th chord inversions:

Root position: 5
1st inversion: 1
2nd inversion: 2
3rd inversion: 4

A similar chart can be made for the right hand but is left as an exercise for the reader.
Comment: @MarioMarinato-br- 2-5-1 means the chord progression using ii, V, and I chords of a major scale (e.g., in C major, Dm7, G7, CM7). Circle of fifths means repeating the progression a 5th away from the previous root (e.g., moving from C to G to D to A and etc.) until you get back to the original key.
Comment: It might be a lame question, but beginners are allowed to do that:  what do you mean when you say "practice 2-5-1 in the circle of fifths"?
Comment: Ah, get it.  That's exactly the kind of exercises I've been looking for.  Thanks for your explanations.
Comment: @ReinHenrichs I have no intuition on playing inversion chords. Can you explain what's the motivation behind the technique you suggest? To play a 2nd inversion for example, I visualize the chord in its root position, then put my 5th on the 3rd node in the chord, and then play the rest of notes moving up the lower ones by an octave. That's methodical but awfully slow. What goes in your mind when you use your technique?
Answer: http://www.pianotools.com/piano_visualization_tools/chords.html has interactive chord shapes look-up and displays, which are very useful. The static charts below are adapted from diagrams there. Diminished 7th chords are not pictured, but you can figure them out easily.
7(b5)

7 (i.e. major minor 7th)

m7

M7

mM7

M7(#5) (pianotools.com does not have this, but it is easy to picture as mirror image of mM7)

as for 'practice regimen', try playing cycle of fifth chord sequence in each key (e.g. with root motion going through nth degree of the scale in sequence with n = 1, 4, 7, 3, 6, 2, 5, & back to 1) with smooth voice leading (i.e. instead of using the same shape throughout, try alternating between 1st and 3rd inversions, and between root position and 2nd inversion).
Answer: I agree with the plus-voted answers above, but I'd like to suggest a couple of additional techniques.
First, simplify your chord voicings.  Start with "shell" or "Bud Powell" chord voicings. Then add color notes: flatted fifths, 11ths, 13ths, etc.  Honestly, this is what most jazz piano players do.  George Shearing the Block Chord King is dead.
Second, try playing all melodies as chord-melodies, that is, matching every single note of the melody with a chord inversion.  Do this in free tempo, at first, taking as much time as you need to voice each chord.  Then start playing against a metronome, at first verrrry slowly, then gradually speeding up until you can play andante or lento.
Third, go through chord melodies but start reharmonizing all your chords.
Finally, comp along with the solos on your favorite jazz records.
When you get to this point you're playing jazz chords at a professional level.
Go forth and do good.
Answer: I play the bass guitar, but I learned this way of practicing seventh chords and inversions from a saxophone player.  Say I am working C Maj 7...  I start at the bottom of my instrument and head towards the top of the range:  up CEGBC, down ECBGE, up GECBG, down BGECB.  Once I reach the top, I come back down again alternating up and down.  I do this for each degree of the scale, i.e.:  I, ii, iii, IV, V7,vi, and vii(b5).  Might be cool to do the seventh chords for ii, V, I (or) I, iii, V7, vii(b5),ii,IV,vi (or) pick the progression of a tune you like.
When major/minor gets old, I do the seventh chords and inversions for Harmonic Minor and Ascending Melodic Minor. When straight arpeggios gets old, I try to come up with scale sequences off the notes of the seventh chords.
For me, there are movable shapes, but there are generally 4 different shapes for each seventh chord and inversion.  A lot to practice!!  The more times I touch the patterns, hear the notes, think the notes, think the intervals, I just sort of internalize them, and I can play them off of any note, starting on any finger.
And when I go to the jam they yell at me unless I play root/five.  Practicing keeps me out of trouble though.
I draw fingerboard maps too which seems to aid in memory.
---Oh shoot, sorry to ramble on, but check out Dominic O'Brien The World Memory Champion.  He builds imaginary palaces to memorize incredible amounts of information like the Ancient Greeks.
Answer: I still think the best way to memorize chords is by their sound. To do this you would first need to be familiar with the pitch of every key on the keyboard and their relative pitches. This might seem really basic but is very important, and also fairly easy to accomplish on the keyboard because there are really just 12 keys repeating themselves.
Then try to memorize how the different types of chords sound like (in your case, major seventh, minor seventh, dominant seventh, diminished seventh, etc.) and associate the overall sound of the chord as well as the relative pitch of each note within the chord with the shape on the keyboard. Start with the chords in C major only and all other keys would just be a shift from this.
This might seem more challenging than just memorizing the shapes mechanically at first, but it will prove to be very beneficial in the long run and would make inversions effortless.
Answer: For practical purpose like improvisation and accompaniment, memorizing the notes of each chords is useful.
That means, you can play whatever texture and inversion you want with any of these chords. Let's say the C7. If you remember the note position on the keyboard of it are C, E, G and B-flat, you know automatically how to combine them either into compact texture or open texture. i.e., you can play a bass note on G and a compact chord an octave above it of B-flat, C and E.
The key is that you visually memorize the notes in a chord. Then when you want to play this chord, you "see" all the notes of that chord in at least 2 or 3 adjacent octaves in your mind. Imagine how easy it would be to randomly pick some notes from a chord if every notes of that chord is marked red on keyboard.
And familiarity, or instinct is the key, and the method mentioned above is just a tool. Use what every means to get familiar with these chords, the shape of your hand, the relationship with other chords, the imaginary shape of related notes on a keyboard. Your final goal is to intuitively play whatever 7th chords in whatever texture and inversion.
Answer: Before you start adding in fancier chords like ninths and augmented chords, I would get familiar with basic chord progressions and what inversions work best to provide good voicing. Good voicing basically means selecting inversions that prevent jumping around too much.
A good place to get started is the I-IV64-I-V65-I chord progression. (64 means first inversion triad, 65 means first inversion 7th chord.) So, for example in C, play CEG, CFA, CEG, B(D)FG, CEG. (In a 7th chord, the fifth is optional.) Try that in several of the keys with a few sharps or flats. Also, do minor keys with a sharped 7th, for example in a minor, play ACE, ADF, ACE, G#(B)DE, ACE. Try that with a few minor keys.
This is probably the most basic chord progression there is. You'll find it in most genres of music. Getting familiar with this progression to the point where it's automatic will teach you a lot of the things that you want to know, and also give you a framework to start applying those things.
Once you have that down in several keys, start working with the I chord in first inversion. Moving from I6 (first inversion), what inversions of IV and V require the least movement? Use those. Then experiment with I64. Try for stepwise movement of each note in each chord change. Look at I64 to IV6, and see that one note remains the same, and the other two move up by step.
You can apply these nuts and bolts directly to your desired repertoire, and from there you can begin branching out to other types of chords.
Answer: Hi the issue with the original question is that when forming the standard triad one uses the 1,3,5 fingers on the right hand and 5,3,1 on the left hand. However when forming sevenths one brings in the second finger on both hands.
1,2,3,4 on the right and 5,4,3,2 on the left.
This gives the dominant seventh of F as C-1,E-2,G-3 and Bb-4 with the 5 of the right hand available to finalise an arpeggio run with the next C or cross the thumb under to continue an arpeggio with the next C. Just ignore the pinky if playing a full blocked chord
Answer: The inversions of seventh chords are really very easy. It is better to know how to figure them out so as to not needlessly make it a memory excercise.
You start from the root and you count when you find notes. So for instance if you have the dominant seventh chord of F Major you have the notes C-E-G-B♭.
If you have this chord in root position it would be
B♭
G
E
C (From Bottom)
If you start from the bottom note and count you get

C > E is three C(1)d(2)E(3)
C > G is five C(1)d(2)e(3)f(4)G(5)
C > B♭ is seven C(1)d(2)e(3)f(4)g(5)a(6)B♭(7)

So we notate the root seventh chord as F:V 7/5/3 or just as F:V7
If you have this chord in first inversion you have the notes
C
B♭
G
E

E > G is three E(1)f(2)G(3)
E > B♭ is five E(1)f(2)g(3)a(4)B♭(5)
E > C is six E(1)f(2)g(3)a(4)B♭(5)C(6)

So the seventh chord in first inversion would be notated as F:V 6/5/3 or just F:V 6/5
Second inversion we have the notes.
E
C
B♭
G  (Bottom)

G > B♭ is three G(1)a(2)B♭(3)
G > C is four  G(1)a(2)b♭(3)C(4)
G > E is six G(1)a(2)b♭(3)c(4)d(5)E(6)

So second inversion could be noted F:V 6/4/3 but not 6/4 (That is triads in second inversion) Also notated as F:V 4/3
Third Inversion we have the notes.
G
E
C
B♭

B♭ > C is two B♭(1)c(2)
B♭ > E is four B♭(1)c(2)d(3)E(4)
B♭ > G is six B♭(1)c(2)d(3)e(4)f(5)G(6)

So we can note them as F:V 6/4/2 but again not 6/4. Sometimes it may be noted as F:V 4/2


Escrever dentro de uma DIV utilizando CSS

Question: Como escrevo dentro de uma DIV utilizando CSS. Abaixo tenho o CSS e neste mesmo código gostaria de escrever uma frase para aparecer nesta DIV.
<code>.gerenciar-coluna-exibicao-vismodelo{
        position:relative;
        height:60px;
        width:250px;
        float:left;
        text-align:left;
        line-height:70px;
        border: 0px double #cccccc;
        text-indent:25px;
        background-color:#FF3F42;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 20px;
        color:#1085A9;
    }
</code>
Sem que com isso eu precise ir na TAG da DIV e escrever o que preciso.
Comment: Você quer mudar o texto conteúdo da div via css?
Answer: Faz assim
<code>.gerenciar-coluna-exibicao-vismodelo:before {
  content: "Boschini was here!";
}
</code>
Porem o recomendado seria vc fazer por jquery.
Comment: IE8+ suporta, mas é meio gambiarra isso viu, eu acredito que por JS seria o ideal.
mas funciona
Comment: Porque? pode ser incompatível com alguns navegadores?
Comment: Qlq navegador com suporte a CSS2


Factoring out a coefficient from binomial

Question: I watched a youtube video (I cannot find it anymore) however, the author showed that the following binomial equation could be factored (If I remembered it correctly.)
$$\binom{n}{n+2k}=\binom{n}{n+k}\frac{1+(-1)^k}{2}$$
I cannot see how this was derived, for example I have tried the following:
$$\frac{n!}{(n+2k)!(n-(n+2k))!}$$
But cannot see how the above works.
Comment: Probably you didn't remember the formula. If $k>0$, both ${n \choose {n+2k}}$ and ${n \choose n+k}$ are zero.
Answer: What you probably saw was
$$\sum_{k\ge 0} a_{2k} = \sum_{k\ge 0} a_k \frac{1+(-1)^k}{2},$$ which holds because
$$\frac{1+(-1)^k}{2}=
\begin{cases} 1&\text{if $2\mid k$},\\
0 &\text{otherwise}
\end{cases}$$
Comment: Ok I see, essentially I got the k belongs to the integers, therefore we only want to iterate over the positive integers, am I correct? Therefore, for k even we get 1 and for k odd we get 0. However, If I get something like $\binom{n}{n+pk}$ with p denoting any natural number, would this become something like $\binom{n}{n+k} \cdot \frac{(p-1)+(-1)^k}{p}$?
Comment: No, for general $p$, you use $p$th roots of unity.  See [summation] [roots-of-unity]
Comment: For an example with $\sum_k \binom{n}{3k+1}$, see https://math.stackexchange.com/questions/3644225/what-is-the-value-of-binomn1-binomn4-binomn7-binomn10-bi/3644277#3644277


Java thread concept

Question: I'm inexperienced in using threads and I wanted to check if I understand their implementation in Java and other programming languages well enough.
Is the fact that a class is called thread misleading?
I understand threads as an abstract concept which is a set of steps done by the processor that have an order and a meaning.
A java thread object however(as well as classes and structs form other programming languages) does not represent a thread entirely, as it passes control to monitors and does not execute the whole abstract thread.
Am I correct? Or am I understanding threads incorrectly?
(Obviously, I've read several definitions along the way including wikipedia but I'm still uncertain)
Also, are OS system processes(although implemented in C structs) similar to Java threads?
Comment: C has threads, which work in a similar fashion to Java's (barring that C isn't using classes and objects).
Answer: The Thread object does represent a thread, in as much as it gives you a handle by which you can control a thread. Obviously the object is "special" in that it instantiates an actually running thread of execution, but it does represent that thread. The thread's run method (or the runnable it calls) defines the sequence of operations that that thread will execute and determines how long the thread will run for, etc.
Answer:
I understand threads as an abstract concept which is a set of steps done by the processor that have an order and a meaning.

That's not how I see it.  A thread the administrative framework required to execute independent code.  This can be kernel threads, user threads, or in this case VM threads.  I'm not sure what you mean by "order and a meaning" but a thread can execute any code.  To quote this page:

A thread is a basic unit of CPU utilization, consisting of a program counter, a stack, and a set of registers, ( and a thread ID. )

Good definition.

A java thread object however(as well as classes and structs form other programming languages) does not represent a thread entirely, as it passes control to monitors and does not execute the whole abstract thread.

I'm not sure I understand your point.  The Thread object is Java's way to administer the independent entity.  It manages the stack frame, helps with VM scheduling and administration, and is tied closely with the native thread structures and also the OS scheduler.  In terms of Java, the Thread object certainly is a thread although to be technical maybe you can say that it is a thread after it is started.  But either way the term is not misleading -- at least not to me.
This is the same way that a Java File represents a file on disk.  Sure, it's not technically a file but to Java it is the class that manages access to the disk file.  Same with Socket, InputStream, Console, and any other class that is tied to a outside OS entity.

Also, are OS system processes(although implemented in C structs) similar to Java threads?

Uh, sort of?  Not sure what you mean by "system process".  Maybe you are talking about kernel threads?  Regardless, the answer depends highly on the OS in question.  Not all OS' are written in C obviously.  Certainly the JVM works with the native side of Java and the OS to schedule and manage the threads.  After a Thread object has been started, with most OS', there is a 1-to-1 relationship between the Java class and a OS managed user thread.

Java thread concept


Predict and evaluate metrics in Keras

Question: After model's training how can I predict and evaluate my metrics?
Code is like this:
for patch in generator():
    pred = model.predict(np.array(patch, dtype=patch.dtype))

    loss_val_partial,accuracy_val_partial = model.test_on_batch(np.array(patch, dtype=patch.dtype),pred)

or like this:
for patch in generator():
    pred = model.predict(np.array(patch, dtype=patch.dtype))

    loss_val_partial,accuracy_val_partial = model.test_on_batch(ground_truth,pred)

where ground truth is the true label of the patch.
I don't think the first is right because the accuracy is always 1.0
Answer: The problem in your first code listing is that you first predict the output with your model and then use this result pred as the ground truth for the test, so that you will of course have an accuracy of 1.0
See the signature for the test_on_batch method:
test_on_batch(self, x, y, sample_weight=None)

So I can't test it myself for you because you only showed a part of your code (e.g. I don't know where your ground truth comes from) but try something like this, i.e. just remove the manual prediction step as it is done internally for you in test_on_batch:
for patch in generator():
    loss_val_partial,accuracy_val_partial = model.test_on_batch(np.array(patch, dtype=patch.dtype), ground_truth)

Comment: test_on_batch method don't return the prediction i need both prediction and metrics...that's why i use predict too
Comment: yeah that's ok but don't pass your prediction as ground truth as this is wrong (which you recognized yourself with your acc = 1.0)
Comment: ok, so the solution is the yours but if i want the prediction too i must add the predict method, right?
Comment: Yes. I think in theory one could provide the predictions which were made internally during the test phase but from the perspective of a clean API this would intermingle two different steps in the overall process (just my opinion, maybe the creators of Keras have a different reason :)).

Predict and evaluate metrics in Keras


$f(x)$ such that $f(x)$ is continuous and $f^{-1}(x)\ne 0$ is continuous for every $x$

Question: My friend told me it is impossible to find a function $f(x)$ such that it is continuous and its inverse is non-zero for every $x$ and its inverse is continuous as well. Is this true? If so, how can it be proved?
Comment: A function with what domain and codomain?
Comment: The domain of $f$ contains $0$ if and only it the range of $f^{-1}$ contains $0$.
Comment: I think he assumed real numbers.
Answer: $f^{-1}$ being zero at some point corresponds to $f(0)$ having a defined value. And clearly, as long as $0$ is in the domain, $f$ has a value there. Continuity is entirely irrelevant.
Comment: But continuity on $\mathbb{R}$ implies that $0$ is in the domain of the function, doesn't it?
Comment: @UraUra Sure, if we say that the function is continuous on $\Bbb R$, then it is implicitly assumed that it is also defined on all of $\Bbb R$. But other than that, continuity is completely irrelevant. The important part is that $0$ is in the domain, and that's it.
Answer: This has nothing to do with continuity and everything to do with the function's domain.
If $0 \in \operatorname{Domain}(f)$ then setting $y = f(0)$ we have $f^{-1}(y) = 0$.
If $0 \notin \operatorname{Domain}(f)$ then $f^{-1}(y)$ can never be $0$ because $f^{-1}(y) \in \operatorname{Domain}(f)$. For example define $f : (0,1) \to (0,1)$ by $f(x) = x$. Then $f^{-1}(y) = y \ne 0$ for any $y \in (0,1)$.


How to pull findbugs or checkstyle coding rules from source repository in Sonar?

Question: I understand we can upload code rules in Solar admin dashboard. But is there a way to have these rules(Checkstyle, Findbugs & PMD config xmls) in the source repository which Sonar will use after every build?
Thanks
Comment: If you're using SonarQube, what's the need of being able to pull them from a source repository?
Comment: In our case Dev+QA maintain code & SCM team owns SonarQube.  Idea is Dev maintaining code, QA team managing code coverage/formatting rules and SCM manage SonarQube. We would like to reduce the dependency between SCM & Dev teams.
Answer: That is not possible at this time. At the time of this writing, SonarQube must be the master (i.e. leading) system for rules definitions. So you define the rules once in SonarQube, then use them whereever you need.
In theory, you could write a script that checks for differences between a rule definition from the source repository and from SonarQube. If a difference is found, you could upload a modified profile to SonarQube via the web interface. I would advise against such a mechanism, because it would be hard to build in a reliable way and counteracts the basic idea of SonarQube as the leading source of quality information.
If you are using Eclipse, for example, you can specify the Checkstyle rules as a remote configuration pointing directly to the permalink URL in SonarQube. This way, your local configuration is automatically in sync with SonarQube.


Show or hide field data using java script in node

Question: I create one cck content type and add one text field in them with name of:  My friend name: text field with add more buttonThen, i submit form with entering my 15 friends names
Like this:
1
2
3
.
.
.
15
this node display all of 15 names,
i am trying to do after submit form display only 10 name and after 10 name display more link after click more button show remaining 5 names. Like this:12345678910 more...Remaining 5 names1112131415 how can i do this ? i am using Drupal 6
Answer: jQuery will do this for you, but you wiull probably have to either write your own code for list items > 10, or adapt existing code to suit your needs.
There are various show/hide plug ins for jquery. In Drupal the facet api uses a jquery function to do just that as well given it's limit.
Here is the function from facetapi.js
/**
 * Applies the soft limit to facets in the block realm.
 */
Drupal.facetapi.applyLimit = function(settings) {
  if (settings.limit > 0 && !$('ul#' + settings.id).hasClass('facetapi-processed')) {
    // Only process this code once per page load.
    $('ul#' + settings.id).addClass('facetapi-processed');

    // Ensures our limit is zero-based, hides facets over the limit.
    var limit = settings.limit - 1;
    $('ul#' + settings.id).find('li:gt(' + limit + ')').hide();

    // Adds "Show more" / "Show fewer" links as appropriate.
    $('ul#' + settings.id).filter(function() {
      return $(this).find('li').length > settings.limit;
    }).each(function() {
      $('').text(Drupal.t('Show more')).click(function() {
        if ($(this).prev().find('li:hidden').length > 0) {
          $(this).prev().find('li:gt(' + limit + ')').slideDown();
          $(this).text(Drupal.t('Show fewer'));
        }
        else {
          $(this).prev().find('li:gt(' + limit + ')').slideUp();
          $(this).text(Drupal.t('Show more'));
        }
        return false;
      }).insertAfter($(this));
    });
  }
}

Comment: here are some coding examples: http://stackoverflow.com/questions/4054211/jquery-hide-show-list-items-after-nth-item
Answer: Replace .field-field-friends-name with your field name and adjust hide_after as necessary. This worked for me on my site
Drupal.behaviors.hide_more_friends = function() {
  var field = jQuery('.field-field-friends-name');
  var hide_after = 10;
  var items = field.find('.field-item');

  if (items.length > hide_after) {
    items.slice(hide_after).addClass('excess').hide();

    var more_link = jQuery('more').click(function() {
      jQuery(this).remove();
      field.find('.excess').show();
      return false;
    });
    field.find('.field-items').after(more_link);
  }
}

Comment: how can i add this currently i am not using any theme use default theme i can apply this in my node.tpl or page .tpl?
Comment: You can put it in page.tpl.php. Wrap it in `` and put it after ``
Comment: it's work perfectly Thank You so much :) only one more if i have 10 content types and each content type have more then 20 fields how can i apply this in all content types?
Comment: and its permanently show if i click more link,any less link after show all data include?
Comment: If you use existing fields, this will work on all fields regardless of content type. If you have more than one field per content type, you will need to adjust the code to loop over each field. The example you provided didn't have `less` link so I didn't include it.
Comment: well i do this with my own, thanx
Answer: Extended code with more or less link
  Drupal.behaviors.hide_more_friends = function() {
  var field = jQuery('.field-field-test');
  var hide_after = 10;
  var items = field.find('.field-item');

  if (items.length > hide_after) {
    items.slice(hide_after).addClass('excess').hide();
    console.log('hide after'+hide_after);
    console.log('item last'+items.length);
    items.slice(hide_after).addClass('excess').hide();
    items.slice(items.length-1).addClass('last');

    var more_link = jQuery('more').click(function() {
      jQuery(this).hide();
      field.find('.excess').show();
      jQuery('.less-link').show();
      return false;
    });
        var less_link = jQuery('less').click(function() {
      jQuery(this).hide();
      field.find('.excess').hide();
      jQuery('.more-link').show();
      return false;
    });
    field.find('.field-items').after(more_link);
    field.find('.field-item.last').after(less_link);
    jQuery('.less-link').hide();
  }

}


error: non-static method unbind() cannot be referenced from a static context

Question: I am changing Bind to BindView Class, How To Write right Way I Dont know, I am new in coding
Please Help me
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import static butterknife.Unbinder.*;

public View onCreateView(LayoutInflater inflater,
 @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

    // TODO Auto-generated method stub code part

    View view = inflater.inflate(R.layout.fragment_device_info, container, false);
    Unbinder unbinder = ButterKnife.bind(this, view);
    mContext = getActivity();

    return view;
}

@Override
public void onDestroyView() {
    super.onDestroyView();
    Unbinder.unbind();
}

Please Help me
Comment: see this link that may help you     https://stackoverflow.com/questions/290884/what-is-the-reason-behind-non-static-method-cannot-be-referenced-from-a-static
Comment: Make `Unbinder unbinder` a field, and use that instead.
Answer: Unbinder unbinder; //declare it here
 public View onCreateView(LayoutInflater inflater,
 @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

    ...........
    unbinder = ButterKnife.bind(this, view); //bind it here

    .......

    return view;
}

@Override
public void onDestroyView() {
    super.onDestroyView();
    unbinder.unbind(); // then unbind it here on the same Unbinder object
}


A problem about convergence...

Question: I am studying an article of Berestychi-Caffarelli-Niremberg - Monotonicity for elliptic equations in unbounded Lipschitz domains, and I don't understand a convergence in the demonstration of the lemma 3.4.
Suppose that $u\in C^2(\Omega)\cap C(\overline\Omega)$, such that
$$
\left\{
\begin{array}{rl}
\Delta u+f(u)=0, & in \ \Omega,\\
u=0, & on \ \partial\Omega,\\
0<u<1, & in \ \Omega,
\end{array}
\right.
$$
where $\Omega=\{x=(x',x_n)\in\mathbb{R}^n\times\mathbb{R};x_n>\varphi(x')\}$, with $\varphi$ is a Lipschitz function.
LEMMA 3.4: For any $h>0$, the solution $u$ is bounded away from $1$ in $\Omega_h=\{x\in\Omega;\varphi(x')<x_n<\varphi(x')+h\}$.
Sketch of the proof: Suppose by contradiction that exists a sequence $(x'^j,x_n^j)_j=(x^j)_j\subset\Omega_h$ such that $u(x^j)\rightarrow1$. By the translation $T^j(x)=x-x^j$ we move the set $\Omega$ to $\Omega^j$, given by
$$\Omega^j=\{z=(z',z_n)\in\mathbb{R}^n;z_n>\varphi^j(z')=\varphi(z'+x'^j)-x_n^j\}.$$
Is easy to verify that the functions $\varphi^j$ is Lipschitz continuous and uniformly bounded in compact sets, so by the Arzela-Ascoli Theorem, for a subsequence $\varphi^j$ tend to a function $\widehat\varphi$. For each set $\Omega^j$ you have a shifted solution
$$u^j(z',z_n)=u(z'+x'^j,z_n+x_n^j),$$
satisfying
$$
\left\{
\begin{array}{rl}
\Delta u^j+f(u^j)=0, & in \ \Omega^j,\\
u^j=0, & on \ \partial\Omega^j,\\
0<u^j<1, & in \ \Omega^j,
\end{array}
\right.
$$
FINALLY, the doubt: In the article, he says that the shifted solutions converge uniformly in compact subsets of
$$\widehat\Omega=\{x\in\mathbb{R}^n;x_n>\widehat\varphi(x')\},$$
to a solution $\widehat u$ that satisfies
$$
\left\{
\begin{array}{rl}
\Delta \widehat u+f(\widehat u)=0, & in \ \widehat\Omega,\\
\widehat u=0, & on \ \partial\widehat\Omega,\\
\end{array}
\right.
$$
If the initial sequence $(x^j)_j$ is bounded, I can to argument this implies (Because in compact sets, the shifted solutions and the first and second derivatives, would be uniformly continuous and uniformly bounded, then you could apply the Arzela-Ascoli theorem). But I think that the sequence could be unbounded, I don't know. Someone can help me in this argument?
Thank you.
Answer: First of all, you should think of the sequence $(x^j)$ as unbounded, because if it had a finite limit, we'd immediately hit a contradiction: $x^j\to x\in \partial \Omega$, $u\in C(\overline{\Omega})$, and $u(x)=0$.
The reason for convergence of shifted solutions on compact sets is also Arzela-Ascoli, but we need uniform continuity on an unbounded set, which does not come for free.
Claim: For any $C>1$ the solution $u$ is uniformly Lipschitz  on the  set $\Omega_C=\{x: C^{-1}\le d(x)\le C\}$ where $d(x)=\operatorname{dist}(x,\partial\Omega)$.
Proof. The function $u$ solves the Poisson equation $\Delta u = g$ where $g=f\circ u$. Notice that both $u$ and $g$ are bounded in $\Omega$. The standard inner regularity result for the Poisson equation (Theorem 3.9 in Gilbarg-Trudinger) implies that $\nabla u$ is uniformly bounded in $\Omega_C$. (Why? Because any point $x\in \Omega_C$ is the center of a ball of radius $C^{-1}$ contained in $\Omega$. Apply the theorem on this ball, and recall that $u$ and $\Delta u$ are uniformly bounded.) It follows that $u$ is Lipschitz on $\Omega_C$. $\Box$
When we fix a compactly contained subdomain $G\Subset \widehat{\Omega}$ and consider the restrictions $u^j$ to $G$, we are actually looking at the restriction of $u$ to a subset of $\Omega_C$. Hence $u^j$ are uniformly Lipschitz on $G$. Since $f$ is Lipschitz  and $\Delta u^j=f(u^j)$, it follows that the sequence $\Delta u^j$ is uniformly Lipschitz as well. By Theorem 4.6 in Gilbarg-Trudinger, this implies uniform Hölder continuity of all second-order derivatives of $u^j$.
Therefore, we can choose a subsequence, still denoted $u^j$, such that both $u^j$ and  $D^2 u^j $ converge uniformly on $G$. Say, $u^j\to \widehat{u}$ and $\Delta u^j \to g$. We should check that $\Delta \widehat{u}=g$. To that end, pick a test function $\psi$  supported in $G$, and observe that
$$\int u^j\Delta\psi\to \int \widehat{u}\,\Delta\psi\tag{1}$$
$$\int \Delta u^j \,\psi\to \int g\,\psi\tag{2}$$
Since $\int u^j\Delta\psi = \int \Delta u^j \,\psi$ (integration by parts), the combination of (1) and (2) implies $\Delta \widehat{u}=g$.
Comment: @JoséCarlos Since $\Delta u_j = -f(u^j)$, the functions $\Delta u_j $ also form a uniformly convergent sequence. Uniform convergence of $u_j$ and $\Delta u_j$ implies uniform convergence of all derivatives of 1st and 2nd order. Indeed, take $v=u^j-u^k$ and apply Poisson equation estimates from Chapter 3 of GT to $u$.
Comment: I have two doubts yet. First of all, before to read this article, I thought that to define a sequence of functions, the functions would need to be defined in the same set, but in this case, we have one different set to each $u^j$. Is this not a problem? In the end, for each compact set $K$, we have to consider the restriction of the sequence in the compact, ok? My second doubt, is about your second answer. Could you explain better, why the first and the second derivative are uniformly convergent? Thank you very much, you are helping me a lot.
Comment: Why the sequence $x^j$ can not converge to a point in the interior of $\Omega$?
Comment: @Tomás Good point. If $x^j\to x\in\Omega$ then $u(x)=1$, contradicting an earlier result in the paper, Theorem 1.2 (a).
Comment: Why the laplacian converges in $\widehat\Omega$? What is the explanation to $\Delta\widehat u+f(\widehat u)=0$ in $\widehat\Omega$?
Comment: I cant see how to apply Poisson estimate to $v$. In what domain it is supposed to do it?
Comment: @5PM Could you explain about de the convergence of laplacian?

A problem about convergence...


Statistics about php setups / What extensions are installed by default

Question: I'm trying to get some statistics about how most PHP sites are configured, specifically what extensions are installed on them.
I'm particularly interested in knowing if Mcrypt is installed or not.
Anyone know of any sites collating such information?
Comment: any inputs folks? looking for an authroritative source  - a report of some kind... surely there  must be php websites doeing this?
Comment: Is the question : "what percentage of php instances from providers give you access to this extension ?" or "what percentage of php instaces have Mcrypt enabled ?". If the question if the first, you can have your answer quite easily, just do it by hosting provider / number of instances served, I'm pretty sure you can cover the top providers quickly. I can see sites collating the info about hosting providers - not about specific individual PHP instances (which are a minority anyway).
Comment: I'm interested in this too, for the mb_string extension especially :)
Answer: Google does, by indexing phpinfo() -- so search for that using a string embedding in phpinfo.
like this: http://www.google.com/search?&q=%22If+you+did+not+receive+a+copy+of+the+PHP+license%2C+or+have+any+questions+about+PHP+licensing%2C+please+contact+license%40php.net%22
Comment: thanks @beans - i was looking for reports which either survery people or do scans.
Answer: Interestingly, php site itself has a usage page, but seems like it was not updated after 2007 :(. The other lists are,
http://php.net/usage.php
http://w3techs.com/technologies/details/pl-php/all/all
http://trends.builtwith.com/framework/PHP
http://www.tiobe.com/index.php/paperinfo/tpci/PHP.html


How to display evolving BufferedImage on a JPanel

Question: I need to display evolving BufferedImages on a JPanel. The code is structured in the following format and I have compiled a SSCCE as below.
The following classes are in SSCCE1 project in Eclipse
Class DisplayLattice.Java
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;

public class DisplayLattice extends JPanel {

    private BufferedImage IMAGE = null;
    private BufferedImage DISPLAY_IMAGE = null;

    public DisplayLattice()
    {
        IMAGE = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
        render();
    }

    public DisplayLattice(BufferedImage map) {
        IMAGE = map;
        render();
    }

    public void paint(Graphics g) {
        if (IMAGE == null)
            super.paint(g);
        else
            g.drawImage(IMAGE, 0, 0, this);
    }

    public void render() {

    int cellWidth = 5;
    int cellHeight = 5;

        int imgW = IMAGE.getWidth();
        int imgH = IMAGE.getHeight();
        DISPLAY_IMAGE = new BufferedImage(imgW*cellWidth, imgH*cellHeight, 1);
        Graphics2D g2 = IMAGE.createGraphics();
        g2.clearRect(0,0,DISPLAY_IMAGE.getWidth(),DISPLAY_IMAGE.getHeight());

        for (int x=0; x<imgW; x++) {
            for (int y=0; y<imgH; y++) {
                g2.setColor(new Color(IMAGE.getRGB(x, y)));
                g2.fillRect((int)(x*cellWidth), (int)(y*cellHeight),
                            (int)cellWidth, (int)cellHeight);
            }
        }
        g2.setColor(Color.black);
        g2.dispose();
        repaint();
        revalidate();
        System.out.println("XX");
    }

    public void setImage(BufferedImage image)
    {
        IMAGE = image;
    }
}

Class SelfOrganizingMap.java
import java.awt.Color;
import java.awt.image.BufferedImage;

public class SelfOrganizingMap {

    public void methodTrain()
    {
        for(int i = 0; i < 100; i++)
        {
            new DisplayLattice(exportImageNorm());
        }

    }

    private BufferedImage exportImageNorm()
    {
        BufferedImage colorNodes = new BufferedImage(200, 200, 1);
        double[][] normL2values = new double[200][200];
        float t = 0.0f;
        for(int i = 0; i < normL2values.length ; i++){
            for(int j = 0; j < normL2values[0].length; j++){
                t = (float) Math.random();
                colorNodes.setRGB(i, j, (new Color(t,t,t)).getRGB());
            }
        }
        System.out.println("LL");
        return colorNodes;
    }

}

The following class is in SSCCE2 project
Class MapScreen.Java (Main Class)
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MapScreen extends JFrame {
    private int WIDTH = 0;
    private int HEIGHT = 0;
    private DisplayLattice pnlMap;

    public MapScreen(int mapOption) {

        setType(Type.UTILITY);
        setResizable(false);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setTitle("Map");
        setSize(600, 600);
        setLocation(150,150);
        getContentPane().setLayout(null);

        pnlMap = new DisplayLattice();
        pnlMap.setBounds(6, 130, 582, 440);
        getContentPane().add(pnlMap);

        JButton btnNewButton = new JButton("New button");
        btnNewButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
                new SelfOrganizingMap().methodTrain();
            }
        });
        btnNewButton.setBounds(10, 81, 89, 23);
        getContentPane().add(btnNewButton);

    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable()
        {
            public void run()
            {
                MapScreen frame = new MapScreen(5);
                frame.setVisible(true);
            }
        });

    }
}

What I want to achieve is when I click the JButton on the MapScreen class I need the JPanel which is a instance of DisplayLattice in SSCCE1 project to dynamically change for the number of iterations as specified in the methodTrain() in the SelfOrganzingMap class.
The current problem I have is that the bufferedImage I set at the SelfOrganizingMap class at each iteration is not set in the JPanel displayed.
How to rectify this issue? What is the best way of doing this type of visualization keeping in mind that all three classes presented here is pretty huge in size with a lot of methods in the actual application.
Comment: While I take a deeper look, you might like to have a read of [Performing Custom Painting](http://docs.oracle.com/javase/tutorial/uiswing/painting/) as overriding `paint` isn't recommend ;)
Comment: Don't understand the point of you DisplayLattice class. You call the render() method and it creates a image, but I don't see where you use the image anywhere. There is no need to do a revalidate(). You do revalidate when you add/remove components from a panel. Also, you should be overriding the getPreferredSize() method to return the size of your image so the panel can be added to another panel and displayed at its proper size.
Comment: @camicker can you be more specific? The intention of creating the DisplayLattice is to enlarge what ever image is passed through to it so I can represent each array element with a rectangle. There is another part for the render method which calculates some values. I did not include it since that is not where my problem was. Sorry, if I mislead you.
Answer: The main problem (you are having) is in your methodTrain method.
new DisplayLattice(exportImageNorm());

This is simply creating a new instance of the DisplayLattice, which has nothing to do with the one that is actually been displayed on you screen...
The simplest solution I can think of is to simply pass the reference you created in MapScreen to the methodTrain method...
new SelfOrganizingMap().methodTrain(pnlMap);

This would allow you to do something like...
public void methodTrain(DisplayLattice map) {
    for (int i = 0; i < 100; i++) {
        map.setImage(exportImageNorm());
    }
}

The only other thing you would need to do after that is add repaint in the setImage method after you reassign the image.
Nit picks

Don't use setBounds, use a LayoutManager, seriously, just make the effort, it will reward you endlessly...
Don't override paint, use paintComponent instead.  This is the recommend method for providing custom painting.  Also, unless you absolutely have a concrete reason not to, you MUST call super.paintXxx and if you don't, you better know what's going to go wrong so you can fix it.
There's no need to call revalidate after repaint, revalidate will schedule a repaint itself.
You also may like to take a look at Code Conventions for the Java Programming Language
Comment: +1, I was just getting to the methodTrain() method, but now I don't have to worry.
Comment: @MadProgrammer, Thanks for the quick reply. I now can get an image on the JPanel update once. But the above fix only displays the image after all the iterations are complete. But I need to display the generated image at each iteration not at the end of all iterations.
Comment: Do you want it animated or do you want the output pane to display each image (like in a grid)?
Comment: @MadProgrammer I want image generated at each iteration to be displayed. So it will form a type of animation when images are replaced with subsequent images generated. So each image generated at each iteration should be updated to the same panel space. I don't want a grid so I can see all images. The output should look something like [this](http://davis.wpi.edu/~matt/courses/soms/applet.html) in the applet once you hit the play button
Comment: The problem you have is you are generating the the images within the context of the Event Dispatching Thread, which is responsible for, amongst other things, processing repaint requests.  So, until the `actionPerformed` method actually exists, no repaints can occur. You have two choices, you can use a `javax.swing.Timer` that on each "tick" would generate a new image or use `SwingWorker` and use the `publish`/`process` methods to update the image. Take a look at [Concurrency in Swing](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/) for more details


Proper naming of chords

Question: Assuming that no chord inversions are in use:
Am I right in believing that in a major chord, there are always 5 semitones between the 1st and 3rd and 4 semitones between the 3rd and 5th?
Am I right in believing that in a minor chord, there are always 4 semitones between the 1st and 3rd and 5 semitones between the 3rd and 5th?
Am I right in believing that in a diminished chord, there are always 4 semitones between the 1st and 3rd and 4 semitones between the 3rd and 5th?
Am I right in believing that in an augmented chord, there are always 5 semitones between the 1st and 3rd and 5 semitones between the 3rd and 5th?
Am I right in believing that in regular seventh chord, e.g. G7 or Am7, the 7th is always two semitones lower than the next tonic? Am I right in believing that in a major7 chord, the 7th is always 1 semitone lower than the next tonic? (7 and major7 chords have always confused me; when I saw them in chord charts, I was never 100% sure if I was supposed to play a 7th one or two semitones below the next tonic.)
Am I correct in believing that something like Gminmaj7 means a Gminor chord (G Bb D) with a major 7 (F#) added and Gmajmin7 means a Gmajor chord (G B D) with a 7 (F) added?
Comment: I don't think this question should be closed. If a asker of question is operating under a false premise then that hardly deserves a close, people ask questions to improve there knowledge of a subject afterall
Comment: @Tim Okay, I see where you're coming from. I think we both addressed it in our answers — it's just miscounting (given the consistency).
Comment: I'm voting to close this question because it's totally based on a false premise.
Comment: @Tim False premise?
Comment: @Aaron - everything quoted is inaccurate. How would you phrase it? If I asked a question stating as a basis that 2+2=5 is what I believe to be true, where do we go?
Comment: lets take this opportunity to improve the premise of this question
Answer: You're so close. Almost right in all counts. You probably started counting too early. First example - 4 semitones between 1 and 3, 3 semitones between 3 and 5.
I think your concept of intervals counts the first note as the first interval. It doesn't, shouldn't, and won't. C>E, for example. C>C♯ (1), C♯>D (1), D<D♯ (1) D♯>E (1). That makes just 4 semitones between C and E. Maybe you could explain where '5' came from.
Comment: You've got it exactly right: I counted the 1st and 3rd when counting from 1st to 3rd. I also counted the 3rd and 5th when counting between them. Sorry, I should have realized I wasn't counting in a standard way. Are the last two paragraphs (about the 7ths and the minmaj majmin chords right?
Comment: @Henry - your last two paras are correct. How about making the rest correct also?
Answer:
My attempt at a joke set-aside you need to get away from counting semi-tones to get intervals. C - E is a major third. Yes it is 4 semi-tones, but you know what is also 4 semi-tones from C, Fb and that is not even a third, but a diminished fourth.
A more accurate and succinct definition of a major chord is three notes a set interval away from a root note. A major chord consisting of a root note, a Major third and a perfect fifth.
So C-E-G is a major chord, but C-Fb-G is not a major chord even if E and Fb is the same amount of semi-tones away from C. You need a certain amount of scale knowledge to start learning how to figure out intervals, but the effective teaching of it does most certainly not comprise the counting of semi-tones because there may be two or three different notes, all of which may be the same amount of semi-tones from the root, each changing the interval.
You unfortunately cannot learn it like this.
Comment: Good point on learning intervals over semitones. I would say in this case it looks like Henry is asking if a major third is always 4 semitones, not if 4 semitones is always a major third
Answer: You're one semitone too large in every instance. For example, a major chord is four semitones and three semitones. It's likely you counted the first note as a semitone, but two notes are required to make a semitone. (C-C#, C#-D, D-D#, D#-E: four semitones make up the first interval in a C major chord in root position.)
Comment: Sorry about that. I expressed myself poorly and counted the intervals incorrectly.
Comment: @Henry No worries. Did your question get answered?
Answer: Others have already pointed out you need to subtract one from all your semi-tone counts.
But, also there is one particular point to make about naming...

Gmajmin7 means a Gmajor chord (G B D) with a 7 (F) added?

That would be a G dominant seventh chord. The pop/jazz label for it is G7. Gmajmin7 does convey the right information, but by the conventions of the chord label system you don't need to explicitly list the majmin part, because those are the "default" qualities. The base triad is always major unless labeled otherwise and the 7 is always a minor seventh unless labeled otherwise.
Personally, the way I look at the pop/jazz labeling is this: chord tones above the root are assumed to be a dominant thirteenth chord, like G13 in C major. So, the intervals above the root G are: M3, P5, m7, M9, P11, M13 or major third, perfect fifth, minor seventh, perfect eleventh, major thirteenth. So, while a G7 has no modifiers and is understood to be a dominant seventh chord composed of M3 P5 m7 modifiers can be added to it to make something like Gmin7♭5, min changes the base triad from major to minor and the ♭5 changes the P5 perfect fifth to a d5 diminished fifth.
You can define chords as stacked thirds, but you can also think of chords are root plus third and fifth, and for seventh chords plus a seventh. This can be helpful, because you then see the importance of a perfect or not perfect fifth in various chords:

major triad: root + M3 + P5
minor triad: root + m3 + P5
diminished triad: root + m3 + d5
augmented triad: root + M3 + A5 (augmented fifth)

A basic list of seventh chords is:

major seventh chord: major triad + major seventh
minor seventh chord: minor triad + minor seventh
dominant seventh chord: major triad + minor seventh
half diminished seventh chord: diminished triad + minor seventh
diminished seventh chord: diminished triad + diminished seventh

Keep in mind there is a diminished fifth inside the dominant seventh chord between the third and seventh.

Proper naming of chords


online semi-supervised learning with incomplete input data

Question: Let's assume that one has the following inputs and corresponding outputs:
<code>x1 = (a,b,c) with corresponding output y1, which is a number.
x2 = (d,e,?) with unknown output
x3 = (?,?,g) with known output y2, which is a number
</code>
and so on.
So, by "incomplete input data" I don't just mean that some input data is unlabeled but some data-points from certain data-vectors are missing and are sometimes labeled and sometimes unlabeled.
Is there at least one known online semi-supervised learning algorithm for this kind of "input data with gaps"?
So far I only found algorithms for online semi-supervised learning for "input data without any gaps".
Answer: I came across a new paper that does just this, however I have not read it carefully: Max-Ordinal Learning.
Another option is the E-M algorithm, which is commonly used with missing data.


AWK: keep appending information to the same row in a new column to file1 from file2 by matching a particular column

Question: Both of my files looks like this
file1
NC_000001.11:g.100007038C>T
NC_000001.11:g.100007039C>A

file2
NC_000001.11:g.100007038C>T     NM_001271684.2:c.347C>T     NP_001258613.1:p.Thr116Met
NC_000001.11:g.100007038C>T     NM_001271685.2:c.473C>T     NP_001258614.1:p.Thr158Met
NC_000001.11:g.100007038C>T     NM_012243.3:c.347C>T        NP_036375.1:p.Thr116Met
NC_000001.11:g.100007039G>A     NM_001271684.2:c.348G>A     NP_001258613.1:p.Thr116%3D
NC_000001.11:g.100007039G>A     NM_001271685.2:c.474G>A     NP_001258614.1:p.Thr158%3D

My desired output:
I want to match the first column from file2 to the first column of my file1. If the match is true, then I want to add to append the third column of file2 to a new column in file1 such as to obtain:
file1
NC_000001.11:g.100007038C>T     NP_001258613.1:p.Thr116Met, NP_001258614.1:p.Thr158Met, NP_036375.1:p.Thr116Met

Here's my try:
awk 'BEGIN{ FS=OFS="\t" }
NR==FNR {a[$0]; next;}
{
        for (k in a) {
            if ($1 == k) {
                print $0 "\t" a[$3]
            }
        }
}' file1.txt file2.txt

But will not produce my desired output:
NC_000001.11:g.100007038C>T     NM_001271684.2:c.347C>T     NP_001258613.1:p.Thr116Met
NC_000001.11:g.100007038C>T     NM_001271685.2:c.473C>T     NP_001258614.1:p.Thr158Met
NC_000001.11:g.100007038C>T     NM_012243.3:c.347C>T        NP_036375.1:p.Thr116Met
NC_000001.11:g.100007039G>A     NM_001271684.2:c.348G>A     NP_001258613.1:p.Thr116%3D
NC_000001.11:g.100007039G>A     NM_001271685.2:c.474G>A     NP_001258614.1:p.Thr158%3D

Thank you in advance.
PS: file1 contains unique entries. file2 is sorted, tab-separated and contains more than 3 million entries.
Edit:
What I meant by tab-separated is that the new column is appended as tab-separated but the values inside that column are comma separated.
Answer: Could you please try following, written and tested with shown samples.
awk '
BEGIN{
  OFS=", "
}
FNR==NR{
  array[$1]=(array[$1]?array[$1] OFS:"")$NF
  next
}
($1 in array){
  print $1"\t"array[$1]
}
'  Input_file2   Input_file1

In case you want to save output into Input_file1 then try following:
awk '
BEGIN{
  OFS=", "
}
FNR==NR{
  array[$1]=(array[$1]?array[$1] OFS:"")$NF
  next
}
($1 in array){
  print $1"\t"array[$1]
}
'  Input_file2   Input_file1 > temp && mv temp Input_file1

Explanation: Adding detailed explanation for above code here.
awk '                                                ##Starting awk program from here.
BEGIN{                                               ##Starting BEGIN section of this awk program from here.
  OFS=", "                                           ##Setting OFS as comma space here.
}
FNR==NR{                                             ##Checking condition FNR==NR which will be true when Input_file2 is being read.
  array[$1]=(array[$1]?array[$1] OFS:"")$NF          ##Creating array with index $1 and value is last field of line.
  next                                               ##next will skip all further statements from here.
}
($1 in array){                                       ##Checking condition if 1st field of current line is present in array then do following.
  print $1"\t"array[$1]                              ##Printing first column TAB and then value of array with index $1 here.
}
'  Input_file2  Input_file1                          ##Mentioning Input_file names here.

Answer: Another awk. Your sample code said FS=OFS="\t" but output ", " so I used the former latter. Also, your expected output is not met as only one item in file1 is matched in file2.
$ awk '
BEGIN {
    FS=OFS="\t"                         # delims
}
NR==FNR {                               # process file1
    a[$0]                               # hash key only to see if values in file2
    next
}
($1 in a) {                             # if found in file1
    a[$1]=a[$1] (a[$1]==""?"":", ") $3  # append to the corresponding item
}
END {                                   # in the end
    for(i in a)
        if(a[i]!="")                    # print all non-empty ones
            print i,a[i]
}' file1 file2

Output with your data:
NC_000001.11:g.100007038C>T     NP_001258613.1:p.Thr116Met      NP_001258614.1:p.Thr158Met      NP_036375.1:p.Thr116Met

Comment: Sorry if I misexplained myself, but what I really meant is that the second column is tab-separated value but the values inside that column are comma separated `", "` Thank you for the answer !
Comment: Sure, fix'd it.


Are there other solutions of $x^{x^3-x}=2^{x^2+x}$ than $x=-1 $ and $x=2$ in $\mathbb{R}$?

Question: I have tried to solve that equation $x^{x^3-x}=2^{x^2+x}$ in $\mathbb{R}$  , I have got only two integers solutions which they are : $x=-1$, $x=2$ , are there others ?
Note: if we try to study this : $\frac{x^3-x}{x^2+x}=\frac{\log x}{\log 2}$, I think there is a numerical solution in the range $( 0,1)$ using value intermediate theorem, it is to show that there is a solution here, but i can't determine it
Comment: Another obvious solution is $x=0$ because $0^0=1=2^0$
Comment: I don't think we should consider 0 a solution as $0^0=1$ is debatable.
Comment: $0^0$ is an *indeterminate form* (mostly because $(x,y)\mapsto x^y$ is not continuous there) but not an *undefined expression*. $0^0$ is the number of maps from the empty set to the empty set.
Comment: Wolfram finds a solution around $x≈0.346323$.
Comment: Thanks so much, i didn't montioned that because i have consedred x=0 as indeterminate case
Comment: @HagenvonEitzen I'm not sure that I would say that $0^0=1$ _in $\mathbb{R}$_ - which is explicitly what the title of the question asks about. This certainly comes down to semantics, but I wouldn't fault someone for saying that $x=0$ is not a solution.
Comment: $2$ is not a solution and $-1$ does not belong to the domain of $x^{x^3-x}$.
Answer: HINT: Write your equation in the form
$$\ln(x)-\frac{x^2+x}{x^3-1}\ln(2)=0$$, define
$$f(x)=\ln(x)-\frac{x^2+x}{x^3-1}\ln(2)$$ and use calculus.
Comment: @Dr.Sonnhard Graubner , But you didn't add any thing to my above note ,I want to add me somthing otherwise than i have wrote above
Comment: So you want to tell me that you have a closed form for the $0.346323\dots$ solution?
Comment: This can i not tell you, sorry, but you can construct the image of the function and you will get the Information, how many solution the equation has.
Comment: You will never find all solutions of your equation, but with my hint, you can prove how many solutions the equation has.
Answer: I think the domain should be restricted to positive real numbers. I mean, the expressions make sense for some negative numbers, but not so many of them. (It is problematic to raise a negative number to a non-integer exponent.)
So let $x$ be positive. Then after taking the logarithm we obtain: $(x^2+x)\log 2= \log x\cdot (x^3-x)$. Simplyfying by $x$ and $x+1$ yields $\log 2= \log x\cdot (x-1)$, or equivalently $\log 2- \log x\cdot (x-1) =0$. Clearly $x=2$ is a solution. The function $f(x)= \log 2- \log x\cdot (x-1)$ on the left is strictly monotone increasing on $]0,1[$ and decreasing on $]1,\infty[$ (pay attention to the signs). As $f(1)>0$, there can be two roots, one on each interval. There is one on $]1,\infty[$, namely $x=2$. There is also one on $]0,1[$, as $f$ changes signs there. For example $f(1/4)< 0$.


Continuous at exactly two points and differentiable at exactly one of them

Question: Give an example of a function which is continuous at exactly two points and differentiable at exactly one of them. Justify your answer.
This question is from a competitive examination. I have of thinked a solution but I didn't get it
Comment: How about $f(x)=x^2$ if $x$ is rational, $f(x)=x^3$ if $x$ is irrational?
Comment: will you please explain about differentiability
Comment: What solution did you think of?
Comment: @Travis $f(x)=x^2$ if $x$ is rational ,$f(x)=1$ if $x$ is irrational this function is continuous at 1 and -1 .but i don't know about differentiability
Comment: @bof is that function is differentiable only at $x= \frac{3}{2}$?
Comment: That function is diff. at $0$ and continuous at $0,1$. You can check by definition.
Comment: @John will you please explain about differentiability ?
Comment: You need to know if $\lim_{x\to 0} \frac{f(x) - f(0)}{x-0}$ exist. For this function provided by bof, this limit is $0$.
Comment: @Anonymous The function you give is not differentiable anywhere.
Answer: Hint Let $\chi_{\Bbb Q}$ denote the indicator function of the set $\Bbb Q$ of rational numbers, that is
$$\chi_{\Bbb Q}(x)
:= \left\{\begin{array}{cl}1,& x \in \Bbb Q \\ 0, & x \not\in \Bbb Q\end{array}\right. .$$
Then, $|x \chi_{\Bbb Q}(x)| \leq |x|$ for all $x$. So, by the Squeeze Theorem,
$\lim_{x \to 0} |x \chi_{\Bbb Q}(x)| = 0 = x\chi_{\Bbb Q}(x)\vert_{x = 0}$, and thus by definition the function $$x \mapsto x \chi_{\Bbb Q}(x)$$ is continuous at $x = 0$. One can show with a little more effort that this is the only point at which it is continuous. On the other hand, the limit
$$\lim_{h \to 0} \frac{h \chi_{\Bbb Q}(h) - 0 \chi_{\Bbb Q}(0)}{h - 0} = \lim_{h \to 0} \chi_{\Bbb Q}(h)$$
does not exist, so by definition the function is not differentiable at $x = 0$.
Now, the function $$x \mapsto x^2 \chi_{\Bbb Q}(x)$$ is continuous at $x = 0$ (it is a product of functions continuous there) but again nowhere else, and applying the above squeezing argument to the limit of the difference quotient there shows that it is differentiable.
Can you build a function out of these two functions that satisfies the given conditions?


Sub-theme navigation menu and footer menu not showing

Question: I have created a sub-theme using a purchased theme. While creating sub-theme I followed these steps as mentioned in the documentation:

I have created subtheme.info.yml and subtheme.libraries.yml
files.
I have also copied regions to subtheme.info.yml file from
basetheme.info.yml.
Then created context as it was there on base theme.

Now everything is working fine but main navigation and footer links are not showing. I also confirmed the position of each block in "Block layout".
I am new to drupal so not getting how to solve this issue. I am using drupal 8.6.1
EDIT 1
Here are some images get idea about the issue:
Headers

Above screenshot is from parent theme as a default.

Above screenshot is from sub-theme. Here you can see the nav links and logo text link is missing
Same with footers:

Footer parent theme

Footer sub-theme. Links/Blocks missing.
yml files
Subtheme: https://pastebin.com/KmhD2BSh
Parent Theme: https://pastebin.com/T1XQq8T8
EDIT 2
subtheme.theme
(I picked it from official resource but added after the subtheme was set as default)
/**
 * Implements hook_theme_suggestions_HOOK_alter for blocks.
 */
function subtheme_theme_suggestions_block_alter(&$suggestions, $variables) {

  // Load theme suggestions for blocks from parent theme.
  foreach ($suggestions as &$suggestion) {
    $suggestion = str_replace('subtheme', 'virgor', $suggestion);
  }
}

EDIT 3
I noticed all the links on navigation bar including logo text link is showing on other pages like contact, blog but the styling is not getting applied to them. And getting this error inside console:
js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:2062 Uncaught Error: Quick Edit could not associate the rendered entity field markup (with [data-quickedit-field-id="node/5/uid/en/teaser"]) with the corresponding rendered entity markup: no parent DOM node found with [data-quickedit-entity-id="node/5"]. This is typically caused by the theme's template for this entity type forgetting to print the attributes.
    at processField (js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:2062)
    at HTMLSpanElement.<anonymous> (js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:2179)
    at Function.each (js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:2)
    at r.fn.init.each (js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:2)
    at Object.attach (js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:2178)
    at js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:62
    at Array.forEach (<anonymous>)
    at Object.Drupal.attachBehaviors (js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:59)
    at js_XPobW92vm-QdWeFPYokxAO-5aOHsW7b5uAqFwCBjrZM.js:244
    at HTMLDocument.t (js_BKcMdIbOMdbTdLn9dkUq3KCJfIKKo2SvKoQ1AnB8D-g.js:4)

EDIT 4
I enabled template debug and found that main navigation block was not automatically placed as it is in parent so I place it but still site_branding block is not placed by default and there is no region to place it.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/84477/discussion-on-question-by-sagar-guhe-sub-theme-navigation-menu-and-footer-menu-n).
Comment: Wondering why the multiple downvotes?
Answer: Here are some suggestions:

Check that you added the same theme regions in your child theme as
the parent theme
Check the documentation of the parent theme for Drupal version compatibility. Usually purchased themes come with a demo that contains a Drupal installation. Try working with that first.
Try disabling JS related core modules: BigPipe, Contextual Links, QuickEdit
Try disabling JS aggregation from /admin/config/development/performance
Comment: thanks for your answer! but I have added the same regions as parent theme, I have added the pastebin links too, Parent theme is compatible with the version I am working on as Parent theme works perfectly. I have disabled JS aggregation cleared cache but no effect.
Answer: After searching for longtime, waiting for an answer and many hair pulling events I finally found the solution...

Initially I was trying to compare admin/structure/context for sub-theme (enabled) homepage with parent theme (enabled) homepage and those conditions and reactions matched perfectly.
Then as Ismail Cherri mentioned in his answer I did all the checks but no avail.
Enabled twig template debug as @cchen mentioned in a comment. (It helped me lot to know how blocks and templates working).
Checked if all the blocks are enabled from admin/structure/Block Layout

Solution: Finally I got to know that parent theme had those missing blocks by default present that is why comparing homepage context with parent theme  homepage made me confused. So adding them in a proper region solved the issue.
I still didn't get why those block were present on parent theme even when they were not placed in context. I will update my answer when I will get the explanation to that and will also check if this is the behaviour with this theme only or every themes reacts the same.
Update 1

I still didn't get why those block were present on parent theme even when they were not placed in context

So there was a context named "Global" which had condition current_theme and in reaction all the blocks that theme was providing was there. But when I created sub-theme and set it as default all those default contexts duplicated with no reaction and condition. So this was the main reason why Main Navigation and Footer Menu was missing in sub-theme and not in Parent theme.


Line number in file

Question: I'm having some problem with getting line number.
Here is what I got :
<code>        var lines = File.ReadLines(fileNameData, Encoding.Default);

        foreach (string line in lines)
        {
            if (line.Contains("()"))
            {
                MessageBox.Show(line );
            }
        }
</code>
Which show me
<code>       MessageBox.Show(line );
</code>
So it's shows me lanes which contains (), and it works correctly.
Is there any possibitity to get this line number.
<code>       MessageBox.Show(line + lineIndex);
</code>
Does anyone know how to accomplish that?
Comment: use a counter variable.
Comment: Declare a integer outside the for loop, then increment it each loop, eg: int i=0;  and i++;
Answer: What you could do is add an interger variable and increment this value for each line that you 'traverse'. Eg.
int counter = 0;
and then in the foreach loop
counter++;
Answer: Try this:
<code>    var lines = File.ReadLines(fileNameData, Encoding.Default);
    int lineIndex=0;

    foreach (string line in lines)
    {
        if (line.Contains("()"))
        {
            MessageBox.Show(line + lineIndex);
        }
        lineIndex++;
    }
</code>
Comment: thanks, it works :)
Comment: In your rush to answer, you forgot to make sure your post was formatted correctly.
Comment: I just formatted :)

Line number in file


Visual Studio 2015 not showing project folder content

Question: Fixed by Repairing the VS2015 from the setup file.

I've added a VS 2013 project to Visual Studio 2015. It compiles and
  runs as expected, but in Solution Explore i can't see the content of
  the folders.
I've tried deleting the folders and adding them again, but it didn't
  work.
Any ideas? I also use SourceTree for the project, but i don't think
  it's relevant.
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/Bhm3B.png
Edit 1: Please note that this issues happens to all the folders in the
  project (Resourfes, Themes, Sources)
1.) The files exist and are visible in Windows Explorer
2.) Deleting and adding the folder again, or the individual files in a newly  created folder does not change the situation.
3.)  csproj has the files that are not show in the folders :
<code>     <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Compile Include="Sources\LoginViewModel.cs" />
    <Compile Include="Sources\RelayCommand.cs" />
    <Compile Include="Sources\ViewModel.cs" />
    <Compile Include="Login.xaml.cs">
      <DependentUpon>Login.xaml</DependentUpon>
    </Compile>
    <Compile Include="WrongPassword.xaml.cs">
      <DependentUpon>WrongPassword.xaml</DependentUpon>
    </Compile>
    <Page Include="MainWindow.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="MainWindow.xaml.cs">
      <DependentUpon>MainWindow.xaml</DependentUpon>
      <SubType>Code</SubType>
    </Compile>
    <Page Include="Resources\Icons.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Dark\MetroDark.MSControls.Core.Implicit.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Dark\MetroDark.MSControls.Toolkit.Implicit.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Dark\Styles.Shared.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Dark\Styles.WPF.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Dark\Theme.Colors.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Light\Metro.MSControls.Core.Implicit.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Light\Metro.MSControls.Toolkit.Implicit.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Light\Styles.Shared.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Light\Styles.WPF.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Themes\Metro\Light\Theme.Colors.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Login.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="WrongPassword.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
</code>
Comment: There is a button to show 'hidden' files in the solution explorer. Click it, select the files you are interested in and select 'include in project' from the context menu.
Comment: Look inside `csproj` file and post here related `ItemGroup` (for that `Sources` folder).
Answer: After adding the file to the correct folder. Click on the Show all Files option, include the file in the project. And that's it
Answer: The files are probably not listed in the solution. Try right-clicking the folder in VS, selecting 'Open in File Explorer', then dragging the contents onto the folder in VS. This should add them to the .sln file.
Answer: Fixed by Repairing the VS2015 from the setup file.
Answer: Faced this problem with VS 2015 Community Edition and identified the problem happened due to one of the extensions (Mexedge Stylesheet extension in my case). After disabling this extension and restarting, the problem was resolved.
Answer: I had the same problem. Repair of installation did not help. Uninstallation and new installation did the work.
Answer: If it's converted, then the file should be there. Maybe the solution file refreshed and skipped the reference of this folder.
Try these steps:

Right-click on the solution and unload it, then edit the solution (right-click and edit the solution), check the file's path defined and determine if it's correct or not.
Navigate to the project directory and check files are there or not. If the files are there then: refresh the solution and click to show the hidden files, and if you see those file, then add to the solution.
If the files are not in the directory, add the existing file to the solution.
Answer: Had this problem, but only on one particular project, where I couldn't see files in folders.  If I opened another project, I could see its files that were in folders, so I knew I didn't have a Visual Studio-wide problem.  So then I just rebuilt my project. Steps:

Shut down Visual Studio.
Moved my project to another folder (so I could re-create my project with its old name)
Launched VS.  Created another project like my last one, including all pages and folders.
Copied my old pages from my old Explorer folder on top of the pages in my new project's Explorer folder (Visual Studio recognizes the changes and asks you if you want to reload the content - say "Yes to All").
Copy the classes from the old Explorer folder to the new one.
In VS, in the Solution Explorer, right-click the folder you created there that represents the Explorer one you copied classes to in step 5, select "Add Existing Item..." and highlight all the classes (Ctrl+A, or hold Ctrl and click the mouse on the files) and click Add.

You should be back where the Solution Explorer is able to show your files again.
Answer: In VS 2015 We have new feature Hide Folder/Unhide folders. some times people by unintesitionally press it. you can get it back, right click the on solution and click on unhide option from the list as shown in picture below.


How can i prove that the theory of random graph has a vaughtian pair?

Question: I'm searching for theories that have a vaughtian pair. I've been given a hint, that $T_{RG}$ has at least one. I have also found many theorems stating in which cases a theory has no vaughtian pair, but none the other way round.
1) Can you give me a (short) proof?
2) Do you know other theories that have a vaughtian pair (with(out) proof)?
Definition of a vaughtian pair:
T has a Vaughtian pair if there are two models $\mathfrak{M} \prec \mathfrak{N}$ and an L(M)-formula $\phi(x)$ such that: $\mathfrak{M} \neq \mathfrak{N}$, $\phi(\mathfrak{M})$ is infinite and $\phi(\mathfrak{M}) = \phi(\mathfrak{N})$
Comment: By $\phi(\mathfrak M)$ do you mean $\{x\in\mathfrak M\mid \mathfrak M\models\phi(x)\}$?
Comment: @Asaf: Yes.${}{}{}$
Answer: For (2), Peano arithmetic has a Vaughtian pair. Take $\mathfrak{M}$ and $\mathfrak{N}$ to be non-standard models such that $\mathfrak{N}$ is a proper elementary end-extension of $\mathfrak{M}$, fix an infinite $c \in M$, and let $\varphi(x)$ be $x<c$.
Added:
It took a while, but I think that I can now answer the first question as well. Let $G = \langle V,E \rangle$ be the random graph. Fix a vertex $v_0 \in V$, and let $V_0 = V \setminus \{v_0\}$. The partition property of the random graph ensures that $G_0 \triangleq G[V_0]$, the subgraph induced by $V_0$, is isomorphic to $G$, so $G_0 \prec G$ as models of $T_{RG}$, since $T_{RG}$ is model-complete. (Model-completeness follows, for example, from Theorem 3.1.12 in C.C. Chang & H. Jerome Keisler, Model Theory. In fact $T_{RG}$ even admits quantifier elimination.)
Fix any vertex $v_1 \in V_0$ such that $\{v_0,v_1\} \notin E$, and let $\varphi(x)$ be $R(x,v_1)$, where $R$ is the symbol for the edge relation in the language of $T_{RG}$. Then the infinitely many vertices satisfying $\varphi(x)$ are all in $V_0$, so $\varphi(G_0) = \varphi(G)$.
Comment: wow! as simple as sufficient, nice answer, thx
Comment: @Sebastian: I've added an answer to your first question. (I'm not sure whether you're automatically informed of edits.)
Comment: The fact that $G_0$ is isomorphic to $G$ does not ensure $G_0 \prec G$. For example $\mathbb Z$ is isomorphic to $2\mathbb Z$ in a language containing only $+$. But $\exists x (x + x) = 2$ is true in the first structure, but false in the second.
Comment: @Levon: In this case it does: $T_{RG}$ is model-complete. But I should have said so, and I've edited the answer accordingly.
Comment: @Brian: Ok, then you gen an upvote :)
Comment: definitely an upvote, Thank you Brian
Comment: I would've argued like this: prove that $G_0\models{RG}$, since $RG$ is complete, by vaught's test, $G_0$ and $G$ satisfy the same sentences, and since $RG$ has quantifier elimination, using induction on formulas, one can prove from all of this that $G_0\prec{G}$


Is it possible to redirect (not forward) email in procmail?

Question: I am using the following rule to forward email in .procmailrc
# in .procmailrc

* ^Subject.*something
! email@example.com

The filtering and forwarding part works as intended. However, the email received by firstname.lastname@example.com has my local email address as the sender. I want to the keep the original sender so that any reply goes to the original sender and not my local address. Is there any way to do this?
Answer: This seems confused on multiple accounts. Forwarding does not touch the headers at all, and any reply from a RFC-conformant client should go to the sender indicated in the headers.
In some more detail, the Reply-To: header is the primary factor which decides where the reply should go (though some email clients vigilantly ignore this standard, cough Outlook cough); secondly, the "sender" in this context usually means the From: header which is not modified by Procmail at all in this scenario. Tertiarily, there is also the Sender: header, which was used in some legacy clients to indicate that the From: header was not the true sender; some clients show this as "on behalf of". Again, this is not modified by Procmail when you forward a message.
Finally, there is the envelope sender, which is copied into the Return-Path: header at delivery time by most delivery clients. This one does get changed under forwarding. Under some circumstances, you can change it back, but you should understand the technical consequences.
Basically, the envelope sender is only used to identify where to send a bounce message. So if you forward a message and change the envelope sender, and the forwarding operation fails, the bounce message will get sent back to the original envelope sender. They have no control over your forwarding arrangement, so they have no way to troubleshoot or fix this error.  In other words, you will basically be setting them up for getting some blowback spam.
Having said that, if you really wanted to, you could.  The following assumes that you have the envelope sender in Return-Path: and that the configuration of the system allows you to override the envelope sender with sendmail -f. This is technically email forgery, so some sites disable this option altogether, and some others only allow it for a small subset of privileged accounts.
:0
* ^Return-Path:[    ]*<?\/[^<>]+
! -f "$MATCH" firstname.lastname@example.com

(You could technically pick apart the capturing into MATCH and refactor it into a separate recipe before the forwarding recipe. The whitespace inside [...] consists of a space and a tab, but Server Fault will render it as a sequence of spaces, so you can't just copy/paste it from here.)