Check engine light went out by itself but codes still there. Will these go away and can I pass NYS Ins

Question: I had codes for p0352,53,54 and replaced coil, check engine light went out by itself but codes still there. Will these go away and can I pass NYS Inspection with codes still there?
Answer: It shouldn't affect your inspection results at all. The reason is, when they do the emissions on an OBDII vehicle, they are only checking for the readiness indicators and that the system has passed them. The vehicle passes them through what is called a drive cycle. If the system has failed one of the drive cycle elements (readiness indicators), the check engine light (CEL) would be on.
The only way it might not pass the test without the CEL on is if the drive cycle itself is not complete. There are (if I remember correctly) eight different elements of the drive cycle. If the drive cycle isn't complete, it doesn't mean you've failed emissions testing, it means the vehicle is not ready for emissions testing. If the ECU has completed the drive cycle and there's no active codes present, the vehicle will pass emissions.
If you disconnected the battery to replace the coils, your car may not be ready. It would need to go through the drive cycle in order to get there. This may or not be completed depending on how far it has been driven since the disconnect, how much gas is in the tank, and several other factors. An easy thing to do would be to take it to a auto parts store and have them check the drive cycle elements. If you do, ensure they DO NOT reset the ECU through their tester, because this will cause you to need to redo the drive cycle. If the battery was disconnected when changing out the coils, the codes would be erased in the process.
For your edification, an "element" (my terminology ... don't know if that's what they are actually called) is something like a test for the O2 sensors or EVAP system.


Target Priority for Turrets?

Question: Obviously, turrets prioritize minions unless a friendly champ takes damage from an enemy champ within the turret's range, and if there are no minions the turret will target the first enemy champ to come within range. My question is this - if there are multiple enemy champs within range as the last friendly minion dies, how does the turret prioritize the enemy champs? Is it random, or is there some factor that affects which enemy champ the turret will start attacking first?
Answer: The League of Legends site covers this in this article.  The priority of turrets is as follows (emphasis mine):

An enemy champion designated by a call for help from an allied champion.
An enemy minion designated by a call for help from an allied champion.
The closest enemy minion.
The closest enemy Champion.

Note: Any time a champion takes damage near a friendly turret, it will
  immediately try to attack the aggressor unless otherwise occupied with
  an enemy champion.

In regards to your question, the turret will target the closest enemy champion
Comment: I suppose I'll have to watch more closely the next time I see this situation. The questiong stemmed from seeing, on several occasions, a turret ignore a melee champ attacking the base of the turret to focus on a ranged champ instead. According to what you've said, the ranged champ must have been tagged with a call for help - which makes sense, seeing as how that'd most likely be the carry, who are routinely tagged by teammates. Thanks for shedding some light on that for me.
Comment: @Strife7x Glad I could help.  I'll remove my emphasis, since I had originally assumed you were already aware of attacking minions drawing aggro as well.
Comment: @DaveMcClelland It should be noted that a 'Call for help' is not a ping but rather something that Champions and minions do automatically when they are attacked.  Also, the priority list for turrets is smaller than that of minions, and it may be worth separating instead of combining.  The list you provided is for minions, and although it includes the turret list(a subset), the question asked for turret :) good find though
Comment: @BrianColvin Wow, good call.  I hadn't scrolled all the way down the page to see the other list :).  I'll update the answer, thanks!

Target Priority for Turrets?


Monitoring uniswap pair buy and sell transactions via the logs filtering

Question: Can anybody suggests the way to retrieve an Uniswap pair sell or buy transactions,
filtering the events logs.
I know, it's possible to monitor an token transfers continuously scanning token Transfer events, while websocket connecting.
Also, another option to achieve pair transactions is using thegraph and it's not accept an wss connection (subscription).
As I understand, it needs to monitor an Swap event. It's not clear all technical details, but rather only partly.
Answer: Uniswap V3 emits a Swap event
<code>    /// @notice Emitted by the pool for any swaps between token0 and token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the output of the swap
    /// @param amount0 The delta of the token0 balance of the pool
    /// @param amount1 The delta of the token1 balance of the pool
    /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
    /// @param liquidity The liquidity of the pool after the swap
    /// @param tick The log base 1.0001 of price of the pool after the swap
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick
    );
</code>


Video Streaming

Question: I would like videos get downloaded as it plays, and site is in godaddy shared hosting.They said it can be done but they cannot open up streaming ports on a shared plan and they recommended flash method. If anybody know about this, kindly let me know.
Answer: I used VLC player, it can be an option, coming with ActiveX.

Video Streaming


What is the ideal class group of the ring $\mathbb{R}[x,y]/(x^2+y^2-1)$?

Question: I would like to find the ideal class group of $\mathbb{R}[x,y]/(x^2+y^2-1)$. The motivation of this question comes from totally outside of algebraic number theory -- I was playing around with Lissajous curves, i.e. curves parametrized by $x=A\sin(t+t_0),y=B\sin(\alpha t)$. In the book Mathematical Methods of Classical Mechanics, Arnold claims that when $\alpha$ is rational, such curves are actually algebraic, and left the proof of that claim as an exercise. My main idea to prove this was just to analyze the associated ring $\mathbb R[\cos t,\sin t]\cong\mathbb R[x,y]/(x^2+y^2-1)=:A$. As a finite integral extension of $\mathbb R[x]$, it must be a Dedekind domain, but I strongly suspect that it is not a PID. Is there any clear way to calculate the ideal class group here?
Comment: https://math.stackexchange.com/a/220295/3217 , https://math.stackexchange.com/q/244460/3217
Answer: $$A=\Bbb{R}[x,y]/(x^2+y^2-1) = \Bbb{R}\left[\frac{1-t^2}{1+t^2},\frac{2t}{1+t^2}\right], \qquad \mathrm{Frac}(A) = \Bbb{R}\left(\frac{\frac{2t}{1+t^2}}{\frac{1-t^2}{1+t^2}-1}\right)=\Bbb{R}(t).$$
For $f(t) \in \Bbb{R}(t)$ if its only pole is at $t= \pm i$ of order $k$ then $$f(t) = (a\pm ib) (t\pm i)^{-k}+O( (t\pm i)^{1-k}) \implies f(t) - \frac{a}2\frac{1-t^2}{1+t^2}+\frac{b}2\frac{2t}{1+t^2}=O( (t \pm i)^{1-k})$$
thus by induction on $k$ there is $g(t) \in A$ such that $f(t)-g(t)\in \Bbb{R}(t)$ has no poles which means $f(t)-g(t) \in \Bbb{R}, f(t) \in A$. Whence $A$ is the subring of $\Bbb{R}(t)$ of rational functions with poles only at $\pm i$.
Its maximal ideals are $$m_p= \{ f(t) \in \Bbb{R}(t): f(p) = 0\} \text{ for each } \ p \in (\Bbb{R}\cup \infty - (\pm i)) / \mathrm{Gal}(\Bbb{C/R})$$ Moreover $m_p^2= (h_p(t))$ is principal: for $p \in \Bbb{R}, h_p(t)= \frac{(t-p)^2}{t^2+1}$, for $p \in \Bbb{C}-(\pm i), h_p(t)= \frac{(t-p)^2(t-\overline{p})^2}{(t^2+1)^2}$, for $p = \infty$, $h_p(t) = \frac1{1+t^2}$.

Thus every maximal ideal is invertible and $A$ is a Dedekind domain.

For two maximal ideals $m_p,m_q$ there exists $u(t),v(t)\in A$ such that $u(t) m_p = v(t)m_q$ iff $p,q$ are both real or both complex. If $p$ is real and $q$ is complex then $um_p^2 = vm_q$.
Thus the ideal class group is $$\mathrm{Cl}(A)=\{ m_q,m_p\}\cong \Bbb{Z}/2\Bbb{Z}$$
Every non-zero ideal is invertible thus the fractional ideals form a group $\mathcal{I}(A)$ which is isomorphic to $\mathrm{Div}(\Bbb{P^1_R}) / \left<\pm i\right>$ where $\Bbb{P^1_R}=(\Bbb{R}\cup \infty)/ \mathrm{Gal}(\Bbb{C/R})$ and $\mathrm{Div}(\Bbb{P^1_R})=\mathrm{Div}(\Bbb{P^1_C})^{\mathrm{Gal}(\Bbb{C/R})}$
and $\mathrm{Cl}(A)=\mathcal{I}(A)/\mathcal{P}(A)$ is isomorphic to $\mathrm{Pic}(\Bbb{P^1_R}) / \left<\pm i\right>$.
Answer: To see that the class group is nontrivial is pretty easy: I claim that $\langle x-1, y \rangle$ is not principal. If $\langle x-1,y \rangle = \langle f \rangle$ for some polynomial $f(x,y)$, then $f(\cos \theta, \sin \theta)$ would vanish with multiplicity $1$ at $\theta =0$ and not at any $0 < \theta < 2 \pi$. But a periodic smooth function always has an even number of zeroes (counted with multiplicity).
Working a little harder, it is easy to see that there is a surjection from the class group to $\mathbb{Z}/(2 \mathbb{Z})$, sending ideals of the form $\langle x-\cos \theta, y - \sin \theta \rangle$ to $1$ and all other maximal ideals to $0$. Again, this map vanishes on principal ideals because a periodic smooth function always has an even number of zeroes.
I don't know how to check, without getting your hands dirty as in reuns answer, that this surjection is an isomorphism. I believe that all maximal ideals of $A$ are either of the form $\langle x-\cos \theta, y - \sin \theta \rangle$ or of the form $\langle (\cos \theta) x + (\sin \theta) y - r \rangle$ with $r>1$ (in which case the ideal is principal, and $A/\mathfrak{m} \cong \mathbb{C}$), but I don't know a slick proof of this.


How can I export Mosaico html without tabulation?

Question: I'm trying to export emails I've created in a way that can be pasted into an already existing webpage, but it seems impossible as Mosaico utilizes tables to display information. Is it possible to export the email templates without tabulation? I'm trying to do this so that I don't have to format the information twice.
Comment: Do you know that you can set Mailings to be 'public' in which case they are available at a url?
Comment: eg https://dmaster.demo.civicrm.org/civicrm/mailing/view?id=2
Answer: You could try something an online utility that strips table tags from HTML and paste in your Mosaico mailing HTML. If you're just looking for basic text formatting like headings, paragraphs, bold, bulleted lists and so on, that might work, but if you have more complex formatting, I suspect you might not find that's a great solution. Worth a try though!


