Is the winter time loss of heat from north facing windows and doors ever outweighed by the gain in circulation in summer?

Question: Is there a point (USDA Agricultural zone) at which the heat loss in the winter time through north facing windows is out weighed by the gain in the circulation of cool air during the summer time.  At what point as you move from north to south does it become worth it to have north facing windows?  (Reverse this for the southern hemisphere as you move from south to north.)
Comment: I don't think this is particularly answerable; surely it will heavily depend on the design of the house in question.
Comment: Perpendicular ventilation usually results in greater airflow.
Answer: There isn't a single point.  Circumstances vary widely, and depend on the detail of individual design. There are, however, well-established mechanisms to evaluate any single building.
The best-established of these is the Passivhaus Planning Package, or PHPP, which will do the full set of calculations for a given dwelling design.
As for using North-facing windows in the Northern hemisphere for cooling, that's a pretty bad way to do things.  Preventing solar gain in the first place is far more effective, for example by using external window shutters or roof overhangs:

picture courtesy of PassivDesign.org
Answer: Without regard to individual site qualities; those living north of the equator but south of the Tropic of Cancer receive a positive net benefit from northern glazing.  The benefit is so small to be meaningless.  For those living in the tropics window orientation is decided exclusively by site characteristics.
Of course those living south of the Tropic of Capricorn definitely want north facing windows!


How to align view to 3D cursor orientation?

