text:
Q: How much does post-GoF Voldemort remember about events in PS? Is there any canon evidence of exactly how much does post-GoF Voldemort remember about events in PS (e.g. what happened when he occupied the insides of Quirrell's turban)?

A: Yes, he remembers what happened while he possessed Quirrell.
When the Dark Lord explains to his Death Eaters how he survived every circumstance he faced, he gives a synopsis of what happened while he possessed Quirrell. He doesn't go into the small details, because possessing Quirrell and trying to steal the Stone was only a small part of his story, which spanned years in total.  He described the chain of events well enough, though, that it shows he remembers it. He mentions how he saw Quirrell as his opportunity to get the Stone and gain immortality, how that plan was unsuccessful because of Harry Potter, and how Quirrell died and he moved on but still in his weakened form.

"Then … four years ago … the means for my return seemed assured. A wizard – young, foolish and gullible – wandered across my path in the forest I had made my home. Oh, he seemed the very chance I had been dreaming of … for he was a teacher at Dumbledore's school … he was easy to bend to my will … he brought me back to this country, and after a while, I took possession of his body, to supervise him closely as he carried out my orders. But my plan failed. I did not manage to steal the Philosopher's Stone. I was not to be assured immortal life. I was thwarted … thwarted, once again, by Harry Potter …'
Silence once more; nothing was stirring, not even the leaves on the yew tree. The Death Eaters were quite motionless, the glittering eyes in their masks fixed upon Voldemort, and upon Harry.
'The servant died when I left his body, and I was left as weak as ever I had been,' Voldemort continued."  - Harry Potter and the Goblet of Fire, Chapter 33 (The Death Eaters)

A: I think its safe to assume that Post GoF Voldemort will retain all memories of his time possessing Quirrell.

*

*We have 0 evidence that he forgot anything.

*We know that it was the primary piece of his soul possessing Quirrell, the piece that contains all of his memories.

*We Know that he retained the memories of other possessions that were similar to this, such as the animals he possessed while hiding.

*We know that after he regains his body, he is able to posses other creatures, such as Nagini, in a very dominate fashion most likely due to the fact that he has a fragment of his soul attached to her, and appears to have full control/memory of the possessions.

*He actually mentions that he was thwarted in the retrieval of the philosophers stone. So he acknowledges that he indeed has some of the memories of this event, as at this time, no one else who hes been in contact with would have known this event occurred. We can assume that other then Harry and the gang, only Snape and Dumbledore would have known the extent of his attempt on the stone, and in the graveyard he had not yet come back into contact with Snape.


text:
Q: Use of Can vs. May Should I use can or may in the following sentence: "For more information on how you can help with wreath sponsorship..." ?

A: One of my old instructors used to tease us about this. A student would ask:

"Can I go to the bathroom?"

To which he would respond:

"I don't know, can you?"

So while you certainly may use "can" in that context, the term concerns ability (or capacity) more than it does permission.

"May I go to the bathroom?"

Would be deemed the technically "proper" form of the question.
But again, as others in the comments note, it's not a significant difference. Both are used interchangeably in modern speech.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Find the indefinite integral $\int\frac{dx}{(x^2+2x+5)^2}$ I need help with the indefinite integral
\begin{align}
& \int\frac{dx}{(x^2+2x+5)^2} \\[10pt]
= {} & \int\frac{dx}{((x+1)^2+4)^2} = \int\frac{du}{(u^2+4)^2} & & x+1=u,\quad du=dx \\[10pt]
= {} & \frac{1}{16} \int\frac{du}{(\frac{u^2}{4}+1)^2} \\[10pt]
= {} &  \frac 1 8 \int \frac{ds}{(s^2+1)^2} = \text{?} & & \frac u 2 = s, \quad 2\,ds=du
\end{align}
or maybe there is an easier way ?
Any ideas ? thanks !

A: it is $$x^2+2t+5=(x+1)^2+4$$ we Substitute $$x+1=t$$ then we have $$dx=dt$$
and $$\int\frac{1}{(t^2+4)^2}dt$$ and then we Substitute $$t=2\tan(s)$$ with $$dt=2\sec^2(s)ds$$ and we get $$(t^2+4)^2=16\sec^4(s)$$ and our integral is $$2\int \frac{\cos^2(s)}{16}ds$$ and in the last step note that $$\cos^2(s)=\frac{1}{2}\cos(2s)+\frac{1}{2}$$

A: If you write $s = \tan(t)$ then you obtain $\sec^2(t)\,\mathrm{d}t = \mathrm{d} s$ and
$$
 \int \frac{1}{(1+s^2)^2}\,\mathrm{d}{s}=\int \cos^2(t)\,\mathrm{d}{t}
$$
you can then solve the second integral by using the double-angle formula for cosine.

A: There is a reduction process. Apply integration by parts.
$$\int \frac{1}{1+x^2}\,dx=\frac{x}{1+x^2}-\int x \,d\frac{1}{1+x^2}$$
$$=\frac{x}{1+x^2}+2\int \frac{1}{1+x^2}\,dx-2\int \frac{1}{(1+x^2)^2}\,dx$$
And rearranging,
$$2\int \frac{1}{(1+x^2)^2}\,dx=\frac{x}{1+x^2}+\int \frac{1}{1+x^2}\,dx$$


text:
Q: TensorFlow / Keras Error : dlerror: cudart64_101.dll not found I wrote a program using Keras. When I run the program it crashes with an error as seen below:
2021-02-23 18:50:50.  : W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2021-02-23 18:50:50.  : I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

Traceback (most recent call last):
  File "C:/Users/USER/PycharmProjects/Sofia/main.py", line 26, in <module>
    X = dataset[:,0:8]
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\frame.py", line 3024, in __getitem__
    indexer = self.columns.get_loc(key)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 3080, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas\_libs\index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 75, in pandas._libs.index.IndexEngine.get_loc
TypeError: '(slice(None, None, None), slice(0, 8, None))' is an invalid key

Here is my code:
# Develop Neural Network with Keras

# Load Libraries
# first neural network with keras tutorial
from keras.models import Sequential
from keras.layers import Dense
import numpy
from pandas import read_csv
# fix random seed for reproducibility
seed = 7
numpy.random.seed(seed)
# Load Data
dataset = read_csv('pima-indians-diabetes.data.csv', delimiter=',')
# split into input (X) and output (y) variables
X = dataset[:,0:8]
y = dataset[:,8]
# Define Keras Model
model = Sequential()
model.add(Dense(12, input_dim=8, activation='relu'))
model.add(Dense(8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
# Compile Keras Model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
# Fit Keras Model
model.fit(X, y, epochs=150, batch_size=10)
# Evaluate Keras
_, accuracy = model.evaluate(X, y)
print('Accuracy: %.2f' % (accuracy*100))

How would I go about fixing this error?

A: You probably haven't installed the NVIDIA GPU Computing Toolkit, OR your paths are not configured correctly OR your tensorflow installation version requires a different cuda version. You can try using tensorflow CPU if you don't want or can't set up your GPU (e.g. because you don't have on).


text:
Q: UnicodeDecodeError: 'ascii' codec can't decode byte 0x87 in position 10: ordinal not in range(128) I'm working with images2gif and getting this error. Any ideas?
UnicodeDecodeError: 'ascii' codec can't decode byte 0x87 in position 10: ordinal not in range(128)
Test file:
from PIL import Image
from images2gif import writeGif

FRAMES = 2
FRAME_DELAY = 0.75
WIDTH, HEIGHT = 600, 600

frames = []
img1 = Image.open('1.jpg')
img2 = Image.open('2.jpg')
frames.append(img1)
frames.append(img2)

writeGif("test.gif", frames, duration=FRAME_DELAY, dither=0)

Traceback:
Traceback (most recent call last):
  File "gif.py", line 15, in <module>
    writeGif("topmovie.gif", frames, duration=FRAME_DELAY, dither=0)
  File "/Users/Craig/Documents/github/RTB/images2gif.py", line 575, in writeGif
    gifWriter.writeGifToFile(fp, images, duration, loops, xy, dispose)
  File "/Users/Craig/Documents/github/RTB/images2gif.py", line 435, in writeGifToFile
    fp.write(header.encode('utf-8'))

images2gif line 435: fp.write(header.encode('utf-8'))
Updated traceback:
Traceback (most recent call last):
  File "gif.py", line 16, in <module>
    writeGif("test.gif", frames, duration=FRAME_DELAY, dither=0)
  File "/Users/Craig/Documents/github/RTB/images2gif.py", line 579, in writeGif
    gifWriter.writeGifToFile(fp, images, duration, loops, xy, dispose)
  File "/Users/Craig/Documents/github/RTB/images2gif.py", line 440, in writeGifToFile
    fp.write(globalPalette)
TypeError: must be string or buffer, not None

A: Your updated question is also here: Error in images2gif.py with GlobalPalette
It references an issue on images2gif in which the author says they're going to rewrite the module to not use PIL/Pillow, but are busy: https://code.google.com/p/visvis/issues/detail?id=81
That in turn references a patched images2gif that is claimed to fix the issue: https://github.com/rec/echomesh/blob/master/code/python/external/images2gif.py


text:
Q: Get the value of data-* without knowing the specific id I have this html with a data tag with the name price.

$('input:radio[name="optradio"]').change(function() {
  var selectedText = $(this).closest('.radio-inline').text();
  var selectedCapacity = $(this).attr('data-capaciteit');
  var selectedPrice = $(this).closest('.bb').attr('data-price');
  console.log('Selected Text ', selectedText);
  console.log('Selected Capacity ', selectedCapacity);
  console.log('Selected Price ', selectedPrice);
});

Economy

    <ion-icon class='ic' name='information-circle-outline' data-toggle='tooltip' data-placement='right' title='lorem ipsum'></ion-icon>

Ksh 250

 Pickup by 00:00 pm

                <input type='radio' name='optradio' value='any' data-capaciteit='economy' checked>Any

                <input type='radio' name='optradio' value='box' data-capaciteit='economy'>Box

                <input type='radio' name='optradio' value='no box' data-capaciteit='economy'>No Box

This is the fiddle http://jsfiddle.net/9foqat3k/3/
I am interested in reading Ksh 250 when a radio button is clicked.
This line var selectedPrice = $(this).closest('.bb').attr('data-price'); gives undefined. How would i read price without knowing the id of the span?

A: .closest() searches only in ancestors.
Instead, use this:
var selectedPrice = $(this).closest('.gbo').find('.transport_amount .bb').data('price');

$('input:radio[name="optradio"]').change(function() {
  var selectedText = $(this).closest('.radio-inline').text();
  var selectedCapacity = $(this).data('capaciteit');
  var selectedPrice = $(this).closest('.gbo').find('.transport_amount .bb').data('price');
  console.log('Selected Text ', selectedText);
  console.log('Selected Capacity ', selectedCapacity);
  console.log('Selected Price ', selectedPrice);
});

Economy

    <ion-icon class='ic' name='information-circle-outline' data-toggle='tooltip' data-placement='right' title='lorem ipsum'></ion-icon>

Ksh 250

 Pickup by 00:00 pm

      <input type='radio' name='optradio' value='any' data-capaciteit='economy' checked>Any

      <input type='radio' name='optradio' value='box' data-capaciteit='economy'>Box

      <input type='radio' name='optradio' value='no box' data-capaciteit='economy'>No Box


text:
Q: Android Revoke Permissions when App is running - Can I recover the App I have just moved my target SDK to v9.
I have hit the issue where when I have my app running, I open the settings and revoke one of the permissions. When I then bring my app to the foreground it restarts and tries to restore the app, however it fails to restore properly.
My understanding is the behaviour should be the same as rotating the device. However in this case my app can recover correctly.
What the behaviour is when revoking permission when the app is running? Should the app just terminate and start from the beginning, or is it possible to recover?

A:
My understanding the behaviour should be the same as rotating the device.

No.

Can someone tell me what the behaviour is when revoking a permission when the app is running.

Your app's processes are terminated. Android will start a fresh process for your app when the user returns to it. Android may attempt to restart the last activity the user was in, depending on the timing of all of these events.
In general, the behavior is the same as if the user left your app for a while (say, 20 minutes), Android terminated the process in the background, and then the user returned to it.

Should the app just terminate and the just start from the beginning, or is it possible to recover.

We cannot answer that, as the details will depend on the app. Ideally, your app can "recover", but it will require you to design the app to be able to deal with a fresh process from every activity.


text:
Q: All radio buttons are getting selected under a radio group, android I'm very new to android and I have an xml like this:
<RadioGroup
        android:id="@+id/cardRadioGroup"
        android:layout_width="wrap_content"
        android:layout_height="45dp" android:layout_alignParentLeft="true" android:layout_marginLeft="35dp"
        android:layout_alignTop="@+id/cardEditText">
</RadioGroup>

I'm tyring to inflate this xml using my code to generate as many radio buttons I want depending on my data model.
The code I use is (which is inside a for loop) :
        LayoutInflater inflater = this.getLayoutInflater();
        View currentView = inflater.inflate(R.layout.card_payment_content_node,null);

        RadioGroup rg = (RadioGroup) currentView.findViewById(R.id.cardRadioGroup);
        RadioButton rb =  new RadioButton(this);
        //set radiobutton properties
        rb.setText(entry.getKey());
        rb.setId(++radioButtonIdCounter);

        rg.addView(rb);

        //add to view
        parent.addView(currentView);

This is working as expected. But the problem is that I can select many radio buttons at a time on my device.
I'm not sure why this is happening. Where I'm making the mistake?
Thanks in advance.

A: All of your buttons have the same ID. That's why they act so uniformly.
You would inflate the layout only once. You'd have to add the buttons programmatically by identifying cardRadioGroup and then looping in code, generating unique IDs for all buttons.
To add radio buttons to the group, use RadioGroup.addview().
To create the radio buttons, use one of the constructors of RadioButton and set further properties if required.


text:
Q: Is there a rule for "‑ance" vs. "‑ence"? OK, so I'm ashamed to admit that as a native speaker I think I've missed something somewhere. I was typing up some documentation and spellchecker kept bugging me.  So I looked up some words and found this:

The suffixes ‑ance and ‑ence mean
  "quality of" or "state of." Words
  ending in these suffixes are usually
  nouns. There is no rule that governs
  whether a word ends with
  ‑ance or ‑ence.

Even the dictionary on my Mac goes so far as to say:

ORIGIN from French ‑ence, from Latin
  ‑entia, ‑antia (from present participial stems ‑ent‑, ‑ant‑). Since
  the 16th cent. many inconsistencies
  have occurred in the use of ‑ence and
  ‑ance.

Is this for real?  There really is no rule?

A: There are four conjugations of verbs in Latin, verbs that end in -are, -ēre, -ere, and -ire. The four conjugations are still evident in Spanish, French, Italian, etc. In English nouns that derive from these verbs end with -antia, -entia, and -ientia, from which we eventually get our nouns ending with -ance, -ence, and -ience.
e.g. parlance is from parlare, insurgence is from insurgere, audience is from audire. So remembering the spelling in English helps if you studied Latin ;)
However, standard spelling in English wasn't a huge priority until people like Samuel Johnson started writing dictionaries, so there are all sorts of exceptions to these rules.

A: Yes, this is for real. No, there really is no rule. There used to be a rule in Latin, though. Etymonline explains in more detail:

-ancesuffix attached to verbs to form abstract nouns of process or fact (convergence from converge), or of state or quality (absence from absent); ultimately from L. -antia and -entia, which depended on the vowel in the stem word. As Old French evolved from Latin, these were leveled to -ance, but later French borrowings from Latin (some of them subsequently passed to English) used the appropriate Latin form of the ending, as did words borrowed by English directly from Latin (diligence, absence). English thus inherited a confused mass of words from French and further confused it since c.1500 by restoring -ence selectively in some forms of these words to conform with Latin. Thus dependant, but independence, etc.

A: The following is meant to supplement not supplant existing answers.  In general, you look at what it was in Latin; however, there are several prominent exceptions.
The Etymonline entry regarding this is cribbed and abbreviated from the OED. Here's what the OED says about these.
‑ance and ‑ence

‑ance
a. Fr. ‑ance :– L. ‑ānt‑ia, ‑ēnt‑ia, ‑ent‑ia
  (see ‑ence), all of which in words that survived into Fr., or were
  formed in Fr. as nouns of action, on the pres. pple., were levelled under
  ‑ance. But other L. words of this form, subseq. adopted in Fr., took
  ‑ence or ‑ance, according to L. spelling. Thus of popular preservation
  or formation, aidance, assistance, complaisance, nuisance,
  parlance, séance; of later learned adoption from L., absence,
  clémence, différence, diligence, providence, prudence, as well as
  élégance, tempérance. Words of both classes were adopted in Eng. in
  their actual Fr. forms, which they still generally retain. But, since 1500,
  various words orig. in ‑ance from Fr. have been altered back to ‑ence,
  after L.; and all words recently adopted from L., directly or through
  mod.Fr., or formed on L. analogies, have taken ‑ence or ‑ance according
  to the L. vowel. Hence, mod.E. words in ‑ance partly represent L.
  ‑āntia, but largely L.  ‑entia, ‑ēntia, through OFr. ‑ance; partly
  also mod.Fr. ‑ance from vbs. of various origin. On the other hand, OFr.
  ‑ance :– L. ‑entia, ‑ēntia, is, in consequence of refashioning,
  partly represented by Eng. ‑ence. For the confusion and inconsistency
  which this causes in current spelling, as in dependance, ‑dence,
  resistance, subsistence, see ‑ence. As, in many cases, the OFr.
  vbs. themselves, as well as their derivatives in ‑ance, were adopted in
  Eng. (e.g. appear ‑ance, assist ‑ance, purvey ‑ance, suffer ‑ance),
  the suffix became to a certain extent a living formative, and was occas.
  used to form similar nouns of action on native vbs., as abid‑ance,
  abear‑ance, forbear‑ance, further‑ance, hinder‑ance, ridd‑ance,
  etc. For meaning, see ‑ence; and cf. ‑ancy.
‑ence
a. Fr. ‑ence, ad. L. ‑entia, forming abstr. sbs., usually of
  quality, rarely of action, on ppl. stems in ‑ent‑, e.g. sapient‑em
  knowing, sapient‑ia knowingness, sapience; audient‑em hearing,
  audient‑ia the process of hearing, audience. As the ppl. stem had
  ‑ent‑, ‑ant‑, the derivative sbs. had ‑entia (prūdentia), ‑antia
  (īnfantia); but all these were levelled in OFr. to ‑ance, in words that
  survived in popular use, or were formed analogically on the pr. pple. in
  ‑ant; as aidance, assistance, complaisance, contenance,
  nuisance, parlance, séance. These were sbs. of action or process, the
  value with which the suffix was retained in Fr. as a living formative. But
  subsequently other L. words in ‑ntia, which had not survived in the
  living language, were readopted on the analogy of these, but with ‑ence
  or ‑ance according to the L. vowel, e.g. absence, clémence,
  diligence, élégance, présence, providence, prudence,
  tempérance, violence. These were sbs. of quality or state; all Fr.
  words in ‑ence are of this class. Both classes were adodpted in ME. in
  their actual Fr. forms and senses, which they generally still retain; but
  since 1500, some of those in ‑ance have been altered back to ‑ence
  after L. All words since adopted from or formed on L., follow L. precedent
  as to ‑ence or ‑ance. The result is that the modern spelling of
  individual words, and still more of groups of cogn. words, is uncertain and
  discordant; cf. assistance, consistence, existence, resistance,
  subsistence; attendance, superintendence; ascendant, ‑ent,
  ‑ancy, ‑ency, condescendence; dependant, ‑ent, ‑ance, ‑ence,
  independence; appearance, apparent; pertinence, appurtenance. In
  sense, words in ‑nce are partly nouns of action, as in OFr., partly of
  state or quality, as in L. The latter idea is more distinctly expressed by
  the variant ‑ncy (see ‑y = ‑ie :– ‑ia) which has been formed in
  Eng. as a direct adaptation of L. ‑ntia; see ‑ency, ‑ancy.

‑ant and ‑ent

‑ant
a. Fr. ‑ant, sometimes :– L. ‑entem, ‑āntem, ‑ēntem, ending of
  pres. pple. (see ‑ent); sometimes a later adaptation of ‑āntem only.
  All the participial forms were in OFr.  levelled under ‑ant, the sole
  ending of the pr.  pple., as L. amānt‑, vidēnt‑, sedēnt‑,
  crēdent‑em in Fr.  amant, voyant, séant, croyant. But other words
  were subsequently adopted in their L. stem form, as prudent, présent,
  élégant. Hence Fr. words in ‑ant are of two kinds, one answering to L.
  ‑ānt, the other to L. ‑ent, ‑ēnt. All were adopted, in their actual
  Fr. forms, in Eng., where they subseq. became ‑ˈau.nt; then again, with
  the change of stress, ‑ant, as L.  affīdent‑em, diffī‑dent‑em,
  plicānt‑em, servient‑em, tenēnt‑em, OFr. afiant, defiant,
  pliant, serjeant, tenant, ME.  afiˈa(u).nt, defiˈa(u).nt,
  pliˈa(u).nt, serjeˈau.nt, teˈnau.nt.  Most of them retain ‑ant,
  e.g. claimant, pleasant, poursuivant, servant, suppliant,
  valiant; but since 1500 some have been refashioned with ‑ent after L.,
  wholly (as apparaunt, ‑ent), or partly (as in pendant, ‑ent,
  dependant, ‑ent, ascendant, ‑ent).  Hence, inconsistency and
  uncertainty in the present spelling of many words, in which L. and Fr.
  analogies are at variance: see ‑ent. Many new words of this class have
  been adopted from L. ‑āntem directly or through later Fr., or have been
  formed on L. analogies, or adopted from mod.Fr. and Romance ‑ant,
  ‑ante; as concomitant, protestant, commandant, anæsthesiant. For
  sense, see ‑ent.
‑ent
a. Fr. ‑ent, ad. L. ‑ent‑em, the ending of pr. pples. of vbs. of the
  2nd, 3rd, and 4th conjugation, as rīdent‑em, currentem, audientem.
  (In the pples. of the 3rd and 4th conjugation this ending represents OAryan
  ‑nt‑, or perh. ‑ent‑, of the ablaut‑series ‑ent‑, ‑ont‑, ‑nt‑;
  cf. Skr. ‑ant‑, ‑at‑, Gr. ‑οντ‑, Goth. ‑and‑, OE. ‑end‑; in those
  of the 2nd conjugation it represents this suffix combined with the thematic
  ‑e‑ of the vb.; similarly the ‑ant‑ of the 1st conjugation includes a
  thematic ‑a‑.) In OFr. this suffix and the corresponding ‑ant‑em of the
  1st conjugation were levelled under ‑ant, the sole ending of the Fr. pr.
  pple., as riant, courant, mourant, levant ( :– L. levantem). At a
  later time many L. forms in ‑ent‑, which had acquired an adj.  sense,
  were adopted in Fr. as adjs. with the ‑ent‑ unchanged, as diligent,
  évident; some of these were duplicates of living ppl. forms in ‑ant, as
  convénient = convenant, provident = pourvoyant, confident
  = confiant. The Fr. words in ‑ant, ‑ent, which were adopted into
  Eng., have generally retained the form of the suffix which they had in Fr.;
  but since 1500 there has been a tendency to refashion them after Lat., and
  hence several words in ‑ant have changed that ending for ‑ent, either
  entirely or in certain senses. In mod.Eng. also many Lat. words in ‑entem
  have been directly adopted, always in the form ‑ent. The conflict between
  Eng. and Fr. analogies occasions frequent inconsistency and uncertainty in
  the present spelling of words with this suffix; cf. e.g. assistant,
  persistent; attendant, superintendent; dependant, ‑ent,
  independent.

*In sense the words in ‑ent, ‑ant are primarily adjs., sometimes
  distinctly ppl., as convergent, obsolescent, errant, peccant; some,
  however, are, like many words of the same type in Lat. and Fr., used as
  sbs. (either in addition to the adj. use or exclusively), meaning (a) a
  personal agent, as agent, claimant, president, regent; (b) a
  material agent, as coefficient, current, ingredient, secant,
  tangent, torrent; esp. in Medicine, as aperient, astringent,
  emollient, expectorant.

A: Well, there seems to have some rules to that in English according to a blogger I've found on Oxford Dictionaries:

-ance or -ence?
These endings are used to make nouns, meaning either: a quality or
  state (e.g. ignorance is the state of being ignorant about something)
  or an action (e.g. emergence is the action of emerging from
  somewhere).
One key way of knowing which ending to choose is to be aware of the
  words that these nouns are formed from. Some are made from verbs (e.g.
  performance from perform) and some are from adjectives (for example
  intelligence from intelligent).
-ance
If the word is formed from a verb that ends in -y, -ure, or -ear, then
  the ending of the noun will be spelled -ance, for example:
Verb: apply comply / Noun: appliance compliance
(...)
If the noun is related to a verb which ends in -ate, then the ending
  is likely to be -ance, for instance:
Verb: deviate dominate / Noun: deviance dominance      (...)
A further tip is that, if the stem of the word (the part before the
  ending) ends in a 'hard' c (pronounced like the c in cab) or a 'hard'
  g (pronounced like the g in get), then the ending will be spelled
  -ance. For example: significance; elegance.
As for the other nouns which end in -ance, there are no hard-and-fast
  rules, so you may find it helpful to memorize them. Here's a handy
  list of the most common:
ABUNDANCE acceptance acquaintance
(...)
-ence
If the word is formed from a verb ending in -ere, then the ending will
  be spelled -ence. For example:
Verb: adhere cohere   / Noun: adherence coherence
(...)
So, you may ask, why is perseverance (from persevere) spelled -ance?
  Sorry, it's simply an exception to this rule…
Does the related verb end in a stressed -er syllable? If yes, then
  -ence is the correct ending, as in:
Verb: confer infer / Noun: conference inference
(...)
Note that, although the verb differ is stressed on the first syllable
  rather than the final –er, difference is still spelled with -ence at
  the end. If the word contains the syllables -cid-, -fid-, -sid-, or
  -vid- immediately before the ending, the correct suffix is -ence. For instance:
CONFIDENCE evidence
(...)
If the stem of the word ends in a soft c (pronounced like the c in
  cell) or a soft g (pronounced like the g in gin), then the ending will
  be -ence. For example:
ADOLESCENCE indulgence
(...)
Again, some words don't follow these rules (or the 'rules' have
  several exceptions, so can be rather difficult to learn). Here's a
  list of some common nouns ending in -ence:
