How to estimate the capacity of a neural network?

Question: Is it possible to estimate the capacity of a neural network model? If so, what are the techniques involved?
Answer: VC dimension
A rigorous measure of the capacity of a neural network is the VC dimension, which is intuitively a number or bound that quantifies the difficulty of learning from data.
The sample complexity, which is the number of training instances that the model (or learner) must be exposed to in order to be reasonably certain of the accurateness of the predictions made given some data, is proportional to this number.
The paper VC Dimension of Neural Networks (1998) by Eduardo D. Sontag provides a good introduction to the VC dimension of neural networks (even though these concepts are quite abstract and you may need to read them several times to fully grasp them). The information in this answer is highly based on that paper.
Shattering and VC dimension
In section 2, Concepts and VC Dimension, he describes the basic concepts behind the VC dimension (not only for neural networks), such as the concept of shattering (i.e. what does it mean for a set of sets to shatter another set?), which is a well-known concept in computational learning theory and is used to define the VC dimension (see definition 2), so you definitely need to get familiar with this concept to understand the VC dimension and, therefore, the capacity of a neural network (calculated with the VC dimension).
VC dimension of functions and neural networks
He then provides an equivalent definition of the VC dimension but for functions (equation 6). Given that neural networks represent functions, then we can also define the VC dimension of a neural network. A specific combination of weights of neural networks represents a specific function, for which the VC dimension can be defined. To be more precise, a parametrized function (and a neural network) can be denoted as
$$
\beta : \mathbb{W} \times \mathbb{U} \rightarrow \mathbb{R}
$$
where $\mathbb{W} = \mathbb{R}^p$ and $p$ is the number of weights (or parameters) of the neural network, $\mathbb{U}$ is the input space and $\mathbb{R}$ the output space. So, in this case, $\beta$ can also represent a neural network, with a certain parameter space $\mathbb{W}$, an input space $\mathbb{U}$ and an output space $\mathbb{R}$.
The vector $\mathbf{w} = (w_1, \dots, w_p) \in \mathbb{W}$ represents a specific combination of weights of the neural network, so it represents a specific function. The set of all functions for each choice of this weight vector can be denoted as
$$
\mathcal{F}_{\beta} = \{ \beta(\mathbf{w}, \cdot) \mid \mathbf{w} \in \mathbb{W} \}
$$
The VC dimension (VCD) of $\beta$ can then be defined as
$$
\text{VCD}(\beta) := \text{VCD}(\mathcal{F}_{\beta})
$$
Therefore, the VC dimension is a measure of the capacity of a neural network with a certain architecture. Moreover, the VC dimension is equivalently defined for a certain set of functions associated with a neural network.
How to calculate the VC dimension?
To calculate the actual VC dimension of a neural network, it takes a little bit of more creativity. Therefore, I will just report the VC dimension of some neural networks. For more details, you should fully read the cited paper (more than once) and other papers and books too (especially, the ones described in this answer, which provide an introduction to CLT concepts).
VC dimension of a perceptron
The VC dimension of a perceptron is $m + 1$, where $m$ is the number of inputs. Given that a perceptron represents a linear and affine function, the VC dimension of the perceptron is also equal to the number of parameters. However, note that, even though the VC dimension of the perceptron is linear in the number of parameters and inputs, it doesn't mean the perceptron can learn any function. In fact, perceptrons can only represent linear functions. See section 3.1 of VC Dimension of Neural Networks for more details.
VC dimension of a single hidden layer neural network
Let $n$ be the number of hidden units, then the VC dimension of a single hidden layer neural network is less than or equal to $n+1$. See section 3.2 of VC Dimension of Neural Networks for more details.
VC dimension of multi-layer neural networks with binary activations
The VC dimension of multi-layer neural networks (MLPs) with binary activations and $p$ weights (or parameters) is $\mathcal{O}(p \log p)$. See theorem 4 (and related sections) of the paper VC Dimension of Neural Networks for more details.
VC dimension of MLPs with real-valued activations
The VC dimension of MLPs with real-valued activations is no longer bounded by $\mathcal{O}(p \log p)$ and can be exponential in the number of parameters. See section 5.3 of VC Dimension of Neural Networks.
VC dimension of MLPs with linear activations
The VC dimension of MLPs with linear activations is $\mathcal{O}(p^2)$.  See theorem 5 of the paper VC Dimension of Neural Networks.
Notes
The VC dimension is often expressed as a bound (e.g. with big-O notation), which may not be strict.
In any case, the VC dimension is useful because it provides some guarantees. For example, if you use the VC dimension to describe an upper bound on the number of samples required to learn a certain task, then you have a precise mathematical formula that guarantees that you will not need more samples than those expressed by the bound in order to achieve a small generalization error, but, in practice, you may need fewer samples than those expressed by the bound (because these bounds may not be strict or the VC dimension may also not be strict).
Further reading
There is a more recent paper (published in 2017 in MLR) that proves new and tighter upper and lower bounds on the VC dimension of deep neural networks with the ReLU activation function: Nearly-tight VC-dimension bounds for piecewise linear neural networks. So, you probably should read this paper first.
The paper On Characterizing the Capacity of Neural Networks using Algebraic Topology may also be useful and interesting. See also section 6, Algebraic Techniques, of the paper I have been citing: VC Dimension of Neural Networks.
The capacity of a neural network is clearly related to the number of functions it can represent, so it is strictly related to the universal approximation theorems for neural networks. See Where can I find the proof of the universal approximation theorem?.
Comment: the value of n+1 for a single hidden layer neural network holds only if input weights and biases are constant. The model then becomes an affine function of output weights which is equal to n+1 (including bias term c0) ~ VC-dim = n+1
Answer: Most methods for measuring the complexity of neural networks are fairly crude. One common measure of complexity is VC dimension, a discussion which can be found here and here. For example, neural networks have a VC dimension that is too large to give a strong upper bound on the number of training samples needed for a model (the upper bound provided by VC analysis is much higher than what we have observed neural networks to be able to generalize from).
Another common measure of capacity is the number of parameters. We see in the paper "Understanding deep learning requires rethinking generalization", published at ICLR with over 1400+ citations, that networks with more parameters than data often have the capacity to memorize the data. The paper provides compelling evidence that traditional approaches to generalization provided by statistical learning theory (VC dimension, Rademacher complexity) are unable to fully explain the apparent capacity of neural networks. In general, neural networks seem to have a large capacity, given the apparent good performance on certain tasks.
Beyond these ideas, the universal approximation theorem tells us that the set of neural networks can approximate any continuous function arbitrarily well, which strongly suggests that any neural network has a large capacity.


How does one build a burnup chart?

Question: Can someone explain how to build a burn-up chart? Please give me a walkthrough of how to build one?
Comment: Asking about burn-up is definitely on-topic. However, step-by-step tutorials are generally out of scope everywhere on StackExchange, and may get a question closed as "Not a Real Question" because it is overly-broad.
Answer: Basically, a burnup chart is simply a graph plotting both the total story points across the project, and the amount of done story points (both on ordinates), over all iterations (on abscissa). See for example this comparison with burndown charts.
So, in order to build a burnup chart, you simply have to do the following for each iteration:

sum story points across the whole project (done + current + backlog; including the icebox is up to you but I would advise against it as it could lead to odd jumps, lived this in a project where epics with huge story points were in the icebox and later deleted, halved the story points amount);
sum story points in "done" state;
plot them on a graph.

From the same source as above:

This walkthrough gives an example based on SharePoint, but you can most likely extract all important information from it  :)
Comment: @jmort253 Yup, right, thanks, that made me write an actually useful answer  ;)
Comment: No, I think it's a useful example of a burn-up, so I'd leave it as-is unless you find a more compelling example somewhere. I just didn't want to leave the referenced link's *conclusion* unchallenged.
Comment: Hi Matt, the goal of Stack Exchange is to become a resource of knowledge for years to come. While the link may be helpful today, if it were to break, your answer would be useless. Consider making an [edit] to include the most important details of building a burn-up chart in the body of your answer, or remove this and add it as a helpful comment to the question. Good luck!
Comment: +1 for a good answer, but the referenced "comparison" is bogus. Both a burn-down and a burn-up can plot total points; that's not a valid distinction between the two.
Comment: @CodeGnome I agree the referenced comparison tries to present burnups as "improved burndowns" rather than highlighting their profound similarities and slightly different uses. Though, this was the simplest illustrated introduction I found after a short search on the web… If you really think it is misleading, I could remove the reference. Still not sure it is not useful at this point.
Answer: Burn-Down vs. Burn-Up
The difference between a burn-down chart and a burn-up chart is simply the way it represents the information. A project isn't done until work remaining is zero, so a burn-down chart is often more intuitive as it doesn't require the plotting of an intersection with project totals to represent project completion. The intersection of the X and Y axes on the right of the chart is an implicit end-of-cycle with burn-down.
Otherwise, the differences between the two chart types are minimal. Specifically:

A burn-down chart shows work that remains incomplete in a project or iteration.
A burn-up chart shows work completed during a project or iteration.

Building the Chart
In either case, you build the chart by graphing points that represent the work-effort on the project. This is often represented by story points, but can be in whatever units you track such as man-hours, ideal hours, features, or even dollars.
Note that a burn-up chart will require a legend or an explicit second line identifying the project total you are building towards, unless you continually adjust the scale of the Y-axis to make the top of the axis an implicit total. Regardless of how you represent it, with burn-up just make sure you represent the total somewhere to provide the burn-up metric with a valid scale.
Answer: To plot a Burn Up Chart – plot work completed per day in story points and compare it with estimated work completed. Say you need to complete 20 story points per sprint i.e. 10 working days. If you complete 4 story points in the first day then you will plot 4 on the graph. The next day you complete 4 more story points then you will plot 8. So on and so forth. Map this to the expected story points and you have a burn up chart.
http://screencast.com/t/AsyxrsAi0e1

How does one build a burnup chart?


Why is it common for naming 2 axis dimensions as width and height instead of length and width?

