Server 2016 login issue

Question: I have a strange issue occurring with a Windows Server 2016 Standard.
Usual DC roles, DNS, DHCP, AD
When trying to log into the console, as soon as your press control/alt/del combo, screen goes sky blue like it is trying to log in but immediately returns to initial screen. Happens in safe mode and DSRM as well.
RDP into the server using Remote Desktop and supplying the credentials looks like it is working but then exhibits the same behaviour. (Screen flashes light blue, then goes black and the session is disconnected).
OTher remote features seem ok, I can remotely control using powershell, and remote registry but trying to get event viewer remotely throws rpc errors.
I have checked system event viewer through powershell but cannot see anything obvious. Any help would be appreciated.
Comment: Update: remote event viewer is now ok
Answer: Situation is now resolved. SFC /scannow initially found nothing wrong (using ps-remoteing) second run found faults, fixed them and am now able to log back into console

Server 2016 login issue


Can split second be used to block damage prevention effects?

Question: My friend plays a stupid amount of prevent all damage instants. If I attack, and use something with split second, can he still use his prevent all damage? Or with split second ending the stack, is he unable to do anything except block?
Comment: Split second is very handy against somebody who plays a lot of counter spells
Answer: No.
Note the text of split second:

Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)

Split second only prevents casting spells and activating abilities while the split-second spell itself is on the stack. This means no player may take an action in between casting the spells and resolution. After that spell resolves, however, you'll still pass priority around normally (meaning your friend now gets to play other spells or abilities) before going on to the next part of the turn.
If you want to prevent your opponent from casting spells, you'll need countermagic or a Silence effect. Try Grand Abolisher if you want to keep your opponent from messing with your attack phase.
Alternatively, you can play cards that cancel out the effects of his spells — e.g. Skull Crack or Leyline of Punishment against damage-prevention effects.
Comment: Re "This means no player may take an action in between casting the spells and resolution", note that Triggered Abilities can still be added to the stack, and Special Actions can still be performed.
Comment: Alright figured it would be too good to be true. I guess ill have to sideboard some skull cracks to deal with it. With 12 prevent all damage, (fog, darkness, and holy day) ill only need one strong attack. Thanks for the info!
Answer: Split second only prevents casting spells and activating abilities while the split-second spell itself is on the stack.
If you were to cast a split-second spell after blockers are declared, he wouldn't be able to respond to it with his instant. But as soon as your split-second spell resolves, both players are again given the chance to cast a spell. He could cast his then.


Use $variable from file1.php in file2.php (different file paths)

Question: I have $variable_1 = '5'; in /public/includes/themes/theme-section-users-score.php and I want to use its value in another php file with a different location /plugins/name/other/users-time.php , I tried using include_once , require_once and others but I can't, might be the .htaccess doesn't allow me? please help, thanks in advance.
Comment: Is the value hardcoded?  What if you want to change the value? If it's hard coded, then you could very easily just write the value out in both the theme and the plugin, but if it's not going to be hard coded then that means you'll be writing it to the database, so instead of pulling the variable across why not just check the database when you need it?
Comment: the value is variable its not hard coded, tell me how its easier, from DB or from another file
Comment: If you're obtaining the variable value in one file use the same method to obtain that variable in the other file, that way neither is dependent on the other. How do you get the variable in the theme file?
Answer: Store the value is a function or make it global;
function get_variable_1(){

    return 5;

}

OR
global $variable_1;
$variable_1 = 5;

But.. really, what you need to do it to read a bit more about the basic of PHP to understand how variables and functions work - global variables are not really a good idea and neither are functions which single return values with accepting arguments.. so you need to plan your PHP application to use both concepts correctly.
Comment: with global variable i cannot access it from a plugin file to a theme php file...
Comment: You need to declare new variables as global - and then you also need to use the global keywork to bring the variable into the scope of your function again - but, global variables are not a great solution.. WordPress uses them a lot, but -- oddly -- that's not because it's the best way to do things..


Washer Does Not Drain Water Before First Spin Cycle Begins

Question: My Maytag Atlantis 2005 washer begins the first spin cycle as soon as the first wash cycle ends. So, the spinning starts with a full load of soapy water. Isn't it supposed to drain all the way down before the first spin cycle starts?
Comment: yes, it's supposed to drain first. does it wait between cycles for a period of time where the drain pump should be running, or does it go instantly from one to the next?
Comment: It seems to have started this only recently. I don't think it's correct operation to begin the spin cycle with a full load of water.
Answer: Is it draining at all, but just not fully? Does it eventually pump the water out, or is the water just sitting there at the same level no matter what?
Washing machines have a pump under the tub that pumps the dirty water out. These pumps often have a little mesh filter in front of them, sometimes there's also a filter on the outlet where the drain hose connects on the back of the machine. If these screens get plugged, the pump will be very slow and may not have enough time to clear the water out between cycles. So, if the pump seems to be pumping, just not quickly enough, check for these filters and/or check the pump itself for obstruction.
If the pump isn't turning on at all and the machine is just sitting full of water, google your machine for a troubleshooting diagram or parts diagram. Often, the pump circuit will have sensors or switches in it, that prevent the pump from turning on unless certain conditions are met. For instance, some machines will not turn the pump on unless they can detect that the lid is latched shut. Other times there will be a water level sensor or other sensor that the pump relies on. Troubleshooting guides provided by manufacturers (or just detailed troubleshooting info on appliance repair forums or blogs) will usually point these out and tell you how to check them.


Semi-supervised learning algorithms creating redundant data

Question: If I'm generating pseudo-labels that I'm confident are correct for my dataset due to high confidence scores or something else, how can I expect that the new data I'm labeling won't be redundant? To my knowledge, if a datapoint is labeled automatically, unless novel data is generated like in this paper I don't see how the data that can be labeled will be particularly useful, as it will admit no new patterns to learn from, as otherwise the data wouldn't be labeled with a high confidence. Is the point here to make sure the labeled dataset you start with is sufficiently large that it covers all the kinds of patterns you expect from the data for the model to need to be able to identify?
Answer: If you are confident that your pseudo-labels are correct, then you can expect that the new data you label will not be redundant. however, If you want to avoid having redundant data in your labeled dataset, then you need to make sure that it is large enough to cover all the relevant patterns.
One way to avoid creating redundant data when using data augmentation is to use a technique called transfer learning. This involves training a model on one dataset and then transferring the learned knowledge to another related dataset. This can be done by fine-tuning the model on the new dataset or by using the model to extract features from the new dataset that can be used to train a new model. Transfer learning can be used to reduce the amount of data needed to train a new model, and can also improve the performance of the new model.


IVsDropdownBarClient and GetEntryText: Problems with text buffers

Question: In my Visual Studio extension, I'm going to read the text that is in the navigation bar. Therefore I listen to window created events and from the IVsCodeWindow object I get the IVsDropdownBar to get the current selection in the dropdown bar. This works fine. Then I'm using the following code snippet to extract the text of the current selection:
 string text;
 barClient.GetEntryText(MembersDropdown, curSelection, out text);
 if (hr == VSConstants.S_OK)
 {
    Debug.WriteLine("Text: " + text);
 } else  {
    Debug.WriteLine("No text found!");
 }

However, this does not work. My extension crashes with an unhandled exception in the second line of the code snippet. I read the documentation and could find the following note:

The text buffer returned in ppszText is typically created by the
  IVsDropdownBarClient object and the buffer must persist for the life
  of the IVsDropdownBarClient object. If you are implementing this
  interface in managed code and you need to have the string disposed of
  by the caller, implement the IVsCoTaskMemFreeMyStrings interface on
  the IVsDropdownBarClient interface.

I assume that this is part of my problem, but I can't really understand what I have to change in my code to get it working. Any hints?
Answer: I'm pretty sure now that the Visual Studio SDK Interop DLLs have the wrong marshalling information for IVsDropDownbarClient.GetEntryText and that there's no way to call that method using that interface.
The best workaround I've found so far is:

Use the tlbimp tool to generate an alternate Interop DLL for textmgr. (You can safely ignore the dozens of warnings including the one about GetTextEntry.)
tlbimp "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VSSDK\VisualStudioIntegration\Common\Inc\textmgr.tlb"
(Optional) If you're using source control, you'll probably want to copy the resulting file (TextManagerInternal.dll) to a subdirectory of your extension project and check it in as an external dependency.
In your Visual Studio extension project, add a reference to the file (TextManagerInternal.dll).
Add the following method that should properly handle the string marshalling.
static public string HackHackGetEntryText(IVsDropdownBarClient client, int iCombo, int iIndex)
{
    TextManagerInternal.IVsDropdownBarClient hackHackClient = (TextManagerInternal.IVsDropdownBarClient) client;

    string szText = null;
    IntPtr ppszText = IntPtr.Zero;

    try
    {
        ppszText = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(IntPtr)));
        if(ppszText == IntPtr.Zero)
            throw new Exception("Unable to allocate memory for IVsDropDownBarClient.GetTextEntry string marshalling.");

        hackHackClient.GetEntryText(iCombo, iIndex, ppszText);

        IntPtr pszText = Marshal.ReadIntPtr(ppszText);

        szText = Marshal.PtrToStringUni(pszText);
    }
    finally
    {
        if(ppszText != IntPtr.Zero)
            Marshal.FreeCoTaskMem(ppszText);
    }

    return szText;
}

}


If we say A is weaker than B by a factor of x, then should x be smaller or bigger than 1?

