Saving as jpg in Illustrator

Question: When I try to "save for web" my work in Illustrator (258px - 170px) it shows the right image size (258px - 170px) but after I save the image, and open it in windows, the image is really small. When I zoom in, it blurs so something is wrong. What am I doing wrong? How can I save without getting my image so small?
Comment: Your image, at 100% scale on a typical monitor, will only be about 2.75" across, which is pretty small. If you need the image to be sharp at a larger size, you will need to upscale the artboard and art before exporting again at 72ppi.
Comment: 258x170px is pretty small small...try a bigger image size....
Answer: Not sure what version of Illustrator you are using, but make sure after you put in the new size you click the 'Apply' button just below the image size text boxes before hitting save.
I also agree with the above post that the size you have chosen is really quite small and could also be the issue. As well, PNGs tend to look a lot nicer for most work.
Answer: Can you copy the object from Illustrator to Photoshop?
Illustrator's artboard is designed for vector objects, but it sounds like you're doing raster images via Save for Web via Illustrator.
Also Photoshop will show your object as 100% to scale, so zooming won't be an issues.
Also, a side problem - but the default photo viewer for Windows sucks. It will probably show slightly blurry no matter what zoom you're using. Try dropping the image into a browser and view it there.
Answer: Choose a larger size. The dimension that you're talking about is quite small at 72ppi (web quality). If this size is not required then I would enlarge your Illustrated design or try File>Export and select JPEG. Now when you export you can choose a higher resolution.
Comment: When I do this (file>Export) It crops the image, i dont know why or how, but it gets smaller
Comment: You may have to adjust your artboard size to fit the design.
Comment: After making sure that the artboard size is right.When using (File>Export) make sure that the "Use Artboard" option is checked, this will take the size of the artboard itself ignoring the clipping masks.

Also in the save for web option, you can find an option on the right where you can scale proportionally your output so you can upscale the final image saved.

Can you please also tell us what are you using the photos for? Web? print?

Saving as jpg in Illustrator


What about autocorrelation and heteroskedasticity in Fama French?

Question: I am analysing ESG and conventional mutual funds. I decided to measure the extra performance of each category using the Fama French 4 factor model, but it seems to me that in previous literature they do not investigate issues such as autocorrelation and heteroskedasticity. SOme paper just write down that they use Robust Standard Errors. Could you please explain me why and in case provide me some books, papers or links where I can investigate this topic?
Thank you
Answer: If you face heteroskedasticity, you have to check if heteroskedasticity is conditional (e.g., with a Breush-Pagan Chi-square test). If so, you have to use White-corrected standard errors.
If you have serial correlation (e.g., you can test that with a Durbin-Watson test), you can use the Hansen method to adjust the standard errors.
Basically, what you do with both methods is to use "robust" standard errors. Otherwise, your standard errors are underestimated.
I recommend Wooldridge, J. M. (2015). Introductory econometrics: A modern approach. Cengage learning.


Hot water running out, already replaced both heating elements and both thermostats

Question: Our hot water runs out during one not-too-long shower.  By the end of the shower, I have the cold water completely off and the hot water coming out is only lukewarm.  My husband already replaced both heating elements and both thermostats.  What else could be causing this?
Comment: Has this always been a problem, or has it just started?  When your husband was replacing parts, did he check to make sure there isn't a bunch of sediment at the bottom of the tank? Is the tank set to the proper temperature?
Comment: At some point it's more economical to replace the tank, rather than continually replacing parts.
Answer: The most likely reason is a degraded/broken dip tube in the hot water heater. If this were the case, there would likely be little bits of plastic in your water, which perhaps could be seen  if you removed a faucet aerator. To replace the dip tube, the cold water inlet must be removed, and the new tube installed. One related cause is if the inlet and outlet of the water heater are swapped. If swapped, the cold water in the bottom of the tank is supplied to fixtures.
Another reason is an unintentional mixing of the hot water and cold water. It's possible that there is a broken faucet somewhere that allows the water to mix, providing lukewarm water.
I suggest also verifying that the hot water is reaching the proper temperature. If you drain a little bit of water from the tank, is it the proper temperature? If not perhaps the wiring is wrong, the thermostat is broken, or the thermostat is set to the wrong temperature.
Comment: The tank being plumbed backwards (cold/hot reversed) will also cause this.
Comment: +1 for dip tube... Another idea: Is it possible your incoming water temperature is colder than normal?  If so a tank that might have been large enough for a shower before is no longer large enough.  How big a capacity is the tank?  Do you have the model number so the gallons per hour and recovery rate can be checked?
Comment: Thank you SO much for the replies, this is so helpful!  We are going to replace the dip tube and see what happens.  This started happening a few months ago, having not been a problem previously, so we are pretty sure the capacity of the tank is okay.  Thanks again!
Comment: While you're at it, you should check the condition of the anode rod and the emergency relief valve, and replace them if needed.


macbook pro making repetitive clicking noise

Question: My macbook pro has started making a repetitive clicking noise every 4 seconds. It kind of sounds like a woodpecker or something, not a scraping noise.. does anyone know what could be wrong?
Comment: I would check your hard disk and make sure it has a backup
Answer: As previously mentioned, it's either the hard drive,but it sounds to me like something might be impeding one of your fans. I used to hear something similar with an older MBP I had and it was the fan on the GPU. Might be worth taking it into a qualified Apple dealer/service point.


Is there any reason not to mix warm and cool season native grasses?

Question: I'm looking to plant a no-maintenance prairie in my desert southwest yard (Northern New Mexico, zone 7B, sand and heavy clay soil, 7 inches of annual rainfall). Two years ago I planted a bunch of Blue Grama and it does well with no irrigation. One year ago I planted Streambank Wheatgrass elsewhere and that does well too, also with no irrigation. Streambank wheatgrass retains a bit more color in the winter, so I'd like to add it to my grass mix when I plant more to fill even more of my large and very sad-looking dirt yard. So my question is: can I plant these two grasses together? Blue Grama is a warm season grass and Streambank Wheatgrass is a cool season grass. Is there any problem with such an arrangement? Will they grow together? Will one dominate and crowd out the other, wasting the money spent on the loser? Will it look stupid in the winter with big weird clumps of green Streambank Wheatgrass amidst the dormant yellow-gray Blue Grama?
Comment: I don't know the answer to most of these questions, but I don't think it will look stupid mixing the two (if one is not completely overtaken).
Answer: I am going to say that there is really no reason not to blend them. Will one out perform the other? Possibly, but then you know you have the variety better suited to the conditions that grass finds itself in.
Answer: If you are in full sun then give Buffalo Grass a try (Buchloe Dactyloides) It is fine textured, thrives on almost no water once established, does not need fertilizer, does not need to be MOWED! mature height is about seven inches. And suffers from no pests or diseases. There is a great company called Native American Seed that sells a buffalo (80%) and blue grama(20%) seed mix and in this years catalog they have photos of the stuff thriving in peoples yards all over Texas. The above answer is right, when you mix seed types the one that suits the conditions will generally out perform and dominate. There is also a native shade mix with eight different species in the catalog and it is a 'mixture of cool season and warm season species providing year round cover'. I think that pretty much clears up any doubts. Since 70% of our water use where I live is for irrigation, I really hope this stuff catches on nationwide like it is starting to here in TX.
Comment: Yes, I have already purchased Blue Grama from them. It grows wonderfully in my climate, but does need to be mowed to be a lawn. The problem with Buffalograss is that we don't get enough water for it to thrive on its own in non-irrigated areas. My goal is zero supplemental irrigation.
Answer: What a great question. If you like the effect of blue grama in a yard setting, wheatgrass would indeed dilute from it.  I have a stand of blue grama, buffalograss and inland saltgrass and love it (pic), and keep wheatgrass and other things out of it. I see mixes around, and they give more of a wild, scruffy, highway roadside effect.  Diluted effect.  Wheatgrass CAN mix with Sideoats Grama in a compatible way, with similar size and texture.  A yard in my neighborhood has more of a mixed effect based on those two, with some shrubs, yucca, and other things thrown in as well. [Pic is mostly blue grama and buffalograss] [Tried to add another pic of Western Wheatgrass & Sideoats Grama]
Comment: There's no picture.


Action of the Galois group on the ideal class group