Question: Pretty much almost all frameworks I use in programming uses the height and width when identifying a flat dimension (without Z axis), but when in math, a 2 axis object is always measured by length and width. What is the history behind this naming convention?
Comment: Real world paper often lays flat, while computer displays are often mounted vertically.
Comment: @JohnIsaiahCarmona: computers were originally invented for making **comput**ations, not mathematics. Please don't intermix mathematics with bookkeeping. And I guess the frameworks you are using today are probably not from the old ages when computers were invented.
Comment: I don't know about width/height vs length/width but certainly width/height lends itself easier to understand which is which.  X/Y/Z axes have been interchanged so often between applications that it is no longer a guarantee that Y "points up" anymore.
Comment: @whatsisname I get that. But in math, when only 2 axis is involved, only length and width is used, and the computer is invented to solve mathematical problems.
Comment: voting to close, this is one of those "how long is a piece of string" questions ;)
Comment: [`TIFF_IMAGELENGTH`](http://www.awaresystems.be/imaging/tiff/tifftags/imagelength.html) survives in the TIFF standard. It was considered proper at that time because the computer output used to be printed on a big roll of printer paper of potentially unlimited length (which is still physically finite, but typically treated as infinite in software).
Comment: You can always combine them in to 'heighth'. Or maybe weight.
Answer: I guess the majority of frameworks used in programming today (and maybe every framework you tried) use the terms "height" and "width" for positioning of images or shapes on a computer display.  And as @whatisname already mentioned in a comment, computer displays are often mounted vertically, so these terms fit well.
The 99% use case for these frameworks are graphical user interfaces. Pure mathematical use cases are relatively rare today, and frameworks which are designed for mathematical 2D or 3D applications use typically X,Y (or X,Y,Z) for the axes.
Due to my personal education, I think "width" and "height" map quite unambigously to the maximum range of "X" and "Y" in a 2D system, whilst without a separate documentation, I would be unsure how to map "width, length" to "X, Y", it could be "Y,X" as well. But YMMV.
Answer: The history is that things like paper are labeled with height and width, so programmers use those labels.
Comment: I've updated my question since I've noticed I used a wrong example. Sorry I didn't research first before giving real world examples, I changed my comparison to math.
Comment: @JohnIsaiahCarmona - doesn't matter. Any time you're working with something where the human perceives one axis as "up" rather than "forward", that axis' measurement will be `height`.
Answer: Length usually refers to a shape's size along its greatest ("longest") axis, that is, in its own coordinate system.
Height usually refers to a shape's size along the vertical axis of the "world" coordinate system.
Width is ambiguous.
Answer: Perhaps because height is strictly a spatial dimension, but length could refer to something else. Length is already commonly used do describe the size of an array, and "How long should I wait" uses length to refer to time.


What's the significance of Wil Wheaton wearing a Star Trek uniform when visiting the cinema for the Star Wars movie?

Question: Was there any significance to Wil Wheaton being in the theater to watch Star Wars with Koothrapali, Leonard, and Howard, while wearing a Star Fleet uniform in The Big Bang Theory episode "The Opening Night Excitation"?
Comment: Depends if you know who Wil Wheaton actually is, I guess.
Comment: I tried to improve the title by reducing the supposed ambiguity while avoiding a reference to an uspecified episode.
Comment: @cde: Thanks, my edit probably wasn't great. I like Napoleons though, seems a touch more concise.
Answer: The plot and dialog from the episode answer this. Wil Wheaton is a troll, and enjoys messing with people (remember the bowling games?). And he's most known for playing Wesley on Star Trek TNG. The Trekkie vs Jedi (Star Trek vs Star Wars fans) feud is as famous as the Hatfields and McCoys (No, not that McCoy.)
From wikia:

At the movies, the audience starts booing since Wil Wheaton shows up in a Star Trek uniform dressed as Mr. Spock. Wil is loving the rejection. He tells the guys that since he was on Star Trek he's rooting for the home team. Someone calls out that Star Trek stinks. Wil replies, "Live long and suck it."

From the transcript:

Oh, did you hear from Wil?
  Yeah, he's on his way. Time for bladder check.
  Check.
  Check.
  Check. Wait. Screw it. I'm holding it.
  (crowd booing)
  What is everyone booing at?
  (booing continues)
Wheaton: Hey, guys. What's up?
  Um, hey, Wil.  What you doing?
Wheaton: I was on Star Trek. I'm just rooting for the home team.
  Man: Star Trek stinks!
Wheaton: Yeah? Live long and suck it!

Someone should have told him to "Shut Up, Wesley", that really pisses him off (in real life):
Comment: It might also be worth pointing out that **Star Trek** takes place in the **Milky Way** whilst the **Star Wars** take place in a galaxy **far away** (depending on your point of view) - hence the **Home Team** comment.
Comment: The Hatfields and McCoys are almost completely unknown outside of the States (I'd never heard of them before reading your answer), while the Star Trek / Star Wars rivalry is moderately known amongst those people who know that they're different franchises.
Comment: Should have been **Live long and smell it** :D
Answer: Wil Wheaton played Wesley Crusher on Star Trek: The Next Generation.
It's a simple joke that despite seeing Star Wars, he's wearing his Star Trek uniform instead.
Comment: It's simple-ish but it does rely on an understanding that there's a rivalry between the two fandoms.


Why does Ubuntu One persistently go to a `disabled` state?`

Question: My backup tar archive is 0.5 GB. The upload rate is limited so synching to the cloud I estimate to take 3 hours.  The upload rate is difficult to change since the internet service is provided by the landlord.
Initially I expected Ubuntu One to keep the computer awake the whole 3 hours.  My Settings > Power was set to 5 minutes. When I left the computer unattended and returned I saw that Ubuntu One was disabled so I re-enabled and I changed Settings > Power to Don't Suspend.
Many hours later I returned to see that Ubuntu One was again disabled so I re-enabled.  It did not indicate the synch had completed and this is unexpected.  Somehow I managed to get it to report that the synch was completed, perhaps by closing the application and re-opening it.
How do I stop this application from going to a disabled state?
Answer: This may be bug #995146.
That would mean the "disabled" status is wrong.


All-in, pre-flop with AK... twice. Was that a bad decision?

Question: I was playing against a player who was going all in almost every hand pre-flop. So after waiting until I had something that I thought could beat a random hand, I went all in with AKo. LOST to Qx. BUY IN(a bad decision in itself due to tilting). I am dealt AKs next hand, call the all-in and LOST to 99. Should I have only gone all in with a decent pocket pair?
Comment: Losing two good hands in a row to a lucky player is just a bad beat. If he continued his behavior, and you kept buying in, over the long run making calls like that are going to win your money back and the rest of his bankroll too. And if you don't do it, some other guy will. Going all in every hand is just begging someone to bankrupt you.
Comment: Is it safe to assume this is a cash game and not a tournament that allows rebuys?
Comment: cash game is correct sir
Comment: AK = Anna Kournikova. Looks nice but doesn't win anything...
Comment: Robbie, i loled.
Comment: if you were short stacked it was probably the correct decision.
Answer: If your laying down AK to a loose cannon that is raising all in all the time you are making a huge mistake. These calls you made all in were just fine. You will get the guy sooner or later. The 99 he had you were slightly behind but for the Qx you dominated.
I will sometimes get out of games like this, usually because I am not able to get the guy and getting tilted like you were, or I just do not have the bankroll to play this game. But if I have bankroll and I am feeling OK this is the game I want. This guy is going to bust out and then I am going to have a table full of tilted players with a lot of big stacks around the table.
Comment: +1 I too would be inclined to bail or use someone else as cannon fodder to take care of the villain.
Answer: It is definitely profitable to be calling with AKo and AKs against someone shoving 100% of their hands.
Using the Poker stove calculator, AKo will win 65.20% of the time against an opponent's random holding, and will still win 62.12% of the time against an opponent who shoves only with the top 20% of hands dealt.
Similarly AKs wins 67% of the time against a random holding, and still wins 63.9% of the time against the top 20% of poker hands.
If you call with any random pocket pair, you will win 68% of the time against a random holding - only a 1% edge over AKs.
So therefore you made the correct call, but since you will only win about 65% of the time, this play unavoidably has a high variance associated with it.  This is why it is imperative that a poker player has a sufficient bankroll for the stakes he is playing in order to ride out this variance.
Comment: I think I know you from another site. Nice to see you here.
Answer: Getting beat with AKo against Qx suited qualifies as a "bad beat." But if you go "all in," you are "getting your money in good." (When the odds are in your favor).
These decisions are measured ex ante, that is against the opponent's cards held before the flop. The fact that you lost against bad cards ex post has nothing to do with anything.
Over a lifetime, if you could face Qxs every time you got AKo, you'd be way ahead.


What tools are available for managing/writing to WordPress?

Question: Aside from the actual WordPress dashboard, what tools are available for writing posts, moderating comments, and otherwise administering your site?  Please identify whether you're referencing a desktop tool, a web-based tool, or a mobile tool.
Comment: Because it's the kind of question that isn't seeking a "best" answer - rather, it's seeking numerous answers, essentially making up a list of information.
Comment: Why is this community wiki?
Answer: Windows Live Writer
Windows Live Writer (WLW) is hands down the best, if you are on Windows. One of the things I love about it is its plugin architecture and how many people have written useful plugins for WLW.

(source: mikeschinkel.com)
Qumana
I searched far and wide for an equivalent on the Mac and didn't find a match but came close: Qumana:

(source: mikeschinkel.com)
Qumana still can't touch WLW because it doesn't strip garbage HTML (like from a Word .doc) like WLW does and it doesn't have a plugin architecture, but I keep hoping... :)
Comment: Being selected as "the answer" because it covers both Windows and XP and included screenshots.  Though all of the other answers are just as valid and detail tools that are just as useful.
Comment: @EAMann, Windows and **MAC**, you mean.
Comment: Qumana is nice if you need the features it gives.  I've used it in the past, but I keep going back to BlogMate/TextMate.
Comment: What's BlogMate, a plugin for TextMate?

I tried TextMate when I moved to the Mac back in April 09 but could never warm up to it. For WordPress PHP plugin development, I love me my PhpStorm+XDEBUG! For text editing I use a bunch of things like Smultron and Espresso. I have TextWrangler but like TextMate, I just never can get used to it. :)
Comment: @Arlen Beiler Yes, that's what I meant :-)  Sorry, it was a long day ...
Answer: WordPress for iOS
The official WordPress client for iOS (iPhone, iPad, iPod Touch devices), and supports many of the standard WordPress features.
Is both open source and free to download from the App Store.
Answer: MarsEdit is pretty much hands-down the best blog client / WordPress tool for Mac. It's a native OSX desktop app, it's not free but I think it's well worth the money for a multi-client blogging tool.
Comment: I agree. I tried to get by without spending the money, but once you've used it the writing is on the wall...
Answer: WordPress for Android
The official WordPress client for Android mobile devices. Can manage comments, posts and pages.
Is both open source and free to download from the Android Market.
Comment: ... and is also very buggy. I use this daily, and constantly have to wrestle with it. Please DON'T depend on this, and write your posts into a more reliable text editor before committing it into this app, or you may lose your post. It is also buggy when editing posts, and adds extra HTML tags etc.

It's still a good tool, and I use it lots, but keep these things in mind. It's not perfect.
Answer: Windows Live Writer
I've used this tool to write both to my own blog and to clients' blogs.  It's a desktop tool provided free by Microsoft that syncs with your site for creating posts, managing categories, and uploading media.  The rich text editor allows you to copy-paste from Word documents and switch between a text view and a preview of what the post will look like on your site.  You can even write scheduled posts!
One word of warning, though.  The live preview feature might not work with some of the more dynamic themes.  I've seen it break with a few custom designs and with some themes from RocketThemes.  Otherwise, it's a great tool!
Answer: I don't know of many tools, but here are two:
For mobile, there are the iPhone, Android, and Blackberry apps for managing posts, pages and comments, as well as viewing stats on your mobile device.
WP Remote
On the web, the only think I know of is http://www.wpremote.com. It's still in a private beta, but it will be a dashboard set up to help manage updating multiple WordPress installations and their plugins from one central location. It doesn't do anything with posting, comments, or otherwise, but is a nifty tool nevertheless.
Comment: I am (one of 2) developers for WP Remote, if anyone wants a Beta account, ping me and I should be able to fast track it!
Comment: @Joe I need a beta account...
Comment: http://www.wpremote.com/register/
Comment: I am definately interrested in beta testing that plugin!!! Naturally I am willing to provide feedback in detail. How can we reach you?
Answer: Also check out ScribeFire Next. It's a Firefox plugin that lets you write blog posts while viewing other web pages. http://www.scribefire.com/
Answer: BlogDesk was used from mayn users

Program description
As an offline weblog client, BlogDesk lets you comfortably write and effortlessly publish new entries to your blog.
No need to use those annoying HTML Tags in the WYSIWYG editor. Images can be directly inserted and are automatically uploaded. Even publishing simultaneously to multiple blogs is a matter of a click.
With the ImageWizard you can not only insert images to your posts - it's possible to edit them as well (crop, resize, rotate, shadow etc., see Examples). Even Thumbnails can be created - the preview will be shown in the blog and a click on the image will open it in its original size (just like here in the right column). Linking and uploading those images is automatically done by BlogDesk.
The reduced view leaves more space for the actual post and helps to focus on the content. Especially inexperienced users appreciate a clean workspace without to much distraction.
The BlogWizards helps to configure your blog. With pre-defined blog systems you can access your blog after a few seconds.
Links can be easily inserted and edited. If you link to local files (such as MP3 or PDF), BlogDesk will automatically upload them.
Dictionaries in 14 languages are available for the integrated spell checker.
Posts already published can be edited afterwards and deleted directly from the server.
Frequently Used Phrases are an enormous time-saver for often used phrases, sentences, acronyms or complex formulations.
The Tags-Generator lets you easily define and insert tags instead of retyping them over and over again. WordPress-Tags are supported, too. You can also set so called Custom Fields.
In the Notebook you can insert and rearrange text before you actually use it in your weblog entry. For your convenience you can create multiple categories where text can be saved separatley.
Answer: Since it has not been mentioned:

the XMLRPC interface (which all of these use) easily allows you to create a (local php) site which e.g. updates 1000 pages with content from another database system but is also handy when you reach windows live writer's limit on how many posts it can go back. In other words: sometimes you need your own tool to have a better mass sync-update.

(it did not say public tool in the question)
Comment: The XML-RPC API isn't so much as a tool as it is an *interface* that can be used by tools to publish to/control WordPress.  So yes, you can create your own tool using the XML-RPC system, but it's not a standalone tool by itself.
Answer: Being a code monkey, I prefer to do my blogging using the BlogMate bundle in TextMate (a Mac OSX programmer's text editor).  It's not for everyone, I know (not free, not anywhere near WYSIWYG), but for someone who spends 8-10 hours a day in TextMate it's just so easy to open a new window, and start typing.


Did Krishna have 16108 wives?

Question: Most Hindus believe that Lord Krishna had 16108 wives. Can someone explain this?
I have heard that, according to Srimad Bhagavata, the number "16108" has a different philosophical meaning. What does Srimad Bhagavata say about this?
Comment: Little related: [Is it true that thieves kidnapped some of Krishna's wives?](http://hinduism.stackexchange.com/q/8879/1049)
Answer:
As per Mahabharata, Krishna had a total of 16108 wives, of which eight
  were his principle wives and they are Rukmini, Satyabhama, Jambavati, Kalindi, Mitravrinda, Nagnajiti, Bhadra and Lakshana.
  The other 16100 were rescued from
  Narakasura, where they had been forcibly kept. These women were in
  disgrace because they had lived with the demon king and none of their
  families would accept them. So, Krishna gave these women the status of
  his wives. This marital status was not for sexual pleasure but to give
  them shelter and a respectful place in the society.
Lord Krishna's marriage with 16100 wives was synonymous to raas leela
  where he danced with 108 gopis at the same time while each gopi
  believed he was dancing only with her. Whole life Krishna manifested
  in 16108 forms to share same love and care to all his wives.

EDIT
The Vishnu Purana and the Mahabharata differ and set the number as 16100. Generally all of them are unnamed, however many commentators of the Bhagavata Purana state Rohini to be their leader, though such an explicit mention is not found in the scripture.
More explanation given here
Comment: I don't think you need to defend Krsna in any manner and be defensive. That last line in first paragraph is redundant.
Comment: Is anything said about who makes up the 2 wives difference?
Comment: @VineetMenon I know but its better to have clarification of that.
Comment: @TheDictator did Krishna marry his own cousin sisters? Is this allowed in Hinduism?
Answer: As per Shrimad Bhagavatam after killing Narakasura Krishna saw sixteen thousand maidens who were kidnapped and imprisoned by Narakasura:

tatra rājanya-kanyānāṁ ṣaṭ-sahasrādhikāyutam
bhaumāhṛtānāṁ vikramya rājabhyo dadṛśe hariḥ [SB - 10.59.33]

Once Nārada out of the curiosity "How with a single body Krishna married sixteen thousand  maidens simultaneously at separate places" went Dvaraka to witness the daily activities of Krishna himself:

narakaṁ nihataṁ śrutvā tathodvāhaṁ ca yoṣitām
kṛṣṇenaikena bahvīnāṁ tad-didṛkṣuḥ sma nāradaḥ [SB - 10.69.1]
citraṁ bataitad ekena vapuṣā yugapat pṛthak
gṛheṣu dvy-aṣṭa-sāhasraṁ striya eka udāvahat [SB - 10.69.2]

There Narada found that through His mystic power (yoga māyā) Krishna was simultaneously present in the palaces of each queen and busy in different household activities.
So as per Bhagavatam Krishna was indeed married to the 16,000 rescued maidens. Saints reconciling the Narakasura account as mentioned in the Vishnu Purana give the number as 16,100:

kanyāpure sa kanyānāṁ ṣoḍaśātulavikramaḥ
śatādhikāni dadṛśe sahasrāṇi mahāmune [VP - 5.29.31]

Now if you include the other eight queens of Krishna that He had married earlier the number becomes 16,008. So as per puranas Krishna indeed has 16,108 wives, there was no other philosophical meaning.
However, many times there are hidden esoteric meanings to myths and stories of the puranas. So I can't give a reference to a puranic soruce, but from Yoga point of view it has another meaning as below.
As per the yogis there are 16,108 important nadis (nerves) in the physical human body, out of which the three most important ones are the ida, pingala and sushanma. Now it is well known that Krishna is Yogeswara (lord among the Yogis). So as a yogi He was master of all the nadis, just like a husband is the master of his wife. So from yogic point of view Krishna had 16,108 wives means He was master of the 16,108 nadis.
Comment: **just like a husband is the master of his wife.** - Is this also said in some epic???
Answer: From the Puranic Encyclopedia's listing of Krishna:

Krsna-16000 women
Brahmā had given the boon to the 16000 daughters of Narakāsura in their previous birth that Visnu would marry them in their next birth. While even the Devas were suffering on account of Narakāsura, Sri Krsna along with Satyabhāmā mounted Garuda, went to Prāgjyotișa, the kingdom of Narakāsura, defeated him in fight and released his 16000 daughters from captivity. He returned with them to Dvārakā, assumed the guise of 16000 men and married those 16000 girls. He built a palace for each of his 16000 wives.
Krsna's 16008 wives
The eight women, i.e. Rukmini, Jämbawati, Satyabhāmā, Kālindi, Mitravindā, Satyā, Kaikeyī (Bhadrā), Lakşmaņā and the 16000 daughters of Narakāsura constituted Krsna's harem. (The 16000 daughters of Narakāsura are not mentioned by name in the Purānas).

The Harivamsa however says those 16,000 women held captive by Narakāsura are actually gandharva's and apsara's and not his daughters:

gandharvANAM cha yAH kanyA jahAra narako balI |
yAshcha devamanuShyANaM sapta chApsarasAM gaNAH ||2-63-12
The powerful narakAa took away many gandharva maiden. He also took away deva maidens, women and seven groups of divine women (apsarA).
chaturdasha sahasrANi ekaviMshachChatAni cha |
ekaveNIdharAH sarvAH satImArgamanuvratAH ||2-63-13
They were fourteen thousand and twentyone hundred [16,100] women in all. All were with single plait of hair and observing the vow of faithful wife (sati).

You can read how Krishna wedded each of his 8 principal wives here.
The Mausala Parva of Mahabharata says that, following Krishna's death, some of those 8 wives gave up their lives while others resorted to penance:

Rukmini, the princess of Gandhara, Saivya, Haimavati, and queen Jamvabati ascended the funeral pyre. Satyabhama and other dear wives of Krishna entered the woods, O king, resolved to set themselves to the practice of penances. They began to live on fruits and roots and pass their time in the contemplation of Hari.

The Svargarohanika Parva of Mahabharata mentions that the other 16,000 wives of Krishna also gave up their human form and transformed into apsara's:

The holy and illustrious Ananta (who had taken birth as Balarama) proceeded to the region below the Earth. Through the command of the Grandsire, he, aided by his Yoga power, supported the Earth. Vasudeva was a portion of that eternal god of gods called Narayana. Accordingly, he entered into Narayana. 16,000 women had been married to Vasudeva as his wives. When the time came, O Janamejaya, they, plunged into the Sarasvati. Casting off their (human) bodies there, they re-ascended to Heaven. Transformed into Apsaras, they approached the presence of Vasudeva.
Comment: Nice one thanks

Did Krishna have 16108 wives?


Ensemble Kalman Filter SLAM

Question: I know that there is an extended kalman filter approach to simultaneous localization and mapping.  I'm curious if there is a SLAM algorithm that exploits the ensemble kalman filter.  A citation would be great, if at all possible.
Answer: Well let's see. The original paper has approximately 3,000 citations in various branches of literature, including numerous applied textbooks. I'd say this question lacks research, but given the large amount of follow-up literature, I understand how you may not be able to find a SLAM-specific implementation.
I was able to find many papers using enKF/enEKF for visual applications, but relatively few for true map-based SLAM. (I think the term SLAM is over-used and over-specific, but that's an aside.) If you relax your definition of a map to be any feature tracked across multiple sensor measurements, then you should also include:

Vehicle to vehicle localization.
Visual feature tracking
Target tracking from emplaced sensor measurements
Self localization and state estimation

But, doing a search for "SLAM" in the context of directly citing the enKF article yielded only the following:  State estimation of connected vehicles using a nonlinear ensemble filter
This does not preclude enKF-SLAM since my search was restrictive.
Answer: Did you check out this website?http://enkf.nersc.no/
It seems that the authors have an extended literature on enKF and examples in Matlab and Fortran are provided.
Comment: There is no enKF SLAM algorithm in the website you linked.

Ensemble Kalman Filter SLAM


Dealing with ads blocking application functionality on iPad

Question: I've noticed some applications on my iPad have advertisements. The problem is that the advertisement covers lower part of the screen where some applications place buttons and other UI elements, and the ad blocks there elements and prevents me from properly using the application. Is there any way to solve this - like move the ad somewhere or temporarily remove it? It's OK when the ads are just annoying but when they actually prevent me from using the application it's bad.
Answer: If this problem happens in an App than your only chance is tell the developer of the app that the ad placement was a really bad user interface choice and to please fix this issue.
If you can provide screenshots and a brief description of when this happens (if it only happens under certain circumstances) they will most probably be very grateful and fix this problem ASAP.
Just as a precaution: be polite in your email and try to be as objective as possible when telling about your problem.


Deleted answers vs deleted questions

Question: What's the reason why a deleted answer, unlike a deleted question, remains visible on the site? Wouldn't  it be more appropriate to have it removed once the OP decides, for whatever reason, to delete it?
Comment: The "deleted" answer is *only* visible to users with 10K
Comment: @Mari-LouA - transparency? Why isn't that "principle" applied to deleted questions too. I don't think so.
Comment: Sometimes OP decides to "undelete" their post after an edit or change of mind even though it's very rare. Sometimes, users over 10,000 reputation points vote to "undelete" a post which is also very rare. I voted to "undelete" a deleted question yesterday for the first time.
Comment: @Mari-LouA - yes , but the deleted questions are visible to none. What's the point of keeping deleted answers visible (even with the 10k limit)? It looks more 'hiding' rather than 'deleting'.
Comment: The "point" of keeping deleted answers visible to 10K users is, I think, one of transparency. A user who has earned this privilege will better appreciate why some questions have to be protected more than others, and "check" whether an answer was self-deleted or deleted by the system. They might spot an error of judgement, and ask for clarification. Sometimes mistakes are made in good faith, sometimes the deletion of an answer is a loss for the community. A question I posted in meta: *I "really" want a deleted post back*" is a case in point.
Answer: The main practical reason for preserving (in hidden form) answers that a poster has deleted is, as Rathony points out in a comment above, to enable the poster to reopen the post later. I have occasionally done this when I've posted an answer that a commenter has pointed out has a glaring but correctable fault that requires further research to amend; while I'm doing the additional research, I don't want my flawed answer to draw downvotes from voters who recognize the validity of the commenter's point and wonder why I'm leaving up a bad answer.
As for truly obliterating an answer that seems unfixable and may even be embarrassing, I gather that doing so isn't possible on Stack Exchange sites—certainly not in the straightforward way that obliterating one's own comments is. But you can remove a deleted post from the immediate view of 10,000-rep site participants by following a simple process: Reopen the deleted post, click the edit button, delete the content of the post (or replace it with a message such as "Original content removed."), save, and redelete. At this point, your pinked-out deleted post should show none of the original content of the post you deleted. I can't recall ever having done this myself, but I've seen posts from other users who seem to have adopted this method.
Comment: I did this when I had been on the site for only a few weeks -- I wrote an answer so ignorant it was embarrassing.   But it was still there, sneering at me in pale mauve.  So I undeleted, zeroed out the content, and re-deleted.  I was then told I shouldn't do that.  After a little back and forth, the moderator (I have forgotten who it was) took pity on me and removed it from my sight.
Comment: @ab2: I didn't realize that this expedient was frowned upon by moderators. Anyway you have my complete sympathy regarding your natural desire to erase the infamy, and I hope that other moderators will be as understanding as the one you mention in responding to anguished requests from embarrassed authors to put their seriously ill-considered posts out of sight.
Comment: This is the answer I would have posted if my English had been good enough. I learn something everyday reading your post.
Comment: Not a foolproof system, the answer's edit history is still visible if one's curiosity is sufficiently driven. And although deleted comments cannot be seen by users, they can by mods.
Comment: @Mari-LouA Edit histories can be permanently removed (from non-moderators' view) by a moderator if you ask for it. I don't think that's the point of this post.
Comment: My comment above is referring to the last paragraph: *But you can remove a deleted post from the immediate view of 10,000-rep site participants by following a simple process*. That process is not foolproof; unless the edit history can be permanently removed by a mod, a fact which I did not know about.
Comment: @Mari-LouA Sven used "immediate". I don't want to argue with you over what this adjective means. But anyway,  everyday I learn a new thing.
Comment: Wouldn't edit history remain alive after removing content and closing again the post?
Comment: @GiorgiTsiklauri: Yes—this is the point that Mari-Lou A made in her comments above. My suggestion accomplishes a limited objective: preventing the deleted answer from being immediately visible to anyone who has enough reputation at this to see deleted answers. Any such site participant who is curious enough to check the edit history of the answer, will certainly be able to find the original answer.
Answer: The reason you think deleted answers remain visible but deleted questions do not is because deleted question are more difficult to find. You can still read deleted questions because you have over 10K reps. People with less than 10K reps cannot see deleted posts at all.
Look: https://english.stackexchange.com/questions/30314/difference-between-histrionics-and-hysterics
It's just that because deleted answers appear in not-deleted questions, you see them more frequently.
Comment: It's not limbo. They are deleted, in so far as anything gets deleted by online companies. They are only accessible to 10K+ users because we have the ability to undelete. If you couldn't see the deleted things, you wouldn't be able to cast undelete votes. Admittedly this breaks down for questions, as there is no way for non-mods to search for deleted questions. On the other hand, answers get deleted far more frequently than questions.
Comment: Interesting, I wouldn't know how to look for deleted questions as the one you have posted. I guess it is not the same for comments, is it? Is it the policy of the site to keep deleted questions and answer in this sort of "limbo"? –
Comment: It was a mistake by me. I only meant to delete the comments. sorry for the inconvenience.
Comment: I am particularly concerned that a certain member, who shall remain unnamed, is keen to delete any question, new or old that does not comply with the standards of EL&U today. This is not so much a problem for questions that have been posted in the last year or so, but questions which are four years or older are at risk. Questions that are LQ, but have received good quality answers by  Mr. Shiny and New 安宇 and JSBձոգչ, for example.
Comment: What is even more worrying, the old question is *closed* for being GR, there is no risk of attracting new low quality answers. I do not comprehend this user's logic... well, I think I know this person well enough  to know their motivation. I am tempted to go to SE meta and raise this topic, I don't want old questions to be wiped out because of this member and, obviously, there must be at least two other members who are on the same wavelength. I say this because the GR Q which was posted in 2010 has two votes in favour of deletion. Only a 3rd vote is missing before that Q is wiped out.
Answer: All questions and answers were taken from Stack Exchange Meta
Why are answers visible to 10K users?

How does deleting work? What can cause a post to be deleted, and what does that actually mean? What are the criteria for deletion? [edited May 8 2016]

What does deletion mean for a post?

Deleted posts are usually not physically deleted (that is, removed from the system); they're just hidden (AKA soft-deleted). This means they won't appear in search results or data dumps, and normal users following links to them will see a 404 (not found) page explaining the cause of deletion.
Moderators, and normal users with >=10k reputation, see all deleted posts that they have links to. Moderators are able to undelete any deleted post.
"10k users" may vote to undelete deleted questions: it usually takes three votes to undelete a question, but sometimes more.
"20k users" may also vote to undelete deleted answers: it takes three votes to undelete an answer.

Why should 10k rep users view self-deleted answers?  [last edited 2009]

In the comment section:

the deletion is to remove clutter, in many cases the action is in good faith and is sensible. Admins (and 10K plus users are effectively a sort of admin by design) can see everything that happens so that, if bad faith, poorly done deletions occur they can be dealt with. What if someone writes abusive stuff then deletes it? how about threats then deletes it. The people doing the checks on this need to be able to see this. –
@ShuggyCoUk Jun 29 '09 at 10:44

What checks are in place to prevent high rep users and mods from abusing their privileges? [last edited 2014]

The biggest obstacle to abuse is... Everyone. Yourself included. As Tim notes, there's a papertrail for everything - and most of that record is public. Posts, edits, close/reopen, review actions... Even deletion is visible once you have 10K+ on the site. Don't trust a high rep user? Open up his activity feed and keep an eye on him. We can't make everything public, but the more information that's available the better chance there is that someone will catch it. […]
@Shog9♦

Why are deleted answers never purged from the system?

Deleted questions are sometimes undeleted. Not possible if deletion was permanent.
Sometimes moderators needs to make a judgement call about a user. The more information they have, the better. Having access to the user's deleted questions and answers can help the moderators make an informed decision.
Since deleted posts rarely get viewed, they have little-to-no effect on the performance of the site. […]
@agf

What to do if you need to "hard delete" an answer or a question

How to permanently delete questions that contain sensitive information [duplicate]

Email firstname.lastname@example.com; they (the devs) are the only people who can truly erase information from all users.
  @waiwai933

What should I do if a user posts sensitive information as part of a question or answer?

First, edit out the sensitive information.  […]
Second, flag for moderator attention with "other" flag, explaining why the sensitive information should be removed
  […] Moderators can redact individual revisions to remove all traces of such information from both the post and its history; flagging will alert them to the nature of the problem.

Deleted answers vs deleted questions


CodeTipper - Easily reward quality content with BitCoin, DogeCoin and LiteCoin tips!

Question:

CodeTipper
https://codetipper.com

About
CodeTipper provides an easy way for you to express your appreciation for the quality advice, and expert assistance that Stack Exchange users provide everyday by allowing you to send BitCoin, DogeCoin and LiteCoin tips to users.
CodeTipper also allows for you to send and receive tips via GitHub, through commits, comments, pull requests and issues.
Using CodeTipper to send tips

Connect your Stack Exchange account to CodeTipper at https://codetipper.com
Transfer some DogeCoin, BitCoin or LiteCoin to your unique wallet address provided.
Start tipping! To tip an answer, simply add a comment with the following instruction somewhere in it +codetip [amount] [currency]
(For example: to send a 10 DOGE tip to the owner of the answer, you might write the following comment:
"That worked perfectly! Thank you - was stuck on that for days. +codetip 10 DOGE")
CodeTipper will automatically detect the tip, and update your comment with the results of the tip, as well as a notification to the recipient.

Using CodeTipper to claim tips
Other users can send you tips without you first requiring a CodeTipper account. When a tip is sent to you, we'll try and use StackExchange notifications to alert you to the tip (if you've already got an account, you can set an option to receive a notification by email instead).
Collecting the tip is then as simple as logging into CodeTipper with the StackExchange account that the tip was sent to, and then you are free to transfer the funds to your own wallet, or use them to tip other users!
Screenshots
A comment containing a tip

The tip after it has been processed by CodeTipper

The tip as it appears in the CodeTipper interface.

License
CodeTipper is free to use, and there are no ads. If you like the service, you can opt to set an automatic donation percentage to be taken out of any tips you receive that will help support the service, or you can manually donate using the provided features.
Download
To get started with CodeTipper, go to https://codetipper.com.
Platform
CodeTipper should work on most modern desktop and mobile browsers.
Contact
Created by Nathan Oehlman. For support, contact email@example.com
Answer: For more information, CodeTipper has now been released for StackExchange sites.
Comment: This is a demonstration of how to tip. Thanks! +codetip 10 doge [**Verified** => _@NathanOehlman please log into https://codetipper.com to claim._]
Comment: If this question was a placeholder for the CodeTipper app, then delete [that post](http://stackapps.com/q/4683/7653) and edit this question with the app details.  That is, make this no longer a placeholder.


What are the pro and cons of vacuum sealed vs mylar bags for DIY dehydrated foods?

Question: For packaging dehydrated foods for backpacking, the two options that I can think of are mylar bags and vacuum-sealed bags. What are the pros and cons of each method?
Comment: What are mylar bags?
Comment: @Alexander https://mylarpro.com/
Comment: Okay, thank you. Your question at least misses the storage time as an important parameter. For dehydrated food storage over some weeks, simple ziplock bags are an additional option.
Answer: Mylar bags vs. Vacuum sealed.
Pro.

durability (in general, it depends; thickness is varying);
you can pour inside boiled water without additional wares;
more thermal isolation and great sun protection;
can preserve wet and/or warm food;
exists solutions for vacuuming, strong sealing, etc.;

Cons.

slightly larger weight (thickness is varying; usually the packets weight is insignificant);
more volume is consumed inside your backpack (if isn't vacuumed);
non transparent, need signs, etc.;
some air still closed inside (for some products in a long run, it may make a difference);
can't be sealed by molding (most of time even a zip-lock will be ok);
price (in general);

Yes, I used both and had chosen the mylar bags. Maybe, I'm biased.


Travel by ship from India to Canada

Question: We are planning to shift to Canada. We have a pug named Leo who cannot go by plane as brachycephalic dog breeds are not permitted to travel by most airlines. We cannot leave him behind so the only option is to travel by ship from India to Canada. But we do not know of any way to travel by ship. Can anyone offer guidance on this issue?
Comment: With one of our dogs [mixed race but resembling a Shih-Tzu, i.e. also having a "flat face"] I found out that Lufthansa is relatively pet-friendy [I have made 2 intercontinental moves [neither to/from India/Canada, though] having the above dog in the cabin]. So, while I don't know about their current policy, and while I do recognize that a pug may be even more challenging, unless you already did, please check with them! The travel is anyway so long [regardless from where in India and to where in Canada] that e.g flying via Frankfurt [and resting a few days there in between] would make sense.
Comment: Note that there are reports that [it is no longer possible for passengers to embark or disembark on a cargo ship in India.](https://thecruisepeople.wordpress.com/2017/08/16/why-we-can-no-longer-offer-a-passage-to-india-cargo-ship-passengers-are-banned-by-the-indian-authorities/) If so, you would have to travel overland to...  Dhaka, maybe?  Karachi?  (As far as I know, there is currently no ferry service to Sri Lanka, and the borders with Myanmar and China can be tricky.)
Comment: A similar previous question: [Journey from India (Bombay/Mumbai) to USA on ship](https://travel.stackexchange.com/questions/41911/journey-from-india-bombay-mumbai-to-usa-on-ship) gives some useful leads.
Comment: It would help if your dog was classified as a service animal. That way it could travel with you and won't cost you a dime either.
Comment: any updates finally how did you managed to go?
Answer: Have you looked into in-cabin travel for your pet?  A few airlines do allow pets to travel in-cabin on international flights.  See this Q&A on this site (which may be a bit out of date by this point), this 2016 guide from dogjaunt.com, and this more recent run-down of airline policies (focusing on North-American-based airlines.)
In-cabin travel is generally considered less risky for brachycephalic breeds than cargo-hold travel, and airlines will allow some breeds in the cabin that aren't allowed in the hold.  For example, Air Canada bars brachycephalic breeds from the cargo hold, but has no such restriction for in-cabin travel, and Air France allows it as well (though they note that there is still a risk and encourage you to consult with your veterinarian.)
In general, this will only work if your dog is under a certain weight (pugs are small breeds, but I've known some tubby pugs who wouldn't meet some of these limits) and will fit comfortably in an under-seat carrier.  If this might be feasible, and you haven't done so already, I would call as many airlines as you can and inquire about their policies before resorting to the hassle of freighter or cruise ship travel.
Comment: Good advice above! To add, sorry for repeating myself, but  I would recommend first checking with Lufthansa. [I am not German, I don't work for them etc.]  https://www.lufthansa.com/de/en/travelling-with-animals. Site also includes dedicated info on "snub-nosed" dogs. With my smaller dog in the cabin, my bigger dog has traveled in their cargo hold. Also on two inter-continental flights. The cabin crew was professional about dog travel! On board before taxing they told me they checked the she was aboard. During the flight they frequently went to check that she was fine, and kept me up-to-date.
Answer: Unfortunately it could be very difficult and costly.
Personally I would check with airlines and cargo airlines about solution. Often there are much more possibilities (with extra prices).
Cruise ships usually do not allows pets (but for blind people, and often not in such case: a dog cannot help in case of emergency, so now cruise ships requires an accompanying person).
There is one lines/cruise ship: Queen Elizabeth of Cunard which allow dogs in kennels (you may visit it just for limited time, every day). But this ships do usually UK to US (and back).
Cargo ships are also a possibility, but it would often not be comfortable (across the pacific ocean). Or car + train to UK.
So I think it will be much easier to check possibilities with plane, and look for specialized pet transport companies.

Travel by ship from India to Canada


Real world use of C# Delegates

Question: I think that I conceptually understand C# delegates, however, I am struggling to find a real world example where they would be useful.  Can you provide some answers detailing how C# delegates were used in real applications and what problems they enabled you to get around.
Comment: Almost every single class in the .NET framework exposes some set of events, so there you go.  It is just a way to encapsulate some unit of work.  For example, say you were implementing a generic binary tree structure in C.  Well, the only way to order your tree would be to take as a parameter a function pointer which knew how to do the sorting.
Answer: GUI code uses delegates to handle events, such as button clicks, window moves. Using the delegate allows you do have a function called whenever the event occurs. An example would be linking a function that saves data to a "Save" button on the interface. When the button gets clicked it is set up to execute the function that saves data. It's useful in GUI programming because your whole program could be waiting for the user to do something and you have no way of knowing what they will do first. Using delegates allows the functionality of your program to be connected to the UI in such a way that the user can do things in any way they want.
Comment: ++ You're right, but I still hate it :-) so ages ago [I came up with this instead](http://stackoverflow.com/questions/371898/how-does-differential-execution-work).
Answer: Linq uses the Func<T> and Action<T> delegates all over the place as parameters.
These allow you to use lambda expressions as parameters and define the action to be taken as part of the parameter list.
Answer: Virtually anything using the Observer Pattern would likely implement delegates.
Read the description and you'll probably imagine some scenarios where you would use them. GUI event handling is a common example.
Comment: +1, The strategy pattern is really where delegates shine, ie, you have some class where some method does something, but you want the something to be interchangeable and without direct dependency, ergo delegates.  Note that events kinda fill the same need as delegates, the difference is that you use delegates when you need to react on some return value, whereas you just fire events and whatever will be will be.
Answer: Delegates are bloody useful in asynchronous programming.
You have a class which does stuff asynchronously and has a callback. You can have the delegate method invoked upon callback - and your class implementation will do the logic described in your delegate method.
Answer: Delegates are particularly useful as a solution for the hole in the middle pattern.  Essentially, there are a lot of cases where you want to wrap a unique set of instructions inside of a common bunch of instructions.  It's particularly difficult if the instructions before and after the unique bit need to share state.  With delegates, you can just pass a delegate into a function.  The function executes the before bit, executes the delegate, then executes the after bit.
Answer: In the "old days" of non-OOP languages like Fortran and C, it was incredibly useful to be able to have a subroutine receive an argument which was a pointer to a function.
For example, the qsort function works with a user-provided comparison function. There are numerous subroutines for solving ordinary differential equations, or for optimizing functions, and they all take function pointers as arguments.
In windowing systems, all kinds of callbacks follow the same pattern.
In Lisp, even in the early days, there was something called a "functional argument" or FUNARG, which was not only a function, but it also contained a storage context where it could remember and interact with part of the outside world.
This same need exists in OOP languages, except when you pass the address of a function you also have to pass the address of the object the function is a method of. That's two things you have to pass. So a delegate is just that, and allows that good old pattern to still be used.
Answer: Here is a simple example that shows how useful delegates can be at creating simple code that follows the DRY principle. It also allows you to keep code extremely close to where it is needed.
Action<Button, Action<Button>> prepareButton =
    (btn, nxt) => {
        btn.Height = 32;
        btn.Width= 64;
        nxt(btn);
    };

prepareButton(myBtn1, btn => btn.Text = "A");
prepareButton(myBtn2, btn => btn.Text = "B");
prepareButton(myBtn3, btn => btn.Text = "C");

Here is a real world example of the advantage that delegates provide.
protected override void PageInitialize()
{
    const string selectCodeFormat = "javascript:selectCode('{0}', '{1}');";
    const string onClick = "return toggleElement(this);";

    Func<HtmlGenericControl> getElement = null;
    Action<HtmlGenericControl> setElement = null, addChild = null;
    HtmlGenericControl level1Element = null, level2Element = null, level3Element = null, level4Element = null;
    string className = null, code = null, description = null;

    using (var records = Core.Database.ExecuteRecords("code.SocCodeTree"))
    {
        while (records.Read())
        {
            code = records.GetString("Code");
            description = records.GetString("Description");

            if (records.GetString("Level4") != "")
            {
                className = "Level4";
                setElement = e => level4Element = e;
                getElement = () => level4Element;
                addChild = e => level3Element.Controls.Add(e);
            }
            else if (records.GetString("Level3") != "")
            {
                className = "Level3";
                setElement = e => level3Element = e;
                getElement = () => level3Element;
                addChild = e => level2Element.Controls.Add(e);
            }
            else if (records.GetString("Level2") != "")
            {
                className = "Level2";
                setElement = e => level2Element = e;
                getElement = () => level2Element;
                addChild = e => level1Element.Controls.Add(e);
            }
            else
            {
                className = "Level1";
                setElement = e => level1Element = e;
                getElement = () => level1Element;
                addChild = e => Root.Controls.Add(e);
            }

            var child = new HtmlGenericControl("li");
            child.Attributes["class"] = className;
            var span = new HtmlGenericControl("span") {
                InnerText = code + " - " + description + " - "
            };
            span.Attributes["onclick"] = onClick;
            child.Controls.Add(span);
            var a = new HtmlAnchor() {
                InnerText = "Select",
                HRef = string.Format(selectCodeFormat, code, description)
            };
            child.Controls.Add(a);
            setElement(new HtmlGenericControl("ul"));
            child.Controls.Add(getElement());
            addChild(child);
        }
    }
}

Answer: My first encounter with delegates was checking for a program update (windows forms C# 3.5) by downloading a file from my website, but to avoid the update checking locking the whole program I used a delegate and a thread to do it asynchronously.
Answer: I've seen interesting implementations of the Strategy pattern that uses delegates effectively. (ie the strategy is a delegate)
The one I was looking at was for pathfinding where the algorithm to find the path was a delegate that could be (re)assigned to at runtime so that different algorithms could be used (BFS vs A* etc.)
Answer: Many of the classic GoF patterns can be implemented with delegates: For example, Command pattern, Visitor pattern, Strategy pattern, Factory pattern and Observer pattern can often be implemented with a simple delegate. Sometimes, a class is better (e.g. when a command needs a name or a strategy object needs to be serialized) but in most cases, using Action<...> or Func<...> is much more elegant than creating a dedicated one-method interface.

Real world use of C# Delegates


Seeking tips for removing wax from candle sticks, yahrzeit glasses

Question: Removing wax from candlesticks and yahrzeit glasses is difficult for me.  For example, if I put a yahrzeit glass into hot water, the wax floats to the top and then I have to try to separate the wax from the water. (Some of the wax always ends up going down the drain.). Any good solutions to this little practical problem?
Comment: I see that this is getting voted as off-topic. Before voting, please make sure to check the [Jewish Life](https://judaism.meta.stackexchange.com/q/262/9682) policy. To me, this satisfies the criteria listed there and should therefore be left open.
Comment: https://judaism.stackexchange.com/questions/6/how-do-you-get-oil-residue-off-of-a-menora
Comment: What's wrong with having the wax go down the drain? If you really don't want it to go down, why not clean out the cups over a sieve or a piece of cheesecloth or the like, so that the wax gets stuck and the water passed through just fine?
Answer: The easiest way that my wife and I have found is to slowly pour warm water onto the candlesticks or you can use a hot damp towel and rub it over the wax. It will loosen up the wax enough so that you can peel it off in pieces and discard them.
I'd imagine this method should work with yahrtzeit candles, but, I tend to discard them in the garbage after yahrtzeit is over.
Comment: What of the wax in the cup itself.  Or do you use protectors?
Comment: Good question. I assume that you're talking about the candlesticks? Yes - of course I (well, my wife, actually, but we're "one" :-o) we use aluminum / disposable inserts or sometimes glass. I will caution about the glass ones - sometimes they shatter from the candle heat. They also make liquid paraffin holders which my friend uses. They're terrific b/c there's no wax mess. You have to see if they fit your holder, though. Ezra's idea is one that my wife sometimes uses, as well.
Answer: This question is more of a Lifehacks Stack Exchange question, but I will give you some of my advice on how to deal with glass votive containers such as the ones that are used for Yahrtzeit candles.
The first step is to use your oven. Get a metal baking/roasting pan, put the glass containers—votives, whatever…—onto the sheet upside down. Place them in the oven and turn the oven up to the minimal temperature it can be set at. That's usually 200 degrees Fahrenheit based on U.S. measurements.
Now let the oven heat up with the glasses in there for about 5 to 10 minutes. Peek inside to see if the wax has melted. If it has, the wax would melt down into the pan and the glasses should be a bit cleaner.
When you feel the wax as melted out as much as possible, take the pan out of the oven and then—using paper towels or a rag you won't need anymore—take each glass container and wipe away as much of the still liquid-like wax as possible.  If all goes well, the glasses should be clean of all wax.
If somehow there are some residual pieces of wax, I would recommend just boiling the glasses on the stove in a pot with a small amount of water, wait for that wax to melt again and and wipe it away again with the paper towels and/or rags.
The reality is some wax will be melted in with the water and head down the drain. But using this method the bulk of the wax melts off into the pan where it can solidify can you can crack it off and toss it in the trash. The remaining wax from the stove top boiling will be so minimal it would be inconsequential to literally toss down the drain… Or if you are concerned about a small amount of wax going down the drain, filter that wax out of the water by pouring it through a paper towel that should catch that wax and allow you to just toss it in the trash.
Comment: Thx. I like all except the little wax down the drain. Wax may not deteriorate with time, so a little wax in the drain now and then might end up causing real plumbing problems.
Answer: Burn a tea light in the glass after using it, and once the tea light has burned out, remove the metal case from the glass and the remaining wax in the bottom of the glass should come out with it. The heat from the metal tea light case will have melted the remaining wax onto itself.
Answer: White vinegar. Jewish housewives know this. So do some Jewish girls.
It only works for splatters, though; for a larger amount, you need heat.


Can I enter Iran with an expired Iranian passport, while being in possession of a second passport?

Question: I am a Canadian citizen and I am traveling to Iran (back home) this December. My Iranian passport expired on 17/05/2015. I was wondering if I can use it. I want to renew my passport in Iran because it is much cheaper there.
Comment: If you're male and haven't done Military service, remember to get the passport stamp from the embassy permitting you to leave Iran
Answer:
Nationals of Iran are allowed to enter with an expired passport.

This is noted in Timatic, the system which airlines use to verify passenger documents prior to boarding, so you should have no trouble boarding your flight. Present your Iranian passport when you check in to your flight. (You probably will need to present both passports here due to airport transits.)
Remember that Iran does not generally recognize dual citizenship, so you should not need to show your Canadian passport to Iranian officials. You do need to bring it with you, though, because you need to show it to the airline for your return flight to Canada. Read more on traveling with two citizenships.
Comment: @Fiksdal It means they treat them as Iranian citizens and disregard the other citizenship. So such people may be required to do their military service, may not be allowed to contact the embassy of their other nationality if they're arrested, and so on.
Comment: @user102008 I haven't got the slightest idea. And I don't see any relevance to this situation.
Comment: Does "not recognize" mean that they don't allow Iranian nationals to keep a second nationality?
Comment: Just because Timatic says that doesn't mean airlines cannot have additional requirements to let them on board. Timatic also says that US green card holders do not need a passport to go to the US, but how many airlines will board them on an international flight without a passport?
Answer: I have done this 5 years ego. I have Australian citizenship and entered Iran with an expired Iranin passport. They don't care about your second passport. It doesn't matter if you have a valid Canadian passport or that I had an Australian passport. What matters is that you can enter Iran with an expired Iranian passport but you leave can't leave without getting a new one. So, as long as you renew while in Iran, you are sorted. That is eactly what I did 5 years ago.
Answer: Qatar Airways lets you fly to Iran with an expired Iranian passport.
Source: Qatar Airways Travel & Entry Requirements (accessed 2021-04-28).


Non-local structure of field theory

Question: Can someone explain what is non-local structure of field theory? I know you cannot have $\phi(x) \phi(y)$ term in Lagrangian which indicates the non-locality. However, why I cannot have the non-local terms as long as I have causality maintained? In QFT, one should not write an operator like $\phi(x)^2$ which will yield singularities like $\delta (x-x)$ if one does OPE? How should I understand the locality in field theory and OPE sense consistently?
Answer: The situation is more subtle than suggested by the other two answers as the following example shows.
In $d\ge 2$ dimensions, consider the Euclidean Gaussian field with propagator given in momentum space by
$$
\frac{1}{p^{d-2\Delta}}
$$
where $\Delta$ is in the interval $\left(\frac{d-2}{2},\frac{d}{2}\right)$.
This satisfies the unitarity bound and in fact all the Osterwalder-Schrader axioms.
Therefore, by analytic continuation to Minkowski space, this results in a QFT that satisfies all the Gårding-Wightman axioms including locality:
$$
[\phi(x),\phi(y)]=0
$$
if $x-y$ is space-like.
On the other hand, the Lagrangian for this model is nonlocal.
Comment: Just want to add that this is also called generalised free theory, or mean filled theory in some contexts. It however it's not completely accurate (in the most common sense) to say that it is local. The axiom you refer to is about causality. This theory can be described as the boundary dual of free massive scalar in rigid AdS space, and causality of this theory is due to causality of the bulk theory. However, this theory is not local in the usual sense of this word, e.g. it does not have a stress-energy tensor.
Comment: Is there really a problem with $\Delta>d/2$?
Comment: @PeterKravchuk: "usual" in usual sense of locality depends on which community one belongs to. For CFT folks, I know that having a local stress tensor is usually included in the definition of locality. For axiomatic QFT folks, locality is usually just the space-like separation commutation above. It is also the main ingredient is the definition of "local relative to" leading to the notion of Borchers class. Also, I am used to worry about contact terms, so I took $\Delta<d/2$ to make my life easier. But otherwise a larger $\Delta$ is fine.
Answer: It is impossible to maintain causality with an operator that is non-local. The reason is very simple:
If you have non-local operators, the equation of motion will include fields at a different spacetime event. There is no way of imposing that information can only be transmitted by the speed of light, because the communication from that other spacetime event to your position is manifestly instantaneous.
Comment: If you integrate out a field (eg. the photon) you get a non-local interaction (eg. the Coulomb force) but causality is maintained.
Comment: So should I say, the localness implies the condition of causality. Or are they equivalent(in the sense of local if and only if causal) in this context?
Answer: When you introduce $\phi(x) \phi(y)$ for $x \ne y$, you postulate an action at a distance, whichever the interval between said events is: time-like, null, or what. In other words, you admit some essence that isn't a field, but propagates through the spacetime directly, in a point-to-point fashion. I am not sure you can't maintain causality is such theory, but it will be not a QFT, but a hybrid theory. It would join two competing paradigms: one of a field, and another of an action at a distance. It might violate the Occam's razor principle before other problems with it would appear.

Non-local structure of field theory


How to construct a composting toilet

Question: I want to built a composting toilet. What are the main construction aspects to be considered? Does anyone have a manual to share? I am especially interested in construction schemes which include the excreta on site.
Comment: I recommend the [Humanure Handbook, 3rd edition](http://humanurehandbook.com/). It has example designs and goes over all the salient details of designing your own system in significant detail. Hope that helps!
Answer: We live in a household of 5, and have 2 composting toilets. Whatever solution you choose, the biggest hurdle we have found is the cost of heating the waste to increase the evaporation rate. As we live off grid, having heaters and fans running 24/7 does consume a fair amount of the power produced by our PV system.
The waste pile must be aerated every couple of days to avoid anaerobic decomposition, we add about two parts lucerne straw to one part faeces.
The peat produced is very good and we have been using it for years to fertilize our vegetable gardens. We take the waste from the toilets every couple of months and put it into our green waste pile for about 12 months before digging it into the garden.
Answer: Although I have not made my own composting toilet, I have been interested in the idea. I've heard that waste can be collected in a bucket (typically a 5-gallon) beneath the toilet hole. Peat moss makes a great compost material- just use it as an additive to the waste.
I have heard you can also use sawdust or woodchips to eliminate odors.
Answer: If you have a sufficient yard area, a composting dry-toilet can be easily built as a very simple facility.

create a composting pile - you will require at least 2, and better 3 composting piles in the long run.
buy 2-3 big square flower-pots, and have a toilet seat fitted on top of it. The seat can easily be removed from the flower pot for disposal to the composting pile:

I started this home and it works for now. I installed the thing outside in a secluded place for intimacy. My outside light allow using it at night too. Consider hiding your place it behind curtains.
The thing is my installation doesn't dry. For it not to stink, I pile up sand, dried leaves and saw dust on top of it. I have to use mowed grass to clean the bin after disposal.
Answer: One method of making a composting toilet is to connect the outlet of a regular flush toilet to a ~1 cubic meter flowbin (just a container with an inlet at the top and outlet at the lowest point). And then you fill it a third to half way with mulching material (woodchips work well) and a kilogram of earthworms.
What will happen is the solids will get trapped in the flowbin by the mulch and get processed by the earthworms and the liquids will drain out. The liquids should then go into a greywater system.
We've been using this method for 2 years by ~3 people/day (sometimes 10-12 people over the course of a week) and haven't had to empty the flowbin yet. When it comes time to empty, we'll stop using it for a bit so that it can be fully processed by the worms. Or at least enough that it's not a horrible job. How long that is, is still to be determined.
I would say only do this if you're somewhat familiar with using composting toilets already (a good one to start with would be a dry composting toilet). Also note that there is the potential to kill your earthworms by taking strong worm medicine internally.
The performance of the system is brilliant. There is literally no smell unless you stick your head right inside the flowbin. And it functions just like a regular toilet that everyones used to.
Sources - Personal experience and "Solviva" by Ana Edey (the design comes from this book)
Comment: Do you mean a regular flush toilet? Doesn't that either form a sediment trap (if the outlet is high) or was the solids out into the greywater (if the outlet is low)? Either way, putting toilet waste into a greywater system is risky.
Comment: Please [edit] your answer and do something about your [wall of text](http://uncyclopedia.wikia.com/wiki/Wall_of_Text)
Comment: @Móż The outlet is at the lowest point but it's not an issue. Basically your flush water is filtering through a mass of compost and just the liquids are draining out the bottom. The outlet actually needs to be at the lowest point so that your compost doesn't remain wet.
Comment: You send the liquids that have filtered through feces to a greywater system?  That is not greywater.  That is blackwater.  By definition.
Comment: @Jean-Paul Calderone Well, the point of this system is to take blackwater and turn it into greywater. And thats done by filtering it through compost. The feces that remain get composted very quickly and so the overall percentage of feces in there is probably less than a percent. Also, the feces are on top. So first the water goes through feces and then the compost.
Comment: This can be done whole house. With a grease trap above the holding tank. Rice straw added. for a filter material. Pumped out once a year. Or more. Then put in the rice fields or garden area.  If used in the garden all vegetables must be steamed or cooked before ate. The grease from the grease trap is used at the candle factory. How my home in the Philippines is hooked up.

How to construct a composting toilet


How do I change the exposure setting in manual mode on a Canon EOS 550D?

Question: I have recently bought a Canon EOS 550D. In the Manual Mode, I am unable to change the exposure level. What am I missing here? I am sure there must be a way to change it.
Comment: There is no such thing as "exposure compensation" when running full manual. Exposure compensation means that you nudge the camera's automatic exposure by a little bit. In manual mode there is no automatic exposure, so exposure compensation is a meaningless concept. You set the exposure manually, explicitly, yourself so there is nothing to compensate!
Comment: From Itai's answer I guess I am not able to change Exposure Compensation. The setting that ranges from -5 to +5. Sorry for that but I am still new to this world.
Answer: Based on experience, I am certain you are confusing exposure and exposure-compensation.
Exposure is a product of 3 parameters: ISO, shutter-speed, aperture. In Manual mode, you control all of these and doing so sets the exposure. @jrista shows very clearly how to control each of them. For how they relate, see What is the exposure triangle?.
Exposure-compensation (EC), marked on most cameras including yours by a ± sign, is an offset from the exposure the camera is computing in automatic (P, Auto) and semi automatic mode (S, A). In all these modes, the camera computes an exposure (based on the metering mode) and EC is how you tell the camera to adjust the computed value by a certain amount.
In other words:

In all modes except manual: The camera computes an exposure and you use EC to tell it to make things brighter or darker relative to its guess.
In manual mode: You set the exposure exactly using Aperture, Shutter-Speed and ISO. There is no offset the camera can apply because all the parameters have been fixed by you.
Comment: Thanks for the answer. I guess I am a victim of the common misconception. Thanks for sparing to answer. :)
Comment: Just to make it a bit more generalized - on some Nikons you can set exposure compensation in Manual mode.  If you have autoiso on in Manual mode, then it will pick the ISO for a given aperture/shutter combo and adjust it up or down based on your compensation.
Comment: +1, even I was having the same confusion like the OP had. But one thing I noticed is that I can still snap pics in 3 different exposure compensation in `M` mode, how is that ?
Comment: That is *Exposure-Bracketing*. You set an exposure and the camera takes one brighter and one darker shots. On some cameras it can take up to 9 such shots with various increments (difference of bightness from 1/3 to +5 EV).
Comment: But because of this reasoning I am not able to shoot nice smooth waterfall or silky smooth mist, because exposure comp. is always reaching +3 automatically even in ISO 100 and Aperture ranging from 9 to 18 and shutter time 1" or 2"
Comment: @JimitPatel - Engage *Manual* exposure mode, you can pick any exposure you want and remember to turn of *Safety Shift* in the custom function menu, otherwise it can override your choice. Also note that the indicator clamps outside of -3..+3 but you exposure changes will still make a difference.
Answer: To change the exposure settings in Manual (M) on any of the Canon Rebel series, you use the main dial. Its near your shutter button, but a little more towards the back of the camera. You can't miss it, its a notched roll-type dial. By default, when in manual mode, rolling that dial will change your shutter speed. Roll one way to increase, roll the other way to decrease. To change your aperture, you use the same dial, however you must also press and hold the Av (+/-) button on the back of the camera while you roll the main dial. Pressing and holding the Av button will switch to aperture adjustment mode, instead of shutter adjustment mode. If you hold the camera right, that button should be easily accessible with your thumb. It should be noted that usually, the camera adjusts shutter and aperture in "1/3rd stops". This can be changed via the camera menus to "1/2 stops" if you so prefer. However you have it configured, one "tick" of the main dial represents one of those values. So by default, three "ticks" of the main dial would adjust shutter or aperture by a full stop.

To adjust your ISO setting, you press the ISO button, which is again a little farther towards the back of the camera from the main dial. You press this button once to enter ISO adjustment mode. You can then either use the arrow controls on the back of the camera to select an ISO, or use the main dial again to "roll" through the ISO options. When you have selected the ISO you desire, press the ISO button again to actually set the selected ISO.
Finally, while not specifically a part of exposure, another common control is AF point selection. This can be achieved by pressing the the increase magnification button on the upper right back corner of the camera (looks like a blue magnifying class with a + in it). Once in AF point selection mode, you can again either use the arrow keys on the back of the camera to select an AF point, or use the main dial to roll through them. Pressing the same button again sets the selected AF point (or points, if you select them all.)
Comment: Ah! Well, I would actually edit your question to make that more clear, rather than just leave it as a comment. I understand what you are asking now...however the simple answer is in manual mode...there is no exposure "compensation"...you are in full control, so you aren't compensating for anything. You have exposure compensation only in semi-automatic modes, and you adjust it the same way as Aperture in manual mode...press and hold the Av button and roll the main dial.
Comment: wow stepping it up a notch there, +1
Comment: After reading Itai's answer I guess I am confusing the two things. I have made a comment on my question to be clearer about my question. But thanks for that amazing explanation. :)
Answer: In manual mode, you are in control of the exposure factors - shutter speed, aperture, and ISO.  To change the exposure, you'll vary these three factors in your camera - there are controls on your camera to change each of these factors independently.  There shouldn't be one particular button or feature that changes them all while in Manual mode.
Answer: It's hard to tell what you are missing if you don't tell us what you've tried.
In manual mode, you can adjust shutter speed by turning the control dial (a rotating disc with ribbed edge sticking out of the body) behind shutter button. To adjust aperture, hold Av/exposure control button and turn that same dial. To adjust ISO sensitivity, press the ISO button behind the control dial and use the control dial or arrow buttons to choose another ISO (look at upper left corner on LCD for current setting).
When you change exposure, viewfinder status bar and LCD should show how much the new exposure is different from metered exposure, or blinking +/- if the difference is larger than 2 stops. Also, exposure parameters change on LCD and in viewfinder status bar.
If turning the control dial does not change the parameters, your camera probably needs repairing.


Reason to use mingw win32 headers and libs with LLVM/Clang

Question: Is there any good reason (except "GCC is better") to use the MinGW win32api/headers/libs with LLVM/Clang. Suppose that in two to three years, Clang has matured enough (in C++0x and performance) that it's a competitor/replacement and has its advantages over MSVC like GCC does on some accounts. Why on earth would one want to avoid using the MS library and header implementations of the win32 API, which is freely available in the form of the Windows SDK?
Answer: One reason for the MingW header files to exist is certainly copyright: while they are "free as in beer", you are not allowed to redistribute them. Neither could the LLVM authors redistribute them, instead, every LLVM/Clang user would have to download them on their own. So it would be reasonable for Clang to provide a set of header files, and it would then be reasonable to use the MingW code as a starting point.
In addition, another reason for the MingW header files to exist (IIRC) is that the SDK headers use C extensions that were not supported by gcc. They may be supported now, so that reason may have gone.
Comment: As well as being full of non-standard extensions , the SDK headers also define a bunch of annoying macros, e.g. `#define min` ... and `max` which break standard-conforming programs
Answer: The only real reason I can think of is to adopt a purely "Microsoft-free" philosophy.
You can ask the writers of the mingw win32 headers, but I suspect that there might also be some copyright concerns as well.
Comment: `One thing I see is that you'd need a Windows PC to use the SDK legally` -- That's probably the strongest point.
Comment: Well, I just don't "get" why you would not use the official SDK if possible. You use a proprietary OS, so it's only logical the SDK is proprietary as well. In this sense, MinGW would only be useful as long as GCC is incompatible with the Windows SDK. As Clang is striving for full compatibility, when it achieves that goal, why try to "reverse engineer" (not quite, but you know what I mean) something that is provided for free? One thing I see is that you'd need a Windows PC to use the SDK legally, but you'd need that to test your program regardless...
Answer: This answer is for 2018, and as far as I know it applies to all versions of Windows since Vista (updates providing).
The short answer is: you can't. Or more precisely, you can, but you will be pulling teeth every step of the way, spending countless man-hours fighting to get the API to work for you rather than against you, and it's simply a question of whether that's worth it to you.
The Windows API is by design going to be nightmarish to use without MSVC, because Microsoft wants you to use their entire development solution, and they don't give you a choice to avoid Visual Studio if you use their libraries. While it may seem convenient and sensible that the OS ships with the Windows SDK for free, it won't work without the C standard library, which is provided as a download from Microsoft. When you download this library through the installer, you'll find that Microsoft's UCRT depends on headers only found in the Visual C++ package, which is a 600MB+ download and consumes over 2GB when installed. And after all that, your compiler will default to choking on Microsoft's custom dialect of C, which isn't C99 but uses line comments and has countless other traps specifically designed to trip up sane compilers.
The above also doesn't even scratch the surface of legal that your team might have to delegate to cost even more money so you can figure out what's redistributable and under what terms. MinGW's libraries solve not only the legal concerns for the standard libraries (thanks to the GPL exception clause), but also make it painless to use in actual ISO C/C++.
My experience with this problem stems from a project I'm working on to develop a codebase using a unified LLVM-based build process. Everything works well enough on Linux and macOS, but on Windows without MinGW it has taken me days to failingly sort through this, and I haven't even gotten into the hiccups that there will inevitably be during linking with LLD. It's just not worth it to use anything Microsoft unless you're using MSVC, because Microsoft says go all the way or go home, and they put their code where their mouth is with that.
Answer: One reason might be that every SDK you can download only works on certain Windows versions. You can still download older SDKs that also run on older Windows versions, yet these are missing all the newer features added by later Windows releases.
Compared to that mingw64 runs on every Windows from XP SP1 to the latest Windows 10  and it offers all the features that were added in between. Such a universal SDK is not offered by Microsoft, every SDK is limited in supported Windows hosts, supported Windows deploy targets, or supported feature sets.
Another reason is that the SDK Microsoft offers can only be installed on only works on a Windows system, yet with mingw you can cross-compile to Windows, that means the system you use to build your Windows executable does not have to be Windows, you can as well build it on a Linux system.


Is the product of two objects in a concrete category always a sub-object of the product of these objects viewed as sets?

Question: Is the product of two objects in a concrete category always a sub-object of the product of these objects in the category of sets, i.e. is their product in the concrete category a subset of their cartesian product?
Comment: The word "is" here rubs me the wrong way. I'd rather you rephrase the question as follows: for $F : C \to \text{Set}$ any functor, there's a natural morphism in $\text{Set}$ from $F(X  \times Y)$ to $F(X) \times F(Y)$ given by the universal property of $F(X) \times F(Y)$. The question is whether this morphism is a monomorphism if $F$ is faithful.
Answer: Let $P : \text{Set}^{op} \to \text{Set}$ be the powerset functor that sends a set $X$ to the set of its subsets and sends a function $f : X \to Y$ to the inverse image function $f^{-1} : PY \to PX$. Since $P$ is faithful we see that $\text{Set}^{op}$ is concrete but also that given any concrete $C$, $C^{op}$ is concrete: if $F : C \to \text{Set}$ is faithful, so is $P \circ F : C^{op} \to \text{Set}$. These $C^{op}$ tend to produce counterexamples (that answer your question negatively) when $C$ is some sort of algebraic category --in which case $C$ itself would not give counterexamples.
To give one specific example, take $C$ to be the category of Abelian groups. So we're making $C^{op}$ concrete by means of the functor $A \mapsto PA=\{$ subsets of $A \}$. The product in $C^{op}$ is the coproduct in $C$ which is the direct sum of Abelian groups. The canonical map $P(A \oplus B) \to PA \times PB$  is just $S \mapsto (S \cap A, S \cap B)$ which is not injective unless $A$ or $B$ is trivial.
Comment: Nice and easy example.
Answer: I haven't found a counterexample yet, but I'm sure that there will one where $C$ has only one object (isn't this funny?):
A category with one object is just a monoid $M$. It has binary products if and only if there are $p_1,p_2 \in M$ such that $M \to M^2$, $m \mapsto (p_1 m,p_2 m)$ is a bijection, in other words: There is an isomorphism of right-$M$-sets $M \cong M^2$; an example is $\mathrm{End}(S)$ for an infinite set $S$.
A functor $M \to \mathrm{Set}$ is just a set $X$ on which $M$ acts on the left, also called an $M$-set. This functor is faithful iff the action is faithful, i.e. $\forall m,n  \in M \forall x \in X : mx=nx \Rightarrow m=n$. The map $F(*) \to F(*) \times F(*)$ is just $X \to X \times X$, $x \mapsto (p_1 x,p_2 x)$. Is this injective, i.e. do we have $p_{0,1} x = p_{0,1} y \Rightarrow x = y$? Probably not!
I'm sure that someone can find a counterexample.


Change the site look based on user's list item property

Question: We have a list containing the ADUsername and Boolean field (Yes/No) columns. Based on the logged in user we are fetching this list item and corresponding value for yes/no field.
Now we want to change the look of the SharePoint site based on this value.
Yes=Blue suitebar and top bar.
No=Green suitebar and top bar.
Possible solutions we have envisioned:

Composed looks (we have worked on this but not sure if they can be changed on run time)
Master page (creating master page with hardcoded blue/green color, but not sure if it is possible to call master page at runtime)

I believe both above methods will fail as there will be multiple users accessing the site at same time and changing the master page/composed look at run time is not feasible.
The 3rd method we were thinking of is to use Javascript on the Master Page using client object model to detect the list item (yes/no) value and change the CSS colors/file dynamically.
Another option was to create a user control and put it on the master page.
Let me know your views on this approach or other possible solution. Thanks.
Answer: If your solution scope is FARM:  you can add user control to your master page, which will render an html of your liking based on your factors.
Javascript is good as well, but your bar will change only after the page loads. As it will be on document.ready and will take a second to fetch information from your list and set right background to the div etc.
Comment: Another option was to create a user control and put it on the master page.?