Do math departments require the math GRE primarily to weed out applicants?

Question: Do math departments require the math GRE primarily to weed out applicants? Or is it predictive of completing the program?
Comment: They are both related; by weeding out applicants, you also (hopefully) selective for those most likely to complete the program.
Comment: Top departments don't really think of success or failure in terms of completing the program.  I would say they tend to regard anything other than becoming a leading mathematician (say at the level of an AMS Fellow - note some AMS Fellows are named for mathematical accomplishments that are not purely research) as a failure.
Answer: This answer applies to the US, and maybe not universally even there.
Graduate admissions in the US are broad based with many factors to consider. GRE may be one of them but less so since the onset of COVID. In particular, letters of recommendation have high value.
The GRE, by itself, is a poor predictor of success in mathematical research. It shows that a person with a good score has some background knowledge that is fairly broad based and is a good problem solver in those areas that they have studied. But that isn't the same thing as actual research in mathematics: the ability to extend the field into the unknown. Other mathematicians who have worked with a person are a better predictor for that.
It isn't an either/or in this case. It can be both/neither, actually, or even an orthogonal.
Doctoral admissions committees often get a lot (a lot!) of applications. The problem is to have an idea where to spend the effort needed to select good candidates. In some (many?) places a first effort might be made to separate applications into two piles, with only one being focused on. That separation might use GRE or GPA or a combination, since it is quick and easy. Time is spent on the applications that get through that first gate. If a class can be built on the higher scoring applicants there is no need to go back to the other pile. If not, the range might be extended somewhat.
However, many places will spend some effort in looking within that secondary pile for people whose letters are outstanding and the writers trusted. So, a poor GRE might still not be exclusionary even in a place that uses them. Nothing can be guaranteed here. Rules might even require that someone go through each application and, perhaps, assign it a score to guide further action.
But doctoral study is about research, not about retaining lots of information or about problem solving. At best, the GRE shows that a candidate has the necessary background and skills to begin the journey, rather than a predictor of success in achieving the goals.

Personal note: I took the exams more than 50 years ago and don't remember my scores. They were pretty good, I think, and I was a pretty good "test taker" at the time.
What I do remember, however, is being extremely depressed on completing the advanced exam since there were many questions for which I'd never even heard the terminology used. In the US, undergraduate programs differ quite a lot in the upper level courses, so the test has to be very broad so as not to disadvantage people because their curriculum wasn't "typical". I remember the scores being surprisingly good after my initial disappointment.
Comment: I like this answer overall, but: "But doctoral study is about research, not about retaining lots of information or about problem solving."  Here you lost me a bit: it seems to me that retaining lots of information (okay, better still: actually understanding that information!) and problem solving are two important components of mathematical research.
Comment: @PeteL.Clark, those other things are necessary, but not sufficient. It is a long step from understanding to creating.
Comment: Is there something else you think mathematical research is mainly about, rather than learning and mastering some extant mathematics or problem solving?  I'm not saying that I have some magic formula in mind, but those seem to be as important components as any.
Answer: Supplementing @Buffy's good answer:
In the last 10 years or so, and especially stimulated by the (im)practicalities of Covid, many math depts have found incentive to stop believing that math subject test GRE scores are useful at all. Yes, as has always been the case, the "most elite" places can use scores as a filter, because they'll still have lots of candidates who pass a (somewhat, but not entirely) meaningless filter.
In my R1 U.S. univ, for a few years now (even before Covid), we'd stopped looking at (or requiring) GRE subject tests... or any other GRE tests, for many reasons.
Quasi-ironically, already many years ago, our grad admissions people realized that we could not compete for potential students with the absolute highest numbers (whatever that might mean). Thus, as in pretending to make subtle intelligent choices in investing in under-valued stocks in the stock market, we deliberately chose to look at students who had "bad numbers", but who had stellar letters of recommendation, etc. One extreme case was a person who was in the bottom 6th percentile on the GRE, but finished her Written Prelims and Oral Prelims and thesis on a faster track than her "peers".
Returning to the specific original question: it is slightly misguided, in the sense that grad programs cannot pretend to only admit "the very best" students, because (by whatever standards) those students will have other offers. Yes, it's difficult to sort out the huge pool of applicants... and, yes, at the same time, it is a logistical failure to make many grad admission (and funding) offers that are rejected.


Why is the view header showing triangle count when my mesh is all quads?

Question: I know for a fact I don't have any tris so this thing is wrong, however, I notice that it's the same number as edges. I also find it hard to believe I only have 2 more vertices than I do faces. It takes 4 vertices to make one face and after that 2 for every adjoining face.
Comment: Sry for the noob question but I can't find the answer in the manual
Answer: Without getting too technical, in 3d, there is no such thing as a true quad. Quads and ngons are mere abstractions to make objects easier to manipulate (imagine modeling a car or face using triangles only). At the very core however, every object is comprised of triangles. Blender and other modeling packages abstract these away but they are there.
You might have seen proof of this if you've ever badly transformed a face for example, if you were to paint all 4 vertices of a plane and move a vertex out of place, you will see evidence that there is supporting geometry somewhere holding that "quad" together.

To test, just add a plane and check the header again, you will see that it shows 2 tris, this is accurate because a flat plane in its simplest form is two triangles. If you were to cut it diagonally with say the knife tool, it would still show 2 because now it is still 2 triangles.

Now if you were to create an actual triangle, it would show 1.

In a perfect sphere without any actual triangles, say a cube morphed into a sphere (by subdividing and using To Sphere AltShiftS), the amount of triangles will always be twice that of faces, because remember, by default a quad is 2 triangles.
This might not be the case for edges however, that count depends on how uniform your object is, toplogy etc.
Comment: Ok gotcha. Thanks for the answer. I had read that I should avoid tris and ngons so I was worried I was doing something horrible by having over 3000 tris lol
Comment: Also suddenly something makes sense. For example in the ear of my image there are pats where the quad looks like its folded in half, because the vertices don't allow for a solid face. Now I realize that triangles make it possible
Answer: About the relation between vertex, edge and face counts:
For a simple closed surface, essentially a "deformed" sphere as in your example, but without handles, such as (the surface of) a donut, we have the Euler formula:

vertices + faces = edges + 2

Additionally, in your example we have essentially as many vertices as faces. Just associate each face with its top left vertex, this will pair off most faces and most vertices successfully. Only in a few weird places you will have some vertices left out or being the top left of two faces (or it is unclear where top left is meant to be).
But if vertices are approximately the same as faces, then by Euler's equation, edges are approximately twice as numerous as either of them.
Now if we subdivide all your faces into triangles, we have triangle = 2 faces because all your faces are in fact quadrangles. Consequently triangles are approximately the same as edges .
Answer: The reason you have fewer vertices than expected is because vertices that are in the exact same place as other vertices can often be treated as just one vertex.
This is where index tracking comes in.  It's the sort of thing that GPU's rely on to reduce calculations since many of the calculations done on one vertex are also valid for the vertices which are also in the same spot.
Now the information that has already been calculated for one vertex can be fetched from cache memory and reused for all vertices that have matching index numbers.


How to Test Facebook Connect Locally

Question: I use ASP .NET and Facebook Connect APIs. but when I run the app and press Connect button it's return to the Website not to the test local server which is (http://localhost:xxxx/test.aspx)
So how I can test Facebook locally (i.e How I can change the callback url) ?
Comment: This system appears to be rather poorly implemented on Facebook's part. It does not seem to have occurred to them that anyone would want to test the feature other than on a live server. The two solutions given here -- editing the local hosts file to spoof the production server and redirect it to localhost, and temporarily changing the live production URL on Facebook to localhost, are both remarkably bad design on Facebook's part. Facebook needs to add some sort of testing capacity to their system.
Comment: The answer is here:
http://forum.developers.facebook.com/viewtopic.php?pid=116136

you must edit 'C:\WINDOWS\system32\drivers\etc\hosts' file to make your domain come to your localHost
Comment: Well a work around is to have 3 apps --> live, QA and Dev. So if your main app is apps.facebook.com/ohnice/ QA and dev can be is apps.facebook.com/ohnice_qa_sd/ is apps.facebook.com/ohnice_dev_fg/ yes something random so you do not have unwanted visitors when your house is not tidy.
Comment: @PaulLegato it is done now (after years...). See my solution or one of the solutions using the test feature.
Answer: It's simple enough when you find out.
Open /etc/hosts (unix) or C:\WINDOWS\system32\drivers\etc\hosts.
If your domain is foo.com, then add this line:
127.0.0.1    local.foo.com

When you are testing, open local.foo.com in your browser and it should work.
Comment: this used to work for me until recently but now i am receiving `connection refused` exception when trying to log in, probably due to a change on facebook side. any ideas of a work-around is much appreciated.
Comment: To edit your hosts file on MAC then run "sudo pico /private/etc/hosts" in your terminal, edit and press "ctrl X" to save
Comment: You are right... but some of us needs to be spoon-feed and saying "open /etc/hosts" just isn't enough ;) FB is still failing locally with this solution for me though. I am not using the facebook JS
Comment: If you're doing this to access a locally running Rails app, you might have to visit local.foo.com:3000` in your browser since Rails apps are usually run on that port.
Comment: @Christoffer: I believe that /private/etc is just a symbolic link into /etc, so /etc/hosts and /private/etc/hosts is the same file.
Comment: What can I do if my app heavily uses subdomains to function?
Comment: If you are using Windows Vista/7/8 then make sure to open the hosts file by running notepad as an administrator...see http://support.microsoft.com/kb/923947
Comment: True -- thanks!  But don't forget to update your facebook app.  You have to open your URL on facebook developer, select settings on left, basic tab on right, leave the "site URL" alone and add "app domains" such as local.dharmafish.com, www.dharmafish.com, dharmafish.com, etc...
Answer: Edit your app at www.facebook.com/developers/ and set the "Site URL" to "http://localhost/myapppath".
When done - change it back.
Comment: Facebook does not "connect" back to your server. Their JS does. And the JS runs in the context of your browser. Which knows where "localhost" points to.
Comment: it's worth noting that the validation on the app form requires you to use localhost in the url, eg `http://localhost/myapp` rather than `http://myapp`
Comment: if you use another port use this pattern : http://localhost:xxxx), for example : http://localhost:8080
Comment: It wouldn't let me add "http://localsite", I had to make sure I had a dot in there. This worked : "http://local.site"
Comment: Some FB features doesn't work with this. For example - save achievements to FB servers. It wants HTTPS, so my localhost trick is not working :(
Answer: Facebook has added test versions feature.
First, add a test version of your application: Create Test App