Question: In math, we always need to derive different algorithms to get a tighter error bound. It may be correct almost surely that: the error bound of B is better than that of A by a factor x (x is bigger than 1). However, I am not sure if it is right to say:  the error bound of A is weaker than that of B by a factor x (x is samller than 1)?
Comment: There is no defined relationship between strength and size.
Comment: Based on the answer you selected, it looks like this was a math problem and not an English language problem. Am I correct?
Answer: If B is better than A by a factor of x, then A is weaker than B by a factor of x.
Not only is it correct, but it is equivalent to this statement:
If B == A * x, then A == B / x
There should be no restriction on x though. No need to say (x bigger than 1) or (x smaller than 1). Whatever x is in one statement, it should be the same in the other.
Take the starting statement: B is better than A by a factor of x. What "better" means can be confusing since it is unique to your exact problem, so I'll just use the value (rather than the algorithm) of B and compare that with the value of A.
Now we have: B > A by a factor of X.
The phrase "by a factor of, means when either increasing or decreasing a value by multiplying it by some factor. Since we are measuring how "good" an algorithm is, we aren't just comparing two numbers on the normal scale.
If we have a logarithmic scale (base 10) where 5 is the worst an algorithm can perform, and 8 is the best an algorithm can perform, then the values 6 is better than the value 5 by a factor of 10. Similarly, 5 is worse than 6 by a factor of 10.
Below I provide links and show details about how to find this equation, but in this section I'll only solve it.
If we have some initial value, i, and we increase it by a factor of some unknown, x, and we end at some final value, f, we can solve for the factor:
(f / i) == f

If we had decreased i by a factor of x and ended at f, we could solve for the factor like this:
(f / i) == (1 / f)

See the inverse relationship?
We can use this to show that A is weaker than B by a factor of X.
Initial value = A
Final value   = B
Factor        = X

(A / B) = X

(B / A) = 1 / X

So to get the factor, when we increase A by a factor of X to get to B, we find the factor is X. And if we decrease by a factor, i.e. go from B to A, we take the inverse and see the factor is 1/X.
If we give X a number, let's say 5, we can see the property in action:
(A / B) = 5
  => A = 5B

(B / A) = (1 / 5)
  => B = 1/5A

You can plug in either value of A or B into the other equation to see they are both true.

The usage of saying that some value is decreased by a factor of some value isn't too common in pure mathematics (excluding grammar school math), but you do see it in branches like economics and physics.
See the definition of factor according to the Cambridge Dictionary's listing:

a number or variable (= letter or symbol) that is being multiplied in a product (= result of multiplying):

According to this definition, a factor is simply some number or variable being multiplied to another.

We can use the definition of "factor" to see how the following examples make sense:

Suppose you invested $100, and after a time, your investment was worth $300. The final value ($300) would be three (3) times the initial value. We would say that your investment had increased by a factor of 3.
On the other hand, if you made a poor investment, and the value decreased from $100 to $25, then the final value would be a quarter (1/4) of the initial value. We would say the investment had decreased by a factor of 4.

This short article goes on to show how the final value divided by the initial value is equal to the factor when increasing a value by a factor. It also shows the factor is the reciprocal of that value when decreasing by a factor.
Answer: Whatever the common usage may be, "decreased by a factor of" is confusing, and should be deprecated. Rather say decreased to (state the fraction here) of instead: decreased to a quarter of, for example.
One of the reasons the decreased by usage is bad, is that it's used to mean what it shouldn't. If you say decreased by a factor of 4, then what factor of 4 are you talking about - 1, 2, 4? B is not decreased by a factor of the decrease, the factor you're talking about has to be a factor of B!
Do you mean you end up with what you started with, less 1/4, or 1/4 of what you started with? In the first case, starting with 100, you end up with 75; in the second, with 25.
This is not all. It leads to something like rainfall has decreased by 200%, which means we must somehow be giving rain back. Starting with 100mm, for example, we now have -100mm.
Journalists tend to use this style a lot, which just proves that innumeracy is part of their job description.
Comment: +1 Frank, I think you had some really notable points that *needed* to be said. I completely agree that the usage of "decreased by a factor of" should be deprecated, ***especially*** outside of the colloquial of mathematics. However, I did feel that from reading your post it seemed as though there was absolutely no common practice or understanding of the phrase, even within mathematics. I disagree with that particular point. I think that in mathematics (and **only** mathematics), there is an agreed practice for the usage of the phrase. See my answer for what that exact usage is.
Comment: Thank you, Matthew. All through my answer, I'm referring to common usage. Mathematicians know what they're talking about: if they didn't, it wouldn't be mathematics!
Answer: My intuition is that you use the number bigger than 1, and Googling bears me out.
Answer: if B = A*x and A weaker than B then x should be greater than 1.
Example :
First one:
A = 2; x = 5;// (x>1)
B = 2*5 = 10; //A weaker than B
Second one:
A = 2; x = 0.8;// (x<1)
B = 2*0.8 = 1.6; //B weaker than A


How can I know the best number of features to use?

Question: I noticed that developing ml models a very important step in feature engineering is adding new features that can explain better the target variable.
Recently I experienced a situation where by adding some features the model's performance improved, while adding five more features the performance worsened.
So, my question is: is the feature engineering process more an experimentation phase where I need to try different scalers, features and encoding methods?
If I am wrong please let me know.
Answer: I would recomend reading (Feature Engineering and Selection: A Practical Approach for Predictive Models).
Intuitively, I would say that adding relevant and informative features to a model can help it capture more patterns in the data, leading to improved performance. For example, in a classification problem, adding features that are strongly correlated (and not by chance) with the target variable can increase the accuracy of the model. If you get to explain a significant portion of the variance in the target variable, you get to improve the model's predictive power.
However, adding irrelevant or redundant features can lead to a decrease in performance. This is because such features can introduce noise (obscuring the underlying pattern) and complexity to the model (making variables adjust one another), making it harder to learn the underlying patterns in the data. Additionally, if the added features are highly correlated with existing features, it can lead to multicollinearity, which can also reduce the model's accuracy. You can see the coefficients of a logistic regression, they get huge when they are collinear.
I would add that the number of variables will depend on the amount of data you have for each of the states of the predictor variables you are using. You can delve further into this by reading about what Frank Harrel has written about the limiting sample size.


Dishwasher fault when directly wired but not when on an extension cord

