Good vim tutorial?

Question: I've constantly heard good things about vim, and now I'm intrigued. The only thing that's putting me off is it's irregular keyboard controls. Does anyone know of any good beginners tutorials for vim?
Comment: I think you'll find, with a bit of experience, that the keyboard controls are wonderful, especially on laptops.  You can navigate and edit your entire document without leaving home row and using a mouse.
Comment: If Vim's controls are hard, try Emacs; they'll fry your brain.
Comment: use ":behave mswin" if you feel like its too foriegn, or, put that in your ~/.vimrc to make it do it that way, you can always put it back using ":behave xterm" if you change your mind. Furthermore, I find everyone should have at least a few mappings of their own to fine tune things, since not everyone learened to type exactly the same way, especially for those who use Dvorák keyboards or other odd layouts (me, at one point, using a modified numpad for editing numeric only documents)
Answer: Vim comes with its own tutorial, for a start. Just run this in a terminal:
vimtutor

The good thing about vimtutor is that it allows you to read about how the editor works while actually using it.
Beyond that, you can take a look at the links here: Vi Lovers page
The nice thing about that page is that it briefly discusses the various links it provides, so you get a sense of which are better or worse and why.
I would add that the best way to get comfortable with Vim is to use it exclusively for a bit. If you end up hating it, fine. Use something else then. However, the only way to train your fingers and brain is to use it. My fingers now do Escape :wq out of habit, even when I'm in a gui email client at work (instead of Mutt).
Comment: @hasen: as they say in the Marines, that sounds like a personal problem.
Comment: The vim tutor is horrible; at least it's horrible at convincing you that vim is actually useful and usable by sane people.
Comment: +1 probably the best way to start learning vim. :)
Answer:
Why, oh WHY, do those #?@! nutheads use vi?. Start here; get motivated and see some excellent examples.
Graphical Cheat Sheet: Keep this under your pillow. I downloaded the image files to my desktop.
IRC Based Vim Tutorial. Chat log of an interactive one-on-one vim tutorial by examples.
Comment: The Cheat Sheet Tutorial is how I learned vi.  Seriously.  I printed out the cheat sheets, put them in front of my keyboard, forced myself to type "gvim" when editing my files, and referred to them as I wanted to do various things.  I spent about two weeks per cheat sheet, and got the hang of it.
Comment: The first link is great. Thanks for that one.
Comment: Yup, read that first one a while ago. It's a good one :)
Comment: That last link is what got me in to using Vim in the first place.
Answer: Stackoverflow: Vim Tutorials
Answer: I found the instructional videos by Derek Wyatt on Vimeo to be very useful. He has uploaded 27 videos, starting with basic editing and describing more advanced features later on.
Answer: "A Byte of Vim" is a book which aims to help you to learn how to use the Vim editor, even if all you know is how to use the computer keyboard.
Comment: +1, I learned Vim by reading that book on my train trips.
Answer: Check this VIM game, its plain awesome:
http://vim-adventures.com/
It's the "Zelda meets text editing" game. Beat the game to master VIM.
I finished 2 levels, 3rd under development it seems.
Also check this. Its good: http://www.openvim.com/tutorial.html
Answer: I think vim recipes is a good to-the-point book.
Answer: I'd start off with the manual page (man vim), but I can see why you wouldn't want to read through the entire thing.
As such, this came up in a quick google search.  It covers some of the more important points, although there are probably more in-depth tutorials.
Comment: Reading the manual page for Vim is nearly zero help for a beginner, since it primarily talks about opening Vim on the command line. Vim's own internal Help is very good, but even that is not a sane way to learn the editor initially. In this case, doing beats reading. Read a short tutorial and edit with it, or use the `vimtutor` program to do both at once.
Answer: In your terminal:
$ vim

Then in your opened vim buffer:
:set syntax=on
:help

When you get familiar with the touch type, you need some customizations to beautify it, like a beautiful color scheme, and an elegant font. Feel free to download my setup at GitHub.

Good vim tutorial?


How to detect entities in Montezuma's Revenge environment

Question: I'm thinking of implementing "Hierarchical Deep Reinforcement Learning: Integrating Temporal Abstraction and Intrinsic Motivation" paper. In this paper authors used some custom object detector for entity detection(eg: Key, rope, ladder, etc) but they did not give any information about this custom detector. Can you please give me a suggestion on how to Implement this object detector?
Comment: The authors of the paper did release the code for the paper on github. You can check it for reference: https://github.com/mrkulk/hierarchical-deep-RL/tree/master/dqn
Comment: @JoãoSchapke I had a scan through the code for the custom object detector, but could not find it. I suspect from the inclusion of template images that it is based on template match, which would indeed be very simple as I suggest in my answer. I'd like to extend my answer to confirm this, but sadly not able to.
Answer: The quote from the paper is:

In this work, we built a custom object detector that provides plausible object candidates.

And in their related submisstion to NeurIPS:

In this work, we built a custom pipeline to provide plausible object candidates. Note that the agent is still required to learn which of these candidates are worth pursuing as goals.

I think that this detects and identifies "screen locations of interest" to create parameterised sub-goals - e.g. one goal might be to make objects A and B coincide. It is also not clear whether static objects such as rope and ladders are included, or the detector is more fine-tuned to "active" entities such as the player, keys, doors, enemies etc.
This also gives a clue:

The internal critic is defined in the space of entity1, relation, entity2, where relation is a function over configurations of the entities. In our experiments, the agent learns to choose entity2. For
instance, the agent is deemed to have completed a goal (and only then receives a reward) if the agent entity reaches another entity such as the door

It implies that the entity detector does identify the player-controlled entity and sets this as entity1 for all the top level goals. All the high level goals are stated in terms of "player coincides with B" or "player avoids C".

Can you please give me a suggestion on how to Implement this object detector?

The implication is that they created something simple and fast that would specifically detect important objects in the game, so that it would find and identify all the objects that could reasonably be used in sub-goals. Objects in old Atari games are visually distinct and simple, so it is likely to be something quite basic. The reference code linked by João Schapke implies perhaps template match because there are suitable images in a "template" directory, but I was unable to find the object detector functions from scanning the code quickly.
It is also important to note that this custom detector was only used to build a selection of sub-goals and detect whether any had been achieved. It was not used as input to the neural networks (which had to learn their own representations of the same objects in order to make decisions), and did not set internal rewards for achieving those sub-goals. The top level policy selected amongst the sub-goals based on processing the video frames - this selection decided the lower level policy's reward. The algorithm used the detector only to assess whether a sub-goal had actually happened, at which point the reward for achieving it would be granted to the lower level policy. Whilst the upper level policy was granted rewards as scored by the original game.
Comment: Thanks, man! this is really helpful


Specifying a subproject's Configuration in Xcode

Question: I have an Xcode project (A) referencing another project (B). By default (as far as I understand it) Xcode will implicitly build the configuration for the B dependency that matches the configuration of the A's target (e.g., "Debug"). But what if I want, say, A to build as "Debug" and the B to build as "Release"? How would I go about specifying that in Xcode?
Answer: I don't know of any easy approach, but you can brute-force it by calling xcodebuild directly for the dependency with a "Run Script" build phase.
I know it was just an example, but if your real goal is that the sub-project be a Release (no symbols) build, then you may have a better experience by just building the sub-project into a library or framework and checking the resulting binary into your version control system. Whenever I have a piece of the system that seldom changes and that I don't want debug symbols for, I go ahead and build it as a static library and check it in. I often go ahead and move the code elsewhere as well (with a README file with the .a that says where the code is and how it was built). This saves time on both build and checkout and is invaluable for large projects in my experience.
Answer: This might help: if the configuration of the project A is not found, Xcode will build Release config as a fallback (or maybe the first config of the list).
Then you can "force" the link using this tip: Xcode custom build configuration causes "library/file not found" for static libraries
Answer: You can specify the default 'fallback' configuration in the project info.
Change from:

Use 'Release' for command-line builds.

to:

Use 'Debug' for command-line builds.

And default will be 'Debug'.
Diffs of project file:
Answer: Yes, this is not naturally supported by Xcode; when you build a target, it builds one configuration of itself and of all dependent targets.
The workaround, as Rob mentioned, is to have a dependent target that's an Aggregate Target type that comprises a single Run Script build phase, which simply invokes xcodebuild -configuration Release (or whatever).


I keep on getting a stray '\302' in program error.How do I fix it.This is in arduino uno

Question: #include <LiquidCrystal.h>

int trigPin = 13;  //sensor's trigger pin connected to pin 13
int echoPin = 7;  //sensor's echo pin connected to pin 11
float pingTime;  //time for the ping to hit the target and back
float ss;  //we will calculate the speed of sound
float td = 13; //target distance.

void setup() {
  // put your setup code here, to run once:

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

  Serial.begin(9600);
  pinMode(trigPin,OUTPUT);  //TRIG AS OUTPUT
  pinMode(echoPin,INPUT);  //EHO AS AN INPUT

  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.println(ss);

}

void loop() {
  // put your main code here, to run repeatedly:

  digitalWrite(trigPin,LOW);  //set trig pin low.
  delayMicroseconds(2000);
  digitalWrite(trigPin,HIGH);
  delayMicroseconds(100);
  digitalWrite(trigPin,LOW);
  pingTime = pulseIn(echoPin,HIGH);  //measure ping time traveltime in microseconds.
  ss= 2*td / pingTime;  //gives us speed in inches per microseconds.
  ss=ss/63360*1000000*3600;  //gives us speed in miles per hour.
  Serial.print("The speed of sound is ");
  Serial.print(ss);
  Serial.println(" miles per hour");

  // Turn off the blinking cursor:
  lcd.noBlink();
  delay(3000);
  // Turn on the blinking cursor:
  lcd.blink(0);
  delay(3000);

}

