cabinet hinges, crooked,uneven some will not close cabinet doors

Question: I recently removed all cabinets to redo them. I had old brass or copper looking hinges. I wanted to change to nickel to match the rest of my kitchen.I have returned 4 different types of hinges because they cause bad overlap.the hinges I now have are made by same company as old ones they are 3/8 inset non self closing. Still having issues. I only have 2 sets hung on both right door is higher than left and on 1 pair doors have to close at same time otherwise there is an overlap.trying to use same shape and size to cover the black stain left by old hinges. I really do not want to cut doors. Any advise would be appreciated.
Comment: Pictures of old and new hinges would help as would how the doors set. It sounds like you need a larger setback on the new hinges. It is typically called overlay. If the hinge is a face frame mount, move it over a bit, drill new holes. that should keep the doors from overlapping themselves. Again, this depends on the type of hinges you have, and the need for the pictures.
Comment: How do I add pictures to site?
Comment: Typically it is added when the post is created. I think, if I heard right, that new members can't edit their own posts. But it is done by clicking on edit under the post and clicking the picture button and upload the pictures you save of the cabinets on the computer. Or something like that. Other members may know much better than I.
Comment: Cannot get pictures on here. I am getting estimates to have them rehung. I think we may be able to move hinges slightly but my husband refuses to do so, afraid of turning wood into mush from continuing to hang and remove. Hinges are the closest to originals that I could find. I have 7 sets of double doors and 5 single doors. What kind of charge should I be expecting. 2 estimates so far very different in price.
Answer: For anyone who may be struggling with this issue, there I a simple solution. My cabinets are partial inset, using plain 3/8's inset hinges that were close to my originals in order to cover black markings left on my stiles. I added toothpicks and glue to original holes.so that my screws fit well. But after installed had to close double doors together or they would overlap just a little. I was over my head I couldn't figure out how to fix. I started getting estimates to repair. 100.00 to mill down one side of cabinets. 300.00 to rehang and move hinges over slightly. My last estimate was from Mr. Fix it. He tried to tell me how on the phone. Close the doors together on a paint stick. I had already done this, to hold my gap while installing. He came out with a 5 gallon paint stick. 1/4 inch thick. He closed the doors together,gently, on the stick twice and my problem was gone. He called it setting the hinges. I couldn't believe that's all it took. Wanted to share with anyone having similar issue. So that they wouldn't have sleepless nights and wasted tears, and messed up cabinets.


Plotting multiple lines from a data frame with ggplot2

Question: I am trying to plot multiple lines using ggplot2. My data is fitted into a data frame as follow:
> rs
  time           1           2           3           4
1  200 17230622635 17280401147 17296993985 17313586822
2  400 22328386154 22456712709 22499488227 22542263745
3  600 28958840968 29186097622 29261849840 29337602058
4  800 40251281810 40650094691 40783032318 40915969945
5 1000 73705771414 74612829244 74915181854 75217534464

I would like to use the "time" column as the x value. Other columns are y values of points in different lines. In the data above, there are 4 lines, each line consists of 5 points. More specifically, the first line has points (200, 17230622635), (400, 22328386154), (600, 28958840968), etc. The second line has points (200, 17280401147), (400, 22456712709), etc. (If you need further explanation of the data format, see P.S. in the end.)
To generate a similar data, you could use the following code:
rs = data.frame(seq(200, 1000, by=200), runif(5), runif(5), runif(5))
names(rs)=c("time", 1:3)

I followed some examples on stack overflow and tried to use reshape2 and ggplot2 to do this plot:
I first melt the data into a "long-format":
library('reshape2')
library('ggplot2')
melted = melt(rs, id.vars="time")

Then plot the data using the following statment:
ggplot() + geom_line(data=melted, aes(x="time", y="value", group="variable"))

However, I got an empty graph which has no point nor line.
Can anyone help me to see what's wrong with my procedure?
P.S.
About the data format:
You can imagine there are many students in the class and we have their scores of several quizzes. Each row contains one student's data: first column is the quiz number, then the rest of columns are his/her scores. For each student, we want to plot a line to reflect how his/her scores change over different quizzes, each point is the score of one quiz for a certain students. Since there are multiple students, we would like to draw multiple lines.
About the melted data:
Specific to the data I show above, the data I got from the melt() function is:
> melted
   time variable       value
1   200        1 17230622635
2   400        1 22328386154
3   600        1 28958840968
4   800        1 40251281810
5  1000        1 73705771414
6   200        2 17280401147
7   400        2 22456712709
8   600        2 29186097622
9   800        2 40650094691
10 1000        2 74612829244
11  200        3 17296993985
12  400        3 22499488227
13  600        3 29261849840
14  800        3 40783032318
15 1000        3 74915181854
16  200        4 17313586822
17  400        4 22542263745
18  600        4 29337602058
19  800        4 40915969945
20 1000        4 75217534464

Comment: why do you need to melt?
Answer: Drop the quotes:
ggplot(data=melted, aes(x=time, y=value, group=variable)) + geom_line()

see:   ggplot aesthetics
Answer: Another option is to use aes_string.
Comment: Once you reach 50 reputation you can comment on other people posts. You can see full privileges list here: http://stackoverflow.com/help/privileges
Comment: I guess this is  to avoid spams and self-promoting comments
Comment: Seems almost backwards to me. ;)


What can I do about a low spot in my bathroom floor?

Question: I have water standing on a specific area of my bathroom floor. The whole floor dries out except for this area. It has stagnant standing water.
What can be causing this problem, and is there a solution to this problem?
Comment: where is your home located, and what sort of construction is it? cinder block, wood frame, concrete? what's your floor material? tile, vinyl, stone?
Comment: It is a house and washroom is the ensuite. It is built of brown square tiles. The area bordering the shower room is where the water keeps standing otherwise whole washroom dries up quickly.
Answer: Why do you expect your floor to drain or dry? Is this a wet room, where the whole floor area is designed to get wet and drain? In most bathrooms (at least in the US), only the bath/shower itself is designed to drain water. The rest of the floor is typically made of a material that won't be damaged by an occasional splash but also isn't designed to drain large amounts of water.
If you have a wet room with areas that don't drain, then the solution is to fix the shape of the floor so those areas do drain. The exact approach (and how invasive the repair would be) depends on your particular layout and materials.
If you have a more typical bathroom, then you should not expect the floor to function as a drain, and instead work to prevent it from getting quite so wet. Often this can be solved with better placement of shower curtains and bath mats or repair of leaks. For advice on that we'd need to know where this water is coming from.
Answer: Since you've pointed out to me from my original answer that this certainly is not a leak related puddle & is just a usage remnant puddle due to a low-spot in the tile. Then, you have 4 main options to choose from:
1 - Treat the puddle area like a street pothole & fill in the area with cement.
2 - Chisel up the puddle area's tiles, level the floor beneath & install new tiles.
3 - Double Option: A - Perform #1 & install new tiles over the entire floor of old tiles. B - Install cement on top of the old tiles & sculpt it to pitch the floor toward the drain prior to installing new tiles. Either of these raises the floor & may therefore cause problems with fixtures &/or doors.
4 - Remove the whole floor's tiles, repair or flatten the floor, pitch the floor with cement toward the drain & install all new tile.


Fixing broken wrought iron gate

Question: The Fleur-de-lis shape on top of iron rod of the gate broke off during tree trimming about 3 yrs back. I have been attaching it every year or so with J+B weld. However, it seems fall off after sometime. Is there a more permanent way to fix it? Or, do need to find a welder etc..
Comment: How about a picture so we can see what you see.
Comment: If you can remove the gate and take to local garage or welder, then cost should be quite low.  Much less than if they need to come to you
Comment: When you post the picture show the bottom of the shape where it connects with the gate, please.
Answer:
Is there a more permanent way to fix it? Or, do need to find a welder etc..

You've practically answered your own question. Yes, there is a more permanent way to fix it - actual welding, not an epoxy product with "weld" misleadingly in its name and a bunch of implausible miraculous claims elsewhere on the package. Brazing would probably also work fine. and might be preferable if the decoration is cast iron, rather than actual wrought iron.

Fixing broken wrought iron gate


Could not find Angular Material core theme. Most Material components may not work as expected

Question: I am currently using angular 4, and I followed the link here about how to use Angular Material. This is what I have done so far:
app.module.ts
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import 'hammerjs';

imports: [
    BrowserAnimationsModule
  ],

I included in my index.html the theme style

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="../node_modules/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet">

component
<md-sidenav-container>
  <md-sidenav>
    un idee
  </md-sidenav>

</md-sidenav-container>

But I am getting the error:

Unhandled Promise rejection: Template parse errors:
'md-sidenav' is not a known element:
1. If 'md-sidenav' is an Angular component, then verify that it is part of this module.
2. If 'md-sidenav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

and the following warning
Could not find Angular Material core theme. Most Material components may not work as expected

Could anyone point out what I am doing wrong?
Answer: You are missing MdSidenavModule import and adding it as a dependency to your AppModule
import { MdSidenavModule} from '@angular/material'

imports: [
    BrowserAnimationsModule, MdSidenavModule
  ],

Also ensure that, the following line is there in your systemjs config file
 '@angular/material': 'npm:@angular/material/bundles/material.umd.js',

If you are facing the BrowserAnimationsModule, NoopAnimationsModule error. Refer to this post
Update : For CLI, update the tsconfig-build.json file with the below path
"paths": {
     "@angular/material": ["../../dist/packages/material/public_api"]
 }

Note: Path subjected to change as per your version
Comment: I imported `MdSidenavModule`. But, it caused a compilation error `has no exported member`.
I am using cli so I don't have systemjs config file.
Comment: Sorry, but it seems that I don't have the file tsconfig-build either. i do have tsconfig.json but not the one you mentioned
Comment: I did as you suggested
`{
  "compilerOptions": {
    "baseUrl": "",
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ],
    "paths": {
      "@angular/material": ["../dist/packages/material/public_api"]
    }
  }
}` But I stil facing the same problem


Give the same rights to two users