Question: My dishwasher which is on a spur from the kitchen ring after some minutes will trip the main switch on the CU. However running the dishwasher on the ring from an extension plug works fine. The wiring in the sockets seems fine. How can I check the spur cable if that is where the problem lies as it seems it must
Comment: Stack exchange is a global site, he used appropriate terms for his country. CU=[consumer unit](https://en.wikipedia.org/wiki/Consumer_unit) (what we'd call a "service panel", "breaker panel", "distribution panel" (among other names) in the USA), "ring" is a [ring circuit](https://en.wikipedia.org/wiki/Ring_circuit), which is not used in USA residential wiring as far as I know.
Comment: What is a "ring"? What is a "main switch on the CU"? Please don't use abbreviations.
Answer: Just guessing from the information you provided:
If there is a partial ground in your dishwasher wiring it can draw enough current to trip the breaker.
When you run it through the extension cord it adds enough resistance to limit the current so it doesn't trip the breaker.
I would suspect if it is an older machine the motor is leaking current through the insulation on the windings.
It may be time for a new one but double check the wiring just in case.
Good luck!
Comment: This... i'm thinking the extra resistance is in the ground wire, because the extension cord doesn't connect the ground wire very well.   Which is just awesome because now instead of faulting to ground, it's putting 230v on the chassis of the machine.  I would measure voltage between chassis and a known solid ground (while using the dodgy cord).  You might also measure current between chassis and good ground, however that will probably trip your GFCI, er, I mean RCD.


Immediate differences between 1898-2018

Question: I have a story where two characters from 1898 apear in the Texas hillcounrty, on a disused ranch. Neither are familiar with ranches, and they come from vastly different socioeconomic backgrounds. What would be the first things they would immediately notice as different, and what would take the longest for them to comprehend?
Comment: You say they come from vastly different socioeconomic backgrounds, but don't say what they are, how old they are, educational background, etc (all of which are vital to answering your question).  For example, a well-educated rich girl from the East Coast who's been riding horses for 15 years will be less unfamiliar with the disused ranch than a black guy from Compton or South Chicago.
Comment: @CortAmmon ranches are most definitely **not** farms.
Comment: @RonJohn I think that the OP wants to know about obviously modern technology that you would find on a modern Texas ranch, without getting into details of how ranching is done differently than it was back then (unless the difference is the presence of modern technology)
Comment: Man, what hasn't changed in farming?  They still use seeds, right?  Seems a bit backwards with all the technology these days, but I think they're still seeds.
Comment: @ArcanistLupus it can't be that OP is looking for differences between modern and old ranches, since "*Neither are familiar with ranches*".  There's nothing for them to compare.
Comment: @RonJohn Yes, that's what I said.  (Or at least what I meant to say.)
Comment: What kind of ranch, a mom and pop ranch or a large corporate ranch, also what animal are they ranching, someone from the 1800's might be startled by the giant bideal birds being ranched for instance.
Comment: Beside being a plot point, there is no way to objectively answer this question.
Answer: "Disused" is incredibly broad, and their backgrounds are undefined. This makes this question harder to answer completely, but there are quite a few things that are incredibly different from 120 years prior.
I'm going to focus on the ranch house, since that's where the easiest differences will be. On the exterior, it might look a little weird - I don't remember what shingles looked like in the late 1800s, but they might not even notice that. They might think the home looks weird but I doubt they'd really think anything past "Oh, this house looks weird." I would expect the driveway would be gravel, and I doubt there would be a garage. If it does have a garage, it would be a weird room with a weird door.
Once they step inside, however, things are going to be super obvious, really quickly. I'm going to assume everything in the ranch house is from no earlier than the 1950s. While I doubt it would sit disused for that long, there's a lot of things that stay just fine. And who knows, maybe the last person to live here liked antiques.
Furniture would look funny. Most of it wouldn't be "This is from the future" but it would look weird.
Light fixtures would be a lot different. Standing lamps might look the same, but things like ceiling fans and other ceiling lights have changed a lot in the past 50 years, let alone 120. I'm going to assume they know what electric lighting is, but even bulbs from the 1900s are vastly different than those from the 50s, different from the 90s or modern ones. If the house has flourescent lighting, then things are very different.
The Kitchen will be the most obvious things. So many things made out of metal. A fridge, if it had ancient moldy food in it, would be fairly straightforward as to what it did (stored food), even maybe they could guess it was some sort of ice box. But why would it look so funny and be made out of metal?
Additionally, something like a dishwasher would be completely alien, and a stove from anytime in the past 70 years would be vastly different than what they used. Again, they might be able to infer the purpose of the stove, but not necessarily how it worked.
If the house is more recent, something like a television would confound them. There's literally nothing like it that they could compare it to. Same goes for even a radio from the 50s. In this case, the age of the TV doesn't really affect much. If it's from the 50s, it'll confuse them just the same as if it's a brand new flatscreen - Although the plastic from the flatscreen might weird them out.
Oh, right! Plastic! - Plastic wasn't really commonly available (I think it existed but I'm not sure), but they probably have never encountered it. They would have no idea what the material is.
If the house has old heating, the radiators would look pretty similar to what they had, and they might be able to figure out what the furnace does. Maybe. If the house had a water heater, it would be an alien metal cylinder to them. Similarly, a washer and dryer would be weird metal boxes with things.
To their comfort, a bedroom would probably look just like a bedroom. The style might be different, but aside from weird things in a bedroom (I have my computer in mine, that'd be a treat), it would at least be familiar.
If there are bycycles somewhere in or around the house, those too would be identifiable. They may or may not have flat tires, but if I remember correctly, late 1800s bikes had rubber tires and I think if there was a hand pump they could figure it out if they were familiar with it. Remember, the Wright brothers were bycycle repairmen, which was a significant thing for some time.
I'm excluding the potential for a vehicle, but any vehicle made since the 1900s would be completely alien to them. The late 1890s was when automobiles really started to become a thing, so they would have to be really familiar with an obscure thing to have even a glimpse as to what it is.
A different take
Honestly, I think they'd have a better knowledge of time passing if the ranch house had antiques in it. My personal opinion is that the easiest way for them to tell that they've traveled forward would be with books. An old library, with old books in it, would be the perfect method of telling age.
Why?
Well, it's easy to tell that a book is old. It feels different. It looks diiferent. So they could see many books that are obviously old. And then, someone sees one they are familiar with. They open it. And pretty much every book printed from mid-1800s on has a copyright/printing date in the first few pages. The newer books in the library would have later dates, and would look and feel newer - Not to mention book binding has changed over the past 120 years. There's also the option to dedications. A lot of books given as gifts have notes inside them, and some of those have dates written in them. "To Mary, with love. Christmas 1912."
Comment: There was a family in Siberia that went ~40 years without seeing another human, from the 1930's to the 1970's.  When finally rediscovered by the rest of the world, the thing that surprised them the most was clear plastic wrap.  They were thrilled how it was "like glass that crinkles".
Comment: You also have newspapers, magazines and tv guides. TV guides are unknown, magazines and newspapers have their issue date on front page.
Comment: I remember reading about them. They had noticed the satellites in the sky, and things like planes, too. I think the characters in this setting would notice those things eventually, but not immediately.
Answer: The Rural Electrification Act was in 1936.  Before that, a lot of rural areas had no electricity at all.  So while there was electricity in 1898, if your characters are from the Texas hillcountry or other rural areas, electric wires and poles would be very very strange to them.  Even if they were from cities, seeing wires along roads and over to the house would be odd and probably the first thing they'd notice as different.
The hardest thing I think would be plastic.  So many things in our modern homes are plastic.  Coatings on wires (not just in the walls but also on electric cords for lamps and such), flooring (vinyl!), window frames, countertops, toilet seats (after they got over the shock of a toilet...in a house, depending on their experiences), dishware, kitchen tools, handles and trim on appliances, and much more.
Plastic is hard or soft, breaks or tears easily, yet is often very durable.  It's not wood or metal or ceramic.  It behaves in completely unpredictable and unique ways.  But at first they wouldn't realize it was a new material.  There may have been prototypes of plastic in 1898 but Bakelite (the first plastic) wasn't invented until 1907.  And even if there were some plastics that they immediately knew were not of their time (like plastic wrap as others have written), they wouldn't connect it with other plastics like countertops or vinyl flooring.
Answer: Contrails
The very first thing they'll notice, and the one that will take them the longest to comprehend? Definitely the fact that there are mechanical beasts that roam the skies, leaving behind perfectly straight clouds from horizon to horizon. Such sorcery is inconceivable at the end of the 19th century, and many people today still don't understand exactly how planes work. They could appear in the middle of a 50km2 field with nothing else in sight, and would only need to look up to notice them.

Immediate differences between 1898-2018


Problem with raster calculator gdal_calc.py

Question: I have two rasters. One with the following values: 0,1,2,3,4,5,6,7,8,9,10
and the other one with continuous values ranging from 0 to 10000. I would like to create a raster where only values of the second raster will be kept when the first raster has values from 4 to 6. How could I do this using gdal_calc.py?
I tried:
gdal_calc.py -A first_raster.tif -B second_raster.tif --outfile=Result.tif --calc="B*(3<=A>=7)" --NoDataValue=0

But I get a Value Error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Is that the correct way to introduce this condition in to the raster calculator?
I thought that follows the same logic than the raster calculator used in QGIS, where the value in the ouput we want goes together with the * simbol and the condition goes in parenthesis.
Answer: I believe gdal_calc.py doesn't cope well with combined relations such as (3<=A>=7). It might be better to split it up:
--calc="B*logical_and(3 <= A, A >= 7)"

Comment: AND is not a thing. You mean `logical_and(3 <= A, A >= 7)`


UISplitview - not from the appdelegate

Question: I am trying to do an IPad app that needs to use UISPlitview. I have found a lot of examples of how to do this but they all come from the starting point of using the AppDelegate. Does anyone have a sample where it is used in the view pushed from a previous view?
Answer: In my searches for answers to basic splitviewcontroller questions I have come across your question.  It is a little old now but I thought I would provide an answer for the next person that finds the question in the forum.
If I understand your question you have views and at some stage through user selection you would like to display a splitview on the window, is this correct?
You really have to understand the theory of a splitviewcontroller and also the wishes of Apple on that theory.  When you understand this you will know that what you want to do is not really (or at least at the beginning of 3.2) what Apple would like.  The Splitview should be the rootview of your app. Thus always there and not pushed or added later.
Now if you google long enough you will find examples where people have worked around this. Look at for example "Splitview in tabbarcontroller".  But there are others.
As for a nice tutorial or example on this, I have not seen one but there are lots of forum questions and answers of workarounds of doing this.

UISplitview - not from the appdelegate


What's the main difference between Atomic Swap and Bisq?

Question: I do not know if this can be a monero-related question. I have the following one:
what's the main difference (or the differences) between Atomic Swap and Bisq? Bisq seems a P2P market that connects buyer and seller, while Atomic swap integrates directly into blockchain.
Answer: First one needs to disnguish between a marketplace (where makers / takers advertise trades) and how a trade is to be executed (the exchange protocol for a trade).
Bisq is a P2P marketplace which also defines an exchange protocol. There is no centralized entity involved in advertising trades (for makers or takers). When it comes to executing a trade, if there's a dispute, an arbitrator (a 3rd party) gets involved. It's akin to meeting someone in a public place to swap USD for GBP and asking a random stranger to observe (to help in case of a dispute).
An atomic swap is only an exchange protocol (any marketplace is separate). This exchange protocol is a mechanism to convert one cryptocurrency for another without needing a 3rd party arbitrator in the case of a dispute. This is because the swap occurs using a contract derived from the respective blockchains. In other words, the swap only completes if both participants actually pay each other the agreed upon amounts.


java serialization - persist class definition

Question: I have learned a bit on Serialization in java . My basic understanding is it is a mechanism to persist the state of an object and write it to streams so that we can inflate and use it at any latter point in time or in any other "JVM" where the object was not created .
Now suppose if I have a class A and create an instance of the class A i.e. object a , serialize it and store it in a file "A.ser" . I copy the file to other system and deserialize the file "A.ser" to obtain the persisted state of the object a . But in that case the class definition of A should be present in the other system where I deserialize the object ! Is there any way we can save even the class definition and transport it to the other system , so that the other JVM does not have any idea of what class A is until we deserialize the file obtain the class definition and reconstruct the class over there ?
Answer: What you describe is a ClassLoader. To be able to load class A in a JVM that doesn't have A in its classpath, you need to use a ClassLoader to load the class (and its dependencies).
The ObjectInputSTream would then have to delegate to the custom class loader to resolve its classes.
See the last post in https://forums.oracle.com/forums/thread.jspa?threadID=1149865 for an example that does that. Spring also has such an ObjectInputStream.
Answer: Lets consider that for de-serialization you dont need the classes. But what will you do with that after de-serialization as you can't execute the object with out class definition?
Thats the reason why de-serialization throws ClassNotFoundException when it can't find the class definition. You can distribute your class definition as a jar.
Answer: Not with serialization, you would have to store the class files in separate and also evaluate dependencies and bundle them too.
So, you would have to serialize the object, find it's .class file, detect dependent classes, find their .class files too and on and on until you have resolved all dependencies are resolved.
As you might imagine, this is not a simple task, so send this stuff with your classes jar file and be done with it.
Answer: One idea is to have the receiving system download the class definition from a remote registry. You'll have to get the name of the class using reflection. Just a guess, I've never tried it.


Can I mention my undergrad ranking in CV, when there is no official document about it?

Question: Our university doesn't announce any rank and it is not present in our transcripts but I know that my rank is 7 out of 60 in my department. Can I mention this rank? Since I dont have any proof of my rank I am not sure if I can mention it or not.
Comment: How do you know your rank if the university doesn't announce it?
Answer: If you can't prove it, I wouldn't put it in your C.V.
For one, anyone reviewing your application will have no way of knowing if you're lying or telling the truth. That's never a feeling you want a reviewer to have.
Even more importantly: what if you were actually wrong? What if you were 8 out of 60? Or 6 out of 60? I trust that when you say you're 7 out of 60, you have a pretty good idea of that, but you can't be sure if your school doesn't issue an official rank.
For what it's worth, if your GPA is high enough, I doubt rank will matter much. #7 is great, but #7 out of 60 students is different than #7 out of 600 students or 6000 students. For that reason, the rank itself is less valuable than your actual GPA.
Answer: You may want to say Top X% of the department or Top 10 or Top 20 rather than #8. I never really found this ranking to be all that useful because your previous work/experience and GPA are self-explanatory. These ranks are not gonna matter. If you go to a more competitive college, your rank could've been lower. Remember, you are competing with others from other universities, so how you rank against everyone else is far more important than how you rank against your peers.


What is a Figure of Merit in statistics?

Question: Papers published on the arXiv often mention the notion of Figure of Merit (FOM). Can you explain what a Figure of Merit is, how it is used and what are its relations to statistics?
Answer: One of the earliest references to Figure of Merit (FOM) in statistics is:

H.G. Balian and N.W.Eddy. Figure-of-merit (FOM), an improved criterion
over the normalize chi-squared test for assessing goodness-of-fit of
gamma-ray spectral peaks. Nuclear Instruments
and Methods, 145:389–395, 1977

The goodness of fit of the equation to the data is expressed by FOM which is defined as follows:
$$
FOM = \frac{\sum_{i=1}^n|y_i^{expt}-y_i^{fit}|}{\sum_{i=1}^n|y_i^{expt}|},\space\space  i = 1...n
$$
where $y_i^{expt}$ is experimental data, $y_i^{fit}$ is fitted data, $n$ is a number of measurements.
FOM is quite extensively used in spectrography to fit the spectrum curves. Fitting spectra (optical, X-ray, gamma and so on) with the usual least square minimization is a quite subjective procedure: you need not only to fit but as well to analyze residuals, account for different spectra shapes, variations in experimental techniques or control noises. The authors feel (and practice shows) that FOM reduce this subjectivity and it is less influenced by experimental techniques and applications. Basically if $FOM < 0.025$ it's a good fit.


How can i add all videos from youtube playlist as post?

Question: I want to add 200 videos from YouTube playlist to my WordPress blog. Each video iframe add as each post to particular category. I searched many plugins but that's not meet my requirement.
Answer: Two steps:

Fetch the playlist XML. Use that as import file.
Write a custom importer. Look at the native WXR importer to see how that works. Should be very similar.
Answer: The Youtube playlist have a xml strema, RSS feed.
You can parse this and create post via wp_insert_post() and add as content the URL to the video. Publish this and you have wich each new video from the playlist a new post.
The best way is, that you write a custom plugin. But you can aslo use a auto publisher plugin for feeds.


Can I use Bitcoin to recieve funds from Egypt

Question: I am owed about £7000 from a friend in Egypt but we are having a very difficult time transferring the money to my UK bank account, as the money is in UKP (sterling) WU and moneygram only accept USD, the banks want a government signed contract between us, and paypal is new in Egypt and will not accept debit cards or his new visa card so he cannot sign up to these services, so my question is, is bitcoin a way that we could transfer the funds directly to me and will I be able to convert the bitcoins to Sterling, and how much will this cost? many thanks to all that reply
Tony
Comment: I am from Egypt and banks in Egypt does not  require a signed contract.  I highly doubt that and sounds strange to me. Check the bank yourself or tell me its name to check for you. Also Paypal will not refuse debit or credit card. I was using an online visa card issued in Egypt with no problem at all with Paypal.
You can create a bitcoin address and sure your friend can convert the money in bitcoins and send to your address, latter you can change that to any currency you want.
Answer: Yes it is possible.
Steps.
1) Find a bitcoin seller in Egypt.
2) Buy Bitcoins in Egypt. Your Friend must provide a bitcoin address to receive the bitcoins.
3) You provide a bitcoin address to your friend where he sends the bitcoins.
4) You find someone willing to buy bitcoins with sterling in your location.
5) Sell your bitcoins and receive Sterling.
You both will need a bitcoin wallet. And a way to contact with a bitcoin seller/exchange.
You can do the exchange in person (ie, LocalBitcoins) or directly to your UK bank account using a service like Coinbase.