Comment: Your program doesn't even begin to compile. Maybe you should worry more about where you are defining things first?
Comment: And I see no `\302` in that program. Are you actually showing us the right program here?
Comment: The variable `lcd` will be out of scope in `loop`.
Comment: Please add more details. What have you tried? What was the result.
Answer: The culprits are the no-break spaces (U+00A0) you sometimes use in your
indentation. Each of them, when encoded in UTF-8, is represented by the
pair of bytes 0xc2 0xa0 (or 0302 0240 in octal). You should indent
with regular spaces (U+0020) instead.
Specifically, you have no-break spaces as the first characters of each
of the following 8 lines:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.println(ss);
[...]
lcd.noBlink();
delay(3000);
// Turn on the blinking cursor:
lcd.blink(0);
delay(3000);

Answer: Beware when you copy code from sites which have formatead fonts in their content. As you copy and paste these font-formatead codes, chances are that you copy the font's formats as well. Once you paste these formatead fonts on your code, the text editor from the Arduino IDE will not recognize the special characters used on the font's formatting; thus, it will not show them on your screen. However, the compiler will read them and will strive to compile them as if they were part of your code. Since the compiler does not "understand" these special characters, it will warn you about their existence by identifying them as "stray" pieces of code. This is why some code-related sites, such as GitHub, gives you the opportunity of copying RAW CODE, so you do not copy the formatead fonts that some developers use to showcase their much appreciated contributions. I sincerely hope this works for you. Best regards.
Answer: Just try to removes extra spaces that are outside the scopes (curly braces { and }) and it'll work fine.


Does annotation only work at a specific reference scale in ArcMap 10.2?

Question: I know that we could set "Define classes of features and label each class differently" for a point feature class but I prefer to label the features in an annotation layer.
We have to set a reference scale when we create an annotation layer. My question is that how to fix the problem that the labels do not scale up or down very well?
Answer: You can have multiple annotation feature classes with different reference scales.

When you create your annotation, set up a label, set your scale, and create Annotation.  It will create that annotation at that scale.  Your next annotation you set the label and your new scale, and create annotation again.  The second annotation will be created at that new scale.

Annotation are essentially features linked to your spatial features.  They are not labels.  As a result the features appear to get bigger or smaller as you zoom in or out.
As they are features, in a layer in your Table of Contents, you can set a reference scale on the layer to make it visible or not visible at specified scales.  You can combine this with a second Annotation layer at another scale.
I set the reference scale for the 1:25000 Annotation to not show when zoomed out past 37500

And I set the reference scale for the 1:50000 Annotation to not show when zoomed in past 37500


How to bootstrap the AUC on a data-set with 50,000 entries?

Question: I am learning classification. I do have AUC-ROC curve of the data-set. How should I proceed to bootstrap the AUC? If I do the sampling of the same size as data-set then my AUC value would not be the same all the time?
Comment: AUC is area under the ROC curve, but it's also a property of a classifier's classification, not the data. What do you mean by bootstrap and what does it mean to take a sample of a data set that's the same size as the data set?
Comment: The problem I am trying to solve is a binary classification. Samples are in the form of two columns (true/false, probability of true): (1, 0.43), (0, 0.32), (1, 0.52) etc. I did find the AUC of ROC curve for different threshold probabilities/decision boundaries. The value of AUC I found for the data-set is close to 0.77. I need to find the Confidence interval for AUC of the ROC. One way to do is to bootstrap the data with replacement. I am not sure how to do that?
Answer: Yes, sample the same size of your data set (with replacement), then find your AUC, say 10,000 times.  You will then have 10,000 different AUCs which will give you some idea of how confident you are in the AUC result.
When you sample with replacement, you will only find around 63% of the entries in your new bootstrapped data set will be unique (so many of these will have 2+ identical entries in the bootstrapped data set.  Every time you make a new bootstrapped sample, the 63% that are unique will change, as will how many times a record is duplicated in the bootstrapped sample.  This helps extract some information on the natural variability of your data.
So to recap, if you have 50,000 records, which means 50,000 probabilities/values and 50,000 class labels:
1) samples 1:50,000 with replacement.  You should find about 31,500 unique records in this new sample.
2) calculate the AUC
3) repeat steps 1 and 2, 10,000 times(pending computational times, I would shoot for at least 1000), and save those 10,000 AUCS.
4)  Now you have 10,000 AUCs.  If you take the 5th percentile and 95th percentile, you have the bootstrapped 95% confidence interval.  The big benefit here is now you can take the mean of those 10,000 AUCs, and give the standard error $(sd/sqrt(n))$ to give some idea of the variability.
Rather than just doing one AUC calculation on your full data and saying the AUC is $.77$, you may end up finding your AUC is $.75 +/- .03$, which is much more reliable to make a claim on.  Now in hindsight you can see your single AUC measure was a little optimistically high.
Comment: Minor correction to this: for a 95% confidence interval, you should be taking the 2.5th and 97.5th percentile.

Going from the 5th to 95th percentile is a 90% confidence interval.
Answer: I think sampling of the same size as data-set then your AUC value would not be the same all the time.
Based on my understanding, you might misunderstand the sample with replacement. Even your sample size is the same as the data size, n, (we only talked about OOB), it means you pick 1 case each time and return it back and repeat n times to get n samples for this entire sampling. Then you could repeat enough this process for x replicas. By this process, even your sample size is the same as data size, you will not get the same items with the data set in each sampling.
Answer: two questions:
1, About 50000 entries do you mean 50000 test data? and you have other data to train and fine tuning the model, is that right?
2, If the data set if more than 50000 entries, you will split the data set into train, validate and test dataset(50000 entries). If you split it randomly, the AUC result should be different every time, so how could we using bootstrap method on ONE TIME Classification result to calculate 95% CI AUC?
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).
Comment: Your Answer has Three Questions in it and No Answers AFAICT :(


Migrating database to a new server

Question: We recently got a new server, so we tried moving our database over (made a backup of it). I have an encrypted column in one of the tables, however, and when we tried this migration technique the master key was deleted. Is there a way to copy over the database to the new server without losing all the information for my encrypted column? (master key, certificate, symmetric key, etc.).
Answer: The master key was not deleted - it is not moved when you move the encrypted database.  You need to back it up from your old server and then restore it to the new server.  Here are some links to help you backup and restore the master key:
http://msdn.microsoft.com/en-us/library/ms174387.aspx
http://msdn.microsoft.com/en-us/library/ms186336.aspx

Migrating database to a new server


Public Key of existing wallet

Question: I have an ethereum wallet. How can I get the public key? I am getting the only private key.
Answer: Public keys in ethereum does not hold much significance. Your account address is last 20 bytes of the hash of your public key and that is used for sending or receiving any transactions. But if you still need to get your public key, refer to this answer.
Answer: i suppose you are looking for your public address as you will probably not need public key for any activity, they are kept internally by ethereum to validate transactions, to get public address you can

go to https://www.myetherwallet.com/#view-wallet-info
select 'Private key' to access your wallet
Paste your private key and click 'Unlock Button'

MEW will show your public address with account balance and related info. you can also use browser extensions like metacast and desktop freewares to access your wallet.
Answer: You may use ABDK Toolkit to recover both, public key and address from your private key.

Public Key of existing wallet


Is delta H a state function?

Question: My teacher says $H$ is a state function but $\Delta H$ is not. But I think both of them should be state function. Is he correct?
Answer: $\Delta H$ is a function of two states, the initial state and the final state.
For a given final state, there can be infinite $\Delta H$ values depending upon what the inital state was.
For a given inital state, there can be infinite $\Delta H$ values depending upon what the final state is.
Therefore, $\Delta H$ is not a state function.
Comment: It only depends on the inital state and the final state, regardless of the path between the two states
Comment: Then is it a path function?
Answer: I generally agree with DavePhD's answer but I also want to give the opposite view (!).  Everyone agrees $H$ is a state function, but energy (and thus enthalpy) has no built in zero-scale.  So really even in defining $H$, there is some built-in standard state that you are comparing the state of interest to.  For example, the standard state might be all electrons and all nuclei infinitely separated from each other (this standard is commonly used in quantum chemistry).
But we could also specify other standard states. We could say the standard state is one where all electrons and all protons and neutrons are infinitely separated...but that's possibly only useful for nuclear chemistry.  We could also a standard state where all the atoms in a sample are separated into pure chemical elements.   So to compute "the" enthalpy $H$ of say $\ce{CH4}$ using this standard state, we first separate its atoms to $\ce{C}$ and $\ce{2H2}$, our standard state, and then see how much the enthalpy changes.
Regardless of how we definite the standard state, enthalpy is a state function.  But "the" enthalpy $H$ that we compute from the last standard state is the same as the enthalphy change of formation, $\Delta H_{form}$!  So if those two things are equal, and one of them is a state function, then the other one must be a state function too!  So $\Delta H$ is also a state function.
Comment: That is just a way to say that dX is actually conceptually same with X if we insist that dX always should be used only with a single standard state. While technically you can call it correct, I think it is not helpful: 1) the OP's question is referring to a misunderstanding that you do not correct or explain, only bury; 2)  dH is more often than not used for comparing specific, non-standard states
Comment: Greg, I'm not sure what misunderstanding I have buried -- I do think whether $\Delta H$ is a state function is intimately related to standard states, and also that if $X$ is a state function then its differential $dX$ and by implication $\Delta X$ should also be a state function.  If you have more to add (and by no means do I think my answer is the best or final word!), you should add your own.  I would probably upvote it, just like I did DavePhD's.
Comment: As I said, dH is generally not referring a standard state. Also whether something a state-function or not is nothing to do whether it has a "built in zero". This distinction in thermodynamics (Q, W, dH are not state-function etc) actually has a meaning you fully ignore.
Comment: When I ignore something, I always try to ignore it "fully".
Comment: The "built in" scale for energy is $E=mc^2$. If we have a block of U238 at a certain T and P it has an energy and an enthalpy.  We can heat it, cool it or take it down other paths, and each path will correspond to a delta H, that is not solely a function of the initial state.
Answer: A state function is a property of a single state of the system.
A change in a state function is associated with a process that involves two states of a system.
You may be thinking that the change in enthalpy will be a state function because you can take any path you like between the initial and final states and still get the same enthalpy change. But that's beside the point; the enthalpy change isn't a property of a single state of the system, so it isn't a state function.
Comment: Fred, can you say a few words about the (interesting) new picture in your avatar?
Comment: @ron. Ha. It's just a recent picture of me--this is the avatar I use on my Moodle sites. Funny, after I switched to this one, I got 37% fewer instant messages from students--I wonder why?