Question: Let's say I have 2 users :
user1 and user2
I would like to give user1 the same permissions as user2 but I don't want user2 having the same permission as user 1.
Sorry for my english.
Thank you
Answer: (I'll call user1 boss and user2 minion, to avoid the risk of typos that would invert the meaning).
You mean you want boss to be able to access minion's files? Add boss to the minion group. By default, on Ubuntu, most of minion's files are group-readable and group-writable. There's probably a way to do this in the GUI, but I only know the command line way:
sudo adduser boss minion

Minion can still create private files if he wants. If want to allow boss to run arbitrary commands as minion, this can be done through sudo. Run sudo visudo and add the following line:
boss ALL = (minion) ALL

Then boss can run sudo -u minion somecommand.
Comment: Thank you, user1 (boss) is the user that I use to login with SSH user2(minion) is www-data, the php user. Will it still works ?
Comment: @Babajaga Ah, no, that's a different use case. I thought you were talking about real users, not system users. For the www-data group, you'll need to make sure that Apache's umask is set to 002, I think the default is 022. [Set it in `/etc/apache2/envvars](http://ubuntuforums.org/showthread.php?t=1536972). If you need more complex things, you might need [ACL](http://en.wikipedia.org/wiki/Access_Control_List).
Comment: I dont see any line with umask 22 in the configuration file, do I have to create it ?
Comment: @Babajaga Yes, add a line with `umask 022` (and check whether it still applies to your version of Ubuntu).

Give the same rights to two users


Colimits glue. What do limits do?

Question: The informal but very useful way to think of colimits is as 'gluing things'. This intuitive view is very helpful to me, and I'd like one for limits aswell, but I haven't stumbled opon such a thing anywhere so...

If colimits glue, what do limits do?
Comment: They coglue, obviously.
Comment: They "cut" things. The idea of a limit from sets is intersection, so you should think of it as cutting off bits in that sense. It's a subset of a product, so it makes sense that you're cutting off the ways they are incompatible (transition functions). The main problem is that colimits take coproducts, which are like assembling pieces to glue, but limits start with products, which somewhat intertwines how they work together, so the metaphor is less clear in this case.
Comment: I think it's probably better to link http://en.wikipedia.org/wiki/Inverse_limit (limit) and http://en.wikipedia.org/wiki/Direct_limit (colimit). There are examples there.
Comment: @NajibIdrissi was waiting for that :p
Comment: This intuition is all well and good but it's very easy to find cases where it doesn't apply.
Comment: @MattSamuel could you give some nice instructive examples?
Comment: I don't have any brilliant examples, but I can give you some trivial ones.
Comment: @MattSamuel everything helps!
Comment: @NajibIdrissi You beat me to it.
Answer: Limits cut out solutions to equations.
Edit: For example, this is literally true in the case of affine schemes. Consider the affine scheme $\mathbb{A}^n = \text{Spec } k[x_1, \dots x_n]$ over a field $k$, and let $f(x_1, \dots x_n) \in k[x_1, \dots x_n]$ be a polynomial. $f$ defines a map $\mathbb{A}^n \to \mathbb{A}^1$, and the scheme $V(f) = \text{Spec } k[x_1, \dots x_n]/f$ of solutions to $f$ is precisely the fiber of $f$ over $0 \in \mathbb{A}^1$, which is a special case of the pullback.
Comment: An example, and an elaboration, would be nice. I don't understand what is meant by the answer out all.
Comment: Possibly infinitely many equations in possibly infinitely many variables, which is kind of exotic.
Comment: Perhaps it would be helpful to give an example?
Comment: @Exterior: sorry, I was in a hurry when I first wrote it. Edited with an example.
Answer: As an example of limits cutting out solutions to equations think of equalizers or pullbacks in $\mathsf{Set}$. Do it now, before reading on. This is the sort of example that you need to have at your fingertips.
In any complete category $\mathcal{C}$, the limit of a functor $F: \mathcal{I} \to \mathcal{C}$ can be computed as the equalizer of two maps $\prod_{\alpha \in \mathbf{Mor} \mathcal{I}}F(\mathrm{dom}\alpha) \overset{\to}{\underset{\to}{}} \prod_{i \in I} Fi$. In $\mathsf{Set}$, the two arrows are functions in $|\mathbf{Mor}\mathcal{I}|$ variables, and the equalizer is the set of all solutions to setting these two functions equal to each other.
Now remember that the categories you're thinking of are concrete categories, usually  admitting a limit-preserving (even right adjoint) functor to $\mathsf{Set}$. So their limits are calculated in the same way, with some bells and whistles to specify the structure forgotten by passing to the underlying set.
Of course, these kinds of intuitions have their limitations -- most obviously, by passing to the opposite of the category you're considering, you switch limits and colimits.
Even in perfectly ordinary settings, sometimes the "cutting-out-by-equations" notion is not the easiest way (for me) to think about limits. For instance, consider the $p$-adic integers $\mathbb{Z}_p = \varprojlim \mathbb{Z}/p^n$ where the limit is taken in $\mathsf{Ab}$ over the obvious chain of quotient maps $\dots \to \mathbb{Z}/p^{n+1} \to \mathbb{Z}/p^n \to \dots$. The cut-out-by-equations description describes this as the subgroup of $\alpha \in \prod_n \mathbb Z/p^n$ such that for each $n$, $\alpha_n = p\alpha_{n+1}$. I tend to think of this as the coordinates $\alpha_n$ being "glued" together -- somehow the individual elements of the limit are glued together whereas in a colimit it's the whole space itself that's been glued together. This can even be seen in the case of pullbacks in $\mathsf{Set}$: an element of the pullback can be thought of as "glued together" from elements of the two upstairs sets, "glued together" by an equation between them downstairs. I'm not quite sure if this can be explained in some categorical way. Maybe (homotopy?) type theory could help to understand this.
I also tend not to think of $\mathbb Z_p$ as being "cut out" of $\prod_n \mathbb{Z}/p^n$ even though it is: I think the reason is that the latter space is so huge and $\mathbb{Z}_p$ is so small -- it is a subspace of very high codimension. I suppose this is no different from the fact that I don't usually explicitly think of a CW complex as a quotient of the coproduct of all its cells.
Comment: I'm curious about you comment on CW complexes. Isn't the all point of CW complexes to be able to think of certain topological spaces as the glueing of cells to have a combinatorial intuition about them ?
Comment: Yeah, I guess all I'm saying is that I could _visualize_ the big coproduct space of which my complex is a quotient as a sort of "étale cover" of my complex, but I usually don't. Similarly, when thinking about $\mathbb Z_p$, I rarely _visualize_ the big product space $\prod_n \mathbb Z / p^n$ with $\mathbb Z_p$ sitting inside.
Comment: Some of the answers to [this question](http://math.stackexchange.com/q/38517/45082) get at the idea that limits can be "completions", which don't feel like generic "solution sets of equations" to me. But maybe the way to look at it is that it's an interesting insight that "completions" really are "solution sets of equations"...
Answer: Sheaves provide a nice framework for getting comfortable with the notion of a limit. See my answer at the relevant MO discussion
MO/23268: Geometric intuition for limits
There you will also find many other interesting answers.
To add something "new" and explain a little bit the other answers: Compute the pullback of the two obvious maps $(S^2)^+ \to S^2 \leftarrow (S^2)^-$, where by $(S^2)^+$ I mean the upper hemisphere and by $(S^2)^-$ the lower hemisphere.

Colimits glue. What do limits do?


What is the purpose of the "grounding" tab/wire on a 3-prong to 2-prong adapter?

Question: We've probably all seen these guys...

They come in handy when you need to plug something with three prongs, into something with two prongs.  What I've never understood was, what the heck is the "grounding" tab for?  It's meant to have the cover plate mounting screw through it. But why?

Is this really designed as a grounding device, or is it there simply as an attachment means to insure the thing doesn't fall out of the receptacle?
Comment: I can't authoritatively answer this, but it is my impression that the grounding tab comes in contact with the coverplate screw, that is in contact with the metal frame of the receptacle, which is in contact with the metal box, which is hopefully grounded to the metal conduit that carries the wire to the box from the breaker.  The conduit of course is grounded to the electrical panel.
Comment: @maple_shaft In a perfect world, but what about those 2 prong receptacles that are supplied by cable with no grounding means (which may be a large portion of 2 prong receptacles)?  Also, if the receptacle is not a self grounding type (which it's not since it's 2 prong), the yoke is not an acceptable grounding means.
Comment: Strange that you *ask the question* and then *immediately argue against it.*
Comment: Arguing against its use does not have any relevance to your question. The purpose (which is what you asked) is to connect to ground. If you don't like them, rewire your house, add GFCIs and labels, or whatever suits you. I haven't needed one in 30 years...(and that house had grounds, just not many outlets with grounds.)
Comment: It can be... I have measured decent continuity between the plate screw and grounded conductor in older homes where I knew the box was metal and it was grounded to the panel. It is certainly more likely to offer ground fault protection than the cheater plug without a ground tab.  Why are these things legal anyway?  Surely the NEC doesn't put its stamp of approval on this?
Comment: @maple_shaft There may be continuity, but it's not *designed* to carry current, and is not an *accepted* grounding means.
Comment: Nor is the human body designed to carry current, but that wouldn't stop it from getting electrocuted when touching a desktop case plugged into a cheater plug that has developed a ground fault.  That tab might save someones life regardless.  Lesser of two evils I guess.
Comment: @Ecnerwal I'll argue against it's use, until somebody can provide enough evidence to persuade me the other way. And by evidence I of course mean something from a reliable source.
Comment: @Ecnerwal I'm simply playing devils advocate, to try and inspire a good answer.  Maple_Shaft had a fairly good answer in his comment, and I was trying to get him to expand on it.
Comment: @maple_shaft Your comments would make a good answer. Explaining how it would work with both metallic and nonmetallic cable would make it a great answer.
Comment: @maple_shaft Is this something NEC or UL would have to approve?  If unapproved, what stops them from being sold regardless?  I've always believed your chain of connections was the expectation, and beyond the control of the adapter to verify.  But seeing the entire chain typed out, I'm now skeptical about how often it ever really happens.  (disregarding how often I see these in use by people who didn't bother to unscrew the faceplate screw and connect them)
Answer: Yes, it's designed as a ground attachment. No, it's not simply to keep it from falling out, as evidenced by the style you haven't shown that provides a pigtail green wire, and the fact that the terminal in question is electrically connected to the ground pin of the receptacle side of the device.

While it is true that this will not always result in a ground, and may (I haven't got time to sift through code, nor code on a computer to sift through) not result in a ground approved by code, it is, nevertheless, what it's there for, and in quite a few cases it does, in fact result in a ground - whether or not you like it.
Comment: In the days of Metal Conduit, Armored BX and Metal Electrical Boxes, it was a ground for the inserted three wire device. Your conduit system was supposed to attach to a cold water pipe bonded to ground with a ground rod. The center screw in the cover plate attached to the metal bracket the sockets attached to and grounded to the electrical box via the two screws that held the socket there.
Answer: Plausible deniability. I've always regarded these adapters as a 2-to-3-prong converter, rather than a proper grounding mechanism, and here's why:
In every outlet I've encountered without a third (ground) prong, there is no ground wire. Sometimes (my parents' house) there is, but for whatever reason the ground wire is cut off and unused. Thus, the electrical box itself isn't even grounded.
The screw holding the face plate on is electrically connected to the outlet box, and if it's not grounded, then there's not much point in using the screw holding the face plate on as a ground.
The companies who make these grounding adapters probably also know this, but they can't really get away with providing 2-to-3-prong adapter without providing some way to still connect ground. So they provide a way to connect it to something that should be grounded, but often isn't. In this way, it's not their fault if something bad happens because your house wiring is faulty.
If you do happen to have a 2-prong outlet in a properly grounded box, then the little ground tab or wire will actually provide ground continuity, as intended.
So, the answer is that the grounding tab is meant as a way to connect electrically to something that in turn should be grounded (but might not be). It's not meant as a secure attachment mechanism, though it may seem that way because of the use of a faceplate screw.
Comment: I have come across one that didn't even have a grounding tab.
Comment: @Brad 1. Research if the manufacturer still exists and if so, if the company is wealthy. 2. Ensure you have purchase receipts, warranty registration card filled out, etc. 3. Operate some machinery using the adapter, perhaps something that doesn't have safe wiring (wink, wink). 4. Sue for damages and profit.
Comment: Based on the design I would say that the latest it would have been produced was in the 1970's. ( It had 1940's 1950's styling. ) I don't remember any identifiable markings on it either.
Comment: _plausible deniability_ Nice conspiracy theory, works if the house wiring used properly installed and grounded metal boxes and conduit. Which is what this is supposed to be used with.
Comment: I would think stores should sell adapters with a GFCI built in.  Given that even the cheapest hair dryer will have a GFCI built into the cord, the cost of the GFCI part can't be all that great, and the safety advantages would be *huge*.
Answer: Many older houses with 2-prong outlets use the sheathing of their BX or AC cables to ground the metal cases.  This is not a very effective ground, but it is better than nothing.
These adapters with the grounding tab are a much cheaper and easier alternative to rewiring the entire house, yet still provide (marginally) more safety than using the adapters without a grounding tab.
As the site's expert on electrical matters, I'm sure you knew this already, so I'm curious why you asked this question ;)
Comment: Just because I know the answer (sort of), doesn't mean I can't ask the question.
Comment: One of the great things about SE sites is that you can ask a question (even if you know the answer) because you want to either a) answer it yourself as a reference for others, b) get additional answers to elaborate and expand on something, or c) you just want to get more internet points!
Comment: @Tester101: Fair enough.  I hope you didn't read that in an offending tone - I was just curious, that's all.
Comment: It is [ok](http://meta.stackexchange.com/a/16933/1337) to [answer your own question](http://meta.stackexchange.com/q/16930/1337). I advocate [waiting](http://meta.stackexchange.com/a/16936/1337) a while though.
Answer: Grounding from plug to Box
Looking at the second picture in the question, makes the grounding path to the box evident.

While the yoke of the device may not be a great (or approved) grounding path (unless it's a self grounding device), it may well serve as a grounding path in an emergency. Which when it comes down to it, is the purpose of the equipment grounding conductor.
Grounding from box to earth
In some situations conductors leading to the box may be either in metallic conduit, or cable assemblies sheathed in a metallic covering.  In some cases, these metallic pathways can provide and adequate grounding path. In these situations, the grounding ring on the adapter can indeed provide and adequate grounding path.
Unfortunately, there are a lot of situations where nonmetallic cable is used to supply nongrounding type receptacles.  In these cases, the grounding ring will not provide a path to ground.
Potential Hazards
Without an adequate path to ground from the box, this setup could actually be more dangerous.
Short to ground inside the box
If for some reason the ungrounded (hot) conductor comes into contact with the metallic box, the box can become energized.  If this adapter is connected, the grounding conductor of the plugged in device can also be energized. In this case, if the grounding conductor is attached to a metallic outer covering of the plugged in device. The outer covering can be energized, and becomes a potential shock/electrocution hazard.
Inadequate grounding path
If the box is supplied using older armored cable, the cable sheathing may actually be a high resistance path to ground.  This could lead to heating of the cable sheath, in some cases to the point of ignition of surrounding building materials. Modern armored cables provide a low resistance path to ground, and are often approved to be used as a grounding means. So if newer cable is used, this may not be a problem.
Broken grounding path
The box containing the receptacle may be supplied using modern cabling, and a grounding path may be present. However, the modern cabling may be connected to older cabling that does not provide a grounding path. In this case, fault current will follow the grounding path back to the junction between old and new cabling, and lead to potential hazards at that location.
tl;dr
In some cases these devices work as intended, and provide an adequate path to ground.  In other cases they do not, and can potentially introduce other hazards.  Though we must keep in mind, the equipment grounding conductor is a safety device. Under normal operating conditions, this path will never have current flowing through it.  Because of this, the dangers from a device like this are limited.
Answer: These are "officially intended" for cases where the sockets are 2-prong, but yet, the receptacle is grounded.  The idea is to get proper ground from the receptacle cover plate screw, which would work if the receptacle was grounded.
Obviously, this situation is imaginary.  If an electrician went to all the trouble to use the more expensive /2+ground cable in 1964, he certainly would have fit the then-impressive 3-prong receptacle, as a selling point for his effort, and there would be no need for this adapter.
So this is called a cheater for a reason -- it's actually used to plug 3-prong things in locations which are actually not grounded.  Which, indeed, is playing with fire.  For instance the one in your photo allows polarized devices to be plugged in (taller neutral slot), but its pins are not polarized, breaking polarization!
Now the modern age gives us an alternative here, and that's to fit GFCI protection to the ungrounded circuit (a breaker, deadface or GFCI+receptacle here or upstream), with a "No Equipment Ground" sticker.  That will provide all the shock protection of a grounded outlet, but none of the equipment protection (hence the sticker).
Comment: Actually, the case of 2-prong yet ground available would happen back then if they were using BX or conduit -- it's only imaginary for receptacles wired with pre-ground NM.
Comment: @ThreePhaseEel I would have expected those to be upgraded the moment someone cared.  That's like, low hanging fruit!
Comment: +1 for the "imaginary" part.  What I find puzzling is why there aren't commonplace adapters with a GFCI built in, or even purpose-designed non-ground-to-three-prong GFCI outlets which, instead of leaving ground floating, have a current-limited connection to neutral (so that a hot-to-chassis fault will trip the GFCI immediately rather than waiting for someone to supply an alternate ground path).
Comment: @supercat There are, in fact, adapter cords which provide a GFCI inline.  There's a bit more to it than sticking a GFCI in a 2-gang steel box and hanging a pendant off it (thought of that).


Which tool can provide flexibility and simplicity? Argo vs Cellery vs Prefect

Question: I am currently working on the development of an API. I want to upload data via a frontend and this data is then processed on a server. I would like to develop the individual steps independently of one another and also maintain them independently. The first step of this dag is quite complex. There are a lot of different testing machines, each providing a slightly different set of raw data. Depending on the machine, a different task has to be started. In this step the file should be loaded and standardized. Afterwards, the data is passed on to several tasks for analysis (preferably also in parallel) and the results are finally stored in a database. The file size varies from a few MB to several GB.
The API will be extended later, performing calculations using the data previously stored in the database. The calculations are intensive in CPU times and memory usage.
Since I have not much knowledge of such complex structures, I have currently checked the following systems.
Argo
It requires its own Kubernetes cluster to deploy the system. Then you could deploy and run the individual tasks in containers in the cluster. The distribution of the resources takes over K8s. However, setting up the cluster is quite complex for me, since the system is to be set up on a cloud hoster at the end, which does not support Kubernetes natively. This would have to be set up manually. Another disadvantage is that the execution is quite slow, because one container has to be pushed and started at a time. Advantage extremely flexible and expandable. Possibly also future-proof, since each container can be maintained individually.
Celery and Prefect
You can easily code the individual processes in Python and define the dependencies. In Celery, you also have a task queue and therefore you can manage many individual tasks effectively. With Prefect, tasks that do not run in Python can be intercepted well via containers. However, there is no resource management and the systems do not appear to be so well extendable.
What other benefits does Argo offer over Prefect/Celery?
Thx
Answer: Full disclaimer that I work for Prefect but I think Prefect can indeed slot in nicely here where you have an API that hits Prefect's API to create_flow_runs to process that data that came in through the frontend. It also sounds like you need a decentralized solution where the compute happens on different machines. Prefect lets you do this by having multiple agents on those different machines, and then you can invoke flow runs that get picked up by the respective agents.
Yes, you are also right non Python tasks can be abstracted with containers and by using tasks to spin up containers. There is some degree of resource management offered by the agents because you can have them on multiple machines. If you decide to go to Kubernetes also for better resource management, Prefect also supports that and the Kubernetes agent can control the resources per container.
This might be a good resource for you
Comment: Thanks for the quick reply. I have a few more questions for you. If I receive multiple requests via my API and start one job each via prefect api, then do they run in parallel on the agends? Can the define the resources needed per job?


How to count number of user gives rating to specific item in jQuery AJAX

Question: I am trying to count how many user have given rating to specific products. My code is working fine but it just don't store the number of times a item is rated. For example, it store that item with id 17 is rated 5 by one user, 4 by other user, 3 by other user and so on but it could not store the overall users like 3 user give rating on item with 17.
Then, I initialize the count_rating variable with 0 and it get increment when any user click on rating. But still it shows count_rating for every product because may be I have put count_rating=count_rating++.
So, when the onclick function runs, it simply just increment the value.
It would be great if anyone look out my code and can edit my code.
All I want that once a user give rating to item with id 17, it increment the count_rating 1 and if another user give rating to same product then count_rating get increment to 2.
$(document).on('click', '.rating',function(){
    var count_rating=0;
    count_rating= count_rating+1;
    var index = $(this).data("index");
    var business_id = $(this).data('business_id');
    var username='<?php echo $_SESSION["username"];?>';
    var useremail='<?php echo $_SESSION["useremail"];?>';
    $.ajax({
        url:"search_rating.php",
        method:"POST",
        data:{index:index,business_id:business_id,username:username,useremail:useremail,count_rating:count_rating},
        success:function(data)
        {
            if(data == 'done')
            {
                alert("Dear "+username+",You rate "+index+" out of 5 for this product");
            }
            else if(data == 'update')
            {
                alert("Dear "+username+",you updated your rating for this product");
            }
            else
            {
                alert("Dear "+username+",Sorry but there is some problem in system");
            }
        }
    });
});

});