Stored procedure problem in MS Access caused by ReturnsRecords (accdb)

Question: I have a relatively simply stored procedure that runs an insert, and then attempts to return the last inserted ID. This is done so I can the ID via SCOPE_IDENTITY(). This was working great for me. But then, I got reports that on some machines, the stored proc would cause duplicate results.
After investigating it, I found that the cause was the use of the property ReturnsRecords. When true, it will run a query twice! For a select; who cares. For this case though, it is causing duplicates in my database.
Setting ReturnsRecords to false gets rid of the problem, but then it defeats the purpose of the stored proc (I absolutely must get the proper last inserted ID for the record)!
My question is simply this: How would I go about inserting this record and getting the ID of the new record, while getting around this problem?
Additional Info:

I am currently using DAO
I have tried the ADO.Command method, but it is
very error prone and doesn't seem to
work with output parameters for me.
I am using the stored proc solely for the purpose of retaining scope. I do not have my heart set on using a stored proc. I simply need a reliable way to get the id of the last inserted row.
This is an ACCDB
This is happening in access 2007
my DB backend is MSSQL Server 2008

Any help or insight is appreciated.
Answer: One of your parameters in the procedure can be set to output. Still don't return any rows, but set the value of that parameter to Scope_Identity()
<code>create proc ReturnTheNewID
  @NewValue int
  , @ReturnNewID int output
as

set nocount on

insert ....

set @ReturnNewID = Scope_identity()
</code>
Comment: This is how it currently works, except when i try using output parameters, I get multistep OLE-DB errors. how would i go about retrieving the output value?
Comment: create another parameter but set its type to output.


In the Linux Terminal, is there a difference between "bash foo.sh" and "./foo.sh"

Question: When executing a bash script in the Linux Terminal, is there a difference between "bash foo.sh" and "./foo.sh"?  Or are they just two different ways of performing the same function?
Comment: Assuming the shebang line for `foo.sh` is pointing to `bash` they'd be the same thing, oh, and assuming you have the execute permission on `foo.sh` which is not required for `bash foo.sh` but is for `./foo.sh`
Answer: They are likely equivalent if ./foo.sh

is executable, and
begins with with #!/bin/bash (or equivalent)

Otherwise, and given the precondition you describe (foo.sh is a bash script), the ./foo.sh version may well fail, either because it doesn't have execute permission for the user, or because it is interpreted by /bin/sh instead of /bin/bash (/bin/sh is the default script interpreter).
Answer: In addition to Tobys answer I want to point out that one should check existing shebang bash params in the script (like #!/bin/bash -e) before calling just 'bash foo.sh'. Calling a script via 'bash foo.sh' will not care about existing bash params in the shebang.
Answer: People already explained here but in simple words bash foo.sh mean foo.sh will be executed in bash shell.

It is just a way to tell the kernel to which shell script  will be use to run the script with making any changes in script.


What kind of features does each node have as an input graph to a graph neural network?

Question: What kind of features does each node have as an input graph to a graph neural network? For example, we want to do image classification with GNN, what are the features of each pixel? Or if anyone could send me a link to implementing GNN on an example I would greatly appreciate it.
Answer: Applying GNNs to images can be realized in different ways. If you only substitute a visual ConvNet by a GNN, then the pixel values would be the same as what goes into a ConvNet. The only difference will be the input format. Whereas a ConvNet gets inputs of shape [batch, height, width, channels], a GNN would receive a list of pixels [batch, n_pixels, channels] together with an adjacency list that contains the structural information (Each pixel may have 8 neighbors and a selfloop except for the pixels at the boarders).
So basically the features doesn't change, what changes is the format of the data. For a clean library of GNNs you can checkout DeepGraphLibrary, they have tutorials on how to use their library. If you want to see a simplified standalone implementation, you can checkout this code. His repository also contains more nice implementations.
Comment: Thanks! helped a lot


When should I use Genetic Algorithms as opposed to Particle Swarm Optimization?

Question: For which problems are Genetic Algorithms more suitable than Particle Swarm Optimization, and vice-versa? Are there any guidelines?
Answer: These kind of questions cannot be answered without looking at a particular project. Each algorithm has its particular strengths and weaknesses; and trade-offs in terms of use of resources (processing power and/or storage space, for example). If there was an objective answer, then the worse algorithm would surely fall in disuse.
It also depends what you mean by "better". Faster? Better score according to some evaluation measure? More robust (ie works with many diverse data sets)?
I would recommend looking at both algorithms in more detail, and trying to understand how they work. Then you should be able to find out which best fits your problem.
However, one problem with Particle Swarm Optimisation is that it is not well understood, so you might have to resort to trial-and-error.
Comment: This should have been a comment (for the most part). You should have encouraged the asker to change his question to something like: when should I use genetic algorithms as opposed to PSO?
Comment: In order to save the original post (not sure if it is a good idea), I've reformulated the question, so that it's more "acceptable". You may want to review this answer to reflect those changes, as the question "when to use one over the other?" may be useful to some people. You may also consider the deletion of this answer, as it only partially addresses the current answer now (and, as I had said in a previous comment, this should probably have been a comment).
Answer: The paper Comparison between genetic algorithms and particle swarm optimization (1998, by Eberhart and Shi) does not really answer the question of when to use one over the other (this may be an open question), but at least it provides a comparison of how the methods work and what could affect their performance (i.e. which parameters or operators they use, and what the typical values are), so it may be worth reading it.


what is all this buzz around SharePoint

Question: I am an ASP.NET developer. I have many friends working with sharepoint. What I don't really understand is why do companies requre always a customized solution? Who are the usual clients for a sharepoint website and some examples of the requirements that they need
Comment: Ryan, this is quite a broad question. Per the [FAQ](http://sharepoint.stackexchange.com/faq#dontask), we allow questions that can be definitively answered. Maybe if you have a specific scenario in mind? Alternatively, feel free to discuss this in our [chat](http://chat.stackexchange.com/rooms/411/sharepoint).
Answer: Sharepoint at it's core is about Content Management.  Storage, management and retrieval of documents over the intranet/extranet/internet/whatever.
But that statement alone is a gross understatement of it's true capabilities.  People going into SharePoint typically have needs revolving around document management, but also:
1) Collaboration (revolving around the documents and elsewise)
2) Business intelligence (reporting on facts often found in these documents)
3) Project Management
etc, etc...

