Send some text to mail from UNIX such that the text will appear in some color in the body of mail

Question: I have some text in a file in UNIX. I send that file to my mail using mail command. What I want is the text to be appeared in some color in the body of the mail. The mail will be opened from Windows. Any help would be greatly appreciated.
Comment: **This is a bad idea.** Adding **any** sort of formatting to an email message tremendously increases the odds that it will be discarded as spam.
Comment: @zwol While converting an email. to html can slightly increase its spammyness, doing so properly will not significantly increase its odds of being misclassified as spam. I know because I run an email service !
Comment: Thanks a lot @zwol to bring the discussion of spam here. I need to take care of formatting as I don't want this mail to be a spam to recipient as this is so important to be read by recipient. +1 for this ☺
Answer: You would need to convert the contents to HTML, and ensure the header of the email includes
Content-Type: text/html; charset=UTF-8

How you would do this would depend on what program your "mail" command is, and indeed may not be possible.   You could modify the script to inject the email into sendmail or similar instead by something like
echo 'Content-Type: text/html; charset=UTF-8
Subject: My Subject

Email Header

This text is red
' | sendmail firstname.lastname@example.com

Note that this is a slightly crude implementation and may be more likely to dropped by spam filters unless tuned.
Comment: @Jasper Outlook 2010 and up use Word's engine to render emails. So, no, it isn't lagging: **it's walking backwards**! Thunderbird is really good and supports inline CSS and HTML4.01. For web-based services (Hotmail, GMail, Yahoo ...), you should use HTML4.01 with as little *inline* CSS as possible.
Comment: Please, do not use ``. You should use `Email header This text is red`. Also, most email clients use HTML4.01, which requires a  ``. Other than that, spot on!
Comment: @Jasper You are welcome. The email world is insanelly insane! Just so you see how crazy it is, Outlook Express 6.0 and Outlook 2003/2007 use IE to render emails, but, at least Outlook Express 6.0, freaks out when it sees an UTF-8 message. It supports it, but will insist in using whatever default encoding you picked. Some web-based services block external CSS (like GMail), other's don't support some styles (like Hotmail doesn't like paddings, as far as I know) and Outlook 2010 and up don't handle `` tags (they are converted to hacky paragraphs). The email world is hair-pulling insane!
Comment: Upvoted since yours is the practical answer. Wrote another one with some background since I felt that editing in that much extra information would distord your answer.
Comment: ``? Is the email world lagging that much behind or should you just be using css in one form or another?
Comment: @IsmaelMiguel Oh wow. Thanks for educating me.
Comment: It worked :) @davidgo. But when I use `mail` command instead of `sendmail` it's not working. And how is **Subjet** taken as email subject ? I didn't understand. Can you please clarify ?
Comment: the mail command does not usually allow you to inject headers - you need to inject the content-type header, so thats why I used sendmail rather then mail.   I'm not sure I understand what you are talking about with the "Subject taken as mail subject" - if you look at my command the second line of output includes the subject header - you would replace the words "My Subject" with whatever the subject is.  Emails are broken up into the header (which includes from, to, subject, content-type and other stuff, seperated by a blank line - the rest is the body.
Answer: Some more background to davidgo's good answer:
Email standard did not start with colour or font supports.  Thus there is no guarantee that the recipient can see any colour, no matter how hard you try.
Most clients however do interpreted mail a bit broader, and if you sent rich text or as webpage then it might render in colour. Alternatively, if you really need a specific markup you will need to send it as a picture (with all downsides, sunch as not being able to select text or edit).
Basic mail from a Unix like platform can be send as follows:
sendmail email@example.com < myfile

Or, if you like cat or start with a pipe:
cat myfile | sendmail email@example.com

Or, from echoing via shell:
echo 'content here' | sendmail firstname.lastname@example.com

All of these will send the contents of myfile, with no subject, no colour, no text markup. Just a plain simple mail. It is a good way to start with to understand the basics.