Comment: JavaScript is client-site you would need to collect these data on the server, preferably within some database.
Comment: Can you telll how can i collect the all data on server.In my server(XAMPP),it is storing that which item is rated by whom but it just not collect the all user data for specific item.
Comment: Just use some database engine, most probably MySQL as it's included in XAMPP. A more detailed answer will be possible if you'll implement any DB `INSERT` in your `search_rating.php` script.
Comment: yes,this script insert into search_rating
Comment: What i am thinking is that there should be additional code which can count rating with productid.but don't know how to do.Can you refer me some links where this kind of work is using.
Answer: Disclaimer: That, of course, is only POC, in real life your database structure, field types and other factors can differ, but this is something you should resolve yourself. This sample is tested and works as expected.

Let's do it!
First using PhpMyAdmin of your XAMPP create an empty database for this case let's name it test_ratings, make sure it uses some UTf-8 charset, I suggest utf8_general_ci and add columns/index to it with this code:
CREATE TABLE ratings (
 uid int(11) NOT NULL AUTO_INCREMENT,
 username varchar(255) NOT NULL,
 business_id int(11) NOT NULL,
 useremail varchar(255) NOT NULL,
 count_rating int(11) NOT NULL,
 PRIMARY KEY (uid)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8

Note, as index is reserved keyword in MySQL/MariaDB I renamed it to uid so reflect it in your JavaScript as well.
So finally, everything you need is to connect with your DB, INSERT or UPDATE the row, and return the updated state to the user.
Your search_rating.php should work like this:
<?php

// create a pdo object
$pdo = new PDO("mysql:host=localhost;dbname=test_ratings;charset=utf8", "yourusername", "yourpassword");
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

// Prepare INSERT/UPDATE query, bindValues, execute and get last inserted/updated uid
$stmt = $pdo->prepare("
    INSERT INTO ratings (uid, business_id, username, useremail, count_rating)
    VALUES (:uid, :business_id, :username, :useremail, :count_rating)
    ON DUPLICATE KEY UPDATE
        username=:username,
        business_id=:business_id,
        useremail=:useremail,
        count_rating=count_rating+:count_rating
");

$stmt->bindValue('uid',          $_POST['uid'],          PDO::PARAM_INT);
$stmt->bindValue('username',     $_POST['username'],     PDO::PARAM_STR);
$stmt->bindValue('business_id',  $_POST['business_id'],  PDO::PARAM_INT);
$stmt->bindValue('useremail',    $_POST['useremail'],    PDO::PARAM_STR);
$stmt->bindValue('count_rating', $_POST['count_rating'], PDO::PARAM_STR);
$stmt->execute();

$lastUid = $pdo->lastInsertId();

// Read updated value to return it to user
$stmt = $pdo->prepare("SELECT uid, count_rating FROM ratings where uid=:uid");
$res = $stmt->execute(['uid' => $lastUid]);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
echo("Record {$row['uid']} has rating: {$row['count_rating']} now.");

Note that as an AJAX response I would return something better than echoing raw string, ie. a JSON object with more details and proper CONTENT-TYPE, however, it's already up to you.
Comment: Well, thank you ao much for your effort and looking uopn on my code. But, i resolved it by my self. I tried so manyntimea and end wirh solving it. What i did is i fetch the data feom db and put Count on rating and atore it in session and call it in jquery. Its worked for me.
Comment: @aleena Great that you are working on your own solutions instead of waiting for ready-to-use solutions. That's the best way, always. Just make sure you're using parameterised statements and good luck :)
Comment: @aleena, just let me understand, you fetch current rating for your product when the user opens the page, you store it in session and later when he clicks to rate it you get a current rating from the session, increase by 5 and store to the database?
Comment: first of all,thankx for appreciation.Actually,there is a product decription page which shows product details along with how many user give rating to that product to users.To show product details,i fetched the data from that particular product from its table and i also used COUNT(rating) as rating_num to show how many users give rating to that product.But the problem was that i did not knew that how can i store that Count value in db because i am inserting the value through jquer via call ajax.So,then i get the value of rating_num in session and used it jquery part.


Is having only target SDK enough to develop UWP Application?

Question: This question sound's to be little basic but I don't find any documentation on MSDN. Actually, in my machine, I have 4 UWP SDK version(17134, 16299, 14393, 15063) installed which is consuming a lot of disk space.
My App min version is  14393 and target version is 15063. So the question is that do I need 14393 SDK or having only 15063 strong text is sufficient?
Comment: You must have min sdk version- which states min version of win 10 will required in client/user side. Extra Note: Currently windows 10 mobile has version 10.0.15254.xxx and few limited to 10.0.14393.xxx so if you are considering all device Min version will play a role
Answer:
My App min version is 14393 and target version is 15063. So the question is that do I need 14393 SDK or having only 15063 strong text is sufficient?

You could choose to install only 15063 SDK. Once you only install the 15063 SDK, then your target version could only set 15063 and the min version could be 10240 ~ 15063.
In short, only installing one SDK will not affect you to develop your UWP app, but you need to consider your app's users, their environment was not necessarily the same as yours.
For example, your project's target version is 15063 and min version is 10240, then, you develop and test your app on 15603 OS successfully, but your app can be installed on 14393 OS. In your code, once you call an API that is introduced from 15063, then the app run on 14393 will fail.
The document Choose which version to use for your app mentioned by @Bite has explained this scenario:

The value of Target Version is used to identify all the references (contract winmds) used to compile your project. But those references will enable you to compile your code with calls to APIs that won't necessarily exist on devices that you've declared that you support (via Minimum Version). Therefore, any API that was introduced after Minimum Version will need to be called via adaptive code. For more information about adaptive code, see Version adaptive code.
Answer:
Target Version. This sets the TargetPlatformVersion setting in your project file. It also determines the value of the TargetDeviceFamily@MaxVersionTested attribute in your app package manifest. The value you choose specifies the version of the UWP platform that your project is targeting—and therefore the set of APIs available to your app—so we recommend that you choose the most recent version possible. For more info about your app package manifest, and some guidelines around configuring TargetDeviceFamily manually, see TargetDeviceFamily.
Minimum Version. This sets the TargetPlatformMinVersion setting in your project file. It also determines the value of the TargetDeviceFamily@MinVersion attribute in your app package manifest. The value you choose specifies the minimum version of the UWP platform that your project can work with.

Please read Choose which version to use for your app. It has explained all information.
Comment: This doesn't answer the question.


Creating a fully functional website while only using vanilla coding

Question: When I say "Vanilla Coding", I am referring to websites that don't utilize server side coding (such as PHP, ASP, etc.), only HTML, JavaScript, and CSS.
I know that there are a plethora of sites that already exist that don't utilize (to my knowledge) any of the common, server side languages used by many others (PHP, ASP, etc.), but still function just fine!
I am confused!  How do these sites continue to save login information, keep records, etc. etc. without using a server side scripting language?  Is there something that I am missing?  Can JavaScript access more (such as databases and local files) than what I thought it could?
EDIT
Turns out I've made a serious and shameful mistake in assuming that just because it ended with a .html extension that it was client-side only.  That is okay though because I'm learning.  Thanks so much for the help everybody!
Comment: Do you have an example of these "plethora of sites"?  You do realize that a website can use `.html` as the page endings and still be using a server-side language (or no ending at all)?  Also, a page can post from `theform.html` -> `processform.php` -> `thankyou.html`, which utilized a server-side page to process but you never saw it.  And yes, `AJAX` technically can save login information, keep records, etc. entirely using `JavaScript` - but they will be talking to some server-side page somewhere.
Comment: @DalexL - there was always a server-side something if databases and dynamic applications were involved.  They were just called `CGI` way back when and written directly in `C` (or such like) instead of higher-level languages like `PHP` and `ASP.Net` with fancy tools like `IIS` or `Apache` to abstract away all of the underlying technology.
Comment: There was never such a time. I bet you within 24 hours of the first web site that was created using HTML coming online sometime around 1990, some clever guy figured out he could make a perl script generate HTML dynamically. They used to call it "cgi.
"
Comment: @DalexL; @mellamokb: And even before that, you didn't even have dedicated web servers, just programs written in C that implemented whatever bits of HTTP or, as was sometimes the case, Gopher they damned well pleased.
Comment: Oh - GET and POST are part of HTML 1.0: http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#GET  So I think we can assume that the "founders" had thought of server side processing from the outset. There would be no point in anything other than a parameterless "get" if there were no server side processing.
Comment: @mellamokb Was there not a time before these server side scripting languages started that this all worked?  Really, I don't know, you are probably right, that is why I am asking the question.  Here, have a point for the time being...
Comment: @mellamokb Is it a bad idea to utilize CGI?  What are the differences?
Comment: @mellamokb, btw, thanks for the help.  Have some more points!  You should have posted it as an answer but Williham Totland helped quite a bit.
Answer: Essentially, unless you have some sort of server-side programming, you don't stand a chance at making a site with any amount of functionality. To break it down for you:
What you can do without server-side scripting:

Serve static pages

What you need server-side scripting for:

Absolutely everything else

Even something so simple as keeping a site consistent and up to date is a nightmare on wheels without, at the very least, some some sort of management system that pre-generates the static pages to be served. (Technically, one could argue that Copy+Paste in Notepad counts as this.)
As has been mentioned elsewhere; obfuscating the true nature of precisely what system is being used is trivial; and having URLs ending in, say, .html while using PHP is no issue.
Edit: In the most perverse case I can think of off the top of my head, you could have a lighttpd server masquerading as an IIS server, serving pages generated by an offline renderer fed to it by a Perl FastCGI script, sent together with PHP signature heading and using a mix of .asp and .jsp file extensions.
Of course, noone would do something as silly as that. I think…
Comment: @DalexL: Well, here's the thing, tho'. It doesn't matter. Not one bit. As a user of the content, you shouldn't need to care, you shouldn't want to care, and you sure as hell shouldn't care one bit.
Answer: No client side script can access server side information (like a database) without some sort of server side communication (through something like ajax or the like)
If you really ( i mean really as in don't do it ) want to do logins and the like on clients side, you would have to make some sort of cookie that you store on the user's computer, also you would need a list of users (which anyone can read) to use against
Answer: This answer is very late but I leave this reply for anyone who may stumble upon it.
Using javascript/jQuery, and various APIs a simple site can be created only using client-side coding.
For instance, a simple shopping cart type of site can be created.  I've done it before.
There are few (not many) strictly 100% jQuery based shopping cart solutions that are open-source.
How does the PG (pay gateway) get taken care of?  You are limited to accepting payment through paypal, google checkout, and direct deposit.
What about allowing customers to leave comment?  You can use API's like Disqus.  What about chat support?  Zopim is pretty handy.
How do you get notified when purchase is made?  Paypal & google checkout notifies you.
What about sending mass email?  Mail Chimp.
Personally, I almost always use WordPress or some other types of CMS but using only vanilla coding to build a simple site is not only feasible but very sensible in certain circumstances.
Answer: You're not going to see whether a site is using a server side language unless they let you see the file extensions. With URL rewriting, MVC patterns, etc., it's easy to hide, or even fake that information. Therefore, chances are very good that the sites that you think aren't using a server side language are actually using one.
Now, a site can save certain information in cookies, such as some basic preferences, but any authentication they appear to be doing wouldn't actually be doing anything without a server-side script accessing a database somewhere.
As a side note - I have worked on a site where the content was actually static, but made to look like a blog or CMS. It was an absolute nightmare and hugely error-prone.
What are these sites that you think aren't using server-side scripting?
Comment: For what it's worth, PHP usually adds a response header when it "builds" a page; something like `X-Powered-By:PHP/5.2.17`
Comment: @sdleihssirhc: While this is true; this can a) be turned off in php.ini, and b) be spoofed in any other server-side language.
Answer: Nowadays a lot of sites are using Javascript as a server side solution, Node.js being the most popular. Check out this list: https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node