Multinomial logistic regression analysis or binary logistic regression

Question: I need to analyse data and am unsure whether or not I should use a multinomial logistic regression analysis or a binary logistic regression analysis. I have just conducted a latent class analysis and am interested in seeing if my variables can predict class membership. There are only two classes and so my response variable only has two categories; however the variables range from having 2 to 3 to 4 and are mostly nominal categorical data.
Comment: Thank you so much that is really helpful. I have started on my analysis but have come to another road block. How should I go about investigating multicollinearity between my independent variables when they are all categorical. Is it ok to just investigate this by running a linear regression and investigating the VIF values?
Comment: I really appreciate your help thank you very much. I have asked another question and was wondering would you be able to provide any solutions? http://stats.stackexchange.com/questions/142513/multicollinearity-in-binary-logistic-regression-analysis-after-latent-class-anal
Answer: I think that, if a model's outcome variable has only two categories, then the appropriate term for the analysis is binary logistic regression, regardless of the number and type of predictors. For details on performing actual logistic regression analysis, please see links in my recent related CV answer as well as this tutorial, this chapter (SPSS examples) and this nice set of slides (Stata examples).
In regard to potential multicollinearity, if you're not familiar with this topic, I suggest you start by reading corresponding Wikipedia article. Also, check some CV discussions, for example this, this and this. If you have access to paywalled peer-review journals through your institution, you might want to check this paper and this paper. This blog post presents some options on dealing with collinearity. More details and references on the topic of multicollinearity in general (not specific to logistic regression models) can be found in my recent relevant answer. I hope that this is helpful.
Answer: Do realise that it is of importance to know when you have more than two outcomes, if the outcomes are ordered or unordered. In your case (class membership y/n) I don't understand how you can have 3 outcomes unless outcomes 3 and 4 are for instance nested on another property. In this case you can create new variables using for instance excel with an if-statement in which you say if your variable has option 3 or 4 it represents a one and zero otherwise. After this you can use binary logistic regression.
Comment: I have actually overcome that problem but am facing another huge one. Do you have a background in stats and can you help me?
Comment: http://stats.stackexchange.com/questions/142513/multicollinearity-in-binary-logistic-regression-analysis-after-latent-class-anal


Android push notification how to play default sound

Question: I'm using MixPanel to send push notification and on the custom payload I add the following code:
{"sound":"default"} the problem Is that no sound gets played when I receive the notification. Does anyone have a solution for this?
Answer: Maybe this helps found here code will look like this.
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();

Answer:   mBuilder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI);

Answer: In order to send notification + sound using mixpanel, you need to do the following:

add the following code to the onCreate:
        NotificationCompat.Builder mBuilder =
                new NotificationCompat.Builder(this);
        mBuilder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI);
        Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
        Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
        r.play();

Send notification from mixpanel and see it received. This will send notification on create with default sound configured on the user's device.
Answer: Assuming you have a declaration...
    NotificationCompat.Builder mBuilder =
            new NotificationCompat.Builder(this)
                    .setAutoCancel(true)
                    .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher))
                    .setTicker(title)
                    .setWhen(ts)
                    .setContentTitle(title)
                    .setStyle(new NotificationCompat.BigTextStyle()
                            .bigText(message))
                    .setContentText(message);

... variable constructed somewhere in your code, try this:
final String ringTone = "default ringtone"; // or store in preferences, and fallback to this
mBuilder.setSound(Uri.parse(ringTone));

Comment: I get an error that says "mBuilder is not initialized" If I click on the fix button Eclipse auto initialize mBuilder to null and when I run the app it crashes
Comment: I mentioned "assuming" you have it filled in somewhere. Anyway, it would look like the edited code above. Note, you have to set the title, ts, and message variables!
Comment: Right answer for me (using adapted Xamarin code). Totally forgot to check if Builder had a SetSound method! Thanks.
Answer: try following code
Notification notification = new Notification(R.drawable.appicon,
                "Notification", System.currentTimeMillis());
notification.defaults = Notification.DEFAULT_SOUND;

Answer: final Notification notification =
    new Notification(iconResId, tickerText, System.currentTimeMillis());
final String packageName = context.getPackageName();
notification.sound =
    Uri.parse("android.resource://" + packageName + "/" + soundResId);

Answer: The default GCMReceiver in the Mixpanel library for Android that handles incoming push notifications from Mixpanel doesn't include sounds. You'll need to write your own BroadcastReceiver to process incoming messages from Mixpanel.
You can take a look at Mixpanel's documentation for using the low level API at : https://mixpanel.com/help/reference/android-push-notifications#advanced - then you an apply the advice from the other answers to do anything you'd like with your custom data payload.


Switching to heavier oil for hot weather

Question: I have a 5.3 Triton 3V that asks for 5W-20 in the manual, but I live in a very hot climate, where the lowest this season is 20~ celsius and the hottest is 45~ celsius. Will switching to 5W-30, 10W-30 or 5W-40 oil be better, and if so how thick should I go, thanks in advance. P.S the engine is on 250k kilometers if that makes any difference.
Answer: Generally, do not change the oil from what is recommended. The main thing this has to do with is the variable valve timing (VVT ... or whatever Ford calls it). If you go to a heavier oil, you will be causing issues with it. If you've taken care of your engine throughout its lifetime, continuing to run the 5w-20 shouldn't cause a bit of issue.
Another problem with heavier oil is, it doesn't flow as well as the thinner oil. Since your bearings are gapped for the thinner oil, running heavier oil may actually starve the bearings of the amount of oil they need. You could actually harm the engine by doing this.
NOTE: Take a look at your owners manual (or find one online). You may be surprised to see it may say to do exactly as you've stated (heavier oil for hotter conditions). If it says to, then by all means.
Comment: Thank you! This is really helpful
Comment: Oils these days are amazingly high tech and very capable of handling wide outside temperature ranges. The days of using different oils in different seasons are long gone.


Change background color of single page in Google Document

Question: I would like to know how to change the background color of the cover page of a multi-page Google Document.
Comment: Google Docs have changed a lot since this question was posted by the other hand, this doesn't look as a good question for a site for power users of web applications --> Search thoroughly this site and the help center of the corresponding web app, in this case [Google Docs Editors Help](https://support.google.com/docs), show what you tried, share what you found and why it didn't meet your needs.
Answer: AFAIK there is no way to change the background color of a single page. The best workaround I can think of is to create a a table that is 1x1 and expand the cell to be as big as possible. You can then change the color of the cell to be whatever you want.
The downside here is that, well, it's a table, so already not ideal. There other thing is that you are constrained by the margins of the page, unless you want to change the margins for every page in the doc.
Answer: It is possible to change the background color of a single page !! This is how you do it:
Select page setup from the file menu

Choose the color you want

Color is set for a single page, but also set for the whole document.
If you print out the finished documents as PDF files, then you can use for example the following web app to merge the two documents: http://www.pdfmerge.com/.
Comment: "Color is set for a single page, but also set for the whole document." So in other words it's not possible to change the color for a single page.
Comment: Had to edit your answer. What a weird answer btw, it is NOT possible to change the color of a single page and leave the others as is. At least not yet.
Comment: @felix The answer is still super misleading. Please could you (or someone) correct this answer? I don't have enough reputation. It's one of the top search results and super frustrating that it's misinformation.
Comment: @Paul locked this question as obsolete and added a post notice to this answer. Please let me know if you are interested in making a new question.
Answer: Why not just make a separate doc for your cover page?  Or better yet, download your doc into a pdf and make a flipsnack or something for the paper.
Answer: The easiest way is to open MS Paint, make a rectangle with the colour you want, copy it into your document and format the image to stay behind the text.
Then you can expand the rectangle to fit the whole page or to whatever size you want.
Comment: How do you do that? I can't find options for putting the image behind the text nor for filling the whole page (it wants to stay within the margins).
Answer: You can only change the page background color for the entire document (File > Page Setup), not a single page. However, you can set paragraph styles (Format > Paragraph Styles > Borders and shading) with background colors, which should accomplish the same effect:

Double-check that bullets and indent inputs work correctly with whatever you choose.
Re: alternatives, full-width tables technically work with the major caveat that tab function will skip to next table cell rather than indenting the line, which is usually a dealbreaker. And there's no way to send a shape to the doc background to write text over it.
Answer: Go to page setup then click page color. Then you can change the color.
Comment: But that would be the color throughout the document, isn't? The OP asked if one single page could be colored differently.


I want to change change the arrangement of the grid of posts displayed by the theme on the Search page (read the description for better understanding)

Question: i have a theme called Hueman installed on my Wordpress. I have the free version of the theme installed. Now whenever i search using the default search of Wordpress it displays the result in a grid layout with 2 posts in a row with the images having a weird aspect ratios and cropping. I changed the size of those images to (width 200px and height 290px) to avoid it being cropped and i disabled excerpt.
Now those images are smaller and occupy less space but still it is displaying only 2 posts in a row with the rest of the space being empty (as shown in the screenshot below)

As this was looking ugly i put float:none in my custom CSS. This allowed me to have more than one post in a row but it made it unorganized and some of the post appear in random positions as seen in the screenshot below.