ABSENCE   DEPENDENCE  OBEDIENCE
(...)

And much more at: http://blog.oxforddictionaries.com/2013/05/ance-ence-suffixes/


text:
Q: iPhone UIWebView PDF Page Jump I want to view a local PDF (in my iPhone app) and be able to jump to a specific page.  Seems like the UIWebView is the way to go, however, I can't find any information on jumping to specific pages.  Is this impossible?  Are there any other techniques I can use?
thanks,
Howie

A: You can try using Javascript. See this link for more details. You'll want to use something along the lines of @"window.scrollTo(0, x);", where x is some value you determined by playing around with the WebView.

A: Another option would be to set the content offset of the UIWebView like Mike pointed out (but without involving JavaScript):
webView.ScrollView.SetContentOffset(new PointF(0, y), true);

(sorry for the MonoTouch code but ObjectiveC is still on my todo list)

A: Alternatively to an UIWebView, you can use the Quartz API :http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
It's more complicated, but you should be able to do whatever you want.


text:
Q: Type is not assignable to type 'IntrinsicAttributes I have this component
import React, { FunctionComponent, useEffect } from 'react';
import shouldForwardProp from '@styled-system/should-forward-prop';
import styled from 'styled-components';

const delay = 0.25;

interface FadeInSectionProps {
  offset?: number;
  children: React.ReactNode;
}