Replacing slimline breakers with tandems and quads?

Question: I've got a sub-panel that's full of the wrong breakers (not compatible with the panel per the label). The majority of these are slim lines.
I want to replace the bad breakers with Eaton BR/C, which is allowed per the labeling. However, it seems they don't make these in slimlines - just tandems and quads.
I know there are some restrictions on MWBCs with tandems, but that shouldn't be a problem with the quads.
So does this seem like a reasonable plan? Is there more to consider here?
Here's some shots of the labeling and the current install.
Comment: I just wanted to check and make sure there wasn't a problem with doing that.
Comment: What's wrong with just replacing your pairs of slimlines with tandems?  Panel can't handle so many tandems?  It looks like you already have one Eaton tandem.
Answer: I don't remember seeing many handle ties in your panel.  MWBCs require those now.  They do not require common trip, however. That means Eaton breakers like BD220220 (not BDC220220) are fair game.
Left-right handed slimlines are dead as a product and will never return. That bus clip is quite "dainty" and also poorly guarded (being on the edge of the breaker, rather than center like GE thins) That made them prone to damage, and if clamping force is not correct it'll burn up the bus stab and put 4 breaker positions out of action.  Or worse.
Tandems and quadplex are simply slimlines factory bolted together, or a little bit more in one case.  Quadplex breakers come in two major formats.