Question: I am getting into some more serious hard surface modelling right now and came to think, that it would be a REALLY helpful to speed up things if there would be a specific feature, that I can't seem to find anywhere in the documentation or the interface of blender (I am using versions 2.8 and 2.9 at the moment):
Is there a script or addon (or even a built-in function which I am just not finding) to align the view to the ORIENTATION of the 3D cursor? Much like you would do with the submenu View→ Align View → Align View to Active… but WITHOUT switching into edit mode.
Given the fact that you can auto rotate the cursor when placing it to the surface it is placed on, this seems like an incredibly fast way to orient your view for off-axis manipulations for example with a tool like BoxCutter.
I know that I could go into face mode, select the face, align the view and switch out again, but that would force me to do this sequence of steps over and over again if I want so switch to different orthogonal views of the selected face (like you would do with Shift + Num7 or Shift + Num 1 etc.)
So far I have only found the "Center view to Cursor" functionality and that is not helpful at all.
Any help would be greatly appreciated!
Cheers!
Answer: There's an align tools addon in vanilla blender that has 3d cursor option. But it appears to be buggy.
I wrote an addon for that just now. So it probably has bugs. It has only one functionality for now: align view to 3d cursor.
link to addon
Important Note: It can be used in object and edit mode but it removes (unselects) previous selections. It's not hard to fix that. I probably fix it when I have time. Or feel free to fix it yourself.
let me know if you found any bug or any way to improve this addon.
Comment: Oh wow, that is exactly what I needed! Thank you so much, great work! I cannot understand, that this his not already part of the blender standard functions since the 3D curser orientation has been introduced. Anyway: thanks again! :D
Answer: In the blender preferences, under Keymap ((3D view > 3D view (global) in your case), you can find all the shortcuts.
For "Frame selected" its ctrl+, on numpad which I found inconvenient and so I changed it for something more suitable for me.
For the view you are looking for it is probably the key ; between Escape and Tab at the top left corner on keyboard. It opens a pie menu with views and then by pressing numbers next to this key you select the view you want.
Comment: Sorry, but I don't see any shortcut there that achieves the desired function.
Answer: I completely agree. It would be more consistent for the 3D Cursor to behave more fully as an object, when aligning a view. (It would also be nice if, when using ShiftS > Cursor to Selected, that command respected the Cursor Tool > Orientation > Geometry setting.)
In the mean time, you can use an Empty in its place? Create, say, an Axis-Arrows Empty, and set Snap to 'Face', and 'Align Rotation to Target'. Then you can move the Empty around the scene as you wish, maintaining its alignment to the geometry beneath it, and at any time hit ShiftNumpad 7 to align the view to the Empty's Z.
In a way, it's more convenient.. you don't have to switch in and out of the 3D Cursor manipulation tool, but.. there are more steps, still, if you want your Transform Orientation to align to the Empty :(
Comment: Thanks for the explanation, but that was what I had figured out already. As you remarked very correctly that takes a LOT of extra steps and therefore makes the process quite cumbersome, which was the reason for me to write that post in the first place ;). Nevertheless, thanks again for taking the time!
Answer: It's one year and a half late, but I just released an add-on that provides 2 methods to align the 3D view to a custom orientation :

one using the 3D cursor orientation,

one using a "custom transform orientation".

If you're interested, you can download the add-on or have some details here : Align2Custom add-on


Possible to upload to S3 when using Assets field in channel form as file input?

Question: Within a channel form, I'm using an Assets field that points to an S3 external source. I'm using the <input type="file" name="assets_field_name"> method (from http://docs.pixelandtonic.com/assets/templating/channel_form.html). When I submit the form, the entry is created, but the image is not uploaded. If I use the {field:assets_field_name} method, the image is uploaded, however I need to maintain my form's visual style, so I can't use this method.
The S3 credentials are valid, and I'm able to upload and manage photos from the backend.
Using the <input type="file" name="assets_field_name"> method, is it possible to upload directly to S3 from a channel form?
Answer: Yes, but you need to add the hidden field with the remote source's ID as the value attribute.
<input type="hidden" name="assets_field_name_source" value="1">


Can enum represent string numbers?

Question: I want a user to input "Sun" and have that represent "1".
Console.Write("Enter a Day: ");
day = Console.ReadLine();

can enum do this?
Answer: Yes.
enum Days { Sun = 1, /*...*/ }

string day = Console.ReadLine();

Days d = (Days)Enum.Parse(typeof(Days), day);

Answer: Yes - you can use Enum.Parse (and Enum.TryParse as of .NET 4) to parse a string to an enum value:
Day day = (Day) Enum.Parse(typeof(Day), "Sun");

or
Day day;
if (Enum.TryParse<Day>("Sun", out day))
{
    // Success!
}

It's still somewhat ugly, mind you - there's a certain amount of casting involved in the first call, and the second wouldn't stop you from trying to parse to any value type.
The final reason I don't really like Parse/TryParse is that they will parse string representations of the numeric values of the enums - so "1" would successfully parse, even though it's clearly not the name of an enum value. That seems a bit clunky to me.
There's a nicer (IMO!) approach if you use Unconstrained Melody, a small open source project I wrote to allow generics with enum constraints. Then you'd have:
Day day = Enums.ParseName<Day>("Sun");

or
Day day;
if (Enums.TryParseName<Day>("Sun", out day))
{
    // Success!
}

No casting, and you can't accidentally use it on a non-enum type. (There are various other goodies in the project, of course... description parsing etc.)
Comment: plus one purely for the gratuitous plug :) and of course your answer is correct
Answer: If you have an enum, lets say:
enum SkyObjects
{
   Sun = 1,
   Star = 2
}

You can then have the following:
SkyObjects day = Enum.Parse(typeof(SkyObjects ), Console.ReadLine());

This will have Sun, represented as 1 as you like.
Answer: or,... another candidate for an immutable value type struct that "appears as" and "behaves" like an enumeration, but has additional fuinctionality as required by your domain model concerns... Using the type defined below you can write
 var myDay = (InPutDay)"Sunday";

or, ...
 int x = (int)InPutDay.Sun;

or,
int x = (int)  InputDay.Parse("Sunday");
Use this type:
   public struct InPutDay
   {
       private int val;
       private bool isDef;
       private InPutDay( )  { } // private to prevent direct instantiation
       private InPutDay(int value) { id=value; isDef = true; }

       public bool HasValue { get { return isDef; } }
       public bool isNull{ get { return !isDef; } }

       public static InPutDay Null = new InPutDay();
       public static InPutDay Sun = new InPutDay(1);
       public static InPutDay Mon = new InPutDay(2);
       public static InPutDay Tue = new InPutDay(3);
       public static InPutDay Wed = new InPutDay(4);
       public static InPutDay Thu = new InPutDay(5);
       public static InPutDay Fri = new InPutDay(6);
       public static InPutDay Sat = new InPutDay(7);

       public static InPutDay Parse(string s)
       {
           switch (s.ToUpper().Substring(0,3))
           {
               case "SUN": return InPutDay.Sun;
               case "MON": return InPutDay.Mon;
               case "TUE": return InPutDay.Tue;
               case "WED": return InPutDay.Wed;
               case "THU": return InPutDay.Thu;
               case "FRI": return InPutDay.Fri;
               case "SAT": return InPutDay.Sat;
               default return InPutDay.Null;
           }
       }
       public static implicit operator int(InPutDay inDay)
       { return val; }
       public static explicit operator InPutDay (int inDay)
       {
           if (inDay > 0 && inDay < 8)
              return new InPutDay(inDay);
           // either throw exception ....
           throw new ArgumentException(
               "InPutDay integer values must be between 1 and 7.");
           // or return null instance
           return InPutDay.Null;
       }
       public static explicit operator InPutDay (string inDayName)
       {  return InPutDay.Parse(inDayName); }
  }

Can enum represent string numbers?


How do I make LaTeX push long citations to a new line?

Question: When I use the \cite command for my citations, often LaTeX will overflow the margins for my lines, and the text looks pretty bad.  How can I make LaTeX push long citations to the next line automatically?
Comment: Here's a reference to the same question in 2004, but I don't get the answer http://tug.org/pipermail/tugindia/2004-September/002975.html
Comment: The email to the Tugindia mailing list links to the TeX FAQ, but this yielded the error message, "This site can't be reached. Check if there is a typo in www.tex.ac.uk. DNS_PROBE_FINISHED_NXDOMAIN."
Answer: Without a minimal example (i.e., code that will show the problematic behaviour), one can only speculate. However, I've stumbled over this problem in the past, and it may (!) help if you add the following to your preamble:
\usepackage{breakcites}

See the breakcites page at CTAN for details. If it doesn't help, you'll have to provide a minimal example that (above all) shows your document class and your bibliography style.
Comment: You saved my day.
Comment: You've just halved the number of my overfull \hboxes. Thank you.
Comment: Awesome (6 more to go)
Comment: god in sky u in earth
Answer: The "general solution" for overfull boxes in paragraph mode runs as follows:

Rewrite your text. Seriously. In some cases, this can be the only way to achieve "perfect" typesetting.
Enable the microtype package. Surprisingly enough, this package reduces many occurrences of overfull lines.
Wrap the paragraph with \begin{sloppypar}...\end{sloppypar}. This relaxes LaTeX's rules for how much interword space is acceptable; you'll get less "grey" paragraph, but at least it will stay within its margins.
Finally, if this happens a lot, you can enable \sloppy for the entire document. With this mode in effect, well-typeset paragraphs will (almost almost always) remain just as well typeset, but "bad" paragraphs such as you're talking about will behave as if they were wrapped with sloppypar. I tend not to recommend this route as it can make you lazier about good typesetting—but depending on your document this is not necessarily a bad thing.
Comment: +1 for microtype, -1 for sloppypar and \sloppy (for me, this is only the _last_ resort).
Comment: What do you suggest besides microtype+rewriting? I suppose playing with other paragraph settings *might* get you what you want, but I doubt it would be any better than sloppypar. Note that sloppypar on an already good paragraph will not reduce its quality.
Comment: `microtpe` did the trick without more intervention!
Comment: `microtype` works for me
Comment: `sloppy`  works for me
Answer: In order to split citation you must add both these packages, otherwise the citation will not properly split.
\usepackage[breaklinks=true]{hyperref}
\usepackage{breakcites}

Comment: Although @Mico is right in his comment, this actually solved my problem. +1!
Comment: Welcome to TeX.SE. How does your answer differ materially from the one posted by @lockstep? Note that the original posting made no reference to the `hyperref` package being loaded; it may thus not be a good recommendation to suggest including `\usepackage[breaklinks=true]{hyperref}`.
Answer: Just use following command on your LaTeX file
\usepackage{cite}

if you are using LaTeX2e
Comment: You mean "Just use the `cite` package.". Also everyone should use LaTeX2e. LaTeX2 is outdated since ages and LaTeX3 isn't around yet.
Answer: If you are using hyperref, it may help to put breaklinks=true in the options, e.g.
 \usepackage[breaklinks=true]{hyperref}.
I found this suggested here: [http://www.latex-community.org/forum/viewtopic.php?f=47&t=5455]
Comment: If the driver does not support `breaklinks`, then the link area will be messed up. `breaklinks` is already enabled by default for drivers that support this feature.
Answer: I don't mean for this to be an answer, though it worked in my case and that is why I'm putting it here - in the odd chance it is helpful to someone else. I tried all these suggestions and I suppose I could have drastically reworded the paragraph but it was best as it was. It had two citations like this: \cite{citation1,citation2} and the second one (though order didn't appear to matter) always ran off into the margin in the bibliography. I finally wound up just putting \penalty-10000 inside the JabRef bib source file where I wanted the break - disappointing way of solving it for sure! Feel free to remove this if people do not think it is helpful.


A thread to request questions be made community wiki

Question: I'm putting this up for people to request that questions be made community wiki.
Comment: Not to say this is a bad idea, but sometimes people say that a question should be wikified when it really should be closed. But converting to CW doesn't make an inappropriate question okay. The true use cases for wikification are very rare these days - on Physics (just because that's the site I'm most active on) I don't think we've made anything CW in weeks. I just want to make sure people don't get carried away and start using this thread for the wrong purposes.
Answer: To add to and underscore @DavidZaslavsky's point, there's been an increasing number of suggestions to wikify posts. Before suggesting that something should be made Community Wiki (CW), please read this blog post by Grace Note.
The rough guideline given by Grace Note is that no more than one in one hundred questions should be CW. As of February 6, 2012, we have roughly 300 questions, so no more than 3 questions should be CW.
It also seems like if a post is valuable, it probably doesn't need to be CW. In the rare case where people ask for lists of references, such as @Dan's first suggestion for a CW question, CW might be acceptable as long as some sort of commentary accompanies each reference.
Answer: I think these should probably be made community wiki:
Which journals should I read to keep up on advances in solving PDEs numerically?
What core skills should every computational scientist have?
Comment: Update: I closed the second question on your list.
Comment: I've made both of those questions community wiki.
Comment: I think it probably needed to be closed.
Comment: @Geoff Oxberry: After reading the post you linked, I'm starting to thinkg you should probably close mine (the first one) as well.
Comment: Probably. I'll close it and see what people say.


What message should we use with under construction page?

Question: I have problem showing the message to the user on my under construction page. I want to know which is the best practice to write the message for those under construction web page.
Comment: Simple answer: do not put anything on there as long as your website is not ready. Showing an "under construction page" will not make users come back later.
Comment: It's not completely clear if you're talking about one page among many being under construction or a placeholder page you have live before the entire site is available. Regardless, you might like to look at [this similar question](http://ux.stackexchange.com/q/22963/11687).
Comment: it should be all like 'omg page not found man come back later or whatever'
Answer: When the web was in its dawn in the early 1990's there where a lot of different animated gifs letting the user know the page visited was "under construction". There are numerous examples on any image search, such as this one:

Since then, the web have evolved and changed a lot. The under construction sign isn't used and hasn't been used since the late 1990's, for two main reasons:

All web pages are in a sense under construction. Static, non-changing content is a thing of the past. Today almost all web sites edit their content unless it's in some kind of archive (News Archive, Software release version archive,...). Take a look at any page on Wikipedia and use the edit tab to see how often pages are edited. That's also the reason for web crawlers to visit web pages again and again and again.
When there is a publishing tool available, web editors make their web page before they publish it. These option is available in Content Management Systems (CMS), where you can finish your work, having a review process (if needed) before release to the public.

That's why under construction signs shouldn't be used. Wait until you have version 1.0 before you publish the page.
Comment: +1 for the historical sloppiness memories. In addition to @Benny's sense of _permanent construction_ (which is good), many pages in the nineties were _under construction_ forever, i.e., never progressed from containing only the little man with the shovel.
Answer: Depends upon the context of site, like whether it is a personal blog or a start-up portal.
A Coming soon message , with at least some graphics , at least the logo. This will add more credibility.
Also, if your site/product has a fixed launch date, you can go ahead and add a nice count down timer .
Additionally, If there's a broadcast account for your upcoming company/website/product, let people share the news, find you on Facebook etc and receive tweets/blog-feeds about how things are coming up.
This might go one step further: Accepting email addresses with something like "Let us inform you when we roll out" . But it will be useful only if there is some kind of fan following for your company's products, for example a new movie, or game, or a sub-network website.
All the best for your endeavor.
Answer: I agree with Bart from the comments, albeit it depends of course.
Let's put this into context: The user has a problem. A need, a goal to fulfill, anything. Let's say she wants to cook dinner, and looks for recipes.
Somehow she reaches your site, and let's say your site is about recipes. A site about recipes under construction.
The only problem: she doesn't need recipes in general, she needs the recipe for this evening!
The situation is different per se, if you want to advertise a cool new startup idea on FaceBook, and you want to gain attention. Then it's usually an e-mail or fb-login collecting thing.
Most of the sites under construction never see the day of light at the end unfortunately. This creates a bad feeling with users who visit the site regularly to check if it has already started.
Therefore I usually tell people to keep silent about your project until it's in gears, provide ways of notification (a simple facebook page or a mailing list will do), and offer a showcase on what is done by now.
Answer: I believe this article about designing "coming soon" pages of Smashing Magazine will be quite helpful
Comment: Could you summarise the content of the link, to help us avoid link rot?
Answer: I disagree with @Benny Skogberg conclusion: in construction pages can be sometimes used in order to notify the user that there is a missing page or feature but that it will come in a while.
By example, it allows you to keep a consistent navigation menu, as all the links will already be present, and the user won't have new menus coming from nowhere without any warning.
That said, you should always warn the user that the page is under construction before they click - like a shaded link with a little tooltip instead of a plain one.
About the under construction message itself, I think it should tease the user, explaining which features the page will grant, what they will be able to do here, maybe the release date if you know it, and why not a screenshot of your design if you have any. A simple "be back soon, we're working on it" is basically useless, as there is no useful piece of information delivered to the user.
Answer:
Provide a brief what that page will contain when it is done.
Providing a timer (Something like This page will be available in 2 Days 6 Hours 22 Minutes) showing approximately how much time it will require to finish.
Ask the user to provide his name/e-mail, to notify him as soon as the page is available (In case he is very interested in the content that will be available on this page)
Answer: Web activity tends to convey a sense of immediateness, like for example looking for a word in a dictionary or purchasing tickets for a show to be performed later today.
Users rush through the pages swiftly, thanks to the ever growing Internet connections bandwith, the faster hardware, and last but not least, our work as usability enhancers.
Users get to the Internet with a purpose, a goal, usually in a rush (as of these modern times).
In such a context, lulling the users in order to take them to a dead end page just to tell them that sometime in the future a feature will be available, seems to me as a lack of respect to their time.
Also, I think it might generate a negative reaction, like, this site has a fake page while the other one (where I was able to fulfill my goal) is real; in the future I won't waste my time and go straight into the latter.
So, if I really had to communicate that I don't have a feature available (which I plan to implement really soon) I'd avoid taking the users to  dead end.
To achieve this I'd set the link in the navigation artifacts, in its place (in order to make clear its importance), but some how dimmed (like, in lighter gray letters) and on click wouldn't take the users out of the current page but instead I'd pop an overlay promising the feature, including the reasons why it's going to be much better than those competitive sites.
I'd use a pyramidal organization of the info, allowing the most harried users to leave (albeit already informed) is about three seconds, and satisfying the will to know of the very interested in a smaller font.


What is the most time-consuming part of training deep networks?

Question: Deep networks notoriously take a long time to train.
What is the most time-consuming aspect of training them? Is it the matrix multiplications? Is it the forward pass? Is it some component of the backward pass?
Comment: See also https://ai.stackexchange.com/q/7865/2444, https://ai.stackexchange.com/q/5728/2444 and https://ai.stackexchange.com/q/13612/2444.
Answer: Check out Figure 6 in this paper: PyTorch Distributed: Experiences on Accelerating Data Parallel Training
It breaks down the latency of the forward pass, the backward pass, the communication step, and the optimization step for running both ResNet50 and BERT on a NVIDIA Tesla V100 GPUs.
From measuring the pixels in the figure, I estimated the times for the forward, backward, and optimization steps as a percentage of their total time combined. (I ignored the communication step shown in the figure because that was only to show how long an unoptimized communication step would take when doing data-parallel training). Here are the estimates I got:

Forward: 23%
Backward: 74%
Optimization: 3%

So the backward pass takes about 3x as long as the forward pass, and the optimization step is relatively fast.
Answer: Forward pass
The output of a layer can be calculated given the output of the previous layer. So the GPU can parallelize this computation for every layer and over the minibatch which is done by calculating a big matrix. But it needs to be sequential from layer to layer (earlier layers to higher layers). Regarding the layer type convolutions or especially fully connected layers can result in a big matrix calculation.
Backward pass
The gradient of a layer with respect to the layer input (and layer parameters) can only be calculated given the gradient of the layer output (input gradient of a subsequent layer) and input to the layer (output of the previous layer). This again can be parallelized over a layer and minibatch but is sequential from higher layers to earlier layers. Moreover, since the backward pass relies on the outputs of the forward pass all intermediate layer outputs of the forward pass have to be cached for the backward pass which results in a high (GPU) memory usage.
Forward and backward pass take most of the time
So, these two steps take a long time for 1 training iteration, and (depending on your network) high GPU memory usage. But you should read and understand the backpropagation algorithm that basically explains everything.
Moreover, to train a network from scratch, in general, takes lots of iterations because especially in the earlier layers training the parameters is based on gradients that are affected by lots of previous layers, which can result in noisy updates, etc., that do not always push the network parameters in the right direction directly. In contrast, e.g. fine-tuning a pre-trained network on some new task can for example already be done with much less training iterations.
Answer: There is no such single hard and slow step in training neural networks ,  forward pass involves large number of matrix multiplications so does backward pass , even though there are highly optimized libraries for matrix multiplications neural networks act on very high dimensional (tensor) multiplications in both forward and backward passes which makes it difficult train . however backward pass would be even more slower or even intractable if we won't use backpropagation in case of large neural networks, since computing derivatives is time-taking.
refer training results in for exact number https://github.com/baidu-research/DeepBench#types-of-operations


Diagonal asymptotics of integer compositions

Question: A (weak) composition of a positive integer $n$ into $k$ parts is an ordered sequence of nonnegative integers $(a_1, a_2, \ldots, a_k)$ such that $ \sum_{i=1}^k a_i = n $. I am interested in the case when the parts are bounded: $a_i\in\{0, 1, \ldots, j-1\}$. The number of such compositions satisfies the two-variable recurrence
\begin{equation}
\kappa(n,j,k)=\sum_{i=0}^{j-1}\kappa(n-i,j,k-1)
\end{equation}
and can be expressed as
\begin{equation}
\kappa(n,j,k) = \sum_{s\geq0} (-1)^s {k \choose s} {k-sj+n-1 \choose k-1}
\end{equation}
[R. P. Stanley, Enumerative Combinatorics, Vol. I, p. 307].
Does someone know how to find the asymptotics of $\kappa(n,j,k)$ when $k\to\infty$, $n\sim\lambda k$, $\lambda\in(0,j-1)$, and $j$ is fixed? In particular, I would like to determine
\begin{equation}
\lim_{k\to\infty,\ n = \lambda k} (\kappa(n,j,k))^{\frac{1}{k}} =\ ?
\end{equation}
Answer: Up to a factor of $j^k$, What you're asking for is the probability $P$ that a k-step random walk with steps chosen uniformly from $S = \{0, 1, ..., j-1\}$ lands on $\lambda n$. This is the probability of return to the origin at time $k$ of the (typically biased) random walk with steps chosen uniformly from $S - \lambda = \{-\lambda, -\lambda+1, \dots, -\lambda + j-1\}$.
If we choose some $t$ and bias this random walk so that $-\lambda+r$ has probability $t^{-\lambda + r}/Z_t$, we are multiplying the probability of return to the origin by $(j/Z_t)^{k}$. But we can choose $t$ so that this new random walk is unbiased, in which case its probability of return to the origin is roughly proportional to $k^{-1/2}$.
So, $P \sim k^{-1/2 }j^{-k}Z_t^k$, and the number you're interested in is roughly
$$k^{-1/2} Z_t^k.$$
All that remains is to find the values of $t$ such that this new random walk is unbiased, but this is the value that maximizes the probability of return to the origin, i.e. the value for which $$Z_t = \sum_{r=0}^{j-1} t^{-\lambda + r} = t^{-\lambda}\frac{t^j-1}{t-1}$$ is minimal.
So the number you're interested in is roughly
$$k^{-1/2} \rho^k,$$
where
$$\rho = \min_t t^{-\lambda}\frac{t^j-1}{t-1}.$$
You can get an explicit upper bound on $\rho$ by noting that, by convexity of the summands, $$\frac1j Z_t = \frac1j \sum_{r=0}^{j-1} t^{-\lambda + r} \leq \frac{1}{2}(t^{-\lambda} + t^{-\lambda+j-1}).$$
The optimal value of $t$ is $((j-1)/\lambda-1)^{-1/(j-1)}$, which gives
$$\rho \leq \frac{j}{2} \left(
\left(\alpha^{-1}-1\right)^{\alpha} + \left(\alpha^{-1}-1\right)^{-(1-\alpha)}
\right) = \frac{j}{2} \alpha^{-\alpha}(1-\alpha)^{-(1-\alpha)},$$
where $\alpha = \lambda/(j-1).$
Comment: @antonThank you for your answer. Note that $\kappa(n,2,k)={k \choose n}$ (compositions are binary sequences in this case), and so $\lim_{k\to\infty} (\kappa(\lambda k,2,k))^\frac{1}{k} = \lambda^{-\lambda}(1-\lambda)^{-1+\lambda}$ (by Stirling's approximation), which seems to violate your upper bound. Am I mistaken?
Comment: Yes, I had made a mistake with the indexing. I've fixed it. The bound now agrees exactly with the right answer for $j=2$, as it should.
Comment: I expect that this can be extended to exact asymptotics by using Berry-Esseen to derive a CLT and the log-concavity to infer a local CLT.
Comment: @antonThanks a lot, this is a nice approach. Differentiating wrt $t$ implies that $\rho$ is the positive real root of the polynomial $\sum_{r=0}^{j-1}(r-\lambda)t^r$. This seems to be the same characterization as the one obtained by the analytic approach suggested by Dr Wilson. I will try to get the exact value explicitly, but I don't know if that's possible (the above upper bound can be "loose", depending on what one needs of course, e.g., for $\lambda=1/2$ and $j=4$ one obtains $\rho\approx2.56$, whereas the bound yields $3.138...$).
Comment: Yeah, I optimized that bound for being reasonably good near $\lambda = (j-1)/2$, if you're looking near $\lambda = 0$ or $\lambda = j-1$, you can fruitfully approximate the finite geometric series for $Z_t$ with an infinite one.
Answer: Such problems can be solved routinely using the methods explained in the book by me and Robin Pemantle, Analytic Combinatorics in Several Variables (preprint version online at our websites, book published by Cambridge in 2013). The bivariate generating function for $\kappa(n,j,k)$ is $F_j(x,y) = 1/(1 - yf_j(x))$ where $f_j(x) = \sum_{i=0}^{j-1} x^i$. This simplifies to a nice rational function - use the standard smooth point formula for Riordan arrays (Section 12.2 as I recall) to get the desired results. I won't work out all details, because I am on vacation, but this is an absolutely standard application of our basic theory.
Comment: @markThanks a lot for the reference and the pointers, I'll work out the details...
Answer: This question has been answered in (last line of) Asymptotic for restricted compositions into k parts giving $$\lim_{k\to\infty,\ n = \lambda k} (\kappa(n,j,k))^{\frac{1}{k}} =\frac{(\alpha+1)^{\alpha+1}}{\alpha^\alpha}\cdot e^{-\left[\frac{\alpha}{\alpha+1}\right]^j}$$ where $\alpha=j-\lambda-1>0$.


Do I have to worry about individual armor pieces?

Question: I was DMing for a group of friends and one of them was wondering if he were to wear normal leather armor (11+dex), but wore scalemail (14+dex[max 2]) shin-guards, would a low sweeping attack at his shins have a different AC than normal. I ruled that it's whatever he was wearing more of, which was the leather armor. My real question is: Does it even matter that he was wearing shin-guards? Or is it not possible to "Mix-n-Match" armor?
Comment: Welcome to the site. Take the [tour]. It appears  there was a disconnect between the question's title and its original tags. Based on the description for determining your friend's Armor Class, I've changed the tag to *Dungeons and Dragons 5E*. If that's incorrect, feel free to edit the tags or the title. Thank you for participating and have fun.
Comment: Scale Mail "consists of a coat *and leggings...*" Not shin guards exactly, more like pants.
Answer: Combat in D&D has never (except for options) had hit locations and armour class is an abstraction for how well protected you are overall.
You can wear shin guards if you want - they look cool but they won't make one jot of difference to your AC.
Comment: "Never" is not strictly true (though generally true and true for 5e).  D&D Blackmoor (p.  6-10, hit location and height differential to determine hit location) was an option.   (it slowed the game down).  Hit location rule in the AD&D 1e DMG (p. 53) for damage to wings in aerial combat is an exception to the general point you make, (see also AD&D DMG p. 61 on HP). Recommend opening sentence confine this answer to 5e (per the tag) and the AC as abstraction point (100% agree).
Comment: Why not use a modifier? Like "+1 against cutting"? It would still have some usefulness, but would be inferior to a standard +1 leather armor.
Comment: @vsz one of the meris of 5e is that it did away with a lot of conditional bonuses, replacing them with advantage if neccesary. IMO they should be used very sparingly, and since an AC bonus against slashing may be relevant in any combat, I would avoid it
Comment: @MartinEpsz : Because of the "wait, was that orc wielding a spear or a cutlass?" situation? Which isn't a problem in a computer RPG, but can become tedious in pen&paper?
Comment: @vsz that, and the all-too-common remembering  after the fact that you had a bonus that applied. Sometimes leading to rolling back action in combat, sometimes to frustrated players
Comment: @vsz that one is easy - I nick the rule from Advanced Squad Leader (a game with a ridiculous number of situational modifiers): once the action has moved on the result stands no matter who forgot what.
Answer: I think anaximander's comment on another answer is worth expanding into a new answer.
In short, there is no RAW for deciding the AC of custom armour combinations in D&D. Hit location and choice of target does turn up very rarely, most commonly for specific monster, trap or magical effects.
Rather than attempt to use hit locations more generally, which breaks away from a lot of core D&D assumptions, you could attempt to homebrew new types of armour based on your player's descriptions.
I can suggest a couple of rules of thumb:

Any custom armour type should be strictly no better than existing listed items, taking armour category, AC, max Dex bonus, stealth disadvantage and cost all into account. Another way of saying this is that a new homebrew variant should not be obviously superior and first choice for any type of character.
Where possible, categorise a player's armour description as a variant of existing armour type (armour is not made in factories all alike, there are very many variations). Metal shin guards added to leather armour sounds a lot like "studded leather" to me - it would be simplest to rule it exactly the same for all game mechanics, including cost.

There is very little room amongst the armour types already in the PHB to create something with different mechanics (all AC values, and most variations in other properties are already covered with cost separating otherwise clearly better options). So for most custom descriptions it should just be a matter of granting existing stats to a player's desired appearance or reasoning.
Comment: As an aside, *Runequest* has (had?) an interesting armour model allowing free mix and match between types and hit locations, plus hit locations were core in the game. It is part of what gives the game a very different feel to D&D though - in my experience it also meant many characters were retired not because dead, but because they lost a limb.
Comment: https://www.youtube.com/watch?v=vncIBREXCwU


"Web Template" item template is not available in Visual Studio 2012 list of item templates

Question: I am working with visual studio 2012 and want to add sharepoint 2013 "Web Template" item from VS 2012 list of sharepoint 2013 item templates. But I could not find "Web Template" item in SP 2013 item templates list? From where i can get and How can I add "web template" item to SP2013 item templates in VS 2012.
Answer: There are two types of Templates when it comes to Webs.
One is Site Definition and other is web template, you can save a web as a template when it is created using out of box or custom site definition.
This article will explain you the difference between site template and site definition.

To create a site definition project
On the menu bar, choose File, New, Project. If your IDE is set to use
  Visual Basic development settings, on the menu bar, choose File, New
  Project.
The New Project dialog box appears.
Expand the Visual C# node or the Visual Basic node, expand the
  SharePoint node, and then choose the 2010 node.
In the Templates list, choose the SharePoint 2010 Project template.
In the Name box, enter TestSiteDef, and then choose the OK button.
The SharePoint Customization Wizard appears.
On the Specify the site and security level for debugging page, enter
  the URL for the SharePoint site where you want to debug the site
  definition, or use the default location (httpSystem Name/).
In the What is the trust level for this SharePoint solution? section,
  choose the Deploy as a farm solution option button.
All site definition projects must be deployed as farm solutions. For
  more information about sandboxed solutions versus farm solutions, see
  Sandboxed Solution Considerations.
Choose the Finish button.
The project appears in Solution Explorer.
In Solution Explorer, choose the project node, and then, on the menu
  bar, choose Project, Add New Item.
Under either Visual C# or Visual Basic, expand the SharePoint node,
  and then choose the 2010 node.
In the Templates pane, choose the Site Definition template, leave the
  Name as SiteDefinition1, and then choose the Add button.

For More information check this MSDN article out.
Answer: There is no actual Project item template in Visual Studio 2012 to create this but the links here below point to articles giving you the step by step procedure, after you decide whether you want the Site Definion (farm deployment only) or the Web Template (sandboxed or SharePoint Online compatible). Mirjam has quite a good explanation of these aspects here http://sharepointchick.com/archive/0001/01/01/site-definitions-vs.-webtemplates.aspx
Also, even if it target VS 2010, is perfectly doable with Visual Studio 2012, is a step by step procedure into creating one http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx
Both articles also describe some tricks and benefits,in case you need to figure out, which approach to choose


I get no ping repsonse to my phone. Why?

Question: I went to www.whatsmyip.org and got my public IP address for my phone.  Just for kicks and grins, I tried to ping it, but didn't get a reply.  Is ICMP turned off on my android phone?
Comment: Was that the same IP address your phone had locally? If not (which is very highly likely), you're behind NAT and won't get unsolicited packets.
Answer: Either your phone silently drops pings, or the router it's behind, either your wifi router, or the 3G network's router that NATs your phone drops them.
Comment: It is very likely that the provider's network and the phone's configuration itself both block incoming connections of any sort, except any that the provider specifically wants open. +1
Answer: Your phone can have a lot of different IP's on different interfaces but that one is not yours. It's internet gateway of your mobile operator.
If I'm wrong consider the point of describing to customers why they should pay for some pings or face the hell of ICMP incapsulation of freebies masters.
Comment: Not entirely sure what this answer is saying, but it seems to have originated from a very naive idea of what IP addresses are and how they are assigned and used.


Don't calculate accepted answer rate on meta

Question: Meta is a discussion site and accepting an answer on many questions makes no sense.  Since this statistic is now reported, it may be taken as a measure of the level of participation.  For a discussion site, this stat makes much less sense, especially as a measure of participation.  I suggest that it not be calculated or reported for meta.
Comment: Why should we bother answering this, you only have a 29% acceptance rate :)
Comment: @John Rasch: don't.  :-)
Comment: Since [it's not shown anymore](http://meta.stackexchange.com/a/164654/140951), you'll never see it, so even if it is calculated, it's worthless.
Answer: I say go ahead and report it, but understand the nature of the site when you are looking at it.
Comment: I                 agree.
Answer: I had a look through my posts on here earlier -- most of those that haven't had an answer accepted are for things where there isn't a solution yet, or none of the answers (suggestions, even) match the actually implemented solution.
Answer: It makes sense sometimes, on support questions especially.
Since questions on meta require special tags, perhaps questions tagged with things like feature-request could be removed from the count.
Answer: (I don't know why I bother answering this, there is only a one in 3 chance you will accept this :p)
I think it does make sense.

Jeff can always select a different accepted answer
You can select the "answer" you found most helpful, or that most comprehensively addressed your query.

There is no question that this feature increases participation, I cleaned up all my questions on Meta and SO recently, accepting feature requests I made on meta etc. If Jeff sees a feature request that is accepted that he is going to decline, he now is kind of forced to adding a reason and marking it as accepted.
Answer: I just had someone say they would not have answered by question on Meta if they had saw my accept rate first.  So this is a real problem, as most questions on meta does not have one best answer.
Maybe only include questions tagged "support-request" when working out the "accept rate"
Comment: That "someone" was random and he was making fun of you. Don't whine!
Comment: Wasn't entirely *that* random, shamone!
Answer: Please don't. It's the only site I have a 100% accept rate.
Answer: A lot of SO functionality wasn't designed for Meta.SO but I would like to see as much of the functionality maintained as possible even where it might not be needed... for a few reasons:

Meta.SO is a good place to try out functionality you might not want to try on a "professional" site.
Stack Exchange is coming up and there is a lot to be learned seeing how SO features hold up under a site for which is was not specifically design (like meta.SO).
I would like to see how the SO engine handles more traditional discussion needs of meta.SO.
It would be useful to see to see how different features "work" in different types of community environments. The group dynamics here are certainly different than that of SO and the other sites.

Meta.SO is a bit experimental. I'm sure the SO team stands to learn a lot by maintaining meta.SO as a close macrocosm of the Stack Overflow proper.


Tool for working with cross platform/desktop icon format?

Question: I want to create/edit a desktop icon that must work on Windows, Mac OS X, Linux (KDE/Gnome) and mobile devices. Is there a tool that handles all these different formats?
Comment: Off topic: specific to implementation on OS platforms
Comment: My question is about the TOOL, not the format itself.
Comment: Then the question's headline needs to be edited to make this clear.
Comment: OSX and Linux (and UNIX systems too) use png files for icons. Windows is the odd man out with their ico format.
Answer: IcoFX is a free package for creating and editing icons.  It works very well in Windows and can also save to 'Macintosh' format; so I'm not sure how well it would work for OS X (I'm not a Mac user).  I've been using it with all my Windows stuff for a couple of years now, and have not found it lacking any important features.
EDIT:  As pointed out in the comments, IcoFX can't go larger than 256x256, but if you need something larger than that, it's really not an icon anymore.  :)
Axialis Software has a top-notch package, Icon Workshop, that can do about anything for any icon.  It runs between $30 and $70 US, depending on what you want.  I used it for years with great results.
I believe Linux distros use either .png or .svg formats for their icons, so those can be created from most any graphics package.
Comment: My vote for IcoFX. Though not reaching 512x512,(256x256 maximum size) wont allow that size for Leopard, for example. Still, it exports quite well in the icns format that Mac OSX uses, and to date, basically seems to have worked, in my experience...But I'd rather do the sizes versions myself and import into IcoFX than let the auto generated ones that IcoFx creates when you hit the convert to mac button...
Answer: There is, unfortunately, no such format - both Windows and OS X uses their own propreitary container formats for their desktop icons.
The closest you can get would probably be to use a set of Photoshop plugins such as these to convert your files to the appropriate format and offer both (in addition to PNG for Linux).


Does the pinata always spawn in Whimsyshire?

Question: I've played the Whimsyshire level a few times but only saw the pinata once near the exit stone.  Is the chance of it spawning random? If it does, does it always show up near the exit stone?
Answer: No it does not.
I've run 3 full clears of Whimsyshire, and never seen the pinata once.
Since the Pinata is just the Whimsyshire version of a Resplendent Chest, I would assume that it has a relatively low chance to spawn.
I would assume however, that it will always spawn somewhere near the exit stone, as most resplendent chests in dungeons do so.
Comment: its not necessarily anywhere near the exit zone.  For example, I've seen runs where the pinata was right next to the entrance.
Comment: You have to be careful too, since you attack the pinata to open it, you can accidentally open it with ranged attacks.  I've seen ranged characters accidentally shoot the pinata from offsceen while aiming at mobs :(
Comment: Based on the loot revived from Pinata I would say it is no where nearer a Resplendent Chest.
Answer: The Pinata can spawn anywhere. On my second last run it had spawned just inside the entrance point. On my last run I didn't find one at all. I am currently at 40% for spawning but have only done 10 runs so i may have been lucky/unlucky or missed it on occasion. It doesn't seem to spawn every time however.
Answer: I've ran through whimsyshire about 30 times on torment 1,2,& 3 and I've only seen the pinata once. In my experience, the pinata is a very rare spawn. I'm not sure what factors influence whether or not it spawns.
Comment: I disagree. This does answer the question - the pinata is not a guaranteed spawn. This answer has other problems (it is not clear, has poor grammar, and does not add much new information), but we should endeavor to be clear and helpful to new users.
Answer: I have done 15+ runs in legendary and it has always spawned for me. As for loot I always get 4+ yellows and a bunch of gold with 5 stacks. First time I opened one I got a Horadric Hamburger which I sold for 15m.
Comment: Did you mean inferno, since I'm not aware of any 'legendary' difficulty.  Either way this isn't an answer.


Does "freshening" a zip file with the -FS option change the modification time of the file?

Question: I have a zip file that I use as a backup for my work.  I use the "freshen" option (-FS) whenever I want to update my backup file.  However, the file shows the date of last modification as being the date I originally created the file, rather than any of the several times since I have "freshened" the file.  Is this normal behavior?
Answer: Unix doesn't have a create date, so when you update these files in your .zip you're updating them based on their modification date, which according to the zip man page is normal behavior.
excerpt
The new File Sync option (-FS) is also considered a new mode, though it
is similar to update.  This mode synchronizes the archive with the files on
the OS, only replacing files in the archive if the file time or size of the
OS file is different, adding new files, and deleting entries from the
archive where there is no matching file.  As this mode can delete entries
from  the  archive,  consider making a backup copy of the archive.

Example
Say we have the following 3 files:
$ touch file1 file2 file3

We add them to a ZIP file.
$ zip file.zip file{1..3}
  adding: file1 (stored 0%)
  adding: file2 (stored 0%)
  adding: file3 (stored 0%)

Some time passes and file3 gets updated.
$ touch file3

Now we update the ZIP file.
$ zip -FS file.zip file{1..3}
updating: file3 (stored 0%)

Checking the ZIP file we see the times for the files is now like so:
$ unzip -l file.zip
Archive:  file.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  07-12-2014 02:59   file1
        0  07-12-2014 02:59   file2
        0  07-12-2014 03:00   file3
---------                     -------
        0                     3 files

If we create a temporary directory and unpack the ZIP file within:
$ mkdir temp; cd temp

$ unzip ../file.zip
Archive:  ../file.zip
 extracting: file1
 extracting: file2
 extracting: file3

The contents of this directory are as follows:
$ ls -l
total 0
-rw-rw-r--. 1 saml saml 0 Jul 12 02:59 file1
-rw-rw-r--. 1 saml saml 0 Jul 12 02:59 file2
-rw-rw-r--. 1 saml saml 0 Jul 12 03:00 file3

And if we use the stat command to check out file3:
$ stat file3
  File: 'file3'
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: fd02h/64770d    Inode: 17307675    Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/    saml)   Gid: ( 1000/    saml)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2014-07-12 03:00:16.000000000 -0400
Modify: 2014-07-12 03:00:16.000000000 -0400
Change: 2014-07-12 03:01:03.447913554 -0400
 Birth: -

NOTE: Notice there is timestamps for access, modify, and change. The zip command is preserving the access and modify times when you use the -FS switch.
References

get age of given file
How to find creation date of file?
Get file created/creation time?
Comment: So, `-FS` will update the timestamp of the individual files in the .zip file while the .zip file's own timestamp remains unchanged?
Comment: @Joshua - no it's not possible to preserve the timestamp of the .zip file itself. Anytime you manipulate it, you're modifying the timestamp.
Comment: I'm not asking because I want to preserve the timestamp, I'm asking because the timestamp of my `.zip` file does not update after I use the `-FS` flag.


Free opening name database?

Question: Is there a database available that the gives you the names of common openings?  "Ruy Lopez", "Sicialian", "Queens Gambit", etc.  Ideally it would just be a simple map of the opening PGN to the common name.
Answer: There is an "eco" GitHub project available which I believe, based on the name, is based on the Encyclopedia of Chess Openings.
This project used to provide a JSON file with all openings, but now provides a set of tab-separated files with columns for ECO code, name, FEN, and moves.
To give you an idea of the format of the file, here's the entry for Ruy Lopez: Marshall, Main Line, Spassky Variation, which happens to be the longest opening in the file:
<code>C89     Ruy Lopez: Marshall, Main Line, Spassky Variation       5rk1/5ppp/p1pbr3/1p1n3q/P2P2b1/1BPQB1P1/1P1N1P1P/R3R1K1 w - -   e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5a4 g8f6 e1g1 f8e7 f1e1 b7b5 a4b3 e8g8 c2c3 d7d5 e4d5 f6d5 f3e5 c6e5 e1e5 c7c6 d2d4 e7d6 e5e1 d8h4 g2g3 h4h3 c1e3 c8g4 d1d3 a8e8 b1d2 e8e6 a2a4 h3h5
</code>
Answer: I have a CSV file with 2000+ openings in it, with their ECO codes, all names, and moves in SAN notation. You can find it on GitHub here: https://github.com/Destaq/chess_graph/blob/master/elo_reading/openings_sheet.csv.
Answer: Lichess provides an online database in the analysis board which will tell you the name of the opening in the chess board. However, chessbase is a much more powerful tool, it provides an online database and you can also load any database you can find on the internet (chessbase will automatically display the name of the opening on the board). Moreover you have the option of creating your own database, with your own games or games of other databases (or both).

Free opening name database?


Tracking people with NFC/RFID

Question: I recently read an article about a Texan student called Andrea Hernandez who refused "wearing" an RFID tracking tag at school. I became interested in the subject.
Apart from any legal/social/religious discussion, which is definitely off topic, my question is hardware & privacy related.
The short question is

How can we use short-range technologies to track people movements and how precise can we do?
The long question is

I know that if you want to track where a person goes in a wide area, you can ask him/her to install a smartphone application that records GPS track and has the highest accuracy.
I know that if you want access control to a facility you can secure its entrances with contactless badge readers so you know who enters and who exits the facility. This is what many companies do.
If you want to know in which room anyone is, first idea is to secure all doors with the same readers above.
In the past years I read a few articles about ePassports being able to be read from a middle distance (1 to 3 metres) with a special-crafted skimmer so I started to hold mine in an aluminium foil instead of hammering it. I also saw a demo of a bomb, tested on a puppet, that activates itself when scanning a specific passport (see video at around 3:20 for the show) but at a very short distance.
With reference to current NFC/RFID technology, how precisely can we track movements of a person in a facility without explicit scan by user? I mean, is it feasible with today's technology to put scanners on walls and know who's inside a room? If it was Bluetooth or Wi-Fi it was surely feasible but they use battery power
and finally

With reference to the San Antonio case and the fact that a number of schools are hitting the newspaper's first page (even in my country) for adopting "tracking students and/or teachers with NFC/RFID", I would like to ask if what our local papers call "tracking" only means tracking enter/exit from facility or tracking how long do you stay in classroom/bathroom/dining hall...
Answer: Currently this RFID tag advertises a 20 metres range. It features an autonomous power source that is not a battery.
So part of the answer is yes, with today's technology we can mount RFID readers on walls and tell how long do you stay in the bathroom, but nothing to see with passports (they collect power from reader)

Tracking people with NFC/RFID


How do I choose where to position a mini-map in the HUD?

Question: In a game with a minimap, what factors should be considered when choosing where to put the minimap on the screen HUD? What choices are typically made when wanting to emphasize a particular factor?
Comment: "Most common" doesn't mean "best", since the best choice depends on the game. After Lærne's edit, this question looks promising and useful though. It's in the reopen-vote-queue.
Comment: I don't think this is a question which fits in here. Mostly the minimap is in one of the four corners, which one you should decide yourself.
Comment: I am asking what is the most common position. It is part of game development
Comment: Yes. That was my point to be honest but I phrased it completely wrong
Answer: There's no clearly "most common" position beside one the four corners.  If you an information band/ribbon/... you typically want to embed it in your information ribbon, and leave the viewport as clean as possible.  Since it's usually one of the biggest and more visual element to display in a HUD, you often want to push it to the corner to avoid it to be too distracting/overlapping.  The band, when there is one, has often been place on the bottom, so it's no surprise, the minimap is often on the bottom left or bottom right in many games, especially RTS.  Here is Dota 2 and league of legends:

But other games have the band above, so the minimap is above.  On binding of isaac, it's on the top left

Other have the band on the left or right, so the minimap is on the left or right.  I can't remember a recent game with a left band, so here is populous : the beginning, with the minimap top left.

If you do not have a band in your HUD, put it where it hides the least interesting part of the viewport.
However if your minimap is very, very important and you cannot go around without, you can center it on the top or bottom edge of the screen, like star citizen or elite dangerous (which besides embed their minimap in the game world).

Without knowing what kind of game you want to make, that's all help we can give.
Comment: Actually, many games that require a certain amount of navigation show you the minimap overlayed at the center of the screen, so you can focus on navigating when you need so.
Comment: Yeah, I though of it but actually it's usually a feature to enable/disable when you're lost, I guessed it's more akin to check a full regular map by pressing a key or to play just with the map than to have a minimap.  I should also have mentioned the 3DS ability to display the game world on one screen, and the map on the other.  Feel free to improve my answer.


has BREW MP JVM?

Question: If BREW MP has JVM ( java - car ) , If it supports all Java ( J2ME Applications),
There is no need to develop applications through BREW , TBT etc....is it true?
Answer: In slide 10 of this "BrewMP Overview" Uplinq 2010 presentation, you can see that there are several frameworks available with BrewMP, including Java.
The biggest benefit of Java is its wide-ranging compatibility, but to actually achieve this compatibility also restricts you to the most common denominator of features across the platforms, as well as the "Java sandbox" that gives you very limited access to the phone. For many applications this is a good tradeoff to make and that's why Java apps are widely found.
BrewMP apps, with correct permissions, can interact with most components of the phone - connectivity, hardware sensors, contact / messaging databases, etc. which allows you to have very deep integration with the device. When a developer wants the experience to be seamless, it usually means choosing a particular platform that is used on the device, and working with it.
Answer: HTC Smart and HTC Freestyle are already equipped with Java VM (J2ME) while shipping.
HTC Freestyle:
http://www.mobileheart.com/cell-phone-reviews/htc-25/htc-Freestyle-2578.aspx

has BREW MP JVM?


How to deal with a decision variable in the objective function that depends on if-else conditions involving other decision variables?

Question: I'm modeling an optimization problem in which a decision variable $x_1$ in the objective function depends on if-else conditions involving decision variables $x_2$ and $x_3$, as the following equation, where $a$, $b$, $c$, and $d$ are constants. I know a possibility would be using binary variables, but I'm not sure how to do it. Could someone help me?
\begin{equation}
x_1 =
    \begin{cases}
    a, & \text{if } x_2 \geq c \ \text{and} \ x_3 \geq d\\
    b \cdot x_3, & \text{if } x_2 \geq c \ \text{and} \ 0 \leq x_3 \leq d\\
    0, & \text{otherwise}
\end{cases}
\end{equation}
Comment: What are the bounds on $x_2$ and $x_3$?
Comment: By any chance does $a=b\cdot d$? Otherwise the value of $x_1$ when $x_2 \ge c$ and $x_3 = d$ is ambiguous.
Comment: No, $a$ is not equal to $b \cdot d$. I will work on this ambiguity. Thanks!
Comment: $x_2$ and $x_3$ are bounded by a max value from both sides, e.g., $-p_{max} \leq x_2 \leq p_{max}$ and $-e_{max} \leq x_3 \leq e_{max}$.
Answer: Introduce four binary variables indicating which region you are in and the function value.
$$\begin{align}
\delta_1 &\rightarrow x_2\geq c, ~x_3\geq d, ~x_1 = a\\
\delta_2 &\rightarrow x_2\geq c, ~0\leq x_3 \leq d, ~x_1 = bx_3\\
\delta_3 &\rightarrow x_2\leq c, ~x_1 = 0\\
\delta_4 &\rightarrow x_3\leq 0, ~x_1 = 0
\end{align}
$$
You are in one of the regions so $\delta_1+\delta_2 +\delta_3+\delta_4=1$, and all the implications are standard big-M representable such as $x_2-c\geq -M(1-\delta_1), -M(1-\delta_1) \leq x_1-a\leq M(1-\delta_1)$ etc. By exloiting structure and linearity in some terms this can be reduced and simplified, but this is the basic model.
Answer: The quickest way to study this is to use Generalized Disjunctive Programming.
If we use disjunctions to formulate the problem, we get:
$$ min/max \quad z=f(x)\\ \begin{bmatrix} Y_1 \\ x_1 = a \\ x_2 \geq c\\x_3 \geq d \end{bmatrix} \veebar \begin{bmatrix} Y_2 \\ x_1 = b·x_3  \\ x_2 \geq c\\0\leq x_3 \leq d \end{bmatrix} \veebar \begin{bmatrix} Y_3 \\ x_1 = 0  \\ x_2 \leq c\\ \end{bmatrix} \veebar \begin{bmatrix} Y_4 \\ x_1 = 0  \\ x_3 \leq 0\\ \end{bmatrix}$$
Where $Y_1, ... Y_4$, are Boolean variables that represent the disjunctions.
What Johan answered is perfectly correct, since it is the Big-M formulation for this GDP problem. I am just gonna add the Convex Hull formulation, which for linear problems tends (not always) to produce a tighter feasible region.
First you have to disaggregate the variables. Let's assume that the set of disjunctions is $i\in \{1,2,3,4\}$, we dissagregate variables $x_1,...x_4$ into $x_1^i, ..., x_4^i$:
$ \sum_i x_1^i = x_1\\\sum_i x_2^i = x_2\\\sum_i x_3^i = x_3$
Then, consider a binary variable $y_i$ that will have a value of 1 if disjunction $Y_i$ is active and 0 otherwise.
We also need limits for all degrees of freedom. But normally it is good to have limits for all the variables. These parameters will be called $\overline{x_1},\overline{x_3},\overline{x_3}$ for the upper bounds and  $\underline{x_1},\underline{x_3},\underline{x_3}$ for the lower bounds.
The whole formulation would therefore be:
$$ min/max \qquad z = f(x) \\ \sum_i x_1^i = x_1\\\sum_i x_2^i = x_2\\\sum_i x_3^i = x_3 \\ x_1^1 = ay_1 \\ x_2^1 \geq cy_1 \\ x_3^1 \geq dy_1
\\ x_1^2 = bx_3^2 \\ x_2^2 \geq cy_2 \\ x_3^2 \geq 0 \\ x_3^2 \leq dy_2
\\ x_1^3 = 0 \\ x_2^3 \leq cy_3
\\ x_1^4 = 0 \\ x_3^4 \leq 0
\\ \underline{x_1} y_i\leq x_1^i \leq \overline{x_1}y_i \qquad \forall i
\\ \underline{x_2} y_i\leq x_2^i \leq \overline{x_2}y_i \qquad \forall i
\\ \underline{x_3} y_i\leq x_3^i \leq \overline{x_3}y_i \qquad \forall i
\\ \underline{x_4} y_i\leq x_4^i \leq \overline{x_4}y_i \qquad \forall i
\\
$$
And it is missing the logic constraints for the binaries. Since it is an exclusive OR, we have to add the following:
$$ \sum_i y_i = 1$$
There are some redundancies there in the constraints, but it is the tightest convex envelope that can be generated for this problem.
However, you have to also notice that, if the disjunctions are not continuous (This meaning, $Y_2$ gives a different result for $x_1$ when $x_3=d$ than $Y_1$ does, for example), it will be able to choose any of the two disjunctions indistinctively. This may be the intended behavior, of course.
Answer: Is the following model correct?
Consider $\delta_i$ as binary variables, whereas $x_i$ and $y_1$ are continuous.
\begin{equation}
x_1 = a \delta_1 + y_1
\end{equation}
For the first if statement:
\begin{equation}
\begin{matrix}
c - M(1 - \delta_2) \leq x_2 \leq c + M\delta_2\\
d - M(1 - \delta_3) \leq x_3 \leq d + M\delta_3\\
\delta_2 + \delta_3 \geq2\delta_1
\end{matrix}
\end{equation}
For the second if statement:
\begin{equation}
\begin{matrix}
- M(1 - \delta_4) \leq x_3 \leq   M\delta_4\\
d - M\delta_5 \leq x_3 \leq d + M(1 - \delta_5)\\
\delta_2 + \delta_4 + \delta_5 \geq 3\delta_6\\
bx_3 - M(1 - \delta_6) \leq y_1 \leq bx_3 + M(1 - \delta_6)\\
-M\delta_6 \leq y_1 \leq M\delta_6\\
\end{matrix}
\end{equation}
Comment: If this is meant to be an implementation of my answer, no I don't see why you would need to add two additional binary variables. if you move the $x_1$ model to a linearization of $x_1 = a\delta_1 + b\delta_2x_3$ you do not need any new binary variables as it is simply $-M(1-\delta_2) \leq y_1-x_3 \leq M(1-\delta_2)$
Comment: if it is your own attempt, well it looks correct(-ish), but the model is less clear to untangle, and more complex combinatorially. A start is to write the logical conditions and structure first to understand how the indicators relate to the initial model, and then write the MILP interpretations, instead of just listing the final MILP model.


signal sampling for 2nd time of sampled signal

Question: A sinusoidal signal of 600hz is sampled with 1khz, If the sampled signal is applied to an ideal low pass filter of 500 hz, what is the output?
Comment: We appreciate it if you share your own ideas on a problem. Your question is just a copy of the exercise, but for us the question remains what is *your question* concerning this exercise?
Answer: thirI believe it is a nonsensical question, or at least a tricky, meant  to detect students who have  a shaky knowledge, and whose anwser deserves a lot of care.
First trick: if the $600$ Hz signal is sampled at  $1000$ Hz, it will endure aliasing (a proper sampling frequency would be above  $2 \times 600$ Hz). If the sampling process is perfect, it will appear as a sine at the mirror frequency $2*\frac{1000}{2}-600 = 400$ Hz.
The  signal (that is assume real)) is now  in the $[0,500] $ Hz band. An ideal-low pass cutting at $500$ Hz would thus be an all-pass, second trick, and would be utterly  hard to design, numerically, in that case (third trick).
So in theory, the  output signal would be the same (aliased) signal as the one from the first stage, fourth trick in a way.
Comment: thnk u a ton :)
Answer: This is basic sample theory. when you want more of the background you can find this at wikipedia. Check also there pages about sampling and Nyquist
The output frequency will be:
    $$
    F_{out} = \frac{Fs}{2} - f_0 \text{ so } 500-600 = -100
    $$
The result of this will me that you measure the signal at $400 Hz$
Comment: thnk u a ton :)


