What can I do about taekwondo knee pain?

Question: I am 17 years old and i am a girl. I really want to be a good taekwondo fighter, but not only a fighter. I love doing it more than I can say even if i am not that good. My left knee is so weak and painful when I do things like sitting, running, and kicks. I am having a hard time. Can any one please tell me what to do rather than stop doing it? I am really scared I do not want to stop doing taekwondo please.
Comment: You need to speak to a doctor or physiotherapist. Medical advice from the Internet shouldn't be trusted.
Answer: First off, I hear you. I was in your position once after my knee locked up in excruciating pain while running one day in my early 30's. I was training for a marathon. I went to see a medical doctor who specialized in sports medicine. I was really upset that I might be essentially cripple, and I really wanted to be able to run that marathon.
He diagnosed me with patellofemoral pain syndrome. And I was prescribed exercises to do at home to rehab and strengthen the knee. They really did help, but my knee will never be as good as it was in my teens. I'll never run a marathon, I don't think, but I can run a 10k just fine. There are limits.
The point is this: 1) See a medical doctor to get examined and diagnosed. 2) Get treatment and/or rehab. 3) You will probably realize that you will always have issues with your knees, but you'll be able to avoid the worst of the problems so long as you're careful and are aware of your limitations. Your doctor and/or rehab specialists will help you figure that out.
That being said, Taekwondo is particularly bad for knees. I have a black belt in TKD, by the way. And I actually blame my knee problems on my TKD training back in my teens. In particular, watch out for how far you extend your knees. You don't ever want to hyper-extend the knees (going further than lock position).
Pay attention to any slight pain your knees are feeling, and if you feel any, that's when you need to take a break immediately and have ice packs standing by (bring an insulated freezer bag with ice packs in it to every class). Your instructor will need to be told of your condition, and he/she has to be okay with you stepping out immediately.
I also recommend taking a week or two off whenever you feel pain, even if it's small, starting immediately after you feel it. Ice it up immediately. Give it rest. Don't go back the next day. Don't go back for at least one whole week. And don't practice kicks at home when you're supposed to be resting.
Your doctor and/or physical therapist will likely prescribe exercises you need to do at home. These will help strengthen your knee. You're going to need to do these exercises religiously, every day or every other day as is prescribed. And do them right before class. They'll provide a certain degree of immunity to most problems.
The exercises won't work perfectly. You'll still get knee problems if you go too hard or too long. That's okay. It's just about knowing your limitations, that's all. And at first, you won't know, so you're going to feel pain again. That's normal. That's just finding your limits. It takes time to figure those limits out.
There are so many conditions of the knee that you can have, by the way. Some are treatable with strengthening exercises like I mentioned. Others may require surgery. Others may require certain medications. You won't know until you're diagnosed. So you need to see an actual medical doctor who specializes in this.
Usually this would be under Sports Medicine or orthopedic medicine. You can also find doctors who specialize as knee surgeons. Any of those 3 specializations will work fine. Your family doctor can also do some basic tests, x-rays, and so forth, before referring you to a specialist. Ask your parents to set up an appointment as soon as possible.
Don't be scared. Worst thing that will happen is you find out what is going on and how it can be treated. You get to decide what to do after that.
Back to Taekwondo... After treatment, you'll be able to test your limits at home, practicing your kicks and such. And you can return to class and see how it goes. You'll know after that whether or not you can really keep on doing TKD or not. If you find that you're still feeling pain in TKD, my recommendation is to find another martial art to do, or find another sport or physical activity to do. It's not the end of the world, and you'll probably be just as into whatever you decide to do.
Hope that helps.


LIGO Gravitational waves detection

Question: During the detection of gravitational waves by LIGO machine, why wasn't the laser light used in the detection,  also stretched as a result of the stretching of space time fabric?
Comment: could you explain more?
Comment: Also see my answer to [LIGO discovery: if the space "time" metric is changed, how is it measured?](http://physics.stackexchange.com/questions/235556/ligo-discovery-if-the-space-time-metric-is-changed-how-is-it-measured/235803#235803)
Answer: Yes, it stretches and squeezes the light, i.e., the wavelength, and does tthe opposite (lowers and raises) the frequency, and keeps the speed of light the same. What the interferometer sees is that the light in the longer path (because that path was stretched) had to travel further, a peak took longer to arrive (in the stretch portion, the opposite in the squeeze).
So, say if a second Ray of light which did not see that stretching (keep to stretching, we mean alternatively stretching and sneezing in concert with the gravitational wave), and at some instant say it arrived at a peak, then the first one would not be at a peak, there would be a phase difference. The interferometer is sensitive to that phase difference. If that first one was at a trough, it'd cancel out with the second Ray.
The fact that the light going through the gravitational wave arrives a little later allows us to know that the gravitational wave was there. The wavelength is indeed stretched (and later squeezed), but the speed of light is the same, and so it arrives a little later (for a given phase)
In fact, of course, LIGO uses perpendicular legs, and when one is stretched the other one is squeezed, and it changes, so we see the changing phase difference as an electrical wave on the output.
This is answered and described in LIGOs FAQ at https://www.ligo.caltech.edu/page/faq
Comment: You have correctly given the standard argument as to why a gravitational wave effects the interference pattern.  But why did you assume the coordinate speed of light along the two axis was c ? The speed of light is invariant when looking into a frame related to yours by a Lorentz transformation (ie:  it leaves the Minkowski metric unchanged), but Schwarzschild (Shapiro delay) and gravitational waves  change the Minkowski metric and thus change the coordinate speeds of light.  In fact in just the right way so the wave fronts' times of flight are unchanged and the same along both arms.
Comment: What is your definition of time of flight? A certain peak leaving and arriving, or if not what?
Comment: Note that my answer is the same as the FAQ. They also state that c is constant. Btw, this is tricky, there's other previous answers on the site, and discussion.
Comment: So as it is said, it does not measure distances, but time differences of arrival of a peak
Comment: And for your ref., and others who might not have seen it, here is a presentation of the right heuristic way to think about it. See Saulson at https://www.aapt.org/doorway/tgrutalks/Saulson/SaulsonTalk-Teaching%20gravitational%20waves.pdf. He is/was one of the leaders at LIGO, said it took him years to get it right, though others knew how to do it right. Non-trivial, and everybody gets confused.
Comment: A light wave obeys $c=\nu\lambda$.  If the GW leaves c unchanged and increases/decreases $\lambda$ then $\nu$ must decrease/increase as you say in your answer.  Presumably, the laser output has been effected by the GW and the emitted light is same freq that is seen after the splitter mirror in the straight ahead arm of LIGO.  But how does an observer explain the physics of the splitter mirror that causes a different light freq to exit the splitter along the perpendicular arm of LIGO?  If the freq along the two arms must be the same, then c is different along the two arms.

LIGO Gravitational waves detection


How do I make my a77 go back to a single shutter click when I press the shutter release?

Question: Sony a77 camera. Has started clicking several times when I push shutter button and then display says "processing" for a few seconds. I would like for it to go back to a single shutter click and ready to take another pic. Can't seem to find answer in manual.
Comment: feel free to return and let us know if that is resolved
Answer: it sounds like camera is in "HDR" mode, taking several images and then combining into one, or in bracketing mode, taking several pictures with different exposure.
You can turn off HDR (manual pages 158) and bracketing in the menus (manual page 155)
You can also reset setting to factory default by doing (manual page 186)


Mismatch in the name

Question: My passport has the name "Apoorva Soorya Chandrashekar Shekhar." However, on my boarding pass, it says "Apoorva Aoorya Chandrasekhar."  I am traveling on a domestic flight; will this be a problem?
Comment: You should be okay, your name is really long and I'm sure they understand. 3 out of 4 parts are present which should be a close enough match.
Comment: To others: don't VTC as duplicate yet. Writing about it on meta.
Comment: It is already happened with may name. I have two surnames and sometimes, they put my first surname together my first name. I sure that you will not have problem.
Answer: So, if I understand you right, they did two mistakes:

missing second family name (Shekhar)
misspelled your (second) first name (Soorya -> Aoorya)

The missing family name is usually no problem at all, as long as any travel document you use (personal identification such as your passport) shows both names (has to mention the name which is shown on the ticket).
Regarding the misspelled first name it really depends. Usually, a simple "typo" as in your case is no problem at all. To be on the safe side I always suggest to simply get in contact with the company you are travelling with and confirm with them. But in my experience a typo is really no problem.
If your name showing on the ticket was completely different (Anna instead of Soorya), then it would most probably be difficult to explain. And the ticket could indeed be from a completely different person (which is the reasoning for having the name on the ticket in the first place, to make sure it is the intended person travelling, and not someone else).
So, to summarize:

missing family name: no problem at all.
typo in first name: should be no problem either.

Suggest to confirm with the airline. ;-)

Mismatch in the name


SPFX Command Set Apply view

Question:
I'm newbie in developing SPFX extensions. I'm trying to add a CommandSet that toggles the view in a list. For example, I want to assign for 'Command Two' event to view 'All items'. Is it possible to assign an event to switch saved displays in a Sharepoint List? Any idea how how can this be implemented?
Answer: Command Set is not suitable for changing the list view, It is something that will work on item level or item selection to run some custom code.
And it can be displayed in list menu and context menu.
It can be used with some scenario like.

Moving selected item to another list.
Display dialog on item selection for some type customization.

For changing the list view you can use out of box functionality.

SPFX Command Set Apply view


Can the M590E's boot pin be used to reduce power consumption?

