Tikz draw automata..

Question: I've been able to draw the states, and the arrows between the states. It's the "labeling" around the automata I've got issues with ( I, E, P, and R).. Any ideas?
Comment: Welcome to TeX.SE! Could you please provide us with what you have achieved to do?
Comment: Questions seeking debugging help ("**why isn't this code working?**") must include the desired behavior, a *specific problem or error* and *the shortest code necessary* to reproduce it **in the question itself**. Questions without **a clear problem statement** are not useful to other readers. See [minimal working example (MWE)](//tex.meta.stackexchange.com/q/228).
Comment: TikZ has a whole library for drawing automata. Are you using it? It makes lablelling connections between states simple.  But without showing your code it's hard to tell what you are doing. See [Which package can be used to draw automata?](//tex.stackexchange.com/q/20784).
Comment: I agree with @AlanMunn. I also find it very hard to guess what your doing after my [crystal ball](https://i.stack.imgur.com/qOr3L.png) got stolen. ;-)
Answer: <code>\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,positioning,calc}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,nodes in empty cells,column sep=3.14mm,row sep=3.14mm,
nodes={draw,circle,fill=cyan!50,minimum size=1cm}] (mat) {
 & & & \\
 & & & \\
};
\node[left=3.14mm of mat-1-1,font=\sffamily] {P};
\node[left=3.14mm of mat-2-1,font=\sffamily] {R};
\path ($(mat-1-1.north)!0.5!(mat-1-2.north)$) coordinate (x1)
($(mat-1-2.north)!0.5!(mat-1-3.north)$) coordinate (x2)
($(mat-1-3.north)!0.5!(mat-1-4.north)$) coordinate (x3)
($(mat-2-2.south)!0.5!(mat-2-3.south)$) coordinate (x4);
\node[above=3.14mm of x1,font=\sffamily] {I};
\node[above=3.14mm of x3,font=\sffamily] {E};
\draw[dotted] (x2) -- (x4);
\end{tikzpicture}
\end{document}
</code>
Comment: @HenriMenke My willingness is inversely proportional to the reputation of the user. (You could just upvote those users to prevent me from answering these questions. ;-) A bit more seriously, there is a long discussion on whether or not one should ["educate" users](https://tex.meta.stackexchange.com/questions/7733/should-we-educate-new-users-by-not-answering-until). I see and respect the arguments of both sides, but my take on this is that (a) I do not educate users and (b) the answer is for everyone, not just the asker.
Comment: 61k rep and still not tired of answering do-it-for-me questions.  That's some real dedication.
Comment: Thank you! I did not receive a notification that my answer had been answered.

Tikz draw automata..


How can I get fast external ssd safely?

Question: I want to get Thunderbolt speeds for my M1 Mac Mini for a low price, but it's confusing.  If I buy a fast external drive, I may get slow speed because of low power.  If I buy a powered thunderbolt 3 hub, I can get faster speed, but all the powered hubs sold on Amazon have people complaining that their ports were fried by those hubs.  Is there a safe hub?  Is there a powered drive that doesn't cost the moon?  What's the solution?
Comment: could you clarify your question - are you looking for a drive that runs fast when plugged in directly, or a thunderbolt 3 hub that can deliver enough power to multiple accessories, including a drive, that is safe to use?
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comment: Are you asking for a product recommendation?
Comment: Yes, I'm looking for recommendations or an explanation of how to think about this.  I want something fast at the lowest cost.  If I can plug a drive into the thunderbolt port and get 40 Gb/s, that would be great, but from what I'm reading, that sort of speed requires a hub.  And I'm guessing it requires a powered hub.  And a powered hub, moreover seems to be dangerous.  If it's badly made, it can destroy the computer and/or it's ports.   And it's not easy to find any sort of explanation from Apple or Apple users.
Answer: There is no necessity for a Thunderbolt drive to require a hub between it and the computer.
There'a also some possible confusion between "Thunderbolt drives" and "USB-C drives", as both use the same port/connector. Most portable drives that do not require a separate power supply are likely to be USB-C, rather than TB.
True Thunderbolt drives are likely to be larger units, such as RAID systems, that have their own power supply.
There have been reports of cheap USB-C hub that have a power supply coming in causing problems with M1 Macs. But this relates to charging Macs with batteries, and so does not affect a Mini.
There have also been problems reported with the connection speed of external drives on M1 Macs.
https://eclecticlight.co/2022/04/18/m1-thunderbolt-ports-dont-fully-support-usb-3-1-gen-2/
This may not be enough information to remove all confusion. I would also ask what you plan to use the drive for, and whether high speeds are essential.
Comment: This. The last question ("What you plan to use the drive for") is the essential query to avoid an X-Y problem.

How can I get fast external ssd safely?


training matrix: Should we ditch/replace huge tables on mobile?

Question: It is popular to use this sort of model in certain industries; the training matrix. Its nonetheless a huge table of data. Are there any possible alternatives to replacing the training matrix? Or another way to display a huge amount of data on desktop and mobile?
Comment: Is there a reasonable/practical use case your viewing this type of information on mobile? Usually large amounts of information on mobile require scrolling (vertical, horizontal or both) and doesn't lend itself to a positive user experience. Some sort of filter followed by a smaller table displaying the results seem more reasonable.
Comment: @MichaelLai The simplest way to solve the space problems of mobile (within tables bigger than the view) is the same way spreadsheets have been doing it for tables from their inception, ie the split view. One (or more) columns and/or rows stay in place whilst the rest scroll.  Unfortunately I think this means the answer to this question is no, there's not a better way than a table matrix to represent this kind of thing.
Comment: @MichaelLai Practical use case? As in do users actually, really, definitely need this feature on the go? Nope. This is a client request and they want this to be on mobile even after explaining the dynamics of a mobile platform. Now im looking for solutions and alternatives. However, this would be interesting to figure out a way to display huge amount of data on mobile.
Comment: @Confused in this situation, having a fixed section (e.g. the header rows and columns) with scrolling internal sections is probably not that practical because it would only show a very limited number of rows and columns at any given time.
Comment: @MichaelLai that's true of any table on a mobile screen. But it's still the best (and only) solution. Even for bigger screens.
Comment: Keep the Template, however, do not continue use for mobile devices (phone) other than tablets or iPads.
Answer: This situation comes up all the time, i.e. You have a complex table in a web application, but because the business decides it should be jumping on the mobile revolution, and that it heard about responsive design and thinks it will save them money if they only have to work from one code line.
The bottom line here is the goals of a mobile user on the go, will be very different to the goals of the web user set at a desk with a large resolution monitor. As others here have said, a mobile device is way too small, and the one thing a mobile device can't do is make use of lots of tabular data.
So if you want a mobile solution you really need to understand what you want your users to do on a mobile device on the go, because it is way different to using a web application displayed on a large monitor from your desk.
So now that I have told what you can't do, here is something you can do. Consider the card UI metaphor for mobile. This will allow you to chunk the table data in small discrete blocks of information.
This article introduces you to the card UI metaphor:
https://blog.intercom.com/why-cards-are-the-future-of-the-web/

Cards give bursts of information
Cards as an information dissemination medium have been around for a
  very long time. Imperial China used them in the 9th century for games.
  Trade cards in 17th century London helped people find businesses. In
  18th century Europe footmen of aristocrats used cards to introduce the
  impending arrival of the distinguished guest. For hundreds of years
  people have handed around business cards.
Cards can be manipulated
In addition to their reputable past as an information medium, the most
  important thing about cards is that they are almost infinitely
  manipulative.

However, everything starts by working out what you want someone to do on a mobile device, and validating this with the real people who you are expecting to use this.
Answer: Since you have a limited amount of space, the question that you need to ask yourself (and the client) is what the minimum or useful 'section' of information would be, and build the user interface around that. This is one of the reason that a listview or card/tile view of information has been adopted and popularised in the mobile view of website design.
The mobile view doesn't lend it self to comparisons of large amounts of information very well, so the best you can do is to try and present slices or pieces of information that is meaningful enough for the user to make a decision or to take action. For anything more complicated it is still better to push them back to the desktop environment.
But rather than trying to argue with them over requirements, just show them the difference between the table matrix design versus one of the suggested alternate design strategies and see which is more user-friendly/usable.
Answer: Supplement by reformation and condensing data while keeping the original matrix:
Here is one way, it entails finding the main question the table answers, along with the minimum options you can offer and formatting it for mobile, in this case with a couple of select options and a list. Note that although this might work for most,in this particular case you loose the global perspective a reference table offers, so you might still want to offer it as a separate download, or recombine the data for a different user.
Answer: Usability Testing
As most of us agree that displaying huge data is not a good UX, especially for the small devices and resolutions. I recommend doing a usability testing to provide some evidence to convince the Client about drawbacks. We need to delight the customers as well as clients. As a best practice, we do usability testing throughout any app development.

Try to host this matrix in a server (if you don't have a server and if you are using Axure, you can do it by 'share').
Ask/request the client and other users (or some of your colleagues) to look at the prototype and provide their feedback.
You may want to prepare script for conducting the usability testing and get the numbers (pros and cons).
Answer: This is a great example of why you need to know who the users are and what they need.
I'm going to go out on a limb and say no one user needs to see all this information in this one place all the time.
For example, if the user is an employee who wants to see what training she needs to complete:
1. Choose job title: Field supervisor

2. Display required courses:
   • Once          Quality Core
   • Once          PEC/Safegulf
   • Every 4 years Crane operator
...

If the user is HR staff who is scheduling training sessions and wants to know which employees to notify:
1. Choose company: QPM

2. Display required attendees

Quality Core:
   • Field supervisor
   • Lead operator
   • A operator

PEC/SafeGulf:
   • Field supervisor
   • Lead operator
   • A operator

There may be other users who need the information provided according to their own needs.
Also, freed from the table, the data can be smart. You have the scheduling data here, why not show the employee only the courses that still need to be taken, or only those that need to be taken this year, based on data of which courses he has already taken?


Spread and volatility

Question: I look for any references where one consider how bid-ask spread depends on volatility (may be it is more correct to say 'volatility measure'). I would be grateful for any references.
Answer: Whatever is published out there, you are better off developing the model yourself. The model has to be customized to your objectives. Much depends on the asset and the broker / market maker. And still, there is no clear relationship.
For example, for most currencies the period 5 pm - 5:15 pm (EST) is when many brokers "take the rest" and set very high bid-ask spreads. They take the rest because this is the end of NY day and time for very thin trading. "Thin trading" means low volatility. On the other hand, during active hours the relationship is the reverse. Around the announcements we see increased bid-ask spread and increased volatility. Usually, we are talking about 3:30 am, 5 am and 8:30 am (EST).
Comment: Consider the most 'standard' period of time. What about this?
Comment: There is no such thing. Dynamics around 8:45 am is quite different from dynamics around 8:30 am... If you put your heart and soul into this, you will create something of value. Because the underlying relationships are non-trivial.

Spread and volatility


What is an asymptotically tight upper bound?

Question: From what I have learned asymptotically tight bound means that it is bound from above and below as in theta notation.
But what does asymptotically tight upper bound mean for Big-O notation?
Comment: This confused me too. Why can't authors say "theta"? Why invent unnecessary terms?
Answer: Saying that a big-O bound is "asymptotically tight" basically means that the author should have written $\Theta(-)$.  For example, $O(x^2)$ means that it's no more than some constant times $x^2$ for all large enough $x$; "asymptotically tight" means it really is some constant times $x^2$ for large enough $x$ and not, say, some constant times $x^{1.999}$.
Comment: $\Theta$ would imply $\Omega$, which is not necessarily true.
Answer: Here's an example explaining it (and a concrete example for David's fine answer).
Suppose you have an algorithm that is given as input an array of integers $A$. The algorithm scans through the array, and increments a counter initially set to zero everytime it sees an element that is an even integer. We can prove the algorithm runs in say $O(n^3)$ time, where $n$ is the number of elements in $A$. But we can also give a tighter bound, and say it runs in time $O(n)$. This bound is asymptotically tight: in fact, since reading the input already takes $\Omega(n)$ time, we could be more precise and say the algorithm takes $\Theta(n)$ time.
Comment: +1, but I think a danger in your choice of example is that it can be misinterpreted to be claiming that for an upper bound to be asymptotically tight, it must be that no faster algorithm for this problem is possible, when that's not true.  (I say this because whenever I see the "You need at least $\Omega(n)$ time to read the input" observation, it's being used to justify such a "no faster algorithm can exist" claim.)
Comment: @j_random_hacker You are right, we should be careful with that. To reiterate, ofcourse an asymptotically tight bound says nothing about the possibility of having a faster algorithm in general.
Answer: $\Theta$ means we have both a lower bound and an upper bound. For example if $f(n) = \Theta(n^2)$ then $c_1 n^2 <= f(n) <= c_2 n^2$ for large n.
However, we have functions that are not always close to the upper bound. For example, $\sin n \cdot n^2 = O(n^2)$, but it is not $\Theta (n^2)$. Still, we cannot reduce the $n^2$. $\sin n \cdot n^2 ≠ o(n^2)$. That makes $n^2$ an asymptotic tight upper bound.