2-pole breaker in the middle and two singles on the outside.
2-pole breaker in the middle and another 2-pole breaker on the outside, with a hinky looking handle tie tying them together.

The hinky looking ties make you think "how can that possibly cause common trip? It will simply tram."  Sure but here's the breaker secret inside a secret.  Breakers "trip free" - they trip even if the handle is held or locked "on". Therefore... handle-ties would not work as a common-trip method, and are not used for that. Common trip is a separate internal mechanism inside the breaker. The handle tie is to help maintainers shut off the whole circuit so they don't get nailed.
...and that's why... on Eaton breakers the common-trip mechanism might not be there.  They make quads in two flavors: with and without.
"Without" is acceptable for MWBCs if they do not serve any 120V loads.  "Without" is also acceptable for 240V-only loads which do not have a neutral.  I don't why Eaton bothers to produce no-common-trip quads. Nobody ever died because their breaker was common-trip that didn't need to be.  Most makers do common trip on the inner, and not on the outer.
With MWBCs, you need to wire then like a 120/240V load with the hots on opposite pole.  So you don't use them with tandems.  On a quadplex you put a given MWBC on the inner breaker or the outer one.
It helps to be able to visualize your panel's spaces as full spaces, in which two slimlines share a space.  And then see the red/black striping a-la my answer on tandems.


How to resign an app with app store provisioning profile to add beta-reports-active key?

Question: In order to distribute apps via Apple's new Test Flight service the beta-reports-active key needs to be present. Currently I'm using Apple's bot server to distribute to the old Test Flight system with and Ad Hoc distribution profile. Using a post build trigger I want to take the archive that is created and build an App Store Distribution ipa that I can upload to iTunes Connect. I've written a script that does this. I use the xcrun command to build:
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${APP_STORE_IPA}" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}"
The SIGNING_IDENTITY and PROVISIONING_PROFILE are both app store distribution certificates/profiles. So the provisioning profile is getting embedded in the ipa and it contains the beta-reports-active flag. However, when I look at the ipa to verify its entitlements it is not present.
What am I doing wrong? All information I've seen on this has just suggested regenerating the provisioning profile. I've done this and know the key is present. It is not getting added to the entitlements. I have a widget that gets bundled in the ipa as well. I am not resigning that.
Comment: Can you try this nifty script. I haven't tried it myself

https://github.com/KrauseFx/sigh
Answer: You could always try using the xcodebuild export command:
xcodebuild -exportArchive -archivePath '{APP}' -exportPath '{IPA}' \
-exportFormat 'ipa' -exportWithOriginalSigningIdentity

or if you want a different profile and identity:
xcodebuild -exportArchive -archivePath '{APP}' -exportPath '{IPA}' \
-exportFormat 'ipa' -exportWithOriginalSigningIdentity \
-exportProvisioningProfile {profilename} -exportSigningIdentity {identityname}

See man xcodebuild for more info.
Comment: I think you might need to make sure your signing identity is full specified. I.e. instead of just "iPhone Distribution" you use "iPhone Distribution: Company Ltd. (ABCD1234)"
Comment: Thanks for the suggestion. I'm working on modifying my script to use that command instead. Right now it's failing with this: "error: mismatch between specified provisioning profile and signing identity"

This is confusing to me because I've verified that the Provisioning Profile is the correct one and I'm signing with my iOS Distribution certificate. Any thoughts?
Comment: @jervine10 Also, the value for `-exportProvisioningProfile` is the name, not the UUID, not the filename, but the actual name of the profile (as it shows up on the Provisioning Profiles section in the Xcode build settings). If you need help finding this, let me know.
Comment: Thanks, I did manage to figure that out, but after that is where I'm getting the error I mentioned.
Comment: @jervine10 Do the App Ids of the provisioning profiles you're using match?
Comment: I'm awarding you the bounty because I think this is going to be the correct approach. I was pulled from this task this week to work on something else, so I haven't been able to complete my investigation. I will report progress hopefully this week. Thanks again!
Comment: @jervine10 Another tip: If you want to verify the package before uploading to iTunesConnect, run `codesign --verify --verbose=2 --no-strict /path/to/package.xcarchive/Products/Applications/AppName.app`. This will print out `valid on disk` and `satisfies its Designated Requirment` if it's got the right provisioning profile and is signed with the right cert.
Answer: Alright so I think I've finally got this figured out. It seems as though the Bot Server may have a few kinks that Apple needs to iron out. I noticed that the Distribution IPA that is generated by the Bot Server lacks any of the required entitlements of my Application. I did a little searching and found other people are having the same problem. Here's a question that explains the issue really well: IPA created via Xcode bot fails to run for APNS but runs if built manually via Xcode itself or built as an archive by Xcode
So with this in mind I created and added an entitlement file to my project with the minimum entitlements I needed. I also did the same for the widget that is in my project. Then during my post integration trigger I read both entitlement files and add the necessary entitlements to it.
# Copy the Entitlements file out of the payload so we can update it
APP_ENTITLEMENTS="/tmp/distributionEntitlements.plist"
rm -rf ${APP_ENTITLEMENTS}
codesign -d --entitlements :${APP_ENTITLEMENTS} "/tmp/Payload/MyAppName.app"

WIDGET_ENTITLEMENTS="/tmp/widgetDistributionEntitlements.plist"
rm -rf ${WIDGET_ENTITLEMENTS}
codesign -d --entitlements :${WIDGET_ENTITLEMENTS} "/tmp/Payload/MyAppName.app/Plugins/${WIDGET_NAME}"

# Copy over the latest build the bot just created
echo "Copying latest Archive to /tmp/...";
cp -Rp "${XCS_ARCHIVE}" "/tmp/"

APP="/tmp/Archive.xcarchive/Products/Applications/MyAppName.app"

echo "Updating entitlements file"
/usr/libexec/PlistBuddy -c "Add :beta-reports-active bool true" ${APP_ENTITLEMENTS}
/usr/libexec/PlistBuddy -c "Add :aps-environment string production" ${APP_ENTITLEMENTS}
cat ${APP_ENTITLEMENTS}

echo "Updating widget entitlements file"
/usr/libexec/PlistBuddy -c "Add :beta-reports-active bool true" ${WIDGET_ENTITLEMENTS}
cat ${WIDGET_ENTITLEMENTS}

Then of course you have to codesign these apps again:
echo "Codesign the widget"
cp "${WIDGET_PROVISIONING_PROFILE}" "${APP}/Plugins/${WIDGET_NAME}/embedded.mobileprovision"
codesign -fv -s "${FULL_SIGNING_IDENTITY}" "${APP}/Plugins/${WIDGET_NAME}" --entitlements "${WIDGET_ENTITLEMENTS}" --preserve-metadata=resource-rules,requirements

echo "Codesign the app"
codesign -fv -s "${FULL_SIGNING_IDENTITY}" "${APP}" --entitlements "${APP_ENTITLEMENTS}" --preserve-metadata=resource-rules,requirements