const Section = styled.div.withConfig({
  shouldForwardProp,
})<{ offset?: number }>`
  transition: 0.5s ease-in-out opacity, 0.5s ease-in-out transform;
  opacity: 0;
  transform: translate(0, -40px);

  &.fade-in-section--is-visible {
    opacity: 1;
    transform: translate(0, 0);
  }

  transition-delay: ${(props) => (props.offset ? props.offset * delay + 's' : '0s')};
`;

export const FadeInSection: FunctionComponent = ({ offset, children }: FadeInSectionProps) => {
  const [isVisible, setVisible] = React.useState(false);
  const domRef = React.useRef();
  useEffect(() => {
    const observer = new IntersectionObserver((entries) => {
      entries.forEach((entry) => {
        if (entry.isIntersecting) {
          setVisible(true);
        }
      });
    });

    observer.observe(domRef.current);
  }, []);
  return (
    <Section
      className={`fade-in-section ${isVisible ? 'fade-in-section--is-visible' : ''}`}
      ref={domRef}
      offset={offset}
    >
      {children}
    </Section>
  );
};

export default FadeInSection;

Which I'm using (after importing it) like so:
<FadeInSection>
   <Header />
<FadeInSection>

or
<div>
   <FadeInSection>
     <Item1 />
   </FadeInSection>
   <FadeInSection offset={1}>
     <Item1 />
   </FadeInSection>
</div>

But when I pass the prop offset I get this ts error (even that works as I expected)

En english:
    Type '{ type: string; name: string; value: string; onChange: (e: any) => void; placeholder: string; label: string; }' is not assignable to type 'IntrinsicAttributes & InputProps & { children?: ReactNode; }'.
  Property 'type' does not exist on type 'IntrinsicAttributes & InputProps & { children?: ReactNode; }'.ts(2322)

What I'm doing wrong? Or how Can I get rid of this error?

A: try changing const FadeInSection: FunctionComponent = ({ offset, children }: FadeInSectionProps) to const FadeInSection: FunctionComponent<FadeInSectionProps> = ({ offset, children })
You type the component with FunctionComponent instead of props, so you can use internal props like children, without the need to type them. (you can actually remove children from your interface, cause it exists on FunctionComponent interface). What is happening is that you specify the type of const FadeInSection not the type of props, so when you used it previously, compiler didn't look into your interface at all

A: Like this the warning in the ide was gone and also the errors in the lint command
export const FadeInSection: FunctionComponent<FadeInSectionProps> = ({
  offset,
  children,
}: FadeInSectionProps) => {
   return (<Section />);
}


text:
Q: AJAX - Promise.all method - unexpected output dilemma My question is about why there are two expected outputs from this chunk of ajax code but when I test in the debugger/console-panel this gives me only [foo, car] as output?

const a = new Promise((res, rej) => { //n1
  setTimeout(() => res('foo'), 300);
});

const b = new Promise((res, rej) => {
  setInterval(() => rej('bar'), 100);
  res('car');
});

Promise.all([a, b]).then((race) => {
  console.log(race);
}).catch((crash) => {
  console.log(crash);
});

Right answers:
[foo, car]
['bar', 'car']

*

*why this?

A: Promises are designed to store either a future result (the argument to res() above) or a future error (the argument to rej() above) but not both.  It is therefore not valid to call both res() and rej() in a Promise body.
In this example, when trying to resolve the future values of a and b, the promise returned by Promise.all will call either the function passed to then() or the function passed to catch() based on the resolution or rejection of a or b.
Usually, it will call the function passed to then() with a list containing first values with which a and b resolved.  If either promise rejects prior to resolving, however, the promise returned by Promise.all will call the function passed to .catch().
Since the a promise always resolves, and because the b promise resolves first, and does so with the value, car, Promise.all([a,b]) will resolve with a value containing car.  It will not reject with the value bar because b resolved first.
Although the Promise implementation provided by your browser handles the double reject/resolve silently, do note that this could result in undefined behavior.  For example, some implementations of Promise will throw an exception when used in this way.


text:
Q: three.js fill color(face) randomly ordered vertex, incident polygon I just recently studied three js.
I want to fill in the face color after creating a polygon based on vertices. How can I do this?
The vertices will be given randomly
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 100);
camera.position.set(0, 5, 10);
camera.lookAt(0, 5, 0);
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

var controls = new THREE.OrbitControls(camera, renderer.domElement);

var grid = new THREE.GridHelper(30, 30, 0xffffff, 0x404040);
grid.rotation.x = Math.PI * 0.5;
scene.add(grid);

