Could there be life on a planet with high radioactive activity?

Question: I make no assumptions to the nature of this planet. There are high chances it does not have an atmosphere or a lithosphere. But in a planet that shows a high level of radioactive activity, would it be advisable to probe for life, or is it improbable? Either way, why? How would we go about detecting life in such planets?
Comment: What is the distribution of these radioactive zones and their concentrations? Earth for instance harbours ample of illegal substances beneath its crusts, and life still flourish as if they are being intoxicated. We also received cosmic rays and there's even a dude who turns himself into a temperamental green walking fly swapper who enjoys sending unaware victims soaring all over the sky or becomes a graffiti on the floor or wall.
Answer: At what level do you define life ? Bacterias, sentient, instinctive inteligence ?
https://en.wikipedia.org/wiki/Tardigrade

For example, they can withstand temperatures from just above absolute zero to well above the boiling point of water (100 °C), pressures about six times greater than those found in the deepest ocean trenches, ionizing radiation at doses hundreds of times higher than the lethal dose for a human, and the vacuum of outer space. They can go without food or water for more than 10 years, drying out to the point where they are 3% or less water, only to rehydrate, forage, and reproduce.

Roaches are also known to be able to live in radiation but it does not fill the requirement to be without atmosphere.
Answer: Earth-like life would be run into problems if enough energy is delivered through radiation, so that the organisms can't handle it. As bacteria are known to tap into unusual energy sources for earth-life, I think it should be thinkable that some alien life form can utilize the radiation as energy source for life (as plants utilize the sunlight). There might be still another limit: if radiation start to destroy the structural integrity of the molecules too fast for repairing, this would be deadly for every life-form.
Generally spoken simple life-form can withstand higher radiation-doses than humans, because of simpler genetic information, so we could expect more simple life forms in high radiation.
Comment: I could imagine bacteria with two or even three copies of the DNA, so that when it replicates, it will fold twice and have a 50% chance of not passing damaged DNA or fold three times and favor the ones which have at least 2 pieces the same (a sort of organic checksum).
Comment: @Neil: nature thinks as you. All higher living beings (humans for instance) have a redundant second copy of the DNA. That is not entirely an copy, as sexual reproduction uses this duplication to give us one copy from the mother and another from the father, but as these are for more than 99% the same it acts as redundant. That helps to alleviate the problems of big DNA, that leads to masses of errors (along other stuff like repairing damaged DNA). If this is done in bacteria with much simpler genetic information, it would already help a great deal.
Comment: Single-celled organisms don't generally require copies, but if high radiation were constant, then I think that this would be the only way.
Comment: Not the only way, but one method. Extended rapair method and splitting the genome into more shorter strains might also help. Maybe life forms could developed some sort of radiation shielding. I'm not sure though, how this would work.
Comment: @Mnementh, first comment: This second copy is also helps in a more direct way, as it allows for the repair of double-strand DNA breaks (such as those produced by irradiation) via [homologous recombination](https://en.wikipedia.org/wiki/Homologous_recombination).  Recombination against the homologous chromosome isn't ideal, since the two aren't identical (the preferred option, if available, is to recombine against the sister chromatid produced during DNA replication), but it's a good-enough solution for damage during the early part of the cell cycle (when no sister chromatid is available).
Answer: If we're talking about more advanced/complex life, I would think that a protective layer would be all that's really needed.    The evolution of life is a fairly complex and uncertain subject.   As one example, on earth it took some 2 billion years for the first plant to appear on land.  It can be a very slow process it seems, as well as, at times, a very fast process.
If there was a planet with very high radiation, I think all it would take to protect the DNA for reproduction and have not overly-mutated offspring would be a refillable sack of water around the entire body - not too different than how we have skin and fat as protection.   An outer skin of water around the entire body would protect from a lot of radiation.  Water is pretty good at blocking radiation.
Now, whether such an evolutionary adaptation like that is likely, I have no idea but I see no reason why it wouldn't be possible.   Certainly sea life would have a chance even in a high radiation environment.


Using an Olympus FL-50R via a Canon 5D Mk II with third party trigger

Question: Can I use an Olympus FL-50R wirelessly, via a Canon 5D Mk II, with a third party trigger ? If so, which make of trigger would be best. Manual only is fine.
Answer: Yes, nearly any manual-only radio trigger should work fine between the Canon 5DMkII and the FL-50R, as both the four-thirds flash foot and the Canon EOS hotshoe are iso-compatible, so the center sync pin signal should work just fine.
If you have any kind of flash you can put on top of the 5DMkII, you could also use the built-in "dumb" optical slave mode of the FL-50R to trip it remotely, but given that the 5DMkII doesn't have a pop-up flash, this may not be useful advice.


If a kohen participates in a stoning is he still allowed to bless the people?

Question: The shulchan aruch codifies that a Kohen who kills someone may not bless the people. If, in the times when the Sanhedrin administered capital punishment, a Kohen saw a situation that warranted the death punishment by stoning, and the person was convicted, and the kohen as a witness participated in the stoning, would he be disqualified from blessing the people?
Comment: According to those who permit Kohen-soldiers who killed in battle to bless the people, this would certainly be fine since it's also a Mitzva-killing. Are you only asking about the other opinion?
Comment: @DoubleAA i'm not 100% sure. I have seen an explanation (cite in the link in my question) that the reason those kohanim-soldiers are allowed to bless is because killing in war is considered self defense. that reasoning would not apply to the case of a witness.
Comment: Similar: https://judaism.stackexchange.com/q/82578
Answer: R. Ephraim Bilitzer (Yad Ephraim no. 5), in addressing the question how could Phineas perform the priestly service after killing Zimri & Kosbi, admits as obvious that only a kohen who was not performing a commandment by killing another is subject to disqualification - not a kohen who was performing a commandment, as Phineas was (cf. Rema CM 425:4). In the case of capital punishment too, once it is determined by the sanhedrin that the accused is guilty his execution is a biblical commandment (see Rambam, Laws of Sanhedrin 14:2-3). In solidifying his view, R. Bilitzer cites from Chizkuni (Num. 25:12) that Phineas was worried he may lose his priestly status if he were to kill Zimri and Kosbi as the law dictates, and so God had to assure him that since the killing is for the sake of heaven he can still maintain his priestly status.
Comment: This is written with regards to the temple service NOT PRIESTLY BLESSINGS see tosfos yevamos 7a Sheneemar this is an answer to an irrelevant question.
Comment: @user15464 Nope. Did you look at the first linked source?
Comment: Yes i did,  Kanaim pogim Bo required completely leshem shamayim which Pinchos did and Hashem said therefore It is considered as if he didn't kill as said in the source. The same cannot be said about people who kill in bais din where there is no proof that they did it (unless there is Divine revelation otherwise) Leshem shamaim so this is actually a proof that regular cohanim cannot Bless the peole when they kill through beis din
Comment: @user15464 Wow, aside for the seeming splitting hairs of "לשם שמים" you are clearly reading his words differently than I (specifically sec. 4). He explicitly states it would be permitted for a kohen who, through his testimony, capital punishment was administered "וכי נימא שמפני זה פסול לישא כפיו והלא קיים זה מצוה של ובערת הרע מקרבך״.
Comment: Your job is to logically prove your answer as The Yad ephraim quotes those with alternative answers to why Pinchos was allowed to serve as a kohein which seem to think its impossible to kill and serve in the bais hamikdash. blind faith in what he says which contradicts Tosfos in yevamos and many others won't get you brownie points on this web site
Answer: The Gemoro Brochos 32b says no a Cohen who killed shouldn't do bircas cohanim

ברכות דף לב: כהן שהרג נפש לא ישא את כפיו שנאמר ידיכם דמים

Tosfos in Yevamos 7a "sheneemar"says either because of a chumra or because the hands which killed as accusants cannot become defendants:

לא ישא את כפיו חומרא בעלמא הוא ועוד דוקא לא ישא את כפיו לפי שהרגו בידו ואין קטיגור
  נעשה סניגור וכדכתיב בההוא קרא ובפרישכם כפיכם: -
  He should only refrain from blessing by raising his hands because he killed with the very same hands and an accusant cannot become a defendant.

Note that Tosfos says there that with regards to Avoda i.e serving in the Beis Hamikdosh there is no such prohibition hence thats why Pinchos was able to become Cohen Gadol after killing Zimri. But it could be he never performed Bircat Cohanim ever again and let the other Cohanim bless the people. See Shevet Halevi (thanks to Jay) who quotes Tosfos as Halacha
Comment: just because he is an accuser of one person doesn't mean he is an accuser of everyone does it?
Comment: the cohanim are blessing people who are alive that they didn't kill so why is there such a halacha? Kol yisrel areivim Zeh lozeh - we are all guarantors for one another1
Answer: Rav Ovadia Yosef in Yechaveh Daat (2:14) was asked about whether a Kohen who fought in the IDF and during the battle killed a terrorist is permitted to perform the blessings.
Rav Ovadia after discussing the issue at length concludes that it is permitted. For the killing of this terrorist was a mitzvah.
With this in mind, it would be permitted for the kohen to continue to bless the people, even after he took part in the stoning, as carrying out the punishment of stoning is a mitzvah.
Comment: you're very welcome
Comment: The question is with regards to killing a convicted jew in sanhedrin, A terrorist is not jewish so there is no problem with an accusant becoming a defendant. see tosfos  yevamos 7a "sheneemar"
Comment: @user15464 huh? You presume that being a קטיגור is only regarding killing a Jew? It's that someone who killed cannot bless. Nothing more. Killing a goy is still שפיכת דם
Comment: Nearly Every single leader of the jews in the bible (Moshe, Yehoshua, Pinchos,Ehud, Barak, many many others)  had to kill goyim that were threatening the existance of the jews so no one is not considered a kateigor for defending our nation.


Optimal prefix-free binary code with several codewords already assigned

Question: The classic Huffman algorithm, as Wikipedia states, finds an optimal prefix-free binary code with minimum expected codewords length, given a set of symbols and their weights. Now, suppose codewords for some (but not all) symbols are already assigned (maybe in a suboptimal way). How should we assign remaining codewords to the remaining symbols so as to minimize the minimum expected codewords length, assuming that there exists at least one binary sequence such that none existing codewords have it as their prefix, and neither of the existing codewords is its prefix?
Comment: There's a subtle and easily fixed error in this proof: "If there is more than one symbol that has the lowest frequency, then take two that have the biggest depth" should be "If there is more than one pair of satisfying symbols, then take two that have the biggest depth". Otherwise, there might be a uniquely lowest-frequency symbol, which we could assign to $y$, and two or more second-lowest-frequency symbols at distinct depths, all as deep as or deeper than $y$. We could then choose the one of the less-deep to be $w$ and hit case 3, but "By our choice of w, f(w) < f(z)" would fail.
Answer: "Ordinary" Huffman is suboptimal
Let's call a symbol "free" if it has not yet been assigned any codeword.  Here's an easy counterexample to the optimality of running the ordinary Huffman algorithm on the set of free symbols:
Suppose we have three symbols $a, b, c$, with frequencies $0.5, 0.25, 0.25$, of which $b$ and $c$ are free; $a$ has already been assigned the codeword $00$.  Then the unique minimum-size tree in which $b$ and $c$ -- the lowest-frequency free symbols -- are siblings is
<code>  /\
 / /\
a b  c
</code>
with expected codeword length $0.5*2 + 0.25*2 + 0.25*2 = 2$, which is strictly greater than that of either of the two trees in which they are not siblings:
<code>  /\        /\
 /\ c      /\ b
a  b      a  c
</code>
which each have expected codeword length $0.5*2 + 0.25*2 + 0.25*1 = 1.75$.


Person vs Thing for determining case?

Question: In German, some verbs use the dative case for the object (e.g. Ich folge dir).  In lists about these, I've seen mention of jemand and etwas. Does the case change depending on whether the object is a person or thing?
Comment: my confusion is that they seem to care about jemand vs etwas.  Why not just "nomen"?  Do I really need to care about Person vs Sache?  If I write a story about a Robot, does it matter if the robot is an IT or a HE?  (I know it matters for es vs er, but will it matter for the cases). Thanks.
Comment: maybe this is bad stackechange form, but basically, my question is "what is this page (and the linked pdf) talking about!?" https://mein-deutschbuch.de/liste-kasusergaenzungen-der-verben.html
Comment: @perpetual Is your confusion, because they print _jdm = Person + Dativ_ and _s. = reflexives Pronomen im Dativ_ is red, but _jdn = Person + Akkusativ, _s. = reflexives Pronomen im Akkusative_ is red, **AND** _etw = Sache + Akkusativ_ in black - which looks as if there were no _Sache + Dativ_?
Comment: @perpetual English dictionary entries can look like "_to follow so./sth._" as well. This is unrelated to cases, but it is mentioned, as some verbs can only be applied to a person OR a thing - you can _help someone_, but you can't _help something_
Comment: @Marzipanherz, I accept your answer.  As an aside, I am not as accepting of the idea that some verbs only apply to people.  "I helped the house become more beautiful."  Would helfen be the wrong verb for that?  Sometimes it requires more poetry or fiction (e.g. talking cars that get stomach pains), but I don't think it's a function of the grammar as to which verbs would be wrong to use with objects. Thanks.
Comment: @perpetual Maybe _to help_ wasn't the best English example :) But I hope, you got the point. I've expanded my answer a bit regarding the living/non-living aspects.
Answer: No, the case does not depend on whether the object is a person or a thing.
One can say:

Ich folge dem Mann.
  [jemandem, Dativ]
Ich folge dem Auto.
  [etwas, Dativ]

This is similar to English dictionary entries, for example:

to follow so./sth.

where the distinction between someone and something is unrelated to cases as well.

The distinction between a person and a thing is made, because there are some verbs that usually do not make sense with a person or a thing. This is rather about word usage, less about grammar.
Consider the German verb weh tun, for example:

Dem Mann tut der Bauch weh.
  [jemandem, Dativ]
Dem Auto tut der Bauch weh.
  [etwas, Dativ]

The second example is perfectly fine from the grammatical point of view. However, it does not make sense in a standard environment, since cars usually do not have a belly that might hurt them.
(In a non-standard environment, like a fictional writing or TV show, a sentence like the second might be valid as well. For example, in a story where toys are "alive", the doll might tell the teddy bear Dem Auto tut der Bauch weh., referring to the toy car.)
Answer: In German, it is a trait of a verb what case (nominative, accusative, genitive, dative, all are possible) it rules. This does not change depending on the object's gender:

Ich folge dem Mann
Ich folge der Frau
Ich folge dem Kind

(all dative).
Comment: Gender war aber nicht gefragt, sondern jmd. oder etwas.
Comment: @userunknown und was ist das anderes als Gender?
Comment: Das hatten wir aber schon 100 Mal: Der Löffel, die Gabel und das Messer sind 3 unterschiedliche, grammatische Geschlechter aber alles Sachen, nicht Personen. Während der Mensch, die Person und das Mitglied alles jemanden bezeichnen, nicht etwas.

Person vs Thing for determining case?


How to connect truffle using HDWallet provider to Websocket-powered node?

Question: I am using truffle-hdwallet-provider to connect to the node that operates over https and it works perfectly. Now I want to connect to websocket-powered node but keep my HD Wallet provider. I cannot find how to do that. All I found is package web3-providers-ws but cannot find is it possible (and how) to chain multiple providers?
Answer: You can pass an instance of the provider instead of a string as a second argument. So you can pass a websocket provider in:
const webSocketProvider = new Web3.providers.WebsocketProvider(...);
const walletProvider = new HDWalletProvider(mnemonic, webSocketProvider);

Answer: In https://github.com/trufflesuite/truffle-hdwallet-provider/blob/master/index.js, it is hard coded to use HttpProvider
You would need to fork and modify this line of code:
 this.engine.addProvider(new Web3Subprovider(new Web3.providers.HttpProvider(provider_url)));

to instead:
 this.engine.addProvider(new Web3Subprovider(new Web3.providers.WebsocketProvider(provider_url)));

I will give it a try some day and get back to this thread...


HP printer won't print

Question: I just attached a HP Deskjet 3510 printer to my Ubuntu 12.04 computer via USB, which works with other devices.  The printer is not recognized by HPLIP, as the device manager says "No Installed HP Devices Found."  When I try to print a test page from the print icon properties, nothing prints although the printer state says "Idle - Rendering completed."  However, a self-test page is printed OK directly from the printer itself.  Any suggestions please?
Comment: You can print but you can't?
You mean you can press a button to do a printer self test on the printer, and that works(that involves no interaction with no OS) but a test page sent from Ubuntu doesn't work? Which seems logical when it is not installed.
Sorry, but the text you provided was a little confusing to read.
Answer: If you open System Settings and click on Printers does the printer show up? Look in the "/dev" directory, is there a "usb" folder?
~$ ls /dev/usb
lp0
~$

If you don't have an lp in your usb directory I would suggest trying some other usb ports on your machine or trying other devices in that port. USB ports are notorious for becoming faulty, usually due to constant plugging action and the fact they have power running through them.
I didn't have to do a damn thing for my HPDJ3512. It didn't even ask me to install anything, it just showed up.
Answer: My printer (HP LaserJet 1020) was working when I first plugged it in to my Ubuntu laptop and then for some reason after some time it no longer did jobs successfully. My computer apparently was sending the data to the printer successfully but the printer would just sit there doing nothing
Using sudo hp-setup in the terminal put me through an installation wizard that, when finished, got my printer working. Apparently Ubuntu comes with the hp-setup functionality.
Hope this helps another--
Answer: Today I solved the riddle of why the new HP-Deskjet 2510 All-in-one, (Ubuntu-1204) would not print despite having followed documentation, advice given here (upgraded hplip, etc). I acquired an old Epson Stylus CX3810, missing ink cartridge and all, hooked it up turned it on, ran hp-setup, there it was found and ready to go. huh? What was different? I used an old USB printer cable, hmm.. switched it to the HP-Deskjet, there it was found and ready to go. Lesson? Just because a USB printer cable is new and for the printer does not mean it works. Thanks to all that helped.

HP printer won't print


Web programming only, or database applications of any stripe?

Question: The DBA title kind of leaves the implication, for me anyway, that the site is aimed primarily at those of us who create and manage databases for online applications and similarly deployed settings.  Are questions about databases used in desktop/client-side programs (e.g. the use of CoreData in Cocoa) considered on- or off-topic here?
Comment: How does the DBA title imply web based applications only?
Comment: why wouldn't they be concidered on-topic ?
Comment: possible duplicate of [What kind of questions are allowed on Database Administrators ?](http://meta.dba.stackexchange.com/questions/11/what-kind-of-questions-are-allowed-on-database-administrators)
Answer: This site should not be limited to web only. I think desktop applications like MS-Access should be on-topic as well.
Answer:
Are questions about databases used in
  desktop/client-side programs (e.g. the
  use of CoreData in Cocoa) considered
  on- or off-topic here?

You answered your own question in the question itself.
As long as the question is for database professionals to answer, that's fine.
From the FAQs page:

Database Administrators - Stack
  Exchange is for database professionals
  who wish to improve their database
  skills and learn from others in the
  community

PS: I wonder how many times I need to advise on reading FAQs and About page.
Answer: What about smaller embedded databases (eg sql-lite) where there isn't really an 'admin' focus. They probably fit more into pure programming. Single-user (or thread) isn't a good line-in-the-sand either as that can be applied to large data warehouses as well as small apps.


How should I build a portable light box for shooting beer bottles?

Question: I am working on a beer related website, and I would like to build a portable light box that I can take to a beer shop and photograph as many individual beer bottles as possible.  What is the best way to construct this to ensure proper lighting and the ability to rapidly swap out beers and snap photos?
Answer: There are plenty of light tents on the market that would suit your needs:
Light Tent - Google Shopping
If you want to go the DIY route, your best bet is to choose a decent piece of diffusion material (thin plastic / acrylic are good for this) and make a tall three sided pyramid and fire the flash through the diffusion material for even lighting, see:
Strobist - A Ping from Ming on the Bling Lighting Thing
This setup really favours shooting from above however you could build a two sided box with sides at right angles which would give you the ability to quickly swap out bottles. When shooting glass you want the lit-up diffusion material to make up as much of the space around the bottle as possible so you don't get odd reflections of your light tent in the glass.
Answer: Unless you are on really good terms with your beer shop, I would have thought they would have frowned on you photographing dozens of beer bottles in their store without paying for them. Why not take the bottles home and use a non-portable setup? If you are on really good terms with your beer shop that they may be happy with you returning them (rather than cluttering up their store for hours). If not then how about buying the beer you want to photograph. Bonus - you get to drink the beer!
Comment: Photograph them THEN drink them.
Comment: The shop owner may well benefit from the exposure such a website could generate. As for buying and drinking the beer that could cost hundreds and lead to some severely drunk shooting! None of this has anything to do with photography, however...
Comment: Thanks for your input, though it is a bit irrelevant to my original question.  I am on great terms with my local beer stores, and have purchased more than my fair share of beer from them over the years.  I plan on practicing my technique with the bottles I already have at home, and once I get a system down, going into the store for an hour or so to take as many shots as time will allow.

In fact, I built a light box last weekend and am still working on tweaking it to get the lighting right. This will allow me and a team to rapidly shoot/swap out bottles with minimal disruption.
Comment: I agree my input wasn't immediately relevant, but I did want to mention an alternate approach in case you hadn't considered it. Good luck with the project.
Answer: There is this tutorial on digital-photography-school how to make a DIY light tent from a cardboard box.
You could in theory scale this down to bear bottle size or make one on site.


"клеветa в отношении чего-то" vs. "клеветa о чём-то"

Question: What's the difference between "Распространять клевету в отношении Китая" and "Распространять клевету о Китае"? Is there a slight difference in meaning there?
Answer: What's the difference between "spreading rumors concerning China" and spreading rumors about China"?. Pretty much the same difference is in Russian.
In other words, there's not much of a difference. Any language possess certain level of redundancy, one can speculate that there's very subtle connotational differences, but I'd rather not.
However "распространять клевету в отношении кого-либо/чего-либо» sounds too official, bureaucratic even. You most probably hear something like this in TV news but not in a casual speech.
Well, to be more strict, it rather be "клевета на Китай", not "клевета о Китае".
Answer: The first sounds OK I guess, since it implies that a whole country (China) is falsely accused of something, so the formal language (в отношении) is expected.
The second sounds slightly incorrect and quite informal, for the most grammatically correct form is 'клевета на Китай'. But since it's not a person who is involved, but a whole country, the first seems to sound not bad at all.


New GFCI to replace one that was in the subpanel of a hot tub

Question: I have a dedicated 50 amp 240 v circuit to a hot tub.  Had it over 15 yrs no problems.  Recently the GFCI that was in the sub panel would buzz and then trip or sometimes work just fine after resetting.  The GFCI was an old one that had the 240 v wires running through a hole in the back...these are not used anymore.  I bought a new one that goes into the main panel that feeds the sub panel.  It has a center white ground wire that goes to the main ground.  The circuit going to the hot tub has red, black, and white.  In the main panel the white wire is connected to the main ground bus.  When I connect the white from the new GFCI it trips the breaker.  Is that because I need to take the white wire from the hot tub and connect it directly to the center lug in the new GFCI circuit breaker instead of the bus and then the pigtail from the GFCI to the ground bus?  To me that makes sense and would stop the tripping.  Please advise as these new GFCI are a bit different than 20 years ago.
Answer: Yes, you need to connect the white from the hot tub panel to the gfci breaker, and the pigtail from the breaker to the neutral bus.
Answer: Your white wire from the breaker goes to the panel neutral, not ground. The white wire from your hot tub gets connected to the breaker.
Answer: Thanks...After thinking about it I moved the white ground to the center lug of the breaker and then the pigtail to the ground bus.  I just had to think how it works and it has to sense activity on the ground and to do that it has to pass through the back end of the breaker where the GFCI sensors are located.  It was a light bulb goes on moment.
Thanks
Comment: White is neutral, NOT ground.


Can the inverse of a function be the same as the original function?

Question: I was wondering if the inverse of a function can be the same function.
For example when I try to invert
$g(x) = 2 - x$
The inverse seems to be the same function. Am I doing something wrong here?
Comment: No, you're not doing anything wrong.  You can certainly have functions such that $f(f(x))=x$.  Such functions are called *involutions*.
Comment: Consider $f(x) = x$.
Comment: There is also a simple graphical interpretation: any function that when graphed is symmetrical over $y=x$ (that is, a diagonal line at 45° angle splits the graph in two mirror images of each other) will have this property. It's easy to see that you can draw boatloads of functions like that.
Comment: In general, given an invertible function $g$, $f(x)=g^{-1}(-g(x))$ is an involution.
Answer: You're correct. A function that's its own inverse is called an involution.

Edit: Oh let's have some fun. :) What are some other functions that are easy to check are involutions? I've cherry picked some of my favorites in what follows, both from memory and also the references I provide below.

First, note that there's an easy test to determine whether or not $f$ is an involution. Namely, since $f^{-1} = f$, you just need to double check that $f(f(x)) = x$ for all $x$ in the domain of $f$. This can be used to verify all three of the following examples are actually involutions.
Your function $g(x)$ generalizes to a whole class of involutions! Namely,
$$
    f(x) = a-x
$$
is an involution for any real number $a$. In particular, $f(x) = 0 - x = -x$ is an involution (as is $f(x) = x$, of course).
As someone already pointed out, $f(x) = 1/x$ (defined for all real $x \neq 0$) is also an involution. More generally, for any real $a$ and $b$ the function
$$
    f(x) = a + \frac{b}{x-a} = \frac{ax + (b-a^2)}{x-a}
$$
satisfies
$$
    f(f(x)) = a + \frac{b}{a + \frac{b}{x-a} - a} = a + (x-a) = x
$$
for all real $x \neq a$, and as such is also an involution on this domain.
Here's a less obvious (but cool) example. Consider the function $f(x) = (a - x^3)^{1/3}$. You can check this directly that $f(f(x)) = (a - ((a-x^3)^{1/3})^3)^{1/3} = x$. This is an example of a large class of involutions generated by a special type of symmetric function $F(x,y)$ (as explained here).
Fun Fact: The only continuous, odd ($f(-x) = -f(x)$ for all $x$) involutions with domain $(-\infty,\infty)$ are $f(x) = \pm x$. (A short proof of this fact is given here.)
There are many, many, more of these functions, and they occur naturally/are useful tools in many branches of mathematics.
Comment: For "fun fact", that is the only non-trivial involution, but the trivial involution is also odd and continuous.
Comment: @DietrichEpp: Good catch! I've edited the post. Thanks!
Answer: That's perfectly fine, and your answer is correct.  For another function that is its own inverse, see:
$$f(x) = \frac{1}{x} = f^{-1}(x)$$
Answer: $g(x): y=2-x$
$g^{-1}(x): x=2-y\implies x-2=-y\implies y=2-x$
So you're correct. It is possible that a function can be an inverse of itself.
Answer: Coming from theory of coding (LDPC codes decoding), you have another involution:
$x\mapsto-\log(\tanh(x/2))$.
Answer: Yes, you are correct, a function can be it's own inverse. However, I noticed no one gave a graphical explanation for this.
The inverse for a function of $x$ is just the same function flipped over the diagonal line $x=y$ (where $y=f(x)$). So, if you graph a function, and it looks like it mirrors itself across the $x=y$ line, that function is an inverse of itself.
This graphical representation can be used to understand a lot of really cool ideas about inverse functions.
For example, any straight line that's perpendicular to the line $x=y$ will of course be the exact same on both sides of the line $x=y$. Any function that is a straight line perpendicular to $x=y$ can be written in the form $f(x)=a−x$, which as Dan mentioned is an entire class of functions that your function just happens to be one of. Note that the $a$ just determines how high up on the $y$ axis the function starts, but it will always mirror itself across $x=y$.
You can also see some interesting facts about functions that are their own inverse that might be fun to take some time to prove. For example, since it needs to mirror itself over the line $x=y$, any function that is its own inverse that has any points where $f(x) = x$ must have a slope of either 1 or -1 at that point (or have an undefined slope).
Edit: I must have skipped over Euro Micelli's comment, which explained the graphical aspect of this literally years before I did.
Answer: There are many examples for such types of function's
Y=1/x
X^2+Y^2=1,2,3,4,5,6,7.....(any other positive number)
Simply the fact behind this is that the graph of the function should be symmetric about line Y=X
While calculating inverse what we actually calculate is image of that function with respect to line Y=X
Comment: $x^2 + y^2 = 1$ is not a function.
Comment: Welcome to the math.stachexchange. Try using mathjax for formulas to make your answers/questions more readable. Extensive how-to found on site.


how to copy List item attachment to document library with SharePoint Designer workflows?

Question: I have SP Foundation without access to the server local folders, so my only change is through Sharepoint designer as far as I know.
how can I copy a List item attachment to document library with SharePoint Designer workflows?
Note. The document library does not have the same fields as the list.
Answer: I could not achieve my goal to copy a list attachment to a document library but on my investigation I discovered how to copy files from one document library to another with Sharepoint service copy.asmx and sharepoint services (see more information on http://spservices.codeplex.com/)
I post below the different functions I created for my testing, as I said they work but not for list attachments as a source.

uploadFile uses soap CopyIntoItemsLocal to upload.
uploadFile2 uses SPServices jquery with CopyIntoItemsLocal
uploadFile3 uses SPServices jquery with CopyIntoItems

Note. I post this because my research didn't help me on my goal but might help someone else.

function uploadFile(source,destination)
{
    //source = encodeURI(source);
    //destination = encodeURI(destination);
    var soapEnv =
    ""+
        ""+
            ""+
                "" + source + ""+
                ""+
                    "" + destination + ""+
                ""+
            ""+
        ""+
    "";

    $.ajax({
        url: "http://sharepoint.cplis.com/test/CentralisTest/_vti_bin/copy.asmx",
        beforeSend: function (xhr) { xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/CopyIntoItemsLocal"); },
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: processResult,
        contentType: "text/xml; charset=\"utf-8\""
    });
}

function processResult(xData, status) {
        alert("Uploaded SuccessFully");
    }

function uploadFile2(source,destination)
{
    //source = encodeURI(source);
    //destination = encodeURI(destination);
    $().SPServices({
            operation: "CopyIntoItemsLocal",
            async: false,
            SourceUrl: source,
            DestinationUrls: [destination],
            completefunc: function(xData, Status) {
                alert("Status=" + Status + " XML=" + xData.responseXML.xml);
            }
    });
}

function getStream(source) {
    var myStream = "";
    //source = encodeURI(source);
    jQuery().SPServices({
        operation: "GetItem",
        async: false,
        Url: source,
        completefunc: function(xData, Status) {
            myStream = jQuery(xData.responseXML).find("Stream").text(); //MSDN: base-64 representation of the retrieved document's binary data.
            alert("myStream: " + myStream);
            } // end completefunc
    }); // end getItem
}

function uploadFile3(source, destination, myStream) {

    source = encodeURI(source);
    //destination = encodeURI(destination);

    jQuery().SPServices({
        operation: "CopyIntoItems",
        async: false,
        SourceUrl: source,
        DestinationUrls: [destination],
        Stream: myStream, //whatever variable you used to store the base64 encoded binary data from the GetItem call
        completefunc: function(xData, Status) {
            alert("Status=" + Status + "\n" + xData.responseText);
            } // end completefunc
    }); // end CopyIntoItems

}

Have fun!!


Local AP - Outside Router MitM Attack?

Question: Let's say that we have our computer inside the local network. Our local network is connected to the Internet by AP+Router that connects to the router in other network which is connected to the ISP.
Now, I'd like to know if there is any chance that we can listen to the traffic between AP+Router and Router(in other network) from our local network?
Comment: No. The router in your local network is your gateway - you send all the traffic that is not destinated for your LAN (your computer determines that looking at subnet mask) to the address, configured as your default gateway in order to be routed to it's destination. Every host on LAN do the same if something other isn't configured. So, what happens next is router's job and is not under your control, no matter if the router acts as a simple bridge and route the traffic to the ISP network on the WAN port or pass it to another router that manages another LAN segment.
Answer: No, you won't be able to do a MITM attack on the edge router and your access point/router. In order to perform a man in the middle attack you must be on a network segment that allows your device to actually get in between these two routers. As programings already pointed out your gateway is the internal router/access point, which means that without it you cannot get to the edge router or route traffic. In a MITM you are attempting to reroute traffic through you by some means (in this case I imagine your referring to ARP Poisoning?), which is impossible if you cannot get to one of your targets without going through the other.
In order to perform a MITM on these routers you would need to move onto a network segment that is between the edge router and the internal one. You need this due to the fact that ARP Poisoning deals with a flaw in ARP which lives on the second layer of TCP/IP. In your case you don't have access to the second layer that the edge router is working with because you are behind the internal router.
Comment: It's not a protocol flaw. That's the only way ARP can work effective. :)
Answer: Potentially yes, but you would need to implement bgp-hijacking
Answer: Yes you can.
MitM attacks consist of sitting between the connection of two parties and either observing or manipulating traffic.
A classical and well known MITM would involve ARP poisoning, which can only be executed on the same subnet, meaning in this scenario you can't do it from another network.
This doesn't hold true if for example you have taken over control of a victims default DNS server, meaning you can MITM all of those requests.
Also another scenario would be externally compromising the victims internet router (finding open management access through Shodan) and adding a route to your public proxy.
There recently have been many bgp-hijacking attacks as well, where the attackers main purpose is to re-route traffic through his AS router so he can MITM all of the internet traffic.
There are also a bunch of other examples, which you can read up
here

Local AP - Outside Router MitM Attack?


Advice for closing proposals on Area 51? How can I wield this power?

Question: What is an equivalent of I just crossed the 3K threshold! Any tips for responsibly wielding this power? for Area 51?
Comment: I think like everywhere else you should err on the side of leaving something open.  If it's not strictly against the FAQ (offensive, duplicate, etc) leave it to the Double D's  to close.
Comment: And BTW you are not 3k yet on '51, you're exactly `1,956` at this second.
Comment: @rlb  you only need 2k, see the faq :)
Comment: I'm flagging to close this question as off-topic because it's no longer possible for community members to vote to close Area 51 proposals; as of a few years ago, only moderators can close proposals.
Answer: It should be pretty obvious what kind of proposals need to be closed, like obvious duplicates or completely ridiculous joke proposals. The only grey area here is that what might seem to you like a spurious proposal might not actually be so, so I'd at least leave a comment on what might look like a dubious case to check and make 100% sure before throwing your weight around.
Comment: Now why do you have to drag Welbog into everything that you consider ridiculous? A lot of people backed at least one of his proposal, many thinking it would be condoned since it was allowed to live so long. It was addressed. Move along ... move along ...
Comment: OK I deleted that.
Answer: Whenever I close a proposal (particularly duplicates), sometimes I take a wait-and-see approach. There might be a good reason to have a duplicate proposal. Perhaps there is a unique aspect to the proposal that the author wishes to pursue. That doesn't mean I have to agree with him. Those cases are usually decided by the (lack of) support by the community.
Maybe the author is better suited to launching a successful campaign: If the author is some world-class maven in [subject] who wrote a better proposal, asks better questions, rallies more support, blogs about it enthusiastically, and it takes off. Proposals that look the same aren't necessarily equal. So I give it a bit of a chance to see where it goes.
But I stay on top of it and check back often. Sometimes a duplicate proposal was placed inadvertently (the search didn't bring up the duplicate). In those cases, the author is usually more than happy to support the other proposal. If nothing special happens with the proposal I'm watching, there's no use in splitting up the subject, so I close it.
I usually leave a comment indicating that the author may follow up with a reason they placed the apparently-errant proposal.
Answer: My advice is to do your reading. Since you have 3k obviously you've been eating your wheaties, but it's always best to keep in touch with what Meta's been talking about, especially in those touchy areas:

Voting to close as duplicate on Area 51
Near-duplicate or "subset" proposals on Area 51


What does it mean when we say that "a neuron connects to a certain cortical layer"?

Question: For example, if we say "a neuron connects to Layer V of the cortex", does it mean it synapses inside layer V, or does it imply that the soma of the neuron it synapses to is in Layer V (and it could synapse inside Layer II for example)?
Answer: Short answer
In complicated matters like neural connections in a layered cortex, it is all about semantics. One should carefully place statements in their context and deduce their meaning.
Background
In Fig. 1 a schematic of the layering of the cortex is shown. The layers can be separated based on their histological and neurophysiological features:

Layer I: the molecular layer, contains primarily axons running parallel (horizontal) to the cortical surface.
Layer II, the external granular layer, is composed of a mixture of small granule cells and pyramidal cells. The apical dendrites of the pyramidal cells extend into layer I and their axons descend into and through the deeper cortical layers.
Layer III, the external pyramidal layer, contains primarily pyramidal cells. Their apical dendrites ascend into layer I and their axons descend into and through the deeper layers.
Layer IV, the internal granular layer, consists almost exclusively of stellate neurons. It can be divided into subdivisions in many neocortical areas. Layer IV is the primary target for ascending sensory information from the thalamus.
Layer V, the internal pyramidal layer, consists predominantly of pyramidal cells. Apical dendrites may extend upward one or two layers, and the larger pyramidal cells may have dendrites extending into layer I.
Layer VI, the multiform layer, contains an assortment of neuron types. The dendrites of pyramidal cells may extend into layer I. (source: Clinical Gate)

As the text in bold above shows, the apical dendrites of pyramidal cells can extend many layers. Hence, it is a matter of reading the text carefully to know what they are talking about.
In your example...

[A] neuron connects to Layer V of the cortex...

...it would depend on the context, but in this isolated instance it simply reads that a neuron's axon terminates in layer V. Especially in histological texts a line like this would most likely have identified the axon and the axon terminal and have identified the layer where it terminates.
However, as said above, dendrites of pyramids may extend all the way up to layer I, so if a text would say...

[A] neuron synapses onto a layer V neuron...

it is left undetermined exactly where that connection is made (can be layers I, II, III, IV, or V in the case of pyramidal cells).
What can be of help is the fact that when a text talks about...

...a layer V neuron

...you can safely assume that its cell body is located in layer V, as a cell's location is determined by its cell body. Its dendrites can be in any layer (especially of the larger pyramid cells) and its axon may traverse all layers.

Fig. 1. Layers in the cortex. source: Clinical Gate
Comment: Thanks for your time. If I ask the question it's because I read it written like this many times and the context was not helping. So I thought there must be a convention. Trying to guess from the context is not scientific at all.
Comment: @borilla - no worries. It's not guessing,  it's placing words in their context. Words without context are meaningless.
Answer: Both are correct, technically, neurons a lined and positioned through synaptic connections and so logically each layer should comprise both the soma of neurons as well as the neurites for synaptic connections that can or may extend outside its layer and protrude its network outside. I highly recommend studying and understanding the processes and actions that are underscored in neural activity in the visual cortex.
http://www.ncbi.nlm.nih.gov/books/NBK10884/
PS. brain has 6 layers, try picturing fetal neurons climbing up radial glia stalks that transcend layers during fetal development!
Comment: The brain does not have 6 layers. The cortices do. And this layering is arbitrary and very different in, *e.g.*, rhinal and visual cortex.
Comment: That was not my question. If you read "this neuron connect to layer 5" then what do you understand? it connect to a synapse in layer 5 or it might connect above layer 5 to a neuron whose soma is in layer 5 ?


Lotus Notes embedded view from other database using formula?

Question: When creating an embedded view, a popup will appear asking from which database and which view to embed. There's also an option to use @formula to specify the view. Selecting that will present 2 more option 'Display' (radio button): 'View' and 'Formula'. How do I write formula to select view 'Employee' from 'Database B'? Let's say I'm currently in 'Database A'. In the form I already passed value for 'Database B' server and file name/path in the fields 'svr' and 'db'.
Answer: Unfortunately you can't.  You can only specify the view name which corresponds to views within the current database.
See more information here: http://www-10.lotus.com/ldd/nd6forum.nsf/0/8b60e2b8c9c3223c852572e2004cbd79?OpenDocument
Just a thought:  I'm not sure if this is possible, but perhaps you could add the two embedded views into your form and then hide/show them?  They wouldn't be based on a formula, but deciding whether they show/hide could be based on a formula.
Comment: Ken is right, however instead of using hide-whens, I would suggest using two subforms, each one with one of the embedded views, and a computed subform formula.  That seems slightly cleaner to me.
Answer: Here's how you do it: http://dmcnally.blogspot.com/2011/01/configurable-embedded-views-single.html
It is an extensive writeup so I won't describe it here.
I've been using this solution for ages, works pretty well.


Creating polygon layer from raster

Question: I am using ArcGIS 10.2 in order to create soil management zones for farmers. when I use the raster to polygon tool it creates small triangles out of the polygons and jagged edges that are very unrealistic looking zones. I have used the smooth polygon tool, as well as the nibble, focal statistics and majority filter while the files is still a raster in order to reduce the number of zones. Any ideas on an effective way to change these zones from raster to vector and look realistic?
Comment: Can you provide a screenshot of your input raster, as well as indication what the values of the raster cells are? An output of your current results might help as well. It's hard to offer suggestions without seeing the actual problem.
Answer: First of all.... Is this using the generalize polygons toggle or not? Toggling this on might be good enough for your purpose. Keep in mind the intended data scale relative to presentation scale. My suggestion below is purely for presentation. Make-up on a pig .... No offense meant...
Although this is categorical data, you might get a more natural looking output from an interpolation rather than a conversion. Not sure how your SMUs are organized, but you would need to have each type with a unique number, possibly arranged in some assumed sorting order by particle size. Then create contours and polygonize those. If attributes don't come along happily, convert your raster to point and join the points to the polygons. Probably have some artifacting where mud turns to bedrock or boulder .... That type of thing. You could also try resampling your raster to a smaller cell size and messing with your interpolation type. Nearest neighbor is what you should be using, but depending on the change in cell size and how much smoothing you are looking for.... Something else might give you a more natural looking result...keep in mind this is no longer data though.. Just illustrative
Comment: Mike The generalize option you mentioned do you mean smooth polygon during the raster to polygon conversion?
Comment: Yes, it is just a check box in the raster to polygon tool. It has no modifiable parameters, so it does what it does. Proceeded by a resampling to a smaller cell size and a few iterations of expanding and thinning groups it should smooth a little better.

Creating polygon layer from raster


France Switzerland trip

Question: I am attending a conference in cannes France from 17 April to 20th April
By 20 April I will be free and wish to see Paris and any town in Switzerland I am accompanied by my wife and12 year old son.
My holiday ends on 24th April
What would be the best travel plan? Would it be better to travel from cannes to Paris spend 2 days in Paris and then travel to Switzerland or the other way round that is cannes to Swiss and then Paris?
Please guide me
Would also like to be in Disney land Paris
Comment: Based on a map of Europe, I'm pretty sure you should go to Switzerland first.
Comment: You don't have a lot of time to see something Swiss, Paris, and Disneyland Paris in 5 days, especially when you factor in travel time. You could easily spend that time in just one of those places and still not see everything there is to see. In any case, one factor here is where your flights arrive and depart, as you'll want to plan your route to most efficiently use your time and avoid going back and forth.
Comment: I agree with @ZachLipton, just skip Switzerland this time. Towns in Switzerland are not that interesting anyways...
Answer: I feel the main attraction of including Switzerland here has to be a scenic road trip over the mountains. I think the main ones are the Forclaz pass between Chamonix and Martigny (relatively low) the Great St Bernhard pass (still closed in april) and the Simplon pass, which reaches 2000m and is usually kept open in winter.
But the route Cannes-Simplon Pass-Disneyland-Paris is 1209km and takes over 13h of driving according to Google Maps. Whether it is worth spending so much time in a car (I think the time is optimistic) is up to you. You'd need to rent a car in Cannes that you can drop off in Paris, and find places to sleep along the way.
On the plus side -- the route follows the Mediterranean for a long time, passing Nice and Monaco and stretches where the mountains almost reach the sea, before it turns over the flats until it goes into the high mountains for the pass. And in Switzerland, Sion, the Rhone Valley and Lake Geneva are very scenic, and you can visit Montreux or Lausanne.
But it takes quite a lot of time, and you only have a few days. Combined with a day Eurodisney, this may result in basically skipping Paris...
Answer: The best approach would likely be :
- Cannes to Nice : 30 minutes driving
- Nice to Paris : 1h flight
- Few days in Paris
- Paris to Geneva : 50 minutes flight
From Nice to Geneva, you will also find direct flights but there are less options than the other way.
Comment: For Paris to Geneva, consider taking the train. It takes around 3 hours, but it saves you the trip to the airport, going through security, check-in/boarding time and waiting for your luggage. Depending on where exactly you want to go in Switzerland, you may also have even more direct routes that would not be available by plane.

France Switzerland trip


Dual Passports: Australian and Lebanese

Question: I am currently studying in the UK with a visa on my Lebanese passport. If I want to travel to Portugal I will need a visa. Can I use my Australian passport to get out of the UK and visit Portugal and back? Am I allowed to do that?
Comment: I think jpatokal procedure is the best and safest but in principle you are allowed to do anything, you just need to follow the rules in each country.
Answer: Yes, you can travel, but you need to use both passports.  This is going to be the third answer saying basically the same thing, but let me break it down into exact steps.
When leaving the UK:

Check in at the airport, show your Australian passport to airline staff.
There is no exit immigration in the UK, so you do not need to show your Lebanese passport to anyone, unless you're stopped by the police or something.
Arrive in Portugal, show Australian passport at Immigration.

You are now in Portugal!  And on the way back:

Check in at the airport, show your Lebanese passport with UK visa to airline staff.
At exit immigration, show Australian passport.
Arrive in UK, show Lebanese passport at Immigration.

This obviously assumes you have a multiple-entry UK visa that will let you back in the UK.  Given the UK's lack of exit immigration, you could probably re-enter with your Australian passport (no UK visa needed) and they might never even notice you left, but I would not recommend it -- things would get hairy fast if they notice a hole in your story, eg. claiming to be a student but not having a student visa in your Oz passport.
Answer: The general rule about multiple passports is that you must always exit a country using the same passport that you used to enter. This implies that you cannot:

enter the UK on your Lebanese passport
leave the UK using your Australian passport
enter the UK on your Australian passport

because at that point, you have "entered" the UK twice with two different passports and clearly you can only leave once more at this point.
If your UK visa is multiple-entry, then you should be able to re-enter the UK on your Lebanese passport in step 3 above after visiting Portugal on your Australian passport. If your UK visa is single-entry, then you would probably have to apply for a new visa or something before returning to the UK.
Comment: +1 for the general rule.  However, in the specific case of the UK, you actually *could* do that quite easily, since the UK does not track who leaves the country, only who enters.
Answer: No, you are not allowed to do that.
However, you do not need to enter Portugal on the same passport that you left the UK on.
Since your Australian passport won't have any UK visa or entry stamps, you can't leave the UK on it.
Conclusion: You need to leave the UK on your Lebanese passport.
The Portuguese customs, will not know (and don't even care) where you just came from. So you can enter Portugal on any of your passports, as long as you hold a valid visa in this passport (or are allowed to enter without a visa).
Conclusion: Enter and leave Portugal on whichever passport it's easier to enter the country.
Same on your way back: You need to leave Portugal on the same passport, that you entered it with.
However, now you can enter the UK with any of your passports - as long as you hold a valid visa in this passport (or are allowed to enter without a visa).
But since you are apparently studying in the UK and your student visa is in your Lebanese passport, you should enter on your Lebanese passport.
Entering the UK on your Australian passport will probably just get you a tourist visa, which most likely means you need to leave the country after a certain amount of time.
That said, make sure your Student Visa is a multiple entry one. If it isn't you will loose it by leaving the country - no matter which passports you are using anywhere.
Comment: Mostly true, but the UK has no exit immigration checks.  This means you can leave with a receipt from McDonalds, as long as you can convince an airline to let you board.
Comment: Not completely correct - there's normally no problems with showing the airline Passport A at checkin (so they can see you can enter the destination), showing Passport B at the exit immigration control (so they can see you left on the one you entered on), then back to Passport A at the gate (for a final check for the destination)
Comment: No exit checks at all? I can hardly believe that. That would mean you could overstay any visa for years without anyone being able to find out. Also makes me wonder why Julian Assange fled into an embassy when he could just have left the country easily.
Comment: Rest assured, it's true, although they're thinking of adding them.  Assange would have been nabbed at check-in though.  And you can overstay *anywhere* for years as long as you don't go to the airport!  http://www.dailymail.co.uk/news/article-2381880/Exit-checks-track-immigrants-leaving-Britain-NOT-introduced-2015.html

Dual Passports: Australian and Lebanese


UK trademark law: Similar company names

Question: Can a company be sued for using a similar name to an existing company? For example if a company was called "The Kraken liberties" and a new company were to be named "The Kraken Club", could the company come after it?
The jurisdiction is the UK.
Comment: As edited, I do not think this question is a request for specific legal advice.
Comment: You tagged this "trademark". Is that all you are interested in? Without a trademark there might still be the company names tribunal (https://www.gov.uk/government/organisations/company-names-tribunal/about) and/or an action for passing off.
Answer: First of all, copyright law does not apply here. Names, titles, and other short phrases are not subject to copyright protection.
The basic rule in such trademark cases is to avoid confusing similarities to existing trademarks. If the existing name has been protected as a trademark, and the proposed new name is sufficiently similar that reasonable people might confuse the teo, thinking that the new firm is, or is part of the old one, or is somehow sponsored by, endorsed by or approved by the old one, then there might be a problem.
Trademark law applies only to names, phrases, graphics and symbols being used to identify or advertise and product or service, or to identify the source of such a product or service. But the name of a company is very often used to identify the source of that company's products or services, so it will normally be treated as a trademark and be subject to trademark law.
Trademark protection is normally limited by industry. If "The Kraken Company" was a maker and seller of seafood, say, while "The Kraken  Club" was a dance club, there would probably not be any conflict between the two names as far as trademark law went. But if reasonable people could still be confused, and think that the good will and reputation of one should be attributed to the other, then there might still be a trademark issue. This is a more likely problem with well-known marks, and with ones that are used in multiple industries.
Even if , under the law, there is no trademark infringement, a company might still "come after" someone using a name that the company thinks is too similar to their mark. Such a company might well send a cease-and-desist letter, demanding that the recipient stop using the similar name or mark, and mentioning the possibility of a lawsuit. There is no way to predict whether a company will take such action. Some are quite aggressive about such issues, some are not.
Many cease-and-desist letters are never followed up, but quite a few do lead to legal action. Defending a trademark suit can be costly, even if the claim is rejected by the courts.
We on Law.StackExchange cannot advise on whether a particular name does or does not infringe on an existing trademark, nor on whether a company will file suit. One would need to consult a lawyer with experience in the trademark law of the particular jurisdiction to get useful advice on such a specific issue.

UK trademark law: Similar company names


CoffeeScript variable scope

Question: Is there any way to declare a variable at "file" scope (which will be closured by CS), without initializing it? A contrived example:
init = ->
  counter = 0

inc = ->
  counter += 1

This won't work, because you need to declare "counter". Adding "counter = 0" to the top would make it work, but the "= 0" is unnecessary. (A more realistic example would involve something that accesses the DOM on page load - there's no way to correctly initialize it in "file" scope.)
Answer: You'll have to define it on the outer scope, as you mentioned.
counter = null
init = ->
  counter = 0
inc = ->
  counter += 1

Comment: +1. Shorthands have been proposed, but jashkenas is a firm believer in the `= null` syntax.
Comment: I haven't seen that, but I guess the rationale is to keep the keyword count low.
Answer: If your functions where part of an object you could use @counter, like this:
obj =
  init: ->
    @counter = 0
  inc: ->
    @counter += 1

Answer: You can say `var counter;` with backticks and that is passed literally through to the generated javascript.
When you have a problem like this, look at the generated javascript.  It will be extremely clear that the variable scope is lexically limited to the function.
Looking at the generated javascript is often a good way to understand what the behavior of coffeescript constructs is.

CoffeeScript variable scope


Re-Applying for the same job after rejecting it

Question: I've rejected a job offer, In the future, if I want to move to their company, how long should I re-apply if I rejected their previous offer?
Comment: Be prepared to explain what changed.
Answer: Did you actually tell them that you rejected their job offer, or that did you weren't taking it? Employers hire you because they need you not because they love you. If they advertise again for the same position, that's because they need someone. One advantage of having received a job offer recently is that you could point out to them that you went through the process successfully and hopefully, they remember you well enough to spare you from repeating the whole process. You could wait six months to a year but then, you'd have the start the whole process all over again. Choose your poison.


Living Above a Restaurant

Question: If I wanted to save money by living in the floor above a restaurant I opened, would this be legal? A friend brought up the problem of districts (commercial, residential, etc)... would this prevent me from doing this?
Comment: @Onyz it probably doesn't. Zoning is generally specified by the municipality. In some cities, mixed-use buildings with commercial space on the ground floor and residential space above are common.  Traditionally, many shopkeepers and perhaps also restaurateurs "lived above the shop."  But the details will depend on the zoning regulations that apply to the restaurant's location. The restrictions will vary *from one zone to another within the same municipality.* (Also, if the restaurant is in a high-rent area, you might save more by leasing out that space and commuting from a low-rent area.)
Comment: This all depends on state, city and county zoning. You're much better off simply talking to the local zoning office.
Comment: Is there any resource you think would be a good place to start looking for zoning info, if I don't have a place in mind yet?
Comment: Generally, zoning restricts non-residential uses rather than residential uses. There might be some jurisdiction where residential use is forbidden, so you'd have to say where this is.
Comment: Missoula prohibits residential use in Light Industrial zones, for example. Zoning is city-based law.
Comment: @user6726 I added a State, if that helps?
Answer: Let us assume you want to open a restaurant in Baltimore, in a C4 location. The zoning table Table 10-301 indicates that you can open a restaurant there. While you cannot generally establish a residence there, you can apply for permission for Above Non-Residential Ground Floor or Live-Work residence. Live-Work is essentially "artist's loft", so not applicable. There are a few Industrial zones where a restaurant might be allowed and such a residence might be allowed ("bio-science campus"). You could check the map to get information on a specific location. If you're not in Baltimore, check that location's zoning ordinances and zoning map.
Comment: There's also the complication that zoning is generally grandfathered, so if you purchased an existing building, it may have uses that don't conform to the current zoning, such as an apartment upstairs even if those aren't allowed anymore. Of course, the most typical way of opening a restaurant would be to lease the space, and the landlord may have leased an upstairs apartment separately to another tenant.

Living Above a Restaurant


Room above garage smells

Question: I live in Ottawa in 15 year old house. The room above garage smells like wet wool or rubber. I removed the carpet and a foam padding to examine. The padding and plywood smell as described above (rubber and/or wet wool). All other rooms also have the same carpet and padding but do not smell. Room has no sink or toilet. Garage is not heated but isolated with painted drywall as a ceiling. Garage does not smell. Plywood is dry. What can cause this smell? Should i replace the plywood? Any suggestions please.
Comment: Does this room have appropriate HVAC ducting?
Answer: If the smell remains after you have fully removed the old carpet and padding and you let the air circulate through room and the window by using a box fan or two then you may very well want to consider replacing the plywood as well.
The original problem could be caused by cold moist air rising from the garage into the living space above. It could even have been aggravated to some extent by car exhaust and other oil/paint/chemical usage in the garage by the former owner.
Before you put down new plywood you may want to investigate whether a vapor barrier under the plywood would be a reasonable thing to do. It may very well require a consultation with an expert in your region and such decision would also be dependent upon if there is already a barrier installed such as poly, foil backed insulation or even foil backed drywall on the garage ceiling.

Room above garage smells


Long term investing

Question: Would it be a good idea to invest long term in a stock but buy in the morning and sell at the close every day? This can reduce the risk of an economic crisis affecting my portfolio. I would hold it overnight if there was an earnings report etc.
Comment: This is self-contradictory. On one hand, you're talking about long-term investment. On the other hand, you're considering buying and selling stock every day.
Comment: Oh ya, the old buy and sell every single day variety of long term...
Comment: This is a great idea for the days when the stock goes up after you buy it.   For the rest of the trading days, not so much.  Now if you could only figure out which days are going to be up days.  Then you would have something... :-)
Answer: An economic crisis can occur during the day too!
So this doesn't sound like a great idea for several reasons, the first one of which is transaction fees. Secondly, tax obligations: any profit at the end of the day is taxable, and so over time you can potentially accumulate a lot of taxes on stock that didn't appreciate in value a lot.
Comment: But most happen overnight right? For example, Trump tariffs, the recent turkey crisis. And I can sell as quick as possible in the day but can't do anything when the market is closed
Comment: Yeah, in theory that's not impossible, so as long as you're okay with the downsides.
Comment: @chrislam5459 the important parts are "**transaction fees**" and short term "**tax obligations**".
Comment: Understood. For me personally, my account is tax free anyway and the commissions are negligible. I am just wondering if there are any other disadvantages to this strategy? Thanks
Comment: @chrislam5459 Because you will lose money on a large number of days, and "negligible" commissions aren't, if you have to pay them twice a day (once to buy; once to sell).
Answer: Under your plan not only will you have transactions costs every day, and capital gains issues every day, but you will miss both the good and the bad of the changes that take place when the market is closed.
Sometimes those events that you want to neutralize because they take place at night or on weekends are the events that you want to capture. If the price jumps overnight then you will end up buying fewer shares the next morning. Those are gains that you can't get back.
Comment: This. Transaction costs will eat up any profit you make at all.
Answer: Besides the already mentioned excellent points about transaction fees and tax obligations, you're missing the whole point of long term investing: it ignores short term crises like Trump tariffs and the Turkey crisis.
Buying in the morning and selling in the afternoon is... day trading.  And ignores after hours trading and world markets.
Comment: Isn't that good though?
Comment: They both accomplish the same function
Comment: @chrislam5459 you're not smarter than everyone else.  **We've all had this idea** at one point or another.  **ALL OF US.**  But it doesn't work for the reasons mentioned by user6731765.

Long term investing


using OSX server in conjunction with Windows server

Question: We have a mixed shop, about 60% windows and 40% mac.  The Mac users use the Windows server for sharing files with all users and for access to the internet.  I would like to have a mac server for running backups of the Macs and storing Mac software.  Is it possible to configure things so that the Macs are connected to both servers and using each one for the above-mentioned purposes, using the same cables?  Hang one server off the other, maybe?
Comment: Do you have a router or switch?
Answer: Yes - servers work well together and you could configure things in just about any manner you wish.
As long as you can map out on paper how you want things to connect, you can configure the server and clients to connect to either or both servers at the same time. You'll have different shares on each server for many cases, but you could have one directory run for both servers so people's names and passwords were centrally managed and not different on each server.


How to pronounce 繁栄 han'ei?

Question: How to pronounce 繁栄 han'ei? Is there a glottal stop between the two syllables? Is it //haɴʔeː//, //haɴeː//, //haŋʔeː// or //haŋeː//?
Answer: 繁栄 and 反映, 半影, ... are pronounced //haɴeː// without glottal stop and ん as //ɴ//.
The combination //ɴ// + vowel is difficult to pronounce, so in some cases, such as 反応【はんのう】, orthography has been adapted to allow for easier pronunciation (although はんおう might still be considered a valid pronunciation). Usually though a word has only a single valid spelling, which sometimes may help to distinguish homophones, e.g. 漢音【かんおん】 and 観音【かんのん】.
This phenomenon is called 連声【れんじょう】 and usually occurs with //ɴ// + //aou//, although the Wikipedia page also gives examples for んゑ > ね.
I guess one should also mention that in the case of //ɴ// + //i//, there is 雰囲気【ふんいき】, which is more often than not pronounced ふいんき...
In any case, //ɴ// + //aiueo// sometimes calls for attention to detail, but putting exceptions aside, ん + あいうえお is pronounced //ɴ// + //aiueo//. In the case of //ɴe// the phonetic realization usually exhibits some palatalization as in [[haɴʲe:]] or nasalization as in [[hãːeː]] (see comments below).
Comment: Announcers surely pronounce it as  /haɴʲe:/, but people usually do it more like /hãe:/.
Comment: I would write it as [hãːeː], because the nasal is still moraic.

How to pronounce 繁栄 han'ei?


Why do we use the term 'centrifugal force' to calculate net gravitational force?

Question: When an object, orbiting in circular path, experiences the sensation of being thrown outward away from the centre of circle. We often think that an outward force or centrifugal force is responsible for this trend. But it is wrong idea. Inertia is responsible for this.
Since earth rotates around its axis, an object standing on the surface of earth rotates with earth. We say that it affect the downward force that object feels while standing on the surface of earth, and to calculate the net value of attraction force between earth and object we subtract the value of centrifugal force from the weight of that object. This is because centrifugal force pulls this object outward, and the value of centrifugal force equals to that of centripetal force.
But we know that centrifugal force is not responsible for the sensation of being thrown from the centre of circle. So why, in the case of effect of earth's rotation on value of net gravitational force, do we think that centrifugal force wants to pull the object to outward?
Comment: It's just the term used for the 'virtual' force that has to be included when considering force balances in a rotating (non-inertial) reference frame. What's wrong with it?
Answer: I believe it derives from the Latin words centrum (meaning 'center') and fugere (meaning 'to flee'). It is the term used for a virtual inertial force that is apparent when considering force balances in a rotating (non-inertial) reference frame. This virtual force would appear to make objects in a rotating frame want to move outwards, if there are no other forces acting upon them.
Answer: The problem arises from jumping between two different frames of reference in describing the "motion" of the object in question, and applying Newton's Laws of Motion.
If we make the wiser choice, we choose a frame of reference in which the earth is rotating once every day.  Then the object is rotating in a circle, and we need to assign some of the forces we find to the job of maintaining this accelerated motion.  We call the force the centripetal force.  Note that it is not a source of a force;  it is a task we assign to some real force:  gravity acting on a satellite, the tension of a string swinging a rock in a circle, the friction between the tires and the road as a car rounds a curve, etc.
We can also observe that, apart from this acceleration, the object is not accelerating in any other way;  we know that all the forces we find must result in just this centripetal acceleration.
If we then look at this object, we discover that there are only two real forces acting on the object:  the force of gravity, and the force of reaction of the ground on the object.  We can then proceed to measure various forces and calculate others, knowing that all these real forces must add up the centripetal force.  We never mention or even think the words centrifugal force;  if we do, our friends point at us and laugh.
Imagine that you are doing the books for a business, and you are told that the business must make a profit of 1,000,000.  You don't then put down that million dollars as a source of money. Instead, you look at all the real cash flows: purchases, taxes, sales, etc. knowing that you need to find values for all the revenues and expenses (positive and negative) such that the total is one million dollars.
A poorer (in my opinion) choice of frame of reference is to take the earth as non-rotating.  In this frame, the object on the surface of the earth is completely at rest, and thus Newton says that all the forces acting on it must add up to zero.  There is no need to assign any forces to the task of exerting a centripetal force, because the object is not rotating.
But before we start looking at the real forces, we must make an adjustment.  We somehow know that our frame of reference is rotating (relative to what??) and thus we must create some new, invisible forces which are acting on the object, and which depend on (among other things) the rate of rotation of the frame of reference.  The centrifugal force is one of these.  If we include this centrifugal force with the force of gravity and the force of the ground, and require that the total be zero, we can do the same calculations, with the same results as in the rotating earth case.


It is possible to create a custom text field with default text defined?

Question: we need to include some explanation text related to some custom field in order to provide to the user the meaning of these fields and how it must to be completed. We have test with the help text option and the help page feature but we need that the explanation text appears always and any action be required from the user to show it. It is possible to create a new custom text field and define the explanation text as the default value? We have tested it but it does not work.
Answer: Assuming you have Enterprise or unlimited edition you can do this with a fairly simple workflow rule.

Set the evaluation criteria to 'Created'.
Set the Rule Criteria to a formula, and just put
'TRUE' in the formula.  This way it always runs when a record is
created.
Then you create a field update that sets the text of your custom
field to whatever default text you want.

You could of course also do this with a trigger, but why not use native functionality that is available.
Answer: I'm assuming that the requirement here is to have the help text appear when creating a new record (i.e. before it is saved) and when editing or viewing an existing record without having to hover over icons etc in order to save?
There's no way to do this with standard functionality I'm afraid.  The real problem is create new, at which time there is no record to provide default field values to (or to update fields via workflow/trigger).  Edit can be troublesome as well, as only fields that the user can change are displayed, so you'd stand a chance of them updating your help text.
If you were prepared to replace the standard pages with Visualforce equivalents, you can put whatever you like into any of the pages.  It is likely to introduce overhead whenever you want to change things though.
The only way I know of to do this is via a sidebar HTML component (unsupported) that uses JavaScript to inject the help information into the page.
You might want to take a look at the improved help managed package (I have no affiliation other than using it a while back) as that is intended to provide this kind of additional functionality:
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000009x9XeEAI


How to automatically detect blurred document images

Question: The question I have is related to image quality evaluation. Suppose you are supposed to perform OCR (Optical Character Recognition) on a set of document images. Some images, however, are very blurring, and for these images blind deconvolution is needed. However, there are good images that do not need deconvolution. Then my question is: could I find a criterion to automatically separate these images into two groups: blurred image and clear images and then treat them differently when performing OCR?
Comment: See this Q&A: http://dsp.stackexchange.com/questions/2304/auto-focus-estimation
Comment: When doing OCR, don't you get a reliability measure of the detected character? If you can somehow extract this reliability measure you could define some threshold to decide whether to apply blind deconvolution and then do OCR one more time, hopefully with a greater recognition reliability than before.
Answer: Yes, but doing so is difficult. You are basically assuming that when a certain feature is sufficiently present in an image, you can apply a filter and realize an improvement in OCR accuracy. This implies that you can find the right feature, apply the right filter, and evaluate OCR accuracy correctly. Since there are lots of features that might be relevant (edge prominence, high-frequency energy, PSF estimation, unfiltered image OCR accuracy metrics (as @Matt mentions), etc.), lots of filters available (blind deconvolution, among others), and you'll need lots of ground truth images to prove system effectiveness, you are looking at a lot of work and experimentation to create a system that works well.
You also need to make sure you are not working against the OCR software itself, which may do its own image processing to improve its accuracy. In other words, make sure that artifacts introduced by your deblurring do not make OCR accuracy worse, even if the deblurring was done "well" from a deblurring perspective.
All that being said, it should be possible to do this. You might even be able to do this adaptively, by automatically and iteratively adjusting parameters and approaches to optimize the result.


Consequences of overstaying Schengen visa for 6 months

Question: So, as the title read I happened to overstayed my Schengen visa for 6 months does anyone know what the consequences could be. If I wanted to return back to Saudi Arabia.
Comment: Related: [What is the penalty for exceeding the 90 day limit in Rome on an US passport](http://travel.stackexchange.com/q/21596/32134) and [Can an over-stayed stamp from one country affect my abillity to travel to other countries?](http://travel.stackexchange.com/q/47128/32134). In short, you might be fined, banned for future Schengen visas and have a hard time getting visas in other countries. Also related [Best way to leave EU with expired visa](http://travel.stackexchange.com/q/43374/32134)
Answer: Immediate consequences are that your exit will be recorded in the Schengen-wide SIS database.
This means that the next time you apply for a Schengen visa (and possibly, for other visas) your application will have to go additional scrutiny and has a high chance of being denied.
As far as Saudi Arabia is concerned - as long as you have a valid visa (or don't need one), you will have no problems entering the country.
Unfortunately each member state is free to enforce their own rules when it comes to sanctions for overstaying.  There are stories all over the Internet of heavy fines, jail time, questions ... but in the end no one was denied exit.


How to do Migrations and SQL Server connection on MacOS

Question: I'm in OSX and I'm creating a new ASP.NET Core Web API. I've followed this tutorial: https://docs.efproject.net/en/latest/platforms/netcore/new-db-sqlite.html
That's cool and all but what about Sql Server? Now I know SQL Server won't yet run on OSX (https://www.microsoft.com/en-us/cloud-platform/sql-server-on-linux).
The only way I can see to make this work is if I create a cloud remote SQL server (on Azure or similar), then connect with it from my ASP.NET core application. I tried following this, but it assumes VS2015 https://docs.efproject.net/en/latest/platforms/aspnetcore/existing-db.html. We don't have the package manager console in VSCode and I don't know if there is an equivalent to Scaffold-DbContext.
So how do I make a connection to SQLServer and how do I do things like EF migrations to update that database.
Answer: All the packages download can be done without the package installer, by using project.json and dotnet restore (if VSCode doesn't do it when project.json is saved).
With the tools installed, you can create migrations with dotnet ef migrations add <migration name> and dotnet ef database update to apply the migrations to the db schema.
Class libraries (where DbContext and models are defined in class library) are not supported yet. There is a workaround in the Entity Framework Core docs though.
For scaffolding the usage is dotnet ef dbcontext scaffold [arguments] [options]. See the Scaffolding docs for details.


Minecraft Update Dilemma

Question: I just got a recent Minecraft update for the Xbox 360 edition, but now when I attempt to enter my previous worlds, the device freezing and disregards any further passage into that world. Is there any way that I can fix or reverse the outcome of the update?
Answer: It is possible to delete the update, however this will delete all updates to all games, and can therefore can be fairly dangerous and is not recommended. Even after doing so, you will still be unable to use your world, unless it has only been played on Minecraft version 1.0.0 (ie you've never updated Minecraft previously). Also, you will be unable to play on Xbox Live until you update.
To delete ALL game updates (again, not recommended):
Settings > System > Storage > [Hover over Hard Drive] > Press Y > Clear system Cache
If you choose to try this, keep in mind that you will be unable to play on Xbox Live until you perform the update again.

Minecraft Update Dilemma


What would cause a drive shaft to snap in half?

Question: I drive a 2007 Ford Explorer XLT 4WD. I stopped at a stop sign and as I was turning right and starting to accelerate(Not very fast). I heard a loud noise and the car stopped moving forward. Turns out that the rear drive shaft has snapped in half. I was able to get the car on a trailer using the front wheels since its 4wd. The broken drive shaft came off fairly easily and it does not look like the U joints or any other visible part is broken. What should I be looking for that could be the cause of a snapped drive shaft. It seems odd that it would just snap on its own accord or because it got worn out. I know I have to replace the drive shaft itself however I do not want to find out that it will just break again because this is the symptom and not the cause.
Comment: is it possible you hit something (big rock off roading? ) Or maybe some dolt used it as a jacking point.  Any vibration etc prior to failure?
Comment: I had not felt any changes prior to the break. Unless it happened so gradually that I did not notice. I pretty much just drive it to work and the roads aren't very rough.
Comment: another thing to consider is if something else failed. Inspect your transmission mounts, etc.
Comment: Completely opinion, but that's some weak sauce right there. Not sure why Ford would design something so fragile ... it looks like my Tonka trucks from when I was a kid was built with better metal than this. Ugly.
Answer: All we can do it guess. IMO, though not easy to see, it appears the slip joint is corroded.
If the joint is not able to slide in and out as the suspension travels up and down, then it will put undue tensile stress on the joint. Once a crack forms, it is only a matter of time before it twists off.
Answer: I have only once seen a drive shaft snap.  The cause was traced to a faulty batch of steel.  The shaft had inclusions within the steel which reduced its strength.
Once found, the company issued a recall on the vehicle model.
This was back in the 1970s so I would hope modern quality control is a little better.  But it may be something for you to look for.
Comment: I bust several on my landrover - the cause : a 160bhp v8 on the original rover axles and 2wd. Then fitted a rangerover box into the swb 88" to have permanent 4wd and it was much more reliable...
Answer: Usually drive shaft issues can be attributed to aftermarket engine modifications (more torque) or tires (more traction, and thus a higher peak torque through the shaft). In both those cases slight twisting of the shaft near the failure point will be visible.
It's hard to diagnose from the photo, but I don't think that I see that tell-tale twisting other than the little bit that occurred as the crack propagated. Thus, I would assume this to be an issue with the shaft itself, possibly due to collision damage, and wouldn't hesitate to replace it with a well-inspected junkyard shaft. Save yourself the heavy diagnoses, but keep the old shaft to compare failures if the replacement shaft fails as well.
Additional things that should be inspected when a driveshaft fails include transmission and engine mounts, suspension and swaybar mounts, and of course the undercarriage and anything near the broken shaft (exhaust, fuel lines, brake line including the mechanical parking brake line).
Note that my experience in the matter is mostly with competition vehicles, not 4x4s.