Question: Assume that $K/\Bbb Q$ is a cyclic Galois extension, and $\mathfrak{p}$ a prime ideal of $K$ and $\sigma$ an element of the Galois group. What can we say about the classes $[\mathfrak{p}]$ and $[\sigma(\mathfrak{p})]$ in the ideal class group? Let $\left \langle [\mathfrak{p}] \right \rangle$ be the subgroup of the ideal class group generated by $[\mathfrak{p}]$. Do we have that necessarily $[\sigma(\mathfrak{p})] \in \left \langle [\mathfrak{p}] \right \rangle$? I cannot prove this. Also, I do not have any idea how to find a counter example.
Comment: @FranzLemmermeyer Could you please introduce a specific book or note or ... to me about this subject? If I am not mistaken, probably genus theory would deal with the cases when the Galois group acts trivially on the ideal class group.
Comment: Look up genus theory.
Comment: looks like you got interested: https://mathoverflow.net/questions/382930/galois-group-acts-by-the-i-th-power-of-the-teichmuller-character-on-h
Comment: @Niels Much more than interest. My mind is involved with this kind of number theory, around the clock and every moment. Thanks for introducing that article
Comment: you could have a look at [[math/9812171] Perfect forms and the Vandiver conjecture](https://arxiv.org/abs/math/9812171)
Comment: @Niels I can not see how the results in that paper are related to my question. Could you please give an exposition on it?
Answer: This is true if $K$ is quadratic, since then $[\sigma(\mathfrak p)] = [\mathfrak p^{-1}]$.
It should be false for every other degree.
The only relation that the Galois action should satisfy is (for cyclic fields of degree $n$) that $ \prod_{i=0}^{n-1} [\sigma^{i}(\mathfrak p)] $ is trivial in the class group, since it's the class of the norm of $\mathfrak p$, which is an ideal of $\mathbb Q$ and thus is principal.
For example, for cubic fields, if this were true then you could never have $p$ congruent to $2$ mod $3$ dividing the order of the class group, as the Galois automorphism of order $3$ would have to act on elements of order $p$ by scalar multiplication by an element of $\mathbb F_p^\times$, and thus would have to be trivial, which is impossible since it would violate the above identity. So it suffices to find a cubic field whose class number is a multiple of $2,$ or $5,$ or ...
Searching quickly on the LMFDB, I found this counterexample, whose class number is $4$.
Comment: @NeoTheComputer No, I just mean that if $\sigma([\mathfrak p]) \in \langle [\mathfrak p \rangle$ then $\sigma([\mathfrak p]) = [\mathfrak p]^a$ for some $a$ mod $p$, because  $ [\mathfrak p]$ has order $p$.
Comment: Your statements on quadratic extension and cyclic extensions are very clear. Also, I can check why your counterexample contradicts my claim (I can see it in another way), and I get the answer to my question. But I have another request, could you please tell more on the "Galois automorphism should have to act on elements of order $p$ by scalar multiplication by an element of $\mathbb F_p^\times$"? Can you write down the action of the Galois group?
Comment: Thank you for your response.


Physical Meaning Behind Matrix Factorization

Question: As we all know, Matrix Factorization is an effective method to do rating prediction jobs in recommender systems. Thanks to the work of Yahuda Koren. My question is why MF can do this job? What's the physical meaning behind it?
Comment: Matrix factorization is a sort of (slightly lossy) compression. A sufficiently good compression contains (at least implicitly) a certain type of understanding about the compressed information.
Comment: Why do you think there has to be a "physical meaning"?
Answer: The idea in matrix factorization is to find the latent variables which connect the input and the output. Suppose that we are interested in a movie recommendation system, and that movies "live" on a one-dimensional axis, having romantic comedies in one end, and action movies in the other. Each "input" and "output" move can be rated in this scale (say $1$ to $-1$). Given the input movies, we can estimate a person's location $p$ on the axis (say a point in $[-1,1]$) by taking the inner product between the movies they saw and their "ratings" $r_i$, i.e. $p \approx \frac{1}{n} \sum_{i=1}^n r_i$, where $1,\ldots,n$ are the movies seen by the person. Given the location, we can estimate how much that person will like other movies: movie $t$ will be liked by an amount proportional to $pr_t$ (this is just a simplistic linear model).
In this example, the recommendation matrix can be decomposed as an outer product $A_{it} = r_i r_t$. More generally, the situation could depend on several latent variables, and this is the general situation described by matrix factorization. The number of latent variables is the "middle" dimension in the factorization. If you have found a good factorization with only a few variables, then you have a succinct explanation of your data that could have predictive power.
Comment: Could you explain a bit more, or redirect me to an elaborate explanation? I don't see where the inner product is happening - the person's location is simply the average of the (ratings of the) movies he has seen. Furthermore, people and movies lie on the same axis? I'm missing something here.
Comment: Have you read this: https://datajobs.com/data-science-repo/Recommender-Systems-%5BNetflix%5D.pdf? If there is anything specific you don't understand, you can ask about it here, or you can try to look for it in some of the references.
Comment: @elexhobby: Basically, if you assume that there are a small number of "prototypical" users (i.e., every user is a linear combination of a small number of other users) and similar for items, the recommendation matrix is low rank.  Then you can try to get back the singular vectors (which represent the users/items) from the observations.  Once you have them, you can predict.  The point of this area is figuring out how to do it.
Answer: a rough intuition (other than the basic data compression concept) is as follows. recommender systems that use matrix factorization methods eg SVD can be seen as a set of linear weights of natural features found via unsupervised means. a "feature" eg for a movie database is a large set of movies of varying weights. they dont necessarily have recognizable human meanings but could be given loose interpretations based on correlations with other variables associated with the subjects. such as "movies that women like, movies that men like, movies that kids like, movies that republicans like," etcetera. an individuals tastes are then represented approximately as a linear weighted combination of all these "factors". hence its very similar to statistics-based Factor Analysis where, roughly, causes & effects are decomposed into weighted "factors". some accounts of the Netflix contest refer to this concept.


Refocusing light field images via Fourier Slice Photograph theorem

Question: I am trying to refocus images from a microlens array light field using Ren Ng's Fourier Slice photograph theorem found in his thesis chapter 5, equation 5.7, which is available at https://stanford.edu/class/ee367/reading/Ren%20Ng-thesis%20Lytro.pdf
Fourier Slice Photograph theorem
$$ P_a=F^{-2}\circ B_a \circ F^4$$
Where P is the refocused photograph, F is either inverse or forward Fourier transform, and B is the Fourier photographic imaging operator, which he gives as
$$B_a [G](k_x,k_y)= \frac{1}{F} G(\alpha k_x, \alpha k_y, (1-\alpha)k_x, (1-\alpha)k_y) $$
which is given in equation 5.6. In words, the Fourier Slice photograph theorem means a photograph is the inverse 2D Fourier transform of a dilated 2D slice in the 4D Fourier transform of the light field.
My confusion is partly notation and applying it in python to an acquired light field image. To start, I understand what the Fourier transform is but when Ng says 4D Fourier transform of the light field, I am not sure how to interpret that. Currently, I have my light field as a NumPy array such that my u=i, v=j values index to the different sub-aperture images where each pixel in the sub-aperture image has an x and y coordinate, hence giving me a 4D light field array.
<code>        lf_img = cv2.imread(lf_img, -cv2.IMREAD_ANYDEPTH)
        row_lens = lf_img.shape[0]/14 #14 is pixels under a microlens in this direction
        col_lens = lf_img.shape[1]/14 # 14 is pixels under a microlens in this direction
        vp_imgs = np.zeros([14,14,int(row_lens),int(col_lens),3])
        for i in range(14):
            for j in range(14):
                vp_imgs[i, j, :, :, :] = lf_img[i::14, j::14, 0:3] ##U,V,X,Y,(RGB)
</code>
Then I see images like this http://graphics.stanford.edu/papers/fourierphoto/ in Ng's thesis where to me it looks like he just took the 2D Fourier transform of each lenslet and arranged them in a grid. So I am not entirely sure how to interpret this 4D Fourier transform and how the slicing is done. Thanks!
Sample of what sort of light field image I am working with:
Answer: The trick is avoiding the computation of $4D$ Fourier transform (high computational complexity) by using Fourier slice theorem. Its implementation is pretty tricky AFAIK. He never computes $4D$ transform. $4D$ transform is not much different from $1D$ to $2D$.


Coin toss probability

Question: How would I go about calculating the probability of the following, the number of tosses needed when tossing 3 coins for the probability of at least one head to be at least 0.99999?
Comment: I'm not sure if I'm missing something about the "3 coins".  If you can solve this with one coin, isn't your question answered just by dividing that number of coins by three and rounding up (to get the number of 3 coin tosses)?
Comment: Interesting.  If you tossed a coin and it came up tails 16 times in a row, would you start to doubt the assumption that the coin in unbiased?
Answer: You would just figure the probability of there being no heads. The probability of there being no heads on 3 coin tosses is $ \frac{1}{8}$
So to compute the number of times that can happen and satisfy your conditions:
$$ \left(\frac{1}{8}\right)^n=1-0.99999 $$
Solving for n yields about 5.6, so we round up and get 6 as the answer.

Coin toss probability


Unable to verify raspbian OS using raspberry pi imager

Question: I'm trying to install raspberry pi OS on my SD card with the help of raspberry pi imager. the problem is that it writes successfully but when it's time to verify it ends with an error saying "Verifying write failed. Contents of SD card is different then what was written to it". I've been looking up everywhere for the solution but all I get is "fault in SD card" that's not the case with me, my SD card works fine. please help !! Hardware details: Raspberry pi 4 8gb variant Raspberry pi imager version : 1.6.2
Comment: "my SD card works fine" how do you KNOW? Have you tried a NEW card? If the verify fails either the SD Card or the SD writer is faulty.
Comment: Does the card boot a Pi?
Comment: @joan it worked, i used balena etcher to flash my sd it's working now
Answer: The fact that your SD card is bootable doesn't mean there is no corruption. Perhaps you just didn't access the corrupted files yet. Consider checking it with a tool you trust (I don't use the Pi imager so I don't know how reliable it is). Balena Etcher seems to have a validation option as well, make sure to use it when you flash.
Working with a corrupt SD card will cause you lots of pain in the long run. You might spend days trying to debug a script, only to find out that the error is caused by a corrupt Python library file. Checking an SD card only takes a few minutes.
Answer: Honestly, I wouldn't be so sure your card works fine. I once spent 2 hours on tech support with GoPro trying to get the firmware updated only to find that none of the new 32GB and better Samsungs I had would work, but an old crappy 2GB Kingston worked without a hitch.
This is just to say, don't waste a lot of time trying to fix the computer before just trying a reboot. Get a new card, see what happens. I bet you'll be happily surprised.


How can you test whether a word is being used as a conjunction?

Question: It's been a couple years since I've taken a syntax class, and I've forgotten - what tests can you use to check whether a speaker uses a word as a conjunction? I seem to remember something about testing where the speaker can attach different clauses in the sentence, but I don't remember the details. I'd appreciate any explanations, or links to published papers discussing this topic!
Comment: If the answer below brings the information you need, you should consider clicking on the "tick" of the answer so as to check the answer as the "accepted answer".
Answer: In The Syntactic Phenomena of English, McCawley uses Ross's CSC (Coordinate Structure Constraint) and RNR as diagnostics for coordinate conjunctions.  See, e.g., p. 616, where M. investigates contrastive negative but.
Comment: This resembles a Link-Only-Answer... Could you explain or sum up about it a bit?
Comment: @StephaneRolland, The CSC requires that all conjuncts of a coordinate structure be affected equally by any rule that affects one of them.  So, if you find that the parts of a structure are affected equally, by an extraction for example, this identifies it as a coordinate structure.  McCawley has a whole chapter of his book on coordination, and I cannot do it justice here.  Some of the book is online, and I urge you to go there and take a look.  Here is another web reference: https://books.google.com/books?id=k6-C5AWWqjQC&q=coordinate#v=snippet&q=coordinate&f=false
Comment: @StephaneRolland, My characterization of rules which must conform to the CSC should have mentioned that rules constrained by the CSC must have a conditioning factor outside of the putative coordinate structure.
Comment: @StephaneRolland, They are both necessary conditions.
Comment: thanks for your additional information. I have some difficulties understanding your second comment. What is the most important ? First, that there is at least one conditionning statement, or second, that this statement is outside the structure ?


Reclaim space from dropped column in SQLServer2008R2

Question: I am trying to reduce the size of a database that is reaching the limit of the express edition of SQLServer2008R2.
We have identified that due to bad design, a large varchar(2000) field that contains on average 1100 bytes occupies most of the space.
Since this field is not needed to be retained, I want to drop the column, move it to a different table, use it there for the duration it is needed and then clean that table frequently.
I am trying to find the best solution to reclaim the space "wasted" in this column after it is dropped.
The table contains about 1.500.000 rows and has a Clustered PK on an ID (int) column.
I have succesfully reclaimed the space by moving all the contents of the table to a separate database, compacting the original database and then moving the table contents back to the original database having dropped the varchar column. This reclaims about 5Gb of space, which is what I need.
However, I'm looking for a faster and more streamlined option.
I have also succesfully reclaimed the space by dropping the varchar column and then using
DBCC DBREINDEX ({TABLENAME}, {PK_Name}, 100)
However, this process enlarges the size of the database while being executed, exceeding the 10Gb limit that would be enforced in the production environment, so it's not feasible.
I have also tried using DBCC CLEANTABLE that by the documentation appears to be the function best suited for the task, especially since the "Batch_Size" parameter may avoid the inflation of the database size during execution.
However, it looks like CLEANDATABASE is not doing it's intended job at all. It's a pretty simple command and I can't find how I can get it wrong, but here is what I did:

Restore the database (7.2Gb size, 198Mb free) - an old backup, the current database is about 9.5Gb large
Drop the varchar column (does not alter size and free size as expected)
Run DBCC CLEANTABLE ({DatabaseName}, {TableName}, 1000)
Database still shows the same size and free space

From that point on, the only way I've found to be able to reclaim the space is to reindex the table by using:
DBCC DBREINDEX ({TableName}, {PK_Name}, 100)
with the PK_Name being the Primary key, clustered, i.e. the actual data pages.
By doing so, the database shows to have become 8.1Gb with 4.8Gb free space.
From there on, I can reduce the size of the database file - for faster backups - by issuing a shrink command with NOTRUNCATE and then a second one to truncate the file at the end.
Although I have found a way that decently does what I need to do, I am baffled because CLEANTABLE doesn't seem to perform it's "advertized" purpose, even though it takes some time to complete.
Any suggestions or similar experiences?
Thanks in advance
Answer: I did more work on the subject and came up with an interesting insight.
Working with the Express edition database engine, I just dropped the column, re-indexed the primary key (cluster index) to re-arrange the data, which inflated the database file size to more than 10Gb and then simply performed a shrink step (NOTRUNCATE) to compact the database file and reduce it's size within nominal limits.
The database engine didn't complain for the excess size during this process and the end result was a database file that had the space needed reclaimed.
So I guess the answer was simpler to solving the problem at hand.
However I still remain puzzled about CLEANTABLE not doing what the documentation describes it does.


Asking Am Haaretz and doing opposite

Question: There is a Sm"a (I think) somewhere which talks about what to do in a situation when a chacham is not available to answer one's question - namely, to get advice from an Am Haaretz, and then do the opposite.
Does anyone know where this is?
Answer: There is a well-known expression in the world of the yeshivot:

דעת בעלי בתים היא היפך דעת תורה
The view of laymen is the opposite of the view of the Torah.

This is often sourced to a statement of Mahari Weil quoted in Sma (3:13):

ואם תשמע לעצתי לא תשב אצל הקהל בשום דין דידעת שפסקי הבעלי בתים ופסקי הלומדים הם שני הפכים
If you will take my advice, do not sit with the general public in any judgement, because you know that the decisions of laymen and the decisions of the learned are two opposites.

As far using this aphorism to arrive at a decision by consulting laymen and doing the opposite, this seems to have its roots in a legend concerning the author and publicist R. Moshe Sheinfeld and the Brisker Rav (recounted, for instance, here or here).
Apparently, the Brisker Rav marveled at the fact that R. Sheinfeld in his articles always arrived at the correct, da'at torah-compliant position. R. Sheinfeld explained that his method was simple: he would consult with the general public about an issue, and then write the precise opposite of whatever he heard from them. In this way, he was guaranteed that what he wrote would represent da'at torah.
Comment: Doing the opposite of the unsuccessful: http://www.contractorsalescoach.com/george-costanza-school-of-contracting-success/
Answer: I once saw in the sefer ברך משה that explained with this theme a Gemara in sanhedrin 94a that brings a dispute between רב and שמואל what is the correct interpetation of the words ויחד יתרו, and רב brings proof to his "rival" שמואל from what "the people say" (היינו דאמרי אינשי), and the meforshim question why would רב bring support which is opposing to his approach, says the ברך משה that perhaps he was bringing proof to himself by saying that the view of שמואל is the view of the commonfolk and דעת תורה היפך דעת בעל הבית!!!!!

Asking Am Haaretz and doing opposite


Are investors' preference for dividends justified?

Question: Think about it. Before you get the dividend, you own the stock of the company. The amount to be distributed to you as dividend is in the coffers of the company. After you get the dividend, the money disappears from the coffers of the company but you still own the stock. In other words, the value of stock before the dividend must be equal to the stock + dividend received after the dividend. Even if the company does not pay a dividend, the cash retained in the company is also owned by the investor. So why are people so excited about dividends?
Comment: I _wish_ investors still  preferred dividends. Unfortunately too many are looking for a quick buck and have been forcing companies to manage for stock price growth ... which is not always healthy for either company or investors.
Comment: Cash owned by the investor != cash available to use by the investor.
Answer: This question is predicated on the assumption that investors prefer dividends, as this depends on who you're speaking to.  Some investors prefer growth stocks (some which don't pay dividends), so in this case, we're covering the percent of investors who like dividend paying stocks.
It depends on who you ask and it also depends on how self-aware they are because some people may give reasons that make little financial sense.  The two major benefits that I hear are fundamentally psychological:

Dividends are like mini-paychecks.  Since people get a dopamine jolt from receiving a paycheck, I would predict the same holds true for receiving dividends.  More than likely, the brain feels a reward when getting dividends; even if the dividend stock performs lower than a growth stock for a decade, the experience of receiving dividends may feel more rewarding (plus, depending on the institution, they may get a report or see the tax information for the year, and that also feels good).
Some value investors don't reinvest dividends, as they believe the price of the stock matters (stocks are either cheap or expensive and automatic reinvestment to these investors implies that the price of a stock doesn't matter), so dividends allow them to rebuild their cash after a buy.  They can either buy more shares, if the stock is cheap, or keep the cash if the stock is expensive.  Think about Warren Buffett here: he purchased $3 billion worth of shares of Wells Fargo at approximately $8-12 a share in 2009 (from my memory, as people were shocked that be bought into a bank when no one liked banks).  Consider how much money he makes from dividends off that purchase alone and if he were to currently believe Wells Fargo was overpriced, he could keep the cash and buy something else he believes is cheaper.  In these cases, dividends automatically build cash cushions post buying and many value investors believe that one should always have cash on hand.

