Cyclops Visor Material and beam color

Question: This question has several parts, so it may need to be split into a few questions. I know that Cyclops visor aperture is made of a mixture of powdered ruby-quartz.   Has he ever tried using a different material for the visor, and if so did (or would) that change the color and EM wavelength of his optic blasts?
Answer: Cyclop's optic blast is not electromagnetic energy so its signature color has never changed. Nothing is known about the dimension from which the red kinetic energy is released. It is the same color even when he does not wear his visor.

Ruby quartz crystals resonate at the same frequency as the psionic field that protects both Cyclops and Havok from their own powers.
The beam is a kinetic energy coming from an other-dimensional aperture focused over his eyes. A traumatic brain injury prevents him from controlling the aperture so he needs the visor to compensate.
As to whether other materials are more or less effective, I suspect Professor X tried many things before settling down with the ruby quartz he uses today. Unfortunately for Cyclops, ruby quartz is rather rare, so it is fortunate he does not need much. On Marvel Earth-616 there is sufficient supply for it to be used in a variety of technologies used by agencies such as SHIELD.
While ruby quartz was selected, there is little reason another variety of quartz could not function in a similar fashion since the difference in coloration is merely the addition of trace elements within the quartz crystals.
Comment: Back in the day...It was just called a ruby quartz visor. I suspect, as often is the case, when science caught up with the X-men, people began to question whether it was quartz or ruby-quartz. In the end, it doesn't really matter since it is just a special effect (it helps keep his power under control) it doesn't add anything or subtract anything. It is assumed he will have the resources to get or recreate the material as needed and keeps a supply on hand (just in case). What I always wondered about was his RQ contact lenses. How did he put them on without opening his eyes first...
Comment: Ruby quartz is a type of quartz. It is not made from a combination of ruby AND quartz. It is a particular type of quartz. If they were saying it was an amalgam of ruby and quartz, they should have been writing it as ruby-quartz. Since they haven't I am forced to assume it is a particular type of quartz with ruby as a designation of its color type such as [rose quartz](http://en.wikipedia.org/wiki/Quartz#Rose_quartz).
Comment: So it's the quartz that is vibrating at his psionic fequency not the Ruby, or is it a combination of the two?
Comment: the Marvel Comics Database does have it listed as Ruby-Quartz however Wikipedia has it without the hypen.  I found an article that states that Ruby Quartz has only recently been discovered and most "Ruby Quartz" is synthetic in nature because true Ruby Quartz is extremely brittle

Cyclops Visor Material and beam color


Where to encash American check in Australia?

Question: Where/How can I encash a US Treasury check in Australia ?
Of course, for the least fee.
Comment: I see there is a close vote for this question. I personally think it's OK but explaining how it is relevant to expatriates could perhaps be useful.
Comment: Is this different from any other kind of US cheque? Also, I wonder if Money.SE mightn't be a better home for this?
Comment: I am posting it in the expatriates site because I hope to find more than one person who moved away from America and has received tax returns in a check. And what are the ways one goes about encashing them. I checked with my local bank and they said they have never dealt with this before but looked up a few books and said "you can get your money in 20 weeks mate" - which is a lot of time
Comment: @Gagravarr: At least within the US, Treasury checks are handled specially; there are different rules for depositing and clearing them (including shorter hold periods).  I suspect it probably won't make a difference in this case, but it is certainly worth mentioning.
Comment: http://money.stackexchange.com/questions/22535/how-can-i-deposit-usd-money-in-my-australian-checking-account-while-incurring-as
Answer: I've deposited Treasury (tax refund) checks twice in Melbourne, at the bank (nab). Once they insisted in locking it up for three months, and once I got the money in a few days. Same bank, same branch, similar amount. No idea why but didn't want to ask too many questions :)
The bank takes a fee of about $15 AUD - I don't know if you can get a better deal elsewhere.


operate in internet gateway mode to relay data - windows

Question: I want to write a general solution to relay data that comes from different application protocols to a proxy (socks and or/http) in order to do web filtering. Are there any open source projects for windows that do that ?
Answer: Check out cntlm.  Here's the link:
http://cntlm.sourceforge.net/
It's main selling point is that it does NTLM authentication, but it also works well as a general-purpose proxy.  It also has a gateway mode that allows it to proxy network traffic to another proxy server.


Is "Unless you had told me about Sue's hair, I wouldn't have noticed it" correct and natural-sounding?

Question: I find it natural to say "If you hadn't told me about Sue's hair, I wouldn't have noticed it", but when if-not is substituted with unless in this specific sentence it sounds weird.
I've found a similarly-constructed sentence that for some reason sounds more natural:
He wouldn't have survived unless a stranger had rescued him.
But I can't pin down the specific reason why the latter example sounds more natural to me. So is there a difference that makes the second example more correct or is it just that my English instinct is a little off on this one?
Comment: I don't like *he wouldn't have survived unless a stranger had rescued him* that much, either.
Comment: Now that I take another look at the sentence, I find that awkward as well.
Comment: "If you hadn't told me about Sue's hair ..."
Answer: What is wrong is that this is a situation where you can't use unless. From Oxford Dictionaries Online,

unless: Except if (used to introduce the case in which a statement being made is not true or valid):
  unless you have a photographic memory, repetition is vital.

