Replacing the Voltage regulator of a fried Arduino

Question: I accidentally fried my Arduino. I found this Instructable. The symptoms are the same. The board not powering on connecting USB source and the over current protector was heating up. So I removed the voltage regulator as mentioned in the Instructable. But the problem is the pins 1 and 2 of where the regulator used to be are still shorted out. That is even after removing the regulator, the pins seem to be somehow internally shorted. I tried checking the continuity on another working Arduino and found it to be not shorted. What seems to be the problem?
Comment: The problem that something else on the board is fried as well. Maybe the MCU itself. It would be easier to buy a new one, I guess...
Comment: What board are you using? Mega like in the instructable? Try checking the caps. Are there any visible anomalies? Charred traces e.g.
Comment: You should try running it off a separate 5V supply to see if the other parts are damaged as well.
Comment: @IgnacioVazquez-Abrams As I understand, the Vout of the regulator (i.e. 5V) pins are shorting, so it is impossible to connect external 5V to such a setup unless the short is resolved.
Comment: I checked if the MCU was damaged by installing it on another board and found it to be not damaged - @EugeneSh. I am Using Arduino UNO not Mega. I found no visible damage.
Answer: I know it's an old thread, but others are likely to have this problem.  If you check the open source schematics, there are a couple of nearby capacitors that connect pin 1 (GND) to pin 2 (+5V) of the regulator.
I would check C2 and PC2 (top right of the diagram) as well as C1 (top left of schematic diagram), and any other components you can find that bridge the rails between +5V and ground.  Capacitors are more likely to fail shorted than many other components.  You will have to remove at least one pin of each capacitor to test it since you don't know where the short is, or you can simply remove capacitors until the short goes away.


Is the Shehechiyanu bracha recited when eating an esrog fruit?

Question: Is the Shehechiyanu bracha recited when eating an esrog fruit?
Is seasonal needed?
Comment: Could you [clarify](http://judaism.stackexchange.com/posts/34724/edit) what you mean by "Is seasonal needed?"? Do you mean to ask whether the _esrog_ being eaten must be from the current season? or whether seasonality of a species is necessary, as a rule, for saying _shehechiyanu_? or what?
Answer: Kovaitz Bais Aharon V'Yisroel 103 has the following roundup.
Orach Chaim 225:6 a fruit that does not regenerate yearly, you do not make a Shehechiyanu on it. Mishna Berura 225:6:16 says this is for example a Esrog. Mishna Berura 225:6:16:19 refers to the Shaarei Efraim and Mor Uketziya.
However Kaf Efraim 225:43 in the name of the Shaar Efraim says one would make a Shehechiyanu upon eating from an Esrog.
The Sefer Pri HaAdama 1:26 questions the Be'er Hataiv for mentioning in the name of the Shaar Efraim that would not make a Shehechiyanu upon eating a Esrog.
Ben Ish Chai Parshas Re'eh 11 says one should not say Shehechiyanu when eating Esrog since  the Shehechiyanu we make on it when we shake it on Succos includes eating it during the year.
Rabbi Chaim Kanievsky used to make a Shehechiyanu when he ate it, however in the more recent years he stopped.
Comment: but what about nishtaneh hateva? Does any of this apply if the esrog is not truly fit for human consumption? I ask this as a halachic point.
Comment: @Josh Waxman: I eat Esrog every year, and I am alive and well Boruch Hashem. I do not eat the peel, only the inside, and as you know an Esrog has a thick peel. I do not think there is any danger in eating it.
Comment: Baruch Hashem. I would not advise this, before doing research on it. I read about this in (iirc) Mishpacha magazine, how they dip it in heavy chemicals. One never knows the long term effects, and how it might effect people with weaker constitutions, etcetera. Also, there are recipes for using the peel: http://www.tabletmag.com/jewish-life-and-religion/112933/dont-discard-that-etrog
Answer: The Piskei Tshuvos 225:17:footnote 124 brings many shittos who say not to make a shecheyanu.A few: Sidur Yaavetz ,Eishal Avraham,Leket Yosher and more.
Some reasons brought are ,its not fit to eat unless its fried and one can't tell between old and new.One already made a brachah on it during the time of its mitzvah and got pleasure from its sight.Another reason is it is not a fruit from year to year because it can last longer than a year on a tree. See it inside if available to you.
Answer: The sefer תהלה לדוד discusses at length the various opinions about reciting שהחיינו when eating an esrog, and at the end, he concludes:

1) If one eats an esrog before Succos one may bless on it שהחיינו. And such was the custom of the Sages of Yerushalayim, to bless the brachah of שהחיינו on the second night of Rosh Hashanah.
2) If one eats an esrog after Succos, since he has already fulfilled his obligation of שהחיינו when he sees the esrog when he took the Arba Minin, he should not say שהחיינו.
3) On the confection which is made from an esrog in all situations one should not say שהחינו.
Answer: No
Nor any bracha at all! It is forbidden to eat.
Because it is poison. In order to make it look so lovely, they dip it in a bunch of toxic chemicals.

Unfortunately, while researching recipes, I learned that the etrog crops designated for use on Sukkot tend to be so heavily treated with pesticide that they're essentially toxic to consume. That's a terrible shame, since the etrog is supposed to be  notable among the four species as being the only one that has both fragrance and taste. Even more concerning is that heavy pesticide use is a health hazard for the farmers who tend the etrogim. Unfortunately, we've placed such priority on the superficial beauty of the pri eitz hadar -- fruit of the beautiful tree -- that etrogim are now literally too pretty to eat.

And:

I have now heard from two individuals, one of whom worked on an esrik farm, that we should under no circumstances eat our esrogim. Because there is so much pressure for the fruit to be as beautiful as possible, the esrogim are drenched with toxic pesticides, herbicides, and fungicides to an even greater extent than typical in conventional agriculture.
Comment: here by the way is an answer. http://www.yeshiva.co/ask/?srch=1&orderby=&q=etrog&cat=1 But regardless of downvotes, I believe the answer I provided should be the true answer. Because otherwise someone will poison himself. Plus other discussions do not apparently take into consideration that modern esrogim are poisonous.
Comment: do you have a source that just as one doesnt make a blessing on non-kosher food, so too one does not bless on a poisonous food, (were he to eat it)?


What is "A" in AGeV?

Question: AGeV means GeV per nucleon. But why A letter is used for such a short cut? Why not NGeV, for example?
Answer: The $A$ is a variable; it's actually $A\text{ GeV}$, where $A$ is the mass number.
For example, RHIC has run Au-Au collisions at a beam energy of $100A\text{ GeV}$ (among other values). You would interpret this as $100A$ being the number of GeV. With gold nuclei, $A = 197$, and so that is $(100\times 197)\text{ GeV} = 19700\text{ GeV}$ total energy per nucleus.
Answer: This is an artifact of a long established coding for nuclei

$Z$ -- the "atomic number" is the number of protons in the nucleus(or occasionally the "proton number")
$A$ -- the "mass number" the number of nucleons in the nucleus

There is also the not often used

$N$ -- the "neutron number"

The per-nucleon energy of course applies to both the protons and the neutrons, so you want $A$.

And yeah, the use of these letters doesn't make much sense, but it has been that way for a long, long time.
Comment: And I was wondering what Ampere-GeV should be...
Answer: N.GeV would be confusing as the symbol N is commonly used to denote the number of neutrons.
From the Wikipedia article on Atomic Number:

The atomic number, Z, should not be confused with the mass number, A,
  which is the number of nucleons, the total number of protons and
  neutrons in the nucleus of an atom. The number of neutrons, N, is
  known as the neutron number of the atom; thus, A = Z + N.

What is "A" in AGeV?


Is it possible exctract sinusoids from non periodic signal?

Question: Digital signal UT1-UTC is not periodic but is including many sinusoids (periodic elements in IERS nomenclature) that are not multiples of some fundamental. For example tidal sinusoids are not multiples of yearly seasonal sinusoid because lunar month is not submultiple of the year. Then, is it possible these sinusoids be extracted from UT1-UTC by Discrete Fourier Transform?
Comment: My question is related to UTC (or leap second) problem, 13 years long debate between USA  and UK. Root of problem is just the noise (random element or irregularities) in UT1-UTC digital signal.
Comment: For get it (noise in UT1-UTC signal) one should detect every sinusoid and remove them by moving average as long I understand.
Answer: Fourier's theorem say almost any (non-pathological) waveform, periodic or not, can be decomposed into sinusoids (or complex exponentials).  Whether, or how well, those sinusoids correspond to any underlying pseudo-periodic phenomena or not is another issue.
Note that with a DFT, you may need to interpolate a periodic signal between the DFT result bin sinusoids.
Answer: DFT is always finitely long. So yes, that's what it does: deconstruct a finite sequence of $N$ samples into a representation based on the orthogonal $N$ sinusoidals. That works for every sample vector $\in \mathbb C^N$, the DFT mathematically just being a multiplication with a Matrix $\in \mathbb C^{N\times N}$, and being bijective.
The question how meaningful that representation is can only be answered by yourself, because it depends on what you want to do, and what assumptions you make about the signal.


Complement of compact subset in Riemann surface