Is delta H a state function?


Should I present future research directions in a separate section while writing a scientific paper?

Question: Should I present future research directions in a separate section while writing a scientific paper? Or to mention it in its related section?
Answer: Anything is Okay. I have seen the future directions in both ways: mostly I found it in the related section, however it is rare in a separate section. So choice is yours. But keep one thing in mind. Your future direction should not be too long unless your presenting results and discussion are enough to be accepted by the reviewers. Otherwise, reviewers of your paper may feel the future directed works are important part in your present paper and may give a comment like "why didn't you conduct same work for this paper?"
Answer: You can discuss future directions in related work if related work section comes at the end of article i-e, just before the conclusion section. If the future work discussion is long, then I recommend adding a separate section before conclusion section; otherwise, discussing it within the conclusion section will be better choice.
Answer: In most of the good papers I have read, the directions for future work are typically mentioned in the conclusion and/or a discussion section (if it exists), and sometimes partially in the related work section if relevant.
The conclusion section is quite apt for this because you can closely link it with a summary of your main proposal and/or results.
I think it largely depends on individual author(s') choice, you general organization of the paper, and also on the type of paper you are writing.
Is it a survey paper (of the state of the art) or a paper detailing your novel contributions? In the former case, it may often be prudent to have sections or sub-sections under each section (e.g., if there's a section per theme you survey the SOTA for). In the latter case, it is typically done as part of Conclusions; some elements of the future directions may also appear in a separate Discussion section (if any) that critically analyzes the core contributions you've made in the paper until that point.


Managing Long Straddle

Question: Am a beginner in option trading. Recently started learning option strategies. The long straddle looked particularly appealing. However to make a profit the underlying needs to move, lets say around 2%. Is there any technique by which we can reduce this gap down to 0.5% range?
Answer: A long straddle gains value if implied volatility increases and/or the underlying moves away from the strike price.  It loses value due to double sided time decay.  Those are its dynamics.
You can reduce the 2% threshold by:

using lower IV options (less chance of a big move)
buying nearer term expiries (disadvantage of higher rate of theta decay)
utilizing defined risk strategies that have a cap (butterfly, iron condor)
Comment: Each strategy has its own risk profile.  Google for info about the differences between each one and choose the one that best fits your outlook for the stock.
Answer: Thank you Bob for quick response. Tried and compared different strategies and came up with this one. Please comment.
Comment: As I mentioned above, choose the strategy that best fits your outlook for the stock. If this one meets your criteria, then all is good.  For me, the 6:1 risk/reward ratio would be a non starter.
Comment: Bob could you kindly take a look at the strategy i posted here: [https://money.stackexchange.com/questions/97441/why-this-strategy-with-options-and-zero-risk-is-not-possible/142219#142219]  can its theta value be made positive. Thank you.

Managing Long Straddle


Are there any legal doctrines like the absurdity doctrine that tend to correct legislative undersight or oversight?

Question: Absurdity doctrine is a doctrine used by courts to ignore the plain meaning of a law in cases where the plain meaning would in the court's opinion lead to absurd results. Are there any similar doctrines that attempt to correct legislative flaws by either interpreting a law broadly or narrowly to include or exclude situations where such law can or cannot apply?
Answer: canada
The Supreme Court of Canada has long been clear that "plain meaning alone is not determinative and a statutory interpretation analysis is incomplete without considering the context, purpose and relevant legal norms" (R. v. Alex, 2017 SCC 37 at para. 31).
Many factors would pull a court to interpret a statute more narrowly or broadly than an acontextual, isolated reading of the words would suggest. Generally, this includes the full text, context, and purpose of the statute. Courts will look to:

the words of the provision
the surrounding words and related provisions
the words of the entire statute
the entire statute book
the legislative purpose as revealed through legislative history and the mischief the provision is meant to deal with
the presumption of constitutionality
etc.

Basically every doctrine of statutory interpretation will pull towards either a narrow or broad reading of a provision. I would hesitate though to call these "corrections" of "legislative flaws" but rather an attempt to give effect to the legislative intent. Even the doctrine of absurdity that you mention is based in an assumption that the legislature does not intend absurd results. Instead of correcting "legislative flaws" this doctrine/canon is a way to avoid judicial error.
However, after a full interpretation of a statute reveals that it is unconstitutional because it is over or under-inclusive, then a court may use the remedies of reading down or reading in (these are constitutional remedies not part of the ordinary act of interpretation). In such a circumstance, where it is a "safe assumption" that the Legislature would have enacted the "corrected" version, the court may declare the correction. See Schachter v. Canada, [1992] 2 SCR 679.
Comment: In France, the general principles of interpretation are given in chapter I of [_Le recours aux travaux préparatoires et la volonté du législateur_, Philippe Gérard](https://books.openedition.org/pusl/8897). (Chapter II is about the specifics of determining legislative intent via parliament debates and so on.) It is a bit dated but still valid. An English summary would be extremely similar to what this (Canada) answer gives, hence I just drop the reference instead of giving a (France) answer.
Comment: can a court read down or read in inside a law even if it's not unconstitutional ?
Comment: better question , does the reasoning for the narrowing or broadening of a staute have to come from the purpose of the lawmakers or constitution itself ? @Jen
Answer: Yes, it's called statutory interpretation
Courts recognise that words rarely if ever have a clear and unambiguous "plain meaning". For example, the words "go" and "put" which are not uncommon in statutes each have several hundred dictionary meanings to choose from. While the correct meaning may be obvious for hundreds or even thousands of fact patterns, sooner or later a case will come along where even simple words and phrases are ambiguous.
Former High Court justice Michael Kirby wrote an illustrative article on the matter.

During the past decade or so, the High Court of Australia has unanimously endorsed other principles as necessary to the accurate reading of legislation. Amongst the most important of these principles have been:

that where the applicable law is expressed in legislation the correct starting point for analysis is the text of the legislation and not judicial statements of the common law or even judicial elaborations of the statute;

that the overall objective of statutory construction is to give effect to the purpose of Parliament as expressed in the text of the statutory provisions; and

that in deriving meaning from the text, so as to fulfil the purpose of Parliament, it is a mistake to consider statutory words in isolation. The proper approach demands the derivation of the meaning of words from the legislative context in which those words appear. Specifically, it requires the interpreter to examine at the very least the sentence, often the paragraph, and preferably the immediately surrounding provisions (if not a wider review of the entire statutory context) to identify the meaning of the words in the context in which they are used.

These and other explanations of the contemporary understanding of statutory interpretation have increasingly taken courts in Australia away from the previous 'literal', or so-called 'objective' or 'plain meaning', approach to interpretation. The notion that a word of the English language has a single, objective and scientific meaning that has only to be discovered has gradually given way to a more candid recognition of the choices that face those who interpret the written law and the way in which values and policy considerations can influence the making of those choices. That realisation presents the third element in contemporary statutory interpretation in Australia. Today, that task requires a combined exercise involving analysis of the text, context and purpose (or policy) of the statute in question.

He then goes on to illustrate the nuts and bolts by discussing Carr v Western Australia which split the High Court on the meaning of the word "interview".
Comment: could mistake of law be used as a defence in such cases where the law itself was ambiguous or had multiple interpretations ? exempting an accused from the liability of the present case while also clarifying the law so that the law is applied to the acts the accused commited without punishing the current accused
Comment: something like a test case doctrine


The meaning of Pan-India Character?

Question: What is meant by the Pan-India Character during the Mauryan Empire at the time of Chandagupta Maurya ?
Comment: Can't tell you what is meant unless you provide a citation/reference.  Where is this term mentioned.
Comment: It is in this line "Pan-India Character: The Mauryan was a vast with all-India character."
Answer: The  Mauryan Empire, if we look at this map, covered a large region:

and the word pan- can  be defined as:'"all, every, whole, all-inclusive'
so, Pan-India is indicating the fact that this empire literally covered all of the Indian region:

The Maurya Empire was one of the largest empires of the world in its
  time. At its greatest extent, the empire stretched to the north along
  the natural boundaries of the Himalayas, to the east into Assam, to
  the west into Balochistan (south west Pakistan and south east Iran)
  and the Hindu Kush mountains of what is now Afghanistan.[7] The Empire
  was expanded into India's central and southern regions[8][9] by the
  emperors Chandragupta and Bindusara

The 'Character' aspect of the phrase may again relate to the definition, the 'all-inclusive' part. Again from the Wiki :

Mauryan India also enjoyed an era of social harmony, religious
  transformation, and expansion of the sciences and of knowledge.
  Chandragupta Maurya's embrace of Jainism increased social and
  religious renewal and reform across his society...
Comment: Actually, it's a little subtler than that. An empire with pan-Indian character would have a culture and characteristics drawn from all the regions of India. It *isn't* an empire whose ruling class are all from one region and thus rule in a manner characteristic of that region.
Comment: Noted. Added some on the social aspect, the original question didn't really give enough context to me for a good determination of intent, however.

The meaning of Pan-India Character?


Improve performance of Ubuntu guest in VirtualBox on Windows 10 host

Question: I am trying to run an Ubuntu guest on Windows 10 using VirtualBox. I found the Ubuntu guest was running with slow response after the installation. I found some previous solutions for this problem by changing the settings under machine (like activating 3D acceleration, etc.), but I find my settings are locked. What is the solution for this? How to make the options active?
Comment: Please shut down the VM then make your changes!
Answer: Shutdown the Ubuntu 16.04 guest OS, then you can safely make changes in the VirtualBox Settings for that guest OS (click the Ubuntu 16.04 guest OS first to select it) and restart the guest OS to test your changes. Enable 3D Acceleration won't help. The changes that will improve performance are:

Add another CPU thread in Settings -> System -> Processor. You can safely have 2 Processors instead of 1 Processor if you 4-8 CPUs.
Add more Base Memory in Settings -> System -> Motherboard. You can safely allocate up to half of the RAM in your physical machine for the guest OS Base Memory.
Optionally you can increase the Video Memory up to a maximum of 256MB from the terminal by running this command:
<code>VBoxManage modifyvm "name-of-Ubuntu-16.04-guest-OS" --vram 256
</code>
Answer: Certain configurations on Virtualbox can only be modified when the device in question isn't running, so please shut down your Virtual machine that's the only way those configurations can be set. And they will only work if your system (host OS) supports 3D Acceleration.


Why did my 50mm f/1.8 Canon lens deactivate autofocus on Canon EOS 1000D?

Question: I recently lent my 50mm f/1.8 lens to a friend who owns a Canon EOS 1000D. Afetrwards he told me that the camera had deactivated autofocus when he switched back to his kit lens (18-55). Is this possible? It sounded very strange to me...
Comment: Corrected title. And welcome to photo.SE!
Answer: Maybe he accidentally set the AF/MF switch to manual focus.
Edit: It's not entirely clear what's happening here. In your title, you say "autozoom," but the body says "autofocus." I'm assuming the former is a mistake, and the issue is what you state in the content of your question.
What you are asking is, "is it possible for AF to be disabled when switching lenses?" And the answer to that question is yes. However, what I think you're actually asking is "My friend says the AF mechanism on his camera broke when he used my lens. Is that possible?" And the answer is that it's extremely unlikely.
The AF/MF mechanism on that camera is controlled by a switch on the lens. Both the 18-55mm and 50mm lenses have these switches. The most likely scenario is that he simply bumped the switch when changing lenses, and it's in the MF position, in which case flipping it back to AF will solve his problem.
The second-most likely scenario is that the contacts on either the lens or body are dirty, which is preventing the body from knowing what position the switch is in. And the least likely is that your lens fried the guts of his camera just enough to make AF stop working, but not enough to break anything else.
Comment: You say he had to change something in the menus. I have a Rebel XSi (450D), which is very similar (and I have used the 1000D before). The only AF related thing I see in the menus is the kind of AF to use: One shot, AI Focus, and AI Servo. It sounds like your friend is confused.
Comment: I thought so at first, but my friend says he had to activate something through the menus.
Comment: I think I agree with you. It's what makes most sense to me.


Is there a way to determine what kind of data is sitting in the Redo Queue for an AlwaysOn AG Secondary Replica?

Question: Do any of the DMVs or is there another way to expose what kind of data is in the Redo Queue that's in process of being synced up to a secondary replica? (E.g. is it table data and which table, or is it index changes and which indexes, etc?)
Answer: The short answer is no, there is not a DMV that contains this information.  It would be a significant amount of overhead for SQL Server to track what table was associated with each log record that had been received but not committed.
As you can read in Reading the transaction log in SQL Server – from hacks to solutions, you can read the log records with a function, but it's certainly not something that you would want to do in production just to have some interesting information.  Doing something like this on every log record in real time would add a tremendous amount of I/O load on a busy server, and you wouldn't want it to be done unless it solved a significant problem.
Although the type of information you're looking for would be interesting, you might get a better answer if you can state why you want to see this information--there may be a better solution.
Comment: I see that  symptom sometimes on replicas that are across the WAN link, particularly after there's been a WAN outage.  We just restart the SQL Server service.  I think to diagnose it you'll have to open an incident with Microsoft and they will have to find out what thread is stuck or died or whatever.
Comment: My particular case was my Redo Queue was abnormally large one morning, so my secondary replica was out of sync with my primary and I wasn't sure of the best way to debug what happened. I eventually realized the night before into the early morning my index maintenance job (on the primary) ran for 12 hours straight before completing and therefore must've generated a large amount of transactions that the secondary had to catch up to. Luckily the secondary did catch up a few hours later, but it would've been nice to have some explicit way to determine the cause of the transactions at the time.


What to put in precompiled header? (MSVC)

Question: What are the best candidates for a precompiled header file? Can I put STL and Boost headers there, even though they have templates? And will that reduce compile times?
Also, what are the best IDE settings to reduce compile times?
Comment: I prefer not to use PCH. The reasons are (1) I like the first include in a cpp file to be its corresponding header so you know the header compiles (2) my experience is that dependency checing with pch is not fully reliable, and this results in incremental builds becoming unreliable in very large projects. In my opinion it is more efficient on balance not use pch and enjoy the benefits of reliable incremental builds. This might no longer be the case with the most recent Visual Studio versions - my experience with that is still not sufficient to judge.
Answer: The quick answer: the STL and Boost headers do indeed belong in the precompiled header file, even though these header files define template classes.
When generating a precompiled header file, a compiler parses the header text (a significant task!), and converts it into a binary format that is optimised for the compiler's benefit.
Even though the template classes will be instantiated when other .cpp files are compiled, they will be instantiated from information in the precompiled header, which is significantly faster for the compiler to read.

(later addition)
One thing that you should not include in a precompiled header are files that are part of your project and are changed frequently, even if every single .CPP file includes these files.
The reason is this - the generation of the precompiled header can take a long time, because the boost, stl and windows libraries are very large.
You might have a simple file (eg "StringDefs.h") that everything uses. If StringDefs.h is included in stdafx.h, and one developer touches StringDefs.h, then every developer has to wait until the entire precompiled header recompiles. It would be much faster if StringDefs.h was left out of the precompiled header, and parsed along with each .CPP file.
Comment: You can only have 1 precompiled header file per .cpp file, but you can have multiple pre-compiled headers in your project.
Comment: You not only have to wait for the PCH to recompile, but also for every file that uses it.
Comment: That's a fair point - including frequently changing files would slow down build time, overall.
Comment: Do you have any references to substantiate the claim that templates will indeed be improved? Eg profiling results, or compiler documentation links?
Comment: `one developer touches StringDefs.h, then every developer has to wait until the entire precompiled header recompiles`. I think this is the expected behavior if StringDefs.h is barely touched.
Answer: One addition to Andrew Shepherd's answer. Use the precompiled header for header files that are external to your project, for files that change infrequently. If you're changing the header files in the current project all the time, it's probably not worth precompiling them.
Answer: I've written an article on techniques that reduce the compilation time. Among these techniques a post on precompiled header and its application can be found here. It also has a section on best practices that you may find interesting. CMake scripts that handle it transparently are included.
Comment: This is a nice article.
Answer: Put anything in the precompiled header that most of the .cpp files in that project would include anyway. This goes for any header file, really. This allows the compiler to parse these files once, and then reuse that information in all .cpp files in the same project.
Comment: "precompiled headers should never include project-local headers" Why not? If the local headers are stable and never change, and are included all through your application, why wouldn't you put them in the precompiled header?
Comment: I disagree, and have written an extra section in my reply to explain why.
Comment: precompiled headers should *never* include project-local headers
Comment: I have worked extensively on a project that followed this erroneous advice and it is very inefficient - every time you compile, everything compiles for any change.


LED replacement for cicline CFL lamp

Question: I have a ceiling fan with an FCL-30EX circline bulb. It's marked as 2700K, 30W, 120V. My main issue is that it is very dim. I would like to replace it with an equivalent of 100W if possible.
Led would be preferable. Does such a replacement exist?
Thanks!
Comment: You may be able to convert to a led but without rewiring the ballast I did not see a direct led replacement look for a circle lamp retrofit kit. I did see both 8" & 12" models but not one for your lamp type.
Answer: A quick search using The Google with the terms "FCL-30EX circline bulb led replacement" results in many links, although The Google prefers to search without the hyphen, "FCL30EX circline bulb led replacement." Additional research shows the CFL tube you reference is a nine inch diameter unit. Many LED replacements for this tube are plug-in without complications. Keep in mind that rating a CFL bulb for 30W is not the equivalent of an incandescent bulb at 30W. This would indicate that your desired 100W equivalent, if available would be blindingly bright.
A representative sample from amazon.com is listed at 30W, 1700 lumens:
CFL Replacement LED circline bulb although the comments indicate that it may be necessary to remove the ballast.
Use your favorite search engine with the previously noted terms for more options.
Answer: There are LED replacements for screw-in incandescent bulbs and so for compact fluorescent tubes which are themselves direct replacements for incandescent bulbs. These work directly from 120 V 60 hz ac.
But AFIK there are no LED direct replacements for plug-in fluorescent tubes.
The reason is that fluorescent tubes are powered from a "ballast", which is an electronic device which changes regular ac 120 V 60 hz to a different type of power which the tubes require. The compact fluorescent tubes have a mini-ballast built into the tube.
There are conversion kits to allow fixtures for 4 ft fluorescent tubes to power long LED arrays, but it is not a simple plug in. The ballast has to be disconnected and a special power supply for the LEDs added in the fixture. I have not seen such kits for circline fluorescent tubes. But if they exist, you might locate them by Googling LED replacement for circular fluorescent tubes. I assume that a circline fluorescent has a separate ballast in the housing. Google replacing ballast for circular fluorescent tube fixture.
EDIT
Looks like there are LED replacements for circular fluorescent tubes http://www.homedepot.com/p/Aspects-22W-Equivalent-Warm-White-T9-Dimmable-LED-Retrofit-Kit-RFKIT22/207056636?MERCH=REC-_-piphorizontal2_rr-1--207056638--207056636-_-N

LED replacement for cicline CFL lamp


Should soapui questions from stackoverflow be migrated here?

Question: I'm subscribed to the soapui tag on stackoverflow and they generally have a question or two day about soapui.  Since this is a common test automation tool, should we work to migrate the questions here? Do we have the community here to support it?
Comment: What are those questions like? Are they more or less coding questions? Or more about how to accurately apply the tool to being used. Obviously both are okay on SQA, but the coding questions -might- be better off there. For sure process questions should be migrated here.
Comment: I have experience with SoapUI and would probably be able to answer many questions, I just haven't really seen any here to answer.
Answer: <code>Do we have the community here to support it?
</code>
I do not know how to answer that.  However, an SQA search for "SoapUI" turns up several questions that were answered in a reasonable amount of time.


Changing numeric language from konsole in Kubuntu

Question: how to change the numeric language to English from terminal & why the games are not working?
Answer: Sounds like you want to change your locale settings.

Type locale in the console and observer what comes up (Note if LC_ALL= is set to something, this over rides all other settings).
If you want to change the numbers to english decimal (en_US.UTF-8), enter the following:
su - (switch to root)
export LC_NUMBERIC="en_US.UTF-8"

Try it out now and see.
Environment variables implement the locale codes. For example LANG=en_US.UTF-8 specifies that the computer uses US English with a UTF-8 encoding when displaying information.
Note: Type in locale -a to ensure you have the en_US.UTF-8 installed. If now use POSIX if you have that (I believe this is nessary but I am starting to doubt it now, most distro's will have that even if it isn't shown?)


What's the difference between docker.io and docker?

Question: Trying to learn docker here but I am a bit confused on what the difference is between docker.io and docker. Is docker.io the daemon server and docker the client? Why does the daemon need to run all the time?
Answer: You probably want docker.io.
The docker.io package is the Docker containerization software; whereas, the docker package is a tray plugin for docking applications to the desktop UI.

Running:
sudo apt-get install docker.io

installs package described as "Docker complements kernel namespacing with a high level API which operates at the process level." That is, the Docker everyone is usually thinking about when they say Docker.
Running:
sudo apt-get install docker

installs a package described as a "System tray for KDE3/GNOME2 applications"
Running:
sudo apt-cache search ^docker

displays descriptions of packages that start with the word "docker".

To make things more confusing, the snap package management tool uses the name docker to refer to the container, not the tray.
Comment: I don't remember how  installed docker on my ubuntu, but it is here. Does that mean that `sudo apt-get install docker.io` is no longer necessary? (I am following a step by step how to on some software)
Answer: docker-io is the deb package name used by Ubuntu distribution
docker-engine is the deb package name from the official Docker Ubuntu distribution.
Probably you want docker-engine because the Ubuntu one is too old and buggy to be used. As of today Ubuntu has 1.6.2 and Docker registry has 1.12.0 !
In terms of Docker, 1.6.2 counts as stone-age.
Comment: The difference seems to have narrowed now in Xenial: Ubuntu's docker.io 1.12.3 vs Docker's docker-engine 1.13.1.
Comment: one year later, "mind the gap":  the versions available via docker(.com) vs the ubuntu pkg repo is now so wide it's hard to even compare (as of mid-2017, ubuntu 17.04 (zesty)). What was called `docker-engine` from docker.com is now split into `docker-ce` and `docker-ee` (a free "community edition" & paid "enterprise edition", respectively), and `docker-compose` must be installed either from git or via `pip install docker-compose` to get the correct, corresponding latest version. Presently, sadly, one must simply avoid ubuntu repos for all things docker.
Comment: @Pierz but will ubuntu upgrade within the same release? Before 18.04 the difference will probably widen again ;)
Answer: Docker is the name of the open platform for developers and sysadmins to build, ship, and run distributed applications. Docker.io on the other hand is the name of the package that you install in your Linux OS (i.e. Ubuntu). See this link here.
In terms of how it works, the Docker Engine consists of two parts: a daemon, a server process that manages all the containers, and a client, which acts as a remote control for the daemon.
I would suggest you to try a quick demo they have on their site, located here.
From a usability standpoint, you invoke the Docker client anytime you use the docker command.
Comment: Yes, but that doesn't say anything about the two different processes, namely docker and docker.io
Answer: It seems docker is just a symbolic link to docker.io:
> file $(which docker)
/usr/local/bin/docker: symbolic link to `/usr/bin/docker.io'

So we can assume that docker.io is both the daemon and the client process, just invoked with different flags I assume?!
Comment: That's it exactly. docker.io uses the same binary for both client and server/daemon.
Answer: Talking about Debian packages: docker.io is the name of the package provided by Debian/Ubuntu, while docker is the name of the package provided by docker.com.
Technically, these packages are built differently: for docker.io the build dependencies are fetched from Debian packages, while for docker, the build dependencies are in-tree, in the vendor directory.
If you want more details, I wrote a detailed blog post at: https://www.collabora.com/news-and-blog/blog/2018/07/04/docker-io-debian-package-back-to-life/
Comment: That was a good article. It sounds like you guys did a lot of work. Has anything changed since 2018? What is your recommendation today?
Answer: These are just all names:   "docker.io" is name of package, and "docker" is name of the binary that interact with the daemon, which is "dockerd".
So when you run the command:
dpkg --listfiles docker.io

These files are listed:
/usr/bin/docker
/usr/bin/docker-init
/usr/bin/docker-proxy
/usr/bin/dockerd


Toilet leaking from base

Question: Toilet leaking from base of toilet when flushed . Just washed a load of clothes. When washer drained water came up through toilet and bath tub . What could it be?!
Comment: how old is your house?  could be tree roots if you have segmented clay pipes or the city section does.  Could be someone flushed something they shouldn't have, I've seen thermometers, plastic toys, non decomposable wipes ( for some great vids check out the penetrator on youtube it is disgusting but SFW ).
Answer: The fact that the washer drain is coming up through the toilet leads me to believe that you have a clogged drain pipe at some point BELOW the point where the toilet drain enters your drain stack.
The water is backup up and then forcing its way past the toilet flange seal.  That seal is not designed to handle water pressure.
You'll either need to buy or rent the tools needed to locate and then remove the blockage or hire a plumber to do it for you.
Answer: Washer drains large amount of water in short time.
You drain is clogged or partially clogged and can not handle that.
Since it is already leaking under the toilet, you will have to remove the toilet, unscrew and lift it out and place on two 2x4 supports. Remove the wax seal and clean the residue on the toilet flange.
Then proceed in using a drain snake in a attempt to remove the clog. Or maybe you have to use more sophisticated tools to inspect the drain line, like a camera to find it. You might have to inspect the drain where it exits the home. Usually there is screw on cap on drain-Y to do that.
Unfortunately you might be facing some serious damage from the leak. The floor if it is wood will be damaged, the toilet mount ring needs to be replaced also. This all would be a DIY job but if you are not confident get a plumber.
Comment: I had to do this once. Fortunately the house had a flat roof and I used the snake down a vent pipe. Therefore I did not need to remove the toilet. BUT... water leaking from under the toilet means that the toilet is not sealed properly to the pipe and needs repair.
Answer: You have a clog. Diagnosing where online will be impossible. This is something you cannot repair on your own. You need to call a plumber.
Comment: Because only a plumber could possibly push a snake through a clean out?
Comment: @FreshCodemonger OP's question phrasing suggests little plumbing experience. There are a range of possible types of clogs and possible damage to the toilet seal, so hiring a professional seems the wise choice in this case at least.
Comment: @FreshCodemonger  Because pushing the clog from above will just compress it more. It needs to be pulled apart from the dry (down-slope) side with a corkscrew attachment, and trapped at the downstream access point so it can be removed from the drainage system (before it ends up at somewhere even less accessible). If it is big and solid enough to block a 4-inch soil pipe, it is too serious for a novice to deal with.

Toilet leaking from base


Change WS endpoint on Axis2 with no servicePath

Question: I've developed an WS using Axis2 1.4 and glassfish 2.1.1, which is properly running using the endpoint url like
 `http://server:port/appname/services/FooService`

but I need to get it working through an endpoint like
 `http://server:port/FooService`

since the WS clients can't be changed to use a different endpoint.
Getting rid of the "appname" part was easy, setting the appname to root under the application server (changing the application.xml configuration file for the application). This leads to an endpoint like http://server:port/services/FooService which works fine but still has the "services" part on it.
To get rid of the "services" part, i tried:

Changed the "servicePath" property on the axis2.xml configuration file. If I set this property to blank, null, "" or "/" does not work. On the first two cases a "servicePath can't be null or empty" exception is thrown while deploying the application.
Added a new entry on the web.xml file to map the AxisServlet to the url pattern "/", but again it does not work.

So, my question is: Is there any way to get rid of the servicePath parameter?
Supposing there is no way for doing so, another idea is to "redirect" requests from the endpoint url i'm trying to use to the one that axis2 uses (with the servicePath). I'm not sure how to do this, maybe with a servlet? some configuration on the application server?
Answer: If you deployed an application as ROOT just put servlet mapping in web.xml :
<servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/FooService/*</url-pattern>
</servlet-mapping>


Pipe the output of a command to rm command

Question: Following command prints the path of the song being played.
mpc | head -n 1
songs/oldSongs/Mukesh_D/041 KANHAIYA = YAAD AAYI ADHI RAAT KO.mp3

Can I delete this file by modifying the command I used to print it?
Answer: To answer your more general question, that's the job of xargs to take a list of words on standard input and convert it to a list of arguments to a command.
However, xargs expects the list as a space, tab and newline (and possibly more blank characters depending on the locale and xargs implementation) separated list of words where single quotes, double quotes and backslash are used to escape those separators (with varying behaviors with regards to nesting of those by different implementations of xargs).
If the input is a newline-terminated list, the canonical way to convert it to the format expected by xargs is to escape every character (though only, backslash, single quote, double quote, underscore (potentially), space and tab (and possibly other blanks if not in the C locale) are necessary) but newline with a backslash character, which we can do with sed.
mpc | head -n 1 | sed 's/./\\&/g' | xargs rm --

Note that some xargs implementations have a rather low limit on the maximum line length they expect on stdin, so you may want to only escape the necessary characters with those.
With GNU xargs at least, you don't need to do that, you can do:
mpc | head -n 1 | xargs -rd '\n' rm --

(also using the GNU specific -r option to avoid running any command if the input is empty).
Comment: To explain the `sed`: this converts "input like this" into "\i\n\p\u\t\ \l\i\k\e\ \t\h\i\s". This won't handle newlines, but will properly escape spaces and quotes. Note also that it won't handle the tags problem @ChrisDown describes in his answer.
Comment: This answer would be better for an [edit] that explained why this is necessary and what it accomplishes.
Answer: You can do this with rm -i "/path/to/music/library/$(mpc -f %file% | head -n 1)". However, be warned that this will break if the filename contains a newline. As the output of mpc -f %file% is relative to your music library path, you need to prepend it to the output.
Comment: Note that you can work around the second problem using `mpc -f %file%`. Also, the paths `mpc` outputs are relative to the music directory you've configured it to search, so you need to add that path in. For example, `rm -i "/var/lib/mpd/music/$(mpc -f %file% | head -n 1)"`
Comment: @MichaelMrozek - Great information! Will add it to my post.
Answer: Personally, while I think xargs is fun and all, I kind of prefer loops for this kind of thing.  Why?  Well, it gives you more flexibility... and also gives you a fairly easy way to handle spaces:
mpc | head -n 1 | while read filename
do
  ls -al "$filename"  # Look at the file you're deleting
  rm -i "$filename"   # Ask if you want it deleted (or not)
done

When you use a while loop like that, your data gets pumped into whatever variable name comes after "read"; in order to reference the variable, you then need the leading dollar sign.  The quotes are there to gracefully handle spaces, so they don't look like delimeters.  Loops like this, while less elegant than a simple one-liner, offer you more flexibility and come in crazy handy in the long run.
Answer: Unless you are able to produce NULL-terminated filenames (as e.g. find -print0) you can try to quote the filenames by piping it through sed 's/^/"/;s/$/"/', which adds the quotes at the beginning and end of a line. Note however, that in this case you need to have:

one file per line
no double quotes in the filenames

The advantage is, that you can pretty much arbitrarily transform the output (e.g. when you decide not to rename rather than to delete or when you need to strip parts of the output).
Answer: If it's safe to assume you do not have files with double quotes or newlines you can do:
mpc | head -n 1 | sed  's/^/"/g ; s/$/"/g' | xargs rm --

The sed adds quotes around your file name, and xargs turns the input it gets to arguments for the command it is running (in this case, the rm command).


How to convert tif to map

Question: I need to convert a .tif file into a .map format. How can I do it? Is it possible using GDAL?
Comment: What is .map? MapInfo TAB, Manifold project file, or something else?
Answer: As per this list the 'OziExplorer .MAP'-format is not supported for writing in GDAL.
If that is not actually the format that you are after, you can probably find the one you actually are looking for on the same list.
Answer: You can do it easily in QGIS in raster> Conversion >translate (Convert Format)

How to convert tif to map


Is there a way to install Arch Linux without any installation media?

Question: I want to install Arch Linux on my laptop machine. I have created a 20GB partition (/dev/sda5) to be used as Arch Linux root partition. I tried installing using a USB thumbdrive (I don't have a CD drive on that machine) and my partitions were not recognized. I read a little bit and concluded this has something to do with cfdisk which Arch Linux uses to create the partitions. Is there a way to bypass that and directly install Arch to my hard drive in a similar process?
Comment: try using /dev/sdb instead of /dev/sda when you use cfdisk https://bbs.archlinux.org/viewtopic.php?id=159120
Answer: Yes. You can use a graphical tool like GParted to set up all of your partitions and then continue with the standard Arch USB install from there.
You will find instructions on how to create a Live GParted USB drive here
I would then recommend that you choose a recent ISO from the Arch Releng site
Once you are back in the Arch install process, select the partition, filesystem and mountpoints you require and continue with the installation
Comment: I have the partition set up an ready using Ubuntu (GParted)
Comment: Then proceed to setting the filesystem mountpoints as per the Install Guide. If that is where you are stuck, try a more recent ISO.
Comment: This is exactly whay I can't do. I have them set up on my HD. I have downloaded the 2010.05 iso (which is the one featured in the website) and cdisk can't identify my partitions
Comment: But it does display your partition table? Switch to TTY2 and run `cfdisk /dev/sda5`. But as I said in my answer, your best bet is to download a more recent ISO and try again. Arch has moved on *a lot* in 15 months...
Answer: What you are looking for is installation from chroot environment. Arch linux has a very detailed tutorial for this.
https://wiki.archlinux.org/index.php/Install_from_existing_Linux
You can easily plugin the hard drive into another computer to do the install and when you are done, just switch the drive back into the laptop and you should be good to go.
Otherwise, you can install something like ubuntu or tails borum onto a USB so you can boot up a "live" session on the laptop to give you something you can work from to do the installation if you don't have another computer running linux or if you just don't want to mess with removing the drive. If you use ubuntu, just select "try ubuntu without installing" to start up the live session.
You can also create your partitions from the live session using the gparted partition tool.
Answer: There is Archboot which (iirc) uses parted instead of cfdisk to do the partition stuff.


meaning of 一応 at the beginning of a sentence

Question: I was wondering what 一応 would mean in this context. always had trouble grasping the concept of this word.
Comment: Does this answer your question? [The meaning of 一応 in 一応褒めている](https://japanese.stackexchange.com/questions/29798/the-meaning-of-%e4%b8%80%e5%bf%9c-in-%e4%b8%80%e5%bf%9c%e8%a4%92%e3%82%81%e3%81%a6%e3%81%84%e3%82%8b)
Comment: Could you include which episode of which anime this screenshot is from? The preceding dialogue might be useful to know to give a better answer.
Comment: It should be "Hibike! Euphonium" 1x3.
Answer: 一応 means something is not meeting a high standard, but should largely meet the minimum requirements. Similarly, it's used when something barely manages to qualify as something.
E.g.

急に雨が降ってきたので、一応窓だけは閉めておきました(床は見なかったのでまだ濡れているかもしれません)。
(アルバイトばかりしているのでフリーターだと思われるかもしれませんが)一応大学生です。

It's also used to 謙遜. For example: 一応社長やらせてもらってます to appear less arrogant compared to just saying 社長やってます.
Conversely, it can also be associated with indicating that someone has a higher social status (like in this specific case). Here, the 先輩 describes whatever was done for the 後輩 was "一応". This subtly reinforces the relationship between the two.
If the 後輩 would use 「一応」to the 先輩 instead, it shows they are close or have almost equal standing to each other. If not, it would sound rude. E.g. if the 後輩, who just joined the club said 「楽器一応拭いときました」, then it would be rude and 生意気.
Comment: It's really hard to translate because of the cultural difference. Here, 一応 is added for self-deprecation. So maybe closest I can come up with is: "I may not be a very worthy student, but I am a student nevertheless" (though this sounds way to strong - 一応 is way lighter). @Mauro
Comment: How would you translated your second example? I'd say something like "(Since I just have a part time job people could think of me as a freeter, but) I'm a college student", but I'm not sure how to fit 一応 there; does it have an implication like "And that's the bare minimun to not being a freeter"?


Does Stack Exchange use UTC time to store creation dates of posts and comments?

Question: Does Stack Exchange use UTC time to store when a question, answer or comment is created, or is there any other approach to handle it to display localized time to the user?
Comment: Based on [this](http://meta.stackexchange.com/questions/27199/what-is-an-se-day-when-does-each-day-start) the answer is yes.
Comment: Best practice is to *always* store date/time variables in UTC, so I'm fairly certain the answer is yes.
Answer: Per What is an SE "day"? When does each day start?, the SE day is the UTC day.  This applies to everything that's date-stamped on SE -- posts, comments, visits (to count toward the Fanatic badge), daily limits on reviews, and so on.
Localizing the dates isn't as easy as it sounds.  What should SE use to determine your timezone, your IP address?  That will be wrong if you use certain proxies.  A user setting?  That's additional data that needs to be collected and managed (including with a UI), and requests for user preferences have not fared well in the past.
However, SE does mitigate this somewhat.  For recent times, the timestamp is presented as, for example, "17 minutes ago" or "3 hours ago" or even "yesterday".  For non-recent events, I would argue that a difference of a few hours -- what you might gain through localization -- isn't that important.  (If it was a week ago, does it really matter if it was 7 days 2 hours or 6 days 20 hours ago?)


What should I do about a character's magic items when their player leaves?

Question: I have a group of three adventurers and one member of the party is leaving the group permanently. No worries, it's all on good terms and we're getting someone else to replace them. My concern is that my group can be fairly volatile, meaning that players come and go somewhat frequently, and I'm not sure what the best way would be to handle their magic items. I could just allow the remaining players to pick through the magic items that belonged to the player who is leaving, but that could cause balance issues if my player count dwindles and they are loaded with unnecessary magic items. Not to mention it doesn't really make sense for a character to just give up all of their most valuable possessions just because they are retiring from adventuring. On the other hand, I don't think it would be right for me to rob the party of the hard earned loot that they ALL risk their hides for. Does anyone know if there are guidelines for this scenario, or do you have any advice?
Comment: Related: https://rpg.stackexchange.com/questions/154303/how-to-handle-inventory-and-story-of-a-player-leaving
Answer: You have various options
Introduce the new character as being an old friend of the leaving character. The leaving character feels bad about abandoning the party in their hour of need and hands their magical items over to their replacement. This would only be helpful if they can use the items of course.
Alternately, let the new character have their own items of equal value/rarity. If the departing character has a rare item, let the new character have a rare item.
Comment: @GummiWyrm You mean if you go from, say, 4 players to 3? Just make a note of the departing players items and apply the same rule when a new player joins. If you go from 4 to 5 on the other hand then you'd either need to divide up the existing items or let them arrive with some new ones. You could always try enforcing a rule that the party has a certain number of uncommon, rare etc. items based on the party level and the number of players.
Comment: My concern is more around what to do with magic items when a player leaves and there is no one replacing them. I do like your idea of giving the new player equivalent rarity magic items in this case though.


And another insect from SE Brazil Oct 2017

Question:
Photographed in the low areas of the Brazilian Atlantic Rainforest - Oct 2017 and about 2cm in length.
Answer: I'm having a difficult time pin-pointing the species, however, I'm fairly certain this true bug belongs to the genus Zelurus.
Zelurus sp.

Zelurus sp.

Z. variegatus

Distribution

Interactive version can be found here.

source
Answer: Great answer from @Charles: I was still humming and hawing between a zelurus species and another of the zelus species such as the longpipe that has the distinct red colour. (I had to leave for a couple hours...)  Like him, I was having trouble finding one that looked really similar.  But I found one, labeled as the Zelurus Circumcintus:

However, further research revealed that this is a fairly undocumented species.  The only source I could find with pictures of a distinctly red one was Flickr, such as this one:

I'm guessing it actually is the zelurus circumcintus, but I have yet to find any official sources that back me up.
Comment: Zelurus species will be fine guys - brillient


Is sleep actually vital to muscle growth?

Question: I think personally it is mainly diet and weights that contribute to muscle growth. Is sleep that important of a factor too? Are there substitutes for sleep, like meditation, for example?
Comment: The greatest amount of HGH is released during REM sleep cycle. You're not going to enter REM without uninterrupted sleep.
Answer: 100%, I've been training for about 5 years now and there was one spell were due to work I was living off about 4-6 hours sleep a night for a month. I still exercised and dieting like i normally would but I actually loss muscle strength. Sleep is were all the hard work pays off, its the chance for your body grow and recover. Without the proper recovery you wont see any benefits!
Answer: You grow when you sleep. When I was competing I would take simplysleep to make sure that I got 9 - 10 hours of sleep a day.  IMHO, sleep is only second to eating in terms of growing muscle. Ironically lifting weights is a distant 3rd, especially in terms of willpower.  Anyone can lift weights.  Few can get enough sleep.  Fewer can stick to a diet.  As much as our minds won't allow it, our bodies love a consistent routine.  Eat every 2 hours, work out in a routine as scheduled (same time), and go to bed at the same time and wake at the same time - and preferably not by an alarm clock.  Your body doesn't really care that it's the weekend, your mind does.


Running ASP.NET 5 on Nano Server throws "Unable to load DLL 'kernel32'"

Question: I have created a simple ASP.NET 5 project based on the ASP.NET 5 beta 8 Visual Studio template.
I have published the project using this command
dnu publish <path to project.json> --out <path to publish folder> --configuration Release --runtime dnx-coreclr-win-x126.96.36.199-beta8 --wwwroot-out "wwwroot" --no-source

After I run the web.cmd on nano server I received this error:
.\web.cmd : System.DllNotFoundException: Unable to load DLL 'kernel32': The specified module could not be found. (Exception from HRESULT:
0x8007007E)
    + CategoryInfo          : NotSpecified: (System.DllNotFo...LT: 0x8007007E):String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

   at Microsoft.AspNet.Server.Kestrel.Networking.PlatformApis.WindowsApis.LoadLibrary(String dllToLoad)
   at Micros
oft.AspNet.Server.Kestrel.Networking.Libuv.Load(String dllToLoad)
   at Microsoft.AspNet.Server.Kestrel.ServerFactory.Start(IFeatureCollection serverFeatures, Func`2 application)
   at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start()
   at Microsoft.AspNet.Hosting.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
   at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)

The same command doesn't throw this error when running on Windows 10. The application works fine on Windows 10.
Comment: You need to install reverse forwarders...
Comment: can you please add this as an answer so I can mark it
Answer: Nano Server does not have kernel32.dll and advapi32.dll so code that is not linked against default libs won't work. You need to either link your code against onecore.lib or install reverse forwarders.
Reverse forwarders redirect calls to kernel32.dll/advapi32.dll APIs to the counterparts available on Nano Server.
On some OneCore systems (e.g. Win10 IoT Core on Raspberry Pi 2), reverse forwarders are installed by default. This is not the case in case of the Nano Server, since the goal is to make it as small as possible. Hence the need to install reverse forwarders manually if you need them.
To relate this to Asp.Net 5 - both Http Platform Handler and Kestrel (or to be more specific libuv) are linked against default libs. Therefore, to run Asp.Net 5 on Nano, you need forwarders, unless you use WebListener (which should work fine without forwarders).
Answer: Hypothesis
You mention that this application is working fine on Windows. How are you running it on Windows? There's a good chance you are using dnx451 and not dnxcore50 (CoreCLR) as your target platform.
This is a problem because you are publishing for CoreCLR. (--runtime dnx-coreclr-win-x184.108.40.206-beta8), and there's a good chance when you are running locally, it is using the full .NET framework.
Does It Work with CoreCLR on Windows 10?
Here's what I'd do: Try to run the web app in the Developer Command Prompt for Visual Studio 2015 using dnx.

Switch to the CoreCLR version of .NET using dnvm:
dnvm use 1.0.0-beta-8 -r coreclr

Restore packages
dnu restore

Run
dnx web

If this fails, we know what is the issue. If this succeeds, there's a chance that Nano doesn't provide the native Windows APIs your code is trying to execute. If that is the case, you have to identify the code that is causing this and use something else.
How to target only CoreCLR in Visual Studio
You can remove the dnx451 target from your project.json so that Visual Studio is forced to use the dnxcore50 (CoreCLR) version. Ideally we want to be running the exact same version / environment we are publishing to.
Comment: thank you for your answer. But I am only targeting coreclr. This is my project.json

"frameworks": {
    "dnxcore50": { }
  },

This is global.json
"sdk": {
    "version": "1.0.0-beta8",
    "architecture": "x64",
    "runtime": "coreclr"
  }


Where is Dekuuna?

Question: I just go the mission "Dekuuna: Elcor Extraction" and I need to go to the planet Dekuuna. The mission does not specify where I should go to find this planet and I don't see any indication anywhere on the galaxy map of where I should go. So, what mass relay and system should I go to in order to find Dekuuna?
Comment: Problem is: If you already scanned Dekuuna for the "Dekuuna: Code of the Ancients" quest, you might have scanned Oltan too and already picked up the Elcor Army without having the quest. So just return to the quest giver and end the mission like Gh0sT already said.
Answer: The Elcor homeworld of Dekunna is in the Silean Nebula, in the Phontes system.  I see that you've found Oltan - Oltan is actually a satellite of Dekuuna, so it should be right there.
If you found the Elcor asset there, you're in the right place - the ships you're looking for are apparently on Oltan, actually.  (It's even possible you already found this one without realizing it, maybe)
More at the Mass Effect wiki.
Answer: The planet with the survivors you're looking is named Oltan. Oltan is in the Phontes System which, in turn, is in the Silean Nebula. As for where Dekuuna is, it's the big planet right next door to Oltan.
Once you scan Oltan and pick up the Elcor Flotilla, just head back to the Citadel Embassies and talk to the Elcor Ambassador again to finish the quest.
Comment: True, but you actually need to head to Oltan, not Dekuuna. Regardless, I've updated the answer.
Comment: This is false. When I go to that planet there is no option to land or scan. I know I found an Elcor asset there, but that is not the same as this mission. Anyway, the mission says that the planet is named Dekuuna, as my question says.
Comment: OK, I understand now. I changed my vote.
Answer: Dekuuna is located in the Phontes System in the Silean Nebula. BUT if you have already completed "Dekuuna: Code of the Ancients" nothing happens when you scan it (it seems to be a bug). In that case just speak to the quest giver to complete the mission.
Answer: Go to the Silean Nebula (it might not originally show up on the galaxy map) and then to the Phontes system (there is an artefact on Dekuuna and a flotilla on its moon).
Comment: Welcome to Arqade! Thank you for contributing, but your answer does not add anything to the existing answers. We would prefer that you no do this, as answers like this add noise without helping anyone.

Where is Dekuuna?


Why is binary serialization faster than xml serialization?

Question: Why is binary serialization considered faster than xml serialization?
Comment: Please clarify your question. Are you asking if one is faster than the other, or _why_ one is faster than the other?
Answer: Consider serializing double for example:

binary serialization: writing 8 bytes from memory address to the stream
binary deserialization: reading same 8 bytes
xml serialization: writing tag, converting to text, writing closing tag - nearly thrice the I/O and 1000x more CPU utilization
xml deserialization: tag reading/validation, reading string parsing it to number, reading/validation of closing tag.  little more overhead for I/O and some more for CPU
Comment: One might also mention memory management for string objects typically created during serialization or deserialization of text formats. This can push things out of CPU caches, or cause garbage collection algorithms to kick in, or thrash.
Answer: Binary serialization is more efficient because write raw data directly and the XML needs format, and parse the data to generate a valid XML structure, additionally depending of what sort of data have your objects the XML may have a lot of redundant data.
Answer: Actually, like all things - it depends on the data, and the serializer.
Commonly (although perhaps unwisely) people mean BinaryFormatter for "binary", but this has a number of foibles:

in adds lots of type metadata (which all takes space)
by default it includes field names (which can be verbose, especially for automatically implemented properties)

Conversely, xml generally has overheads such as:

tags adding space and IO
the need to parse tags (which is remarkably expensive)
lots of text encoding/decoding

Of course, xml is easily compressed, adding CPU but hugely reducing bandwidth.
But that doesn't mean one is faster; I would refer you to some sample stats from here (with full source included), to which I've annotated the serializer base (binary, xml, text, etc). Look in particular at the first two results; it looks like XmlSerializer trumped BinaryFormatter on every value, while retaining the cross-platform advantages. Of course, protobuf then trumps XmlSerializer ;p
These numbers tie in quite well to ServiceStack's benchmarks, here.
BinaryFormatter *** binary
Length: 1314
Serialize: 6746
Deserialize: 6268

XmlSerializer *** xml
Length: 1049
Serialize: 3282
Deserialize: 5132

DataContractSerializer *** xml
Length: 911
Serialize: 1411
Deserialize: 4380

NetDataContractSerializer *** binary
Length: 1139
Serialize: 2014
Deserialize: 5645

JavaScriptSerializer *** text (json)
Length: 528
Serialize: 12050
Deserialize: 30558

(protobuf-net v2) *** binary
Length: 112
Serialize: 217
Deserialize: 250

Comment: @FrankHileman unfortunately people still lean on it by default, so it is *necessary* to compare it, even if it is playing a different game on a different field (and everyone else is in the pool)
Answer: Well, first of all, XML is a bloated format. Every byte you send in binary form would be similar to at least 2 or 3 bytes in XML. For example, sending the number "44" in binary, you need just one byte. In XML you need an element tag, plus two bytes to put the numer: <N>44</N> which is a lot more data.
One difference is the encoding/decoding time required to handle the message. Since binary data is so compact, it won't eat up much clock cycles. If the binary data is a fixed structure, you could probably load it directly into memory and access every element from it without the need to parse/unparse the data.
XML is a text-based format which needs a few more steps to be processed. First, the format is bloated so it eats up more memory. Furthermore, all data is text and you might need them in binary form, thus the XML needs to be parsed. This parsing still needs time to process, no matter how fast your code is. ASN.1 is a "binary XML" format that provides a good alternative for XML, but which will need to be parsed just like XML. Plus, if most of the data you use is text, not numeric, then binary formats won't make a big difference.
Another speed factor is the total size of your data. When you just load and save a binary file of 1 KB or an XML file of 3 KB then you probably won't notice any speed difference. This is because disks use blocks of a specific size to store data. Up to 4 KB fits easily within most disk blocks. Thus, for the disk it doesn't matter if it needs to read 1 KB or 3 KB since it reads the whole 4KB block. But when the binary file is 1 megabyte and the XML is 3 megabytes, the disk will need to read a lot more blocks to just read the XML. (Or to write it.) And then it even matters if your XML is 3 MB or just 2.99 MB or 3.01 MB.
With transport over TCP/IP, most binary data will be UU-encoded. With UU-encoding, your binary data will grow with 1 byte for every 3 bytes in the data. XML data will not be encoded thus the size difference becomes smaller, thus the speed difference becomes less. Still, the binary data will still be faster since the encoding/decoding routines can be real fast.
Basically, size matters. :-)

But with XML you have an additional alternative. You can send and store the XML in a ZIP file format. Microsoft Office does this with it's newer versions. A Word document is created as an XML file, yet stored as part of a bigger ZIP file. This combines the best of both worlds, since Word documents are mostly text thus a binary format would not add much speed increase. Zipping the XML makes storage and sending the data a lot faster simply by making it binary. Even more interesting, a compressed XML file could end up being smaller than a non-compressed binary file, thus the zipped XML becomes the faster one. (But it's cheating since the XML is now binary...)
Answer: I had assumed binary serialization to be faster than xml (based on how verbose xml can be). However I have an opposite observation! I was investigating a performance issue in one of my application and find out that time to serialize is similar between xml and binary. However difference in time to deserialization is extremely huge. xml deserialization takes less than 10 seconds but binary deserialization takes over 10 minutes!

So I guess in theory xml serialization/deseriliaztion is slower than binary but in your application, it depends!

I can't share the actual data but here are the results (in milliseconds)

 Serialization   Deserialization
 XML    Binary   XML    Binary
 7,956  9,535    9,112  668,918
 7,608  9,105    8,386  670,445
 7,583  9,398    8,372  676,190
 7,656  9,299    9,783  679,117
 7,454  9,458    8,219  669,626


Godox X Pro Flash Trigger Using Center Pin only does not fire Godox TT600 flash

Question: Godox Xpro (C) mounted on Canon 5D Mark III hotshoe with single pin adapter between hotshoe and trigger will not fire Godox TT600 speedlites.  Without the adapter between hotshoe and trigger I can fire the flash every time.  Both are set in MANUAL.
Comment: Why are you using a single pin adaptor between the camera and trigger? What are the flash settings in the camera menu set to?
Comment: Um, what's the question?
Answer: The Godox Xpro does not have a single pin trigger mode.
The Xpro can be fired from the Sync socket when configured  appropriately to provide backward compatibility.
The X1T has a single pin mode.
Also the T600 and T660 flashes can be used as single pin controllers.
Comment: @StevenKersting, that's incorrect. First off, the X2T has no single-pin mode; only the X1T does, and it's for the sync pin on the foot to be used on non-supported systems. From the X1T-F user manual: "It is advisable to set the transmitter to single contact mode when using it to trigger the flash by PC cord or **through camera's single contact**."
Comment: The X-pro doesn't have single pin mode because it doesn't have a hotshoe. Single pin mode on the X1/X2's has nothing to do with the input signal to the trigger; it only puts the passthrough hotshoe into single pin mode. And if you block communication to/with the trigger by taping over the other pins they will still trigger a flash.
Comment: @inkista, I don't have the X2T; but I do have the X1T [N], and I have experimented with it extensively trying to get it to trigger my AD200's in tail sync. Based on the manual center pin mode should work, but it doesn't; it still communicates with the camera/flash and switches the flash into HSS. You can prevent that by taping over the TTL/communication contacts and forcing single pin/dumb mode; but then it loses offset sync timing. The only way tail sync is really possible is to turn off the AD200's internal receiver and use an XTR-16 on it instead...
Comment: Everyone, thanks for the input.
Comment: @StevenKersting ...or you cable an X1R or R2 SPT receiver to the AD200. Godox tail-sync has always required a manual-only external add-on receiver unit and cannot be done with the built-in receiver. And yes, the X1T still does full TTL/HSS radio communication; it just doesn't care what the flash hotshoe is telling it, aside from the single pin. If you had HSS set directly on the X1T that's why it's sending HSS signaling, it wasn't picking that up from the camera hotshoe via the non-sync pins.
Comment: @inkista, the X1T switches the strobe in/out of HSS based on the camera's SS (auto FP). There is no way to prevent it and no sync/HSS button/function like other triggers have. And the trigger does not get SS from the center pin; which is why taping off the other pins *does* prevent the HSS switchover, but that also prevents HSS sync timing.


POST xml to php with apache2

Question: I'm working on an application that receives XML data via POST, processes it with a PHP script, and returns an XML response.
I'm getting the XML with this PHP code:
$requestStr = file_get_contents('php://input');
$requests = simplexml_load_string($requestStr);

which works fine on the Linux-based product hardware using nginx as the server.
However, for testing I'd like to be able to run it on my MacBook Pro, so I can avoid the "build image, install on product, reboot product, wait, test change" loop while I do targeted development on this XML processor.
I enabled "web sharing" which starts up Apache, added a rewrite rule to point a convenient URI at my development source directory and used curl to send a request to my PHP script thus:
curl -H "Content-Type:text/xml" -d @request.xml http://localhost/test/path/testscript

"testscript" is handled by the PHP script fine, but when it goes to read "php:://input" I get nothing -- the empty string.
Anyone have a clue why this would work under Linux with nginx and not under MacOS with Apache?
I've googled and searched stackoverlow.com to no avail.  Thanks for any answers.
UPDATE:
I've discovered that at least in this configuration, reading from php://stdin will work fine, while php://input will not.  Who knew?
Answer: Not familiar with nginx or MacOS, but with FreeBSD/Apache there is another way you might try:
$xml_in = $GLOBALS["HTTP_RAW_POST_DATA"];
You must also add this to the .htaccess:
php_value always_populate_raw_post_data 1
HTH,
Kevin
Comment: Thanks for taking the time to answer my question.  Alas, that company is no more and the question is now moot, at least for me.

POST xml to php with apache2


16.04/Dell XPS 15 9560 freezes/keyboard not working on login

Question: tldr: Ubuntu login screen: keyboard doesn't work/ubuntu freezes. Used install usb to run boot-repair. This generated this paste: http://paste.ubuntu.com/p/vnNdS8pDdR/
16.04/Dell XPS 15 9560 freezes/keyboard not working on login. I recently reinstalled linux, and it was working perfectly, until at one point i shut down the device, and got a cpu lockup[23s] message. It wouldn't power down. I used the alt + print screen + R > S > E > I > U > B combination to shut down.
From the reboot and forward, the mouse began to stop working on boot, and intermittently for 2-10s at a time. I did some research updated nvidia drivers, and attempted to turn off the nouveau drivers. The device will not allow me to log in now.
I used a usb drive to install boot-repair, and ran it. It still doesn't work. This has happened 4 times during my use of this laptop over the last year. It always happens after an update from the application manager. How do I fix/avoid this, so that I can actually use linux reliably? I use this for software development, so I only install: Visual Studio Code, Chrome, MongoDB, npm, yarn, node, and the typescript compiler.
Answer: I had the same issue. I could fix it with a modification of /etc/default/grub file. I added a parameter to line GRUB_CMDLINE_LINUX_DEFAULT. Now it looks like
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_rev_override=1"

Don't forget update-grub once you changed this file


Blender stops halfway when baking textures

Question: I'm trying to bake multiple materials into one texture map. As you can see in the image, I've selected all the objects that I want to bake the materials, selected the image texture that I want the materials to be baked on in the node editor, and made sure the bake setting is set to diffuse and unticked the direct&indirect options. Blender only bakes the two textures that you can see on the upper left of the image attached, and then stops baking. The image resolution is 4K and I have UV unwrapped all selected objects. I'm not sure why this happens or how to fix it.
Anyone have any idea why this is happening?
Answer: I think the problem is that you need to go to the Object Data tab, inside the Properties panel, under UV maps you have to click the + button to add a new UV map to your object and name it something, for example, bake. Then repeat the process for each one of the objects you want to appear in the image texture after the bake process (remember that all the newly created UV maps must have the same name and have them selected for all the objects). Before you proceed to bake the texture, you also need to unwrap all your objects at once.