In your example, the statement "you had told me about Sue's hair" is presumably indeed valid, so it can't be introduced with unless.
Comment: That makes sense. Thanks! It's just that while researching into this topic I came across a few websites/forums that say you can use "unless + Subject + had" to mean "if + Subject + hadn't". One of the articles even gave an example: "They wouldn't have come over unless we'd invited them" = "They wouldn't have come over if we had not invited them." I guess that's wrong, too?
Comment: *"They wouldn't have come over unless we'd invited them"* is perfectly fine if they didn't come over (and in fact, it implies it). And *"They wouldn't have come over if we hadn't invited them"* implies that they did come over.
Comment: And in cases with general truths, like *"Birds will sing if there are no hawks nearby"* or *"Birds will sing unless there are hawks nearby",* *unless* and *if not* are equivalent.
Answer: This is gramatically incorrect, because it lacks parallel construction (here's a Wikipedia link).
Briefly put, linked items in a sentence should have similar grammatical forms.
In

Unless you had told me about Sue's hair

the verb had is not negated, but in

I wouldn't have noticed it

wouldn't is negated.
The alternative you give

If you hadn't told me about Sue's hair, I wouldn't have noticed it

does not have this problem, and is the correct construction.
Comment: There's no grammatical requirement for parallel sentences to be ***that*** parallel. Can you show me anybody who criticizes Tennyson's line from *Ulysses* "to strive, to seek, to find, and not to yield" on the grounds that it is insufficiently parallel? Or any reference saying that adding a *not* to a parallel structure makes it ungrammatical, for that matter.
Comment: -1: I don't believe there is any grammatical requirement for consistency with negatives in parallel structures in English. As a native English speaker, I don't find this kind of inconsistency ungrammatical, as I do other kinds of inconsistency in parallel structures.  Do you have any references that say this is ungrammatical, as I asked you for in a previous comment?
Comment: It's more than a little silly to language-lawyer English as if it were C++. There are no absolutely absolute absolutes; it's all a matter of degree. The Tennyson line is poetic license, and you could say the "parallelism" comes from the poem's meter. Introducing "Unless" in the second example creates a double negative, so in balance it's worse than the non parallel construction.
Comment: The [Purdue Owl](https://owl.english.purdue.edu/owl/resource/623/01/) website specifically gives as an example of good parallel structure something that would be considered ungrammatical per your answer. See the first example in Clauses: *The coach told the players that they should get a lot of sleep, that they should **not** eat too much, and that they should do some warm-up exercises before the game.*
Comment: Again: English. Not C++.    In OP's original example, there is nothing else to link the two clauses _except_ the negation.  In all of your examples, there is something else.
Comment: So you're not actually going to be able to find a reference saying that this is ungrammatical, are you?
Comment: I'm not even going to try; you're overthinking it.  Over and out.


What should be the unit of mass while calculating centre of mass?

Question: Can it be in any unit ?
Can it be in grams,
Kilograms or
Unified atomic mass( to calculate centre of mass of a compound)
Or should I convert them to kg and then proceed?
Answer: It doesn't matter. The centre of mass depends on the ratio of the masses so as long as you use the same units for mass in your calculations the result will be the same.
Answer: I dont see how the choice of units can matter in any calculation whether it be centre of mass or not. See unit is just an internationally accepted standard to measure quantities. However if I want to use some regional units for the same purpose, it would not make any difference. For example, whether I measure the length of a road in miles or metres or some other unit, the length of road will still remain the same!
Anyway for the purpose of centre of mass (or any other calculation), it is always preferred to use SI unit (kg, in your case). However, it would hardly make a difference even if you took it in grams or a.m.u. or pounds or whatever.
Answer: The concept of center of mass tells you about the position of the combined mass of the bodies in a system  . And it is calculated using this formula
$r_{cm} = \frac{m_1r_1 + m_2r_2 + .....}{m_1 + m_2 + ...}$
So both the numerator as well as the denominator have mass . So it doesn't affect the $r_{cm}$ and you can take any units of mass in consideration but remember to use one unit at a time only i.e don't take different units for numerator and the denominator.
Hope it helps ☺.
Answer: This is the CM equation (for 2 body's)
$$R_{CM}=\frac{m_1\,r_1+m_2\,r_2}{m_1+m_2}=
\frac{m_1\left(r_1+\frac{m_2}{m_1}\,r_2\right)}{m_1\left(1+\frac{m_2}{m_1}\right)}=\frac{r_1+\frac{m_2}{m_1}\,r_2}{1+\frac{m_2}{m_1}}$$
the equation show you that the unit of the mass cancel thus the CM unit is the unit of $r_i$  for example $[m]$
General case
$$R_{CM}=\frac{r_1+\frac{m_2}{m_1}\,r_2+\frac{m_3}{m_1}\,r_3+\ldots+\frac{m_n}{m_1}\,r_n}{1+\frac{m_2}{m_1}+\frac{m_3}{m_1}+\ldots+\frac{m_n}{m_1}}$$


Differences between reconstruction- and generation-level variables in HEP data

Question: I am working on a CMS - related project where the ROOT trees contain both reconstruction-level and generation-level particle variables (like mass). However, I don't know the basic difference between the two or when we prefer using one type of variable over the other?
Answer: Real data goes
$$\text{Collisions} \to \text{Detector} \to \text{Trigger} \to \text{Reconstruction}$$
Simulated data goes
$$\text{Event generator} \to \text{Simulated detector} \to \text{Trigger} \to \text{Reconstruction}$$
Generator-level is the information from the first step, before the events are passed through the simulated detector. This is also sometimes called "MC Truth" or "Truth level".
Reconstruction-level is the information from the last step, after the reconstruction algorithms have been run over the data from the simulated detector.
You can compare the two in order to quantify things like efficiencies and resolutions.
Answer: What follows is basically a guess based I my experience with several experiments (not one of which was at a collider; all fixed target and neutrino stuff).
I don't know the CMS data, but presumably if you have "generation level" quantities you are looking at Monte Carlo, yes?
If so this will be a kind of record keeping that is useful for both debugging the simulation and for providing functions to deduce the underlying physical distributions from the measured distributions (which include FSIs, multiple scattering, errors in clustering and so on). Most simulations picks some "true at vertex level" quantities, and then manipulate (and possibly weight) them to get the "as measured" quantities which appear as if they were data.
"Generation level" would be the former.
Answer: I will continue from dmckee's answer, again guessing you are working on a Monte Carlo generated set.
The monte carlo event generator , generates the event from basic quantum mechanical calculations, it is a method of getting at the integrals of the plethora of Feynman diagrams for proton proton scattering . It is the ideal event. The detector simulations  are necessary to get at specific numbers, the energies and momenta of the particles generated at the generation vertex, as the detector degrades them, so as to compare with the real measurements. The final numbers are the reconstruction level variables, to be compared with the measurements from the detector.
This could be a nested definition: a gamma hitting the electromagnetic calorimeter treated as generated and the summed energy in the calorimeter as a reconstruction, because at each subdetector the simulation assumes primary interaction from theoretical formulas and generates what the reconstruction should look like.


0xc000007b error on Windows 7 64

Question: I recently had to reinstall Windows 7 64 (my hard disk died) and i'm building a project of mine with vc++ 2013 but when i run it i get a 0xc000007b error
I found out that this error for 32 bit applications is commonly due to loading 64 bit dlls instead of the 32 bit versions
So I'm trying to figure out what's going on and I tried with Dependency Walker, but the only errors I see when I open my exe with it are those files missing:
API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-1.DLL
DCOMP.DLL
GPSVC.DLL
IESHIMS.DLL

I doubt that's the problem though, those errors seem to show to a lot of people and I guess I should ignore them
The rest of the dlls seem to be ok and 32 bit, so that would appear to be fine
I tried to find out something more using the profiling option on dependency walker but it hangs after loading a bunch of dlls, I doubt any information from the profiling log is helpful but i post it anyway (i can't copy it from the Dependency Walker window cause the process is not responding at this point)
I've read in another stack overflow post that this problem might be fixed in a 2.2.8288 version of Dependency Walker that I was not able to find
I tried to uninstall and reinstall the vs 2008/2010/2012/2013 redistributable packages x86/x64 to solve the problem as someone suggested in other posts about this error but that didn't work
At the moment I have no idea how to figure out why is it happening, any tip would be helpful
Edit:
I tried the latest Dependency Walker version installing it from WDK as suggested, but it suffered the same issue
I'm trying with Process Monitor too and I have a list of the dlls loaded. I checked the list with a script that runs dumpbin on the file to check the architecture just to be sure, this is the result, it seems ok to me, the only x64 dlls are wow64 dlls, that should be fine, am i overlooking something?
Comment: Don't use Depends, SysInternals' Process Monitor can show you what DLL it found.
Comment: the latest depends.exe (2.2.9600.0) is part of the Windows 8.1 WDK
Answer: This is an old question I know, but because I experienced same error this week and have spend a lot of time to find the cause (repair, reinstall Visual Studio, recompile dependent DLLs,...), I share my solution here.
The 0xc000007b error sometimes occurred due to a DLL conflict. One of imported DLLs is imported from other location than you expected.
For example in your question there is a second copy of GPSVC.DLL on your path that is loaded and made the 0xc000007b error.
You can find the DLL location with where console command and see if a second copy exists or not:
> where GPSVC.DLL
C:\path\to\another\copy\GPSVC.DLL

0xc000007b error on Windows 7 64


C# h323 calls with gatekeeper

Question: I am looking for a simple voip lib (.net or .net frendly) to make calls using h323 with gatekeeper (I have hardware gatekeeper). My app must call a phone number and play an audio file when the user answers. I found a few libs but they are too big and costly.
Comment: http://www.codeproject.com/Articles/17048/Examples-to-create-your-Conferencing-System-in-NET
Answer: There are only very H.323 libraries available and to my knowledge none of them supports C# directly.
The only 2 OpenSource libaries for H.323 are H323Plus and OPAL. Both are C++. OPAL also has a limited C API, but in my view H323Plus is the better H.323 library.
Commercially there is H.323 stack from Radvision, but as far as I know it also only supports C / C++.
All of these libraries can easily register and make calls with a gatekeeper.

C# h323 calls with gatekeeper


Ability to add tag to favorites/ignore list within tags

Question: It would be nice to be able to immediately add a tag to your favorites or ignore list, from the tag itself (by dropdown, context menu or even drag and drop).
Answer: It is already available! Just hover on any tag, you will get option to toggle the tag between favorite, ignored and normal.
Comment: Silly me for not seeing that... thanks!
Comment: The only problem with this (imo) is that when ignoring, it ignores only `tag`, and not `tag*`, which is what I prefer... so back to square 1 for me!


Do UK Academic Journals Generally Use Formatting Styles Based on APA, MLA, or Chicago?

Question: I'm working on an online formatting problem with a UK programmer who is not familiar with academic style requirements. The styling problem in one that is frequently encountered in APA and some Chicago-based style guides—both style guides that originated in America (U.S.). I'm wondering if UK journals also use styles based on these two American style guides.
Comment: I suspect that this is more a matter of academic discipline, not of country. In my experience (math/CS) a journal is providing the bibtex style file they want authors to use, and then you just use that. I only know of APA/Chicago due to questions by confused undergrads.
Comment: Arno is right; country and citation style are not related.
Comment: My formatting problem is for an online journal that published the lay theological research of a [PhD who was a bacteriologist and biochemist](https://worldviewpublications.org/outlook/pages/jdzwemer.php), so the formatting doubtless reflected his academic writing. It contains what APA and Chicago call [run-in headings](https://owl.excelsior.edu/citation-and-documentation/apa-style/apa-headings/) (levels 4 or 5), which are difficult to style online with [W3C](https://www.w3.org/standards/) styling tools. I was curious if this was a problem in the UK as well as the US.
Answer: I've published in a mix of journals including some based in the UK.
I don't think I've encountered one yet that uses APA or Chicago or any other specific style guide; they all come up with their own, which may be loosely or closely based on some other guide (if one of them has used APA or Chicago it must not have been very notable at the time, though). I don't think it's possible to say "generally" for anything regarding citation format styles, particularly across fields.
Comment: Thank you. Good answer, and I appreciate that you are speaking from experience. The programmer is thinking about writing an article about the issue we are working on, and I got to thinking that maybe it's not an issue in the UK. But since, as you say, every journal has it's own rules (as is also true with most US-based journals), I suspect his article would be useful in at least some circumstances on his side of the Atlantic. And it would also be useful for UK academics who write for US-based journals.


Can I prevent an Active Directory account from locking out?

Question: Is there an ADUC setting that can prevent certain user accounts from locking out, particularly after x number of failed logon attempts?
Oh and our DC is on Server 2003 at the moment, but we also use Server 2008 DC's in other environments.
Answer: You can do it but you still need a GPO.  Create a GPO that has the necessary settings, then eliminate the "apply group policy" right from the ACL.  Create a group that you want to have eliminated from password lockouts, add your user(s) to the group, and assign that group the "apply group policy" right for your GPO.
Remember that GPOs are applied in the following order:
Local
Site
Domain
OU
so be sure to apply your new GPO at the correct level so it's not stomped on by something below it.
Comment: Yup. It seems like this is the way to go (we tried it and it worked).
Answer: A preferred approach would be to move off of your Windows Server 2003 DC's and configure your domain for Windows 2008 functional level, you will be able to take advantage of one of the new features of Windows Server 2008: multiple password and account lockout policies.
AD DS Fine-Grained Password and Account Lockout Policy Step-by-Step Guide
http://technet.microsoft.com/en-us/library/cc770842%28v=ws.10%29.aspx
How to raise Active Directory domain and forest functional levels
http://support.microsoft.com/kb/322692
Comment: cool.  good to know.  I think the DC is one of about 2% of machines in the domain still on 2003.  :)  It'll be upgraded someday (right?)
Answer: You should ask this on serverfault.com, although a quick answer is http://technet.microsoft.com/en-us/library/cc781491(WS.10).aspx
Comment: You can't do it at an account level, you'd have to put the users in a group and then apply the policy to that group.
Comment: I appreciate the suggestion to move to Server Fault.  Your link, however, is for computer and domain objects, not users.  Further, Creating a GPO for the user with its own lockout rules is an option, but I am looking for a way to do this on individual accounts, effectively overriding a GPO.
Answer: I can't help but wonder why you don't simply allow blank passwords for those accounts. It's near enough the same (lack of a) security level as allowing unlimited attempts. Alternatively, you can either apply a separate GPO to those accounts that allows the maximum number of password attempts (whatever that number might be) or simply set as short a lockout time period as possible so that the account unlocks quickly enough that they don't really notice.
Of course the ideal solution would be to get these people to actually remember their passwords but I'm guessing these are senior managers.
Comment: These aren't senior managers.  These are service accounts in a testing environment.  They need real passwords to simulate production functionality, but they are constantly being pounded by devs trying stuff out.  The domain itself cant have a GPO without proper security because the rest of our real accounts are in there.
Comment: In practice there is a large difference in security between unlimited tries (you have logging and intrusion detection to flag this, right?) and no password at all.   Also, the problem is more than just dumb users not knowing their password - You can miss *one key* by accident, and a misbehaving client or service will automatically try it a few times, just to be sure. I've seen accounts lock after only 3 tries, which is just ridiculous.
Comment: *rolls eyes* And why is it that you always seem to be resetting the passwords for the same users, week in, week out.
Comment: @Mark, I think there must be an oxygen shortage near the top of the corporate ladder. ;)
Comment: @Bob, you no doubt have a policy applying to the OU these accounts are in but by using filtering you can still have a different (or additional) policy apply to specific accounts.


Samsung Smart TV SDK Documentation

Question: I've recently started developing some small apps on the Samsung Smart TV SDK.
I've been searching for some guide/introductory documentation on the SDK, to no avail.
http://www.samsungdforum.com/Guide/ has a lot of specific examples, but no general information on the architecture of the SDK.
This (http://www.scribd.com/doc/51800086/2010-App-Development-Guide-for-Internet-TV-V1-09) is the only thing I've found, but its outdated.
It uses the /CSS /JavaScript /Resource config.xml index.xml hierarchy, while it seems the "new" hierarchy of projects has changed (scenes etc)
Am I not searching hard enough or is the documentation a bit scarce?
Answer: See here for the SDK archives and release note for that.
http://www.samsungdforum.com/Devtools/SdkArchive
Look here for the guide

Samsung Smart TV SDK Documentation


Why operator `?:` does not have priority?

Question: After debugging I found that ternary operator ?: does not have priority. My question is why?
I have the following code:
bool T = true;
cout << ((T == true) ? "true" : "false") << endl;
cout << (T == true) ? "true" : "false";

Output:
true
1

live demo: http://ideone.com/Tkvt9q
Answer: The conditional operator does have a precedence (albeit slightly complicated by its ternary nature); but that precedence is very low. Since it's lower than <<, the second is parsed as
(cout << (T == true)) ? "true" : "false";

streaming the boolean value of T == true, then evaluating (but ignoring) the expression "true". Most compilers will give a warning, if you enable a sensible set of warnings.
Here is a reference to the operator precedences, showing << with a higher precedence (7) than ?: (15): http://en.cppreference.com/w/cpp/language/operator_precedence
Answer: The conditional operator ? : does have precedence - it's number 15 in this table, lower than << and >> operators, which are number seven.
The rule that I follow to avoid mistakes like that is to use parentheses when in doubt. The rationale is simple: if you need to look up the priority in a table, good chances are that the readers of your code, including yourself, would need to do the same thing at some later time.
Comment: +1 just for that rule. Too many programmers omit parantheses unnecessary for the compiler, but useful to human readers.
Comment: @AndyThomas There is of course a balance. Too many parens and you may as well write LISP
Comment: You always want to please the human reader god otherwise, his wrath might strike you.
Answer: A lot of the other questions answer why you are seeing that behavior but they don't answer why the ternary operator has low priority.
The decision was made to have low ternary priority because we don't want the code
a<d ? 10 : 100

to end up meaning
a < (d ? 10 : 100) //BAD: not what we normally expect

we want it to mean
(a<d) ? 10 : 100

Low priority for the ternary operator achieves this goal. This sort of thing is the whole reason for operator precedence that you find in languages. The goal is to make it convenient to write expressions that are expected to be normal in the language. Right? If not, it could just be left to right with parentheses. Which would be annoying to use and you'd quickly propose some sort of convenient operator precedence.
Comment: Thousands of LISPers would disagree with your last statement ;-)
Comment: I think the alternative solution used in LISP to the problem of precedence is excellent. Any design decision is a compromise. I can see how one would start designing syntax and go down the path of C->perl/python/ruby where you think "I'm going to design a great easy to use syntax". They have done a great job with choices like the precedence for the ternary operator. From the C position, LISP looks like it is dodging the question of precedence when from inside of LISP it is a total, simple, easily learned solution.
Answer: It is true that the ?: operator has no clearly defined priority. But the example in question does not really illustrate that. The relative priorities of << and ?: are rather unambiguous. All your example shows is that the priority of << is higher than the priority of ?:.
As for the more general issue of the priority of ?: operator... ?: operator has relatively convoluted format, compared to other operators: it has three non-uniform operands. Because of that non-uniformity the part before ? has different syntactic grouping properties than the parts after ?.
After all, "priorities" are a derivative trick invented to simplify visualization and memorization of syntactic groupings defined by the grammar. Not all C++ operators conform to that trick though. The ?: operator happens to be the one that does not, which is why a  properly written priority table will typically have a side note for ?: operator, explaining its unusual properties. Again, the part before the ? has different priority than the parts after the ?, which is why it is impossible to properly place the ?: operator into a linear table of priorities.
Unless I'm forgetting something, the ?: operator is the only operator without a straightforwardly definable priority.
P.S. Things with ?: operator were even worse in C. C++-related changes to the grammar made ?: to conform better to the idea of linear priority.
Comment: @bdesham: The classic, often quoted example is `a ? b = c : d = e`. In C it is parsed as `(a ? (b = c) : d) = e`, while in C++ it is `a ? (b = c) : (d = e)`. (See the "Notes" section of the page linked in Mike Seymour's answer)
Comment: I'm just curious—regarding your postscript, do you have an example of a ternary expression that would be parsed differently in C++ than in C?
Comment: I've often thought that the proper way to parse the "?: operator" would be to regard "?" as an operator whose second operand was a special compiler-internal type which was yielded by the ":" operator.  Likewise, in a language where relational operators do not work on Boolean types, relational operators could yield a special type which is implicitly convertible to Boolean, or can be accepted by another relational operator (thus allowing `x < y < z` to be parsed as "y is strictly greater than x and less than z" without weird gamesmanship in the parser).
Comment: @supercat The type of the ":" operation would not be special, it would be the type of either of its operands, or at least the type they can both be converted into, and that type would have to be compatible with whatever operator's going to be used next. `AST* term = bFloat ? new ASTInteger(0) : new ASTDouble(0.0) ;`
Comment: @cardiffspaceman: I would suggest that `:` should return an operand which comprises a *pair of code paths*, and that the `?` operator, given a `bool` on the left and the aforementioned special operator on the right, would invoke one of the code paths.
Answer: Like the other answers note, the << operator has higher precedence than the ? operator. Here is my opinion on why it is so.
Using bit-shift (<<) with the choice operator makes sense; for example
(T == true) ? (whatever << 1) : (whatever << 2)
(T == true) ? whatever << 1 : whatever << 2 // same as above

When the designers of C++ invented operator overloading, they decided to reuse the bit-shift operator << as a streaming operator. Had they introduced another, completely new streaming operator (e.g. <<<), it would get very low precedence, so the code would work as expected:
cout <<< (T == true) ? "true" : "false";

However, introducing a new operator just for it to be overloaded would undermine the idea of usefulness of operator overloading, which was a fascinating idea back then. So they decided to use an old (existing) operator.
Answer: The ternary conditional operator does have a precedence, except that it's at the bottom of the  list (value 15). Only throw and , (comma) have a lesser precedence. See this reference for C++ Operator Precedence.
Answer: because of brackets, firstly statement (T == true) is evaluated, then comes the left shift operator and 1 which was evaluated earlier is sent to cout. later, the ternary operator evaluates "true" but it is ignored.
all in all, ternary operator has precedence, but one of the lowest.
Comment: You're conflating precedence with order of evaluation, which is inaccurate. http://stackoverflow.com/a/5475260/179910
Comment: The edit makes the problem even worse. all of this is about precedence, not order of evaluation.


Why don't major browsers currently support TLS above version 1.0?

Question: TLS 1.0 seem to be vulnerable to Beast, Lucky13 and maybe other attacks and is simply outdated. Common workaround used e.g. by Google was to use RC4 which was also recently broken, but none of the major browsers seem to be implementing newer version of TLS, except Microsoft IE for newer Windows versions.
Is there a reason why there has been so little movement?
Edit: almost the same question. Why was it closed? Mystery on stackexchange.
Supported TLS versions at 2011-09-22

Do I think right that to avoid problems with TLS 1.0 you have to forbid it? This can take time.

I'll misuse my questions to answer Thomas Pornin because this doesn't fit into comment.
As usual, you write many letters :)

"RC4 breakage is still "academic"

Do you remember WEP history? 2001 only certain key patterns were vulnerable which could be excluded without changing the protocol, 2004 it was no more the case and 2007 only 40k packets were enough. Attacks never get worse, only better. And in real life, all updates need time, years will past till all servers update, although it's not so much like on soho routers. Can you predict with reliable probability when it will become realistic? About workarounds - are they backwards compatible? How long will they hold? Isn't it easier to use newer TLS version?

Upgrading client support to TLS 1.2 will not change anything at all until most servers are upgraded, too.

So upgrades need time, earlier we'll begin, earlier it's done.

comparison with IPv6

Well, with IPv4 you can predict when you are out of IPs. This depends much of the country - those who were first in internets usually have no problems :) Those who are out of IPs advance IPv6, like China.

In practice, several widely used browser rely on the SSL/TLS code of the underlying OS

Which ones O_o? I thought only IE does this, who cares about it with no working AdBlock.
Answer: The main reason why there is little movement is that the "breaks" are not practical enough to show up on radar.

BEAST does not work anymore. Firstly, it requires a way for client code in the browser (hostile Java or hostile Javascript) to emit cross-domain requests with a high level of control at the bit level; the two known ways to do that (a draft version of WebSockets, and a vulnerability in the Java VM implementation) have been fixed. Secondly, browsers and OS have added workarounds, namely the 1/n-1 split: whenever a TLS record is to be emitted, two records are sent, the first one containing only one byte of application data. This workaround prevents BEAST from being applied.
RC4 breakage is still "academic". It had been known for some time that RC4 had some serious biases. The recent results (March 2013) are some systematic measures which show that there are more biases than previously thought, so that an actual attack requires "only" observing a few millions of connections with the target secret always in the same place. While "a few millions" is rather low, it is still impractical, from the attacker's point of view, in a Web context. Thus, no cookie has been stolen in the wild through usage of RC4. Moreover, there are possible workarounds which are easier to implement in a browser.

Thus, there is no real incentive for a mass update of client TLS implementations. Indeed, browser vendors are accustomed to deal, on a weekly basis, with vulnerabilities which are much more devastating than that (typically entailing hostile hijack of the whole client system). A somewhat theoretical exploit of the cryptography in SSL is unlikely to be even noticed, let alone acted upon. What makes browser vendors move towards newer versions is the publicity which is made about these cryptographic attacks.
Moreover, and that's the important point, the protocol version which will be used for any given connection is constrained by what both client and server software support. Upgrading client support to TLS 1.2 will not change anything at all until most servers are upgraded, too. And, similarly, upgrading server support is not very useful until clients are upgraded. This is the classic Mexican stand-off, in which nobody moves, because it would require a massive simultaneous upgrade switch of several distinct vendors. For that matter, it is the same story as with IPv6 (which was scheduled for wide adoption in 2007).
In practice, several widely used browser rely on the SSL/TLS code of the underlying OS, so any mass upgrade will have to wait for the end-of-life of Windows XP (scheduled by Microsoft for next year).
Comment: See question update.
Answer: I am not sure what you mean by not supported. Currently the following browsers support TLS 1.1 and 1.2:

Chrome - v30 supports TLS 1.2. Previous to this only up to TLS 1.1 was supported
Firefox - v27 enables TLS 1.1 and 1.2 by default
Internet Explorer - v11 supports TLS 1.2 from Feb 2013
Opera - v17 has added support for TLS 1.2. Versions 10-12 supported TLS 1.1 and 1.2 but disabled it by default, and versions 14-16 supported TLS 1.1 but not 1.2.
Safari - v5 on iOS and v7 on OS X have added support for up to TLS 1.2.
Comment: TLS 1.2 is disabled by default in IE 10 and Opera...
Answer: BEAST has been fixed on modern browsers.
While people really should be moving to the newer TLS versions, there hasn't been a significant adoption of the newer protocols. There has been compatibility problems with servers that has not activated the newer protocols. See this link for more information. The article is almost a year old though, so there might have been improvements since that time.
One plausible reason for not shifting over to the newer TLS versions is that developers have been applying band-aids to the older protocols to fix any vulnerabilities is found. This obviously isn't sustainable in the long run. Hopefully the recent spate of attacks against SSL/TLS will push people to speed up the move to newer versions of the protocol.
Comment: <_There has been compatibility problems with servers that has not activated the newer protocols._> - you can still fallback to older versions. The problem is the clients.
Comment: @SmitJohnth "Firstly, there's the usual problem of buggy servers. TLS has a version negotiation mechanism, but some servers will fail if a client indicates that it supports the newer TLS versions." From the article I linked to. Like I said, the article is a year old though, things should have improved somewhat since then.
Comment: The link only talks about Chrome.
Comment: I've heard that Lucky13 was not fixed.
Answer: The reason Firefox does not support TLS 1.2 is because the security backend they use Network Security Services does not support it. An implementation is work in progress, see this bug report
Update: As of June 13, 2013 Chrome Canary now supports TLS 1.2 as the relevant bug is fixed now.
Comment: https://bugzilla.mozilla.org/show_bug.cgi?id=480514#c86 2013-05-24 21:14:19 _"Seems abandoned.
Sad really."_ lol
Comment: Comment relevant to a point in time.


Does being read to improve reading speed?

Question: So my girlfriend is not what you would call a fast reader. She understands completely what she reads, but she reads rather slowly. I'm trying to be a good boyfriend and help her out with this, but the only two things I can think of that would help are getting her to read a lot and maybe being read to. I know in my personal experience that being read to helped to improve my reading speed but I may just be an outlier.
I guess what I'm trying to say is this: "is being read to actually something that improves reading speed?" and "other than the aforementioned methods, are there other ways to improve reading speed?"
Comment: Most people [citation needed] can read much faster than they can speak. Unless we're talking about incredibly slow reading, I would imaging that being read to would end up being quite a bit slower.
Answer: There is no scientific proof that being read at an adult age enhances reading speed.
However, slow readers read faster when the format of a document is enhanced. Is your partner more responsive to a specific background color, a particular contrast or a particular font? Such visu-attentional factors play a fundamental role in our ability to read.
You may want to investigate the letter spacing effect for example. It has been shown that children with dyslexia read faster and with less errors when a paragraph is less crowded. Here are two paragraphs written with the exact same font (spacing between lines and spacing between letters are wider in the second paragraph, with an extra space between words).
Here is the image:

There is also a ton of other possibilities that can be tested using a word processor such as Microsoft Word (spacing is sometimes called kerning), or activating the Accessibility option in Mac's preferences. What you have to keep in mind is that, once you find a combination that feels OK, reading a lot makes you read faster.
REF: Zorzi et al. (PNAS, 2012). Extra-large letter spacing improves reading in dyslexia.
http://www.pnas.org/content/109/28/11455.short
Answer: I would recommend two solutions. One is that you learn to read for understanding not speed unless it is a fluffy novel. You can read fluff at light speed because there is nothing there to challenge understanding. You have to read differently for different subjects and types of material. A book that is an incredible help for learning to read different subjects and materials is http://www.amazon.com/How-Read-Book-Intelligent-Touchstone/dp/0671212095
"How to read a book: a guide to intelligent reading"
That is one solution the other is, figure out what substance might fix some sort of deficit of substances in the brain. For me having had schizoaffective I had a deficit of pregnenolone in my hippocampus. I learned about this substance by researching my illness and reading from others with similar experiences on the forums at forum.schizophrenia.com
So: If you think pregnenolone is in short supply then you could get it real cheap at great quality at pipingrock.com I only take half of a 50 mg dose. Do your research on this and other nootropics, that is what cognition enhancing substances are called, then experiment.
I was a slow reader, it could take me an hour to read a page in my academic text for social problems and solutions course and I would fall asleep and not read anything, now I can read anything without getting tired for hours because I found what my brain needed. Preg helps others with out the deficit too so it might be worth a try.
Answer: I can't see why simply being read to would improve your girlfriend's reading speed; after all, except for the possibility that she might thereby be exposed to more literary language than she usually encounters in speech, it would be little different from hearing someone narrating a documentary or describing something on the radio. (Here, I am disregarding the benefits from potentially  strengthening the bond between you in the course of reading to her.)
Without knowing exactly why your girlfriend's reading speed is low, I can only make the preliminary suggestion that if you do decide to read to her, you do so from your copy of the text in question, and have her simultaneously follow it in her own copy. That would at least give her the experience of (I assume) reading faster than normal without the pressure of struggling to decipher the words by herself at a rate that she would find uncomfortable or onerous, and perhaps begin to give her the sense that she could read faster if she wanted to, or if she actively decided to try to speed up her reading. It will, of course, help quite a bit if you are able to read aloud without stumbling, and can make your delivery expressive and engaging. It is also  highly desirable that the text you are reading is entertaining to her, and/or that it corresponds to what she finds interesting.
However, there are really some other questions that should be answered before you draw any conclusions about the best method for increasing her reading speed. For instance:
1) How does your girlfriend's reading speed actually compare with the average? Is it in the normal range, or is it exceptionally slow?
2) Does she noticeably struggle to read, or does she just read at a speed that is comfortable for her?
3) Does your girlfriend subjectively consider her reading speed to be a problem? Objectively speaking, is it an obstacle in some necessary aspect of everyday life?
4) If she struggles to read, what is the underlying reason? Is it merely lack of practice, or does she have dyslexia or some other cognitive obstacle?
If there seems to be some reason to suspect the latter, then some kind of professional input may be required.
I hope this is helpful.
Answer: The way to improve your (or your girlfriend's) reading speed, is to, well, read faster.
There are courses available do this by forcing your eyes along a passage by either highlighting or displaying a word or groups of words for a set amount of time. As you progress through the course, the time between word groups gets shorter.
There are many resources online for speed reading courses. You should be able to find free courses pretty easily.
Another tool is http: // www . spritzlet . com (I don't have the rep for this link), which will display single words for a user-set amount of time. This tool is very useful, since it also highlights the middle of the word, increasing shape recognition.
These tools can also help her get a baseline for what other answerers have mentioned: How is her average speed in general? Google says 300 words per minute is average. That's just a little bit more than a full page of double-spaced, 12-point text on a letter-sized page.
I will tell you that reading quickly has less to do with comprehension in general and more to do with word recognition. How many times have you read a page in a book, but not absorbed it? Have her read this paragraph. If she can do it (even slowly), then she probably doesn't have a problem with word recognition.


Cakephp 2.0: complex find query

Question: I'm trying to pull some info out of two tables linked by the hasMany and belongsTo associations.
requisitions hasMany locations and locations belongsTo requisitions
TABLE `requisitions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`fecha_generacion` date NOT NULL,
`solicitado_a` varchar(60) NOT NULL,
`proyecto` varchar(150) NOT NULL,
`obra_no` varchar(11) NOT NULL,
`observaciones` text NOT NULL,
 PRIMARY KEY (`id`)
)

and
  TABLE `locations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `requisition_id` int(11) NOT NULL,
  `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `name` enum('pendiente','tecnico','existencia','cotizando','generar_o','archivada')
   NOT NULL DEFAULT 'pendiente',
  `image_path` varchar(150) NOT NULL DEFAULT 'estado0.png',
  `note` text NOT NULL,
  PRIMARY KEY (`id`)
)

Requisition goes from one Location to another and I need to keep track of its current Location looking by a given Location as 'pendiente','tecnico'...
So I need to generate a list with the last Location for each Requisition and then filter that list by the Location.name
I believe the only way to do this is with a query around another query, so I'm trying to understand cakephp syntax with more simple queries first.
I was trying to search for the last 'pendiente' Location with the next code from my RequisitionsController.
$lastPendiente = $this->Requisition->Location->find('all', array(
 'conditions' => array('Location.name' => 'pendiente'),
   'fields' => array('MAX(Location.id) AS olderLocation', 'Location.requisition_id'),
    'group' => 'Requisition.id',
    ));

I have the query
SELECT MAX(`Location`.`id`) AS olderLocation, `Location`.`requisition_id` FROM `petrofil_demo`.`locations` AS `Location` LEFT JOIN `petrofil_demo`.`requisitions` AS `Requisition` ON (`Location`.`requisition_id` = `Requisition`.`id`) WHERE `Location`.`name` = 'pendiente' GROUP BY `Requisition`.`id`

output...
array(
    (int) 0 => array(
        (int) 0 => array(
            'olderLocation' => '22'
        ),
        'Location' => array(
            'requisition_id' => '29'
        )
    ),
    (int) 1 => array(
        (int) 0 => array(
            'olderLocation' => '5'
        ),
        'Location' => array(
            'requisition_id' => '30'
        )
    ),
    (int) 2 => array(
        (int) 0 => array(
            'olderLocation' => '13'
        ),
        'Location' => array(
            'requisition_id' => '31'
        )
    )
)

...which is great because those are exactly the last requisitions with a 'pendiente' location but here comes the second query or the condition where I'm clueless. I need to be sure my requisition last state was 'pendiente' and not another possible locations. For example my requisition_id =>30 last location is really 'tecnico' so I need to find a way to exclude it from showing on my results.
Answer: You could quit the condition from the query, put the 'name' column in the 'fields' and add an order by sentence:
    $lastPendiente = $this->Requisition->Location->find('all', array(
   'fields' => array('MAX(Location.id) AS olderLocation', 'Location.requisition_id', 'name'),
    'group' => 'Requisition.id',
    'order' => 'fecha DESC'
    ));

This way you only get the last status from the Location table. Then, you could iterate the results, filtering by the 'name' column and deleting those whit a 'name' diferent from 'pendiente':
foreach($lastPendiente as $k => $location){
if($location['Location']['name'] != 'pendiente'){
    unset($lastPendiente[$k]);
}

Cakephp 2.0: complex find query


Tensor Product vs Direct Product in QM

Question: Consider adding angular momentum. Shankar describes the state of the system as the direct product of states while Ballentine (and I think most other people) describes the state of the system as the tensor product of states. I assume Shankar isn't straight up wrong. Thus, I am a bit confused.
Comment: same thing, different name
Comment: @EE18 I would reconsider posting my email address on a forum in plain text.
Comment: That's not what google tells me. Of course, they are hopefully the same in this context, but I don't understand how.
Answer: $$\newcommand{ket}[1]{\left|#1\right>}$$
Physicists tend to be a bit loose with their terminology, for better or worse.  The correct notion here is the tensor product space, not the direct/cartesian product space (which is in this case equivalent to the direct sum).
The distinction between $\psi \otimes \phi$ and $\psi \times \phi \equiv \psi \oplus \phi$ is a distinction between the spaces to which those objects belong. Both objects are fundamentally an ordered pair of vectors, but the distinction between the tensor product $\otimes$ and direct product $\times$ / direct sum $\oplus$ has to do with how we combine and scale these ordered pairs via vector addition and scalar multiplication.

Given two vector spaces $V$ and $W$, we may construct the direct product space $V\times W$ whose underlying set consists of the ordered pairs $(v,w)$ with $v\in V$ and $w\in W$. The addition and scalar multiplication operations on $V\times W$ are defined as follows:
$$\times\text{-Addition}:\qquad (v,w)+(v',w') = (v+v',w+w')$$
$$\times\text{-Multiplication:}\qquad \lambda \cdot (v,w) = (\lambda v,\lambda w)$$
In practice, we often use the notation $(v,w)\equiv v\oplus w$ or, if we're being even more lax, $(v,w)\equiv v+w$.  Note that, for example, $\lambda(v \oplus  w) = \lambda v \oplus \lambda w$ is reminiscent of a distributive law.

On the other hand, the tensor product space $V\otimes W$ is a bit more complex. The underlying set consists of all formal linear combinations of elements of $V\times W$; in other words, an element of $V\otimes W$ takes the general form
$$\sum_i c_i (v_i,w_i)$$
for some collection of vectors $\{v_i\}$ and $\{w_i\}$ and scalars $\{c_i\}$.  The addition and scalar multiplication rules are also different:
$$\otimes\text{-Addition:}\qquad (v+v',w) = (v,w)+(v',w) \qquad (v,w+w')= (v,w) + (v,w')$$
$$\otimes\text{-Multiplication:}\qquad \lambda \cdot (v,w) = (\lambda v,w) = (v,\lambda w)$$
In practice, we typically use the notation $(v,w)\equiv v\otimes w$, or occasionally just $vw$ if the tensor product is understood to be implicit (I prefer to write $\otimes$ explicitly while I'm teaching the concept for the first time, and then drop it after it becomes exhausting).
A crucial difference between $V\times W$ and $V\otimes W$ is that every element of $V\times W$ can be expressed as some ordered pair $(v,w)$ by trivially applying the rules of addition and scalar multiplication.  This is not true of $V\otimes W$; there's no way to reduce $(v,w) + (v',w')$ down to a single ordered pair for generic $v,v',w,w'$.
Elements of $V\otimes W$ which can be expressed as a single ordered pair are sometimes called simple; the rest are non-simple, and through the lens of quantum mechanics, it is precisely the non-simple state vectors which represent entangled states.

Consider adding angular momentum. Shankar describes the state of the system as the direct product of states while Ballentine (and I think most other people) describes the state of the system as the tensor product of states.

Consider a composite system consisting of two spin-1/2 particles which are fixed in space (so their only degree of freedom is their spin).  The corresponding Hilbert space is $\mathbb C^2 \otimes \mathbb C^2$, not $\mathbb C^2\times \mathbb C^2$.
A generic element of the composite space takes the form
$$\psi = a \ket{\uparrow\uparrow} + b \ket{\uparrow\downarrow} + c\ket{\downarrow\uparrow} + d\ket{\downarrow\downarrow}$$
where $\ket{\uparrow\downarrow} \equiv \pmatrix{1\\0} \otimes \pmatrix{0\\1}$.  The fact that this cannot be condensed down into a single ket is an expression of the fact that we are studying the tensor product space rather than the direct product space.  More explicitly, we talk about entangled (non-simple) states of the form $\ket{\uparrow\downarrow}\pm \ket{\downarrow\uparrow}$, which would not exist if we were studying the direct product space.
Comment: @hft Indeed, thanks for the catch.
Comment: @Eric Can you clarify what you mean by the "typical" treatment? If you mean that the direct sum of two matrices is conventionally written $$\mathbf A \oplus \mathbf B = \pmatrix{\mathbf A & 0 \\ 0 & \mathbf B}$$then I would simply say that that's just a different way of writing $(\mathbf A,\mathbf B)$, where the addition and scalar multiplication of those pairs occurs element-wise as described above. Or did you mean something different?
Comment: Thank you! This was extremely informative and thorough. I especially apricated that you fully explained the nuances at play (and didn't discard the question out of hand). A point of clarification, you seem to indicate that we treat direct sum of two elements of vector spaces (so vectors) as elements of the cartesian product space of vector spaces. I assume this treatment recoverable from the typical treatment of direct sum of matrices or vector spaces. If so, can you direct me towards a way to demonstrate this for myself (If you want to explain it yourself, I am all for it as well, of course!)
Comment: That's exactly what I meant! I was thinking along the lines that you outlined. However, I wanted to make sure I was on the right track before I started playing with the formalism! Thanks again for the help!
Answer: There are a dozen questions on this site beating that horse to death. Might well start here.
Note in the lede of Kronecker product it is sometimes called "matrix direct product".
Physicists are practical people and treat m apples and n oranges the same way, whether they are plain sets, or arrayed into a pointless mn-dimensional vector where basis changes would be meaningless.
It is not going to kill you to promote (or, more hidebound, section 3 of this )  a direct product to a tensor product; so, for example, to organize m (e.g. 3) color and n (e.g. 2) isospin degrees of freedom into the same mn-vector, with an additive structure, where each orange is paired with the entire set of m apples, and stacked up into a huge vector of mn apple-orange pairs. (Most physicists, however, feel more comfortable thinking of them as on a parallelogram, with the isospin on the abscissa and the color in the ordinate.) The point is that color and isospin commute, so you will always operate on them by isospin operators and color operators that resolutely ignore each other. As a result, you will never have a meaningful color-isospin operation (which will simplify & shed insight on your system by a change of basis!); you rotate isospin and color always separately and never the twain shall meet.
Angular momentum addition, by contrast, involves the Kronecker product, a tensor product where you combine, e.g., two angular momenta by making a combined mn-vector whose entries are each entries of the first constituent m-vector multiplied by the entire n-vector of the second. The corresponding mn×mn-matrix generator acting on this vector is dubbed the "coproduct", and is symmetric between the two factors, and it is reducible in general, so a basis change (Clebsch-Gordan) reduces it to several block components. So, here, the vector is meaningful and it matters that it is not a mere Cartesian product.
To improve your question, you might dream up a concrete example where the distinction could matter and drive you to a wrong conclusion... a  tough challenge. At every stage of your construction  keep track of the dimensionalities of the component and total vector spaces.
An outstanding reference that utilizes and implicitly "explains" what you think of as an off-mainstream misuse of the direct product here is Wu-Ki Tung's standard text.
You might illustrate my promotion of $\times$ to $\otimes$ above by considering the only practical example you are likely to come across, representation matrices acting on vectors. Defining the color Lie algebra element as $\mathfrak a$  (an m×m matrix), and the  isospin Lie algebra element as $\mathfrak b$ (an n×n matrix), the generic $SU(m)\times SU(n)$ group element is $$e^{{\mathfrak a}\oplus {\mathfrak b}}= e^{{\mathfrak a}}\oplus e^{{\mathfrak b}},
$$
an (m+n)×(m+n) matrix in direct sum blocks, acting on an m+n-vector $v\oplus w$.
However, it doesn't cost you a thing to expand your vector space to mn-vectors  by Kronecker-tensoring them, $v\otimes  w$, now acted upon by $$
e^{{\mathfrak a}\otimes {\mathbb I}   +  {\mathbb I}  \otimes   {\mathfrak b}}= e^{{\mathfrak a}}\otimes e^{{\mathfrak b}},
$$
now a  mn ×mn matrix, much bigger, but noticeably cleaner. Note that the two terms in the exponent on the l.h.s. commute with each other!

Tensor Product vs Direct Product in QM


Is it possible to find authors' agents?

Question: I am trying to locate agents in my area of writing, so as to better target the limited amount of queries I'm sending.  There are several other writers writing in similar genres/niches, and I would be interested in contacting their agents, who clearly have an affinity for this area of writing.  Short of directly tweeting/emailing these authors to ask for their agents (which strikes me as discourteous/unprofessional), is there a database of authors and their agents I could consult?
Answer: Look at The Complete Idiot's Guide to Finding a Literary Agent (http://www.penguin.com/static/pages/cig/quickguides/literary-agent.php), it lists lists of agents.
Answer: In most books, the author will have an acknowledgements page or two, and they almost always include the name of their agent. A few other helpful places to look:

Acknowledgements page in the back of the author's book
aaronline.org (AAR is an association of agents that requires a certain level of ethics, e.g. no reading fees)
Writers Digest's Guide to Literary Agents and Writers Market
Look for big conferences in your genre - they usually have visiting agents. (For example, I write thrillers, so I looked at the International Thriller Writers conference page where they listed agents coming to the conference.)
BIG ONE Look at Publishers Marketplace. They have a listing of all agents, authors, book deals, etc. that are going on right now in the industry. It does cost a little, but it is definitely worth it.
Answer: find a copy of

2015 Guide to Literary Agents - Sambuchino, Chuck

or

2015 Writer's Market - Robert Lee Brewer
Answer: AgentQuery.com has a searchable directory of agents that can be filtered by genre and/or keyword.

Is it possible to find authors' agents?


Does long-time rendering damage CPU?

Question: I have a question. Does long-time rendering (3D animations) damage CPU? Or make it slow or reduce its life? I am not talking about network systems or big computers used in animation companies. I'm talking about my PC.
When I started rendering my 3D animation with Maya, the fan of my CPU noises and when I opened the Task-Manager window, the CPU usage was in 100 %. So I has been worry and came here to ask.
Comment: Not GD related, voting to close. Think this is a better fit for SuperUser?
Comment: All right, but **I'm still looking for other answers.** And I haven't enough reputation to vote up.
Comment: Welcome to GD!  While this is tangentially related, hardware questions will get better answers on SuperUser.  They have a similar question already (http://superuser.com/questions/314932/can-keeping-my-cpu-speed-at-high-performance-turbo-all-the-time-decrease-its-l), but if that doesn't answer your question you will likely get more detailed answers by posting there.
Answer: Simple answer: No.
CPUs have provision for overheating — They'll shut down before any damage is done. Unless you're running things really, really hard, it's unlikely you'll have any issues during the normal lifetime of a CPU. You'll likely want a replacement before anything goes wrong.
If you're using a PC, maybe a fan/cooling upgrade would be a good idea, if you think it's struggling.

Does long-time rendering damage CPU?


Bolzano-Weierstrass Property Implies Countably Compact?

Question: I thought that I could prove this, but it seems that it isn't generally true (for example, https://math.stackexchange.com/q/438474). So, I'd appreciate it if anyone could point out my error. Even better would be to show where an additional property (e.g. Hausdorff or first-countable) would complete the proof.
My "proof": by contradiction.
Assume $S$ has some countable open cover $\mathscr C = \{{C_i\}}$ which has no finite subcover.
Then for all $n > 0, \; ⋃_{i = 1, n} C_i$ does not cover S, and so there is $x_n \in  S$ \ $ ⋃_{i = 1, n} C_i$
Choose one such $x_n $ for each n, forming the sequence $(x_n)$.
So, by the Bolzano-Weierstrass Property the sequence $(x_n)$ has an accumulation point $x \in S$.
Since $\mathscr C $ is countable and covers $S$, then for some $i$, $x \in C_i$.
By the construction of $x_n $ , for $n > i$, then $x_n  \not \in C_i$, so there are a finite number of $x_n  \in C_i$
But this contradicts $x$ being an accumulation point, which requires an infinite number of $x_n $ in any open set that contains $x$.
Answer: Your proof is correct and it shows that one of the implications. There is however the following issue: how exactly do you define Bolzano–Weierstrass property? There are several conditions:

Every sequence has an accumulation point.
Every injective sequence has an accumulation point.
Every (countably) infinite set has an $ω$-accumulation point.
Every (countably) infinite set as an accumulation point.

It doesn't matter when you restrict yourself to injective sequences and countably infinite sets. The point is that an countably infinite set can be interpreted as an injective sequence and vice versa, but an accumulation points of the sequence correspond to $ω$-accumulation points of the set. But accumulation point of a set is weaker notion than $ω$-accumulation point unless you are in a $T_1$ space.
To conclude, 1, 2, 3 are equivalent, 4 is equivalent with them on $T_1$ spaces. Countable compactness is equivalent to Bolzano–Weierstrass property if its definition is based on 1, 2, 3. Note that the definition forbidding infinite closed discrete subset is equivalent to 4.
Comment: Many thanks, that's very helpful.
Answer: The problem with your argument arises from your understanding of the term accumulation point. The Bolzano-Weierstrass property as usually stated requires that every infinite set have a limit point, and a point $x$ is a limit point of a set $S$ if every open nbhd of $x$ contains a point of $S\setminus\{x\}$, i.e., a point of $S$ different from $x$ itself. If the space is $T_1$, this implies that every open nbhd of $x$ contains infinitely many points of $S$, but if the space is not $T_1$, this need not be the case. For example, let $=\Bbb N$, for each $n\in\Bbb N$ let $V_n=\{k\in\Bbb N:k<n\}$, and let $\tau=\{\Bbb N\}\cup\{V_n:n\in\Bbb N\}$. Then $\tau$ is a $T_0$ (but not $T_1$) topology on $X$, and every $k>0$ is a limit point of the set $\{0\}$: if $0<k\in V_n$, then $n>k$, so $n>0$, and hence $0\in V_n$, i.e., every open nbhd of $k$ contains $0$, a point of $\{0\}$ different from $k$. And this is true even though the set $\{0\}$ is finite: $\operatorname{cl}\{0\}=X$, so the singleton $\{0\}$ is actually dense in $X$.
Thus, the final step of your argument works only if $X$ is $T_1$: otherwise it's entirely possible for $x$ to be a limit point of $S=\{x_n:n\in\Bbb Z^+\}$ even though $C_i$ contains only finitely many points of $S$. In my example above, for instance, $\{V_n:n\in\Bbb Z^+\}$ is an open cover of $X$ with no finite subcover. For $n\in\Bbb Z^+$ let $x_n=n-1$; then $x_n\in V_n\setminus\bigcup_{k<n}V_k$. Then $\{x_n:n\in\Bbb Z^+\}=\Bbb N=X$, and we saw above that every open nbhd of $x_2=1$ contains $0=x_1$, so $x_2$ is a limit point of $\{x_n:n\in\Bbb Z^+\}$ even though $V_2$ contains only the two points $0$ and $1$.
Comment: Many thanks, so having the B-W property is just another name for limit point compact ?
Comment: @Tom: Yes, exactly.


Do the set of all integer satisfy the least upper bound property?

Question: i were thinking about this and it seen to me no, but a book i were reading says that the majorum of any set of integer is an element of that set.
And if that's the case does it mean that the set of all integer have the least upper bound property.
Answer: Yes, it satisfies, in fact, in that case the sup is actually the maximum of the set.
Answer: Set of integers have no supremum.But any finite set of integers have supremum which is maximum element of that set.


Magento 2.4 shows 502 bad geteway error

Question: I have installed magento 2.4.2  and installation is done but when tried to access through url it shows 502  bad gateway error
Comment: It is related to your web server configuration. It is hard to answer without knowing your server configuration. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502
Comment: Is this an upgrade or new install? There could be some issues with an upgrade because they moved index.php into /pub folder. Check nginx.conf.sample and compare it with your nginx.conf for changes.
Comment: new installation
Answer: 502 Bad Gateway its a webserver error, so something are going wrong here. We need to know about its NGINX or Apache webserver you are running you Magento on.
In my case I have created a Docker setup to have all the pre-config for me when I developer Magento code.
I know there are a huge NGINX config file you need to take care of if you are running on NGINX webserver, if you are running Apache I can't help here sorry.
The next step I see when you have running the upgrade cli command, you need to get the right access to your project folder in my case becures its local I run it, I just give it chmod -R 777 project/ if you are running on production 777 its not recommended.
But again when you hit 502 Bad Gateway there can be a lot of different errors here on you webserver access log.
Remember Magento required (PHP, MySQL and Elastic) to get up and running.
Answer: Can you try changing your document root to "pub" folder? From the newer version of Magento, you need to keep your document root to pub folder.

Magento 2.4 shows 502 bad geteway error


Ubuntu Plugins (gstreamer, freepats, etc) DEB Archive?

Question: Correct me if I'm wrong (I'm still a newb, tried Ubuntu last year), but I made a fresh install of Natty. Is there an Ubuntu site where it has the *.deb files of restricted plugins? i.e. gstreamer, freepats, and the like for a specific Ubuntu distro. My net speed sucks most of the time, just for backups or something.
Comment: related with this question http://askubuntu.com/q/974/61218
Answer: Basically most of the retricted packages are on ubuntu repository. Just search for your package on http://packages.ubuntu.com/. There are some additional media packages not found in main repository here: http://medibuntu.org/. As for backup, the installed packages that were installed with apt stay on /var/cache/apt/archives You may backup that on any external device or somewhere else so that you can reuse it later.
Comment: thanks man, now there's a use for my spare flash drives lol
Answer: Yes, http://packages.ubuntu.com . Choose your Ubuntu version, search the package, then on the right choose your download.
Comment: will bookmark that to be used in the future. thanks
Comment: there's a message that goes like, "it's recommended that you install it from the local repositories." it doesn't matter, right?
Comment: Those packages are from the repositories.
Answer: Probably in the launchpad repository: http://launchpad.net/ubuntu/natty .
Just search the package you would like to install and download it.
If you would like to use gstreamer, I advice you to add this medibuntu repository, please see here : http://doc.ubuntu-fr.org/medibuntu . To easely install repository and application, install ubuntutweak : http://launchpad.net/ubuntu-tweak  .
Answer: The apt is not the only tool which store installed (actually downloaded) debs in /var/cache/apt/archives, but also  synaptic and Software-Center. Just a clarification.
But if you want to install these packages later, you should setup a local-repository, so that you do not need to download these debs again.
You can get details about creating a personal repository here.
It is fine, if you do not stay connected to the Internet. But the problem with this method is  - it is not trusted. So if you want to install a package which resides both on your untrusted 'personal repository' and also on a trusted repository on the Internet, the package manager(apt or synaptic) will try to download the packages from trusted one (from Internet). So you may want to setup a local trusted repository. You can create a trusted repository by following this guide.
If it seems to you a clumsy method, you can force to install from your untrusted local repository by using --allow-unauthenticated switch to apt-get or change the preference of synaptic.
apt-get method
sudo apt-get --allow-unauthenticated install your_package_name
synaptic method
when you check some package to install and click on Apply button, synaptic will warn you that the packages are not authenticated and ask 'are you want to continue?'. just say OK to this answer.


How to evaluate $\int_{0}^{\infty}\arctan (x^2)\sin(x^2)\mathrm dx$

Question: How to evaluate
$$I=\int_{0}^{\infty}\arctan (x^2)\sin(x^2)\mathrm dx$$
with the help of Wolfram alpha,I got the answer below
$$I=\frac{\pi^{2/3}\text{erfc(1)}(\text{erfi(1)}+1)}{4\sqrt2}$$
But I don't know how to prove it.
Comment: I am ready to bet that this involves the Dawson integral. But, how to prove it, this is the question.
Answer: A simple approach is to use differentiation under the integral sign. If we set:
$$ I(\alpha)=\int_{0}^{+\infty}\arctan(\alpha x^2)\sin(x^2)\,dx $$
for any $\alpha> 0$, we have:
$$ I'(\alpha) = \int_{0}^{+\infty}\frac{x^2}{1+a^2 x^4}\,\sin(x^2)\,dx $$
that can be computed trough the Laplace transform:
$$ I'(\alpha) = \frac{\pi e^{-1/\alpha}}{2\sqrt{2\pi^3}}\left(\text{Erfi}\left(\frac{1}{\sqrt{\alpha}}\right)-e^{2/\alpha}\text{Erfc}\left(\frac{1}{\sqrt{\alpha}}\right)\right) $$
and by:
$$ I(1)=\int_{0}^{1}I'(\alpha)\,d\alpha $$
the claim follows.


Windows Live Mesh Connectivity Issue

Question: I have Windows Live Mesh installed on a 64 bit Windows Server 2008 system. Whenever I attempt to sign in to it I get an error message saying, "There might be a problem with your internet connection." This happens even though the server has an external connection.
Answer: I had this problem on my Windows 7 (x64) laptop, and the problem ended up being that Internet Explorer was in offline mode.  Since I never use IE, it took me a while to figure this out.  Once I told it to go back online, live mesh connected with no problems.

Windows Live Mesh Connectivity Issue


scratch countries effect of map using react native or flutter

Question:
I want to implement something like visited countries in react native or maybe flutter, using google map I don't know if is possible to make some animations like scratch a country from silver default map like in image from above.
I think to implement some animation above to a static map, but maybe is there something already implemented, I don't find something similar on expo or in flutter,...
Any suggestions ?
Answer: You can reference https://github.com/gi097/flutter_clickable_regions
This is a simple application which displays an SVG image with clickable regions. It displays all the provinces from The Netherlands. When you click on it, it will highlight the clicked province.
After download this package, execute command flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 513ms
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 52ms

[INFO] Succeeded after 13.6s with 1 outputs (5 actions)

working demo

code snippet
Widget _buildProvince(Province province) {
    return ClipPath(
        child: Stack(children: <Widget>[
          CustomPaint(painter: PathPainter(province)),
          Material(
              color: Colors.transparent,
              child: InkWell(
                  onTap: () => _provincePressed(province),
                  child: Container(
                      color: _pressedProvince == province
                          ? Color(0xFF7C7C7C)
                          : Colors.transparent)))
        ]),
        clipper: PathClipper(province));
  }


How is prevented that I just let any account pay for storage?

Question: When I create new state with https://developers.eos.io/eosio-cpp/reference#emplace I have to enter the account that has to pay the RAM. How is it prevented that I just enter any account and let it pay for the storage? Does the emplace require the authority of the payer?
Answer: emplace requires the authority of the payer. It will fail if that authority isn't present.
Comment: how about modify, I find in the token transfer, the receiver didn't authorize it, how can we modify it's tokens
Comment: @JimmyGuo a contract may modify any of its rows at any time
Comment: Yes, it can modify, but it can't make users to pay for the record if the user didn't authorize the action. I mean that when I transfer a token to another, his balance record was changed, but he doesn't authorize it.
Comment: Whenever a contract modifies a row, it can choose to keep the row's payer as-is or change the row's payer. Authorization is only required if it changes the payer.
Comment: but in my research for code, only  when you modified the record and the  ram didn't increase that the modification could be done, if the ram is increase, it can't modify it, because you can't let the  payer to reallocate  new memory.


DOMPDF background color and image issue

Question: I got some issue with background in DOMPDF. Please assume an element having both a color and image background.
When i try with just color or image, both works. But when i want both, the background image work but the background color turn black. I tried these syntaxes :
<code>background: #ff000 url('path/to/image');
// or
background-color: #ff000;
background-image: url('path/to/image');
</code>
The result is the same. I tried to check the html render without pdf and obviously it's works. The element is a div. The picture is a transparent PNG.
Edit : After posting this i thought about something : does even dompdf supports transparency in PNG for background ?
Answer: dompdf v0.5.1 does not support alpha transparency. The most recent release (v0.6.0) does, as you can see here on the dompdf demo site.

DOMPDF background color and image issue


Advanced formatting rules for StringBuilder.AppendFormat

Question: I've seen on this site a StringBuilder code sample illustrating AppendFormat usage:
using System;
using System.Text;

class Program
{
    static int[] _v = new int[]
    {
        1,
        4,
        6
    };

    static void Main()
    {
        StringBuilder b = new StringBuilder();
        foreach (int v in _v)
        {
            b.AppendFormat("int: {0:0.0}{1}", v,
                Environment.NewLine);
        }
        Console.WriteLine(b.ToString());
    }
}

=== Output of the program ===

int: 1.0
int: 4.0
int: 6.0

Where can I find documentation on those advanced rules for string formatting?
Answer:
Composite Formatting
Standard Numeric Format Strings
Custom Numeric Format Strings
Standard Date and Time Format Strings
Custom Date and Time Format Strings
Answer: Are you looking for this ?
Answer: You can start by checking the Composite Formatting article at MSDN. From there you will find links to standard format strings for numbers and dates, as well as links to the custom format strings for both numbers and dates.


Is the phrase "There are many hungers it is better to deny than to feed" correct?

Question: The "it is" seems out of place to me. I'd rather have it written as "There are many hungers that/which are better to deny than to feed".
Comment: great question!
Comment: I would use passive voice.  "There are many hungers which are better denied than fed." or "There are hungers which would be better denied than fed."
Answer: The sentence is not incorrect, it is just awkward.
Whenever I see there and it used in a sentence, I know I can come up with something better.  Many words in English can both enhance and refine a sentence.
For example, by using instead of and satisfy in the sentence, we can rearrange it to read:

It is better to deny many hungers instead of satisfying them.

This version of the sentence is less awkward.  Alternatively:

Many hungers are best denied rather than satisfied.

This version of the sentence is more concise and stays true to the original meaning.
There and it are frequently used in spoken English, but written English requires more specific words.
Comment: I don't think it is awkward at all, just going for a different effect than language you use chatting over coffee.
Comment: Quite, Oldcat. It's not at all awkward; just rather poetic.

Sorry Snapman, and more mundane clearly isn't always better


How to figure out time signature of complex type

Question:
Here according to me the left side time signature is 9/8 and the right side is 4/4. Am I going down the right path or are my thoughts wrong ?
Comment: One important point: You can't necessarily determine a time signature just by looking at the music. You can rule many out, and you can make common-sense guesses (these examples let you do both pretty conclusively). But material in 4/4 and in "cut time" (2/2) would look the same; the difference would be in what is thought of as the beat.
Comment: @AndyBonner while it's true that there will be some pieces, or at least some measures, that could be written identically in 4/4 and 2/2, many will be identifiable as one or the other from internal clues.  For example, it's pretty clear that the second excerpt here is 4/4, as I suspect you will agree.
Comment: @phoog There's a "high probability" that it is (if for no other reason, simply because common time is, well, more common, and there's no particular reason to suspect 2/2). I just wanted to make the point, though, since this came along as one of a [rash](https://music.stackexchange.com/questions/118299/identifying-complex-time-signature) of [questions](https://music.stackexchange.com/questions/118293/is-41-16-a-proper-time-signature) starting from the assumption that one can accurately reverse-engineer a time signature by looking at the notes (and confusing time signature with meter).
Answer: You are correct in both cases. In the first excerpt, the easiest way to discern 9/8 is by focusing on the left hand. In the second excerpt, the 4/4 is clearest in the left hand of the first measure and the right hand of the second.
Answer: Both correct. 9/8 needs to be 3 groups of 3 quavers, as shown slightly less complex in bass clef bar 2.
4/4 is written best when the bar can be split into two equal halves, each containing the equivalent of 2 crotchets. Last bar, treble clef shows two halves, each with just that - 8 quavers. Well done!


What's the difference between semiconductor and insulator (besides band gap)?

Question: The typical classification of electronic materials is metal-semiconductor-insulator. Is there any actual difference between a semiconductor and an insulator, besides the size of the bandgap?
Answer: Basically they are the same from a physics point of view, if you only look at crystalline materials. A semiconductor is defined to be insulating at $ 0 K $, while conducting at room temperature, although I don't recall, what level of conductivity is required to count as semiconductor.
Technically, insulators are a more general group of materials, since they could also be amorphous, while semiconductor materials are in the best case monocrystalline with very few defects or at least polycrystalline with a certain grain size in order to show proper semiconducting behavior due to the bandstructure. If there are to many defects, grain boundaries, impurities, the real bandstructure can differ from the ideal one by a lot.
Comment: Amorphous semiconductors also exist and are used, see e.g. amorphous silicon.


How to check if a Magento product is already added in cart or not?

Question: I want to show popup when a product is first added to cart in Magento and don't want to show a popup if the product was added again or updated.In short, I want to know product which is going to be added in the cart is First occurence or not?
Answer: The answer largely depends on how you want to deal with parent/child type products (if you need to).
If you are only dealing only with simple products or you have parent/child type products and you need to test for child id's then:
$productId = 1;
$quote = Mage::getSingleton('checkout/session')->getQuote();
if (! $quote->hasProductId($productId)) {
    // Product is not in the shopping cart so
    // go head and show the popup.
}

Alternatively, if you are dealing with parent/child type products and you only want to test for the parent id then:
$productId = 1;
$quote = Mage::getSingleton('checkout/session')->getQuote();

$foundInCart = false;
foreach($quote->getAllVisibleItems() as $item) {
    if ($item->getData('product_id') == $productId) {
        $foundInCart = true;
        break;
    }
}

EDIT
The question was asked in a comment as to why setting a registry value in controller_action_predispatch_checkout_cart_add is not available to retrieve in cart.phtml.
Essentially registry value are only available through the life of a single request - you are posting to checkout/cart/add and then being redirected to checkout/cart/index - so your registry values are lost.
If you would like to persist a value across these then you can use the session instead:
In your observer:
Mage::getSingleton('core/session')->setData('your_var', 'your_value');

To retrieve the value
$yourVar = Mage::getSingleton('core/session')->getData('your_var', true);

The true flag being passed to getData will remove the value from the session for you.
Comment: I used "controller_action_predispatch_checkout_cart_add" for getting product id before it added to cart..i used register variable for getting product id in phtml page on cart...and prepare one function for condition check as you mention..but now i am not able to get productid on cart page with registry..please help me for this..
Comment: Thank you so much Drew Hunter..A perfact solution for me..thanks for your help...:):)
Answer: In order check if the product is already in cart or not, you can simply use the following code:
$productId = $_product->getId(); //or however you want to get product id
$quote = Mage::getSingleton('checkout/session')->getQuote();
$items = $quote->getAllVisibleItems();
$isProductInCart = false;
foreach($items as $_item) {
    if($_item->getProductId() == $productId){
        $isProductInCart = true;
        break;
    }
}
var_dump($isProductInCart);

Hope this helps!
Comment: Thanks for your reply..it was perfect solution.I used this logic in observer,now my problem is how to get $isProductInCart value on the cart page,as i want this value to show popup in cart page.i want variable value in one phtml file...
Comment: You can simply wrap up the above code within some function with product id as function argument and you can call it from anywhere.


Training a multi-layer neural network to give a constant output

Question: Suppose I have a multi-layer neural network, with non-linear activation functions, and no bias terms. Is it possible to train this network such that for any input $x$, it will always give the same (or nearly the same) output $y$?
Comment: What do you mean by "for any input x, it will always give the same (or nearly the same) output y"? Taking that sentence literally is incompatible to neural network functionality and pattern recognition in general.
Comment: Yes, I know -- it is totally useless -- but it is just a theoretical question. Does a multi-layer neural network (without bias) have the capacity to give an output entirely independent of inputs?
Answer: For tanh, relu or linear activations where all weights are 0 the output will be 0 for any input. No bias units is equivalent to bias units are all 0.
In other cases, you can use 0 weights with other activations to output specific nonzero constants; subsequent linear layers can make this constant into any fixed value. For example, logistic(0)=0.5, so you can consider linear combinations of 0.5.
Answer: Yes. This happens even when people don't want it to. It happens when people train catagorization networks with very unbalanced datasets, then network will often catagorize every input as the most common class in the training set.
It also happens in GANs, with so called "mode collapse", where the generative portion of the network learns to produce a single output that always tricks the adversarial part.


How to add a halo to a dynamic label of an attribute in Atlas?

Question: How can I apply this for a dynamic label of an attribute in atlas? I'm using QGIS 2.18.10
How to add a halo to a text in the composer?
Answer: Using the method provided in the mentionned answer, you can replace the static text by an expression. Make sure to enclose it between [% %] and use the variable name (starting with @). If you click on the expression button, you can access all the list of available variables.
Let's note that the mix of an expression and the html label, together, are not a valid expression.

   [% @qgis_version %]


How come the URL of this page always remains the same when clicking on subpages?

Question: No matter what hyperlinks I'd click on this site, the URL displayed in my browser bar always remains the same as the starting URL. Unless I right-click on the links and open a new tab. This is the first time I encounter this so I'm not sure what this kind of technology is called and how it was realized with html code.
Comment: @Variant is right. This method of building sites is not recommended: http://www.hobo-web.co.uk/website-frames/
Answer: The entire page is constructed within a frameset. the hosting page remains the same and the navigation is done inside the frames.
if you view the page's source you'll see that it looks like this:
<code><frameset rows="100%,*" border="0">
  <frame src="http://ofb.net/~niniane" frameborder="0" />
  <frame frameborder="0" noresize />
</frameset>
</code>
the whole browsing is done in the first frame which occupies 100% of the screen
Answer: The whole page uses frameset instead of HTML. On click of any link, the page is opened in the same frame


I want to use a product thumbnail completely different than the product image

Question: I want to use a product thumbnail completely different than the product image. I've tried to search on google but all solutions lead to just customization of thumbnail sizes.
Answer: There's several ways you can do it. My suggestion would be to create a custom meta box that either accepts a either the image url or you pass the id of the image you want to use. Then within the template you can use the wp_get_attachement_image($args) function.
https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/
https://developer.wordpress.org/reference/functions/wp_get_attachment_image/


How to get rid of these bugs?

Question: We have newly got these bugs at home and want to get rid of them. They are about 1 cm long. They live under a laminated "floating" floor and they are only active at night - they run around our washroom and one can easily step on them... Is there a way how to get rid of these without removing the floor?
Answer: That's a silverfish. They're harmless to people and they won't do any structural damage to your home, but they do like to eat starch, cellulose, carbs; they'll do damage to wallpaper, book bindings, clothing, that kind of stuff. They like to eat mold and fungi too, and they tend to live in dark, moist / damp places.
As with any pest if you search around on the internet you can find a zillion suggestions for getting rid of them, some more successful than others.
Large infestations usually require an exterminator (if you find them problematic). But for small ones there are various things you can try first. This article on WikiHow has a number of suggestions, too many to reproduce here. Here is another decent article, although it's fairly clear that the author really despises these bugs.
Answer: That looks like a silverfish, one of the most ancient pests to perturb humans. They don't bite, but there is anecdotal commentary related to the spread of germs.
Boric acid powder, used as directed, will help reduce their population.
Answer: I agree - that is a silvefish.  Boric acid powder puffed into the nooks and crannies of the area is a safe (if slightly slow) way to get rid of them.
Comment: Welcome to Home Improvement.  Just a heads up, the site is a knowledge base of solutions rather than a forum.  The objective is to have answer posts that each provide a solution to the original question that hasn't already been contributed.  So posts that just confirm another answer without adding something substantive to it aren't really considered answers in this format.  The way we do that is to upvote good answers (which you'll be able to do with a small amount of rep from upvotes on your own good answers).

How to get rid of these bugs?


How can I connect the ground planes to GND?

Question: I'm trying to make a double-sided PCB in Proteus Ares. I added the planes using the Power Plane Generator tool, but there is no connection between planes and ground, if that makes sense. The only option in the Net menu is "none" so I can't really select anything. How can I connect the planes with actual ground? I included the PCB design and ground plane parameters:
Comment: I'm not familiar with Proteus Ares, but it looks to me as though you do not have *any* net names defined in your design. Is this PCB based on a schematic in the same project from which you've imported a netlist into the PCB design, or are you just drawing the PCB "freehand" with no linked schematic or netlist?
Comment: Well then if you have not imported a netlist from a schematic then you won't have a ground (or any other) net in your PCB design. It's possible that you can create a net "manually" in the PCB editor.
Comment: If the default footprint for a component is incorrect, find or create the correct footprint.  If you do any amount of schematic design and PCB layout, you WILL have to create your own schematic symbols and PCB footprints.  Any reasonable CAD system will allow you to do this.
Comment: @brhans  I'm drawing freehand because I was having some problems with the pre-defined pins. For example SMD package in Proteus is incorrect, compared to the datasheet.
Answer: Select the net you want you plane connected to from the "Net:" drop down menu.

Assuming you have named your ground "GND", select GND from the drop down menu.
Comment: Thank you for the information but the problem is that only option in the Net drop down menu is none so I can't do what you just said.


Delay between sending and recieving SNMP Traps within a machine

Question: I am experimenting with sending and receiving SNMP traps via net-SNMP.  I have a script that sends traps out to localhost.  I have snmptrapd set to write traps to a file.  This works fine, except for the fact that there is about a 5 second delay between the trap getting sent and receiving the trap.  It is all on the same computer (snmptrapd is running on localhost), so why would there be such a large delay?  Also, when I send a large amount of traps at once, like 100 within 5 seconds, it will not write more than 1 every ~5 seconds.
Thanks!
Comment: `tcpdump` is your friend.
Comment: Sounds like some sort of rate limiting. Check your SNMP configs, firewall, and `tcpdump`.
Comment: There is nothing in the configs and the firewall is off.  I can't directly tell what is wrong with tcpdump.  I even tried using 2 virtual machines as opposed to one, one for sending and the other for receiving traps.  Needless to say there is still a delay.  The receiving server gets packets immediately after the trap is sent, and then gets packets about 5 seconds later, which is when the trap is actually received.
Comment: Did you ever resolve this? I am having the exact same issue. Still haven't found any answer but I will keep digging and post back if I do.
Answer: Turns out the issue was DNS look ups timing out so I just pushed the -n flag to the options lines in /etc/defaults/snmpd. This was on Debian 6.0.

# snmpd options (use syslog, close stdin/out/err).
      SNMPDOPTS='-Lsd -Lf /var/log/snmpd.log -n -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
# snmptrapd options (use syslog).
      TRAPDOPTS='-Lsd -Lf /var/log/snmptrapd.log -n -u snmp -g snmp -p /var/run/snmptrapd.pid'

This was for:
 NET-SNMP Version:  5.4.3
on a Debian 6.0 server, the behaviour seems to have changed since Debian 5.0.


Excel and tab delimited files, using Carriage Return and Line Feed

Question: How do you introduce a CR and LF into a cell so when it is saved as a Tab delimited text file, the importing program will recognize the CR and LF?
Answer: You must use CRLF at the end of every row, and LF for carriage return inside a cell

In this way a spreadsheet will read properly the input
Answer: You can use the ASCII character codes in the cell:
Line Feed =CHAR(10)
Carriage Return =CHAR(13)
If need be, copy and paste values to get rid of the formula.
Answer: I use NotePad++ to edit the file after export.
View > Show Symbol > Show End of Line.
Then highlight the line break characters and do a find/replace (CTRL + h). [FYI: It only works for me when I highlight and not when I used the extended characters.]
In the 'Search Mode' section (bottom left of find/replace window) choose Extended.
Then in the 'Replace With' box put in what end-of-line character you want:
\r = Carriage Return = CR
\n = Line Feed = LF
\r\n = CRLF
For my needs, I replace CRLF with \n and then I replace LF with \r\n.
I have to do it in this order otherwise if I replace the LF first I get a CRCRLF; you may need to consider your order.
I'm trying to avoid this process with this question to make a batch file that does it for me here: https://stackoverflow.com/questions/73225619/batch-script-to-replace-crlf-with-cr-then-lf-with-crlf-excel-to-timeslips-impo
Please upvote the question if it would help you.
Answer: Late to the party here, but if the goal is to introduce linebreaks into the original Excel file in such a way that they survive export to CVS and import back into Excel, use ALT+ENTER to add the linebreaks where required in the cell itself.
This automatically gives you the same result in the exported CSV as @aborruso has described.