Question: We have $S\subset S'$ Riemann surfaces with $S$ hyperbolic with boundary. For sufficiently large compact set $K\subset S$ does each component of $S'\setminus K$ have to be a hyperbolic Riemann surface? If so, how can this be shown? If not, can extra conditions provide such a result?
Comment: @Futurologist No assumptions on compactness. By hyperbolic I mean that the universal cover of $S$ is conformally isomorphic to the unit disk. No further restrictions on $K$.
Comment: But what do you mean by $K$ is large enough? It cannot be either one or two points in the case when $S'$ is the Riemann sphere...
Comment: What do you know about the compactness of $S$ and $S'$?
Comment: Is there any info for $S'$ like compact closed empty boundary or with/without finitely many points removed (finite type)? When you say hyperbolic do you mean a surface whose every connected component has the disc as a universal cover? Is $K$ arbitrary or are there some more specific restrictions?
Answer: I think this is more or less true if we assume $K$ is compact but contains at least three points. The set $S'\setminus K$ is a non-empty open subset of $S'$ and therefore a subsurface. Let $S_c$ be a connected component of $S'\setminus K$. It is a non-compact connected Riemann surface without boundary (since it's open) and let $p : \hat{S}_c \to S_c$ be its universal covering space. Then by the uniformization theorem $\hat{S}_c$ is conformally isomorphic to either the Riemann sphere, the plane or the unit disk. $\hat{S}_c$ cannot be the Riemann sphere as $S_c$ itself is not the Riemann sphere. Let us assume it is the plane $\mathbb{C}$ and thus the universal covering space of $S_c$ is  $p : \mathbb{C} \to S_c$. Then the group of deck transformations of $p : \mathbb{C} \to S_c$ is the subgroup $\Gamma \subset \{z \mapsto az+b\}$ acting properly discontinuously on $\mathbb{C}$ without fixed points by conformal automorphisms of $\mathbb{C}$. But the restriction that there are no fixed points implies that $\Gamma \subset \{z \mapsto z+b\}$ , i.e. it's a discrete subgroup of the translation group. There are only two types of such groups -- either $\Gamma = \langle z \mapsto z+b \rangle$ or $\Gamma = \langle z \mapsto z+b, \, z \mapsto z+c\rangle$. Since by the uniformization theorem $S_c\cong\mathbb{C}/\Gamma$, there are two possibilities for $S_c$: In the first case it is conformally isomorphic to $\mathbb{C}\setminus \{0\}$, in the second case it is conformally isomorphic to a torus (i.e. аn elliptic curve). By construction, $S_c$ can be neither of those (it is not compact to be the torus and it is not obtained by the removal of two points from another Riemann surface because $K$ has at least three points). Therefore the universal covering space of $S_c$ can only be the unit disc, i.e. it is a hyperbolic Riemann surface.


What steps we need to perform from DB end in case of storage migration?

Question: What are the impacts / steps from DB2 DB side before VMware SvMotion Storage migration ?
Answer: The impact should be minimal, if not non-existent. I've had several databases of varying sizes (both in storage and cluster) and types (MySQL, Postgres, Cassandra, to name a few) migrated between different storage environments with little impact to the end user. The VM always stays online and is usable just as it was prior to the vMotion.
If it's a:

manually triggered event I would say, at minimum, have a fresh backup available somewhere off-server in case there is a problem that requires a recovery. Otherwise, watch your applications and logs on the DB server as the Storage vMotion is occurring  and react accordingly.
automatic event because of storage failure, storage utilization, etc., you should be sure your backups are automated and saved off-server so you can recover should there be a problem. VM snapshots won't save you here should there be a problem.
Answer: Answer left in a comment by mustaccio:
I presume set write suspend should be enough.


Does the Zariski closure of a maximal subgroup remain maximal?