how to train tensorflow chat application on updated dataset everyday

Question: I have created chatbot on Cornell movie dataset and it's working fine. I have trained chatbot application up to global step 330000. I am using tensorflow library. I am using ||source|| chatbot. I am also receiving output fine.  Then I created this new dataset file by modifying original dataset and i wish to train chatbot application with updated files. Now should I delete previously saved checkpoints and saved data and start training from zero or should i train from 330000 onwards without worrying changes in dataset.
           I wish to modify database daily basis and train on modified database.
Please kindly let me know if you have a suggestion for me as I am stuck on this issue. I will really appreciate if you help me with this issue.
Comment: Persist the weights, and use them with tensorflow's constant initializer when you want to update. And periodically train from scratch as Jan says.
Answer: The distribution of your data won't change too much over a smaller period of time, retraining from scratch seems like a waste. Just add the new data to your set and do one or more epochs on all your data, not just the new ones. It can readjust the weights a little bit for changes in the distribution which is exactly what you want. Make sure you are not overreliant on early stopping as regularization method against overfitting because you continuously train like this, use some other regularizer. I would suggest periodically to retrain from scratch but this doesn't have to happen very regularly, maybe once every two months.


YouTube 360 videos will play but the view is stationary

Question: I'm using Sony Xperia M2 phone on Android Lollipop 5.1, and the YouTube app with latest update. Any video that supports 360 view will play, but the view is stationary - I can't move it around.
Answer: To watch 360° videos your phone should support a gyroscope sensor. A gyroscope gives the phone's pitch tilt and yaw, which is needed by the YouTube app to properly rotate the view on display.


Backing up/save files on android with a broken screen

Question: My phone's screen is broken and is useless, but it has important files on it. Is there a way to back the files up or get the phone back?
Answer: You can only back data up yourself, if the phone is functioning (apart from the screen obviously). Make sure it shows some kind of life signal when you plug it in/turn it on/press the volume keys/etc. It could be something like the charging LED lighting up or vibration. If you have the SIM card in there, you could also call it and check that way. If none of these work, then the only solution is to take it to a data recovery center (it can cost a couple hundred dollars, so make sure those photos are irreplacable).
So, first of all, a broken screen could mean a couple of things:
1.: The digitizer (touch screen glass) is broken
This is the easiest problem to solve. If you have an OTG cable (a cable with a micro USB end and a female USB on the other), you can connect a mouse to the phone and use that to back everything up. It's very rare nowadays for a phone (especially phablets) to not support this feature.

You could also just buy a new screen and either apply it yourself or take it to a repair shop if you want to keep the phone.
2.: The LCD (the display) doesn't work
If you see a black screen or random lines on the screen, when you turn it on, then the LCD is broken. This has a bunch of different types too.
If you're lucky and the phone goes into file transfer mode, when plugged into a computer, then you can just take the files off, so make sure to try this first.
a.: Water damage
If you dropped your phone in water and it got damaged, then either a chip got fried or something got corroded. It's usually impossible to tell which one it is, so the phone has to be disassembled and cleaned. It's not really worth it to buy a screen at this point, LCD don't really mind water that much. However, If you're "lucky" and only the backlight is faulty (or the connectors got corroded), then you can just take a strong flashlight, hold it up against the screen (possibly somewhere with a white/light area of pixels). Make sure to try this out, in my experience, even some repair shops forget to check it. I've had it on a friend's phone recently and it looked like this:

(That's the vodaphone logo btw)
If it's not the backlight, then probably some video output chip got damaged. Backing up data in this case is very hard. You could try using one of the tools designed for this but it's a gamble whether they work and even if they do, they might require you to turn on USB debugging (which is hard without seeing anything). I also don't like to install random programs on my computer.
In some cases, removing the corrosion from the device can also solve some problems. If you want to keep the warranty, take it to a repair shop and let them clean it. If you don't care however, iFixit has some really nice guides to disassemble almost any phone. Make sure to remove every board from the device, then take an unused tootbrush and some Isopropyl alcohol and give it a good scrub. Clean the adapters and the ends of the cables too. You're essentially looking for some blueish-greenish goo:

If you don't want to void warranty and you can't take it to a repair shop either, then you could theoretically put it in a tub of alcohol, but I haven't tried it and it certainly won't have the same effect.
After this, assemble the phone again without missing anything out and test it. Hopefully it works. If not, check the general advices part.
b.: Blunt damage
If you dropped your phone on concrete and the screen won't turn on again, it's either because the LCD got damaged or a cable got loose (the latter is very unlikely, I've only had it happen once and only with a vibration motor). If it turns on, but you see lines one the screen (see image below), then the LCD is broken.

(This is an iphone, but you get the point)
In any case, it's usually worth it to get a new screen if it's still in production. Make sure to not touch the glass too much, the small glass shards don't mix well with your finger.
c.: General advices
If nothing above worked for you, there's a small chance going through a software based solution will work too.
If you have USB debugging enabled, install adb, pull up the command line of your choice, connect the phone to the computer through USB (pray to your choice of deity) and type "adb devices" without the quotes. If your phone show up in the list, you can continue. Type "adb pull mnt/sdcard/DCIM/Camera/" without quotes. This will pull the images from your phone. You can also do "adb pull mnt/sdcard/" if you want every file on there, because you have some sick scores in temple run you want to keep.
Comment: Quick note: I compiled this list because I found the general lack of a comprehensive guide, which went into hardware and software frustrating.


Count external clock pulses for a predefined time interval (PIC16f877a)

Question: I need to count external clock pulses for a predefined time using PIC16f877a. I don't know what to use, whether counter or timer or both. I don't know to use timer and counter modules of PIC16f877a.
Please help me!!
Answer: To count how many pulses occur during a specified time interval, use two counter/timer modules. (This technique is not specific to Microchip PIC16F877A, and can be adapted to other microcontrollers with counter/timer modules.)

Configure one counter/timer as counter (clock source = external pin).
Configure another counter/timer as interval timer (clock source = instruction clock).
Clear the counter.
Enable the timer and the counter (at the same time, if possible).
As soon as the timer interval completes, disable the counter and read the count.

For lowest latency, you can test for timer interval complete by polling the appropriate flag bit in the timer register -- but your firmware will not be able to do anything else while making the measurement.
For best multitasking (firmware performing other actions while timer/counters are measuring the pulses), use an interrupt handler to detect the timer interval complete. There will be some latency due to the interrupt handling system, be sure to read the interrupts section of the datasheet.
Because the pulses come from an external source, there will typically be 2-3 stages of D flip flops to synchronize the input with the CPU clock. This is required to prevent issues with metastability, but does introduce a delay of a few clock cycles. As far as I know nobody has ever come up with a better way to protect against metastable failures, so you just have to compensate for the delay if it is important in your application.
Some timer/counter modules have an 8-bit counter, some are 16-bit. And some have a prescaler. So there could be several possible ways to implement the basic technique on your microcontroller, with different performance tradeoffs. You must consult the microcontroller's datasheet to determine the details.
Often timer/counter modules support other specialized activity, such as serial communications (baud rate) or watchdog timer. If your firmware is already using timer/counter modules, be sure to account for this as these are a limited on-chip resource.
It's also possible to use external counters, but adding more ICs somewhat defeats the purpose of using a microcontroller.
Microchip PIC16F877A datasheet is here -- by the way, PIC16F877A is NRND (Not Recommended for New Designs), and Microchip is recommending PIC16F887 as replacement.
Answer: Use a timer and configure it to clock on the timer input pin. You have 3 timers, Timer0, Timer1, and Timer2. Timer1 is 16 bit and all are both timer/counters with prescalers.
From page 23 of 234 from the datasheet, you can set T0CS (bit 5 of the Option_Reg register) to 1, which transitions on the RA4/T0CKI pin. Bit 4, T0SE selects the edge the transition will occur on, bit 3 "PSA" assigns the prescaler to either the watch dog timer or Timer0 module. Select the prescale values with PS2:PS0, bits 2-0 of this register, the table defines what the frequency will be divided by.
Pin RA4 is multiplexed with Timer0, also all PORTA pins are muxed with analog inputs (so don't forget to disable the ADC peripheral.)
The timer will generate an interrupt when it overflows, so you will have a timer interrupt routine, and clear the bit.
You will generally need to do the following: 1) understand how to configure the timer with the settings you want 2) write a routine to do that 3) create an interrupt routine.
Starting on Page 54 of the datasheet will give you an idea of how to configure the timer for the settings you want, namely writing certain values to certain registers (so you will have to know how to write values to a register.) The interrupt routine will have an interrupt vector, you can also find a list of interrupt vectors buried very deep in the compiler folder that comes with MPlab 8, search for it on your computer (it installs there by default.) In general the interrupt for this device should be as follows:
void interrupt Timer0_ISR(void)
{
     //do some code here
     T0IF=0;//clear the interrupt flag
}
What I highly recommend is reading the Timer documents provided by Microchip; documents DS51682A and DS51702A which can be found on the Microchip website and you should be set after going through these, they aren't very long but you will understand how they work.


