Are comments to show what version code was added/modified for useful?

Question: Some of the developers on the project I work on have a habit of commenting their code to show which version of the product it was added for, e.g.
<code>// added for superEnterpriseyWonder v2.5
string superMappingTag = MakeTag(extras);
if (superMappingTag.empty())
{
     autoMapping = false;
}
// end added for superEnterpriseyWonder v2.5
</code>
Whenever I see this my blood pressure rises, and I have to spend 5 minutes browsing SO to cool off. It seems to me that they don't understand version control and if I were to use this practice too every other line in the source files would be a comment about when things were added. I'm considering removing all such comments from files that I work on, but am wondering is it just me being picky and is there actually some value to these comments?
Comment: I share your dislike of this practice. I think it demonstrates a misunderstanding of the capabilities of version control tools. I always tried to gently educate offenders. I have similar issue with people checking in code which contains commented out code.
Comment: My problem is that both practices (defect number comments, and commenting out code for later use), are so much easier to use than the alternatives. I think commenting out code is the much worse problem, as it leaves a lot of totally dead detritus around. I like defect linking comments, as they provide a quick short-cut to finding more discussion about the change.
Comment: They also provide a hint that that section of code has been thought about by a larger group of people and that this is the end-result, so be more careful about making functional changes.
Comment: @Douglas: Isn't this where issue tracking comes in?
Comment: @Tom Duckering: with you 100% on this. The commented-out code things drives me crazy too, as any of my team could tell you...
Answer: If you're using Source Control then I would advocate adding a build label to Source Control after every build. That way you can search for all source modified for a specific build, with no nasty comments clogging your code.
This from Clean Code, a book by Bob Martin:

"The proper use of comments is to
  compensate for our failure to express
  ourself in code. Note that I used the
  word failure. I meant it. Comments are
  always failures."

I always think of that quote when I see a comment so I'm not suprised your blood boils.
Comment: @NickGPS: "Comments are always failures" is a pretty hard line -- I'd treat that as an aspiration rather than a rule! However I agree 100% that Source Control is the answer to this, not comments.
Answer: No value whatsoever. If you have a blame tool in your version control this will achieve this, they just add noise.
Whats worse is they will attract further comments to your code to make it completely unreadable
<code>// added for superEnterpriseyWonder v2.5
string superMappingTag = MakeTag(extras);
if (superMappingTag.empty())
{
     // bug fix #12345674 shuld have been true
     autoMapping = true;
     // bug fix #12345674 should have been true
     i++; // v2.6 now need to up the counter DO NOT DELETE
}
// end added for superEnterpriseyWonder v2.5
</code>
and then someone will delete the method but leave the code comment in
<code>// added for superEnterpriseyWonder v2.5
     // bug fix #12345674 should have been true
     // v2.6 now need to up the counter DO NOT DELETE