Question: Let $k$ be an algebraically closed field and let $G\leq\rm{GL}_n(k)$ be a linear group. Assume that $M< G$ is a maximal subgroup (in the abstract group sense). Denote by $\bar{G}^Z$ the Zariski closure of $G$ in $\rm{GL}_n(k)$. Is it true that if $\bar{M}^Z\neq \bar{G}^Z$ then it is a maximal subgroup in the algebraic groups sense? If yes, would it be a maximal subgroup in the abstract group sense?
(I asked this question on MathSE five days ago and got no response, so I re-posted it here)
Thanks in advance for any help.
Comment: What set do you apply Zorn's lemma to ? Because a union of strict subgroups may not be strict.
Comment: How about this: consider any Zariski dense subgroup $H$. For example the non-zero rationals inside $GL_1(\mathbb{C})$. By Zorn's lemma we can pick a maximal (abstract) subgroup $G$ containing $H$.
Comment: Yeah, clearly it could happen that $\bar{M}^Z=\bar{G}^Z$, but that's not the interesting case. I edited the question accordingly.
Comment: @Auguste: I hadn't thought it through - my comment is wrong then.
Answer: The answer is no. Assume that $G=\text{SO}(2,\mathbf{R})\ltimes\mathbf{R}^2\subset\text{GL}_3(\mathbf{C})$ and $M=\text{SO}(2,\mathbf{R})$. Then $M$ is maximal in $G$. However the Zariski closures are $\text{SO}(2,\mathbf{C})\subset\text{SO}(2,\mathbf{C})\ltimes\mathbf{C}^2$, so $\text{SO}(2,\mathbf{C})$ is not maximal in the algebraic sense because it stabilizes a line $L$ in $\mathbf{C}^2$ and is thus contained in $\text{SO}(2,\mathbf{C})\ltimes L$.
There are obvious similar examples with $G$ countable. However it seems more subtle to cook up an example with $G$ finitely generated.
(Edit: I understand the confusing assumption "$G\leq\rm{GL}_n(k)$ be a linear group" as "let $G$ be an arbitrary subgroup (in the abstract sense) of the group $\text{GL}_n(k)$.)
Comment: Ah! Your understanding of the question makes a much better question than mine. I'm sure that you are right, but I'll wait for confirmation from Dennis before deleting mine.
Comment: Thanks, that's exactly what I meant. Thanks for your great answer.


root with no password

Question: I was reading that in Ubuntu for security reasons root is disabled / has no password set, hence we cannot su into it. How this is increasing security if one could simply do sudo su and gain identical permissions?
Answer: I think you have a slight misunderstanding -
root is generally disallowed to login via SSH, but is still a valid user once on the machine.
When executing simply su, a user will be prompted for the root user's password in order to continue; sharing a password like this is bad practice.
If a specific user has access to sudo su, then only that named / user my become root. Again, sudo su will only work for the users / groups that are explicitly defined in /etc/sudoers.
The this link on why allowing root over SSH is bad practice.
Comment: Thanks Matt for commenting and although I agree regarding SSH different arguments were used, for example. If you are user X you won't be able to switch to root using su as it has no password set, at least in Ubuntu. Because you won't be able so say you will be able to delete only your data but no the data of other users. But this doesn't make sense to me. Say I'm able to brute force user's X password what will prevent me from gaining ultimate rights using sudo su?
Comment: If user X is not in the sudo group, then you won't be able to gain root access. Simple as that. Besides, `sudo su` for root access is handy when having multiple administrators so, as said in the above post, you avoid sharing a single root password among users. Everyone just has to know their own password.

root with no password


Windows SDK 10 can not find .pcp file

Question: Hi I have a problem I can not find template.pcp file that should be in windows SDK but It is not. I need it to make a patch .msp file I am following this tutorial: MSDN tutorial . Does anyone know where could I find it?
Comment: Belated, attempted answer below.
Answer: I can't see the template.pcp file anywhere in the SDK at this point, it might have gotten removed whereas it previously kept being moved.
The free MSI SDK tool called Orca can save a PCP file - and other types of MSI-relevant files. Search Windows SDK folder for Orca-x86_en-us.msi and install. Some more info here, current paths etc... (towards bottom).
WiX can also create a PCP file via markup, as explained in this thorough tutorial: Using Patch Creation Properties.  This tutorial should contain all required information to succeed without the template.pcp file (though I never use patching).
Comment: Great, I thought as much. Better with a late answer than never I suppose - for other people who might have the same problem.

Windows SDK 10 can not find .pcp file


How to give a permission to create marketing api user in marketing cloud

Question: How do I give permission to create marketing API user in Marketing Cloud? I am not able to create users.
Answer: Knowledge Article
Marketing Cloud Connector: Create Marketing Cloud API User

In the Marketing Cloud, navigate to Email Studio.
Click Admin.
Click My Users.
Click Create.
Name the user so it can be easily identified (example: api-user-1234).
Enter your email address as the Reply Email and Notification Email Addresses.
Enter a unique username.
Leave the External ID field blank (unless required by your organization).
Set a Time Zone.
Set a Culture Code.
Select API User.
Create a temporary Password.
If you are using a non-enterprise 2.0 account, set the following roles and permissions on this page:   User Permissions: NONE Marketing
  Cloud Permissions and Roles: NONE Select Email Application Select
  Mobile Connect (if applicable) Select Marketing Cloud Administrator
  role
Click Save.

Additional instructions for Enterprise 2.0 accounts Continue to set
roles and permissions:

Click My Users from Email Studio Admin.
Select the Marketing Cloud API User.
Click Manage Roles.
Click Edit Roles.
Assign the following roles:   Administrator Marketing Cloud Administrator
Click Save.
Comment: I have Already use this steps as you mention but create button is not visible
Comment: Click My Users from Email Studio Admin.
Select the Marketing Cloud API User.
Click Manage Roles.------> this is disable .
Comment: Click My Users from Email Studio Admin
Select the Marketing Cloud API User.


Does running Ubuntu on a Dell laptop sold with Windows void the warranty?

Question: If I run Ubuntu on a Dell laptop which was sold with Windows, will that void my warranty?
Answer: No it wont void the warranty. You can revert back to windows using the recovery partition or any other recovery media that was supplied with your laptop and your laptop will be back to the state where it was when you bought it. If you are new to Ubuntu and if your laptop comes with recovery partition (which most of laptops these days do) then make sure that you create recovery disks first before installing Ubuntu. Because sometimes people trash their harddisks while installing Linux and that can destroy your recovery partition. Even if you destroy the recovery partition and dont have the recovery disks, you can buy them from dell.
Comment: No, this shouldn't be a problem, since it is a hardware failure. There is no liability to use windows for warranty reasons. I sent my packard-bell (aka ACER) shipped with windows back for repair the power on/off button with Ubuntu installed. It was no problem at all.
Comment: I have a Dell Latitude, and removed the recovery partition.  When I got a hardware problem they asked me to restore from the recovery partition for some test and I said I had removed it because I installed a different OS.  They said it was no problem at all, because there is a BIOS self-diagnostic that tells them what they need to know.
Comment: So I should put windows back on it before sending it for repair?
Answer: When you send a computer with ubuntu installed for repairs, when it had windows on it, they will take no responsability if they had to re-install windows and remove your ubuntu partition and your data (considering your disk was still ok).
My brother sent his computer for repair because is wifi wasn't working. He got a windows computer back...
Comment: they likely replaced his computer instead of repairing it, and of course will not take the time to clone your drive over. this applies to still having windows on it.
Answer: They Say no, it will not be void but they will not be responsible for the software. most of the time they wipe everything and give you a new OS.
Here is the  thread from Dell Website,And here is also another thread specific for a  Dell  laptop


Getting specific Backbone.js models from a collection without getting all models first

Question: I'm new to Backbone.js. I'm intrigued by the idea that you can just supply a URL to a collection and then proceed to create, update, delete, and get models from that collection and it handle all the interaction with the API.
In the small task management sample applications and numerous demo's I've seen of this on the web, it seems that the collection.fetch() is used to pull down all models from the server then do something with them. However, more often than not, in a real application, you don't want to pull down hundreds of thousands or even millions of records by issuing a GET statement to the API.
Using the baked-in connection.sync method, how can I specify parameters to GET specific record sets? For example, I may want to GET records with a date of 2/1/2014 or GET records that owned by a specific user id.
In this question, collection.find is used to do this, but does this still pull down all records to the client first then "finds" them or does the collection.sync method know to specify arguments when doing a GET to the server?
Answer: You can implement some kind of pagination on server side and update your collection with limited number of records. In this case all your data will be up to date with backend.
You can do it by overriding fetch method with you own implementaion, or specify params
For example:
collection.fetch({data: {page: 3})

Comment: You answer was useful too, thank you. Mark's answer more directly addressed my question.
Answer: You do use fetch, but you provide options as seen in collection.fetch([options]).
So for example to obtain the one model where id is myIDvar:
collection.fetch(
{
    data: { id: myIDvar },
    success: function (model, response, options) {
        // do a little dance;
    }
};

My offhand recollections is that find, findWhere and where would invoke all models being downloaded and then the filtering taking place on the client.  I believe with fetch the filtering takes places on the server side.
Comment: Ah, this makes more sense. Thank you.
Answer: You can also use find where method here
collection.findWhere(attributes)


A nice result for an sub-area I am not working in

Question: I have recently come across a (recent) problem in a different sub-area, by a well-established mathematician, that he deems likely to be intractable, but to which I have found a particularly nice proof (at least I believe so) using the techniques well known in my own sub-area. I think the result itself has a particularly illuminating interpretation so I would like to get it published somehow, but since I am not familiar with the sub-area nor particularly interested in working in it (by which I simply mean I am not suitable for the sub-area), would the best recourse be to contact the author and ask him to write a paper together on the result?
Answer: Probably more like: Contact the author, and ask for his reaction.  It could be: "Great, let me help you publish it".  Or it could be: "You made the following well-nown error."
Comment: I am well aware of that possibility of course.
Comment: Which is why I think it might be best to contact the author in the first place, since he probably can tell whether the proof is sound or not, otherwise I would have asked if it would be best to submit it straight to arXiv or something. So should I try to submit it to arXiv as @David G. Stork suggested, or should I contact the author first?
Answer: If you're confident of your result (even if you might not have extensive knowledge of the literature), I would recommend you submit your work to a journal.  If your work is so closely based on this well-established mathematician, he or she will likely be contacted by the journal to perform a review.  But as @Gerald Edgar points out, be prepared for a review that states:  "You make the following well-known error."
Comment: Should I submit it to arXiv then?
Comment: If you're reasonably confident of your results, then yes... I would submit to *arXiv*.


Solaris11: can be installed as zone on omnios or similar?

Question: I can install Solaris11 as qemu vm on Omnios,my question is: is possible (maybe using an archiveadm "flash" archive) to install Solaris11 as zone of Omnios?
Comment: @elbarna But that's still the same kernel, designed to do just that.  You're asking if it's possible to run another kernel in a zone - and no, it's not.
Comment: Sounds like blasphemy to me ;-).  I don't think the zones can natively be anything other than the parent OS.  lx zones can emulate a linux kernel (but are not that).  I would suggest asking the illumos mailing list but I suspect this question would not be well received :-P
Comment: I agree with you,but a Os with emulation of zones with other os,for example Solaris10 is not a bad idea
Comment: Thanks,please add as answer, so I can vote and close.
Answer: Yes, one can install Solaris11 as OmniOS zone using the new bhyve and KVM branded zones introduced a few weeks ago with OmniOS r151028.


Test Driven Development: A good/accepted way to test file system operations?

Question: I am working on a project at the moment that generates a table (among other things) based on the contents of a file-system, and in turn does some meta-data modifications on the things it finds.  The question is: how should tests be written around this, or set up?  Is there an easy way to mock this out? Or should I setup a "sandbox"?
Answer: As you do always in TDD with external resources: you create one or more interfaces to your filesystem operations and "mock them out". You want to test your "table generator" and your meta-data modification code, not the file system operations itself (most probably you are using ready-made library implementations for accessing the file system).
Comment: But it sounds like the business logic is defined in terms of files and directories. So the stuff that calls the file system API _is_ the stuff that needs testing. Testing any related non-file business logic does not need mocking; just test it.
Comment: @soru: That's not what this answer recommends. It recommends first creating interfaces, then mocking the *interface*. So you do test the business logic, but not the filesystem interface.
Comment: So effectively we resign from testing the actual class that interacts with file system, database, etc... instead we create a different implementation with the same interface as a mock/stub, but the actual class we leave without any kind of unit testing, because we believe that we cannot unit test it and should do integration testing to test it instead. Is this correct?
Comment: @Ark-kun The intention of mocks is to hide these kind of file system caused bugs for the unit under test. So this is not con, it's a pro in terms of unit testing. Otherwise the unit test would test something outside of its scope (the file system integration). The answer nowhere suggests to only do unit testing of domain code and get rid of all integration tests that could be able to detect this kind of file system related bugs.
Comment: TDD does not recommend mocking the implementation of the unit under test. See (e,g) [URL redacted -- site redirects to one that is not appropriate]
Comment: @soru right, so you create a thin layer around files & folders with an interface defined such that all domain-specific operations are on the client side, and the implementation side is trivial enough to be confident it works without unit testing (integration tests will still be required). Similar to the idea of a Humble Dialog in ui code, or using a mock Repository in code that operates on persistent objects.
Comment: Mock the FS operations? And then, after shipping your product you realize that any write corrupts the database if the disk runs out of space.
Comment: @Ark-kun: the OP asked about how to apply TDD to his situation. TDD does not mean doing no other tests, or fewer other tests.
Comment: @DocBrown I just meant that for almost all file system caused bugs I saw in my life, most mocks will hide them. For structured data the integrity is very important. I do not think the OP should use some mostly-broken ad-hoc thick mock instead of thin wrapper around a sandbox. Actually I just came here because I found a small library to be thoroughly broken in many places and its' 1000++ unit tests were rather useless as the file system was not faked good enough.
Answer: Whats wrong with having a "test" file system?
Create a template folder/directory structure which has enough content to test you operations.
During setup of your unit test copy this initial structure (would recommend you ZIP up the template and unzip into your test area).
Run your tests.
Delete the whole thing during tear down.
The problem with mocking is firstly file systems, OSes and databases which belong to your project do not really qualify as external resources and secondly mocking low level system calls is both time consuming and error prone.
Comment: Mocking out file system operations will create much (!) faster running tests than using a real file system, and if this is more "error prone" is debatable, I would say it depends on the implementation. Nevertheless I think your suggestion is fine for creating automated **integration** tests (which I typically would do first when not doing TDD). But the OP specficially asked for TDD, and TDD unit tests have to be fast.
Comment: @Doc Brown -- I am sort of assuming he wants to do dir, delete, and rename type operations all of which have edge cases which would be painful to mock. Also on modern hardware unzipping a a few small files into a directory is only a little slower than loading a Java class -- its all IO after all.
Comment: I think file systems, if mocked, ideally should have a whole API written and maintained by some group,  because you are reinventing the wheel, if you do anything significant with the file system.
Comment: The more I think about the test file system, the more I like it.
Answer: I understand your question as "A good/accepted way to test a class that depends on file system operations". I donot assume that you want to test the filesystem of your os.
In order to keep the effort to 'interfaces to your filesystem operations and "mock them out"' as @Doc Brown answer suggested as small as possible it is a good idea to use java binary streams or text reader (or ther equivalent in c# or the programming language you are using) instead of using Files with filenames directly in you tdd-developed class.
Example:
Using java I have implemented a class CsvReader
public class CsvReader {
    private Reader reader;

    public CsvReader(Reader reader) {
        this.reader = reader;
    }
}

For testing I used in memory data like this
String contentOfCsv = "TestColumn1;TestColumn2\n"+
    "value1;value2\n";

CsvReader sut = new CsvReader(java.io.StringReader(contentOfCsv));

or embend testdata into the resources
CsvReader sut = new CsvReader(getClass().getResourceAsStream("/data.csv"));

In production I use the file system
CsvReader sut = new CsvReader(new BufferedReader( new FileReader( "/import/Prices.csv" ) ));

This way my CsvReader does not depend on filesystem but on an abstraction "Reader" where there is an implementation for filesystem.
Comment: The only problem here is that the OP was not speaking of file operations, but *file system* operations and meta data operations - I guess he meant something like listing all files in a directory, updating some EXIF information in all picture files etc.
Comment: You can create IDirectoryLister which has a method String[] List(String directory); then FakeDirectoryLister can implement that method by just returning new String[]{".", "..", "foo.bat", "bar.exe"};
Comment: This is correct.
Answer: This is the kind of thing you definitely need to integration test, as real-world file systems have all kind of strange behavior (like the way Windows won't allow deleting a file if any process, including the deleter, has it open).
So the TDD approach is to write the integration test first (TDD, strictly speaking, doesn't have distinct concepts of 'unit test' and 'integration test'; they are just tests). Quite likely that will be enough; so job done, stop, go home.
If not, there will be some internal complexity that isn't easy to adequately test by arranging files. In which case, you simply take that complexity out, put it in a class, and write unit tests for that class. Quite likely you will find that that common class is usable in the database, xml file, etc. cases too.
In no case would you take the fundamental core of the code you are writing and 'mock' it out in order to write tests that will pass whether or not the unit under test is wrong.
Comment: This answer really put it into perspective for me - `'unit test' and 'integration test'; they are just tests.` I think realistically, this is going to be the best solution for my case - I really need to test the file system libraries I'm using for edge cases, and how the application should respond to those. If I switch to a different file system library, I don't want to have to rewrite a bunch of mocks/test code to work with the new library, but having a test folder structure and integration tests would make that much simpler.
Answer: Create a wrapper for the file system operations. In the tests, pass in a mock that implements the same interface as the wrapper. In production, pass in the wrapper.


macos apps not going back to macbook display from external display when external display is powered off

Question: I have an external display connected to my macbook. External display doesn't have power backup. Whenever power goes off apps running on external display do not come back to the MacBook display. I have to remove the display cable to get them back. Anyone else facing this? Is this the default behaviour? Can it be fixed somehow or is there some workaround for it to get apps to macbook everytime external display is switched off or power goes off?
Comment: I don't have an answer but can confirm this happens to me on macOS 12.4. I run a 13" MBP with an external monitor. I believe that there is still a signal going from the monitor to the MBP even if the monitor is OFF. Only when the physical connection is severed does the MBP no longer "see" the monitor.
Answer: I think this works as intended. I have a display connected to a switch, so I can use it on the MacBook and another computer concurrently. If that would result in my apps being re-arranged or put the MacBook to sleep every time, it would be extremely annoying.


Change Image Size option in the settings in bulk

Question: I was wondering if I can change Image Size option in the post settings panel. From Large to Full Size. Automatically in all posts? I have about 500 posts... :) Seem can not find any answer to that. Thank you!
Comment: maybe something with database can be done?
Comment: I don't think there is a way to bulk update like this. Do you want to change every image or just the first in a post? Are you familiar with PHP programming in WordPress?
Comment: Ideally i would like to do all, but first would work too, i just need wider size image for Google Discover
Answer: Well, i think you totally right, there is no way to bulk change like that. But i found solution. Since Google Discover uses Featured Images for display, i can add my big size Featured Image to the post <?php the_post_thumbnail('full'); ?> and hide it with css from the page rendering, but Google will use it as a display image.


Comma after "In Italy" at the beginning of the sentence

Question: Is it necessary to put a comma after "In Italy" in this sentence?

In Italy, there are many historical art pieces.

Could you explane the rule please?
Comment: There are other obvious problems with the edited OP. One wouldn't normally say 'write a comma' but 'put/place a comma'. 'At this sentence' should read 'in this sentence'. And in the final sentence  it would be more usual to say 'Could you explain the rule please?'
Answer: This is a prepositional phrase. You can see a list of prepositions here. If a prepositional phrase begins a sentence, it is usually mandatory or wise to place a comma to reduce ambiguity in interpretation. You can see examples of this rule here.
Though it would be unlikely for anyone to be confused about the meaning of that particular sentence, it might still be good practice to include one. I think this is particularly true in strict APA and (possibly) MLA styles.
Chicago style handbooks maintain that a comma is not always mandatory, but instead should only be used a) when a pause is intended or b) the elements of the sentence are complex and varied.
I tend to side with the Chicago school on this one. With such a simple sentence a comma is unnecessary, but certainly not wrong.
Answer: Not to disagree with jboneca's answer, but here's another interpretation.
This is similar to the practice of, say, writing lists of names like this:

Einstein, Albert
Shakespeare, William

Or writing inventories like this:

Coat, brown
Shoes, leather, black

In each case, we mark the break from the natural order of English ("black leather shoes", "Albert Einstein") with a comma.
The natural order of an English sentence is to put modifiers like in Italy at the end:

There are many historical art pieces in Italy.

But English grammar permits us to move the modifier to the front when it suits our purposes. In speech, we mark this break from the natural order with a change in intonation and a pause. In writing, we mark it with a comma.


Stuck on GRUB Command Line

Question: I am running Natty Alpha 3. I used Update Manager to install something (not sure what it was), then I restarted, but instead of listing all the kernels, it gave me a command line. I don't know what happened and how to use it. Help!
Comment: Welcome to Ask Ubuntu! 11.04 is currently Alpha so things might not work right. Please see http://askubuntu.com/questions/18641/theres-an-issue-with-an-alpha-release-of-ubuntu-what-should-i-do and http://meta.askubuntu.com/questions/871/when-are-questions-about-ubuntu1-appropriate for better instructions on how to proceed.
Answer: May I suggest you to recover your grub installation with a live cd?
I could recover grub many times by following these instructions at: https://wiki.ubuntu.com/Grub2#Recover
"METHOD 3 - CHROOT
This method of installation uses the chroot command to gain access to the broken system's files. Once the chroot command is issued, the LiveCD treats the broken system's / as its own. Commands run in a chroot environment will affect the broken systems filesystems and not those of the LiveCD.
1) Boot to the LiveCD Desktop (Ubuntu 9.10 or later). Please note that the Live CD must be the same as the system you are fixing - either 32-bit or 64-bit (if not then the chroot will fail).
2) Open a terminal - Applications, Accessories, Terminal.
3) Determine your normal system partition - (the switch is a lowercase "L")