Angular Material v17: Missing "legacy" from "MatFormFieldAppearance"

Question: In Angular Material v14, MatFormFieldAppearance provided the values legacy, standard, fill, and outline.
type MatFormFieldAppearance = 'legacy' | 'standard' | 'fill' | 'outline';

However, in Angular Material v17, it is only providing fill and outline.
type MatFormFieldAppearance = 'fill' | 'outline';

I am missing legacy and do not understand why they have removed it. So how can I make my input field look like this?
Answer: Use this CSS:
.mdc-text-field--filled, .mat-mdc-text-field-wrapper:hover, .mat-mdc-form-field-focus-overlay {
  background-color: transparent !important
}

I am pretty sure there is an official way to handle this issue. So although it is a hack, it may fix this issue temporarily.


Jenkins: Access bitbucket payload in shell

Question: According to the documentation of the bitbucket plugin for Jenkins (https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin) it should be possible to access the payload infos through the environment varaible $BITBUCKET_PAYLOAD.
However when in my build I run the command printenv, there is no environment variable called $BITBUCKET_PAYLOAD, and nothing related to it.
So it's impossible for me to access informations I need to configure my build.
Answer: You can trigger Jenkins with Generic Webhook Trigger instead.
Then you can create a variable everything having the JSONPath $. Then everything will resolve to the entire JSON payload. So you can have a shell script build step like:
echo $everything


which classification model allows user to choose importance of data inputs?

Question: I am working on a match analytics project where I have to deal with the situation in which I am having some inputs like skills, experience, certifications etc. and my output is candidate selected Yes or No, my problem is, Is there any algorithm which will allow users to give weightage to one Input than the others? For example skills matters more for someone whereas for other user experience matters . I have tried neural network and Naive bayes algorithm but unable to choose importance of variable . Any help will be highly appreciable.
Answer: The answer is that  you don't need to . Say you decide to go with some classification model, for instance a simple decision tree, the model in question will implicitly learn which are the importances (or weights) of the features of your training data, and will use these features as main nodes of the tree.
To better understand this idea, lets take as an example the ID3 algorithm, which is one of the several existing algorithms to generate decision trees from a dataset. This algorithm will build a tree by iteratively setting as decision nodes those features that maximise the information gain at each step, or in other words, those that are the best predictors.
So it will implicitly be giving more importance to the attributes that are better predictors, hence there is no need to assign weights to the features of the dataset.
So my suggestion is that you try using some classifier from scikit-learn such as RandomForestClassifier for instance.
Comment: Can you suggest then any alternative algorithm or simple mathematical function I should use
Comment: Yes updated with an example. Have a look at the classifiers in scikit learn
Answer: You should avoid competing with any algorithm for feature importance but for now let us see the other side of the coin. Here I am thinking for the user. Maybe it is a good idea to give the user the power to select people base on certain criteria so giving weights for certain features make sense.
Rpart has this option (the parameter cost which ranges from 0 to 1).
It might also be good idea if users can ignore other variables so you will make a model for each subsets of all features.
Answer: Since you mention the neural networks ...
Input weights in neural networks
Giving more weight to some inputs in a neural network could be easily done by multiplying the input with some weights you predefine.
Example in TF: (assuming inputs are arrays of numbers of size 3):
<code>input = tf.placeholder(tf.float32, shape=(1, 3))
weights = tf.constant([2, 1, 3], dtype=tf.float32) # weights for input
weighted_input = tf.multiply(input, weights)
... rest ot the network ...
</code>
But, as others already mentioned, you should be careful with playing with weighted inputs in machine learning algorithms, in this case neural network, since those things should be learned by the model.


why won't my shower regulate water temperature

Question: a couple days ago this started. no matter what position I turn the handle towards the left it's always very hot. and the same if I turn it to the right. very cold. I'm assuming there must be some sort of regulator. this doesn't happen with any other of my taps. nor does it happen when the bath is run.
Answer: Your shower mixing valve probably has an anti-scald feature with either pressure balancing or thermostatic control. These can get out of adjustment.


Optimal way to get a JList selectedvalue from another class

Question: I am making a database manager which shows you a JTable with all the table data. The ideas is to have in the left side a JList with the table names where you can select the table to visualize.
So i have a class where I manage all the table data and so, an another one for the JList.
The JList class extends from JPanel and I created a getInstance() method so I can just create one instance of JList. I also have a method called getSelectedValue() that is mainly called in the JTable class to display the selected table information.
But this way I am having problems, I debug and I get an error in the JList constructor, here os the code:
public class DatabaseJList extends JPanel {

private static DatabaseJList instance = null;
private static DefaultListModel listModel = new DefaultListModel();
private static JList list;

  public DatabaseJList() {
    setLayout(new BorderLayout());
    model = new DefaultListModel();

    list = new JList(model);
    JScrollPane pane = new JScrollPane(list);

    Vector<String> vector = new Vector(DatabaseTableManagers.getInstance().getTableNames());
    for( int i=0; i<vector.size() ; i ++ )
    {
        String string = vector.elementAt(i);

        model.addElement(string);

    }

    add(pane, BorderLayout.NORTH);

  }

public Object getSelectedObject() {
    return list.getSelectedValue();

}
public void setSelectedObject(String str)
{
    list.setSelectedValue(str, true);
}

public static DatabaseJList getInstance()
{
    if (instance == null)
    {
        instance =  new DatabaseJList();
    }
    return instance;

}

When the getInstance method is called for first time and it proceeds to make the "new DatabaseJList();" it goes to the constructor and stops, at less thats what I see with my poor debuging knowledge. Any ideas? Thanks everyone ;)
Comment: Off-topic: having a static method return a single instance, it's called a singleton pattern and in that, you make the constructor private(or protected) so the class itself cannot be instantiated normally.
Answer: Seems to work fine for me. Here's what I tried (some minor tweaks, nothing drastic)
public class DatabaseJList extends JPanel {

    private static DatabaseJList instance = null;
    private static DefaultListModel listModel = new DefaultListModel();
    private static JList list;

    public DatabaseJList() {
        setLayout(new BorderLayout());
        DefaultListModel model = new DefaultListModel();

        list = new JList(model);
        JScrollPane pane = new JScrollPane(list);

        Vector<String> vector = new Vector<String>();
        vector.add("test1");
        vector.add("test2");
        for (int i = 0; i < vector.size(); i++) {
            String string = vector.elementAt(i);

            model.addElement(string);

        }

        add(pane, BorderLayout.NORTH);
    }

    public Object getSelectedObject() {
        return list.getSelectedValue();

    }

    public void setSelectedObject(String str) {
        list.setSelectedValue(str, true);
    }

    public static DatabaseJList getInstance() {
        if (instance == null) {
            instance = new DatabaseJList();
        }
        return instance;

    }

    public static void main(String a[])
    {
        DatabaseJList list = DatabaseJList.getInstance();
        JFrame frame = new JFrame();
        frame.setSize(300,300);
        frame.getContentPane().add(list);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);

    }
}

Comment: remember to place Swing-related events on the `EDT`!


Red shift and time distortion

Question: Superman throws a light emitting object away from himself fast enough to notice a red-shift. The object passes through a region in which time runs more slowly. From Superman's perspective, does the red-shift change as the object slows or is the light's appearance unaffected?
Comment: Is there a common thought on this topic in the theoretical physics community?
Answer: The object doesn't slow in this case, it speeds up. The redshift is increased. The clock-slowing-down factor is more traditionally called the gravitational potential, and where clocks are slow, this is close to a massive object. In the extreme limit that the light-emitting-object is approaching a black hole, time stops relative to Superman, so that Superman sees the object infinitely redshifted.
Comment: Sorry to leave this hanging for ... *gulp* 3 years... I never received notification that this was answered! Weird. Oh well -- points for you.

