Is there a limit to the number of addresses that you can pass in an array as an argument to a function?

Question: I'm trying to create a simple airdrop contract. I'm fairly experienced with Solidity, so this is not a completely noob question - but maybe I'm missing something.
My airdrop contract has a function that accepts an array of addresses
<code> function bulkWhitelist
    (
        address[] calldata _to,
        address _projectAddress,
        string calldata _projectName
    )
    public onlyRole(WHITELISTER_ROLE) {
        for (uint256 i=0; i<_to.length; i++) {
            whitelist[_to[i]] = true;
        }
        emit BulkWhitelist(_to, _projectAddress, _projectName, block.timestamp);
    }
</code>
Simple, I know, but I would like to keep the architecture as simple as possible.
Everything works well if I pass around 650 addresses or less to the contract as an array, but if I try to add more, I get a transaction block gas limit error. The problem is, increasing the block gas limit makes no difference - after around 650 addresses, the error always comes up with a number above the current gas limit, no matter how much I raise it.
The error also comes up if I remove the for loop from the contract - so it doesn't seem to be a gas limit per se.
I am using hardhat and I haven't deployed to a testnet to see if I still get the error - so it may be a hardhat limitation. I'll try that later, but until I get to doing it, the question is: Does anyone know of any inherent limitation in Solidity that will limit the amount of addresses that I can pass within an array as a function argument? I can't find anything online, bar the well-known 'maximum 16 arguments' limit.
Thanks
Answer: The block gas limit is the upper limit for a block and it is a constant. You cannot have a transaction that consumes a limit that is more than the block gas limit.
If you want to do a batch transfer, then I would suggest you to break the number fo addresses into smaller chunks, loop through the chunks and pass the batch as an array into the smart contract.


Vnea 8ball pool league

Question: It's my turn to shoot and the cue ball is touching one of my object balls is it legal for me to hit that ball straight on or does it have to be hit at an angle and what angle should it be hit at and if the balls aren't touching by the littlest of a eighth of an inch is it legal for me to hit that ball
Answer: If they are touching / frozen:
If the cue ball is touching an object ball, then yes, it is legal to hit straight, or at an angle, into the object ball, assuming the shot then does one of the following (from VNEA 8-Ball Rules):

H. Fouling
7. Object Ball Frozen To Cushion Or Cue Ball
This applies to any shot where the cue ball's first contact with a ball is with one that is frozen to a cushion or to the cue ball itself. After the cue ball makes contact with the frozen ball, the shot must result in either:
a) A ball being pocketed, or;
b) The cue ball contacting a cushion, or;
c) The frozen ball being caused to contact a cushion attached to a separate rail, or;
d) Another object ball being caused to contact a cushion with which it was not already in contact.
Failure to satisfy one of those four requirements is a foul.

If they are not touching / frozen:
It is still legal to play the shot, in the sense that it is not illegal to do so, however you are almost certainly going to perform a double hit (unless you hit the object ball very fine), which would result in a foul.

Vnea 8ball pool league


How do I keep 16.04 LTS up to date?

Question: I regularly use the Software Updater to keep 16.04 LTS up to date.  Today when I opened the Software Center, there was one OS update available that "Improves performance, stability and security improvements". It also shows "bind9-host" and "1:9.10.3.dfsg.P4-8ubuntu1".  Should I also install this OS update?
Comment: Today, I used the Software Updater on 16.04 LTS and it installed OS updates, Firefox update, Chromium update, and Thunderbird update...195 Mb.  After it finished updating successfully, I opened the Software Center, selected Updates and it showed the same updates were ready to be installed.  Now I am confused.  Do I use only the Software Updater, the Updates in the Software Center, or both?
Comment: Problem Solved.  I then rebooted and checked the Software Center for updates and there were none.  It said "Software is up to date"!!  So, is this a bug in the Software Center where its list of available updates is not in sync with those just installed by the Software Updater?
Answer: You can install unattended-upgrades by typing the following commands:

sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
Answer: Yes. Whenever the update manager comes up with an update, it is a release-wide update (everybody's machine gets it). These small updates keep 16.04 up-to-date and error free between major and minor releases.
Some updates may not be "checked" be default because they are not for the core of Ubuntu. They may be for a third-party application. In 99% of cases, you will want to install all updates that show up from the update manager if its settings are default.

How do I keep 16.04 LTS up to date?


How is Gandalf the White a "significantly more powerful figure" than Gandalf the Gray?

Question: After his fight with the Balrog of Moria, Gandalf changed:

Gandalf was sent back as a significantly more powerful figure; Gandalf the White.
  - "Gandalf - Gandalf the White", Wikipedia

What are Gandalf's new powers as Gandalf the White? What feats could he accomplish that he was not able to perform as Gandalf the Grey?
Comment: I think of it as Gandalf "leveling up".
Comment: for Gandalf, *What **does** kill you makes you stronger*
Comment: Short version - before, he was in an extra-limited human body, after, he regained SOME of the power of the Maiar that he was denied (on purpose) as G. the Gray.
Comment: @b_jonas: Think in terms "death removes current debuffs; debuff 'mortal coil' removed."
Comment: Are you asking for a sort of "Gimme the powers' list" thing? :P
Comment: Remember in Final Fantasy 1, how half-way through the game all of your classes transform into more powerful versions of themselves? That's Gandalf.
Comment: @Alenanno No, a general representation of the power difference.
Comment: Wouldn't you normally *lose* levels if your body dies?
Comment: Nitpick perhaps but it's 'Grey' and NOT 'Gray'. Just like Tolkien was unhappy to say the least that American publishers used the word 'farther' instead of properly 'further' (a sin Peter Jackson is also guilty of) I can't see him using the spelling 'Gray' (or 'gray') and in any case a name is a name and it was 'Grey'/'grey' (which I see is in the body of the question but not the title).
Answer: Eru, the Authority, sent back Gandalf with additional power, knowledge and wisdom.

He was sent
  by a mere prudent plan of the angelic Valar or governors; but Authority had taken up this plan and
  enlarged it, at the moment of its failure. 'Naked I was sent back – for a brief time, until my task is
  done'. Sent back by whom, and whence? Not by the 'gods' whose business is only with this
  embodied world and its time; for he passed 'out of thought and time'.

Prior to Gandalf's return, he would not have been able to rescue Theoden by breaking Saruman's spell and inspiring and leading the Rohirrim. Nor would he have been able to face down Saruman, as originally Saruman had been the leader of the Istari and hence more powerful than Gandalf.

So Gandalf sacrificed himself, was accepted, and enhanced, and returned. 'Yes, that was the name. I was Gandalf.' Of course, he
  remains similar in personality and idiosyncrasy, but both his wisdom
  and power are much greater. When he speaks he commands attention; the
  old Gandalf could not have dealt so with Theoden, nor with Saruman. He is still under the obligation of concealing his
  power and of teaching rather than forcing or dominating wills, but where the physical powers of the
   Enemy are too great for the good will of the opposers to be effective he can act in emergency as an
  'angel'

Gandalf's barring of the Witch-King from Minas Tirith is another example. Previously, he merely aided Elrond's flood in keeping the Nazgul from Rivendell.  After his return he was able to single-handedly impede the Witch-King.

He alone is left to forbid the entrance of the Lord of Nazgûl to
  Minas Tirith, when the City has been overthrown and its Gates destroyed

Excerpts from Letter 156.
Comment: It's also in Letter 156, stating that because Gandalf "passed out of thought and time", he had to have been sent back by "the Authority" (Eru) as this was beyond the abilities of the Valar.
Comment: @acolyte: Eru is the only one that can create life. The Valars can (and did) restore several elves to life -- Golorfindel for example.  Humans are move beyond Arda and thus cannot be returned -- that is Eru's gift to mankind.  Maiar are bound to the world and thus under the control of the valars.
Comment: @Sardathrion I do not think the Valar can _create_ life; the Elves are merely restored to life. Even Aulë couldn't give full life to his Dwarves; it was Eru who gave them sapience.
Comment: Gandalf says Saruman is the leader of his order in the movies, and I believe this is right out of the books.  The White Robes are for the leader, which is why Gandalf is contemptuous of "Saruman of Many Colors", and why he becomes the White Wizard himself on his return.
Comment: Do you have *any* source that states it is Eru and not the Valar that send Gandalf/Olorin back?  As far as I was aware, Eru takes a very hands off approach to godhood and does not intervene at all within Arda.
Comment: @Sardathrion If you read the Silmarillion, you know that the istari are Maiar, and that only Eru Illuvater can return them to life/really interact with them.
Comment: Strictly speaking, they are bound to the world until its unmaking, with the exception of Melkor who was thrust into the void.
Comment: Are you sure Saruman was the leader of the Istari? My understanding was that he was head of the white council only.
Comment: As Gandalf the white he was far more powerful than Saruman as he was able to break his staff & cast him from the white council. In his previous visit to Isengard as Gandalf the grey Saruman had been too strong for him & had been able to imprison him in Orthanc.
Comment: @horatio Well, minus the prophecy about Morgoth and a new battle, anyway... And Saruman of course was lost also.
Comment: @a_a Correct, White Council. And if it was up to Galadriel it would have been Gandalf but iirc Gandalf didn't want to be head of the Council. Can't say I remember 'head of' Istari ever being mentioned though maybe it has.
Comment: @Oldcat White Council. 'Order' is an invention of the film and so he's referring to the Council. And Galadriel wanted Gandalf but that didn't turn out that way until he returned from the dead. And he was made White more so because of his deed of saving the Company from the Balrog. I don't remember it being said exactly how the colouring worked; Radagast was Brown and the other two iirc were Blue (and mentioned more in the letters). But certainly Saruman was surprised that Gandalf was now White. And furious at Wormtongue for throwing the palantír of course.
Answer: Adding to @dlanod answer.
When I read the books the main feature that seemed to stand out the most as Gandalf The White, was his confidence on himself.
As The Grey he underestimated his powers, he never overdid it and he was VERY humble (this was one of the main reasons that the Valar sent him and the main reason he received Narya).
As The White he still knows his limits but is far more daring and defying towards Saruman and Sauron (he frees Theoden and casts Saruman from the Order, he faces the Witch King, etc)
Answer: Gandalf the white is more powerful because the whole story is about the fall. The fall from grace, wisdon, loyalty...anything. Anything that sets the creator apart from the sub-creators, ie-Eru from Valar, Maiar, elves, men, etc. All the main characters experience a fall of some kind, some repent some don't, thus we observe the duality of good vs evil as polar expressions of divinity. This is a recurring theme. As Gandalf's "fall" is based on a sacrifice to the higher good (Eru), his re-embodiment is a divine blessing for the benefit of the sub-creators. He cannot conquer, only inspire. He cannot force anything to his will but he can use force to preserve the will of others. He is, in a sence, Eru! The Valar and Maiar are "the offspring of the thought of illuvitar". Which we can take to mean, aspects of the divine self. Gandalf the White is God, embodied and Sauron is mearly dancing to the divine tune. Gandalf's greatest power is his ability to know how Sauron will react. If you knew all the moves your opponent would make beforehand, could you really lose at chess? No. The overall message is the choice of the sub-creators to follow the wisdom of the creator. Frodo is the hero who trusted, had faith in, Gandalf. As is Sam, Aragorn, Theoden and even Butterbur. Who trusted Sauron?
Comment: Gandalf didn't know all Saurons moves beforehand,that's complete fantasy,he was constantly worried that Sauron would find Frodo.
Comment: -1 "Gandalf the White is God, embodied" - this is answer is an eccentric reading, placing a strange grid over the text of LOTR in my opinion.
Answer: Gandalf is overall more powerful as Gandalf the White. He is far more charismatic and has some limited foresight. He was able to defeat Saruman, breaking Saruman's power over Theoden and breaking his staff after the Ents took Isenguard. However, he was not all-powerful, seeing as the Witch-King of Angmar broke Gandalf's staff. Still, he is obviously more powerful, since, as Gandalf the Grey, he was defeated by Saruman, then he later broke his staff and cast him from the Istari and the White Council.
Comment: Gandalf staff is only broken in the movies. In the books Saruman's staff is broken by Gandalf but it is implied that does not happen by brute force but rather as a consequence of Saruman's betrayal.
Answer: Gandalf was more powerful as white than grey. His wisdom as well as his magical powers and his physical powers were all increased. He basically was now Saruman (like he said). He was the new White Wizard and was as powerful as Saruman was. Saruman lost a great deal of his power and was cast from the order.
Answer: Gandalf was sent back by , I assume, the Valar, who sent him in the first place. This is because he had not yet finished his task, which was to oppose Sauron and save Middle-Earth from him. The fact that he was sent back as a white wizard, instead of a gray, would tell you something if you had done your research. The "wizards", or Istari, are ranked by color of their robes. Saruman has white robes because he is the most powerful. Gandalf has grey, because he is less powerful, but still one of the most powerful, possibly the second most powerful of the five. When he was sent back to Middle-Earth as a white Istari, he gained a significant amount of power that came with the rank, or the other way around, however you see it. So, it is expected that he would be more powerful after his return.
Comment: Hi @DMG007! You're probably getting downvotes because of the aggressiveness of your answer, and also because you don't cite any references for your assertions.
Comment: @JonKiparsky Hi Jon! I suggest you read the FAQ and guidelines for this site. Works of fiction have references, of course (the actual work, author interviews, etc). In this site we discourage pure speculation and personal opinion, and encourage actual references.
Comment: @AndresF. he's also wrong. The Valar didn't send him back, only Eru has that power.
Comment: Have you got any proof?
Comment: @AndresF. - it's a work of fiction. What sort of references would you be looking for here?
Comment: Regardless of accuracy or style, the post completely fails to address the question: *How* was Gandalf more powerful?  This answer simply says, repeatedly, that he *is* more powerful.  In what ways?  What is this increased "power" specifically measuring?


Login Screen source code

Question: I would like to see how the login screen actually verifies that the password is correct. Does it have access to passwd file directly or does it refer to the judgment of some system function?
Answer: Authentication is implemented using PAM, the Pluggable Authentication Modules.

Linux-PAM is a system of libraries that handle the authentication tasks of
  applications (services) on the system. The library provides a stable general
  interface (Application Programming Interface - API) that privilege granting
  programs (such as login(1) and su(1)) defer to to perform standard
  authentication tasks.

The configuration for the login service is in /etc/pam.d/login.
It's well-commented, and very informative.
It is PAM's modules that access to the password file,
when needed.
In systems with centralized authentication (for example LDAP),
the login service may never need to access the password file.
See more info in man 7 pam.
Comment: This certainly is the correct answer about where to find the source code. However it does not answer the question about whether the login screen has access to the passwd file. A library only has the privileges of the process which uses the library so part of the code running the login screen does have to run with root privileges.

Login Screen source code


Joining the centers of the edges of Platonic solids

Question: We know that taking the centers of the faces of any 3d polyhedron (say, the Platonic solids) produces the dual solid. And repeating this operation gives us back the original solid. Another possible thing we can do is take the centers of the edges. This will produce other solids as well. If you do this to a tetrahedron, you get an octahedron. Do this to an octahedron and you get a cuboctahedron. My question is, why does taking the face centers preserve the properties of the Platonic solids and have this nice dual-solid property while taking the edge centers doesn't. What makes the operation of taking the face centers "superior" to taking the edge centers? And is there a name for the process of forming a new solid by taking the edge centers?
Comment: Note that taking points at the centre of faces and joining to points on adjacent faces preserves the number of edges - each old edge has one new edge crossing it.
Answer: It may be worthwhile visiting this MO question, The limit of edge-midpoint convex polyhedra, and in particular, the
answer by A. Meyerowitz:

Image due to Aaron Meyerowitz.
Answer: The general setup here is dealing with regular polytopes. Then you are asking about taking the centers of k-faces (k-dimensional sub-elements). This process is usually called the k-rectification, cf. https://en.wikipedia.org/wiki/Rectification_(geometry).
When describing regular polytopes by Dynkin diagrams, those are of type xPoQoRoSo..., that is have a special node ("ringed", here demarked by x) at one end, and all other nodes are "unringed" (demarked by o), whereas the links bear several number marks (here represented by P, Q, R, etc.). The rectified polytope then gets described by oPxQoRoSo... and describes your edge-center figure, the birectified will be oPoQxRoSo... and describes the hull of the set of 2-boundary centers, etc.
What is special for the birectification, when applied to polyhedra, is that those would be oPoQx, that is the Special node happens to lye at the opposite end of the graph. And this - quite generaly - is just the dual of the starting regular polytope.
$$$$
Edit:
Whilst rectification (or multi-rectification like bi-rctified = oPoQxRoSo… etc.) is only defined on base of regular polytopes and which thus ensures all equal edges throughout (even when dealing with non-convex regulars), there is a closely related operation called ambification, which simply is defined by the convex hull of the edge centers of any convex polytope. That latter one has been used in the other answer. Applied to the convex regular ones those clearly coincide. But ambification generally will not ensure to produce equal edges in the new polytope.
--- rk


Extracting energy from the universe's expansion using gravitational waves

Question: Would it be possible to extract energy from the universe's expansion by having two massive bodies orbit each other in such a way that their rate of infall due to emitting gravitational waves is exactly countered by the expansion of the universe, then collecting the energy from the waves to do work? If so could this method be used to generate energy well beyond the evaporation of the last black hole?
Answer: No, it can't be done.
The Hubble expansion isn't a force. You can extract kinetic energy from the relative motion of receding objects, but once that's gone it's gone.
The repulsion due to the cosmological constant is a force, but it's a conservative force like ordinary gravity, so there can be no net energy output from a periodic system like the one that you're envisioning.
If you allow your system to grow in size then it's more complicated.
In a Newtonian universe with a repulsive force similar to the cosmological constant, I'm pretty sure you can extract unlimited energy from it with an ever-growing system, because, although it's still a conservative force, the potential energy function has no minimum.
In general relativity, though, when the cosmological constant is positive, there's a cosmological horizon that limits the size to which any system can grow, and the maximum energy you can extract is finite. (See this answer.)
Comment: Can there be a setup where the volume inside the cosmological horizon grows unboundedly?
Comment: @A.V.S. Not with a cosmological constant. If the dark energy is really a scalar field with some more complicated equation of state, then I don't know what's possible.
Comment: @benrg What do you mean in the last part with "using a device that fell closer and closer to the horizon while never reaching it". Is that possible?
Comment: @vengaq I deleted the paragraph since I think it was wrong. I added a link to an answer (to one of your questions) where I derived a finite total extractable energy.


Should I use a semicolon or a dash to connect two closely related sentences?

Question: When you want to connect two closely related sentences, you can use a semicolon or a dash. (You can also use a dash for other kinds of non-sentential relations). How would you choose whether to use a semicolon or dash?
Answer: I don't think I was ever taught a clear-cut rule, and as a non-native speaker, I am probably spoiled to some extent by the usage of dashes in other languages. That being said, following nothing but my intuition I would use:

a semicolon when the sentences express related, yet independent (especially grammatically independent) thoughts; they could well stand on their own, separated by a period.
a dash when the second sentence backs up the first one, nails it down to something, restates or amplifies it, provides reasons or examples, or when the second sentence could not stand on its own "as is" for grammatical reasons.

I will try to demonstrate my point by rewording the notorious examples from The Oatmeal accordingly.

My aunt had hairy knuckles; she loved to wash and comb them.
My aunt had hairy knuckles — she suffered from hirsutism.
When dinosaurs agree on something, they'll often high-five one another; dinosaurs are all about high-fives.
When dinosaurs agree on something, they'll often high-five one another — they cannot talk and have to resort to gestures.
I gnaw on old car tires; it strengthens my jaw so I'll be better conditioned for bear combat.
I gnaw on old car tires — to strengthen my jaw so I'll be better conditioned for bear combat.

Again, this is just my two cents, and I'm only putting them in because the other answers so far seem to miss the point of your question by focusing on non-sentential relations and sometimes not even mentioning semicolons at all. I don't know whether my answer comes close to being correct or not, but I hope it will at least serve as a turning point for getting the discussion back on topic.
Comment: This is exactly the kind of answer I was hoping for.
Comment: "I gnaw on old car tires — to strengthen my jaw […]" pretty sure this is grammatically incorrect.
Comment: A semicolon works like a period. A dash works like a colon — or can.  That previous use is not one such, though.
Comment: @tchrist - If a dash works like a colon, what's the difference between a dash and colon, then?
Comment: My general rule is that semi-colons usually connect two phrases or sentences to another, but it's also used as a dividing character, for instance to separate two series.  "A red, white, and blue; a green, black, and yellow; and also a red, white, and green flag dangled in the wind." An my rule for hyphens is that it's generally used as an aside allowing the author to interject opinion to the reader, which is why you may see a phrase written in first person.  "The man was short — shorter than anyone I had seen before — allowing him to duck under the neighboring fan."  But there are many rules.
Comment: @mk12, RegDwi, so is that grammtically correct or incorrect?
Comment: I think semicolon is a **mood-switcher**, while dash is an **explainer**. See [my answer](https://english.stackexchange.com/a/434645/80007)
Answer: Semicolon is used to join sentences that can stand alone, but are joined to emphasize their relationship.
En dashes are used to indicate periods of time or other numerical ranges.
Hyphens are used to combine open compounds.
Em dashes are used to disrupt the flow of a sentence and bring emphasis to the coming point.  It is a more informal and stronger version of the colon.  It can also act as a stronger version of the comma.
Comment: I am not sure what to define as stylistic and not.  Wouldn't that be anything to be used for emphasis?

http://web.mit.edu/comdor/editguide/style-matters/punctuation.html
Comment: Interesting.  Do you have citations for these rules?  Are these stylistic rules only?
Comment: Glad somebody brought up dash types.
Comment: @Eruditass, Are you sure they're stronger than the colon not the other way round?
Comment: In Britain, it is more common to see the en dash used for what you describe the em dash is used for
Answer: Typically, if I'm connecting two closely related sentences, I use a semicolon; I use dashes in instances where commas would also be acceptable—usually where commas would be confusing—or where parentheses would also be acceptable.
Answer: Firstly, you should be aware that there are two different kinds of dashes: the en dash and the em dash.
The em dash (—; historically, an em is precisely the width of the letter "M", but now defined by the height of the font) is generally used to add a passage into the middle or end of a sentence. This is similar to using parenthesis, but should be read without adding a pause. Moreover, the em dash in fact interrupts the sentence, so no pause should be used at all; an interruption should be emphasized.
This dash is also often used as a de facto interruption; for example in dialog when the speaker for some reason cannot continue.
In use, the em dash is not surrounded by spaces. This is done—like this—because it otherwise uses excessive spacing.
Some publishers or style guidelines may instead prefer the narrower en dash (–; an en half the width of an em). This character is usually – as in this example – surrounded by spaces.
Suggestions on the use of semicolons can be found as answers to this question.
Comment: @Jared, I'm slightly worried that incorrect usage of a glyph a few dots or pixels narrower "drives [you] up the wall." Take it easy mate. We're aware of the significance; needn't get angry at those who aren't. Whether it's an en dash, an em dash or a hyphen, it's often quite clear which is intended.
Comment: +1 just for mentioning en and em; correcting others' dashes used to be a not insignificant source of grief for me.
Comment: @Popular: a much larger problem is the common accidental usage of a hyphen when an em dash is meant. This is worrisome because they have the opposite meaning: hyphens connect and glue things together, and em dashes separate and break things up. It drives me up the wall when a hyphen is used instead of a long dash. It really muddies the sentence up.
Comment: In American typography it's appropriate to add a thin space on both sides of an em dash, and slightly less commonly, an en dash. Unfortunately thin spaces are difficult to type and sometimes aren't rendered correctly. Still, as someone who's set a lot of type, em spaces pushed right up next to their surrounding words look far too tight to my eyes. Examples with full spaces, thin spaces, and no spaces (pad to push to its own line): M — L vs M — L vs M—L.
Comment: @Jared, that grief I referred to was suffered when I was a copy editor, so I know exactly what you mean.
Comment: I believe an em dash is the width of a capital M, not a lowercase one as your post implies.
Comment: @Paul, The question is asking about usage of **single** emdash, not the multiple one.
Comment: One should also be aware that individual style guides differ in their _recommendations_; an answer quoting one without balancing recommendations from other equally legitimate sources (especially when the answer lacks references) is hardly scholarly, and can be very unhelpful.
Answer: In Comma Sense (Richard Lederer and John Shore — ISBN 0-312-34255-1) it's reported that the dash is used:

to set off a though or explanatory remark with a sentence: If I remember well — bear in mind I have been on New York City 5 years ago — Central Park is close to Fifth Avenue.
to introduce an appositive: When I frequented the ITIS — the secondary school on Cantore Street — I was still a teenager.
to signify a sudden change in thought: We are going to — what's that burning smell?
before the citation of an author or source of a quotation.

In the other cases, a different punctation should be used.
Comment: Your 4 examples of dashes are **not** the usage of dash he's talking about—he's talking about that which works like the thing between colon and semicolon.
Comment: The question is _How would you choose whether to use a semicolon or dash?_ I said when I would use a dash, not that his example suits for using a dash.
Answer: Here is what I think:
Semicolon is a mood-switcher
It switches your "learning mood" to "exciting mood" and vice versa.

When dinosaurs agree on something, they often high-five one another; dinosaurs are all about high-fives.

Godzilla is a misunderstood creature; beneath his raging desire to set people on fire & eat them lies a gentle giant who just wants to cuddle

Dash is an explainer

It further explains a concept before it.

When dinosaurs agree on something, they'll often high-five one another — they cannot talk and have to resort to gestures.

Godzilla is a misunderstood creature — beneath his raging desire to set people on fire & eat them lies a gentle giant who just wants to cuddle

This answer is inspired by RegDwigнt's answer.


How do I disable the trackpad in ubuntu 10.04?

Question: I have an usb radio mouse, so I would like to disable the trackpad to while i have the mouse plugged in. Is there a nice and easy way to do this ?
Answer: Even though this question already has an accepted answer I would like to add one more. The reason is that many laptops have a hardware switch (possibly reached with the Fn modifier key) that allows you toggling the touchpad on/off. So, instead of spending a lot of time on finding a way to disable/enable the touchpad through configuration, the solution might be as simple as pressing a button.
Comment: On Thinkpad it's Fn-F8.
Answer: If you have a Synaptics touchpad (very common in laptops), you can disable the trackpad using the synclient command. See http://embraceubuntu.com/2006/03/24/disable-synaptics-touchpad/
for a thorough explanation.
You could either bind that command to a key, or have it executed automatically when the USB mouse is (un)plugged by putting an appropriate script into udev. The latter might be a bit tricky though.
If you are just annoyed that you brush the touchpad while typing, there's a daemon to disable the touchpad while typing: http://embraceubuntu.com/2006/09/20/disable-touchpad-temporarily-when-typing/
Answer: Completely disabling Touchpad
Some systems don't have the option to permanently disable the touchpad via BIOS or it's located in an external keyboard. To fully disable you can do the following:

Determine the device id (the device name should be something with
  touchpad or glidepoint)
xinput list

Disable it (e.g. here the device id is 15)
xinput set-prop 15 "Device Enabled" 0

You may run the command during session startup

Original link:
https://help.ubuntu.com/community/SynapticsTouchpad
Answer: You can use xinput package for Python.
It's a very tiny code which allows you to disable/enable the touchpad from terminal.
https://github.com/barseghyanartur/xinput
Simply follow the Instructions below:
Install:
$ pip install xinput

Disable touchpad:
$ disable-touchpad

Enable touchpad:
$ enable-touchpad


Problem building a Setup project

Question: I'm working on a tool to simplify an application's deployment. Hence I'm aiming to automate the build of the setup project.
The Situation:
When I use Visual Studio to build the setup project this, creates the msi and exe files and concludes successfully. The problem occurs when I run a command in the command prompt, I keep getting this error "ERROR: Cannot find outputs of project output group '(unable to determine name)'"
The command for the command prompt is:

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv "C:\Project's Directory\Project.Setup.vdproj" /Build

Can anyone help me with it.
I'm really stuck.

EDIT: The solution to my problem was to create a solution which contains the setup project and the project which is actually the output project of the setup project.

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv "C:\Project's Directory\Project.Setup.sln" /Build

Thanks to everyone.
Answer: You can't do this.
The issue is that you have defined your inputs to the setup project as outputs from the other projects in the solution.  You have to build the entire solution to use this method.
You can do this but you have to manually link all the files you want into your setup project.  It is a bit more tricky but just as doable.
Answer: I suspect that you have a setup project that is referencing the output of another project. in this case you need to use
<code>devenv [solutionname] /build
</code>
the reason you are getting the error is because visual studio has not compiled the referenced project.
side note: if you are trying to automate a build in vs 2005 or later I would investigate wix as it is easier to automate using msbuild.
Comment: Implementing Wix is in my TODO list.

Problem building a Setup project


Convex functions in integral inequality

Question: Let $\mu,\sigma>0$ and define the function $f$ as follows:
$$
f(x) = \frac{1}{\sigma\sqrt{2\pi}}\mathrm \exp\left(-\frac{(x-\mu)^2}{2\sigma ^2}\right)
$$
How can I show that
$$
\int\limits_{-\infty}^\infty x\log|x|f(x)\mathrm dx\geq \underbrace{\left(\int\limits_{-\infty}^\infty x f(x)\mathrm dx\right)}_\mu\cdot\left(\int\limits_{-\infty}^\infty \log|x| f(x)\mathrm dx\right)
$$
which is also equivalent to $\mathsf E[ X\log|X|]\geq \underbrace{\mathsf EX}_\mu\cdot\mathsf E\log|X|$ for a random variable $X\sim\mathscr N(\mu,\sigma^2).$
Comment: Is this inequality actually true?
Comment: @did: the motivation is to show that $\mathsf E\log|\mu+\sigma Y|$ for a standard normal $Y$, for any fixed $\sigma>0$ is increasing in $\mu$ along positive values of $\mu$. This is equivalent to the monotonicity of $\mathsf E\log|X|$ where $X\sim\mathscr N(\mu,\sigma^2)$. I've found the derivative of the latter with respect to $\mu$ and that is
$$
(\mathsf E\log|X|)^\prime_\mu = \frac{1}{\sigma^2} (\mathsf E[X\log|X|] - \mu \mathsf E\log|X|)
$$
which should be hence non-negative.
Comment: @did: but why did you ask - do you have a particular counterexample in mind?
Answer: Change the dummy variable $x\mapsto x+\mu$:
$$
\begin{align}
\int_{-\infty}^\infty x\log|x|f(x)\,\mathrm{d}x
&=\int_{-\infty}^\infty(x+\mu)\log|x+\mu|f(x+\mu)\,\mathrm{d}x\\
&=\mu\int_{-\infty}^\infty\log|x+\mu|f(x+\mu)\,\mathrm{d}x\\
&\phantom{=}+\int_{-\infty}^\infty x\log|x+\mu|f(x+\mu)\,\mathrm{d}x\\
&=\mu\int_{-\infty}^\infty\log|x|f(x)\,\mathrm{d}x\\
&\phantom{=}+\int_{-\infty}^\infty x\log|x+\mu|f(x+\mu)\,\mathrm{d}x\tag{1}
\end{align}
$$
Next
$$
\begin{align}
\varphi(x)
&=\int_{-\infty}^\infty x\log|x|f(x)\,\mathrm{d}x-\mu\int_{-\infty}^\infty
\log|x|f(x)\,\mathrm{d}x\\
&=\int_{-\infty}^\infty x\log|x+\mu|f(x+\mu)\,\mathrm{d}x\\
&=\frac{1}{\sigma\sqrt{2\pi}}\int_{-\infty}^\infty x\log|x+\mu|\;e^{-\frac12(x/\sigma)^2}\,\mathrm{d}x\\
&=\frac{\sigma}{\sqrt{2\pi}}\int_{-\infty}^\infty x\log|x+\mu/\sigma|\;e^{-x^2/2}\,\mathrm{d}x\\
&=\frac{\sigma}{\sqrt{2\pi}}=\hspace{-11.5pt}\int_{-\infty}^\infty\frac{1}{x+\mu/\sigma}\;e^{-x^2/2}\,\mathrm{d}x\tag{2}
\end{align}
$$
$\varphi(x)$ is an odd function of $\mu$, which is positive when $\mu>0$.
First note that
$$
\begin{align}
\varphi(\mu)+\varphi(-\mu)
&=\frac{\sigma}{\sqrt{2\pi}}
=\hspace{-11.5pt}\int_{-\infty}^\infty\frac{2x}{x^2-(\mu/\sigma)^2}\;e^{-x^2/2}\,\mathrm{d}x\\
&=0\tag{3}
\end{align}
$$
since $(3)$ is the integral of an odd function times an even function. Therefore, $\varphi$ is an odd function.
Furthermore, since $\varphi$ is odd, for $\mu>0$,
$$
\begin{align}
2\varphi(\mu)
&=\varphi(\mu)-\varphi(-\mu)\\
&=\frac{\sigma}{\sqrt{2\pi}}=\hspace{-11.5pt}\int_{-\infty}^\infty\frac{1}{x}\;\left(e^{-(x-\mu/\sigma)^2/2}-e^{-(x+\mu/\sigma)^2/2}\right)\,\mathrm{d}x\\
&=\frac{\sigma}{\sqrt{2\pi}}=\hspace{-11.5pt}\int_{-\infty}^\infty\frac{2}{x}\sinh\left(\frac{x\mu}{\sigma}\right)e^{-\frac12\left(x^2+(\mu/\sigma)^2\right)}\,\mathrm{d}x
\tag{4}
\end{align}
$$
Thus, the integrand in $(4)$ is positive for $\mu>0$. Therefore, $\varphi(\mu)>0$ for $\mu>0$.
Thus, your inequality is true for $\mu>0$.
Comment: Thanks a lot for the answer!
Comment: Sorry for the long answer, but as I was modifying my previous, erroneous answer, and there were already answers using the symmetry, I simply stayed with this.
Answer: Below is a probabilistic and somewhat noncomputational proof.
We ignore the restriction to the normal distribution in what follows below. Instead, we consider a mean-zero random variable $Z$ with a distribution symmetric about zero and set $X = \mu + Z$ for $\mu \in \mathbb R$.
Claim: Let $X$ be described as above such that $\mathbb E X\log|X|$ is finite for every $\mu$. Then, for $\mu \geq 0$,
$$
\mathbb E X \log |X| \geq \mu \mathbb E \log |X| \>
$$
and for $\mu < 0$,
$$\mathbb E X \log |X| \leq \mu \mathbb E \log |X| \>.$$
Proof. Since $X = \mu + Z$, we observe that
$$
\mathbb E X \log |X| = \mu \mathbb E \log |X| + \mathbb E Z \log |\mu + Z| \>,
$$
and so it suffices to analyze the second term on the right-hand side.
Define
$$
f(\mu) := \mathbb E Z \log|\mu+Z| \>.
$$
Then, by symmetry of $Z$, we have
$$
f(-\mu) = \mathbb E Z \log|{-\mu}+Z| = \mathbb E Z \log|\mu-Z| = - \mathbb E \tilde Z \log|\mu + \tilde Z| = - f(\mu) \>,
$$
where $\tilde Z = - Z$ has the same distribution as $Z$ and the last equality follows from this fact. This shows the $f$ is odd as a function of $\mu$.
Now, for $\mu \neq 0$,
$$
\frac{f(\mu) - f(-\mu)}{\mu} = \mathbb E \frac{Z}{\mu} \log \left|\frac{1+ Z/\mu}{1- Z/\mu}\right| \geq 0\>,
$$
since $x \log\left|\frac{1+x}{1-x}\right| \geq 0$, from which we conclude that $f(\mu) \geq 0$ for all $\mu > 0$.
Thus, for $\mu > 0$, $\mu \mathbb E \log |X|$ is a lower bound on the quantity of interest and for $\mu < 0$, it is an upper bound.
NB. In the particular case of a normal distribution, $X \sim \mathcal N(\mu,\sigma^2)$ and $Z \sim N(0,\sigma^2)$. The moment condition stated in the claim is satisfied.
Comment: I accepted the answer by mike (which follows similar lines) since it answers the case of OP. But thank you very much for the formal solution for the general case
Comment: @Ilya: Sure. I actually originally obtained my answer independently of the other two. I see some similarities with mike's (and robjohn's, too, actually), but I have a bit of a hard time parsing it. There appears to also be an error or two.
Answer: $\int x log \vert x \vert f(x) dx - \mu \int log \vert x \vert f(x) dx  = \int( x - \mu) log \vert x \vert f(x) dx  = \int x  log \vert x + \mu  \vert \phi(x) dx = \int_0^{\infty} x log(\vert \frac {\mu +x}{\mu - x}\vert )\phi(x) dx$     and the integrand is positive.  $\phi$ is symmetric is all that gets used.

Convex functions in integral inequality


Is there a Spotify repository that works for 12.04?

Question: The Spotify repository (deb http://repository.spotify.com stable non-free) doesn't work on Ubuntu 12.04 (download failed). Does anyone have a solution to install Spotify on Ubuntu 12.04?
Answer: Here's what worked for me:
echo "deb http://repository.spotify.com stable non-free" | sudo tee -a /etc/apt/sources.list

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4E9CFF4E

sudo apt-get update && sudo apt-get install spotify-client

Can you ping the repository?
$ ping repository.spotify.com

PING repository.spotify.com (126.96.36.199) 56(84) bytes of data.
64 bytes from judith.lon.spotify.com (184.108.40.206): icmp_req=1 ttl=58 time=189 ms

Answer: There is a new key. Use 94558F59 instead of 4E9CFF4E.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59

Answer: I presume your problem is/was the same that I had. That is you went and used the GUI tools for adding the repository. It won't work. It will automatically create a deb-src entry for the repo and they don't, obviously, provide one. Hence you get errors like this (depending on your language of course):
W: Tiedoston http://repository.spotify.com/dists/stable/InRelease nouto ei onnistunut
Unable to find expected entry 'non-free/source/Sources' in Release file (Wrong sources.list entry or malformed file)

The simple solution is to:
gksudo gedit /etc/apt/sources.list

and delete the deb-src spotify entry.
Then apt-get update should succeed and you can proceed to actually installing the Spotify client.
Answer: It must be done in terminal as root. You can get in Ubuntu 11.10 and newer, by sudo -i. Then follow this steps:

Open terminal and enter sudo -i
Add the following line to your list of repositories by editing your /etc/apt/sources.list file using gedit (gedit /etc/apt/sources.list)  and save it.
deb http://repository.spotify.com stable non-free
If you want to verify the downloaded packages, you will need to add our public key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59
Run sudo apt-get update
Install spotify!
sudo apt-get install spotify-client

SOURCE


Advice on refactoring jQuery time duration calculation

Question: I am relatively new to jQuery and javascript in general; I'm knowledgeable enough to write basic scripts but I could do with some help optimising some of my code which to me does not seem efficient, but I don't know the best way to alter it.
I have two input type='time' form fields and a hidden form field which is used to hold the difference between the two fields.
Here is my code:
function timeDifference(field1, field2) {
    var field1val = $(field1).val();
    var field2val = $(field2).val();

    if ((field1val !== '--:--') && (field2val !== '--:--')) {
        var hours = field1val.split(':')[0] - field2val.split(':')[0];
        var minutes = field1val.split(':')[1] - field2val.split(':')[1];

        minutes = minutes.toString().length<2?'0'+minutes:minutes;
        if(minutes<0){
        hours--;
        minutes = 60 + minutes;
        }
        hours = hours.toString().length<2?'0'+hours:hours;

        var difference = hours + ':' + minutes;
        return difference;
    } else return false;
};

    $('#assessmentHeaderStartTime, #assessmentHeaderEndTime').change(function() {
    var duration = timeDifference('#assessmentHeaderStartTime','#assessmentHeaderEndTime');
    $('#assessmentHeaderDuration').val(duration);
    });

I am dubious that .change() is the best way to go about updating the duration value but I'm not sure what would be the optimal solution. I know input type='time' is not supported across all browsers but for now Chrome & Safari are our main focus which both support it.
I thought about maybe using .keyup() to only calculate the duration once the user has finished typing in a time, but Chrome & Safari both provide the option of clicking arrows to increase/decrease time so you can input data in a few ways. Plus I know this will be used on tablets and I'm not exactly sure whether the time dials they use to select times count as clicks or key presses.
It seems inefficient to call the function every time a change is made when users could, for example, click and hold the button to increase the minute counter from 01 to 59 and have it call the function at every interval in between as part of normal usage behaviour.
I don't know what the optimal solution to this would be. Does anyone have any suggestions?
Answer: Are you sure that if you click the up arrow the change event is called?  From a quick test I ran it was not.
I was going to suggest using onBlur if the change event was firing too much, but it looks like the code you have will behave exactly how you want.  See this question for more details on the difference between onBlur and onChange.
Comment: Yes I am sure it change fires on the up arrow. All 3 fields are on the same page and you can see the duration field update as you click the arrows to change the two other time fields. Thanks for the link but as you say it looks like the code I've got now best fits how I want it to behave.


Helping others succeed

Question: What do you do when you are trying to help friends get themselves on a good track, but you are afraid that by helping them you yourself might fall...what is the Torah obligation here?
Answer: Speak to someone else who can help and won't be affected.
Answer: The Gemara in Nida discusses what a person should do with his nails. The Gemara there says that "chossid sorfan" - that a pious person should burn them so that a pregnant woman wouldn't accidentally step on uncovered nails. Tosfos says that this is true despite the damage one receives for burning parts of one's body. Therefore, we see that one should be willing to undergo a definite self-harm for the partial benefit of another.
If this is true physically, all the more so spiritually.
Comment: Just to clarify, it's saying that burning ones nails causes damage to the person even when they're _not_ still connected to their hands. ;)
Answer: Its simple, just give them advice or go to someone else to help your friend

Helping others succeed


Use Raspberry Pi with SSH disabled and no access to the screen

Question: I recently reinstalled Debian Jessie on a Pi 3. When I turn it on the screen is blank and my keyboard does not light up - before the reinstall, the GUI would only start and the keyboard would light up if I restarted it with putty.
I cannot remember how I ever managed to get it operating at that point, I think it worked magically the first time and then stopped. Now I have realized that I cannot ssh into it. I am in some trouble here as I have to present a working OpenHAB2 system to my boss by the end of the day.
Please save me.
Answer: I was able to enable SSH by plugging the SD card into my laptop and enabling SSH in <code>/etc/ssh/ssh_config</code>.


Computer Science + Electrical Engineering Project, Angle Projection

Question: I'm looking for some help in a project of my own that i can't get off the ground. I wanted to make some mechanism that can automatically shift to a certain angle based on computer input. Ex. On a computer i enter 48 degrees, the mechanism (which is no bigger than a normal protractor) starts off flat at 180 degrees then shifts to 48 degrees after input. What programming software helps with this, how do i build this. If it helps i am a CS Major
Answer: Most programming languages (C++, Java) allow you to interface to the computer's serial port (RS-232). If no physical serial port is available then you can use a low-cost UART-to-USB adapter.
Once you are able to send data out over serial you need to build something at the receiving end that interprets this data, probably a microcontroller (AVR, PIC, Arduino). Microcontrollers are very good at interfacing to low-level signals (e.g. analogue or digital 0-5V).
With the microcontorller you can control something like a linear actuator. This will allow you to physically move something. You will need a feedback system to know how far the linear actuator has travelled.
When you are able to successfully read the serial data from your pc program you then need to interpret the number and translate it to a value that corresponds with your linear actuator feedback (e.g. 48 degrees equals to 1.45V measured on an analogue input sent from your actuator feedback.
Based on how you asked your question I think you will have quite a learning curve to scale.
Good luck and feel free to come back here for any related questions you may have.
Comment: A common mechanism for this purpose is called a servo. So if OP does not want to design any hardware or do uC programming, search for "serial servo controller".


Is it ok to keep reusing a water bottle indefinitely?

Question: I have a 1.5 liter plastic water bottle (the disposable kind) that I keep on a shelf by my bed. I fill it every night before bed, and generally nearly finish it by the morning and refill it when I wake up. I recently noticed that I've been using the same bottle for months... is there any issue with this? Any mold concerns, etc? Or can I keep using it indefinitely?
Comment: In some underdeveloped countries, I understand they fill the bottle with unhealthy water, lay it on its side in the sun 4 - 6 hours.
The dirt settles, UV from the sunlight kills germs, and they drink it. If left to long in the sun, things start to grow. Not a recommendation. Clean & sterilize regularly.
Answer: The general prescription for water bottles is to recycle them, not reuse them. According to a University of Virginia paper:

Reuse of polycarbonate plastic bottles is generally not recommended by
  commercial bottled water manufacturers, as it may pose a health risk
  from two perspectives. First, everyday wear and tear from repeated
  washings and reuse can lead to physical breakdown of the plastic, such
  as visible thinning or cracks. Bacteria can harbor in the cracks,
  posing a health risk. Secondly, reuse of plastic water bottles can
  lead to bacterial contamination unless washed regularly. If a consumer
  wishes to reuse a plastic water bottle, it should be washed after each
  use in mild detergent only and rinsed well (9). The plastic should not
  be subjected to extreme, hot temperatures or harsh detergents, and
  should be carefully inspected for physical breakdown prior to reuse.

Additionally, the narrow opening can make it difficult to clean and dry properly.
Comment: Take a look at some of the stainless steel water bottles made by Kleen Canteen, Sigg, Camelbak and others.  They are durable, reusable, dishwasher safe, can be frozen (you should leave at least 10% of the volume empty because they won't expand like the thin plastic does), and they have wide mouths that allow easier cleaning and drying.
Comment: ok, doesn't sound like such a good idea then... guess I should buy the more heavy-duty reusable plastic type (we have some glass, but more prone to breakage, and can't be put in the freezer)
Answer: Another issue not addressed thus far is contamination by the breakdown of the plastic bottle itself. Here's a quote from the Environmental Working Group:

Hard plastic bottles (#7 plastic) can leach a harmful plastics chemical called bisphenol-A (BPA) into water. Carry stainless steel or other BPA-free bottles. Don't reuse bottled water bottles. The plastic can harbor bacteria and break down to release plastics chemicals.
Comment: Interesting. I too expected to see BPA warnings all over this conversation. I'm with you, man. Welcome to Seasoned Advice!
Answer: If your water is hard, you'll get mineral buildup. I've found algae, green/orange, growing on those mineral deposits. Likely bacteria and fungus grow there too. I clean the container out with vinegar then detergent every month or so. That seems to keep the growies down to unnoticeable levels.
From a safety standpoint, you should probably autoclave your bottle every morning.
Comment: I'm thinking the autoclave comment was meant to be tongue-in-cheek.
Comment: I'm pretty sure the bottle would melt. Perhaps a [Plasma Sterilizer](https://www.aspjj.com/us/product/sterilization)?
Comment: You clean a disposable plastic bottle with detergent? Or are you talking about one of the metal or "hard plastic" water bottles?
Comment: @Aaronut Plastic, type 1-PETE. As long as you're not soaking for long periods you shouldn't get much detergent migration into the plastic.
Comment: *Ew* (and 11 more char)
Comment: @CareyGregory So was my response
Answer: There was a case in Italy where the death of the girl was blamed on the water bottle she always used. It was then proclaimed by experts on TV to NOT be safe, so I'm discarding them now after I while. I can't find the story on Internet now, but I saw it on TV there. You can do some more research if you want.
I also noticed my bottle I use for running acquired a bad taste and smell after a year, although being washed.
Comment: I don't think a single unattributed headline and "I saw it on TV" really qualifies as a reliable source. If you're going to post an answer like this, you should be the one to do the research - don't ask readers to do it themselves.
Comment: TV *might* be a reliable source, if we even knew which "expert" or which broadcast it was. This simply states that something is dangerous and references an anonymous source that we can't possibly verify. It doesn't even offer an explanation of why it might be dangerous, how much time or how many uses are dangerous, under what conditions, etc... it just makes a blanket statement. That's not the way in which this type of subject should be approached. Answers about food safety should be based on verifiable facts.
Comment: I did try to find it on the Internet - as I posted above. I could go to Rai Uno and ask for their footage archives, then ask them to release the copyright so I can publish it for you. If the archive is not Internet based, I'd have to go to Rome to search it, pretty expensive project just to satisfy some self proclaimed police. Is the information not information if it's released through TV? Lastly, why are we wasting people's reading time by this meta talk, if you have or have heard an opinion on plastic bottles you're welcome to post it just like anyone else.
Comment: It was as reliable as multiple experts confirming it on a court case, which was reported on TV and discussed there further. But OK, since I don't have transcripts, you win.
Comment: @Aaronut: Anyway I'm leaving the answer here not minding the infantile points race, as it might be way to important for someone.


Is there a quantum Hermite reciprocity?

Question: It is well known that there is an isomorphism of $SL_2=SL(V)$ representations
$$
Sym^n(Sym^m(V))\simeq Sym^m(Sym^n(V))
$$
called Hermite reciprocity (discovered in 1854).
My question is: Is there anything like this isomorphism
for $U_q(sl_2)$, at least for generic $q$?
Comment: What do you mean by $\operatorname{Sym}$ in the quantum case? Homogeneous components of the "symmetric" algebra constructed using the braiding, a.k.a. Nichol's algebra?
Comment: The inner of sym is clear it is the corresponding irreducible representation of the quantum group. But indeed the outer sym
is not clear at least to me. In fact my question can be rephrased as:
is there a good definition of the outer sym for which one has a Hermite isomorphism?
Answer: There is in fact a reasonable way to define quantum analogues of symmetric and exterior powers of a finite-dimensional representation of $U_q(\mathfrak{g})$.  Let $V$ be such a representation, and let $\hat{R} : V \otimes V \to V \otimes V$ be the braiding of $V$ coming from the universal R-matrix.
It is a fact (see, for instance, Proposition 22 and Corollary 23 in Chapter 8 of the book Quantum Groups and Their Representations, by Klimyk and Schmudgen) that the eigenvalues of $\hat{R}$ are all of the form $\pm q^{t_i}$, where $t_i \in \mathbb{Q}$.  Call the eigenvalues of the form $+q^{t_i}$ positive, and those of the form $-q^{t_i}$ negative (this notion is well-defined if $q$ is not a root of unity).  Then call eigenvectors for $\hat{R}$ positive or negative, respectively, if their eigenvalues are positive or negative.
The idea is that positive eigenvectors are $q$-symmetric, while negative eigenvectors are $q$-antisymmetric.
Then define
$$
S_q^2 V = \mathrm{span} \{ \text{positive eigenvectors} \}
$$
and
$$
\Lambda_q^2 V = \mathrm{span} \{ \text{negative eigenvectors} \}.
$$
Since $\hat{R}$ is diagonalizable, $V \otimes V = S_q^2V \oplus \Lambda^2_q V$.
For example, when $V$ is the 2-dimensional representation of $U_q(\mathfrak{sl}_2)$ with weight basis $x,y$, where $x$ is the highest weight vector, we have
$$
S_q^2 V = \mathrm{span} \{ x \otimes x, y \otimes x - q x \otimes y, y \otimes y  \},
$$
and
$$
\Lambda_q^2 V = \mathrm{span} \{ y \otimes x + q^{-1} x \otimes y  \}.
$$
Finally, you can define higher quantum symmetric powers $S^n_qV$ to be the submodules of $V^{\otimes n}$ created by intersecting the submodules of tensors that are $q$-symmetric in all $n-1$ consecutive pairs of entries:
$$
S^n_q V = (S^2_q V \otimes V^{\otimes n -2}) \cap  \dots \cap (V^{\otimes n -2} \otimes S_q^2 V).
$$
There is also a closely related notion of quantum symmetric algebra, which is a graded $U_q(\mathfrak{g})$-module algebra whose homogeneous components are isomorphic to the quantum symmetric algebra defined above.
Anyway, that's the good news; there is a not-too-bad definition of quantum symmetric powers.  The bad news is that it doesn't always give you the classical result.  The quantum symmetric powers of a module are no larger than their classical counterparts, and the module is called flat (in a different sense than the usual homological one) if all of its q-symmetric powers (or equivalently, just the q-symmetric cube) are the right size.
The flat simple modules $V_\lambda$ have been classified by Sebastian Zwicknagl in his paper R-Matrix Poisson Algebras and their Deformations.
For each semisimple Lie algebra there are only finitely many flat simple modules.
In the paper Braided Symmetric Algebras of $U_q(\mathfrak{sl_2})$-modules and Their Geometry, he computes all of the quantum symmetric powers of simple $U_q(\mathfrak{sl_2})$-modules.
It turns out that if $V$ is the 2-dimensional simple module, then its symmetric powers are the right size, i.e.
$$
S^n_q V \cong V_n,
$$
where $V_n$ is the $(n+1)$-dimensional simple module.
So your question about Hermite Reciprocity boils down to the question: are $S^m_q V_n$ and $S^n_q V_m$ isomorphic for any $m$ and $n$?
The answer is that they are not.  The first example is $m=3$ and $n = 4$, which follows from the computation in Theorem 3.1 of the second paper I referenced.  The decompositions into simple modules are:
$$ S^4_q(V_3) \cong V_{12} \oplus V_8,
$$
while
$$ S^3_q(V_4) \cong V_{12} \oplus V_{8} \oplus V_{4} \oplus V_{0}.
$$
Of course, this doesn't rule out the possibility of a better definition which does satisfy Hermite Reciprocity, but nobody has come up with one yet.  And if you want everything to be $U_q(\mathfrak{g})$-equivariant, then your choices are pretty rigid.  But perhaps if you let go of that requirement then something more is possible.
Comment: @MTS: that seems related to the comment by Sasha below, but with much more details. Thanks, that's very helpful.
Answer: Take the question to be: Can we define a $q$-analogue of $Symm^n$? Then we can cheat and declare it has the same character as for $q=1$. I suspect there is not a principled way of doing this. My circumstantial evidence is that no-one has come up with a way of defining $Symm^n$ even for $n=2$ for crystal graphs.
Comment: One can define $Sym^n(V_\lambda)$ as the subspace `$\{v: R_iv=c_\lambda v\}$`, where $c_\lambda$ is the (easily computable) eigenvalue of $R$ on $v_\lambda\otimes v_\lambda\in V_\lambda\otimes V_\lambda$. The difficulty of generalizing it to reducible representations is that $c_\lambda$ depends on $\lambda$....
Comment: How about this for Sym^n(Sym^m): one could try to build
the corresponding projector in V tensored with itself nm times
seen as n groups of m strands. For each group use the formula for the m-th Jones-Wentzl projector. There is a formula for that with a sum over permutations. I am wondering if there is a similar formula which can be found at the next level when permuting the groups. I guess crossings would be implemented by R-matrices. Couldnt' something like this work? i.e. give an equivariant projection which has the same decomposition into irreducibles as in the classical case?
Comment: I don't see a way to do this; hence my pessimistic answer. Maybe someone else will come up with something?
Comment: @ Sasha: what do you mean by $v_\lambda$? Is it a highest weight vector? Somebody else could be interested in reducible representations but I am not. So what you say works in the case when $V_\lambda$ is the symmetric power of the fundamental representation i.e. $\lambda$ has one part, right? Is it obvious that the iterated symmetric power defined in this way is an sl_2,q module?
If this is the case, do you think Hermite reciprocity holds?

Is there a quantum Hermite reciprocity?


Having Problems On Organizing Code In Packages

Question: On my Android project I have the main Activity called TestFIO, which is in the package org.testing.file.io.main, and I tried to keep it clear and sent all the functions I had to a new class called FileManipulator, which is located at org.testing.file.io.main.manipulator. Here is how the FileManipulator class looks like:
package org.testing.file.io.main.manipulator;

// imports here

public class FileManipulator extends TestFIO {
    public String readFileFromCard(String location) {
        // some code here
    }

    // more functions here
}

And here is an example of TestFIO:
// header with package and imports

import org.testing.file.io.main.manipulator.FileManipulator;

public class TestFIO extends ListActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final String[] fileString = readFileFromCard(Environment.getExternalStorageDirectory() + "test.txt");
    }
}

The problem is that Eclipse is underlining readFileFromCard and showing the following error:

What am I doing wrong or how is the correct way to organize my code in packages?
PS: Sorry if this is a dumb question, I'm coming from iOS development.
Comment: You are calling a Child's method in your Parent Class and its a violation of inheritance Rule
Answer: I see TestFIO is parent class, FileManipulator is child class according to your code.
Then you can't call child class' method, you need a instance of FileManipulator.
Am I wrong?
Answer: The compile problem is because you're trying to call a method defined in a subclass from the superclass. Inheritance doesn't work that way; subclasses inherit all public and protected methods from the superclass, but superclasses don't know anything about the methods of their subclasses.
Additionally, it doesn't seem reasonable to have FileManipulator extend your Activity class. Does FileManipulator pass the "is-a" test, in other words, is it a kind of Activity? It seems more like it's a "helper" class that the Activity will use to do its work. In that case, FileManipulator should not extend TestFIO but rather be stand-alone, created by TestFIO.
Comment: A more robust but slightly more complex solution would be to make the "helper" class an `AnsycTask` instead. Here is a good tutorial about `AyncTask` and some other options: http://www.vogella.de/articles/AndroidPerformance/article.html
Comment: What should I do for my class to work on the `Activity` class? `FileManipulator` uses `getBaseContext()` to show up a `Toast` so I extended the `Activity`.   *Sorry if this is a dumb question, I'm coming from iOS development.*
Comment: There are a couple of ways to get a "helper" class to invoke UI changes. The simplest is to just pass the instance of `Activity` when you create the `FileManipulator`, but there's a caveat to that simple solution: you can only invoke methods that change the UI from the thread that created the UI (sometimes called the "UI Thread"). Depending on how FileManipulator is being used, that might be OK in your app or might cause exceptions.


Does the conditional density $f(X|X+Y<a)$ equal to $f(X)$ when $X,Y$ are independent continuous random variables with $Y$ having full support?

Question: I wonder if the following equation holds when continuous random variables $X,Y$ are independent from each other and random variable $Y$ has full support on $\mathbb{R}$.
\begin{align}
f(X)=f(X|X+Y<a)
\end{align}
where $a$ is a real constant.
Comment: Consider $X, Y$ i.i.d. Normal$(0,1)$, and $a=-3$.   Is the probability that $X>0$ still $50\%$?
Comment: @jbowman Thank you. I feel the equation does not hold. But, on the other hand, I always feel that I can vary $Y$ freely to accommodate any $X$. So, the inequality is not really a restriction. I know this should be wrong, but I don't know where I am wrong intuitively.
Answer: Imagine a plot of the joint distribution of $X,Y$. The condition $X+Y <a$ can be depicted by a diagonal line $y=a-x$ as a boundary. The points below it satisfy the condition.

Second image
Next, consider the marginal distribution by summing all the distributions of $X$ for the various values of $Y$. This will be a sum of right truncated distributions $ P_{X\vert X<c}(x\vert c) $ of $X$ (Three of those truncated distributions are shown in the second image in red, green and blue. Also the related points of the joint distribution are coloured in the first graph).
Your end result will be
$$\sum_{\forall y} P_{X\vert X <c}(x\vert a-y) P_Y (y) $$
When $P_Y (y)$ is positive everywhere then it must be that you are taking some bite out of the right side of the distribution of $X $.

Third image
You could also view the image in another direction. And quantify how much of a bite you take out of $X $ by using the cdf $P_{Y<c}(c)$
$$P_{X|X+Y <a}(x|y,a) \propto P_X(x) \cdot P_{Y <c}(a-x) $$
When The PDF of $Y $ is positive everywhere (full support), then the CDF $P_{Y <c}(y)$ will be a continuously increasing function and the 'bite' will be larger for higher values of $X$. (you can see this in the image as the increasing fraction of gray points - those that do not fulfill the condition - as you move to higher for values of $x$)
$X $ remaines only unaffected when $X $ follows a degenerate distribution (ie has only one value). (or when $Y$ has not full support, and more particularly when the CDF of $Y$ is constant for all values of $X$, ie when $P_Y(z) = 0$ if $P_X(z)>0$ )

The above formulas are expressed for discrete variables but the same logic works for continuous variables.
$$f_{X \vert X+Y<a}(x \vert a) \propto f_X(x) F_Y(a-x)$$
Comment: Thank you so much! I read it very carefully. This is super clear and helpful.


VMWare player is crashing the whole OS

Question: I am using ubuntu 12.04 (with latest updates) on Lenovo Thinkpad T430. Both OS and machine are 64 bits and I got crashes when try to use vmware player to create a VM.
I have install vmware player 64 bit from the official site successfully but when I start to create a vm the whole machines restarts
Any one know the issue ?
Thanks
Comment: Is there no message of kernel panic? Try looking at `dmesg`, especially the lines  right before the reboot.
Answer: I also encountered this issue.
My setup:

Lenovo T430s
Ubuntu 12.04
BIOS Ver. G7ET60WW (2.02)

Whenever I tried to open a VM using either VMware Player/WorkStation as well as Virtual box running on Ubuntu 12.04, the machine would immediately re-boot.
What worked for me:
In the BIOS there is a Security tab and within that there is a Virtualization section. It has two options

Intel Virtualization Technology
Intel VT-d Feature

Both options were disabled on my machine. I enabled both of them. Saved the new BIOS setting and re-started the machine and I was able to boot and create VM's using the above.
Try that and see if it works...

VMWare player is crashing the whole OS


How to tell my advisor that I would probably search for a job?

Question: A bit of background: I'm a non-european phd student in europe doing a phd in a computational field. Recently I've applied and obtained a grant. The grant came with a unfortunate pay cut of 15% and I was barely scraping by with my pre-grant salary (paid from my advisor's project). I've accepted the grant as it was more secure (I was assured funding for a certain amount of years). I've asked my advisor if I could teach for the difference in my salary, which I was declined due to language restrictions. I was offered an alternative to that, a software developer position. But my advisor keeps postponing the signing of the contract for that stating issues like accounting trouble at university administration. Its been six months I've been on this reduced salary, to a point that I have to borrow to survive. I've applied for a two jobs and got interviewed for one. The results are still unknown. I'm not sure if it will impact our professional relationship if I mention to him that I'm going to search of a second job. How would i approach this?
Answer: I think the only way to approach this is directly, saying to them that you are unable to live at the level of funding you are currently getting and need to supplement it somehow. Say that a job is one possibility if they can't provide any additional funding relatively soon, but you need a resolution. Say you are flexible, but the current situation is untenable.
If they say there is no resolution possible then you have to make hard decisions about leaving for something better. It might delay your career a bit but the long term might be better. Hard decisions.
If you have family obligations, as many do, it can be an additional incentive both for you and your advisor to find a solution.


Why are normal maps in tangent space but not in normal space?

Question: I want to implement normal mapping in my little game engine. When getting into normal mapping, I wonder why normal maps are typically in tangent space but not in normal space? That normal maps in object space would be complicated to handle is clear to me. But when in normal space, they could be easily added to the vertex normal, couldn't they? It seems that tangent space requires to construct a transformations matrix for each pixel.
Comment: What do you mean by "normal space"?  How would you define this space?
Comment: By normal space I mean a space orthogonal to tangent space. The further difference is that a normal vector is fixed which a tangent can be rotated around the normal. In [this illustration I made](http://i.stack.imgur.com/xhHzG.jpg) a offset in normal space is shown in red while a offset in tangent space is shown in blue. Maybe I haven't understand normal mapping and there is actually no distinction between normal space and tangent space?
Answer: A space is not just an axis though.  Tangent space has 3 axes: the U tangent, the V tangent, and the normal.  In your illustration you add an offset to the normal.  But how do you know which direction to offset it?  That's what tangent space defines.  If the normal is Z, the tangent space gives you the orthogonal X and Y directions in which your offset vector lives.
Now, you could define the X and Y directions for your space in any way you like.  But there's a good reason to define them using the UV mapping, which is that the normal map then makes sense visually: its red channel represents horizontal offsets - horizontal relative to the texture - and its green channel represents vertical offsets relative to the texture.  It's this property of being relative to the texture that makes it possible to create a normal map matching the rest of your texture set (diffuse, specular, etc.) and apply it to surfaces of different orientations.
(BTW, the offset-vector formulation of a normal map is called a partial derivative normal map.  It's handy because it offers better results for blending multiple normal maps together).
Comment: Thanks a lot. I had a wrong understanding of normal mapping. Also thanks for the helpful links.
Answer: To try and make reasonalby comple mathematical theory sort and concise: it is because the Normal is actually a co-vector rather than a vector. The difference between a covector and a vector is that a co-vector defines an opposite 'handedness' on sign reversal, while a vector defines an opposite 'direction' on sign reversal. For instance, reversing the normal to a plane defines the same plane, but with CW and CCW reversed.
For a more rigorous distinction you will have to get into the theory in fair depth.


What elementary particles have properties that vary by spin direction?

Question: This table of elementary particles indicates that electron spin = 1/2.
My understanding is that electron spin may proceed in two directions which may be denoted by spin sign and that electron spin direction correlates to differences in magnetic interactions. What other elementary particles with nonzero spin have properties that vary by spin direction?
Comment: For the electron , spin 1/2 is the total spin, whereas spin $\pm 1/2$ is the $z$-component of the spin.
Answer: Your question indicates a lack of understanding of quantum spin; however, don't let that stop you.
Electron (and mus, taus, nus, and all the quarks) have intrinsic spin quantum number $s=\frac 1 2$, which means they carry angular momentum:
$$ |S| = \hbar \sqrt{s(s+1)} = \frac{\sqrt 3}2\hbar $$
Nothing is spinning, per se. In the Standard Model, these are point particles with intrinsic angular momentum; that is, the angular momentum is a property of the particle.
The spin can point in any direction, the problem is we can't know that direction fully. For spin 1/2, we can know the project of the spin onto an axis, and the projection can be $\pm \frac 1 2 \hbar$.
Particles with intrinsic spin also have magnetic moments:
$$ \mu = g\vec S$$
where the constant of proptionbality is the aptly named "$g$-factor".
The magnetic ($\vec B$) interaction has an energy term:
$$ H = \vec \mu \cdot \vec B $$
so that the two eigenstates of known projected spin-angular momentum are non-degenerate energy eigenstates too.
This is a more precise phrasing than "[the] electron spin direction correlates to differences in magnetic interactions".
Nevertheless, that does not render moot:
"What other elementary particles with nonzero spin have properties that vary by spin direction?"
Here we need to look at the Weak Interaction and consider the spin projection onto to the momentum (aka, helicity):
$$ h = \vec S \cdot \hat p $$
For simplicity, I'll consider neutrinos in the massless limit. In that case the helicity is fixed in all reference frames. Positive (negative) helicity is called right (left) handed.
Here is the kicker: neutrinos only interact via the Weak Interaction, and the Weak Interaction only couples to left handed neutrinos and right handed antineutrinos. So that is rather surprising: if you flip the spin direction you turn off the weak force. Of course, there are many subtleties in the weak interaction that I am glossing over).
Comment: A good answer but also might want to include why a half integer spin particle differs from an integer spin particle, or the special case of a zero spin particle.
Answer: Protons, neutrons, muons and tauons also have spin and a magnetic moment. In the standard model W bosons, having spin 1, are predicted to have a magnetic moment. This remains to confirmed experimentally. All of these have a magnetic field that varies with spin direction, like the electron does.
Comment: @GiorgioP I don't follow your comment. I don't "critique or request clarification". I provide an answer.
Comment: @GiorgioP I understand and propose to delete the comments.


How to use APC only for frontend?

Question: we have recently installed an apc cache for our magento shop and it works so far.
Now we have a new module using ioncube Loader and as far as we now know these two things are not compatible.
The module only works in the backend so I hope to find  a way to deactivate apc for backend area.
But I can't find an option in the apc config to do so.
Isn't it possible to restrict the apc?
Comment: AFAIK there's no compatibility issues with APC and ionCube Loader. Have you seen any issues with both of them running side-by-side?
Comment: Unfortunately I have. We are using an importer connecting to several marketplaces and to our shop. And as soon as we activate APC the importer drives crazy and is in no condition to fullfil the job. The AOE Scheduler can finish the importer jobs and creates race conditions.
Comment: Have you considered using another OPCache like Zend instead?
Answer: if you are talking about php pecl apc module, then i think it works for real files
http://www.php.net/manual/en/apc.configuration.php#ini.apc.filters
apc.filters = "-/var/www/magento/app/code/POOL/MODULE/.*"

or something like this. it will match every php file for that module, and exclude it from apc. never tried this honestly.
Answer: what you are searching for is APCu, it only implements the caching without all the opcode stuff.
http://php.net/manual/en/book.apcu.php
But I am pretty sure Ioncube in generell is compatible to opcache, as this is a very basic and needed Part of PHP.
Answer: Unfortunately, this is not possible by default. Magento's cache does not separate out the frontend and backend.
A solution would be to create a new Magento site (by symlinking the files) and create a new app/etc/local.xml with the values that you need. You will have to access the admin panel at a different location (like another folder or a subdomain).

How to use APC only for frontend?


Issue with Connected-App. Java-Salesforce Rest API

Question: I am getting an issue from my local java application running at http://localhost:8080. When I enter this address inthe browser, I am being redirected to a login.salesforce.com, but I see a blank screen with the error error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration. I have configured the callback_uri as http://localhost:8080 which is where salesforce should redirect me after authentication. But instead shows me this error. Anyone ran into this issue before?
Answer: This explanation might help you to find the issue https://success.salesforce.com/answers?id=90630000000CzqNAAS


Nginx, Wordpress and URL rewriting problems

Question: Trying to get Nginx and Wordpress to play nicely but it seems that they don't understand each other quite yet, especially in terms of pretty urls and rewriting.
I have the following snippet in my config file for nginx at the bottom (got it from Nginx's wiki page on WP), and I keep getting this error message in my error log, which makes me think it's not even trying to rewrite the location.
2011/04/11 09:02:29 [error] 1208#1256: *284 "c:/local/path/2011/04/10/hello-world/index.html" is not found (3: The system cannot find the path specified), client: 127.0.0.1, server: localhost, request: "GET /2011/04/10/hello-world/ HTTP/1.1", host: "dev.local:83"

If anyone can help give me direction or pointers or links or suggestions, that would be amazing because I'm seriously stuck.  Thanks!
NGINX
worker_processes  1;
pid        logs/nginx.pid;

events {
    worker_connections  64;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    #gzip
    gzip on;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_min_length  1100;
    gzip_buffers 16 8k;
    gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    # Some version of IE 6 don't handle compression well on some mime-types, so just disable for them
    gzip_disable "MSIE [1-6].(?!.*SV1)";
    # Set a vary header so downstream proxies don't send cached gzipped content to IE6
    gzip_vary on;

    server {
        listen       83;
        server_name  localhost  dev.local;
        root   c:/local/path;
        index  index.php;

        location / {
            try_files $uri $uri/ /index.php;
        }

        #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:521;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_intercept_errors on;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }

}

Answer: Absolute paths like the one you specified gets translated into a /cygdrive/c/-path even if you don't have cygwin installed. For Windows I suggest you use relative paths if possible. Relative to the nginx directory.


Alternative to 'hype' for an academic paper

Question: I am working on an academic paper, and I want to describe the scientific community's hype regarding a certain technology. The word 'hype' is concise and describes exactly what I mean, but I'm not sure the word has the proper tone for an academic document. Is there an alternative term or concise phrase that gets the same idea across in a more academic tone?
Comment: I'm not as academic as the link on your profile shows you are, but my thinking is, if it can be found in all these federal court cases ([http://scholar.google.com/scholar?hl=en&q=hype&as_sdt=3%2C44&as_ylo=&as_vis=0][1]), then maybe it's OK in an academic setting as well.
Comment: Are you looking for a word that simply means that something is being promoted aggressively, or one with the sometimes-more-negative connotation?
Answer: Aggrandizement ("act of aggrandizing", ie, of making to appear great or greater) may serve, or perhaps exaltation ("the act of exalting or raising high"), glorification ("act of glorifying", particularly in sense of making something appear more glorious than it is), deification ("act of deifying", ie, of treating as worthy of worship or regarding as a deity).   Less formally, consider kowtowing, advertising, or  buzzing.
Answer: Maybe buildup would work, if there is a sense of increasing attention being paid to the technology.
Or perhaps "the scientific community's enthusiasm for a technology is..."
Answer: How about aggressive promotion or overblown promotion?
Answer: I think hype is perfectly fine, even in a formal academic context -- it is the best word for the job... If you want to tip a hat to the formality, consider italicising it, or putting it in quotes.
Answer: What about increasing popularity?
(Maybe that doesn't carry a negative enough connotation for what you want, but that inference could be handled by the accompanying context.)
Answer: What about using the word from which "hype" probably originated — hyperbole?
Comment: That could *not* under any circumstances suit the context.


Taking money for donating blood voluntarily

Question: I went to donate blood in a hospital. A brother from the patient's side arranged good food for me. He sometimes insisted me to choose any food. So, I decided. And after blood donation, he managed the transportation. He dropped me at my home. When I was at the gate of my house, he gave me a good amount of money. I did not want to take this but he put it in my hand and insisted. He said to me, "Have some fruits purchased." So, was it permissible?
Comment: Why would you think it is not permissible?
Comment: As far as I know, selling blood or any body parts is prohibited.
Comment: @goldPseudo It is impermissible to sell blood or take money/reward for blood donation, see [Surah Maidah 5 : 3](https://www.quran.com/5/3) and [Is Blood Donation for Money Permissible?](https://aboutislam.net/counseling/ask-the-scholar/health-science/is-blood-donation-for-money-permissible/).
Answer: Selling is considered when you deliberately give someone something ONLY IN EXCHANGE for a return. In this case, he gave you the money of his own free will without you requesting it. In this case, in which he gave it to you of his own free will because of the good you did it is considered a Hadiyah (translates to gift) which in fact is a Sunnah to receive. The Prophet (PBUH) did not deny gifts.
It was narrated that the Prophet (PBUH) said:

"Come to the invitation, do not reject the gift, and do not abuse the
Muslims." (Narrated by Ahmad, Ibn Abi Syaibah, Al Bukhari in Adabul
Mufrad and Shahihul Jami 'Ash Shaghir [158])

Another narration:

"If I were invited to a meal of a sheep's foot I would accept, and if
I were given a sheep's foot as a gift, I would accept." (Narrated by
al-Bukhaari (5178))."

One last one to strengthen my point even more:

Indeed, his acceptance of gifts was one of the signs of his
Prophethood for the people who followed previously-revealed Books.
Salmaan al-Faarisi (may Allaah be pleased with him) recognized him by
that, as is told in the story of how he came to Islam, as narrated in
the Musnad of Imam Ahmad (5/441)

I'll draw an analogy here and finish off my answer Insha Allah.
Consider it like this, you help walk an elderly person across the road just for the sake of Allah. If they give you a reward in return, it is considered Hadiyah. You did not require them before helping that I'll have $10 for helping you, they gave it to you because they were pleased with you. The exact same example applies in this case, it doesn't matter if what you helped them with was blood, finance, walking across the street, etc. As long as what you did, was to actually help them in a Halal manner (in this case, fighting some deadly blood disease, etc.) then it is alright for you to keep the gift if they gave it to you due to their pleasure and without you expecting it from them in the first place.
So it in fact seems like a reward from Allah for your act, may he bless you more.
One more tip: It is also believed by some scholars that if you do like the gift, then keep it, if you do not, give it away in Sadaqah. Utilizing a gift (Eating food, wearing clothes, spending money, etc.) and doing Sadaqah are both Sunnah, so both are rewarded by Allah (SWT).
And Allah knows the best.
Comment: @AbduRahman Please do yourself a favor and read the question itself instead of the title.  The question states that he donated blood feesabeelillah, and was given a gift out of the pleasure of the one who was helped. This is not considered selling. As for scholarly instances, there are none from earlier, more established scholars as blood donation wasn't a thing. And this is a very specific question about taking a gift for donating blood, not selling it. They should get a Fatwa from a scholar on their own rather than asking here, but nonetheless there are no modern Fatwas on this as well.
Comment: Oh and the sources you linked are entirely for selling blood, in this case, blood was not sold at all. The doner received a gift from the people/organization/representative receiving the blood, nothing more than that.
Comment: The question title clearly says **Taking money for blood donation**, It is impermissible to do that. Not talking about gifts, and atleast include the stances of scholars rather than give indirect blows at the question kindly.
Answer: It is impermissible to take reward/money for blood donation
There is an agreement among Muslim jurists on the impermissiblity of selling blood. The Quran explicitly declares:

Forbidden to you is [the consumption of] carrion, and blood… (Al-Ma'idah 5:3)

Say, ˹O Prophet,˺ "I do not find in what has been revealed to me anything forbidden to eat except carrion, running blood, swine—which is impure—or a sinful offering in the name of any other than Allah. But if someone is compelled by necessity—neither driven by desire nor exceeding immediate need—then surely your Lord is All-Forgiving, Most Merciful." (6:145)

The Messenger of Allah (peace be upon him) sets a rule that dictates "When Allah forbids people to eat something, He forbids its price for them as well."
Narrated Ibn Abbas:

I saw the Messenger of Allah sitting neat the Black stone (or at a corner of the Ka`bah). He said: He (the Prophet) raised his eyes towards the heaven, and laughed, and he said: May Allah curse the Jews! He said this three times. Allah declared unlawful for them the fats (of the animals which died a natural death); they sold them and they enjoyed the price they received for them. When Allah declared eating of thing forbidden for the people, He declares it price also forbidden for them." (Abu Dawud) graded Saheeh by Albani

Narrated Awn ibn Abu Juhaifah:

My father bought a slave who practiced the profession of cupping. (My father broke the slave's instruments of cupping). I asked my father why he had done so. He replied, "The Prophet forbade the acceptance of the price of a dog or blood, and also forbade the profession of tattooing, getting tattooed and receiving or giving Riba, (usury), and cursed the picture-makers." (Al-Bukhari)

Al-Haafiz said in al-Fath:

What is meant by the prohibition of blood is the same as the prohibition of dead meat and pork. It is haraam according to scholarly consensus, i.e., selling blood and taking its price.

How to dispose the blood donation reward
The best way to dispose of the (forcefully) given reward/money to you for blood donation is to give it to a poor person, charity or a sound organization. In this way you do not need to argue with the reward-er and would not consume haram.

For more upon this topic see :

Is Blood Donation for Money Permissible? by aboutislam.net
Rewards for donating blood and Prohibition on selling blood  by islamqa.info
Comment: The verses you have mentioned have absolutely nothing to do with blood donations, they are for the prohibition of drinking blood. There is 'Ijmah amongst the scholars that blood donations are Halal as they are utilized for medical treatments, and all other things, such as alcohol, are permissible if used to cure a deadly disease, and most cases in which donation blood is used, are deadly problems.
Comment: @SyedMohammadSannan Did you read the below Hadith.
Comment: @AbdulRahman Again, the Hadith has nothing to do with it. Selling something, and donating something feesabelillah are different. If you sell something Haram, the gain from it is Haram as well. If you donate something to help someone for the cause of Allah, and someone gives you a little gift, out of their pleasure, that has nothing to do with you selling the blood, then it is permissible.

In this case, they donated blood, which is usually only used to treat deadly medical diseases, thus it is Halal to donate as well and a form of Sadaqah.
Comment: @SyedMohammadSannan Where have I mentioned gifts,  I said taking money or reward solely for donating blood is impermissible.


Do swing traders look at fundamentals?

Question: If they do, what fundamental analysis do they look at?
Answer: Swing trading involves holding a long or short position for more than one day up to several weeks.  Most will use technical analysis as their guide for entry and exit.  It attempts to  capture short term price movements, usually in more volatile stocks.  Volatility is a trader's best friend.
Swing trading involves several decisions:

Direction of trade (long or short)
Entry price
Exit price
Stop loss price

A swing trader might use fundamental analysis for screening stocks to create a trading list but beyond that, fundamentals play little to no part in it.  The financials of a company are relevant to investors, not short term traders.
Answer: It really depends. Every type of trader has their strategy.
When I swing trade stocks, the technicals are what get me interested. I have to see a nice setup with favorable risk/reward.
If the technical setup isn't there, I won't place the trade.
I will, however, look at basic fundamentals before entering some of these trades. I don't do in-depth research but I will analyze things like:

Share structure
Basic financials (i.e. profitability, P/E, EPS, etc.)
Upcoming catalysts (i.e. news and earnings)
Warrants and offerings (for potential dilution)

This approach to fundamental analysis takes less than 10 minutes or so and I find it beneficial when I plan to hold a stock for a few weeks. I may as well know a little bit about the stock I am holding, even if the trade is driven by technicals.
A small amount of fundamental analysis can protect you from surprises. For example, if you find the perfect technical setup and neglect the fact that the company reports earnings soon, you may watch your trade unravel as the company reports subpar earnings.
Comment: Fundamental analysis uses revenues, earnings, and other financial data  to determine a company's underlying value and potential for  growth. I don't think that  pending news events (such as earnings announcements) enter into that evaluation.
Comment: @BobBaerker That's fair. We all have our own interpretations. To me, fundamentals are anything related to the company itself whereas technicals are related to price and volume.
Answer: Nope, why should they?
Fundamentals are for investment. Anything TRADERS care are not fundamentals - but CHANGES in fundamentals that are not foreseen.
Example: Microsoft. SOLID company. This is priced in. Their guidance tells you how the next profit looks. As a swing trader your horizon is maybe a month (and that is long) - you think ANYTHING significant will change at Microsoft in a month that is not already visible in news reports - and thus priced in? Nope.
Now, The US president does not like Microsoft and suddenly out of the blue announces microsoft is forbidden to operate and have employeed in the USA (note: TOTALLY unrealistic, but that is not the point here). This is a fundamental change and - and that is important - it is suddenly and out of the blue, so it is NOT in the prices. THAT may interest swing traders. But otherwise - swing traders look at quite low timeframes and fundamentals do generally NOT change in these timeframes.
Answer: No, swing traders are motivated by news and trading tools to convince themselves to do so. It is no different than gambling on probabilities
The keyword for a swing trader is to tell a story. Logically, fundamental stories can be part of the storytelling or hindsight.
Note : Be careful not to confuse swing trading with High-frequency trading.
Comment: I think that linking Daniel Kahneman  with swing trading  is a bit of a stretch.

Do swing traders look at fundamentals?


Script to automatically make a new bookmark folder in Skim for each PDF and store every bookmark created in it's respective folder?

Question: Skim by default makes every new bookmark in the bookmark menu for all the pdf's,  even if I create a bookmark folder for the pdf manually, there is no way of making it save the bookmark in this folder automatically because in the save bookmark dialogue by default the Add To field will show Bookmarks Menu as the default location, which I have to manually change to the folder I created each time. So I was wondering if there is a applescript method of automating all this so, a bookmark folder will be automatically created when I save the first bookmark and every consequent bookmark will be automatically saved into this folder.
Answer: Apparently Skim has a nice Wiki, which covers much, including Wiki: AppleScript and has quite a few scripts available.  One of which is called: Synchronize Folder Bookmark
Also read the section on the Script Menu.

Synchronize Skim Folder Bookmark.scpt
<code>(*
Folder Action script to keep a Skim folder bookmark synchronized with the contents of a folder.
• Save this in ~/Library/Scripts/Folder Action Scripts
• Select the folder in Finder
• Choose Services > Folder Actions Setup… from the main or contextual menu
• Select this script
*)

on adding folder items to theFolder after receiving addedItems
    my synchronizeFolderBookmark(theFolder as alias)
end adding folder items to

on removing folder items from theFolder after losing removedItems
    my synchronizeFolderBookmark(theFolder as alias)
end removing folder items from

on run
    my synchronizeFolderBookmark((choose folder) as alias)
end run

on synchronizeFolderBookmark(theFolder)

    set theName to displayed name of (get info for theFolder)

    tell application "Skim"

        set wasRunning to running

        if (bookmark theName exists) and (type of bookmark theName is folder bookmark) then
            make new bookmark with data theFolder at bookmark theName
        else
            make new bookmark with data theFolder
        end if

        if not wasRunning then quit

    end tell

end synchronizeFolderBookmark
</code>
Comment: Hi, thanks for the answer, in the script menu link it says, To add a Script Menu to Skim, create a folder Library/Application Support/Skim/Scripts. But you gave the path as ~/Library/Scripts/Folder Action Scripts, so which is correct. I did the former and it worked now I have Script menu in Skim and it contains the Synchronize Folder Bookmark script, but I don't understand exactly what itis supposed to do?. When I click it, it asks me to choose a folder, so I did and it added that folder to the bookmark menu as a folder and all the files inside it(other non related PDf's) as menu.


Website translation check

Question: I hope that it is not so stupid question but is there some service or forum where another users (native speakers) can check and review my translated web site? I don't want to check dozens of pages but only few sentences.
Answer: I've had good luck asking my users to improve translations for me.  On one site, I asked users to email me any improvements to the translations.  On other site I built an interface that allowed them to enter improvements one sentence at a time.  Most of the popular languages have now been completely rewritten by native speakers, just because I asked.
Comment: Interesting, the only user generator-ed content I get is on my wiki and even then its poor, you must have a good user base.
Comment: thank you, but I need to be the translation correct because its commercial site, so I can't rely on my users
Answer: Meanwhile I found this: www.mylanguageexchange.com
I hope that it will be no problem to review my translation for someone from that site and I can improve my language skills too, so one day this reviews will not be needed.
At this time, it seems the best solution for my needs. Anyway, if you find something better, I'll be glad. Thank you

Website translation check