sudo fdisk -l

If you aren't sure, run
df -Th  Look for the correct disk size and ext3 or ext4 format.

4) Mount your normal system partition:
Substitute the correct partition: sda1, sdb5, etc.
sudo mount /dev/sdXX /mnt   # Example: sudo mount /dev/sda1 /mnt

5) Only if you have a separate boot partition:
sdYY is the /boot partition designation (for example sdb3)
 sudo mount /dev/sdYY /mnt/boot
6)
Mount the critical virtual filesystems:
 sudo mount --bind /dev  /mnt/dev
sudo mount --bind /dev/pts  /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys  /mnt/sys
7)
Chroot into your normal system device:
sudo chroot /mnt
8) If there is no /boot/grub/grub.cfg or it's not correct, create one using
update-grub
9)
Reinstall GRUB 2:
Substitute the correct device - sda, sdb, etc.
Do not specify a partition number (e.g. do not specify sda5, instead it could be sda)
grub-install /dev/sdX
10) Verify the install (use the correct device, for example sda. Do not specify a partition):  sudo grub-install --recheck /dev/sdX
11)
Exit chroot: CTRL-D on keyboard
12)
Unmount virtual filesystems:
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
13)
If you mounted a separate /boot partition:
sudo umount /mnt/boot
14)
Unmount the LiveCD's /usr directory:
sudo umount /mnt/usr
15)
Unmount last device:
sudo umount /mnt
16)
Reboot.
sudo reboot "
Comment: This is the only way I was able to fix my boot loader. Thanks
Answer: It happened to me too, on a regular upgrade.  Thankfully I was working on the dev system, determining the stability of the upgrade before pushing it to production.
The answer from "steabert" is not helpful at all.  That's the answer for people who run Windows.  Early releases are for finding bugs, and Cg2916 found one.
I recovered by using the grub console to continue booting, then reinstalled grub after I was able to log in.
set root (hd0,1)
linux /vmlinuz root=/dev/sda
initrd /initrd.img
boot

Lots of fun boot stuff happens
sudo grub-install /dev/sda

Of course, you'll need to adjust for correct partition numbers and device names, but it's fairly painless after you get over the initial pain.
Now, how do I do this on a virtual machine in a remote location where I only have SSH access...

Stuck on GRUB Command Line


How can I knock out a person instead of killing them?

Question: Sometimes it is more convenient or beneficial to incapacitate a person rather than letting them go about their business. Sometimes that person is a civilian, which means killing them incurs a massive penalty to my score. It seems most of the available attacks are lethal, what are the way non-lethal ways to take somebody out?
Answer: You have several options:

Sneak behind the target with your weapon holstered (Caps lock) and subdue (Q, if playing the PC version)
Let them spot you away from other targets and they will follow you, go to a secluded area and fake surrender (X), you will then have the option to knock them out with their own weapon(Q)
Grab them from around a corner by holding the left mouse button while they approach(holster any weapons).
Comment: Can you elaborate on the no weapon part?
Comment: Holster your weapon. If you have a gun or fiber wire out put it away.
Answer: If you have your bare hands equipped and press the action button, you will be prompted to tap a button (X on this Xbox) in order to subdue. This is an alternative to snapping their neck. When you subdue someone, you still lose points as opposed to leaving them but if you hide the body in a bin (dumpster), you will get your points back.
Edit: You lose more points if you kill someone.
Answer: You can take people as a human shield even if you have a weapon out, so it's a faster knock out. It does the same thing as subduing but it's faster.
Comment: Eccept that using human shield counts as getting spotted.
So it's not an option if you go for a higher score.


Does the entropy of the universe change as expansion exceeds the speed of light?