Red shift and time distortion


Approval Process when a checkbox is changed

Question: I have a checkbox on account with active status. When someone edits the checkbox, an approval process starts and the manager needs to approve or reject. My issue is that this approval by the manager it could work both ways (if the checkbox is ticked=approved...if the checkbox is unticked=approved - for rejection as well), but in the approval process you can only specific for approval=tick checkbox and reject=untick checkbox).
I also have a process builder when someone changes the checkbox, the approval is sent to the manager.
Can someone help me with a suggestion on what I can do to solve both scenarios? Thanks
Comment: If I understood you correctly what you need is 2 different approval process first will be triggered when that checkbox is checked the other will be triggered when the checkbox is unchecked so you can manage you approval or rejection actions accordingly.
Answer: It sounds like you'll need two separate approval processes. One for approving or rejecting account marked as active, second for approving or rejecting account marked as inactive.
The corresponding approval action will be leaving the checkbox as is, and rejection action will be reversing it to checked or unchecked, according to which process we're in. Then, you can change your process builder to fire the right approval process depending on whether the checkbox was changed into true or into false.
Alternatively, you can use a hidden help text field or another checkbox field, that will indicate if the action taken was to activate the account or to deactivate it. Then you can use a single approval process the fires upon a change in the help field, and two different approval steps with approval/rejection actions, with a different entry criteria per the value in the help field.
Comment: Thank you, Eran, for your advice. I will give it a try to the two approval processes.


ML Method for temporal object mapping

Question: The scenario is like this:
I have 2 point clouds, representing the radar readings of a car at the moment t and t + 0.1 seconds. Each point is a solid point that you don't want to drive trough, it's probably part of a solid object like a road cone. Objects on the road are hence represented by little clouds of points.
The points have been grouped into clusters (using dbscan lets say) and had their convex hull computed, so now we have the polygons that represent each object the car sees.
The next part is tracking an object across multiple such readings taken at t, t+1, t+2, etc.
If there is a road cone let's say in front of the car at moment t, and the car drives towards it, then at moment t+1 the cone should be of similar shape/area but slightly closer to the car (the coordinates of the vertices of the polygon change). Not closer by a whole lot, just a bit closer.
We can algorithmically map the road cone at moment t to the one at moment t+1 by allowing some tolerances like "if its area is less than 10-15% different that the road cone at moment t and it is not farther than 3 meters from the road cone at moment t then it is probably the same road cone.".
However I am looking for a solution that involves some kind of ML algorithm. It would probably have to involve some kind of clever application.
The most I could come up with was classification, where every object from moment t represents a class, so we try to pair each object from t+1 to an object from t. But this has several design issues such as there needs to be at most 1 object classified in each class (so if a class receives more than 1 object, we need to be able to... send the 2nd object away to find a new class to fit into? I hope this makes sense) and there needs to be some way to have a class for objects that are newly detected and not close to any other object. So I think pure classification may not do the trick.
I am looking for a way to do this using ML. This would be a summer project for a student at my company, so the ideal solution would not require 2+ months of programmer time from an experienced programmer.
Answer: You could think of this as a distance learning task. You could train your model with triplet loss and the output of your model would be some vector in a latent space such that the same objects would be really close together regarding some standard distance measure, e.g. cosine similarity. See Wang, et al for an example that matches yours.
However, this approach might be prohibitive compute consuming for real-time applications in a car, depending on the hardware that would be available.
I supervised a student who did something similar from a different domain (cover song identification) for his bachelor thesis. If your intern has some experience with neural networks this could be done as a summer project. Exploring 3D data and getting the data right to feed it into the network can be time consuming. I think it would be crucial to provide the student with tools to visually explore the data and the data in such a format that the data wrangling does not take too much time (e.g. grouping and labelling the objects already done).

ML Method for temporal object mapping


HTML5 Chrome supported popup Dialog box?

Question: I'm wondering is there anyway of creating a dialog box for a Chrome extension using HTML5 or otherwise? basically I'd love to have a dialog box that looks more elegant than just creating a new window. Is there anything available to do so I'm attempting to create a popup effect.
Answer: Challenge / Issue:
1) Chrome was not supporting windows popup
Reason:
Google Chrome no longer supports window.showModalDialog, breaking several enterprise apps such as OWA, EAC, SAP, and others.
Why:
1) Google decided to deprecate window.showModalDialog in Chrome 35 due to its related code complexity
 2) Google believe that showModalDialog is a "bad API" that, according to their measurements, is not used extensively
Immediate Solution:
The immediate solution is to switch to IE or Firefox. For those willing to stay on Chrome, one way to temporary solve this problem
 is to enable this deprecated feature in Enterprise Policy settings, which can be done only until April 30, 2015
 (http://www.bugdebugzone.com/2014/08/sitecore-modal-pop-ups-are-not-working.html)
Another approach:
Another partial solution is using a ShowModalDialog polyfill as explained in this post, but some of the functionality
 is still not restored.
Approach our team adapted:
 Work with Window.Open method and tweak the javascript code to adapt this method to refresh the parent window and pass values to and from.
Answer: I think the best way to do this would be to inject a <div> into the page and position / style it using CSS. It is possible to include other JavaScript libraries with your plugin, so, you could look into using jQuery UI's Dialog.


What's the fastest way to sync a node only keeping full state for the last N blocks?

Question: I need to only keep state for the last few blocks, but I don't want to wait for the full sync of the node, is there a way to do that faster than by using --sync=full? Because it seems like all the current modes either download the full history or just the latest state.
Answer: Check this guide from the Polkadot Wiki: Set up a Full Node. Running as a simple sync node, only the state of the past 256 blocks will be kept, if you want all the history run as an Archive Node.
If you want a faster sync you can use the flag --sync warp
--sync <SYNC_MODE>
    Blockchain syncing mode.

    - `full`: Download and validate full blockchain history.
    - `fast`: Download blocks and the latest state only.
    - `fast-unsafe`: Same as `fast`, but skip downloading state proofs.
    - `warp`: Download the latest state and proof.

More information about why is faster: Is GRANDPA warp sync the recommended method for syncing a node? and in the Polkadot Protocol Specification.


Frequency limitation for homebrew CPUs

Question: While looking into some custom built CPUs I've noticed the frequencies at which they operate are relatively low compared to modern CPUs (in the order of several MHz). Is there an electronics engineering reason for that limitation, e.g. for breadboards?
If yes, how to determine the max frequency that is possible to achieve with your design?
Comment: @Nate, I imagine that he's referring to homebrew multi-chip CPUs built from TTL.  For example:  http://www.homebrewcpu.com/
Comment: Like...home made VLSI chips? I'd imagine it's a cost limitation. The precision that multi-million dollar equipment affords just can't be duplicated at home and as a result the chips must run slower.
Comment: @Nate i've updated my question to be more specific.
Comment: @AlfredCentauri - yes, you are right ;)
Answer: It mostly has to do with the lengths of interconnections and propagation delays through the gates. If we reduce a CPU to its essence, it is a feedback machine. A bunch of combinatorial logic circuits compute some boolean functions over the current state of the machine, and those functions determine the new state, which is latched in by sequential circuitry when a new clock edge arrives. The combinatorial circuits all have delays. The clock period cannot be shorter than the time it takes for the slowest path through these gates to produce a stable result because a single incorrect bit stops the show.
Furthermore, the sequential logic has timing requirements. Before the clock edge arrives, there is some minimum setup time that the inputs have to be stable and then afterward they have to be stable for some hold time. If these are violated, the state becomes garbage.
The propagation delays are caused by things like how fast parasitic capacitances can charge, how fast current can build in the face of an inductance and how fast silicon devices can switch. For example, a bipolar transistor with a smaller base can switch faster than one with a larger base, so a tiny transistor on a chip will be faster than a discrete one.
In an earlier answer that I deleted, I wrote about transmission line effects. But I didn't consider that these effects don't even come into the picture at the speeds we are talking about  because, say, at 10 Mhz, the wavelength is still about 30 meters. So on the scale of an ordinary sized circuit board, pulses on the time scale of a few megahertz still reach all parts of a copper network simultaneously.
So, if you make a CPU out of discrete components, you're simply not achieving the small components with fast switching times, and the same proximity which minimizes stray capacitances and inductances.
Nevertheless, ancient discrete-component machines in the 1960's did run quite a bit faster than these homebrew machines. It took some time and cunning to get there. For instance the IBM 360 Model 44 (1964) ran at 4 Mhz. That may still be "homebrew speed", but the CDC 7600 released just a few years later in 1969 surpassed 36 Mhz. The Wikipedia article http://en.wikipedia.org/wiki/CDC_7600 gives a hint at some of the tricks that were pulled, for instance:
"As always, Cray's design also focussed on packaging to reduce size, shorten signal paths, and thereby increase operating frequency. ... [E]ach circuit module actually consisted of up to six PC boards, each one stuffed with subminiature resistors, diodes, and transistors. The six boards were stacked up and then interconnected along their edges, making for a very compact, but basically unrepairable module."
So the homebrew CPU's are not necessarily built to their true potential due to some confounding effects having to do with the build quality and layout. Still, anyone who builds a CPU out of individual integrated circuits and discrete components which runs at several megahertz should be applauded.
Comment: A lot of homebrew CPUs use EPROMs to store microcode, but also to implement complex logic and/or truth tables (many of them even have an ALU made out of one or more ROMs). The access speed of the ROMs can limit the top speed of the machine significantly, but they're popular because they make it easy to debug, repurpose and tweak the processor without significant rewiring.
Comment: Depending upon the complexity of the data path, I would think that a homebrew device should be able to clock in at 20Mhz or more without difficulty using modern technology and conventional techniques.  Not multi-GHz, but not a total slouch.  I suspect, though, that it most cases where homebrew CPUs are used, ease of troubleshooting is more important than speed.  Incidentally, the master clock crystal of the original Pong(R) brand arcade machine was 14.3818Mhz, though it was divided down pretty early on; I think the only thing gated by something that speed is the center-line of the playfield.
Comment: @Alexios: Not that it invalidates your point, but I recommend to most folks to switch to NAND or NOR flash from EEPROMs for these. Yes, they are harder to write to in situ, but in exchange the access time can be halved. An AT28C256 is a popular breadboarding EEPROM, but has a 150ns access time and costs about $9 on mouser. OTOH, an all-but-pin compatible NOR flash 8x larger costs half that, is 2x faster (70ns), can be rewritten more times, lasts 10x longer, and can use the same programmer. Even cheaper EEPLDs can get you 30x faster (4-5ns) but require you to use somewhat esoteric software.
Comment: @EdwardKMETT You're right, of course. It's been a long time, but I must have been using 'EPROM' in a very liberal sense there. My own design uses 70ns NOR Flash ICs (and already did when I wrote that comment 7 years ago) with a 250ns processor cycle.
Answer: As a former high schooler who built a special-purpose computer with 7400 series TTL, which won some kinda award at the science fair, I observed these things that kept it from running as fast as possible:

Stray capacitance in the breadboard.  A few pF between every adjacent pair of connectors. That limited pulse edge rise/fall times and in places added crosstalk.  This was probably the biggest factor.
Variations of grab-bag chips. (Anyone remember Poly-Paks?)  74LSxx, 74Hxx, 74xx with different propagation delays and other characteristics, made it impossible to have signals stay in sync at higher clock speeds than a few MHz.
Cheapo static memory chips, again from a grab-bag or other no-quality source. They just couldn't read or write reliably beyond a certain rate.
My test instrumentation was limited to homebrew signal generators, a 5MHz bandwidth oscilloscope, and temporary jury-rigged digital circuitry.  Hard to check signal integrity, timing, amplitudes of digital signals that have been low-pass filtered into wobbly mush.

Today, it would be hard to find a 5MHz scope unless one is an antique buyer.  Better chips of all kinds are just as easy to get, even in 0.1" spaced DIP packages, except I haven't seen much in the way of grab-bags in a long time.  Socket breadboards, however, haven't changed much.  Stray capacitance is still a speed killer for any edgy creative digital projects.
Avoiding breadboards by using a homebrew PCB is the best way to avoid stray capacitance, but of course requires more effort and time.
Answer: I'd think the primary reason is that as you increase frequency, the impedance of your breadboard's connections will increase and limit the final speed of your circuit.
Every connection in your breadboard has a low, but non-zero inductance. As your frequency gets higher and higher, you need to take these effects into account. The impedance of the wires can be found by:

where L is the inductance of the wire. Eventually, Z will become high enough that not current will flow and your circuit will stop working. Finding the exact numerical value for this number will be very complicated, especially because breadboards have traces next to each other and that will change each wire's impedance a bit from this formula. If you really want an (imprecise) number, you can try here to calculate the inductance (and therefore impedance) of your wires. If you know the lowest current that a part can operate from, you can determine the maximum frequency before you hit that limit.
Comment: @DarenW: Stray inductance and capacitance are indeed the problems.  In a radio system, you typically have only one wire of non-trivial length.  In a processor implementation, you have hundreds, with mutual inductance depending on the spacing.  The frequency-dependent interactions are unmanageable due to the complexity.  Characteristic impedance depends strongly on things like distance from ground traces... which aren't well controlled on a breadboard.
Comment: I think you're right, I guess it should probably just be reactances in general. Capacitance will result in similar issues, but for things like hard rising/falling edges and state changes. The equations for finding the impedance is similar though, and if he wants a numerical answer those could probably be applied in a similar fashion.
Comment: Could you explain the relationship between the impendance and speed of the circuit?
Comment: So how does this explain that CPUs like Intel Core I7 work at clock speeds of 2.5GHz and CPUs build on breadboards cannot achieve this speed? I thought initially that there is a connection with the length of the wire between the CPU and RAM chips.
Comment: Not to deny the laws of physics, but I don't think that inductance is really the main limiter of speed. After, similar wires of similar ranges of lengths are used in homebrew radios and other projects, at much higher frequencies.  One just has to be careful about matching impedances, lengths, layouts, avoid accidental couplings, etc.
Answer: Others have answered the "why". Here's how to determine the maximum speed.

For each flip-flop, look up it's clock to Q.
Total the wire length of all the wires from the flip-flop to the next flip flop. Turn this length to time. Wire is ~2/3 speed of light
Total any gate delays, including through asynchronous RAM.
Take the setup time at the next flip-flop.
Add 1-4. This is you minimum clock period. Invert to get frequency.
Consider clock skew. If the clock gets to the second ff before the first, add skew in with 1-4.
If the clock gets to the second ff before the first, calculate the minimum of 1-3. Make sure that they are less than the hold time required by the second ff plus the clock skew.
Comment: @Eugen - I think (but not my area of expertise) he's referring to its internal propagation delay - time from being clocked to having a stable output.
Comment: Which wire length you are talking about: the length from the power source to CPU out pins, CPU out pins to RAM chips ... ? Also I am not really clear what you mean in the first step.
Comment: I would say he means the length of the wires/traces in the longest part of the critical path. Your worst case would involve the memory. You can offset some of that with a multi-phase clock.

You wouldn't need to count the Vcc lines since you should have decoupling capacitors on them.
Answer: For homebrew machines, it comes down to two factors. The propagation delay for the chips you are using and the number of chips you need to use on the longest path through your CPU design.
For example, a 74HC574 (8-bit register) has a maximum propagation delay of about 41ns (taken from its datasheet). Now let's say the longest path through your CPU design requires it to pass through 8 different chips. Add up the propagation delays for each of the 8 and let's imagine it comes to 333ns. With 1000ns being the same as 1Mhz that would give you a maximum speed of 3Mhz.
In practice, you might want to restrict yourself to something slower like 2Mhz, in order to ensure a stable design. Even if you think you will only miss the timing once per billion cycles, then you're still in trouble. 10 billion divided by 3 million means you miss-execute once every 3,333 seconds, which is about once per hour. Crashing your machine every hour is not good!
To make it go faster you can use faster chips and/or change the design to reduce the number of chips in the slowest path. About the fastest homebrew speed you see is around 4Mhz which gives you 250ns to complete each cycle.
Comment: Drass over at 6502.org is making a 100 Mhz replica of the 6502 using the fastest CMOS chips from the 74xx series. He ended up having to make a high-speed adder for the ALU out of many discrete chips, things like XOR gates, AND gates, and transparent latches. It can do around 6.7 ns which should leave barely enough headroom for 10 ns instructions.