This second point is a little tricky because it can involve risk assessment: some investors believe that high dividend paying stocks, like MO, won't experience the huge declines of indexes like the SPY.  MO routed the SPY in 2009 (29% vs. 19%) and these investors believe that's because it's yield was too desired (it feels safer to them - the index side would argue "but what happens in the long run?").  The problem I have with this argument (which is frequent) is that it doesn't hold true for every high yield stock, though some high yield stocks do show strong resistance levels during bear markets.
Comment: Also, some countries may have special tax treatment for dividends - for example Franking Credits in Australia.
Answer: Stocks aren't just paper -- they're ownership of a company.  Getting cash from a stock that doesn't pay dividends basically means reducing your stake in the company.
If the stock pays dividends, on the other hand, you still have the same shares, but now you have cash too.  You can choose to buy more of the company...or, more importantly, to use it elsewhere if that's what you want to do.
Comment: One of the most common misconceptions about dividends among new or unsophisticated investors is that a dividend is free money. It is not.  Dividends are just cash flow, not actual income. They do not provide Total Return nor do they increase the value of your position or account (if received in a non sheltered account, you are losing money because of taxation).  This is because on the ex-dividend date, share price is reduced by the EXACT amount of the dividend, creating an equal capital loss.
Comment: @BobBaerker: True enough. You're losing money to Uncle Sam either way, though -- without dividends, you're just putting off the bill til you sell.
Comment: Another issue is that by paying taxes on non sheltered dividends received, you reduce the compound rate.  It's above my pay grade to know the result "X" years down the road when you factor in the compound rate, taxation now versus later as well as tax bracket  bracket differences.  My gut feeling is that getting taxable dividends is the poorer choice.
Answer: Some investors (pension funds or insurance companies) need to pay out a certain amount of money to their clients. They need cash on a periodical basis, and thus prefer dividend paying stock more.


What do you call a person who conducts seminar workshops?

Question: If a resource speaker or guest speaker is someone who makes usually formal public speeches; a trainer is someone who trains; how about someone who conducts seminar workshops?
Comment: If he *conducts* workshops, perhaps he is the *conductor* of the workshops.
Comment: A *seminarian*, obviously.  (Well, maybe not.)
Comment: please describe what duties are included in your "conducts" verb.
Answer: Facilitator is sometimes used to describe someone who leads a seminar.

A facilitator is someone who helps a group of people understand their common objectives and assists them to plan to achieve them without taking a particular position in the discussion.
[Wikipedia]
Comment: What happened to all the 'instructors'?
Comment: Reg mentioned *instructor.* And instructors instruct; facilitators facilitate. A *seminar workshop* may not need an instructor.
Comment: @AndrewLeach: Facilitator does leave it open that this person maybe wasn't present at the workshop. E.g. someone who made his building available and put up posters is a facilitator ([derived from the verb](https://en.oxforddictionaries.com/definition/facilitate)), but he does not necessarily conduct the workshop. Not saying your answer is wrong, just that it can have more interpretations than just the OP's.
Answer: Coach, instructor or tutor. Will likely depend on what they want themselves to be called, and what kind of workshop it is.
Answer: A person who conducts or presides over a seminar or group discussion may be called moderator:

one who presides over an assembly, meeting, or discussion.

[Merriam-Webster]
Comment: Hello, Rajeswar. Your answer was (unfortunately) flagged automatically as low-quality for its length. Please try to cite some references as I've done in the edit. Your post seems to answer the question. Please review my edit and try to follow the format next time you answer a question. Good luck.
Answer: We call him Organising Secretary. He looks after all the aspects of the seminar - including funding, transportation, accommodation and publication from a direction and decision point of view.


Does there always exists coefficients $c,d\in\mathbb{R}$ s.t. $ax^3+bx^2+cx+d$ has three different real roots?

Question: Well, my question is exactly the one which is written in the title. Consider $a,b\in\mathbb{R}$ two given real numbers. Now, let $c,d\in\mathbb{R}$ be two parameters that we can control. My question is, does there always exists $c,d$ so that the polynomia $$
ax^3+bx^2+cx+d
$$
has three different real roots?
Answer: If $a=0$, then there cannot be $3$ real roots.
If $a\not = 0$, WLOG $a\geq0$, then let $c<0$, $d=0$. It passes $(0,0)$ with negative slope, so it has $3$ real roots.
Answer: Let $f(x)= ax^3 + bx^2 + cx + d $. Clearly for $a=0 $ ,$f(x)=0$ cannot have $3$ roots. Let $a\neq0$. Note that only the sum of the roots =$-b/a$  is given as $a$ and $b$ are given. The product of the roots taking $2$ at a time($c/a$) and product of all roots($-d/a$) are not given as $c$ and $d$ are not given. Let the roots be $p-r, p , p+r$ ( in AP $r\neq0$ to make the roots distinct; here $p, r$ are real). Therefore $p-r + p + p+r= -b/a= 3p$. Hence $p=-b/3a$. Therefore the roots becomes $-b/3a-r, -b/3a , -b/3a +r$ . Note that sum of this AP is independent of the value of $r$. Hence we can adjust the value of $c$ and $d$ by finding the product of the roots taking $2$ at a time * $a$ and product of all roots*d respectively. Therefore thre always exists coefficients $c$ and  $d$ given $a, b$ such that all roots are  distinct and real.