// end added for superEnterpriseyWonder v2.5
</code>
Just say no to crappy comments
Comment: Your modified code actually looks very close to some of the older code that is in the system (10+ yrs of cruft).
Answer: I'd say there's no value: This info can also be retrieved with your SCM's annotate/blame functionality. Also, anyone can add text between these comments, which make the comments dated (since you might add something for v2.6 while the comments say v2.5)
Another thing to note is that these comments are essentially hidden: You only see them when you are looking at the source code in question, so you can't use it to generate a changelog or something.
Answer: The comment as shown, is probably not to useful.  However, there may be times that adding a feature may cause the addition of not so obvious code.  In which case, a comment describing the change and/or why it the code is not obvious would be appropriate.
Answer: Not only is there no value here...there's negative value.  Maintenance of comments is already sketchy in most places, this just adds another thing for people to screw with.  These comments have no value to the reader and are therefore clogging their brain up with useless version information when they could have another line of code in their memory.  It's also another line to have a merge conflict on (totally not joking here..I've seen merge conflicts on comments).
Answer: Could be useful in some cases (e.g. if this helps to understand why some function works differently in V3 than in V2) but in general, it's the job of the SCM to know what has been added when.
Answer: You are not picky IMHO. There are at least three good reasons not to add this type of comment in source code:

their place is actually in a Version Control System, where you can have a global view of everything that has changed to accommodate a new version of a library or a new feature. Provided it is done correctly and the logs are used.
if the source code is part of the deliverables to clients, maybe they don't need to know the history of what happened. Imagine you have done a modification for another client, and put that in comments!
too many comments are no better than too few.

The line is not clear though, what would be the difference between
<code>// Compliance with specs abc (additional xyz feature)
...
... // some code
</code>
and:
<code>// xyz feature:
...
... // some code
</code>
In general terms, I would not put anything that is related to the history in the source code, but stick to commenting what is done, how it is done, so that someone else can easily browse through the code and understand it.
My advice: have a methodology document written, or an informal discussion.
Answer: If seeing a superfluos comment makes your blood pressure rise, you need to take up drinking or something.
That said, I agree that such comments are mostly useless. If used consistently, the program would quickly become a maze of such comments. What if a line is changed once for version 2.5 and then a year later changed again for bug 3294? Do you put two "version" comments on the same line, or just keep the latest? If you only keep the latest, then you've lost the fact that this was originally added for 2.5. If you keep them both, what happens when there's a third change or a fourth? How do we know what the state was at each change? What happens when you add a block of code in version 2.5, and then for version 2.6 you add another block of code embedded within the 2.5 block? Etc etc. The program could easily end up having more version comments than lines of code.
If not done consistently, the comments would quickly become misleading. Someone could put a comment saying this block was added for 2.5, someone else could insert code inside that block for version 2.6 and not comment it, and now we have a comment that seems to say that the second block was added for 2.5.
And do we care that much? It's pretty rare that I care when a change was made. Oh, okay a couple of weeks ago I cared because I wanted to know who to blame for a major screw up.
As others have pointed out, version control systems do this for you on the rare occasions when you need it. I guess if you didn't have any sort of VCS, a case could be made for doing this. But you can get some very nice VCSs for free. If you need one, get one. Otherwise you're like the people who say that you should practice doing arithmetic in your head because otherwise what would you do if your calculator quit working. The assumption apparently being that at any moment, all the calculators in the world might simultaneously break.
You might say that it can help to be able to say, "Ohhhh, this was added to order entry to support the new salesman timecard function" or some such. But then the important this is not "This code was changed by Bob for version 3.2.4", but rather, "This code produces this data which isn't used here but is needed by another module over there".
I am a firm believer in writing comments that introduce sections of code and describe the general idea behind complex or otherwise non-obvious code. But that's an entirely different thing.
Answer: Consider that some may have to grab snapshots from the VCS. In that case, they don't have history to fall back on .. and such comments become useful.
Comment: When I first joined my company (over 10 years ago) they were using a home-brewed source control system that had no information about history.  They had to use comments to show why things changed and that habit was hard to break.  I'm happy to say that we now use subversion and even actively look for these comments and remove them from the code base.
Comment: Why would anyone grab snapshots? They should be doing a branch or a migrate?
Answer: I saw that a lot in code written by people that didn't use version control until recently. I guess they just took the habit and now it's hard to stop.
Another reason I found was that sometime it is important to know what piece of code is associated with what version. Of course you can always check the version log, but you don't always have time for that, and it's annoying. In some cases saying "code for v3.2" speaks more to other developers than "code to do x, y and z"... it all depends on the conventions established by the team.
Another answer is that in some projects I worked with some code was commented like that, but it was before the project actually started using version control. In that case it also made sense to keep it that way.
Answer: I find them useful, it saves chasing through the VCS to find out why a change was made to the code, or to find the BugId for a defect, given I remember what the code change was.
Although in theory the VCS contains the information, in practice it can get buried, particularly by integrations.
In other works which is easier:
<code>// DEF43562 - changed default value
foobar = true
</code>
Or

blame(or equiv)
chase through
history to find the correct change.
Follow integration to source, and
repeat 1&2.
Find bug id attached
to original change, if you are
lucky.

Basically the comment is a short-cut around the VCS, and flaky VCS/BugTracking integration.
I find that the comments are also useful as a marker for: "This decision has been reviewed by customers/users/review committee, and this is the selected answer, be careful about changing the behaviour".
Comment: Yes it's true that it is quicker to find a bug number from a comment but then I still have to load up the bug tracking system to find out why. If it's worth commenting I would say it is worth actually explaining in the comment why the default should be true.
Comment: I generally have the bug tracker open anyway - YMMV. And you're right - you need to put the reason for the default in the code as well. My example isn't the greatest.
Comment: We use TFS for source control. Every single change is linked to a task or a defect, via the checkin. In Visual Studio this is integrated, so you can view the history (annotate) without much effort.


How does electron positron plasma act compared to normal plasma?

Question: When an electron positron plasma is formed, will it react to magnetic fields the same way? With the gamma ray photons resulting from the annihilation, would the plasma be of greater energy?
Thanks!
Comment: Can you be more specific with your question?  The main difference between an electron-positron plasma and an electron-proton plasma is the mass ratio between the two species.  If the system is truly a quasi-neutral plasma, then annihilation should become rare enough, due to Debye shielding, that we can reduce our worries to the difference in mass ratio.  At that point, yes the two types of plasmas I listed will act differently at small-scales primarily.
Answer:
When an electron positron plasma is formed, will it react to magnetic fields the same way?

The short answer is yes and no.
The primary difference between an electron-positron plasma (also called a pair plasma) and an electron-proton plasma is one of scales.
In an electron-proton plasma, the cyclotron frequencies, $\Omega_{cs}$, plasma frequencies, $\omega_{ps}$, inertial lengths, $c/\omega_{ps}$, and gyroradii, $\rho_{cs}$, are all different for the different particle species $s$ (i.e., electrons and protons) due to the vastly different masses.  In a pair plasma, the first three are identical (for quasi-neutral conditions, i.e., $n_{e} = n_{i}$ or equal number densities) and the gyroradii are the same when the temperatures are the same, i.e., $T_{e} = T_{i}$ (where $e$ is for electron and $i$ is generic for ion).
The separation of scales in an electron-proton plasma allows for several interesting phenomena from wave modes to magnetic reconnection geometries that cannot exist in pair plasmas.
Finally, the other main difference is location.  Pair plasmas generally only exist in nature in extreme environments like the magnetospheres of pulsars and magnetars.  Under such high magnetic fields, much of the dynamics are also completely different (e.g., the gyroradii can become quantized), leading to different phenomena than is commonly found in an electron-proton plasma.

With the gamma ray photons resulting from the annihilation, would the plasma be of greater energy?

Electric fields generally do work on the system to eliminate themselves.  In plasmas, this results in Debye screening -- on scales larger than the Debye length the plasma is considered neutral, i.e., $n_{e} = n_{i}$.  Thus, pair annihilation is typically not a major issue.
The extreme environments under which pair plasmas form are generally responsible for their higher energies than pair annihilation.


Home Link in Top Menu Navigation

Question: I want home menu in top Navigation.
But One thing is that , i Created root category and that link to top navigation.
In that root category i already add Home category but that leads to http://www.xyz.com/home.phml page but i want http://www.xyz.com In that case we have to write store URL in URL_key line but that also can't accept. so help me.
Thanks.
Answer: You can resolve this issue by editing target URL from URL rewrite management.

On the Admin menu, select Catalog > URL Rewrite Management.
In the list, find the entry for the subcategory you created. If you can't find it do the following:
In the filter box at the top of the Request Path column, type the URL key for the subcategory you created, and click the Search button. In this example, the Request Path is "home.html"
change its target path to "/"
Answer:
Add this code in your menu file. check using system->developer
  select store Template path hint option enable.
default file path template/catalog/navigation/top.phtml

<?php
     $routeName = Mage::app()->getRequest()->getRouteName();
     $identifier = Mage::getSingleton('cms/page')->getIdentifier();
?>

After

  <li class="level0 home level-top <?php if($routeName == 'cms' && $identifier == 'home') {echo " active";}?>">
  <a href="<?php echo $this->getBaseUrl(); ?>" class="level-top"><?php echo $this->__('Home'); ?>

Answer: It can be done in your topmenu.phtml file in your theme. All the navigation menu are come from this file you just have to add the link over there staticaly.

Home Link in Top Menu Navigation


Can any bones (but specifically Beef Shortribs) be used to make bone broth AFTER they've done a stint in the crockpot?

Question: Today, I have beef shortribs in the crockpot for Caribbean Beef Ribs for hubby's birthday.  After we're done feasting, are the bones still usable for making bone broth?
Comment: You can do it, but you likely won't get what you'd consider to be "bone broth".  It's called "remouillage".  See https://cooking.stackexchange.com/q/61918/67
Answer: Yes and no... You can certainly toss them in a pot and let it simmer for a few hours, you'll extract some flavor and there's no danger. But broth usually uses bones that have only been roasted, not cooked low and slow in liquid as I'm guessing you did in the crock pot. Depending on how long you cooked the previous dish, some or most of the flavor and even the gelatin could already have been extracted. Speaking of that previous dish, any spices used will most likely have imparted some flavor to the bones while cooking, which will then end up in the broth.
Personally, a lightly flavored Caribbean broth doesn't sound particularly appealing to me; I would just toss the bones. But there shouldn't be any danger to trying it if it does appeal to you.
Comment: I agree with you, one of the benefits low and slow submerged cooking is that it extracts flavor from the bones, there won't be much left.
Answer: I'm not a bone expert, but I took the habit of making stock whenever I have bones left, whether it was chicken, beef or mutton so far, and I don't see why it wouldn't work with beef shortribs!
I have never heard of some kinds of bones being dangerous, or simply bad for stocks, but maybe just that some might be tastier than the others.
I watch a lot of French cooking shows and these guys make broth out of any type of bone you can imagine! More seriously, that's an interesting question and I can't find anywhere that some types of bones are bad, it seems that you can really use them all...
Let us know what the result will be!


"Belongs in another area" close-vote doesn't let me suggest area?

Question: Whether via browser or app, when I try to select this reason the only choice offered is the local Meta. If that's deliberate, the language inviting us to choose, and indeed that whole step, are misleading/redundant. If it isn't, could we get this fixed someday?
Comment: @m0sa the "could we get this fixed someday?" part makes this kind of feature request. Maybe better put back that tag and add [tag:status-declined]? Know it's nitpicking, but I just like to keep things organized. ;)
Comment: I can't find the said "belong in another site" flag anymore.  It used to exist before...
Comment: @ShadowWizard  the "could we get this fixed someday?" part kind of excludes [tag:feature-request]...
Comment: @m0sa fair enough. Thanks!
Comment: I didn't intend to assert it either as bug or missing feature, just as issue.  Feel free to edit/rephrase to make it more suitable for the queues.
Answer: Each site has its own list, which may be as small as its per-site meta. This is by design. You can't move to an arbitrary site, only to those the site admins have decided are typical targets.
However if you are sure it belongs somewhere that is not on the list, use an Other flag and explain to the moderator where you think it should be migrated to.
Comment: Not only do the referrals need to happen frequently, they need to be of a kind that the target site would accept. We don't encourage the migration of nonsense.
Comment: Ok, so I should pester the area heads if a particular kind of referral is happening frequently... Good enough. The UI does not make this at all clear; room for improvement there.


how to stop an app upgrading?

Question: How can I pin an app so that it can't be upgraded? I have one app where version 2 is not as good or stable as version 1, so I want to pin it at version 1 and not upgrade it .
Answer: I needed to do that for Google Maps.  I still believe the original Google Map is about the best.  The upgrade lost a lot of functionality, almost two years ago and still hasn't caught up.
So I had to do the same thing you described and found that the only way to do this was to disable auto updates and only manually update the items (all the items) except for Google maps.
You can disable auto updates by going (from the Android) into Google Play > Apps > Options > Settings > (Click on) Auto-update Apps > (Tick) Do not auto-update apps
After you have done this, you'll be notified when Apps have updates.  You can select which ones to update from the notice.
Comment: Thanks for this, I've done as you suggested, and am now trying to restore the programme from backup, but no matter what I do it is refusing to install. So I've now flushed the cache and turned the mobile off for at least half an hour, and will then try again. AArrrghh!

how to stop an app upgrading?


Will adding space to the Vigenère block make it truly unbreakable?

Question: I just have gotten into cryptography and learned about the Vigenère block. I think it's a very good idea because, if used correctly, it is unbreakable. But the only downsite is, the key must be the same length as the message. Well, can't you just simply make the block 27x27 big by adding the space into it. That way you could have no space at all, or you can make spaces where ever you want. Is there anything like this already or am I overlooking something here?
Comment: The Vigenere cipher is [not unbreakable](http://en.m.wikipedia.org/wiki/Vigenère_cipher).
Comment: @cygnusv, he stated "key must be the same length as the message", assuming he meant the key to be random, it should be as unbreakable as OTP, as OTP is a vigenere cipher with smaller table.
Comment: @SOJPM, yes but then he said "bock 27x27", so I assumed the traditional Vigenere cipher with a bigger table.
Comment: @cygnusv, which is still unbreakable provided the key is of the same length as the message and the key is random?
Comment: If you use a random permutation over 27 symbols (letters + space) and you use a key of the length of the ciphertext, then you get a bloated version of OTP. All it does, is increase the already huge size of the key (since the whole permutation for each symbol requires $27$ symbols to be stored, instead of just one).
Answer: I believe you need a few clarifications to answer this question yourself.
The first is the one time pad (OTP). This is the only truly unbreakable system if it's used correctly.
Using correctly means that for every symbol of the message there is exactly one truly random symbol in the key. Specifically, this means that there is no chosen symbol of the key that is used twice (of course a symbol can occur twice in the key; I mean that for every symbol of the message there is a new symbol chosen for the key with its own randomness). The message includes spaces, so spaces need to be encrypted as well! This is what your thought was when you said to extend the table with a space.
The Vigenère cipher has a repeating key in its original definition. If you choose the key to be exactly as long as the message (and encrypting every symbol of the message, not just the letters) and you chose this key randomly, then the Vigenère cipher becomes the One Time Pad and is thus, as you correctly said, unbreakable.
If your message has more than 27 symbols (for instance capital letters, punctuation etc.) then your key must be extended, as well.


Execute script after specific delay using JavaScript

Question: Is there any JavaScript method similar to the jQuery delay() or wait() (to delay the execution of a script for a specific amount of time)?
Answer: Just to add to what everyone else have said about setTimeout:
If you want to call a function with a parameter in the future, you need to set up some anonymous function calls.
You need to pass the function as an argument for it to be called later. In effect this means without brackets behind the name. The following will call the alert at once, and it will display 'Hello world':
var a = "world";
setTimeout(alert("Hello " + a), 2000);

To fix this you can either put the name of a function (as Flubba has done) or you can use an anonymous function. If you need to pass a parameter, then you have to use an anonymous function.
var a = "world";
setTimeout(function(){alert("Hello " + a)}, 2000);
a = "Stack Overflow";

But if you run that code you will notice that after 2 seconds the popup will say 'Hello Stack Overflow'. This is because the value of the variable a has changed in those two seconds. To get it to say 'Hello world' after two seconds, you need to use the following code snippet:
function callback(a){
    return function(){
        alert("Hello " + a);
    }
}
var a = "world";
setTimeout(callback(a), 2000);
a = "Stack Overflow";

It will wait 2 seconds and then popup 'Hello world'.
Answer: There is the following:
setTimeout(function, milliseconds);

function which can be passed the time after which the function will be executed.
See: Window setTimeout() Method.
Comment: this is not a delay, it's a fork.  Delay should work in same thread.
Comment: This will immediately execute function_reference. To "work" (asynchronously) it should be stated as: setTimeout(function () { MethodToCall(); }, 1000);
Comment: I want to point out that we're talking about JavaScript; bringing up "threads" or that it should work "synchronously" may be true *technically* and *semantically* but don't really fit within the context of JavaScript, considering there really is no way to achieve a delay with either of those methods (you don't create "threads" in JS like you do in other languages). Also, this will not immediately execute `function_reference` unless you include `()`. I.e. `function_reference` is just that - a reference; passing in `function_reference()` would invoke the function immediately.
Comment: It's not a expression that is executed it's a function. @Marius' answer illustrates that.
Answer: Just to expand a little... You can execute code directly in the setTimeout call, but as @patrick says, you normally assign a callback function, like this. The time is milliseconds
setTimeout(func, 4000);
function func() {
    alert('Do stuff here');
}

Answer: If you really want to have a blocking (synchronous) delay function (for whatsoever), why not do something like this:

Comment: A more compact routine: function delay(ms) {
        var start_time = Date.now();
        while (Date.now() - start_time < ms);
}
Comment: The difficulty with this solution is that it actively uses a processor, which leads to increased power usage and a decrease in resources available for other threads/processes (e.g. other tabs, other programs). Sleep, by contrast, temporarily suspends a thread's use of system resources.
Comment: Of course it is CPU intensive, but for quick and dirty testing it works
Comment: better to use Date.now() instead of new Date() and don't think about memory leaks
Comment: `;(function(){function a(b,a){!0!==a&&(b*=1E3);for(var c=Date.now();Date.now()-c<b;);}window.hasOwnProperty("delay")||(window.delay=a)})();` Use secs or msecs. Example with 3 seconds: `delay(3);` Example with 500 milliseconds: `delay(500, true);`
Answer: You need to use setTimeout and pass it a callback function. The reason you can't use sleep in javascript is because you'd block the entire page from doing anything in the meantime. Not a good plan. Use Javascript's event model and stay happy. Don't fight it!
Comment: Still it would be useful for testing purposes.  Like delaying a form submission for a few seconds to evaluate page changes before a new HTTP request is made.
Comment: @rushinge then set the callback to submit the form and disable the default form submit
Answer: You can also use window.setInterval() to run some code repeatedly at a regular interval.
Comment: `setTimeout()` does it once, `setInterval()` does it repeatedly. If you want your code run every 5 seconds, `setInterval()` is made for the job.
Comment: setInterval() should n't be use instead should use setTimeout
Answer: To add on the earlier comments, I would like to say the following :
The setTimeout() function in JavaScript does not pause execution of the script per se, but merely tells the compiler to execute the code sometime in the future.
There isn't a function that can actually pause execution built into JavaScript. However, you can write your own function that does something like an unconditional loop till the time is reached by using the Date() function and adding the time interval you need.
Answer: If you only need to test a delay you can use this:
function delay(ms) {
   ms += new Date().getTime();
   while (new Date() < ms){}
}

And then if you want to delay for 2 second you do:
delay(2000);

Might not be the best for production though. More on that in the comments
Comment: Well, it's a busy loop that will drain the batteries of laptops and other mobile devices, and probably also prevent the UI from responding (or even displaying).
Comment: Works well enough in development for a quick & dirty (and temporary) solution.
Comment: @U2744SNOWFLAKE Makes sense. Have updated the answer, for what I used this function for :)
Answer: why can't you put the code behind a promise? (typed in off the top of my head)

new Promise(function(resolve, reject) {
  setTimeout(resolve, 2000);
}).then(function() {
  console.log('do whatever you wanted to hold off on');
});
Answer: The simple reply is:
setTimeout(
    function () {
        x = 1;
    }, 1000);

The function above waits for 1 second (1000 ms) then sets x to 1.
Obviously this is an example; you can do anything you want inside the anonymous function.
Answer: I really liked Maurius' explanation (highest upvoted response) with the three different methods for calling setTimeout.
In my code I want to automatically auto-navigate to the previous page upon completion of an AJAX save event.  The completion of the save event has a slight animation in the CSS indicating the save was successful.
In my code I found a difference between the first two examples:
setTimeout(window.history.back(), 3000);

This one does not wait for the timeout--the back() is called almost immediately no matter what number I put in for the delay.
However, changing this to:
setTimeout(function() {window.history.back()}, 3000);

This does exactly what I was hoping.
This is not specific to the back() operation, the same happens with alert().  Basically with the alert() used in the first case, the delay time is ignored.  When I dismiss the popup the animation for the CSS continues.
Thus, I would recommend the second or third method he describes even if you are using built in functions and not using arguments.
Answer: delay function:
/**
 * delay or pause for some time
 * @param {number} t - time (ms)
 * @return {Promise<*>}
 */
const delay = async t => new Promise(resolve => setTimeout(resolve, t));

usage inside async function:
await delay(1000);

Or
delay(1000).then(() => {
   // your code...
});

Or without a function
new Promise(r => setTimeout(r, 1000)).then(() => {
   // your code ...
});
// or
await new Promise(r => setTimeout(r, 1000));
// your code...

Answer: As other said, setTimeout is your safest bet
But sometimes you cannot separate the logic to a new function then you can use Date.now() to get milliseconds and do the delay yourself....

function delay(milisecondDelay) {
   milisecondDelay += Date.now();
   while(Date.now() < milisecondDelay){}
}

alert('Ill be back in 5 sec after you click OK....');
delay(5000);
alert('# Im back # date:' +new Date());
Answer: I had some ajax commands I wanted to run with a delay in between.  Here is a simple example of one way to do that.  I am prepared to be ripped to shreds though for my unconventional approach.  :)
//  Show current seconds and milliseconds
//  (I know there are other ways, I was aiming for minimal code
//  and fixed width.)
function secs()
{
    var s = Date.now() + ""; s = s.substr(s.length - 5);
  return s.substr(0, 2) + "." + s.substr(2);
}

//  Log we're loading
console.log("Loading: " + secs());

//  Create a list of commands to execute
var cmds =
[
    function() { console.log("A: " + secs()); },
    function() { console.log("B: " + secs()); },
    function() { console.log("C: " + secs()); },
    function() { console.log("D: " + secs()); },
    function() { console.log("E: " + secs()); },
  function() { console.log("done: " + secs()); }
];

//  Run each command with a second delay in between
var ms = 1000;
cmds.forEach(function(cmd, i)
{
    setTimeout(cmd, ms * i);
});

// Log we've loaded (probably logged before first command)
console.log("Loaded: " + secs());

You can copy the code block and paste it into a console window and see something like:
Loading: 03.077
Loaded: 03.078
A: 03.079
B: 04.075
C: 05.075
D: 06.075
E: 07.076
done: 08.076

Answer: The simplest solution to call your function with delay is:
function executeWithDelay(anotherFunction) {
    setTimeout(anotherFunction, delayInMilliseconds);
}


Difference in output with waitKey(0) and waitKey(1)

Question: I've just begun using the OpenCV library for Python and came across something I didn't understand.
cap = cv2.VideoCapture(0)

while True:
      ret, frame = cap.read() #returns ret and the frame
      cv2.imshow('frame',frame)

      if cv2.waitKey(1) & 0xFF == ord('q'):
          break

When I use cv2.waitKey(1), I get a continuous live video feed from my laptops webcam. However when I use cv2.waitKey(0), I get still images. Every time I close the window, another one pops up with another picture taken at the time.
Why does it not show as a continuous feed?
Answer: From the doc:
1.waitKey(0) will display the window infinitely until any keypress (it is suitable for image display).
2.waitKey(1) will display a frame for 1 ms, after which display will be automatically closed. Since the OS has a minimum time between switching threads, the function will not wait exactly 1 ms, it will wait at least 1 ms, depending on what else is running on your computer at that time.
So, if you use waitKey(0) you see a still image until you actually press something while for waitKey(1) the function will show a frame for at least 1 ms only.
Answer: waitKey(0) will pause your screen because it will wait infinitely for keyPress on your keyboard and will not refresh the frame(cap.read()) using your WebCam.
waitKey(1) will wait for keyPress for just 1 millisecond and it will continue to refresh and read frame from your webcam using cap.read().
More clearly, Use debugger in your code.When using waitKey(0) in the while loop, the debugger never crosses this statement and does not refresh the frame and hence the frame output seems stable.Does not move.
Where as with waitKey(1), the debugger will cross the code after pausing at
if cv2.waitKey(1) & 0xFF == ord('q')

for 1 milli second.
Answer: From the documentation you can see that cv2.waitKey(delay) waits for delay milliseconds if delay is positive but forever (waits for a key event infinitely) if it's zero or negative. That's why you see these differences in behavior.
In the case of cv2.waitKey(1) this is, in fact, negligible but its use provides the user the opportunity to press a key (the key might be caught in some next iteration but does not make a big difference).
Answer: Delay in milliseconds. 0 is the special value that means "forever".
The function waitKey waits for a key event infinitely (when \texttt{delay}\leq 0 ) or for delay milliseconds, when it is positive. Since the OS has a minimum time between switching threads, the function will not wait exactly delay ms, it will wait at least delay ms, depending on what else is running on your computer at that time. It returns the code of the pressed key or -1 if no key was pressed before the specified time had elapsed.
Note: This function is the only method in HighGUI that can fetch and handle events, so it needs to be called periodically for normal event processing unless HighGUI is used within an environment that takes care of event processing.
Note: The function only works if there is at least one HighGUI window created and the window is active. If there are several HighGUI windows, any of them can be active
Answer: cv2.waitkey(1) is being used in while loop.It shows the output for 1msec but because of infinite while loop it is the sequence of images that are perceived by our brain as a single continuos video.
Hope this helped.
Answer: Indratej Reddy's answer is the only one to clearly explain why this works — and why no GUI events act until waitkey is called.  Unclear how to handle menu/mouse events — e.g., ignores menu quit.
$ python3
>>> import cv2
>>> im = cv2.imread("/tmp/portrait.jpg")
>>> print("im =", im)
im = […]
>>> cv2.imshow("image", im)
>>> print("imshow called")
imshow called
>>> print("waitKey =", cv2.waitKey(0))
waitKey = 32
>>> print("destroyAllWindows =", cv2.destroyAllWindows())
destroyAllWindows = None
>>> print("Final waitKey 1ms =", cv2.waitKey(1))
Final waitKey 1ms = -1
>>>


Use quartz composer for creating time lapse videos

Question: Hy there let's say I have 1000 pictures which were taken with a delay of 1 second.

Is it possible to create a video from these pictures using quartz composer?
In a second step I would like to add labels to the video stream depending on the current time of the given picture so that you can see how time flies by while watching the video.
In a third step I think it would be very cool to have something like an animated analogue clock that displays the time instead of a label.
clock http://www.thepropheticartist.com/images/animated_clock.gif
There is no fourth step :-)
Answer:
No, there's currently no way to combine individual pictures into a QuickTime movie using Quartz Composer.  Apple does provide example code for writing individual images to disk, so currently at best you could load an image, process it, and write an image to disk.
Use the System Time, Date Formatter, Image With String, and Billboard patches.
In /Developer/Library/Quartz Composer/Examples/Patches/, there's Clock.qtz, which renders an analog clock.
No comment.
Comment: Using [Kineme FileTools](http://kineme.net/FileTools) you can get the file's creation and modification timestamps.  (I'm not aware of a way to read EXIF tags in QC, though.)
Comment: Great! Thank you very much. Do you know if it is possible to use the image's capture time instead of the `System Time`?

I currently have created just the movie without any labels on them using Aperture. The good thing there is that I can time the images according to the beats of the background music. So I could process all the images write them to disk and then re-import them in Aperture.


Moderation bias against short answers

Question: My answer to this question was removed by a moderator for no apparent reason. While brief, it provided the correct answer to the question. I'd like to know why it was removed. Could it be that there is a bias against shorter answers?
Comment: I'd agree that there is a bias, since I find short, comment like answers distasteful myself, but I do agree with you that moderator removal is not nessecarily the right answer.
Comment: @RewanDemontay I'd say that "size doesn't matter" in this case. If a question can be answered with a short, direct answer, then that answer is preferrable to an unnecessarely wordier one
Answer: Short, low quality answers are automatically flagged by the system. From there they go into a review queue. If two reviewers (or one mod) agree then the post is deleted.
Here is an example which is halfway to being deleted as you can see from the comments and the timeline.
Comment: How does the system determine if an answer is "low quality"? The example you link shows an answer (chess24.com) to a question (where to find certain type of videos?)

Moderation bias against short answers


Is it possible for Google to Index a site with login?

Question: I have a real estate site that we require the user to login after viewing 3 properties.  Is it possible for Google to index these property listings while still keeping that functionality in place?  What is the best way to handle this on the up and up with Google?  Thanks!
Answer: This sounds like a great use-case for First Click Free - which would allow you to show the full content to Googlebot, while limiting the number of times a user can access content from there.
Comment: I have read a little about this but not exactly sure how it works.  I didn't realize until reading this article that it works for regular web search.  Everything i had been reading about it was geared directly towards news.  This is a very interesting idea!  Have you ever used it and had success outside of the news articles?  Thanks!
Answer: There is something called submitting URL Parameters in google webmasters.
https://www.google.com/webmasters/tools/crawl-url-parameters
If you want the bot to read the contents inside a page that is shown after login, you can submit the url of the php or link that handles the login form along with parameters of login.
Hope that helps.
Comment: what do you mean by php ? Do I need to take the page address from cpanel ?
Comment: no. If your login form submits to `yoursite.com/login.php` with the parameters `username` and `password`, then you have to submit `yoursite.com/login.php` with the username and password parameters with values that are accepted by the server. I don't know how secure this is though. Always good to create a test or bot profile separately and provide the login parameters for that account.
Comment: Thanks @AtulBhatS.  I'm not sure I completely understand but will definitely try to look into this solution more.  Have you had success doing something like this?  Thanks!
Answer: How do you find out of the 3 views? Cookies?
If so, whitelist crawlbot IP's to not get the cookies. Possible in .htaccess file
Comment: Would that be considered cloaking and potentially harm the site?


Can I execute multiple lines sudo commands?

Question: This question relates to another question. If I paste the @kyodake 's suggested code, all at once in the terminal would it work?
Or should I go line by line?
Comment: @Ravan that's not true. A newline works just as well. Were it not for `sudo` requiring a password and for the OP of the linked answer including `#`, the commands could be copy-pasted directly.
Answer: There's several approaches to letting multiple commands run with sudo.
The first one suits your use-case best. Others are added for the sake of exploring alternatives; they may not suit your particular need, but may come in handy to you in the future or other users.
Approach #1: Cleanest and simplest
Put everything into a script, for example myscript.sh, make the file executable with chmod 755 myscript.sh, and run that script with sudo myscript.sh
Approach #2: long string of commands
You need something with superuser privileges to run multiple commands. That would be shell, ( any shell for that matter, bash or sh ) . Shells have a -c flag, which tells them to run a command or a set of commands separated by a semicolon ;. Simple example: sudo bash -c 'apt-get update; apt-get upgrade'. In particular, kyodake's answer can be re-done like so:
sudo bash -c 'apt-get update;apt-get install --reinstall aptitude deborphan mate-desktop; aptitude remove '?and(?reverse-depends(unity),?not(?reverse-depends(?exact-name(mate-desktop))))';aptitude remove '?and(?reverse-depends(ubuntu),?not(?reverse-depends(?exact-name(mate-desktop))))';aptitude remove '?and(?reverse-depends(gnome),?not(?reverse-depends(?exact-name(mate-desktop))))';apt-get install --reinstall mate-desktop;deborphan;apt-get --purge remove $(deborphan);deborphan --libdevel;apt-get --purge remove $(deborphan --libdevel);deborphan --find-config;dpkg --purge $(deborphan --find-config);apt-get autoremove;apt-get clean;reboot'

Lengthy ? Yes. This approach works better when you need to run just a few commands with sudo.
Approach #3: playing with sudo timeout
By default, the sudo privilege times out after 15 minutes. So if you are certain all those commands won't take that long, you could run the first command with sudo and will be prompted for password; for all the subsequent commands you won't be prompted, but you still need to type sudo.
Approach #4: using root shell
As kyodake suggested himself in the answer, log-in to a root shell with sudo -i to use the root privilege until you exit. Note, that this is not recommended for security reasons. Unless you are 100% certain you will remember to log out once you are done working and no-one will get into your root shell, then... use this approach at your discretion.
Comment: "By default, `sudo` privilege timesout after 15 minutes" - that doesn't mean that all commands will be executed with `sudo` privilieges for 15 minutes, it only means that you won't have to type password each time you use `sudo`.
Comment: @gronostaj noted, already edited my answer
Answer: Copy-pasting the script will work, and the commands will be executed one after the other;
However the problem here are the $ / # characters at the start of each line, which would break each command; removing them is mandatory before running the script in any way.
I think the fastest / most direct way to do this would be to process it and to run it at the same time using the following method:

Selecting the script, skipping the first line, as it is (i.e. including the # characters at the start)
Copying the script using Ctrl+C
Hitting Ctrl+Alt+T
Typing sed 's/^.//' <<EOF | sudo bash
Hitting Enter
Pasting the script using Ctrl+Shift+V
Hitting Enter
Typing EOF
Hitting Enter again

Advantages against creating a script on purpose and running it:

It's quicker
There's no need to create any file
There's no need to process the script to remove the $ / # characters

Here's an example using this script:
# whoami
# echo command1
# echo command2
# echo command3

ubuntu@ubuntu ~ % sed 's/^.//' <<EOF | sudo bash
ubuntu@ubuntu ~ pipe heredoc> # whoami
ubuntu@ubuntu ~ pipe heredoc> # echo command1
ubuntu@ubuntu ~ pipe heredoc> # echo command2
ubuntu@ubuntu ~ pipe heredoc> # echo command3
ubuntu@ubuntu ~ pipe heredoc> EOF
root
command1
command2
command3


Find two parallel lines containing a set of points in 2D

Question: I have a set of discrete points (at most a single $y$ value for a given $x$) and I need to find two parallel lines which contain all of these points and minimize the distance between them. Note that the lines do not have to be parallel with the $x$ axis as in the picture, they can have arbitrary angle. Is there a well known way of solving this?
Comment: In conjunction with a regression line, I have heard of 'prediction intervals' for Y-values given new x-values (i.e, x-values not used to find the line.) If the original x-values are relatively widely spread, then the resulting 'prediction bands' are nearly linear. There is a clearly stated purpose of wanting such prediction bands. // By contrast, you do not give a motivation for wanting to find the parallel lines you request. Knowing your purpose might help someone make sense of your Question. Perhaps more to the point might lead to something that better serves your purpose than parallel lines
Comment: I suggest plotting them on a graph and seeing which points belong to each set.  Then fit straight lines to each set.  Finally compute the distance between the lines.
Comment: There is only a single set of values (e.g., some physical quantity such as temperature sampled by a sensor in discrete time points) so this wouldn't work. Ideally, the process could be completely automated.
Answer: Prediction Interval Bands in Simple Linear Regression.
Following from my Comment, here is a plot of $n = 20$ pairs $(x, Y)$ with
a regression line of $Y$ on $x,$ showing 95% 'prediction interval bands'.
For a new $x_p$ (not used to make the regression line), the corresponding
predicted $Y$-value is between the two curves (nearly linear here) just
above $x_p$ (with 95% confidence).
Depending on the data, it is possible for a few points to lie outside
the bands. If this is undesirable, one can use a higher level of confidence
for the predictions interval (perhaps 99% instead of 95%).
If you will look at the plot very closely, you will see that the 'bands' are
curves. They are a little closer to each other at $\bar X = 10.5$ than
anywhere else.
This is a standard procedure. Formulas for the prediction
interval are given in almost any basic statistics text containing a treatment
of simple linear regression.

Notes: (1) The data were simulated according to the model $Y_i = 10 + 2x_i + e_i,$ where
$e_i \stackrel{indep}{\sim} \mathsf{Norm}(\mu=0,\sigma=2).$ (2) The plot is from Minitab 17 software.
Answer: Choose  a pair of parallel lines as a second degree degenerate conic
$$ ( y-cx- a) (y-cx-b) =0 $$
in which three constants $(a,b,c)$ can be found out by least square methods... like fitting data to a parabola
$$  y -(ax^2+bx+c)=0  $$


How to Protect GPIO when using long wires?

Question: I want to connect a normal toggle switch with one of the gpios pins of a tasmotized esp01 with a wire about 20 feet in length. When I tried this before, I lost the GPIO pin mostly due to the high current drawn from GPIO because of the long wire. How can I limit current and protect the gpio and esp completely?
Comment: There are reasons why technology such as rS232, RS485 or 4-20 mA DC loop exist, not just for providing isolation, but for ability to send data over twist pair for distance, with noise immunity and without signal degradation.
Answer: Thanks for the tips. I have seen one more solution to protect GPIO pins which was never mentioned here. This uses optocouplers. The anode or the cathode of the optocoupler can be connected through a switch to vcc or ground respectively. With respect to the optocoupler a series resistance will also needed to be used. The GPio and ground are connected to the 3 and 4 pins. when the switch is engaged, the 3 and 4 pins are connected.
The limitation is that not all GPIO can be used as some needs physically pulled to ground like Rx pin of esp8266.
Answer: You can use a resistor with a transistor in order to control something that requires more power.  This will protect your io pin. Values depend on what you are specifically connecting to the io pin.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: You don't say how your switch is connected.
The standard way to protect a GPIO pin is with a series resistor and ideally a couple of Schottky diodes to clamp it to the supply rails.
Unless you're expecting particularly high voltages or require high speed data then around 100 ohms in series is reasonable.
The diodes go from the input pin to the processors power and ground pins. They are connected so that if the input is between 0 and 3.3 V they are reverse biased and have no effect. But if the input goes above VCC or below GND then the appropriate diode turns on and clamps the voltage. The series resistor limits the current that can flow in this situation and so prevents the diode from getting overloaded. In the image below this means pin 1 of the BAT54-S (the lower right one) goes to GND, pin 2 to 3V3 and pin 3 to your signal. Watch out, different manufacturers sometimes number the pins in different orders.
In theory the diode isn't needed. The chip will include the equivalent diodes internally. However they aren't particularly good ones and will be more susceptible to failure, counting on them is never a good plan. The external ones will clamp sooner and harder and are easier to replace if something does fry.
Just for clarity the resistor is on the outside of the diode. The signal path is: Outside world - resistor - clamping diode - ESP32 pin.


Lync/ Skype4Business App saves Chat History locally?

Question: I hope this is in scope of this stackexchange. I was wondering, if the chat history is saved servers-side (https://msdn.microsoft.com/en-us/library/office/hh243707%28v=office.14%29.aspx), is it then additionally saved locally, on the phone?
Answer: The conversation history in Lync Server 2013 was device-specified. It was stored in your Lync 2013 client, and in an Outlook folder labeled "Conversation History", depending on which device you used for that conversation. Example: You used a Laptop, the "Conversation History" folder was used. You used a phone, it got logged on on the phone Lync client.
Now with Skype for Business this was improved. Now all conversation history is stored server-side. Which means that all your devices can see the same Conversation History. BUT you need Exchange Server 2013/2016 or Exchange Online and also need to enable this feature via powershell:
<code>Get-CsClientPolicy -Identity Global |Set-CsClientPolicy -EnableServerConversationHistory $true
</code>
Comment: The question is, if the conversation history is stored server-side, is it then additionally saved locally?


Plugging USB hard drive put my Mac to sleep

Question: I just plugged a USB hard drive into my MacBook Air and for some reason it immediately went into sleep mode (it also stopped the music I was playing on iTunes). What could be the issue? Is it something I should worry about? I just tried to plug it in again but nothing weird happened, the drive works fine.
Answer: This can happen if for some reason it pulls more power then the computer can handle.  If this happens only once, I wouldn't worry about it too much, however if it becomes a repeat issue, it could mean there is a problem with the power regulation, the USB port, or both.
Comment: Agreed, but the computer also shouldn't go into sleep mode just because a device was connected to it.
Comment: That shouldn't (not can't) happen: OS X is supposed to simply refuse to provide power for it and provide a "To prevent damaging your computer, the USB device drawing too much power has been disabled. Other devices may have also been disabled. When you disconnect the device drawing too much power, your other USB devices will be enabled again." message.


Has a two-letter country code been proposed for use by independent Scotland?

Question: If it doesn't already have one, what would Scotland's two-letter country code likely be, in the event of its gaining independence?
I've tried searching a little but it seems that Scotland simply doesn't have any such code. As one blogger notes (but in the context of internet domain codes),

If a domain code has any more than two letters, then it is not a Country Code Top-Level Domain, but a Special Interest Domain. ... Even the Isle of Man, Guernsey and Jersey have their own internet country codes (.im,.gg and .je respectively) and there is no reason for Scotland to settle for anything less.

SC would seem a likely candidate, except it's already taken by the Seychelles. (SO, ST, SL, SA, SN, and SD are also already all taken.)
Comment: No code has ever been assigned, so there can be no correct answer to this (old) question, answers are speculation.
Comment: @JamesK: If you know exactly how these two-letter code assignments work and know for sure *why* there can't possibly be any answer to this question, then please add an answer explaining. Otherwise your comment itself is just mere speculation.
Comment: If the question was "How are country top level codes assigned" then it is not a matter of governments or policies, and so off topic.
Comment: The problem with this question is that you're asking about a specific hypothetical future decision, which is primarily opinion-based. I wouldn't mind a question in the form of "How are country codes assigned?", which is *not* opinion-based (and I disagree with James that such a question would be off-topic).
Comment: For **years** sometimes I've been suddenly remembering this question, and planning to give a better answer. Even if I'm no longer part of this site altogether. Finally I decided to do it, but it's closed. Pity.
Answer: There's a lot of possibilities, and it's impossible to say which will be followed right now.
Some possibilities include:

.ab, taken from Alba, the Scottish Gaelic name for Scotland.
.ce, taken from Caledonia, the Latin name for Scotland.
.sc, .sk, or .sl, ISO3166-1 supports transitional reservations, which provide a 5-year period for transitioning a reassigned code.  It's possible for Scotland to acquire an already-used code from a smaller country, although I don't know what the mechanics of that would be.
Comment: Also, `.sq` (phonetically equivalent to `.sc` or `.sk`) is still unassigned.
Answer: I see SQ being used successfully for Scotland:
https://www.banknotes.com/sq.htm
Answer: If Scotland gains its independence as a result of the upcoming referendum, I assume that the ISO 3166-2 code "SCT" will be taken over into ISO 3166-1 for the three letter code. For the two-letter code, however, neither SC nor ST is available. CT is, however. AB might be used for "Alba".
Answer: '.ab' is the most likely choice. If Abkhazia became independent, '.ah' could be used, or indeed '.ak'.
I don't see '.ce' becoming the code, because a Scottish Gaelic name is going to be preferred and seem more relevant to a Latin name.
But what will the number plate code be?
Also, the existing GB code might have to be changed as a significant part of Great Britain will have become a new country. The country code of the UK may become UK for number plates to include NI more, but, obviously, the ccTLD will remain the same.
Answer: I was thinking .aa (from the Scottish Gaelic name) because .ab would be good to keep around in case Abkhazia ever becomes independent of Georgia.
Comment: It's certainly possible, but I doubt they'd skip a given code on the chance that it might be needed later, or else `.sc` or one of the other more obvious ones would have been reserved for Scotland in the first place.  That said, `.aa` sortof makes more sense than `.ab`, since `.al` is already taken.
Comment: In that case, we should reserve for all regions (and maybe individual cities) in all countries. Theoretically every region or city can be occupied by other country, can be made genocide of one or several nationalities that are living there and after can be made referendum for independence by remaining people and to make new "country".
Comment: Actually, reserving more codes for certain sub-national regions might be good; I know it's already done for Jersey, Guernsey, Isle of Man, Gibraltar, Bouvet Island, Svalbard and Jan-Mayen, Puerto Rico, Taiwan, Hong Kong, Macau, and the Cocos Islands, none of which are independent, and some of which are barely inhabited. More ideas: `wa` for Wales | `en` for England | `qb` for Quebec | `ek` for the Basque Country (from "Euskal") | `ct` for Catalonia | `gc` for Galicia | `an` for Andalusia (currently Netherlands Antilles, but being phased out) | `os` for Ossetia | `ku` for Kurdistan
Comment: I also realize that the Catalan linguistic and cultural community has long had the `.cat` TLD, and that the provisional government of Kurdistan already has `.krd` but this is about more than TLDs.
Comment: in any case, `.aa` is in the private use area, so it can't be used for a country.


What's a helpful flag?

Question: I have a (i.e. only one) helpful flag on my profile page and being relatively new to this community, am not sure what it means. Is it a good or bad thing and why/how did I get this?
Answer: If you click on the number, it will take you to a summary of your flagging history.
When you flag a post (for not being an answer, or for rudeness, or for being a duplicate, etc.), it gets extra attention by high-rep users who can take action to close/delete the post. Or in cases of custom write-your-own-text flags, only moderators will see the message, and they can choose to take action based on it.
If the high-rep users end up doing what your flag suggested, it is automatically marked as helpful. If the moderator who sees the flag agrees it was a good thing to flag, they will mark it as helpful (this is independent of whether they actually take action or not). Thus helpful flags are a good thing -- they indicate that the community things you did a good job bringing something to our attention.
By the way, after a while everyone accumulates a few unhelpful flags too. Don't stress over those, but take them as feedback from the community that you don't need to worry about those posts.
Comment: Note that as a non-moderator, I can't see your flagging history, so I can't explain that one particular helpful flag.
Comment: It was for an off-topic question - pretty standard and not much explanation needed, I think, beyond what you've given here.

What's a helpful flag?


Yu-gi-oh! is it worth it?

Question: I have heard from card shops that Yu-gi-oh! is not worth getting into, because it is becoming to expensive. I just wanted to run the original Kiba deck, which i am very fond of, but i doubt it would hold up today. Does anyone have tips on how an old Yu-gi-oh! player can be relevant? Maybe even there is a card game out there that mimics the classic style?
Answer: Some people have old-school leagues at their local game shops where they play with older cards. If you don't have something like that in your vicinity, and you don't have any friends to play old-school Yugioh with, it's hard to recommend getting into it if you want to play old-school.
If you are also interested in normal, "modern" Yugioh, be aware that today's Yugioh plays a lot faster and is a lot more complicated (with tons of additional rules) than it was at the time when the original starter decks were released.
For the most part, the really expensive cards are those which are used in the most popular tournament decks. If you want to play a deck that is not used in the tournament scene, it's very possible that it is cheap to get.
As for your deck choice in your question: Besides having absolutely no chance of winning against even decks that would be considered "bad" today, the original Kaiba starter deck is also expensive as hell to get, because it's so old. I would recommend the newer Kaiba decks (e.g. the Kaiba structure deck) if you want Kaiba. Although those also have no chance against tournament decks, it can be played against the Yugi structure deck in a balanced way with friends.
Comment: I can attest to the game being faster paced and  old cards not holding up. Eight years ago, I came into a casual tournament at my game store with a deck that only had cards from the first few years. Turn 1 had my opponent play several cards and synchro summon a 2400/2000 monster with a nasty effect. All I could do in response was put an 1800/600 monster with no effect in defense mode. It all went downhill from there and was over by turn 3. I imagine an old deck would fare even worse today.
Comment: _if you want to play old-school_ I would suggest play videogames too. For example, I play Yu-Gi-Oh! Forbidden Memories, Yu-Gi-Oh! tag Force 5 and Yu-Gi-Oh! TDOANE (ygopro) mostly against AI, but it's fun. I have played with a 60 trap deck only "old trap cards" and I had win a few duels.

Yu-gi-oh! is it worth it?


Setup VPN on Linux, connect through ssh

Question: I want to securely connect to linux through ssh. I heard that to setup a VPN is more secure.
But I don't know how to setup VPN-connect-only in Linux.
I want to restrict directly connection except through VPN.
Answer: VPN stands for Virtual Private Network. SSH stands for Secure Shell.
VPN simply provides a more secure (and perhaps more convenient) means of accessing your servers across insecure or public networks using other protocols.
Think of it this way.
The VPN is like a Turducken. The SSH protocol is still necessary to actually get to your server, and is like the birds on the inside. Most people can't SEE inside the turkey to know what is in there, but you know what it is and have the keys (knife) to open up the VPN packets (outer turkey layer) so that you can get at the inner bird.
In short, You cannot connect to your server ONLY through VPN without using some other protocol to handle logins, such as SSH. They are not mutually-exclusive.
Comment: ... I have no idea what a Turducken is
Comment: Courtesy of Wikipedia: A turducken is a dish consisting of a de-boned chicken stuffed into a de-boned duck, which itself is stuffed into a de-boned turkey. The word turducken is a portmanteau of turkey, duck, and chicken or hen.
Comment: I want to know how to configure VPN-connect-only in linux.
Comment: That's a rather vague request. I'd suggest editing your answer and providing a more verbose request as to exactly what you mean by that statement. A 'VPN-only-request' COULD mean that you want to connect using the VPN protocol which is impossible because it doesn't do that OR that you wish to restrict access to the remote machine to only those machines on the VPN. You need to update your question before you can reasonably expect further assistance.
Answer: As far as I know ssh is undoubtedly secured. However if you want to configure VPN on Debian Linux, You can follow this link.
Comment: I want to know how to configure VPN-connect-only in linux.
Comment: What do you mean with VPN-connect-only?

Setup VPN on Linux, connect through ssh


Help proving that the order topology is a topology

Question: I have been looking into topology recently and have run into a brick wall with the order topology.  A lot of the sources that I have been looking at have brushed over the proof that the order topology meets the axioms of a topology.  I can prove that the whole space and the empty set are in the topology, but I have trouble proving the finite intersection and arbitrary union are in the topology.  It seems easy with the properties of a metric space but without this idea of a metric I can't visualize how this would work.  Any help would be greatly appreciated.
Comment: What definition of order topology are you using?
Comment: Please try to make the titles of your questions more informative. For example, *Why does $a<b$ imply $a+c<b+c$?* is much more useful for other users than *A question about inequality.* From [How can I ask a good question?](https://math.meta.stackexchange.com/a/589/): *Make your title as descriptive as possible. In many cases one can actually phrase the title as the question, at least in such a way so as to be comprehensible to an expert reader.* You can find more tips for choosing a good title [here](https://math.meta.stackexchange.com/a/10144/).
Comment: Thanks for the advice is there any way to edit my question? @shaun
Comment: Use the [edit] button.
Comment: found it thanks
Comment: You're welcome :)
Comment: Usually the definition is by using the subbase of all upper and lower segments. Then there's nothing to prove.
Comment: basis for a space X $ (a,b) \cup [\alpha,b) \cup (a,\beta] \ where \ a,b \in X, \alpha \ is \ min(X), \beta \ is \ max(X) $.  so for example in the first uncountable ordinal $\omega_1$ we get basis $ [0,b) \cup (a,b)$ since there is no max element.  Hopefully that makes sense.
Comment: If it's defined by a base you only have to check the conditions for a base.
Answer: Check that the set $\mathcal{B}$ is a base for a topology on $(X,<)$, having at least two points, where $\mathcal{B}$ is given by $$\{(x,y)\mid x < y, x,y \in X\} \cup \{[\min(X),x)\mid x \in X\} \cup \{(x,\max(X)]\mid x \in X\}$$
where the latter two are only used if $\min(X)$ resp. $\max(X)$ exist.
So suppose both exist (that's the most "work", if neither exist we only have the open intervals to deal with, which is a bit easier), and let $p \in X$. If $p=\min(X)$ then we have some $p\neq q \in X$, and we know that $p \in [\min(X),q) \in \mathcal{B}$. If $p=\max(X)$ then we have some $p \neq q \in X$ and we have $p \in (q,\max(X)]\in \mathcal{B}$. If neither of these cases holds, $p$ is neither the minimal nor the maximum of $(X,<)$ and so we have $q_1,q_2 \in X$ with $q_1 < p$ and $p < q_2$. But then $p \in (q_1, q_2) \in \mathcal{B}$.
This shows that $\bigcup \mathcal{B}=X$, which is the first condition to be a base.
Now, let $B_1,B_2$ be two members of $\mathcal{B}$ and let $p \in B_1 \cap B_2$.
If $p = \min(X)$ then $B_1$ must be of the form $[\min(X), q_1)$ (as no other types in $\mathcal{B}$ can contain $\min(X)$, as those imply an element strictly smaller than $\min(X)$ which cannot be), and likewise $B_2$ has to be of the form $[\min(X), q_2)$. But then $x \in B_3:=[\min(X), \min(q_1,q_2)) \subseteq B_1 \cap B_2$ and we are done checking the condition for intersections in this case. The $p=\max(X)$ is quite similar, check it.
So we can assume $p \notin \{\min(X),\max(X)\}$ and $B_1 = (q_1, q_2)$, say, and $B_2 = (r_1, r_2)$ for some $q_1 < q_2, r_1 < r_2$ in $X$ (even either is of one of the two special types, we could safely remove the min/max endpoint and have an open interval instead). Then take $B_3 = (\max(q_1,r_1), \min(q_2,r_2))$ and verify that $p \in B_3 \subseteq B_1 \cap B_2$, finishing the intersection condition check.
This makes the order topology's definition well-defined.
I usually prefer to take all sets $$\mathcal{S} = \{(x,\rightarrow):=\{y \in X: y > x\}\mid x \in X\}\cup \{(\leftarrow,x):=\{y \in X: y < x\}\mid x \in X\}$$
and define that as a subbase (so that the order topology is the smallest topology that contains $\mathcal{S}$) and the induced base then becomes exactly $\mathcal{B}$, as can easily be checked as well.
Comment: Thanks a bunch, this is super helpful.


Retrieve Memos off ipod

Question: I have recorded a memo and while I was recording it. The iPod died. When I turned it on it show I taped something by show 0 minutes. I try to share and it says file is 2.7mb but won't let me share and I can't hear it. How do I retrieve this?
Answer: I'm not 100% on this but I think you can use something like this software called iBrowse that will allow you to view files from your Mac or PC. Assuming the recording is not somewhere in the restricted portion of the file structure, you can get it from there. The file should be .AAC format.
Another way, again assuming you have access to where it was saved, is to use disk mode to browse the files. Apple has a nice support page on that so I won't elaborate: Disk Mode
Hope that helps!

Retrieve Memos off ipod


Can the terms 'dude' and 'guy' be applied to women?

Question: I heard 'dude' used to address a woman. I also read in a dictionary that 'guys' could be used to address a mixed or even completely female group of people (but the same doesn't go for 'guy'). What would you say about that? Are these all limitations concerning the words' applicability to females?
Comment: @dan - on ELL Stack Exchange, if a question cannot be rigorously answered, because the subject is a matter of opinion, it qualifies for (is liable for) closure.
Comment: You can use those words for mixed, or either sex groups, unless you think you should not, which is another way of saying _this is a matter of opinion_, and thus liable for closure.
Comment: In UK, "Hey guys" can be addressed to a mixed group. We don't use "dude" much here even for men.
Comment: @MichaelHarvey What does "liable for closure" mean?
Answer: Whether "guys" can be used to address a group of mixed males and females is debatable. I have heard people say that. It's not unheard of. I would not, as a woman might be insulted by it. Either because she thinks you are leaving her out by "only addressing the guys", or that you are insulting her femininity by calling her by a masculine word. It's easy enough to use other words that clearly can refer to both, like "folks" or "people" or something that specifically describes the group, "co-workers" or "friends" or "taxidermists" or whatever.
"Dude" is a word pretty much limited to very informal use in some sub-cultures. If you were having a business meeting of the company's accountants and you began, "Hey dudes ...", that would be considered distinctly odd. It's appropriate if you're talking to a group of surfers on a beach in California, or a group of skateboarders.


ModuleNotFoundError: No module named 'digitalio' HELP

Question: I have been following a YouTube tutorial on how to setup the Raspberry Pi Pico H as a midi device. While programming, I came accross an error ModuleNotFoundError: No module named 'digitalio'. I'm using a mac with thonny IDE and I cant seem to find any help for this issue. ive tried installing it via pip and pip3. I am using circuit python but it also doesnt work on micro python. It's most likely an easy fix but my smooth brain cant figure it out.
Comment: The digitalio module I know of is to facilitate IO on the GPIO pins. Was the error during the install or while running your own code?
Answer: I have found the answer to my own question. You need to install the Adafruit_Blinka library from the tools tab. My brain is SMOOOOTH


Predict XPS Spectrum of Organic Monolayers on a Semiconductor

Question: X-ray photoelectron spectroscopy (XPS) is a particularly useful technique for examining the surfaces of all sorts of materials. Organic monolayers are particularly difficult to characterize completely via this technique due to the fact that many carbon peaks do not differ much by chemical shift. Traditionally quantitative information is obtained via a lot of guess-work and forced peak fitting. It would be better to predict peaks shapes and peak positions beforehand to aid in the interpretation and prevent a terribly mis-guided interpretation. How well can theory help the non-specialist with this? I wouldn't have the time to develop a program to do this either. Preferably one could point me to the right direction in terms of a research paper/software.
Answer: Some density functional theory packages, such as Quantum Espresso, can calculate XPS core level shifts using the pseudopotential formalism. See Phys. Rev. B 74, 045430 (2006).


The process cannot access the file because it is being used by another process

Question: I am adding images to a FlowLayoutPanel control via the following code
Dim WithEvents Pedit As DevExpress.XtraEditors.PictureEdit

Private Sub LoadImagesCommon(ByVal fi As FileInfo)
        Pedit = New DevExpress.XtraEditors.PictureEdit
        Pedit.Width = 133
        Pedit.Height = 98
        Pedit.Image = Image.FromFile(fi.FullName)
        Pedit.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom
        Pedit.ToolTip = fi.Name
        AddHandler Pedit.MouseClick, AddressOf Pedit_MouseClick
        AddHandler Pedit.MouseEnter, AddressOf Pedit_MouseEnter
        AddHandler Pedit.MouseLeave, AddressOf Pedit_MouseLeave
        FlowLayoutPanel1.Controls.Add(Pedit)
    End Sub

The problem is that i get the following error The process cannot access the file xxxx because it is being used by another process. when i try to delete the images that i loaded on the previous step.
                    FlowLayoutPanel1.Controls.Clear()
                    FlowLayoutPanel1.Refresh()
                    For Each fi As FileInfo In New DirectoryInfo(My.Settings.TempDirectory).GetFiles
                        RemoveHandler Pedit.MouseClick, AddressOf Pedit_MouseClick
                        RemoveHandler Pedit.MouseEnter, AddressOf Pedit_MouseEnter
                        RemoveHandler Pedit.MouseLeave, AddressOf Pedit_MouseLeave
                        File.Delete(fi.FullName)
                    Next

So what am i doing wrong here?
Answer: Image.FromFile actually locks the file it loads and only releases the lock once it is disposed.
The solution is to draw the image into another image's graphics context (thus effectively copying it) and dispose the original image.
Answer: Aha! Thank you Konrad.
after some reading, i found another workaround too.
Dim fs As System.IO.FileStream
fs = New System.IO.FileStream(fi.FullName, IO.FileMode.Open, IO.FileAccess.Read)
Pedit.Image = System.Drawing.Image.FromStream(fs)
fs.Close()

Update:
and here is what Konrad suggested. For all the newbies out there, just like me :)
 Dim imgTemp As System.Drawing.Image
 imgTemp = System.Drawing.Image.FromFile(strFilename, True)
 Pedit.Image = New System.Drawing.Bitmap(imgTemp)
 imgTemp.Dispose()
 Pedit.Image.Save(strFilename)

which is better since the Image object cannot have its Save method called after the FileStream has been closed.
Comment: Your solution is better than mine.
Answer: I found this solution is the best to unlock the image file after it has been loaded to the PictureBox :
PictureBoxName.LOAD(image file name with full path)


How to avoid overfitting in stratified k-fold cross validation methods for classification?

Question: I'm using stratified 10-fold CV on my data set that is imbalanced. I've read in articles that this method is useful for such data set. But I'm not sure if I'm using this method as well. In each fold, there is the same number of positive and negative instances; so, some positive instances are repeated in some folds since there is less number of them in my data set.In the training phase, 9 folds are used for training, so some instances are repeated. My classifier gave high accuracy. I doubt if over fitting has happened, or my implementation of stratified CV is wrong. Note that the size of my data set is 486 rows.
Comment: When saying your dataset is "imbalanced", I would mention the exact ratio. For example, I deal with data where the positives represent <1% of the data - I doubt that is your case here (since you'd only have 5 positives). Knowing the ratio of positives to negatives will help people understand the problem you're facing.
Answer: It sounds like you're conflating two different approaches: stratified sampling and oversampling.
In stratified sampling you assign folds by class, for example to ensure that you have 10% of each class in each fold (and thus you roughly maintain your original ratio of positives to negatives).
Then it sounds like once you performed stratified sampling, you oversampled your positives. This is one approach when dealing with highly imbalanced data (there are many others, such as undersampling and SMOTE).
Assuming that you assigned the folds first and then performed the oversampling you shouldn't have a problem with overfitting.


Shifting .dwg file to align with a shapefile

Question: I'm trying to integrate data in a .dwg file collected by surveyors  into an ArcView 10.2 project I have projected as NAD83 UTM Zone 10 N.  The survey data is in an undefined coordinate system but I have values for the translation parameters, which are below as described by the surveyors.
Which utilities can perform this transformation?
Our surveys were based on a local assumed coordinate system.
To translate our local coordinates to UTM, you will have to (1) apply a scale factor to your UTM mapping coordinates of 0.99960196 and (2) apply the following shifts in northings and eastings : ΔN = 5 441 341.306 & ΔE = 491 604.143.  After going thru this procedure, you will have a list of UTM mapping coordinates.
Comment: why when I bring in my dgn file into GIS it warps the dgn... I have to then place 8 dots to line things up
Answer: If I understood the surveyor's directions correctly, you should be able to make a custom projected coordinate reference system for the CAD data.
Let's say that standard UTM coordinates are calculated like this:
e = fe + k0 * x
n = fn + k0 * y

where e = UTM easting, n = UTM northing, k0 = 0.9996, fe = 500000.0, fn = 0.0, and x and y are the proto-projected coordinates. The direction say to do:
e * sf - 491604.143
n * sf - 5441341.306

where sf = 0.99960196
Do a substitution:
(fe + k0 * x) * sf - 491604.143
(k0 * y) * sf - 5441341.306

or
(sf * fe) + (sf * k0) * x - 491604.143
(sf * k0) * y - 5441341.306

and finally,
local grid x =  0.999202119216 * x + 7996.916608
   local grid y =  0.999202119216 * y - 5441341.306
So create a new projected CRS based on transverse Mercator with a scale factor = 0.999202119216, false easting = 7996.916608, and false northing = 5441341.306
Note: If the data's not lining up and looks like it's too small, try using the inverse of sf instead, 1.00039819849893 and rerun the equations above to calculate the new values.
You might ask the surveyors in your next contract to return grid coordinates IN UTM or State Plane instead.
Answer: I don't know how accurate you have to be in your maps but georeferencing should get you close. The how to is referencing an older version of arc but it should be basically the same as performing this in 10.2
http://gpshort.uga.edu/instructions/gis/Convert%20an%20AutoCAD%20file%20to%20a%20Shapefile%20and%20Georeferencing.pdf
Answer: The surveyor wording is a bit unclear, and I have not done this on UTM yet, so without testing and verifying this, I cant be certain i have it right, but the formula is correct.  May just need a slight tweak (i.e. subtracting the shift values instead of adding OR using the inverse of the scaling instead of the actual).
Take your current UTM Northing (0.0) or Easting (500000), multiply by the scale factor the surveyor provided (0.99960196), then add the shift value the surveyor provided.  The resulting values should be entered into the Northing or Easting values in a new modified Projected Coordinate Systems Properties dialog for the UTM Zone 10N properties.
(Easting * Scale Factor)+Easting Shift = New Easting
(Northing * Scale Factor)+Northing Shift = New Northing
OR
(500000*0.99960196)+491604.143 = 991405.123
(0.0*0.99960196)+5441341.306 = 5441341.306


Mirroring an entire machine

Question: What's the most appropriate way to constantly mirror all the settings and data from one Linux machine to another? I have a critical server, which I'd like to have a "hot spare" available for in case any component failure takes it offline. I have RAID and redundant power supplies, but a failure in memory/CPU/motherboard could still take it offline. Is using rsync on a hourly/daily basis to copy over the filesystem to an identical machine enough?
Comment: You should probably mention what this data is. Are you talking about a MySQL DB, development files...?
Comment: I'm referring to the entire machine in general, which may have multiple databases (MySQL, PostgreSQL, etc), web server (Apache), samba, DNS, etc.
Comment: The data the this machine stores has a huge bearing on strategies for backup/replication. rsync may not be good enough especially with very busy servers. That being said you can do some pretty fancy stuff with "snapshotting" LVM and then restoring to your hot spare box.
Answer: There isn't "the" way to do this, but a whole pile of ways that depend on your needs.  rsync can do enough copying that recovery is possible, but isn't necessarily the answer you need.

Is using rsync on a hourly/daily basis to copy over the filesystem to an identical machine enough?

Good question, is it?  There are two issues that will present:

You can lose up to one hour, or one day, of changes to the system and your data.  Is that acceptable to your business?
rsync takes time to run, so if the whole process takes five minutes you will have some files from 12PM, and some from 12:05PM.  Is that acceptable to you?
If you lose the source machine during the rsync process you might have a broken clone.  Is that acceptable to you?

You should also watch out that, for example, database servers don't really cope well with nothing but rsync clone backups unless you take extra care - they are very sensitive about lots of different files matching, and if they are running at the time you rsync, you can have problems.
You can improve on point 2 using LVM snapshots, which will give a consistent instant at which you capture the machine - that makes your clone the equivalent of having a hard reboot when you start it up, which is not too bad to recover from.
You can try and configure rsync to minimize the risk that 3 bites, but you can't totally eliminate it.
Anyway, other places to look are shared file systems like GlusterFS, or shared disk tools like DRBD, which give you different trade-offs around recovery and reliability.
Ultimately, though, it is all about what your business needs and the trade-off.  Good disaster recovery backups help mitigate the problem.
Answer: I would use something like Pacemaker/heartbeat + drbd to handle the availability and data syncing issues.
Pacemaker would manage machine-level resources such as the networking failover (moving IPs between systems), starting and stopping applications (apache, mysql, postgres, etc).
DRBD would be used to do the on-disk block-level replication to help ensure that your data is as up to date as reasonably possible between your primary machine and hot spare.
Answer: There is no one solution for backups.
For non DB data, I agree with Travis.  Pacemaker/heartbeat & DRBD are the way to go.
For settings, it depends how fancy you want to get:

rsync
version control
configuration management tools (puppet, cfengine, etc)
ssh + ....

take your pick.
Databases are another beast.  Copying their files may work, but I don't recommend it. Most db engines have some form of replication built in these days. See if your's does and if it meets your needs.

Mirroring an entire machine


What tag to use for optical networking?

Question: There's already a fiber for fiber questions, but I think we need another tag for optical networking (ROADM/DWDM/etc).  I suppose it could just be optical-networking but that's doesn't really roll off the tongue.  Suggestions?
Answer: I would suggest just using "optical". The -networking suffix seems redundant. I think that's clear enough in the context of the site. It should probably be combined with "dwdm" or other tag as appropriate for the specific technology involved.
Comment: In the absence of tag wiki excerpts, this use of "optical" .vs. "fiber" was completely non-obvious until I found this discussion over here in the meta-site. Simply appeared to be a mess of redundant tags - optical, fiber, optics, and one for passive optical networking.

I have submitted excerpts (without tackling the main Wiki entries, which is either a lot of work for stuff you can search on elsewhere, or subject to being a plaigairist if you take the easy route) for everything but optics, after finding this discussion. I still have no idea what "optics", as opposed to the other three, is.
Comment: In general, I'd like to suggest that if folks think a tag is a good idea, they take on the responsibility of making at least the tag wiki excerpt - this sector alone seems to be illustrating that the logic can be clear as mud when bare tags that have no obvious reason to be different are available.

What tag to use for optical networking?


Creating Slope Map Using Contours in ArcGIS Desktop?

Question: I am trying to create a slope map. I have many contour elevation files. I tried to use the slope tool in ArcToolbox, but it calls for raster files and I'm working with vector data.
Comment: Do you have access to the 3D Analyst extension?
Answer: You first need to make a raster DEM from your contours. That requires the Spatial Analyst extension, and uses the Topo to Raster tool (Spatial Analyst | Interpolation toolbox). That elevation raster can then be used as the input for the Slope tool.
Note that since this is an interpolation process, it is estimating the elevation values between the contour lines. That's simply a source of possible error to be aware of in subsequent analyses and/or interpretation of results, however.
Comment: The topo to raster tool is intended for a hydrological DEM but that would probably suit here. You should really try to get more information: spot heights, lakes, creeks.. to feed the topo to raster tool for better results but still don't get your hopes up too high as DEM derived from contours will have some stripe effect from contours. The better the source, the better the results... oh, and if you find spot elevations remove them in close proximity to contours to avoid arguments, only use them for flat areas between contours.
Answer: The other answers cover the Spatial Analyst extension. Another option is the 3D Analyst extension.
You can create a TIN from your contours, then convert the TIN to a raster, before calculating the slope.
Answer: In order to make a slope map you need to work with raster data. You will need to make a raster tile (ie: DEM) from your contours. With the output raster you will then be able to make a slope map.
Answer: You can create a TIN from your contours, then convert the TIN to a raster, before calculating the slope, tutorial here https://www.youtube.com/watch?v=ZxRu7nAbDAs
Answer: The first thing you have to do is convert the contour into tin data format in 3D analyst and from tin to raster in data management tool. Then you have DEM of the contour, you can do as many analysis than as you want.


Why won't Tortoise SVN update my ready to go green check folders? (for Garrys Mod)

Question: Whenever I try to update my Wire Mod folders by right clicking Tortoise SVN doesn't appear. There are no options regarding Tortoise SVN when I right click on the files at all. Im fairly angry now because I cant update it and I cant play Garrys Mod correctly without errors and pop ups telling me to update wiremod. I have (x86) as my program files on my "D" drive and I downloaded the 64-bit version of Tortoise too. It was working fine before but now it doesnt....please help me!?
Comment: You might check this old question on SO which seems to be talking about the shell extensions you seem to be missing. http://stackoverflow.com/questions/1057734/tortoisesvn-icons-not-showing-up-under-windows-7 (I'm not sure about the discussion of 'icons' but I've never used Tortoise SVN - I'm guessing the shell extensions were headed by icons?)
Comment: This did explain the problem to me thank you, but I don't really know how to fix the problem know that I really know about it :C
Answer: Use the cleanup feature, there is an option which refreshes the shell overlays. This usually does the trick. Or you could delete the hidden .svn folder in the root of the directory and then checkout again. Sometimes they appear after a system restart. Recently I haven't noticed them to get stuck though, maybe it was happening more often before I switched to Windows 10 but that might be a fallacy.


Topological insulators literature

Question: I started learning things on topological insulators and I got lost in dozens of existing papers on this topic. Could anyone recommend me appropriate literature that explains deeply enough what topological insulators are, how they are related to time-reversal symmetry issue, why the word "topological" is used, what a relation with Dirac fermions and oth. Any recommendations where I could start learning the topic from scratch?
Answer: I think two great reviews on the topic (cited by almost any paper on the matter) are:
M. Z. Hasan and C. L. Kane, Colloquium: Topological insulators, Rev. Mod. Phys. 82, 3045 (2010);
X.-L. Qi and S.-C. Zhang, Topological insulators and superconductors, Rev. Mod. Phys. 83, 1057 (2011);
Answer: There is a book on the topic:
B. Andrei Bernevig, Taylor L. Hughes: Topological Insulators and Topological Superconductors, Princeton University Press (2013).
Comment: Can I download it from somewhere?
Answer: There is this very nice and introductory paper from Soucheng Zhang published at Physics Today!
http://scitation.aip.org/content/aip/magazine/physicstoday/article/63/1/10.1063/1.3293411
It exposes the basic concepts on TIs as well why they are interesting for future applications.
If you read that, please let me know if you liked It!
Cheers,
Graciely
Comment: Thanks Graciely for your suggestion. I will check this out and give my feedback to you.
Comment: Hi @Graciely! I've read the paper. It is really good a good introduction to the topological insulators and motivates to go further into details :)

Topological insulators literature


For how long will the question be closed?

Question: I want to know why the question is closed and I cannot edit it anymore? Because I planned to improve it. I mean I want to make the text question 100% clear without any mistakes, because I got an idea how to make clear. And can you tell me after that if it is OK how I corrected it?

Answer: Assuming you're talking about the question Can I ask Allah To reverse the time till the moment He Will decide to create Pen?, that is going to be closed until the community or a moderator decides that it's worth reopening. The advice in our help centre, particularly How do I ask a good question? and What types of questions should I avoid asking? are worth checking out if you have not already.
As for why you can't edit it any more, that's because it's also been locked, the reasons for which were explained when I locked it:

I am temporarily locking this question to prevent further edits; please take the time to actually think about what you want to ask before asking it (do feel free to discuss it on meta or in chat with others who are willing to help if you are unable to do so yourself), flooding the site with low-quality edits and poorly thought-out questions is disruptive and doesn't actually help anyone.

This lock was set for a week, and will expire naturally; you can edit your question again then. I see no reason to believe that your current "idea how to make clear" will be any better than the fifty-six other edits you made to the question which have, if anything, made it even harder to understand what, if anything, you're looking for in an answer.
I strongly suggest you take this week to figure out what sorts of questions we do encourage here, what you actually want to ask and how to present it as a clear and focussed question that might actually have a chance of being reopened. The blocks and restrictions you're seeing when you try to ask poorly-formulated questions are there for a reason.
Comment: Even if it is "not worthy" it is just for me to know.
Comment: I was trying to make 100% clear text so that I'll no longer get: on hold,unclear etc.. ,and if I fail can you please correct it? Only the last time and next time when I can ask again, I'll try to not happen as now again.
Comment: Good guess, about this what I was talking about.
Comment: Just out of curiosity, is there any post that have beem edited more than that?
Comment: @Medi1Saif Nothing that I know of on this site. You'll see edit chains that long on some of the really popular community wiki stuff on Stack Exchange or FAQ stuff on Meta.SE, but it's not a regular thing.


Is it possible to be a pilot for both the RAF and a Commercial company?

Question: I have always wanted to be a pilot for both the RAF and Commercial airlines.
Would it be possible for me to serve, for say 6 months in the RAF, and then when not deployed work as a commercial pilot. Just asking this as I saw a video a few months ago of a US Air Force member who works for United when he is not working for the USAF.
Thanks - Jay.
Comment: What you probably saw was an Air Force **Reserve** pilot working for United, active duty cannot hold another job.
Comment: I agree it was probably a reservist, but active duty military members may hold another job, it just cannot conflict with military duties. Flying for a commercial airline would likely not work out, but I have known several people who worked as CFIs on the side.
Comment: Ok, thank you for this information, I was just interested.
Comment: I expect the  Royal Air Force Reserves would consider someone who is already qualified for the aircraft.   Most likely someone who has just left the full time RAF with transport experience.
Answer: Basic officer training in the RAF takes 30 weeks, so you're already over your six months, even before you start pilot training.
When you sign up you enlist for a minimum period which varies according to your speciality. Six to twelve years is typical.
Source
Assuming you get through pilot training and make it to a squadron, you're not going to just sit around and wait for a war. There's ongoing training, exercises, active deployments and other duties that will take up your time. Whilst there will be periods where your working life will be 9-to-5, there will also be periods where you'll be working nights, weekends, public holidays, and away from home.
I don't know what the RAF policy on second jobs is, but for practical reasons I can't see that you would be able to drive buses for easyJet or the like.
Comment: As noted by Ron Beyer in a comment above, it is technically allowable for any member of the UK armed forces to have a second job, but it must not conflict with the requirements of their service, which makes anything other than a hobby-job completely impracticable. Even during time-off, there are various levels of requirement to remain available.


In a regression model, how to interpret a IC 95% for R-squared with negative values but with a significant effect of a predictor?

Question: Imagine a regression with 3 predictors and one dependent variable with a sample size over 400. Only one predictor has a positive significant effect, p value equals to .02 aprox. R-squared is low (less than .03) and the R-squared IC 95% includes negative values: I have read that this means my model has worse fit than a horizontal line. Therefore, how to interpret this result? If my model is poor, how can I explain the significant effect of one predictor?
Answer: To check for the significance of predictors, i.e. if at least one of your predictors is useful to predict the response, you should look at the F-statistic. In a multiple regression case, you should test whether all your coefficients are zero.
$ H_o: \beta_1 = \beta_2 = ... = \beta_p = 0$
$H_a:$ at least one beta is non-zero.
You can test this with the F-statistic because it adjusts for the number of possible predictors we have. This is not the case if you look at the individual p values. In the latter case, it is possible that one predictor has a p-value below 0.05 by chance, especially if the number of predictors is large. This is because, loosely speaking, by definition around 5 out of 100 predictors will have a p-value below 0.05.
Comment: Thanks for your answer. In my case I have few predicotrs (probable relevant predicto was not included), so do you think that R-squared IC 95% implies a poor model and therefore, the significant effect of one predictor was by chance?
Comment: Yes, I think that's a reasonable explanation.