In the past, there were commercially available computers made of discrete chips and a few of those were in the 12-20 Mhz range. The stock Gigatron TTL computer can do 6.25 Mhz, and some have overclocked theirs to 12.5 Mhz & faster (maybe up to 15.
Answer: Apart from all the electrical reasons that limit the speed, there is also one on the logical level:
You cannot throw as many resources at making things run faster, such as pipelined operation with branch prediction, faster arithmetic and whatnot. Caches don't make much sense either if they aren't faster than your main memory.
Comment: I'm not disputing this by saying you can do much of that in a homebrew design. You can pipeline things and create a skip-carry adder. For an 8-bit design, you can use 3 nibble adders and a multiplexer, and that can get you up to 20 MHz.

If you want to go toward 100 MHz, you'd need to move to 3.3V or lower in SMD packages. However, many of the parts you need don't exist in the smaller packages. So you'd need to make your own adders and incrementors out of transparent latches.

Plus you'd need to pay attention to the board layout, parasitic capacitance, ground planes, etc.
Comment: As for caches, even a cache at the same speed as your main memory can be helpful, at least for reads, if you have a mechanism where they write in tandem but are read from individually.

However, you can find Sync. QDR SRAM that has a latency of 300 ps. It is expensive, but that is close to what CPUs use as a cache as that can support up to 3 GHz.

Frequency limitation for homebrew CPUs


16' Tall Load Bearing Wall

Question: I am planning to build a 12'x12' cabin. I cannot go bigger than 12x12, but there are no height restrictions so I'd like to incorporate a loft. I'm thinking front wall at 16' tall and rear wall at 12' feet tall with shed roof. Loft floor will be 12'x10' and tie into side(non roof load) walls at ~8', leaving a 2' gap between the loft floor and front 16' wall. Question is, can I frame these tall(12' & 16') load bearing walls with 2x4's? I will use blocking, and exterior sheathing will be glued and nailed. Thoughts?
Answer: Yes. This is called balloon framing: https://en.wikipedia.org/wiki/Framing_(construction)#Balloon_framing
The catch in 2015 is that it might not be all that easy to find 16' 2x4s that are all that straight.
I'd personally go with 2x6's in this case for added rigidity, load bearing abilities, increased insulation space (important on that high wall) and just plain easier to deal with in terms of getting straighter walls.
Unsolicited suggestions:

have you considered leaving the gap along the side wall? That will allow you the maximum head space up in the loft area towards the front (tall) wall.
I'd consider going with a 3' gap rather than 2' just to make it that much easier to get stuff up into the loft (namely furniture).
Comment: Thanks for the response. I'm aware of balloon framing, but just wasn't sure of the integrity of an unsupported 16' tall wall. Some things have changed and I will be going with 2x6 as suggested, and leaving a 3' gap too. We got a variance that is going to allow a slightly larger footprint, so I've got some wiggle room now. Thanks again for your response.

16' Tall Load Bearing Wall


How does Vax from Critical Role get three attacks per round?

Question: I am getting ready to play D&D for the first time and really excited! I have been watching Critical Role to learn a little more. I am going to be playing a rogue and on Critical Role Vax often attacks with 3 daggers. When you're duel wielding do both attacks count as one then using a bonus action to get to third? It has been confusing me.
Comment: This isn't really an answer but as an avid watcher of critical-role myself, Matt Mercer, their DM, has numerous houserules that let his players do stuff so that they can maximimze their fun. Case in point, Trinket the bear is not a legal ranger companion, a Bard should not be able to inspire himself, oh, and... Gunslinger. He's the kind of DM who vetoes all the rules to favor the Rule of Cool/Fun.
Comment: @daze413 He is living up to the spirit of the game, whether or not he adheres to the letter of any and all rules.  I consider that laudable.
Comment: I will say that gunslinger rules are now part of the d&d online.
Answer: You're rightly confused — you don't normally get three attacks per round like that. By itself, fighting with two weapons gives you at most two attacks — one from the normal Attack Action and one from a Bonus Action with the off-hand weapon.
Vax therefore has something else going on that is allowing that third attack. From the Critical Role Wiki's FAQ:

How does Vax get 3 attacks per round?
He dual wields daggers for 2 attacks and has a custom magic item brought over from Pathfinder called boots of haste which function like the spell.

So Vax is making the first two attacks according to the normal rules for Two-Weapon Fighting (on page 195 of the PHB), and then making a third via the extra Action granted by D&D 5e's version of the spell haste (p. 250).
Comment: In a recent episode where Liam actually DMs, Travis asks him if he can attack three times "like the famous rogue, Vax: Dagger dagger dagger.", Liam replies that Travis would need the Boots of Haste, and the Dual Wielder feat. This still needs to be confirmed, however, as you really don't need Dual Wielder to two-weapon fight with daggers, and it might just be a houserule Matt uses to allow the triple dagger throw.
Comment: @anaximander That's not what Dual Wielder, the feat, does. You are thinking about Two-Weapon Fighting, the feature.
Comment: Th Dual Wielder feat is required to make the triple-attack so effective, though: without it, the bonus-action attack made with the offhand weapon doesn't add your Strength or dex bonus to the attack roll.
Comment: @daze413 Indeed I am. I get those two mixed up all the time.
Comment: I would be very curious to see how often he spent the bonus action on something else before Dagger Dagger Daggering out of habit and Matt didn't notice.  I don't recall a time he just Dagger Daggered without the Boots of Haste explicitly not being active.


How to import Facebook friends to website

Question: I've got a website that has users and users can add each other as friends. Lately, I've been seeing a lot of web apps that have a function where you can import your friends from Facebook directly into their web app. How is this type of import of the Facebook friend list implemented?
I looked in the Facebook API docs, and can't really find anything directly on point to this.
Presumably I would use the Facebook API to pull a list of the user's friends. From there, how would I then find users on my site that are members of that list? Does this type of scheme only work with other users that have already used the Facebook friend search themselves, so that you can tie a Facebook account to them?
There really doesn't seem to be much out there on this topic, even though I've seen a lot of sites doing it, so any help, no matter how basic, would be much appreciated.
Comment: You can do this only if you store fb user ids of your users (i.e. users on your site can link their accounts to facebook profiles and you store this information).
Comment: What about using some piece of identifying information that Facebook provides like the email? Is there a way to match a user's information on my site to their information on Facebook?
Answer: The basics of what you'll need for this center around registering your site as "a Facebook application" and making use of the Graph API.
Take a look at the "Login with Facebook" section of this page.  Basically, when you register your "application" you will have an application ID and an "application secret" (which is just a string of characters, and must never be made public or anybody with it could spoof as your application).  The example on the page shows a small amount of JavaScript to initialize the application from your website, at which point you're good to go for Facebook integration.
Just below that is an example of the "Login with Facebook" button, which is what your users would use to indicate that they wish to allow your site to access some of their Facebook data (the Friends list, for example).  You can highly customize the specific permissions your site requests from the user within that login tag, and your users would be presented with a prompt like this one specifically asking for permission to allow your site to access their Facebook data.
Looking back at this page again (though it may be on other pages as well, the Facebook documentation changes a lot), scrolling down a little further you find a simple example (in PHP) for very basic Facebook integration.  The example page presents the user with a "Login with Facebook" button and reloads itself after the button is clicked (by subscribing to the correct Facebook API event in JavaScript).  Upon reload, the user now has an encrypted cookie (assuming the user agreed to the permissions request) which the example page can read.
The "application secret" is used to decrypt the cookie, which contains the user's Facebook ID and the access token which authorizes your site to make requests for that user's Facebook information.  Using the access token in Graph API requests will grant you permission to receive the data from those requests.
Graph API requests are just GET requests which return JSON data, so once you have the access token (and the user ID as a starting point) you can make such requests anywhere you want.  They can be made client-side in JavaScript (along with using Social Plugins and other Facebook widgets) to "Facebookify" your users' experience on your site without exposing much, if any, data or responsibility to your site.  Or the requests can be made from your server-side code on the back end for the purpose of storing requested data and using it as your site sees fit (such as the Friends list).
An API request to get a list of Friends would be something like this:
https://graph.facebook.com/me/friends?access_token=your_access_token
(However, you'd replace the me in the path with the Facebook ID of the user whose Friends you wish to retrieve, and replace your_access_token with the actual access token.  Example links for your own account, assuming you're signed in to Facebook, can be found on this page.)
The Graph API (as the name suggests) extends outward across the social graph of Facebook data.  Any JSON object which comes back with an id can be requested in its own API request to see more of its information.  Any piece of information you want, such as the email addresses of the user's Friends, will be available if and (hopefully) only if the permissions of both the user and the user's Friend in question allows this.  (Sorry, but if the user's Friends have specifically said that their Friends can't grant access to this information, then it's not available.)
So, once your users grant your site the requested permissions to view their Facebook data, you can harvest whatever data you want (and are allowed to access) that's available in the Graph API.  (I hate using the word "harvest" there, but you get the idea.  Act responsibly, of course.)  So your process, from the perspective of the user in any given instance, would be:

Ask the user to Login with Facebook, requesting specific permissions.
Receive those permissions from the user (otherwise the process ends here).
Make back-end Graph API requests from your server code to get the relevant information from the user's Facebook social graph.
Present the user with options that you could make sense of (such as matching email addresses or even names with users you already have), be it users you already have (hey, this Friend of yours is on our site, would you like to say hello?) or invites to your site (we don't have a record of your Friend visiting our site, click here to invite them!), etc.
The user then continues to interact with whatever functionality your site is presenting in this matter.

Make sense?  As I mentioned, the documentation for all of this on Facebook changes a lot (I found several dead links within their own site while writing this).  Their programmatic interfaces change fairly often as well.  They may develop easier ways to do this, but once you get set up and going and abstract out the Graph API calls and all that, it becomes pretty straightforward to integrate your site(s) with Facebook.
Answer: You are able to get the friend's list of members who login into your website using Facebook Login. HOWEVER, only friends who are also registered on your website will be shown. (In Facebook term, only friends who are also using the same app)
From facebooks developer's page you are able to get the following codes.
Login.php
$fb = new Facebook\Facebook([
  'app_id' => '{app-id}', // Replace {app-id} with your app id
  'app_secret' => '{app-secret}',
  'default_graph_version' => 'v2.2',
  ]);

$helper = $fb->getRedirectLoginHelper();

$permissions = ['email','user_friends']; // Optional permissions (THIS IS WHERE YOU GET THE PERMISSION FOR FRIEND'S LIST)
$loginUrl = $helper->getLoginUrl('https://example.com/fb-callback.php', $permissions);

echo 'Log in with Facebook!';

Fb-callback.php
$fb = new Facebook\Facebook([
  'app_id' => '{app-id}', // Replace {app-id} with your app id
  'app_secret' => '{app-secret}',
  'default_graph_version' => 'v2.2',
  ]);

$helper = $fb->getRedirectLoginHelper();

try {
  $accessToken = $helper->getAccessToken();
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  // When Graph returns an error
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  // When validation fails or other local issues
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}

if (! isset($accessToken)) {
  if ($helper->getError()) {
    header('HTTP/1.0 401 Unauthorized');
    echo "Error: " . $helper->getError() . "\n";
    echo "Error Code: " . $helper->getErrorCode() . "\n";
    echo "Error Reason: " . $helper->getErrorReason() . "\n";
    echo "Error Description: " . $helper->getErrorDescription() . "\n";
  } else {
    header('HTTP/1.0 400 Bad Request');
    echo 'Bad request';
  }
  exit;
}

// Logged in
echo '
Access Token
';
var_dump($accessToken->getValue());

// The OAuth 2.0 client handler helps us manage access tokens
$oAuth2Client = $fb->getOAuth2Client();

// Get the access token metadata from /debug_token
$tokenMetadata = $oAuth2Client->debugToken($accessToken);
echo '
Metadata
';
var_dump($tokenMetadata);

// Validation (these will throw FacebookSDKException's when they fail)
$tokenMetadata->validateAppId({app-id}); // Replace {app-id} with your app id
// If you know the user ID this access token belongs to, you can validate it here
//$tokenMetadata->validateUserId('123');
$tokenMetadata->validateExpiration();

if (! $accessToken->isLongLived()) {
  // Exchanges a short-lived access token for a long-lived one
  try {
    $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
  } catch (Facebook\Exceptions\FacebookSDKException $e) {
    echo "
Error getting long-lived access token: " . $helper->getMessage() . "
\n\n";
    exit;
  }

  echo '
Long-lived
';
  var_dump($accessToken->getValue());
}

$_SESSION['fb_access_token'] = (string) $accessToken;

// User is logged in with a long-lived access token.
// You can redirect them to a members-only page.
//header('Location: https://example.com/members.php');

At login.php you can see the following line
$permissions = ['email','user_friends'];

This will prompt user for permission to access the friends who are also using the app.
This code will get the friend list from graph
 try {
            // Returns a `Facebook\FacebookResponse` object
            $response = $this->fb->get('/me?fields=id,name,email,gender,user_friends,', $this->token);
        } catch(Facebook\Exceptions\FacebookResponseException $e) {
            echo 'Graph returned an error: ' . $e->getMessage();
            exit;
        } catch(Facebook\Exceptions\FacebookSDKException $e) {
            echo 'Facebook SDK returned an error: ' . $e->getMessage();
            exit;
        }

The codes are all sample and are for reference only so you get the idea of what's happening in the backend. I highly recommend you take a look at https://developers.facebook.com/docs/php/howto/example_facebook_login
Should you have further questions with regards to the flow you can then create new question to get your answers.
Update: Handling user_friends <- this is what you are looking for
Upon login using Facebook on to your website, the logged-in member will be given a permanent unique id to your website.
When you request for the user_friends graph of that member, Facebook Graph will return a list of user objects for friends who are using this app as well. And those objects includes the user id (which is unique to each app), from the ID you will be able to link up friends who know each other within your app.
https://developers.facebook.com/docs/graph-api/reference/user/

Example User A (ID: 1234) and User B(ID: 5678)
1) User A login to your website using Facebook.
2) You try to request user_friends from Facebook of User A but it
  returns nothing.
3) User B register and login to your website using Facebook.
4) You try to request user_friends of User B and Facebook graphs
  returns user A's ID 1234.