Jenkins Performance Plugin for Jmeter

Question: I am currently using Performance plugin v 1.13 on Jenkins 1.583 for integrating and reporting Jmeter results. The plugin overall works fine except for the error rate which is constantly reported as 100% although the actual JTL log contains no error records. I know this is an existing bug with this plugin but I am hoping if someone has found a workaround for this issue. I downgraded to v 1.11 but without luck. Any help is appreciated.
Answer: Yes indeed, this is defect JENKINS-28426 and only obvious workaround seem to be switch to CSV.
However, I'd suggest you to take a look at the entire bug list of this plugin. This particular issue was logged in May and didn't attract too much attention so far. Similar case with other defects.
I need a confidence in tools which give me confidence in software I'm working on. I have no confidence in Jenkins Performance Plugin. Think what you use this plugin for and look for the alternatives.
Answer: I was able to fix the problem by switching report format to xml in jmeter properties file, like so:
jmeter.save.saveservice.output_format=xml

Jenkins Performance Plugin for Jmeter


how to selecting image from list view and display it in image view?

Question: I am  creating a application which contains a listView on lefthand side that display different images now i want to show that particular image in the center of the screen when user clicks on any image in listView.
Comment: what have u tried so far?
Answer: You can add a custom adapter for your listview and add an onitemselectedlistener where inside it you can get the image you put in the view, and set the imageview.
Answer: You should keep the list of path of images and when user taps you will get the postion from OnItemClickListener. Using the position you can load the image from path.
The link has good content on creating custom adapters , You should use that then just map your path and positons. try that and post when you are stuck


What does Include() do in LINQ?

Question: I tried to do a lot of research but I'm more of a db guy - so even the explanation in the MSDN doesn't make any sense to me. Can anyone please explain, and provide some examples on what Include() statement does in the term of SQL query?
Answer: Let's say for instance you want to get a list of all your customers:
var customers = context.Customers.ToList();

And let's assume that each Customer object has a reference to its set of Orders, and that each Order has references to LineItems which may also reference a Product.
As you can see, selecting a top-level object with many related entities could result in a query that needs to pull in data from many sources.  As a performance measure, Include() allows you to indicate which related entities should be read from the database as part of the same query.
Using the same example, this might bring in all of the related order headers, but none of the other records:
var customersWithOrderDetail = context.Customers.Include("Orders").ToList();

As a final point since you asked for SQL, the first statement without Include() could generate a simple statement:
SELECT * FROM Customers;

The final statement which calls Include("Orders") may look like this:
SELECT *
FROM Customers JOIN Orders ON Customers.Id = Orders.CustomerId;

Comment: `Join(...)` syntax allows you to specify the logic used for the `join`.  `Include(...)` does not, and will build the `join` statement based on the configured relationship between entities.
Comment: Thank you. Using your example, can I say if I want to also include the `LineItems` and `Products`, the LINQ query should look like this: `var customersWithOrderDetail = context.Customers.Include("Orders").Include("LineItems").Include("Products").ToList();` ?
Comment: Yes, you can chain multiple calls to `Include()` to capture objects along difference "paths". If you want objects in the same path you only have to make one call that specifies the entire path. Since `LineItems` and `Products` don't share any path components you do need separate calls.
Comment: @Tk1993 it is `Left Join` when the foreignkey is nullable and `Inner Join` when it is not.
Comment: @Yuck which type of join it is?
Comment: whats the difference of this from 'join'
Comment: Is it mandatory to use Include? I am pretty sure i worked on solutions where I could get related objects without using it.
Comment: @Jepzen It depends on whether you're using lazy-loaded entities or not.
Comment: @Yuck, I believe this works when you are using lazy-loading, in case of eager loading, you don't need to use "include" statement, but this definitely will result in performance issues.
Please correct me on this.
Comment: To complement the answer and understand how does `Include()` know what keys to use, see the [Relationships](https://learn.microsoft.com/en-us/ef/core/modeling/relationships) documentation article, which specify two ways (conventions and FluentApi), and the [Data Annotations](https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/data-annotations#relationship-attributes-inverseproperty-and-foreignkey) article which specify a third way (using attributes).
Answer: I just wanted to add that "Include" is part of eager loading. It is described in Entity Framework 6 tutorial by Microsoft. Here is the link:
https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/reading-related-data-with-the-entity-framework-in-an-asp-net-mvc-application

Excerpt from the linked page:

Here are several ways that the Entity Framework can load related data into the navigation properties of an entity:
Lazy loading. When the entity is first read, related data isn't retrieved. However, the first time you attempt to access a navigation property, the data required for that navigation property is automatically retrieved. This results in multiple queries sent to the database — one for the entity itself and one each time that related data for the entity must be retrieved. The DbContext class enables lazy loading by default.
Eager loading. When the entity is read, related data is retrieved along with it. This typically results in a single join query that retrieves all of the data that's needed. You specify eager loading by using the Include method.
Explicit loading. This is similar to lazy loading, except that you explicitly retrieve the related data in code; it doesn't happen automatically when you access a navigation property. You load related data manually by getting the object state manager entry for an entity and calling the Collection.Load method for collections or the Reference.Load method for properties that hold a single entity. (In the following example, if you wanted to load the Administrator navigation property, you'd replace Collection(x => x.Courses) with Reference(x => x.Administrator).) Typically you'd use explicit loading only when you've turned lazy loading off.
Because they don't immediately retrieve the property values, lazy loading and explicit loading are also both known as deferred loading.
Answer: Think of it as enforcing Eager-Loading in a scenario where your sub-items would otherwise be lazy-loading.
The Query EF is sending to the database will yield a larger result at first, but on access no follow-up queries will be made when accessing the included items.
On the other hand, without it, EF would execute separte queries later, when you first access the sub-items.
Answer: include() method just to include the related entities.
but what happened on sql is based on the relationship between those entities which you are going to include what the data you going to fetch.
your LINQ query decides what type of joins have to use, there could be left outer joins there could be inner join there could be right joins etc...
@Corey Adler
Answer: Remember that you should use .Include() and .ThenInclude() only when returning the object (NOT THE QUERYABLE) with the "other table property".
As a result, it should only be used when returning APIs' objects, not in your intra-application.

What does Include() do in LINQ?


GRUB menu customization (change menu appearance)

Question: In my GRUB (GRUB 0.97) menu the selector became invisible (changed of inversion color). I would like get my selector bar back and by the way customize a bit grub menu to be more fancy with colors. Where i could change the default b&w schema? Do i need add directives in <code>/etc/grub.conf</code> ? or rather use some tool to change grub menu appearance?  In fedora repo i found grub-customizer-3.0.4 but i use centos and it seems the only way is to change grub files manually.
Answer: You should be able to just install using yum install grub-customizer.
If not try this Grub customizer for CentOS


Which type of paint for a surface with slight imperfections?

Question:
Hi guys I'm planning on repainting my door its plan but it's slightly textured from previous paint I was wondering whether I would need to use a primer on this door and which type of paint ?
As I've been searching around the consensus is not to use oil based paint any suggestions much welcomed
Answer: I wouldn't use oil-based paint. More expensive and harder to clean up. I'd use acrylic latex (water-based) paint.  No primer is required. Make sure the door is clean, (I.e.: no oil, grease, crayon marks, etc.). Quick drying and easy clean up.
Comment: Oh, and make sure the existing paint is not oil-based. Test it...there are lots of test kits that can do the trick.
Comment: Oh, the ""sheen" will have as much to do with noticing imperfections as anything. The higher the gloss finish, the more likely you'll see the imperfections. "Color" has nothing to do with hiding the imperfections...


Proof of uncountability of irrationals without using completeness of real numbers

Question: I am studying countable sets and every proof of uncountability of real numbers uses completeness property? I know completeness is required to define irrtionals and real numbers, but if one considers irrational numbers or assigning a Dedekind cut of rational numbers to each irrational number or calling irrational numbers as gaps between rational numbers, can it be proved that those gaps are uncountable? Using nested interval theorem or decimal representation and other such proofs use completeness inherently. It is my understanding that completeness talks about ordering of elements, and countability is about cardinality of set
Comment: The definition of the reals requires completeness so proving *ANYTHING* about the reals (specifically) will implicitely involve completeness.
Comment: Well, define the irrational numbers as the members of $\Bbb{N^N}$, and then it's easy.
Comment: Use Lebesgue measure.
Comment: When you write about completeness, what you have in mind is the fact that the reals form a complete ordered field?
Comment: There are incomplete extensions of the rational numbers (e.g., the field of real algebraic numbers) that are still countable.
Comment: @GNU Supporter I am sorry, but wont lebesgue measure use completeness?
Comment: So how does one go about proving that all those gaps are uncountable without completeness?
Comment: Are you asking whether the set of Dedekind cuts of $\mathbb{Q}$ is an uncountable set? Or, perhaps more precisely, whether the set of Dedekind cuts $(A,B)$ of $\mathbb{Q}$ such that $A$ has no maximum and $B$ has no minimum is an uncountable set?
Comment: Second one. If first one is uncountable, second one too will be
Answer: Say a Dedekind cut $(A, B)$ is between two irrationals $p<q$ if there are elements of both $A$ and $B$ in the interval $(p, q)$. We now argue as follows:

Suppose $(A_n, B_n)$ (for $n\in\mathbb{N}$) is a sequence of Dedekind cuts; we want to build a Dedekind cut not in this sequence.
Fix an enumeration $(s_i)_{i\in\mathbb{N}}$ of $\mathbb{Q}$.
We define a pair of sequences of rationals $p_i, q_i$ as follows:

$p_0$ is any element of $A_0$, $q_0$ is any element of $B_0$.
Having defined $p_i, q_i$, we now define $p_{i+1}, q_{i+1}$ as follows:

If $(A_{i+1}, B_{i+1})$ is not between $p_i$ and $q_i$, then we pick any rationals $p_{i+1}, q_{i+1}$ with $p_i<p_{i+1}<q_{i+1}<q_i$ with $s_i\not\in (p_{i+1}, q_{i+1})$.
If $(A_{i+1}, B_{i+1})$ is between $p_i$ and $q_i$, we let $q_{i+1}$ be some element of $A_{i+1}$ in $(p_i, q_i)$, and let $p_{i+1}$ be some rational such that $s_i\not\in (p_{i+1}, q_{i+1})$.

It's an easy exercise to show that this construction does in fact give rationals $p_0<p_1<p_2<...<q_2<q_1<q_0$ and that there is no rational contained in every $(p_i, q_i)$ (think about how we handled $s_i$). Letting $$A=\{s\in\mathbb{Q}: s<p_i\mbox{ for some $i$}\},\quad B=\{s\in\mathbb{Q}: s>q_i\mbox{ for some $i$}\}$$ we get that $(A, B)$ is a Dedekind cut not equal to any $(A_n, B_n)$.
Note that what's really going on here is that completeness is essentially built into Dedekind cuts automatically.