Then, change the Site URL to "http://localhost" under Website, and press Save Changes

That's all, but be careful: App ID and App Secret keys are different for the application and its test versions!
Comment: This is much better answer in my case, than editing the `hosts` file, because it doesn't require to use HTTPS on my test server.
Comment: As far as I can tell, this does seem ti require HTTPS now...
Comment: @Chiragthaker It is the domain where will be hosted the production app
Comment: I tried this solution, it seems to work but I still have this error message: `The method FB.login can no longer be called from http pages.`
Comment: what is App Domain in settings panel. i am developing ionic app with facebook login
Answer: I suggest creating a test app (for dev environment only) on https://developers.facebook.com/apps and set: Website with Facebook Login property to your localhost:[port] settings.
this option will work fine with no need to change hosts.
remember to change the appId back to your production app once you go live.

Edit - in the latest fb version you'll find it under the settings tab.
Comment: It seems you have to click on the "+ Add Platform" big gray horizontal button. There you have "Website"
Comment: Or just use separate configuration files for, dev, staging and live.
Comment: Can't find "Website with Facebook Login" any more.
Answer: You don't have to do anything difficult!

Facebook → Settings → Basic: write "localhost" in the "App
  Domains" field then click on "+Add Platform" choose "Web Site".
After that, in the "Site Url" field write your localhost url (e.g.: http://localhost:1337/something).

This will allow you to test your facebook plugins locally.
Comment: is there a workaround for files in the path file:///android_assets/www ?
facebook will not allow that path for site url
Comment: must be https now
Comment: @Simon_Weaver where did you get this information from? is it documented somewhere?
Comment: @kolistivra https://developers.facebook.com/blog/post/2018/06/08/enforce-https-facebook-login/
Comment: @Simon_Weaver from that link you sent: "You will still be able to use HTTP with "localhost" addresses, but only while your app is still in development mode."
Answer: Facebook seemingly randomly disables the ability to set localhost as a domain on your facebook app.  I found the easiest work around was to tunnel my localhost to the web.  This can be done for free using http://progrium.com/localtunnel/ or with a custom url (easier since you don't have to change url everytime in facebook) https://showoff.io
Comment: another tunnel choice is ngrok.com
Answer: I couldn't use the other solutions... What worked for me was installing LocalTunnel.net (https://github.com/danielrmz/localtunnel-net-client), and then using the resulting url on Facebook.
Answer: LAST TESTED 2021/06/07
Just a few notes to complement  the excellent answer of @Erdal_G with my successful experience:

Apparently, HTTPS is needed even in the local environment (I used the library https-localhost).

[I don't know if this is mandatory] create a test app from the main app (https://developers.facebook.com/docs/development/build-and-test/test-apps/)

Set the redirect OAuth URI to https://localhost:<MY_PORT>/auth/ and update also all other URIs in .../instagram-basic-display/basic-display/ settings accordingly.

Finally, don't forget to use the client-id (aka app-id) and app-secret of the test app in the requests, which are different than the parent app
Answer: go to canvas page..
view it in browser.. copy the address bar text.
now go to your facebook app
go to edit settings
in website, in site url paste that address
in facebook integration , again paste the that address in canvas url
and also the same code wherever you require canvas url or redirect url..
hope it will help..
Answer: Looks like FB just changed the app dev page again and added a feature called "Server IP Whitelist".

Go to your app and Select Settings -> Advanced Tab
Get your public IP (google will tell you if you google "Whats My IP")
Add your public IP to the Server IP Whitelist and click Save Changes at the bottom
Comment: what if multiple developers from different locations are working on the site?
We use VM (Vagrant) so the IP is the same for every dev. Sadly facebook does not allow to use local IP's in the Whitelist. It doesn't work.
Comment: If I'm reading your comment right this shouldn't be a problem.  You need to put in your public IP, which you say is the same for each developer (did you mean is NOT the same).  If you've got multiple developers at different sites with different IPs, you could use a VPN to route all traffic through 1 IP.
Comment: no, the public IP for different machines on different locations is of course not the same, just the local IP on each machine is the same. (e.g. localhost).
I don't want to route anything. For now i'm using localhost (just an example) in the FB app - which works fine. But i need a solution once the page goes live. Facebook allows to create "Test-Apps" inside an App, that may be the solution but i haven't tried it yet.

EDIT: seems that is the solution
Answer: Create 2 apps and
In  /initializers/env_variables.rb
if Rails.env == 'development'
    ENV['FB_APP_ID'] = "HERE"
    ENV["FB_SECRET"] = "HERE"
else
    ENV['FB_APP_ID'] = "HERE"
    ENV["FB_SECRET"] = "HERE"
end

How to Test Facebook Connect Locally


Usage of the "history" tag

Question: What is the purpose of history? Isn't there any other tag that would, even partially, be used instead of history? For example, the history of a word is its etymology; if I am asking for the etymology, I use etymology, not history.
Answer: I think my question What is the historic process for converting vulgar words into simply rude words? fits a tag of history. The question is asking about more than the history of a specific word but rather an entire group or class of words. The language-evolution tag was apt so I also chose it.
I am not strongly attached to any of the tags and would be happy with any decisions so long as the tags themselves get a good description of what should be in that category. If, for instance, the etymology tag's wiki told me that it was most appropriate for the type of question I had asked I would have done so.
Comment: The excerpt for the _etymology_ tag is the following: "Etymology is the study of the history of words and their origins."
Comment: I guess I interpreted "words" as "individual words" not "words and groups of words." My bad.

Usage of the "history" tag


Classification of transmission lines

Question: The general classification of transmission lines based on their length into short, medium and long is -
Short if length < 80 km
Medium if 80 km < length < 200 km
Long if length > 200 km
but this classification is for the case where frequency is 50 Hz. How is the classification done when frequency is not 50 for eg, classify the transmission line in short, medium or long if length = 100 km and frequency = 100 Hz.
Comment: A long transmission line can be as short as 1 metre i.e. it completely depends on the frequency of excitation.
Comment: Please edit and ask a specific question - "Classification of transmission lines" is not a question.
Answer: You do not cite where you found that classification.
However this can be answered in some generic way. A motivation to classify transmission lines for energy grids is to have rules of thumb which problems to expect. These are related to the electrodynamics of long lines.
Some questions/problems are:

Will a branch of my network act as an antenna?
Will we have to compensate for capacity of a line?
Can a line elicit resonance when open, yielding twice the nominal voltage at some point?

Good thing is: You can apply a simple rule. There's reciprocity between frequency and length. So if you increase the frequency to e.g. 77 Hz, a short line in terms of that rule will be shorter than 60 km. This is correlated to the wavelength of that specific frequency.
However this logic shortcut shouldn't be stretched infinitely because at much higher frequencies there will be additional effects on local elements e.g. power poles and insulators.

Classification of transmission lines


Advantages of Scala emitting bytecode for the JVM 1.7

Question: As per Scala 2.10, what are the advantages (if any) of emitting bytecode for the JVM 1.7, when compared to the default of emitting for the 1.6?
Comment: @dicarlo2: I don't think that trait Dymanic uses invokedynamic. It is rather a sugar for applyDynamic method calls. But method calls on structural types is a candidate for invokedynamic.
Comment: Are you only interested in actual advantages implemented by scala 2.10 as of now, or also looking for how scala could *hypothetically* benefit from new features in JVM 1.7?
Comment: JVM 1.7 brought `InvokeDynamic` which I'm sure can be used in a couple places in Scala (structural types, trait `Dynamic`, to name some), but I don't know if the compiler takes advantage of it
Comment: some detail in http://stackoverflow.com/questions/13380807/how-is-scala-generating-byte-code-using-some-libraries-like-asm-or-write-binar
Comment: @v6ak Ah, you are correct I misunderstood how `Dynamic` worked.
Answer: Previous Scala versions emitted version 49.0 of the byte code, which corresponded to Java 5. With Scala 2.10 version the default was changed to version 50.0, corresponding to Java 6 and which has the principal advantage of activating the faster verifier introduced with that version, so it should lead to (slightly) better run time performance.
As you note, with 2.10 it became possible to emit version 51.0 byte code, which corresponds to Java 7. There are a few differences between version 50.0 and version 51.0:  the biggest is the inclusion of the invokedynamic instruction, with the plumbing that goes with it (see the class file format definition for the gory details).
As far as Scala usage of the 51.0 byte code goes, even though the technical parts are in place it is my understanding that work is still at an experimental stage in using this feature. See this EPFL presentation and this thread which shows that the team is working on getting the performance benefits of method handles without having to introduce a dependency on Java 7.
Scala 2.11 maintained the default of emitting version 50.0 bytecode, but the official plan is now to jump straight to Java 8 bytecode with Scala 2.12. In the meantime, there is a new back-end available for Scala 2.11 that will let you try out some of the features that are being prototyped for Scala 2.12, and which will become the default back-end with Scala 2.12.
Anyway, the long-awaited proposed benefits all come from using the invokedynamic bytecode (and its associated MethodHandle structures). They include:

reducing code size and execution time for closures
improving specialization of generic datatypes
potentially faster structural types

(Spoiler: Using MethodHandles to implement closures in the experimental backend is currently slower than the present optimised closure creation!)
Comment: The Java 6 verifier optimises class loading, see for example [this question and answers](http://stackoverflow.com/q/10724942/991432).
Comment: Great answer! But regarding the increased performance from the verifier, does it impact execution or just initialization?
Comment: @Hugo, all it does is speed up class loading. Basically the JVM has to check the types of everything in the bytecode to make sure it is valid. The classic verifier runs a full dataflow analysis to account for stuff like conditionals and loops. But modern classfiles include metadata asserting the types of everything so the verifier can verifier that it matches in a single pass.


Do I need to buy the latest camera model?

Question: I have recently picked up more interest in photography.  I took classes several years ago, but would like to start doing it on the side.  I am shooting my friend's engagement shots in a few months and planning on building a portfolio.  I have an older camera that I used to use when I was taking classes.  It is a Sony A300.  I believe it was released in 2008. I have been researching different models and have been leaning toward the Nikon D3400.  My question is do I need to upgrade or should I just continue to shoot with the Sony? Would there be that big of a difference in my photos?  Will a newer camera make that big of a different on the quality?  I just want to compare the two really and see if it's worth the upgrade.
Comment: Although be aware that some of Snapsort's categories are confusing and descriptions prone to hyperbole. ("Significantly more lenses available!" is pretty iffy when the options are 230 vs. 126, and maybe neither one has the particular lens _you_ want. And "Has a built-in focus motor" is just... wrong.)
Comment: I think the answers you get to this question are going to be primarily opinion-based. [We also don't do shopping questions on SE as a whole](https://meta.stackexchange.com/questions/158809/why-are-shopping-list-questions-bad). You might do better asking on [dpreview's Buying Advice forum](https://www.dpreview.com/forums/4001).
Comment: Possible duplicate of [When should I upgrade my camera body?](http://photo.stackexchange.com/questions/71199/when-should-i-upgrade-my-camera-body)
Comment: There are plenty of sites that provide specs, and even some that compare models directly. For example: http://snapsort.com/compare/Nikon-D3400-vs-Sony_Alpha_DSLR-A300/detailed
Comment: Ugh. I hate the way Stack Exchange doesn't separate out the attribution for close votes. I don't think this is off-topic, but I do think it is either too opinion-based or a duplicate as Michael suggests.
Answer: You don't need to. People were taking perfectly awesome photos a decade ago, and were very happy. However, you're talking about a camera body that's almost ten years old, there certainly have been notable improvements since then. Particularly:

Higher sensor resolution: 10 megapixels was common in this class of camera in those days, and now you'll see 24. Megapixels aren't everything, but that's a significant increase.
Less noise, especially at high ISOs. Back then, 3200 was often the maximum possible, and 800 was pushing it for practical use. Now, many people wouldn't think twice about 3200 or even 6400 if the situation calls for it, and maximums of 25600 or 51200 are common. Basically, that's the ability to shoot in a quarter the light, which is nothing to sneeze at.
Everything will be faster. Time to turn on, autofocus speed, playback, lcd refresh. Again, ten years is a long time here.

The Sony A300 is a little too old, but the similar 2009 model is available for comparison with the Nikon D3400 on Digital Photography Review, where you can see some of these things. You can also find old reviews and look at samples.
Since you've been shooting with the Sony, you're probably aware of some of its limitations. You might consider renting a newer camera for a week or so, or borrowing one if you can, to compare how it feels after extended use and the results you get. You may decide that you're perfectly happy with the older camera and would be best served spending your cash on lighting gear or lenses.
If we were talking about last years' model, or the one before that, my advice might be different — But my guess is that 2008 is just so long ago in electronics-generations that you'll probably want to change.
Comment: Never buy something for photography unless you can answer the question "What problem that I have will this solve". Above are some good possibilities, but first decide if you have a problem, then if it solves it.
Comment: If I had taken that advice, I would never have realized how awful the Canon 18-55 kit lens is.  Well, technically I realized it when it got an Err01 and stopped taking pictures, and I happened to be able to borrow a nice prime from one of my coworkers, and my jaw dropped at how much sharper the shots were.  And my upgrade from a 75-300 to a 70-300L involved a drop incident.  But in both cases, I would kill to have known much earlier how soft those lenses are even on an original Rebel (much less the XTi) and how amazing the IS is on Canon's long lenses.
Comment: @dgatwood That sounds like a separate issue.
Comment: Sorry, that was in response to @Linwood, not to your answer specifically.
Comment: @dgatwood Ah, that makes more sense. To be clear, I _definitely_ recommend taking a look at other gear, even if just to understand your own better.


GameCenter iOS leaderboard identifier

Question: this is my code to get the default leaderboard in game center but return a nil value.
and i have this info in the iTunes connect  what can i do? thanks
This image is from iTunes Connect

This is from Xcode

This is from device

and the code to obtain the default leaderboard
<code>GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];

    localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
        if (viewController != nil) {
            [self presentViewController:viewController animated:YES completion:nil];
        }
        else{
            if ([GKLocalPlayer localPlayer].authenticated) {
                _gameCenterEnabled = YES;

                [[GKLocalPlayer localPlayer]loadDefaultLeaderboardIdentifierWithCompletionHandler:^(NSString * _Nullable leaderboardIdentifier, NSError * _Nullable error) {

                    if (error != nil) {
                        NSLog(@"%@",[error localizedDescription]);
                    }else{

                        _leaderboardIdentifier = leaderboardIdentifier; // **This contains nil value**

                    }

                }];
            }else{

                _gameCenterEnabled=NO;
            }
        }

    };
</code>
Answer: You code looks fine. Did you try signing out and back into Game Center on your device? I have this happening to me a few times in sandbox mode as well and a signing out and back in usually fixes it.
Answer: I solve this strange problem creating a new leaderboard and create a new version of my application for example 1.1 and this works for me.
Thanks for your answer crashoverride777

GameCenter iOS leaderboard identifier


PDF from difference of two Weibull distributions

Question: How should I derive a PDF from the difference of a couple of given two parameter Weibull distributions ? The convolution integrals become very difficult to evaluate. PS : The parameters are not necessarily the same since the idea is to get a distribution for a general case.
Comment: please add more information to clarify your question
Comment: Do they have the same values of their parameters or not?
Comment: Since we're considering a general case, it'll be better to assume that they do not have the same parameters. However, I don' think it'll make much difference since the convolution integral is equally difficult to compute.
Comment: It makes a profound difference!  When either both shape parameters are equal and equal to certain special values (such as $1$ or $2$), or both scale parameters are the same, a closed form answer is possible.  Otherwise it does look difficult.
Comment: I am sorry. Your argument sounds correct. It looks tough to get a closed form solution in other cases.
Answer: This seems to be a difficult question. I tried to find a closed form answer with the help of maple, but maple gives up!  So I will use the same numerical approach as used in Difference of two i.i.d. lognormal random variables.  The convolution formulas used are developed there, so will not be redone here.  If $X, Y$ are independent weibull distributed (possibly with different parameters) then the density of $D=X-Y$ is
$$
   f_D(t) = \int_0^\infty f(t+y) g(y) \; dy
$$
with $f$ the density of $X$, $g$ the density of $Y$.
The density of the difference $D$ can then be calculated via numerical integration:
<code>dDIFF <-  function(x, shape1, shape2=shape1, scale1=1, scale2=scale1) {
    res  <- x
    for (xx in seq(along=x)) {
        res[xx]  <-  integrate(function(y) dweibull(y+x[xx], shape1, scale1) * dweibull(y, shape2, scale2),  lower=0.0,  upper=+Inf)$value
    }
    return(res)
    }
</code>
and we can make a plot of that, first in a symmetrical case:

(note the cusp at zero), and then an asymmetrical case:

This numerical solution is very fast and should be enough for most practical purposes!  If you have to evaluate it very often, maybe make a spline approximation?


Why does a switch with an incomplete mac address table - sends a broadcast when it receives a frame with an unknown mac address?

Question: Wont it make more sense in term of less congestion to send a multicast to just those interfaces that are not currently in its mac table?
Comment: Just a note that the unicast frame isn't broadcast in the sense of having a broadcast MAC address, it keeps its original destination MAC address and is sent out of every port.
Comment: Just flooding that frame to linked ports without any MAC association won't work, as the destination may be connected to an adjacent switch with lots of MAC addresses already associated with its port.
Answer: No, any interface could be connected to a neighboring hub/switch having more than one MAC address on it.  Therefore, unknown unicast traffic is flooded to all ports except the origin port.
Comment: Both this answer and the one i accepted are good answers which really helped and clarified what i was missing out with my mental model regarding switches roles in networks.

each answer gives a different valid explanation and they are complementary.

I chose the accepted answer just because of the length and depth of the explanation.

Thanks to both of you.
Comment: @ArielFerdman, the accepted answer has invalid host MAC addresses as they are multicast addresses for Host B and Host C. Addresses with the I/G bit set are not allowed to be host source addresses, and, as destination addresses, they will be sent to every switch interface.
Answer: It wouldn't be ideal if the switch sends multicast to interfaces not currently in its switching table.
The ideal thing is for the switch to flood the unknown unicast frame out all interfaces except the port on which the frame came from. The primary reason for this is that hosts might have been moved around or replaced with other hosts.
Consider this, if for example in a switch's CAM table there are entries for Port F0/1 and F0/2 with Mac-addresses of 00:BB:CC:FF:11:22 and 11:33:CC:DD:22::FF respectively (host A and host B).
Supposing the network administrator removed host A from interface F0/1 to interface F0/3 and replaced interface F0/1 with host C (Mac-address 11:22:33:AA:CC:00), the switch would be ignorant of this change. Supposing the switch received a frame with destination Mac-address of 11:22:33:AA:CC:00, it would be making a grave mistake by sending a multicast out all other franes except the ones already in its table.
But when the switch floods the unknown unicast out all its interfaces (except the port on which it came from), it would learn that host A has moved from port F0/1 and that port F0/1 has been effectively replaced with host C. The switch then updates this entry in its CAM table. So as you can see, multicast frames will not be ideal in this situation.
PS. CAM table, Mac-address table, switching table etc etc all mean the same.
I used the terms 'interface' and 'ports' interchangeably.
Comment: Your Host B and Host C MAC addresses  are multicast MAC addresses, Any odd first byte has the I/G bit set, making it a group address. Those addresses are not allowed to be source addresses assigned to hosts.
Comment: I chose the Mac-addresses randomly, just for the sake of illustration. Thanks for pointing that out though.
Comment: The problem I saw is that you reference multicast addresses, but your example addresses are multicast addresses, and it is very confusing about what you really meant because of that.
Comment: "_it would be making a grave mistake by sending a multicast out all other franes except the ones already in its table._" That is exactly what will happen with any frames send to Host B or Host C using those MAC addresses because they _are_ multicast addresses.
Comment: See [this question](https://stackoverflow.com/q/58808705/3745413) and the answer for what really happens.


Best Open Source Mail Server for Windows

Question: I'm looking for a mail transfer agent that is free, preferably open source that can run on Windows natively. I've used Postfix before, but Postfix doesn't really run on non-Unix machine.
Answer: I am using hMail server, which works like a charm and is free / oepn source
Comment: Have you used the spam protection or integrated the SMTP gateway with clamav? I'd be interested in hearing your experiences.
Comment: it stores mail in a database (mysql).  yuk.
Comment: Actually I belive it stores mail in a directory and uses the database for indexing of it.  As well it now includes SQL CE which means you don't need to do a database server install anymore.
Answer: If you're looking to run a mail server on a dedicated box with open source tools, then for reliability and generally thorough testing of the code you would want to dedicate a system to  the task, and for open source there's no match for running on the "native" platform of Linux or FreeBSD.
You don't mention why you have to do it on a Windows box, but the last time I was asked this type of question it was because someone wanted to stick a mail server program on their workstation. This causes issues with reliability, but also can cause issues with being blacklisted. Plus updates and installing/uninstalling software that people use on desktops was always a crapshoot as to whether it would screw up the mail.
If you are doing this on a Windows box because it's what you have available, you could always try running something like VMWare and create a VM to run the program in question. That way you get open source servers running on their native platform, as well as an easy way to back up the state of the machine should you need to restore to another system. More resource hungry but it may save you some headaches.
There aren't a lot of open-source mail servers for Windows; most open source projects on it are ports, often using CygWin to run them, and tend to be slower and non-optimized (and less well tested) and you generally won't get as much of an audience from which to ask for help when using open source on the Windows platform. There are some free programs for Windows but they also tend to have a far smaller userbase.
My advice would be to consider using a Linux box dedicated specifically to acting as a mail gateway or look at using a virtual machine solution on Windows if you must use a Windows box.
Comment: This answer changed my way of looking. now as i'm not familiar with linux, which mail server would you recommend and what to choose as operating system? ubuntu?
Comment: @AshkanMobayenKhiabani The usual answer is, "Whatever OS you're most comfortable with, and whichever server application has the most active and supportive community if you're new to using it." Most Linux distros are differentiated by their support community and method of updating, so you might want to see what is out there and choose from that. As for mail, most common mail transport agents are capable of handling quite a bit of traffic on modest hardware, so my advice is to take a look at some different MTA configuration files and see what looks manageable to you.
Answer: an alternative way of looking at the problem:
why not run postfix on a linux box, and have it relay mail to/from the windows machine?
the windows box can then be hidden behind a firewall.  or the linux box can even BE the firewall for the rest of the network.


Design pattern for players

Question: Is there a design pattern for multimedia players? I've been searching on internet, but I've found no pattern related to architecture of players. I took a look at sources of a few players(MPlayer VLC), however I couldn't recognize any pattern used by the players. I would like to build a player where the different medias supported were implemented in different modules. The player would be an unique process(server) that should be used by a plenty of other client process, the client would request the player to play a media and then the request would be processed by the player.
Answer: I dont know if its just my negative thinking about that design-pattern megahype which leads to absolute nonsense behaviour (personal opinion insight), but:
You should not ask yourself "what Design-Pattern could fit for that XYZ type of application i want to code".
This is the absolute wrong way of doing things. Design-Patterns are no lego-blocks which you assign to a program you code. A pattern will naturally evolve in the specific domain.
If you know patterns, it may help you to see what might be a good solution. But in no way you pack some patterns together just for the sake of it.
Patterns for a mmplayer is really a bad question. You might say you need different codecs for the same tasks, wich might evolve in Factory pattern in THAT SPECIFIC DOMAIN. You might want some streaming functionality with some fault tolerance, wich might evolve in a leaky bucket counter.
You might rethink your question. I think it doesnt make sense at all to ask that.
Really, no offense! But i think you are going into the wrong direction in sense of design-decisions. It might be the best to approach it in a different way.
Answer: A media player is a whole application. There is no such thing as a "design pattern" for an entire application.
However, some families of softwares (say, video games) almost always share some common architectural properties. But we are at the application architecture level here, not at the design pattern one, which is commonly considered as a code level concept.
I'm afraid there is no reference architecture for a media player kind of application, but yet, you can rely on many different and less specific architectural principles. For example, designing a composite application is quite a general practice. You'll find a lot of dedicated literature about how to create a plugin system that can load module, or codec, etc.
Answer: You can take a look at the Audacity architecture and see a good SW design at the same domain: http://www.aosabook.org/en/audacity.html

Audacity is a popular sound recorder and audio editor. It is a capable
  program while still being easy to use. The majority of users are on
  Windows but the same Audacity source code compiles to run on Linux and
  Mac too.

Design pattern for players


Allowing only local network connections to a Windows Azure VM?

Question: I am trying lock down a virtual machine that acts as an app server for a web application. I have a two VM's: One for the app server and another one running the web server. I have to open a ton of ports to allow the web server talk to some wcf services, but I only want to allow those connections from the web server and no one outside of that network. I have to add endpoints in order for the web server to access the wcf services, but this also makes them accesible to the public IP. How can I only allow this traffic on the
Answer: For Virtual Machines, the only way of accessing ports from outside the hosted service is by defining input endpoints (with or without load-balancing across a set of machines). In your case, you'd just open, say, 80 and 443, specifically for your web server (e.g. not load-balanced). This is considered a port-forwarded endpoint since traffic on these two ports get forwarded directly to your web server. For more clarity around port-forwarded endpoints, I suggest Michael Washam's blog post, here.
At this point, you'd open various other ports on your app server (through its firewall config), and now your web server can talk to the app server, yet the outside world won't be able to reach the app server. Note: I'm assuming you placed your web server and app server in the same hosted service. Otherwise, you'd need to find a different way to connect between web and app servers, such as configuring a Virtual Network.
EDIT 6/5/2013 You can now enable ACLs on input endpoints, allowing (or blocking) IP ranges. Today ACLs may only be managed through PowerShell, with the June 2013 update. See this post to learn more.
Answer: Machines that exist on the same virtual network will be able to talk to each other as long as the local firewall has been opened to those ports. This problem was with my configuration in my application and not because of this. I also didn't have the correct ports open. Now it works like a charm.


What kind of freewheel/cassette is this?

Question: I bought some old bike from netherlands, I wanted to restore it.
Rear wheel is broken and I wanted to exchange it but there is this strange freewheel which I cannot identify, do you have any idea what it is?
Comment: @sashir please don't take the duplicate flag as being an attack on you - instead it shows that the same question has already been asked and answered, so to avoid duplicating effort, this question gets pointed at the original.   IE, "here's one we prepared earlier"
Comment: Ok, sorry I didn't noticed this one, thanks for your help :)
Answer: It's called a Helicomatic. The idea was to make a freewheel that does not need a lockring that has to be torqued tight. The helical splines make the freewheel tighten itself.
Amazingly we had this exact question about a month ago, so I flagged this as a duplicate question.


Is there a way to scale circular faces individually?

Question: I've tried setting the pivot point to "individual origins" and changing the orientation of scale tool to normal but neither worked. It seems that those methods only work when the face is actually separated. I don't want the faces go towards the center so I manually scaled edges so that it works kinda like the "inset" feature, but is there a more effieicnt way to do this? I believe this feature was called Extrude > offset in Maya so I'm hoping for something like that.
Comment: I'm not sure it's possible, so maybe inset then dissolve the edges you don't want?
Comment: Sorry if the question wasn't clear. Inset creates additional faces, but I want the selected faces itself get thinner.
Comment: Scale them along **local** axis.
Answer: Scale radial edges around individual origins.
Rather than a face selection, suggest in this case using edges.  Scaling  the radial edges about their individual origins will have the desired effect

Select a radial edge to be scaled.
Select edge ring to get all radials of inner ring
With pivot point set to individual origin scale.
Comment: ... and.. Indiana Jones re-holsters his revolver.


Can I know if a device is USB 3.0 or 2.0 in Device Manager?

Question: I'm using applications like HWInfo to learn this, but I've always wondered if it's possible to learn this from Device Manager, especially when I'm remoting into a customer's PC with TeamViewer, without having to install an application.
Comment: "hwinfo" is somewhat ambiguous. Is it [Microsoft's](https://support.microsoft.com/en-us/topic/description-of-the-microsoft-hardware-diagnostic-tool-c446e28e-8589-d236-bac2-37a0113e7848) or [Linux'](https://en.wikipedia.org/wiki/Lspci#hwinfo)?
Answer: Unfortunately, the Windows Device Manager won't be able to give you this information reliably, but Microsoft USB Device Viewer, that is part of the Windows 10 SDK, can show detailed information.
There is a freeware version by Uwe Sieber, named USBTreeView. It's a stand-alone application that is less than 1 MB, is based on the Microsoft code, and doesn't require you to install and download the SDK.
Comment: Useful, Thank you.  You're right, Device Manager won't tell you, I looked into every nook and cranny.
Comment: For anyone, As the information about where you can get this Microsoft USB Device Viewer in this answer is incomplete, this tool is only available through the SDK.
Answer: Devices can themselves decide to be USB 2 (in fact, they should) when connected to a USB 2 hub / controller. So, you can not find out whether a device would work at USB 3 super speed if connected via USB 3. What you can figure out is how it's connected:
Under "view" you can select to show things "by connection"; find your USB device. If it's attached to an xHCI (eXtensible Host Controller), then it can be USB 3, if attached to an OHCI / UHCI / EHCI controller, it's USB 2 or 1.
But: USB 2 devices can be connected to an xHCI, so it's a "necessary, but not sufficient" condition.
However, I think you can find the connection type, by going into the settings, "Bluetooth and other devices", and going down the list until you hit the USB devices, where you'll find info if it's USB 3. Not sure that's always accurate, though.
Comment: Yep, they can even decide to be USB 1.1 (and in fact, most cheap USB keyboards do this because they don't _need_ more bandwidth than what they get from USB 1.1). This behavior is an important part of why USB (and PCI-e, and various other standards with similar down-negotiation) works so well and has survived so long.
Comment: Windows settings don't state if it's USB 2.0 OR 3.0, by what I can see.  And device manager won't tell you by checking if it's connected to the EHCI or xHCI controller, as the user may have plugged the device into any port without checking the USB type.  Thanks all the same.
Comment: @Antonio23249 it definitely does; in the connection view, as described, you can see to which kind of controller it's connected to.
Comment: @MarcusMüller That doesn't work for "virtual" devices that a USB device driver can create. For example, my Logitech mouse driver/software creates a number of "Logitech Virtual Keyboard/Mouse" devices under "Human Interface Devices" (when viewing Devices by Type), but when viewing Devices-by-Connection they appear under a top-level node named "Logitech Virtual Bus Enumerator".
Comment: @Dai interesting! And that has no representation under actual USB hosts? Because, there's still a USB device there...
Comment: @MarcusMüller " it definitely does; in the connection view"

I can't see it, I added a picture at the end of my post.  See my "Store N Go" USB drive.
Comment: sorry, don't see a picture!
Answer: Nir Sofer's NirSoft USBDeview has a column listing the USB version. The column will not be at the front by default, but you can move it there. The option "Retrieve USB Power/Version Information" must be enabled for this to work.
I could not find documentation whether this column only shows the "apparent" USB version (e.g., showing 2.0 for devices which are 3.0 but have chosen a backward compatibility mode).

I find this tool easier to provide a better overview instead of the mentioned USB tree view.
Comment: I adore NirSoft, but I have had issues with USBDeview where it won't see some USB mass storage devices (e.g. USB 3.0 HDD enclosure) and it often suffers from prolonged hangs.  USBTreeView seems to cope better with all devices in my experience.
Comment: @spaceman-spiff: thanks for the feedback. I'll take USB TreeView into my tool library as well.
Answer: I don't know about Device Manager. But on a laptop, it differs with color in the USB slot. Blue means it's USB 3.0, and black is USB 2.0.
Comment: "especially when I'm remoting into a customer's PC with Teamviewer" - how would one figure out the color of the USB ports then? Other than that, my laptop has black USB ports only, but they all have the USB 3.0 SS (super speed) logo. Those colors are not reliable. There are also red 3.2 USB ports (e.g. on the Sabretooth Z77), white USB 1.x ports and even yellow ones (always on). Blue can have 2 shades (3.0 / 3.1 typically). All in all I doubt that this answer is useful.


How to indicate that something has changed on a form

Question: I have a form that displays queue of messages and number these messages can be changed. Really I want to "indicate" label (queue length) when the number of messages were increased to improve user experience. What is the best way, according to user usability, to attract attention to this label? In additional, users get a lot of messages per working time, so it should be is not so busily.
Answer: A short background + text color animation would grab the user's attention, such as when you post a message on StackExchange.
Answer: In this case, I would probably update the count periodically, without any animation to draw attention to it.  The user will get used to the number changing and will look for it when they are ready.  It's usually not a good idea to interrupt a user's thought process without good reason.
If you want to draw more attention to it, and you've come up with good reasons for it, then I would use an approach similar to the Scriptaculous "highlight" effect.  It briefly flashes the container and settles back down to normal.  It is very important that you don't employ this too often or you will make your users sick.  In short, do not flash/shake/etc. more than three times a second.  For something like this, I would say don't even update more than three times a minute.
Comment: Some colors are worse than others, and the amount of area you are strobing also has an effect.  When in doubt, you can use this tool: http://trace.wisc.edu/peat/
Comment: unless you're strobing the screen, I don't think the yellow fade technique is going to cause seizures.
Answer: The term what you are looking for is spotlight effect:
http://patternry.com/p=spotlight-effect/
Comment: Berin Loritsch has already mentioned same effect (http://madrobby.github.com/scriptaculous/effect-highlight/) any way thanks


What can I place under my sofa cushions to reduce sag?

Question: I am looking to use a piece of wood to lay under my sofa cushions because it sinks to much when you sit on it. I can't afford a new sofa so I was told I could use a piece of wood under the cushions. I need it to support a person 300 lbs- 400 lbs. They are disabled and do a lot of sitting.
Comment: Welcome to DIY.SE! Can you add some images of your couch? I think what you are describing is doable, but images would help to confirm that.
Answer: 3/4" plywood will do the job, but the outcome will depend on how the sofa's supporting structure is built. You'll want to cut the sheet to a suitable shape and bullnose the edges with a router or sander to prevent it from cutting through the fabric of the cushions and the base. It probably will eventually, though. You could also wrap it with old sheets or similar to protect the sofa.
Answer: As @isherwood has said, however, make sure your springs are not dangling. Easy way to do this is to flip the couch over and pull the bottom fabric off, usually stapled. Look inside as it should be hollow, and you will see the springs. On the front edge of the seat area, they are usually mounted to the wood rail. On the back they could be mounted to a rail or perhaps hung by a fabric strip. If the strip is torn and the spring has fallen, it needs replaced. A board won't support the weight if the fabric hung springs have all fallen. If the sofa has been sagging more over time, then the springs are just worn out, and a board could work to prop the cushions up. Again as long as the springs are still intact.


Main stacks in Linux

Question: What are the main stacks in Linux? What I mean  is, for example when an interrupt occurs what stack will be used for it, and what is the difference between user process and kernel process stacks?
Comment: usually, this is not the platform for asking homework sounding questions, but since you are a new member, I'd suggest reading this thread and making your own conclusions out of it : http://unix.stackexchange.com/questions/5788/how-is-an-interrupt-handled-in-linux
Comment: This may be helpful: http://duartes.org/gustavo/blog/post/journey-to-the-stack/
Comment: Thank you men, but you doesn't answer my question, sorry. At first, it isn't my homework. At second, I don't asked about how stacks works (local variables, call a subroutine, stack frame and so on) ... I am asking about what are the main stacks in Linux. What are the most important stacks that are used in Linux (or in any other modern OS). For example ... what stack uses interrupt routine? Where is stored? And how is it loaded into processor register (for example on x86 arch) on interrupt occurs?
Answer: This is highly platform-specific. Unless you bind to a certain platform (even difference between x86-32 and x86-64 is principal), one can't answer this. But, if to limit it to x86, according to your last comment, I could suggest some information.
There are two main styles of service request ("syscall") from user land to kernel land: interrupt-styled and sysenter-styled. (These terms are invented by me for this description.) Interrupt-styled requests are those that handled by processor exactly in the same manner as an external interrupt. In x86 protected mode, this is called using int 0x80 (newer) or lcall 7,0 (the oldest variant, SysV-compatible) and implemented using so-called gates (task gate, interrupt gate, etc.), configured as special segment descriptors. The task switching is executed by processor. During this switching, the old task registers, including stack pointer, are stored to old task TSS, and the new task registers, including stack pointer, are loaded from the new task TSS. In other words, all "usual" registers are stored and loaded (so this is very long action). (There is a separate issue with FPU/SSE/etc. state which change is postponed - see documentation for details.)
For handling such service requests, kernel prepares a separate stack for each thread (a.k.a. LWP - lightweight process), because a thread can be switched during any blockable function call. Such stack usually has small size (for example, 4KB).
As soon as x86 task switching always changes stack pointer, there is no chance to reuse userland stack for kernel. On the other hand, such reuse shall not be allowed at all (except small amount of the current thread data) because a user process page can be unsecure: another active thread can change or even unmap it. That's why it is simply prohibited to use userland stack for running in kernel, so, each thread shall have different stacks for its user and kernel land; this remains true for modern, sysenter-styled processing. (On the other hand, as already noted above, each thread shall have a stack for its kernel land another than of another thread.)
Sysenter-styled processing had been designed much later and implemented with SYSENTER and SYSCALL processor instructions. They differ in that they were not designed with keeping an old (too firm) restriction in mind, that system call shall keep all registers. Instead, they were designed more closer to a usual function call ABI which allows that a function can arbitrarily change some registers (in most ABIs, this is named "scratch" registers), only a few registers are changed and the care to keep old values is brought by handler routines. SYSENTER/SYSEXIT instruction pair (both for 32 and 64 bits) spoil old contents of RDX and RCX (in a weird manner - userland shall prefill them with proper values), and new RIP and RSP are loaded from respective MSRs, so, stack is switched to the kernel land one immediately. Opposed to this, SYSCALL/SYSRET (64 bit only) use RCX and R11 for return address and flags, and do not change stack by themselves. Later on, kernel utilizes part of this stack to save a few registers and then switches to own stack, because 1) there is no guarantee that userland stack is enough big to keep all needed values, and 2) for security reasons (see above). From this point, we have again a per-thread kernel stack.
Beside userland threads, there are many kernel-only threads (you can see them in ps output as names inside square brackets). Each such thread has its own stack. They implement 1) periodic routines, started on some event or timeout, 2) transient actions or 3) handle actions requested from real interrupt handlers. (For case 3 they named "bh" in old kernels, and "ksoftirqd" in newer ones.) Large part of these threads are attached to a single logical CPU. As soon as they have no user land, they have no user land stack.
External interrupt handlers are limited in Linux, AFAIK, to no more than one simultaneously executed handler for each logical CPU; during such handler execution, no IO interrupts are allowed. (NMIs are a terrible exception with bug-prone handling.) They come using task-switching interrupt gate and have got an own stack for each logical CPU, for the same reasons as described above.
As already noted, the most part of this is too x86-specific. Task switching with mandatory stack pointer replacing is rare to see at another architectures. For example, ARM32 has a single stack pointer per privilege level, so, if an external interrupt comes during kernel land, stack pointer is not changed.
Some details in this answer can be obsoleted due to high kernel development speed. Consider it only as a general suggestion and verify against the concrete version you will explore. For more description on x86 interrupt handling and task switching, please refer to "Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide, Part 1" (freely available on Intel website).
Answer: On Linux, when running in userspace, the userspace stack is used. If the process is running in kernelspace, it uses a kernel stack "owned" by the process. Interrupts are handled in-kernel.
Probably a better place to find out such details about the private parts of your favorite kernel is to rummage around in sites catering to people programming it, like e.g. kernelnewbies or search around in LWN's "kernel pages" for Linux. You should be able to find similar places for the BSDs or Solaris, and even MacOS. Windows information might be harder to come by...
Such information isn't discussed in typical operating system texts, you'd have to look for descriptions for developers.
Comment: Handling of another external interrupt during a running one is not allowed, AFAIK, in Linux. This could be too resrictive for some cases but greatly simplifies design. Multiple interrupt handlers in parallel are allowed in SysV and BSD design (look for `splbio`, `splnet`, etc.). Anyway, interrupt handlers are designed in manner so they limit only to parts that can't be performed in softinterrupt state. There are "realtime" versions which allow multiple interrupt handlers; see my answer for generic pecularities which occur with such permission.
Comment: Thank you for your answer. I can imagine the situation when an interrupt occurs and inside its handler enables further interrupt (nesting interrupts). So, what if stack size is small? What is occurs overflow?
Comment: @Netch This sounds like a powerfull solution, BUT. I am afraid about that Linux uses nested interrupts...
Comment: @Netch So I asked about that. Here is an link: http://stackoverflow.com/questions/34527763/linux-nested-interrupts?noredirect=1#comment56797629_34527763
Comment: AFAIK, nested interrupts of _different_ IRQ lines are allowed. NOT the same IRQ! IOW, when handling interrupt 'n', interrupt 'n' will be turned Off, i.e., it is non-reentrant. Of course, top and bottom halves can still execute concurrently..

Main stacks in Linux


If I buy the same game I already have downloaded on my computer from a different steam account, will I have to re-download it?

Question: A while back, I got completely locked away from my old steam account because of a hacker that bothered me more than a couple times. He completely changed all the information on the account so I can't get it back. I was going to re-purchase a game that was already downloaded on my computer from my last account (I can't play it since it's linked to the other account). My question is, if I purchase it again on another steam account, will I need to redownload it or will I be able to use the already downloaded file to play?
Answer: No, you won't have to re-download the game files. From Steam's support page on Steam Account Use :

Can I use multiple Steam accounts on one computer?
  Yes, you can access different Steam accounts from one computer. However, you may only access one account at a time.
The accounts will share the core files for any games the accounts have in common, but each account will maintain its own custom content and configuration files.
Comment: I believe you may have to start the download to get Steam to recognize it's already installed, but it shouldn't have to actually download anything. (That's how it used to work for copying games from an external drive, at least.)
Comment: If it uses Steam's Custom Executable Generation or another DRM it may need to download the executable(s) used to launch the game again, which could cause it to fail to verify the existing data but should not in most cases. Since you're using different accounts, there may be different encryption keys for some data which would also require it to be downloaded again. Also, since the version of the game you have may be outdated that may cause Steam to just throw it all out and redownload. If you move/keep both the install data and the appmanifest for the game that often can help prevent this.
Answer: To answer the original problem, Steam does not use any of your personal information to restore control of your account.  When I had to regain control of my Steam account, they asked for one of the Credit Card number used to purchase the games in the account.
Contact steam and retrieve your account.
Comment: Steam also keeps historical records of your previous account information.  Give them your old ID, tell them it has been changed, give them CC number.  Done.  Your account is back.
Answer: Yes - See @Arkive's answer
However steam on my family's Mac has a steam folder for every different Mac user account, meaning you did have to install the game for every user account. I am a Windows / Linux person, so I am not 100% certain if this was correct behavior for a Mac. Luckily, I've found 2 solutions to this problem:
The easy way
In steam's preferences you can select a folder to hold game data. Create a folder in the shared user, and set it's permissions to read and write for everyone (RClick folder --> Get info --> Unlock button --> Permissions --> Everyone --> read & write). Then in the steam client go to steam --> settings --> downloads --> steam library folders. Add the folder you created, and right click it and make it the default folder. This will cause new games to install into that folder.
You will need to do this for every Mac and Steam user combo, but each game will only need to be installed once.
The easy way part 2
To move existing games from the user steam folder to your system-wide game folder, right click the game --> Properties --> Local Files --> Move.
The hard way
Creating hard links from all the user steam accounts to a shared steam account. It works shockingly well. You will need to do this once per Mac account, and then everything works.

I spent a couple hours figuring this out, so hopefully people in the future will be able to Google this question and get an answer.
Answer: Do you need to re-download it? Not Necessarily...
Will you be able to use the files you have downloaded? Yes! You can!

As of my experience, since the internet in Asia is horrible, I have
  been copying steam games from my friend, ("technically, it's illegal,
  but if you have own the game, no one can bother you")
Then I pasted it to my steam library (Ex: "C:/Program
  Files(x86)/Steam/SteamApp/Common") and let steam do the rest.
  (Depending where your SteamLibrary is, the location may vary)

You wont be able to directly play the game, since steam will verify and download few files, but at least you wont have to download the whole game from scratch.
Another way is using Create & Restore backup, but since you don't have access to you account, it wont matter anyways, but if you have, you wont have to download it from scratch. Its the same either way.
Answer: As other answers already mentioned it, no, you won't have to re-download games, although I just wanted to add something to Arkive's answer, more specifically the "but each account will maintain its own custom content and configuration files" part.
The catch is that some games do not specify correctly their save files and configuration files, and some games may get their data overwritten when another user logs in and synchronizes his Steam Cloud data. That happened to Dark Souls III notably with characters being overwritten when another user logs into his steam account and launches the game.
In short, back up your save files manually before starting any game, just in case.


Pseudoinverse of pseudoinverse of matrix A equals A: ${(A^{+})}^{+}=A$

Question: As you know, a Matrix $A^{+}\in \mathbb{R}^{m\times n}$ is called a a pseudoinverse of $A\in \mathbb{R}^{n\times m}$ if $\Vert b-A A^{+} b \Vert_2\leq\Vert b- A y\Vert_2 \forall b\in \mathbb{R}^{n} \forall y\in \mathbb{R}^m$ and $A^{+}b$ is the smallest vector by norm to do so, which is equally characterized by $\langle b- A A^{+}b,Ay\rangle=0$, since $A A^{+}$ is the orthogonal projection of $\mathbb{R}^{n}$ onto $R(A)$.
Because of it being a orthogonal projection the penrose axioms ${AA^{+}}^T=AA^{+}$ and $A A^{+}A=A$ follow. What I would like to do now is proof the other two axioms $A^{+}A A^{+}=A^{+}$ and ${A^{+} A}^T= A^{+}A$ given a Matrix and its pseudoinverse, by showing that ${(A^{+})}^{+}=A$ or in other words, that $A^{+}A$ is a projection onto $R(A^{+})=N(A)^{\perp}$. On the other hand, if those two penrose-axioms could be proven another way ${(A^{+})}^{+}=A$ would follow by the penrose-axioms.
I would appreciate any proof - especially one that is not using SVD.
Answer: $A(b-A^{+}Ab)=0\Rightarrow b-A^{+}Ab\in $N(A)$\Rightarrow \langle b-A^{+}Ab,A^{+}y\rangle=0$ since $A^{+}y \in R(A^{+})={N(A)}^{\perp}$


Redactor - doesn't generate unordered list

Question: I'm using Redactor v2.8.5. it doesn't render an unordered list in HTML? How do I fix it?
Answer: Redactor is perfectly capable of rendering an unordered list, so perhaps your question is a little unclear.
If you mean that there's no formatting button to format an unordered list, check that you're using an appropriate redactor config which allows the use of 'unorderedlist' in your field definition:

More instructions about how to configure Redactor in Craft can be found at https://github.com/craftcms/redactor
Comment: I'm able to see these buttons on the editor. And I'm able to see bullet points with my content in the editor. But when I see that same page on website, I don't see the bullet points
Comment: Then this is sounding like a CSS issue, rather than Redactor. If the markup that's generated correctly has `` tags, it's most likely your stylesheet that's changing the formatting.


How to organize API?

Question: I am designing an API and I would like it to be simple to use.  So, if I have Customers, Statements, and Payments.  Does it make sense to have objects such as:  Customer, CustomerHandler, Statement, StatementHandler, Payment, PaymentHandler?  This way when the developer wants to do something with customers he/she knows to create a CustomerHandler and then all of the possible functions that one would like to perform with a customer are inside the handler.
Methods like:

CustomerHandler:

AddCustomer(customer)
GetCustomer(customerID)
GetCustomerCount()

StatementHandler:

AddStatement(customerID)
GetStatement(statementID)
GetStatementCount(customerID)

PaymentHandler:

GetPaymentsByCustomer(customerID)
GetPayment(paymentID)
GetPaymentCountByCustomer(customerID)

This way if the developer wants to work on receiving payments he/she knows to go to the PaymentHandler.  My coworker thought that functions like GetPayments(customerID) belong in a class that manages the customer.  So, it would be like Customer.GetPayments() AS Payments.  But if I have some other entity like Worker, there would be Worker.GetPayments() AS Payments.  So, I see the logic with both approaches.  The first one groups things together so that if no matter whom the payment is coming from you get it all from one class by having functions like GetPaymentsByCustomer(CustomerID) and GetPaymentsByWorker(WorkerID).  This way one does not have to stumble through different handler or manager objects to get payments.  Both approaches make sense to me, how about you?  Or, are we both off and there is a better way to do this?
Thanks in advance!
Answer: If you're designing an API, then maybe you could try writing a few mock-ups from your intended users' point of view.  Implement a few use cases, even if it's just on a white board, and see which approach is more valuable.
In your payments example, both Worker and Customer could implement a Payable interface.  If you then later had to add an object that could be "paid", you would simply have it implement the same interface.  If you had a payment handler and need to add a new type of thing that could be paid, you would have to change the handler by adding a new method.  Over time this could get cumbersome I suppose.  You could of course use a combination of the two, and have a handler utility that acted as a front for your payment system.
Answer: You are pretty much describing two ways (patterns) for data access:

active record - http://martinfowler.com/eaaCatalog/activeRecord.html
data mapper - http://martinfowler.com/eaaCatalog/dataMapper.html

Please, get Martin Fowler's book Patterns of Enterprise Application Architecture and read through all pros and cons. In particular if you try to expose your objects and APIs as web services you might want to go with the data mapper approach (as you suggest).
Active record is very popular because it is simpler. Decide for yourself what suites your needs the best.
Comment: Wow, this really goes over my head. I guess I need to get that book.
Comment: Please don't worry. It is not a rocket science. It is a very well written book that is easy to read -- especially if you did some of that work already.
Answer: In the "where does it belong" debate, I usually decide where something belongs based on what it returns.  If you have a GetPayments() method that returns a list of Payment objects, it should be on the PaymentHandler.
It's really a pretty subjective thing, but doing it by return type ensures that everything that creates Payment objects will be in the PaymentHandler, Customer objects in the CustomerHandler, etc.
This can simplify things a bit when you need to make changes later, and as you mentioned makes it very easy for users of your API to figure out which handler they need to call - if they need a Customer, they'll work with the CustomerHandler.
It also eliminates confusion if you have a hypothetical method like GetPayments( customerId, workerId ) that would get payments for a customer and a worker.  Using your co-workers suggestion, it's unclear where this method would go since it involves payments, customers and workers.  Categorizing by return type is almost always clear since a function only returns one thing.

How to organize API?


The Maths necessary to understand Logic, Model theory and Set theory to a very high level

Question: I am studying Philosophy but most of my interests have to do with the philosophy of Maths and Logic. I would like to be able to have a very high level of competence in the topics mentioned in the title, and I was wondering, given that I don't have a mathematical background beyond basic school level maths, what particular branches of pure mathematics will help me to go deeper in my study of Logic, Model theory and Set theory? Calculus? Group theory? I hope you can give me some suggestions.
Answer: Apart from actually learning logic, set theory and model theory you would probably benefit from some basic understanding in

Abstract algebra (group theory, ring theory, etc.)
General topology
Some basic measure theory
Computability and complexity

While these things are not necessary per se in order to gain understanding in logic, or set theory (although model theory deals a lot with actual mathematics, so you can't escape it there); in order to fully understand set theory I think that one has to see "usual" mathematical theories and understand them at a basic level. If not for anything else, then in order to understand what makes set theory special.
It seems, if so, that the better part of an undergrad degree in mathematics is needed. But then again, it is needed if you wish to understand any mathematical theory in depth.
Comment: +1 These areas (except for perhaps measure theory) are really almost crucial for providing proper motivation and justification for the work one does in particular in model theory, but also set theory and fundamental logic.
Comment: @Noldorin: Measure theory actually helps understanding a lot of the motivation behind club and stationary sets, as well the idea behind measurable cardinals, and many of the related topics. True, there is no integration here, but the basic concepts of measure and measurability help a lot in understanding.
Comment: Well for general mathematics sure, it's useful; just not so much from a philosophical/foundational aspect in my view. It depends on what approach you're coming from. It's rarely covered in courses on pure set theory, though it's pretty much essential in higher-level work on probability theory, real analysis, and some other areas. :-)
Comment: @Noldorin: My point in adding measure theory was that if you want to understand a lot of the work in infinitary combinatorics, some of the work in large cardinals, and most of the basics of descriptive set theory then you need to be familiar with the basic concepts of measure theory. If understanding set theory at a very high level does not include any of the above, then yes -- it is perfectly fine to remove measure theory from the list.
Comment: fair enough, I accept that. :)
Answer: I would say that if you get hold of three books titled respectively "Mathematical Logic", "Model Theory" and "Axiomatic Set Theory" then that is pretty much all you need. Some or all of them should probably have the word "Introduction" in the title too.
I do not believe that calculus would be much help (but I understand that the elements of abstract algebra would be.)
If you want more precise recommendations for books, I am sure we can help there too.
Comment: Some basic abstract algebra at least is integral to model theory.
Answer: It depends of course what you mean by "a very high level of competence"! Being able to understand high-level work in logic, model theory, set theory (and you should certainly add computability theory to the list) is one thing, being able to do frontiers-of-research mathematical work in such areas is another thing. If you are interested in the philosophy of maths and logic, then it is definitely the first which is crucial. And it is certainly possible to gain a very good advanced understanding of the areas you mention without having a very wide and rich mathematical background.
So I would say that, at least for the present, you should concentrate on logic (broadly construed) and set theory etc., and pick up other mathematical knowledge as you go along, on a need-to-know basis. When you when you come across references to some background mathematical idea that seems to be important (i.e. features in more than a dispensable example), you can always check out Wikipedia (often good) or get a fellow student to explain over a pint of beer: that could very well be enough for your initial purposes, though you could find yourself intrigued enough to want to delve a bit deeper. [Speaking for myself, it only when I started teaching myself some category theory that I found myself struggling a bit because of the lack of a wide knowledge of modern abstract pure maths, having done the maths tripos so long ago and then specializing in applied.]
Still, having said that, why not sit in on a maths course or two at your university? That can be a relatively painless way of picking up more mathematical ideas! Start perhaps with the intro Analysis course. (Though since modern Analysis courses can put things set-theoretically at the outset, that can be potentially misleading about the supposed role of set theory as a foundation for mathematics. So maybe also try to an elementary course on Combinatorics or Number Theory,)
Finally, as it happens, I'm in the middle of writing a Teach Yourself Logic guide – I mean annotated reading list – for philosophy students who want to get to a high level of competence. So far it is only partly done, but you can find the current version here: http://www.logicmatters.net/tyl
Comment: But shouldn't one have a wide and rich view of mathematics when doing philosophy of math? Just looking at "foundational" material can give a rather misleading picture of mathematics.
Comment: Yes, @Michael, I agree that an impoverished diet of examples can lead to bad philosophy of maths. But the main point I was making here was just that a rich maths background is not really needed to get a good advanced understanding of logic/model theory/set theory.
Answer: This is a bit tangential to your question, but if your ultimate interest is in the philosophy of mathematics, I would believe that some knowledge of category theory, as a possible alternative to set theory as a foundation for mathematics, would be important.  The texts by Steve Awodey (Category Theory) or F. W. Lawvere and Stephen Schanuel (Conceptual Mathematics) may serve as useful introductions.
Comment: Lawvere & Schanuel is by far the easier book. Awodey is good but is actually quite tough going (it requires more 'mathematical maturity', as they say).
Comment: @Peter: I freely admit that Lawvere & Schanuel is a _much_ easier ride, though I feel that Awodey's text is very well written, if terse, and a bit underappreciated.  But mostly I'm glad that you didn't disagree with my inclusion of category theory as a topic philosophers of mathematics should be acquainted with.
Comment: Arthur: Oh I agree that Awodey's book is very nice: I appreciated it a lot more the *second* time I read it, when I came to it knowing a bit more already. I was just saying I wouldn't *start* there.
Comment: Arthur: And yes, I do agree very much that (more) philosophers ought to know (more) about category theory. The last section of my Teach Yourself Logic guide for philosophers is planned to cover that.
Comment: @Arthur,Pete If Awodey is a bit much for your intended audience but you still want to maintain strong rigor-as well we should-then Harold Simmon's INTRODUCTION TO CATEGORY THEORY may be just what the doctor ordered.It covers all the basics, it's relatively short and quite rigorous, but Simmons motivates the material a bit more then Awodey does.


Will restoring WhatsApp chats from a backup also restore blocked contacts' chats?

Question: If I want to restore my conversations on WhatsApp and I'm reinstalling it from the latest backup, will the conversations with the blocked contacts appear? Will the blocked contacts continue to be blocked?
Answer: Yes, restoring from backup (like with Titanium Backup) will restore all conversations. App settings will be restored as well, so blocked contacts should stay blocked.
Comment: The chats should be in the same state as when the backup was made. So if you cleared them, they should be clear.
Comment: Thank you! Which means that they will still be blank? because basically if i "cleared the conversation" and then i blocked the user, even after a restore, the chats will be blank?
Answer: The blocked numbers don't have any relation with restoring backup or not. They're stored online. So, even if you don't restore the backup, the numbers will be there in the blocked list.
Comment: chats are stored locally too


How do you call a fifth-year student in college terminology?

Question: In US College terminology, they call a fourth-year college student a Senior. Most of their reasons were because you are a senior when you graduate from college. How about those courses who have 5-year course with 2-semester only, like 5th-year college student? What's the term they are categorized?
Comment: When I was at RPI  years ago, the Architecture degree program was a five-year sequence. Architecture students _never_ called themselves 'junior' or 'senior'; they were 'third year' through 'fifth year'. 'Freshman' and 'sophomore' were common but not universal because those two years were mostly taken by 'common core' courses that _all_ students had to take.
Answer: To the best of my knowledge, there is no single word corresponding to "senior" for a fifth-year student. Such a person would most likely simply be called a "fifth-year student", or possibly a "fifth-year senior". The latter might be more likely when such a situation is a rare exception, When many or most students are in a program for 5 years or more, I would expect "Nth-year student" to be the usual for for all students, and the one-word forms not to be used often.
Answer: I agree with the above answer, the US does not have a standardized word for a 5th year student. Typically, students would just say "This is my 5th year" or "This is my final year." Some students consider themselves to be juniors for two years or seniors for two years, but that's more about culture and less about language.
Some slang terms to describe 5th year students do exist though. Here are some of them:

Super Senior (This is most common, many Americans will know what you mean if you say you're a super senior)
Hang-overs (Cornell University uses this term)
Stay-overs (I've heard this exactly once)
Extras (I've heard a student from Florida use this term)


Eigenvalues in orthogonal matrices

Question: Let $A \in M_n(\Bbb R)$.
How can I prove, that

1) if $ \forall {b \in \Bbb R^n}, b^{t}Ab>0$, then all eigenvalues $>0$.
2) if $A$ is orthogonal, then all eigenvalues are equal to $-1$ or $1$
Comment: Two is false. The _determinant_ is $\pm 1$, not the eigenvalues in general. Take a rotation matrix for example.
Comment: for two use the fact that you can diagonalize orthogonal matrices and the determinant of orthogonal matrices is 1
Comment: 1) does not need to to be true if $A$ is not symmetric. In that case, you could construct a real matrix with complex eigenvalues satisfying (1) but obviously with non-real eigenvalues (though their real parts might be positive).
Comment: @Ale The link you give has counter-examples in it. The eigenvalues merely have to satisfy $|\lambda| = 1$.
Answer: Let $\lambda$ be $A$ eigenvalue and $Ax=\lambda{x}$.

(1) ${x}^{t}Ax=\lambda{x^tx}>0.$ Because $x^tx>0$, then $\lambda>0$
(2) $|\lambda|^2x^tx=(Ax)^{t}Ax={x}^{t}A^{t}Ax=x^tx.$ So $|\lambda|=1$. Then $\lambda=e^{i\phi}$ for some $\phi\in\mathbb{R}$; i.e. all the eigenvalues lie on the unit circle.
Comment: If $|\lambda|=1$, it does not follow that $\lambda=\pm 1$. Only $\lambda=e^{i\phi}$ for some real $\phi$.
Comment: Yes, you are very right.@TooOldForMath You must consider the real eigenvalue.
Answer: The first part of the problem is well solved above, so I want to emphasize on the second part, which was partially solved.
An orthogonal transformation is either a rotation or a reflection. I will focus on 3D which has  lots of practical use. Let us then assume that $A$ is an orthonormal matrix in $\mathbb{R}^3 \times \mathbb{R}^3$.
We find that its eigenvalues are either $1, \text{e}^{\pm i \theta}$ for a rotation or $\pm 1$ for a reflection.

For a rotation:
We have the following sequence of equalities (since $\det A = 1$)
\begin{eqnarray*}    \det(I -A) &=& \det(A) \det (I-A)  \\   &=&
\det(A^T) \det(I-A)  \\   &=&  \det(A^T - I)  \\   &=&  \det(A - I)
\\   &=& -\det(I-A)   \quad , \text{since 3 is odd}, \end{eqnarray*}
So $\det(I-A)=0$ and $\lambda_1=1$ is an eigenvalue of $A$.
Now, let $u_1$ the unit eigenvector of $\lambda_1$, so $A u_1 =
u_1$.  We show that the matrix $A$ is a rotation of an angle
$\theta$  around this axis $u_1$. Let us form a new coordinate
system using $u_1, u_2, u_1 \times u_2$, where $u_2$ is a vector
orthogonal to $u_1$, so the new system is right handed (has
determinant = 1). The transformation between the old system $\{e_1,
e_2, e_3\}$ and the new system is given by a matrix  $B$ with column
vectors $u_1, u_2$, and $u_3$.  So we have that $B e_i = u_i$. Let
us call the coordinate transformation (similarity) matrix $C =
B^{-1}AB$. Then
\begin{eqnarray*}
    C e_1 = B^{-1} A B e_1 = B^{-1} A u_1 = B^{-1} u_1 = e_1.  \end{eqnarray*}  The fact that $C e_1 = e_1$ means two things:

The first column of $C$ is  $(1,0,0)^T$.
The first raw of $C$ is $(1,0,0)$.

Then $C$ is a matrix of the type
\begin{eqnarray*}
C = \left (   \begin{array}{ccc}
    1 & 0 & 0 \\
    0 & a & b \\
    0 & c & d \\   \end{array}   \right ) \end{eqnarray*}  Since $A$ is orthogonal $C$ is orthogonal and so the vectors $(a,c)^T$ and
$(b,d)^T$  are orthogonal and since  \begin{eqnarray*}
    1 = \theta A = \det C = ad - bc  \end{eqnarray*} we have that the minor matrix with entries $a,b,c,d$ is a rotation (orthogonal
with determinat 1). Rotations in 2D are of the form
\begin{eqnarray*}
    \left (
    \begin{array}{cc}
      a  & b \\
      c  & d
    \end{array}
    \right )
=
    \left (
    \begin{array}{cc}
      \cos \theta  & -\sin \theta \\
      \sin \theta  & \cos \theta
    \end{array}
    \right ) \end{eqnarray*} then   \begin{eqnarray*}   B^{-1}A B = \left (   \begin{array}{ccc}
    1 & 0 & 0 \\
    0 & \cos \theta & -\sin \theta \\
    0 & \sin \theta & \cos \theta    \end{array}   \right ) \end{eqnarray*} But since the eigenvalues of $B^{-1}AB$ are the same
as those of $A$ we find the eigenvalues of this matrix and those
would be the eigenvalues of $A$.
For the eigenvalues of this matrix we have that
\begin{eqnarray*}   \det ( C - \lambda I)= 0 \implies   (\cos \theta
- \lambda)^2 + \sin^2 \theta = 0. \end{eqnarray*} That is,
\begin{eqnarray*} 1 -2 \lambda \cos \theta + \lambda^2 = 0
\end{eqnarray*} Then
\begin{eqnarray*}   \lambda = \frac{2 \cos \theta \pm \sqrt{4 \cos^2
\theta - 4}}{2} =  \cos \theta \pm i \sin \theta = \text{e}^{\pm i
\theta}.
\end{eqnarray*}

This is the interesting result by Euler where he claimed that all
rigid body rotations can be written as rotation about one vector
(here $u_1$ by some angle $\theta$).

Eigenvalues of a reflection. If we repeat all the steps above for a
reflection we find that now
\begin{eqnarray*}   B^{-1}A B = \left (   \begin{array}{ccc}
    1 & 0 & 0 \\
    0 & \cos 2 \theta & \sin 2 \theta \\
    0 & \sin 2 \theta & -\cos 2 \theta    \end{array}   \right ) \end{eqnarray*}
Now
\begin{eqnarray*}
 \det ( C - \lambda I)= 0 \implies   -(\cos
2 \theta  -  \lambda)(\cos 2 \theta + \lambda )  - \sin^2 2 \theta =
0.
\end{eqnarray*}
and then
\begin{eqnarray*} -\sin^2 2 \theta - \cos^2 2 \theta + \lambda^2 =0
\end{eqnarray*} and from here
\begin{eqnarray*}   \lambda =  \pm 1. \end{eqnarray*}
.

Please see the following reference which I used for this answer:
Orthogonal Matrices
Comment: The link you have provided is not working. Can you please give the new link?
Comment: Can you explain why $det(A^{T}-I) = det(A-I)$
Comment: @SachchidanandPrasad  : I appreciate your remark.  I updated the link, it was changed.
Comment: Looks like the link is broken again, though archive.org has a saved copy of the previous link https://web.archive.org/web/20150206015748/www2.bc.edu/~reederma/Linalg17.pdf
Comment: @HermanJaramillo, so can I say that the eigenvalues of orthogonal matrices are real iff it produces a pure reflection?
Comment: @DatBoi : I would say no.  Take a Householder transformation in 2D. This is a reflection with eigenvalues 1 and -1. Now a rotation in 2D has eigenvalues exp(i theta). If theta=n*pi, then you get eigenvalues 1, and -1, but these are not reflections, this are rotations. If you include in the concept of reflections those with respect to the origin. Then yes, all eigenvalues 1 and -1 are reflections and vice-versa.
Comment: That makes a lot of sense. Never thought about considering these reflections about origin. Thanks a ton!
Answer: (1):
Let $Av=\lambda v$ with $v\not=0$, i.e. $\lambda$ is an eigenvalue of $A$. Then
$$0<v^t Av=\lambda v^t v=\lambda \|v\|^2.$$
Since $\|v\|^2>0$, we get $\lambda>0$.
(2):
You certainly mean that the determinant of $A$ is $\pm 1$, since the statement about the eigenvalues is not true, for consider the orthogonal matrix
$$\begin{pmatrix}\cos\theta & -\sin\theta\\
\sin\theta & \cos\theta\end{pmatrix}$$
This represents a rotation and has therefore complex eigenvalues.
But if $A$ is orthogonal, then $A^tA=AA^t=I$, therefore applying the $\det$ to both sides and using the multiplication law for determinants, we obtain
$$(\det A)^2 = 1$$
Therefore $\det A=\pm 1$.
Comment: This solution has problems. $|\lambda|=1$ holds for the eigenvalues of every orthogonal matrix Q.
Answer: Both statements are false as currently written. The following matrix serves as a counter-example for both.
$$R = \begin{pmatrix}\cos 1 & -\sin 1 \\ \sin 1 & \cos 1\end{pmatrix}$$
The first statement needs to be modified so that the matrix has all real eigenvalues, otherwise it is false as noted by Algebraic Pavel in the comments. Let us express an arbitrary non-zero vector $\mathbf{b}$ in polar form
$$\mathbf{b} = r\begin{pmatrix}\cos \phi \\ \sin\phi \end{pmatrix}$$
Then for the above matrix $R$, we get
$$\mathbf{b}^\mathrm{T}R\mathbf{b}= r^2\left( \cos(\phi + 1)\cos\phi + \sin(\phi+1)\sin\phi\right) = r^2\cos 1 > 0
$$
The eigenvalues are both complex however. If we assume that all eigenvalues are real, then the arguments given by TooOldForMath and gaoxinge works fine.
The second statement should say that the determinant of an orthogonal matrix is $\pm 1$ and not the eigenvalues themselves. $R$ is an orthogonal matrix, but its eigenvalues are $e^{\pm i}$.
The eigenvalues of an orthogonal matrix needs to have modulus one. If the eigenvalues happen to be real, then they are forced to be $\pm 1$. Otherwise though, they are free to lie anywhere on the unit circle.

Eigenvalues in orthogonal matrices


Does this series converge as $x\to \infty$

Question: $$\lim_{x \rightarrow \infty}  \sum_{n=0}^\infty (-1)^{n} \frac{x \lvert x \rvert^{2n}}{2n+1}$$
If the series didn't have  $(-1)^n$ then it would be evident that the series diverges but the alternating between high values throws me off. Any suggestions?
Comment: @ hwood87 Taken plainly the sum is divergent unless $|x|<1$. However, if understood as the limit of the analytic continuation of the sum $\frac{x \operatorname{arctan}(\left| x\right| )}{\left| x\right| }$ to $|x|$ >1 then the limit is $\frac{\pi}{2}$
Answer: For $|x| >1$ the sum does  not even exist so the question of its convergence as $ x \to \infty$ does not arise.
Answer: The other answers have already discussed the literal meaning of the convergence of the sum, but one can ascribe what is known as an antilimit to the sum
$$\sum_{n=0}^\infty (-1)^n\frac{ x |x|^{2n}}{2n+1} \to \arctan(x)$$
This limit is exact when $|x|<1$ but what makes it an antilimit is the assignment of this value to the sum even when $|x|\geq 1$, like a principal value-esque operation. With this interpretation for the regularization of the sum, we have that
$$\lim_{x\to\infty} \arctan(x) = \frac{\pi}{2}$$
but if I was asking this question to someone, this would've been a poor way to go about it without further context, and saying the limit does not exist would be more correct.
Answer: We have that for $|x|>1$
$$|a_n|=\frac{\mid x\mid^{2n+1}}{2n+1}\to \infty$$
therefore the necessary condition for the convergence doesn't hold.
Answer: For $x \ge 0$ we have $\sum_{n=0}^\infty (-1)^{n} \frac{x\mid x \mid^{2n}}{2n+1}=\sum_{n=0}^\infty (-1)^{n} \frac{x^{2n+1}}{2n+1}.$ This power series has radius of convergence $=1$.
Consequence: For $x>1$, the series in question is divergent.
Answer: To add on the previous answer, a necessary condition for the convergence of a series is that the $n^{th}$ term goes to $0$ as $n\to\infty$. In this case, if $|x|>1$, the absolute value general term is growing to $\infty$, rather than going to $0$.
If $0\leq x\leq 1$ the series has general term of alternating sign and whose absolute value goes to zero decreasingly. This is indeed sufficient for convergence of the series.
Thus, for $x\in[0,1]$ the series converges, for $x\in(1,+\infty)$ it does not.


Send file with REST?

Question: Do Java REST frameworks like Restlet and Jersey allow one to send a file as input to a web service?
This would encompass the client sending the file and the server then receiving and processing the file.
Answer: If you're asking if you can do an HTTP PUT to a Restlet service, then, absolutely, yes you can. You can use the Directory class if you just want to store the file, or you can implement your own ServerResource to handle the new resource.
I haven't used Jersey, but Restlet is a fantastic api.
Answer: Well, there's no restriction for them not to do it. REST handles files without any problems.
Take a look at:
http://mikedesjardins.us/wordpress/2007/04/restful-services-on-ftp/
Answer: You can also use REST Assured which builds on HTTP Client. It's very simple:
<code>given().multiPart(new File("/somedir/file.bin")).when().post("/fileUpload");
</code>

Send file with REST?