Question: The potential encoded information in a photon that is at the edge of the observable universe would seem to be lost as the universe expands.  Does that loss of information contribute to the overall entropy of the universe or is the information fully encoded in our measurement apparatus just before the photon is lost?
Comment: By definition the entropy of the universe keeps increasing, but that is only so for well defined volumes, which the entire expanding universe is not. I don't know how you want to measure a photon at the edge of the visible universe, though. To measure a photon it has to be where the measurement is made and by definition we are never at the edge of the visible universe. We are always "here" and a photon at the edge will not make it "here" until a long time from now, if ever. In that sense it's not clear what entropy should even mean, since it's a completely open system.
Comment: I find this problem really interesting. Somewhere I am sure I encountered Susskind talking about this, and the general principle of treating event horizons as holographic surfaces which encode the information 'beyond' them. But am not readily finding anything about this on cosmic horizons. Looking at https://en.m.wikipedia.org/wiki/Black_hole_information_paradox it seems the holographic principle is by no means the only game in town. The Big Rip now expected at the end of the universe, is another issue to reconcile in terms of information conservation
Comment: Obviously the photon is measured 'here'; it was produced 'there' some 13 Billion yrs ago.  The information in the sum is the same.  What happens when the source of that information becomes inaccessible to measurement as it expands beyond reach? (or another way, when we can no longer detect that photon, does it count in the measure of entropy of the system, the observable universe)
Comment: @CuriousOne thanks for that, was thinking about it, didn't realise a definition could help sort it out,
Comment: @AlanMonroe: The problem with that is that the information content "there" is very, very low: it's the total of the structure in the CMB, so if you pick that definition you end up with the universe having the "information content" of a few thousands bits, or so. Having said that, this is NOT an information problem but an open system thermodynamics problem and one should treat it for what it is, rather than for something that it isn't. For one thing we don't know what the relevant temperature scale is, it could be extremely high but almost completely decoupled from us.
Comment: Information and order are synonymous.  Disorder equates to loss of information.  I'm not sure I agree that this is NOT an information problem (I'll try not to get too metaphysical on a physics site).  Take the example to it's extreme, such an expanded universe that no information remains available to measure...infinite entropy?
Comment: @AMonroe Information and order are _not_ synonymous. Consider a weighted die. For a die weighted to always land on 1 or 6 (where it's equally likely to land on either), the distribution of outcomes is more ordered than a fair die. But the distribution of the weighted die can be characterized with only one bit ("did it land on 1?" for example), whereas the distribution of the fair, more "disordered" die requires more information to characterize (between two and three bits). In that sense, the more "disordered" distribution, with higher entropy, contains more information.
Comment: Not a duplicate but very closely related: https://physics.stackexchange.com/questions/27922/black-hole-no-hair-theorems-vs-entropy-and-surface-area - the photon crossing the cosmic horizon is analogous to the photon crossing a black hole horizon, and the entropy increase happens for the same reason. (See my answer there.)
Answer: The Second Law of Thermodynamics states that the state of entropy of the entire universe, as an isolated system, will always increase over time. The second law also states that the changes in the entropy in the universe can never be negative. Put another way as the universe increases in volume there are more ways to arrange the mass of the universe in more configurations. Therefore as the size and volume increase at an accelerated rate the potential for even more configuration of mass increases. This is true regardless of the speed of light.
The speed of light is relevant when we examine the observable cosmic universe or hubble horizon -
One can define a so-called "Hubble Horizon" which shows roughly how far light would travel if space were not expanding. This size is
$\chi = c t$
where t is the lookback time since the Big Bang (otherwise known as the age of the universe) which, according to the Friedmann Equations, is:
$t = \int^{a}_{0}{\frac{da}{H_0 \sqrt{\Omega_R a^{-2} + \Omega_m a^{-1} + \Omega_k +\Omega_\Lambda a^2}}}$
where $H_0$ is the Hubble Constant and the $\Omega$ density parameters are, in order, the density of radiation, matter, curvature, and dark energy scaled to the critical density of the universe.
Today, roughly:
$\chi_0 = \frac{c}{H_0}$
yielding a Hubble horizon of some 4.2 Gpc. This horizon is not really a physical size, but it is often used as useful length scale as most physical sizes in cosmology can be written in terms of those factors.
You ask -
The potential encoded information in a photon that is at the edge of the observable universe would seem to be lost as the universe expands. Does that loss of information contribute to the overall entropy of the universe or is the information fully encoded in our measurement apparatus just before the photon is lost?
Very much doubt that it would be encoded in the measuring apparatus. And yes since it is no longer observed in the local Hubble Horizon or sphere the data would appear to be lost locally and a net local increase in entropy could said to take place. All the while as the entropy of the universe is increasing at an increasing rate along with the exponentially increasing volume of the universe. Basically just a subset of the whole.
Answer: If the whole universe is homogeneous, it will be as likely to loose a photon than to gain one that come from the other side, so on average the entry does not change. However, we are actually in an accelerating universe with accelerated rate of expansion. In this case the observable universe actually diminishes in size, and so the entropy. The total entropy of the observable universe only grows if it is a closed system. The visible universe of a particular observer, does not define any physical border, just a causal/observable one. The entropy inside the observable universe (and its radius) does not grow, and actually, by the holographic principle, the entropy gets actually reduced. This is because of the reduction of mass and energy and of available microstates as the radius diminishes. The extreme case will be in the future if the big rip happens, every fundamental particle and every black hole will become isolated from the rest of the universe, so each disconnected part of the universe will in fact have very low entropy (although the entropy of the whole universe will grow)
Answer: For a vast over simplification - take the universe to be analogous to a very well insulated piston containing a gas.  If you expand that volume normally it will be adiabatic / constant entropy - no heat loss by definition of it being well insulated.
Now add in the accelerating expansion of the universe such that regions relative to us are no longer accessible because they are moving away from us faster than the speed of light.  In the piston analogy it would be as if we've inserted a thermal barrier between sections of the piston that do not allow transfer of heat.  Inserting these barriers does nothing to the entropy of the piston.  Therefore for the universe as a whole there is no change in entropy.
Now if you're interested in the entropy of the accessible universe, that has certainly decreased, but so has the amount of matter/energy.


"A whole nother" way of looking at things

Question: People say this so much (instead of "another whole" way, etc.) that I wonder how it got started.  How did "another whole..." get changed to "a whole nother..."?
Comment: There's a bit of false premise here: the "proper" form of *a whole nother* is *a whole other*, **not** *another whole* (the latter sounds more wrong than *nother*).
Comment: As an adverb, "whole" means "completely", so "a whole other way" means "a completely different way" (yes, as opposed to a partially different way). If you switch the order around, however, then "whole" becomes an adjective modifying "way", which is just nonsensical.
Comment: @drm65: No, because the expression is formed by analogy with things like "A whole new world of opportunity" - you couldn't say "*A new whole world of opportunity" to mean the same thing.
Comment: "Another whole way of looking at things" makes no sense to me. Another whole way? As opposed to another *partial* way?
Comment: A whole other way? As opposed to a _partial_ other way?  This cuts both ways.
Comment: You're both right. I see now.  Thanks for helping me!
Comment: "Another whole way of looking at things" vs. "A whole other way of looking at things" - both sound plausible and ugly.
Comment: So how long does it take for *a whole nother way* to be accepted as proper English?
Comment: Related: "[Is 'a whole nother' grammatical?](http://english.stackexchange.com/questions/247785/is-a-whole-nother-grammatical)"
Answer: This is an example of metanalysis: taking two words that occur in close proximity, and re-analyzing them so that the word boundary changes position. In this case, the common phrase an other is reanalyzed as a nother, which then allows the insertion of the word whole to give a whole nother.
Metanalysis has happened several times in English, the most common being the word apron, which was originally napron, but suffered metanalysis from a napron into an apron. For this reason, I doubt that the creation of this phrase was an example of deliberate play on words. Rather, it's an example of a process of word-formation which operates sporadically in English, and has for a long time.
This metanalysis isn't complete, as most speakers, including myself, don't really use the word nother except in this phrase. I would never say the nother thing, for example.
Comment: @JSbangs: another nice example is *ewt* becoming *newt*, which goes in the opposite direction from *napron*/*apron*.
Comment: Excellent answer. I'd use this phrase aloud but never write it, so I don't know whether it will ever survive to get in print.
Comment: A third example is 'an adder', which used to be 'a nadder' (related to German _Natter_).
Comment: More background on this: http://www.quickanddirtytips.com/education/grammar/why-do-people-say-a-whole-nother
Answer: In addition to JSBangs' metanalysis reference I found the following in classical rhetoric (as one often does):

Tmesis, Gk. "a cutting", Also sp. timesis, dissectio
Interjecting a word or phrase between parts of a compound word or between syllables of a word.
Examples:

In the following sentence the word "appear" occurs between the two words that make up the compound "hereafter."
This is the place where Christ will come, as will here appear after.
In the following sentence, "whatsoever" has been interrupted with "man":
He shall be punished, what man soever offendeth.
In the following passage, "heinous" interrupts "howe'er":
If on the first, how heinous e'er it be,
  To win thy after-love I pardon thee.
  —Shakespeare, Richard II 5.3.34-35

EDIT:
There are further examples in wikipedia's article, among which are:

"Any-old-how", in which the divisibility of "anything" (as in "any old thing") is mimicked with the usually indivisible "anyhow".
"A-whole-nother", in which another (an+other) is reanalyzed as a+nother.
Comment: A very good, relevant treatment. Examples, however, involve compound words broken at **word boundary**, not monoliths actually "broken down".
Comment: Agreed with Kris. Tmesis is the act of _deliberately_ separating a compound word at word boundaries, using them as separate constituents of a clause. That is not quite what happens in 'a whole nother'. First off, 'another' is, despite its orthographic shape, still easily recognisable as determiner + adjective, so splitting it up as such is more a matter of orthography than tmesis; secondly, the split here goes _against_ word boundaries, indicating metanalysis of the adjective.
Answer: Where I grew up (in Texas), sentences like "That's a whole nother thing" were common in informal speech—and completely intelligible to hearers of all but the youngest ages. But somehow, when called upon to write the expression, many people use this punctuation:

"I guess I just feel that's a whole 'nother piece of software I'd have to learn," Beavers said.

Since the quoted sentence was spoken in an interview, we can blame the apostrophe before the n in nother on the reporter (or perhaps on a zealous editor). But I don't see any justification for the added punctuation, which logically seems to transform "a whole nother" into "a whole another," albeit in truncated form.

FOLLOW-UP (July 21, 2018): Academic discussion of 'a whole nother'
Two discussions of "a whole nother" appear in Word Study (1954—1963[?]) [combined snippets]:

A Whole Nother
The locution "a whole nother", common from "Here's a whole nother row of beans ain't weeded" to "I have to grade a whole nother set of themes", seems to have escaped our inquiring linguists so far. The phrase may be regional, but its geographical range extends at least from Philadelphia to north central Ohio. No English word besides another separates in just this way, nor is any wod except whole ever inserted into the gap. There is no such thing as "a half norther helping". (By the way it is equally odd and generally unrecognized that at least one major meaning of such everyday words as helping, serving, slice, piece depends almost entirely on conditions within a given household, and gives lexicographers fits. I defy anyone to define "a half helping".
My best guess is that two psychological foibles in combination have engendered this unique phrase: first, the confusion caused by simultaneous conception and mental juggling of another and a whole; second, the lazy tongue that finds it easier to flatten from alveolar l to alveolar n than to withdraw to the mid-central vowel. Does this make sense or is a whole nother explanation necessary?
John T. Flautz Kent State University Kent, Ohio
A Whole Nother One
For the past two or three years I have been observing friends and acquaintances using a split construction of another in expressions like, "Well here's a whole nother day gone", or "I read a whole nother book while I was waiting". Like many such things it has probably been going on for years, but only recently have I begun noticing it.
My initial impression was that the whole nother phrase was characteristic of people with limited language sophistication, in other words, a colloquilaism used by people who had either heard it or invented it directly. Certainly they could not have seen it in writing. Later as I continued to listen for the phrase I picked it up in the utterance of graduates of Ivy League and Big Ten universities, including Ph. D.'s in English literature.
Pretty obviously this cannot be  a literary construction. But there is evidently something in the structure of English that makes it virtually inevitable.
In the first place we have the familiar phenomenon of "movable n" which occurs from time to time in words regularly juxtaposed. We have an apron from a naperon, an adder from a nadder, a newt from an ewt, a nickname from an ekename, and so on (cf. Jesperson, Modern English Grammar I, 33). Therefore we do not have to be surprised when we accidentally encounter a nother in place of an other. As a matter of fact, in giving the first syllable greater emphasis, speakers of English are likely to pronounce the syllable as though it were the definite article, rhyming it with day, that is ay-nother. I have heard radio and television announcers do this repeatedly, particularly in unrehearsed speech.
In the second place we have a peculiar arrangement of modifiers. ...

*Early print instances of 'a whole nother'
In Google Books search results, instances of "a whole 'nother" go back to 1890. From Mrs. Molesworth, "The Mysterious Guide: A Story of the London Fog," in The Story of a Spring Morning, and Other Tales (1890):

"Will the fog be gone by to-morrow morning?" said Patty, disconsolately. "I don't know what we shall do if we have to be a whole 'nother day in the house and in the dark."

Patty is a young child although her exact age is not specified; the story is set in London.
From Lucy Furman, Mothering on Perilous, serialized in The Century Magazine (December 1910):

That night when Mrs. Salyer and Miss Loring and Keats and Ken and all the others were once more in bed in t' other house, and conversation had languished, and Ponto was thumping the floor with his tail again, Keats raised his head to murmur sleepily but rapturously, "Gee-oh ! a whole 'nother day at home to-morrow!"

Keats is eleven years old; the story is set in Kentucky (in fact, the name "Perilous" may be a play on Hazard, a town in the Appalachian region of eastern Kentucky).
From Anne Archibald, "Angelina Interviews the Modern Cinderella," in The Theatre (March 1918):

Cinderella Miss Grace Field, for example, goes on duty at the Claridge at 11 P. M. and though closing hour on Broadway is one, still with that late start she finds that she is never able to turn in till the early morning hours. Angelina found Miss Field breakfasting around noontime, arrayed in charming Chinese coat of white silk embroidered with pink roses, just long enough to show the lace flounces of a dainty petticoat underneath. (Miss Field, by the way, lives in a marvelous reconstructed stable that once belonged to three millionaires, that is as capacious as a Fifth Avenue mansion, and that is a whole 'nother story in itself.)

As you might expect, The Theatre magazine was published in New York City.
From Life and Labor, volume 10 (1920) [combined snippets]:

"Was there a strike here?" I asked innocently.
"A year and two months," she replied almost scornfully, as if any fool ought to have known that. "Why, they used to have five hundred people working here, and now there only about sixty. They had a whole 'nother floor besides this."

I have no particulars about this article/story, including its characters and setting. Life and Labor magazine was published in Chicago, Illinois.
From an advertisement in The New Yorker, volume 49 (1925):

SHE'S A WHOLE 'NOTHER MOTHER when she slips into our deliciously romantic morning glory robe. Shades of pink, blue, green on white Dacron® cotton voile. Crystal-pleat ruffles at wrist, satin bow at neck. Button front. Washable, packable, lined for privacy.

From Plain Talk, volume 5 (1929):

Somebody had mentioned the Tank Corps. So it seemed altogether fitting and proper we should drink a standing toast to Spike Hennessy. Not that any of us knew him other than by name and reputation, but his nickname seemed appropriate to a Christmas Eve. Colonel Hennessy took a whole nother bottle. And then in walked two Y-men who used to be newspapermen themselves and were full of late gossip of the staff of the Stars and Stripes. And then we knew no more.

Plain Talk magazine was published in Washington, D.C., from October 1927 through August 1938; its tagline was "Spokesman of the forgotten man."
To sum up the results of the Google Books searches I conducted, the first confirmed instance of "a whole 'nother" (from 1890) is from England and appears in a remark by a young girl; and the second confirmed instance (from 1910) is from a story set in Kentucky and appears in a remark by an eleven-year-old boy. Three of the next four matches (from 1918 through 1929) are by adult speakers (the age of the speaker in 1920 instance from Life and Labor is ambiguous); and those three come directly from the voice of the writer or narrator, not as quotations from someone else.
Perhaps most interesting as a matter of orthography is the fact that the first five examples cited above use the logically suspect spelling "a whole 'nother" rather than the more logical "a whole nother." Evidently, the earliest writers—like many of their successors—thought it was more important to signal the connection between nother and another (as opposed, for example to some third term such as neither) than to avoid using a form that, viewed objectively, amounts to a short form of "a whole another." In any case, the Plain Talk example from 1929 is the earliest Google Books match to dispense with the apostrophe in favor of "a whole nother."
Answer: I don't think it's a play on words. I find myself doing it sometimes, and have reasoned it happens thus: I want to emphasise 'another' so I add 'whole' into the phrase. 'Whole', starting with a consonant, takes the article 'a', leaving over 'nother' to complete the phrase.
It happens because we still recognise 'another' as two words semantically, therefore try to insert things in between them.
Comment: This is kind of like of JSBangs's answer, but much less technical.  Which isn't a bad thing.
Answer: It seems like it started as a play on words: to treat 'another' like 'a nother' and then insert 'whole' between them.
I'm sure it would have been done deliberately. Word play is like that.
Comment: There are many speakers in various regions of the USA who officially pronounce *another* like *a nother*. To them, it's not a deliberate play on words. And really, *a whole nother* should be *a whole other* in "proper" speech. Anyway, @Joe, I can't believe you go so far as to call idiots those who mix up *brought* and *bought :( No one is 100% error-free all the time. You never know how close this might get to home.
Comment: @drm purely FWIW -- for me, yes, it sounds like a conscious, deliberate play on word sounds.  NOT accidental or mistaken, such as when idiots say brought instead of bought. So (my guess) it's deliberate play. Further, for me it has a slightly Southern-USA feel (hard to put finger on why).
Comment: Could this have been done purposefully, or is it unconscious?


Rename File on Download

Question: I'm using SharePoint Online and I'd like to know if it's possible to append a metadata column value to a filename when a user clicks "Download". The filename in SP must stay the same, but the locally downloaded version must be appended.
Comment: I also have the exact same requirement. Were you able to find a solution for this, if so can please share or give me guidance. Thank you
Answer: This is not possible out-of-the-box. But one solution could be to customize SharePoint with your own download link at the appropriate location. Use the HTML download attribute on an anchor tag. For example:
download

However, it will not work in all browsers. It works with Google Chrome and FireFox whereas Internet Explorer and Microsoft Edge will ignore it.
Comment: Thanks, but that won't work with the standard download link on libraries will it? I need a solution that works for all links without me having to edit the html each time. Plus, I don't know the filename - so a hard-coded approach won't suffice.
Comment: No, the standard download will use the filename only! You'll have to develop a custom solution. Maybe by registering some JavaScript code (through a CustomAction) that replaces the standard download link! The metadata to add can be retrieved from the web page if available or by a call back to SharePoint with the JSOM.

Rename File on Download


Will Eidolon of Rhetoric also prevent Cipher from working in the same turn as another spell?

Question: Say Eidolon of Rhetoric is on the battlefield and an opponent has a Cipher card (Hidden Strings for example) encoded on one of their creatures. If that player casts a spell and then deals damage with that creature in the same turn, would they be able to cast Hidden strings? Would it work because the Ciphered card turns additional casts into an ability or would it not work because the cipher ability says "cast"?
Answer: They cannot cast the ciphered spell because they've already cast a spell. Rule 101.2 says

When a rule or effect allows or directs something to happen, and another effect states that it can't happen, the "can't" effect takes precedence.

The cipher ability allows the player to cast a spell, and Eidolon of Rhetoric says that they can't cast any spells after their first each turn. So, Eidolon prevents them from casting the spell.

From the Cipher rules, as long as the card is encoded on a creature, that creature has an ability that says

Whenever this creature deals combat damage to a player, you may copy this card and you may cast the copy without paying its mana cost.

So, when the creature deals damage to a player, the player can make a copy of the spell, and then they can cast the spell just like they would cast any other spell except that when they pay the cost, they don't have to pay the mana cost. This spell is affected by Eidolon of Rhetoric, just like any other spell
Comment: Is there a rule showing definitively that "casting a copy" counts as "casting a spell"?
Comment: A copy of a spell is a spell. There is only one meaning of the word cast in Magic. I don't think there's any ambiguity here. The specific rule on how to copies is 706.12.
Answer: It doesn't matter whether the instruction to cast comes from an ability or from having priority. They can't cast a second spell since they've already cast a spell.

As the saying goes, "can't trumps can"[1]. This means Eidolon of Rhetoric's ability to forbid him to cast more than one spell per turn overrides any instruction to do soCR 101.2.
The triggered ability granted by Cipher is as followsCR 702.98a:
Whenever this creature deals combat damage to a player, you may copy the encoded card and you may cast the copy without paying its mana cost.
You cannot obey the instruction to cast the copy. When faced with an effect with a mandatory instruction that cannot be obeyed, you perform as much as the effect as possibleCR 101.2. However, the instruction to cast is optional in the case of Cipher ("you may"). As such, you are forbidden to chose to take the forbidden actionCR 608.2d.
So all that happens is that a copy of the card is made if you so desire. The copy ceases to exist immediately afterCR 704.5e.

Doing things in the opposite order wouldn't help. If he started his turn by attacking, he'd be able cast the copy of Hidden Strings, but he wouldn't be able to cast anything else in his second main phase for all of the same reasons.

"Can't trumps do" is more accurate, but not as poetic.

101.2. When a rule or effect allows or directs something to happen, and another effect states that it can't happen, the "can't" effect takes precedence.
609.3. If an effect attempts to do something impossible, it does only as much as possible.
608.2d [...] The player can't choose an option that's illegal or impossible, with the exception that having a library with no cards in it doesn't make drawing a card an impossible action (see rule 120.3). [...]
702.98a [...] "Cipher" means [...] and "For as long as this card is encoded on that creature, that creature has 'Whenever this creature deals combat damage to a player, you may copy the encoded card and you may cast the copy without paying its mana cost.'"
704.5. The state-based actions are as follows:
704.5e [...] If a copy of a card is in any zone other than the stack or the battlefield, it ceases to exist.
Comment: Honestly, this normally wouldn't bother me, but was it really necessary to post an answer that follows basically the same reasoning to the same conclusion half an hour after I posted mine?
Comment: @murgatroid99, I'm not interested in a philosophical on what's necessary and what's not. I felt there was far more to say that what you said, and far more than appropriate for a comment or to add to your answer.
Comment: This just leaves in an uncomfortable situation. I can either improve my answer by effectively taking ideas from yours, or I can leave my answer to be overshadowed by yours even though it was first and correctly answered the question.
Comment: @murgatroid99, Earlier, you said I wanted too long, but now you're saying I didn't wait long enough for you to make changes. Either way, I have no problem with you improving your answer.
Comment: I think it's a little unfair to say that you waited for me to make changes when you never made any comment indicating that changes were needed. It just feels, from my point of view, like you read my answer and then posted basically the same information with a little elaboration. It feels like a rep grab, even if that wasn't the intention.
Comment: Also, I don't think 609.3 is relevant. The player can choose to copy the spell, but he simply isn't allowed to choose to cast it because the Eidolon forbids it. It's not so much the effect not doing something impossible as the player's choices being restricted.
Comment: @murgatroid99, fixed.
Answer: Something that the other answers haven't really emphasized, but might be the key to your confusion: you said

Would it work because the Ciphered card turns additional casts into an ability or would it not work because the cipher ability says "cast"?

Cipher does not "turn additional casts into an ability." What happens is that when the creature deals damage to the defending player, the cipher ability triggers, and then resolves, and while resolving it gives you the opportunity to copy the exiled card and cast that copy. But you are still casting something. In almost all respects this is just like any other instance of casting a spell: you pick targets, pay costs, and put it on the stack as normal, and anything that affects your ability to cast spells also affects this. There are only two differences: (1) the thing you're casting is a copy, so is not represented by a card, and (2) it's being cast from exile, not from your hand. Neither of those two things make a difference to Eidolon of Rhetoric, though. (Hypothetically, if the Eidolon said "Each player can't cast more than one spell from his or her hand each turn," then it would make a difference, and the spell cast via cipher wouldn't count toward that limit of one.)


Get Windows 8.1 universal app state / public variable access from its winrt component

Question: I have an Universal Windows Platform app and for background checkings I use winrt component (separate project in solution). I register it correctly and system launches my winrt class every 15 minutes. The problem is that my app uses the same files and makes the same checks that background checker does. So I need to know is my app alive (background or foreground) to skip background check to avoid multithread file access.
Is there any way to get access to state of my app from winrt component, or query system does my app active?
Answer: Since the Anniversary update, it is now possible to run background tasks from within the same process as the main app. Both the background task and the main app share the same memory. See Create and register a single-process background task for information on how to do this.
If you want to keep the background task in a separate process to the main app, then you can use a named EventWaitHandle:
Foreground app code
<code>// Keep this handle alive for the duration of your app
eventHandle = new EventWaitHandle(true, EventResetMode.ManualReset, "MyApp");
</code>
Background app code
<code>EventWaitHandle handle;

if (EventWaitHandle.TryOpenExisting("MyApp", out handle)) {
    // Foreground app is running
} else {
    // Foreground app is not running
}
</code>
You need to be mindful of possible race conditions here (if that is a problem for your situation). You could probably make better use of the EventWaitHandle to synchronize whatever file task it is both processes need to do.
Comment: thanks! But single-process background task is not available in uwp 8.1. It would solve so many problems if would. 1. so when my app is closed var eventHandle is collected and automatically unregistered system-wide?  2. Not quite understand about race condition  - if I see that app runs I do nothing. Or do you mean I can enter "else" when app is offline and continue checks when app goes online?
Comment: UWP is Windows 10 only. I assumed you were developing for Windows 10 since it was tagged `uwp`. The EventWaitHandle method should still work for Windows 8.1 though. It will be closed automatically when the process terminates. With the race condition, I just mean there might be a small chance that the background task runs first, sees that the foreground process isn't running, *then* the foreground process starts and tries to access the files too.
Comment: uwp is not win 10 only, initially it was for 8.1, but now it almost impossible to find docs for uwp 8.1. But it does exist. I have uwp apps online - most code is shared between winphone 8.1 and win 8.1. Another thing that msft will not update some devices to 10 (and some even to 8.1) but I need to support my old users as well. I started to develop for winmob since wince 3.0, but this situation takes place with every major update - msft hates its customers. For developers - I thought the same way, but when I started to develop for iOS/OSX I've found out that there's greater evil than msft :)
Comment: UWP is the [Universal Windows Platform](https://en.wikipedia.org/wiki/Universal_Windows_Platform) introduced in Windows 10. Windows 8.1 had the concept of "Universal Apps", but this just meant that code could be shared between desktop and mobile.
Comment: oh, my bad. but from development perspective code sharing is "universal" enough (comparing to pre-8.1 problems), too similar terms to confuse :) I'd say universal app 8.1 looks like beta for 10 (even most related docs disappeared), but there were no "release" for 8.1, so we have what msft gave us.


There are 31 houses on north street numbered from 1 to 57. Show at least two of them have consecutive numbers.

Question: I thought to use the pigeon hole principle but besides that not sure how to solve.
Comment: Tell that to the [Ninja Turtles](https://www.youtube.com/watch?v=EgmXewamiiY) who get their pizza delivered to $122 \frac{1}{8}$.
Comment: You should probably specify that house numbers must be integers.If not, what defines consecutive in the context of fractional addresses?
Comment: Iterating housenumbers 1 and 57 would also violate this. I think we have a strictly increasing sequence of integers.
Comment: The question does NOT say that the houses with consecutive numbers have to be adjacent. And while it is not explicit that the numbers have to be integers, it is an obvious from the question that this is intended. Of the two complaints brought up here, one is false, and the other is trivial, and a complaint that could be made of perhaps the majority of questions on this site. So why was this question put on hold?
Comment: This is a pretty muddily phrased question. For one thing, most real streets (at least in the US and UK) never have consecutively numbered houses, since they have odd and even numbers on opposite sides.
Also, it's trivial (as @Pieter21 points out) to arrange the houses to have no consecutive numbers.
The missing detail (I'm guessing) is that all houses are on the same side and must be arranged in ascending (or descending) order.
Answer: HINT: For your pigeonholes take the sets $\{1,2\},\{3,4\},\ldots,\{55,56\}$ of house numbers. Even if one house is numbered $57$, you still have $30$ houses to fit into those pigeonholes.
Comment: Nice move with the pigeonhole definition
Answer: More simply perhaps:
Suppose that no two houses have consecutive numbers. If $L$ is the lowest house number then the second lowest house number is at least $L + 2$, the third lowest is at least $L + 4$, and so on up the the highest house number of at least
$$L + 30 \cdot 2 = L + 60$$
Now derive a contradiction!
Answer: Not sure if this is the answer you were looking for, but it's one of those "so painfully simple that you likely never considered it":
North Street ends in a cul-de-sac.
But more to the point...
If houses are numbered 1 through 57 and NONE of them are consecutively numbered, they must all have odd numbers.  All odd numbers from 1 to 57 (inclusive) total 29 numbers.
The problem cites 31 houses in a range which can only accommodate 29 houses without any adjacent houses.  31-29 = 2, therefore at least two of the houses must be adjacent to others in order to fit within the parameters.
Even if the question cited 30 houses, at least two would have adjacent numbers.  For example, if the 30th house was numbered 2, houses 1, 2, and 3 would all have adjacent numbers.
Answer: There is a unique subset with the maximum number of non-adjacent houses: {1,3,5,...,57}.  The number of houses (29) in this set is less than 30.
This observation solves the problem, but it also indicates that with 30 houses there are at least 2 adjacencies.  With only 1 adjacency $(i-1,i)$ you could add $+1$ to all the house numbers $\geq i$ and get a set of house numbers between 1 and 58 with no adjacencies, but there again the maximum size of set is 29, not 30.  To have 30 nonadjacent numbers we need to choose them from an interval of size at least 59.
Continuing the argument to the general case, to have $H$ houses with distinct numbers between $1$ and $n$, and with $\leq k$ adjacencies, one needs $(n+k) \leq 2H - 1.$ This is optimal; the equality can hold, and in a unique way.
Comment: Assuming that no screwup has given the same number to two houses.  Or does "equal" qualify as " adjacent"?  :-)
Comment: One can generalize to "the house numbers all differ by at least $k$", or "the sum of differences of the house numbers that differ by less than $k$ is at most $S$" and so on.


Moving the data from a SharePoint list in one site to a SharePoint library in another site

Question: I understand that a list and a library are two different things... But I have a project tracker which is a list. I would like to move it to a different site and as a library.
Is there any way I can move this data ? Without having to create a library all over again ?
Is there any option to sync a list in one site to a library in another site ?
Kindly help..
Answer: Libraries are associated with documents, it's required to have a document in a library. If you aren't bringing over a document, there is no reason to use a library. Otherwise if you want to move the items over to a different list, the idea is to use powershell:
<code>$sourceweb = get-spweb http://sourceweb
$destinationweb = get-spweb http://destinationweb
$sourcelist = $sourceweb.Lists["List Name"]
$destinationlist = $destinationweb.Lists["New List Name"]

foreach($item in $sourcelist.Items){

$newitem = $destinationlist.Items.Add();
$newitem["Field"] = $item["Field"]
$newitem["Field2"] = $item["Field2"]
$newitem.Update()
}

$sourceweb.Dispose()
$destinationweb.Dispose()
</code>
Comment: Thanks for this info... But to be more precise.. I want the tracker which is a list to moved to a library.. There are many other documents related to the same project in the library and tracker which is now in list must be in the library and its in a different site...any means by which I can bulk load the data from a list in one site to a library in another site ?? Or by using powershell can the same logic be applied ?
Comment: does this script work withing same site collection lists. for moving data?
Comment: Where are your documents stored? What I'm getting at is every "library item" is a document, not a list item. The metadata is about the document. You are planning to have a document for every list item? I think your best bet is to just create a document library that houses these documents, and if you want you can link list items to the document that it relates to.


What does gauge pressure indicate in fluid flow?

Question: In flow measurement, suppose we find gauge pressure difference between any two sections. Does this pressure is total pressure difference, I mean potential, kinetic and pressure head difference or only potential and pressure head difference?
In other sense, does this pressure indicate static pressure only or also dynamic pressure?
Answer: The gauge pressure difference is equal to the static pressure difference.
Comment: In addition, if this gauge pressure difference occurs in a single section of pipe (not blocked in by valves or other equipment), AND both gauges are accurate, there will be fluid flowing in the pipe.


Professional writing tips

Question: I just started my post doc and currently writing a paper but I don't have any professional writing experience. Is there a learning curve or forums that can help with improving writing skills? E.g. I want to rephrase "The review paper published recently talked about the wide range of.." into more professional sentence. How can I get help on this?
Comment: You basically need to have one or more relatively senior people who can advise you on this _now_, since your prior experience did not include much of it. A big part of a PhD would have been lots of iterations of critiques of writing papers, back-and-forth between advisor and advisee, which I guess you missed.
Comment: You're a post doc but don't have writing experience? Did you not have to write a thesis? Anyway - services such as Grammarly have been really helpful to me for improving sentence structure and general grammar.
Comment: I am an MD, do not have a PhD yet so didn't have to do any thesis. Thanks
Comment: at the moment there is an course course which is pretty good https://www.coursera.org/learn/sciwrite in general a good thing is to join a course a get an editor to edit your writing and explain you what are you doing wrong
Comment: _The review paper published recently talked about the wide range of.."_ Add a citation to clarify which review paper you mean. Drop _recently published_ (it is vague and the review paper won't be recent when you publish). Be more precise; replace _talked about the wide range of_ with something more direct. Consider replacing _the review paper_ with _X, Y & Z_, where X,Y,Z are author names. Maybe try https://english.stackexchange.com/
Answer: Many universities have a "writing center" or equivalent that will typically be your best starting point, since it has people who are paid to sit down with you in person and help you solve this problem.
If your institution does not have such, there are massive numbers of online scientific writing courses that may help. Personally, I have found Jean-luc Doumont particularly helpful, and especially his "architectural" view of writing. Different people will find different resources fit their personal learning styles best of course.
Next, if at all possible, make sure that you are partnering with mentors or co-authors who are good at writing.
Finally, read!  The best way to understand what works in communication is to be a reader and learn what works for you.

Professional writing tips


Image quality problems when UILabel is rescaled and rasterized

Question: I have some problems in rescaling the content of a UILabel object when it is stored as an image. Since the rendered image has to be bigger than the original UILabel, I have computed the scale imageScale needed to rescale the original image and saved it into a CGSize variable. In the following, I will explain the adopted (and failing) approaches.
Code used for rendering the image
The following code is used for rendering the extracted image on the canvas.
[labelImage drawInRect:CGRectMake(xCoordinate/imageScale.width,
                                  yCoordinate/imageScale.height,
                                  newSize.width,
                                  newSize.height)
                          blendMode:kCGBlendModeNormal alpha:0.8];

where the variable newSize is computed as follows:

newSize.width = originalWidth/imageScale.width;
newSize.height = originalHeight/imageScale.height

Approach 1
I extracted the label using the following code:
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
    [[label layer] renderInContext: UIGraphicsGetCurrentContext()];
    UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

where label is the UILabel variable and newSize is the size that the rescaled image should have (see above for details).
However, I obtain the following image, which is obviously failing, since the content is very little and not centered:

Approach 2
I extracted the label using the following code:
UIGraphicsBeginImageContextWithOptions([label bounds].size, NO, 0.0);
    [[label layer] renderInContext: UIGraphicsGetCurrentContext()];
    UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

However, since I am using the original image size in order to extract the image, the effect I obtain is the following:

As you can notice, the text in the balloon has not a high resolution, and thus it is not visualized properly.
The question
How to correct one of the two approaches so as to visualize in high resolution the image?
Answer: Seems like you just need to set appropriate scale for the generated image.
This is the function:
void UIGraphicsBeginImageContextWithOptions(
    CGSize size,
    BOOL opaque,
    CGFloat scale
);

You set scale as 0.0. Try replacing it with [UIScreen mainScreen].scale.
Comment: Unfortunately this is not solving the problem.


What happens to oxygen produced on the Sun (or other stars)?

Question: Through nuclear fusion, the Sun can (or at the very least, someday will) produce atoms of all elements up to and including oxygen.  And in terrestrial chemistry at least, when you combine oxygen, hydrogen, and a small amount of heat you get water.  Or lithium and oxygen and heat will produce lithium oxide.  Those individual components are all readily available in a star like the Sun.
So my questions is, does the oxygen produced by the Sun (or any other star, now, in the future, or in the past) react chemically (for instance, through oxidation or combustion processes) with the other elements present in the star's atmosphere?
Or I suppose more generally, do the elements formed through nuclear fusion in a star chemically interact to produce more complex molecules (and if not, then why not)?
Comment: Please note that elements heavier than oxygen will be produced in the Sun (in the AGB phase) via the s-process (neutron capture).
Answer: The Sun is a small main sequence star. It does not produce oxygen via fusion. It can't. The temperature and pressure in the Sun's core are too low. Fusion in the Sun is currently limited to production of helium. This will remain the case for several billion years.
That said, there is oxygen in the Sun, about 1% by mass. This oxygen was produced long ago by other stars at the end stages of their lives. Our Sun is a third generation (or more) star. Most of the Sun is far too hot for those oxygen atoms to combine chemically. One exception is sunspots, relatively cool areas on the Sun's photosphere. (Relatively cool means less than 4500 kelvins, so still quite hot.) Molecules can form at these lowish temperatures, and scientists do see signatures of many different molecules in the light coming from the Sun.

**Update, in response to edits to the question**
Molecules cannot form inside of a star. The temperatures are just too high. Molecules decompose (split apart) into their constituent parts at high temperatures. The Sun's photosphere is about 5800 kelvins, which is already too hot to sustain very many molecules. Temperature rises rapidly with increasing depth below the photosphere. The Sun's core temperature is about 15 million kelvins (27 million Fahrenheit), and the Sun is a small star. Larger stars have even higher core temperatures. At 15 million kelvins, there aren't even atoms, let alone molecules. There are instead atomic nuclei and electrons. Atoms are stripped of their electrons at those extreme temperatures.
In five to seven billion years, our Sun will have fused all of the hydrogen in the core into helium. That's when our Sun will become a red giant. Even then, it still will not produce oxygen. The first stage a one solar mass star experiences after leaving the main sequence is the red giant phase, where the core is an inert mass of helium surrounded by a shell of fusing hydrogen.
Eventually (after another billion years or so), the temperature of that helium core will rise to the point where the helium starts fusing into carbon, plus a little bit of oxygen via the first step on the alpha ladder. At this point, the Sun will leave the red giant phase and join the horizontal branch of the Hertzsprung–Russell diagram. This is a rather short-lived phase of a star's life. The carbon and oxygen produced by helium fusion quickly (in stellar timeframes) form an inert core. At that point, our sun will become an asymptotic red giant.
The red giant and asymptotic red giant phases are rather messy affairs, wracked by convulsions where the star expels lots of gas. Our Sun will lose about half its mass to such convulsions. Molecules do form when this expelled gas cools. This results in some of the prettiest pictures in astronomy, shown below.

(source: inspirehep.net)
Comment: @aroth: The first point is entirely relevant and is complete accurate. Read your second and third references carefully. I'm not a fan of wikipedia, but it's certainly better than yahoo answers. The Sun will eventually produce oxygen, but first it has to deplete all of the hydrogen in the core. Then it will become a red giant (and it still won't be producing oxygen). The Sun will only produce oxygen when it leaves the red giant stage to join the horizontal branch. That won't happen for several billion years.
Comment: Yes, which is why the "It can't" isn't accurate.  It _can_ and _will_, just not for awhile yet.  A long, _long_ while, true.  But the Sun several billion years from now is still "the Sun", just as it was still "the Sun" some ~4 billion years ago when it started its existence.  As for relevance...the substance of the question was about what happens to chemically reactive elements in a star and why (which the second half of your answer addresses), not about whether or not the Sun is producing oxygen _right now_.
Comment: Not sure if the first point is relevant, or even accurate.  According to the information [here](https://au.answers.yahoo.com/question/index?qid=20080525065321AAwr2jH), [here](https://en.wikipedia.org/wiki/Triple-alpha_process), and [here](https://en.wikipedia.org/wiki/Helium_flash) the Sun is massive enough to produce oxygen.  If not today then at some point in its lifecycle.
Comment: @aroth: Your question was phrased in the present tense at the time I wrote this answer. (The second paragraph in your question is still phrased in the present tense.) I answered the question you originally wrote, not the question as currently edited.
Comment: In the present tense, but also with a general summary that was meant to make it clear that the subject was "what happens to reactive elements _when they exist_".  Anyways, I've edited the question to hopefully make it more clear what was actually being asked.
Comment: Is it completely impossible for fusion at those temperatures to produce oxygen, or just statistically unlikely? Is it possible that at *some* point in the Sun's history, a freak pressure wave or something produced a local spot hot enough to fuse an oxygen nucleus? It's like the thought experiment where the random motion of air particles coincidentally evacuates a room of its air for 3 minutes and you suffocate.
Answer: The answer is yes. Molecule formation is common in the outer photospheres of cool stars, and those molecules frequently contain oxygen. Obvious and common examples are TiO, VO.
This chemistry almost entirely happens when temperatures fall below 5000K, because otherwise the molecules are dissociated. Therefore it never occurs in stellar interiors.
The Sun will form molecules (involving O) in the later stages of its life, first in its atmosphere when it becomes a red giant (in small quantities). The oxygen in these molecules was not produced in the Sun, it was already there. More extensive molecule formation happens when it ascends the Asymptotic Giant Branch, prior to losing about half its envelope to thermal pulsations and a strong stellar wind. Here, some of the oxygen was made in a helium burning shell inside the Sun and transported to the surface by convective mixing.