A point which may look fishy in the above is the use of arbitrary choices. However, this is really just a device to make the proof more readable, and is easily avoided: we can always just pick an appropriate rational with minimal index according to the enumeration $(s_i)_{i\in\mathbb{N}}$, and such an enumeration can be given explicitly.
Comment: @SK19 My point was about set theory, not style: by "arbitrary choice" I meant "application of the axiom of choice." The point is that in general, any "construction" which has a step like "pick some real number such that ..." is not guaranteed to go through without the axiom of choice; however, since here we're picking *rational* numbers, we can fix our favorite (totally explicit) well-ordering of the rationals and use that to avoid invoking the axiom of choice.
Comment: so any definition of irrationals, as gaps or dedekind cuts, or any other form uses rationals too, which means completeness is inherent in the way we define irrationals. So though we are talking about cardinality, the way we defined the set involves completeness. and if we were to call irrationals as power set of naturals, then we could prove uncountability using power set theorem. do I have it right?
Comment: Well, if you use the minimal index instead of arbitrary choice, aren't you just moving the arbitrary choice to the enumeration $(s_i)$ instead?
Answer: It is impossible to prove that the set of all irrational numbers we can think of (solutions of certain equations, values of special functions at rational points, etc.) is uncountable. There is no way around using  some grand view assumption about ${\mathbb R}$. I shall work with decimal expansions, taking it for granted that each infinite decimal expansion gives a unique real number.
The basic fact is that given any set $A$ there is no surjective map $f:\>A\to{\cal P}(A)$. In particular there is no surjective map $f:\>{\mathbb N}\to{\cal P}({\mathbb N})$. As a consequence the set $B$ of binary sequences $$b:\>{\mathbb N}\to\{0,1\},\qquad k\mapsto b_k$$
is uncountable. Given a $b=(b_1,b_2,b_3,\ldots)\in B$ consider the infinite decimal
$$\alpha(b):=0.\,b_1\,2\,b_2\,2\,2\,b_3\,2\,2\,2\, b_4\,2\,2\,2\,2\,b_5\,2\,2\,2\,2\,2\,\ldots\ .$$
Since this decimal is not periodic $\alpha(b)$ is irrational; furthermore $b\ne b'$ implies $\alpha(b)\ne\alpha(b')$. It follows that the irrational numbers form an uncountable set.
Comment: This uses completeness when you assign the real number $\alpha(b)$.
Comment: @fleablood: I know; but we cannot prove something about "all numbers" without some input. My input was that any real number has a binary expansion.
Answer: Here's a direct proof that Dedekind cuts of $\mathbb{Q}$ form an uncountable set. All that's happening in this proof is that I'm back engineering the proof that $\mathbb{R}$ is uncountable based on decimal representation, so it's kind of boring and I'll leave some details out. But at least I won't use $\mathbb{R}$ itself, I'll just use an abstraction of "decimal representation".
Just to review, define a Dedekind cut of $\mathbb{Q}$ to be an ordered pair $(A,B)$ of nonempty subsets of $\mathbb{Q}$ such that $B = \mathbb{Q}-A$, and for every $a \in A$ and $b \in B$ we have $a<b$. Define a Dedekind cut $(A,B)$ to be rational if $A$ has a maximum or $B$ has a minimum, otherwise the Dedekind cut $(A,B)$ is irrational. Define an equivalence relation on Dedekind cuts: if $(A,B)$ is irrational it's not equivalent to anything else; if $(A,B)$ is rational then its equivalent to exactly one other, obtained by moving a maximum element of $A$ over to $B$ or a minimum element of $B$ over to $A$.
Consider an infinite sequence of non-negative integers
$$(n_i) = (n_0, n_1, n_2, n_3, ...)
$$
such that for each $i \ge 1$ we have $n_i \in \{0,1,2,3,4,5,6,7,8,9\}$. For each integer $K \ge 0$ we define the $K$th lower rational approximation of $(n_i)$ to be the rational number
$$r_K(n_i) = \sum_{i=0}^K n_i 10^{-i}
$$
and we define the $K$th upper rational approximation of $(n_i)$ to be
$$s_K(n_i) = r_K(n_i) + 10^{-K}
$$
Consider also a Dedekind cut $(A,B)$. We define $(n_i)$ to be a decimal expansion of $(A,B)$ if for all $K$ we have $r_K(n_i) \in A$ and $s_K(n_i) \in B$. One can prove a bunch of things about decimal expansions of Dedekind cuts. For example,

Every Dedekind cut has a unique decimal expansion (constructed by induction), and the decimal expansion is eventually periodic if and only if the Dedekind cut is rational.
For any infinite sequence $(n_i)$ as above, either $(n_i)$ is the decimal expansion of a unique Dedekind cut and that cut is irrational, or $(n_i)$ is the decimal expansion of exactly two Dedekind cuts and those two cuts for an equivalent pair of rational Dedekind cuts. Roughly speaking one defines the required Dedekind cut $(A,B)$ by letting $A$ be the set of all rational numbers $r$ such that there exists $K$ satisfying $r \le r_K(n_i)$.

