What is Gödel's pairing function on ordinals?

Question: I find many references to Gödel's pairing function on ordinals but I have not found a definition.  What is it?
Answer: Define an order on pairs of ordinals $(\alpha,\beta)$ by ordering first by maximum, then by first coordinate, then by second coordinate. That is, one pair preceeds another if the maximum is smaller, or they have the same maximum and the first coordinate is smaller, or they have the same maximum and first coordinate, but the second coordinate is smaller. This is clearly a linear order, and it is a well-order, since none of these three quantities can descend infinitely. Furthermore, every proper initial segment of the order is a set, consisting of pairs with the same or smaller maximum (and indeed, the reason for using the order-by-maximum part of the definition is precisely to ensure that the order is set-like; the lexical order itself is not set-like on Ord).
Thus, every pair $(\alpha,\beta)$ is the $\xi$ th element in this order for some unique $\xi$, we may view $\xi$ as the code of $(\alpha,\beta)$. Every pair has a unique code and every ordinal is a code.
This pairing function is highly robust and absolute, since the definition of the order is absolute to any model of even very weak set theories that contain those ordinals. Another attractive feature is that whenever $\kappa$ is an infinite cardinal (or even merely a sufficiently indecomposable ordinal), then $\kappa$ is closed under pairing, in the sense that any pair of ordinals below $\kappa$ is coded by an ordinal below $\kappa$.  This is how we know $\kappa^2=\kappa$ for well-ordered cardinals. In particular, this method of coding also works on natural numbers.
But I'm unsure if this coding is due to Gödel or was known earlier (perhaps even Cantor?); so it may not be the answer you seek.
Comment: I have not checked the original sources, but I guess that Godel's pairing function is the inverse of this function described by Joel Hamkins. This inverse have a direct description in Shoenfield's Mathematical Logic, page 251. This (inverse) function is used by Shoenfield in the definition of the constructible model. One place to look is Godel's book on constructible sets and the consistency of GCH.
Comment: I think Rodrigo is probably right.  A pairing function like this is needed when one develops constructibility using the Gödel functions (as opposed to the nowadays more common development using definability).  And if I remember correctly, Gödel's book used the Gödel functions while his paper in the Proceedings of the National Academy used definability (or did I get that backward?).
Comment: Andreas: I think you got it right: According to secondary sources (Drake's book, page 132) the construction of the paper of 1939 is based on definability while the presentation in the monograph is based on Godel's operations.
Comment: Thanks.  The absoluteness is just the kind of thing I wanted to check from the definition.
Comment: I think that this coding is how Zermelo proved that $\aleph_\alpha\times\aleph_\alpha=\aleph_\alpha$. I'm not sure whether or not it was his discovery or someone else's and it can probably be checked in his 1904 paper.
Comment: Maybe the ordinal pairing functions are called Gödel coding not because Gödel invented this particular ordinal pairing function, but rather just because it is analogous to Gödel coding of sequences?
Comment: Okay, according to Jech Set Theory historical notes the ordering is due to Hessenberg (from his book - which I couldn't find - "Grundbegriffe der Mengenlehre", 1906).
Answer: Asaf and Joel have answered the question. Let me add a remark that expands the fact that it helps us prove that $\kappa\times$ and $\kappa$ have the same size. All the claims here can be verified rather easily. Multiplication and exponentiation are in the ordinal sense.
It is customary to write $\Gamma(\alpha,\beta)$ for the order type of the predecessors of $(\alpha,\beta)$ under the order than Asaf denotes $\prec$. For example, $\Gamma(\omega,\omega\cdot2)=\omega^2+\omega$.
An ordinal $\alpha$ is (additively) indecomposable iff $\alpha\gt 0$ and whenever $\beta,\gamma\lt\alpha$, then $\beta+\gamma\lt \alpha$. One can easily check that the indecomposable $\alpha$ are precisely those of the form $\omega^\beta$. Say that $\alpha$ is multiplicatively indecomposable iff $\alpha>0$ and $\beta\gamma\lt \alpha$ whenever  $\beta,\gamma\lt\alpha$. Then $\alpha$ is multiplicatively indecomposable iff it is $1$ or has the form $\omega^{\omega^\beta}$.
Ok, we can now state the remark; unfortunately I would not know who to credit for this observation, I think of it as folklore: An ordinal $\alpha$ is multiplicatively indecomposable iff it is closed under Gödel pairing, that is, $\Gamma(\beta,\gamma)\lt\alpha$ whenever $\beta,\gamma\lt\alpha$. In particular, $\Gamma(\kappa,\kappa)=\kappa$ for any infinite cardinal $\kappa$, which of course implies that $\kappa\times\kappa$ and $\kappa$ have the same size. Also, if $\kappa$ is uncountable, then there are $\kappa$ ordinals $\alpha$ below $\kappa$ such that $\Gamma(\alpha,\alpha)=\alpha$. Of course, all of this works well in $\mathsf{ZF}$ and all the definitions involved are absolute.

I prefer a different approach when verifying that $\kappa\times\kappa$ and $\kappa$ have the same size, one that (again) is absolute and goes through in $\mathsf{ZF}$, but only requires the use of additively indecomposable ordinals: One first checks that there is a (recursive) bijection $h:\omega\times\omega\to\omega$ with $h(0,0)=0$. Then, given ordinals $\alpha,\beta$, use their Cantor's normal form to write them as
$$ \alpha= \omega^{\alpha_1}n_1 + \omega^{\alpha_2}n_2 + \dots + \omega^{\alpha_k}n_k $$
and
$$ \beta= \omega^{\alpha_1}n'_1 + \omega^{\alpha_2}n'_2 + \dots + \omega^{\alpha_k}n'_k $$
where $\alpha_1 \gt \alpha_2 \gt \dots \gt \alpha_k$ are ordinals, and $n_1,\dots,n_k, n'_1,\dots,n'_k$ are natural numbers. (Note that these representations are not unique, but at least one of $n_i$ and $n_i'$ is non-zero iff $\alpha_i$ appears as an exponent in the canonical form of $\alpha$ or $\beta$).
Now set
$$ H(\alpha,\beta)=\omega^{\alpha_1}h(n_1,n'_1)+\omega^{\alpha_2}h(n_2,n'_2)+\dots+ \omega^{\alpha_k}h(n_k,n'_k). $$
Then $H$ is a bijection between $\alpha\times\alpha$ and $\alpha$ whenever $\alpha$ is indecomposable. And an easy inductive argument, appealing to the explicit proof of Schröder-Bernstein, allows us to use $H$ to argue that there is, provably in $\mathsf{ZF}$, a class function that assigns to each infinite ordinal $\alpha$ a bijection between $\alpha\times\alpha$ and $\alpha$.
(Of course, the existence of this class function can also be argued from $\Gamma$, using that there are $\kappa$ ordinals $\alpha$ below $\kappa$ with $\Gamma(\alpha,\alpha)=\alpha$, but this second approach is somewhat easier.)
I found this argument a while ago, but then saw that Levy gives essentially the same approach in his textbook on set theory. Again, I am not sure who to credit for this construction, it seems to go back to Gerhard Hessenberg's 1906 book, "Grundbegriffe der Mengenlehre".
Comment: Thanks Asaf and Joel! I didn't expect this argument to go back this far.
Comment: In the comments to Joel's answer I wrote that Jech attributes this proof to Hessenberg.
Comment: It is basically the same idea as the Hessenberg (commutative) addition operation on ordinals. For that, you sort the two Cantor normal forms to have the same terms, as here, and just add coordinate-wise. The twist for coding is not to just add the similar terms, but also to apply a natural number pairing function also.
Comment: Hmm... the attribution seems right. I have not seen Hessenberg's book, but Oliver Deiser's "Einführung in die Mengenlehre" describes Hessenberg's argument in page 301, and it is reasonably close to the one above.
Answer: According to this .pdf file the definition is this:
Consider the canonical ordering on $\mathsf{Ord\times Ord}$:
$$(\alpha,\beta)\prec(\gamma,\delta)\iff\begin{cases}
\max\lbrace\alpha,\beta\rbrace\lt\max\lbrace\gamma,\delta\rbrace & \lor \\\
\max\lbrace\alpha,\beta\rbrace=\max\lbrace\gamma,\delta\rbrace\land\alpha\lt\gamma&\lor\\\
\max\lbrace\alpha,\beta\rbrace=\max\lbrace\gamma,\delta\rbrace\land\alpha=\gamma\land\beta\lt\gamma
\end{cases}$$
The pairing function, if so, $G(\alpha,\beta)=\operatorname{otp}\lbrace(\gamma,\delta)\in\mathsf{Ord\times Ord}\mid(\gamma,\delta)\prec(\alpha,\beta)\rbrace$.
Comment: Too bad the link to the PDF is broken, maybe this is the correct one
https://www.math.uni-bonn.de/people/koepke/Talks/Ordinals_computations_and_models_of_set_theory.pdf
Comment: In case it isn't clear: this is exactly the same order and coding as in my answer.
Comment: Yes, I only saw Joel's answer after posting my own. It is not hard to see that we describe the same order.
Comment: @am70: Yes, but since the definition is in the answer, that's not a big deal that I feel the need to bump this for that edit. But thanks for letting me know.


Gauss Bonnet Theorem

Question: The Gauss Bonnet theorem for a closed surface states
$\int_M K = 2 \pi \chi$
where $\chi$ is the Euler characteristic and $K$ is the Gaussian curvature
$K = k_1 k_2$,
which is the multiplication of the principal curvatures, meaning the minimum and maximum curvature, of the surface at the point of evaluation.
Is there an intuitive way to understand why the Gauss Bonnet theorem requires the use of the Gaussian curvature, instead of a combination of any other curvatures on the surface?
For example, if I subdivide a surface into square-plaquettes, can I define a topological number using the curvature along the sides of the plaquettes instead?
I simply do not understand where the principal curvatures come from and whether they are avoidable, ie, whether there are alternative formulations of the Gauss Bonnet theorem that do not rely on them.
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comment: This is not really a question in differential topology.  You should modify the tags appropriately, by including differential geometry for example.
Comment: What's more, by Gauss's Theorema Egregium, the Gaussian curvature in fact depends only on the first fundamental form (the Riemannian metric) and can be defined without having the surface sitting in $\Bbb R^3$ and using its extrinsic geometry.
Answer: The historical definition of the Gaussian curvature at a point $p$ of a surface in $\mathbb R^3$ was in terms of the product of the minimum and maximum curvatures, etc.  However, a more conceptual definition would be to define the Gaussian curvature as the determinant of the Weingarten map $W_p$, also known as the shape operator.  Here $W_p$ is an endomorphism of the tangent plane to the surface at the point $p$.  The determinant, unlike the trace, is an intrinsic invariant of the Riemannian metric (i.e., the first fundamental form) on the surface.  The reason that the Gaussian curvature occurs in the Gauss-Bonnet theorem rather than some other combination is because the Gaussian curvature is the only intrinsic invariant at a point, to begin with.

Gauss Bonnet Theorem


Will Microsoft Access Runtime work with SQL Server Express?

Question: I am looking into make a simple drawing management/MRP database for a small company I work at.  It is not clear from the description of Microsoft Access Runtime whether or not it still retains the ability to connect to an external SQL database (Like Microsoft SQL Server Express).  I am thinking of purchasing a copy of Access 2010 and then making a standalone app for accessing the database that I can distribute to other employees.  Everyone does have excel here, so I could probably make forms using that, but it seems like Access would reduce the development time considerably.
Comment: You will need a full version of Access for the development, but users can just have the runtime and still connect to SQL Server.
Answer: Access Runtime will work fine with SQL Server.  We use it all the time.  You still need at least 1 license for Access, though, because the Runtime version does not allow development of databases.  Also, troubleshooting an app that's not working properly in Runtime is a pain, because you can't view any of the code or "break" (Ctrl/Alt/Break) an app to see what the code is doing.


Is there such a thing as a Conflation Fallacy? Or something like it?

Question: I commonly find this phenomenon when debating, where my statement is conflated with another similar statement or idea.
For example, if Person A. said "X is the highest grossing Horror movie of all time." And Person B. responded "that's not true, the highest grossing movie of all time is Z."
In this case, Person A. was referencing a particular genre, Horror, while Person B. took this statement to mean ALL movies of every genre and conflated them.
Now this could be an accident but I'm looking more for intentional misrepresentations of claims through conflation. I'm looking to see if there is a specific name for this misrepresentation. I know it sounds very similar to a Strawman Argument but it's a very specific kind of misrepresentation through conflation. If anyone could help me identify this type of fallacy that would be helpful.
Answer: Irrelevant conclusion or ignoratio elenchi.  Also known as "missing the point."
By discussing something other than the assertion, the fallacy simply does not argue against it.


Frontpage Admin Bar Disappeared

Question: I am on a multisite network. Recently my frontpage admin bar dissappeared but continued to show at backend. I disabled all the plugins, changed theme to twenty ten and twenty twelve also, but no success. But it starts showing when i change name of plugins folder to something else, but it doesn't when i network deactivate all plugins without changing name of plugins folder. I think network disabling all and/or changing plugins folder name is same thing so it should work by both ways. But admin bar only shows hen i change plugins folder name to something else, but not by disabling all plugins network wide. Please help ASAP.
Comment: This is impossible to answer without more information or hands-on debugging. Had you tried removing plugins one by one to narrow it down?
Comment: I did but still no success.
Comment: this may be your css  problum kindly check the dashbord css add frontend with each other  for strip
Answer: I have faced the same issue and solved it by addig wp_footer(); function in footer.php. Please make sure that you have wp_footer(); in footer.php.
Comment: I doubt that's it.

Frontpage Admin Bar Disappeared


I Pad and MS SQL data base

Question: I want to devolep a iPad Plugin for an application which is currently working as a web application. My web application now uses MS SQL server as back end, i designed my application as to fetch & update data in my back end MS SQl server, how can i connet my iPad application and  MS SQL data base
Answer: If you don't need the native capabilities of the iPad, like going offline, photo library, GPS etc, then you can make your website to display correctly on the iPad browser (Safari).  This way it can work across iPad, iPhone, Droid, other mobile devices.
If you do need a native iPad app, then you need to expose your CRUD operations with some type of service (usually RESTful, asmx will work as well) that your app can access.  You don't want to directly connect your app to your SQL database.
In essence create the API that your app can work against, then build your app to run against this API.  I built an iPad app that connects to an ASP.NET system that did just this that connected to the ASMX web services to fetch and update the database.

I Pad and MS SQL data base


Partially contained databases and Windows Logins - best practices?

Question: In versions of SQL Server prior to 2012, in order for anyone to log in to a database using Windows credentials, you first had to create a server-level login, them map that login to a user for each database.
In 2012/2014+ my understanding is that this is not necessary, and that a user can be granted access to a database merely by granting their domain login permissions on the database directly.
Is there any reason why we as SQL Server Admins should define a server-level login for a Windows account if that account isn't intended to have any specific server-level role (backupoperator, sysadmin, etc)?  Is the best practice now to simply forego the server level login definition for Windows accounts altogether, unless you want to grant that login a server-level role?
Answer: I was going to just comment the link to the SQL Server 2012 Best Practice security white paper...but found out Microsoft took it off the Internet for some reason. You might be able to find a cached version of it some where online, but I will paste in the contents of contained database section of the document here.
There is also a BOL article for Security Best Practices with Contained Databases, this may be why the white paper was taken off but not sure.
Author of this whitepaper: Bob Beauchemin, SQLSkills; Published January 2012; Applies to SQL Server 2012

Contained Databases and Authentication
SQL Server 2012 introduced the concept of contained databases. A
  contained database is a database that includes all of the settings and
  metadata needed for its operation with dependencies on the instance.
  From a security perspective, a contained database makes it easier to
  have user accounts that are limited to a single database. SQL Server
  2012 supports partially contained databases; it does not yet support
  full containment. Although contained databases allow more control by
  the "application administrator" they do have security repercussions.
Contained databases are interesting for a security point of view in
  that they allow defining users with authentication privileges, i.e.
  users who can log directly into a contained database without a
  corresponding login. Contained databases support two types of users:
  Windows users and groups that can directly connect to the database and
  do not need logins, and users with a password where the password is
  authenticated by the database, not the instance. This is not permitted
  by default; the instance administrator must specifically allow it by
  setting the "contained database authentication" configuration option
  on. To disallow connections to specific contained databases but allow
  access to other contained databases, a login trigger can be used.
Allowing direct connection of users to a database changes the
  effective threat-level of some existing permissions. For example, the
  permission ALTER ANY USER in a contained database gives permission to
  add user-based access to an instance through a contained database.
  Logins with ALTER ANY DATABASE or CONTROL DATABASE permission could
  also set containment on a database and add instance access through
  users. In addition, contained database users can connect to other
  database in the instance if the guest account is enabled.
Although you can use the system stored procedure
  sp_migrate_user_to_contained to migrate a database user mapped to a
  SQL login to a contained database user-with-password, contained
  databases' user-with-password does not use password history and
  expiration policies as SQL logins do, although password complexity
  checks are still used. Therefore, attaching a contained database could
  allow weak passwords. In addition, the password hashes for these
  passwords are stored in the database, not in master. Anyone with
  access to the database file could perform a dictionary attack on a
  separate, unaudited instance.
There exists the possibility of conflicts, if a login and contained
  database user have the same name. The rule for resolving this conflict
  is that if an initial catalog is specified in the connection string
  and it's the contained database, access is checking against the user
  based principal, not the login. To ameliorate this possibility, do not
  create conflicting names or specify a contained database as an initial
  catalog in a connection string. In addition, members of the sysadmin
  role should not use initial catalog in a connection string.
Best practices for contained databases

Use the default (off) setting for contained database authentication    and only turn this setting on if it is required.
Protect backups of contained databases using passwords.
Audit the capabilities of users and modules in contained databases.
Audit logins that have the ability to set containment, if contained    database authentication is allowed.
Disable the guest account on databases that share an instance with    contained databases.
Take care to avoid login/user-with-login naming conflicts
Avoid connection strings with initial catalog if contained database    authentication is permitted.
Comment: Yes, I'd read that BOL article.


GIS through Games: Ideas or Links

Question: I'm managing a project - http://nepanode.anl.gov aimed at improving data awareness and sharing around Environmental impact analysis. I'm struggling to come up with ways to engage users and show them how they can apply the site. I'm looking for specific ideas, games, demos, tutorials to demonstrate how the site can be used; looking for new ideas and/or links to existing training resources that aim to engage users through games or case studies? Limited to users only using the site and/or using QGIS
Comment: not sure this will even work as a community Wiki. Seems too broad to meet requirements.
Comment: I have added a link in the answers below which may spark some ideas for you.  Also, having worked in the computer games industry I have links with games/UI designers and coders.  I would love to explore possibilities for involvement with your project but this is obviously not the appropriate forum, so please PM me using the email in my profile to take such a discussion off-line.
Answer: Here is one example from the John Hutton Institute in Aberdeen (formerly The Macaulay Institute - where I headed up their commercial GIS team, though didn't create this game), Scotland, which might provide some ideas.

GIS through Games: Ideas or Links


Seed in a grid search

Question: When conducting a grid search over a range of parameters of a predictive model which is itself subject to randomness (such as a random forest with bagged features), should you set a seed for the predictive model, so that for each round of the grid search, the model is initialized the same? It seems straightforward, that you ONLY want to test the parameters, and the less variance, the better, but is there any scientific consensus on this?
Comment: To give a concrete example, if you're comparing the performance of RandomForest with max_features=2 or max_features=10, are you asking if it would be in some sense better to start each test with the random number generator initialized to the same seed?
Comment: Yes, exactly, but it might be that it doesn't have a significant effect, depending on how the rng works
Answer: The premise that the same random seed will lead two randomized algorithms to have more similar performance is extremely dubious (except perhaps for the most similar and specially structured of algorithms over the smallest of samples).
An analogy
Using a Monte-Carlo simulation, let's say you're trying to estimate a casino's house take in:

Game A: blackjack where the dealer hits on soft 17
Game B: blackjack where the dealer stands on soft 17

Would it make the comparison less noisy if Game A and Game B used the same order of cards (i.e. started with the same random seed)?
No! (Not in any meaningful way.) The moment Game A leads the dealer to take an additional card (compared to Game B), the games are no longer in sync: players will be dealt different hands, cards that would have gone to the dealer instead go to a player etc.... Just one card offset makes a huge difference, and everything will just diverge from there.
There may be some special case algorithms where the small differences don't just compound, but I would think these are unusual cases.
Comment: I'm afraid that your analogy may not be perfectly clear for those of us who weren't yet in Vegas ;)
Answer: That is an ongoing reseach topic (hyperparameter optimization). A very popular technique following the idea you formulate in your question is random search.
Once you see it, the idea is quite simple, and it is shown to work well in practice. Consider you search space with a finite maximum. Take the 5% interval around the maximum. If you sample at random, you have 5% chance of landing in that interval. The probability that when you sample n times you hit at least one time this interval is,
$$
1-(1-0.05)^n
$$
Now, you need to determine, how many times you need to sample. First you set a threshold for that probability. For example, you want to have a 95% confidence that you will eventually hit the interval once. Then it yields that n has to be at least 60.
Comment: I don't think this answers the question that was asked.
Answer:
It seems straightforward, that you ONLY want to test the parameters, and the less variance, the better

Well, it isn't that straightforward. @MatthewGunn already explained that it typically won't help as you apparently thought.
In general, if you encounter variance there are two quite opposide strategies of dealing with it.

(As you suggest,) reduce it as much as possible by restricting experimental conditions, or
measure and account for it.

Strategy 1 will only help if the restricted conditions can be applied to your further process. If they can not, you need to go with approach 2.
Besides, there are further points to consider:

If you fix the seed and for the algorithm you tune that does indeed lower the variance, then your conclusions are limited to that one seed (always the case with strategy 1). This may or may not acceptable for the task at hand - but you need to consider this point carefully.
Besides algorithms where the seed has negligible influence on the randomness (see @MattewGunn's answer) there are also algorithms where the combination of seed and training cases together lead to variance. In that situation, you may be successfully suppressing variance during the grid search using the same training set and the same seed but e.g. a final model built form the larger base of (training + optimization test cases) for training will be subject to additional variance. In other words, your grid search overfits.
Strategy 2 becomes particularly important, if some parameter of your grid may be influencing this variance: you'd then be able to consider whether the apparent optimum in your grid may be due to variance.
Answer: It seems that there is no scientific consensus on it.
I think that Monte Carlo analogy by @Matthew is not perfect.
E.g. if you had a neural network and you did a grid search of learning rate and momentum, then using the same random seed would lead to the same initialization which seems a good idea, so I agree with your intuition.
Key point here is different. If variance coming from random seed is significant compared to variance coming from different choice of hyper-parameter, then grid search may not have sens. For different seeds it may find different optimal hyper-points.
If such a case occurs, you may want to perform repeated cross validation, for more see this site

So the final answer is: if fixing seed matters, something is going wrong.
Comment: That's a good point that the random seed may matter more if you're minimizing non-convex functions (have problems with local minima) and your initial condition $\boldsymbol{\theta}_0$ is a random draw (that will become the same for each grid point if you fix the seed). I also agree that if substantive results are sensitive to fixing the seed, that's a problem. It implies results are not robust.

Seed in a grid search


Can someone help me in identifying this font

Question: I have scouted the internet looking for this font in the image below. I have searched through www.myfonts.com, whatthefont and other font identifier websites but no head way. Can someone please help me out? Thank you.
Answer: That's Cinzel Decorative font by Natanael Gama. Typed in all upper case at a weight of about 700 at a size of about 82px but from the looks of it, the Kerning on the P and I has been reduced by the designer so they almost touch.
Here are more font identifiers, you can use FontSquirrel, Myfonts' WhatTheFont, Fontspring's FONT MATCHERTER, whatfontis.com among others. Personally FontSquirrel's Macherator almost gives me about 70% accuracy on most fonts I get to look up.
Comment: Thank you very much you just saved a life, that is very accurate
Comment: Glad it was helpful @EmmanuelOkezieOgbonna, you can mark it as an answer then. :)


Extract frame from VOB(DVD) file

Question: I need to generate thumbnail from video files, i m using IMediaDet to get frame from video, it not working for (*.vob) file DVD, how can i get thumbnail from DVD in C# ..
Comment: You need to either use an undecrypted DVD or you need to decrypt your DVD in order for this to work.
Comment: You might be able to write your own render filter ... that way you'd have the raw data that you could do what you please with. Dunno if the copy protection mechanisms will stop you doing that though ...
Answer: It isn't clear whether or not you are using an unencrypted DVD. For the sake of this answer, I'm going to assume you are.
IMediaDet uses the Sample Grabber filter to perform most of its operations. Unfortunately the Sample Grabber doesn't support the VIDEOINFOHEADER2 format as indicated here. Some MPEG-2 decoders will only use the VIDEOINFOHEADER2 format, thus preventing the Sample Grabber from connecting, and IMediaDet from working.
I do know that the MPEG-2 decoder from Elecard available here is able to output both VIDEOINFOHEADER and VIDEOINFOHEADER2. It is thus compatible with IMediaDet and should be able to accomplish what you want.

Extract frame from VOB(DVD) file


Different ways of writing complex number arguments

Question: In complex numbers , when the argument of a complex number lies in the second quadrant we usually say that it's argument is $\pi -\theta$ however what is the meaning of the notation $\theta-\pi$ ?
For example , if I wanted to write the modulus argument form of $1+ i\tan\theta$ when $\theta$ lies in the second quadrant I would usually write it as $-\sec\theta \space\text{cis}\space(\pi-\theta)$ however the notation of $-\sec\theta\space\text{cis}(\theta-\pi)$ is also valid . How are both the same ?
Answer: $1+i\tan \theta =\sec \theta(\cos \theta + i\sin \theta)=\sec \theta \space \text{cis}\space \theta\\\hspace{43pt}=\sec \theta (-\cos(\pi-\theta)+i\sin(\pi-\theta))\\\hspace{43pt}= -\sec \theta (\cos (\pi-\theta) -i\sin(\pi-\theta))\\\hspace{43pt}
=-\sec \theta(\cos(\theta-\pi)+i\sin(\theta-\pi))\\\hspace{43pt} =-\sec\theta \space \text{cis}\space(\theta-\pi)$

$-\sec \theta \space\text{cis}\space (\pi - \theta) = -\sec \theta(\cos(\pi-\theta)+i\sin(\pi-\theta))\\\hspace{75pt}= -\sec \theta (-\cos \theta+i\sin \theta)\\\hspace{75pt}=\sec\theta(\cos \theta-i\sin\theta)\\\hspace{75pt}=\sec \theta\space\text{cis}\space(-\theta) \ne \sec \theta \space \text{cis}\space \theta\\\hspace{75pt}=1-i\tan\theta \ne 1+i\tan \theta
$
So, they're not actually the same.

As $\theta\in (\frac\pi2,\pi)$,
($\pi-\theta$) means $Q_1$ so imaginary part of $-\sec\theta \space \text{cis}\space(\theta-\pi)$ would lie in $Q_4$.
($\theta-\pi$) means $Q_4$ so imaginary part of $-\sec\theta \space \text{cis}\space(\pi-\theta)$ would lie in $Q_1$.
Also, imaginary part of $1+i\tan \theta$, which is $\tan \theta$, lies in $Q_1$ so that verifies this.
Comment: https://www.desmos.com/calculator/n1698xdz63
Comment: Thank you , but I'm the second step, why did you write $-cos(\pi-\theta)$ if we know that $cos(\pi-\theta)$ is already negative ?
Comment: $\cos \theta$ lies in $Q_2$ so it would be negative but $\cos (\pi - \theta)$ lies in $Q_1$ so as a result, it would become positive. So we need the minus to maintain the negative sign.
Comment: I'm sorry but I don't understand the meaning. If $\theta$ lies in second quadrant then how does $\pi -\theta$ lie in first quadrant ? I'm not able to imagine it actually
Comment: $\theta \in (90^\circ,180^\circ)$. So, ($\pi - \theta) = (180^\circ-\theta)\in(0^\circ, 90^\circ)$.


Kerberos events are not logged on Windows 7

Question: I tried to configure Windows 7 machine with our web-server running on it to log Kerberos-related events (meaning Windows system Log). I followed these instructions: How to enable Kerberos event logging.
In order to test this setting, I changed time on a demo client machine so that 'Clock skew too great' error would be raised. The exception itself was raised on a server, however, no logs were found in System Log. Even though I expect them to be logged only on a server machine, I also checked logs the same way on client machine, and even on a domain machine (which was rather a wild guess). As expected, no error events were found in system log.
Answer: I was trying this too, but it didn't work for me either, probably because Windows 7 is not listed in the "Applies to" section the link.


Magic Mouse Momentum Scrolling Not Working

Question: Unfortunately this is hard for me to test myself because I have yet to get a Magic Mouse of my own, but I've been told by my testers who do have a magic mouse that momentum scrolling isn't working in my app. I've not subclassed NSScrollView, but scrollview's document view is all custom. I have not overridden scrollWheel: anywhere, either, and yet momentum apparently just isn't working. I'm not even sure where to begin. I thought it'd just send scrollWheel events and things would take care of themselves. (Scrolling with a wheel or on the MBP trackpad works as expected.) Obviously I must somehow be doing something that's stopping it, but I don't even know where to begin. Thoughts?
Comment: Get a Magic Mouse. How do you expect to be able to develop applications for devices you can't use to test with?
Comment: Thanks.. that's easier said than done when there's no Apple store for 100+ miles and Christmas is coming this week. :)
Answer: I figured this out awhile ago and the problem was that on scroll, I was doing a lot of fancy view manipulation somewhat like how on the iPhone the UITableView adds and removes views as they scroll on and off screen. This worked great for performance - but the more I got into OSX programming, the more I realized this was wrong for OSX (but the right idea of iPhone).
Anyway, what's really going on, it seems, is that when you do something like a wheel scroll, the scroll event is sent to the view that's under the mouse cursor and then it ripples down the responders/views until it gets somewhere that handles it. Normally this isn't a problem, but with momentum scrolling the OS is really just sending ever smaller scrollWheel events to the view that was under the cursor at the time the momentum started. That means if the view is removed during the course of scrolling (because it scrolls off screen or something), it breaks the chain and the momentum stops because the view that's still getting the scrollWheel messages is no longer in the view hierarchy.
The "simple" fix is to not remove the view that got the last scrollWheel event - even if it's off screen. The better fix (and the one I went with) is to not try to use NSViews like they are UIViews and instead just draw the content using drawRect. :) Not only is that about a billion times faster, it Just Works(tm) with momentum scrolling because it's how OSX expects things to be done.
Repeat after me: OSX is not iPhoneOS.. :P
Comment: sean, thanks for the insights. very helpful. you were right about the root cause... i had implemented a UITableView-like view for the desktop, and removing the 'cell' views from the hierarchy was causing the issue. However, i have to disagree that this is a bad strategy for the desktop. after reading your post above, i found a simple fix for the issue: dont remove a view that is about to be reused from its superview. just resize/reposition it. and then remove those that are not reused. problem solved. seen in action here: http://tod.nu/listview
Answer: Odd scrolling behavior can occur when you don't set the Line Scroll and Page Scroll properties of the NSScrollView itself.
Beyond that, you're quite simply going to have to get a Magic Mouse - easily said or not :-) - to test this yourself or post the entire code of your custom view as well as the xib containing it. There's no way others can offer you more than guesses (like the above) without it.


Electrolytic capacitor with zero bias

Question: This is a very common trick used in many audio amplifiers with an op amp topology to minimise the output offset by creating a unity gain for DC. Usually the electrolytic capacitor sits on the ground so it operates around zero. The voltage drop is usually miniscule. Does it make a sense to provide an additional bias to the capacitor to increase its life span? It's believed that ±0.5V is a safe area but I can't find any concrete proofs.
Comment: Negative voltage is specified in datasheets, but lifetime or any other adverse effects they don't say.
Comment: I don't see any at least for Nichicon and Panasonic
Comment: Normally e-caps in audio are to remove DC to speakers, otherwise active circuits can use high R and small non-polar C parts.
Answer: The cathode of an aluminum electrolytic capacitor has a thin oxide layer (as opposed to the thick layer on the anode) that can withstand a few hundred mV (typically ~1V).
Applying excess reverse voltage continuously can result in reduced capacitance as the oxide layer grows, even if it doesn't cause excessive heating and venting of electrolyte. But <50mV or so isn't going to do anything.
Note that in your circuit if a low frequency AC voltage is applied, the capacitor can see some positive and negative voltage, up to approaching the supply voltages.
You could also use a nonpolar or bipolar electrolytic which has thick oxide on both anode and cathode. Or two ordinary electrolytics back-to-back. Or put a 1N4148 across the capacitor.
Applying a bias is possible (for example you could connect the capacitor to the negative rail rather than ground) but that sounds like a good way to inject noise into the amplifier circuit.

Electrolytic capacitor with zero bias


Android accelerometer full range

Question: I am currently working with Android Sensor API and accelerometer data.
Though the internal components should support high acceleration (even +-16g), I tried some recent smartphone and found that the maximum range of exposed data is usually +-2g (e.g. Nexus 5) and sometimes +-4g (e.g. Nexus 4).
Is there any way to set the full scale of the sensor? (I didn't manage to find a public API for this)
Alternatively, is there any flagship smartphone that support higher range from stock? (e.g. +-8g, +-16g).
Answer: I'm facing the same problem as yours.
DISCLAIMER: I just discovered what I'm writing, so I haven't tested it at all... but I think it's in the right direction.
Checking what range is functional is quite simple: Sensor.getMaximumRange()
http://developer.android.com/reference/android/hardware/Sensor.html#getMaximumRange%28%29
Now, as you know, setting the appropriate value is a much more involved thing. I believe it has to do with Android's so-called "Hardware Abstraction Layer"
https://source.android.com/devices/reference/files.html
I've found this document by STMicroelectronics, who are the manufacturers of the accelerometers embedded in Samsung Galaxy SIII and S4 http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00063297.pdf
If I'm getting it right, you need to #define ACCEL_MAX_RANGE in configuration.h (page 5 of the document) as 8 or 16*GRAVITY_EARTH. There are plenty of instructions following, which I'm still trying to understand, but I think one would need to root the smartphone and compile Android from its source.
Hope this helps! If you manage to solve it, please let me know so that we can help each other.
Regards
Answer: Sorry that this is an answer and not a comment, but I don't have the rep yet. I've got a Moto X 2nd Gen, and the accelerometer has a 16-g range(+/-).
Here's the datasheet for the sensor. It's an MPU6515 from Invensense.
Answer: As ignzz stated in his/her initial post, it does not seem to be a problem from the sensor hardware, which in his/her case can also record +/-16g in principle. I believe it has to do with the settings of the operating system.
However, I haven't had time to give a try to what I described above. Has someone tried?

Android accelerometer full range


Hourly electricity demand data finding AR and MA terms

Question: I am new to time series analysis. I have hourly electricity demand data for five years (having multiple seasonalities at intra-daily, intra-weekly, and annual periodicities) and I want to guess the number of AR and MA terms using ACF and PACF. Please advice me how to remove seasonalities and guess the AR and MA terms.
Answer: Standard ARIMA can only deal with a single seasonality, by taking seasonal differences. You might be able to work with multiple seasonal differences at different lags, but

I have never seen this approach used by serious forecasters, which predisposes me to think it's not a good idea
I personally think it's not a good idea, because it turns into a mess
I don't know of any software that implements multiple-seasonal ARIMA

I'd much rather recommend you look at BATS or TBATS models, which are based on exponential smoothing. The tag wiki for the multiple-seasonalities tag contains pointers to literature. This earlier question and previous posts containing "BATS" may be useful.


Primer for my drywall project

Question: I do not have enough in my pail to finish my project. Can I add another brand of primer to it that I have on hand?
Answer: I think the best bet is to use up the remaining primer in the pail by applying it to the drywall. Then start with the new pail applying on the remaining drywall.
Even better would be to let the residual area dry before coming with an overlapping coat of the new primer.
Some paints would mix just fine whilst others may not. So why take the chance when the solution is simple.

Primer for my drywall project


Automatic display of Server Manager - turn off

Question: Is there a way to turn off the automatic display of Server Manager after each log on to the server (Windows Server 2008R2)? Can I do that for all servers that are domain members?
Answer: Why not go directly to the source of what is starting Server Manager, instead of putting up roadblocks to stop it afterwards? I found it easier to simply disable the task in Task Scheduler that starts Server Manager.
This was brought to my attention at: http://flamingkeys.com/2010/09/how-to-disable-server-manager-globally-on-server-2008-rtm-or-r2/
Just open Task Scheduler and navigate to:
Task Scheduler (Local) > Task Scheduler Library > Microsoft > Windows > Server Manager
Then right-click on the task and select Disable.
Carl
Comment: Works in Server 2012 R2 as well.
Answer: You can disable this behavior, and this is done either by enabling the check-box Do not show me this console at log on or by setting a Group Policy.
If you have an Active Directory Domain Services environment, then you can set it using Group Policy Management Console.
To disable Server Manager automatic display after log on, follow these steps: In Server Manager, under the Server Summary section, enable the check-box beside "Do not show me this console at log on" and close the window.
To set it though Group Policy, then follow these steps: Go to Administrative tools then to Group policy management. In Computer Configuration for Default Domain policy (or any other policy setting e.g. for some OU), under Policies/Administrative templates/System find Server Manager and then enable "Do not display Server Manager automatically at log on"


Execute a file in the body of a specific content type

Question: How to load the file, which contains css, javascript and html, in the body of a specific content type?
Comment: The file that contains that is html.tpl.php, but why you need to load that file in a content type? What do you need to do exactly?
Answer: Looks like you are looking for Code per Node module:

Code per Node makes it possible to add custom CSS and Javascript per node, per content type, per block, and globally. The code is stored in the database, but served from the file system.
Answer: Insert is a utility that makes inserting images and links to files into text areas or WYSIWYGs much easier. It adds a simple JavaScript-based button to FileField and ImageField widgets.
You can insert files inserted into text areas with a specific Content type Option.


Disturbing Notification

Question: I received an E-mail notification a couple of days ago welcoming me for signing onto Stockholm Arlanda Airport's wifi network.  My wife and I have never been to Stockholm.  I asked my neice's husband who is involved with IT about it and he didn't seem too concerned.  Felt someone might have mistakenly entered my E-mail address when signing on.  Figured I should double check in case.  Anything to be concerned over?  Any recommended security precautions?  Thanks in advance!
Comment: "someone might have mistakenly entered my E-mail address when signing on" or the guy just put any email he knew to access the airport internet.
Answer: I agree with the comment; this doesn't sound like an issue to me. If the email legitimately came from Stockholm Arlanda Airport (you can check the email address*) and if the email doesn't ask for any personal information, I wouldn't worry.
I don't like putting my personal email address in captive portals; I don't want be on their email list for something I likely don't care about. I suspect that's what happened here - someone simply typed in your email instead of their own.
*Note, most modern email providers do filter spoofed emails, and the probability that's the case is low.

Disturbing Notification


shortcodes not working [dt_carousel & [dt_fancy_image

Question: I've been asked to investigate an issue with a WordPress site that's displaying shortcodes. The site is new to me and I don't know who built it. The shortcodes start with [dt_carousel ... or [dt_fancy_image .... I'm trying to find out which plugin would use this shortcode so I can reinstall it, or if it's already installed contact the author or fix it in some other way. A Google search just brings up other websites that are displaying the shortcodes and there are many of these, so it's common problem without an easy-to-find solution. I've tried disabling plugins to see if there's a clash somewhere, but I still get the shortcode displaying. The site is using the theme Sinatra and the WPBakery page builder. So any help to point me in the right direction to get the shortcodes working this will be appreciated.
Comment: As far as I can tell they appear to belong to themes developed by these guys: https://themeforest.net/user/dream-theme, particularly "The7". You will need to check with them if it's possible to make the shortcodes work in another theme.
Comment: @JacobPeattie Thanks for your comment, I think you maybe right. There are a couple of "The7" plugins on the site that are missing licences and need updating. Once my client has purchased the licences and I've conpleted the updates, I'll confirm.
Answer: Sometimes the problem is less complicated than you expect. The wrong theme had been activated. Activating the theme 'The7' solved the issue. There are loads of sites out there with the same issue, hopefully this may help those who manage them.


Trig and derivatives: If condition holds for derivative, does it hold for the original equation?

Question: Let's say I have some trigonometric identity such as $\sin(x) + 1 = -\cos(y)$. As we can see, the derivative of this identity gives $\cos(x) = \sin(y)$, which implies that $x + y = \pi/2$. Does that mean that $x + y = \pi/2$ in the original equation?
Comment: Your derivative is wrong, if you differentiate wrt to $x$ (assuming $y=y(x))$ then you would get $\cos x=\frac{dy}{dx} \sin y$. In general, to your further point, the answer is no.
Comment: It doesn't.Put x and y as $\frac{\pi}{4}$.
Comment: what do you mean by $1+\sin x = \cos y$ an idnetity?
Comment: You are right, it's an equation, not an identity. Sorry.
Answer: The derivative of this identity does NOT give you $\cos(x) = \sin(y)$
You need to know what you are differentiating over, and there are several options:

Differentiating over $x$, if $y$ is an independent variable, the identity becomes $\cos(x) = 0$
Differentiating over $y$, seeing $x$ as an independent variable, means you get $0=\sin y$
If $y$ is a function of $x$, then after derivation (over $x$), you get $\cos x = \frac{dy}{dx}\cdot \sin y $
If $x$ is a function of $y$, then you get $\frac{dx}{dy}\cdot\cos(x) = \sin y$.
Comment: I see. I was having doubts about what was it that I was differentiating over and whether you could do what I did there or not. Thanks for helping!
Comment: Can the downvoter please explain how this answer is *WRONG* and deserving of a downvote?
Answer: If $x$ and $y$ are supposed to be  numbers, then $\sin(x)$ and $\cos(y)$ are also numbers, and the derivative of both sides will be $0$. Then you just get the true, but useless, identity $0=0$.
Answer: I think you confused yourself by including $x$ and $y$. Typically an identity is in the form of some equation that includes the same variable on both sides, say $x$, and the equation holds for any value of $x$ (or any value that in the the domain of both sides).
Some identities have the two instances of $x$ on the same side, for example:
$$ \left(\cos\left(x\right)\right)^2 + \left(\sin\left(x\right)\right)^2 = 1$$
if we take the derivative of both sides with respect to $x$:
$$-2\cos(x)\sin(x) + 2\sin(x)\cos(x) = 0$$
That is true! But be careful. We could have started with any constant right-hand side, not just $1$. The derivative of any constant with respect to $x$ is $0$.
What this means is that if you know the identity is true, and then take a derivative, the new identity will also be true. But you cannot go the other way. And that is because when you integrate the derivative of a function, you don't recover the constant offset in the function (because the derivative of that term is always zero). This ambiguity is the reason why you include a constant of integration when stating the anti-derivative of a function.
Still, though, if you're stuck on trying to find an identity of some form, you can integrate something you do know, and then solve for the constant.
For example, suppose you didn't know about kinetic and potential energy. And you didn't ever hear about conservation of energy. But you did know how to write down the equations for an object in free-fall:
$$\frac{\text{d}^2}{\text{d}t^2}y(t) = a(t) = -g$$
and you chose the coordinates of $y$ such that $y(0)=0$, and you also know the object starts at rest. Then you know the velocity and position of the object as
$$\frac{\text{d}}{\text{d}t}y(t) = v(t) =  -gt$$
$$\frac{\text{d}}{\text{d}t}y(t) = p(t) = -\frac{1}{2}gt^2$$
(note that $a(t)$, $v(t)$, $p(t)$ are mnemonics for acceleration, velocity, and position)
Let's suppose that somehow you decided that the following was remarkable:
$$ a(t) \cdot v(t) - g \cdot v(t) = 0 $$
If you take the anti-derivative with respect to $t$ (The first term requires $u$-substitution with $u=v(t)$. The second term requires the fundamental theorem of calculus.), you get
$$\frac{1}{2}\left(v(t)\right)^2 - g \cdot p(t) = C$$
If you did the integration of each term separately, you get three constants of integration. You can combine them all into one constant.
That above is a statement of conservation of energy. The first term is the kinetic energy per unit mass, and the second term is the potential energy per unit mass. The constant reflects that we don't know the ground level for defining the potential energy, so we don't know how much potential energy the object starts with. But whatever it is, the energy is constant.
Comment: Thanks for the awesome post! This totally cleared my doubts.
Comment: Glad to help. Please see http://math.stackexchange.com/help/accepted-answer


What is the actual reason for geometrical isomerism?

Question:
My teacher explained it as restricted rotation between the double bonds. But I think there is more to it. After all, why is it considered to be a type of isomerism itself? Whether an alkene is cis or trans only depends on how you make the structure on paper. So what is the basic idea behind it?
Comment: What do you mean exactly by "it only depends on how you make the structure on paper"? There are no rotational nor mirror symmetries that can convert a cis isomer into a trans, so they are different compounds. Another way to look at it is that not all the parts of the molecule are in the same position relative to each other in the isomers, so there should naturally be different steric interactions. You can convert one into the other by rotation of the double bond, but that is highly restricted as you need to temporarily break the $\pi$ bond, resulting in a high bond rotation energy barrier.
Comment: It is very hard to see which problem you have. If I ask you to draw a hat I cannot pretend you draw it in the colour I want.  If I want a red hat I must ask for it.  Else it cab be blu or whatever. It as an analogy  E and Z are different ergo the E Z nomenclature to distinguish them.  Moreover the title does not reflect your problem thus the nice answers cannot solve it . If your teacher ask you to draw but-2-ene is up to you.  Or you draw both as differently from the hat analogy their are just two, it is manageable.
Comment: I've tried to explain my point via paper 53. You see, I get your explanation but the problem arises when you draw it on paper. If you specify cis or trans, I will make the compound. But if you ask me that I make 2-butene and without seeing my structure you ask me is it cis or trans, then it would only depend on how I MAKE the compound. That's the problem I've experienced.
Comment: @Alchimista The actual intention behind this question was the fact that sometimes my teacher "obviously" referred to some geometric isomer and I would be lost and be looking for properties of the compound to make myself understand why it was so obvious to him.
Answer: Geometric isomerism occurs when two structures with the same connectivity are not interconvertible.
Cis-Trans isomerism is common and easy to recognize kind of geometric isomerism. The carbon-carbon double truly has limited rotation. The double bond in the alkene functional group consists of a $\sigma$-bond located within the plane of the molecule and a $\pi$-bond located perpendicular to the plane of the molecule. In the image below (created by David Pilz for Wikipedia), you can see the $\pi$-bond in a perpendicular plane.

The $\pi$-bond is made from $p$-orbitals, so it cannot have the same symmetry as the $\sigma$-bond. You can see the formation of the $\pi$-bond from $p$-orbitals in this picture by Wikipedia user JoJan. In order for the $\pi$-bond to exist the $p$-orbitals must be aligned.

In order for the molecule to rotate from $cis$ to $trans$, the bond axis would need to rotate so that the $p$-orbitals are no longer aligned and can no longer form the $\pi$-bond.  This slide show from James Condon at Roane State(PDF) explains the same concept. Rotation around the double bond requires enough energy input to break the $\pi$-bond, at least $250 \ \text{kJ/mol}$, which is a lot for room temperature.
The clearest demonstration that geometric isomers are clearly different molecules is to look at some examples with drastically different properties. It is important to remember that the experimental observation that these compounds with very similar structures have very different properties predates the explanation that the double bond has limited rotation.
The two isomers of 1,2-dichloroethene have different physical properties due both the difference in polarity and the difference in shape:

$cis$-1,2-dichloroethane

Dipole moment = $1.9 \ \text{D}$
Boiling point = $60.2 \ ^\circ\text{C}$
Melting point = $-81.47 \ ^\circ\text{C}$
Density = $1.28 \ \text{g/cm}^3$

$trans$-1,2-dichloroethane

Dipole moment = $0.0 \ \text{D}$
Boiling point = $48.5 \ ^\circ\text{C}$
Melting point = $-49.44 \ ^\circ\text{C}$
Density = $1.26 \ \text{g/cm}^3$

However, my favorites are maleic acid and fumaric acid. Notice the extreme difference in water solubility as well as the difference in acidity. These molecules behave very different chemically.

Maleic Acid $cis$

Melting point = $135 \ ^\circ\text{C}$ (decomposes)
Density = $1.59 \ \text{g/cm}^3$
Solubility in water $788 \ \text{g/L}$
Acidity $\text{p}K_{a_1} = 1.9$, $\text{p}K_{a_2} = 6.07$

Fumaric Acid $trans$

Melting point = $287 \ ^\circ\text{C}$ (does not decompose)
Density = $1.635 \ \text{g/cm}^3$
Solubility in water $6.3 \ \text{g/L}$
Acidity $\text{p}K_{a_1} = 3.03$, $\text{p}K_{a_2} = 4.44$
Comment: Well, since cis and trans [2-butene](http://en.wikipedia.org/wiki/2-butene) are different compounds with different properties, you either need to be told which one to draw, be given enough information (for example some reactions are stereospecific and would generate one isomer and not the other based on the reactant), or it does not matter. If you are worried about when it matters and when it does not, ask your instructor about it.
Comment: Thanks for explaining geometrical isomers such a nice way @BenNorris but please look at the picture I've attached and the comment I posted below it. Although in real life you can differentiate between them but when you make 2 butene on paper and I ask you what it is, your answer would depend on how you've made your structure. That is the real problem.
Comment: @BenNorris In higher temperatures they should interconvert. So why they have different boiling point and not a common one? I mean suppose that from a given reaction we took only one isomer. Now we isolated this isomer and start heating it up. As we heat it up shouldn't interconversion be possible? So if we can find a temperature that can interconverts these two (reaching equilibrium) then we should expect a mixture with both of them. Then shouldn't this mixture have a common boiling point?
Comment: Correct me if I'm wrong; for some reason, the boiling points of all pairs of cis-trans isomers lie below the temperature required for interconversion. If this isn't the correct answer to @Anton's excellent question, could you explain it, Ben?
Comment: "Geometric isomerism occurs when two structures with the same connectivity are not interconvertible" Does this mean that a pair of enantiomers are also geometrical isomers?


Cannot get USB passthrough working with QEMU MacOS (Arch Linux host)

Question: I'm using this repo to run MacOS High Sierra on my Arch Linux.  All is fine, however cannot seem to get USB passthrough working for my Lego NXT (current Lego Mindstorms software doesn't support NXT 2.0) or any other USB passthrough for that matter.
Here's my basic.sh modified from above repo
#!/bin/bash

OSK="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VMDIR=$PWD
OVMF=$VMDIR/firmware
#export QEMU_AUDIO_DRV=pa
#QEMU_AUDIO_DRV=pa

qemu-system-x86_64 \
    -enable-kvm \
    -m 2G \
    -machine q35,accel=kvm \
    -smp 4,cores=2 \
    -cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc \
    -device isa-applesmc,osk="$OSK" \
    -smbios type=2 \
    -drive if=pflash,format=raw,readonly,file="$OVMF/OVMF_CODE.fd" \
    -drive if=pflash,format=raw,file="$OVMF/OVMF_VARS-1024x768.fd" \
    -vga qxl \
    -device ich9-intel-hda -device hda-output \
    -usb -device usb-kbd -device usb-mouse \
    -netdev user,id=net0 \
    -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
    -device ich9-ahci,id=sata \
    -drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
    -device ide-hd,bus=sata.2,drive=ESP \
    -drive id=InstallMedia,format=raw,if=none,file=BaseSystem.img \
    -device ide-hd,bus=sata.3,drive=InstallMedia \
    -drive id=SystemDisk,if=none,file=osx-hs.qcow2 \
    -device ide-hd,bus=sata.4,drive=SystemDisk \
    -device qemu-xhci,id=xhci -device usb-host,bus=xhci.0,hostbus=1,hostaddr=11 \

I've tried following the Arch wiki page, by explicitly passing through the device itself, but also passing the bus/address of the USB port as above.  None seem to have any impact on the listed USB ports in the MacOS VM.
I've also tried vfio-pci to passthrough a USB controller, however my host system is a Macbook Air 2015, so USB ports are all on the same bus.  So when I try modprobe to switch the driver to vfio, Arch logs out of i3 to a terminal and the keyboard stops working (presumably the kb is on the same USB bus).  I'm running Arch Linux from USB, don't know if that matters...  I figured it should be fairly simple to do a USB device or port passthrough...
Any ideas?  Would I have better success with a Windows 10 KVM?
Answer: I just got this to work although the MacOS wasn't the issue. The user I was running qemu with didn't have access to the usb device I was trying to pass trough, e.g.
$ ll /dev/bus/usb/003/014
$ crw-rw-r-- 1 root root 189, 269 Sep 29 21:55 /dev/bus/usb/003/014

Once I did a
sudo chown $(whoami) /dev/bus/usb/003/014

The passthrough worked without problems.


How do you recommend using the ADL (Active D-Lighting) feature in Nikon cameras?

Question: Some folks recommend the use of the active d-lighting feature of Nikon cameras. However, if I am reading correctly, Aperture won't pay attention to this in a NEF file. Would the experts in the room recommend turning it off and just pay close attention to exposure to get good highlights, or letting the camera deliver JPG, or using Nikon's transfer program to punch up the highlights based on the ADL information in the NEF file?
Answer: Active D-Lighting doesn't do anything that you can't already do in Aperture (or Lightroom or similar). All it does is to reduce contrast in the highlights (depending on the strength of the highlights) so all (or at least more) of the detail can be fit into the 8-bit JPEG. Your RAW processor will let you control highlights to the same degree (and may, in some cases, read the "ADL Strength" tag in the NEF and adjust the default image adjustments).
What the ADL will do for you when you're shooting RAW is adjust the histogram and highlight warnings on the camera, which are based on the JPEG that results from your conversion settings (Optimize Image/Picture Control/ADL/White balance). That will give you a better idea of what levels are being recorded in the NEF (and, of course, what the resulting image will look like if you make the same adjustments the camera makes). Without ADL, the highlight warnings will turn on at lower levels, which may lead you to reduce exposure, potentially damaging the shadow detail in a high dynamic range scene. (Conversely, it can lead to slight overexposure decisions in flatter scenes, such as portraits, unnecessarily adding to post-processing time and effort.)
So while ADL may have little actual affect on what APerture presents to you, it's still a good guide for shooting RAW in landscapes, architecture and similar scenes.
Comment: @Itai - did I say anything different? Or are you just good at reading things into other people's statements?
Comment: Keep in mind that I'm using the raw processor that shows up in Aperture by default -- which is claimed not to read the ADL strength tag -- thus the notion that having ADL on will require some Aperture tweaking of the images.
Comment: @bmargulies - I read that (the aside was in reference to Nikon's View NX and Capture NX and potentially others), but the in-camera histogram info is still relevant if you're shooting high-contrast images.
Comment: This is not entirely correct. ADL ends up affecting RAW because it changes metering behavior, unless of course one shoots in manual exposure mode. See my answer to the suggested duplicate.
Comment: First sentence, second paragraph: you say it adjusts histogram but nothing about exposure. True, you did not say outright that nothing else changes but I find this answer misleading.
Comment: @Itai - I read carefully this answer and the suggested duplicate answers, and I can not see where this answer might be misleading.


Is 1.5 hours of a layover time in Dubai practical?

Question: I plan to fly from Bangalore (India) to Dubai and then to San Francisco, all on the Emirates Airline. I have an option of a 1.5 hour layover in Dubai.
I'm wondering if this is sufficient time to make my connection. Are transiting passengers required to clear customs/security in Dubai ? Any information on potential causes of delay is appreciated.
Comment: If it's all Emirates, you don't need to worry - if you miss your connection because your incoming flight is late, it's their fault, and they'll re-seat you on another flight.  For the transit question - we have a LOT of transit questions in Dubai on here, have you had a look? What citizenship are you?
Comment: If you're flying through a place as gorgeous as Dubai, why not stay for a few hours to explore around :o
Comment: Maybe unrelated but Emirates has its own terminal in Dubai so their passengers get processed much faster. If your connecting flight is also Emirates, then you will be even better off.
Comment: You (and your carry-on luggage) will go through x-ray screening before being led to the transit area. Other than this, there are no further formalities.
Answer: It's fine.  The minimum connecting time for Emirates-Emirates flights is 75 minutes — sorry, can't find an authoritative source for this, but if you booked your flights through Emirates, they'll only offer legal connections anyway.
If your incoming flight is on time, you'll make it.  If it's delayed and you miss the connection, Emirates will put you on another flight.
Comment: +1 for this. The only thing I would add is that if your incoming flight is late, you will see agents at your arriving flight's gate calling out the destination. They will take you to a transit desk, where you will get either [a] rebooked on the next flight and a voucher for a meal if there is a large delay or [b] hotel accommodation, a meal voucher, a transit visa and a booking on your next flight or [c] in rare cases, they may book you on another carrier. Either way, you are guaranteed to arrive at your destination.
Answer: jpatokal answer is correct. But I'll add that you will need to go through a security screening in Dubai (not immigration) and your luggage should be checked through.
In my experience it is certainly feasible to get from gate to gate in about 45 minutes. I also noticed staff standing outside the security screening trying to flag down passengers for flights that were leaving very soon. Presumably to help them get through quickly.
Another concern here is, if the inbound flight is delayed, how long until the next flight out to your destination? If that route is only flown once a day, you may want to consider if it is worth the risk.
In your case, this route is only flown once a day.
Answer: I traveled this route twice (Hyd-Dubai-US) with emirates. Even they give 1 hr 30 lay over when you book the ticket, but they will change it to three hours layover. You should get a notification email from emirates before you travel. This happened to me twice. And yes 1.5 hours is enough is ideal conditions but not always.
Comment: You certainly can't count on that happening, plus the OP is flying from Bangalore to SF, not Hyderabad to "US".


What's the best practice for clearing all or keeping the selected filters after changing the search query?

Question: We are working on a search engine (non- Ecommerce). After changing or editing the search query, should the filters stay selected (assuming the user have the same criteria) or should it be cleared (assuming this is a new search query with different criteria)?
Comment: By all the means, it shouldn't be ambiguous for a user. So, probably, the best practice is Google search (including advanced one). If you really need search and filters, just keep the hierarchy, like the Search is the primary tool, and the filters are applied to search results. So on new search, filters are cleared. Take a look on Booking.com.
Answer: The filters should be cleared, as your new search term maybe for something entirely different from the original search query. Either way, the indication that the filters have been reset needs to be clear. Do check how your competitors are doing it to gain more insight.
Answer: In principle, I wouldn't change or modify user action without their consent.
Modifying  search filters through a reset, adding or removing filters should be left to users rather than the system inline with heuristics (User Control and freedom)
Worth noting that filter reset functionality is typically introduced when there is far too many filters to unselect individually.

It can be difficult to remember which filters have been applied.
  Having to go through each filter, and find all applied filters is time
  consuming. The more mental energy your website demands, the quicker
  your users are going to become tired or bored.

5 UX Best Practices For Powerful Retail Filters
Filter Reset allows users to be more efficient by clearing all selected filters with a single action.
Also, a change in query doesn't really mean the intent of the user has changed. What it means is that the user has reformulated their query. The user intent might still be the same, in which case you might be doing them a disservice rather than helping them by resetting the filters.
So, overall, handing control to users is the best option.
Hope that helps
Answer: It totally depends upon the context of using filters. In typical e-commerce products the filter resembles user's preference (size, type, colour, etc to name few).
You might need to ask this question to yourself: is there any value addition for users if the filters are applied? If yes then how many such use cases are covered? If not then you have your decision!


How to know what note I'm singing?

Question: I have a decently low singing voice and I was trying to sing along with some keys to see how low I could really go and when I did it I was disappointed with the results but then I did the exact same thing with a friend and when I stopped, saying I couldn't go any lower, he said I already had been. Do I hear my own voice differently or something? How can I really tell where my vocal range is?
Comment: Can you sing a major scale?  It might be easier for you to keep track of where you are, and where you've already been, if you sing a descending scale, either with "do, si, la, sol, fa, mi, re, do" or "1, 7, 6, 5, 4, 3, 2, 1," to keep track of how far down you can go.
Answer: 1) Yes, one hears the own voice at a different pitch, which is one of the reasons, why it is quite hard to recognize it from recordings. Problem is, that sound you hear is not only transported via air but also via the bone of the skull. Putting the flat hand on the side of the face, so that a "V" formed by the fingers with some fingers on each side of the ear is used by some singers during rehearsal to get a more neutral impression.
2) Using an electronic tuner or app should work if you can produce the tone somewhat constant and long enough for the measurement.
Comment: I refute 'pitch'. 'Timbre', certainly, due, as you state, to the differing means of the sound being heard. But, if we heard (or felt, through vibrations) ourselves singing in a different pitch than we actually were singing, we'd never be able to sing in tune, or harmonise.
Answer: Before singing.  Learn to confidently recognize pitch.
Example:  Some one plays notes ( one at a time ) on a piano.
   As each note is played ;
You identify if the note is higher or lower. No peeking !  (ha)
Do this until you become strong and confidant at this.

How to know what note I'm singing?


Is there such a thing as lightweight window glass?

Question: I have a cool wood screen door which my wife wants to turn into a storm door. I think its suitability is marginal. As in, it would probably work but I'd prefer a little more structure. I'll consider bolting a custom steel frame to the inside of the door but it occurred to me today that lighter weight glass might be the ticket. Does such a product exist?
Answer: Well, there's rigid plastic, which is much lighter weight than glass for similar strength, but generally more subject to scratches. There are also plastic film products that would be similar to a screen in terms of weight and installation, some of which are very clear.
Glass weight is primarily a function of thickness, so thinner glass would be lighter than thicker glass, but without knowing what thickness glass you are contemplating now, it's unclear if you could go lighter or not.
Glass for a storm door should be tempered, which means 3mm / 1/8" is as thin as you can go (thinner glass is made, but it cannot be tempered and would present a cut hazard - since the tempering process also strengthens the glass, the thinner untempered glass would also be much weaker, and thus more prone to getting broken and causing cuts.)
Comment: Glass-clear plastic is easy. Keeping it glass-clear is the problem.
Comment: I assume I would use 1/8" glass. The porch has 13 windows and none are tempered (old house) but I imagine tempering is a good idea on a door. I was hoping to learn about a glass product will the clarity of glass but with the weight of plastic. In the end, it might be more affordable to reinforce the door rather than solving the problem through special glass.


How close can I fly to a bridge?

Question: I want to take some pictures of a bridge. How close can my pilot get me?
Comment: You might be better off finding a drone operator if that's feasible. They seem to be taking over the market for aerial photography
Answer: If operating under VFR rules, which your pilot probably is if he's attempting to stop you actually hitting the bridge in question and allow you good enough visibility to take a photograph in the first place, the rules vary slightly by location.
The FAA regulations will be as follows (Note: all emphasis mine - indicating what I believe is the interpretation of your bridge)
:

An aircraft must maintain an altitude of 500 feet above the surface [and], the aircraft may not be operated closer than 500 feet to any person, vessel, vehicle, or structure.

and

An aircraft must maintain an altitude of 1,000 feet above the highest obstacle within a horizontal radius of 2,000 feet of the aircraft over any congested area of a city, town, or settlement

Also note that helicopter rules differ slightly.

Helicopters may be operated at less than the minimums prescribed in [the previous quoted sections] if the operation is conducted without hazard to persons or property on the surface.

source: 14 CFR 91.119 - Minimum safe altitudes: General.
And the UK CAA rules are similar

An aircraft must not fly closer than 500 ft to any person, vessel, vehicle, building or structure.

and

[...] it must not fly less than 1000 ft above the highest fixed object within 600m of the aircraft.

So, in summary your pilot can get you within 500ft if it is an uncongested area, 1000ft if its a congested area - closer if he's got a helicopter and can do it without causing a hazard.
Comment: CAA rules for helicopters are not relaxed. A helicopter must not fly closer than 500 ft to any person, vessel, vehicle, building or structure except for the purposes of taking off or landing.
Comment: HI Jamie.  I wasn't critiquing, just adding info.  The CAA has no such variation.  Your answer is fine.
Comment: @Simon ok, bad wording. I took out the "relaxed" - but is my quote below that not an accurate summary of the Helicopter differences for VFR flight? (Ive added my source)

How close can I fly to a bridge?


Setting up a lightweight NT Domain without a domain controller?

Question: I've been getting by with using Workgroups throughout the years.  I'm wondering if there is a free lightweight solution that doesn't involve setting up a Windows Server domain controller?
Answer: Samba 3, the open source package used to connect to Windows networks, can be used as a domain controller.  Not an Active Directory controller, but an NT 4.0 style domain controller.  Here is a how to on setting it up.
Answer: You don't have to set up a Windows Server domain controller specifically, but you will need some sort of server that is always on to manage authentication and such. Apache Directory is an open source solution which is similar. It offers LDAP support and Kerberos authentication as well as a number of tools for administration via Apache Directory Studio. It is not a replacement for a Windows DC but it offers some similar functionality. It depends on what features you need from a domain controller.
Comment: I think this is too complicate for the questioner. And he only used work-groups till now. Your answer would be really good if he asked for a replacement of a DC in large environment.
Comment: This answer is OK. Just because OP has only used workgroups doesn't mean it's not time to move past that. OP wants to set up a domain, and domains typically require domain controllers. The main stipulation seems to be that the DC not be based on Windows Server.
Answer: I agree w/ mfini, the desired functionality and why you feel AD isn't a good option will help with our suggestions.
Active Directory is lightweight and free w/ the OS; creating the same functionality w/ a different product is likely to be more and not less complicated/lightweight. Samba is a high functioning alternative, but not necessarily an easy one.  Novell has it's own directory, also not necessarily more or less lightweight than AD, also not free.
MyLogon is lightweight and may be an option depending on the functionality you need, it's not free though. I haven't used it but I have seen it mentioned a few times. http://en.wikipedia.org/wiki/Mylogon
MS Foundation Server is a cheap option for <=15 users, must be purchased w/ hardware.
Answer: What are your goals, and what is leading you away from wanting to install an actual domain? You'll learn a lot.


Python sudoku solver using backtrack algorithm

Question: My first attempt at a sudoku solver using the backtrack algorithm.
# Functions for solving Sudoku puzzles of any size

# NumPy makes it easier to work with 2D arrays
import numpy as np

def find_empty_cells(board):
    """Traverse the board and return a tuple of positions of empty cells"""
    return [(i, j) for i in range(len(board)) for j in range(len(board[i]))
            if board[i][j] == 0]

def check_rows_cols(board, cell, test_value):
    """Return True if the given number is legal
        i.e. does not appear in the current row or column
    Return False if the given number is illegal
    """
    if test_value not in board[cell[0], :] and test_value not in board[:, cell[1]]:
        return True
    return False

def check_subgrid(board, cell, test_value, subgrid_height, subgrid_width):
    """Return True if the given number is legal
        i.e. does not appear in the current subgrid
    Return False if the given number is illegal
    """
    # Find subgrid coordinates
    # Map cell coordinates to top-left corner of subgrid
    subgrid_coords = ((cell[0] // subgrid_height) * subgrid_height,
                      (cell[1] // subgrid_width) * subgrid_width)

    # Use that top-left corner to define subgrid
    subgrid = board[subgrid_coords[0]:subgrid_coords[0]+subgrid_height,
                    subgrid_coords[1]:subgrid_coords[1]+subgrid_width]

    if test_value not in subgrid:
        return True
    return False

def update_cell(board, cell, available_nums, subgrid_height, subgrid_width):
    """Try to update the current cell
    Return a two-tuple, with second element as the board
    First element is True if the cell was successfully updated
    First element is False otherwise
    """
    # Get current cell value and index
    cell_value = board[cell[0], cell[1]]
    cell_value_index = available_nums.index(cell_value)
    # available_nums is a list of numbers that could populate a cell

    # If we backtracked and the current cell has no more options, reset it and go to the previous cell
    if cell_value_index == len(available_nums) - 1:
        board[cell[0], cell[1]] = 0
        return (False, board)

    if subgrid_height == 0:  # Don't call check_subgrid if there aren't subgrids (e.g. on a 3x3 board)
        # Check all numbers from the value of the current cell (the earlier numbers have already been checked)
        for num in available_nums[cell_value_index + 1:]:
            # If the number is legal, update the cell and move on
            if check_rows_cols(board, cell, num):
                board[cell[0], cell[1]] = num
                return (True, board)
            # Otherwise, none of the numbers worked and we need to backtrack
            elif available_nums.index(num) == len(available_nums) - 1:
                board[cell[0], cell[1]] = 0
                return (False, board)
    else:  # Call check_subgrid otherwise
        for num in available_nums[cell_value_index + 1:]:
            if check_rows_cols(board, cell, num) and check_subgrid(board, cell, num, subgrid_height, subgrid_width):
                board[cell[0], cell[1]] = num
                return (True, board)
            elif available_nums.index(num) == len(available_nums) - 1:
                board[cell[0], cell[1]] = 0
                return (False, board)

def solve(board, empty_cells, available_nums, subgrid_height, subgrid_width):
    """Perform the backtrack algorithm"""
    count = 0
    while count != len(empty_cells):
        try:
            result = update_cell(board, empty_cells[count], available_nums, subgrid_height, subgrid_width)
        except IndexError:  # Subgrid dimensions might be wrong
            return [0, 0]
            # Could return None, but that gives a ValueError in main()
            # The reason is that if solve() produces an array, then main() will need to compare None with an array
            # This produces a ValueError
            # So we just never return None, instead we return a definitely incorrect array
        if result[0] is False:  # Cell was not updated, so backtrack
            count -= 1
        else:  # Cell was updated, so carry on to the next cell
            count += 1

    return result[1]

def main(BOARD, available_nums, subgrid_height=0, subgrid_width=0):
    board = np.array(BOARD)  # Make a copy of the original board
    empty_cells = find_empty_cells(board)
    board = solve(board, empty_cells, available_nums, subgrid_height, subgrid_width)
    if board == [0, 0]:
        return "Sudoku not solvable, check subgrid dimensions or numbers input onto board"
    else:
        board = [list(row) for row in board]  # Convert from NumPy array back to 2D Python list
        return board  # Solved puzzle

An example call to this solver might be:
board = [
    [0, 0, 9, 0, 6, 0, 4, 0, 1]
    ....
    .... 8 rows later
    ....
    [1, 0, 0, 2, 0, 5, 8, 0, 3]
]

solution = main(board, list(range(10)), 3, 3)

I'm mainly interested in improving the code quality and efficiency of this implementation. I've designed it to generalise to any size board, which may add some overhead, such as checking whether or not there are sub grids. I'm also aware that there are better methods, such as recursion. In fact, I have also written a recursive version, which is much faster than this, but I would still like to improve this version, as it is quite slow on some of the diabolical rated puzzles.
Answer: Just a couple notes.
check_row_cols
This function can just be:
def check_row_cols(board, cell, test_value):
    return test_value not in board[cell[0], :] and test_value not in board[:, cell[1]]

Since the expression results in a boolean value, you can return the expression itself.
check_subgrid
Same concept as above:
def check_subgrid(...):
    ...

    return test_value not in subgrid


Time Machine backup between networks

Question: I have a computer on network A that I would like to backup via Time Machine to a drive connected to a computer on network B. Can this be done? Would I need a VPN? I just need the network B computer's drive to show up as Shared to the computer on network A.
Comment: If you have a .sparsebundle available to mount as a TM backup, and if you have TCP 548 opened, and traffic forwarded to the location of your TM backup, I don't see why you couldn't mount the drive and backup to it, although it would be a heap easier to just set up a VPN and mount the drive to which you need to back up.
Comment: Although you may have to run this command first: defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Comment: I'm very sorry for my ignorance, but I have NO IDEA what you just said. At all. Not a clue.
Answer:
No, this cannot be done as far as I am aware. It may be possible to hack together some way to fool it into working, but I would be willing to bet that it would eventually (and by 'eventually' I mean 'fairly soon' not 'some day before the sun goes out') fail.
Unless you have some specific reason to have to use Time Machine, I would recommend using CrashPlan instead of Time Machine. While there is a 'for pay' option with CrashPlan, you can use it completely free to back up to another computer anywhere. It doesn't matter if it's on the same network or across the Internet. You can set a very high encryption rate and customize the amount of CPU that the program uses. You also get much more control over the frequency of backups and how long information is retained. All in all it is a much better option than Time Machine or Time Capsule, in my opinion.

(I have no connection to the company except as a paying customer who is very satisfied with their service. I backup all of my laptops across the LAN to one 'retired' MacBook which has a very large external drive attached.)

Time Machine backup between networks


Can I use Blender to create an open loop race car track level?

Question: I've just used Blender to design my 3d model of a vehicle.  Now I would like to create the race track.  It will be an open loop track where the start and finish are not connected.  Is this something for which I should be using Blender?  Or is this done in another program?  Google research has been unclear.
Comment: You certainly can use blender for that. Better question is what do you want to do with this race track? Does this need to be some specific architectural drawings with measurements CAD style? Or are you just making a setting to render you car in? If the latter, then yes by all means make it in blender.
Comment: just a racetrack for a video game.
Answer: As J.Doe yes you definitely can! There's even tutorials on that exact task,
https://www.youtube.com/watch?v=SDLLbKvEeBY
Although this specific video is on a loop track making an open one wouldn't be much different I don't think. Of course depending on what you're actually trying to do you may need to look for more specific tutorials, like if you're making it for animation inside blender or if it's intended for a game or perhaps you want terrain around your track, there's tutorials out there for a lot of tasks in blender if you need them. Best of luck! :)
Answer: Yes
The modeling and texturing tools of Blender enable you to create environments. (Including streets)


Programmatically Upload Files from Client to IIS

Question: How would I set up IIS to allow clients to programmatically upload files to a folder on the server?
Answer: You would need some app in IIS to receive the byte stream. You can use web services for this type of file transfer. Then it would be up to your service layer to save them in the desiered location. Also you would need it to set that folder to have write access and most likely be working in Full Trust mode. You could check out this app and see how he's doing it in Silverlight from an asp.net page. http://www.michielpost.nl/Silverlight/MultiFileUploader/
Answer: You would have to write code to accomplish this for you.
Tim gave an example for a .NET page.
If you are in shared hosting, your hosting provider may provide COM+ components you could call from ASP pages such as AspUpload or SaFileUp


How can I get full URL of current page with xpath on InfoPath 2010 form?

Question: I want to open different forms for different SharePoint list views so I need to get current page full URL on an InfoPath 2010 form. How can I do this through XPath or XQuery?
Answer: Probably you do not need full URL but only that part that triggers default views?
Most Infopath 2010 controls have "Insert Function..." button where you can choose various URL functions, related to your context
For example, here is an image of text box properties in context of infopath form for (in context of) a list:

Now, when you tell about Xpath or JQuery, you most probably do not understand that Infopath is codeless approach to crating forms.
Even more, in browser-enabled Sharepoint List Form type (which only make sense for your questions) Infopath forms the custom code is IMPOSSIBLE at all!!!
Take it or leave it altogether.
Update:
Infpath form is just XML-based from, i.e. just XML data used by, for ex., Sharepoint Server 2010 for rendering this form at runtime.
The same IP form is used, depending on context, in different web pages.
As such, determining a web page URL from inside of and by means of Infopath form, by quering its own XML data does not make sense to me. IP form does not control its use, it is just being used from outside. Page URL is external data for IP form, you should get this URL  outside of IP form and pass/return it to Infopath Form Web part, if you want to show it there.
You can't learn dynamic or run-time or external data by querying internal or static or XML data of infopath form. You can provide it by external means only and use it by external means only.
How to do it is another and different question
For example,
create web part detecting full page URL. I hope it is easily searchable in internet.
On design surface of web page in browser (Site Actions --> Edit Page), place this web part and  in your Infopath Form Web Part click small-black-down-arrow drop-down-list on the upper right corner --->  Connections --> Get Data (Filter Value) From --> Click the name of your placed web part  --> on the following popup dialog choose the field where to put caught data in "Consumer Field Name" drop-down list.
Comment: Yes, I need only a part of page URL, actually, I need site page name, like .../../MyPage.aspx
I want to learn page URL to decide to open a custom InfoPath 2010 form view. I guess this can be learn through XPath or XQuery, not JQuery.
And again yes, InfoPath is a codeless approach to create forms but you can type custom XPath codes on there.
Comment: Updated my answer
Comment: Once again, you cannot get it from Infopath form because the same Infopath form is used in different contexts and web pages. It cannot know how it will be used
Comment: -1 for "the custom code is IMPOSSIBLE at all!!!"
Comment: "Even more, in browser-enabled (which only make sense for your questions) Infopath forms the custom code is IMPOSSIBLE at all!!! "
Sorry, why? Browser-enabled IP-forms have some restrictions, but you can use code in it
Comment: 'browser-enabled' was a typo which I changed to 'Sharepoint list Form type'.


Ampleness of the universal subbundle

Question: Let X be a variety and $E$ an ample vector bundle on $X$. Let $G=G(r+1,E)$ be the Grassmann bundle over $X$ whose fiber over $x\in X$ is the Grassmannian of the $r+1$-dimensional subspaces of $E_x$. Let $U$ denote the universal subbundle on $G$. Under which hypothesis is the dual of $U$ ample on $G$?
Comment: I would assume never. If $U$ is ample on $G$, then its restriction to a fiber over $x\in X$ must be too, but this just takes you back to the universal subbundle of the Grasmmannian of $r+1$ dimensional subspaces in a vector space and thus can not be ample.
Comment: sorry...I had forgotten to write "the dual of"
Comment: I am interested in the dual of the universal subbundle
Answer: I think this is essentially never true, again by restricting to a fiber over $x\in X$.  The problem is that (somewhat counterintuitively) the universal quotient bundle on $Gr(k,n)$ is not ample, and for the same reason, neither is the dual of the universal sub.  (Except of course when $k=1$!)  See Examples 6.1.5 and 6.1.6 in Lazarsfeld's Positivity in Algebraic Geometry II.

Ampleness of the universal subbundle


Laplace Boundary Problem

Question: Consider a boundary given by vertices $(0,a)$, $(0,0)$ and $(1,0)$ (an 'L' shaped boundary).
The problem is to find the equation that passes between the endpoints $(0,a)$ $(1,0)$ of minimum length that encloses a specified area $A$.
A trivial case would be $A=a/2$ in which case the solution would be a line.
This is one dimensional Laplace problem with two boundaries (area and lenth) but how do I try to get a series solution for $A < a/2$?
Answer: Welcome to Math.SE! This is an interesting question which would be approached in different ways depending on the
context in which it arrives (e.g., level of a course). For example, the curves could be assumed to be smooth or
merely rectifiable. They could be assumed to be graphs, or not. The attainment of minimal length could be taken for
granted, or require a proof. All this makes it hard to pitch the answer  at the right level, and I'm most likely going
to fail at that. Indeed, I do not see how one would get a solution in the form of a series, because in general the minimizer
is not analytic. If this problem comes from a textbook, it would be helpful to have a reference so that an answer can be given within the context of that book.
If the existence and differentiability of a minimizing curve can be granted, then there is a variational argument to show
it must have the same curvature at all points where it does not meet the constraint (i.e, does not lie on the vertical
or horizontal axis). Indeed, write the curve in vector form $\gamma(t)$, parametrized by arclength,
and consider the perturbation
$$\Gamma(t)=\gamma(t)+\epsilon \eta(t) R\gamma'(t)$$
where $\epsilon$ is  a parameter, $\eta$ is a smooth function with compact support, and $R$ denotes rotation
by $\pi/2$ clockwise. Note that $(Ru)\times v =u\cdot v$ and $u\times Rv=-u\cdot v$.
The area bounded by $\Gamma$ is expressed as an integral of $\Gamma\times \Gamma'$, in which the linear term in $\epsilon $ simplifies to
$$2\epsilon \eta \gamma'\cdot \gamma' - \epsilon  (\eta \gamma\cdot \gamma')' $$
Here the first term yields $2\epsilon \int \eta$ and the second integrates to zero. Thus,
we should have  $\int \eta=0$ to preserve the area up to $O(\epsilon^2)$.
The  length of $\Gamma$ is given by the integral of
$|\Gamma'(t)| = (\Gamma'(t)\cdot \Gamma'(t))^{1/2}$  in which the linear term simplifies to
$$
\epsilon \eta (\gamma' \cdot R\gamma'') =  \epsilon \eta \kappa
$$
where $\kappa$ is the curvature of $\gamma$. The conclusion is that $\int \eta \kappa =0$ for any $\eta$ such that $\int \eta =0$.
Equivalently, $\kappa$ is constant.
Thus, the minimizing curve will be a circular arc as long as it is free to move; i.e., as long as it does not hit
the obstacle (vertical or horizontal axes). And the obstacle does get involved when $A$ is so small that no
circular arc through $(0,a)$ and $(1,0)$ can bound area $A$ and stay within the first quadrant. When the obstacle
takes effect, the minimizing curve consists of parts of the vertical and/or horizontal axes joined by a circular arc
that is tangent to them. An obstacle must always be met tangentially: otherwise the point of contact could slide along
the obstacle, decreasing length. This takes a separate perturbation argument, into which I will not go.
Answer: The formulation is as follows: Maximize
$$L[y]=\int_{x_1}^{x_2}\sqrt{1+y'\ ^2}\ dx$$
subject to
$$A=\int_{x_1}^{x_2}y\ dx$$
We can use Lagrange multipliers for a new formulation such as
$$G=\sqrt{1+y'\ ^2}+\lambda \ y$$
and the Euler equation is
$$\frac{\partial G}{\partial y}-\frac{d}{dx}\frac{\partial G}{\partial y'}=\lambda-\frac{d}{dx}\bigg(\frac{y'}{\sqrt{1+y'\ ^2}}\bigg)=0$$
where the open formulation is
$$\lambda-\frac{1}{\big(1+y'\ ^2\big)^{3/2}}=0$$
and can be solved for y such as
$$y[x]=\alpha \ x^2+\beta \ x +\gamma\qquad \alpha=\frac{1}{2}\sqrt{\frac{1}{\lambda^{2/3}}-1}$$
To satisfy the conditions to pass through points $(0,a)$ and $(1,0)$; and $A=\int_{x_1}^{x_2}y\ dx$
$$y[x]=(3a-6A)\ x^2+(6A-4a)\ x +a$$
Comment: The solution $y(x) = \alpha x^2+\beta x+\gamma$ is incorrect.

Laplace Boundary Problem