I want to make this into an organized grid where elements in the next row start from the left and don't pop up randomly to any location.
Below are the screenshots of the code of the page when i use inspect element in chrome.
Comment: If you're familiar with CSS you could create a Child Theme and add some CSS that creates however many columns and rows you desire. Although you're using WordPress, this type of question is not really considered on-topic here because the focus is on coding functionality, not styling - things that anyone could apply to any WP site, not specific to a particular theme or plugin. You might be able to get some CSS help over on the main StackExchange site.
Answer: Try using flexbox, try adding the following in your custom CSS.  Here is more info on flexbox and a flexbox generator you can play around with.
<code>    .grid-wrapper {
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
</code>


Why is methoxy group an electron donating group?

Question: I am studying acidity of carboxylic acids and I found that benzoic Acid is more acidic than p-methoxybenzoic acid. It is written in my book that this happens because methoxy group is an electron donating group. I can understand why electron donating groups can reduce acidity of an carboxylic acid but I can't understand why methoxy group acts as an electron donating group?
Comment: As a rule of thumb, if the atom that is attached to the benzene ring is surrounded by more electronegative atoms, the group withdraws electron from the ring. (-NO2, -C=O, -CN, -COOH). And, if the atom directly attached to the ring is surrounded by less electronegative ones, the group donates electron (-NH2, -OR, -OH, -R, etc.)
Answer: The lone pair on the oxygen delocalizes into the conjugated aromatic ring.
Edit (based on Jan's suggestion):
Notice that the answer is actually a lot more complicated. A methoxy substituent actually impacts the ring electronics via two competing effects. The oxygen's lone pair is well-placed to delocalize and increase electron density within the ring's conjugated system. This allows delocalization to better stabilize positive charges. So the methoxy is electron-donating from a resonance perspective.
On the other hand, because oxygen is quite electronegative, the methoxy group is electron-withdrawing in an inductive sense via the $\sigma$ bonds.
Take a look at a linear free energy relationship (LFER) plot. For acidity of benzoic acids, the methoxy group has a positive $\sigma_{\mathrm{meta}}$ value but a negative $\sigma_{\mathrm{para}}$ value.
The meta $\sigma$ value measures the effect when there is no resonance structure that delocalizes effectively to the carboxylic acid, and its positive value tells us that the methoxy is electron-withdrawing in that position. The negative para $\sigma$ value tells us that when there is effective conjugation into the carboxylic acid, the methoxy is electron-donating. Notice that it is still electron-withdrawing inductively, but the resonance donation is much stronger.


Can ESB/BPM allow to totally get rid of coding apart from wrapping webservices?

Question: In a big company I work for, a very (costfull) ESB has been bought, the purpose is to be able to align with business goal quickly by resusing legacy infrastructure wrapping them with webservices, that is to say no more coding needed. Are ESB/BPM now really mature enough for that because it's now more than 10 years old or is it just an other vendor promise ?
Answer: Almost certainly just a vendor promise.  If this becomes a reality for your company, they'll be the first to be so lucky!
This is the same sales job being done again and again for over a dozen years now (remember 4GLs?).
Most companies find the reality is that 1) it takes far more effort to install, integrate the ESB/BPM tool than they were led to believe, 2) only the most trivial changes can be made with the tool - it still takes coders to perform any meaningful process change / addition, 3) whenever the ESB/BPM tool vendor upgrades their tool, it's a huge effort to upgrade and be eligible for support (look into the history of any of these tools and what pains shops go through to upgrade, particularly Webmethods and BEA/Oracle's products over the years), 4) support services are expensive and rarely provide help (I know of companies that have paid for premium support who have filed dozens of tickets only to have one or two of them resolved  by the idiots on the phone before someone in-house finally found the solution / work-around themselves.
Comment: The company doesn't care to pay since it just has to say that the cost would be even more without this :)
Answer: You certainly can use an ESB / BPM to wrap legacy infrastructure and facilitate a migration towards a more modern target architecture. In fact that's one of the best reasons to adopt an ESB/SOA strategy in a complex application environment.
However, it's a complete fallacy to say that this implies "no more coding needed". After all, you will need to orchestrate a potentially complex sequence of web services with detailed knowledge of the state and transactional semantics of the legacy systems. Another word for that is.... coding.
p.s. It may be too late for you now but, for the sake of others reading this, I feel obliged to point out that costly prorprietary ESBs are often a waste of money. What you need can be done perfectly well (and sometimes even better!) by the open source solutions. JBoss and Mule spring immediately to mind. Since you are going to need to do most of the hard work in-house anyway, you might as well spend the time learning a great open source toolkit rather than locking yourself in to a vendor's proprietary solution.
Comment: yeah too late it's one of the two ESB leaders that was chosen ;)
Comment: I upvoted the previous answer. If you're using Mule, you may want to follow http://mulesux.tumblr.com/


Pressure of the same mass of fluids of different densities?

Question: Suppose I have 2 fluids of different densities, and I pour the same mass of each fluid into 2 identical cups. I feel like I'm confusing myself here — on one hand hand, both cups contain  the same mass of fluid, so mg/A is equal for both. At the same time, the denser liquid occupies less volume, and the depth from the atmosphere to the bottom of the cup is less. Am I being too naive and forgetting something, like omni-directionality or something along those lines? Does the difference is density perfectly match out the difference in depth? Thank you!
Comment: Hydrostatic pressure is calculated via rho*g*h. The heigher liquid column of the less dense fluid makes up for the lower density. Set values for both fluids and make the calculations. Also you might want to look up the hydrostatic paradox.
Answer: It depends on the shape of the container.  If the sides are vertical, then the ratio of depths will be inversely as the ratio of densities, and the pressure at the bottom of each will be the same: in one container you have a larger depth, but a smaller pressure gradient, in the other a smaller depth but an equally larger pressure gradient. However, if the sides of the containers slope, then all bets are off, because the depth no longer scales proportionally with the volume.
Answer: You are correct. The difference in density matches perfectly depth occupied in a container of constant horizontal cross section. Refer to buoyancy as it works similarly - the depth a less dense liquid in a container that is floating sinks in the liquid the container floats in is related to the densites of the 2 liquids.
Comment: Hello, thank you for the answer! Sorry but I can't exactly see how this relates to buoyancy, they feel too distinct to me for me to make a connection. Could you elaborate more please?
Comment: You do not understand perhaps because you are not thinking on a simple enough level. The link between your situation and buoyancy is that the basis for both is density. The buoyancy (floatability) of something is a function of the density - the less dense the volume of the mass the more buoyant. And the ratio of densities of the vessel to the water determines how much of the vessel floats.
Answer: It may help you understand what is happening here if you think in terms of weight rather than in terms of mass.  Weight and mass are related by the equation $W = mG$, where $W$ is the weight of an object, $m$ is the mass of the object, and $G$ is the local gravitational constant ($32.2 \text{ ft/sec/sec}$ at sea level).  If your 2 identical cups are at about the same elevation, $G$ will be essentially the same for both cups.  Therefore, you can weigh and put in say 2 lbs of the less dense fluid into cup 1, and 2 lbs of the heaverier fluid in cup 2.  Assuming your cups have vertical side walls, cup 1 will be more full than cup 2.
Since density, $d$, is $W$/volume, $A \cdot h$ where $A$ is the area of the cup cross section and $h$ is the height of the fluid, we have:
cup 1      $$h_1 A d_1 = W_1  = 2 \text{ lbs}$$
  cup 2      $$h_2 A d_2 = W_2  = 2 \text{ lbs}$$
and we get  $h_1 d_1 = h_2 d_2$,   or  $h_1/h_2 =d_2/d_1$,  so yes, the ratio of the heights is inversely proportional to the ratio of the densities.
END


Corruption on hardmode

Question:
So I have 2 questions:
1: Will the wall hold off the corruption (the wall is wood, stone brick, stone brick and wood)
2: What are the chances of corruption spawning (when I enter hardmode) on the other side of the wall?
Comment: I'd advise you to simply not mind about it, build a small wall around your base and let the corruption and the hallow be. If you want a place to call home you can create a new world, place sunflowers and never go to hard mode in that one.
Answer: 1: Your wall will prevent the Corruption from spreading from one side to the other, yes. Wood and Gray Brick are incorruptible (even in Hardmode), and 4 blocks is the recommended wall width for preventing its spread.
2: There is, however, a chance that either Corruption or Hallow will cross your wall when Hardmode begins. The game will convert large sections of your map into Corruption and Hallow as soon as the Wall of Flesh is defeated, which may span across both sides of your wall. Additionally, each time you destroy a Demon Altar, a small pocket of Corruption or Hallow will appear in a random location on your map, and spread from there. This could happen on either side of your wall, or within the Jungle itself.
If your aim is to protect your Jungle, I would suggest using powders to neutralize any conversions made there upon engaging Hardmode, and refrain from destroying any Demon Altars on this map.
Comment: Thanks lol, although I played terraria for a long time I didnt know that pockets of corruption/crimson were created upon the destroying of a demon alter
Answer: No, you are not safe. The corruption can spawn right at the edge of your jungle, crossing over the wall; after the initial burst, destroying demon altars has a chance to create corruption inside the wall, or on the other side of the jungle, near the ocean.
If, however, after breaking all demon altars you're going to, you'll find that all of the corruption is on the safe side on the wall, then yes, the jungle will be safe.
Answer: Yes, the wall will be able to prevent the Corruption from spreading beyond that point. However, if your world is a Large World, There may be another Corruption or Crimson in that world that may infect your Jungle from the other side before you have time to place a second wall.

Corruption on hardmode


Emacs find-grep-dired then automatically isearch-forward on given regexp

Question: I commonly do find-grep-dired to find an expression in a project directory. That gives me a nice dired view of all the files that contain that expression. But my next step is invariably to open one of those files and do an isearch-forward with the same search expression. How can I save myself from typing in the search words twice each time (or more than twice if there are multiple files I want to edit)?
Answer: This should work for you:

Run find-grep-dired as usual
Press * t (dired-toggle-marks) to mark all files.
Press A  to start dired-do-search. When prompted, instead of typing, press M-p, this will bring up your find-grep regexp since both functions use the same prompting history list
You will be taken to the first match in the first file. Here's the fun part, simply press M-, to go to the next match spanning all of your matched files.
Profit? (sorry, couldn't resist)

And if you want it all in one shot, here you go:
(defun find-grep-dired-do-search (dir regexp)
  "First perform `find-grep-dired', and wait for it to finish.
Then, using the same REGEXP as provided to `find-grep-dired',
perform `dired-do-search' on all files in the *Find* buffer."
  (interactive "DFind-grep (directory): \nsFind-grep (grep regexp): ")
  (find-grep-dired dir regexp)
  (while (get-buffer-process (get-buffer "*Find*"))
    (sit-for 1))
  (with-current-buffer "*Find*"
    (dired-toggle-marks)
    (dired-do-search regexp)))

Comment: `dired-do-search` is bound to `A` in dired buffers.
Comment: M-, to go forward, whats the key binding to go back? i.e. to prev occurrence?
Answer: You can store the search string you use in find-grep-dired in the kill ring (C-SPACE C-a M-w). Then you do the search in the files using the string from the kill ring (C-s M-y). M-y will  yank the last string of killed text.
You can display other (useful) bindings for isearch-forward using C-h k C-s.
Comment: Thanks, that's one way, certainly. I was hoping for something a little less involved, like a single binding to isearch for the last search string.
Answer: How about a different approach?  Try using M-x igrep-find from the igrep.el package.
By default it searches for all occurrences of the pattern, but you could change the behavior to just find the first such occurrence with:
(setq igrep-options "-i -m 1")   ;; I like -i for case-insensitivity

This will result in a compilation style buffer (named *igrep*) with a single line for each file, and when you click on the line (or do C-x `), you'll automatically be put on the line which has the match.  Plus, you can see the matching line in the *igrep* buffer.
Obviously, if you want to see more than one match per file, change the number after the -m, or omit that part altogether.
Comment: I tried that but got an error: find /Users/reed/sb/ampms/app -type d \( -name RCS -o -name CVS -o -name SCCS \) -prune -o -type f \! -name \*\~ \! -name \*\,v \! -name s.\* \! -name .\#\*  -print0 | xargs -0 -e grep -n  -e test  /dev/null
xargs: illegal option -- e
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
             [-L number] [-n number [-x]] [-P maxprocs] [-s size]
             [utility [argument ...]]
Comment: @Reed It looks like your xargs doesn't support `-e`, unsure why.  You can avoid using xargs by setting `(setq igrep-find-use-xargs nil)`.  Or download a newer version of xargs (in findutils).
Comment: I'm on OSX. Perhaps that's why.
Comment: I installed findutils from homebrew: `brew install findutils` and changed my $PATH to make the /usr/local/bin/xargs load before the system /usr/bin/xargs like this `export PATH=/usr/local/bin:/usr/local/sbin:$PATH` and now it works great. I do wish it could use ido-mode to find the starting search directory.


Author of Nishmat kol chai

Question: Who is the author of the prayer "Nishmat kol chai" which is said on Shabbat, Yom Tov, and during the great Hallel at the Seder?
Comment: By the way, Hallel HaGadol, or "The Great Hallel" refers to Tehillim, Chapter 136 (The 26 Ki LiOlam Chasdo's).
Comment: Itchak Avinu and Rachel Imenu maybe...just kidding
Answer: The Machzor Vitri(A talmid of Rashi who lived during 11th - 12th century) Hilchos Peasach 66 brings down that it is a mistake to think that peter wrote nishmas kol chai and if one says this he will have to bring a chatas when the third bais hamikdash is built.
In Siddur Avodas Yisrael pg 206 he brings two commentaries on who the author is of nishmas kol chai one from the 15th century that the author was Rabbi Shimon Kipah. The other source says it was Rabbi Shimon ben Kipeh and some say Rabbi Shimon Ben Shetach.
Comment: why the downvote?
Comment: @AdamMosheh the machzor vitri calls peter = peter chamor and he is saying it is not him at all. In the siddur avodas yisrael he says it was Rabbi Shimon Kipah or Rabbi Shimon Kipeh or Rabbi Shimon ben Shetach. I believe the Machzor vitri is more accurate since he is an older source and his rebbi was Rashi.Also the siddur Avodas Yisrael said he saw from a manuscript.
Comment: -1, Rabbi Shimon Kipah is Saint Peter, AFAICT.
Comment: @AdamMosheh that is what some say ,but the main point is the machzor vitri.
Comment: @AdamMosheh it was a play on words see Rabbi Yehuda Hachassid Sefer Chassidim 191.
Comment: A chatas for what exactly? Or was that just a poetic way of saying it is an unseemly misattribution?
Comment: Proof, "Simon (Shimon) Peter" here is called Caipha: http://www.globalyeshiva.com/forum/topics/curious-anecdote-discovered
Comment: Caipha = Kipah?
Comment: So the Machzor Vitri is saying this belief is an ikkar emunah?
Comment: Who would name their son Redemption of the Firstborn Donkey?
Answer: Maybe Simon (Peter)?!
See the whole conversation at
http://www.globalyeshiva.com/forum/topics/curious-anecdote-discovered
or look at this:
http://hebrewbooks.org/pdfpager.aspx?req=2585&st=&pgnum=285
cf. Mishna -Pesachim 10, 7
Comment: dead link and not saved at archive.org or archive.is
Answer: For an In depth discussion of this and many other such topics Listen to this Lecture
http://www.yutorah.org/lectures/lecture.cfm/726352/Dr.%20Shnayer%20Leiman/Jewish%20Perspectives%20on%20Early%20Christianity:%20Toldot%20Yeshu
The lecture is an attempt to show that Toldot Yeshu is a much older text than it's first appearance in the 1700s.  It explains there that when the Rashi says that the "Romani" have no language, have no alphabet, and other people write their books, he is referring to the idea that R. Shimon set up Latin as the Christian language, created the Christian Bible and otherwise created Christianity to make sure that Jews would not be drawn to it.
The Toldot Yeshu also claims that Nishmat Kol Chai was written by R. Shimon as well. (R. Shimon being Peter)
The Lecturer makes an empahtic point that this is just one Jewish tradition, but that there are others that disagree with it.  His main focus was that the tradition is an old one.
Comment: http://meta.judaism.stackexchange.com/q/1890
Answer: The author is St. Peter according to Rabbeinu Tam, though some say he only held that view due to pressures of the times.
A good analysis, with citations:
https://www.kotzkblog.com/2016/11/102-did-st-peter-compose-nishmat-prayer.html

https://archive.md/1dPiH
Conclusion there:
...
ANALYSIS:
Whether factually accurate or not, we have established that there was indeed widespread acceptance of the notion that St. Peter had composed the Nishmat, Etan Tehillah and Ahavah Rabbah prayers. This appears to have been supported by Rabbeinu Tam and other Rishonim.
On the other hand this perception was vehemently challenged by Rashi, his student the Machzor Vitry and others who suggested the prayers may have predated the Common Era.
It is interesting to see that the brunt of the debate is played out between both Rashi's grandson (Rabbeinu Tam) and his student (R. Simcha of Vitry).
In an attempt at reconciling the variant opinions, some suggest that there may have been two Shimons. One was Shimon ben Yona, the Apostle who was known as St. Peter who was viewed rather negatively by Rashi and the Machzor Vitry. The other was Shimon Kipah who was the righteous man who acted as the agent for the rabbis.
But that is just speculation.
In general the difficulty that confronts us is that;
"Since the names of the first paytanim (composers of liturgical poems) have been lost to memory, it has happened that the liturgical poems have been attributed to people who never thought to write them."[15]
This means that we may never have any real resolution to our question as to who the mysterious author was who penned these prayers.
Comment: Re the ben Yona bit - the whole Kipah/Peter connection is that Kipah means "rock" as does Peter, so they must have been the same person.
Answer: A museum in Israel has a Yemenite Siddur from approx 1500 CE that has a hand written note next to Nishmat saying it was written by Shimon who was called Kepha because he sat on the rock and wept or something like that.

Author of Nishmat kol chai


Why does this code not work in Scheme?

Question: <code> (define a 42)
 (set! 'a 10)

(define a 42)
(define (symbol) 'a)
(set! (symbol) 10)

(define a (cons 1 2))
(set! (car a) 10)
</code>
I tried running them in DrScheme and they don't work. Why?
Comment: Can you provide more details like How does it not work?  What output do you get? An error message? The wrong number?
Answer: Think of set! is a special form like define which does not evaluate its first operand.  You are telling the scheme interpreter to set that variable exactly how you write it.  In your example, it will not evaluate the expression 'a to the word a.  Instead, it will look for a variable binding named "'a" (or depending on your interpreter might just break before then since I think 'a is not a valid binding).
For the last set of expressions, if you want to set the car of a pair, use the function (set-car! pair val) which works just like any scheme function in that it evaluates all of its operands.  It takes in two values, a pair and some scheme value, and mutates the pair so that the car is now pointing to the scheme value.
So for example.
<code>>(define pair (cons 1 2))
>pair
(1 . 2)
>(set-car! pair 3)
(3 . 2)
</code>
Answer: Because the first argument of set! is a variable name, not an "lvalue", so to speak.
For the last case, use (set-car! a 10).
Answer: The issue is with (set! 'a 10), as you shouldn't be quoting the symbol a.
It sounds like you're trying to learn Scheme, and you don't know Lisp, yes? If so, I strongly recommend trying Clojure as an easier to learn Lisp. I failed to grasp the interaction between the reader, evaluation, symbols, special forms, macros, and so forth in both Common Lisp and Scheme because those things all seemed to interact in tangled ways, but I finally really understand them in Clojure. Even though it's new, I found Clojure documentation is actually clearer than anything I found for Scheme or CL. Start with the videos at http://clojure.blip.tv/ and then read the docs at clojure.org.

Why does this code not work in Scheme?


How is resolution defined?

Question: So I'm looking at a 1 meter square object in my digital camera.  What size of pixel is considered fine enough that the object is considered to be resolved?  Obviously a pixel size of one meter squared will 'notice' the object, but it will likely affect four pixels in varying degrees, so we can hardly call it an image.  A pixel size of 10cm will at least let me see that I'm looking at a square, but is that considered fine enough?
Comment: To be honest I was hoping for an answer that wouldn't take a PhD in optics to understand!  'Resolution for dummies' ;-)
Comment: Did you read https://en.wikipedia.org/wiki/Optical_resolution - especially the 'spatial resolution' paragraph? What is unclear once you read it?
Comment: @planetmaker the question presents a specific example of the shape of an object and the ratio of object to pixel size. Simulation of the complete imaging system, determining response functions (e.g. point spread function) and use of image deconvolution are barely even mentioned much less discussed in that article, but techniques like those are going to be necessary to form a good answer to this question as it is currently written.
Comment: TLDR: The resolution of an astronomical telescope ususally is expressed as an _angle._ If the angle between two bright points (e.g., stars) in the sky is less than the resolution of the instrument, they will appear as a single point. But if the angle is greater than the resolution, then they will appear as two distinct points.
Answer: An example of a single, square object is not enough to explain resolution in this context. Resolution is defined in terms of being able to resolve details in an image -- and a single, square object contains no such details. Instead, it is defined in terms of being able to tell apart separate features/objects -- if the resolution is not high enough, separate features melt together into one, and you cannot tell whether it is a single feature, or multiple features blurred together. Using your words and thinking process, you were really close to the true definition, though. Instead of a single, square object, please just think about two square objects sitting at some distance apart from each other; and whether or not you could tell there are indeed two separate objects. If we progressively decrease the resolution of an image, at some point you would not be able to differentiate between them because they would melt together and be seen as a single object.
It is not really about the ratio of object size vs pixel size. Object size vs pixel size is rather about our visual comfort, where the individual pixels are small enough that we do not notice the grid of the screen. However, even if we made a giant screen made of 10 m × 10 m pixels, we still would be able to see detailed images if the resolution was high enough. The screen would be, for example, an 8 km × 6.4 km juggernaut miracle of engineering that would be useless if viewed from the distance we usually sit away from a computer screen or TV, but walking just a few kilometers back away from it would let us see it as a whole and thus see the detailed image.
Please look at this TV resolution chart from 1956. It helps to measure the resolution of TV screen. It is made of various fine-detail features, like thin lines spaced apart in progressively smaller distances.

Source: https://www.cctvcameraworld.com/cms/wp-content/uploads/2014/03/resolution-chart.jpg.
Answer:
How is resolution defined?

Differently in different contexts, and even differently by different people within the same context. Some definitions are objective, expressed as an equation or a computational procedure, others may be more subjective.
We can always start with the grandparent of all resolution definitions, which is The Rayleigh criterion

Two airy disks at various spacings: (top right) twice the distance to the first minimum, (middle) exactly the distance to the first minimum (the Rayleigh criterion), and (bottom left) half the distance. This image uses a nonlinear color scale (specifically, the fourth root) in order to better show the minima and maxima. (cropped and rotated from source)

The middle image  doesn't look as resolved as it should because the author chose to use the fourth root of brightness instead of a linear scale, but you can see a dark band between the two "stars" in the middle one even in this image.
These patterns are what diffraction from a circular aperture causes, either your pupil or a telescope or your camera's lens. It doesn't take into account your square pixels though, so it doesn't help.

What size of pixel is considered fine enough that the object is considered to be resolved?

I'd say that some form of

Beauty is in the eye of the beholder

can be used here. Astronomers push things to the max. Loosely speaking they can measure the apparent size of a "resolved" object if it's 6 pixels wide for example as long as all the other stars are no more than 4 pixels wide, but they'll do a thorough computer analysis first including optical blurring and simulations shifting the positions of the stars fractions of a pixel in every direction first to make sure that object is definitely bigger than all the unresolved stars in the field.

above: from @PeterIrwin's answer to Has Hubble ever been used to try to image a near Earth asteroid?
Resolved? Not?
Here's another case in point. It's from this answer to How big would a QR code have to be on my roof for a satellite to be able to scan it given today's allowable resolution? in Space Exploration SE.

It's the result of a simulation of a 6 meter pixel "QR code" (not exactly) on Earth's surface seen from a 9 cm aperture telescope in orbit 575 kilometers above Earth with the sensor's pixels having a resolution at Earth of 3 meters. I've used an Airy function to simulate the image, the same thing that generates those concentric rings in the first image here.
Resolved? Not?
Perhaps 'barely" or "almost" or "mostly, except for some parts..."? We can recognize that it might be QR-code-ish but from our eye can't
You can see that I was naughty and rotated the image sensor's axis by 45° on purpose just to make it more interesting.
If you gave the right image to a computer program, it could probably recover the data that was encoded into the original "QR code" most of the time, but it might be much harder for a person to figure out.
Punch line
It's up to you really, based on your application. For amateur astrophotographers or lay people like me, I'd say that if other folks look at a tiny few-pixel image of the Moon and recognize it as probably the Moon without being told, then it's resolved. So maybe  10 pixels wide? Is it the Moon? If I told you it was, would it be believable? If I asked you what it was without any hints, would Moon be your first guess?
Resolved? Not?

Now if we had a thousand Moons and you had to identify which one? then you might need to go to maybe 16 pixels wide.
From barcodeart.com/artwork/portraits/pixel_presiden:

Resolved? Not?

Leon Harmon - 1973
In November 1973, a researcher at Bell Labs named Leon Harmon wrote an article for Scientific American titled, "The Recognition of Faces." It includes several "block portrait" illustrations, most notably this one of Abraham Lincoln. He created the portraits with some prehistoric computer equipped with a "flying-spot scanner." Harmon used these pixelated portraits to test human perception and automatic pattern recognition. The article actually doesn't have the word "pixel" in it, but certainly introduced a new way of seeing.
Salvador Dali - 1976
A few years after Harmon's article, Salvador Dali completed this painting titled, "Gala contemplating the Mediterranean Sea, which at 30 meters becomes the portrait of Abraham Lincoln (Homage to Rothko)." Not only did Dali appropriate Harmon's portrait of Lincoln into the overall composition, but Dali also reincorporated a smaller grayscale version into a single tile.
Comment: @RayAndrews Yep I know what you mean, but one person's "resolved" is another person's "unresolved". It's good news because we get to make the call ourselves, based on our own needs and what we're trying to claim. As an aside, I'm no gentleman myself and users here come in all flavors, colors and varieties. :-)
Comment: Thanks gentlemen, it sounds like there is no easy answer.  Dunno I thought there might be some standard, like 10 pixels within the object or something like that.

How is resolution defined?


Oil in coolant - how much trouble am I in?

Question: I have oil in my coolant reservoir.  Could it just be the head gasket or is it almost certainly the entire engine or might it be something else entirely?
Thanks in advance...
Answer: The most likely source is the head gasket. There are very few other ways (short of catastrophic engine failure - and that would give other symptoms!) of the two mixing.
Check for excessive smoke (oil getting into the bores), coolant loss (coolant getting into the bores) and a mayonnaise effect in the oil (coolant getting into the oil)
You don't say what car you have, but for quite a lot of vehicles, particularly older ones, that is a do-able job for a reasonably competant diy mechanic. You'll generally need a decent manual, a gasket set & new head bolts, a Torque wrench and a selection of sockets, and make sure to follow the loosening/tightening sequence given in the manual. It is best to get the head checked and/or skimmed by an engineering shop, but you can usually get away without if it isn't too bad a blow.
Comment: The car is a 2003 Mitsubishi Montero - the full size one with the V6. Apparently they are well known for blowing their head gaskets. :(
Comment: If the leak's not bad, are any of the sealant products you can buy any good, or do they just make a worse mess?
Comment: For a blown head gasket, a sealant will just make a worse mess.
Answer: Following up on @Nick C's answer:
The head gasket almost certainly needs to be replaced and, on some cars, replacing the head gasket is straightforward work with the right tools and procedures.
However, on some seemingly mainstream cars, this is not the case.  In order of ease of access to the head gasket, I would rate the common designs as follows:
Inline: relatively easy.  A transverse inline-4 is very common in today's cars and all parts can be accessed easily.  Longitudinal engine layouts are less common (e.g., BMW inline-6) and you're going to need to reach in to get those back bolts.
V: more work.  A V-6 or V-8 is going to be more work, if for no other reason than you have two head gaskets to be concerned about.  It's your call whether to try to diagnose each or just replace both.
Flat: cast iron b*tch.  I love my Subaru but replacing the head gaskets is not an evolution that you embark on casually.  You can see them from the bottom of the car but there's no convenient way to get at them without pulling the engine.
Answer: head gasket is when water is in oil which is not that expensive if the engine does not otherheat .
If you drive your car and water temperature doesn't go over 100 degrees then your headgasket is ok .And this mean you have these 2 problems

Oil cooler
Crack in the Block

If is oil cooler it's easy to change and after you need to clean your water cooling system,after couple good washes(means 10+ ,drain water add new one clean the reservoiar) you change thermostat and water pomp .
If is the block crack then is cheaper to find another engine instead of repair .


how to get a list of all paths/files on a webpage using wget or curl in php?

Question: I use wget -p $url  to get all the files on a webpage so that I can get a list. But for some URLs, it turns out that only the index.html can be fetched by wget. Is there a way to get a list of files on a specific URL by wget or cURL? Do I need to check the request headers and response headers?
Comment: You'll get better responses if you can make some examples. What do the links look like that wget doesn't follow?
Comment: @Pekka, eg: wget -p amazon.com   and I get only the index.html.
Comment: What exactly do you mean by "files on a webpage"? `wget -p` loads all the prerequisites, ie. attached style sheets and the like. Is that what you want?
Comment: @Pekka, you may type some url on the page: tools.pingdom.com, and the list of files is what I want. Actually I get this kind of file list for some websites by using "wget -p", but for many other websites it only download the index.html. Do you have any suggestion how I can get this kind of list of files?
Answer: Some servers do not let you browse directory listings, and if there's a default document in that directory, it takes over and you can't browse either.
You need to implement a spider that parses all the paths and files and links, and creates a directory structure of files that are declared and used in the HTML. Then you can download those files.
Comment: You may type some url on the page: http://tools.pingdom.com, and the list of files is what I want. Do you know how can I get this kind of list of all files?


Which theme is this and how to get it on Ubuntu 16.04?

Question: Does anyone recognise this theme and icons? It says Ubuntu 17.04. Is the same theme available for 16.04? Here is
Comment: I got when I googled Ubuntu 17.04. Now I saw it actually was a tweet from Ubuntu Budgie (@UbuntuBudgie). Had no idea of it. My bad. Thanks a lot.
Comment: That is obviously the [Israeli currency symbol](https://en.wikipedia.org/wiki/Shekel_sign) reversed: ₪
Comment: Where did you get this screenshot from?
Comment: Oh, okay. I actually found that that tweet, which led me to find out what the icon theme is. I will update my answer.
Answer: It looks like the screenshot is taken from https://twitter.com/UdaraU3/status/792798140403507200, and a followup tweet at https://twitter.com/UdaraU3/status/796319204513370112 states that it is the Budgie Desktop with the Adapta theme and Paper icons.
From http://www.omgubuntu.co.uk/2016/09/install-budgie-desktop-on-ubuntu, to install the Budgie Desktop, run:
sudo add-apt-repository ppa:budgie-remix/ppa
sudo apt update && sudo apt install budgie-desktop budgie-welcome

The Adapta theme is developed at https://github.com/adapta-project/adapta-gtk-theme. To install the theme, run:
sudo add-apt-repository ppa:tista/adapta
sudo apt-get update
sudo apt-get install adapta-gtk-theme

From https://snwh.org/paper/download, to install the Paper icons, run:
sudo add-apt-repository ppa:snwh/pulp
sudo apt-get update
sudo apt-get install paper-icon-theme

It looks like the PS1 in the terminal is also heavily customized. See @Anwar's answer at https://askubuntu.com/a/816091/15003 for ideas on how to customize the PS1 to fit what is shown in the screenshot.
Comment: @AlekhKarkadaAshok That looks like the adapta theme applied to the new Budgie Desktop.
Comment: Yes it is. That pic was actually a tweet from Ubuntu Budgie (@UbuntuBudgie). I had no idea it was a new desktop environment. Thanks to you both!
Comment: To complete the answer, you may also want to refer to the `.bash_it` bash customization scripts. Here is the github repo. I wrote an answer before about this too [here](http://askubuntu.com/a/816091/61218)
Comment: @edwinksl Whatever you wish! It seems I missed the github repo link. Here it is https://github.com/Bash-it/bash-it/
Comment: That seems to be it. But the minimise, maximise buttons are on the right. Terminal seems different and somehow there are icons on the up-left corner. Is it something which comes in Adapta? Thanks!
Comment: @Anwar Wow, nice. I will add a link to your answer.
Answer: To set the icons you can use dconf-editor or:
gsettings set com.solus-project.budgie-wm button-layout 'close,minimize,maximize:appmenu'

For the gnome windows (like settings) it's:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/ShellShowsAppMenu': ,'Gtk/DecorationLayout': <'close,maximize,minimize:menu'>}"

close,maximize,minimize:menu
would be
menu:minimize,maximize,close

if you want it the other way around.
Then, if you did not have it:
sudo apt install gnome-tweak-tool

Start it, set the themes under appearance and enjoy the eye candy :).
Thanks for sharing the PPA's!
[edit]
I noticed that you can start Budgie Welcome from the start menu.
Start it and click default settings.
Then you have the option to install the Arc and Material Design themes.
It seems the Material Design is the one with the transparency.
Click install and then Apply.
[/edit]


Who decides the specifics of the 4th-level fighter granted by a deck of many things?

Question: Since the race is the same as the player character's and they have control of this character, I am inclined to let the player decide background and ability score distribution.
Comment: I've removed the second question from this post, since we have a one-post, one-question site design. If you have a second question about how subrace is determined *separately* from who gets to determine it, please ask it as a separate question.
Comment: Asking as a DM, not a player, although it would be useful for both.
Answer: Do what's fun and enjoyable
Since there are not specific rules, there is considerable latitude to choose an option that the player and you enjoy.  For example, the Fighter's archetype and the characters sub race are not specified so there's room to work.
Knight(DMG)

You gain the service of a 4th-level fighter who appears in a space you
  choose within 30 feet of you. The fighter is of the same race as you
  and serves you loyally until death, believing the fates have drawn him
  or her to you.  You control this character.

DMG p. 5

The rules don't account for every possible situation that might arise
  during a typical D&D session. {snip} Part 3 of this book offers a
  wealth of information to help you adjudicate the rules in a wide
  variety of situations.

Simple Approach
Offer the player the standard array, and have the player create the character with the simple template/example the PHB offers.  Offer the standard equipment, etc.  Have the 4th Level ASI be the default.  Pick a fighting style: as there is no restriction, there is no reason that this fighter can't be a Battle Master, or Eldritch Knight, etc.
You can pick one, or let the player pick one.  It doesn't matter.
From the DM perspective, the more of this you can delegate to the player, the less work for you and the more the player takes an interest in this Character rather than "this piece of cannon fodder."
But why stop there?

Maybe this fighter took a feat at 4th level. (If you allow feats in
your game, why not?)
What is this fighter's name?
Does this fighter even come from this world, or was this fighter
transported into your campaign world from a different one?  (Some
Lin Carter(Green Star), Edgar Rice Burroughs(Barsoom), Robert E Howard(Almuric), and John Norman(Gor) novels use that as a trope: someone from earth transported to a different world).

The permutations and variations are nearly boundless.  How much detail are you and your player interested in?
The player can come up with a back story that fits with a background, etc, or you can offer a tie-in to some other area of your world/setting that connects this 4th level fighter to someone, somewhere, something, some organization, or from off-world as suggested above.  This offers the chance for some rich role play in the future of the campaign, but remember that the player controls this Fighter, which suggests that you can heal this fighter, roll death saving throws, etcetera.   Treating the Fighter as an NPC seems to dilute the card and just adds work for you.
Don't stop play for the other players
The character creation on the spot (impromptu) simply provides a fighter, but you have other players.  Keep the play moving for them unless you judge that this is a good time for a break.  (Then take a break and have the player do a quick build).
Make a ruling and then play on!

There are some pregen characters, levels 1-10, at the WoTC web site, but it may not fit the character's race.  While there are only two Fighter's listed, you could choose to stretch it to "any martial" and choose; Human Fighter, Barbarian, Paladin; Wood Elf Ranger; High Elf Fighter; Half Orc Paladin; Halfling Rogue or Monk;
While that saves you a roll up, it doesn't allow for the kind of customization I recommend in the body of the answer.  Since the player is playing this character, why not let the Player get the joy of creation?  I'd recommend that.
Depending upon time, you could instead have the player roll up stats rather than standard array, or use point buy.  Just make sure the game does not come to all stop when this new character arrives.
Answer: RAW text:

Knight: You gain the service of a 4th-level fighter who appears in a space you choose within 30 feet of you. The fighter is of the same race as you and serves you loyally until death, believing the fates have drawn him or her to you. You control this character.

There is not a lot to go on here, except the loyalty part and the race part.
Therefore, this is left up to the GM by RAW.
As a GM (and therefore purely subjectively, YMMV)... I would set the race and subrace to the same as yours, though I would rule that the NPC was not a character you knew, was related to, or had any way of "background-checking" so to speak. They aren't from your home town or related to anyone you have immediate knowledge of. There's not even any RAW guarantee they're from the same world, though they'd be from the same (material) plane, obviously. (I would at least entertain the idea of an off-worlder, but would make sure they spoke Common or whatever the party's primary language was. I'm not an evil GM. No really.)
As for stats, I'd have the GM create the character, using the same rules the PCs used (same dice method, etc.) It wouldn't be a purely random character, so you wouldn't wind up with a fighter who has a high Wis and a low Str for example. And I'd probably work to make sure the PC at least sort of helped fill a niche in the group -- if the group has no ranged combat fighters, then this NPC would probably be focused more on archery than swords, for example.
The rules do not say and you didn't ask. But I would also, as GM, equip the NPC suitably. It would have minimal equipment, but wouldn't show up without arms and armor at least. But he or she probably wouldn't be as well equipped as the party, since she didn't have time to go to the market before being pulled forcibly "by the fates" to help you out.
But this is all subjective ruling and your GM/you may want to do this differently. There are many ways to make this either comedic and/or less helpful for the party (pure random 3d6, no re-arranging stats dice method for example, or showing up wet and naked with a bath sponge in hand and a look of shock. Or...) but as a GM I wouldn't do that, since doing so violates what I see as the spirit/intent of the card's text -- to provide a purely loyal, trustworthy fighter to aid the group.
...though that raises the question: would the PC know how loyal the NPC really was? I suspect not...
Comment: Well, in this specific case, the PC is a wizard with a military rank and essentially an elven war hero. So the card, when it came up, gave him a fanboy history buff fighter, with details to hash out later.


Can migration from MS Access to SQL Server or ... make database faster?

Question: A company asked me to migrate their database from MS Access to SQL Server or MySQL because they think that on those engines their database will run faster. But I wonder if their problem isn't because of their database design rather than MS Access.
I think that their database is smaller than 1GB large and it will remain always smaller than 10GB. Let me be pessimist 100GB! I'm afraid that the migration doesn't accelerate their query execution time and they would remain unsatisfied. I'd like to know if their slow interaction could be because of Access or I should  contact consult them to continue working with access and just change the designs, optimize network and the programs?
In which case should I think migrations towards non relational databases like MongoDB?
Comment: Well, if the **design sucks**, then going to MongoDB won't solve the problem either.....
Answer: We can't really answer whether you should consider other platforms such as mongodb - we know nothing about the application or its data and whether such a platform would be appropriate.
I can tell you that SQL Server has a lot more features geared toward performance and tuning than Access will ever have. Access is pretty simplistic and, while it can function as a multi-user database, it is not a true RDBMS and really is meant for the desktop space.
Whether those features in SQL Server will make your company's specific application any faster, again, shrug, we just don't know.
Answer: Once you have migrated to SQL Server it becomes easier to improve the database performance. For instance you can start to use SQL Profiler to identify which queries are running slowly. Knowing these queries you can then review the SQL Execution plan. This will also suggest indexes that will improve performance.
You could try and performance tune an access database it is much easier in sql server and therefore worth upgrading.
Answer: Access and SQL Server differ in a fundamental way. In Access all processing of the data is done by the client(s), while in SQL Server all processing (before delivering the query result) is done by the central server process.
That has several performance implications. In Access the client must transfer over the network all the data that is needed to produce the query result. Also, you don't have exclusive access to the data file on the network drive which limits the caching options on the client (it cannot easily know if the data has been modified in the meantime).
SQL Server takes exclusive access to it's (local or semi-local) datafiles and thus can cache both reads and (partially) writes, it can optimize it's file access by removing as much random access as possible and it needs only to transfer the query result over the network to the client, which is often much smaller than the data needed to produce it, especially when using aggregates like SUM or COUNT.
On the other hand, while SQL Server can and does optimize effectively, it has do all the heavy lifting of multiple user access within the physical constraints of the server processor(s) and memory, while Access 'only' needs to synchronize the physical data access and offloads all calculation work onto the client machine.
So, as others wrote here, if you will see performance gains or not depends on the OS and network protocol to access the Acess-DB-File(s), the stats of the SQL Server you would put in place, the number and activity of the users and the nature of the queries they perform. Maybe you have enough information to make an educated guess based on this information.
Answer: Like Aaron said, we don't know anything about the application or data (or number of users, or the hardware running the database, or...).  I will say that in my experience, SQL Server is much faster and more robust than Access for things like web applications.  Whether that means your application will run faster, well.  Not enough information.


How to use Apex Schedule Job UI in custom lightning component without customization

Question: We would like to create a lightning component to display the Apex Schedule Job UI(Customized), could anyone please let me know if there is any option to display Apex Schedule Job UI without customizing.
Answer: I don't know of any direct/standard solutions.
https://crmcog-dev-ed.lightning.force.com/packagingSetupUI/ipLanding.app?apvId=04tE0000000ISIu - was being discussed sometime ago. I am not sure whether it is actively maintained (you can try that!).
Welkin suite could do scheduling as well, but it is too expensive to buy for just scheduling jobs!


PHP / JS image creation

Question: I'm wondering if this is possible: user uploads a picture which is then presented to him in the browser. The image is placed inside a div that has predefined image as background. User can drag and drop his uploaded image inside the boundaries of this div.
It would be something along the lines of uploading a pic of yourself and then positioning it against a background of a tropical beach. User then clicks ok and has the option to download the image.
I have the upload and JS drag & drop covered. I'm just wondering: is it the possible to create a new image on the server that exists of the back - and foreground image? So basically an image would have to be created from the contents of the specified DIV.
Answer: Yes it is possible using the functions of GD, you may also want to check out imageMagick
Comment: Any idea which GD functions can help me do this?

PHP / JS image creation


Is there a name for the square of a function plus the square of its Hilbert transform?

Question: Given a real-valued analytic function $f$ defined on the whole real line, and its Hilbert transform ${\cal H}f$, it seems that the quantity $f(x)^2+{\cal H}f(x)^2$ should have some kind of importance as an energy measure. It is the square of the complex modulus of the analytic extension of $f$ to the complex plane: $f(x)+i{\cal H}f(x)$. What are keywords (or textbooks, or even academic papers) that focus on this quantity?
Answer: Engineers often call real valued functions "signals". Denoting Hilbert transform $\mathcal H\{\cdot\}$, there exists a concept called Analytic signal denoted $\mathcal A\{\cdot\}$, where for a real valued signal $f(x)$:
$$\mathcal{A}\{f\}(x) = f(x) + i\mathcal{H}\{f\}(x)$$
Then, since $|a+ib|^2=a^2+b^2$ for any pair of reals $a,b$ we can see that $$|\mathcal A\{f\}(x)|^2=f(x)^2+(\mathcal{H}\{f\}(x))^2$$
As you suspect it is a kind of energy measure. In electrical engineering and signal processing the complex absolute value above is often called envelope of a signal. And if we square it (which is just application of a monotonic growing nonlinear function) we get the function you investigated.
Comment: Thank you. I think this is what I was looking for. So I could call it "the square of the envelope of the analytical representation of the function $f$"? It is a bit of a mouthful but I guess that's the best we've got.
Comment: I'm afraid I don't know any shorter name for it, but maybe there exists some shorter name. Actually for engineers "analytic signal" would be better. Mathematicians may confuse it with "complex analytical" which is another concept involving Cauchy-Riemann equations https://en.wikipedia.org/wiki/Cauchy%E2%80%93Riemann_equations.


Why does the term "discrete" usually appear near the term "digital?"

Question: Are these terms just parallel words? If not, why is it that when one reads about the first then one is very likely to come across the second?  In such case, what would be a nice example to explain the possible connection between the words?
Answer: The word discrete is used to define a signal that is not continuous, but is composed of a sequence of values.
The word digital is used to define a discrete signal whose values have been quantized and can be stored... digitally.
You can have a discrete signal that is not digital, for example the signal $x = {\{1.002, \pi, 10.333\}}$ is a discrete signal that is not digital because $\pi$ is an irrational number that cannot be exactly represented in binary.
There is a subtle difference that is argued about by some people, but for almost any situation, the terms digital and discrete can be used synonymously when talking about signals.
Answer: There is continuous time, and discrete time. With a continuous time signal, between any two points in time you can find signal, which may be different than either of the two points. With discrete time, there are values between certain points in time, and nothing between adjacent values. "Digital" is simply an additional quality. It's a convenient way to store individual values, so it's almost solely associated with discrete time.
"Samples" implies discrete time. But you can sample in the analog domain and stay there. For instance, there are analog delay lines using a "Bucket Brigade Device" (BBD) or "Charge Coupled Device" (CCD), where voltage values are held for a time—similar to holding a charge on a capacitor. But it's difficult to store those values permanently, and they tend to degrade quickly. So, it's simply easier to change each value to a digital value. Not only is there no degradation, and storage becomes relatively easy, but it's easier to do complex calculations without building increasingly complex analog hardware to do it. And once converted to digital values, we can exercise arbitrary precision, and there is no concern for environmental electrical noise.
Comment: I barely have any knowledge in SP but I recon from your answer that every digital signal is necessarily a discrete signal but any discrete signal is not necessarily a digital signal.
Comment: One could design a suitably perverse digital system that had continuous-time digital values (it would involve grey code, and probably glitches).  But it's the kind of thing you'd do to win a silly bet, not something you'd do to actually apply to a real-world problem.
Answer: Theoretically, it is easy to analyze a discrete signal only in variable.
A digital signal is discrete in both variable and value, which is the case in practical digital processing systems, such as DSP/CPU/FPGA etc.


Interpreting Georgia property tax digest record from 1850?

Question: What does "g for Jane Burnett of color" mean other than her being a woman of color in the tax digest?
Comment: Welcome to G&FH SE!  Thank you for having the [Tour] to learn about our focussed Q&A format.  It is very useful to also include a link direct to the inline image but many of our users will not have a subscription that enables them to view it.  If you had included a picture cropped from that image that focuses on just the part you are asking about I think your question will be more likely to attract a potential answerer.  You can still do that using the [edit] and then Picture buttons.
Comment: The link to the database's own page, with the About the Database information (which anyone using an Ancestry database should read) is https://search.ancestry.com/search/db.aspx?dbid=1729
Comment: Could you give more information from the Ancestry Record page to make it more clear which line of the image people should look at? I also agree with @PolyGeo that a cropped smaller image including the relevant entry would be more helpful than sending people offsite. A note about the location would also help, in case our community members know about research guides produced by local public libraries or societies.
Comment: @PolyGeo I can confirm that if you don't have a subscription, you can't see the linked image.
Answer: I believe it means that Augustus Hinton was Agent of Rebecca Flinn (white) and Guardian for Jane Burnett a free person of color. Check the laws in effect at that time and place because people of color may have needed a court-appointed person to act on their behalf. In this case, paying taxes on Rebecca's land as her agent and (perhaps) a poll tax for Jane.


How to test unit root in a timeseries with unknown structural change?

Question: Is there a unit root test that works with structural change? I only found Zivot-Andrew test but I would try another test, I do not know if the timeseries has a structural change, so I need a test that works with A break at unknown time.
Comment: I don't know of any literature talking about this issue, but have you thought about first identifying the location of the structural break, say at time $i$, then "difference" it out of all periods $j > t+i$, and then run your unit root tests? This would be somewhat analogous to adjusting for seasonality before employing further diagnostics.
Answer: Zivot Andrews tests the alternative of a one time structural break against a null of a unit root process. Variations in the ZA paper test for a change in the intercept, in the trend, or in the intercept and the trend.
ZA endogenously selects the break point based on the point in time that gives the most weight to the alternative (ie that is most against the unit root null).
It is the prominent (only?) test in the literature for an endogenously determined structural break against a unit root null.
The approach has been extended to 2 breaks (both in the intercept, both in the trend, or one of each) (Lumsdaine, R. L., & Papell, D. H. (1997). Multiple trend breaks and the unit-root hypothesis. Review of Economics and Statistics, 79(2), 212-218.
Last time I looked at the R programs available addressing unit root testing they did not address serial correlation in the way that the original papers did.
Your addendum says you want to check if the series is constant without changes. That is different from saying you want to test for a structural break against a unit root null, as a unit root process need not have an expected value that is constant. There are other tests for structural breaks that do not have a unit root process as the null hypothesis if that is what you are really after.
Comment: what tests are you referring to?


Search in Dolphin returns 'invalid protocol'

Question: I set up a new ubuntu 17.10 and installed dolphin from Ubuntu software. When I do a search ('find'), after typing a few characters a message shows up 'invalid protocol'.
Any packages missing to be installed?
Comment: I had this problem with KDE on 16.04. `Dolphin` needs the `Baloo` indexing package in order to do searches. Indexing can be turned off, but the package needs to be installed.
Comment: Baloo is installed. Must be some other reason.
Comment: I started Dolphin in terminal. Then performed a search which resulted in 'invalid protocol'. Here is the output of the terminal: Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/128/"
Trying to convert empty KLocalizedString to QString.
qt.accessibility.core: Cannot create accessible child interface for object:  PlacesView(0x5587b72b7330)  index:  23
kf5.kio.core: couldn't create slave: "klauncher said: Unknown protocol 'filenamesearch'.\n"
Answer: You could try the instructions here:
https://www.ryananddebi.com/2015/07/13/linux-getting-find-working-in-dolphin-on-kde-linux-mint-and-kubuntu/
In short install  kde-baseapps, systemsettings and kfind. And DISABLE "Enable Desktop Search" in Systemsettings -> Desktop Search. It should work then. It did for me. Pretty counterintuitive but it works ;).


Convert Lead to a Contact for an Account not owned by user

Question: I am trying to design a method to allow sales people to convert leads to accounts not owned by them.  The current settings for their profile only allows them to edit their own accounts.  I cannot find any settings for Leads that will allow visibility of other reps accounts.  I was thinking of changing the base security and then creating a validation rule to block other changes if the owner is not the user.  We are getting too many duplicate accounts with this setup. Has anyone else tried to do this?  Any ideas would be appreciated.
Answer: If opening up permissions doesn't cause other issues (i.e. allows the users to view accounts they shouldn't) this is a great approach.
I've done something similar to restrict the ability to delete a record to just those owned by the current user.

Give everyone delete perms
Add a beforeDelete trigger
Check if the record's ownerid matches the current user
If yes, do nothing
If no, thrown an exception

I'm sure there are other snags you'll run into in implementing the approach, lead conversion is generally kind of idiosyncratic, but the general approach of opening up permissions at the profile level, and then restricting them at another (i.e. trigger or validation rule) is sound.
Comment: Thanks for the reply.  I was hoping someone out there might know of a "little known" configuration in the system that would allow non owners to convert a lead into a contact on an existing account.  Guess I will need to take the hard way.


UITextView Scrolling - Artificial Limit

Question: I have a UITextView with a height of let's say 300.  What I would like is when the typed text gets to the half way point, for the scrolling to start as if it were at the bottom of the textView.  Basically I would like to programmatically set the point within the textView for scrolling to begin.  Any ideas?  Thanks.
Answer: Do you want to do this because the keyboard is causing the text to be hidden behind it? If so just size the textview smaller when the keyboard is raised (possibly animated so that it shrinks as the keyboard grows) then let the system take care of scrolling.
If you are trying to make the text scroll in a different way to the default maybe you should reconsider, it will look a bit strange to people who are used to it scrolling when it reaches the "normal" level.
However if you must do it maybe you could use a UIImageView added as a subview after the UITextView is raised - consider it as an inactive extension of the UITextView. Make an image of the same width as the UITextView, make it the right height for your requirements and position it so that it covers the lower edge of the UITextView. It will look like the textview is longer than it is but the textview's scrolling will work when text nears its actual border, not your fake one.
I can't see anything in UITextView/UIScrollView/UIScrollViewDelegate to do this.
Comment: Thank, Adam.  Response was too large for a comment.  Please see "answer" below.  Thanks.
Comment: The "fake" tableView section insert/delete within a begin/update block works very nicely, allowing the row height to be updated to fit with and without the keyboard being present.  Thanks for giving me the opportunity to get my thoughts down and better think through my options.
Answer: Thanks, Adam.  I am indeed doing this because the keyboard is causing text to be hidden behind and I'll get to that in a sec.
What you suggest with respect to the UIImageView is exactly what I was planning but in reverse.  I wanted the 300 height textView, with the lower portion covered by the keyboard to then have a UIImageView sliver just above the keyboard of the rounded bottom portion of the grouped tableView that the textView is in. (The textView is in a tableViewCell in a single section/single cell tableView.) Adding the sliver of an image would make the larger textView, covered by the keyboard look like a small textView when the keyboard is present, and when dismissed and image removed/restored, textView would be larger, to allow the user to read all of the notes they've entered.
With the solution that I was looking for, scrolling to stop anywhere within the textView, the smaller textView would start scrolling at the correct place, just above the sliver image which is just above the keyboard.
Now to the "just size the textView" suggestion.  Easier said than done.  Because the textView is in a grouped tableView, with keyboard present, I created a smaller textView in a tableViewCell with nicely rounded corners, but when I size the textView larger, only the center portion extends (about 90% of the rounded rectangle in the center), not the rounded corners on the sides (5% of the width on each side remains the same).  Next thought: Can't extend the textView without increasing the height of the cell so...
...the solution is therefore to resize the cell; but that involves a reloadData or begin/end updates which only work with a cell or section insert.   I was then thinking of just adding a new section so the reloadData would work, but then I'd have to turn off scrolling on the scrollView so the new section would never be seen and I'm having trouble with that despite trying every permutation of scrollEnabled=NO (on tableView, textView, scrollView, parent).
And finally, shifting the entire screen upward works beautifully but with a large textView, I'd then have to prevent typing in the non-visible upper portion when scrolled upward, so that was rejected.  Although it just occurred to me that with the CGRect's size.height equally reduced, typing may not occur in the non-visible portion - but I still lose the rounded top of the grouped tableView so cosmetically it could look better - still rejected.
So, that's my story and that's been my day.  Any help from anyone would be greatly appreciated.
I think my best bet is adding the "fake" section to the tableView and setting it to hidden, so I can get the new cell height to kick in. but I still have to turn off tableView scrolling or scrollView scrolling so a scroll in the textView doesn't unnecessarily move the entire screen since the space for the hidden section would probably be there and therefore scrollable.

UITextView Scrolling - Artificial Limit


How Do Copied Serial Numbers Work?

Question: I've seen some serial numbers that have been disclosed on the net and can be used to activate any number of copies of software. How is that possible? Doesn't the software provider check the serial numbers against their database, so that every code can be used limited number of times?
Comment: It's unclear what your question is. You already state the answer in your question: no, they don't, otherwise that wouldn't work.
Comment: No. Because having software that requires activation by calling back to the manufacturer is a pain, so a lot of people actively avoid such software wherever possible. Therefore, most manufacturers don't use such active tracking of serial number usage.
Answer: You're assuming that all computers are connected to the Internet.  If a computer is stand-alone, or on a private network, it will have no access to the software provider.  All it can do is check that the serial number appears valid, based on some secret internal algorithm.  If that's the case, the same serial number will work any number of times.
Answer: I can think of at least three "unlock code" scenarios used by software I have purchased.

Simple/Offline.  You are issued an unlock code that is fully portable and there are no online checks.  The unblock code can be validated offline; for example. if may have certain bytes that are a checksum on the remaining bytes.  This offers only the barest of speedbumps to a pirate. but it does allow the publisher to figure out who gave away their unlock code and pursue legal action.  Piracy, of course, is a felony, and using someone else's unlock code in a crime. This technique is used by Beyond Compare.
Challenge/Response/Offline.  You install the software first, and use it to generate a "challenge" based on a fingerprint of your hardware (CPU serial number, MAC address, sometimes even hard drive serial number).  The publisher will issue an unlock code that will only work on computers with the same fingerprint. This technique is used by ImageLine.
Online.  You are issued a serial number.  When you sign on, the system checks to see if your serial number is already active on the network, and shuts you down if it is.  First person shooter/deathmatch style games often use this technique.

Sounds like in your case the first type is used, so there is no online check and you can copy and steal unlock codes as much as you want, although by doing so you are committing a crime.

How Do Copied Serial Numbers Work?


Difference between molecular dynamics and direct simulation Monte Carlo

Question: I just started studying about rarefied gases and I came across the concepts of Molecular Dynamics (MD) and Direct Simulation Monte Carlo (DSMC). My question is: How are these two fields related to each other? Is MD the physical theory and DSMC just a mathematical method to study molecular dynamics?
Comment: did you mean Monte Carlo instead of DSMC?
Comment: no! DSMC stands for direct simulation monte carlo, which is a mathematical approach for gas dynamic problems
Comment: can't help than :( sorry.
Answer: The difference can be described as follow:
In MD (basic theory), algorithm solve equations of motion in deterministic way. You can have collision, but all of them contribute in state of system.
In DSMC, all part same as MD but instead of equation of motion a random collision sampling (randomly collide with particles in specific range). This part implicit relate this algorithm to Monte Carlo algorithm. You can see the this link for complete description of difference.
MD is more fundamental than DSMC, because we enter randomness directly into algorithm. Of course, there are some doubt about if we can directly can find statistical properties from MD (see FPU paradox) without direct entrance of randomness or noise.
Answer: I am afraid I am not an expert on Discrete Simulation Monte Carlo, but I am familier with other collision based simulation techniques for fluids.
Molecular Dynamics has potentials defining the forces between particles. Newton's equations of motion are then used to update the particles' positions and velocities. The algorithm can be summarized as:
1) Calculate forces using physical potentials like Lennard-Jones and electrostatics
2) Update velocities using $$(v(t+\Delta t)=F(t)/m+v(t)$$
3) Update positions using $$(x(t+\Delta t)=v(t) \Delta t+x(t)$$
In contrast Discrete Simulation Monte Carlo has this algorithm.
1) Update velocities based on a collision related to kinetic gas theory.
2) Update positions using $$(x(t+\Delta t)=v(t) \Delta t+x(t)$$
So the only real difference is the collision based on kinetic gas theory. The first step of calculating the collision is to divide the simulation box into small boxes. Any particles which are in the same smaller box "collide" with each other. I am not familiar with the collision operators used in Discrete Simulation Monte Carlo, but based on other "collision" algorithms I've studied a simple example would be that all particles simply take the average velocity of the particles in the box. This would probably work to a degree, but probably violates the Fluctuation-Dissipation theorem and has other undesirable properties. Thus is practice the "collisions" are usually more complicated. The one thing they pretty much all have in common is that they conserve momentum (the total momentum of all the particles in the sub-box is the same before and after the collision). In fact, in the first Multi-Particle Collision Dynamics simulations made no effort to either have physical meaning nor obey the Fluctuation-Dissipation theorem. I assume the same is true of Discrete Simulation Monte Carlo, and the reason why the word "phenomelogical" appears in the Wikipedia article.


What is the probability that a parameter is greater than other parameters given we know the posterior distribution

Question: Suppose that we have have some form of compositional data $x_i, i\in[1, n]$ which we propose comes from a Dirichlet distribution such that
$$ x_i \sim \mbox{Dir}(\lambda \alpha),$$ where $x_i=(x_1^{(i)}, x_2^{(i)}, x_3^{(i)})$, $\lambda>0$, and that $\alpha=(\alpha_1, \alpha_2, \alpha_3)$ such that $\sum_{i=1}^3\alpha_i=1$.
Due to the constraint on $\alpha$, we do not have an identifiability between $\alpha$ and $\lambda$. Therefore using MCMC we can get posterior distribution for all parameters involved. My question is, given the posterior distributions that we have for $\alpha_1, \alpha_2, \alpha_3$, how can we determine the probability that say $\alpha_1$ is greater than $\alpha_2$ and $\alpha_3$?
Answer: Given that you would be using MCMC  sampling, you can simply calculate the probabilities from the samples. If you draw $n$ MCMC samples from the posterior distribution of $\alpha$, than the alpha matrix would be $n \times 3$, so you can calculate the probability by counting such cases and dividing by total (i.e. taking mean of booleans). In R, this translates to:
mean(alpha[1,] > alpha[2,] & alpha[1,] > alpha[3,])