What would happen to transgender culture/identity if sex were trivially chanageable?

Question: This is a specific followup to the question 'How would society be different in a world where sex/gender is trivially changable?': in a future (Human, earth) society where (like in the Culture novels), it was an easy, common, and trivial procedure to change sex (genetically, physiogonomically etc), would there still be a distinct trans community with its own identity? I am setting a work in just such a future, and initially wanted to include a trans character, but then realised it isn't altogether clear what it means to be trans in a world where there is no struggle /oppression involved in simply changing one's sex overnight; obviously, the common bond forged by resistance to societal and structural difficulties plays a major part of the trans identity today, as does the common bond of undergoing the often difficult (physically and pscyhologically) medical procedures some members of the trans community use to affirm their gender identity.     Would residual prejudice and intolerance still lead to a distinct 'trans' identity? Or, does the ability to change sex with the equivalent of a quick visit to the doctor remove much of the impetus for having a distinct trans identity?
Comment: Transexuals by definition would no exists. And probably 99% of humans would have at least once in their lifetime changed sex..
Comment: In a world where people are either born bald or with hair, we would have transhairing.... People who go bald because they wanted to be born bald or people cross dressing by wearing wigs... But in our world the hair in your head changes over time therefore there is no such thing as transhairing people.... The same would happen in a world where sex can be changed at will, transexuality would not exist.
Comment: I think in the trans community there are groups such as pre and post op, so having both genders genitalia is different from a complete sex change.
Comment: @RandySavage There are also plenty of trans individuals who are perfectly fine with having genitals that don't match their gender identity, as long as the rest of their body matches it.
Comment: I our real world, changing the color of one's hair is trivial and most women (and quite a few men) practice it with enthusiasm. As a result, we don't have a culture or identity of "trans-blondes".
Comment: I think this really depends on how "norm" the trans procedure is in your story. If it hasn't been available for long or the character is in an area of minority then prejudices may still exist but in a world where it happens all the time and if the culture is well integrated there may be little to no prejudice.
Answer: People don't hate transexuals because they are transexuals.
A man transformed into a woman can be either perceived as gross depending on the operation, so basically that person* is not a woman but a guy with boobs.
Or a man transformed into a woman can be perceived as a normal woman... Because it looks like a woman and no one suspects that he is a man.
Some people would still be grossed out to discover they had sex with a woman who was once a man because the idea of having sex with another male is vomit inducing for a lot of men, it doesn't matter if that person* looks like a woman.
It's like asking those people, would you eat bull testicles if they were shaped and looked like normal american meat balls? People would be grossed out anyway, regardless if it's no more a bull testicle.
So until no one discovers that person was once male, no one would discriminate against that person or call that person names like  "trap" or "shemale"
For this reason transphobia exists, and it actually only exists for males becoming females..
Like in Afghanistan for example.
Female to male is not only accepted but its a widespread tradition
So yeah, not much would change except no one will be saying out loud that they are transexuals.
but

If transexuality is real and it's something that happens at birth then a baby could simply wish themselves to change gender and never even develop the idea of transexuality.  And it would be more of a joke your parents tell about at family gatherings "hey Jerry! Hear that one, did you know George was once a girl? His mother was shocked to find out he grew a penis after changing his diaper"
Comment: Calling someone "it" makes it seem insensitive. That's not a rule
Comment: @bytepusher ngl I have this problem a lot. "It" is meant to be used as gender neutral, but it's association with things and animals created the idea of diminishing. Same thing for the suffix "ism", it essentially means "the condition of being /having", but it's association with diseases made it diminishing. I still have trouble using the "they" pronoun simply cause my brains corrects "no that's an individual, not more than one or someone split". This **isn't an attack**, I'm just saying that it's not just what the language means, but the meanings we attribute to it.
Comment: This answer souns kinda insensitive towards transgender people, tbh.
Comment: @Gnar for good or ill, there is no central committee deciding how English works, unlike some other languages.  This discrepancy will have to be decided organically.  If enough people want a gender-neutral pronoun, they will simply make one and it will catch on.  If the number of people who care is too low, it won't stick around long.
Comment: @Erik just pointing out why transphobia exists, I don't make the rules.
Comment: @bytepusher edited.. Between English language should implement a gender neutral singular pronoum since english is one of the very few languages where pronouns are obligatory... A lot of latin languages can be spoken without ever speficifying the gender of the subject.
Comment: @ ProjectApex     'Same thing for the suffix "ism",...'   Itism? Hmmm.  I don't think it will catch on.
Comment: I agree a gender neutral pronoun would be nice ( I've seen "they" ). I often just replace it with "one" or "a person" or "a foo" if I mean a foo. "It" may possibly be technically correct, but really doesn't seem right for a person. Language isn't logical, necessarily ;)
Answer: I posit that you are over-thinking it. It seems that you are hung up on the stigma of transgender being the incentive to self-identify.
Step back, and look at all of the things humans self-identify over - hair color (blonds have more fun), bosom size (need I say anything more than 'Bay Watch'?), musculature (jock), financial success (the Club), place of residence (Beverly Hills), the car you drive (Ferrari prestige), military service (once a Marine, always a Marine), college sorority, Alma Matter. None of these are really based on stigma, but they lead to just as much of a sense of self-identity as does belonging to the 'gay community'.
Humans being humans, we will always self-identify by some designation or another, that seems to be our nature. Even if there is absolutely no stigma attached to being 'gay', the fact that it can be defined as a particular quantifiable group of people with the same experiences, group members will self-identify as belonging to the group.
Answer: My best guess is that it would vanish almost entirely, becoming more something like a minor trait instead of a culturally defining item. That's not to say the things that trans people currently do would somehow go out of style, but more that the people who like those things would gather around the specific activity instead of the identity (and would also include some folks who aren't part of the identity, but like the hobby)
A possible comparison might be drawn to a-religiosity. In countries with a high level of religiosity, where people are likely to make a problem about people not being religious, there are atheist communities, where the non-religious gather together to talk about things like science, philosophy, the dangerous of religion, etc. (The US has a fair share of this)
In countries where being a-religious is more then norm, those communities vanish entirely. Without outside resistance, there is nothing to hold them together. The activities remain, but the association with the identity of being "non-religious" stops being meaningful. Then religious people who like talking science join them as well, and they stop being "atheist culture" and just become "people who like talking about science culture".
People feel a need to band together most when they feel threatened by their environment. If you make a problem out of people being transgender, those people will band together and form a sort of culture as a defense mechanism. If you don't care one bit, that need to band will disappear, and much of the culture with it. The parts that remain will be absorbed into the general culture, and at best you might have an unusually high percentage of transgenders within a certain hobby because a lot of them happen to like it.
Answer: First I would point out, that the medical possibilities not necessarily cause a change in societal treatment of trans people.
But should that be the case for your setting: I guess there would still be some kind of community, around the shared experience of discovering the differences between ones identity and assigned gender. Sometimes people just want to talk to someone who just understands because of their own experience. Furthermore, even if the transition was trivial from a medical standpoint, I don't imagine it to be a quick decision (usually). So there could be a community aspect to helping others figure out who they are.
One more thing: It would also be good to consider non-binary and agender people. How do they fit into your setting?
Answer: The community would stay, but it's going to be much more diverse and much less exclusive.
Many novel things (cars, planes, photo cameras, surfing, climbing mountain Everest etc.) at first are the domain of a few hardcore enthusiasts which general public might think are crazy and maybe even suicidal. But as the progress goes on, this club of enthusiasts is becoming wider, the associated costs and risk lower, until this activity becomes a mainstream. There's still a community of enthusiasts, but it's no longer small and monolithic.
I am not saying that people would ever be as inclined to undergo a sex change as (for example) an air flight, but general acceptance of it would be much higher.
Comment: Diversity comes from differences.  Differences require change to be difficult; if it's not difficult, people from Group A are essentially indistinguishable from people from Group B.  Getting rid of differences doesn't make people more diverse, it makes them less diverse.
Comment: I'm pretty sure every kid or even adult human has once wondered what would it be like to be the other gender. And humans are experimental animals, so it would be incredibly hard to find people who never changed sex just to see what it's like.


Changing MTSUser after installation in web8

Question: We have installed Web8 recently. There is requirement we need to replace the local MTSUser with an Active Directory MTSUser. What configuration change we need to do for this update??
Comment: Dylan i followed jeroen answer and it worked well.we did not have any issue till now cms is working absolutly fine.
Comment: Hey Abdul - did the suggestions below work for you?
Comment: @AbdulQadir Could you please press the accept button next to his answer then? That will let other people with the same question know what worked for you :)
Comment: @PeterKjaer i did :)
Answer: Answer of Dominic is correct but incomplete. Here is the complete list as far as I am aware:

Update MTSUSer credentials of SDL Web Content Manager COM+ app
Update MTSUSer credentials in Tridion.ContentManager.config:

Search Query Engine Settings
Indexer Service Settings
Batch Processor

Update MTSUser in TranslationManager.xml
Grant MTSUSer access to the TridionRsaKeyContainer
Update MTSUSer in TRUSTEES table

Or add as new user as Administrator, optionally set to Predefined to hide user

Add MTSUSer to SDLSearchUsers group
Grant MTSUser the following file/folder permissions:

%ProgramData%\SDL\SDL Tridion\External Content Library: "Read,Write"
%SystemRoot%\Temp: "Read,Write,DeleteSubdirectoriesAndFiles"
%TEMP%: "Read,Write,DeleteSubdirectoriesAndFiles"
%TRIDION_CM_HOME%: "Read"
%TRIDION_CM_HOME%\config: "Write,ReadPermissions"
%TRIDION_CM_HOME%\config\cm_cnfg_git.dll: "ReadAndExecute,Write"
%TRIDION_CM_HOME%\config\Tridion.ContentManager.config: "FullControl"
%TRIDION_CM_HOME%\log: "Read,Write"
%TRIDION_CM_HOME%\web\Preview: "Read,Write"
Answer: In Web 8, the services generally run as System or Network Service, so you shouldn't need to change anything there.
You will need to change the identity of the SDL Web Content Manager application in COM+ as in this screen capture. (Note that my "MTS User" is called tridionsys)

The other thing you'll need to be aware of is that during installation, some of the settings in in the SDL Web configuration file are encrypted, and the key pair needed to decrypt these is associated with the Windows account used for the installation. Details of this can be found here.
If you consult the documentation for aspnet_iisreg, you will see that it is possible to export the keys from one account and import them to another.
I think that's all, but if anyone knows of something else, please jump in.


Developer mode enable js merging