Stop users from logging in from multiple locations

Question: We are running a membership site. However, we have a problem with users that subscribe to our content that are sharing there login information with other people, circumventing the need for those users to also need a subscription. Any ideas for plugins that already do this? Or suggestions of how to go about logging people out that login from 2 locations? I assume some use of IP addresses per login or something...?
Answer: We had a similar problem where we needed to give access to partners and "membership" or "subscription" plugins seemed to offer what we needed.  The problem we had was that the plugins we found were all for-pay, not free or freemium.
Understanding this, the MagicMembers and aMember Pro plugins both had functions that could prevent access sharing.  I'm sure there were others, but the spreadsheet I used to compare the different products (and a quick check of each site) turned up these two as explicitly doing what you need.
The costs of these can range a great deal. I'd suggest searching with terms like "wordpress subscription access sharing" and seeing what turns up.  "Access sharing" is what most of the plugin developers called the situation you are describing...so that might also help.
Comment: Can you define "where" in MagicMember you can see or set this option? I've used it, in fact, using it on this project I'm asking about but it didn't seem to provide any such thing. :(
Comment: We did our research and basic testing more than eight months ago.  Looking at the MagicMember website, it looks like you need their "Magic Kicker" plug-in to block login sharing. Not sure if that's been the case all along or if it was a recent change.
Answer: Check out this plugin
This plugin already does this your requirement.
Comment: [An answer should be more than just a link to an external site](http://wordpress.stackexchange.com/faq#deletion). Please add a solution.
Comment: Like above, can you define where it has this feature? How does it work?


Prism, Gears, etc

Question: I have a question related to this SSB's, how does this sort of engines actually work?? I want to try to code something similar (if possible) just for the sake of it but I have found nothing regarding their behaviour or how to start on building one.Not sure what to look for either.
Answer: Mozilla Prism, last time I checked, is completely different to Google Gears. In fact, Google Gears is to complement apps like Prism.
Mozilla Prism is pretty much a chromeless version of Firefox, whereas Google Gears is a set of APIs allowing javascript applications to function and store data offline, and sync back online at a latter date.
Answer: You'll find a lot of resources regarding Google Gears on the official website, including the architecture and security model. You can actually check out the source code for Gears, since it is has been released under the BSD license.
Mozilla Prism is also open source, allowing you to actually look at the source code to figure out how it works. You can probably find more about its architecture on its website.

Prism, Gears, etc


How do I represent the direction (ascending or descending) for setting a range?

Question: I have a range (numbers) to be set. In most cases a lower value is better, however in some cases a higher value is better. How do I represent the same in my UI? To set up the range I just have two values. I want the solution to be subtle.
Comment: There are many ways to represent 'higher is better' or 'lower is better' ranges. Could you please provide more information or add a wireframe to explain your particular situation.
Answer: It's difficult to give good advice without more information about your interface, but as for the user's experience it can be confusing if 5 times in a row higher is better, and then suddenly lower is better. The user may be confused or have to stop and think even if you do communicate clearly to the user which is which.
Depending on your layout, if you're prompting a user to enter a value within your given range, it may be useful to using something like "(higher is better)" after the text prompt and before the input box, but I suggest standardizing them so that higher is always better, perhaps by reversing the question for the ones where lower is better.
Comment: agree for most cases, though sometimes "confusing" is good (if you want to detect respondents who didn't read the questions and filled lowest or highest values everywhere)
Answer: I feel sharing a color code would be better. You can give a disclaimer saying that values with green are recommended, values with yellow are okay and values with red should be avoided. Then color code you UI values and the user can choose accordingly. The colors will help the user to understand the safer values to be used


Formatting in *.m file

Question: I have my own package (just a bunch of functions) in the *.m file, which I load using the Needs[] command. Everything works fine except for one detail: each time I want to edit the package and open it by double clicking in the file explorer, Mathematica opens the *.m file with all the formatting removed (no indentation whatsoever). Is there a way to avoid this?
Comment: How do you indent your code? Do you use the cells or text elements (spaces/tabs) within the cells?
Comment: I'm not sure. When creating the package, I just opened a new Mathematica window, and then used Save As *.m file. I do not use spaces for indentation.
Comment: The interface for the package editor is relatively simple compared to the regular notebooks. If you didn't add any formatting yourself, or changed the formatting of the cells, then that info is not saved. You can think of it as a text editor that just tries to make things look nice, but doesn't actually save that info.
Comment: I don't see this.  Is it a problem with a specific .m file? Or with all .m files?
Comment: With all .m-files.
Answer:
When creating the package, I just opened a new Mathematica window, and then used Save As *.m file.

You can use another workflow: instead of saving your Notebook as an .m file, you should save it as a usual Notebook, but preliminarily you should make all your input cells to be initialization cells and set AutoGeneratedPackage -> True for your Notebook:
SetOptions[EvaluationNotebook[], AutoGeneratedPackage -> True]

Now each time you save your Notebook a package with the same name will be generated in the same folder. The package will contain the contents of your initialization cells.
There are two possible ways to make your input cells to be initialization cells:

By setting the InitializationCell -> True flag (menu item Cell ► Cell Properties ► Initialization Cell)
By setting the InitializationGroup -> True flag (menu item Cell ► Cell Properties ► Initialization Group). It may be more handy than the first method, because with this method it is sufficient to create a single initialization group at the top of the Notebook (for example, by creating a cell with style "Section" and applying this menu item to it).

Related:

Is there a (simple!) way to convert all initialization cells of a document to normal cells?

Formatting in *.m file


Is there any limit to the number of UTXO's sitting at a script address?

Question: Just want to foresee if we'll run into any issues sending/consuming thousands, or tens of thousands of UTXO's at a script address.
Answer:
Is there any limit to the number of UTXO's sitting at a script address?

There shouldn't be any practical limit.
UTxOs aren't stored in some memory at an address. The address determines who can spend a UTxO, not where it resides. And that address is included on the UTxO, not vice versa.
In other words, when you send UTxOs to an address there is no check on which/how many UTxOs are owned by that address. You are just adding a new UTxO to the blockchain that the intended recipient can identify as their own and spend.
Check out my answer here for more details on how UTxOs are associated with addresses.
Comment: Thank you! This is exactly the answer I was looking for :)
Comment: @Mitchell Turner Since the address is just a hashed string of the script attached to a UTXO, it doesn't specify where the UTXO resides. So, what does it mean when you say "send UTXOs to an address" in the third paragraph? Does it mean that we create a new UTXO using the same hashed script AS the address attached to that new UTXO?
Comment: I mean when you create any transaction that has an output owned by the script address.

I'm using the term "send" loosely. Similar to when you "send" or transfer funds to another wallet. In reality you aren't "sending" it anywhere, you're just creating a new UTxO who's owner is the recipient of the value in the UTxO.

Sorry if that was confusing. I was intentionally mixing vernacular to draw parallels.
Answer: This sounds like a two part question:

Is there any limit to the number of UTXOs stored at a script address
Is there any limit to consuming UTXOs stored at a script address

For the first one, yes and no.  While you can theoretically store as many UTXOs as you like at a script address, there are some resource constraints you're likely to run into:

The size of a single transaction is currently limited to 16k and the max size of a single block is 64k.  And while these numbers are adjustable, this puts an upper limit on the rate of ingestion.
The same issue will apply when you wish to spend the UTXO as well.  16k is the limit for the entire transaction, inputs, outputs, witness, all of it.

For the second question, yes, there are a number of limits on consuming UTXOs:

Within the 16k transaction size limit, the smart contract (currently) needs to fit into that space, significantly reducing the amount of space available for UTXO
Odds are, you'll probably want to do some verifications as well on the UTXOs so cpu and memory execution limits may also play a factor
Like the 64k block size limit, there are also block limits for cpu and memory
Answer: Official documentation is silent about it.
Since many UTxOs can exist within one wallet address, the same way they can exist within a script address. You can potentially have even 10,000 Tx inputs per script address, but in reality, I'm sure, their number is below 1000, because it'll take a fair amount of network power to scan all inputs and outputs of each such an address. The only way to find out the exact number of tx-ins is to experiment in testnet.
However, the max number of UTxOs processed per transaction is known.

The maximum number of UTxOs per single transaction is about 70. Going higher will likely result in the network rejecting the transaction and defrag-ops.py will warn about this if --max is set higher than 70.

In addition to the above, I think everyone will be interested in reading this post.
Comment: This is per transaction, not per script address, right?
Comment: Thanks for adding more details! Gave an upvote, but I still don't think this definitively answers the original question of max # of UTXO's allowed to sit at a script address.
Comment: I've updated my answer.
Answer: I am failing to spend even 10 utxos from the script address because of CPU and memory limits, using AlwaysSucceeds validator. More info:
Transaction memory and cpu usage limits


Raster cleanup eraser fail in ArcGIS for Desktop?

Question: I am running ArcGIS 10.3 ArcScan and trying to clean up a raster prior to vectorisation. The raster was a three band raster converted to greyscale using the 'Greyscale function', classified into 2 bands using the Symbology tool and saved as a new raster tiff in a folder (for this method see How can I flatten a multi-band raster to a single-band raster in ArcMap 10.2?). I can vectorise the raster using ArcScan, but I need to clean it up first using Raster Clean and the Raster Painting tools. When I try to clean it up the eraser appears to work, but when I let go of the mouse button all the erased pixels reappear. Nothing I can do seems to help. I have tried moving the tiff into the same folder as the shapefiles I am editing and will use for vectorisation. I have also tried exporting the tiff and shapefiles to a gdb. I don't know if this is because this was a greyscale raster that is then classified into 2 bands for vectorisation, or if there is some crucial step I am missing that would allow me to clean up my raster in ArcScan.
Answer: Experienced the same issue in 10.4.1 and suspect that the reason lies with the fact that my raster had been georeferenced to a coordinate system (transverse mercator) with a shift in central meridian.  I believe that the shift or the funky coordinate system extents is causing the edits with the raster to not "see" the the actual pixels.
An inelegant fix I used was to project the raster to the same coordinate system and use that reprojected raster for vectorization.
Answer: I've now done some experimentation with vectorisation and raster cleanup in ArcGIS 10.4. I've discovered that it will work with a transverse mercator projection (mine is WGS 1984 UTM zone 36N) but you have to have the Data Frame, the raster you want to vectorise and the shapefile you're going to be vectorising to all on the same projection.
Answer: You should try: go to customize on the menu bar, then check Arcscan and Spatial analyst box.
Comment: Welcome to GIS SE!  As a new user be sure to take the [Tour] to learn about our focussed Q&A format.
Comment: It's difficult to know how this might solve the question asked,  You should provide more details as to why this would help.


Quality / price slider

Question: I am trying to depict quality (custom rating) and price sliders in one phone screen. The problem is that price and quality does not have direct connection (i.e. high quality does not necessary mean high price…there may be high quality and medium or low price). Is there any suggestion to do it? Maybe anybody know how to combine them into one slider?
Comment: Why do you want to combine them given that they don't have a direct connection?
Comment: What are their purpose? Does the user slide them in to place, then click "search" or something, or do they appear from the system to show an item's stats? Need more information
Comment: @Kirill It would be better, if you can elaborate more to this. What's the purpose and a bit Graphical explanation would be great!
Answer: If you need to combine them into one control - which does seem far-fetched - the result is going to depend a lot more on the algorithm you use to display the "results" than the control itself.
I would agree with other commenters that it does not seem like such a good idea to try and combine these metrics (without knowing a lot more about your requirements and audience). It seems as if setting the desired quality with a slider and then showing all price options that result for that quality level.
But more details about your situation may result in better answers :-)