var coordinatesList = [
  new THREE.Vector3(2, 0, 5),
  new THREE.Vector3(0, 10, 3),
  new THREE.Vector3(5, 10, 4),
  new THREE.Vector3(2, 8, 2),
  new THREE.Vector3(5, 5, 1)
];

// shape
var geomShape = new THREE.ShapeBufferGeometry(new THREE.Shape(coordinatesList));
var matShape = new THREE.MeshBasicMaterial({color:"blue", side: THREE.DoubleSide});
var shape = new THREE.Mesh(geomShape, matShape);
scene.add(shape);

// points
var geom = new THREE.BufferGeometry().setFromPoints(coordinatesList);
var matPoints = new THREE.PointsMaterial({size: 0.55, color: "pink"});
var points = new THREE.Points(geom, matPoints);
scene.add(points);

// lines
var matLines = new THREE.LineBasicMaterial({color: "magenta"});
var lines = new THREE.LineLoop(geom, matLines);
scene.add(lines);

renderer.setAnimationLoop(() => {
  renderer.render(scene, camera);
});

jsfiddle :
https://jsfiddle.net/d9quczhe/

A: In your specific case, you can assign Z-coordinate from a vector of coordinatesList to the respective point in your geometry:

var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 100);
camera.position.set(0, 0, 25);
camera.lookAt(0, 5, 0);
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

var controls = new THREE.OrbitControls(camera, renderer.domElement);

var grid = new THREE.GridHelper(30, 30, 0xffffff, 0x404040);
grid.rotation.x = Math.PI * 0.5;
scene.add(grid);

var coordinatesList = [
  new THREE.Vector3(2, 0, 5),
  new THREE.Vector3(0, 10, 3),
  new THREE.Vector3(5, 10, 4),
  new THREE.Vector3(2, 8, 2),
  new THREE.Vector3(5, 5, 1)
];

// shape
var geomShape = new THREE.ShapeBufferGeometry(new THREE.Shape(coordinatesList));

// set Z-coord from the original vectors ///////////////////////////////////////
let pos = geomShape.attributes.position;
for(let i = 0; i < pos.count; i++){
    pos.setZ(i, coordinatesList[i].z)
};
geomShape.computeVertexNormals();
////////////////////////////////////////////////////////////////////////////////
console.log(geomShape)

var matShape = new THREE.MeshBasicMaterial({color:"blue", side: THREE.DoubleSide});
var shape = new THREE.Mesh(geomShape, matShape);
scene.add(shape);

// points
var geom = new THREE.BufferGeometry().setFromPoints(coordinatesList);
var matPoints = new THREE.PointsMaterial({size: 0.55, color: "pink"});
var points = new THREE.Points(geom, matPoints);
scene.add(points);

// lines
var matLines = new THREE.LineBasicMaterial({color: "magenta"});
var lines = new THREE.LineLoop(geom, matLines);
scene.add(lines);

renderer.setAnimationLoop(() => {
  renderer.render(scene, camera);
});
body{
  overflow: hidden;
  margin: 0;
}
<script src="https://threejs.org/build/three.min.js"></script>
<script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>


text:
Q: Cygwin compiling HPLIP on windows xp Cygwin compiling HPLIP on windows xp:
Could build cups-1.6b1 , net-snmp-5.7.2 and sane 1.0.23 successfully on windows xp machine with cygwin.But not able to build hplip-3.13.4
Getting following error on ./configure
configure: error: cannot find libcups support
Stuck here.I will greatly appreciate any help.
Thank you

A: According to that post, where HPLIP is also being built under Cygwin, you should use these flags, as I suppose:
--with-cupsbackenddir=/opt/hplip/lib/cups/backend
--with-cupsfilterdir=/opt/hplip/lib/cups/filter


text:
Q: Windows Phone 8: Alternating colors on a ItemsControl I want to alternate color of items in ItemsControl based on item index - odd or even. As I found here it is pretty easy to do, but looks like ItemsControl for Windows Phone doesn't have AlternationCount property.
Is there any alternatives to AlternationCount property or workarounds to achieve required behavior?
ItemsControl reference

A: You could inherit the ItemsControl class and override PrepareContainerForItemOverride. There you can calculate the AlternationIndex e.g. by using ItemsControl.IndexFromContainer. Now you can apply a specific Style to the container or set an attached property.

A: Use data template selector, you will find useful sample here


text:
Q: How to target inputs of a form opened in fancybox I am opening a hidden form to a fancybox modal from an onclick.
The html:
<p class="btn btn-mini btn-success verify_form" id="<? echo $article_id; ?>" style="float:right; margin:4px;"> Verify

    <form id="article_check">

Enter Website Address of the Article you Wrote:
        <input type="hidden" id="id" value="" />
        <input type="text" id="article_url" style="width: 35%; margin-left: 10px;" value="" />
        <input type="submit" style="position: absolute; left: -9999px; width: 1px; height: 1px;" tabindex="-1" />
    </form>

The jquery:
$(document).ready(function () {
    $(".verify_form").click(function () {
        var theid = $(this).attr('id');
        $('#id').val(theid);
        $.fancybox(
            $('.verify_the_form').html(),
            {
                'fitToView'         : true,
                'autoScale'         : true,
                'autoSize'          : true,
                'closeClick'        : false,
                'openEffect'        : 'elastic',
                'closeEffect'       : 'elastic',
            }
        );
    });

I am then trying to process the form with jquery/ajax:
    $('#article_check').submit(function(event) {
        event.preventDefault();
        var theid = $('#id').val();
        var theurl = $('#article_url').val();
        alert(theurl);
        alert(theid);
        $.ajax({
            'url': '/includes/article_check.php',
            'type': 'get',
            'data': {
                'article_url': theurl,
                'id': theid
            },
            'success': function (data) {
                $('#article_check').append(data);
                return;
            },
            'error': function (request, status, error) {
                return;
            }
        });
    });
});

The problem seems to be that, the way fancybox works, it actually redraws the form on the page.... making for 2 forms with matching id's, and as no element should have id more than once, jquery is confused between which form to use, and is defaulting to values in the hidden form.
To put this more simply, variable theurl is always returned as empty.
I am seeking a means of grabbing $('#article_url').val() from the form the user submits.
An example url of the problem
http://new.adsactlyhits.com/ae/example.html

A: I love when I find my own answers, but hate that I potentially waste peoples time.
My solution was rather basic I had to use (this).find() to specifically call the values from the form being submit.
var theid = $(this).find('#id').val();
var theurl = $(this).find('#article_url').val();


text:
Q: How to Position Image to the Negative Right Position and Prevent Horizontal Scrollbar I have long searched for the answer and found nothing similar to my problem.
I have 3 blocks with height: 200px; width: 500px;. In second block I have image, that have negative right position, and with greater height than his container. And I do not want to see horizontal scrollbar before browser window < my container width. I want to "cut" image on right side if it does not fit in window.
How can I do that?
JSFiddle link

.container,
.container1,
.container2 {
  height: 200px;
  width: 500px;
  margin: 0 auto;
  background: yellow;
  position: relative;
}
.container1 {
  background: blue;
}
.container2 {
  background: green;
}
.container img {
  position: absolute;
  right: -100px;
  top: -50px;
  z-index: 1;
}

A: Make sure your parent container (in your case this is body) has overflow-x:hidden property. So you need to add
body {overflow-x:hidden; max-width: 100%}

A: http://jsfiddle.net/g2LyLetn/2/
you mean that way ?
body {
  overflow: hidden;
  max-width: 100%
}


text:
Q: How to remover certain caracters from each row of a column I have this data table:
Year    GDP
1998–99 <U+20B9>1,668,739
1999–00 <U+20B9>1,858,205
2000–01 <U+20B9>2,000,743
2001–02 <U+20B9>2,175,260
2002–03 <U+20B9>2,343,864
2003–04 <U+20B9>2,625,819
2004–05 <U+20B9>2,971,464
2005–06 <U+20B9>3,390,503
2006–07 <U+20B9>3,953,276
2007–08 <U+20B9>4,582,086
2008–09 <U+20B9>5,303,567
2009–10 <U+20B9>6,108,903
2010–11 <U+20B9>7,248,860
2011–12 <U+20B9>8,391,691
2012–13 <U+20B9>9,388,876

What I want to do is to remove "" from all of the rows. How can I do it?
I was trying with grepl and grep, but did not work for me:
df[!grepl("<U+20B9>", df$GDP),]

df[ grep("REVERSE", df$Name, invert = TRUE) , ]

These do not work for me...
What I want is something like this:
Year    GDP
1998–99 1,668,739
1999–00 1,858,205
2000–01 2,000,743
2001–02 2,175,260
2002–03 2,343,864
2003–04 2,625,819
2004–05 2,971,464
2005–06 3,390,503
2006–07 3,953,276
2007–08 4,582,086
2008–09 5,303,567
2009–10 6,108,903
2010–11 7,248,860
2011–12 8,391,691
2012–13 9,388,876

I also tried using below solution but did not work for me either...
How to identify/delete non-UTF-8 characters in R
x <- "<U+20B9>"
Encoding(x) <- "UTF-8"
iconv(x, "UTF-8", "UTF-8",sub='')

returns me "<U+20B9>" as it is...

A: a data.table attempt with some example data
data <- setDT(data.frame(
 Year=c('1998–99',
     '1999–00',
     '2000–01',
     '2001–02',
     '2002–03',
     '2003–04',
     '2004–05',
     '2005–06',
     '2006–07',
     '2007–08'),
 GDP=c('<U+20B9>1,668,739',
    '<U+20B9>1,858,205',
    '<U+20B9>2,000,743',
    '<U+20B9>2,175,260',
    '<U+20B9>2,343,864',
    '<U+20B9>2,625,819',
    '<U+20B9>2,971,464',
    '<U+20B9>3,390,503',
    '<U+20B9>3,953,276',
    '<U+20B9>4,582,086')))

data[,GDP:=sub("^\\s*<U\\+\\w+>\\s*",'',data$GDP)]

the regular epxression pattern for this can be viewed as:

*

*U \ \ + part implies like a sequence of U+

*\ \ w+ simply states letters or digitis, more than just 1

*this is in part wrapped in < > and then \ \ s* which just removes any whitespaces

A: Smallest answer to above is:
df$GDP <- substring(df$GDP, 2)