Question: I searched for an answer, but I didn't find one.
I like to enable js merging and compressing in Magento 2 developer mode.
Is this possible?
I enabled them in admin, but the merging is not working
Answer: I never tried to do anything like this, but the magento mode, before js merging, seems to be detected at:
vendor/magento/framework/View/Asset/MergeService.php line 84
Actually it also seems to do some merging stuff in developer mode, but on a different way.
In developer mode it merges js files by:
Magento\Framework\View\Asset\MergeStrategy\Checksum
In all other modes the js files are merged by:
Magento\Framework\View\Asset\MergeStrategy\FileExists
Means in developer mode, it compares all the files it wants to merge, to some other file, where it stores the last modified time of the files to merge. And only  if files were modified, the merging will be done.
For further information about how merging of JS/CSS works, this link is kinda helpful, it also explains how to set it up and where limitations are.
https://mirasvit.com/knowledge-base/how-to-combine-javascript-files-in-magento-2.html

JS Bundling:
The thing, which does only work in production mode is not the JS merging, but the JS bundling. Here is the official Magento doc about JS bundling:
https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/js-bundling.html
there the mode is detected inside the createStaticJsAsset method of vendor/module-require-js/Model/FileManager.php. Feel free to try to implement an plugin for this method, and share with us if there were more steps to achieve JS bundling in developer mode.

Developer mode enable js merging


Since electron clouds of different atoms repel each other, does that mean that touch is the feeling of electromagnetic repulsion?

Question: Also when we rest our hand on an object does that mean we are effectively levitating because of the repulsion of the electron clouds?
Answer: Yes ... but let's be careful to understand that the sensation of touch is a psychophysical phenomenon.  The electrons at the surface of an object "push" against the electrons at the surface of your fingers.  The electrons never touch each other.  Your skin deforms a bit, and the nerves in your fingers detect this deformation, and send a signal to your brain.  Your brain creates the sensation of touch.
I don't know if I'd use the word "levitate", but it is true that there is a tiny gap between the electrons.


Is economics a science according to Popperian and Lakatosian standards?

Question: According to Karl Popper's falsification criterion only a falsifiable theory is said to be a scientific theory. If this is true, is Economics falsifiable and hence considered scientific?
Comment: Is this for a class? What of Popper and Lakatos was assigned to read? Is this based on what *they* said about economics? Or was "economics" defined more specifically and *you* are supposed to apply their criteria to that? We do not answer one-liners without more context, and some indication of personal effort.
Answer: It is not possible to falsify economics or science. You are conflating theories, methods, and disciplines. Good theories are falsifiable, disciplines are not. Like most disciplines, some aspects are falsifiable and others are not, and that a discipline has some aspects that are not falsifiable doesn't eliminate it as a science. A perfect example is astronomy which studies many phenomena that cannot be falsified directly. Karl Popper and his critical rationalism was a great counterweight to the logical positivists he criticized, but falsification is only one aspect of what generally constitutes scientific methods. To boot, economics does have theories that can be tested such as those of behavioral economics, among others. What constitutes a science is subject to controversy and interpretation, such as the dispute between realists and intstrumentalists.
Besides, falsification can be practiced in economics through trial and error in fiscal policy. A classic example of an often touted, but thoroughly discredited economic theory is that of trickle-down economics. Supply-side economic theory has been tested as fiscal policy repeatedly over the last hundred years, and the effects consistently fail to create economic growth. Money simply doesn't trickle down, the most recent evidence is recent Kansas fiscal policy.
By most reasonable definitions of a science, economics passes muster.


How to ask my professor to assign a paper to publish?

Question: I am a masters student. This semester I had a course with my supervisor. This course was not directly related to my thesis. During the term, the professor assigned me an in-class project (which was his previous work). I became interested in this course and project. How can I ask him to assign me to write a paper?
Having said that, I am funded by one of his projects and this is another one.
Is it appropriate to ask him to assign me tasks to publish the paper related to this course? If yes could you please tell me how should I write my letter?
Comment: Why do you need his permission to write a paper? Is there any reason that you cannot just do it? Or are you asking him to change your assignment from the old one to this new idea?
Comment: Professors are human, so the email should treat them like any other human. "Hi there, can we meet to talk about writing a paper on my project? Thanks!"
Comment: Possible duplicate of [How should I phrase an important question that I need to ask a professor?](https://academia.stackexchange.com/questions/90725/how-should-i-phrase-an-important-question-that-i-need-to-ask-a-professor)
Answer: If you have a vision for a paper, you could
(1) talk to him about it and show him your proposed outline, or
(2) just start drafting it if you're really motivated to do it,
as @Buffy pointed out, there's nothing stopping you from doing it.
Direct communication and/or initiative goes a long way.
Answer: I don't understand whether you want an additional assignment or a replacement assignment. In the first case, there is no need for the assignment if you have your own ideas. You can just write the paper without any permission needed. You an even publish it without permission.
However, if you do need to discuss this (either case) with your professor, the best way, by far, is to do it in person, not by mail. Only if a face-to-face meeting is truly impossible would I resort to mail. But one way to proceed is to include with your request (in either case) would be to include an outline, at least, of your ideas for the new work. Include this in addition for the reasons why you want to take on the new work. Show both interest in the topic and the fact that you have also spent time and thought on it.


Proxy server and IP address blockade

Question: i am in china. so i use web freer to use blocked sites like face book and you tube. we use broadband connection provided by our university. some times the server goes too down and we can not use internet. our friends say it goes down because they block our IP address as we use that proxy server. I want to know if that is the real case... should we stop using proxy?? will it help?? is there any other way to use blocked sites with out hampering the internet connection???
Answer: You're in a difficult position, because China has a program of "Internet content review" which causes many sites to be inaccessible for periods of time. And most of the information (outside mainland China) which would tell you how to access these sites is also unavailable.
One of the most effective ways of bypassing this is to use SSH's SOCKS proxy feature. This is because SSH is almost never affected by the Internet content review.
This requires you to have access to a Linux (or UNIX) server outside China. For instance you could lease a virtual server from Amazon EC2 or many other low-end VPS providers. It also requires you to have SSH installed on your local PC, so you would need to run Linux, or Cygwin for Windows for instance. Once set up on both ends, you make a SSH connection from your PC to the Linux server:
ssh -D1080 my.server.outside.china.com.au

Then you configure your local Web browser to use a SOCKS proxy on localhost port 1080, and all of your Web browsing will be tunnelled through the SSH connection, and the rest of the world will see the connection originating from your leased Linux server in the other country.
It's also possible to use VPN services, though these often get blocked.
A post at our sister site Super User has some more ideas on ways to access blocked sites.

Proxy server and IP address blockade


Bayesian & Power-Law Distributions

Question: I'm looking to conduct a Bayesian regression analysis with three independent variables (all roughly normally distributed) and a single dependent variable (job performance) that follows a power-law distribution. Instead of assuming that job performance follows a normal distribution, how can I specify that it follows a power-law distribution in R?
Comment: Discrete or continuous dependent variable?
Answer: There is an important implication if your independent variable follows a power-law distribution -- namely the size of your sample data and whether it is  large enough to be reliable for model estimation.  The usual "rules of thumb" about sample size don't apply to many heavy tailed distributions, esp. power law distribution with low value of the exponent parameter $\alpha$.
Here is a blog post that gives a tutorial on this topic: http://exploringpossibilityspace.blogspot.com/2013/08/tutorial-how-fat-tailed-probability.html
Therefore, it would be prudent for you to try to fit a distribution to the data so you can evaluate the adequacy of your sample size.  The R package poweRlaw is very good for this purpose.
Answer: As far as I can see, the distribution of the IVs isn't directly relevant.
Assuming you're talking about a continuous power-law distribution ($f(y)\propto y^{-k}$ for all $y>1$), this would be a Pareto distribution.
One approach would be to model $y^*=\ln(y)$ as exponential using a GLM, where the power in the Pareto becomes the rate parameter, as long as the available link functions for it allow you to match the model you want. Failing that, you will likely need to look at writing and dealing with the likelihood more directly for whatever model you have.
In packages that don't offer the exponential directly, this can be done with a gamma GLM, setting the dispersion parameter to 1.
--
In R you can fit an exponential GLM as follows:
fit <- glm(formula =...,  family = Gamma)
summary(fit,dispersion=1)

If you specifically want a Bayesian GLM, see the arm package. You may also find the following document helpful - Bayesian Generalized Linear Models in
R, Starkweather, 2011 (pdf).

Bayesian & Power-Law Distributions


"whoever" vs "whosoever" - when should I use which?

Question: What's the rule for choosing between "whoever" and "whosoever" as a subject for a sentence? Even if they have the same semantics (of which I'm not sure), I'm assuming there some contextual or stylistic considerations for choosing one over the other.
Comment: @JohnLawler _Whosoever_ was once a boon for hymnwriters. Though both hymnwriters and boons seem a bit thin on the ground nowadays.
Comment: _Whosoever_ is for proclamations and official language. Don't use it in speech except as a joke, and don't write it unless you're a lawyer.
Answer: Whosoever is, according to ODO,

formal term for whoever.

So you should/could use it in more formal situations.
The Bible commonly uses whosoever (because it is 'archaic' and formal):

For whosoever will save his life shall lose it: but whosoever will lose his life for my sake, the same shall save it.
  Holman Christian Standard Bible, Luke 9:24