From there you are able to understand 5679 and 1234 are friends and you are able to design your database around that to associate your members as friends.


Exporting Data from Evernote

Question: I am trying to export data from Evernote for a fixed asset report. How can I do that? We currently have all of our equipment in evernote folders and I need to get it into some kind of usable form, e.g. a spreadsheet.
Answer: Using the Evernote Windows client you can export notes via File -> Export
You can also right click on the Folder or individual Note and select the Export option.
For additional information https://help.evernote.com/hc/en-us/articles/209005557-How-to-back-up-export-and-restore-import-notes-and-notebooks

Exporting Data from Evernote


How does an arcane focus work with an Eldritch Knight?

Question: My PC is an Eldritch Knight. I was wondering what is an Arcane Focus? Do I need to have it in my hand? If I get the War Caster Feat does my arcane focus become obsolete?
Answer: As an Eldritch Knight, you cannot use an arcane focus. The description for the arcane focus includes this clause:

A
  sorcerer, warlock, or wizard can use such an item as a
  spellcasting focus, as described in chapter 10.

If that wasn't enough, the descriptions for a sorcerer's, warlock's, or wizard's spellcasting all include a matching clause allowing them to use an arcane focus:

You can use an arcane focus (found in chapter 5) as a
  spellcasting focus for your sorcerer spells.

So if you want to cast a spell that has a material component, you will have to use a component pouch, not an arcane focus. As for War Caster:

You can perform the somatic components of spells
  even when you have weapons or a shield in one or
  both hands.

This means that you can perform somatic components with your hands full. However, this does not affect your use of material components in any way. Unfortunately for you:

A spellcaster must have a hand free to access these
  components, but it can be the same hand that he or she
  uses to perform somatic components.