Question: What does the boot pin actually do? Can it be used to reduce the module's power consumption when the module is not required? All recommendations are to pull it low to boot. Can it go hi again to turn off the module? Perhaps there are serial commands I should use to shut the module down when not required.
Comment: What does the data sheet tell you?
Comment: Can't find a datasheet of the M590E right now, but the boot pins I've come across were usually to select which way you want the chip to boot, so they are sampled once during start-up and have no effect on the operation of the chip later on. But implementations might differ of course.
Answer: It looks like to "BOOT" pin of the very common PCB for the module goes to the "ON/OFF" pin of the module itself. It looks like this pin can be held continuously low at power on and the module will power up and boot.  It appears to work like a switch that when you press it it pulls the pin low. The switch, if held for a while, toggles the power state of the module. There is also a power down command. I guess that I could use the power down command. (Its not clear if ON/OFF needs to be floating high to do this). I guess to wake it again I can let the BOOT pin float high for a while and then pull it low again, as though the switch was released and then pressed and held. I will try and remember to report back here if I get it working.


How do I discover the latest Android OS available for a device on a carrier?

Question: How do I discover the latest Android OS version available through standard support channels (no manual rooting or reflashing) for a device? In particular, I am interested in the Samsung Galaxy Note 3 for Verizon. Note, I am not interested in actually installing, just in finding what is available.
Comment: e.g. by checking [How do I update Android on my device?](http://android.stackexchange.com/q/13510/16575) (contains links to "when does my device get the X update). Alternatively: [Where can I find stock or custom ROMs for my Android device?](http://android.stackexchange.com/q/17152/16575)
Answer: If you're not rooting or manually flashing, just call Verizon, they'll tell you the latest version they have available.  It's almost certain to be the same that's already there, unless the device has been stored for a good while and thus kept from getting a pushed upgrade.


What is the term to describe when people words have veiled or alternate meanings?

Question: Sometimes people , especially people practicing covert aggression, tend to talk in highly ambiguous terms when interacting with someone , which leaves the other person wondering - were they really saying these things about me, or to me indirectly while seeming to talk about that other person or other thing or telling me this story, and it leaves the person under the verbal aggression in a confused state as to whether they were imagining the messages or the abuser really was talking about them. Somewhat like dog whistle, but done on a one on one basis. Is there a term in English for this?
Answer: One current term for this kind of agressive speech is coded language.  The term refers to the speaker's intent to conceal an often derogatory meaning while sharing that meaning with those who might share the speaker's prejudices.
Examples harvested from the free-range internet include
Vox (Feb. 2016) The sneaky language today's politicians use to get away with racism and sexism
Buzzfeed (Feb. 2015) 14 Words That Carry A Coded Meaning For Black People
Comment: I for one am not sure what programmerravi is asking but it certainly doesn't seem to have anything to with *enigma* or *coded language*. I'd think the question seems to be about psychology, not English, and words for the kind of language used might include *confusing* or *obscure*.
Answer: The website WordHippo is very helpful when you are searching for synonyms and antonyms.
I took the word enigmatic (which, by the way, is a good word for the phenomenon you describe) to WordHippo, and here is what I found:

ambiguous cryptic mysterious obscure unknowable dark Delphian doubtful enigmatical equivocal incomprehensible indecipherable inexplicable inscrutable occult oracular perplexing puzzling recondite secret sphinxlike stickling stumping teasing uncertain unfathomable unintelligible

I'm sure you can find at least one or more words which describe the seemingly covert aggression you describe.


In every ring with unity satisfying ACC, every ideal is finitely generated; can we prove it without assuming Axiom of choice?

Question: Assuming Zorn's lemma, we can prove that in every ring with unity satisfying Ascending-Chain-Condition, every ideal is finitely generated. Is this statement equivalent to Zorn's lemma? Can we prove it without assuming Axiom of choice?
Comment: I think it suffices to use axiom of dependent choice (abbreviated as DC). So you should not expect it to be as strong as Zorn's Lemma, which is strictly stronger than DC. I think a more suitable question you could ask is that if the statement equivalent to DC.
Comment: You've asked two questions which are somewhat similar, and both of them include nothing about your efforts to tackle this problem. At least in searching through standard literature or Google. Have you tries something like that?
Comment: As far as I know, it requires at least the denumerable axiom of choice.
Comment: @AsafKaragila : Both of the two questions came up while dealing with Ascending chain condition ( the prime  ideal question , while dealing with commutative rings ) in face while proving the equivalence of the very same statements as you have mentioned in your answer ...
Answer: If you look at the fourth section of Hodges paper,

Wilfrid Hodges, Six impossible rings, J. Algebra 31 (1974), 218--244.

He proves (Section 3, Th. 1) that the implication that you are asking for is not provable without the axiom of choice. Namely, the following chain of implications is irreversible without using Zorn's lemma:
$$\text{Every non-empty set of ideals has a maximal element}\implies\text{Every ideal is finitely generated}\implies\text{Every strictly increasing chain of ideals is finite}$$
Of course, one can note by looking at the usual proof that with the principle of dependent choice, we can prove these are indeed equivalent. So it is strictly weaker than the axiom of choice.


Are public accessors needed for an inner class, if only accessed from the outer class?

Question: Since i can access private variables of an inner class directly and ... the only way to access inner class is via the outer class .. is there any value in having public accessor/ mutator methods for an inner class?
public class Outer {
    Inner   i;

    Outer() {
        i.v = 5;
    }

    private class Inner {
        private int v;
    }
}

For the purposes of this question, assume that no lazy instantiation or other data manipulation is needed upon access.
Answer: Well, making the fields non-private would avoid synthetic methods being created to access those private members. In your example, the compiled Outer$Inner class contains a synthetic method like this:
static int access$002(Outer$Inner, int);
   Code:
      0: aload_0
      1: iload_1
      2: dup_x1
      3: putfield      #1                  // Field v:I
      6: ireturn

Maybe that will be inlined down to nothing, maybe it won't... but unless there's any reason to force its existence, why not just give v the default access?
As for using accessor methods rather than using the fields directly... that's more of a matter of taste. You can't prevent the outer class having direct access to the fields, so it's a little like asking whether you should create accessors for private fields within a class.
As mentioned in another answer, using accessors makes it more refactoring-friendly. Is the nested class just an implementation detail which will never need to move? If so, maybe that's fine. I find that if I've got a class like that which is just encapsulating fields with no other behaviour, I make the fields public (within a private class, don't forget) to advertise "Hey, I'm not checking anything here..."
Comment: Really? I thought the compiler will always create the synthetic method for inner classes.
Comment: @emory: Not if the access is allowed without any synthetics being required. At least, not the version of javac I'm running :)
Answer: If at some later point you might expose your Inner object thru a function call or in some other way, then yes it is important. It might also be important for synchronization purposes, depending on what's going on in your Inner class


rails-3-jquery autocomplete not working with nested models

Question: my autocomplete functionality using the gem https://github.com/crowdint/rails3-jquery-autocomplete is not working. When I try to work with autocomplete in isolation (only one model) it works.
Here is my controller :-
autocomplete :location, :name

Model :-
belongs_to :location

View :-
 = fields_for @event.location do |location|

    = location.autocomplete_field :name, autocomplete_location_name_events_path, :placeholder => "Enter the name of the location"

routes :-
resources :events do
    get :autocomplete_location_name, :on => :collection
end

application.js.cofee
#= require autocomplete-rails

I am not able to debug properly either as to know what exactly is the issue.
Answer: Try
Routes:
get 'events/autocomplete_location_name'

View:
fields_for :location do |location|
location.autocomplete_field :name, events_autocomplete_location_name, :placeholder => "Enter the name of the location"


Using a dimmer on a light plugged in to a receptacle

Question: My home is 42 years old. The kitchen lighting consists of 2 48" fluorescent shop lights each plugged into a normal 110v receptable. It uses a standard, 1 way, on/off switch. I want to convert from fluorescent to incandescent and still use the plug. I intend to use a 6 light incandescent vanity bar and low wattage (25w or 40w bulbs). However, since there will not be any other type of fixture being plugged into that receptacle except the incandescent light bar, can I use a dimmer switch without hard wiring the fixture? can I use the plug/receptacle? The circuit uses a 15A circuit breaker. I do not want to violate and electrical building codes.
Comment: [Lamp Dimmers](https://images-na.ssl-images-amazon.com/images/I/41gCDoU%2BjoL.jpg) are a common solution to dimming a plugged in light.  I have these on a few lamps and they work great for me.
Answer: No, you can't do that. It sounds great until the first time you are short a receptacle and plug in something else - perhaps a vacuum cleaner. And have big problems. Or to give a really bad scenario - your regular receptacle circuits in the kitchen are out but the lighting circuit is working so you move your refrigerator to the "oops, still dimmed" ceiling receptacle on an extension cord until the electrician can get to you...by which time your food has spoiled and your refrigerator ruined.
According to this reference there is a way to do it. But I don't recommend it.
It is usually not that hard to rewire the switch so that it controls a direct (hardwired) lighting fixture instead of a receptacle and change the receptacle to be always on. That is the first step for many people when they buy a house and find that all the light switches control receptacles instead of ceiling fixtures.
It is also very easy (no new wiring involved) to convert a ceiling receptacle to a hardwired light fixture, which would work well for your situation.
But the bigger question is: Why are you switching from fluorescent to incandescent?
You should be switching to LEDs. A LED bulb roughly equivalent to a 40W incandescent (and much brighter than a 25W incandescent) will use around 6W. Plus you'll be replacing incandescent bulbs on a regular basis while the LEDs will last for years. Just make sure you get dimmable LEDs - not all of them are dimmable.
You should also make sure you get enough light. Your 2 48" fluorescent bulbs (if you actually have 2 bulbs in each fixture then the numbers here all get doubled, but I'd actually agree that's more light than you need for a typical kitchen, so I'll stick with the 2 48" bulb scenario) are producing about 2400 lumens each for a total of 4800 lumens. Each 40W incandescent or 6W LED will produce about 450 lumens for a total of 2700 lumens - a little more than half the light. While you may think the current light is too bright, a lot of light is a good thing in a kitchen and the dimmer can give you less light but it can't (obviously) give you more. If you're stuck on screw-in bulbs in a light bar, then something like 12.5W, 75W equivalent, 1100 lumens will do quite nicely. 6 x 1100 = 6600 (more than you have now), total power at full brightness = 6 x 12.5 = 75W (that's less than 2 of your incandescent bulbs) and dimmable so you can lower the light when you want to.
Based on comments, the issue here is more than just making the lights dimmable. There are issues of light quality. Traditional fluorescent "work lights" are relatively poor quality and bother many people due to:

flickering
brightness
color temperature

The flickering can be solved very easily with most other lighting technologies, including incandescent, halogen, LED and even more modern fluorescent fixtures.
The brightness problem can be solved, obviously, with a dimmer. I do recommend a dimmer for this situation as it allows for dim light for those who need it and bright light for more typical users. Working in a relatively dark kitchen is fine when you're pouring a cup of coffee. But if you're working on a Thanksgiving feast with chopping & mixing & cooking & baking & 3 people running around, a bit of extra light is very helpful.
Color temperature, CRI and other qualitative factors of a lighting technology have also been dramatically improved with the latest fluorescent and LED bulbs.
Recommendation:

Convert the plug-in fixture to a hardwired multi-bulb (Edison base) fixture

For the average user, I would pick a reasonable-looking LED fixture (i.e., not screw-in bulbs). In your situation since you have serious concerns about light quality, screw-in bulbs provide total flexibility.

Install a LED-compatible dimmer switch. Even if you don't end up using LED bulbs now (but please try - some of them are really good!), that will allow flexibility for any future user. Check the specs carefully - most LED-compatible dimmers are also compatible with a reasonable load of incandescent lighting as well.
Go to a lighting store or a big box store with a decent lighting department and compare light color/quality of the available options.
Comment: thank you...the change is due to neurological problem of my wife. She can not handle fluorescent lights nor their brightness. Thus, dimmer on incandescent, which are warmer and has no ill effects on her. Don't mind the inconvenience of changing bulbs. She also has problems with LEDs...again, extreme sensitivity. I noticed a couple of typos...should be 115v & 15a ... Again, thanks for the input. By the way, The receptable is in an enclosed ceiling light box not accessible for anything but the ceiling lights.
Comment: Standard fluorescent bulbs used to be quite harsh. But there are newer bulbs available with warmer color. But most not dimmable. But a good quality LED with the right color may work much better than you'd expect. At my local home depot they have a wide variety on display and you can really see a difference. Back to the dimming receptacle: it is really straightforward to convert a receptacle ceiling box to use for a hardwired light.
Comment: thanks, again...I'm reviewing all possibilities and haven't made my final decision. The total lumens isn't an issue. Right now the fluorescent lights are unplugged so we have '0' lumens except for a single recessed 40w bulb over the sink. I was 'brain storming' with the dimmer & vanity bar  approach. thx...
Comment: Modern electronic fluorescent ballasts will take care of flickering and difficult starting, and modern tubes take care of the harshness.  Except some people are superstitious, so it doesn't matter to them that LEDs and fluorescents have improved dramatically, they will have the same effect. That said, fluorecents and LEDs are very efficient, so two dual 40W fluorescent is a **gigantic amount of light** akin to 1000W of incandescent.  It's for task lighting not living space lighting.  So she isn't being *that* sensitive
Comment: Early LEDs were krap when it comes to color temperature and CRI, as are many dollar store LEDs *to this day*...  I use a quality $15 GE 50/150/100 LED that is indistinguishable from incandescent.
Comment: There are also LED bulbs that dim to a warm yellow.   Together with a C-L dimmer this is a good way to go, **if and only if** you hardwire the fixture, and remove the receptacle.  It's not okay to dim a receptacle, for all the reasons others have stated.
Comment: @Frank -- *what* parameter is she sensitive to? flicker? color spectrum? (for ex. being sensitive to blue)
Answer: You're not allowed to dim receptacles, because dimmers put out a really weird wave shape (so they can be cheap).  Dimming something other than a dimmable lamp can cause a lot of damage to equipment and can even cause a fire.  It can't be "something you remember" because you're not allowed to build a house with dangerous secrets only you know.  Doesn't work for guests, tenants, First Responders and the next person who will own the home.
There is one exception; you are allowed to use special receptacles keyed so normal equipment cannot be plugged into it. This requires the lamp(s) get new plugs keyed to fit in the special sockets (and they can also fit normal sockets).
However, due to the weird wave shape, dimmed incandescents can be more flickerey than fluorescents...
... and by the way, if she can see fluorescent flicker, then either she's The Flash, or you are using obsolete fluorescent ballasts (the kind that hum).  Upgrade to modern ballasts and lamps and everything that is objectionable about fluorescents just goes away.
Answer: If you have a switch controlled receptacle that is then used to power a plug in lighting load you really need to keep the wiring infrastructure as it is. This has already been described in detail.
If you want to be able to have capability to dim the plug in lighting the way to achieve that is to acquire a plug in lamp dimmer. There are a quite a few options available for these now that there is smart technology at play. A plug in module of this sort can even be placed in an inconvenient location and operated remotely via a smart phone or voice assist unit.


How should I bake a cake in a rice cooker with no cake setting?

Question: I've found several online recipes for baking cakes in a rice cooker; they all assume a rice cooker with a "Cake" setting that allows you to specify a cooking time. My rice cooker has settings for white rice, brown rice, congee, etc., etc., but no cake setting. I assume there's a workaround out there. Is there a specific setting that's best to use (e.g., brown rice as opposed to white, or whatever)?
Answer: I've seen a youtube video that does it with what looks like a cheap rice cooker.
I think that you need to experiment and test to see how long it will take to cook; every rice cooker will be different.
Use a wooden pick and test, it should come out dry(ish).
good luck
Comment: "Clean" is the usual terminology I'm familiar with for the toothpick test - It either comes out with batter and/or crumbs stuck to it (keep on cooking) or it comes out "clean" with nothing stuck to it. It has saved me from some very badly written or edited recipes (chocolate cake that kept coming out soup, doing everything as specified, very carefully. Tasty chocolate soup, but not cake. Ignore the recipe time and cook until clean toothpick - *et voilà!* Cake.)


Can my employer ask LinkedIn to delete posts of mine?

Question: Let's assume my LinkedIn account shows the name of my current employer (as most accounts do). Can the employer ask LinkedIn to delete posts of mine which they don't want to see associated with the company? Can they do this even if the posts are by no means offending or inappropriate? Does this right differ by country?
Comment: Probably not. Imagine if one person could request to have another person's content modified or removed and imaging if LinkedIn would honor such a request. Your employer has no legal authority to have LinkedIn do anything with your posts. They can ask, but it's highly doubtful that LinkedIn would comply.
Comment: Rather than contacting LinkedIn, I feel like any company would go directly to you during cases like these and ask you to take down those posts. Though you'd have to have posted something really concerning to the company for them to want it taken down.
Comment: OT, but as a contractor I never have the current client on there. I've been burnt in the past with scummy recruiters phoning them up to offer their own contractors more cheaply or actually and falsely disparaging me.
Comment: Have you observed posts of your own being deleted on LinkedIn?  Have you checked with anyone other than yourself to confirm that they are not offensive or inappropriate?  (Most people don't usually decide to post something they themselves realize will be offensive.)  Assuming this is the case, what leads you to believe it was your employer who requested they be deleted?
Answer: They can certainly ask. Whether or not LinkedIn will comply, only LinkedIn can say for sure. Or waiting to see.
But, since your employer objects to these posts, do you really want to upset them?
Remove the posts yourself, apologizing is not necessary, but would not hurt.
Then ask you employer for a clear, written policy on what you may post when their name is visible and will appear to be associated with it.
Comment: Also: figure out who wants you post removed and talk to them. A written pollicy is all good and well but if this is someone up high enough it is better to go and have a dialog
Comment: @Gianluca any sensible policy includes a "at discretion of management" clause so playing rules lawyer will get you nowhere.
Comment: @Mawg, really depends on company culture but if you have a boss like that, yeah, no explanation needed.
Comment: I upvoted your comment, but am really in two minds. If my M.D wants my post gone, he probably just wants it gone & not to have a chat with underlings. I guess I depends on your knowledge of whomever it was.
Comment: You should ask the employer for a written policy **before** removing the posts. And if the posts are not against a written policy you should not remove them. If the employer insist, you should update my CV and begin looking for a new job since in this case you are working for a employer that does not follow the rules **he** wrote, which IMHO is a big red flag.
Comment: @Borgh maybe. But never found it. Every time I have to accept a policy, it was very specific without any space for interpretation. Such clause can be easily used against the employer.
Answer: Absent legal weight behind the request or breaking of Terms Of Service, it is unlikely that LinkedIn will simply delete the content of other people at someone else's request.
Deleting something simply because another company doesn't like it will ultimately have a chilling effect on the rest of the site userbase. This can get people to leave in droves and promote the use of competitors. As such, LinkedIn doesn't even do this for Microsoft, the current owners of LinkedIn.
The employer can potentially get it deleted under a legal objection, but LinkedIn is no YouTube in that not everything is 100% automated and customer services do exist, so such a legal challenge is not automatically guaranteed and may need actual weight behind it beyond a claim.
Answer: They can try...
In practice, it'll be difficult and your employer would need to provide a very good reason for wanting your content to be edited.
LinkedIn's editing policy will be governed by LinkedIn, so you'll need to ask them directly, or use the official support forum to ask this question.


Income tax: Developer working from home office for foreign company

Question: Where should an income be taxed if a developer (programmer) works from his home office in the Czech Republic for a company incorporated in Malta? The company sells a global service worldwide.
Comment: Generally in the Czech Republic.  Some European countries require independent contractors to set up a company of their own, making the transaction a business-to-business transaction and relieving the Maltese company of the burden of managing compliance with Czech employment law, but I don't know anything about how the Czech Republic handles situations like this.
Answer: You pay income tax in the country you are doing the work, so in your case you will have to pay Czech tax.
This is a general thing that is argued also for businesses. There is more specific info on the European Union websites:

... You will always be subject to the tax rules of your country of residence, you may also have to pay taxes in the other country.
Source:
http://europa.eu/youreurope/citizens/work/taxes/double-taxation/index_en.htm

Each country has its own definition of tax residence; yet:

You will usually be considered tax-resident in the country where you spend more than 6 months a year
If you spend less than 6 months a year in another EU country, you will normally remain tax-resident in your home country"

Source:
http://europa.eu/youreurope/citizens/work/taxes/income-taxes-abroad/index_en.htm
Comment: Do you have legal authority that backs up that statement?
Comment: Let's say the Czech Republic agrees, and Malta says you pay tax where your employer pays you, that is Malta, then you have a problem.
Answer: I don't know if the question is still relevant. You don't tax the income per se, but only income actually transferred to the account in the Czech Republic. Hence, it all depends on whether your employer or client (are you a freelancing individual or an employee?) transfers your pay into an account in the Czech Republic directly or you transfer from Malta on demand.
In any case, tax residency applies, so once you reach over 6 months in the county, your income is subject to tax. However, income is understood as what is brought to the country from abroad in this case.


Is nag.sty authoritative for LaTeX?

Question: I just (re?)discovered nag.sty.  is this a (TUG-endorsed?) authoritative tool to get all of us away from non-recommended use of latex, or just the work of the author?  given that latex never seems to deprecate packages, voluntary standards  may be a way forward.  (I love tools that tighten up the syntax of latex documents, especially if they could help me maintain externally-parseable documents.)
Comment: It's not necessary to sign your questions (as [there is already a box with your username below it](http://tex.stackexchange.com/faq#signatures)) or to begin them with a greeting.
Comment: A tip: If you [indent lines by 4 spaces](http://meta.tex.stackexchange.com/q/1192) or [enclose words in backticks `\``](http://meta.tex.stackexchange.com/q/863), they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).
Answer: nag is a contributed package like most others, it has no special standing. But TUG doesn't endorse packages anyway (LaTeX itself isn't endorsed by TUG either for that matter). LaTeX (that is, the members of the latex 3 project responsible for maintaining LaTeX) can't really deprecate any packages except any they have written themselves (and even deprecating those can be hard).
Comment: big pity...I wish we had authoritative style guides and checkers in the midst of obsolete packages and guides all over the web.
Comment: @ivoWelch you could say the latex book is the authoritative statement of latex syntax, but since the point of packages is to extend the syntax, and the design of latex tries to make it easy to be extended  with packages, this doesn't really help.
Answer: I only discovered nag recently and so read the documentation not long ago.
I think the question is not whether nag is 'just the work of the author' or whether it has some sort of institutional backing. nag is authoritative insofar as the reasons for its complaints are good ones. These are things you can assess for yourself since they are thoroughly documented.
First, the l2tabu option complains about deprecated coding as listed in the document of the same name. These concern changes from LaTeX 2.09 to LaTeX2e. As such, the reasons for thinking the new commands improvements over the old ones are set out in that document. Whether nag's complaints should be regarded as authoritative is a question of assessing those reasons in this case.
Second, nag's documentation is explicit: it will complain about things which are really perfectly fine and it will not complain about some things which are not. So some of its complaints are necessarily ones you have to make a judgement about. For example, it will complain about the use of \def rather than \newcommand but adds that if you know why you need the former, the complaint probably doesn't apply to you. This is because although \newcommand is preferable when it can do the job, it cannot always do the job. Sometimes, you need to use the lower level commands. If you know why, you probably also know the risks. If, on the other hand, you are using \def without knowing why or considering the risks, probably you shouldn't be doing it.
Other options to nag, such as orthodox, are in a slightly different category since there is nothing technically wrong with their use. They just are probably not what you wanted, so nag is just, in a sense, making it easier to figure out why your code doesn't work as expected.
Answer: No, it's not authoritative by a long shot. (I think I would know that. ;) )
It's just one in a series of tools around that topic, along with, for example Markus Kohm's texidate, with the single benefit that it runs within your code, offline.
Comment: Could you update the link to Markus Kohm texidate? This one above no longer works.

Is nag.sty authoritative for LaTeX?


Windows 8 not seeing new SATA HDD

Question: I just purchased a new Dell Inspiron 660 with Windows 8. Tried to install a new Seagate 3T HDD. Windows disk manager does not see the HDD. The HDD is seen by the BIOS. I can change SATA ports and the BIOS will see the change. I just can't get Windows disk manager to see the drive. Any help appreciated
Answer: This is most likely due to the 3TB size. Even if you could see it, it probably would show up as 746GB drive. Use GParted live CD to partition and format it first.
Comment: So you're saying Windows 8 cannot handle 3 TB Advanced Format/GPT drives? Windows 7 seems to handle them just fine on my system.
Comment: I don't think it has anything to do with Windows 8 or 7. Windows 8 would see the drive if Windows 7 could see it (assuming the same machine). When it comes to 2+TB drives there are a lot of things that can be problematic. It is best to use tool like GParted to initialize the drive. In one instance I could not get Windows to report more than 746GB while after formatting with GParted everything worked just fine and Windows also reported full 3TB. If GParted also doesn't see the drive, we can be certain that it is something in the BIOS or MOBO.
Comment: What did you format it as? Workarounds are fine, but I'm interested in knowing why exactly a modern OS released in 2012 is having problems with 3+TB drives, and under what conditions (since it obviously doesn't seem to happen always). Maybe the way it comes pre-partitioned/pre-formatted from the manufacturer (in case of externals at least) causes issues?
Comment: It was bare drive so no prior formatting. I formatted it as NTFS single volume.

Windows 8 not seeing new SATA HDD


Reverse geocoding problem

Question:

I did an address locator on ArcMap and I published the geocode service on ArcGIS Server. When entering the long/lat I got the address but when trying the reverse geocode it didn't get the address.
Comment: Could you please add the error message as text, not picture?
Comment: I'm not familiar with these tool but I wonder what the Output Spatial reference (4326) do when you request an adresse (or should it be Input Spatial reference) ? Also if you work in a geographic CRS are you sure that the distance parameter is not interpreted as degree ?
Answer:
As per the following documentation, the search tolerance is only 10 meters https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm#ESRI_SECTION1_38FA9E7038A64F54B34EB9CCBBCC92AD
You are attempting to pass a "distance" parameter with the request to increase this search tolerance, however, "distance" is not a supported parameter for ReverseGeocode requests.
The distance parameter is deprecated and no longer recognized by the geocoding service.
Comment: i modified the distance params but i still have the same problem,, while when i do the same work with the web Mercator projection it works

Reverse geocoding problem


Does Python have a stack/heap and how is memory managed?

Question: How are variables and memory managed in Python? Does it have a stack and a heap and what algorithm is used to manage memory? Given this knowledge are there any recommendations on memory management for large number/data crunching?
Comment: You might want to have a read of the following two:

http://foobarnbaz.com/2012/07/08/understanding-python-variables/
http://docs.python.org/2/c-api/memory.html
Comment: Is there some specific issue with Python var/memory management that you are having a problem with and is not trivially discovered by the Python documentation and/or Googling?
Answer:
How are variables and memory managed in Python.

Automagically! No, really, you just create an object and the Python Virtual Machine handles the memory needed and where it shall be placed in the memory layout.

Does it have a stack and a heap and what algorithm is used to manage
  memory?

When we are talking about CPython it uses a private heap for storing objects. From the CPython C API documentation:

Memory management in Python involves a private heap containing all
  Python objects and data structures. The management of this private
  heap is ensured internally by the Python memory manager. The Python
  memory manager has different components which deal with various
  dynamic storage management aspects, like sharing, segmentation,
  preallocation or caching.

Memory reclamation is mostly handled by reference counting. That is, the Python VM keeps an internal journal of how many references refer to an object, and automatically garbage collects it when there are no more references referring to it. In addition, there is a mechanism to break circular references (which reference counting can't handle) by detecting unreachable "islands" of objects, somewhat in reverse of traditional GC algorithms that try to find all the reachable objects.
NOTE: Please keep in mind that this information is CPython specific. Other python implementations, such as pypy, iron python, jython and others may differ from one another and from CPython when it comes to their implementation specifics. To understand that better, it may help to understand that there is a difference between Python the semantics (the language) and the underlying implementation

Given this knowledge are there any recommendations on memory management for large number/data crunching?

Now I can not speak about this, but I am sure that NumPy (the most popular python library for number crunching) has mechanisms that handle memory consumption gracefully.
If you would like to know more about Python's Internals take a look at these resources:

Stepping through CPython (video)
A presentation about the internals of the Python Virtual Machine
In true hacker spirit, the CPython Object Allocator source code
Comment: Good of you you stress the distinction of Python vs CPython ;)
Comment: Note that *local variables* will have the actual variables stored in the equivalent of a stack frame.
Comment: Python isn't Java; it doesn't have a virtual machine; it has an interpreter. It may seem pedantic to point this out but they are two different paradigms and the difference has important implications for how code is compiled and run. https://stackoverflow.com/questions/441824/java-virtual-machine-vs-python-interpreter-parlance
Comment: @Apollo2020 The Cpython interpreter contains within itself its own virtual machine implementation, so yes, it is a VM, you're right that it isn't the JVM, but it is still a VM. At runtime, all your python code will be first "compiled" into bytecode native to the Cpython VM, that is why `.pyc` files exist, they are bytecode for the Cpython VM which has been saved in a file to save the need to re-compile it.
Comment: NumPy is simply a wrapper for native LAPack (IE OpenBLAS,MKL) which has its own memory managment outside of CPython. This is 100% a requirement because the python VM's reference-counting operations are not atomic and therefore not thread-safe (which is why the GIL exists). If Numpy used Cpython's memory management under the hood, it would be terribly slow because it would be GIL-bound could not parallelize numerical operations.
Comment: @Apollo2020 Also, python is not a runtime or interpreter, it is a language. The interpreters are just applications that parse your python code into an AST, then use that AST to emit bytecode for whatever runtime is being used (`.pyc` for CPython, probably `.CLASS` for Jython, because `.CLASS` files are the bytecode of the JVM). Even Pypy eventually emits bytecode to run on LLVM (also uses another intermediate representation in between).
Answer: Python doesn't have any such thing.
Python is the language and does not specify how exactly implementations must achieve the semantics defined by Python the language.
Every implementation (CPython, PyPy, IronPython, Stackless, Jython...) is free to do its own thing!
In CPython, all objects live on the heap:

Memory management in Python involves a private heap containing all Python objects and data structures.1

The CPython virtual machine is stack based:
>>> def g():
    x = 1
    y = 2
    return f(x, y)

>>> import dis
>>> dis.dis(g)
  2           0 LOAD_CONST           1 (1) # Push 1 onto the stack
              3 STORE_FAST           0 (x) # Stores top of stack into local var x

  3           6 LOAD_CONST           2 (2) # Push 2 onto stack
              9 STORE_FAST           1 (y) # Store TOS into local var y

  4          12 LOAD_GLOBAL          0 (f) # Push f onto stack
             15 LOAD_FAST            0 (x) # Push x onto stack
             18 LOAD_FAST            1 (y) # Push y onto stack
             21 CALL_FUNCTION        2     # Execute function with 2
                                           # f's return value is pushed on stack
             24 RETURN_VALUE               # Return TOS to caller (result of f)

Keep in mind, that this is CPython specific. The stack does not contain the actual values though, it keeps references to those objects.
1: Source


Is there a problem with a media enclosure box in a laundry room?

Question: Looked at a home where the media enclosure box is in the laundry room. Is that ok?
Particularly, I'm unsure if there's an issue about moisture being near wiring.
Comment: If the laundry room is that wet, there's a problem that has nothing to do with the data wiring. If there is hardware (router, switch) the stray lint might be an issue more concerning. If it's just wiring, not a big concern.
Comment: Such moisture would cause larger mold issues than harm to electronics, which typically don't mind humidity, even in excess.
Comment: Does mains power come into this box?
Answer: A standard laundry room inside a home is normally classified as a dry location. Sheetrock on the walls? This is a clue it is dry as defined by code.  There can be a washer or a basin directly adjacent to a breaker box. An outlet would need to be GFCI protected.
Other than a clothes closet and a bathroom your panel can go just about anyplace that has a 30" wide space floor to ceiling. Although you are asking about your media box it has less restrictions. Receptacles in a garage now require GFCI protection if you have line powered devices. If the house is older it may not have GFCI protection.


What is the best way to show a user that a social media account is linked?

Question: I am working on a profile page where user can link their social media account (Twitter, Facebook. etc.) But what is the best way to show a user that his account is linked? Like a checkmark or something else?
Answer: I'd suggest to remove the Connect button like above and change it to an unlink button. Show them the linked account id and provide an Unlink button next to it.

In case you don't have an unlink option (which would be a bad idea), just don't show the linked option at all.
Comment: Good answer, but if there's not an unlink option (which I agree, there should be), I'd suggest just indicating that it *is* linked already, perhaps by showing it in a disabled state with some text indicating it has already been linked. This would communicate that it is an available option that has already been done, instead of making making it look like it's just not an option anymore.
Comment: @maxathousand Agreed


Magento Encoding Scripts on the Fly and Generating Download Link

Question: I am thinking about selling Magento modules on my website and need your advise what would be the best way to do it.
Here is what I thought:

Install Magento store on my website
When client purchase the module from my store - he is required to enter his domain name
If order is successfully processed and payment is received - Magento or standalone script encode purchased module using ionCube or Zend Guard "On-The-Fly" and generates license to work on provided domain name only.

Is there a script that can do all of this? Or should I write my own code? What do you think about encoding scripts in order to protect your work?
Any thoughts and suggestions are welcome.
Thanks
Answer: This is really a matter of opinion and debat-able, however below is my feeling towards such:

Disadvantages of encrypting your code:

Obviously: It is (almost) impossible to modify or extend for custom
  needs, without having to contact the original developer which adds
  more cost to your end user as well as causing more time for "custom"
  development.
3rd party server software like Zend Optimizer is needed
  in order to execute the encrypted code.  Which can be a headache by
  itself.
Confusion during transfer for binary and text data, ultimately
  corrupting your binary encrypted data.
It is impossible to have others
  contribute to your code to improve it, and/or help with bug finding
  and fixes.
As a store owner or maintainer I'm less confident you are
  not utilizing any of my data collected from my stores.
Maintenance
  becomes chaotic.  Having to re-encrypt every release, can be quite
  pain staking.  This is especially true if you have a bug fix that
  needs to be offered to all of your customers using it – however, the
  ones with "Custom" versions will require re-encryption for all.
  Unless your using some kind of release management that handles this
  automatically for you.  Most don't I'm sure.

Full article: http://www.molotovbliss.com/magento-module-developers-stop-encrypting-and-domain-jailing
With that said, I've changed my mind on phone home calls.  Since I've posted this article.
I'm okay with modules making phone calls home to a developers site to check for licensing, if you have a simple observer that did such and was done properly (By properly I mean don't break my site because your phone home server is down, and don't make my end users wait for the validation), I wouldn't see any problem with obfuscating this portion of code as long as it didn't interfere with the modules overall functionality, i.e., it is strictly there for checking a license, no module functionality encrypted.  I believe Boris (unigry) does such and works well, even though I've had to jump through many hoops at times to get ionCube loader working on different environments, so this still something to consider not doing, and just having hope in peoples integrity and honesty to not pirate.
With that said, domain wide acceptance should be standard, I shouldn't need to send in support requests to get my subdomain added to your white list of domains.  Personally if you can obfuscate and encode without the need of an apache/php module is a huge plus.  General end users won't know where to remove such code at times.
To answer your question, a home brew script and process would be ideal, as using a cookie cutter solution would be easier to reverse engineer.


Use polar complex numbers to find multiplicative inverse

Question: Use the polar form of complex numbers to show that every complex number $z\neq0$ has multiplicative inverse $z^{-1}$.
If $z=a+bi$, then the polar form is $z=r(cos(\alpha))+i(sin(\alpha))$.
I can do it, not using polar coordinates:
Let $z=a+ib$.
Since $1+0i$ is the multiplicative identity, if $x+iy$ is the multiplicative inverse of $z=a+ib$, then $(a+ib)(x+iy)=1+i0$ $\Rightarrow$ $(ax-by)+i(ay+bx)=1+i0$ $\Rightarrow$ $ax-by=1bx+ay=0$ $\Rightarrow$ $x=\frac{a}{a^2+b^2}$, $y=\frac{-b}{a^2+b^2}$, if $a^2+b^2\neq0$.
The multiplicative inverse of $a+ib$ is therefore $\frac{a}{a^2+b^2} +i\frac{-b}{a^2+b^2}$.
Now, should I use this same process and just replace $z=a+ib$ with $z=r(cos(\alpha))+i(sin(\alpha))$??  Or is there another way to go about this process?
Comment: what is cool is that $\frac{1}{r (\cos(\alpha)+i\sin(\alpha))} = \frac{\cos(-\alpha) +i\sin(-\alpha)}{r}$ is true even when $\alpha$ and $r$ are complex numbers
Answer: Most of the time complex numbers are introduced using $z=a+i b$ along with the basic addition rule and some more complicated multiplication rules.  But really, it is much more natural to think of them in polar coordinates when doing multiplication; especially if you keep them in the form $z=r e^{i \phi}$.
You're right to start with the multiplicative identity $1 \cdot z=z$.  If we look at the unit circle, $1=1+i(0)$, and look what is happening when we multiply by $z$ we see two things: the radius changes from $1\rightarrow r$, and the angle rotates from $0\rightarrow \phi$.

Therefore, to find inverse we need to find some $z'$ such that $1 \cdot z \cdot z'=1$.  This $z'$ operation will also be a scaling and a rotation operation, but in this case, what angle should you rotate by, and what value should you scale by, to return to 1?
Once this concept clicks, you can really see that $z=r e^{i \phi}$ is the natural choice for complex multiplication, and makes it almost as easy as $z=a+ib$ for complex addition.
Answer: Yes, you can directly check that inverse of $r(\cos \alpha +i\sin \alpha)$ is $\frac{1}{r}(\cos \alpha - i \sin \alpha)$ (try to multiply them and use $\sin^2 \alpha+\cos^2 \alpha=1$).


Dependency Property "cascade" binding

Question: I'm rather new to WPF/XAML and I've encountered a problem which I'm not sure how to get around.
I'm going to describe my problem using an example. I need to develop an app, which will display tennis courts together with player photos and names on these courts. I created two user controls: TennisCourt and TennisPlayer. The TennisCourt control contains 4 instances of TennisPlayer control.
TennisPlayer has a DP of type Player, which contains the player's name and photo.
TennisCourt has 4 DPs of type Player: Player1, Player2, Player3, Player4.
Each TennisPlayer instance has its Player dependency property bound to one of the Player1..4 dependency properties of the containing CourtControl.
My ViewModel has several objects of type Player, and of course implements INotifyPropertyChanged. Whenever any of the players gets updated, OnPropertyChanged gets called.
My problem now is: when I create the player objects in my VM, OnPropertyChanged gets called, and it travels throughout: VM -> TennisCourt.PlayerX -> TennisPlayer.Player. This works fine the first time I call it. However, the player photos are being obtained asynchronously, and after that operation finishes, the OnPropertyChanged for each player object in VM is called again.
Now, after doing some tests I noticed, that the first control in the line (TennisCourt) does receive the PropertyChanged notification, and it obtains the object from VM again. However, since the Player object did not actually change (the reference is to the same object, it's just a field in the object that changed), the TennisCourt.PlayerX property does not seem to be raising its built in OnPropertyChanged event, so the binding TennisCourt.PlayerX -> TennisPlayer.Player does not have any effect, and the TennisPlayer.Player field doesn't get updated. If I decide to actually change the Player object in VM it does update, but that's not what I want to do.
Am I doing anything wrong? Is such cascade binding not a good practice? At first my TennisCourt did not have any DPs, and each TennisPlayer.Player was bound directly to a VM.Player. This worked perfectly well until I created a second instance of TennisCourt and wanted it to show different players.
Comment: pls post your xaml for the usercontrol bindings
Answer: DependancyProperty is static so all instances of your court would get the same property.
Answer: use simply properties with INotifyPropertyChanged and no dependency properties.

Dependency Property "cascade" binding


LXDE ubuntu 17.04 - The use of dead keys to type accents does not seem to work

Question: The use of dead keys to type accents does not seem to work in any progam. I have physical keyboard MICROSOFT NATURAL (English) and languages installed Portuguese (Brasil) and English (USA). For example typing ' then c , or any accent with the layout 'international with dead keys' leads to a character without accent. Ibus is activated, and deactivating it does not solve the issue.
Comment: One idea: Can you create an additional user for test purposes, log in as that user, and check if the issue is present for that user too?
Comment: I have the same problem with Ubuntu MATE 17.04
Answer: Lucas Simon's solution worked perfectly in my Lubuntu 18.04.1 .
As I don't normally login as root, I opened an LXTerminal and ran the sudo variant of Lucas Simon's command line:
sudo apt install ibus && ibus-setup --xim

This quickly downloaded & installed some ibus packages, after which all my dead key accents immediately worked as intended - no further steps were needed, and I didn't even need to restart anything.
Answer: I have the same problem in Lubuntu 17.07. my keyboard is PT_BR ABNT2 layout
Run it:
apt install ibus && ibus-setup --xim

Choose restart keyboard layout. And try again yéééééééééééééah
Comment: 17.07? What's that? Have you included all the steps here? I've found it less than trivial to set up ibus layouts!


Does Facebook return Album date

Question: When you fetch an album from Facebook, does it also return the date what you selected in the "Edit Date" field? I don't mean the created or updated date.
Answer: No, only the creation time and updated time for the album are returned via the API, the point on a user's Timeline that the album appears (e.g. if they backdated the album) is not returned via the API

Does Facebook return Album date


Why does OSPF function on Network Layer whereas RIP functions on Transport Layer?

Question: As far as I know, OSPF creates its messages directly at the network layer, whereas RIP function on UDP. Their function is pretty similar, so why is there such a difference in their messaging practice?
Comment: Two different people, at two different times, had two different ideas.
Comment: "_OSPF creates its messages directly at the network layer_" It would be more accurate to say that OSPF and EIGRP have their own transport protocols, where RIP uses UDP as its transport protocol, and BGP uses TCP as its transport protocol. The network layer is IP, and IP doesn't know anything about OSPF or the other routing protocols.
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: There's simply no advantage in using UDP.
OSPF is designed to be implemented on hardware devices. Doing away with the (slight) UDP overhead reduces the implementation footprint and makes the traffic more efficient.
RIP was designed when routers were software implementations on hosts that had a full stack anyway.


How do I improve my endgame technique?

Question: I have decent endgame technique and recently bought Jesus De La Villa's 100 endgames you must know. How do I shift it closer to top level endgame technique?
Answer: The simplest answer to you question is:Now read and master your endgame book!
Without knowing your rating there are some general points to be made; applicable to players of all strengths.
1.Take every opportunity to apply this new knowledge to your own games when ever you play.
2.Self analysis and application of your newly learned endgame technique.Analysis with a mentor or buddy of greater strength is especially valuable.
3.I should point out that you should attempt to make parallel improvements in the other phases of the game :all the endgame instruction in the world is entriely superflous if you loose in the middlegame or opening.
4.Widen your experience by playing many games frequently.
So in summary : Read and master your book  and Applicaction , Analysis , Advice (from a stronger player),Attention ( to the whole game) and Acquire experience by frequent play.
Answer:
How do I shift it closer to top level endgame technique?

The simple answer is you study the more difficult endgames which normally require IM or GM level playing strength to master. What you should be looking to learn here is:

When the endgame is won, how to win for the stronger side
When the endgame is won, how to put up the greatest resistance for the weaker side
When it is drawn, how to draw
When it is drawn, how to win when the weaker side goes wrong

These endgames would include:

K+Q vs K+R
K+R+B vs K+R
K+Q vs K+R+P
K+R+f+h vs K+R
K+R+a+f+g+h vs K+R+f+g+h

A useful resource is Fundamental Chess Endings by Karsten Mueller and Frank Lamprecht.

How do I improve my endgame technique?


Transactional Spring Junit4 test cases for Validation scenario

Question: I am using Spring,JPA using hibernate for service -> dao layer.
Transactions are spring managed.
I have validation testcase wherein , I need to validate for duplicate data insertion and throw an exception.
In my testcase ,which is extension to AbstractTransactionalJUnit4SpringContextTests
I have configured @TransactionConfiguration with defaultRollback as true and bean name for transaction manager (in my case its a bean of JpaTransactionManager)
I execute this testcase as below steps

Create a record with call to dao.create(entity); (this will succeed)
Create a same record (with all the attributes same as set in step 1) and call dao.create(entity) (this must fail, but its not failing)
In my create(entity) method I make call to validate() method, which fires scalar object query (JPQL) to validate.

I expect validation to be failed, but this works without exception and duplicate data gets inserted in DB.
I tried debugging (enabled hibernate logs),I found that the select query (scalar query) fails to get the proper data (ideally it should fetch at least 1 record, as I inserted data for it in step 1 listed above.)
I see Insert query for step1 in logs ,before select query for validation.
Is there any other way to write test case for such scenario which involves spring / jpa with hibernate?
Please post your views
Thanks in advance!!
Answer: Can you please paste your test here, I believe each test is running in its own transaction, and you have defaultRollback as true. That should be the issue.


Any sound which is played from Google Chrome is very low pitch

Question: Any sound which is played from Google Chrome is very low pitch, doesn't matter which website or source i.e. video from youtube, music from flash games and etc. However if I open same content in other browser i.e. Firefox everything is fine or if I open some mp3 file from my computer via music player everything is fine again. I am using Ubuntu 10.04 if that matters.
Comment: Have you checked the volume mixer? And pitch, or volume?
Comment: This is confusing. Do you actuall mean volume? Pitch is high and low not loud and soft.
Comment: @soandos well I don't know exact term (pitch or volume) but woman voice sounds very ugly like a man. Can't find volume mixer in chrome settings.
Comment: Could be related to this: https://code.google.com/p/webrtc/issues/detail?id=1587
Answer: Had that issue as well in Linux Mint 15 and it seems the distros share the same Sound Settings gui. Click your volume-icon, select Sound Settings, go to the Applications tab and adjust the volume for Chromium/Chrome.


How to get postdoc funding without a mentor

Question: I see that many people say the easiest way to get a postdoc position (in US) is to come with your own funding. Some postdoc "openings" are only contingent on self-funding. But all the postdoc fellowships I see require a mentor to design a project with, so I'm confused about the process here. Where can you acquire postdoc funding without having a position already?
Answer: Generally you would select a few professors whose work you admire and write to them to say you are excited by their work, explain how you would fit in and ask if they would be willing to discuss the possibility of applying for a postdoctoral fellowship with them as the mentor. When you do this it will definately be in your interests if you were to mention specific fellowships you are thinking of applying for. It has been known for well funded professors in the US to offer to fund an exceptional candidate for the first year while they apply for funding, but I wouldn't assume this.
If the professors were positive you would then generally have a discussion about projects that would fit both of your interests. I would guess you would then write the application with their help, and cross your fingers while you waited for a response.


Bash script in container

Question: How to execute a bash script in the docker container from the host such  that it should not get exited from the container  after execution of script ?
Answer: You can try to use bash as an interactive non-login shell with option --rcfile file.
MAN:

When an interactive shell that is not a login shell is started, Bash
  reads and executes commands from ~/.bashrc, if that file exists. This
  may be inhibited by using the --norc option. The --rcfile file option
  will force Bash to read and execute commands from file instead of
  ~/.bashrc.

So use
bash --rcfile <(echo '. ~/.bashrc; some_command')

as mentioned in this post.
Comment: Thank you Egor. I could reach into the container from   host through the script file but commands are not getting executed in the container
Comment: What command do you use to start rontainer?
Answer: Look at using docker exec along with -d for the detached flag i.e.
docker exec -d <containerid> /path/to/script

Bash script in container


How to connect to the drupal site with xmlrpc from Android?

Question: In the beginning I want to become authorised on a Drupal site, but I cannot connect with "system.connect", as a result I receive null. How can I do that? Thanks in advance.
Comment: You do not provide enough information to help you answering the question.
Answer: From all what i know till now you need to have xmlrpc method library first in your project and then you can use xml rpc methods to connect to drupal site call methods and add paramteres
Answer: You will probably want to use services, it supports xmlrpc by default while Steps to make a mobile application using drupal as a back end or service deals with REST mainly the setup is virtually the same. You can change the JSON code from there to use the Apache XMLRPC android library.
Answer: The text below is related to xmlrpc.
You need to define your endpoint. Setup name, protocol (xmlrpc), allowed resources (nodes, users, comments, files, etc).
And enable "Session authorization" checkbox. Without it, all remote requests will be executed as anonymous user.
To authorize, you call "user.login" method with username and password arguments.
And if call is succeeded, store sessid and session_name values of returned method structure.
Then send value
<code>session_name+"="+sessid
</code>
as cookie in all subsequent calls to identify the session.


Why does squinting allow you to see objects more clearly?

Question: How does squinting alllow one to see clearer pictures? What are the harmful effects?
Answer: This is an optical pinhole effect.  If the amount of light passed through the lens decreases, the sharper the image is at the focal point.  For a camera this is accomplished by increasing the f stop (f22 is a smaller aperture size than f6 — f-stop is an inverse number).  For the eye the iris will dilate (get larger) or contract to be smaller.  In very bright light, you can cut down on large amounts of light coming in by squinting, which creates a slit in front of the eye lens.
In photography this increases the "depth of field". Which is to say that more objects are in focus and sharp.  It works the same for our eyes of course.

In this image you can see as the aperture is smaller, any given point on the focal plane (right hand line) receives light from a smaller angle (i.e. from less of the image field).
I am not a physicist, but that's a first order explanation
@Luke reminds me that there was a question about whether squinting is harmful.  There is another reason that we squint.  If we are nearsighted or if we are getting older, we have a tendency to squint not because there is too much light coming into our eyes, but because our lenses are not focusing very well.  Is it harmful to strain our eyes?  Maybe, but it won't kill you.  Reading glasses won't either.
Comment: I can't think of any harmful effects, can you? Maybe constantly squinting would actually alter the shape of your eye/retina slightly, thus meaning you'd always need to squint (or get glasses)?
Comment: squinting may be harmful b/c it reduces number of blinks?  affects the production of tears?
Comment: @Luke i added some thoughts to the answer.  I think eye strain that results from squinting when your eyes are not really seeing things well might tend to hurt your eyes.  squinting because the light is too bright is probably a good thing and might be as good or better than sunglasses.
Comment: its probably better to be in a not too brightly lit temperate environment


Missing makecert.exe

Question: For some reason I am missing makecert.exe on my system. I searched the whole hard drive and it's not there. In particular, it's not in C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin where I believe it's supposed to be. I haven't found any articles on this topic on the Internet. Any ideas what's going on?
Answer: makecert.exe is also installed as part of Windows SDKs. For example it is available under \Program Files\Microsoft SDKs\Windows\v7.0A\bin for the Windows 7.0A SDK.
Answer: Just to note this as to save you an hour or so of frustration. In Windows 8 SDK, the path is: \Program Files (x86)\Window Kits\8.0\bin\x64\makecert.exe. Note that my machine is 64-bit, so replace the folder names with the corresponding 32-bit version if it happens to be your machine. I was looking at the "\Program Files\Microsoft SDKs" folder, as I thought the folder structure of Windows 7 SDK is similar to Windows 8 SDK. How wrong I was.
Comment: Found it here on Windows 10 C:\Program Files (x86)\Windows Kits\10\bin\x64
Answer: I was tasked with deploying Azure Recovery Services and as such makecert.exe was required on all VMs.
The following worked for me:

Azure VM Microsoft Windows Server 2012 R2 Datacentre:

Download Microsoft Windows SDK for Windows 7 and .NET Framework 4
  http://www.microsoft.com/en-us/download/details.aspx?id=8279
Select .net Framework TOOLS only.
Note makecert.exe installed to:
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64

use the following to create the certificate using Powershell:
 "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64\makecert.exe" -r -pe -n CN=CertificateName -ss my -sr localmachine -eku 22.214.171.124.18.104.22.168.2 -len 2048 -e 01/09/2017 machinename.cer

Azure VM Microsoft Windows Server 2012 Datacentre:

Windows Software Development Kit (SDK) for Windows 8.1
  http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx
downloaded all
installed these 2 components only:

windows software development kit
net framework 4.5.1 software development kit

Note makecert.exe installed to:
C:\Program Files (x86)\Windows Kits\8.1\bin

use the following to create the certificate using Powershell:
"C:\Program Files (x86)\Windows Kits\8.1\Bin\x64\makecert.exe" -r -pe -n CN=CertificateName -ss my -sr localmachine -eku 22.214.171.124.184.108.40.206.2 -len 2048 -e 01/09/2017 machinename.cer

Hope that helps someone.
Comment: It works for me. Important to only select the .Net tools that a small package.
Answer: here is a thread with many other locations on where the exe can be.
Comment: I appreciate the link. Again, it's not in any of those locations but I found it following one of the links on that thread. Still surprised that it's missing. It may have been wiped out after I uninstalled VS2005, but then I would expect to see morepeople with the same problem.
Answer: Currently, the MakeCert.exe is deprecated:

Note  MakeCert is deprecated. To create self-signed certificates, use
  the Powershell Cmdlet New-SelfSignedCertificate.

You should use the new New-SelfSignedCertificate power shell cmlet.

Missing makecert.exe


Plotting a data set

Question: I have data set like this (x , y , n) n is the number from 0 to 12 I want to plot this data set but I want to the color of each point be base on the third column. For example if I have 0 in third column get red point on my graph and for 2  get blue and so far.
Comment: it is not very clear to me what sort of list you have. is `x` a list and `y` a list and `n` just a number? or do you have a list of three lists? can you provide some data explicitly?
Comment: I have a coordinate (x,y) which each coordinate is tagged with a number (between 0-12) I want to plot all of those points but for each point have different color depend on the number in third column.
Comment: hi again. I attempted something. if you don't find it helpful, let me know and I will remove the answer
Comment: This may work `GathetBy[data,Last]` and plot the new data set.
Answer: I assume your data consist of triplets: {x,y,color}. For an example, we create some data:
SeedRandom[10];
dat = RandomInteger[{0, 12}, {20, 3}];

We use ListPlot to display the data and color the points using ColorFunction. As ColorFunction only receive {x,y}, we need to look up the third element of the triple:
SeedRandom[10];
dat = RandomInteger[{0, 12}, {20, 3}];
ListPlot[dat[[All, 1 ;; 2]],
 ColorFunction -> (Hue[Cases[N@dat, {#1, #2, _}][[1, 3]]/12] &),
 ColorFunctionScaling -> False]

Answer: The data points in the x- and y-axes.
x = {1, 2, 3, 4};
y = {1, 2, 3, 4};

Create the list to be plotted
z = Thread[{x, y}]

One way:
ListPlot[{#} & /@ z, PlotStyle -> list2]

A second way:
ListPlot[{{Style[z[[1]], Green]}, {Style[z[[2]], Purple]}, {Style[
    z[[3]], Red]}}, PlotStyle -> PointSize[0.02]]

A third way:
Graphics[Prepend[Riffle[list2, Point /@ list1], PointSize[0.03]],
 Frame -> True]

Plotting a data set


NP-completeness and reduction of MAX-XOR-SAT and MAX-2-XOR-SAT

Question: It is often stated that the MAX-XOR-SAT problem is NP-hard, and that likewise is the MAX-2-XOR-SAT problem. However, I cannot find a reduction from SAT to either of these problems, nor a proof of NP-hardness. Is one published anywhere?
Answer: MAX-2-XOR-SAT is a generalization of the more familiar problem MAX-CUT.
To see this, consider a graph $G=(V,E)$. We will have a variable $x_v$ for each $v \in V$, and a constraint $x_u \oplus x_v$ for each edge $(u,v) \in E$. We can identify a cut $S \subseteq V$ with a truth assignment by $S = \{ v \in V : x_v = 1 \}$. You can then check that the number of clauses satisfied is exactly the same as the number of edges cut by $S$.
Comment: OK, thank you! I had not realized that it remains NP-hard even if the clauses are monotone.


Is there a disadvantage to being higher level in low trophy arenas?

Question: I like to donate cards to my clan for the gold and exp, but is there a disadvantage to leveling up while still in lower level arenas? I donate often so I am almost level 7 and only in Arena 4/5. Is there a drawback to being such a high level in a lower level Arena?
Comment: @DJPirtu is right, the only in game effect is the strength of your structures, out of game however it has a negative reputation effect; essentially being stronger than your opponents should make it inherently easier to win (and thus level up... to a point at least).
Comment: Note - I am not criticising, just highlighting a possibility that people 'may' think
Answer: Your level only affects the HP and damage of your towers. There is no other effect of your level.
As you can see, there isn't any disadvantage to having a high level. This applies to all arenas.
It may also have a demoralizing effect on your opponent, if they're level or two lower. (Less on later on where levels even out and people realize that the cards and strategies play much larger role than a 100 or so more HP on the tower.)
Comment: Thanks. I was curious if SuperCell had put a system in place similar to Clash of Clans. In CoC, if you leveled up your town hall, you received less resources from battling lower level town halls.
Comment: @wizloc As far as I know, the only resources you get from battles are _chests_ and _trophies_. The first you get based on arena played on (chest level) and where you are at chest rotation (silver, gold or magic). The latter is determined by the difference in _trophies_.
Answer: It's not about any of that. What does it require to level up? It requires large amounts of upgrades, so if you fight someone who's a high level than you then they have stronger cards. And sometimes tier cards; meaning someone could bring hog rider from arena 4 to 3 and have an advantage. Many higher level players are losing their place in clash, and cause others to lose because they still have higher tier cards. It's a huge domino effect.
Comment: Sorry, but as I mentioned in the question I am leveling up by donating cards, not upgrading them.
Comment: flagging as not an answer as you do not address the question, you skirted around the topic but did not address the question of 'is there a drawback'
Comment: I did, but if you can't read between the lines I'll type in a way you can understand. No, you have a huge advantage! Your cards are a higher level and you probably have a larger variety.
Comment: I don't see how any of this is a disadvantage to the _higher level_ player.


Populate or change the selection options in one field based on selected option in another field in the CP

Question: I'm looking to change a select fields options with the onChange event from another select fields chosen option. Obviously this can be done with js on the frontend as per this post but has anyone done this for the control panel? I imagine it will need to be done via a fieldType plugin, but wondered if anything already exists for this type of functionality before I attempt to build something.
Comment: Do you already have a plugin and fieldType where you want to do this, or do you mean "this one built-in selectField is connected to this other built-in selectField?
Comment: Could be either. If there is a way to connect select fields in craft already then great where can I find the documentation for it. If not then I would be looking at a plugin to do this.
Answer: I would write a custom fieldtype (http://buildwithcraft.com/docs/plugins/field-types) with two selects. Makes sense to make it as one field if they are dependent of eachother.
Just store the field as json (AttributeType::Mixed) and inject your own javascript in the fields getFieldHtml()
Answer: Instead of building a custom fieldtype, you could just connect two standard dropdown menus with some custom JavaScript. The easiest way to do that would probably be via the Control Panel JS plugin.
Fortunately, the control panel already uses jQuery, so you wouldn't need much JS to tie the two fields together.


Bootstrap + react-bootstrap form elements, styling not applied

Question: I'm using bootstrap + react-bootstrap, and I don't really understand why my custom theming isn't applied on form elements.
The theming is correctly applied to my button that has btn-primary style, and I assumed it would be the same on other bootstrap elements?
Here you can see that the elements still have the default bootstrap style vs the button: https://i.stack.imgur.com/YJB7S.jpg
My index.scss (app base generated with create-react app): https://pastebin.com/5nrWickD
$theme-colors: (
  primary: #86CB92,
  secondary: #404E7C,
  success: #71B48D,
  info: #251F47,
  warning: #251F47,
  danger: #E87461,
  light: #D8B4E2,
  dark: #260F26
);

@import "~bootstrap/scss/bootstrap";

My JSX: https://pastebin.com/jvp9cwyz
<Form.Check type={'switch'}
    className={'form-switch'}
    disabled={!v.state.reachable}
    defaultChecked={v.state.on}
    onChange={({ target }) => {
      lightArray[idx].state.on = target.checked;
      setLightArray([...lightArray]);
      turnLightOnOrOff(idx + 1, target.checked);
    }
}/>

Is there something I am missing? Do I have to add classes to the form elements? I have looked around but can't find anything
Answer: Well, turns out it's not as easy as just setting the theme-colors variable.
I had to set other variables as well, like this
$theme-colors: (
  "primary": #86CB92,
  "secondary": #8f0000,
  "success": #71B48D,
  "info": #251F47,
  "warning": #251F47,
  "danger": #E87461,
  "light": #D8B4E2,
  "dark": #000000
);

$primary: map-get($theme-colors, primary);
$input-focus-border-color: $primary;

@import "~bootstrap/scss/bootstrap";

And now the form element have the right styles.


installing windows 10 with only ubuntu 16.04 currently on ssd

Question: So i have a x220 with the only os on there being ubuntu 16.04 on my 500 gb samsung evo drive. I have windows 10 on a thumb drive that I want to install alongside ubuntu so that I can dual boot them. If I install windows, will it overwrite ubuntu and mess it up? I heard this happens, but is it hard to fix? Or should I plug my ssd into another computer and wipe it, and start fresh? Thanks!
Answer: The general rule of thumb is to install Windows first and then install Ubuntu second whilst selecting the "dual boot" option. That said, you don't have to wipe out Ubuntu, but create a partition for Windows to be installed into. In your case I'd go 400GB for windows and 100GB for Ubuntu. It all depends on where your multi-media files and games will be stored of course but I presume the bulk would be in Windows.
I've been hearing horror stories of how Windows 10 updates wipe out Linux in some situations (fast boot?). So backups are more important than ever today.
Comment: okay thanks! I literally will actually never use windows 10. I study computer science so I am mostly on ubuntu, and only want windows 10 in case I happen to need it for something. I think I will go ahead and just wipe my ssd, reinitialize it, then install windows, then ubuntu. Ubuntu currently contains nothing but many .hpp and .cpp files from programming that I already backed up. Does this sound like a good plan? I guess I will never update windows 10 now either! haha, also, if i select "something else" on the ubuntu menu, that will also set me up for dual booting? I want to create 18gb swap.
Comment: [continuing above post], for hibernation.
Comment: If you're going to dual-boot Windows and Ubuntu, you'll need to disable FAST BOOT and HIBERNATION in Windows. Ubuntu won't hibernate by default. So you don't need a 18GB swap. Set swap to 1-1.5 physical RAM size. Cheers, Al
Comment: how do i disable fast boot and hibernation in windows 10? Really? I read on so many forums to double your swap partition(which I can always get rid of but not add to it?), and you can tweak things to get it to hibernate? Also, the "something else" option is the same as dual booting, correct?
Comment: Swap = RAM size x 2 is a common formula when RAM <= 4 GB I believe. When you have more than 4GB some suggest swap isn't even necessary. Definitely my system with 8GB doesn't need swap. If the amount of swap is set based on misbehaved programs eating up RAM then that number is theoretically infinite when things go wrong. Type "free -t" in terminal to monitor RAM and SWAP usage totals.
Answer: I install booth sistem in my samsung laptop, is preferible you install windows first is you use EFI boot, later UBUNTU (will install grub and you can always choose to boot windows or ubuntu); but in any case if you "overwrite" the boot info you can alway use a "Ubuntu live CD/USB" to install grub again, is very easy. Or if you like graphical interface install GrubCustomizer in ubuntu and fix the dual boot.
Grub will give you access to windows or ubuntu.
You can check also REFIND to have a nice graphical way to choose boot any OS (correctly installed).
Best regards.


Zip Code distance in excel

Question: I am looking for a way to get a function in excel to retrieve the distance form one zip to another. Lets say i have a list of 100,000 possible recruits and I want to sort by nearest. Id have the conference zip code and then 100,000 recruit zip codes. I'm looking to be able to just write a function =ZipCodeDistance(a2,d1) and then sort by that column. I have found a program for $65 that claims to do this, but I was wondering if there was a free way.
Answer: If you have the latitude and longitude for each zip code, you can use trigonometry to calculate the distance as the crow flies.
There is a free database here that you can download.
To do the calculation, see the info here. And some actual Excel-specific calc examples are here.
Comment: Added more info on how to do the calculation.
Answer: How to get the data and the algorithm are explained here, but in C#. If your Excel VBA is OK, it shouldn't be too difficult to translate?
Answer: You can get a list of the post office address for each zip code and geocode each address into a lat, long pair.  Do the same for the recruit's address and then use the formula for great circle distance.
Here's a link to a U.S. zip code database:
http://www.zipcodeworld.com/
And another to how to calculate distance between two points on the globe:
http://williams.best.vwh.net/avform.htm

Zip Code distance in excel


How to properly react on exception during view rendering when response is already partly submitted?

Question: When response is already partly submitted it is not possible to change headers to indicate that there has been some fatal error nor it is possible to show well formatted error message (it is very dificult to detect what steps needs to be done to fix the markup to create some space for the message). Should there be some javascript which would redirect the page to some good looking error report or create some overlay for it? Should be the page completely generated to buffer and sent only after complete succesfull rendering? Or some other strategy is suitable?This is a general question valid for every web technology, but I'm particularly interested in solution for JSF, Facelets, Webflow software stack.
Answer: I believe it is not possible to react properly in every case because you don't know at which position of html output you are. You even may not know if you are in a html document at all, depending on the application.
Exceptions during view rendering should be fatal and rare. Output buffering, which could solve this problem, is not desirable.
You could try to embed some javascript code into the output, maybe to redirect, but the original page could have been a redirection, too. It may be better to emit js code to open a popup/other window which displays a static html page explaining the fatal error and advising the user.


Reverse search using pgUp and pgDn

Question: I'm having a strange issue using pgUp and pgDn to auto-complete searches from history.
I'm using bash in gnome-terminal.
type:
vim fil<pgUp>

expected output:
vim filename

Actual output:
vim fil~

Both pgUp and pgDn are printing a ~ character on the terminal instead of searching through history.
I think I have the relevant lines in my /etc/inputrc but they don't seem to be helping. Can someone tell me what I'm doing wrong here?
Here's my inputrc should anyone need it:
# do not bell on tab-completion
#set bell-style none

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

# Completed names which are symbolic links to
# directories have a slash appended.
set mark-symlinked-directories on

$if mode=emacs

# for linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# commented out keymappings for pgup/pgdown to reach begin/end of history
#"\e[5~": beginning-of-history
#"\e[6~": end-of-history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
#"^[[5~": history-search-backward #these are the values read gives for pgUp, pgDn. They don't work either.
#"^[[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word

# for rxvt
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word

# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif

And my ~/.inputrc if it's relevant.
set show-all-if-ambiguous off
set show-all-if-unmodified on
set completion-ignore-case on

Answer: cat >> ~/.inputrc

"\e[5~": history-search-backward
"\e[6~": history-search-forward

Reverse search using pgUp and pgDn


Is there any way to limit editing in Google Docs?

Question: I'm looking for any way to set the character limit in Google Docs (specifically MS Word-like text processor).
So, for example, I have a cell in the table and I want to only allow putting 2000 characters or less into the cell.
I wonder if there's such functionality in Google Docs, maybe it's possible with a script or some other way?
Thank you!
Answer: There isn't a built-in feature that does that you might use a custom sidebar to hold client-side code to constantly poll the document to count the character of the active Google Docs element by using Google Apps Script or use a Google Docs add-on that does that if its exists.
Answer: What you can do is make the table on Google Sheets and then put it in the Google Docs,
Here's how to do it on google sheets...
First, click on the cell that you want to limit the characters in

Then click "Data validations"

Then go to Custom Formula

And input "=(len($C2)>=500)*(len($C2)<=2000)" this is for cell C2 change "$C2" to whatever cell you want the formula to work in
This formula is basically making the input great than or equal to 500 and less than or equal to 2000

And if you were wondering how to add a table from google sheets all you have to do is go to "insert" than "chart"

Then press "From sheets" to get the table from google sheets into google docs