Of note is the extra syllable, if you wanted to write a poem or something in a particular rhythm.
Answer: They're semantically indistinct. You may find slight differences from dictionary to dictionary but native speakers won't be able to agree upon any meaningful difference beyond a stylistic difference. "whosoever" is very ritualistic and eldritch. If you were writing a fantasy novel like Lord of the Rings, or anything dealing with rites and rituals of a cult or extinct religion, it may be better to use "whosoever". A sentence like "whosoever wields this sword shall be cursed" rings better than "whoever" would. It would be very, very weird to use "whosoever" in normal speech under any circumstances, whether in conversation or instruction or giving a speech.
Comment: _Whosoever_ is 'weird or sinister and ghostly'?  Quite a few of the places you might find it used might be, though some are just old-fashioned and inviting ('Whosoever will may come').
Answer: As other people have mentioned, "whosoever" and "whoever" seem to ne generally interchangeable, and "whoever" is more common, but "whosoever" sounds more formal or old-fashioned.
I did think of one grammatical context where "whosoever" seemed like it would be more common to me, and the Google Ngram Viewer seems to confirm my guess: the emphatic expression "anyone whosoever" seems to be a bit more common than "anyone whoever" (however, it's pretty close, and both expressions are uncommon):

(Actually, "anyone whoever" seems to sometimes be a typo or OCR error for "anyone who ever", so the true difference in frequency might be a little greater than it appears here.)
Here is an example of how "anyone whosoever" is used as an emphatic version of "anyone":

It has been further agreed in the said assembly, that if hereafter the commons of the upper end should need to be enlarged, in order to procure more pasturage for the cattle, all the said inhabitants (s'y porterons) shall help in doing the same, as this day they bind themselves to do for the lower end, always without prejudice to anyone whosoever.

United States Supreme Court Reports, Volume 11, "Chouteau v. Eckhart", p. 348

While this sounds very dry and formal, it really wouldn't sound any more natural to use "anyone whoever" in this context; in fact, my feeling is that it would sound incomplete for whatever reason.
Similarly, "anything whatsoever" sounds more natural to me as an emphatic form than "anything whatever".
Actually, "anyone whatsoever" is also used and is a good deal more common than both "anyone whosoever" and "anyone whoever":

Since the question asked about use as a subject specifically, I found the following example:

Though anyone whosoever could possess a seal, yet these private persons' seals had no other credit than to-day is accorded to a personal signature or seal.

https://www.courtlistener.com/opinion/1176492/state-v-salazar/
(It's not really clear to me what the ultimate origin of this sentence is. It occurs in a footnote of a document by Herbert F. Krucker, and preceded by the statement "In VII Wigmore, Evidence § 2161 (3d ed. 1940), page 634, Wigmore quotes the following with approval", but I can't figure out who Wigmore is quoting with approval.)
Comment: Where would 'anyone whosoever' be used?


Make Theme automatically choose default nav menu

Question: I have been developing a WordPress theme. I want to be able to, once activated, look to see if there is already a menu created in the backend. If it exists then choose it and use as the primary menu, but otherwise create a new menu with the top level pages already in existence and register it as the primary menu.
I can't seem to find much on this, can anyone shed any light?
We have found some code that checks the current default menu listed below
add_action( 'after_switch_theme',  'mytheme_menu_fix' );

function mytheme_menu_fix() {

    $old_theme = get_option( 'theme_switched' );
    $old_theme_mods = get_option("theme_mods_{$old_theme}");
    $old_theme_navs = $old_theme_mods['nav_menu_locations'];
    $new_theme_navs = get_theme_mod( 'nav_menu_locations' );

    if (!$new_theme_navs) {
     $new_theme_locations = get_registered_nav_menus();

    foreach ($new_theme_locations as $location => $description ) {
         $new_theme_navs[$location] = $old_theme_navs[$location];
    }

    set_theme_mod( 'nav_menu_locations', $new_theme_navs );

    }
}

This works fine, all we need to sort now is if no primary nav is selected. I.E. on a fresh install of the theme
Comment: It sounds like you're trying to duplicate the menu that the previous theme used so there's no loss of menus when your theme is activated, is that right?
Comment: yes, but I also want to create a menu of top level pages if no menu is selected as the primary menu too
Answer: You can use has_nav_menu() to check to see if the location has one assigned to it. If it does, use wp_get_nav_menu_items() to duplicate the menu, then assign it to the location you register in your theme.
Here's what I have in mind. It's off the top of my head and will need more code and testing, but hopefully it's a good start for you:
function wpse112672_menus() {
    if( has_nav_menu( 'old_theme_menu_location' ) {
        $old_menu = wp_get_nav_menu_items( 'old_menu_id' );
        register_nav_menu( 'new_theme_menu_location' );
        $new_menu = wp_nav_menu( $args );

        return $new_menu;
    } else {
        return wp_page_menu();
    }
}


Connecting an active low Enable pin IC with a MCU

Question: It's my first time working with an active low Enable IC and I'm not intuitively understanding the connection.
EN_N pin of the IC has an internal pullup resistance of 1.1Mohm and I'm planning to use STM MCU GPIO to control the EN_N pin.
Since this IC needs to be active most of the time, I want to pull it down normally, and only pull it up when not in use.
So like the attached picture, GPIO1111, which is the GPIO of the MCU, is connected directly to the EN_N pin with a matching resistor of 1.1Mohm.
Is this a correct way of connecting?
Comment: What the chip is and what does it do in the system? Do you still want the chip to be enabled, even if the MCU is only booting up after powerup, getting firmware update, or kept in reset? Sometimes you might want it enabled when the MCU is not controlling the board, but sometimes you might not.
Comment: @Justme The IC is TUSB320LAI USBC Controller by TI. There is a different SKU with EN pin active high, but since this controller will be on the most of the time, I decided to go with the active low EN pin part. I wanted to connect the GPIO just in case when a reset is needed.
Answer: 1.1 MΩ is a high resistance, making the internal pull-up resistor very weak. By connecting an external pull-down resistor of the same value, you have effectively created a voltage divider such that the pin will, absent noise or unwanted signals, be indeterminate.
Your schematic is correct, but the value of pull-down resistor should be re-evaluated. In order to assert a definitely low condition on the EN_N pin, consider a stronger 10 KΩ value.
(If battery life is a concern, higher resistance values may be warranted, but must be low enough compared to the internal pull-up to produce a sufficiently "low" voltage.)
Consider:
$$V_{out} = \frac{V_{source} \times R_2}{(R_1 + R_2)}$$

Simple voltage divider (CircuitLab is not cooperating today)
If R1 is the internal pull-up and R2 is the external pull-down, then with both values equal you have 50% of V_source. For example if V_source is 3.3V, your EN_N pin would "see" 1.65V, which would not be considered "low."
If R2 is 500KΩ, V_out becomes approximately 1V, which might be considered low depending on the IC.
10K to 100K would be my recommended range but depends on the IC, noise immunity, tolerance for constant current consumption, etc.
Answer:
Case #1) The device must remain disabled until signal GPIO1111 actively drives a control signal onto input EN_N to enable (LOW) or disable (HIGH) the device.
Remove resistor R28; that's all you need to do.
The EN_N input is connected to VCC (+power) through the internal 1.1 megohm pull-up resistor, which ensures EN_N's default logic state is HIGH (device is disabled) when the EN_N pin is "floating"—i.e., when no external signal source is connected to EN_N, or when an external device is connected but it is not actively driving a logic LOW voltage nor a logic HIGH voltage onto EN_N.
If signal GPIO1111 is a digital logic output signal, and if GPIO1111 is never disabled (placed into a high impedance state), then GPIO1111 continuously drives either a logic LOW voltage (enabled) or a logic HIGH voltage (disabled) onto the EN_N pin.  Your software simply needs to configure GPIO1111 for logic LOW or HIGH as needed.

Case #2) The device must be enabled (EN_N = logic LOW) when signal GPIO1111 is not present—i.e., when GPIO1111 is not actively driving a logic LOW or a logic HIGH signal onto the EN_N pin.
In this case resistor R28's value must be chosen to ensure the voltage at EN_N (\$V_{EN\_N}\$) is within the range
$$
0 \le V_{EN\_N} \le V_{IL}
$$
where \$V_{IL}\$ is the maximum voltage for a logic LOW input signal at the EN_N input.  \$V_{IL}\$'s value for the EN_N input should be specified in the device's datasheet. (NB: Datasheets often specify \$V_{IL}\$'s value for all input pins, rather than specifying \$V_{IL}\$'s value repeatedly for each individual input pin. Sometimes, however, a datasheet will specify \$V_{IL}\$'s value for specific input pin if that pin requires different voltage levels for the applied logic signals compared to the other input pins; so be sure to look for that case also.)
To ensure some noise immunity I suggest that EN_N's default voltage be no greater than 70 % of \$V_{IL}\$.
For example: Assume \$V_{CC}=5\,\mathrm{VDC}\$, and assume the device's data sheet states \$V_{IL}=0.5\,\mathrm{V}\$. (NB: I'm randomly choosing \$V_{IL}\$'s value, so don't assume this is the correct/required value.) Your job is to design a resistive voltage divider whose output voltage is no greater than \$V_{IL}=0.5\,\mathrm{V}\$. As a best practice I suggest the divider's output voltage be no greater than 70 % of \$V_{IL}\$, or \$V_{EN\_N(LOW)}=0.35\,\mathrm{V}\$. Using the resistive voltage divider equation, where the top of the divider is connected to VCC and the bottom is connected to ground, solve for resistor R28's value:
$$
V_{OUT} = \frac{R28 \cdot V_{CC}}{R_{PULLUP}+R28}
= V_{EN\_N(LOW)} = 0.35\,\mathrm{V}
= \frac{R28 \cdot (5\,\mathrm{VDC})}{(1.1\,\mathrm{M\Omega})+R28}
$$
Next, use a table of standard resistor values and choose a standard value for resistor R28.

:: CHECK :: Plug your chosen resistance value for resistor R28 into the resistor voltage divider equation above and solve for \$V_{OUT}\$. Ensure \$V_{OUT} \le V_{EN\_N(LOW)}\$.

:: CHECK :: When GPIO1111 outputs logic HIGH, ensure resistor R28 does not draw too much current from the logic output pin that supplies signal GPIO1111. For example, if \$V_{CC}=5\,\mathrm{VDC}\$ and your chosen value for resistor R28 is \$R28 = 1\,\mathrm{k\Omega}\$, the digital output pin that supplies signal GPIO1111 must be capable of sourcing a current of
$$
I_{GPIO1111} \approx \frac{V_{CC}}{R28} = \frac{5\,\mathrm{VDC}}{1\,\mathrm{k\Omega}} = 5\,\mathrm{mA}
$$
Answer: R28 will help pulling the signal down "when not in use" and is therefore counter productive.
When you don't know the configuration of GPIO1111 at start up, I'd suggest using a transistor with an additional pull-up resistor instead of R28.
So,

remove R28 and disconnect signal GPIO1111.
connect pullup resistor to pin 11
connect e.g. a logic-level NMOS with drain to pin 11, source to gnd and signal GPIO1111 to te gate and a resistor (of 1K to 10K) from gate to ground


Serve Bitcoin Core Wallet Remotely

Question: It is possible to serve the Bitcoin Core GUI remotely via a web page running on a server running in Digital Ocean (or any other provider)? If so, where can I find instructions on how to do this?
Answer: It's not possible to use the GUI. (If you really want to, you can use TeamViewer, which is about controlling your computer remotely and not not that efficient.) You can use the RPC API to use the most of Bitcoin Core's functionality. If you're using it as a blockchain data API, the REST API might be a better choice.

Serve Bitcoin Core Wallet Remotely


Create guided tour in an Android app

Question: I want to create interactive tour in my app like this:

How can i achieve it? Do you know a library to make it easier?
Comment: Viewpager with your own screenshots would probarbly be the easiest way to go.
Answer: ShowcaseView probably is your best option. It's designed to highlight and showcase specific parts of apps to the user with a distinctive and attractive overlay. The library is great for pointing out points of interest of users, gestures, or obscure but useful items.
The library is based on the 'Cling' View found in the Launcher on ICS and Jelly Bean, but extended to be easier to use.
GitHub repository ShowcaseView
Answer: you can check this one link. Here Roman Nurik created a wizard which can be used as your purpose by some modification. You can see the source here.
But I think it is better to create your own guided tour. Create it using Fragments and ViewPager.
Answer: You could consider using this library in your application: Showcase View. It is based on the View that Android shows in ICS and JB when you start a fresh device for the first time / factory reset / flash, say CM 10 / 10.1. As also the app launcher when launched for the first time.
EDIT: This is how it looks

And as pointed out by Warpzit in his comment, in theory (I haven't used is so far, but am really keen on using it soon), you could use the library with screenshots in a ViewPager.
There is an Open Source project on Github called TweetLanes which uses a similar approach (minus the library mentioned above). You could download and give the source a look to see how the app implements.  And as mentioned, it's Open Source. ;-)

Create guided tour in an Android app


Control System Response

Question: How does one find the zeta value or the frequency of an over damped response curve. I am used to determining things by using the log-decrement equation. Does that apply here even though there is no oscillations?
Comment: Can you post a sample response? Why not use some optimization algorithm to fit a second order system step / impulse response to the obtained response? It may be a bit overkill though.
Comment: So there is no way to determine these values from the graph ?
Comment: Over-damped response does not have a frequency.
Answer: The logarithmic decrement is not applicable to the overdamped systems because there are no oscillations.
Also, there is not (at least to my knowledge) an equivalent to the logarithmic decrement approach to calculate the damping ratio $\zeta$ for overdamped systems.
Free vibration measurement
As AJN proposed what you can do is given the equation that describes the response (e.g. displacement). For example for free vibrations of a system:
$$x(t) = C_1 e^{\left(-\zeta+\sqrt{\zeta^2-1}\right) \omega_n t} + C_2 e^{\left(-\zeta-\sqrt{\zeta^2}-1\right) \omega_n t}$$
where:

x: is the displacement
$C_1, C_2 $ are integration constants
$\zeta$ is the dampting ratio
$\omega_n $ is the natural frequency (should be equal to $\sqrt{\frac{k}{m}}$)
t is the time.

Given a set of measurements t, x(t)

t
x(t)

0
1

0.001
0.98

0.002
...

you can use a non linear fit tool to obtain the parameters: $C_1, C_2, \zeta$.
Another approach is that you can also fit $\omega$ and the validate against the $\sqrt{\frac{k}{m}}$).  This is good because, the nonlinear fit is not a trivial exercise, and it would be preferable if you have a benchmark/validation of your effort. (however, I stand with AJN that this is probably overkill).

measurement with forced response on steady state.
Alternatively, another approach for overdamped systems is to apply a forced vibration of known magnitude and frequency. At the steady state, measure the dynamic amplitude of the system, and calculate the Magnification or Transmissibility ratio and from that calculate the damping radio.
Answer: Picking up from NMech's answer:
For the step response, integration constants can be expressed in terms of $\zeta$ and $\omega_0$

According to swarthmore.edu
Where $\omega_0 = \sqrt{\omega_1\omega_2}$ with $(\omega_1,\omega_2)$ being the two characteristic frequencies, and $K$ is the step amplitude
After that, I believe $\zeta$ can be extracted from any two points on the step response $(t_1,x_1)$ and $(t_2,x_2)$, with the procedure made independent of $K$ and $\omega_0$ by looking at the ratio $x_1/K$, $x_2/K$ and $t_2/t_1$ . For any ($x_1/K$, $x_2/K$), chosen arbitrarily, $t_2/t_1$ should correspond to $\zeta$. A table could then be generated with a spreadsheet.

Control System Response


Change resolution from command line in virtual box

Question: In virtual box, how can I change the screen resolution from the command line? (Or if there's one for any type of computer, that might work too).
Comment: Do you want to do this from the host or guest command line?
Comment: maybe its me, but whats the OS?
Comment: A thorough answer can be found here on SO:

http://stackoverflow.com/questions/10725867/forcing-monitor-resolution-in-virtualbox-vm-on-linux-guest/10726041#10726041
Answer: You can quickly "hint" the window to a specific size with the following command:
VBoxManage controlvm <uuid>|<name> setvideomodehint <xres> <yres> <bpp>

For example, if you have a guest called "Windows XP Pro", and you wish to set the resolution to 1024x600 at 32 bits per pixel (aka 32 bit) you would use the following command:
VBoxManage controlvm "Windows XP Pro" setvideomodehint 1024 600 32

There are some prerequisites for this however:

This only works if you've launched the Guest OS from a windowed environment on the Host OS (ie. Windows / X Windows / Mac OS Desktop).
Guest Additions must be installed in the Guest OS.
Comment: Also note that that command must be run while the VM is running. My experience also indicates that it is necessary to set `VBoxManage setextradata global GUI/MaxGuestResolution any` (before starting the VM). The auto resize should also be disabled in the view menu. If the intended resolution is particularly high (especially if it's higher than the host resolution), more video memory may have to be assigned.
Comment: VirtualBox OSE 4.0.4 doesn't let you change the resolution to larger than normal display size with that.
Comment: Is it possible to persist this setting somehow?
Answer: First, the vm must be turned on, you can power on with command:
# VBoxManage startvm "VPN" --type headless

Before you can change the resolution:
# VBoxManage controlvm "VPN" setvideomodehint 1024 768 24

Answer: If you wish to change it from within the guest:
In Windows: there are a couple tools that allow you to do this easily from the command line, notably Display Changer.
In Linux: Use xrandr -q to list available display modes, then xrandr -s # where # is the number of the display mode you wish to use. xrandr -q will display these number options next to each display option.
Comment: the 10k x 8k resolution i tried to set with display changer did have no effect on virtualbox ose 4.0.4
Answer: $ VBoxManage setextradata "WinXP" "CustomVideoMode1" "1440x900x16"
 Where "WinXP" is your virtual machine name. This solution is somewhat close to truth :)
Comment: does not work here on VirtualBox OSE 4.0.4
Answer: Look inside the documentation provided with VirtualBox. The VBoxManage program gives you the ability to modify VMs from the command line. You can't do this while the machine is running, however. To do that you'll need to find a way to script the resolution change for the operating system you are virtualizing.
Comment: please note that in some cases you will have to install "guest additions" in order to properly use VBoxManage, see may question regarding a similar issue: http://superuser.com/questions/30924/resolution-issues-running-ubuntu-on-virtualbox
Answer: The MS Windows RDP client for Mac OSX has a preference setting that I had to adjust in addition to adding the custom video modes (shown above).
Select Preferences from the RDC menu, then click on 'Display'.
(I was going to post a screen image, but the spam prevention feature prevented it.)
By selecting 'Full screen', I was able to get the display mode changed to the full screen of the client computer. In this case, a MacBook with a screen resolution of 1280x800.
Comment: Upload the image/link without embedding it and  someone will fix it. Also "Shown above" dosen't really cut it since the order of answers changes on SU - you may want to explicitly reference which answer you're referring to in future


The Vav of Veahavta in the first perek of Shema

Question: What are the explanations of the Vav of Veahavta in the Shema as it comes to add something?
Comment: Why shouldn't it be there?
Comment: It is after the statement shema. You need: listen and love
Answer: The Sforno seems to say that the vav "you will then enjoy doing things which are pleasing to Him when you understand that there is nothing in this world which is more worth doing."
The kitzur Bal Haturim says that the vav is necessary so that the word v'ahavta has the same letters as "ha'avot" (the forefathers) so it can invoke them and their lives.
The Ohr Hachaim writes

The conjunctive letter ו means that not only is there a commandment to accept the authority of the Kingdom of G'd but there is an additional commandment to love G'd. The sequence of the verses also teaches that we must not make the mistake of believing that love of G'd is possible without an initial dose of fear of the Lord. The Zohar volume three page 56 spells this out. The letter ו then means that after we have achieved a degree of fear of the Lord we will be able to develop love for Him. The reason the Torah uses the word את which implies joining something, is to teach us that the means to develop דבקות ה׳, an affinity for G'd, is by loving G'd in addition to fearing Him.

I am no expert on biblical grammar but on a simpler level, there is a notion of a vav hahipuch (according to some) which changes the tense of a word -- here, Ahavta, a past tense verb is changed to the future (and you shall love).
Comment: Regarding your final statement, couldn't the Torah have written תאהב את ה' אלהיך?
Comment: You're saying that Sforno is saying that the ו indicates that this _pasuk_ results from the statement made in the previous one (i.e. "שמע")?
Comment: @ezra the question of why the Torah would ever use a vav hahipuch instead of the simpler future tense is a question I posted last year IIRC.
Comment: @WAF yes, the Sforno doesn't see loving as a commandment but as a logical conclusion.
Answer: Simple explanation
This is called vav hahipuch or the "reversing" vav. It is a common Biblical technique to add a vav at the beginning of a verb. The reversal changes a past tense verb into the future and a future tense verb to the past.
In this case, the verb ahavta would mean "you loved". Having the vav in front makes the term mean "You shall love", meaning the future tense.
I'm not sure why the Bible uses this technique. That's probably worth asking a separate question.
Comment: Vav hahupuch is not with patach and daggesh chazak afterwards, despite that alef is not able to wear a dagesh chazak, in this case, the vav will wear a komots
Comment: @kouty - I am not following your point as it relates, here. Another indication of vav hipuch is that the accent on the verb is usually milra, as it is here. If it was pronounced Ve-oh-HAV-ta, th emeaning is changed and the vav would mean "and".
Comment: OK thanks. I need to learn this in michlol
Comment: You are right, the rule I mentioned is for hinouch meatid leavar e.g. Vyyomer. But for meavar meatid it's with a Sheva


Who is the Resourceful Rat and what does he do?

Question: In Enter the Gungeon when you leave an item in a room except hearts this weird rat dude takes it I've tried shooting him but of course he had a shield and disappeared. But when I left after I shot him he wouldn't come back so I walked away but when I came back later the item was gone with a rude note. Who is he? And does he do anything in the game?
Answer: The Resourceful Rat is an invulnerable NPC that picks up most items that you leave lying on the floor.
Once you find an item, you normally have a chance to pick it up. If you decide you don't want the item, the Resourceful Rat will come and steal the item while you're not in the room. It takes him about 3-5 seconds to take the item (he leaves a mean note behind when he does, which you can read for some humor). If you shoot him during this time, he will swear ("&$*#@!") and disappear again. Now he will not show up until you are at least two rooms away. If you still manage to get back to the first room (by teleporting back, for example) and shoot him while he's picking up the item, he'll disappear again - however, he'll keep trying to steal the item again once you're far enough away.
In the end, there is no good way to prevent the Resourceful Rat from stealing your dropped items. However, there is a upside to this NPC - he will not steal hearts or keys that you leave on the floor.
Additionally, if you take an elevator shortcut to floor 3+, the Resourceful Rat will be standing near the elevator exit in a ridiculous costume and he'll offer you some free guns.
Comment: It sounds like the Rat will also be a boss in the upcoming "Gungeons and Draguns" DLC, but I don't have concrete details. I'll update the answer when I do.


Push to different parts of array in Solidity

Question: push() pushes to the back of an array. What possible solutions are there for pushing either to the front of an array, or to a specified index in an array?
Answer: Nothing like that exists because the obvious solution would involve considerable, variable gas cost to reorganize data at rest.
There are patterns that combine mappings and arrays to create iteratable sets with random access. If it is to be sorted or organized in any particular order then one needs to code for that as well.
Have a look over here for some ideas Are there well-solved and simple storage patterns for Solidity?
Hope it helps
Answer: Just to add to Rob's answer, I have found a library for a linked list in Solidity, though it comes with the disclaimer that I have not audited the code, nor have I yet had the opportunity to check how gassy it is: https://vittominacori.github.io/solidity-linked-list/


Can firewall block connection over VPN?

Question: I would like to block specific apps from making connection to internet. I sometimes am connected by VPN but not always. How can I make firewall work for both VPN and not VPN, wifi and mobile data? My phone has root.
Comment: Since you have root, you can use AFWall+ which is based on `iptables`. It doesn't require VPN, so you can use VPN apps freely.
Answer: Android permits only one VPN to be working on the phone and that is the problem since firewalls also usually create a VPN and you are forced to switch off the VPN to make the firewall work.
However, there is a workaround, at least in some cases. I use Adguard which is an Adblocker with an integrated firewall. It creates it's own VPN on the device locally to filter ads. I also use Keep Solid VPN which is set to always use in my settings (Pie) . Adguard has a proxy mode which permits both VPNs to be used and since your device is rooted, it is easier.
However, note :

All VPNs may not work in this fashion. Check the Adguard forums.
In proxy mode, the efficacy of Adguard firewall is reduced but in my case I have no problems in blocking internet access to apps.
If I want only the Firewall functions but not Keep Solid VPN, I simply disconnect it from the notification panel.

To sum up, it's possible but you need to invest time in checking and ensuring both work.

Can firewall block connection over VPN?


Does Mac OSX software raid support partial resync?

Question: If I have a software RAID-1 (mirror) setup in Mac OSX and I turn off the system during mirror rebuild, when I turn it back on will it start a whole new resync or just do a partial resync (like linux' raid1 or drbd where both store a bitmap of already-synched blocks)?
Answer: I've never tried it intentionally. I suspect the RAID will show as degraded and try to pick up where it left off.


Front end forms for contacts?

Question: With Caldera forms now no longer an option, what are some best practices for new users to enter contact details into CiviCRM ?  Also, what is the best way to show user info on the front end of a website?
Answer: You have several options.
The oldest option is profiles (Administer > Customize Data and Screens > Profiles).  These are basic in functionality, but are still my first choice for newsletter signups.
Second is FormBuilder (Enable at Administer > System Settings > Extensions, then find at Administer > Customize Data and Screens > FormBuilder).  This is the successor to profiles and Caldera Forms. It does many things that both are incapable of, but still has rough edges - e.g. there's no easy way to add a submitter to a group automatically. But it improves significantly with each month.
Third is Caldera Forms.  Some CiviCRM developers are maintaining a fork of Caldera Forms that continues to work.  I don't have details but someone else can surely respond. Here is a blog post with links to more info.
Fourth is using Form Processor with just about any form building tool.  This is the most complex option, but is much more powerful than any of the others.  It's also possible to use FormBuilder + Form Processor in this way. I'v
Answer: Totally agreed with Jon G. We are using a mix of the solution above depending on what needs to be achieved. Form Processor and Contact Form 7 do work well together.
The remaining question is for paid membership which is not yet handled by FormBuilder but might be soon.

Front end forms for contacts?


Excluding four IP's from a /32 static route

Question: I have a Cisco ASA routing a /32 of public addresses (non RFC-1812) through a private link. When the device sees the destination address it selects the private route instead of going out over the public network. This works great but I am now trying to exclude 4 IP's from the private route. Traffic to these addresses should go over the public internet instead of being routed over the private network. Can I just add anothe route for these four IP's or do I have to modify the existing route for the /32?
Comment: Well, what have you tried to do and what have the results been?
Comment: I haven't tried anything yet because its technically not my device. I'm trying to convince the other admin to make the changes on his side because otherwise I have to put these hosts on another subnet entirely which means downtime for a production system. I would like to know if its even possible before pursuing the issue further.
Answer: Routing decisions are made by the longest prefix match. Par example when you route the network 192.168.0.0/24 out on dmz1 interface and you want to route 192.168.0.1/32 on interface dmz2 then this can be done by just adding the route
<code>route dmz2 192.168.0.1 255.255.255.255 a.b.c.d
</code>
because the prefix /32 is longer then /24.
/32 is the longest possible prefix match. so in your config you had to remove the routes for the four hosts and add the new routes (CLI). If you are using ASDM you can edit the routes.
Answer: No, better to add an a ACL to first block the 4 IPs to be routed through the private network interface, and then have a route in place to take them over the public network. You will need to identify the routing logic of how the traffic is coming into your network first and assign it to the right interface.


HKDF vs TLS PRF. Which of the one is better?

Question: Which of the one (HKDF or TLS1.1+ PRF) is more secure and why?
Comment: Better, in what sense?  More secure, in what sense?  For what purposes?  Under what threat model?  This question is too vague as it stands; I suggest you edit it to make it more specific.
Answer: It is unclear if you wanted to compare TLS 1.1 PRF or TLS 1.2 PRF. Different TLS versions have different PRFs. Assuming you meant TLS 1.1 PRF although you linked TLS 1.2 RFC.
TLS 1.1 PRF
Short: HKDF is commonly a better choice than TLS 1.1 PRF, but not always.
Consider these aspects:

HKDF is a generic construct.
HKDF is extract and expand.
TLS1.1 PRF is just extract or expand.
TLS1.1 PRF is intended for TLS protocol.
HKDF can be used with hash functions chosen by the user.
TLS1.1 PRF uses MD5 and SHA-1 hashes. Thus, it does not allow using stronger hash functions.
TLS1.1 PRF uses two hash functions which causes extra complexity and complicates security analysis.
TLS1.2 defined new PRF function to use. (So for purposes of TLS, TLS1.1 PRF has gotten deprecated).

TLS1.1 PRF has been analyzed in Hash function combiners in TLS and SSL.
Based on this analysis, HKDF, when used with a strong hash function is likely stronger than TLS1.1 PRF.
TLS1.2 PRF
Comparing HKDF with TLS 1.2's PRF.
NIST SP 800-108 Recommendation for Key Derivation Functions defines various ways to construct Key Derivation Function:
- Counter Mode
- Feedback Mode
- Double-Pipeline Iteration Mode
For NIST, all these approaches are equally acceptable. The Feedback Mode matches HKDF's Expand phase. The Double-Pipeline Iteration Mode matches TLS 1.2 PRF. Thus we could assume, that TLS 1.2 PRF could be considered to be similar to HKDF's Expand phase if used with the same hash function underlying the hmac.
Purpose of HKDF's extract phase is quoted from RFC 5869:
<code>In many applications, the input keying material is not necessarily
distributed uniformly, and the attacker may have some partial
knowledge about it (for example, a Diffie-Hellman value computed by a
key exchange protocol) or even partial control of it (as in some
entropy-gathering applications).  Thus, the goal of the "extract"
stage is to "concentrate" the possibly dispersed entropy of the input
keying material into a short, but cryptographically strong,
pseudorandom key.  In some applications, the input may already be a
good pseudorandom key; in these cases, the "extract" stage is not
necessary, and the "expand" part can be used alone.
</code>
For applications where extract phase is beneficial (distribution of input keying material is not uniform), HKDF is certainly the way to go.
For other uses, where expand phase is used alone, any one of these two (or in some cases counter mode) from NIST SP 800-108 could be used. (Note: If you use TLS 1.2 PRF outside context of TLS protocol, maybe better define the function in terms of NIST SP 800-108, instead of TLS 1.2 PRF from the RFC).
Short summary:

If you need extract use HKDF.
If you need expand only, use functions from NIST SP 800-108.
Generally you should not use TLS 1.1 PRF except for compatibility with TLS protocol.
Comment: Note that the NIST SP 800-108 specs are more or less used to cover all secure KDF's that are allowed. I've created generic implementations of them and tested them against the test vectors. Those test vectors are not covering everything and are already multiple MB's for each KDF construction that is defined. Specifying the *practical* security level of NIST SP 800-108 is a moot point; there are too many variables. Heck, the KDF's don't even have official names let alone ASN.1 definitions or OID's.
Comment: So you can validate your implementation (say, HSM) to be FIPS compliant, but please don't try to find 2 vendors that implement exactly the same KDF :( Reporting this to NIST resulted in a clear "MEH" from NIST
Comment: @owlstead: I almost agree on your points. However, 2 vendors implementing exactly the same KDF are occasionally found, but this is a result of them implementing support for the same protocol(s) using KDFs. BTW, there are also some [CAVP unofficial KDF test vectors](http://csrc.nist.gov/groups/STM/cavp/#10) available from NIST, for a preliminary compliance check of implementation. Furthermore, if you have a product in being validated in CAVP (a part of FIPS 140-2), you get to choose a lot of options for KDF, to specifically pinpoint how to test your implementation.


show a video file

Question: I want to show a video file in my windows application.
Please help me with details.
Thanks.
Answer: you can install a Windows Media Player component and go:
player1.URL = @"filename.avi";
player1.Ctlcontrols.play();
Visit: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/53d1071b-26d9-406a-877c-3b33eedf8a4c/
Answer: You can use the Windows Media Player COM control to show video in your Windows app.  You'll first need to add the Windows Media Player control to your toolbox in Visual Studio, then drag the control to your Windows form in Design view.
In your code, you can then set the URL property of the control to whatever video you want to play, like so:
<code>// you may also use the full local path to the video, as opposed to a URL
axWindowsMediaPlayer1.URL = @"http://go.microsoft.com/fwlink/?LinkId=95772";
</code>
Source:  http://msdn.microsoft.com/en-us/library/bb383953%28VS.90%29.aspx
Answer: You can use MediaElement component in WPF. Easy and straight forward to use.

show a video file


modify page header and footer when printing in Chrome

Question: I checked for flags and extensions to no avail. According to this post, there seems to be no builtin option at the moment.
Answer: You can change the center header by changing the content of the <title> tag in the HTML source before printing (right click, choose inspect, expand the  tag, right click on the <title> tag and select "edit text"). The other header values cannot be changed, as the Google employee states in the post you linked in your question:

Currently there isn't a way to edit the header when printing a document. You can currently only turn the header and footer on or off which includes the date, name of the web page, the page URL and how many pages the document you're printing.

An alternative is to save the webpage as a PDF (without any headers or footers), and then manually add the headers and footers. I found this website that let you add headers and footers. Use it at your own risk. You might want to add custom margins when saving the webpage as PDF to avoid the footer and header overlaying with the webpage content. 0.5" as top and bottom margin seems to work. If you want to add headers and footers manually, you can look into the command line tool cpdf.
Comment: Yes, the answer also refers to Google Chrome. But since what you want is impossible (see the answer from the Google employee in the post you linked to in your question) I gave you some alternatives. I will remove the suggestion of using firefox. The last alternative only uses your file system in addition to Google Chrome. If that's not an option for you, I suggest making your own plugin.
Comment: The question clearly refers to Chrome/Chromium.
Comment: @1.61803 I updated my answer to more clearly answer your question.
Comment: The post I linked to is two years old and my question just tracks the lack of feature, flags, extensions one year ago. Thanks for the write-up, especially cpdf, but your workarounds are cumbersome.


$\mathbb{Q}$ is not open, is not closed, but is the countable union of closed sets.

Question: I want to prove that $\mathbb{Q}$ (the set of rational numbers) is not open, is not closed, but is the countable union of closed sets. I tried to show that $\mathbb{Q}$ doesn't contain all of its limit points which would imply not closed. However, I am not able to prove the other two things. I need little help to prove this. Thanks.
Answer: Since any neighborhood $(q - \epsilon,  q + \epsilon)$ of a rational $q$ contains irrationals, $\mathbb{Q}$ has
no internal points. This implies that $\mathbb{Q}$ is not open. Since every irrational number  is the limit of a sequence of rationals,  $\mathbb{Q}$ is not closed (for a set to be closed it should contain all of its limit points). Since every one-point-set $\{x\} \subset \mathbb{R}$ is closed, and since $\mathbb{Q}$ is countable, we have that
$$\mathbb{Q} = \bigcup_{p\in \mathbb{Q}} \{p\}$$
is a  countable union of closed sets.
Answer: $\Bbb Q$ is not closed because it is dense, and if a set is both dense and closed then it is equal to the whole space (in this case, $\Bbb R$).
$\Bbb Q$ is not open either because open sets are either empty, or contain an interval which makes them uncountable; but $\Bbb Q$ is countably infinite so it is neither empty nor uncountable.
Lastly $\Bbb Q$ is the countable union of singletons, all of which are closed.
Interestingly enough, $\Bbb Q$ cannot be written as an intersection of countably many open sets.
Comment: very interesting answer for me
Comment: @Asaf : your last observation is interesting.  Can you provide a reference or a proof sketch?
Comment: @Stefan: Equally we can prove that the irrationals are not the countable union of closed sets; and indeed if they were, then by Baire's category theorem at least one of the closed sets would have to have a non-empty interior and therefore it would contain a rational number.
Answer: Hint
$$r\in\mathbb{Q},\quad\forall \epsilon>0, (r-\epsilon,r+\epsilon)\not\subset\mathbb{Q}$$
$$x\in\mathbb{R}\setminus\mathbb{Q},\quad\forall \epsilon>0, (x-\epsilon,x+\epsilon)\not\subset\mathbb{R}\setminus\mathbb{Q}$$
$$\displaystyle\mathbb{Q}=\bigcup_{r\in\mathbb{Q}}\{r\}$$


Show that $\sum_{i=1}^{k/2} {{k}\choose i}2^i < 3^{k-1}$

Question: Show that $\sum_{i=1}^{k/2} {{k}\choose i}2^i < 3^{k-1}$ for $k\geq6$ and even. I tried using $(1+2)^k=\sum_{i=0}^k{{k}\choose{i}}2^i$, the first half has the same binomials as the second and larger powers of two. Also tried induction, but the step is proving that $\dfrac{\sum_{i=0}^{k/2+1}{k+2\choose i}2^i}{\sum_{i=0}^{k/2}{k\choose i}2^i}<9$.
Comment: @metamorphy - does your bound imply the OP's requested bound?  Perhaps I'm missing something but I don't see how your bound relates to the request bound (at least, not in an obvious way).
Comment: @metamorphy - I'm guessing the $\sqrt{8}$ comes from...  Stirling's approximation?    Actually, even though your observation does not answer the OP question directly, I am quite interested in (1) how you prove its correct, and (2) why the ratio $\to 1$, and (3) how the $\sqrt{8}$ comes about.  If you don't mind writing an answer, that'd be great.
Comment: @antkam: Done (removed my comments above as redundant now).
Answer: Here's an inductive approach. Let $a_n = \sum_{i \leq n} \binom{2n}{i} 2^i$ (including $i = 0$ for convenience). Then since $\binom{2n+2}{i} = \binom{2n}{i-2} + 2\binom{2n}{i-1} + \binom{2n}{i}$, we have
\begin{align*}
a_{n+1}
&= \sum_{i \leq n+1} \binom{2n+2}{i} 2^i \\
&= \sum_{i \leq n+1} \left(\binom{2n}{i-2} 2^i + \binom{2n}{i-1} 2^{i+1} + \binom{2n}{i} 2^i\right) \\
&= \sum_{i \leq n-1} \binom{2n}{i} 2^{i+2} + \sum_{i \leq n} \binom{2n}{i} 2^{i+2} + \sum_{i \leq n+1}\binom{2n}{i} 2^i \\
&= \left(4a_n - \binom{2n}{n}2^{n+2}\right) + 4a_n + \left(a_n + \binom{2n}{n+1} 2^{n+1}\right) \\
&< 9a_n
\end{align*}
where the last inequality holds because $\binom{2n}{n} > \binom{2n}{n+1}$. Then since $a_3 < 3^5$, by induction we have $a_n < 3^{2n-1}$ for all $n \geq 3$ (though there are better asymptotic bounds, e.g. $a_n \leq 2^n \sum_{i \leq n} \binom{2n}{i} \leq 8^n$).
Answer: UPDATED
OK, here is a proof using probability.  It requires pretty tedious accounting.
First re-write the desired inequality as (*) below:
$$\sum_{i=1}^{k/2} {{k}\choose i}(\frac13)^{k-i} (\frac23)^i < \frac13 \,\,\,\,\,\,\,\,\text{   .....(*)}$$
Now consider a "trinomial" experiment, with $k$ i.i.d. trials, and each trial result $\in \{a, b, c\}$ each with equal prob $\frac13$.  Define r.v.s $A, B, C$ as the number of occurrences of $a, b, c$ respectively.  Obviously we have $A+B+C=k$ and $E[A]=E[B]=E[C] = k/3$.
Then the LHS of (*) $= P(\frac{k}{2}\le A \le k-1) < P(A \ge {k\over 2})$.
Originally, I was thinking Markov's inequality would work, but as the OP author correctly pointed out, Markov's inequality gives $P(A \ge {k \over 2}) \le {E[A] \over {k/2}} = \frac23$ which is too big (too loose).

The main idea of the proof is that, $A \ge k/2$ implies $A$ is the max among $A, B, C$.  That would almost immediately give the $1/3$ bound (by symmetry), except for the case of $A$ being a joint max with $B$ or $C$ (e.g. $A=B=k/2, C=0$).  Dealing with that joint max case is where most of the tedious accounting comes in.
Define these events:

$U_A=$ the event that $A$ is the unique max among $A,B,C$, i.e. $A> \max(B,C)$
$U_B, U_C$ defined similarly
$U = U_A \cup U_B \cup U_C =$ event that there exists a unique max
$V = U^c=$ complement of $U$, i.e. the max is a joint max ($2$ or $3$-way tie)

By the law of total probability,
$$P(A \ge {k\over 2}) = \color{red}{P(A \ge {k\over 2} \mid U)} P(U) + \color{blue}{P(A\ge {k\over 2} \mid V)} P(V)$$

Claim 1 (the easy case): $\color{red}{P(A \ge {k\over 2} \mid U)} \le  \frac13$

Proof: conditioned on $U$, i.e. there being a unique max, then $A \ge {k \over 2}$ implies $A$ must be the unique max.  So
$$\color{red}{P(A \ge {k\over 2} \mid U)} \le P(U_A \mid U) = \frac13$$
where the last equality is by symmetry among $A,B,C$.

Claim 2 (the tedious case): $\color{blue}{P(A\ge {k\over 2} \mid V)} < \frac13$

Define these $6$ events, each being a subset of $V$ (when $k \ge 6$):

$E_{AB} = $ the event $(A = B = {k \over 2}, C=0)$
$E_{BC}, E_{CA}$ defined similarly

By symmetry, the number of sample points in these $3$ events are equal.  We will call it $e = |E_{AB}| = |E_{BC}| = |E_{CA}|$

$F_{AB} = $ the event $(A = B = {k\over 2} - 1, C = 2)$
$F_{BC}, F_{CA}$ defined similarly

By symmetry, the number of sample points in these $3$ events are equal.  We will call it $f = |F_{AB}| = |F_{BC}| = |F_{CA}|$

Note that, when conditioned on $V$, then $(A \ge k/2) = E_{AB} \cup E_{CA}$.
Also note that the $3$ $E$-events are disjoint, and they are also disjoint from any $F$-event.  So:
$$\color{blue}{P(A\ge {k\over 2} \mid V)} = {P(A\ge {k\over 2} \cap V) \over P(V)} = {P(E_{AB} \cup E_{CA}) \over P(V)} \le {e + e \over e + e + e + f} = {2e \over 3e + f}$$
For convenience write $k = 2m, m \ge 3$ (since it's given that $k\ge 6$ and is even), then

$e = {2m \choose m} = {(2m)! \over m! m!}$
$f = {2m \choose (m-1),(m-1),2} = {(2m)! \over (m-1)! (m-1)! 2!}$
${f \over e} = {m! m! \over (m-1)! (m-1)! 2!} = {m^2 \over 2} \ge \frac92 > 4 $ (when $m \ge 3$)

Therefore $f > 4e$ and ${2e \over 3e + f} < {2 \over 7} < \frac13$, completing the proof of Claim 2. QED
Main result now follows by combining Claim 1 & Claim 2:
$$\text{LHS of (*)} < P(A \ge k/2) \le \frac13 P(U) + \frac13 P(V) = \frac13$$
Comment: This is part of a homework, this inequality is not the original problem, but a sufficient condition. I tried your hint, lets perform an experiment with 3 possible outcomes $k$ times and let $X$ count how many times we obtain one specific outcome. Then the LHS is $P(X\geq \frac{k}{2}) \leq \frac{E[X]}{k/2}$ according to Markov's inequality, but if I did it right $E[X]=k/3$ and so $LHS \leq \frac{2}{3}$. Maybe I am still missing something
Comment: You are right (and I was wrong originally): Markov inequality is too weak.  Instead I now have a symmetry-based argument, but it involves pretty tedious accounting to deal with a special case.  :(
Answer: An overkill (perhaps), but one can get the true asymptotics from $$\sum_{k=0}^{n}\binom{2n}{k}a^{2n-k}(1-a)^k=n\binom{2n}{n}\int_0^a x^{n-1}(1-x)^n~dx$$ (obtained like I did here, or just using integration by parts). At $a=1/3$, this gives $$\sum_{k=0}^{n}\binom{2n}{k}2^k=n\binom{2n}{n}\int_0^1 y^{n-1}(3-y)^n~dy$$ (after substituting $x=y/3$). The integral is asymptotically $2^{n+1}/n$; in fact $$\int_0^1 y^{n-1}(3-y)^n~dy=\frac{2^n}{n}+\int_0^1 y^n(3-y)^{n-1}~dy\qquad\color{gray}{[\text{I.B.P.}]}\\=\frac{2^n}{n}\left[1+\frac{1}{2}\int_0^n\left(1-\frac{z}{n}\right)^n\left(1+\frac{z}{2n}\right)^{n-1}dz\right]\qquad\color{gray}{[y=1-z/n]}\\\leqslant\frac{2^n}{n}\left(1+\frac{1}{2}\int_0^\infty e^{-z}e^{z/2}~dz\right)=\frac{2^{n+1}}{n},$$ the inequality is asymptotically tight. Thus $\color{blue}{\sum_{k=0}^{n}\binom{2n}{k}2^k\leqslant\binom{2n}{n}2^{n+1}}\asymp 2^{3n+1}/\sqrt{n\pi}$.


When will the last total lunar eclipse happen?

Question: Since the moon is receding from earth, solar and lunar eclipses become more rare. Earth will receive the last solar eclipse in around a billion years, but at the same time the Earth will look smaller from the moon. When will the last lunar eclipse happen?
Comment: Most likely the last lunar eclipse will not be due to the current orbital effects.  The moon already moves far enough away to produce an annular eclipse, yet won't produce the last total eclipse for more thatn a billion years.  The Sun will swell large enough to disrupt the Earth's orbit in about 5 billion, so that will hapen first. The Sun's size would also have an effect on total vs partial eclipses.
Comment: Let's just assume that the sun's lifespan is increased, when would the last lunar eclipse happen?
Answer: Never, unfortunately.
Ignoring the Sun, the angular momentum of the Earth-Moon system is constant. As the tides slow down the Earth's rotation and increase the Earth-Moon distance, more and more angular momentum is transferred from the Earth's rotation to the Moon's orbit.
At present the angular momentum of the Earth's rotation is $7.2\times 10^{33} kg\, m^2\, s^{-1}$ and that of the Moon's orbit is $41\times 10^{33} kg\, m^2 \,s^{-1}$.
Let's over-estimate the final state of the Moon by assuming that all the Earth's angular momentum is transferred to it. That would increase the Moon's angular momentum from $41$ to $48.2$ in these units: a factor of about $1.175$.
The radius of an orbit is proportional to the square of the angular momentum. So the radius of the Moon's orbit will increase by less than 40%.
This reduces the width of the Earth's shadow at lunar distance - but given how wide the shadow is relative to the Moon, we will still have lunar eclipses, and decently long ones at that.
Answer: First off, the sun will completely throw off the orbits of the Earth and moon, if not obliterate them both. But, like you said in your last comment, we will expand the sun's lifetime with some magic.
The moon moves away 3.78 centimeters a year, and is already 384,000 kilometers away (or 238,855 miles). With a bit of research, I have figured out that Earth's umbra is 2.578 to 2.725 moon radii (2.652 average). If we multiply 384,000 km by 2.652 (because that's how much bigger the moon has to be in order to no longer produce a total lunar eclipse), we get an answer of 1,018,368 kilometers. Subtracting our answer with the moon's current distance gives us 634,368 km. This is how much further the moon has to move back in order for total lunar eclipses to be no longer possible (on average). Done with some simple division, if the moon moves back 3.78 cm a year, it will take approximately 16,782,222,222.2 years (16.782 billion years) for total lunar eclipses to be no longer possible on average.


Can Windows Server 2019 on EC2 run WSL 2

Question: I want to create a VM on EC2(Microsoft Windows Server 2019 Base - ami-0eaa025a752a23c5b) that can run windows container and linux container at the same time. I know WSL 2 can support docker container and run on windows 10 Build 18917. I am not sure if it is available to run on Windows Server 2019. If so, what build of the windows server 2019 should I use. Any help would be appreciated.
Comment: Though WSL2 is now only in Insider builds, you can install the insider build in a Hyper-V VM and enable nested virtualization.
Comment: WSL 2 is not a feature of Windows Server 2019.  Windows Server 2019 is built upon an earlier build.  A version of Windows Server that includes WSL 2 has not been released at this time
Answer: There are 2 issues with WSL 2 on Windows Server 2019 on EC2:
1) WSL 2 is available only in Insider builds at the moment. It is unlikely that it would be added into Windows Server 2019 at all, and there is no insider version for next LTSC Server. You can use use insider builds of semi-annual server for WSL 2, but it would be non trivial to install it on EC2
2) WSL 2 requires Hyper-V and Hyper-V  supported only on Bare Metal Instances of EC2.
So it is much easier to run linux and windows docker containers separately in aws.


How many people have become eligible to vote in the UK snap election on June 8th 2017 since the last general election?

Question: How many young voters are eligible to vote in the snap general election on June 8th called by Theresa May (if it goes ahead) since the last general election on 7th May, 2015? (or closest date possible)
I've been looking on the Electoral Commission website but I can't seem to find anything specific to eligibility, also the Home Office website regarding Citizenship and the Census for the UK (unfortunately from 2011 only) but I can't seem to piece the correct numbers to find a solid statistic.
Note: I'm looking for statistics on either people whom are registered to vote since the general election prior to today since May 7th, 2015 or generally those who are eligible regardless of registration, but since the last general election only.
Comment: You should also ask how many old voters have passed away since then.
Comment: You're effectively looking for the birth rate 18 years ago (assuming 18 is the legal voting age). Poke around whatever the UK's equivalent of a Census is.
Comment: And also add the number of naturalized citizens over 2015.
Comment: Thanks for the tips guys, I'll throw them up when I'm sat down at a computer.
Comment: @barrycarter Funnily enough, it's called the Census, sadly the last one took part in [2011](https://en.wikipedia.org/wiki/United_Kingdom_Census_2011) and the next one is in 2021. So that falls outside the date ranges to see the differences in the number of voters between elections
Comment: @Draken the US has a population clock https://www.census.gov/popclock/ that uses a model to determine population at a given time. Surely something like this exists for the UK. It'll be an estimate, but still. Also, birth records for 18 years ago perhaps?
Comment: @barrycarter The birth register would be the better port of call, for that it's better to look at the office of national statistics like [here](https://www.ons.gov.uk/peoplepopulationandcommunity/birthsdeathsandmarriages/livebirths/datasets/birthsummarytables). That doesn't have up to date data as they release it later. Their next scheduled release (For 2016's data) is July to August 2017. They should have something on deaths as well, but you must remember that although people are born in the UK, they may not be eligible to vote!
Comment: @Draken True. I don't think the OP's going to get anything close to a 100% accurate number, but perhaps an estimate. Although, I did think all UK born folks could vote-- citizenship different there?
Comment: @barrycarter, I'm not looking for anything with pinpoint accuracy, I just want a ball park figure (or close to something towards accurate). This is purely for my own curiosity more than anything.
Comment: @barrycarter [A little bit](https://en.wikipedia.org/wiki/British_nationality_law#British_citizenship_by_birth_in_the_United_Kingdom_or_a_qualified_British_Overseas_Territory). There's a whole list of caveats for some people
Answer: TLDR; Under several imperfect assumptions, there will be approximately 1.4 million voters (2.9% of the total) who can vote in the 2017 election, but couldn't vote in the 2015 election. Details below.

As noted in comments, the latest British Census is from 2011. Very roughly speaking (we'll clean it up later), people who were 12-13 in 2011 would've been 16-17 in 2015 (ineligible to vote) but 18-19 in 2017 (eligible to vote).
According to the Census (1, 2) we have:

12 year old males: 377620
13 year old males: 383672
12 year old females: 359875
13 year old females: 365950

for a total of 1,487,117 people.
However, even if this data were taken on May 7th, it would only include people turning 18 between May 7th 2015 and May 7th 2017. To adjust for the extra month, we multiply by 25/24 to get 1,549,080. Of course, that's just an approximation.
We can also say that, roughly speaking, about 2000 people turn 18 everyday in the United Kingdom.
According to Electoral Commission's provisional figured published ahead of the EU referendum there were 46,354,197 people "eligible and registered" to vote in the May 2015 referendum. However, this doesn't include people who were eligible but not registered.
Going back to the 2011 Census, we see there are 52,063,665 people who were 14 or older in 2011, and thus, roughly speaking, eligible to vote in May 2015.
Dividing 46,354,197/52,063,665 we see that, again roughly speaking, about 89% of people 18 or older were registered to vote in the May 2015 referendum.
If you accept the 89% rate applies to young voters, that gives us 1,379,202 new voters between the two elections, meaning new voters will make up about 2.9% of the vote, enough to swing a close election.
Disclaimers and minutiae:

Although I use precise numbers above, these are only estimates. For example, you should read "52,063,665" as "about 52 million".

I assume the voting age in Britain is consistently 18 and that age is the primary factor in determining whether otherwise eligible people can vote; if this is untrue, my numbers will be off by a bit.

Since I provide sources, you should check my work if you plan to use it for anything important.

Some people eligible to vote in the 2015 election have or will die before the 2017 election. You could probably find statistics to include them in the estimated voter count, but I didn't. Generally, the death rate is fairly small, since it roughly reflects the number of people born 70-80 years ago.

As noted in the comments, the UK's population includes people who are ineligible to vote. Additionally, the UK's electorate as defined above, excludes people who are eligible to vote but haven't registered to do so. There is some discussion on eligible-but-unregistered voters at:

Eligible Votes in 2016 (OT: the number 46,500,001 annoys me here-- there are also spreadsheet entries that end in 999999 -- seems odd).

December 2015 Electoral Register

I assume that women can vote in the UK, and that British age at the same rate as normal people.

Even though I use the phrase "British" above, I'm referring to the entire United Kingdom excluding Gibraltar, but including Northern Ireland.
Comment: The effort is highly impressive @barrycarter, I'll do the math and analyse the links but again, this seems like the closest I'm going to get. Interesting, especially considering 2.9% is higher than I anticipated. Cheers bud.
Answer: 2018 lastest est. figures as follows:
UK population 66040m
UK adult population over the age of 18 52413m
% eligible to vote: 92%: 48,219m
Research from https://ons.gov.uk
2nd Research: https://cia.gov
3rd Research: who.org
Comment: Welcome to Politics.SE! This question is from 2017, so I'm not sure that 2018 figures really apply.


Only Clipping part of a vector layer with QGIS

Question: What tool I would use if I just wanted to clip one area in a vector layer?  I want to be able to make the red line extent match the green border, without clipping out the rest of the red extent (which is off screen).
Answer: Setting:

With Line Layer --> Lines to Polygons:

With new Polygon from Lines AND Polygon --> Symetrical Difference

With Result of Symetrical Difference  --> Multipart to Singleparts

Delete Parts you want keep
You can although invert a selction to simplify the slection process.

With Result from Lines to Polygons and the Singlepart --> Difference

With Difference --> Polygons to Lines

Not a very smart solution, but if you need it just once than it works.
Another solution could although be to trace the line you want and merge it with your existing line or use polygons to line and extract the part you need, which is the best solution if you just want the oultines of your green polygon.


Setting textBox.Text doesn't update bound twoway property?

Question: Does it make sense that if the Text on a TextBox is databound to a property using the twoway mode and I set the Text to something, it should update the property? My property gets updated when I type inside the control, but not when I set the value in code.
Answer: I would say it makes no sense to modify a bound Text property directly.  Your code should be setting the other end of the binding and allowing the binding to update the control.
If the bound object is updated when the Text property is set then special case code would be needed to detect when such an assignent is the result of the bound object changing for other reasons.  Otherwise you would end up with an infinite loop.
Comment: The question comes from some work I'm doing with adding/removing databindings programatically. I'm finding that whenever I set a binding in code, it sets the property I'm bounding to and the textbox to empty strings. When I set the databinding again, I want the text inside the textbox to be set to the property and not the other way around. Why I am removing the databinding in the first place? Because the property gets continously updated and I don't want the textbox to change its text when its in focus.
Comment: Perhaps you should include these details perhaps with a little code in the question itself.
Answer: This is because it only commits the data when the textbox loses focus.  Here is a question that is somewhat related that eludes to this.
Answer: You shouldn't set the .Text value of the textbox... set the value of the property it's binding to. :)
I'd encourage you to read more about the Model-View-ViewModel method for designing your views.  It keeps a clear separation of concerns when doing this kind of work.  The reason you are seeing this "bug" regarding focus causing the binding to refresh is because most of the time this kind of thing is not appropriate.
Here's a pretty good video introduction to MVVM: MVVM on Channel 9


How to find out the index creation date in elasticsearch

Question: How to find out the index created date in elastic search?
Answer: Elasticsearch now automatically includes the creation date for an index, for
example:
If I create a new index (with no settings)
curl -XPOST 'localhost:9200/aoeu'
{"acknowledged":true}

I can now 'get' the index to retrieve its metadata:
curl -XGET 'localhost:9200/aoeu'
{
  "aoeu": {
    "aliases": {},
    "mappings": {},
    "settings": {
      "index": {
        "creation_date": "1429308615170",
        "number_of_replicas": "1",
        "number_of_shards": "5",
        "uuid": "C5sqwXClSFyd5uF3MSrVgg",
        "version": {
          "created": "1050199"
        }
      }
    },
    "warmers": {}
  }
}

You can see the creation_date field above.
Comment: You can paste this number in https://www.epochconverter.com/ to get a date quickly.
Answer:
curl -XGET localhost:9200/_cat/indices?h=i,creation.date.string

Above command will output index name (i) and creation date.
For more options you can try help as-

curl -XGET localhost:9200/_cat/indices?help
Answer: From the 1.4.0 version, documentation explains the following:
Index creation date

When an index is created, a timestamp is stored in the index metadata for the creation date. By default this it is automatically generated but it can also be specified using the creation_date parameter on the create index API

curl -XPUT localhost:9200/test -d '{
    "creation_date" : 1407751337000
}'

Answer: You need to change your mapping and add a timestamp
Comment: AFAIU It is not about document creation time, it is about index creation time.


How to pair up event participants?

Question: My event has a structure of all participants pairing up in study couples (2 or 3 people together).
I know I can create a relationship for each one, but I need to see the pairs very clearly in the event participant list.
How can I show the list of participants grouped by pairs, or even have each 2 (or more) coupled participants highlighted in different colors?
Answer: You can get somewhat close to your desired functionality by putting the contacts in a smart group and displaying them within the relationship report.

Use the advanced search to display all contacts within the event (by adjusting the search fields within ("Events").
Add all the contacts to a new smart group.
Create a new report to show relationships (Administer > CiviReport > Create new report from template > Relationship report).
In "Filters", set "Group" to your smart group.
Adjust other report settings as necessary.

But I suspect the end result will still not be 100% satisfying. Groups of three might not display well enough for you.
Comment: Great, thank you.
And now the only thing missing is to add to this report some custom fields that are related to the participants of the event. How can I do this? Because these fields do not appear in this report template's Columns options.
Answer: I would recommend creating a custom report for this. It will require some PHP coding, but will give you the level of control you seek.
Comment: If you need help creating a custom report, you can hire one of the [CiviCRM experts](https://civicrm.org/partners-contributors). My company [Left Join Labs](http://leftjoinlabs.com) is on that list and you can reach me at sean (at) leftjoinlabs (dot) com.

How to pair up event participants?


2008 Toyota Tacoma cabin air filter replacment

Question: What steps do I take to replace the cabin air filter on my 2008 Toyota Tacoma?
Answer: Open your glovebox and release the shock on the right side. While holding the door portion, push the middle of the back of the box away from you and pull the whole box down. There should be a 1" X 6-8" panel with tabs on both sides, the right, or top. Remove the panel and you can remove the filter. Be careful not to let leaves or debris fall below into the blower.
Answer: it will be located behind the glove box. Simple and straight forward.
Check this YouTube video for clear and detailed informations.


Attribute with pairs of values

Question: I'm creating a store where each product has one or more "contributors" and each contributor has a contributor type (composer, arranger, artist, author, or editor). So, for instance, there may be an item with three contributors: John Doe, composer; Bob Smith, arranger; Jane Adams, arranger. I can't figure out a good way to store this information using the standard attribute types. Can anyone suggest a solution or, at least, point me in a potential right direction?
Comment: Can you please specify requirement in some more details.
Comment: I name to store a person's name as a string and I need to store a corresponding type for that person. Each product will have one or more of these people. I could just create a bunch of text attributes called `contributor1`, `contributor2`, etc. and a bunch of multiselect attributes that are `contributor1_type`, `contributor2_type`, etc. But I was hoping to store all this information in a single attribute.
Answer: On magento 2 there is the manufacturer attribute which however is a single string.
What you need should be a multiselect with attached source model so as to select one or more matches. Here the link
https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-multiselect.html
Cheers

Attribute with pairs of values


MC-Cordova-Plugin with hybrid remote

Question: We are trying to implement Marketing Cloud Mobile Push in our hybrid remote app. We have installed the MC-Cordova-Plugin. Included the generated js file into the remote visualforce page but calling the methods has no effect. Is it possible to have Mobile Push work with hybrid remote apps?
Answer: There are a few things I don't understand about your environment yet. I don't know what you're doing in the "remote visualforce page" nor do I know what platforms you are trying to support. I'm assuming you are downloading and installing the latest plugin from the public repo https://github.com/salesforce-marketingcloud/MC-Cordova-Plugin. That being said your best bet is to understand what is going on in the "CLI Workflow" section of our docs.
This section assumes that you have an existing app set-up with notifications, provisioned and turned on with bundleid set, etc; Those steps are commented to help give a bit of an understanding as to why we are copying your original project files, backing them up and then replacing the auto-generated ones created with the Cordova prepare command later. It does sound like you're integrating into an existing app. I'm also assuming the generated JS file you are referring to is our "MCCordovaPlugin.js" file correct?

What platforms are you supporting?
Have you been able to execute any of the build commands like "cordova plugin add", "cordova prepare"?
What do you mean by your question... "Is it possible to have Mobile Push work with hybrid remote apps?" The Cordova repo is a hybrid platform and does support mobile push SDK. At least the features supported in the ReadMe.

If you are in need of more in-depth support or a walkthrough, if you could contact your SF support rep, we would be happy to get you where you need to be.
Comment: The remote visualforce page is an empty page exposed through community from which we are trying to use the methods provided by the plugin. Ex: setContactKey so it registers with mobile push. We have downloaded the latest MC-Cordova plugin and added to our project following the CLI workflow already. Notifications are currently working when pushed from salesforce using the default plugin but the goal here is to push from Mobile push. We are looking to support iOS and Android but we are testing in iOS now.
Comment: We will try to contact SF support rep now, are you part of Mobile Push support? do you need us to refer your name or dept? Thanks.
Comment: Yes... that would be great. I'm part of the Marketing Cloud SDK team. Would be glad to help.

MC-Cordova-Plugin with hybrid remote


Which sharepoint exam is the best to begin: 70-488 or 70-489?

Question: Which sharepoint exam is the best to begin: 70-488 or 70-489 ? And which one is the easy one?
Answer: You can reference to this page for the full SharePoint developer certification path: here.
As you can see 488 is the basic exam and 489 is the advanced one, so (hopefully) you need to take them in that order.
Also notice that if you want the MCSD certification you will have to take the other two exams.

(screen taken as of 03/07/2014)
Comment: @CameronVerhelst I had forgot the most important thing of all.... The [mighty freehand circle](http://meta.stackexchange.com/a/19775/171199).
Comment: +1 For including a nice picture :).
Comment: (had the question open from 2 hours and didn't see the new answer posted prompt. I will leave this here for now).
Comment: Haha, I didn't realise it was an actual meme until now, thx for that!
Comment: I took the 489 exam first, it was perhaps the hardest MS certification exam I have ever taken.
Answer: 488 is the core one and 489 the advanced one, so you should normally start with 488 that is the easier cert.
I have passed both.
More information about 70-488: https://www.microsoft.com/learning/en-us/exam.aspx?id=70-488
and 70-489: https://www.microsoft.com/learning/en-us/exam.aspx?id=70-489
Comment: can you point reference material for 488 please. Like the Microsoft MVA, etc?
Comment: https://www.microsoft.com/learning/en-us/exam.aspx?id=70-488


Start to/of the day

Question: Can we use

A perfect start to a day

or

A perfect start of the day

Please explain me properly
Answer: Grammatically, "a perfect start of the day" makes sense. And without the word "perfect", it would usually be the best choice, as in "at the start of the day".
But there is an established idiom for phrases like "a good start to" when describing some period of time or event, where the adjective good can be replaced with many other adjectives describing value quality: great, perfect, excellent, bad, poor, disappointing, etc.
Since probably most English speakers are used to this idiom, it will be better to say "a perfect start to the day".
(Interestingly, it looks a century or more ago, "a good start of" was more common than "a good start to", but "a good start to" has been steadily becoming more frequent: see the Google ngram comparison.)
Answer: There is a slight difference in emphasis:
Start of the Day: This phrase emphasizes the very beginning of the day, right when a new day begins, often associated with midnight or early morning. It's about marking the transition from one day to the next on the calendar.
Example: "I like to wake up at the start of the day to watch the sunrise."
Start to the Day: This phrase emphasizes the early hours and activities that set the tone for the rest of the day. It's about the initial phase of the day, encompassing morning routines, breakfast, and the first tasks or events after waking up.
Example: "A healthy breakfast is essential for a good start to the day."

Start to/of the day