So if you want to cast a spell that has a material component, not only will you need to use a component pouch, you will also have to have an empty hand to do it with.
Comment: Might be helpful to mention, that a *component pouch* would work and is mechanically equivalent to an arcane focus.
Comment: Can you be more explicit about why you interpret the rules such that "the hand used to perform somatic components" cannot be used to "access these components" for a War Caster.  I can see the reading, but your answer would be better if you make it explicit.
Answer: War caster only allows you to use perform the somatic (S) part of your spell.  You still need an arcane focus, a component pouch, or the actual material, if the spell has (M) in its description. So you still need one hand either free, or holding the focus to cast a spell, so you can't do it while, e.g. welding a 2 handed great wl sword. Eldritch Knights are fighters and, as such, can't use an arcane focus (it's not one of the classes that is listed as able to use it). They have to use a component pouch. This is deliberate.
In Xanathar's Guide to Everything, there's a common item called Ruby of the War Mage that allows any weapon to be used as an arcane focus.  That gets around the problem somewhat, but it does use an attunement slot.


how to polynomially check if a given boolean formula is unsatisfiable

Question: Since SAT is np-complete, there is a polynomial algorithm to check if a given solution for any particular formula is correct. Just substitute the values and solve. But what if one claims that the given formula is unsatisfiable, is there a polynomial way to check if the claim is true... Am i missing something ?
Answer: NP only requires you to have a polynomial size proof for "yes" instances.
co-NP is the class of problems that requires polynomial size proofs for "no" instances.
SAT is in NP, but is not known to be in co-NP. Whether NP = co-NP is an open problem (and proving that SAT is in co-NP would resolve this problem in the affirmative).
So to answer the question in your title, how to polynomially check if a given boolean formula is unsatisfiable: no one knows whether that could be done in general.
Comment: " no one knows whether that could be done in general. " you mean in polynomial time right ?
Comment: Also,  " NP only requires you to have a polynomial size proof for "yes" instances. " , i think that's exactly what i was looking for, can you give some link to any website or maybe any book where it mentions, I want some sort of formal proof, cuz i looked the definition for np problems, and no website i checked states in this form - NP only requires you to have a polynomial size proof for "yes" instances.......                       so i desperately want some sort of authentic source where it mentions it in  this way, if you don't mind
Comment: @AlexMatyasaur Yes, in polynomial time + size for the certificate. Regarding an authoritative source, any book on complexity should have this in the definition of NP. You could also read the formal definition on [Wikipedia](https://en.wikipedia.org/wiki/NP_(complexity)#Formal_definition) precisely: note how the requirements are different for the "yes" instances ("For all x in L") and for the "no" instances ("For all x not in L"). For the "no" instances it only requires that it doesn't give *false positive* proofs, not that it proves the instance is in fact a "no" instance.
Comment: Also, "I want some sort of formal proof" - this is not possible. This is part of the *definition* of NP, not some proven property.
Comment: by formal proof i meant some source obviously; thanks for the wikipedia subsection link... i was confused if definition of np includes polynomial certificates for no-instances as well.....
Answer: We don't know for sure, but most people expect the answer is "no".  In particular, assuming NP != co-NP (as is a commonly held conjecture), the answer is "no".
Checking that a formula is satisfiable (and exhibiting a proof that it is) is a NP-complete problem.  Checking that a formula is unsatisfiable (and exhibiting a proof that it is not satisfiable) is a co-NP-complete problem.
Comment: unsatisfiability , imo, is fundamentally different than SAT. A formula is satisfiable by only a finite number of solutions, a single instance is enough to **prove** the formula is satisfiable, on the other hand, if a formula is unsatisfiable, we can never know just be checking for each solution cuz they will be infinite,  i don't think we can ever know if a formula is unsatisfiable  *polynomially*.......


Can a Jedi mind trick work on another Jedi?

Question: Basically what the title says.  Is it possible for a Jedi to control another Jedi with a Jedi mind trick?  Or is that not possible?  Has this ever happened?
Comment: My personal impression is that the Jedi mind trick only works on characters without names in the script. It works on "Storm Trooper 2" or on "Drug Dealer", but not on "Watto".
Comment: It is possible. Obi-Wan set the rule: "weak-minded." We see in PT that Jedi rules are made to be broken; if Anakin was "special" instead of older, Qui-Gon would still be dead set on training him because of belief in prophecy. Also given Jedi proclivity for losing limbs, head wounds may be commonplace, as is cognitive decline, so a once-strong-minded Jedi could easily have his condition change to weak-minded as time goes on.
Comment: One thing I don't think has ever been mentioned in canon is whether each user of a Jedi Mind Trick are equal or whether some can do more powerful Jedi Mind Tricks than others
Comment: @Philipp, aha, wrong! It also worked on Bib Fortuna. And based on the cringe-worthy dialogue, one suspects it was involved in the seduction of Padmé Amidala by the raging angst-monster that was Anakin. Because pretty much that's the only thing explaining why she was attracted to the whiny drama queen.
Answer: Is it possible? Probably not. Has it happened? Not in canon, per se.
As Kenobi says after the first and possibly most famous use of the Jedi mind-trick, "The Force can have a powerful effect on the weak-minded." We don't really see any Force users who could be considered weak-minded.
All of the Jedi, Sith, and non-aligned Force users in canon have undergone training, and from what we see of that training it includes building up their mental fortitude. So it is unlikely such manipulation would be easy, and possibly downright impossible.
It's perhaps also the case that simply being Force sensitive would render someone immune to mind-control through the Force. Either through growing up more attuned to the world and people around them or simply that their connection to the Force gives them a natural protection. In Rebels, Kanan (jokingly) laments that he can't control Ezra using the Force.

Ezra: "I wish that worked for me."
Kanan: "I wish that worked on you."

Further to that, Kylo Ren's attempt at using a mind trick to force Rey to give up the details of the map in TFA failed. Although strong in the force, at that point Rey was completely untrained, and unaware of her Force sensitivity.
That being said, we do know that even trained Force users can be mislead by the use of Force powers by another. Such as Luke fooling Kylo Ren in TLJ.

By appearing as a Force projection and delaying the First Order's assault on the remnants of the Resistance.

While that is not a simple suggestion along the lines of, "These are not the droids you're looking for," it might possibly count (even though it relies on a knowledge of weaknesses that you manipulate in your opponent).
Finally, and possibly off-topic, but during the opening of season 2 of Rebels, Vader uses the Force to control Ezra's arm, forcing him to hold his lightsaber to his own throat. While that's not mind control, it is using the Force to control the actions of another, partly-trained, Force wielder.
Comment: As an aside, I do believe there are instances in Legends where this defence against mind-tricks might have been a little looser. I think there's an example in the KOTOR games where a trained Force user is successfully mind-tricked, but for the life of me, I can't find it. The manipulation of Revan, post-amnesia _might_ count, possibly.
Answer: As the previous answers have stated, one Jedi is not capable of Mind-Tricking another Jedi. Multiple Jedi, however, might be able to pull it off.
In the Star Wars: The Clone Wars episode "Children of the Force", it's established that stronger-minded individuals can be Mind-Tricked if multiple Jedi attempt it at the same time. Specifically, Cad Bane is normally immune to Jedi Mind Tricks, yet Anakin, Obi-Wan, and Mace Windu are able to successfully Mind Trick him by working together.
It should be noted that the above process was extremely painful for Bane, bordering on torture, and (according to Obi-Wan) carried the risk of him losing his mind entirely. So under normal circumstances, it's not something that a group of Jedi would be willing to do, even if they would otherwise be able to. A group of Sith would, I'm sure, be willing to Mind Trick a Jedi, but the Sith historically lack both numbers and team-working skills, so the opportunity to do so has probably never presented itself.
Comment: While I accept that the potency of the mind-trick can be amplified by multiple Force-users acting in concert, there's no canon example of this being attempted on another Force-wielder. Cad Bane, while certainly strong-minded, showed no Force sensitivity.
Answer: If it is a Jedi, I would think not possible.
I watched all Star Wars movies + Mandalorian series.
Jedi suppose to mind-control those who have weaker/untrained minds.
In Episode 4: A New Hope, Obi Wan Kenobi said to Luke If I remember right that mind-control works on weaker mind. Usually.
In Episode 1: The Phantom Menace at the end Qui-Gon Jinn fights with Darth Maul that has red face with spikes. And he defeats him by hitting him in face with handle of his light saber and then quickly hitting him with light blade in chest.
Maul is suppose to draw power from The Dark Side of The Force.
And The Dark Side was said to be more powerful then Light Side.
So, if he is mentally more powerful he could just put his Light Side opponents to sleep and blow their heads off. But it doesn't happened.
In all Jedi vs Jedi fights that I've seen it doesn't happen.
In the end of the Episode 6: The Return of the Jedi, Luke Skywalker goes on board Death Star to try to turn his Farther Darth Vader to the Light Side.
Emperor offers him to serve him and he refuses.
Then Emperor makes him fight with Vader and Vader uses Force to make objects fly towards Luke. While being far superior to him in the Force and training he still can't affect him directly mind to mind.
At the end, Emperor tries to kill Luke using electricity discharges.And even that is not a direct Jedi Force vs Jedi Force in my opinion. It is using Force to generate a secondary medium - lighting bolts or to affect other Jedi physically. And only after doing it, Vader choose his side and tossed Emperor down some deep hole.
I think Great George Lucas when he was writing script for this, had pre-made it this way.
If Jedi can easily affect one another with their mind powers - it would be no fun.
Instead, we have nice light saber duels in several movies.
So, I think this can't happen.
Unless it be made in future movie/TV
But so far I haven't seen it anywhere.
Comment: Would you please explain you edited my answer? I have carefully checked grammar & spelling.


Potential Difference between A and B is negative the potential difference between B and A?

Question: Is the potential difference between a point A and a point B equal to negative the potential difference between point B and point A? Or, are they the same?
Comment: Are you referring to electrical or gravitational potential?
Comment: I'm referring to Electric Potential.
Answer: They are negatives of each other. The potential difference between two points is a signed quantity.
$$\varphi(\mathbf{r}_A)-\varphi(\mathbf{r}_B)=-[\varphi(\mathbf{r}_B)-\varphi(\mathbf{r}_A)]$$
Comment: A long time ago, I too had the confusion of signs.
Answer: The potential difference $V$ between two points is the work per unit charge required to move the charge between the two points. The magnitude of the potential difference (work required per unit charge) from A is B is the same as from B to A. But the sign of the change in potential of one is the negative of the other. That is because if a given charge gains electrical potential moving from A to B (gaining electrical potential energy), that same charge loses the same amount of electrical potential moving from B to A (losing electrical potential energy).
Hope this helps.


if a check is in your son's name in c/o you does it have to be signed by your son

Question: Second name on check c/o son's check need advice
Comment: What jurisdiction are you in?  Is your son an adult -- in the sense that he is old enough to sign binding contracts without your consent -- or an "emancipated minor"?  Are you legally his parent or "legal guardian"?
Comment: Have you asked your bank?  No matter what answer we give, your bank gets to set its own policies so as to balance customer convenience with the bank's legal obligations.
Answer: Yes, it will need to be signed by him unless he is a minor, you have power-of-attorney or you have some sort of other legal guardianship (such as if he is medically incapacitated and you are his executor). A c/o line does not mean the check was made out jointly to you, only that it could be delivered to you and you are entrusted to pass it on to him (your son).


Configure NFS server to accept connections from unpriviledged ports

Question: I'm working on custom-made NFS client and would like for the purpose of testing to allow connecting to my server from the ports that don't require elevated privileges. I'm sure there was a way of doing it, but can neither remember nor find it on the web.
Answer: You didn't specify the OS of the server, nor the server code.  If it's the standard Linux client then you specify "insecure" as part of the export
eg
<code>/directory server(rw,no_root_squash,async,insecure)
</code>
Comment: It's the same NFS server that comes with Linux kernels, I don't think there were significant API changes in it in the past few decades. I'm not at my office right now and cannot test it, but I'm almost sure that's it.


Automatically import/deploy/distribute private key to users for use with S/MIME

Question: it is an Environment with Microsoft Active Directory, Exchange and Windows/Outlook as Client. Now there are the users which have their own private certificates to send signed mails and encrypt decrypted mails for themself, but all users also access a central mailbox where they should be able to do the same but for this central mailbox.
So there is a private key for this central Mailbox
But how do i distribute the private key to all users, so they can read and sign mails as the central mailbox? Is there a way to install the private key automatically instead of importing the private key manually?
Answer: What you are looking for is a PGP Key Management Server associated with some sort of desktop app like https://www.gpg4win.org
There are plenty of guides if you google/duckduckgo how to setup a key server
Comment: nope, i am looking for a solution for s/smime, not pgp and Google/duckduckgo doesnt deliver any Solutions. Anyway, i think pgp key Management Servers are mostly for Publishing public certs, not the private keys....
Comment: @Blafasel so, I guess I'm a little confused here. are you trying to have it so emails sent and received to people outside your org. are encrypted? at that point just setup edge rules and encryption at the gateway
Comment: @Matt No, OP is trying to make it so that all emails can be sent signed (requires a private key), and all users have a certificate (and its private key) that can be sent (without private key) to others (internal or external) so that they can encrypt messages back to the user (Outlook automatically includes the cert, with public key, in signed email by default). Given that S/MIME are (Open)PGP are completely different standards (even though they have similar use cases), it's pretty obvious the request was not for how to set up a PGP key server.


Number of checkmate positions

Question: How many different checkmate positions are there? A Super-Computer problem. Not with any conditions or hypothetical situations, just simply the number of checkmates that can be arrived at in a properly played game.
Answer: Since there are 10^umpty possible chess positions (an obvious upper bound is 13^64, and estimates are 10^45+-5), even a supercomputer is useless.
The following "Monte Carlo" attempt is a feasible looking way to give an approximate answer, though:

Randomly generate a position (already nontrivial: how to generate truely random material in the sense that it's the correct proportion of legal positions?)
Make a flimsy legality test (material, impossible checks - a total one is very hard!)
Test whether it's a mate.
Rinse and repeat.

Assume that you test p positions, m are mate and there is a total t of legal chess positions, your answer is approximately t*m/p. I only fear that m/p is very low (for very full boards, in light positions things are different) and you again need a far too high p to get meaningful stats.
I strongly advise to make first tests on smaller board. For example, 3x4 chess is tablebase-solved and the analog of your value could readily be extracted.
Answer: It depends a bit on what you mean by 'checkmate position'.  One meaning could be that such positions are defined by active pieces only: in this case a back-row mate with two rooks would count only the rooks, and ignore all pieces that does not contribute (say, by guarding a field twice). Or, it could mean all possible such positions with or without participating own king, and might even make distinctions of mates on the first row, the last row, or either of the edge files, although the fundamental mate would be the same.
In Iuri Akobia's World Anthology of Chess Studies, vol. II: 4492 Studies With Mate (1994), the reference section contains the mate positions that are found in the same volume.  They're intended for finding studies in the same volume, not to answer your question.  But they may help getting into what the question really is.  (Although it is not relevant, there are slightly more than 2000 of them in this volume.)

Number of checkmate positions


Could Nighteye foresee his future?

Question: Nighteye has a quirk which allows him to foresee the future and when he does (like in the case of All Might) he tries to do something to prevent it from happening when it's something bad. Why couldnt he foresee his own future or did he see it and did nothing?
Answer: Two reasons.
First, Nighteye's Quirk requires him to look into the eyes of the person whose future he wants to see. It's not stated whether non-direct eye contact works, but assuming it doesn't then he can't see his own future just by looking into a mirror.
Second, he didn't think the future could be changed, only reacted to. When we first see Nighteye demonstrate his Quirk, he uses it on Deku so that he has perfect knowledge of his future movements. When they fight, he doesn't try to get in Deku's way or otherwise try to change those movements, he just uses that knowledge to avoid being where Deku is. Similarly, he himself said that he regretted seeing All Might's future because he's never been able to change what he sees - so presumably, if he saw his own death he would assume that it was a fixed possibility (and, in fact, in the fight with Overhaul it seems like he has used his ability to see his own death from someone else's perspective, and assumes that it's a foregone conclusion). It's only when Deku beats Overhaul and doesn't die in the process, as Nighteye saw, that he realises that the future can be changed.
Answer: He probably did know his fate, but everyone who has seen MHA should know that Nighteye was very fixated on saving Eri and stopping the Yakuza. He knew that if she wasn't saved, the Yakuza would probably wreak havoc with Eri's quirk. Also, in the anime itself, Nighteye said that they had to save Eri "no matter the cost," which might have been Nighteye hinting that this might be the death of him.

Could Nighteye foresee his future?