Quality / price slider


How to calculate fee in BitcoinJS raw transaction?

Question: I have a transaction with 3 inputs and 2 outputs. 1output is the recipient and the other output is change address. How should I calculate the fee and apply it to output?
Comment: Does this answer your question? [Specifying fee amount using bitcoinjs](https://bitcoin.stackexchange.com/questions/57782/specifying-fee-amount-using-bitcoinjs)
Comment: Your question shows a bit of a misunderstanding.  If you read some of the hits after searching for "transaction fee," I think you'll ask a better question.  You may have meant, "How do I SET the fee in a BitcoinJS raw transaction?" but even this would show that you don't realize the fee is simply the difference between the sum of the inputs and the sum of the outputs.  Or perhaps you meant to ask for advice in choosing a fee (https://bitcoin.stackexchange.com/questions/64443/how-to-find-what-is-suitable-transaction-fee-to-send-10-mbtc/96214#96214).
Answer: The TX fee is the difference between the totals of all the input values and all the output values. If you are looking at a single TX you can see all the output values, but how do you get the input values? They are not included in the TX itself. What you must do is look up the UTXO being spent by each TX input and total their values. (The data structure used to track and process all the input coins is called a "view").
Note that there is no "applying a fee to the output". A TX has no extra fee field or property, and the fee itself does not occupy an entire output.
If you are constructing a TX where the input values equal exactly the output values, you "include" a fee by reducing the value of one of the outputs.


How long can I stay in Singapore on a multiple entry pass visa?

Question: I am trying to get a Singapore multiple entry visa. My question is: can I work in Singapore on this visa base legally? After how many days do I need to come back to my home-country?
Answer: You won't be able to work on the visa.
What you need to get in order to legally work in Singapore is some sort of work pass or permit, which usually your employer will have to get for you. However, there is no issue with looking for a job while on a visa. Once you get a job, your employer can apply for a work permit or pass on your behalf, which will give you a long term pass to stay in the country.
Until then, you will most probably not be able to stay any longer than 30 days at a time in Singapore.
DO NOT overstay or work illegally, as this will most certainly get you into trouble, and other than being potentially fined, caned and/or imprisoned, you will also be very unlikely to be granted a visa again in the future.
Answer: Multiple entry visa is a business pass working not allowed on this pass and 1month + 1month extend and one re- enter total...3month
Comment: Do you have any links or sources to back up this statement?
Comment: Also, please write in full sentences. I can't understand what you're saying.


Season 2: What is so important about the bridge?

Question: I'm just about the second season of house of cards and I'm asking myself: What is so important about that bridge Feng wants to be build? He has already so much money and it seems not to be worth for him? What are his advantages if the bridge is going to be build?
Comment: In episode __2x07__ Feng explains to Doug: _I have allies who want the bridge. Without it they become my enemies._  - Feng has been put on trial for corruption twice already. He needs friends in high places to _"not disappear"_.
Comment: @Oliver_C You should post that as an answer.
Comment: I'm not sure, but I believe his country (China) wants it built and he doesn't want to upset them as the next time he gets investigated for corruption, he will be executed. I think he is protecting his neck on this, so is pushing for this to be built.
Answer: To Xander Feng, the bridge is nothing but a favor to his allies and friends.
In episode 5, the Vice president met him in a trade summit. When they're talking about the projects to be approved, the VP mentioned the Long Island Bridge; Feng stopped the conversation and asked a favor: to continue the lawsuit in the World Trade Organization for currency manipulation. Frank discovered that Xander Feng and Raymond Tusk are trying to manipulate the trade summit. Frank specifically notify that the bridge is very important to the administration but to Feng is only "appearances" to maintain.
What is really important to Feng is to start the Refinery project with Clayton West (Tusk's industry). This hypothesis reinforces when in Episode 7; some strange donations is starting to appear and is used in bad propaganda for democrats in face to midterms elections. Underwood discover the Feng-Tusk scheme and send Douglas Stamper to negotiate with Feng one more time; Feng asked to start ASAP the Long Island project. Remember, Feng is the one who rejected the bridge project in episode 5 after the chaos in the summit and Douglas asked why this strange change of mind but the reason was the simplest:

 Xander Feng: I have allies who want the bridge. Without it, they become my enemies.

So again, the bridge is nothing to Xander, the refinery is the big fish.
Comment: Congratulations, this answer is the winner of the [monthly answer challenge](http://meta.movies.stackexchange.com/q/1795/49).


Why is fruit dropping from my apricot tree?

Question: Our apricot tree is about 15 years old. The tree bears flowers and then fruits, but as the time passes all the fruit drops from the tree.
Comment: If it's not pest damage, the tree probably isn't getting enough water
Comment: Welcome to the site sadik! We need some more details in order to best help you. Where do you live? How mature do the fruits get before they fall off?  Is this a new problem? Would you please post a picture or two of the tree? Our site is different from others you may have seen. A look around the [help] will help you understand why we're asking these things. [Ask] is a good place to start. We're glad you're here and hope to be able to help you with your tree!
Answer: Our apricot tree sounds as though the environment could be a residential setting and The tree bears flowers and then fruits sounds as though this might be an annual occurrence. Hence an alternative to lack of water, from Kristi Waterworth may be of interest:

Why Apricot Fruits Fall from Tree
Apricot fruit falling off your tree
  happens because most trees produce significantly more flowers than
  they need. The odds are that these flowers won't all be successfully
  pollinated, so the extras are like insurance for the apricot. In a
  residential setting where conditions are easier to control, these
  extra flowers are regularly pollinated and too many fruits set. The
  stress of so many fruits causes apricot trees to shed fruits -
  sometimes twice! The main shed comes in June, when small, immature
  apricot fruits fall from tree, allowing the remaining fruit more space
  to grow.
Managing Apricot Fruit Drop
As with peach thinning, you can hand-thin fruits to prevent them from
  falling off apricot trees unpredictably. You'll need a ladder, a
  bucket and some patience; it can be time consuming, but hand-thinning
  is a lot easier than trying to clean up the mess after a fruit shed.
  Remove maturing apricots from branches, leaving two to four inches between
  remaining fruits. This may feel like dramatic thinning, but the fruits
  that result will be larger and fleshier than they would have been if
  they were left alone.
Apricot Scab
Although fruit drop is a yearly event for most apricot trees, apricot
  scab, which also affects peaches, can also cause fruits to drop. This
  apricot disease leaves fruits covered in tiny, olive-green spots
  measuring 1/16 to 1/8 inch long. As the fruit expands, the spots do
  too, eventually merging into dark blotches. These fruits may crack
  open and drop prematurely. Fruits that ripen fully are often only
  superficially damaged. Good sanitation, including complete harvest of
  all fruits and clean-up around the base of the tree during and after
  fruit ripening, can help destroy the organism. A broad-spectrum
  fungicide like neem oil can destroy the fungus if applied after
  harvest and again when buds set in the spring.


Internet of Things Cloud - Developer Edition

Question: I am currently doing the trailhead module on IoT cloud and trying to access it throught the developer editon... I have trawled the web for this, but cannot find any resource. Is it currently available through a DEV account?
Answer: I don't believe it is currently possible to access the IoT cloud in developer edition orgs - as at Spring '17.
I'm basing this on:

Having never seen such a developer org to date
That the IoT Cloud Design and Rollout Trailhead module only has Q&A assessments rather than checks against an IoT enabled org. Trailhead would typically favor real tests over Q&A where possible. Especially for an advanced module.
It's a paid feature that you need to access via your Account Executive, which a Developer Edition org doesn't have. Source - Need access to IOT cloud demo org
Comment: Hi @DanielBallinger Are there any updates regarding this? Is there any way to get a trial version of IoT Cloud for 30 days? Any idea?
Comment: @SE_User I still haven't seen it in the wild or as something that developers can request access to directly. If you have a production org I'd suggest contacting your Account Executive for the next steps.
Comment: Oh ok, thank you. :)
Answer: Salesforce IoT Explorer is now generally available as of W'18 and available in developer editions. I wrote two blog posts to help people get started and see how it fits into a larger IoT strategy:

Using IoT Explorer to Power Your Digital Transformation Projects
Expanding Your IoT Explorer Prototype
Comment: These posts are great - more information than I was able to find on any official Salesforce site.
Comment: Careful not to be too overly promotional. These posts look relevant (at least according to their titles), so I won't take any action here. Just be careful to not have *all* of your answers link to your own blog posts. Your contributions will also be much more helpful and less spammy if you can cite some relevant content *here* so visiting the links is not strictly necessary to glean what useful information you are trying to provide.
Comment: Yeah, I hear that. It would take a lot of copy/paste to bring the content over here though. I could have provided a bit more info here on how to enable in W'18 orgs and then had a slightly seemingly promotional structure for my links. Thank you for the feedback.


Batch API to process millions of records

Question: I need to run Batch API on a huge dataset. Specifically I have a custom table with a lot of rows which I need to iterate over. The batch process works fine using small numbers. When using the full set I run out of memory before it even starts because I am loading a very large array of IDs to pass in to the batch function. Think of a 5 million item array. What is a good way to handle this? Break it into smaller chunks somehow to then pass in to Batch API? Increase the memory limit to an (ungodly) amount?
Comment: You may also want to consider the Queue API rather than the Batch API. This will be a little more reliable, and not require browser interaction.
Comment: The batch should be batched, don't try to do millions in one batch callback. Increasing the memory limit beyond 256MB will not have much effect.
Comment: I've processed millions of records using Batch API, the trick is only loading it a couple of hundred records (or whatever's appropriate for your record size) at a time.
Comment: Five million numeric IDs shoudln't really be enough to collapse your system. Are you sure the array is containing only IDs? If it is, then you could try increasing your memory, or if that's not possible, query your IDs in batches themselves.
Comment: One "gotcha" I've run into with Batch API is that even a single Warning message being logged will cause the memory to run out. I would double check your Watchdog logs and make sure you're getting zero notices, warnings etc., because even 1 notice per record processed can put you into memory hell!
Answer: Add a column for 'processed'. Each time you run the batch process select rows with a limit of 100 unprocessed rows for you batch process and then mark each row as processed.
You could run this on cron or something or run a nested batch.


Smartphone bought for business use - Canada

Question: I (as my corporation) bought a high-end unlocked smartphone (not under any carrier contract). My question is how this should be reported under Canadian tax rules. Must it be treated as an asset to be depreciated, or can it be treated as an office expense? I am assuming the monthly carrier charges are OK as telephone expenses.
Answer: Explained in T4002.  http://www.cra-arc.gc.ca/E/pub/tg/t4002/t4002-e.html

If you buy a computer, cellular telephone, fax machine, or other such
  equipment, you cannot deduct the cost. You can deduct CCA and interest
  you paid on money you borrowed to buy this equipment that reasonably
  relates to earning your business income. For more information on CCA,
  see Chapter 4.

It sounds like a class 8 for CCA if you follow the links.

Class 8 with a CCA rate of 20% includes certain property that is not
  included in another class. Examples are furniture, appliances, and a
  tool costing $500 or more, some fixtures, machinery, outdoor
  advertising signs, refrigeration equipment, and other equipment you
  use in business.
Photocopiers and electronic communications equipment, such as fax
  machines and electronic telephone equipment are also included in Class
  8.
Comment: @ChrisW.Rea You're probably right, I just searched the page for phone, however there is a concept of terminal loss if you junk something.  Also, I noticed the op said corporation, the same concept applies but on form T2 Sched 8.
Comment: @AnthonyX Class 50 is probably as good as it gets. Taking a full deduction in the year of purchase wouldn't be reasonable. As far as I'm aware, you can't do a full deduction for computer hardware worth more than $200 -- CCA applies instead, at the prescribed schedule.
Comment: +1. But, is a smartphone first a computer, or a telephone? If computer hardware, wouldn't the CCA rate be much more advantageous? For the "telephone equipment", 20% implies a lifetime of 5+ years... unlikely for most people who use smartphones. Computer life time is more apropos, no?
Comment: i.e. class 50 @ 55%?
Comment: Because it will rapidly become obsolete and probably even unsaleable, it hardly seems like a business asset. That's why I'd rather not spread the expense via CCA over who-knows-how-many years and take the full cost in the year purchased.


why "too good" is wrong?

Question: I have an example
"I love it here in NY. It's too good."
I know that it should be "very good" or "so good" but I don't know why "too good" is wrong.
Comment: It is really informal, but who said it is wrong? A phrase with a similar meaning might be "It's too good to be true", meaning it is beyond your expectations.
Answer: I wouldn't say it is wrong - but it depends on what you mean to say.

Too good

Means that it is "better than good".
On the entire good-scale, ranging from fairly good (1) to extremely good (100), "Too good" would be above the scale (100+).
Did that make sense?
Comment: **Too good** can have a negative sense.
Comment: Sure - depending on usage. `You are too good to me` as opposed to `Too good to be true`.
Answer: "Too good" is not wrong.  It is a hyperbolic expression that means really really good.  However, you would use it conversationally or in creative or informal writing.  You should not use it in academic writing.
"Too good to be true" is an expression that means something shouldn't be trusted. It means that something is not as good as it seems and there must be hidden problems.

why "too good" is wrong?