echo "Creating .ipa"
# Remove any whitespace
FILENAME=${XCS_BOT_NAME// /}
echo "Filename: ${FILENAME}"
APP_STORE_IPA="/tmp/${FILENAME}_AppStore_${VERSION_NUMBER}.ipa"
rm "${APP_STORE_IPA}"
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${APP_STORE_IPA}" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}"

After all this, I can upload this IPA to Apple and distribute it using their new TestFlight beta distribution tool.
Answer: I use the following commands to resign an ipa which may work for you.  The basic technique is to unzip the ipa, add in the desired mobile provisioning profile, resign the code with the desired certificate and then zip into the new ipa.
unzip -q "${IPAFILE}"
cp "${PROV_PROFILE}" Payload/*.app/embedded.mobileprovision
/usr/bin/codesign -f -s "${SIGN_CERT}"  --keychain "${KEYCHAIN}" \
     --entitlements Payload/*.app/$APP-Entitlements.plist \
     --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app
zip -qr "${NEW_IPAFILE}" Payload

You may be able to leave out the --keychain option if you're using the standard keychain.  The name of your Entitlements.plist file may be different.  SIGN_CERT is the text name of your certificate.  e.g. "iPhone Distribution: Blah Blah"
Be sure that the Entitlements plist has the same TEAM ID as your signing cert and provisioning profile.
Answer: Xcode adds this beta entitlement to your entitlement list automatically. You just have to make a new revision, click on the Team account under the identity, reselect your account and the new profile will be remade by iTunes connect.
After that, upload your new binary.
Once it is uploaded you can assign beta testers to your app, selecting the pre-release version and adding the internal or external beta testers to the list.
I hope it helped.
Answer: A better way of doing this would be set the Release provisioning profile to the App store profile. Then you won't need to provide the --embed flag and the beta reports flag will be true.

Then if you also need a adhoc build you can provide the same xcrun command --embed  with the adhoc provisioning profile.
ARCHIVE = "${ARCHIVE_FOLDER}/Products/Applications/${PRODUCT_NAME}.app"

#Adhoc
/usr/bin/xcrun -sdk iphoneos PackageApplication -v ARCHIVE -o IPA_DESTINATION --sign "SIGNING_IDENTITY" --embed PATH_TO_PROVISIONING_PROFILE

#App Store
/usr/bin/xcrun -sdk iphoneos PackageApplication -v ARCHIVE -o IPA_DESTINATION --sign "SIGNING_IDENTITY"


How to configure Tomcat to run an Google App Engine + GWT application on Mac OS X?

Question: Does anyone know a good tutorial on this?
What Tomcat version must be used?
Answer: You can't use Tomcat to run an App Engine app (unless it doesn't make use of any App Engine specific APIs - in which case, configure it as you would for any other servlet app). You need to use the provided SDK, or the Eclipse plugin, documented here.


Dual boot on two ssd's

Question: Dual booting and ubuntu are quite new to me as I only installed ubuntu a month ago on my laptop (I'm not using it every day since I got windows as well).
I just bought all the parts to build a new desktop computer (I'm waiting for them to arrive) and I'm planning to install both windows and ubuntu on it. The thing is I am going to have two SSD's (one I bought and one I get for free with the motherboard I bought). The one I bought is way faster, so I would like to install windows on it with all the other programs and games I plan to install.
I am willing to install ubuntu on the second ssd, but still keep some space on it (I want to allocate 100 Gb to Ubuntu and "give" the rest for windows). How could I do that?
I'm sorry if I appear like a noob but I kinda am in this matter :3
Thanks for your time.
Comment: Just be sure to install both systems in UEFI boot mode, or if really desired you can use BIOS boot mode. How you boot install media UEFI or BIOS is then how it installs. May be easier just to only connect one drive at a time. If both drives connected Install Windows first, and only use Something Else install option with Ubuntu. http://askubuntu.com/questions/743095/how-to-prepare-a-disk-on-an-efi-based-pc-for-ubuntu and:  https://help.ubuntu.com/community/UEFI
Answer: This is a combined Windows-Ubuntu Question and Windows is off-topic here, so I would install the other OS first on its own hard drive in MBR mode and let the BIOS figure out how to do it:  when you want to switch from that other OS to installing Ubuntu:

reboot,
hit the F12 or whatever key the BIOS wants you to hit to boot from another drive drive, and let the BIOS then fail onto USB/DVD (whatever you're installing Ubuntu from).
install Ubuntu taking only as much as you need (take the "Something else" option while installing Ubuntu)
then boot back to that other OS and then allocate the free space on the second hard drive to it.

Especially: Install both OSes as bare as possible as you've never done this before as you're bound to make a mistake somewhere and you want to avoid losing anything valuable.
Comment: And start out with installing windows first, much less error prone as the other way around.
Comment: @Videonauth that's what I said:  "Install *the other OS* first"  **:-)**

Dual boot on two ssd's


removeClass and then addClass not working

Question: When I click click on a div, that div is covered by a black line.
But when I click on any other div, I want the old div to remove those black lines and only the current div should have the border. Below is the code I am trying to follow:
var addDiv = document.getElementById("addDiv");

addDiv.addEventListener("contextmenu", function(event) {
  event.preventDefault();

  if ($(event.target).hasClass('context_menu')) {
    $(event.target).siblings('.clickedDiv').removeClass('clickedDiv');
    $(event.target).addClass('clickedDiv');
    console.log($(event.target).addClass('clickedDiv'));
  } else {
    $(event.target).parent().addClass('clickedDiv');
  }

  $("#ctxMenu").css({
    'top': event.pageY,
    'left': event.pageX
  }); // only this line to be added
  $("#ctxMenu").show();
}, false);

addDiv.addEventListener("click", function(event) {
  $("#ctxMenu").hide();
}, false);

Above code is triggered on right click.
I want when I right click div with id #addDiv it should remove 'clickedDiv` class from everywhere and then proceed with the code to add the class on the clicked div.
My html code:

Clone

Change Image

Comment: K so, I am still seeing that you're binding the `contextmenu` event only on `addDiv`. When your context says `when i click on any other div, i want the old div to remove those black lines and only the current div should have the border`. I think you should also post your html here
Comment: "Remove `clickedDiv` from everywhere". Do you mean `#addDiv`?
Comment: updated my code, trying with this `$(event.target).siblings('.clickedDiv').removeClass('clickedDiv');`  but this line is not working
Comment: you can simply select all div containing class `clickedDiv` and add to `event.target` element. `$(".clickedDiv").removeClass("clickedDiv"); $(event.target).addClass("clickedDiv");`
Comment: I have updated the question with the html code
Answer: Add a second class to all the divs and then remove the clickedDiv class from every member of the second class.
Something like:
$(".clickableDiv").on("contextmenu", function() {
    $(".clickableDiv").removeClass("clickedDiv");
    $(this).addClass("clickedDiv");
});

And the HTML:

Answer: Update your code to the following:
$("#addDiv").bind("contextmenu",function(event){
    event.preventDefault();

    if($(event.target).hasClass('context_menu')){
        $(event.target).siblings('.clickedDiv').removeClass('clickedDiv');
        $(event.target).addClass('clickedDiv');
        console.log($(event.target).addClass('clickedDiv'));
}
else{
  $(event.target).parent().addClass('clickedDiv');
}

    $("#ctxMenu").css({'top':event.pageY,'left':event.pageX});   // only this line to be added
    $("#ctxMenu").show();
},false);

$('#addDiv').on("click",function(event){
    $("#ctxMenu").hide();
},false);

You should use bind and on to register the event listeners.
Comment: Add event listener line, please add, without it, it won't work
Comment: without this line ` addDiv.addEventListener("contextmenu",function(event){`  this is not working, on right click my menu not coming, can you come on team viewer
Comment: not working, let me know if you can take screenshare


Bandwidth usage per minecraft player

Question: I have a working MC server and multiple users who log on, however due to poor connection/excessive ping play can become unbearable
Does anyone know of a definitive or close approximation to the bandwidth required per player connected in a minecraft server?
Any information or links regarding this topic would be helpful :) thanks.
Edit
As has been mentioned, the amount will vary greatly.
Using the specific case of:

64 mobs hostile+passive
144 loaded chunks
4 players (not moving)

would someone with sufficient knowledge be able to break down net usage of this use case? e.g. usage per mob / usage per chunk...
and/or provide a total average usage of the above case
Please know that estimations WILL DO (per player)
Comment: depends on various things, if there are a lot of enemies then each enemy will have to transmit its location to each player in range, if a player is exploring then he will load new chunks constantly
Comment: It totally depends on how many changes are occurring in loaded chunks near a given player that need to be transmitted to their client every frame. If there are lots of mobs, lots of redstone, lots of changing liquid flows, lots of explosions, lots of mod-added machinery, lots of... You see the trouble? There are too many variables to give a practical answer. Your best answer would be to answer this for your own case by actually looking at your network traffic up and down with different numbers of players under different conditions.
Answer: If the chunks are not being updated, the players are still and the mobs are also still, it is only 1 byte per tick. So, 20 bytes/s.
If all the players are moving and so are the mobs, it is 42 bytes per tick per mob. So: 68 mobs * 42 bytes per tick * 20 ticks per second = 57.1kb/s.
Add in chunk updates:
68 mobs * 42 bytes per tick + 2 chunks per tick * 18 bytes + size of compressed chunk (16 kb for just 1 block 64x16x16) *20 ticks per second = 642.856 kb/s.
This is still very low usage because redstone would cause extra chunk updates as lava and water would. As well, only 64 mobs is quite few. Mainly, it is chunk updates that cause the problem. If the average player is exploring for new terrain, you can expect 10 or maybe 15 chunks to be updating at a time so then it becomes (using 15 as our number), 4.802 mb/s. It is all explained here: www.wiki.vg/Protocol
Comment: Please properly capitalize your bytes and bits!
Answer: there are 8 bits (or 1 byte) of data in each block. Air blocks are not saved, so they dont count.. But if you had solid blocks all the way to the world ceiling, The maximum data per chunk is 16x16x256 bytes.. Or 65536 bytes = 65 Kilobytes. That is unless you have objects such as chests,etc in that chunk which holds more data due to the items in them. So basically 16 (FULL) chunks would be 1 megabyte... But do keep in mind, the average height of calculated blocks is a tiny bit over 1/3 of that... So on average, in a regular minecraft world, your looking at 1 megabyte per (around) 50 chunks. so roughly... 7x7 chunks = 1 megabyte. Broken down to Blockspace, that is 112x112 block area = 1 megabyte.  So you can calculate based on your servers allotted render distance. The above answer is wrong in the sense that the calculations for spawning etc are not handled by the internet connection. It just says "monster is here". or "damage accrued" The calculations of movement is done at the server, then the x/y/z position is passed along which your computer then renders what the movement should look like from it's last known position.
Comment: That does not answer the question. Your calculations are valid, but you haven't given us a definite answer, and also - World data is compressed.
Comment: No, the calculations don't take the actual world serialization and compression into account.

Bandwidth usage per minecraft player


Can I customize my controls exactly the way I want them?

Question: I cannot play with the default controller layout at all.  Having to press the left joystick to run is awful and none of the presets are any better.
Is there really such a game in the year 2013 that doesn't let you program each button to the command you want?
Comment: PC gaming allows you to customize completely, try using a mouse instead of a controller if it's really that bad for you
Answer: Most console games don't allow the full customization of the controls, to build upon this I am willing to say that ALL fps' have strict control setups built into the game. Although, I can be wrong. To answer your question, yes, BO2 doesn't allow full controller editing.


pop up select list for android

Question: I am trying to get away from using 5 buttons when I would like to have one when pressed pops up a window that allows the user to select where they want to go.
Example: button "Country"
 <Button
android:id="@+id/countrySelect"
android:layout_width="300px"
android:layout_height="wrap_content"
android:text="@string/backhome"
android:layout_x="8px"
android:layout_y="21px"
>
</Button>

and when pressed it would pop up a list of countrys to select from: Something like-
countrySelect.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View view){

           //POP UP SELECT MENU WHEN SELECTED START A NEW INTENT
           Intent myIntent = new Intent(view.getContext(), ***SELECT MENU CONTROLS***.class);
           startActivityForResult(myIntent, 0);

        }

 });

Sorry this probably is easy fix but I am not having much luck when I researched it.
Answer: You could use AlertDialog for that. It can show a list of items and react when user taps on any of them http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog
Comment: Excellent link. Contains lots of useful examples. +1.
Comment: Thanks I will take a look at the documentation.
Answer: You can add spinner in your layout.xml :
<Spinner
android:id="@+id/areaspinner"
android:layout_width="150dip"
android:layout_height="40dip"
android:drawSelectorOnTop="true"
android:padding="5dip"
android:paddingLeft="10dip"/>

Now in Activity.java :
areaspinner = (Spinner) findViewById(R.id.areaspinner);
    ArrayAdapter<String> adapter2 = new ArrayAdapter<String>(this,
            android.R.layout.simple_spinner_item, array);  //array you are populating
    adapter2.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
    areaspinner.setAdapter(adapter2);
        areaspinner.setSelection(Integer.parseInt(strarea));

Now you can get gtghe selected value from the spinner by :
int ipos=areaspinner.getSelectedItemPosition();
String str=array[iPos];

Good luck.
Answer: Why don't you use Spinner or Single choice alert dialog for the same.
http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog
Comment: Thanks I will take a look at the documentation.
Answer: If you want a popup menu like a spinner but with a button, you can use PopupMenu
see this example

pop up select list for android


MIN function in Excel

Question: I need to find minimums in a list of companies and prices. For example in one column I have apples, pears and grapes. For each of these there are several sellers and each of them has a different price. The list in the A coulmn would be Apple, Apple, Apple, Grapes, Grapes, Pear, Pear, Pear, Pear. In B would be Target, Trader Joe's, Harris Teeter etc... And in column C would be the price. Fruits in column A are in alphabetical order. I need to find a separate minimum for every fruit. I can do that manually except I have thousands of rows of data.
I'm thinking along the lines that I need to specify the area in which I want to return the minimum from. That would be as long as the entity in column A is the same, that's the area.
Does anyone know a solution for this problem?
Answer: If data starts at row 2 (headers in row 1) try this formula in D2 copied down
<code>=IF(A2=A1,"",MIN(OFFSET(C2,0,0,COUNTIF(A:A,A2))))</code>
That will give you the minimum price on the first row of each fruit. Filter column D on non-blanks to see just the minimums
Comment: Thank you! That's excactly what I needed!
Comment: Actually, in the D column I need the minimum in every row. So if the cheapest pear is 1 dollar, I need the D column in every row of pears say "1". Even if another store sells it for 2, I need column D of that row say "1".
Comment: Found the solution :)
Answer: Use a combination of IF and MIN
<code>=MIN( IF ( logical_test, value_if_true, value_if_false ) )
</code>
e.g.
<code>=MIN( IF ( A2:A100="Apple", B2:B100, 0 ) )
</code>
Answer: You can use PivotTables:

Select your data and insert a PivotTable:

Choose a location to put it. I'll put it in the same sheet:

Click, drag and drop the fruits under Row Label and the Price under Row Values:

Right click on the PivotTable and pick Summarise by > Minimum:

And you should end up with this:
Comment: Found another answer but thank you for yours anyway!
Comment: @user3432836 As long as you have solved your problem, don't worry :) I always try to use PivotTables where possbile. It's a powerful tool of Excel that doesn't need much to learn so someone can use it, and you don't have to remember functions to carry out basic tasks!
Comment: Yes, pivot tables are great but not what I can use for my particular table. I simplified my table greatly for the purpose of the question.
Comment: @user3432836 Ahh, I see :) You should [accept](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) Barry's answer then. It'll indicate that your problem was solved using his solution :)
Comment: Gladly but I couldn't find where I can do that?
Comment: You should see the outline of a tick near barry's answer and you click once on it to mark it as accepted.

MIN function in Excel


How to copy over RDS to an Elastic Beanstalk clone

Question: When I clone an environment in Elastic Beanstalk, the content of the RDS database on the environment doesn't come onto the clone. Is there a good way to get this behavior?
I have a snapshot of the original RDS database but I can't restore it to the exising environment. Also, in the EBS environment, I can't specify a new RDS database for that environment to use.
Answer: Couple of clarifying things...first, Elastic Beanstalk is abbreviated EB, as EBS stands for Elastic Block Store. Second, EB instances are wholly separate from RDS instances, so you'll need to "clone" the RDS instance separately. And finally, the concept of restoring RDS snapshots is a little different than in other RDBMS systems - restoring a snapshot creates an entirely new RDS instance. There is no way to replace the data in-place.
So, I would recommend that you restore the snapshot and then point your cloned EB instance at the new RDS instance by setting the RDS_HOSTNAME environment variable to the new endpoint.


Are all FD-spaces strictly convex?

Question: Suppose $(V, \|\cdot\|_V)$ and $(W, \|\cdot\|_W)$ are two Banach spaces and $f: V \to W$ is some function. We call a bounded linear operator $A \in B(V, W)$ Fréchet derivative of $f$ in $x \in V$ iff
$$\lim_{h \to 0} \frac{\|f(x + h) - f(x) - Ah\|_W}{\|h\|_V} = 0$$
We call a $f$ Fréchet differentiable in $x$ iff there exists a Fréchet derivative of $f$ in $x$.
We call a Banach space $(V, \|v\|)$ FD-space iff $f: V \to \mathbb{R}, v \mapsto \|v\|_V$ is Fréchet differentiable $\forall x \in V \setminus \{0\}$.
We call a Banach space $(V, \|v\|)$ strictly convex, iff $\forall x \neq y \in V, \lambda \in (0,1)$ if $\|x\|=\|y\|=1$, then $x + \lambda(y-x) < 1$.

Are all FD-spaces strictly convex?

Currently I know two classes of examples of FD-spaces and both of them satisfy this property:

All Hilbert spaces are FD-spaces.

Proof:
One can manually check, that $h \mapsto \frac{h}{2\sqrt{x_0}}$ is a Fréchet derivative for $x \mapsto \sqrt{|x|}$ in $x_0 \neq 0$. One can also manually check, that $h \mapsto 2\langle v, h \rangle_V$ is a Fréchet derivative for $x \mapsto \langle x, x \rangle_V$ in all $v \in V$. And it is a well known fact, that the composition of Fréchet derivatives of two functions is a Fréchet derivative of their composition. Thus, as $\|v\|_V = \sqrt{\langle v, v \rangle_V}$, we have, that $h \mapsto \ \frac{\langle v, h \rangle_V}{\|v\|_V}$ is a Fréchet derivative of $\|v\|_V$ in all $v \in V \setminus \{0\}$.

All Hilbert spaces are strictly convex

Proof:
If $\langle x, x\rangle = 1$ and $\langle y, y \rangle = 1$, then $\langle x + \lambda(y-x), x + \lambda(y-x)  \rangle = (1-\lambda)^2 + \lambda^2 + 2(1-\lambda)\lambda \langle x, y \rangle < (1-\lambda)^2 + \lambda^2 + 2(1-\lambda)\lambda = 1$

Suppose $(X, \Omega, \mu)$ is a measurable space, $n \in \mathbb{N}$. Then $L_{2n}(X, \Omega, \mu)$ is FD-space.

Proof:
One can manually check, that $h \mapsto 2n\int_X f^{2n-1}hd\mu$ is the Fréchet derivative for $\int_X f^{2n}d\mu$.

Suppose $(X, \Omega, \mu)$ is a measurable space, $n \in \mathbb{N}$. Then $L_{2n}(X, \Omega, \mu)$ is strictly convex.

Proof:
Suppose $\int_X f^{2n}d\mu = \int_X g^{2n}d\mu = 1$ and $f \neq g$. Then $\int_X (\lambda f + (1 - \lambda)g)^{2n}d\mu < \sum_{i=0}^2n C_n^i\lambda^i(1 - \lambda)^{2n - i}$
However I do not know how to prove this statement in general.
Note however that not all strictly convex spaces are FD-spaces. An example of a strictly convex space that is not a FD-space is $(\mathbb{R}^2, \|(x,y)\| := \sqrt{ \max(x^2 + 2y^2, \ 2x^2 + y^2 )})$.
Answer: In $V = \mathbb{R}^2$, consider the set $B$ of points $p$ with $\lVert p\rVert_{\infty}\leqslant 1$, such that either (at least) one of the components is $\leqslant 1/2$ in absolute value, or the Euclidean distance to one of the four points $(\pm 1/2, \pm 1/2)$ is $\leqslant 1/2$. Thus we round the corners, and do so that the boundary curve is $C^1$. Let $\lVert\,\cdot\,\rVert$ be the Minkowski functional of $B$. Then $(V,\lVert\,\cdot\,\rVert)$ is not strictly convex, but since $\partial B$ is a $C^1$ curve, it is an FD-space.
The first assertion is obvious, for the second we need a little work.
Consider a point $(x,y)$ in the right half-plane with $\lvert y\rvert < \frac{1}{2} x$. Then $\lVert (x,y)\rVert = x$, which is continuously differentiable in that angular wedge. Consider next a point in the right half-plane with $\frac{1}{2} x < y < 2x$. Let $t = \lVert (x,y)\rVert$. Then
\begin{aligned}
&&(t^{-1}x - 1/2)^2 + (t^{-1}y - 1/2)^2 &= 1/4 \\
&\iff& (x - t/2)^2 + (y - t/2)^2 &= t^2/4 \\
&\iff& \frac{t^2}{4} - (x+y)t + x^2 + y^2 &= 0 \\
&\iff& (t/2 - (x+y))^2 &= 2xy \\
&\iff& 2(x+y) \pm 2\sqrt{2xy} &= t\,.
\end{aligned}
Looking at $x = y = 1/2$ shows that the correct sign is $-$, so $\lVert (x,y)\rVert = 2(x+y) - 2\sqrt{2xy}$ in the wedge $\frac{1}{2}x < y < 2x$ of the right half-plane. This is also continuously differentiable.
It remains to consider the line $y = \frac{1}{2} x$, where we must check that the derivatives fit together. Then the differentiability on all of $\mathbb{R}^2 \setminus \{(0,0)\}$ follows by symmetry. On the wedge $\lvert y\rvert < \frac{1}{2} x$ the derivative is constant, its matrix is $\begin{bmatrix}1& 0\end{bmatrix}$. On the wedge $\frac{1}{2} x < y < 2x$ the Jordan matrix is
$$\begin{bmatrix} 2 - \sqrt{\frac{2y}{x}} & 2 - \sqrt{\frac{2x}{y}}\end{bmatrix}\,.$$
On the line $y = \frac{1}{2}x$ these coincide, hence the norm is continuously differentiable everywhere except at $(0,0)$.
Thus an FD-space need not be strictly convex.

Are all FD-spaces strictly convex?


What is the difference between these two versions of code in JUnit?

Question: What is the difference between the code in Junit:
class MethodsTest {
    Methods methods = new Methods();
}

and these:
class MethodsTest {

    Methods methods;
    @BeforeEach
    void init() {
        methods = new Methods();
    }
}

When to use first code and when to use second code?
Answer: In the first version, you hope that the particular test runner you're using is creating a new instance of MethodsTest implicitly creating a new instance of Methods when executing a particluar test. In the second version, you're telling the test runner you're using explicitly to create a new instance of Methods when executing a new test.
Answer: If there is no inheritance involved, there is no difference.
If you were to extend the MethodsTest class, you could override the init() method, and the overriding method would not necessarily either initialize the field directly, or perhaps indirectly by invoking super.init(); or it could initialize it differently.
Personally, I would prefer the first. It's more concise, not overrideable, and its semantics are obvious to anybody familiar with Java, even without JUnit-specific knowledge.


Using The Pigeon-Hole Principle

Question:
Let n be a positive integer. Show that in any set of n consecutive integers there is exactly one divisible by n.

Here is the solution:

Let $a,~a+1,...,a+n-1$ be the integers in the sequence. The integers $(a+i)\mod n$, $i=0,1,2,...,n-1$, are distinct, because $0 < (a+j) - (a+k) < n$ whenever $0 \le k < j \le n -1$. Because there are n possible values for $(a+i)\mod n$ and there are n different integers in the set, each of these values is taken exactly once. It follow that there is exactly one integer in the sequence that is divisible by n.

Few things I don't quite understand:
Why is the sequence of integers $a,~a+1,...,a+n-1$, instead of being $a,~a+1,...,a+n$?
How does $0 < (a+j) - (a+k) < n$ make the values calculated from the modulus distinct? Also, what is the motivation for $0 < (a+j) - (a+k) < n$? Why are we allowed to use this fact?
Comment: If you want you could use: $a+1, a+2, \ldots, a+n$.
Comment: The reason being that it ends at $a+n-1$ is that if it ended at $a+n$, it would be a set of $n+1$ consecutive integers and conceivably, there could be two integers divisible by $n$ in the set. This would happen if $a$ is divisible by $n$.
Answer: There are $n$ integers. $a = a+0$, so if you had $\{ a, a+1, \ldots, a+n\}$, then you have a "$+0$", "$+1$", and so on up to "$+n$" -- the $a+0$ term counts, so you would have $n+1$ terms.
If $0 \le k < j < n-1$, then $j > k$, and $(a+j)-(a+k) = a+j-a-k = a-a+j-k = j-k > 0$. But since $j-k < j$, and $j \le n-1$, then $j-k < n$.
So the moduli must be distinct simply by definition of how modular arithmetic works. You can't have something divisible by $n$ more frequently than once every $n$ terms!
Comment: Assume that $(a+j) \bmod n$ and $(a+k)\bmod n$ are both some integer $N$. Then, $a+j = c_1n + N$ and $a+k = c_2n+N$ by the division algorithm. Then, $a+j-(a+k) = c_1n+N - (c_2n +N)$, implying that $j-k = (c_1-c_2)n$, so $j-k$ is divisible by $n$. But $0<j-k<n$, so this conclusion must be false.
Comment: So there difference being less than n--that is, $j - k < n$--proves that when taking the modulus the result is distinct? I'm sorry, I don't quite see it.
Comment: Thank you very much. Since we have $n$ integers, so we could start from $0, 1, \cdots , n-1$ and that would make up $n$. So, if we take $j = n, k=0$ then $j-k$ would be divisible by $n$. Is that correct please?

Using The Pigeon-Hole Principle


finding the minimum speed of a particle

Question: A particle $P$ is moving along a straight line. The fixed point $O$ lies on the line. At time $t\geq0$ seconds, the displacement of $P$ from $O$ is $s$ meters where $s = t^3 -9t^2 + 33t - 6$. Find the minimum speed of $P$.
Edit:
So I've tried to differentiate and solve for t when the displacement between them is equal to zero and I got this:
$3t^2 - 18t + 33 = 0$. I divided the equation by three to get $t^2 - 6t + 11 = 0.$ I then tried solving for t but I keep got stuck at $(t - 3) ^ 2 = -11 + 9$.
Edit #2:
I got it now. The answer is 6
Comment: Welcome to MSE! What attempts have you done so far? Where are you stuck? Please use [mathjax](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference) to show your work and review the [meta read](https://math.meta.stackexchange.com/questions/9959/how-to-ask-a-good-question) for tips on providing context in your question to better assist the community.
Comment: Keep in mind that $ds/dt$ gives you the velocity at time $t$, but you don't want the *velocity* to be $0$; you want the *change* in velocity (that is, the acceleration) to be $0$.  Find out when that happens, *then* evaluate the velocity at that time.  (ETA: And confirm that the velocity is indeed at a minimum at that point.)
Comment: This is not a homework and answer site... Please tell us what you've tried so we know where to help you.
Comment: Incidentally, this problem is a perfect illustration of why context matters, I think.
Comment: Thank you for helping me! I understand now.
Answer: Hints: If $s$ is the displacement, then $v = ds/dt$ is the velocity. You want to minimize velocity, not displacement, so you want to find where $dv/dt = 0$, not where $ds/dt=0$. Note you will also have to check any boundary points on the domain ($t=0$).
Comment: Thank you for helping me! I understand now.
Answer: The speed is the (absolute value of) the derivative of the position with respect to time, which you have computed.  Now to minimize the speed you need to take another derivative to get the acceleration and set that to zero.
Comment: Thank you for helping me! I understand now.

finding the minimum speed of a particle


Is $\operatorname{range}T$ a subspace of $\operatorname{null}R$?

Question: Suppose $T: P_5(\Bbb R) \to P_5(\Bbb R)$ is a linear transformation, where $P_5(\Bbb R)$ denotes the vector space of all polynomials over the reals such that their highest degree cannot exceed $5$. Also suppose that $\operatorname{null}(T')= \operatorname{span}(R)$, where $T'$ denotes the dual map of $T$ and $R$ is the linear functional on $P_5(\Bbb R)$ defined by $R(p)= p(8)$. Prove that $\operatorname{range}T = \{p\in P_5(\Bbb R) | p(8)=0\}$.
Here is my reasoning:
We know that $\operatorname{null}R = \{p\in P_5(\mathbb R) | R(p)=0\}$. By the definition of $R$, we have $\operatorname{null}R = \{p\in P_5(\Bbb R) | p(8)=0\}$. Now we just need to show that $\operatorname{range}T$ is equal to $\operatorname{null}R$. To do that, I have also managed to show that these two spaces have the same dimension. But it remains to show that $\operatorname{range}T$ is a subspace of $\operatorname{null}R$. How do I show this? Thanks so much.
Answer: You need to show that for every polynomial $p\in P_5(\Bbb R)$, $T(p)\in \operatorname{null}R$, or equivalently, $R(T(p))=0$. By definition $R(T(p))=(T'(R)) (p)$, and since $R\in \operatorname{null}T'$, $T'(R)=0$; hence $R(T(p))=0$ for all $p$.


Addition of sets ans subsets.

Question: The question is about adding the elements of 2 sets. I took all the elements and added them to get 182. But that is wrong, can someone please help me see why that is wrong.
Here is the actual question:
Comment: Since the union is a set, duplicates are not allowed, so make sure to add each value only once.
Comment: $A\cup B=\{12,14,16,18,20,22,26\}$
Answer: Given two sets $A$ and $B$, one can form a set from them that consists of all the elements of $A$ together with all the elements of $B$. This set is called the union of $A$ and $B$ and is denoted by $A \cup B$. Formally, we define
$$A \cup B = \{ x \text{ } | \text{ } x \in A \text{ or } x\in B \}.$$
(Note, $A \cup B$ is the set consisting of all elements $x$ that belong to $A$ or to $B$ or to both).
Now, in your case we have:
$$A\cup B = \{ 12, 14, 16, 18, 20, 22, 26 \},$$
so the sum of elements of $A \cup B$ is $128$.
Comment: So this means that we take all the common numbers from both sets and make them 1. I don't understand why you do that, could you please explain? Thank you, this is helping though!
Comment: We take all the common elements for both sets only once, but we have to take all their different elements as well. Simple, the reason why the union operate like that is in its definition. Try to read once again what I wrote... or see: https://www.khanacademy.org/math/statistics-probability/probability-library/basic-set-ops/v/intersection-and-union-of-sets
Comment: Thank you so much, that helped a lot.

Addition of sets ans subsets.


Discrete Mathematics - Quantifiers problem

Question: This is a question from the Discrete Mathematics question from Kenneth Rosen book.
I didn't understand the question and thus I am confused how to begin with question. Below is the question from the book.

Establish these logical equivalences, where x does not occur as free
  variable in A. Assume that the domain is nonempty.
a) ( ∀x P(x)) ∨ A) ≡ ∀x (P(x) ∨ A)

Also what does "x does not occur as free variable in A" mean. Thank You.
Comment: Hint: To get a better understanding of what is going on try to to show this equivalence for the following 2 particular cases: the case where $A$ is $\forall x R(x,y)$ and the case $\exists x R(x,y)$. In other words, start checking that $(\forall x P(x)) \lor ( \forall x R(x,y) ) \equiv \forall x (P(x) \lor  \forall x R(x,y) )$ and that $(\forall x P(x)) \lor ( \exists x R(x,y) ) \equiv \forall x (P(x) \lor  \exists x R(x,y) )$
Answer: The question is asking you to use the rules of deduction you have been given to show that the two sides of the equivalence are exactly the same as each other - so in this case, show that "((for all x: P(x) is true) or (A is true))" is logically equivalent to "for all x: (P(x) is true or A is true)".
"x does not occur as a free variable in A" means that you can assume that A is not affected by the value of x, because if you were to write A out as a statement you wouldn't find x appearing as something whose value can be varied. (In P(x), x is a free variable, but in $\forall x P(x)$, x is "bound" by the $\forall$ qualifier.)
Comment: I understand that your interpretation of "x does not occur as a free variable in x" makes sense; if x occured in A at all, the question would be unsolvable unless we were given A. However, the wording seems a bit off to me. "x does not occur as a free varibable" still leaves open the possibility that "x occurs as a bound variable", doesn't it? Shouldn't they say "x does not occur as a bound variable" instead?
Comment: If x appears as a bound variable in A, then in the overall evaluation of A the x essentially "disappears", or at least it doesn't actually matter that it *is* x. Whereas if it's a free variable, it's quite troublesome that it also appears as a bound variable in the component involving P.
Comment: Ah okay thank you I understand
Comment: Can you clarify the difference between bound variable and free variable. As per my knowledge free variable is something that is not initialized or is in the scope of quantifiers.
Comment: That's exactly it. A free variable is one whose value is "free" to vary, and hence the truth of the overall proposition may depend on the value of the variable. A bound variable is one that is set to a particular value or is otherwise quantified, meaning that it's not able to vary, and hence its value is "bound".
Comment: So can we say that in this question there is no "x" in the "A" proposition.
Comment: Kind of, I guess? The specifics of it are probably something you'll get after you muck about with a few more propositions involving bound and free variables.
Comment: ok thnx @ConMan