It's helpful to go to the Microsoft website, read a lot of their material and even build a demo machine yourself...
Answer: Because, put simply, SharePoint is a platform, and you can't get far without customising it.
Answer: SharePoint is a platform which one can do many great things, it fulfills close to 80% of the business needs (shared calendars, document libraries, approvals, versioning, etc) out of the box and 20% being fulfilled by customization, whether using Visual Studio or SharePoint Designer.

what is all this buzz around SharePoint


How to install package from Ubuntu install DVD?

Question: i recently installed Ubuntu 17.04. Iam new to Ubuntu, used Windows before. I tried to make my mouse act like it did in Windows. Unfortunately even the fastest setting of mousespeed was too slow for me, so i found this tip:
"Upgraded" 16.04 to 17.04 Now unable to change mouse speed
(all other solutions i could find did also not help)
it did not help in making the mouse speed faster, but after rebooting Ubuntu i am now left without mouse and keyboard. Both are disabled. Both are generic USB devices.
I suppose if i reinstall the package "xserver-xorg-input-libinput" iam fine.
However, i tried booting into recovery mode and installing the package which fails.
In recovery mode menu, when i select "network" to enable network to download and install the package, it fails with some messages:

grep: /etc/resolv.conf: File or Folder not found
Trying to start NetworkManager ...
Unknown Group "power" in message bus configuration file
grep: /etc/resolv.conf: File or Folder not found

Methods from here i could find about how to enable internet in recovery console, also failed.
Now iam looking for a way to install the package from the ubuntu install DVD.
Looking forward to your advice.
Stefan
UPDATE:
Although this is not a solution to my question about how to add packages from install-dvd, i found a solution about how to enable networking in recovery mode: get into root consle, enter the following lines:

mount -o remount,rw /
dhclient enp3s0
echo "nameserver 220.127.116.11" | sudo tee /etc/resolv.conf > /dev/null

if you cant find out your ethernet interface's name(enp3s0 above), try iwconfig (ifconfig is not installed by default)
After these steps i was able to reinstall the package i deleted, using apt-get install. Mouse and Keyboard are working again :)
Answer: Find the package on your DVD (or online), and then use:
<code>sudo dpkg -i packagename.deb
</code>


Laptop touchpad is not breaking blocks in Minecraft

Question: My control is set to left-click. But I've noticed with my Asus X55C laptop touchpad, when I left click it doesn't punch/mine/hit 9/10 times. This is only with Minecraft and it's not just one version or mod because it's on all of the versions modded and unmodded.
Comment: try and rebind it to a keypress or plug in a mouse, touchpads are notoriously bad at handling game input.
Comment: left click needs to be held to break blocks, or rebind it to a key
Comment: Your laptop may not register clicks, even when you leave your finger on the touchpad, as a held click.  It would probably be best to do as @Rapitor suggests and do a keybind.  That was the only solution while playing on my macbook.
Answer: It's a Palmcheck, I would imagine. I have had the same problem. Except I couldn't even move my head.
If you have synaptics touchpad driver (most laptops do)

Open system tray, click the Synaptics icon, and click pointing device properties.
Select the device settings tab.
Select your tracpad device, and press reset devices.

Do not close out of this window, but try breaking blocks again at this point. If this did not work, then it's probably palmcheck.

Select your device again, and click settings. Go to Palmcheck enhanced, and slide palmcheck all the way down, to off. If you don't have synaptics, consider referring to this article.
Answer: I have an Asus laptop as well, and one thing I notice that helps in minecraft with clicking with the touchpad is double-tapping and holding on the second tap.
Answer: You can do a little test to see if it is a part of Minecraft that handles the controls or if it is just your laptop acting weird. First set the control that is "spazzing out" to a key on the keyboard, go to options, controls, click on the control which is activated when mouse button one is clicked. (called mine or slash ore something like that). Set it to a mouse button. Press this button ingame and check if it still does that.
So now you are left with 2 options: ether it still does that or it does not.. lets call theme option 1 and option 2 for the sake of easily navigating trough this answer.
Back up your .minecraft folder and lose minecraft
Option 1. if it still does it just set it back to the mouse button and navigate to your .minecraft folder in roaming. type %appdata% in the windows explorer. then go to this path:

.minecraft\libraries\org\lwjgl\

Delete all the files in that folder, then connect to the internet. Launch Minecraft.
Option 2. If that does not work the only thing I can come up with getting another input device (mouse) and connecting it to make it work.
You might still try the LWJGL thing from option 1.


Chinese citizen/passport making connection flight in Zurich

Question: If I hold a Chinese passport, but I have a green card USA and I am landing in Zurich and staying at the airport for my connecting flight to Beijing, do I need a visa?
Comment: @Gagravarr Not an exact duplicate. The linked answer posses the question, "If you can stay in the international area ("transit airside")..." and point out that in some German airports you cannot do so. Thus the above question could be rewritten as, "Can one transit international flights in Zurich airport without leaving the internationality section of the airport?"
Answer: Chinese citizens can transit through Zurich airport without leaving the international transit area of the airport,(1) without a visa.(2)
The transit area in Zurich has reasonable facilities(3) including a transit hotel(4) should you be making a long transit or overnight transit.
Comment: Care to add a few references?
Comment: The last paragraph and the websites it's based on are incorrect: Holding a green card does not afford any right to enter Switzerland or the rest of the Schengen area without a visa if you aren't already allowed to do it based on your citizenship.
Comment: @Relaxed There are a large number of websites that state the same as I wrote. Your assertion is based on what?
Comment: @Rincewind42 The Schengen [Visa Code](http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02009R0810-20131018) and [Borders Code](http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02006R0562-20131126). Note in particular that article 3 of the Visa Code mentions the Green Card rule *for airport transit* but that there is nothing like that anywhere else, and in particular nothing in article 5 of the Borders Code (which is the legal basis for the obligation to hold a visa to enter).
Comment: I also invite you to check the websites of a few consulates or foreign ministries from EU countries. Their quality varies but I would be surprised if any of them mention something like this. I think it's simply the result of a confusion between the rules that apply for airport transit and the regular entry rules as the difference is easy to overlook.


How can I make Coda auto indent between function brackets?

Question: I've been trying out Coda for the Mac.  I really like it, except for one thing.  It does no auto indention between brackets.  I'm use to having other editors I use to automatically close brackets and tab indent for me.  Does anyone know how to make it do this?  I really want to love Coda, but to me, this is a deal breaker if I can't get it to do this.
Answer: Download TEA for Coda from here. Once installed you can use cmd+shift+enter which will move to next line and indent. Hope this helps.
(TEA is no longer maintained but is still very robust in my experience)


How to get content type by name using JSOM?

Question: Trying to look up a content by name in order to load the CT's fields. Is there a way to avoid getting all the fields and then iterating and comparing the name to the one I'm looking for (shown here)?
Comment: The body of your question and your question title are asking two different things. Are you trying to get a field by name or trying to get a content type by name?
Answer: To get the content type fields from a list you have to get Id from a title and make a second call to get the fields using ID coming from the first call.

Get the content type id from a list using content type name
site url/_api/web/Lists/getByTitle('list title')/ContentTypes?$filter=Name eq 'content type name'

Get Content type is from the StringId variable
Make a second call to get conent type fields
site url/_api/web/Lists/getByTitle('list title')/ContentTypes('content type id')/Fields

Answer: If you already know the ID of the content type you want to access and the name of the field you want to access, then you do not need to iterate over either the content types in the list or the fields associated with the content type.
For example:
 var context = new SP.ClientContext();
 var listTitle = "Example List",
     contentTypeId = "0x0100ABC8ABF94519804BBFB5AFAB12683F5F",
     fieldName = "Title";
 var field = context.get_web().get_lists().getByTitle(listTitle)
     .get_contentTypes().getById(contentTypeId)
     .get_fields().getByInternalNameOrTitle(fieldName);
 context.load(field);
 context.executeQueryAsync(
     function(){
         alert("Field Name: "+field.get_title()+
             "\nInternal Name:"+field.get_internalName()+
             "\nID: "+field.get_id());
     },
     function(sender,args){
         alert(args.get_message());
     }
 );

If you don't know the Content Type ID, and only know it's name, you'll need to retrieve all of the content types from the list and check their names to find the one you want, as demonstrated in Amal Hashim's answer.
Once you have the content type object, you can invoke .get_fields().getByInternalNameOrTitle(fieldname) as in my example code above to select a particular field.


Why use a reference volume for leak testing?

Question: An accepted method of leak testing a test piece is by using a differential measurement between it and a reference such as in the schematic here - why might one bother doing this as opposed to just comparing your test piece alone to a predefined or recorded leak rate, or curve?
Comment: I would imagine for the sake of speed and accuracy, especially for large vessels/pipes.  Using some of the "classic" methods like pressure decay, vacuum decay or hydrostatic tests can take forever with a really small leak or a large volume (large pressure vessel or long pipeline) and also gets progressively less accurate the larger the volume/vessel tested.
Comment: @gwyn good point, I think being able to get more accurate and precise decay rates by doing it differentially rather than just a gauge measurement  is probably the main reason in reality
Answer: Pressures change in a vessel based on ambient conditions.  The reference volume removes that source of error.


How can I detect if my website is opened inside a Trusted Web Actvity?