As a consequence of the above two statements, it follows that the set of Dedekind cuts is countable if and only if the set of sequences $(n_i)$ is countable. But now the usual diagonalization argument kicks in, to prove that the set of sequences $(n_i)$ is uncountable.
Answer: We have the set of rational numbers $\mathbb Q$ and it has 'gaps'. It can be analyzed as a countably infinite densely ordered set.
Now we can always add in some of those 'missing gaps'. Let $G$ be a countably infinite set of 'gap fixes' for $\mathbb Q$. Then $T = \mathbb Q \cup G$ is another countably infinite densely ordered set. This will never get rid of all the 'gaps' since we have the following (see Back-and-forth method):
Any two countably infinite densely (linear) ordered sets without endpoints are order isomorphic.
Interestingly, fixing a countable number of gaps doesn't make any 'real progress' at all.
So if you believe that the linear ordered set $\mathbb R$ has no 'gaps', then the irrationals must be uncountable.
By the time the OP can make precise mathematical arguments concerning the real numbers and 'gaps', he will no doubt be just as comfortable speaking about the real numbers as connected and/or complete.
Answer: The standard argument I know to prove the uncountability of the real numbers shows that $[0,1]$ is already uncountable. This is proved by contradiction, i.e. assuming $[0,1]$ would be countable then the numbers could be enumerated in a sequence and then a number $x$ is constructed that is within $[0,1]$ but not in the sequence, leading to a contradiction. I guess the completeness used here is that $x$ is in fact a real number.
Let's see if we can transfer this proof to the irrationals. Let $a_n$ be an enumeration of $[0,1]\setminus\mathbb{Q}$. Construct $x$ like that: the $n$-th digit $b_n$ of $x$ is defined by
$$b_n=\left\{\begin{array}{rl}
1&\text{if $n=k!$ for some $k\in\mathbb{N}$ and $n$-th digit of $a_n$ is not $1$}\\
2&\text{if $n=k!$ for some $k\in\mathbb{N}$ and $n$-th digit of $a_n$ is $1$}\\
3&\text{if $n\neq k!$ for all $k\in\mathbb{N}$ and $n$-th digit of $a_n$ is $4$}\\
4&\text{if $n\neq k!$ for all $k\in\mathbb{N}$ and $n$-th digit of $a_n$ is not $4$}
\end{array}\right.$$
(This construction idea is borrowed from Liouville.) To guarantee the existence of $x$, we need the axiom of choice. For one reason or another, the completeness of $\mathbb{R}$ is integrated in the end, because else I couldn't ensure that the constructed $x$ is actually a number. $x$ is definitely not in $(a_n)$ by construction, we can prove this with induction. And finally $x$ cannot be rational, because the distance between a $1$ or $2$ to the next $1$ or $2$ increases evermore (we could have used any superlinear function for that, but $k!$ came from the inspirational source).
Comment: As I said very clearly, whatever you claim you are using is no less than the standard proof, and that is why your post is wrong. And "1.000.." and "0.999.." are **distinct representations** of the **same real**, so you cannot claim that reals are simply 'sequences that can formally be written like that'. You will have a hard time proving the basic properties for reals if you construct it via a syntactic route like that, and arguably any such construction is **implicitly based on completeness**. If completeness did not hold for reals, it would be impossible to construct them that way!
Comment: This is wrong. You cannot claim that you can construct your $x$ without essentially the same justification for the typical proof. In both cases, you are defining a sequence of decimal digits and claiming that it is the representation of some real number. So it makes no sense to claim that one requires the completeness of reals but the other does not.
Comment: @user21820 Hm, interesting... But aren't I'm rather using the fact that rational numbers can be defined as having a period when written as $\sum_{n\in\mathbb{N}}b^{k-n}a_n$ (with $b,k$ natural, $b > 1$ and for all $n$ holds $0\leq a_n<b$) and irrational numbers being the rest of "numbers", where "number" is any sequence that can be formally written like that? From this point of view I don't use completeness of $\mathbb{R}$ but rather work with the embedding of $\mathbb{Q}$ in the function space $\mathbb{N}^{\{-1\}}\times\{0,...,b-1\}^\mathbb{N}$. Wouldn't you agree?
Comment: @user21820 I've tried to tie in your objection into the answer. On the upside, even the accepted answer admits some way of using completeness. Anyway, I'll let my answer stay here because I think a direct proof of the uncountability of $\mathbb{R}\setminus\mathbb{Q}$ has its own merit.
Comment: Thank you very much for editing your answer. Indeed, in my opinion every diagonal argument must use completeness at some intrinsic level, because after all the reals are based on that. Please let your answer stay!


Bitcoin users limit

Question: How bitcoin handle users limit if only 4000 transactions in every 10 minutes ? Let's say I transfer 2 bitcoin to Anuj account then how much time maximum it will take to reflect in Anuj's account and what will be the process running in background on bitcoin during this record.
Answer:
Let's say I transfer 2 bitcoin to Anuj account

The Bitcoin network doesn't have accounts as such. You typically transfer money to a Bitcoin "address" given to you by the intended recipient.

how much time maximum it will take to reflect in Anuj's account

It depends on how busy the Bitcoin network is and on the transaction fee chosen by the sender. I don't think there is an imposed maximum but if the sender selects a very low fee and the network is busy, it can take many days.

what will be the process running in background on bitcoin during this record.

No process needs to be running in the background.
You can receive money when your computer is turned off. Receiving money typically doesn't require any participation from the recipient after the sender knows the receiving address.
Obviously, a Bitcoin wallet can only find out it has previously received money by catching up when next online.
Answer:
Time interval between two blocks can be less than 10 minutes or more than 10 minutes

On an average it stays close to 10 minutes with the help of difficulty adjustment

One block may have only one transaction or thousands of transactions

Most of the blocks after segwit have size greater than 1 MB

Your transaction has some inputs and outputs which mainly decides the size of a transaction

You as a user decide the fee rate for the transaction in sat/vbyte. So you are bidding for the block space in satoshis to get your transaction included in the block.

Miners prioritize transactions based on fee rate and higher fee rate transactions get confirmed quickly

Visual representation of how mempool looks for a full node : https://mempool.observer

Mempool is a pool in which transactions remain until included in a block by some miner, mempool for a full node can be different from another full node

Bitcoin users limit


Combinatorics - calculating probability of choosing n people from m groups of k people

Question: I am trying to calculate and understand the following question:
I have 10 groups of 10 people each and am choosing 10 people at random.  What is the probability that all 10 people I have chosen are from one group? From 2 groups? Etc.
Comment: Let's try a simpler example: $3$ groups of $3$ people and you choose $3$ of the $3^2=9$ people.  There are ${9 \choose 3}=84$ equally likely ways of choosing the $3$ in total.  Can you see why there are $3$ ways of choosing them from a single group, $54$ from two groups and $27$ ways of choosing them from three groups?
Answer: Consider $m=10$ groups of size $n=10$ each.  Obtain a sample of size $N$ by withdrawing one element at a time.  For the possible counts $0, 1, 2, \ldots, m,$ let $p_N(i)$ be the chance that exactly $i$ groups are represented in this sample.
Notice, now, that when $i$ groups are represented in a sample of size $N,$ there remain $nm-N$ unsampled elements, of which $in-N$ are in the groups appearing in the sample.  The chance of selecting one of these at the next step is therefore $(in-N)/(nm-N)$, while the chance of selecting a different one--and thereby increasing $i$ to $i+1$--is $1 - (in-N)/(nm-N).$ Consequently, the $p_N(i)$ enjoy the recursive relationship
$$p_{N+1}(i) = p_N(i) \left(\frac{ni-N}{nm-N}\right) + p_N(i-1)\left(1 - \frac{n(i-1)-N}{nm-N}\right).$$
At the beginning, with a sample size of $1,$ clearly $p_1(1)=1$ and all the other $p_1(i)=0.$  Updating this vector of length $m+1$ $N-1$ times requires only $(m+1)(N-1)$ of the foregoing calculations.  That's efficient.  (Well before $m$ and $n$ become large enough to make this onerous, asymptotic approximations will become highly accurate.)
Here is R code to carry out this simple calculation:
n <- 10 # Group size
m <- 10 # Number of groups
N <- 10 # Sample size

P <- c(0, 1, rep.int(0, m-1))
i <- seq_len(m)
for (k in seq_len(N)[-1] - 1)
  P <- c(0, (P[i + 1] * (n * i - k) + P[i] * n * (m - i + 1)) / (n * m - k))

As a test, let's compare it to a direct, brute-force simulation of a half million samples.
set.seed(17)
pop <- rep.int(seq_len(m), n)                             # The elements to sample
x <- replicate(5e5, sum(tabulate(sample(pop, N), m) > 0)) # Take the samples
simulation <- c(0, tabulate(x, m) / length(x))            # Compute frequencies
names(simulation) <- c(0, seq_len(m))                     # Adjoin column headings
rbind(simulation, P)                                      # Compare to the calculation

           0        1       2        3       4      5     6     7     8      9       10
simulation 0 0.00e+00 0.0e+00 0.000226 0.00865 0.0928 0.313 0.389 0.172 0.0234 0.000572
P          0 5.78e-13 4.8e-07 0.000204 0.00884 0.0922 0.314 0.389 0.172 0.0234 0.000578

The headers are the group counts.  You can see the agreement is good.
Answer: This is really a hypergeometric problem. If you have 10 groups with 10 people in each, and you draw randomly without replacement 10 people, let $X_i$ be the number of people drawn from group $i$. Then the probability distribution is given by
$$   \DeclareMathOperator{\P}{\mathbb{P}}
\P\left\{ X_i=x_i, i=1,2,\dotsc,10 \right\} =
\frac{\prod_i^{10} \binom{10}{x_i}}{\binom{100}{10}}
$$
but your interest is in the random variable "number of groups"
$$ G=\sum_i \{X_i > 0 \} $$ where the curly braces is the< indicator function. For $g$ small or close to 10, this is a small sum of hypergeometric probabilities, while for <intermediate values it becomes complicated ...
The comment by @Henry gives a numerical exmple with smaller numbers. Let us do it with your group sizes, with the help< of R. For the intermediate values of $g$ it is most practical to resort to simulation.
library(extraDistr)
### A helper function to save typing:
myhyper <- function(x) {
    p <- length(x)
    n <- sum(x)
    extraDistr::dmvhyper(x, rep(n, p), n)
}

### Probability of exactly one group, G=1:
 10*myhyper(c(10, rep(0, 9)))
[1] 5.776904e-13
# We multiply by 10 because there are 10 ways of
# choosing that group
### Probability of G=2

prob2 <- 0.0
for (i in seq(from=1,  to=9,  by=1)) prob2 <- prob2  +
               myhyper(c(i, 10-i, rep(0, 8)))

( prob2 <- choose(10, 2) * prob2 )
 4.802878e-07

### Then we resort to simulation:

set.seed(7*11*13) # My public seed

prob2_by_sim <- rmvhyper(1E7, rep(10, 10), 10)

### There is one sample in each row. Let us calculate ### the number of zeros, by row:

zeros <- apply(prob2_by_sim, 1,
        FUN = function(row) sum(row==0) )

tzeros <- table(zeros)

 tzeros/1E7
zeros
        0         1         2         3         4         5         6         7
0.0005821 0.0233285 0.1723967 0.3886847 0.3139600 0.0920672 0.0087765 0.0002039
        8
0.0000004

Note the excellent correspondence of the simulation for $G=2$ (that is, 8 zeros) with the theoretical calculation above.
Note the similarity of this problem with the coupon collector problem, with number of coupons corresponding to number of groups. But this is a hypergeometric version of the coupon collector problem. There is a paper dedicated to this: The Hypergeometric Coupon Collection Problem and its Dual by Sheldon M. Ross.
Comment: I find it confusing that the software's output is labeled by $10-G$ rather than $G.$


If measurement collapses the information and we lose information, what's the point of using a qubit?

Question: It's a basic question, I'm new to the domain and still studying qubit.
To my knowledge, One of the most important advantages of a qubit over a classical bit is that it can store more information than just a 1 or 0 but as we measure a 2-state quantum system (qubit) it instantly collapses to one of the states which is why we call measuring a "destructive action", so what is the use of storing more information when we can practically not retrieve or read it?
Comment: Analogy: why would you use a boat if your destination is on land?
Comment: @BeetranDahiya in this analogy, the sea is the full set of possible quantum states, while the land are the classical states you might prepare as input, and be interested in processing via measurements of the output. Even though what you're interested in is getting from land to land, ie process purely classical information, you might do so more efficiently by "passing through the sea", ie exploring the richer dynamics offered by QM. You might not be able to access all the information in a qubit during the evolution, but that still affects what you will measure at the hand (also, great analogy!)
Comment: But, If it's a cargo boat, I would expect it to unload the stuff I loaded on it, right? If I have to throw away stuff before I dock, what's the use?
Answer: Your question gets to the heart of why developing good quantum computing algorithms is tricky.
If we have a set of qubits and naively encode every possible input, evaluate some function, and then measure the output with them, our final state is going to collapse to the value of that function on one of those inputs. So now we only have a single evaluation of that function and worse, we don't even know which input gave of us that answer.
To make a useful QC algorithm, you have to be able to make the most of out of that single measurement. This is usually done by some sort of operation (like the Quantum Fourier Transform) after the function evaluation that uses the superposition of "wrong" inputs to cancel each other out while amplifying the "correct" input such that the single measurement at the end is very likely to give the desired result in just a few attempts.
Answer: Broadly speaking, we can set up our computation so that the measurement outcome tells us something meaningful about the problem we are trying to solve. A nice example of this is the Deutsch–Jozsa algorithm. While we can prepare the state
$$|\psi\rangle=\frac{1}{\sqrt{2^n}}\sum_{\mathbf{x}\in\{0,1\}^n}|\mathbf{x}\rangle$$
and feed it to $f$ to calculate all possible values of $f(x)$ in parallel, when we do a measurement we will get only one outcome (i.e $f$ evaluated at one specific input). But if we act smarter, we can still solve the problem using only one evaluation of $f$ (as you can see on the Wikipedia page).
As Chris E. said in his answer, this is exactly what makes designing quantum algorithms a hard task. Though, that doesn't render quantum computers useless.


synthesis of Red Lead, Pb3O4

Question: I have tried heating $\ce{PbCO3}$ at $\pu{400 ^\circ C}$ temperature to form $\ce{Pb3O4}$. After sometime of heating, only a layer of $\ce{Pb3O4}$ is made and the reaction does not complete. The substance stays white even after hours of heating.
Comment: 1. More heat. 2. If a crust forms, it prevents oxygen getting in. Agitate and crush.
Comment: Crust means partial oxidation. Yes, more heat and more reaction time.
Answer: According to your post, you have tried heating $\ce{PbCO3}$ at temperature $\pu{400 ^\circ C}$ to form Red Lead, $\ce{Pb3O4}$. You haven't give how long you have heat, but mentioned the substance $(\ce{PbCO3})$ stays white even after hours of heating. I think your starting material is wrong in this instance (it should be beneficial if you have given us what literature procedure you have been following).
According to studies done in Ref.1, your starting material should be Basic Lead White $\ce{\left(2PbCO3·Pb(OH)2\right)}$ instead of $\ce{PbCO3}$ itself. Accordingly,

The thermal decomposition of basic lead(II) carbonate $\ce{2PbCO3·Pb(OH)2}$ in static air under atmospheric conditions has been studied for the first time using a combination of thermoanalytical, X-ray diffraction and Raman spectroscopic techniques. New intermediate compounds of the type $\ce{4PbCO3·3PbO}$ and $\ce{PbCO3}$ have been observed in addition to previously reported ones of the type $\ce{2PbCO3·PbO}$, $\ce{PbCO3·PbO}$ and $\ce{PbCO3·2PbO}$. Post-decomposition studies have identified the presence of the tetragonal-to-orthorhombic phase transition in $\ce{PbO}$. Results are also presented for the decomposition processes in nitrogen and oxygen atmospheres. Oxidative decomposition studies have shown that $\ce{Pb3O4}$ forms in oxygen and in flowing air.

According to the work described in here and here, it is clear that the starting material for this conversion is better to be basic lead(II) carbonate, $\ce{2PbCO3·Pb(OH)2}$ and temperature should be around $\pu{475 ^\circ C}$ (the heating should be for longer time period).

References:

Dan A. Ciomartan, Robin J. H. Clark, Lachlan J. McDonald, and Marianne Odlyha, "Studies on the thermal decomposition of basic lead(II) carbonate by Fourier-transform Raman spectroscopy, X-ray diffraction and thermal analysis,"   J. Chem. Soc., Dalton Trans. 1996, 3639-3645 (DOI: https://doi.org/10.1039/DT9960003639).
Comment: You should have included these observations in your question at first place. that is important to reader to give you their thoughts. It is still not too late to do so.
Comment: the substance I have used is PbCO3 because when I overheat it, it turns to a dark substance (PbO2). and I have tested all of the reaction period such as 30mins ,1 hour . after a layer of Pb3O4 is made it turns to yellow when I continue heating

synthesis of Red Lead, Pb3O4


to use C# 4.0: do we need VS 2010 or .NET Framework 4.0

Question: VS 2010 comes with .NET Framework 4.0, let's say I want to use a new ability that is in C# 4.0, so I think if I just go and download .NET Framework 4.0 I should still be able to use that ability with VS 2008? right? it is a little confusing for me .
thanks
Answer: Here are the release date of every version of C# and the .NET Framework, and with which version of Visual Studio they were released.
You can see that .NET Framework 4.0 has been released with Visual Studio 2010. So you won't be able to target .NET 4.0 with VS 2008 since it does not know about it.
Answer: You will need to use Visual Studio 2010 and install .NET 4 if you want to use all the new C# 4.0 features. Some features do work - see this question for more information.
Visual Studio 2008 doesn't know about targeting the .NET 4 framework so you can't use that.
MSDN Forum reference
Answer: No, Microsoft. dont allow you to use its  .Net 4.0 in VS2008 as it is for. Net 3.5. You need to have VS2010 to use. Net 4.0.
 Because there are certain tools which are in VS2010 to work with that framework and VS2008 dont have them.


Buffer and cache Difference?

Question: Can anybody detail - What is the difference between Buffer and Cache in system memory?
Answer: A buffer is just a container to hold data for a short period of time when more comes in at any given time than a consumer can use / process. It's a first-in, first-out situation - the data comes in, might be buffered, and goes out in the same order it came in, after a while.
A cache is a storage for speeding up certain operations. Things get put in a cache, and should be retrieved from it multiple times, over and over again. There's no "flowing through the cache" kind of mechanism - data doesn't come in and go out in the same order - but it's just a holding container. The order might be anything, really - items are addressed via a key, they don't "flow through" but they are "put in" and stay there (until they're thrown out because of not being used, or because the system goes down).
Comment: but if cache is a temporary data holder, what is the difference between "cache" and "used"? These two parameters will be displayed if you use "free -m" or "dstat -m".
Answer: A buffer is a contemporary collection of location where a huge amount of data is managed or disassembled. This may be basic for interaction with a set of collection device that needs huge blocks of information, or when data must be given in a many way than that in which it is made, or rarely considerable when less blocks are not sufficient. The advantage is here even if the buffered data are stored to the buffer in one time and get from the buffer once.
A cache, on the other side, thinks that the data will be get from the cache more one time than they are written on them.
Its aim is to less the accesses to the underlying stock.
Buffer is a programmable cache managed by the operating system in the main storage and is used to have the most necessary data from disk, so that they don't have to be gotten again from the memory. This feature is available by the operating system. While cache is in real a hardware that the CPU uses to reduced the effective memory access time.
Answer: Add something from Wiki about the difference between Buffer and Cache.

A buffer is a temporary memory location that is traditionally used
  because CPU instructions cannot directly address data stored in
  peripheral devices. Thus, addressable memory is used as an
  intermediate stage. Additionally, such a buffer may be feasible when a
  large block of data is assembled or disassembled (as required by a
  storage device), or when data may be delivered in a different order
  than that in which it is produced. Also, a whole buffer of data is
  usually transferred sequentially (for example to hard disk), so
  buffering itself sometimes increases transfer performance or reduces
  the variation or jitter of the transfer's latency as opposed to
  caching where the intent is to reduce the latency. These benefits are
  present even if the buffered data are written to the buffer once and
  read from the buffer once.
A cache also increases transfer performance. A part of the increase
  similarly comes from the possibility that multiple small transfers
  will combine into one large block. But the main performance-gain
  occurs because there is a good chance that the same data will be read
  from cache multiple times, or that written data will soon be read. A
  cache's sole purpose is to reduce accesses to the underlying slower
  storage. Cache is also usually an abstraction layer that is designed
  to be invisible from the perspective of neighboring layers.
Answer: A buffer is just like a drum it can hold data and flush it out ... On the other hand Cache is used to make your operations faster.

Buffer and cache Difference?


Bootstrapping zero coupon rates

Question: How do we obtain discount rates to obtain zero coupon rates given only swap rates? what is the procedure? Also what exactly is curve calibration?
Answer: In general, see Definition 1.5.3 in Brigo and Mercurios fantastic book on interest rate modelling, a forward swap rate with payment dates $T_{\alpha+1},...,T_\beta$ is given by
\begin{align*}
S_{\alpha,\beta}(t) = \frac{P(t,T_\alpha)-P(t,T_\beta)}{\sum\limits_{i=\alpha+1}^\beta \tau(T_{i-1},T_i)\cdot P(t,T_i)},
\end{align*}
where $\tau$ meausres the difference between two time points with respect to any day time convention. $P(t,T)$ is the time $t$ price of a default-free zero-coupon bod with maturity $T$ paying a face value of \$1.
With this equation, given all discount factors (zero coupon bonds), you can build the entire swap curve. On the other hand, if you know all swap rates, you recover the zero-coupon bond curve.
I give you a simple example assuming the following. Let $t=0$ and assume that the swap pays semi-annually and thus $\tau(T_{i-1},T_i)=\frac{1}{2}$. Suppose furthermore that the swap begins immediately and thus $T_\alpha=t=0$ (note that $S_{0,\beta}(t)$ is known as spot swap rate).  I will furthermore use continuous compounding such that $P(t,T)=e^{-r_{t,T}\cdot\tau(t,T)}$ where $r$ is the corresponding zero rate (aka spot rate). Finally, assume that the swap matures in two years and pays in 6 months, 12 months, 18 months and 24 months. This means $\beta=4$ and $T_1=0.5$, $T_2=1$, $T_3=1.5$ and $T_4=2$. Then, the formula from above reduces to
\begin{align*}
S_{0.5} &= \frac{1-e^{-r_{0.5} \cdot 0.5}}{\frac{1}{2}e^{-r_{0.5} \cdot 0.5}}, \\
S_{1} &= \frac{1-e^{-r_{1} \cdot 1}}{\frac{1}{2}\left(e^{-r_{0.5} \cdot 0.5} + e^{-r_{1}\cdot 1} \right)}, \\
S_{1.5} &= \frac{1-e^{-r_{1.5} \cdot 1.5}}{\frac{1}{2}\left(e^{-r_{0.5} \cdot 0.5} + e^{-r_{1}\cdot 1}+ e^{-r_{1.5}\cdot 1.5} \right)},\\
S_{2} &= \frac{1-e^{-r_{2} \cdot 2}}{\frac{1}{2}\left(e^{-r_{0.5} \cdot 0.5} + e^{-r_{1}\cdot 1}+ e^{-r_{1.5}\cdot 1.5}+ e^{-r_{2}\cdot 2} \right)}.
\end{align*}
You can then obtain your zero rates step-by-step. Look at the first equation, you know $S_{0.5}$ from your swap curve. Solve this equation in order to obtain $r_{0.5}$. With this value go to the next equation, take $S_{1}$ from your swap curve, plug everything in and solve for $r_1$, etc. This way you obtain all your zero rates and thus, by definition, you bond prices (discount factors), as well. The same logic (and the formula at the top) applies if you change the method of compounding or if your swap pays annually or quarter-annually.
Edit
Just to clarify, the choice $P(t,T)=e^{-r_{t,T} \tau(t,T)}$ was a mere example and, of course, one may use discrete interest rates as well. Instead, one can simply set $P(t,T) = \left( 1+\frac{y^k_{t,T}}{k} \right)^{-k\tau(t,T)}$ for a $k$ times per year compounding method. However, there is an obvious relationship between discrete and continuous rates, so you can always convert one into the other. Both approaches are equivalent.
Furthermore, I'd be very careful to bluntly condemn all "physics calculus" as it has proven to be extremely successful to work with time continuous models for both pricing and hedging of derivatives contracts.
Answer: First, you will need to supplement swap rates (which start at 2 years maturity) with some other shorter term rates.  LIBOR cash rates are available for 1 day, 1 week, 1 month, 3, 6, and 12 months.
Note that LIBOR rates may be eliminated in the next year in favor of SOFR rates, but it is not clear if regulators will be able to implement this change in time for their deadline.  LIBOR is simply too important to just be "turned off" on date decreed by regulators - the market would shut down and cause economic chaos.  Regulators may push for SOFR adoption as quickly as possible, but so far there are a lot of implementation issues.
Second, swaps generally pay (and compound) semi-annual on the fixed side - not "continuous time" as implied in KeSchn's answer.  e to the power of x  should not appear in a bond formula; it doesn't matter how many physics PhDs  try to force physics calculus into finance.  Fixed legs of swaps compound semi-annually.  Its not just unnecessary physics equations, its wrong.
I write quant algorithms for a major bank, and co-wrote a book on bootstrapping algorithms.  Most big banks have eliminated their use of continuous time models (e to the x), because people like me made a lot of money arbitraging those erroneous models with correct models  :)
Answer: Also zero coupon swaps are kind of weird animals. You can price them in bbg. I don't think a lot trade. Obviously they're used in loads of models. You might imagine the differences verse treasury zero's as you're not paying a discount up front to receive par at maturity. They're accruing and pay out at the end as i remember? I don't believe that people have used anything but 3m eurodollars for the front end since the other libors basically broke in the crisis and so like 4 compounded 3m euro's won't equal 12m libor but heuristically would be closer to a 1yr swap rate (the crisis made term vs. revolvers really matter). What John says about continuous time is interesting. I know sell side traders do arb/rv stuff with euro's and even like odd points on the swap curve that get pushed out with a big unwind or something. Certainly the swap curves i've made have always used actual day count conventions etc. But i do find it interesting that generally the swap curve at least appears to be continuously differentiable and smooth. I don't think i've ever really seen a dealer close their curve or the forward matrix when it isn't. Which is why swaps are so nice for quants to do all the forwards and run interest rate simulations (MBS) and price complex derivatives all with smooth curves etc. I always found the smoothness phenomenon sort of strange though. Another new complication for swaps is ois discounting which is far more complicated. Because you can't just seamlessly go from forward to discount to coupon like you can with treasuries so its a bit strange.

Bootstrapping zero coupon rates


Any reward for repeating the Nightfall strike?

Question: I know that in the list of rewards it doesn't mention any kind of reward, such as an engram or ascendant materials, but do you really earn absolutely nothing at the end of the nightfall if you've already done it that week? Nothing randomly drops from the last boss of the strike?
Comment: None that I know of but I've never done it twice in the week so can't be sure.
Comment: I have done it twice in a week, there is no benefit the second time. This is what alts are for :)
Answer: No, you are rewarded only once.
Nightfall only gives rewards at the end of strike. Before you go first time, you can see that it has 'Unknows Rewards' in Director, but has none after completion.
You can still get random engram drops from enemies during the strike, but that's not nightfall specific.
Strike bosses do not drop gear in Destiny, but you can get race-specific item from them (e.g. Ether Seeds or House Banner from Sepiks Prime, etc).
So the answer is: yes, you gain absolutely nothing at the end of nightfall strike if you've already done it.
Comment: Nothing other than the satisfaction of a job well done. ;)
Comment: @pooter03, ouch, totally forgot about that one!
Answer: The quick answer is No you don't get anything for running the Nightfall Strike more than once before the reset. (It resets every Tuesday.)
One thing I'd like to add though, is that you can run the Nightfall Strike 3 times a week if you have 3 different characters to run it with. I have 1 of each class and I run it once with each of them each week before the reset.
Answer: No You will be rewarded for the first NightFall for that week after that you can still do the nightfall but you will not get rewards on till the weekly reset on tuesday 5AM PST