text:
Q: RangeError: Maximum call stack size exceeded in nodejs and reactjs I try posting the token gotten from my registration via the code below, but I get the error, maximum call stack exceeded
exports.activationController = (req, res) => {
  const { token } = req.body;

  exports.activationController = (req, res) => {
  const { token } = req.body;

  if (token) {
    jwt.verify(token, process.env.JWT_ACCOUNT_ACTIVATION, (err, decoded) => {
      if (err) {
        return res.status(401).json({
          errors: 'Expired link. Signup again'
        });
      } else {
        const { name, email, password } = jwt.decode(token);

        const user = new User({
          name,
          email,
          password
        });

        user.save((err, user) => {
          if (err) {
            return res.status(401).json({
              errors: 'User cannot be saved.'
            });
          } else {
            return res.json({
              success: true,
              message: 'Signup success'
            });
          }
        });
      }
    });
  } else {
    return res.json({
      message: 'Please try again.'
    });
  }
};

I have done the registration like this
exports.registerController = (req, res) => {
    const { name, email, password } = req.body;
    const errors = validationResult(req);

    if (!errors.isEmpty()) {
      const firstError = errors.array().map(error => error.msg)[0];
      return res.status(422).json({
        errors: firstError
      });
    } else {
      User.findOne({
        email
      }).exec((err, user) => {
        if (user) {
          return res.status(400).json({
            errors: 'Email is taken'
          });
        }
      });

      const token = jwt.sign(
        {
          name,
          email,
          password
        },
        process.env.JWT_ACCOUNT_ACTIVATION,
        {
          expiresIn: '5m'
        }
      );

      const emailData = {
        from: process.env.EMAIL_FROM,
        to: email,
        subject: 'Account activation link',
        html: `

Please use the following to activate your account

                  <button style="padding: 15px; background-color: blue; text-align:center; opacity: 0.2; outline: none; border-radius: 10px;">Activate your account</button>

This email may containe sensetive information

${process.env.CLIENT_URL}

              `
      };

I get the error "maximum call stack exceeded" when posting the activation" by using postman. I really do not know where in my code, this error is coming from
This is the response

RangeError: Maximum call stack size exceeded    at
RegExp.test (<anonymous>)    at
_pathToPositionalSyntax (C:\Users\User\Documents\My projects\greenlifeapp\node_modules\mongoose\lib\schema.js:854:16)
   at Schema.pathType (C:\Users\User\Documents\My
projects\greenlifeapp\node_modules\mongoose\lib\schema.js:1200:21)
   at model.$set (C:\Users\User\Documents\My
projects\greenlifeapp\node_modules\mongoose\lib\document.js:1160:33)
   at model.set [as password] (C:\Users\User\Documents\My
projects\greenlifeapp\node_modules\mongoose\lib\helpers\document\compile.js:174:19)
   at model.<anonymous> (C:\Users\User\Documents\My
projects\greenlifeapp\models\auth.model.js:34:19)    at
VirtualType.applySetters (C:\Users\User\Documents\My
projects\greenlifeapp\node_modules\mongoose\lib\virtualtype.js:167:16)
   at model.$set (C:\Users\User\Documents\My
projects\greenlifeapp\node_modules\mongoose\lib\document.js:1264:12)
   at model.set [as password] (C:\Users\User\Documents\My
projects\greenlifeapp\node_modules\mongoose\lib\helpers\document\compile.js:174:19)
   at model.<anonymous> (C:\Users\User\Documents\My
projects\greenlifeapp\models\auth.model.js:34:19)

The mongoose model where I have defined the user
const mongoose = require('mongoose')

const userSchema = new mongoose.Schema({
    name: {
        type: String,
        trim: true,
        required: true,
        unique: true,
        lowercase: true
    },
    name: {
        type: String,
        trim: true,
        required: true
    },
    hashed_password: {
        type: String,
        required: true
    },
    salt: String,
    role: {
        type: String,
        default: 'Normal'
    },
    resetPasswordLink: {
        data: String,
        default: ''
    }
}, {timeStamp: true})

// Virtual password
userSchema.virtual('password')
.set(function(password){
    this.password = password
    this.salt = this.makeSalt()
    this.hashed_password = this.encryptPassword(password)
})
.get(function(){
    return this._password
})

// Methods
userSchema.methods = {
    // Generate salt
    makeSalt: function(){
        return Math.round(new Date().valueOf() * Math.random()) + ''
    },
    // Encrypt Password
    encryptPassword: function(password){
        if(!password) return ''
        try{
            return crypto
            .createHmac('sha1', this.salt)
            .update(password)
            .digest('hex')
        } catch (err) {
            return ''
        }
    },
    authenticate: function (plainPassword) {
        return this.encryptPassword(plainPassword) === this.hashed_password
    }
}

module.exports = mongoose.model('User', userSchema)

A: All operations related to database like find,save,findOne are asynchronous in nature. To execute that you should either use promise or async/await. For ex. to save the user you should use this
exports.activationController = async (req, res) => {
  const { token } = req.body;

  if (token) {
    jwt.verify(token, process.env.JWT_ACCOUNT_ACTIVATION, (err, decoded) => {
      if (err) {
        return res.status(401).json({
          errors: 'Expired link. Signup again'
        });
      } else {
        const { name, email, password } = jwt.decode(token);

        const user = new User({
          name,
          email,
          password
        });

        await user.save((err, user) => {
          if (err) {
            return res.status(401).json({
              errors: 'User cannot be saved.'
            });
          } else {
            return res.json({
              success: true,
              message: 'Signup success'
            });
          }
        });
      }
    });
  } else {
    return res.json({
      message: 'Please try again.'
    });
  }
};

and for registration like this
exports.registerController = async (req, res) => {
    const { name, email, password } = req.body;
   // if validationResult is async function use await here as well
    const errors = validationResult(req);

    if (!errors.isEmpty()) {
      const firstError = errors.array().map(error => error.msg)[0];
      return res.status(422).json({
        errors: firstError
      });
    } else {
      await User.findOne({
        email
      }).exec((err, user) => {
        if (user) {
          return res.status(400).json({
            errors: 'Email is taken'
          });
        }
      });

      const token = jwt.sign(
        {
          name,
          email,
          password
        },
        process.env.JWT_ACCOUNT_ACTIVATION,
        {
          expiresIn: '5m'
        }
      );

      const emailData = {
        from: process.env.EMAIL_FROM,
        to: email,
        subject: 'Account activation link',
        html: `

Please use the following to activate your account

                  <button style="padding: 15px; background-color: blue; text-align:center; opacity: 0.2; outline: none; border-radius: 10px;">Activate your account</button>

This email may containe sensetive information

${process.env.CLIENT_URL}

              `
      };

Let me know if it helps or not.


text:
Q: SSIS Logging and auditing - What are all the events i need to select to capture task start and end time along with rows processed? What are all the events i need to select to capture task start and end time along with rows processed in SSIS logging?

A: Package StartTime: The system variable StartTime has the time that the package started to run.
Container StartTime: The system variable ContainerStartTime has the start time of the container.
There is no end time AFAIK. The way I handle this is by doing a GETDATE() to get the current-date and time at the appropriate place / event in my Control Flow within the SSIS Package.
Example: For auditing all our packages, I use a custom Audit table that contains summary info like the name of the package, the ExecutionInstanceGUID, ETL / CRUD rowcounts etc, and the Start and End time for the package.
At the beginning of each package, I create an Audit row with all the information I have in hand, and most of them are either constants or are values sourced from System variables.

Then at the end of my Control Flow, I update the same Audit Row with the current datetime for the EndTime / StopTime and update other status fields.

As for Rows Process, the OnInformation event has this wherever it is relevant, but tapping into that event means you get a lot of noise i.e. event infos you don't care about. So I usually do an explicit ROWCOUNT in my Control Flow or Data Flow and store it in a Variable at the appropriate scope for use later.
Row Count in Control Flow is done using a SELECT Statement

The SQL to get row count

The variable set to capture the row count from the SQL

Row Count in Data Flow is done using the ROWCOUNT Transform Toolbox Component.

Here's where a variable is assigned inside that ROWCOUNT component, to capture the count.


text:
Q: Fritzbox blacklist not working for redirected URL in Firefox After setting up a blacklist in Fritzbox web interface, the unwanted sites are blocked nicely. However, a site (actually: superuser with wrong top level domain) that previously redirected to another site escapes blocking and still redirects to a comercial site (jacobi.de) in firefox (but not in Chrome).

A: Turns out that Firefox caches redirections (see also helpful answers from RomanSt and user1983017) and thus circumvents blocking before the router-based blacklist can be used. Two solutions:

*

*search for "blocked" site (from where redirection starts, not the destination site), right click, "forget about this site".

*Go to "Options", "Cookies and Site Data", "Clear data", check cache (not necessarily cookies) and delete.

(both tested on Win 10 + Firefox 72.0.1)


text:
Q: How to beautify alert msg with jquery in php? I have too many alert msgs according to my programming conditions, and i wants to beautify them coz thatz looking normal and weird.
if(True)
{
   echo "";
}

if(False)
{
   echo "";
}

I tried too many jquery plugins but they work with some specific event like onclcik, onblur, onhover, onload, onsubmit...
In above code how can i customize alert msgs without using any event

A: Use jQuery UI dialog.
It can be opened directly just like an alert. just write you message to some element like a div, and how it on ready.
See jQuery ui dialog
Sample code:
js:

html:

Blah blah blah

Avoid modal messages if possible. They can be quite irritating, cause your whole screen is locked. Same goes for alerts.

A: You can use jQuery UI for custom alerts (modal dialogs).
Try it here: http://jqueryui.com/demos/dialog/#modal-message
PS: There is no echo in JavaScript.

Nice modal dialog!

Codez:
$( "#dialog-message" ).dialog({
    modal: true,
    buttons: {
        Ok: function() {
            $( this ).dialog( "close" );
        }
    }
});

A: The box that popups when calling alert function, can not be customized through css. It's a browser component so takes the style from the browser and not from the page. So you have to use a popup dialog like jquery ui dialog

A: You can try this plugin to beautify alert: http://plugins.jquery.com/alert-beautifier/


text:
Q: Linear order of the quotient generated from Vitali relation implies non-measurability of subset of reals Vitali relation, $a,b\in\Bbb R;\ a\sim b\iff a-b\in\Bbb Q$, is used to prove that there exists a non-measurable set of reals: we look at $A=\Bbb R/\sim$, from each $a\in A$ we take $b_a\in a$, then $\bigcup_{a\in A}\{b_a\}$ is the desired set.
This construction require choice function for the power set of $\Bbb R$, and without some kind of axiom of choice there is no guarantee such function exists(it can be seen by, for example, Solovay's model).
I remember reading the following:

In $\sf ZF$, $\Bbb R/\sim$ has a linear order implies the existence of of non-measurable subset of the reals.

This fact will also imply that compactness implies non-measurable set of reals, so my question is: what proof is there for the above theorem?

A: Taking help from @Noah comment and from @Wojowu:
Let's assume the contrary, that is, $\mathbb R/\sim$ is linearly ordered but every subset $\mathbb R^2$ is measurable we may use the ergodicity:
Let $\prec$ be the linear order of $\mathbb R/\sim$, and define $x\triangleleft y\iff [x]_\sim\prec[y]_\sim$. Then either $\triangleleft$ has measure $0$ or $\triangleleft^c=\{(a,b)∈\mathbb R^2\mid [a]_\sim\succ[b]_\sim\}\cup\{(a,b)∈\mathbb R^2\mid [a]_\sim=[b]_\sim\}$.
We may notice that $\{(a,b)∈\mathbb R^2\mid [a]_\sim=[b]_\sim\}=\bigcup_{q\in\mathbb Q}\{(x,y)∈\mathbb R^2\mid x-y=q\}$, which is countable union of lines, so has measure $0$, and $\{(a,b)∈\mathbb R^2\mid [a]_\sim\succ[b]_\sim\}$ has the same measure as $\triangleleft$, so in both cases we get that the measure of $\mathbb R^2$ is $0$, which is contradiction.


text:
Q: Java - creating threads in a EventListener I got this code:
Thread thread = new Thread(new Runnable() {
                    @Override
                    public void run() {
                        OctopusWSClient.sendPoolSensorReading(poolSensorReading, OctopusClientStart.currentMacAddress);
                    }
                });
                thread.setName("Thread - WS");
                thread.start();

Is inside a Event Listener that is executing approximately every 30 seconds (When an event occurs), so is creating a new Thread every 30 seconds that usually last 20 seconds to complete, now, my question is... Its OK to call Threads this way?, if not, how???... and also, I'm watching Threads ID and names with this code:
Set<Thread> threadSet = Thread.getAllStackTraces().keySet();
                for(Thread t : threadSet){
                    System.out.println(" Thread #"+t.getId()+" Name: "+t.getName());
                }

and it prints the ID and name for the current threads, I see always the same number of Threads, but the ID is always incrementing by 1 (Thread - WS).
Is this a bad signal? It will fill JVM Memory in some time?
thanks

A: You would probably find it better to notify a single thread to resume, rather than create multiple ones. If it takes 20 seconds to complete, at the end lock it and make it wait till it gets the command to restart the loop from the event listener.


text:
Q: javascript - How to check for existence of object in array How can I check for the existence of an object in an array in javascript?
Here is a simple example. Let's say I have an array that looks like this:
let array = [{"zone": "WV", "zip": "56855"},
  {"zone": "SC", "zip": "28031"},
  {"zone": "TN", "zip": "84755"}]

And now I want to add an object to my array but only if it doesn't already exist.
For example attempting to add this object would fail:
let addMe = [{"zone": "SC", "zip": "28031"}, {"zone": "TN", "zip": "84755"}]

But this would succeed
[{"zone": "SC", "zip": "55555"}, {"zone": "TN", "zip": "88888"}]

Obviously addMe is an array that would need to be stepped thru, failing on some objects, succeeding on others.
I am trying to use filter but its not working like I want. And I'm having to step thru the original array as well as step thru the object I'm trying to add, creating nested for loops which is confusing as hell. This is my attempt:
array.filter(function(item){
  addMe.forEach(function(element){
    if(item.zone != element.zone && zone.zip!= element.zip){
      array.push(element);
    }
  });
});

Is there a better way?

A: An alternative could be the function some to capture at least one object where not every value are equal.

let array = [{"zone": "WV", "zip": "56855"}, {"zone": "SC", "zip": "28031"}, {"zone": "TN", "zip": "84755"}],
    addMe = [{"zone": "SC", "zip": "28031"}, {"zone": "TN", "zip": "84755"}];

addMe.forEach(o => {
  if (!array.some(a => Object.keys(a).every(k => a[k] === o[k]))) array.push(o);
});

console.log(array);
.as-console-wrapper { max-height: 100% !important; top: 0; }

A: By using underscore.js. You may try something like this:

let array = [
              {"zone": "WV", "zip": "56855"},
              {"zone": "SC", "zip": "28031"},
              {"zone": "TN", "zip": "84755"}
            ];
let addMe1 = [{"zone": "SC", "zip": "28031"}, {"zone": "TN", "zip": "84755"}];
let addMe2 = [{"zone": "SC", "zip": "55555"}, {"zone": "TN", "zip": "88888"}];

// This will fail.
addMe1.forEach( item => !_.findWhere(array, item) ? array.push(item) : null);
// This will success.
addMe2.forEach( item => !_.findWhere(array, item) ? array.push(item) : null);

console.log(array);
<script src="https://fastcdn.org/Underscore.js/1.8.3/underscore-min.js"></script>

A: Alternatively you can compare all values of two objects with JSON.stringify.
So we first filter to not have any duplicate, by using some within which we compare the stringified objects.
let array = [{"zone": "WV", "zip": "56855"},
  {"zone": "SC", "zip": "28031"},
  {"zone": "TN", "zip": "84755"}]

const newObj = [{"zone": "WV", "zip": "55444"},
  {"zone": "SC", "zip": "28031"}]

array = array.concat(newObj.filter(x => !array.some(y => JSON.stringify(y) === JSON.stringify(x))))

console.log(array)

A: You can use native javascript, find() method in ECMAScript 6:
  let array = [{"zone": "WV", "zip": "56855"}, {"zone": "SC", "zip": "28031"}, {"zone": "TN", "zip": "84755"}],
  addMe = [{"zone": "SC", "zip": "28031"}, {"zone": "TN", "zip": "84755"}];

  addMe.forEach(place => {
    if (array.find((element) => element.zone == place.zone) === undefined) {
      array.push(place);
    }
  });

A: Apart right answers already given, there's a mistake in your if statement (item.zip instead of zone.zip) and a misunderstanding of the filter method (return true to keep and false to leave). So, if sticking on filter :
let valids = addMe.filter(function(element) {
  for(let i=0; i < array.length; i++) {
     if(item.zone === element.zone && item.zip === element.zip) return false // throw the item
  }
  return true; // keep the item
});

array.push(valids);

And a shorter way with findIndex for modern browser without filter :
for(let i = 0; i < addMe.length; i++) {
   let index = array.findIndex(item => item.zone === element.zone && item.zip === element.zip);
   // will return index of the matching item or -1

   if(index < 0) array.push(element); // Add it and you're done

   // or better to avoid array search inflation on already added elements
   // It will remove element from addMe
   addMe.splice(i,1);
}
// In case use of splice
array.push(addMe);

some method is also a good approach of working on array instead of addMe.

A: There are quick-to-develop, slow-to-run fixes, which involve searching through all the keys of all the objects every time. Or there's a slow-to-develop, quick-to-run solutions that build some sort of lookup so you don't have all the looping lookups. Here's a simple idea (more of a start of an idea) of the later.
Make a class (or object) that keeps a set of all known key/value pairs. This just concats them with a separator character (that shouldn't appear in the data). Now before adding, just do the constant-time lookup in the Set to check :

let array = [
    {"zone": "WV", "zip": "56855"},
    {"zone": "SC", "zip": "28031"},
    {"zone": "TN", "zip": "84755"}
]

class unqiueCollection {
    constructor(arr, sep = "_"){
        this.arr = []
        this.sep = sep
        this.unique_keys = new Set
        arr.forEach((item) => this.add(item))
    }
    add(item) {
        let key =  item.zip + '_' + item.zone
        if (!this.unique_keys.has(key)) {
            this.unique_keys.add(key)
            this.arr.push(item)
        } else {
            console.log("already in array")
        }
    }
}

let coll = new unqiueCollection(array)

// won't add
coll.add({"zone": "SC", "zip": "28031"})
coll.add({"zip": "28031", "zone": "SC"})

// will add
coll.add({"zone": "AK", "zip": "99577"})
console.log(coll.arr)

This assumes all objects will just consists of zip and zone. If your items are more complex, of course the key and logic to make the keys will need to be more complex to decide what constitutes unique.

A: You could do this
    if(myArray !== undefined && myArray.length != 0) {
     //your code here
    }


text:
Q: Convert list into dataframe python by converting list elements into rows and columns I currently have a list with 25 elements in (shape is 25,1).  This contains just the data items. I want to convert the list elements into a pandas DataFrame with 5 columns and 5 rows.  I have to colNames separately and just want to use the following method:
myList = ([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,20,21,22,23,24,25])
df = pd.DataFrame(myList,columns=['Col1', 'Col2', 'Col3', 'Col4', 'Col5'])

Obviously, the above code won't work as my list element and subsequent df shape are different.  Is there a simple way to split the list elements into rows after every 5th element?  Also, bear in mind that I haven't created the list as in the example above - I just want to be able to perform the second line once the list has been transformed into the appropriate shape.  I guess I could try converting the list to a numpy array first and then reshaping it this way, then converting to Pandas DataFrame, but just wanted to see if there was a quicker way.

A: Numpy works well here:
import numpy as np
myList = ([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,20,21,22,23,24,25])
myList = np.asarray(myList).reshape(5,5)
print(myList)

will output
array([[ 1,  2,  3,  4,  5],
       [ 6,  7,  8,  9, 10],
       [11, 12, 13, 14, 15],
       [16, 17, 18, 18, 20],
       [21, 22, 23, 24, 25]])

A: import math
import pandas as pd

l = ([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,20,21,22,23,24,25])
df=[l[5*i:5*i+5] for i in range(0,math.ceil(len(l)/5))]

df = pd.DataFrame(df,columns=['Col1', 'Col2', 'Col3', 'Col4', 'Col5'])
print(df)

output:
   Col1  Col2  Col3  Col4  Col5
0     1     2     3     4     5
1     6     7     8     9    10
2    11    12    13    14    15
3    16    17    18    18    20
4    21    22    23    24    25

A: Just in case without numpy
Example
import pandas as pd

ls = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,20,21,22,23,24,25]
size = 5

ls = [ls[i::size] for i in range(size)]

df = pd.DataFrame(ls,columns=['Col1', 'Col2', 'Col3', 'Col4', 'Col5'])

Output
Col1    Col2    Col3    Col4    Col5
1       6       11      16      21
2       7       12      17      22
3       8       13      18      23
4       9       14      18      24
5       10      15      20      25


text:
Q: Why do we use $\frac{\pi}{180}$ to convert from degrees to radians? If I want to convert from degrees to radians, I can use the function that takes degree value as an input, multiplies it with $\frac{\pi}{180}$ and returns the radian value: $\operatorname{DtoR}(d)=d \times \frac{\pi}{180}$.
And if I want to go from radians to degrees I need to only go backwards and  divide radian value with $\frac{\pi}{180}$ (e.g. multiply it with $\frac{180}{\pi}$): $\operatorname{RtoD}(r)=r \times \frac{180}{\pi}$.
My question is this: Why does multiplying/dividing with $\frac{\pi}{180}$ converts degrees into radians/radians into degrees? Why exactly that number, not some other? Also, does this work only for unit circle, or for any circle?

A: Take a look at these ratios:
$\frac{180}{d}=\frac{\pi}{r}$
Where $d$ is the degrees and $r$ is radians.
Knowing that $\pi$ radians is 180 degrees one can setup this ratio to find the values they're looking for.
Finding degrees: $d=\frac{180}{\pi}r$
Finding radians: $r=\frac{\pi}{180}d$
These equations are simply derived from the first ratio.
It doesn't only need to be $\frac{\pi}{180}$, it can also be setup as:
$\frac{360}{d}=\frac{2\pi}{r}$
Because it is also known that $2\pi$ radians is a full revolution about the circle just as 360 degrees is.

A: A full circle is $360^\circ$ and also $2\pi$ radians. Thus $360^\circ = 2\pi\text{ rad}$. We simplify by dividing by two.

A: Think of it as solving proportions. We have $$\pi \text{ radians} = 180^\circ$$ and you want to convert $$r \text{ radians} = d^\circ.$$ Hence you get
$$
\frac{\pi}{r} = \frac{180}{d}
$$
which simplifies to
$$
r = \frac{\pi}{180} d \quad \text{or equivalently} \quad d = \frac{180}{\pi} r.
$$

A: The radian is defined as the plane angle subtended by any circular arc divided by its radius.
When the circular arc is actually congruent to the circle, the length is $2\pi r=2\pi=$ $\tau$ (for a unit circle). The angle subtended by this arc is $360^\text{o}$, and therefore $1\:\text{radian}=\frac{360}{\tau}=\frac{180}{\pi}$.
So: $$r\text{ radians}=\text{d}\cdot \frac{180}{\pi}\\ d\text{ degrees} = \frac{r}{\frac{180}{\pi}}=\frac{180r}{\pi}$$

A: Since circumference =2pier if we take half circle it would be pier in which rotation of angle is 180 degree and  arc length would be pie*r then we get theta =pie =180 degree


text:
Q: SSH login are disabled after chmod 444 -R myfolder / I have accidently ran  chmod 444 -R myfoler /.
Because of a space it changed root dir permission , I have immediately stopped but now all my login are disabled except root.
Please need help asap.
debug output from ssh to my user from root terminal.
OpenSSH_6.2p2, OpenSSL 0.9.8j-fips 07 Jan 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 31: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <IP> [<IP>] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug3: Incorrect RSA1 identifier
debug3: Could not load "/root/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "<IP>" from file "/root/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /root/.ssh/known_hosts:181
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "<IP>" from file "/etc/ssh/ssh_known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5-etm@openssh.com
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug2: mac_setup: found hmac-md5-etm@openssh.com
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA b4:71:98:9c:e9:8f:b2:f1:0a:84:e6:a5:29:a1:83:e6 [MD5]
debug3: load_hostkeys: loading entries for host "<IP>" from file "/root/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /root/.ssh/known_hosts:181
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "<IP>" from file "/etc/ssh/ssh_known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug1: Host '<IP>' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:181
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /root/.ssh/id_rsa (0x7fdf28796350),
debug2: key: /root/.ssh/id_dsa ((nil)),
debug2: key: /root/.ssh/id_ecdsa ((nil)),
debug1: Authentications that can continue: publickey,keyboard-interactive,hostbased
debug3: start over, passed a different list publickey,keyboard-interactive,hostbased
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive,hostbased
debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ecdsa
debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:
debug3: packet_send2: adding 32 (len 17 padlen 15 extra_pad 64)
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 0
debug3: packet_send2: adding 48 (len 6 padlen 10 extra_pad 64)
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to <IP> ([<IP>]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug3: Ignored env JDK7_64_ROOT
debug3: Ignored env LESSKEY
debug3: Ignored env NNTPSERVER
debug3: Ignored env INFODIR
debug3: Ignored env MANPATH
debug3: Ignored env HOSTNAME
debug3: Ignored env JRE6_64_HOME
debug3: Ignored env XKEYSYMDB
debug3: Ignored env HOST
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env PROFILEREAD
debug3: Ignored env HISTSIZE
debug3: Ignored env SSH_CLIENT
debug3: Ignored env PERL5LIB
debug3: Ignored env JRE6_64_ROOT
debug3: Ignored env JDK8_64_BINDIR
debug3: Ignored env MORE
debug3: Ignored env OLDPWD
debug3: Ignored env SSH_TTY
debug3: Ignored env GSCMAN
debug3: Ignored env JDK7_64_BINDIR
debug3: Ignored env GSCBIN
debug3: Ignored env USER
debug3: Ignored env LS_COLORS
debug3: Ignored env GSCSBIN
debug3: Ignored env XNLSPATH
debug3: Ignored env TTU_PATH
debug3: Ignored env ENV
debug3: Ignored env JDK7_64_HOME
debug3: Ignored env HOSTTYPE
debug3: Ignored env FROM_HEADER
debug3: Ignored env JRE7_64_HOME
debug3: Ignored env PAGER
debug3: Ignored env CSHEDIT
debug3: Ignored env XDG_CONFIG_DIRS
debug3: Ignored env MINICOM
debug3: Ignored env JDK6_64_BINDIR
debug3: Ignored env MAIL
debug3: Ignored env PATH
debug3: Ignored env JRE5_64_ROOT
debug3: Ignored env JRE5_64_BINDIR
debug3: Ignored env CPU
debug3: Ignored env JRE8_64_BINDIR
debug3: Ignored env SSH_SENDS_LOCALE
debug3: Ignored env JDK6_64_HOME
debug3: Ignored env INPUTRC
debug3: Ignored env PWD
debug3: Ignored env JRE8_64_HOME
debug3: Ignored env JAVA_HOME
debug3: Ignored env JDK8_64_ROOT
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env PYTHONSTARTUP
debug3: Ignored env JDK8_64_HOME
debug3: Ignored env JRE7_64_BINDIR
debug3: Ignored env QT_SYSTEM_DIR
debug3: Ignored env SHLVL
debug3: Ignored env HOME
debug3: Ignored env GSCLIB
debug3: Ignored env LESS_ADVANCED_PREPROCESSOR
debug3: Ignored env OSTYPE
debug3: Ignored env LS_OPTIONS
debug3: Ignored env XCURSOR_THEME
debug3: Ignored env WINDOWMANAGER
debug3: Ignored env G_FILENAME_ENCODING
debug3: Ignored env LESS
debug3: Ignored env MACHTYPE
debug3: Ignored env LOGNAME
debug3: Ignored env JRE7_64_ROOT
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env JDK6_64_ROOT
debug3: Ignored env SSH_CONNECTION
debug3: Ignored env LESSOPEN
debug3: Ignored env JRE6_64_BINDIR
debug3: Ignored env INFOPATH
debug3: Ignored env JRE5_64_HOME
debug3: Ignored env LESSCLOSE
debug3: Ignored env G_BROKEN_FILENAMES
debug3: Ignored env HISTTIMEFORMAT
debug3: Ignored env JRE8_64_ROOT
debug3: Ignored env COLORTERM
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Thu May 31 14:24:25 2018 from <IP>
Could not chdir to home directory /data/user/gg_user/: Permission denied
/bin/bash: Permission denied
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)

Connection to <IP> closed.
Transferred: sent 3076, received 2492 bytes, in 0.0 seconds
Bytes per second: sent 864086.7, received 700033.9


text:
Q: Partial Filling of a table with required fields in Asp.Net MVC 5 using Entity Framework I have a scenario where i am maintaining profiles of users. The profile table contains 20 columns out of which 10 are required fields. Initially when the user registers , i save that information (firstname , lastname , country , email , password ) in the default database of my project , Then i have a separate SQL database in which i am maintaining a profile for each user. The fields that i take during registration phase ( as mentioned above ) are entered into the Sql Database and leaving rest of the fields empty for later filling by the user.
var user = new ApplicationUser { UserName = model.Email, Email = model.Email, FirstName = model.FirstName, LastName = model.LastName, Country = model.Country };

var profile = new Profile { CanID = model.Email, Email = model.Email, FName = model.FirstName, LName = model.LastName, Country = model.Country ,ProfileStatus = "0", CreatedOn = DateTime.Now.ToShortDateString()};

var result = await UserManager.CreateAsync(user, model.Password);

 if (result.Succeeded)
 {
      db.Profiles.Add(profile);
      db.SaveChanges();

      //This fails because a few required fields are left out so it has to fail that i understand.

     //Also the below code has to fail because since the record is not created than how can the attach function work.

     db.Profiles.Attach(profile);
     db.Entry(profile).Property(p => p.CanID).IsModified = true;
     db.Entry(profile).Property(p => p.Email).IsModified = true;
     db.Entry(profile).Property(p => p.FName).IsModified = true;
     db.Entry(profile).Property(p => p.LName).IsModified = true;
     db.Entry(profile).Property(p => p.Country).IsModified = true;
     db.Entry(profile).Property(p => p.ProfileStatus).IsModified = true;
     db.Entry(profile).Property(p => p.CreatedOn).IsModified = true;
 }

var user is saved into the default db of my project and var profile will be saved in the SQL Database's table with the name of Profile.
So the bottom line is , i have a table Profile , which has 20 columns out of which 10 are required , When the user initially registers  , i save that info in the default db and also i want to save it in Sql Db's Profile Table. SO how am i going to save record in Profile table when not all the required fields are filled during registration phase ? Its a create scenario to be more precise.


text:
Q: How to parse current page json object values to next page textfield?to set textview with previous page key values       private void checkOut() {
        ArrayList<FishInfoFromJSON> fishInfoFromJSONs = new ArrayList<>();
        fishInfoFromJSONs = ((MainActivity) mContext).getAddedItems();

        final ArrayList<CartInfo> cartInfos = new ArrayList<>();

        for (FishInfoFromJSON fishInfoFromJSON : fishInfoFromJSONs) {
            CartInfo cartInfo = new CartInfo();
            cartInfo.setProductId(fishInfoFromJSON.getProductId());
            cartInfo.setQuantity(fishInfoFromJSON.getQuantitySelected());
            cartInfos.add(cartInfo);        }

        Customer customer = new Customer();
        customer.setCustomer_id(12);
        customer.setFirstname(firstname.getText().toString());
        customer.setLastname(lastname.getText().toString());
       // customer.setEmail("rajagopal.viswanathan@gmail.com");
        SharedPreferences pref =this.getActivity() .getSharedPreferences("MyPref", Context.MODE_PRIVATE);
        String emailst = pref.getString("userEmail", " ");
       // String emailst = pref.getString("userEmail", FragmentLogin.emailedt.edtstr);
        customer.setEmail(emailst.toString());
        customer.setStreet1(addr1.getText().toString());
        customer.setStreet2(addr2.getText().toString());
        customer.setCity("Coimbatore");
        customer.setRegion("TamilNadu");
        customer.setCountry("India");
        customer.setPostcode(post_code.getText().toString());
        customer.setPhone(phonenum.getText().toString());
        customer.setFax("7298292922");

        String text = addtext.getText().toString();
        String spinn = preferredTimeSpinner.getSelectedItem().toString();

        final ShippingInfo shippingInfo = new ShippingInfo();
        shippingInfo.setCart(cartInfos);
        shippingInfo.setCustomer(customer);
        shippingInfo.setNotes(text);
        shippingInfo.setPreferredDelTime(spinn);
        Log.i("shipping information" , String.valueOf(shippingInfo));

        final   JSONObject jsonObj = new JSONObject();
        try {
            jsonObj.put("cart", cartInfos);
            jsonObj.put("customer", customer);
            jsonObj.put(" ", text);
            jsonObj.put(" ", spinn);

         /*   JSONObject jObj = new JSONObject(String.valueOf(jsonObj) );
            Toast.makeText(getActivity(),jObj.toString(),Toast.LENGTH_SHORT).show();
*/
                    } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        Gson gson = new Gson();
        String str_json = gson.toJson(shippingInfo);
        Log.i("gopi", str_json);

        HttpEntity entity = new StringEntity(str_json, "UTF-8");
        String contentType = "application/json";
        String url = EndPoints.checkOutUrl;
        AsyncHttpClient client = new AsyncHttpClient();
        client.post(mContext, url, entity, contentType, new AsyncHttpResponseHandler() {
            @Override
            public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {

                String responseStr = "nothing gopi";
                try {
                    responseStr = new String(responseBody, "UTF-8");

                } catch (UnsupportedEncodingException e) {

                }

                Log.i("HTTP", "onSuccess: " + statusCode + "   responseBody:" + responseStr);

                Toast.makeText(mContext, "Order placed successfully!", Toast.LENGTH_SHORT).show();
                Toast.makeText(getActivity(), jsonObj.toString(), Toast.LENGTH_LONG).show();
                String result = firstname.getText().toString()
                        + lastname.getText().toString()
                        + addr1.getText().toString()
                        + addr2.getText().toString()
                        + addtext.getText().toString()
                        + phonenum.getText().toString()
                        + preferredTimeSpinner.getSelectedItem().toString();

                Toast.makeText(getActivity(),result.toString(),Toast.LENGTH_SHORT).show();

            }

            @Override
            public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {

                String responseStr = "nothing gopi";

                if (responseBody != null) {
                    try {
                        responseStr = new String(responseBody, "UTF-8");
                    } catch (UnsupportedEncodingException e) {

                    }

                    Log.i("HTTP", "onFailure: " + statusCode + "   responseBody:" + responseStr);
                    Toast.makeText(mContext, "Failed! Please contact Customer Support!" + statusCode, Toast.LENGTH_SHORT).show();
                }

            }
        });

I have to set next page textfield with json object value like name, order id, date, price etc.... I don't know how to do that, can you give some idea to assign the textview with json value?
Nextpage code:
public class Order_conformation extends AppCompatActivity implements View.OnClickListener {
    private Button placeorder;
    private TextView cus_id,order_date,cus_name,cus_email,cust_name,cus_add,cus_mobile,fixedrate,quantity,price,subtotal,tax,discount,grandtotal,subtotallast,
shippingcharge,total;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.order_conformation_page);
    Button placeorder= (Button)findViewById(R.id.btn_placeorder);

    /* SharedPreferences pref = getApplicationContext().getSharedPreferences("MyPref", MODE_PRIVATE);
     String cusname = pref.getString("firstname", " ");
     String phnenumber = pref.getString("phone", " ");
     String addr = pref.getString("street1", " ");
     String cusemail = pref.getString("email", " ");*/

     cus_id=(TextView)findViewById(R.id.customer_id);
     order_date=(TextView)findViewById(R.id.order_date);
     cus_name=(TextView)findViewById(R.id.customer_name);
     cust_name = (TextView)findViewById(R.id.customer_name1);
     cus_email=(TextView)findViewById(R.id.customer_email);
     cus_add=(TextView)findViewById(R.id.customer_address);
     cus_mobile=(TextView)findViewById(R.id.customer_number);
     fixedrate = (TextView)findViewById(R.id.first_name);
     quantity = (TextView)findViewById(R.id.qty);
     price = (TextView)findViewById(R.id.price);
     subtotal = (TextView)findViewById(R.id.subtotal);
     tax = (TextView)findViewById(R.id.tax);
     discount = (TextView)findViewById(R.id.discount);
     grandtotal = (TextView)findViewById(R.id.rowtotal);
     subtotallast = (TextView)findViewById(R.id.subtotal_last);
     shippingcharge = (TextView)findViewById(R.id.shipping_charge);
     total = (TextView)findViewById(R.id.grand_total);
     placeorder.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {

            Intent intent = new Intent(Order_conformation.this, Order_conformation_final.class);
            final OrderInfo orderInfo = new OrderInfo();
            startActivity(intent);

        }

    });

}

@Override
public void onClick(View view) {

}

}

A: You can just pass your Json as a string or parse it into a POJO and pass it along to the next Activity using this,
intent.putExtra("key","value");

And then you can retrieve it in the next activity as follows
getIntent().getStringExtra("key");


text:
Q: Проблема с оптимизацией ORM в Kohana (SHOW FULL COLUMNS FROM `tablename`) Доброе время суток, форумчане.
У меня появилась проблема с запросом в одну таблицу БД:

$help1 = ORM::factory('help')
                    ->where('id', '=', '1');

При формировании
запроса в таблицу, получается:
Model_help Object ([_table_name:protected] => helps …[last_query] => SHOW FULL COLUMNS FROM `helps`…

Один из вариантов решения данной проблемы нашел на ссылка (создал файл, положил в директорию «classes»), но опять в сформированном запросе получается какая-то чехарда:
Model_help Object([_table_name:protected] => helps…. [last_query] => SELECT `department`… FROM `departments`…

Т.е. у меня есть таблица «departments», но речь же не о ней.
Второй вариант ссылка, но он какой-то громоздкий, и предполагает вставку полученной структуры таблицы в модель вручную.

Может, есть еще какой-нибудь вариант? Можно, конечно, через "DB::select" попробовать, но привязался к ORM.

Заранее спасибо.


text:
Q: I need to count Images with a specific value for "src" in a web page and populate a input field and submit page using script automatically Assume any web page with a Form and having a set of images. I need to populate the input text value on page load and submit.
var imgs = document.getElementsByTagName('img');
var countImagesFilled = 0;

var curImg;
for(var i = 0; i < imgs .length; i++) {
  curImg = imgs[i];
if(curImg.getAttribute('src')=='abc.png'){++countImagesFilled;}
}
var inputValue = document.getElementsByName('valuee');
inputValue[0].value=countImagesFilled;
document.forms[0].submit();

A: Checkout this working example :)

window.onload = ()=>{
  // get our form
  let imageForm = document.getElementById('image-form');
  // something to inform us that the form has been submitted
  imageForm.addEventListener('submit', function(){
    console.log(`form data: ${$(this).serialize()}`);
  });

  // get all the img elements
  let images = document.querySelectorAll('img');
  // get the input field where we'll be putting the total image count
  let field = document.getElementById('image-count');
  // the number of images that match our criteria
  let imageCount = 0;
  // count the number of img elements that have 'test.png' as their source
  for(let i = 0; i < images.length; i++){
    if(images[i].getAttribute('src') === 'test.png'){
      imageCount++;
    }
  }

  // set the image count (imageCount) as the value of the text field
  field.value = imageCount;

  // submit the form
  imageForm.dispatchEvent(new Event('submit'));
};

<form id="image-form" name="imageCount">

  <input type="text" id="image-count" name="imageWithSourceCount">
</form>

One more thing, given the following HTML:

if you read the src property of the image object (img.src), you will get the resolved path which will be something like yourwebsite.com/images/test.png. But, if you retrieve it using getAttribute (img.getAttribute('src')), you will get the actual value of the src attribute which may also be a relative path (i.e. images/test.png)

A: var imgs = document.getElementsByTagName('img');
var countImagesFilled = 0;

var curImg;
for(var i = 0; i < imgs .length; i++) {
    curImg = imgs[i];
    if(curImg.src == "yoururl") //replace this if statement
        countImagesFilled++;
    }
}
var inputValue = document.getElementById('valuee');  //find by ID... give input tag an id attribute
inputValue.value=countImagesFilled;
document.forms[0].submit();


text:
Q: Prevent USB Partition to be automount on EVERY WINDOWS device I have USB stick and What I want to achieve is:

*

*Split the USB into 2 partitions

*Make First Partition bootable and install Multible ISO using YUMI Multiboot

*Make the Multiboot partition hidden from every windows device , in other words: not mountable by default in any windows device

*other partition is used to store files as needed

the goal from all of this is to make bootable partition with for example, mini Linux distro that can be used in emergency , but separated from files stored on USB and not auto mountable in ANY windows by default , thus protecting that partitions from malwares that change file content by default and making this still bootable and working


text:
Q: Getting unknown property: Da\User\Module::isGuest yii2-usuario I'm install 2amigos/yii2-usuario:~1.5.1 on a yii2-basic-template, using https://yii2-usuario.readthedocs.io/en/latest/. However, it returns this error (Getting unknown property: Da\User\Module::isGuest yii2-usuario) in any view.
My config/console.php:
'components' => [
...
        'authManager'  => [
            'class'=> 'yii\rbac\DbManager',
        ],
...
],
'controllerMap' => [
        'migrate' => [
            'class' => \yii\console\controllers\MigrateController::class,
            'migrationPath' => [
                '@app/migrations',
                '@yii/rbac/migrations', // Just in case you forgot to run it on console (see next note)
            ],
            'migrationNamespaces' => [
                'Da\User\Migration',
            ],
        ],
    ],

My config/web.php:
'components' => [
  ...
  'user' => [
           'class' => Da\User\Module::class,
           'classMap' => [
                'User' => app\models\User::class,
            ],
 ],
 'authManager'  => [
            'class' => 'yii\rbac\DbManager',
  ],
  'view' => [
            'theme' => [
                'pathMap' => [
                     '@Da/User/resources/views' => '@app/views/user'
                ]
            ]
   ]
],

I managed to solve it with help.
Follow the line:
Remove : config/web.php
'user' => [
            'identityClass' => 'app\models\Users',
            'enableAutoLogin' => true,
            'enableSession' => true,

        ],

 'user-management' => [
            'class' => 'webvimark\modules\UserManagement\UserManagementModule',
            'on beforeAction'=>function(yii\base\ActionEvent $event) {
                if ( $event->action->uniqueId == 'user-management/auth/login' ){
                    $event->action->controller->layout = 'loginLayout.php';
                };
            },
        ],
add into config/web.php:
'components' =>[ ...
'authManager'  => [
            'class' => 'yii\rbac\DbManager',
        ],
'view' => ['theme' => [ 'pathMap' => ['@Da/User/resources/views' => '@app/views/user']]] //If your view is modified.
]
'modules' => ['user' => [
            'class' => \Da\User\Module::class,
            'allowAccountDelete' => true,
            'enableRegistration' => false,
            'administratorPermissionName' => 'user-management']
...]
``