Question: I'm opening my page inside a Trusted Web Activity and I want to detect when it's being opened inside it to customize behaviour and for analytics purposes. How can I detect that the page is being opened from the TWA?
Answer: There are three options that will help detecting if the page is being opened from inside a Trusted Web Activity:

When opening the page, the Referral will be android-app://<twa.package.name>, where twa.package.name is the package name used on the Android side of the Trusted Web Activity. In JavaScript, check if the users is in the Trusted Web Activity:

document.referrer.includes('android-app://<twa.package.name>')

Adding an URL parameter. Append a query string to the end of the URL that is launched with the PWA. There's more information in the Passing Information into a Trusted Web Activity using Query Parameters article.

Request Headers: you can now set custom request headers when the origin is verified against the app. This article explains how do do it. This approach is not yet supported by all browsers though.
Comment: FYI, There is some drawbacks on 1., if the user sets his Android Phone's default browser to others, i.e. Brave, document.referrer will return empty. In the end query parameter was used instead.
Comment: NOTE that the first method is **not reliable** and you should not use it.
Comment: Why isn't the first method reliable? The only caveat is that the referrer will be set when loading the first page. When an internal navigation happens, referrals from the web app will be set accordingly. A script like the following can use to save the information across page loads https://gist.github.com/andreban/550f34ed19cc3d7f51d0f95bd246a1a6
Answer: As andreban stated I used:
document.referrer.includes('android-app://')

which returns true if it comes from TWA.
Comment: Checking for`android-app://` is not enough and will give you wrong results. You should include the package name as part of the check, other wise **any** android app opening your page inside a regular browser or a Custom Tab will be identified as coming from the Trusted Web Activity.
Comment: please not that, the document.referrer will be empty if you call window.location.reload()
Comment: @DedeHamzah One thing that helps is using sessionStorage to save if this line ever evaluated to true. Then even a reload wouldn't clear it.
Comment: Does it work on Chromebook?


How can I change the Glossed app icon?

Question: Before iOS 7 on the iPhone, there was an option in settings to turn off the gloss on apps, how can I do so on iOS 7?
Comment: I'm not aware of a feature in iOS 6 that allowed you to do this?
Comment: Could you please show a screenshot of the control that allowed you to do this in iOS6? Maybe we are misunderstanding you.
Comment: Are you talking about development? Or actually using iOS 7 on your iPhone?
Comment: Actually using iOS 7, I want to remove the gloss on some of the apps.
Answer: If you're talking about the icons on your home screen, as a user there is no option to remove the gloss. This is a developer feature. As a developer you uploaded a raw icon and (by default) apple would add the gloss. You could turn this off if you wanted to add your own gloss (to add your own other effects), or if you just didn't want the gloss at all.
I've noticed that since going to iOS7, that MOST of the apps that had gloss, no longer do have gloss, but the occasional one does. This is obviously because the developer chose to add the gloss themselves and set the flag to have apple NOT add it. In this case, apple can't remove it.
Seems like apple thought ahead in this regard and it was simply a matter of turning this off to remove all glossed effects to match their new iOS.
However, in the case that any developer added it manually, there will be no way for you to remove it short of changing the icon which just isn't possible.

How can I change the Glossed app icon?


Consul template, consul and HaProxy setup with springboot applications in docker containers

Question: Can someone tell me how to configure HaProxy config and consul-template to fill the config file automatically? How do we configure consul-template? How do the HaProxy config file and consul-template communicate? Any examples available would help a lot.
Answer: I hope this HAProxy blog post will help you:
https://www.haproxy.com/blog/building-a-service-mesh-with-haproxy-and-consul/


Going off balance and not making an attempt to hit during serve in squash. Is it a fault?

Question: In squash, after throwing the ball in the air, the serving player becomes off balance and makes no attempt to strike the ball. Is this a fault?
Answer: As per section 4.3 under the rules of service in squash as laid out by US Squash, the serve is not counted as a fault if the server makes no attempt to strike the ball.

4.3 To serve, a player shall release the ball from either a hand or the racket and then strike it. Should the player make no attempt to strike it after that release, the player shall release the ball again for that service.


Why not use PKCE for backend apps, too?

Question: For SPA/frontend apps, you should be using PKCE these days for OAuth flow. But the backend apps have this additional complexity of having to have a secret key and use that key to talk to the token endpoint. Why not just use PKCE on the backend, too?
Answer: Having PKCE for confidential clients is a good idea. The draft for OAuth 2.1 requires PKCE for all clients.
In the summary the first bullet point reads:

PKCE is required for all OAuth clients using the authorization code flow

Having a confidential client is still relevant, as you can make sure, that only authenticated clients can get access tokens.
If you have a public client with PKCE an attacker can get access tokens from the Authorization server by impersonating a client. (In that case the attacker just needs to randomly create a code verifier and the corresponding challenge, then create an authorization request and handle the response and token request himself).
Comment: I see. If the logic requires knowing if it is really the client who is contacting the resource server. But I somehow never assume that because I cannot have that assumption on the frontend, so if the frontend already is able to talk to the API with PKCE, why not also the backend.
Comment: Interesting. I didn't know about OAuth 2.1 and PKCE in there. But the attacker would have to intercept the redirect to be able to impersonate a client. Without controlling the target domain this is not easily possible, especially if TLS is used, too.
Comment: No, impersonating a public client is really simple. You just create an authorization request (containing the client id) and send it to the authorization server. Then you do whatever you need to do to allow an authorization (logging in, clicking ok, stuff like that).
You then block the authorization response from reaching the client (it's your browser, you can do that). Then you manually do a token request (with the client_id, but without credentials as it's a public client). Then you have a valid access token.
You can't impersonate another user. But you've successfully impersonated a client.
Comment: I'm talking about a client in the sense of OAuth, you probably mean impersonating the web application that is registered at the Authorization Server as a client.
Answer: (This is a best guess as I am not a OAuth expert nor user).
RFC7636 created PKCE to incapacitate attackers with access to both client source code and relevant client communications. This is for example the case of some mobile applications which cannot ship secrets directly to the client device and cannot prevent other applications on the same device from sniffing the OAuth callback.
On most servers there isn't this kind of risk, as one can directly deploy secrets in a secure manner. On those servers PKCE would create unnecessary complexity. Complexity would both create new security risks and would divert resources which would be better spent mitigating more applicable security risks.
See also this YouTube video explaining the difference between confidential and public clients.
Comment: I understand the history, but I do not see what is the complexity on the server side you are talking about. I mean, having the same code/logic on frontend and backend is better, makes overall complexity smaller, and also you do not have to worry about secrets management.
Comment: @Mitar you'd still worry about server secrets management, as your server would have to authenticate to the OAuth authentication server before he can use PKCE. Moreover if the OAuth Resource Owner can access other resources, a compromised server would have greater impact.
Comment: Why would the server have to authenticate? It would do exactly the same flow as the frontend does, so no secrets? It would just temporary have to store the PKCE state. So if I register a public client with the OAuth authentication server, but do the flow from the backend side. The server would not know that.
Comment: @Mitar I suggest to describe your use case in detail within the initial question.

Why not use PKCE for backend apps, too?


Multiple error info emails to admin if query fails using debug_backtrace()

Question: My application is used by 5000 people. Its a medium sized application. I am using a class which takes care of my queries like escaping variables, doing the clean up, etc. I have a function in the class which is responsible for executing queries. So all the queries from any page needs to call this function execute the query.
<code>function runQuery() {
    //prepare and other lines here

    //execute
    $run = $query->execute($args);

    if(!$run) {
       //debug_backtrace() and mail the admin
    }

}
</code>
Everything is working fine. One of the page in my application is "Work" and usually most of the employees are in this page all the time. The only problem is if 100 users are accessing the application, and if something goes wrong with one of the query, i get 100 mails about the same error. I need only 1 email. How can i manage this ? I am worried if a 1000 users are accessing together, my outlook will go mad. The probability of triggering an error is less but still, i want to catch them.
Answer: Their is no way you can achieve this. Your mail function is in the wrong location. One solution is You can use filters in your outlook and block emails which repeat.


Where to find all camp sites available in an area or city?

Question: As a traveler, sometimes I want to stay in a camp site, rather than in a hotel, motel or hostel. But sometimes it is very difficult to find this camp sites in the web.
Is there any website or app that show all the camp sites available in an area? For example: Camp sites in Yosemite National Park.
I acknowledge that there are federal websites but not a private one.
Comment: That's a bit too broad, care to narrow it down to an area in particular ?
Comment: I thought worldwide! But it would ok if something in Europe or USA
Comment: Have you tried using Google Maps - going to the area you want and searching for "camping" or "camp sites"?
Comment: Yes, and it works. But you have to try one by one, their own website (if they have any). I am looking something like booking.com  including campings.
Answer: I don't think you will find something as universal as Trivago, Skyscanner, Kayak for campsites but your friendly neighborhood Google can yield some results that will let you book at least some of the sites online:

Reserve America
HipCamp
Recreation.gov - For US National Park Service sites.

There is probably more but you should be able to find them on your own.
Answer: This is super old, I know, but I came here looking for the same question. Several tabs (and years!) later, I found a few others:

Explorely aggregates all of those listed earlier and some of those below - it's a bit like kayak.com for outdoor travel
Campspot.com has what looks like a few thousand listings that are using their booking system
Spot2Nite pulls in booking info and is a bit like Expedia (they are also appearing on Reserve America)
The Dyrt is pulling in a bunch of different sites and has their own listings as well
Comment: Nice. Do you know if Explorely is USA-only? It says "Our vision is to help every traveller to explore the world", but every non-USA location I've tried so far just says "Ooops! No results found"
Comment: Ahhh, it looks like it Explorely is very new and in a beta state currently. The [blog](https://www.splitmedia.ca/blog/) is full of placeholders, Instagram link goes nowhere, there's a lot of UI bugs (inconsistent filter state between the sidebar and header bars, sidebar overhangs the footer, there's HTML error content in blog post URLs...), and if I try a very popular non-US location like Lake Bled, I get a number like "6 results" in the top header but the "Ooops! No results found" on the main content. Hopefully they can get it all working
Comment: I'm in the US so it worked for me. I guess it isn't really like a true Kayak.com. I know there is Campsited.com in Europe, but I don't know if they have results in Slovenia. It looks like it might be more Western Europe.


persistent cart login step

Question: In the persistent cart steps, customer is sent to the login page to re-enter the login information. What I want to do is if the customer is logged in (step also adds "Not" in welcome msg header), I want to auto populate email address in the login form. But since no sessions(customer and checkout) are available at this point I cant do it. What would be the best way to achieve this?
Answer: You can get the customer id like this:
<code>$sessionModel = Mage::helper('persistent/session');
$customerId = $sessionModel->getCustomerId();
</code>
then you can easily get the e-mail address.
<code>$customer = Mage::getModel('customer/customer')->load($customerId);
$email = $customer->getEmail();
</code>

persistent cart login step


Jcr (JackRabbit) Repository Tools

Question: I'm looking for a tool (preferably open source) to work with JackRabbit. For example, I'd like to backup/restore some branches of a repository. Any pointer, recommendation ?
Answer: If you are just looking for backup, you can use the included backup capabilities of jackrabbit.
java -jar jackrabbit-standalone.jar --backup \
   --repo=jackrabbit \
   --conf=jackrabbit/repository.xml \
   --backup-repo=jackrabbit-backupN \
   --backup-conf=jackrabbit-backupN/repository.xml

However if you are more interested in a general tool I can only recommend the CLI tool of jackrabbit which I think is the swiss army knife for repository operations.
If you want to look at an existing repository in your filesystem you start it with:
java -Xmx256m -jar jackrabbit-standalone-2.2.4.jar --cli file:///scratch/jcr/repository

If you jcr is running remotely you can also connect with jndi, davex, or rmi, depending on how your repository is exposed.
java -Xmx256m -jar jackrabbit-standalone-2.2.4.jar --cli http:///localhost:8080/server

java -Xmx256m -jar jackrabbit-standalone-2.2.4.jar --cli rmi:///localhost:1099/jackrabbit

Once you have logged in you can do all sorts of repository navigation, node creation or querying. You also have the export and import commands which can export respective import to and from a file in the filesystem.
exportsys /testbranch /tmp/export.xml

There are more parameters that you can see by typing
help exportsys

All available commands can be seen with
help

There are some caveats of this tool as it doesn't support more sophestic operations like ACL modifications or node type creation but for the basic stuff it is my favorite.

Jcr (JackRabbit) Repository Tools


How do you take down a Juggernaut?

Question: In my time of playing the multiplayer, I've noticed the Juggernaut kill streak makes someone nearly invincible, especially if two people do it at the same time. Now my question is what is the best way to take these people down? Just keep shooting? Are there any particularly good techniques to kill them quickly? (or at least keep them from killing your entire team twice)
Comment: They indeed are practically invincible. I managed to survive a Precision Strike right on top of my head on Hard Core. Came very close to death though.
Answer: Even with Juggernaut players are still very vulnerable to headshots (due to the damage multiplier).  Most headshots 'overkill' a player so you never really realize how much more damage they actually do.
To deal with a juggernaut: crouch behind a box, wait for them to walk by and stick a semtex to them, knife them, or (the most reliable) repeatedly shoot them in the head.
Comment: You will have to knife a juggernaut multiple times to kill him.
Answer: Sustained high damage is the key.
Juggernauts heal fairly quickly, so you have to keep up the damage.
Explosives help a lot, but the main thing to do is to make sure they're never getting a chance to heal up. Do this by keeping yourself alive to continuously fire at them, or fire at them with a team mate.
Answer: I kill them instantly using a Predator Missile kill streak. Obviously you have to wait until the juggernaut is outside before using this though.
Also a light machine can kill them in one round, and you can run circles around them to avoid getting shot.
Answer: I've found the very best way to take down a juggernaut. Use a tactical knife! With 4 knifes in a row, their dead. If your teammates (and flashbangs) can keep him from turning around on you, it's extremely quick to kill them.
Answer: Beware that clever juggernauts use their Riot Shield very effectively, and they stay next to other teammates as a tank to draw fire and attention.
Keep your distance.
If you are caught in the open and are alone, try throwing a 9-bang into his face, turn back and run.
Team work and focus-fire are very important, do not let him fight back:  9-bang, fire, 9-bang, reload, 9-bang, and so on. He will use his Riot shield a lot, so try to throw nades behind, or surround him.
Plant explosives and lure him into your trap. They stumble on explosive impact, which should give you precious seconds to unload onto him.
Answer: Use a stinger to lock him and take him down. A stinger missile is a one-shot-kill headshot to a Juggernaught.
Comment: Stinger is a lock-on only anti-air missle. How do you use that against a juggernaut?
Comment: Actually you can lock onto juggernauts and assault drones. See this video:
http://www.youtube.com/watch?v=oBwEYH6yuW0
Answer: I have found that using akimbo FMG9's at point blank range kills juggernauts very effectively. It should be able to kill one in one pair of rounds.
Answer: Hide behind a corner and put down a Claymore (Stand close if you need to shoot or knife). You will probably get damaged but you took out the Juggernaught. (This also works with a Bouncing Betty)
Answer: How about making sure he never gets his juggernaut in the first place?
The juggernaut airdrop looks different to a normal airdrop, (it's a C-130 Hercules(the juggernaut one)) and it will always fly towards the person that dropped the marker. Take him out and hav the juggernaut all to yourself.
I have called in a recon juggernaut 3 times and each one I have been killed before I can use it. But once my teammate got it.
As for actually taking it down, teamwork is crucial. Change to an Lmg class or a launcher class and then just blow them away. Juggernaut are very slow. And the recon juggernaut doesn't have an M60. You can just run away from them and get to a good spot and launch a missile at their face.
Thank you for reading
Answer: if you want to kill juggernaut you need 2 players to be able to kill. all the players must first buy submashinegun, which costs $ 2,000. Upgrade him the whole time until the last level. as the juggernaut is coming, the best headshot maker still on the main shoot, the other on the body, you should also shoot together!
Answer: Shoot them in the back with a SMAW or with an ACR 6.8 M320 (acr with a grenade launcher) use both bullets and grenades
Answer: Get a predator missile and jam down on his head. Or team up with your teammates and go for the head. Or use a light machine gun with extended mags and scavenger pro.
Answer: One of my best techniques is use Model 1887, then melee once a juggernaut crouches down in pain. That's what I do. Others prefer a flash grenade to blind the naut, to keep shooting again and again, camp in spot and attack from behind, etc.
Hmm... If only they had Brown Besses... I could fix a couple of Russians with bayonets...
Answer: Hit the bitch with SMAW right in the face after that just a few bullet with the LMG and it's over just make sure to use flash bangs before doing any thing and that's that
Answer: There are several effective ways to take down Juggernauts. Here are some:

Using a SMAW: This is my favorite approach. Flash the Juggernaut (Juggernauts are slow, they can't run for cover on being flashed). Then shoot them with a SMAW. Usually one SMAW hit is does the job. If not, take cover and keep shooting it, or dealing some kind of damage immediately. This is the only approach you can use in any condition, without needing support from team members.
Throwing knife: Throwing knife is very effective against the Juggernaut. 4 - 5 throwing knife shots kills it. Take help from teammates to keep the Juggernaut blinded (flashbangs, stun grenades etc.).
Predator missile: Predator missile is super effective against Juggernauts. However, it requires that you have a predator missile available and that the Juggernaut is in open. So not always an option.
Team attack: 3-4 people raining fire on the Juggernauts destroys it quickly. Aim for the head! Juggernauts are very weak in the head :)

Key idea behind taking down a Juggernaut is to deal a high amount of damage rapidly. Juggernauts quickly recover health, you don't want to give that chance to it.
Explosives like grenades or semtex are pretty useless against a Juggernaut if you are attacking it alone, use them just before you open fire or when team members are attacking it to throw the juggernaut off-balance.
Team attack is the most common, immediate response to Juggernauts. Weapons like MP7 with rapid fire, MP9 akimbo, ACR and grenade launcher attachments with assault rifles are most favorable in these cases. Also, do try using XM-25 or shooting it in the head with a non bolt action sniper rifle in such attacks.
So there you go, a manual for taking down Juggernauts. Now go show them who is the tough guy :)

How do you take down a Juggernaut?


What happens if I dd zeros to the drive where dd resides?

Question: Will this command: dd if=/dev/zero of=/dev/sda bs=1M succeed if the dd command was originally on /dev/sda? Will this complete because dd is in memory at that time?
Answer: There are three things which can happen:

The command starts, runs till completion and you get dropped back to a prompt. Since the disk is effectively wiped at you can't do much after that, though you might get lucky with some shell build-in commands.
The command starts. At some point it gets paged out due to memory pressure. Normally this is not a problem because parts of it can just be reloaded from disk (unchanged data) of from swap. However if you just wiped these then the dd command will fail partially though filling the disk.
The third option is something from BSDs. The MBR on a mounted disk is protected from overwriting. Even if you run the command as root. There are dozens of Linux distributions, all being just slightly different. It is quite possible that some of them emulate this.

So far for the theory. Now for a practical test.
I installed a fresh Ubuntu 12.10 on a VM. (VMware workstation on win7-x64, using default options and a 10 GB virtual disk).
The dd command completed successfully and I got dropped back at what seemed a working prompt. I could enter new commands, though they would fail for obvious reasons.
Comment: I see `Segmentation fault` and you claim that it completed successfully...?
Comment: Big +1 for the practical test!
Comment: Aye. It made the disk unreadable. I think that was the goal. For secure erases you really should try something else (such as the secure erase command).
Comment: one of the best answers I have ever gotten. Thanks!
Answer: A quick experiment in a virtual machine using Damn Small Linux indicates the dd command indeed completes, as expected; the program is initially loaded into memory to run and it makes very little sense to load the executable again and again during the process. Eventually, dd will exit and report 'no space left on device'.
Afterwards, the operating system seems to function normally at first sight, but hangs after the first command it can no longer execute for obvious reasons and becomes unresponsive. A brief inspection of the hard drive contents shows the partition has indeed been zeroed.
Answer: From the mmap page on Linux:
MAP_SHARED Share this mapping.  Updates to the mapping are visible to other processes that map this  file,
           and  are  carried  through  to the underlying file.  The file may not actually be updated until
           msync(2) or munmap() is called.

MAP_PRIVATE
           Create a private copy-on-write mapping.  Updates to the mapping are not visible to other  pro‐
           cesses  mapping  the  same  file,  and  are  not carried through to the underlying file.  It is
           unspecified whether changes made to the file after the mmap() call are visible  in    mapped
           region.

Executables are mapped to memory by the kernel via an internal call to the mmap function. A MAP_PRIVATE type mapping is requested (look in fs/binfmt_elf.c of the kernel source tree).
So it boils down to the behavior of mmap: whether changes in the file, or the underlying block device to which that file is referenced, are propagated back to the pages of the mapping which have already been paged in and are present.
That page is based on API standards, rather than kernel behavior, hence the "unspecified". The actual behavior is that changes to the file are not propagated back to already present pages. Of course, if the program suddenly jumps to a page of code which has not been paged in, and the erasure has already taken place, then it will get a page of all zeros.
But, quite probably, by the time dd erases itself, it has paged in all the pages of code it needs to continue the erasure loop.  There is the possibility that once the loop terminates, it may hit some code that is in a not present page: like, say a function spans across a page boundary, so to reach the return instruction, a page has to be fetched.
But that page may be cached from a previous dd invocation, too.
Answer: Yes. Of course, it'll also cost you most of your filesystem, but presumably you already know that...
Answer: I made a mistake recently. I intended to dd a 2 GB img onto SD Card, but did it to sda by mistake dd if=rasberrypi.img of=/dev/sda . Realized my mistake and canceled the dd, but by then ~600MB (on a disk with ~500GB used) had been written. Partition table was ruined.
The desktop (with 10 GB memory and up for weeks) continued functioning for few hours asif nothing happened. Managed to get recently changed important files into dropbox, browsed in chrome normally. In fact i could run the dd to SD card as i had originally wanted, worked fine.
After a couple of hours, my filesystem went into read only mode, and random programs started dieing. I was sshed into many other systems, i could continue using those sessions, but making new session gave error that it cant find the ssh program. At this time i could switch open tabs in chrome, but the contents of the tabs seem to have "hung". If i refresh, i get white screen forever. rsyslogd was taking 100% cpu (1 core) for some reason, probably it was confused why it couldn't flush logs to disk... maybe.
I had a 350 MB video opened (and paused) in VLC, i could still play it, and skip to any part of the video. Probably since its a recent download.
I could shut down the system normally using GUI, no errors.
So this doesnt answer your question exactly, but tells what happens if u wipe out begining of the disk..
Most of the things on the disk can still be recoverable, but im not gonna bother since (hopefully) everything i care about is backed up.
Answer: Most likely it will not complete, since some other executing component will request a file that's missing and panic the kernel. if you really want to zero the disk, use a live CD; otherwise you can never guarantee the result.
Comment: Requesting a file that's missing won't panic the kernel. If it did, machines would crash if they had just one unreliable disk.
Comment: @DAvid Schwartz, if that were the case, then #rm -rf / would actually delete the entire file system. I know from experiments that that is not the case. the system cannot stay running long entirely from ram unless some kind of ramdisk technology is implemented, which is not standard.
Comment: @FrankThomas: Did the kernel panic?
Comment: yes, blackscreen shutdown.


Graph Querying on edge

Question: Attributed Graphs are most commonly represented as an adjacency matrix or a list where nodes are considered first class citizens. There are many graph queries such as neighborhood, shortest path, page rank, connected component that operate on these matrix and list structures on nodes. The attributes of the node/edge can also be stored apart from the connections.
Another representation of the graph is an incidence matrix where the incident edges of a node are recorded in a matrix. I understand they represent exactly the same information as previous node-based methods.
My question is, are there any graph queries/workloads/algorithms that can benefit from the incidence matrix structure rather than using the node-based structures i.e. favoring an edge-based structure? When exactly are the incidence matrix used?
Answer: I can think of only one case where incidence matrix may prove faster:
Finding the degree of a node or finding adjacent nodes is an operation with complexity O(V) when using an adjacency matrix and O(E) when using an incidence matrix.
Usually E>V, but this may not be the case if the graph has many 0-degree nodes. Since finding adjacent nodes is a basic operation, many algorithms may prove to be faster on such graphs.

Graph Querying on edge


Why diff stackexchange site for programmer

Question: Why do we have a diff stackexchange site for programmers, IMO it needlessly duplicates functionality of stackoverflow
Comment: From the answers it seems that there has been a long back and forth about this so even though I am not sure about the criteria I think there is no point in reopening the debate, if I knew about the background probably I wouldn't have asked the question. Having said that a. Looking at the questions asked on overflow it seems criteria is "More honor'd in the breach than the observance"  b. I don't who downvoted the q but that was not very nice, I hope he/she doesn't kick cute puppies in real life for fun.
Comment: I'd advise against reading Meta on Programmers SE. Due to shifting domains, topics and rulesets, it opens more questions than it answers.
Comment: possible duplicate of [Why was the Programmers site on Stack Exchange created?](http://meta.stackexchange.com/questions/64042/why-was-the-programmers-site-on-stack-exchange-created)
Answer: Please read the faq for both sites; it is quite clear what the differences are.
https://stackoverflow.com/faq
https://softwareengineering.stackexchange.com/faq
If, after reading these faqs, you have specific questions, please edit your question to include them.
Comment: @guarav if it contains code, it generally belongs on Stack Overflow. If it does not, it generally belongs on programmers.se -- it's fairly simple if you use that guideline.
Comment: actually I asked the question after reading the FAQ =, I know there is a criteria of subjectivity but a. Even after the beta site stackoverflow regularly gets subjective queries as b. it is not very easy to decide what is strictly a subjective question or not, which is not surprising considering c. a lot of programming is about subjective arguments. I would have thought a better idea would have been to have a diff stackexchange based on diff tech (eg web development).Anyhow considering the not very friendly reply I think maybe it was wrong q to ask. My apologies.
Comment: I think maybe that should be reflected in the FAQ's a bit more strongly. Honestly I've read them a couple of times, and just searched meta to try and find the answer, because after reading them I wasn't sure on the differences. I've seen many a question that don't feature code, where SO seems the right place for them.
Comment: @ian if it is discussiony and has no clear cut right or wrong or even verifiable answer -- this is where *code comes in really freaking handy* -- then it belongs on programmers. But this doesn't exempt people from using their judgment, either.
Answer: There is a lot of history that led up to the decision to maintain separate sites. There was a continuous, low-level, mostly mannerly, but none-the-less deeply rooted feud over the proper boundaries of on-topicness for Stack Overflow starting as far back as the beta.
The establishment of Programmers has relieved some of the pressure, and I think the situation continues to improve as the community adjusts to the change.
Answer: I think it's a fair question, I was wondering the same myself.
Having read Jeff's links, I summarise it as:

StackOverflow - How Tos about code
Programmers - Coding related subjective questions.
Comment: Beware about the "subjective" though. There are more closevoting tendencies on Programmers than on SO.
Comment: @mario: Fair point. From the Programmer's FAQ: "*Stack Exchange is for expert programmers who are interested in subjective discussions on software development."* but also *"Subjective does not mean "anything goes". Please keep it professional at all times. If this is a question you'd be uncomfortable discussing with your colleagues in a work environment, it's probably not appropriate here, either."*


Why is there no space between U. and S. in U.S. Government?

Question: It appears that when U.S. Government agencies type "U.S.", they do not enter a space between the U. and the S. Is this used elsewhere on acronyms? Why or why not?
Comment: This question is probably a duplicate of [this one](https://english.stackexchange.com/q/209081/191178), but I don't particularly like the answer there.
Comment: Related: [Punctuation of Initials in Name](https://english.stackexchange.com/questions/450802/punctuation-of-initials-in-name/450821#450821)
Comment: There is a very good answer here: [Replacing the periods/dots with spaces in abbreviations](https://english.stackexchange.com/questions/25257/replacing-the-periods-dots-with-spaces-in-abbreviations)
Answer: At one point in time it was common to see acronyms written with spaces (see for example "P. P.", which stands for "parish priest", in Ulysses, 1922). However, it's pretty standard nowadays to not include spaces between letters in an acronym. In fact, most style guides suggest using neither periods nor spaces between letters. Some style guides recommend using periods (and no spaces) only in certain acronyms. I have not found a modern style guide that recommends using spaces in acronyms.
The APA Blog recommends against spaces in "U.S.":

Generally, do not use periods in abbreviations. Some exceptions are that you should use periods in the abbreviations for United States and United Kingdom when these terms are used as adjectives (don't abbreviate them if they are used as nouns). And if you have created an identity-concealing label for a participant, use a period after each letter.
Examples: U.S. Census Bureau, U.K. population, participant R.E.C.

This is explicitly said later on in the comments by the blog's author:

There should not be a space in the country abbreviation for U.S. The same goes for U.K.

Here are some more examples of style guides with similar recommendations:

Use no spaces after the periods in abbreviations.
The New York Times Manual of Style and Usage, 5th Edition

Abbreviations with periods should be typed without spaces between letters and periods
FranklinCovey Style Guide: For Business and Technical Communication

Note that names are often still written with spaces between the initials. For more info see Should there be a space between name initials?