Now for David answer, it adds a line which tells the mailclient to treat the text as HTML ('Content-Type: text/html). Most mail client will happily recognise that. Some (such as elm which I still use to read suspicious emails) will not.
It also adds a subject which is quite user friendly.
And finally it uses HTML markup (start with  and with , Bold tags, and font setting to set a colour. In this case red, but you can specify any colour with the "color="FF0000" format (in RGB, in this case maxed out red, no green, no blue).
If you have the need for a more complex, variable mail then a shell script can append parts to a file and you can use the first method ( sendmail user < input) to mail the final file.

The mail will be opened from Windows.

The mail client matters here. I expect thunderbird to render this just fine on windows as well on linux or BSD. Similar I expect mutt to fail, both on windows and on BSD's.  Desgining a multipart mail with a text alternative might be a good idea. For this see RFC1341.
Comment: Do note that if sending an image or other binary, (POSIX) `cat` needs needs the `-v` or `--show-nonprinting`, otherwise much non-ascii data will be lost. Moreover, the recipient will need a special decoder script to turn the `^` caret notation escape sequences back to bytes. Don't use cat in the first place; `mail user@domain < myfile` is much better, or use something that handles arbitrary bytes properly.
Comment: I agree. And my first example uses `<` redirection.  I was trying to be complete though and a many people seem to use cat for testing. I guess I could expand on that. And optionally add things like uuencode and its more modern variants.
Comment: @Hennes I tried writing html code to a file and then redirected but it's now working and even `cat file ! mail` also didn't work for me. Only **echoing** and then **piping** worked. Why is it so ?


What do the "last men" mean by <>?

Question: In his book Thus spoke Zarathustra Nietzsche talks about the worst kind of man, "the last man" who is the direct opposite of the ubermensch. Somewhere the last men use the phrase "We invented happiness." What do they mean by that?
Comment: All I can see is a strand of straw, swaying side ta side in the still air. Goodbye Kansas, I love ya ta death!!
Answer: Basically, it means that the last man is deluding himself.

"What is love? What is creation? What is longing? What is a star?" the last man asks, and he blinks....

"We have invented happiness," say the last men, and they blink. They have left the regions where it was hard to live, for one needs warmth.

They ask questions and forget them because finding answers, and the answers, are uncomfortable, they claim to have invented happiness, they avoid unpleasant matters.  Thus they put comfort and ignorance ahead of everything, and they call the result happiness.
Comment: Nietzsche repudiates the unconditional will to truth insofar as it recommends the rejection of 'semblance, meaning error, deception, simulation, delusion, self- delusion' (GS: 344). Such rejection is hostile to life, the stuff of which is 'semblance, art, deception, points of view, and the necessity of perspectives and error' (BT Attempt at Self-Criticism: 5)
Comment: I agree with your second paragraph, and it may be in the spirit of Nietzsche. I originally misread it as claiming that they have answers and are made uncomfortable by them. I imagine the "last man" would rather trick others into thinking they have answers, the perfect life etc..
Comment: also, forgetfulness is a great thing, for Nietzsche. So, I find your answer incomplete and strange, even if it is not completely wrong or abhorrent. I mean "consummate" nihilism is IIRC in some way helpful, but then Nietzsche wouldn't call himself a nihilist, so it probably signals, again, the impossibility of some projects, how the overman must perish. though Nietzsche found the last man to be an irritant, I think, so I suppose the overman perishes through love, though that isn't pity
Answer: Passively accepting your fate is the worst thing that can happen to an individual (love is creative or least reactive); the last men are passive nihilists that accept their fate because their fate it to be happy (wouldn't you?), but it's ironic because their happiness is not as good as it can get.
Answer: No, I get it at last. The last man thinks that happiness is all that matters, unlike the awful contingencies (ironic) of virtue.
Answer:
Alas! there cometh the time when man will no longer launch the arrow
of his longing beyond man—and the string of his bow will have
unlearned to whizz! I tell you: one must still have chaos in one, to
give birth to a dancing star. I tell you: ye have still chaos in you.
Alas! There cometh the time when man will no longer give birth to any
star. Alas! There cometh the time of the most despicable man, who can
no longer despise himself. Lo! I show you THE LAST MAN.

You can see the last man as the resolution of the longing of man

The Myth of Sisyphus is far from having a skeptical conclusion. In
response to the lure of suicide, Camus counsels an intensely conscious
and active non-resolution. Rejecting any hope of resolving the strain
is also to reject despair. Indeed, it is possible, within and against
these limits, to speak of happiness. "Happiness and the absurd are two
sons of the same earth. They are inseparable"

https://plato.stanford.edu/entries/camus/
into a form of self love, even-though Nietzsche clearly wanted some of us to love ourselves in some particular way. I suppose the last man loves himself because his ego is calm and untroubled, he has his needs met by petty polity. The self love of the overman is autonomous and, above all, meaningful
https://www.tandfonline.com/doi/full/10.1080/10848770.2020.1839209
Comment: i mean, what do i know?

What do the "last men" mean by <>?


Civil Law - Shechem

Question: I have been informed that the reason Yaakov was upset with Shimon and Levi for slaughtering the males of Shechem is because the inhabitants became circumsized and had a new halachic status, or because by killing them they put Yaakov and his family in danger. However, before they circumsized they were liable to die for neglecting to set up courts and carry out justice against their prince. Would there be justification today for a war with a country/society for them failing the Noahide command to set up courts and carry out justice? What if the neglection is not a rapist, but a thief, idolator/witch, or another Noahide law? Thank you.
Comment: I should note that Yaakov's sons did not *decimate* the population of Shechem, they killed the **entire** male population. Decimate is a technical term meaning exactly 10% are killed. It comes from a Roman punishment in which 1 out of every ten rebellious soldiers were killed whether they were guilty of a crime or not.
Comment: Much better, but still: `or because by decimating them they put Yaakov and his family in danger.` is irrelevant in my view. The question is also irrelevant today, see [further reading here](https://en.wikipedia.org/wiki/Judaism_and_warfare#General_teachings_on_war). So the times of the Sanhedrin or Yaakov avinu would be more interesting.
Comment: Thank you, I apologize
Answer: The Ramban learns if a non jew violates his laws one can kill him. However you don't have to kill him. Therefore if it's unwise to do so, there would be no need to.
Comment: Thank you so much, could you direct me to this conclusion by the Ramban?
Comment: By the story of Shchem

Civil Law - Shechem


Does btrfs support per user quota?

Question: If I move the /home/... folders to a btrfs partition, can I still enable per user quota? That is, each user should be able to use a limited amount of storage.
Answer:
Does btrfs support per user quota?

No, it doesn't.

If I move the /home/... folders to a btrfs partition, can I still enable per user quota? That is, each user should be able to use a limited amount of storage.

Yes, the trick is to use a subvolume for each home.
Btrfs supports subvolume quotas since Linux Kernel 3.6.
(Note that Ubuntu Precise has 3.2, Quantal has 3.5, Raring has 3.8, and note that you can install the Raring Hardware Enablement Stack on Precise, to have an updated kernel.)
Instructions to enable quotas are in the Btrfs FAQ, "How do we implement quota in BTRFS?". Subvolumes created after btrfs quota enable support quotas automatically. Subvolumes created before btrfs quota enable need manual intervention to support quotas.

Mount the btrfs filesystem
Enable quota: btrfs quota enable mountpoint
(If the filesystem already contains subvolumes, enable their quota support:)

List the subvolume IDs with btrfs subvolume list. The number that follows ID (at the beginning of each line) is the subvolume's id.
Create a qgroup with btrfs qgroup create 0/subvolume-id path-to-subvolume (don't forget to replace the subvolume-id with the correct id)
Rescan the subvolumes, since the quota settings have been changed: btrfs quota rescan

Create new subvolumes that you need: btrfs subvolume create mountpoint/subvolume-name
Limit the subvolume usage: btrfs qgroup limit 100G path-to-subvolume
Profit.

Finally, set up /etc/fstab to mount the subvolumes automatically at boot:

UUID=uuid-of-the-filesystem /home/mountpoint btrfs defaults,subvolid=subvolume-id 0 0

Alternatively, you may use LABEL=label or /dev/sdxn to refer to the btrfs filesystem.
To apply the changes to fstab without rebooting: mount -a
Answer: No, Btrfs doesn't support user quota, It supports directory quota. So you can add quota for each user directory, but if you have shared directory with multiple users/groups then you can't set/count space for every user separately.
So you can't limit userX to be able to put 1MB of files in /home/shared and another userY to be able to put 10MB of files in the same /home/shared folder. But you can set different limits for /home/userX and /home/userY.
This is not user quota, but sub-volume quota. You can put multiple sub-volumes in single limit (for example user have /home/userX/ and /backups/userX/ then both can be under single limit.

Does btrfs support per user quota?


What's the differences between 'get it right' and 'make it right'?

Question: I know that both "get it right" and "make it right" have a meaning of "correction", but what's the significant difference between them?
Answer: The two phrases can be used in different contexts, so it'll be hard to explain ONE difference that always holds true.
That said, I'd suggest that:

"Get it right" means, "Get your facts straight."
"Make it right" means, "You messed up and hurt someone, now go fix the situation."

For example:

Did you hear Justin Bieber got arrested for cocaine?
No, that's not true – he tested positive for alcohol and marijuana. Get it right.

And then:

I don't know why you thought it would be so funny to throw eggs at Mrs. Murphy's house. She's only been nice to you. You need to march yourself over there and make it right.
You're right, Dad. Not only will I help her clean up the mess, I'll offer to cut her lawn for free for the rest of the summer.

As I said, though, that's only one way to distinguish the two phrases. A math teacher might tell her students:

Be careful when you do your arithmetic. Make sure you get it right.

But then, if the students turn in answers with a lot of mistakes:

I want every student to correct their assignments. Any place where I've marked a problem wrong, you need to make it right.

Essentially, make it right refers to fixing something your got wrong, whereas get it right is an exhortation to not get it wrong in the first place.
Comment: This answer is very clear and walks through more of the use cases than mine does. Vote for this one instead of mine :)
Answer: "Get it right" means that you are going to do something right the first time. You're working on a project, and you are determined to do it the correct way.
"Make it right" means more to fix something that is already wrong. You've taken something already created (or some harm already done) and decided to fix it. If it's so bad that it can't be repaired, you might scrap it and start over, planning to "get it right" the next time around.
"Make it right" also has more of a moral connotation. To "make something right" most often means to make amends for some wrong that has been done to someone. "He had his TV stolen from his house, but the cops will catch the thief and make this right."
Comment: This answer presents the same information as mine in a more concise manner. It's worthy of upvotes, too.
Comment: Yes, "make it right" can be used in a moral context, but I think that the core is if it is correct on the first time, or eventually correct. If you get something, you are receiving it whole, if you make something you are creating it. In this case the correctness if being done whole, or by pieces.
Answer: In 'making it right' you are asking a person to correct an injustice, to change a state from being unfair to fair. The person who is being asked obviously has some ability, power or influence to be able to alter whichever situation you are trying to make fair again while the person asking lacks or is unable or incapable of changing the unfair situation themself. "Honey, please make it right between your parents". "You are our last hope, you have to make it right no matter the sacrifice".
With 'get it right' you are asking someone to succeed during their next attempt, which could be the first attempt, but could also be additional attempt at achieving something they failed at achieving before. It is said from someone in a position of power to someone below them, since this is not something a soldier would ever say to a general, an employee to a boss, or a child to their parents (unless they got no manners).
A coach, a teacher, a parent, a team mate, or anyone with a stake in another person succeeding at some task is likely to say this as long as they are above or equal to them. Saying 'get it right' will sound unusually harsh coming from a spouse, or close friend if used incorrectly, and for some reason I want to add 'bozo' to the end - "get it right bozo... or you are fired!" "You will keep marching around the barracks all night and every night, if that's what it takes for you to get it right."
So "make it right" is addressed to a position of power in a polite, almost pleading way, hoping that they will accept. While "get it right" is never addressed to a position of power unless you want to sound insolent and rude on purpose.
Comment: I like this answer better than mine; it's a classic example of why it's best for an O.P. to not accept a question too early.
Comment: The article [The smart move: we learn more by trusting than by not trusting](https://aeon.co/ideas/the-smart-move-we-learn-more-by-trusting-than-by-not-trusting) has this sentence: "If people and institutions are more trustworthy than we give them credit for, why don't we **get it right**?" Does that mean the author have the power to the audience?


Is rigged Hilbert space generally considered the correct structure for QM?

Question: I am currently reading the quantum mechanics text by Ballentine and, over and over, arguments are made (e.g. Chapter 4.6 on constraining the wavevectors of free particles to be real) which rely on rigged Hilbert space as the "correct" context for a quantum theory. Is this generally accepted as true? I ask this because I have this vague notion that there exists another capitulation/mathematization of quantum theory which used operator theory/spectral theory/follows von Neumann, and it seems to me that this is a completely different approach than the rigged Hilbert space approach. Thus my question, overall, is whether there is consensus from mathematical physicists as to which is "most correct", or are they perhaps equivalent?
Comment: The approach based on the rigged Hilbert space structure requires more mathematical hypotheses, and it is much more delicate to rigorously handle, than the von Neumann formulation. For that reason I strongly prefer the latter.  Physically speaking, in all concrete situations, they are equivalent. I think that nobody uses the rigged H space for *rigorous* computations: an impossible heavy work to obtain formally evident results.
Comment: von Neumann? Density matrices?
Comment: @CosmasZachos No, my understanding is that what I am calling the "von Neumann formulation" goes through a generalized spectral theorem which lets us make sense of an eigendecomposition of unbounded operators (in terms of some integral over a projection-valued measure?). This is strikingly different than simply admitting the "eigenfunctions" of such operators which exist in a space conjugate to the nuclear space of our Hilbert space as in the rigged Hilbert space formalism.
Comment: Personally, I sometimes pretend to use the rigged H space approch and finally I rigorously prove the found result with the vN formulation which is quite easy to use once guessed the formal result. I think this is the only safe way to exploit the rigged H. space formulation...
Comment: Thanks for your response Prof. Moretti. Is it correct to say that the rigged H space formulation is useful in the manner you describe because it effectively lets us make precise sense of all the crazy "momentum eigenstates" etc. that we take for granted in a "physics textbook"? @ValterMoretti
Comment: In my opinion, the "von Neumann formalism" aims at treating quantum mechanics in a general way, and the rigged Hilbert space formalism only aims at providing a rigourous formalization of quantum mechanics of particles evolving on $\mathbb{R}^n$. I have seen attempts (I cannot judge if those were successful or not...) of using rigged Hilbert spaces to rigourously define path integrals, see for example the book of Kuo, White Noise Distribution Theory.
Comment: Actually the notion of rigged Hilbert space can be extended to the case of an abstract Hilbert space equipped with a certain couple of topological subspace and sup space analogous to $\cal S$ and ${\cal S}'$ (nuclear spaces). However, I find that construction quite cumbersome in the general case.
Answer: I do not think there is a unique answer. It mostly depends on personal taste.
However, I think that almost all mathematical physicists agree on the fact that the QM approach based on the rigged Hilbert space structure requires more mathematical hypotheses, and it is much more delicate to rigorously handle, than the von Neumann formulation. Which, on the other hand, can be immediately applied to more general quantum theories than QM, whereas this extension is not similarly easy for the rigged Hilbert space formulation.
Personally speaking, for that reason I strongly prefer the von Neumann framework (though I am conscious that it may be dangerous if used uncritically).
In all my career, I never met a colleague who really used  the rigged Hilbert space for rigorous computations.
However a distinction is necessary between Dirac's improper eigenvectors formalism in QM and the  theory of rigged Hilbert spaces to formalize QM.
What is evident is the formal powerfulness of the non-rigorous  Dirac formalism. That is much more powerful, for practical manipulations, than the rigorous and solid approach by von Neumann.
The rigged Hilbert space formulation, essentially due to Gelfand, is a fruitful attempt to demonstrate that Dirac's manipulations can be formulated into a rigorous setting.
However physicists are not interested in that rigorous re-formulation of something already evident, on the one hand.
On the other hand,  mathematical physicists do not need it, because von Neumann formalism is already pretty enough.
For that reason the rigorous rigged Hilbert space formulation is a sort of strange animal to admire in the zoo of mathematics applied to physics. Its existence is a proof of the fact that when the physical ideas are really good, then they can be formulated in a rigorous mathematical framework (the converse fact is tragically false).
The safe view on the issue, in my honest opinion, is to use Dirac's formalism to guess the physical result and, if one also  needs a rigorous proof of that, to pass to the von Neumann formalism to consolidate the guessed result.
All that, as a byproduct, leads to an illustration of the difference between mathematical physics and theoretical physics. The former proceeds in terms of theorems, so that the mathematical rigour is strictly necessary; the latter mainly looks at the physical plausibility of achieved theoretical results, without paying much attention to mathematical rigour. Both use mathematics, but for the former it is a guide, for the latter it is a slave.
Comment: This answer is very enlightening to me! As a mathematician using some of these ideas from physics in application to number theory, naturally I don't mind a little more overhead... and, for me, various rigged-Hilbert-Space ideas (e.g., $L^2$ Sobolev spaces) in combination with the Stone-vonNeumann spectral theory of unbounded operators is the most explanatory for me. I've long suspected that physicists took "physical phenomena" as entirely adequate substitutes for "proof", and I can understand that! Using things outside their testable range is more risky. :) Thanks again for your explanation!
Comment: Yes. The difference between mathematical physics and theoretical physics is that the former proceeds in terms of theorems, so that the mathematical rigour is a guide, the latter mainly looks at the physical plausibility of achieved results, without paying much attention to mathematical rigour.


Renaming items with the /give command in Minecraft PE

Question: I can't figure out how to get an item that is renamed using the /give command and I have tried the command I found here, /give @s stone 1 0 {display:{name:"name"}} but it keeps saying that I am missing a close bracket in line 1, column 2. I have as many closed brackets as I do open brackets. I want to know this because I am making a private server in Minecraft PE.
Comment: Duplicate of [How do you add NBT tags to commands in Minecraft Pocket/Bedrock Edition?](https://gaming.stackexchange.com/questions/334102/how-do-you-add-nbt-tags-to-commands-in-minecraft-pocket-bedrock-edition)
Answer: I'll take a shot at this...
Command structure: /give <player:target><itemName: Item>[amount: int] [data: int] [components: json]
There is not a one block solution. The reason is "Item" is the only thing you can /give so if it's not a default minecraft:item (e.g minecraft:stone, etc...) you cannot /give it.
There is a gadget you will need to make.
I'll do my best to describe it. I use this in my command block typewriter to give a named map with instructions written on it to the player.
Start with 2 command blocks. They will be [R]epeat/[U]nconditional/[A]lways Active blocks. Each one will output a signal through a comparitor into the same solid block with a redstone torch on top. My code below is for a named map. Replace my map example with the item of your choice.

Command block R/U/A:
/testfor @e[type=item,name="Control Panel Help"]

(This checks to see if the map I've named "Control Panel Help" is on the ground - a signal output happens if it is)

Command Block R/U/A:
/clear @p map 6 0

(Clearing a map or item in a players inventory without taking it or taking 0 of it will produce a comparator signal letting us know the player has the item)
If either these commands returns true, the torch on the block they feed into will never light.
The redstone torch powers a row/series of commands with the first, an [I]mpulse]/[U]nconditional/[N]eeds Redstone above the redstone torch. Series is as follows:
Series 1 Command Block I/U/N:
/clear @p map 6  -1
(Clear all items in the players inventory matching map type 6)
Series 2 Command Block [C]hain/U/A:
/setblock <x y z> air 0 destroy
(x y z are the location where you will clone a container that holds the named item you want to get to your player. You will be using the destroy flag so the container drops the cloned named item)
Series 3 Command Block C/U/A:
/clone <start x y z> <end x y z> <destination x y z> replace normal
(Start and end are the same coordinate.  At that coordinate a container, like a barrel or chest, where your master named item is stored. Destination x y z should be the location the setblock command in the prior step would destroy. In this example I'm using a Barrel)
Series 4 Command Block C/U/A:
/kill @e[type=item,name="Barrel",c=1,x=<destination x> y=<destination y> z=<destination z>,r=5]
(Basically we get rid of the Barrel container item on the ground but only the container that appeared as a drop when we destroyed it. Leaving just the named item on the ground.)
Whew!! Seems like a lot! Finally we have an item on the ground but only if it is not in a players inventory, which will be true at the start of a game. Nobody will have the named item.
We can now /tp the named item on the ground to any x y z coordinate entity or player.
Example tp the named item above the this calling command block
Command Block R/U/A :
/tp @e[type=item,name="Control Panel Help",c=1] ~ ~1.5 ~ false
The nice thing about my gadget is the player can drop the item and it will return to their inventory. If the player stashes it in a chest, it will be recreated in Inventory. It's the ultimate /give
Comment: What the… I don't know what this super long answer is all about, but it definitely does not fit to the question. The person just asked how to give a named item to someone in MCBE, to which the answer is simply "you can't, MCBE doesn't have NBT in commands".
Comment: This seems like a nice workaround to get the same effect (give a named item), if a bit poorly explained (perhaps include a diagram for the apparatus?) . Though the additional 'persistence' / 'looping' it causes may not be wanted. The asker might want the item to not self-duplicate, so is it possible to modify this minecraft 'program' so this does not happen; i.e. just hand out one copy of named item X to player P?


Is it ok to view Time Machine backup directly and store files inside backup.backupd?

Question: Suppose if I were to just view my Time Machine backup via Finder and just see its contents, no moving/renaming/deleting. Would just viewing the files affect my Time Machine backup and storing files inside backup.backupd? Because I just created a empty folder inside backup.backupd and I immediately deleted it.
Answer: It's perfectly reasonable to manually navigate your Time Machine backup with Finder, even though you would usually use the Time Machine app instead of Finder. Whilst it's not something to rely on, Finder will prevent you from making changes to a Time Machine backup.
I'd avoid storing your own files in Backups.backupd — put your own files outside this folder, there's no need to put your own files within the backups directory.
Comment: @nobody You can store files there, but why? You've got the rest of the drive to place files, put them elsewhere and leave the backup alone! Edited answer
Comment: I have edited my question.
Comment: Yes I know I should leave the backup folder alone but I am just interested. I am the type of person who likes messing around with system or crucial files. :)
Comment: @nobody That's great and I definitely don't want to you be dissuaded, but it's fine to mess with system files *because* you have a *backup*. When you start messing around with your backup, unless you've got a backup of your backup, you're removing that safety net!
Comment: Yes you are right!


Properly escaping a desired character without duplicating the backslash

Question: So I have a function that takes a string, iterates over a set of characters and returns a string with a backslash added to all the occurences of any character in that particular string:
def re_escape(string):
    res = "|\^&+\-%*/=!>"
    for i in res:
        if i in string:
            a = string.split(i)
            adjusted = ""
            for y in a:
                adjusted+="\\"+i+y
            adjusted = adjusted[2:]
            string = adjusted
    print(string)
    return string

Giving this function the string "
" returns "
", as desired.
However, going back to the part of the program calling this function and receiving the string as a return value, trying to print it results in "
" being printed. Is there any way to prevent it from adding the second undesired backslash?
Answer: Give it a try: string.replace('\\\\','\\').


Categorical semantics of W-types

Question: Jacob's book titled "Categorical Logic and Type Theory" gives a nice description of Π and Σ types as adjunctions to substitution functors induced by display maps.  Is there a similar categorical description of W-types (and maybe M-types while we are at it)?
Comment: The title of the question has a typo which should be fixed.
Answer: The categorical semantics of W-types, as initial algebras, have been studied in the following paper of Moerdijk and Palmgren: "Wellfounded trees in categories", Annals of Pure and Applied Logic 104(2000), 189 - 218.
Comment: And for M-types (as terminal coalgebras) there is the dual paper "Non-well-founded trees in categories" by van den Berg and de Marchi, APAL 146 (2007) 40–59.
Answer: Also, this may be helpfull —
http://ncatlab.org/nlab/show/polynomial+functor
http://ncatlab.org/nlab/show/W-type

Categorical semantics of W-types


What's the word for "urge to go to the toilet"?

Question: I am pretty sure there's a word for it, but I forgot what the word was completely. By "urge to go to the toilet", I mean the desire to go peeing or pooping obviously.
Answer: There is no single word for this.  The actual expression varies between English dialects, but in the US it's common to say something like:

I need to go the bathroom.

If (for whatever reason) you want to be more descriptive, you can say something like

I have a full bladder.

Naturally, there are dozens or perhaps hundreds of slang expressions for this, most of them fairly crude.
Answer: There is the phrase "caught short". In the Oxford Dictionaries is

be caught short
  PHRASE
1.1 British informal Urgently need to urinate or defecate.
those caught short in the store will have to pay £1 to use the toilets
Comment: Moreover "caught short" is in general use to mean *"failing to reach some intended goal"*, which might cause confusion if an English learner reads something like:  *"The Australian was **caught short** of the crease by Ambati Rayudu's direct throw"*  as it's odd for a sports announcer to suggest one of the players needs to pee.
Comment: This is a colloquialism.  In the US, no one would know what you mean.  Also, I would be careful assuming it's a *common* expression in the UK, as I've never heard it used in any British television programs.
Comment: @Andrew I don't *assume* it's a common expression in the UK, I know it, which is why I wrote this answer. Pretty much everyone here would understand what is meant. The dictionary reference says "British informal" so you should challenge *them* with your TV survey.
Comment: I think yours is a good answer, but problematic as the *accepted* answer.  There are perhaps several hundred colloquial ways to say "need to urinate/defecate", many of which would not be understood outside the local dialect, and so of limited use to an English learner.  It's better to teach the one that can be used *anywhere*, and then add in some regional variations.
Comment: @Andrew I didn't accept my own answer! On the other hand the American euphemism "need to go to the bathroom" may be widely misunderstood too, a bathroom being where one takes a bath, not a pee. Heck, many of us didn't even *have* a bathroom until the 1960/70s.


How do geologists measure green house gass emmissions from large regions

Question: I read here that volcanoes release about "0.6 billion metric tons of carbon dioxide per year". I wonder though, how scientists can estimate the emissions from large regions with geological features that release carbon dioxide and methane. For example, here in the Czech Republic, we have countless springs with carbonated water. Some have only a few bubbles while others shoot out like a freshly opened bottle of sparkling wine. Since the Czech republic has an area of 78 870km² it seems impossible that geologists could ever count and measure the output from all these springs, especially since the vast majority of them probably seep their carbon into underground caves, which then leak into the surface soil and eventually the atmosphere. It seems to me, that there is probably carbon seeping into the atmosphere from every m² of land in the country, and at wildly varying rates. What kind of methods to geologist use to get even a rough estimate? Do they try like covering the ground with 100m² tarps and try gathering the carbon that comes up? I'm just guessing here...
Answer: Tracking atmospheric species over the entire planet really is comparatively easy via satellites, compared to plastering entire swathes of land with measurement stations.
You make one infrared image from an imaging satellite at the right wavelength and you got the entire country covered. The right wavelength to choose has to be

originating from the molecule in emission at the right altitude and
be optically thin. If you know your emission is optically thin, the flux in your image is directly proportional to the mass that is emitting this flux. If it's not optically thin, complications apply, but the idea is the same.

An example of the observational fleet that NASA has in orbit can be found here (scroll down the page). There it also becomes clear, that various instruments are needed to cover the entire range of interesting atmospheric species, which necessitates a number of observation platforms/satellites.
Comment: Can they distinguish between carbon coming from spring water and carbon from cars using the satelites?
Comment: @timthelion: In principle yes, as the largest contribution by cars vs natural sources will be spatially separated. And you just made a high-res satellite image. For some satellite systems the resolution scale is down at the 1km level, but I am not sure about CO2 specifically.
Comment: I'm not sure there is spacial sparation in terms of hot springs. I think that many cities actually were created because they were near a hot spring and I think that the water is most carbonated where it is warm (but I'm not sure).
Comment: @timthelion: Cities are founded in ancient times due to availability of fresh water, various resources and accessibility considerations. Except in arctic regions, hot springs don't play a role, we are not living in the world of Game of Thrones. Independent of that, Satellites are how it's done. No other way to cover the globe.
Comment: I do not know where you are from, but my question explicitly mentioned my home country, Czechia, where it is certainly true that hot springs tend to have cities around them. https://en.wikipedia.org/wiki/Spa_towns_in_the_Czech_Republic . Hotsprings are of significant religions and cultural importance here. Where did you learn that hot springs do not play a role in the formation of cities?


Measuring the resonant frequency of a crystal

Question: I am trying to measure the frequency of crystals in my box. I have a signal generator set to output a sine wave at 5V p/p. The output is applied to the crystal and then the other lead of the crystal is fed to the oscilloscope. The ground of the signal generator and the oscilloscope are connected together.
I changing the frequency of the signal generator around the rated frequency of the crystal. I was hoping to see large amplification at the resonant frequency. Instead I am seeing nearly the same wave amplitude at all frequencies.
My signal generator is capable of generating frequency accurate up to two digits after the decimal.
Are all my crystals bad somehow?
Comment: Please show a schematic.  If you don't have a load on the crystal, you'll almost certainly never see a response.
Answer:
Are all my crystals bad somehow?

Probably not. The "issue" with crystals is that the quality factor: Q of a crystal is very high meaning it is somewhat challenging "see" the resonance.
I've built a simple crystal tester myself and it is based on a circuit, which is a standard CMOS logic based crystal oscillator which is present in many ICs including microcontrollers.

source of that picture
It states "20 MHz" for the crystal but in my experience this works with 32 kHz crystals up to around 30 MHz. If you make the circuit small and use faster inverter than the 40106 (for example the 74HC04) then 50 MHz might be possible.
Then using an oscilloscope or frequency counter you can determine the resonance frequency.
Comment: You can -- with a proper setup, and a really good signal generator -- do it using a signal generator.  But the above circuit is much more universal.
Comment: @TimWescott I was thinking maybe feeding a very steep pulse through a resistor to the crystal and looking at the response using the scope might do it but since I've never tried that and seen that working, I didn't mention it. Indeed above circuit "just works" and is handy for checking crystals.
Answer: When looking at lower frequency quartz with high impedance, the resonance is clearly visible.

Higher frequency quartz is better viewed in series with a low impedance generator.

Thus, we see the series resonance frequency, which is minimally different from the parallel.
Comment: This is what I meant by "have a load on the crystal" in my comment to your question.  You also need a signal generator that's stable enough that you can find the resonance -- it'll be 1kHz wide or less, at the crystal resonant frequency; a typical bench signal generator will have a lot of problem hitting it and staying there.
Comment: @TimWescott You're right - typical function generators are far too unstable: their **residual frequency modulation** sweeps right through resonance. Even a medium-quality RF generator might be too "squirrelly".
Comment: @csabahu Thank you. This answer opens a good deal of experiment options.


Is there any punishment for Having more than 50% of the mining power of the network

Question: I am just curious about it.
In history once it happened That GHASH.io owns 52% mining power, he was malicious and sell 5% to other miner. Bitcoin community keep watch on everything?
Answer: Quite the contrary. If a pool becomes too big it just earns more money. There is no punishment. Maybe some bad reputation, but not something the majority will even notice.
It has happened three times so far that pools reached hashpower majority or got too close to it: Deepbit, BTC Guild and GHash.
Only Eleuthria, operator of BTC Guild, handled this in a responsible way. He raised the pool fees which caused some miners to react, moving to other pools. This balanced out the pools.
GHash scammed a casino, but they could have done this without having so much hashpower as we are talking about zero-confirmation transactions. They later said it was done by a rogue employee who is no longer with them.
Deepbit and GHash acted irresponsible and so did the miners. It appears that the vast majority of miners are not keeping watch on whether a pool gets too much hashpower or they just don't care.
The fourth time this happens, maybe some very bad things will happen. Hopefully in that case miners will take note and act more responsibly. It is doubtful though, as almost noone reacted to the casino scam mentioned above.
Disappointing for sure, but it is what it is.
Answer: There's no bad consequence in the protocol for having more than 50% of the hashrate. However, the community keeps a close eye on the pool repartition and will try to prevent such a pool to exist by moving to a smaller one (as it happened with Ghash.io).
Ultimately, the only punishment is a stronger community monitoring to try to prevent selfish mining, double spends, etc... If a miner above 50% stays malicious, the only other recourse could be a HF to another PoW function.
Comment: ... When it is observable. Many behaviours that can threaten the system when deployed on a wide scale (like spy mining) are entirely undetectable by the outside world (until it is possibly too late).


Place a border around points

Question: I'd like to place a black border around points on a scatterplot that are filled based on data, using ggplot2. Also, I would like to avoid having a legend entry for the black border since it will be on each point. Basically I'm looking for this plot, but with a black border around each point.
df <- data.frame(id=runif(12), x=1:12, y=runif(12))
ggplot(df, aes(x=x, y=y))+geom_point(aes(colour=id), size=12)

As a bonus, I'd like to not have a legend entry for the black border. My best try is:
df <- data.frame(id=runif(12), x=1:12, y=runif(12))
ggplot(df, aes(x=x, y=y))+geom_point(aes(fill=id, colour="black"), size=12)

Which gives:

I don't understand why that doesn't give me what I want, and worse (for my education in ggplot2) I don't understand why it doesn't seem to map fill color to anything! Any help?
Perhaps if I can get the outline and fill mapping right I can use a hack like the one in hte last set of figures here to turn off the legend.
Answer: It's a bit obscure, but you have to use pch>20 (I think 21:25 are the relevant shapes): fill controls the interior colo(u)ring and colour controls the line around the edge.
(g0 <- ggplot(df, aes(x=x, y=y))+geom_point(aes(fill=id),
       colour="black",pch=21, size=5))

update: with recent ggplot2 versions (e.g. 2.0.0, don't know how far back it goes) the default guide is a colourbar.  Need g0 + guides(fill="legend") to get a legend with points as in the plot shown here.  The default breaks have changed, too: to exactly replicate this plot you need g0 + scale_fill_continuous(guide="legend",breaks=seq(0.2,0.8,by=0.1)) ...

Related but not identical: how to create a plot with customized points in R? . The accepted answer to that question uses the layering technique shown in @joran's answer, but (IMO) the answer by @jbaums, which uses the pch=21 technique, is superior. (I think shape=21 is an alternative, and perhaps even preferred, to pch=21.)
PS you should put colour outside the mapping (aes bit) if you want to set it absolutely and not according to the value of some variable ...
Comment: I don't see one (I tried setting `width` and `lwd`), sorry.
Comment: Thanks Ben. Is there any way to change the stroke (outline) width using this method?
Comment: Thank you for this - never would have gotten there without this answer!
Answer: The first question's a gimme:
ggplot(df, aes(x=x, y=y)) +
    geom_point(aes(colour=id), size=12) +
    geom_point(shape = 1,size = 12,colour = "black")

And, oh, you don't want an extra legend. I think that does it then:
Comment: @Seanosapien sure, just "jitter" the points manually (transform the values in `df`) using either `rnorm` or `jitter`. You may want to store these values in a new variable in case you need raw values downstream.
Comment: Oh, I see why - because it is not inside an aes() call
Comment: This is nice, but fails if you're using jitter.
Comment: Interestingly a guide doesn't show up for the second geom_point - I don't really understand why that is, but since it is what I wanted anyway I'll worry about it another day
Comment: @DrewSteen - looks like you got it, I asked a similar question a while back since it took me a while to figure that out too. I'm not sure if/what would be made out of date by the introduction of ggplot 0.9: http://stackoverflow.com/questions/4221168/ggplot-legend-issue-w-geom-point-and-geom-text
Comment: @RomanLuštrik You are right. Is there a solution? I'd like to do do something similar using geom_jitter.
Answer: I had the same issue, but I needed a solution that allows for jitter, too. For this you do need to use a pch that is a filled shape with a border and a grid.edit function from gridExtra package. Using your example:
df <- data.frame(id=runif(12), x=1:12, y=runif(12))
ggplot(df, aes(x=x, y=y, fill=id))+geom_point(pch=21, colour="Black", size=12)

library(gridExtra)
grid.edit("geom_point.points", grep = TRUE, gp = gpar(lwd = 3))

Answer: I had the same question, but perhaps since I was using geom_map with latitudes and longitudes, the other answers as of January 2020 didn't work for me.
Restating the question, where the following does not have a black outline around the points:
df <- data.frame(id=runif(12), x=1:12, y=runif(12))
ggplot(df, aes(x=x, y=y))+geom_point(aes(colour=id), size=12)

If I declared both the color and fill in the aesthetic and then used shape 21, problem solved.
ggplot(df, aes(x=x, y=y)) +
  geom_point(aes(colour=id, fill=id),
  shape = 21,size = 12,colour = "black")

Comment: @Ecg modifying the code above, the following  works for variable size:   library(tidyverse)
size_x <- 1:12
df <- data.frame(id=runif(12), x=1:12, y=runif(12), size = size_x)
ggplot(df, aes(x=x, y=y)) +
  geom_point(aes(colour=id, fill=id),
             shape = 21,size = size_x,colour = "black")
Comment: Hi @windyvation what if my data is plotted so the size depends on a variable, how can I add a black outline to the circles? My plot would be like this `ggplot(data, aes(x = Region, y = func, label=NA)) +
  geom_point(aes(size = scaled_val, colour = value), shape = 21, colour = "black") +
  geom_text(hjust = 1, size = 2) +
  theme_bw()+
  scale_color_gradient(low = "lightblue", high = "darkblue")`
Answer: If you want more control (for example, borders on points with various shapes and transparencies), use the fill aesthetic with shapes 21:25
ggplot(aes(x = Sepal.Length, y = Petal.Width, fill = Species, shape = Species), data = iris) + # notice: fill
    geom_point(size = 4, alpha = 0.5) + # transparent point
    geom_point(size = 4, fill = NA, colour = "black") + # black border
    scale_shape_manual(values = c(21:23)) + # enable fill aesthetic
    theme_classic()

Place a border around points


Term used to describe someone who explicitly follows directions when they know that doing so will result in a negative effect

Question: I know I've seen this word somewhere before. It's when a subordinate follows instructions exactly as given when the subordinate knows that the instructions will result in a negative effect (damage to systems, broken processes, etc).
Comment: Do you mean the subodrinate acts *despite* his knowledge of the possible negative effects? Are you looking for a noun, an adjective, or an idiomatic expression?
Comment: The subordinate knows that their following of the instructions would result in bad things happening but do it anyway. I think it's more of an idiomatic expression.
Answer: Malicious compliance is one phrase, although there might be a better one out there. As @StoneyB points out in the comments, in a union environment it would be called "work to rule" or rule-book slowdown.
An example of malicious compliance is if someone says to me "Drop that dirty dish in the sink for me, would you?" and I actually drop it in the sink knowing that the dish will break instead of placing it in the sink as the asker obviously intended me to do.
An example of "work to rule" is this article in a local paper, Teachers institute 'work to rule' plan
Answer: I think that the word you're looking for is "compliant":

: willing to do whatever you are asked or ordered to do : ready and
  willing to comply
: agreeing with a set of rules, standards, or requirements

If not, you can look up synonyms for it in a thesaurus.
Comment: I don't think compliant captures the sort of malicious intent of the person that will do what you say to the letter even if they are fully aware that the result of doing that will not be what you intended. If someone says "Drop that dirty dish in the sink for me, would you?" and I drop it in the sink knowing it will break instead of placing it in the sink as the asker intended me to do, I'm not being compliant.
Comment: Agree with ColleenV - even if the person doesn't have malicious intent, the guilt they assume through lack of action should also be conveyed in the word.


How can I force my phone to send iMessage instead of SMS? (I'm in a mobile promo) [Iphone 5 iOS 9.0.2]

Question: I am new to apple and I want to use iMessage. When I am connected to the internet, I thought SMS would automatically send as iMessage. The one I'm texting also uses iPhone 5 and we're both connected to internet.  I still have to know what their e-mail to text them in iMessage.
Answer: You can go to Settings > Messages and turn the Send as SMS option off. (The actual names of the options may be different as I am just translating from my local language settings.)


Automatically get a value from a log in based website daily

Question: I have an online share trading account in which I own a number of shares. I want to be able to get the total portfolio value automatically daily. Unfortunately my broker doesn't have an API interface. I think it should be possible to get the value using browser automation such Selenium. I can then get the value through the id of the div tag. Does anybody know what is the best way to achieve this?
Answer: Google Docs supports a spreadsheet formula called GoogleFinance. I presume it works for stock markets around the world. I tried the below formula for Dr. Reddy's Laboratories listed in the Bombay Stock Exchange (BSE)
=GoogleFinance(500124,"price")
The scrip code 500124 represents Dr. Reddy's Laboratories. You can use a Google Docs sheet to track stocks.


Laptop -> Disable internal screen on lid close / docking station

Question: I am an absolute noob on Linux/Ubuntu, so please excuse if this is a silly question...
I am using a Lenovo ThinkPad T450 in a docking station with two external screens connected to displayport. The laptop's lid is always closed.
When booting the laptop to Ubuntu, the internal screen is enabled and set as primary screen although the lid is closed. The external screens are only extensions.
Why is that? How can I change that?
Windows is having a whole other behaviour here and working as expected: when closing the lid the internal screen is completely disabled an only the external screens are enabled. One of the external screens is then set to primary.
On Google I did not find a solution for that, only for "Laptop is going to suspend when lid is being closed", but that is NOT my problem here.
Thanks for your help.
Regards
Lorenz
Answer: We had the same problem on some of our Lenovo ThinkPad T480.
As it turned out the problem was related to an outdated BIOS Version. Updating to the current Version fixed it.
It even is mentioned in the Changelog (https://download.lenovo.com/pccbbs/mobiles/n24uj23w.txt):

(Fix) Fix an issue where ThinkPad LCD might be detected when LID
closed even user set power policy as "Lid Close Do nothing".


apt-get update shows "bionic-getdeb Release' does not have a Release file" on 18.04

Question: I was trying to install pycharm on ubuntu bionic beaver(18.04).
I tried the following commands:
<code> sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu $(lsb_release -sc)-getdeb apps" >>  /etc/apt/sources.list.d/getdeb.list'
 wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
 sudo apt update
</code>
But apt update shows the following:
<code>Hit:1 http://archive.canonical.com/ubuntu bionic InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Ign:3 http://screenshots.getdeb.net bionic-getdeb InRelease
Err:4 http://screenshots.getdeb.net bionic-getdeb Release   404  Not
Found [IP: 184.108.40.206 80] Reading package lists... Done N: Ignoring
file 'getdeb.list.bck' in directory '/etc/apt/sources.list.d/' as it
has an invalid filename extension E: The repository
'http://archive.getdeb.net/ubuntu bionic-getdeb Release' does not have
a Release file. N: Updating from such a repository can't be done
securely, and is therefore disabled by default. N: See apt-secure(8)
manpage for repository creation and user configuration details.
</code>
I tried many on-line solutions like changing server from main to India and vice versa.But not able to correct the problem. Also the link http://archive.getdeb.net/ubuntu gives 404 error.
Answer: According to ubuntuupdates.org there is no repo for bionic, hence your error message.


Is it possible to make an obj with single triangle

Question: I am not good in using blender so i wanted to ask if it is possible to make an object with just one triangle and how would it look like, will the no of triangle increase if you scale it up.
Answer: A mesh with just a single triangle is perfectly possible.
It would look like a triangle. Nothing particularly surprising.
Scaling it up won't automatically add more triangles, unless you use something like a tessellation shader to dynamically subdivide it.
It sounds like you might be trying to do something more involved though — if you edit your question to describe the problem you're trying to solve or the ultimate effect you want to use this to achieve, we might be able to give you a more constructive answer.


LOR from a Retired Professor

Question: If my professor is retiring at the end of the semester, would his letter of recommendation carry weight when I apply for PhD programs eventually (later on)?
Comment: Of course it would, provided it is relevant timewise (i.e. not written years after he has become inactive).
Answer: I don't see why it wouldn't. If your professor was fortunate enough to have a career at a university where he could properly retire from, then he must have had an outstanding reputation at his university and in his field.
Comment: I think the weight will have nothing to do with whether the professor is retired, and everything to do with the professor's own reputation (for instance the correlation between strong letters in the past and the success of students being recommended).

LOR from a Retired Professor


Blender Eeve: transparent texture

Question: How could I put put a node with a transparent texture coming from a picture? I don't want any reflexion, just display a normal image.
Answer: So to get alpha working on a texture, click in the material on "Use Nodes" and change the color to use an image:

Also make sure to set the Settings/Blend mode of your material to Alpha Blend:

Then, open the Shader Editor to edit the nodes, and make sure that the alpha is set to Premultiplied in the settings (press N) of your texture. Then, create a node (Shift-A) Transparent BSDF, make sure it is white, and mix it with your image, using the alpha as factor (if you want to keep material, you can use the Principled BSDF node as input to your color instead):

This gives you something like that:

If you get a white border around edges, make sure that you selected Alpha: Premultiplied.

Blender Eeve: transparent texture


Emacs sync w/ Google Calendar and Contacts?

Question: Is there a way to use Emacs to sync with Google Calendar and Google Contacts, ideally keeping a local copy so I can access them offline?
Comment: What are you currently using in emacs to store contacts? bbdb?  Also, what do you use for your calendar program in emacs? My answer will differ for say org-mode vs diary mode.
Comment: [Also asked at Super User](http://superuser.com/questions/187050). Don't do this! (Exception: when the question hasn't had any good answer at a site, and then link to the original question.)
Comment: Actually I am just starting, and am planning to use bbdb for contacts. I was planning to use diary mode for calendar, but now that I know of and read about org-mode that might be a good option, too. Thanks!!
Comment: I had no idea, sorry! Still looking for a good answer, though.
Comment: This would be a great option, if it's even possible, I would like to know.  Building an outlook client into emacs would definitely be cool.
Answer: Unfortunately, I am unable to give a complete answer.  All I have is advice about some possible paths to wander down.
The easiest route would be if the emacs-g-client that Gilles mentioned in the SU version of this question works.  If that doesn't work, I would look into the following:

At the very least you should be able to get some calendar functionality by accessing your google calendar using ical.  The function icalendar-import-file can import an ical file to a emacs diary file (icalendar-import-file documentation).  Thus, in your .emacs file you could have a bit of emacs lisp to get the google calendar ical file and import it into your diary.  If you do end up using org-mode there are a number of ways to integrate org-mode with diary-mode.
I think that the ultimate goal would be to make use of the gdata api.  I don't think that there is an easy way to get access to Google contacts outside of this api.  There is a command line utility that supports a wide range of functionality using this api called Google CL, which could theoretically be used inside some emacs lisp functions to provide full access to your contacts, calendar, and many other Google-hosted services.  This however, would likely be much more difficult than just a few lines thrown into your .emacs.
Answer: For Google Calendar, I have a one way sync setup successfully. Emacs fetches my calendars at startup and transfers it in the emacs diary. This is then displayed by org-mode in the agenda, but you can set it up anyway you want.
For sending back to Google Calendar, I have yet setup anything as I don't need it that much. However, I think it would be pretty easy to have a function that adds an entry in the diary and calls googlecl to add an entry in your google calendar.
To fetch the calendars, I have the following in my .emacs (not that this is not my code, it comes from the org-mode mailing list, but I can't remember where I found it exactly):
(setq mark-diary-entries-in-calendar t)
(defun getcal (url)
  "Download ics file and add to diary"
  (let ((tmpfile (url-file-local-copy url)))
    (icalendar-import-file tmpfile "~/diary" t)
    (kill-buffer (car (last (split-string tmpfile "/"))))
    )
  )
(setq google-calendars '(
                         "http://www.google.com/calendar/ical/DFSDFSDFSDFASD/basic.ics"
                         "http://www.google.com/calendar/ical/SDFSADFSADFASD/basic.ics"
                         ))
(defun getcals ()
  (interactive)
  (find-file "~/diary")
  (flush-lines "^[& ]")
  (dolist (url google-calendars) (getcal url))
  (kill-buffer "diary"))

Replace "http://www.google.com/calendar/ical/DFSDFSDFSDFASD/basic.ics" with the urls to the calendars you want to fetch (you find it at the bottom of the setup page of each calendar in google calendar). You can add as many as you wish.
Now, you can just call (getcals) when you want to fetch the calendars. You can put this in your .emacs to do it at startup, but it might stall your startup.
To have org-mode display the diary entries in the agenda, just add (setq org-agenda-include-diary t) in your .emacs. See the org-mode manual for details.
Answer: For integration with Google contacts there is Julien Danjou's script which you can see in action here (github repository is here):

The google-contacts for Emacs extension allows to display your Google Contacts directly inside Emacs.
Note that it is likely to only work with at least Emacs 24, since it's using oauth2 which is part of GNU ELPA.
Answer: emacs-calfw can synchronize with calendars in iCal (.ics) format such as Google Calendar.


Controlling temperature of soldering iron

Question: I have those cheap 60w chinese soldering iron that runs on 220/240v ac here. Any time I try to solder some ICs it burns them. I know that there are temperature controlled irons in the market but those are too expensive here.
My objective is to lower its temperature just for soldering  and I dont need much of display or any such complexities. I know there are some Arduino based ones and some triac based once but I thought of doing it using dc.
I plan to rectify the mains with rectifiers and then feed it into pwm circuit (I plan in using 555 circuit to make it simple ) and mosfet . I plan to lower the voltage for the pwm cicuit and use the power mosfet in series with soldering iron . Should I go for it ? Will it work ?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/116429/discussion-on-question-by-user268759-controlling-temperature-of-soldering-iron).
Answer: My answer is based on this:

I plan to rectify the mains with rectifiers and then feed it into pwm circuit (I plan in using 555 circuit to make it simple ) and mosfet .

This is a circuit I've worked with that is uses a MOSFET to control a high voltage DC motor. You'll have to work out the values of the components based on what you have or can obtain, but this is a starting point for you. There will be several components you won't need such as DC3, D6, and D31, perhaps more.
I suggest being careful you are driving the MOSFET properly. Also, D5 is a flyback diode and will be critical in protecting the MOSFET from damage. High voltage DC like this is dangerous so please be careful. If you are new to circuit design, I'd suggest going with the lighting dimmer switch idea others have suggested.
Answer: 60W is a lot for soldering electronics. I have not used an uncontrolled iron in years, but I think more like 30-40W is appropriate.
You could try wiring a 1N4006 1A rectifier in series with the iron, which will reduce the power to half. That will only cost you pennies.


Can I use Danco waterproof grease sold for plumbing and faucets to lube seat posts and pedal threads?

Question: I have this tube of lube lying around, which is good for plumbing fixtures. If this is good enough, I don't have to go out to hunt for bike grease during shelter in place.
Answer: As long as there are no carbon fiber parts involved you should be fine. Carbon parts require a special compound, regular grease makes the mating surfaces slippery. That requires applying excessive clamping force which can damage the carbon parts. The grease you have should prevent any oxidation between the seat tube and the seat post.
Comment: Concur - any lubricant is generally better than no lubricant.
Comment: Yep, the stuff should work fine for the stated purposes, absent issues with carbon parts, etc.
Comment: And since grease for plumbing has no issues with water resistance it will persist on wet rides.


Has there ever been a TV show VHS/DVD/bluray/4K release in THX?

Question: I'm wondering. We know movies get THX remasters all the time. But what about TV shows? Has there ever been a TV show release in THX?
Answer: You're unlikely to see a "THX release" on any consumer-grade media, because THX is not a standard that consumer-grade equipment can meet.
Per wikipedia:

The THX system is not a recording technology and it does not specify a sound recording format: all sound formats, whether digital (Dolby Digital, DTS, SDDS) or analog (Dolby Stereo, Ultra Stereo), can be "shown in THX". THX is a quality assurance system. THX-certified theaters provide a high-quality, predictable playback environment to ensure that any film soundtrack mixed in THX will sound as near as possible to the intentions of the mixing engineer.

In effect, being certified for THX requires the recording equipment, the production equipment, and the presentation equipment to meet certain standards. A "THX release" is something almost nobody would have a use for.


Can a workflow move documents into a document set in Sharepoint 2013?

Question: Can a workflow move documents into a document set (within the same library) in SharePoint 2013?
Answer: To be honest, i'm struggling over the exact same issue, well i need to move a current item to another library but into a Doc Set. From what i've found so far it can be done but you need to use the 'Update Item' action and update the 'Path and Name' to be "document set name/current item name".
I'll get back to you if I get anything else working.
Luke


preventing the page from responding to pageup/pagedown events for page scrolling

Question: I am using jquery in one of my projects. I have a scenario where I have to add keyboard events to the td cells of a table to move up and down in them. I was able to achieve this using the following code.
Here is my code:


Can I connect high power LEDs in parallel without resistor?

Question: I see lots of people connecting high power LEDs in parallel to a single power supply (constant current).
Some of them have powerful knowledge about electronics (example).
So, is it something special about high power LEDs so they can be connected in parallel without resistor?
Comment: It's a very bad idea.   If one LED goes bad (open-circuit), more current will be drawn by other LEDs.
Comment: It may be possible if you get carefully selected LEDs with the same relation between current and voltage. It is no problem if the current splits to two parallel LEDs in the ratio 49 to 51 %, but this ratio should be given for different temperatures. But if the ratio is 30 to 70 % one LED may be distroyed by a current above the maximum ratings. If one LED is destroyed, the others will follow soon.
Comment: @Tyler - later is in parallel (2x 3 leds)
Answer: It depends on what your design outcome is. No electronic components are created equal, they all have tolerances from manufacturing that make them different. If the brightness of the LED's is matched then the current needs to be matched.
Example 1 and Example 3: The current through one resistor feeds two LED's, one LED has a slightly different I-V curve, it consumes more current and is brighter. The same thing happens in Example 3, it just has a constant current source.
Example 2: The brightness is better matched  because either LED is getting a similar current. The currents won't be exactly the same however because there are still differences in the LED's
Example 4: This is the best way because the current has to be equal through both LED's, you will get the best brightness matching.

simulate this circuit – Schematic created using CircuitLab
Comment: And if the current/brightness characteristic of the LEDs is not matched then the brightness could be matched between them with the circuit of Example 2 by selecting appropriate resistors, if it was critical for the application.
Answer: No, there's nothing special about high-power LEDs in particular that makes this safe. There's no guarantee that parallel strings of LEDs will share current equally to begin with. The temperature coefficient for the junction voltage is generally negative (on the order of -3 mV/K to -10 mV/K), so if one LED starts to warm up from excessive current, it will draw even more current (stealing it from the other string(s)), compounding the problem and leading to thermal runaway, at least until that LED reaches its peak current limit and fails. After that (when using a current source rather than a voltage source), the other string(s) will by definition be running at greater than their current rating and will fail quickly as well.
Answer: Warning: Do not confuse "makes you tube videos" with "powerful knowledge".
A video maker may or may not know their stuff.
In his video, the 3 series LEDs at constant current are driven correctly.
When he parallels two strings with 3 LEDs per string he is relying on them having very similar Vf (forward voltage) in each string at Isupply/2 so that the current will share equally. In many cases this is "close enough" to what happens for it to work OK BUT it also may result in very uneven current distribution.
LED Vfs of a given type & batch tend to cluster around an average voltage with most typically within 0.1 - 0.2V from the average. You can get substantial outliers. Low quality LEDs tend to have higher spreads of Vf.
[I had one type of LED made by a very competent manufacturer where production sampling over very large quantities showed Vf = 2.95V +/- 0.05V for about 95% of the production.]
If the 3 x Vf's of one string are substantially different from the Vf of the other string then the low Vf string will take more current - possibly MUCH more.
Also, if one LED ever fails open circuit (as does happen)(as 12Lapointep noted in a comment) then all the current will be taken by the remaining string - and LED current will double. Vf at 2 x current will rise so power will more than double. Whether the LEDs die rapidly in this scenario depends on various factors but, at best, their lifetimes will be shortened - probably substantially.
Current driving each string separately is "not too hard" and may not be overly expensive and is well worth doing.
If you ignore the LED open-circuit failure condition, improved current balance may be obtained by adding a small series resistor in each string. One volt drop is usually very adequate and even a few tenths of a volt can help greatly.
What happens is if one string has lower total VF then it will draw more current and the resistors V drop (= I x R) will rise, limiting Vf rise on the actual LEDs, while the high Vf string that has less current will have lower IR drop across its resistor, so lower LED Vf due to lower current.
The overall effect is that, compared to the no-resistor arrangement, the low Vf string will draw reduced current and the high Vf string will draw more current.
Full balance can never be achieved this way, but the result is a great improvement over the no-resistor arrangement.
The overall efficiency will be worse with resistors but this can be at an acceptable level.
eg if you had 3 x while LEDs at say 3.1V Vf nominal = 9.3V in series at 300 mA,
then adding R = V/I = 1V/0.3A = 3.3 Ohms in each string would ensure that string currents were much better balanced.
Even a 1 Ohm resistor would help.
Power in resistor = V^2/R = 1^2/3.3
~= 300 mW for the 3Rs
and 100 mW for a 1 Ohm series R.
Efficiency loss = Vr/(Vr + VLEDS) = 1/(1 + 9.3) ~= 10% loss for a 1 Volt 3R3
and 0.3/(0.3+9.3) ~=  3% for a 0.3V drop 1 Ohm.
This range of losses is worthwhile when possible other outcomes are considered.


At what playing strength level should one be able to mate with King Bishop and Knight vs King?

Question: As in title above, at what playing strength level should one be able to mate with King, Bishop and Knight vs King without much effort (with reasonable time left for the game)?
Comment: Besides being able to win this endgame, the study of the Bishop and Knight endgame also teaches you about the coordination of these two pieces which is useful in its own right.
Answer: A member of my club, rated about 1900 FIDE, had this in a championship blitz game about 2 years ago with 30 seconds left on the clock. He delivered mate with time to spare. IMs  have failed. Go figure. If you study and learn then you should be able to deliver mate. If you don't study then you won't. Playing strength doesn't have that much to do with it.
Answer: I don't think it's that relevant; most chess players are unlikely to ever get this endgame on the board. I'd rather spend my time studying other tricky pawnless endgames like Queen vs. Rook, which is far more likely to occur.
I knew how to win this endgame fairly early in my career, but I had always been fascinated with endgames; conversely, Wikipedia shows two grandmasters failing to deliver mate. Had they known the right corner for mate, and the W-manoeuvre, they'd probably figure out the rest themselves.
Comment: @IanBush : I suspect a confusion here. There is a famous anecdote about Efim Geller (IIRC) failing to win KNN vs KP (in a winning case), then working a lot on this endgame "so that it will never happen to me again" and becoming some kind of expert in KNNKP. But when he got the same endgame again, 20 years had passed - he has basically forgotten everything about his work and drew again.
Comment: Can't find the reference at the moment but I'm sure one of my books reports a GM has failed to win it twice ... I've never had it, and only once has it affected my play where I chose what was probably technically a second best line to avoid it, but it was still winning.
Comment: Sure it's rather difficult, and it happens rarely, but its a technical win, so am I right in supposing that every professional player should be able to win it?
Comment: @IanBush I recall reading somewhere that a Soviet grandmaster once failed to mate with B + N, causing Botvinnik to remark that a GM who can't mate with B + N should be stripped of his title. (I never bothered to learn it myself, but I don't think that's the reason I never made it much past 2000 USCF.)
Comment: I have had it OTB in tournaments and casual play.  It does happen.
Answer: In 2007, Jeremy Silman published Silman's Complete Endgame Course: From Beginner to Master. In this book, endgames aren't organised by theme but according to the level at which they would be most useful to learn - at least according to Silman. The book is divided into chapters that progress from the beginner level (below USCF class E) to "master" (rating range 2200 - 2399). In the introduction to the book, Silman states (page xv; emphasis added):

I've deliberately left out many endgames. Why? Because I don't feel they are important to players below the 2400 level. For example, I heretically decided not to include Bishop and Knight vs Lone King because it is far from easy to master, and it occurs very rarely in over-the-board play. In fact, I only got it once in my entire career, while IM John Watson and IM John Donaldson never got it at all!"

So he concludes that this endgame is so rare that it isn't worth spending two to three hours of study on it if your level is below 2400.
The Complete Guide to Chess Endgames on the Chess Simplified website tackles the King, Bishop and Knight vs King at the "master" level (2199-2400).
Not learning this endgame before the 2200 level is an idea that has been criticised by many people below the 2200 level who have faced this endgame on the board. (A long time ago, I was in this situation myself in a rapid game in a school tournament. As luck would have it, I had studied that endgame just the night before, so when my opponent demanded a draw, not knowing it was a losing endgame, I protested and checkmated his king, which he kindly moved to the edge of the board...) For example, this thread on the Chess.com forums has both detractors and defenders of the approach.
Yuri Averbakh's Erfolg im Endspiel (translated into German by M. Hermann, Sportverlag 1987) is a book aimed at the elementary to intermediate level (which are not clearly defined in the book's introduction) that treats this endgame in two different chapters: in the second chapter (on elementary checkmates of the lone king), starting from positions where the lone king is just one square away from the last rank or file, and again in the last chapter, starting from positions where the lone king is either in the wrong corner or farther away from the edge (e.g. sixth rank). This same chapter also covers endgames with two knights versus pawn, rook and bishop versus bishop, and rook and knight versus rook. This approach recognises that this is a rather difficult endgame when starting with the lone king near the middle of the board, while at the same time treating it as an endgame that needs to be learnt well below the 2200 rating level.
Max Euwe six-part book series Praktische schaaklessen (published in Dutch in the early 1980s) covers the endgame both in the second volume (which covers each phase of the game) and the sixth volume, Hogeschool van het eindspel ("Endgame Academy"), which treats endgames in greater depth.
The endgame is not explained in The Soviet Chess Primer by Ilya Maizelis (translated into English by John Sugden, 2014). The book's chapter on endgames is obviously not meant to be exhaustive; the endgame type that is treated in most details is rook-and-pawn endgames.
At the bottom line, there is no consensus when the Bishop-and-Knigh-versus-Lone-King endgame should be learnt. In Studying Chess Made Easy, grandmaster Andrew Soltis said that he had never encountered this endgame in his own games but said that "learning it teaches techniques that can be applied elsewhere" (quoted from Wikipedia).
Comment: I think the best argument for learning it would that it really teaches piece coordination. So it is a useful skill to practice even though it is unlikely you will ever see kbn v k on the board.
Comment: @JerrySnitselaar I think that's essentially Soltis's point.
Comment: There is a good chance Soltis is where I originally read that.
Comment: It is not that hard to figure out even if you have not studied it.
Answer: One should learn chess from the ending first!  So if one takes your question as when one should have learned the technique then as a beginner.  If one has never looked at this endgame (shame on you) and are facing it for the first time in a real game with the 50 move rule and clock ticking then anything can happen.
The minimum one should know is quite small and is just a couple key concepts. Delétang's Triangle Method is easy to remember. It's just 3 successive nets.
from wikipedia:
Answer: I coached a high school team with ratings from 700 to 1500, and demonstrated the B + N Mate and how you move the opponent's king to a corner whose color is the same as the squares on which your bishop travels.
Those around 700-800 had trouble with it, maybe because they were fairly new to competitive chess, but those 900 or better could all do it.
I think you should be able to teach a six year old who doesn't know how all the pieces in chess move to do it, since there's a structure to how you do it.
Answer: A bright 1000 player could learn to do it,  I have seen IMs that could not.   Most club players cannot do it.
Comment: true.  it depends whether they study it or if they can visualize squares if they have to do it without studying it first.


The product of digits equal to the sum of digits

Question: How to find the number(or numbers ) that has $4$ digits, the product of these digits equal to the sum of these digits ?
Comment: I'd think if there is one, you could get other ones by rotating them? I.e. if 1234 is ok, then 4321 must be ok as well, no? Or am I misunderstanding something?
Comment: Not sure what does this have to do with the number itself? You are just looking for 4 digits that summed or multiplied give the same result?
Comment: @gt6989b yes but may be there is more than one such number .
Comment: @gt6989b yes you are right .
Comment: I wonder why everybody is excluding zero as a digit up front, `0000` seems like an obvious first shot to me?
Answer: First of all, let's observe that all of the digits of such a number cannot be the same. You can just manually check that numbers $1111$, $2222$ and so on don't suit us. It is also clear that all of the digits should be non-zero.
Now suppose that we have such a number. Let $a,\,b,\,c,\,d$ be its digits written in non-ascending order: $a \geqslant b \geqslant c \geqslant d$. Then we have
$$
abcd = a + b + c + d.
$$
From this we have an inequality:
$$
a\cdot bcd < 4a.
$$
This inequality is strict, because at least one of $b, c, d$ is strictly smaller than a. So we have:
$$
bcd < 4,
$$
which is the same as saying
$$
bcd \leqslant 3.
$$
This only leaves us with 3 possible combinations for $(b, c, d)$: $(1, 1, 1)$, $(2, 1, 1)$ and $(3, 1, 1)$.
If $b=c=d=1$, then $a\cdot 1 \cdot 1 \cdot 1 = a + 1 + 1 + 1$, which can't be true.
If $b=2$ and $c=d=1$, then $a \cdot 2 \cdot 1 \cdot 1 = a + 2 + 1 + 1$, which means that $a=4$. This gives us one possible solution: $a=4, b=2, c=d=1$.
If $b=3$ and $c=d=1$, then $a \cdot 3 \cdot 1 \cdot 1 = a + 3 + 1 + 1$, which is impossible.
So, the only solution is $a=4$, $b=2$, $c=d=1$. There are $12$ numbers with such digits.
Comment: @FrerichRaabe I think that technically $0000$ is not a 4-digit number. It is my understanding that 4-digit numbers all lie between $1000$ and $9999$. $0050$, for instance, is a 2-digit number, because its standard form is $50$. From this point of view, $0000$ is a 1-digit number, because the standard notation for it is $0$.
Comment: Why do you exclude zero up front, `0000` would work as well, no?
Answer: You can narrow your search rapidly:

no digits $0$;
at least one digit $1$ (otherwise the product exceeds the sum easily);
at least two digits greater than $1$ (otherwise the sum now exceeds the product);
exactly two digits greater than $1$ (the product of three such digits would exceed their  sum by at least $2$).

So we're looking for pairs of digits in $\{2,3,\ldots,9\}$ whose product exceeds their sum by exactly $2$ (the number of digits $1$ we need to throw in). If one of them is $2$, the other must be $4$. If the smallest of the pair is at least $3$, then their product exceeds their sum by at least $3$, so this cannot happen.
So all in all there is essentially one solution, but since you asked for numbers , the $12$ permutations of the digits of $1124$ give you all solutions.
Answer: i observed a pattern in these numbers.
22
123
1124
11125
111126
1111127
and derived a formula for this.
if the last two digits are assumed to be a and b and for an n digit number
there will be n-2 1's and a and b are to be found out using the below formula.
a=(b+n-2)/(b-1)
where a and b are from 2 to 9 which need to be evaluated manually for b=2 to 9
Comment: Does this give a number as the question asks?
Comment: Yes.. if the number of digits is 4 a=(b+2)/(b-1) and number of 1's in the number is 2.so the number would be 11ab.Now we have to solve for a and b using a=(b+2)/(b-1).which gives integer values for b=2 or b=4 and a=4 when b is 2 and a=2 when b=4.so the number would be 1124 and all permutations of it like 1124,1142,1214,1412 and so on.
Comment: @syam Kumar how would it work for n>=10,like n=10000
Answer: Must be various combinations of $1,1,2,4$.
I don't think there are any other combinations, I looked at all small numbers...
Comment: Can we find the number by using algebraic method ?
Comment: Yes we can find those numbers using algebraic method


Office 365 Sharepoint Transfer Storage From OneDrive

Question: We have bought Office 365 Business Premium and it seems that we only have 30GB Sharepoint space. Is it possible to use space from the 1TB OneDrive or to upgrade the space?
Answer: OneDrive storage is different from SharePoint Online storage. You can purchase additional SharePoint Online storage from Office 365 Admin Portal, Subscription Details.
Source
Comment: I heard a rumor that there is a New Policy where you choose where to allocate space per tenant. Is this true or do you say just buy more space.


Safety shields for power supply DC output bus bars

Question: I have seen a variety of optional or included features with power supplies that the manufacturer calls a safety shield. In some cases it is just a 3 sided piece of metal - the back and bottom remain open, such that someone reaching around the back could contact the bus bars. I see how it protects from a short due to a dropped tool, but do not see how that can be considered a safety shield for personnel - perhaps when operated in a rack, but not when operated on a bench top. What criteria would the UL or CSA standards impose for a manufacturer to legitimately call something a safety shield?
Comment: picture???????????
Comment: What voltage DC?  For a high current 24V supply, you don't need much, but metal still seems like a bad choice.  For a 500V Drive output, most manufacturers use a Polycarbonate or other plastic shield that is about 90% touch safe; you can still get to the lugs with long meter probes for example, or your fingers if you really work on it.
Answer: I think it would satisfy access to dropping a wrench and electrocuting the holder, criteria and keeping one's fingers out. If it is for industrial use and not consumer use then that should be adequate.  Open framed supplies do not have a shield and require additional enclosure.
IMHO,  this is just a marketing item to meet customer demand for internal large cabinets rather than a UL requirement for sub-assemblies.
My last design was UL certified but the open frame supply was enclosed with end vents and forced air cooling.
For cooling design I wanted passive vertical vents but was told there were specific checks/tests on the supply inside the 1U high 19" rack mounted unit.

Coke spill test
sledge hammer test ( sparks or shorts to HV contacts to case.) so insulator was needed.
fan locked rotor test   (thermal test)
Short circuit outputs test.  (48V PoE)
AC earth to case resistance ( 100 mOhm)
leakage current to ground from line filter (0.5mA max)
masked areas for safety welded ground stud to spade lug wire before powder coat paint

I was able to get 6 waved since I was able to prove spade lugs relied on the washers,nut & thread yield low milliohm values and did not need not an unpainted bottom surface.
Mostly to look for sparks or flammability or ground leakage current safety,
I am not sure which tests are omitted for an open framed supply that may be used as is or integrated .

Anecdote

To reduce cost, many power supply manufacturers are using the CE Mark to indicate compliance with EN 60950-1 rather than pay for and maintain a separate EN 60950-1 test report and certificate.  In this case the CB test certificate (and CB test report) will indicate that the product was "additionally evaluated to EN 60950-1".  This is perfectly acceptable.
"The following end-product enclosures are required:" Here the types of enclosures are indicated for mounting the power supply in.  If an open frame power supply is being used, the report will state that it has to be housed in an enclosure.
Usually there are three main documents; the CB certificate, an IEC 60950-1 CB report and / or EN 60950-1 test certificate and of course for North America, the UL or CSA 60950-1 test report
Answer: This is covered under IP ratings (IEC60529). The first digit is for objects, the second is water. So ignoring the last digit:
Rating - Protection Against
IP1X - Solid object greater than 50mm
IP2X - Solid object greater than 12.5mm
IP3X - Solid object greater than 2.5mm
IP4x - Solid object greater than 0.1mm
IP5X - Dust. Minimal dist ingress permitted.
IP6X - Dust tight. No ingress.
RS - IP Ratings Guide
So therefore in theory you would want one at least IP3X or greater if possible to obtain, the problem then is it seems they are not often tested unless the manufacturer is making a dust or water resistant part. So I guess it's a bit of extra effort they've gone to.
Comment: "Finger safe" is IP 2X.


Gimp's color options not working

Question: I'm trying to edit the color balance of a layer in a .xcf image, and none of the color commands do anything. For example, I can crank saturation and value to 0 in Hue-Saturation, or invert values, and the layer is unaltered (both in the preview and also after I hit OK). In fact, the the log of recent actions doesn't show me doing anything when I use a color command. I checked that the image is in RGB mode and tried different layers - nothing. I have changed the color balance in layers in this same image before. Anyone know why this should be?
Answer: I have been having this problem too in GIMP 2.10.18, and finally figured out what's happening. I had the layer visible and highlighted, but the curves are adjusting the RGB channels. That means that even if you have the channels visible, you won't see an effect from the curves until you actually highlight the channels you are working on (make sure they are gray). Once I highlighted the three color channels, everything worked like a charm.
Answer: Two reasons come to my mind:

Your selected layer is not the one that you want to change. (That would be the typical error if I was you. I always get confused by what layer or mask I am currently working on)
An additional layer, higher on the stack of layers, with 100% opacity will simply hide the changes that you to to any of the layers beneath.
Comment: Sigh, I often find I am editing the layer mask rather than the layer itself.
Answer: I had the same issue. A black and white image - actually black and transparent. I want to turn the black to white.
Colors > Invert does nothing.
Selecting by color (black) and using Bucket Fill set to "Fill whole selection" using the white background fill does nothing.
Edit > Fill Background Color does nothing.
I have the layer selected and visible, and I have both Channels selected (Indexed and Alpha). Also tried with only the Indexed channel selected.
The solution: This doesn't work with Indexed mode. I change the mode (Image > Mode) to Grayscale. Success!
Answer: I had similar problem and found that I had a selection hidden somewhere.
Top Menu >> Pick Select  >> Pick None  hidden selection closed and image colour balancing returned.
Newbie mistake on my part .
Answer: In order to apply color changes, it is not enough just by selecting the layer. You have to actually select the element you want to change. If you want to change the whole picture, click Ctrl+A, and then open the color options. You will be able to see your changes get applied then.
Answer: I was working on a very large format multi-layer image and I couldn't change the color of any layer. I had inadvertently selected a tiny area on a lower layer. It was so small I didn't notice the "ants marching" selection marking. Every time I tried to change the color attributes, it was only applying the change to the tiny unnoticeable selection. I finally hit "select - none" and bang I was back in business!
Answer: as a newbie as well, in color map I found I had to raise the thresholds for some colors (in ver 2.10, below "To Color")
Comment: The answer could be improved by stating in more detail what you are referring to, if you could provide an image that would be great. And also, welcome to this site
Answer: I was having a similar problem and I found this question here on the Web. I'm not exactly sure if this is the problem you were having, but I found this helpful. I opened a .png image with GIMP 2.10.30 and tried to edit the foreground and background colors, to no avail. Really, for my purposes I only needed the canvas size. So, I started a new project from scratch and then everything worked fine.
I hope this helps!
Answer: Check "Preview" check box in color panel.
Comment: Could you expand this answer (maybe with screenshots?) to make it clear what you're referring to? At the moment, it's not obvious exactly what actions to take to accomplish this. Thanks!

Gimp's color options not working


Is Ethereum gong to crash now? Is it worthy to keep investing?

Question: With the last news that was found a vulnerability in the Ethereum DAO the coin lost almost 50% of its value in 2 days. Do you think is still worthy buy Ethererum?
Comment: I am sorry guys did not know about that. Someone close the topic please.
Comment: Stack Exchange isn't the right place for this type of question. Perhaps one of the Reddit boards instead? (e.g. https://www.reddit.com/r/ethtrader)
Comment: Should be asked on Reddit ethereum traders site
Answer: I would say that depends on the risk somebody is willing to take.
Buying is always a risk as any coin (real or crypto) can always loose some or all of its value. Therfore past spent cost should never be the trigger for a decision, only future expectations are really relevant here.
The current issue got identified in the DAO contract code and not in the code of Ether(ium) and it is not clear yet what the following steps (risk mitigations like loss sharing, code changes, soft and/or hard fork, ...) between Etherium, miners, investors, the attacker, .... will be, so there is quite some insecurity at the moment.
As The DAO contract is deeply linked to Ether (and there is not a lot more linked to that coin by now) it for sure influences the short term value of Ether, so from that point of view it might be a good time (soon) for a cheap buy with a (DAO related) higher risk.
Learning from Bitcoin: Over a longer term fixed past issues have a positive effect on the overall system, its security and the coin value, so buying later can become more expensive due to some added value that can be called a (more or less significant) lower risk.
Finally only time will tell (also if the DAO will survive somehow).
Comment: Why isn't this the right place for such questions?
Comment: Because SE is not intended to answer subjective and opinion based question, that's all.
Comment: That's why I tried to give a general answer and keep out my opinion. ;-)
Comment: This is not an answer problem, your answer is as good as it can be considering the question.


What triggers a battle event in timeline?

Question: In Age of Empires 2, what is the trigger for drawing a battle event in the Achievements timeline? It seems to be very far from actual happenings, but I just can't get what is a "battle" for the AOE2 engine. For example, often an (kind of) extintion event is considered not a battle.
Answer: According to this source a Battle Event is a one of the following:

Skirmish between at least 2 players
A huge battle between at least 2 armies

It happens often after long passive (peace) phases and it can happen only 3 times. The attacking party / aggressor gets the Battle Event, this is why Yellow does not have a Battle Event.
In your example the 3 Battle Events for orange and green are over. Furthermore a Battle Even occurs when the armies first clash, so if you overrun your enemy in say 5 minutes then only the first "encounter" is considered a Battle Event.
Answer: I love age of empires 2, i think battle events do not occur as many times as i think it occurs. When i have a 75-100 army and sweep a party of 50 enemies withing 25 seconds (which i do) i wont get the mark. But when like 150 soldiers from 4 other players is fired at me over a time period of 5 minutes and my bombard towers or keeps or castles etc. kill them, i do get a mark...
Comment: Welcome to Arqade! If you have another question, please ask it by
clicking the [Ask Question](http://gaming.stackexchange.com/questions/ask?tags=age-of-empires-2)
button.