Customize page info when using crop package

Question: By default the package "crop" adds not only crop marks to the pages of the document, but also a line with some information about the page/document, i.e. filename, date, time, pagenumber. I would like to customize this information, e.g. add a note to myself. Can I accomplish that without changing the package? If so, how?
Comment: Newer versions of `geometry` provide cropmarks, you might want to check their customization possibilities, too (I haven't, so I don't know what is easy/possible there).
Comment: @mbork: I was not aware of that feature of geometry, thanks for pointing me to it!
Answer: You could redefine the internal macro \CROP@@info which prints that information. It's mentioned in the implementation section of the crop documentation.
More general and independent of the implementation: you could call the \cropdef command. Its first and optional argument is the macro which provides the page info (default: \CROP@@info). Four further arguments stand for macros for the corners. It's described in section 2.7 Defining your own marks in the crop manual.
Comment: Thanks Stefan, first I was a bit afraid by the many things that happen in \CROP@@info which I don't fully understand, but in the end I found the place where to add my note. In fact I just copied the whole definition from crop.sty and added a line in between.


Why the $\textbf{PCP}(\log n, 1)$ construction of completeness $c$ and soundness $s$ for an $NP$ language $L$ implies $s/c$ inapproximability for $L$?

Question: In the introductory chapter of $\textbf{PCP}$ in Arora and Barak, I read the proof that why a $\textbf{PCP}(\log n, 1)$ of completeness 1 and soundness 1/2 for an $NPC$ language $L$ will imply that there exists a $\rho$ for which $\rho$-approximation algorithm for MAX-3-SAT does not exist unless $P = NP$. But in the paper, https://www.cs.cmu.edu/~odonnell/papers/maxcut.pdf authors say that "We construct a PCP that reads two bits from the proof and accepts if and only if the two bits are unequal. The completeness and soundness are $c$ and $s$ respectively. This implies that MAX-CUT is $NP$-hard to approximate within any factor greater than $s/c$." What is the proof for this?
Answer: The authors give a reduction $x \mapsto f(x)$ from some NP-hard problem $X$ to MAX-CUT with the following properties:

If $x$ is a YES instance then $OPT(f(x)) \geq c$.
If $x$ is a NO instance then $OPT(f(x)) \leq s$.

Here $OPT(y)$ is the optimal value of the MAX-CUT instance $y$.
Suppose now that you had an algorithm for MAX-CUT with approximation ratio $\rho > s/c$, which means that for every instance $y$, $ALG(y) \geq \rho OPT(y)$, where $ALG(y)$ is the value of the instance produced by the algorithm. We can use this algorithm to solve $X$, since $x$ is a YES instance of $X$ iff $OPT(f(x))>s$ (I'll let you verify that).
This informally explains the statement in the paper. Any more formal explanation requires a definition of "NP-hard to approximate". One possibility is as follows. Let $Y$ be a maximization problem. We say that $Y$ is NP-hard to approximate within a factor of $\rho$ if for every problem $X \in \mathsf{NP}$ there exists a polytime computable reduction $f$ which on input $x$ produces a tuple $(y,v)$, where $y$ is an instance of $Y$ and $v$ is a number, with the following properties:

If $x$ is a YES instance of $X$ then $OPT(y) \geq v$.
If $x$ is a NO instance of $X$ then $OPT(y) < \rho v$.

This generalizes the usual definition of NP-hardness for optimization problems, which corresponds to the choice $\rho = 1$.
Under this definition, if $Y$ is NP-hard to approximate within a factor of $\rho$ and there is a polytime $\rho$-approximation algorithm for $Y$, then $\mathsf{P} = \mathsf{NP}$.
Finally, according to this definition, MAX-CUT is indeed NP-hard to approximate to within any factor strictly larger than $s/c$.
Comment: But algorithm by Goemans Williamson algorithm is a RANDOMIZED algorithm. I can see why Khot et el's result imply that there can not be better alpha-approximation algorithm than GW's constant but a randomized algorithm with better alpha can be possible?
Comment: I guess this paper answers my doubt http://hariharan-ramesh.com/papers/derand.pdf. The GW algorithm was derandomized in 1995.


Windows 2008 R2 - Kernel (System Process PID=4) is locking files and folders

Question: Windows 2008 R2 - Kernel (System Process PID=4) is locking files and folders for a long time.
For example when deleting a file, the file may remain locked for 1 minute or more and only after that be deleted.
On another occasions I encountered files or folders I could not delete. ProcMon showed that the System Process was holding a handle to those resources for a couple of minutes and then released them
None of the resources I mentioned were system resources, only files and folders installed be me and handled by my applications.
Answer: As Dani has already mentioned in the comment:
It's a bug in Windows 7 and likely in Windows Server 2008 (possibly 64bit versions only). It surfaces when you disable Application Experience service.
Re-enabling this service has fixed this problem for me.
A bit more info here as to why it's causing a problem.
List of other SO questions which seem to be related:

Visual Studio output file permissions?
Under which circumstances does the System process (PID 4) retain an open file handle?
Comment: +1 isn't enough for this answer - this has tormented me for a couple of years, manifesting as Visual Studio 2010 failing to build due to a locked file. And now it's fixed.
Comment: @Makis so the same thing happens on Windows 10 if you disable it?
Comment: In case of Windows 10 the Application Experience is found following these instructions http://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/where-can-i-find-application-experience-service-in/a499361b-b7c5-46d1-81c3-15a098860446?auth=1
Answer: Files accessed through a share will be locked by the system process (PID 4).
Try opening compmgmt.msc -> System Tools -> Shared Folders -> Open Files to see if the locked file is listed there
See also the sysinternals forum for a way to replicate this.
Not all applications lock files when they are opened, Excel however does...
Comment: Thanks! After trying for quite some time to find which Excel process had the file open, it turned out to be a shared user :-)
Comment: Thank you for this response @janv8000. I've tried Process Explorer from SysInternals (couldn't close the handle, file was being used by System process), Process Monitor on windows server 2008 (no dice) and a few other things to find what was locking it. I didn't know there was an Open Files list under Shared Folders. That even showed who was accessing it remotely so I could check to verify they were done. Thanks!
Comment: This is very interesting, I've literally spent 3 weeks trying to solve this in many ways (without having to restart the server) by any chance, have you found a way of automating this process? running it through cmd prompt/powershell, thanks a lot , your answer is more than enough
Comment: Is there a way to prevent this behavior?
Comment: Brilliant! Still applies to Windows 2016 Server. Indeed Process Monitor couldn't do it for me either. In case Google indexes these comments, this was essential to fix a Sage / PeachTree accounting 2021 upgrade process gone awry, allowing me to free up `SUA00021.LCK` and `PT.LCK` for deletion and Sage could launch.
Answer: In my case, it was fixed by a simple command in the command line:
net session /delete

I hope that helps.
Answer: Hope this helps others.
open windows run and lauch mmc.exe
File -> Add or Remove Snap-ins --> Shared Folders --> localcomputer
Select Open Files scroll down to the directory or file and right click to close.
You can also get the username that has the lock and go to sessions and right click --> close session.
In my case it was MacOS 10.13 holding file locks open...
https://support.apple.com/en-us/HT208209
Answer: I had this issue when trying to rename a folder.  I had to stop the server service while performing the rename.  Just restarting didn't help, as the system process re-locked the folder as soon as the server service restarted.
Answer: Make this and resolve the problem:
Go to Services and activate Application Experience.
Comment: Worth mentioning that this service does not exist as of Windows 10. It was present in the preview, but release versions use a different approach to managing compatibility. If you have problems with PID 4 (system kernel) locking files in windows 10, this is not the reason.
Answer: Tried all these...
Even copying the file, deleting the original, renaming copy to original name (all on server) would immediately tell me the user had it locked.
In the end -
used Unlocker to clear the file locks.
Copied the file OFF THE SERVER to a desktop.
Deleted the original file off the server.
Changed the filename of the copy on the desktop.
Renamed it back to the original name on the desktop.
Put the file back into the original location ON THE SERVER.
HTH, YMMV... :)
Answer: Had this issue just now whilst trying to replicate data to a new file server (both source & destination servers running Windows 2008 R2).
PID 4 was found locking the file (using procexp as above), but Application Experience has never been installed on either server & the file was not shown in the list of open files.
Fortunately we use scheduled shadow copies on this server (to enable users to self-serve most file recoveries).  I just used the Previous Versions option (available through Properties of the containing folder), selected the most recent copy of the file & copied it to somewhere else, then deleted and replaced the problem file.
You might need to delete the containing folder to delete the file - which could be a problem if lots of files in use obviously (this wasn't an issue for me given this was the only file in the folder).
For a one-off issue like I had (single locked file for the whole server drive), this worked without any disruption to the server or users.
Given you are talking about a server & that Shadow Copies are using VSS - you should be able to recover the locked file from your backups (presumably you have these) if you don't use Shadow Copies.  Otherwise there are some useful utils like ShadowSpawn (https://github.com/candera/shadowspawn) around that might help.


How to quickly fill holes

Question: I made some belts.There are many such holes on my model.But I don't need these holes now. I used the method of deleting faces and merging points to fill them one by one. Is there a faster method or plugin?Thank you.
Answer: I don't know if there's any quick trick, maybe select the circle, merge at center, then do the same on the opposite side, remove the inner edge that will remain between the vertices, at the end select all and press X > Dissolve Vertices to remove of the useless edges.
Comment: Thank you for your detailed process and answers! I am currently using this method as well, but there are many holes that require a lot of time to fill one by one, so I am asking if there are any techniques for batch filling. Thank you!

How to quickly fill holes