Gas Smell from Fire Place Key Valve

Question: When I turn the key to open gas valve to light my gas fireplace I can constantly smell gas coming from the key hole. Is that normal? When I shut the valve off with the key I can no longer smell gas.
Comment: Hello, and welcome to Home Improvement. Gas smells are **serious** problems: turn the fireplace off and leave it off!!! Then, some more details (and a picture or two) would help us help you.
Answer: You certainly have a leaking gas valve.  Your symptoms of it leaking only when open are pretty common.
A while back, you could open up the valve and repack it; but, due to this kind of fix being temporary at best, your gas company and insurance company will demand the valve be replaced.  So, ignore any advice to repack the valve.
This means it's not a DYI job, as you'll need proof the work was done by a licensed professional, in the event someone asks.  Hire a professional, and keep the valve shut until you do.
They will shut off gas to the house, bleed the line free of pressure (gas) and then remove and replace the valve.  The real problems that come from such a repair come due to the pipes possibly being seized due to the mortar, or more likely corroded due to moisture (common in such lines).  In those scenarios, the details of your exact layout will determine how much pipe might need to be replaced, and how easy it may be to replace the pipe.
If a plumber just gives you a new valve, you're lucky.  If they find your pipes are nearly rusted through and you need to replace them, you might feel unlucky, but really you are still lucky.  You're just lucky with a bigger bill, but a much smaller bill than if you were looking at rebuilding due to a fire.
Answer: Smelling gas constantly is not good, it's dangerous. You need to keep the valve off until you find out why it's leaking. Remove the key plate or valve access panel and check the load connections for tightness since you only smell gas when the valve's open. If they are tight, then call the gas company and have them check everything. In many cases they will do it for free.

Gas Smell from Fire Place Key Valve


Control variables- Difference in Difference

Question: I am carrying out a difference in difference estimation. Regarding control variables addition I am kinda confused. Am I to add control variables which affect the dependent variable or control variables which affect the dependent variable but would not affect the policy effect on the dependent variable.
Answer: There are two reasons for including covariates in a difference in differences regression:

for identification of the treatment effect;
to reduce the error variance (i.e. increase power of statistical tests).

Suppose you want to know the effect of a job market program on employment in a city where this program was randomly assigned to unemployed individuals. You regress
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \epsilon_{igt},$$
where $Y$ is the outcome (0 = unemployed, 1 = employed), $J$ is the dummy which equals one for the treated in the treatment period, $i$, indexes individuals, $g$ indexes groups (1 = treatment group, 0 = control group), $t$ indexes time periods (1 = post-treatment, 0 = pre-treatment), $\gamma$ and $\lambda$ are group and period fixed effects, and $\epsilon$ is a stochastic error term.
This is equivalent to the regression
$$Y_{igt} = \alpha + \beta_1 \text{treat}_i + \beta_2 \text{post}_t + \beta_3 \text{(treat$\cdot$ post)}_{it} + \epsilon_{it},$$
where you indicate treatment and control group, and the pre- and post-treatment periods with two dummies that are then interacted. This is probably the difference in difference regression you have seen in a textbook or class notes.
Suppose in the two periods the GDP in our city increases. Then the outcome is affected by another time-varying factor which has nothing to do with the job market program but it occurs at the same time. This violates the common trend assumption. In order to not overstate $\beta$ in the first regression, you would want to include GDP as a control in the regression which separates out this additional effect on the outcome which is not due to the job market program. This is the case of including a covariate for identification when you regress
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \delta \text{GDP}_t + \epsilon_{igt}.$$
Only information at the group level (treatment-control) is required for identification of your treatment effect. If you have additional information on your individuals, for instance their age, you can include this in the regression as well, as follows:
$$Y_{igt} = \gamma_g + \lambda_t + \beta J_{gt} + \delta \text{GDP}_t + \theta \text{age}_{igt} + \epsilon_{igt}.$$
The within-group variation in age does not matter for identification (for a detailed explanation see the notes here) but they can help to reduce the error variance of the regression. In this case your statistical tests will have more power and it will be easier to determine whether $\beta$ has a significant effect or not.
Comment: Alrite. I think I understand the write up. Though I am using repeated cross sections and not panel data. One region received the treatment and the other did not. So I defined treat=1 fot the region received the treatment and treat=0 for the region that did not, meaning that in the pre-treatment period the region that received treatment had 1 and the other region had 0. I defined post=1 if in post treatment period and post=0 if in pretreatment period.
Comment: From the question I could only guess what you want to do, so I provided an own example with the job training program. Difference in differences may rely on too strong assumptions when you use repeated cross sections rather than panel data (see [here](http://stats.stackexchange.com/questions/80287/data-setup-for-differences-in-differences/80290#80290)). Otherwise I hope the answer explained the different uses of control variables in this method.
Comment: Actually my reply got posted by mistake before completing my comment. What Im jst confused abt is that usually without performing a diff-in-diff analysis, there are variables that determine the dependent variables. I was wonderin if I shld include them along side treat, post and interaction.
Comment: If they vary over time, then you should include such variables. Otherwise the diff in diff interaction coefficient will wrongfully pick up the effect of these variables because they also change at the same time as the intervention.
Comment: While the previous reply was excellent, I think it needs to be highlighted that time-varying covariates are highly problematic as they are likely to be bad controls.


SQL Best Practices

Question: Is it good to check that some fields are blank or not from a table and return true or false from a sp Or is it good to fetch the values and check in the code.
Answer: It is generally better design to have a specific business layer, which validates fields.  In an n-Tier architecture for example, the Business Layer would validate and return an error if required fields are missing.  This means the data layer expects valid data coming from the business layer.
All the data layer has to worry about is manipulating/retrieving data effectively and efficiently.
Answer: In addition, adding constraints to the table will protect you in the event your BLL lets invalid data through.  Although it adds to the complexity in maintaining and extending the application, the pain endured when rubbish does get into your production DB is far greater.
It's a bit of a judgement call based on your available skills sets and development practices for your company/product/project.
Comment: Totally agree Matt, especially in an enterprise environment as developers turn over who knows which applications are plugged into the DB and passing invalid data.

SQL Best Practices


CleanMgr can nolonger be installed on server 2012 R2

Question: Just tried to get cleanmgr installed and working on a fresh 2012 R2 install.  Copies CleanMgr.exe & CleanMgr.exe.mui across like done before but when it is run get error:
The Program or feature \?system32\cleanmgr.exe cannot start or run due to incompatibility with 64-bit version of windows
Answer: You need to enable Disk Cleanup by installing theDesktop Experience feature (see Enabling Disk Cleanup Utility in Windows Server 2012). The command line interface should still be available via the C:\Windows\CleanMgr.exe executable.
I got back to my lab and tried grabbing CleanMgr.exe and CleanMgr.exe.mui from the x86 and WOW64 bit updates thinking that might fix the compatibility issue:
Copy-Item -Path C:\Windows\WinSxS\x86_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.3.9600.16384_en-us_f2763474b4405afa\cleanmgr.exe.mui -Destination C:\Windows\System32\en-US
Copy-Item -Path C:\Windows\WinSxS\wow64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.16384_none_685740be65e399a2\cleanmgr.exe -Destination C:\Windows\System32

And the results...

Ah. The march of progress. I see two options. You can get ProcMon running and try to track down all the various DLLs in the WOW64 subsystem (maybe by doing a Desktop Experience install on a throwaway server), you can try this method to remove the windows.old directories if that's what is ailing you or you can follow Microsoft's officially supported albeit misguided recommendations and install it from the Desktop-Experience Windows Feature.
Comment: Yes but rather than installing the whole ridiculous Desktop Experience on a server it used to be possible to get cleanMgr working by copying the following files:

copy \\HskServer\C$\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.16384_none_5e02966c3182d7a7\cleanmgr.exe %SystemRoot%\System32\*.*

copy \\HskServer\C$\Windows\WinSxS\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.3.9600.16384_en-us_4e94cff86c9dcc30\cleanmgr.exe.mui %SystemRoot%\System32\en-US\*.*
Comment: @NickC - Yep. That looks like the only way to do it on 2012 R2.
Comment: They placed quite *too many* things in the Desktop Experience feature; you need to install it even to be able to have *THE SYSTEM ICONS ON YOUR DESKTOP*...
Answer: I had the same problem as Keith described for W2K12 R2 SP1 server.
My solution for this problem:

Install the desktop experience feature.
Then you can see in SystemRoot\System32\en-US\cleanmgr.exe.mui and in SystemRoot\System32\cleanmgr.exe the new "cleanmgr" files, which are bigger as the files in the Winsxs folder
Copy these files to another folder e.g. C:\
Remove desktop experience feature, this will delete the cleanmgr files from system32!
Copy the cleanmgr files from your folder(step3) to the known system32 locations (step2)
Now you can run cleanmgr.exe

I use this procedure for making vmware template machines, so i did this once and all other future w2k12r2 server will have the cleanmgr files already installed
Comment: The files you mention are not present after adding the "Desktop Experience" feature to Windows Server 2012 R2.
Answer: Copying directly from the c:\windows\WinSxS directory, although once supported, now no longer works as-is. This appears to be a change within Windows Server 2012 R2 Update 1
a quick view of the cleanmgr.exe binary in a hex editor reveals that the C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.17031_none_5e3588b0315d2219\cleanmgr.exe file is no longer begins with the required magic header "MZ...", instead it starts with "DCN..." and the file is much smaller than the expanded version. This is why we are getting the "unsupported..." dialog box above.
This appears to a direct result of KB 2821985 improvement #2 -
Adds a feature that compresses unused binary files and allocates free disk space to prepare Windows
for future updates.
Still trying to figure out how to extract/uncompress the files programmatically. :^(
Comment: That's "Delta Compression" - http://blogs.technet.com/b/askcore/archive/2014/03/27/what-s-new-in-windows-servicing-reduction-of-windows-footprint-part-2.aspx SxSExpand tool is able to decompress - http://forums.mydigitallife.info/threads/48613-Aunty-Mel-s-Cheap-And-Nasty-SxS-File-Expander-%28Updated-2013-09-29%29 I've just used it to decompress cleanmgr.exe and .mui on Server 2012 R2 Update1.
Answer: Copy-Item "C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.3.9600.16384_en-us_4e94cff86c9dcc30\cleanmgr.exe.mui" -Destination "$env:SystemRoot\System32\en-US\cleanmgr.exe.mui" -Force
Copy-Item "C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.3.9600.16384_none_5e02966c3182d7a7\cleanmgr.exe" -Destination "$env:SystemRoot\System32\cleanmgr.exe" -Force

I believe this is what you're looking for.
Comment by Nick was close to this, but this is a bit cleaner and uses $env rather than %env% variables (powershell likes $env better)
Comment: this no longer works
Answer: Someone has kindly provided a zip file containing the required files which unlike the steps above (not including installing the "desktop experience rubbish) actually works on Windows Server 2012 R2 64-bit.
You can read more from the author's page and get the download links yourself. It is a zip file that you expand onto your System drive and it puts the files where needed. There is also a link for the Windows 2008 version.
Quite why we have to go to such measures for such a simple thing as cleaning up the hard disk is a mystery to me.
UPDATE: I have opened a Windows Server user voice request here - if you think having disk clean-up installed is useful, please vote for it.
Comment: Anyway besides downloading the files from the author's page
and installing them properly, the code to add the button to the properties page of the drive is this Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\cleanuppath] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,63,00,6c,00,\ 65,00,61,00,6e,00,6d,00,67,00,72,00,2e,00,65,00,78,00,65,00,20,00,2f,00,44,\ 00,20,00,25,00,63,00,00,00 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Micro
Comment: @RNR1995 Welcome to Server Fault! To critique or request clarification from an author, please leave a **comment** below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://serverfault.com/help/whats-reputation) you will be able to [comment on any post](http://serverfault.com/help/privileges/comment). (comments are limited in length so I can't convert your answer properly either).
Answer: You can copy the Cleanmgr.exe and Cleanmgr.exe.mui from an updated Windows 8 to the server.


How does the performance of a warped pan compare to a level one when using gas?

Question: Of course there will be hot spots when using it on anything besides gas because it won't sit flat.  But are there any performance disadvantages when using a slightly warped pan and gas? As far as I can tell even a brand new pan will still pool oil depending on how level your stove / floor is.
Answer: A slightly warped pan will perform the same as a flat pan on gas from an efficiency perspective, the shape isn't going to waste energy. As for whether the warp will impact your cooking experience it's hard to say, a warp can cause coatings to flake off, or make liquids pool in or run away from particular spots.


Why do Timelords always ignore the Master? (Classical Doctor Who)

Question: The Doctor is a rogue Timelord and other Timelords have made his life miserable for several seasons in spite of him being "good". On the other hand with the evil and megalomaniac Master they choose not to interfere. Why is that?
Comment: Do you have any evidence on hand, of the timelords ignoring the master's actions? I mean, do they actively choose not to act in the series, or is it simply that we never see them going after the master? I only ask out of my own curiousity, and do not intent to dispute the claim, of course.
Comment: He mentions Classical Doctor Who in the title, and there haven't really been Time Lords lately, so it's safe to assume he's *not* talking about the current run.
Comment: Agreed. If you're talking about the current run then the episode The End of Time suggests that the Master has always been manipulated by the Timelords for their own ends...(http://tardis.wikia.com/wiki/The_End_of_Time_(TV_story))
Comment: I do not have evidence of Timelords actively ignoring his actions, but they did have power to interfere and they didn't, that's plain from the classical seasons (Doctor 1st through 4th) I've seen already. I'm currently watching seasons with the 5th doctor, so I can't speak for all of the classical episodes. It is evident though that TLs did not lack power to swat Master's efforts, they do not interfere though in spite of his numerous attempts to take over the Universe, including one time he nearly destroyed the whole Universe. They're obsessing over the Doctor though in the beginning.
Answer: The Time Lords left the Doctor alone for years, and it's implied that, somehow, they didn't even know where he was (although that doesn't make much sense), until he involved them directly in the situation of The War Games. At that point, even if they had simply been looking the other way where the Doctor was concerned, they couldn't any more, and had to take cognizance of the fact that he had stolen a dangerous piece of equipment and been using it in an unregulated manner for quite some time.
There are several hints, both in The War Games and later in the series (The Invasion of Time), that the penalty for that theft should have been death, on the theory that any being capable of such a theft is too dangerous to leave alive. The Doctor never really expected to face such a penalty -- even in The War Games he's mainly afraid of simply being made to return to (as yet unnamed) Gallifrey and live out a "normal", boring Time Lord life. That his penalty was, instead, exile with the possibility of parole was actually far better than anything he could have hoped for.
After that, there was a tacit understanding between the Doctor and the Time Lords that they could use him when they felt a need to interfere in something but didn't want to be seen to do so. This can hardly be said to be making the Doctor's life "miserable", honestly, so much as his being made to actually be responsible to someone other than himself for five minutes.
Meanwhile, the Time Lords have not exactly ignored the Master. They haven't even always held themselves aloof from the Master's shenanigans. In his very first appearance, Terror of the Autons, they at least warned the Doctor he was coming, although they did not deign to take a hand themselves. Similarly, in Colony in Space, the Time Lords actively "release" the Doctor from his exile momentarily to deal with a plot the Master is undertaking that had seriously broad implications.
While that's the last time that the Time Lord's hand in the matter is made clear, there are two Sixth Doctor stories (Attack of the Cybermen and The Two Doctors) which suggest that the Time Lords have been quietly nudging the Doctor into situations they need handled ever since, which suggests that some of the Doctor's encounters with the Master may not be coincidental.
Long story short: the Time Lords take their non-interference stance very seriously, even when it comes to their own rogues. They take cognizance of such matters mainly when their own interests are involved or threatened, and otherwise stay out of it. This is really true of both the Doctor and the Master (and also Drax, The Rani, the Monk, and, until the Doctor forced their hands, The War Lord). The only real difference is that the Doctor wound up directly involved in something he needed the Time Lords' help for, and that made them have to start paying attention to him.


Change a quartz clock timebase by changing the frequency of the quartz crystal oscillator?

Question:
I've been doing some research on rewiring clock circuits for a project, but I'm new to these types of pulse-counting circuits.  My question at this point is:  If I replace the existing quartz crystal oscillator in a clock's timebase generator circuit with an oscillator of a different frequency, will the timebase change?  My goal is to make clock circuit with a shorter or longer space between pulses - making the clock's "second" shorter or longer.  Is there a smart way to do this without use of arduino or additional stepper motors?  Quartz clocks are fascinating so far- I look forward to learning more.
Thank you for any input!
Comment: This sounds like it might be an XY problem. What range of frequencies are you trying to generate?
Comment: If you have a simple controller with a single crystal, then changing the crystal will probably change all timing on the controller the same way. BUT, there is probably a range of frequencies that will work. It could even be a narrow range. And there could be side effects. For example, Baud rates for any serial port will no longer be correct if you change by too much. USB may not work due to frequency error. Video outputs may not sync correctly. Basically the whole machine will run faster or slower.
Comment: You need to tell us what change in frequency you want to acheive? How accurate the new frequency needs to be? Is it just one fixed frequency, or do you have multiple fixed frequencies you want? Do they need to change during operation?
Answer: In principle, yes. If you have a device that uses a crystal oscillator to generate its timebase then you can change the timebase simply by changing the crystal oscillator frequency.
In practice things get more complicated. A given device will only operate over a specific frequency range and you can't violate that limit. Furthermore, if the oscillator circuitry is built in to the device and a simple crystal is connected to it then you have to consider the electrical characteristics of the oscillator circuit. The manufacturer of the device should provide information on selecting a suitable crystal, as well as the associated capacitors.
Answer: In addition to the "In principle, yes" answer from Elliot Alderson I'd like to add something:
Almost all clocks use a 32768 Hz crystal. That seems an odd number but it makes sense if you realize that \$2^{15} = 32768\$. If that 32768 Hz signal is divided (in frequency) by a chain of 15 divide-by-two circuits then you'd end up with a 1 Hz signal. So 1 pulse per second!
If you want to change that 32.768 kHz crystal for a different one I bet that such a crystal will be extremely hard to find. That's because there is almost no application where such a low crystal frequency is useful. Also with a higher frequency crystal and some (simple) chip or microcontroller, almost any frequency can be generated in that low (32 kHz) frequency range.
There are many different crystals (and crystal oscillators) in the 1 MHz to 50 MHz range but that's a much higher frequency. Very likely too high for a clock circuit to work with.
So yes your idea could work but will probably be impractical with any clock using a 32.768 kHz crystal and since those crystals are also very cheap, almost every clock uses one of those.
Comment: There are lots of crystals right around 32768 Hz. I have substituted different crystals as a way of evaluating timing margin before. You can go up or down by several percent from there and still find crystals. Just don't expect your serial port to work.


Exporting HTML canvas as an image sequence

Question: I've created a very naive page that will take a Three.js scene (though this could be any non WebGL <canvas> animation) and exports individual images (or sequences of images) to then be converted into video.
I'm doing this partially as a way to learn Python, but also the idea of being able to rapidly prototype something in  Three.js and then export a massive high res silky smooth video is super attractive to me. In the past I've used screen capture software to grab video, though it's always felt a bit clunky and real time drops in FPS would show through in the final video too.
The process I currently have is as follows:
Javascript:

Create the WebGL scene and set up a render cycle
Set canvas width/height to desired dimensions
Render the scene using requestAnimationFrame
Pause the scene's render/update cycle
Call toDataURL() on the canvas element and retrieve a base64 string
POST request to a python script, passing the base64 string (and other things, like target directory to save to and whether a single image or sequence is being captured)

Python:

Strip the MIME header content-type and decode the base64 string
Write the string to an image file
Print / return out a string that signifies successful state if the file was written, otherwise print out the offending error message

import base64, cgi, cgitb, datetime, glob, re, os
cgitb.enable()
#cgitb.enable(display=0, logdir='/tmp')

print "Content-type: text/html"
print

def main():
    form = cgi.FieldStorage()

    saveLocation = "../httpdocs/export/"

    # POST variables
    dataURL = form['dataURL'].value
    captureSequence = form['captureSequence'].value
    folderName = saveLocation + form['folderName'].value

    saveImage(dataURL, captureSequence, saveLocation, folderName)

def saveImage(dataURL, captureSequence, saveLocation, folderName):
    # strip out MIME content-type (e.g. "data:image/png;base64,")
    dataURL = dataURL[dataURL.index(','):]

    decodedString = base64.decodestring(dataURL)

    if captureSequence == 'true':
        # based off http://www.akeric.com/blog/?p=632
        currentImages = glob.glob(folderName + "/*.jpg")

        # TODO: perhaps filenames shouldnt start at %08d+1 but rather %08d+0?
        numList = [0]

        if not os.path.exists(folderName):
            os.makedirs(folderName)

        for img in currentImages:
            i = os.path.splitext(img)[0]
            try:
                num = re.findall('[0-9]+$', i)[0]
                numList.append(int(num))
            except IndexError:
                pass

        numList = sorted(numList)
        newNum = numList[-1] + 1
        saveName = folderName + '/%08d.jpg' % newNum
    else:
        if not os.path.exists(saveLocation):
            os.makedirs(saveLocation)

        saveName = saveLocation + datetime.datetime.now().isoformat().replace(':', '.') + '.jpg'

    # TODO; rather than returning a simple string, consider returning an object?
    try:
        output = open(saveName, 'w')
        output.write(decodedString)
        output.close()
        print 'true'
    except Exception, e:
        print e

if __name__ == '__main__':
    main()

Javascript:

Receive response from Python script and display returned message
Resume/update render cycle
(Repeat process for as many frames as desired)

This is something that I would always run locally so there would be no risk of conflicting writes or anything of the sort.
I've done a few quick tests and it seems to work for the most part, if a little slow.

Am I missing something completely obvious in the way this is being done? How could it be improved? (Especially on the python side of things..)
Is it inefficient to do an individual ajax call per image? One advantage is that I can just stop / close the tab at any time and it'll have saved all images up until that point. Would there be any benefit to storing all those base64 strings and sending them all at the very end?
As requestAnimationFrame will cap the update cycle to 60fps, is it possible to easily set a lower frame rate? Lets say for some stylistic reason I'd want to update everything at 15fps, would the only option be to use setTimeout(callback, 1000 / targetFPS) with the understanding that it will drift over time?
Following on from the above, this animation has a var frame which is being incremented by 1 every update cycle. This var is then used to control varied parts of the animation (e.g, rotating the cube, and being passed to vertex/fragment shaders to manipulate colors and texture UV coordinates).
If I wanted to simulate something like 15 fps, would I be correct in needing to increment frame by (60 / 15) instead? Is there a more elegant way to be able to easily switch between capped frame rates?
Finally, are there any techniques that could be adopted to improve the quality of images being rendered? (Thinking out aloud, saving out at double size then reducing them?)

I really hope that makes sense, any insight or advice would be massively appreciated.
Source files: http://cl.ly/3V46120C2d3B0A1o3o25 (Tested on Mac / Chrome stable, WebGL required)
Comment: Not sure about your other Q's but here's a great answer on [how to throttle requestAnimationFrame](https://stackoverflow.com/a/19772220/2583987)
Answer: In EaselJS you can set FPS
EaselJS Ticker
Comment: What does your answer have to do with the question?


Has any formerly excommunicated person ever been canonized as a saint in Catholicism?

Question: Has any formerly excommunicated person who later repented been canonized as a saint after their death?
Answer: Some saints were accused of heresy. St. Alphonsus of Liguori, discussing the patience of persecuted saints, writes (True Spouse of Jesus Christ ch. 13, §3, EPUB ref:839.48):

All the saints have been persecuted in this world. St. Basil was accused of heresy before St. Damasus, Pope. St. Cyril of Jerusalem was condemned as a heretic by forty bishops, and was deprived of his see.

He continues with examples of saints accused of lesser sins than heresy.
St. Joan of Arc was excommunicated by her local bishop.
Pope St. Marcellinus was deposed for having offered incense to idols (albeit out of fear*) but later recanted and was re-elected pope.
*St. Robert Bellarmine argues in Papal Error?: A Defense of Popes said to have Erred in Fatih that "Marcelinus neither taught something against faith, nor was a heretic, or unfaithful, except by an external act on account of the fear of death". Others may disagree.
Answer: Has any formerly excommunicated person who later repented been canonized as a saint after their death?
There are a few cases that come close to fitting into the parameters of your question, but not totally exactly.
I know of at least one that comes very close, but I can not recall the particular circumstances at the moment.
However, other other individuals come very close!
Some saints have lived in the peril of excommunication. Even canonized saints have been acquainted with the formal censures of ecclesiastical authority.
Even St. Athanasius was condemned by several councils, and being deposed from his place as Pope of Alexandria, spent years in exile.
St. Columba was excommunicated in 562 by the synod of Teltown for allegedly praying for the winning side in an Irish War. The excommunication was later held to be an abuse of justice and the bishops in question removed their charge.
Saint Joan of Arc by Bishop Pierre Cauchon on 30 May 1431 (even though he allowed her Holy Communion before her immolation). She was fully reconciled to the Catholic Church at her Trial of Nullification in 1456.
St. Mary MacKillop by Bishop Laurence Sheil in 1871. Five months later, from his deathbed, Shiel rescinded the excommunication


Is there a comparable technology to Cisco's DTP from other network vendors?

Question: Is there a substitute for Cisco DTP technology from other vendors? And if so, which ones?
Didn't find anything on google.
Comment: Has any answer solved your question? Then please accept it or your question will keep popping up here forever. Please also consider voting for useful answers.
Answer: An open-standard alternative is the Multiple VLAN Registration Protocol (MVRP), defined in IEEE 802.1Q. It replaced the GARP VLAN Registration Protocol (GVRP) in 2007.
Answer: Cisco DTP (Dynamic Trunking Protocol) is a Dynamically negotiated interface configuration management feature. It allows two Cisco switches to negotiate their interface status regarding VLAN tagging mode. If the ports on each switch that connect to each other are configured for either Trunk, Dynamic Auto, or Dynamic Desirable then the 2 ports will reconfigure for Trunk mode. Any other combination of interface configuration (Access, or No-negotiate) will result in the ports not configuring for Trunk mode and only non-VLAN-tagged traffic will pass the interface.
DTP is different from features on most other brands because the Cisco concept of a VLAN 'Trunk' interface is not standard terminology with all other brands.
For example, Aruba switches refer to an interface with all VLANs tagged as a 'Tagged' mode interface (what Cisco calls a Trunk mode interface). For another example, even though Meraki MS switches feature what they call a 'Trunk' mode on their ports by default, it only carries up to 1000 (1-1000 VLAN ID tags only by default) VLANs total so it requires special configuration to match the VLAN tagging that may be in use on a Cisco switch (say VLAN IDs 1, 200-900, 1200-3500, etc.).
Brocade/Ruckus switches refer to a port as 'Dual-mode' if it accepts both tagged and untagged (Cisco tagged and native VLAN) traffic. It is not called a Trunk port.
Some Dell switches use a configuration called 802.1q General Mode to equate to a Cisco Trunk mode interface.
Other brands have similar configuration foibles and standards that are different from what might be familiar to a Cisco user.
Because there is no standard nomenclature or configuration default or status for what Cisco calls a 'trunk port', there is no equivalent Dynamic Trunk Protocol. Other brands might have similar interface configuration negotiating protocols or interoperability management features, but I have not heard of any nor found examples of any that specifically relate to interface VLAN tagging management. They would probably be a more general centralized management and templating feature rather than specifically serving to configure the interface only for tagging/non-tagging frames for VLANs.
Cisco VTP is not the same thing as DTP. VTP is a VLAN management protocol that is designed to help manage the creation of VLAN configuration consistently across a network of connected switches and can help create or remove configuration of VLAN IDs across multiple switches that are configured to participate in the same VTP domain. VTP can also feature VLAN Pruning which can help dynamically remove VLAN implementation from switches where it is not used, such as disabling spanning-tree instances from switches that have no interfaces configured for the VLAN in question.
802.1ak or MVRP (and previously GARP-based GVRP) is an open standard based implementation of a similar feature set to help manage the creation/configuration of VLAN ID definitions across multiple switches that have MVRP enabled for their 802.1q trunk ports. This document covers more detail on interaction between VTP and MVRP and configuration examples:
https://www.cisco.com/c/en/us/td/docs/ios/lanswitch/configuration/guide/lsw_cfg_mvrp.html
Since DTP can result in the enabling of 802.1q Trunk interfaces, MVRP (or VTP) can be used in conjunction with DTP to enable the dynamic creation of VLAN configuration across those 802.1q Trunk mode interfaces but the enabling of the port as a Trunk mode interface is handled either by static configuration or by DTP independently from VTP or MVRP.
The common consensus I have seen around the IT industry is that dynamic VLAN configuration is generally undesirable because it can have unintended results. A good centralized configuration management solution and/or configuration documentation and careful configuration management is preferred even/especially on large networks.
Answer: No,it's proprietary and works only on Cisco
Comment: The OP's asking about a *comparable* technology, not a *compatible* one.


Why is the expectation calculated over finite number of points drawn from a probability distribution?

Question:

This is from the book Pattern Recognition by Bishop. Why is expectation here a simple average? Why is $f(x)$ not being multiplied by $p(x)$?
Answer: When we say that we have $N$ points that were "drawn from the probability distribution or probability density", this means that every point $x_n$ had the correct probability $p(x_n)$ of being sampled from the distribution when we were sampling our $n^{th}$ point.
For example, suppose that we wish to compute/estimate the expected value of a distribution given by flipping a coin, which is weighted such that it lands on heads two-thirds of the time (value of heads $= 1$), and tails one-thirds of the time (value of tails $= 0$). This means that the ground-truth probabilities are:

$p(1) = \frac{2}{3}$
$p(0) = \frac{1}{3}$

In this case, we actually wouldn't have to estimate anything by sampling; the exact probabilities are known, so we could just compute the expected value as $p(1) \times 1 + p(0) \times 0 = \frac{2}{3}$.
But now suppose that we do not know exactly how the coin is weighted, i.e. we do not know the exact values of $p(1)$ and $p(0)$. If we simply flip our weighted coin $N = 100$ times, we will in expectation find about $67$ samples of $x_n = 1$, and about $33$ samples of $x_n = 0$ (rounded to integers because we can't obtain a non-integer number of observations). So we cannot explicitly use the probabilities (because we do not know them), but they will implicitly be present in the number of repeated observations we have for every possible datapoint.
Comment: So you mean sampling is used to estimate probabilities, and that's why if p(1) = 2/3, we can expect 2/3rd of samples to be 1, and hence the expectation will account for the probabilities?
Comment: @sage76 Correct


Concept of services, tags, and arguments

Question: I defined a service using the following code.
services:
  redirect.repository:
    class: Drupal\redirect\RedirectRepository
    arguments: ['@entity.manager', '@database', '@config.factory']
    tags:
      - { name: backend_overridable }

According to my understanding, '@entity.manager' , '@database', and '@config.factory' are classes on which the service is dependent.
Now, the entity.manager service definition is the following.
class: Drupal\Core\Entity\EntityManager
parent: container.trait
tags:
  - { name: plugin_manager_cache_clear }

It has a tag associated with it. Maybe this tag manages all entity specific cache.
What is the responsibility of the redirect.repository services?
Does this service help communicating with the database directly?
What if I don't have any entity and I implemented hook_schema()? Can I mention my custom database table name instead of @entity.manager?
Where do these tags actually get registered?
Answer: 1. Database
redirect.repository communicates with the database through its usage of the class represented by the database service injected into its initialize method (__construct). However the RedirectRepository class does not itself use PDO to connect to the database.
The redirect module has chosen not to implement an entity to store its data, and is an example of using Drupal's database abstraction layer (DBAL) from the database service.
// Load redirects by hash. A direct query is used to improve performance.
$rid = $this->connection
  ->query('SELECT rid FROM {redirect} WHERE hash IN (:hashes[]) ORDER BY LENGTH(redirect_source__query) DESC', [':hashes[]' => $hashes])
  ->fetchField();

2. Entity Manager
The entity.manager service provides a deprecated helper class to make it easier to get information about entities only. If you do not implement an entity, then you cannot use any of the entity-related services such as entity.manager or entity_type.manager.
3. Dependency Injection Tags

Dependency Injection Tags are little strings that can be applied to a
  service to "flag" it to be used in some special way. For example, if
  you have a service that you would like to register as a listener to
  one of Symfony's core events, you can flag it with the
  kernel.event_listener tag.

Tags are treated specially so that when the service container is "compiled" certain classes may be able to make a second "compiler pass" and act on services that are tagged.
See the Symfony2 documentation for more details about compiler passes: http://symfony.com/doc/current/components/dependency_injection/compilation.html#components-di-separate-compiler-passes
Answer: 1.) RedirectRepository is not a Drupal core functionality please specify contrib module name or provide code in order to be able to respond to your question.
2.) The arguments in services mean that the are put as dependency an can be directly injected via the __constructor method of your service. No you cannot mention no table name here! Only services! You need to define a custom entity and service!
3.) A name to identify groups of services. Tags are used in compiler passes and for collecting cache bins. http://symfony.com/doc/current/components/dependency_injection/tags.html
What do you want to achieve with the tags?


iOS Mobile Scrolling Best Practice

Question: My designer came up with this design which I like but the top part, what is a best practice to scroll here.  Should the table cells go behind the searchbox, should we have a divider of some sort? What are designers doing these days?
Answer: In iOS, most often the search is hidden and launched only after the swap down. As an example, you can open the settings on your iPhone and see where the search is located.
Feel free to try this feature, it's fairly native behavior and it's the easiest to implement.
Comment: I like that, and didnt know.
Answer: Just copy what Apple does. It'll follow Jakob's Law and also stays away from the false consensus effect (ie avoid "this design which I like...).

iOS Mobile Scrolling Best Practice


Tracking long panning shots

Question: I need to track the camera in a very long panning shot. Because the start frame and end frame don't have common reference points, I am only able to get fragmented track points. I can detect a camera pattern in the graph view but when I try to build this, the average error is too high.
Is it still possible to track a shot like this?
Answer: Yes, this is possible, although you will need to use the tripod solver. Also, you will have a difficult time doing a 3d scene reconstruction, because blender can't track depth in a panning-only shot. Also, make sure there is no zooming, as blender doesn't handle that correctly as of yet. Finally, make sure you have a decent number of solid keyframes (10ish) at each frame, and that the trackers are getting disabled AS SOON AS they begin to deviate (or be "obscured" by the edge of the screen).
Here are is the "Ultimate" BSE answer on motion tracking (required reading for anyone interested in blender's motion tracker):
https://blender.stackexchange.com/a/42332/28015
Comment: You might want to update your post, the agenzasbrothers link now redirects to some p*** site
Comment: @ChameleonScales I checked on web archive (https://web.archive.org/web/20170311181044/https://agenzasbrothers.com/en/understanding-motion-tracking/) and it looks like that page was not saved before it was destroyed. So not sure if it is still out there. Let me know if you find the right link.
Comment: @ChameleonScales thanks for pointing that out. In the future please edit the question or have a moderator deal with links like that.
Comment: @susu ok I will.
Answer: When the markers move out of the visible frame you should disable them so they aren't considered when solving. Inversely you can also have markers disabled before they come into view and enable them only while they are visible.
You can find the enabled property in the marker properties panel P, when disabled a marker is shown as a plain box without the resize handles or centre point. Like other tracking properties, this is automatically keyframed as you change it.

You can also use box select B to select all the markers that are off screen and use ⇧ ShiftD to disable the selected markers.
The same can be done in the clip editors graph view by selecting the keyframes you want to disable and pressing ⇧ ShiftD.
There is also a margin setting that can automatically disable the marker as it reaches the edge of the image, this can be set for selected markers as well as the new marker settings.
Answer: I just made an add-on specifically for tracking long shots with a constantly evolving environment:
https://gitlab.com/ChameleonScales/step_tracker
It allows you to batch-track "steps" of a specified number of frames any number of times at once (e.g. 15 steps of 20 frames each) without degrading performance on long shots. It also lets you have an overlap between each step by using an offset, so that the overall tracking doesn't have any cut.
Please read its Readme for instructions on how to use it and don't hesitate to ask me if you have any further questions.
I've used it on a ~5000 frames shot with a camera fixed on a car and my results turned out very good. The add-on could still use several improvements to ease and accelerate the process even more so you can expect updates to come.
This is still very fresh and not bullet proof yet, so please use with precautions and report issues if you find any.
Comment: Please consider that this is no forum rather a Q&A site so please help us making this site a real knowledgebase and add in detail *how* this add-on is going to help for this specific situation. Otherwise your actual *answer* is a so called "low quality post".
Comment: Sure. better now? Note that this is very fresh, I released it today so it's subject to updates.
Comment: ok, thanks for the tip
Comment: yep better, thanks

Tracking long panning shots


Bass-Serre theory textbook

Question: I am a PhD freshman working on topological graph theory and geometric group theory. I would like to learn some Bass-Serre theory. What do you think is the best introductory textbook in this topic? Thank you in advance for your recommendations.
Comment: Serre's book and Scott-Wall's survey remain by far the best sources.
Comment: I like the beginning of Dunwoody and Dicks book.  They might be a little too brief for a first introduction but they have a number of nice applications and I love they prove the universal covering tree is a tree using homology rather than normal forms.
Answer: As mentioned by Andy Putman in the comments, the classical (and probably the best) references are Serre's book Trees and Scott and Wall's paper Topological methods in group theory.
Serre's approach is elementary and essentially self-contained, based on combinatorial arguments. Scott and Wall's approach is based on algebraic topology (in particular, they use covering theory). If you are already familiar with some algebraic topology, then you may find Scott and Wall's approach more intuitive, more visual. Personally, I began by reading Serre's book, but I prefer the point of view of graphs of spaces.
You can also take a look at Henry Wilton's blog Geometric group theory. There are several blogposts dedicated to the Bass-Serre theory. In complement to Serre's book, an interesting complement is Higgins' article The fundamental groupoid of a graph of groups. Looking at the fundamental groupoid instead of the fundamental group makes some arguments more natural.
Answer: Depending on how far you want to go, there is a very short and very well written note by Wenyuan Yang here : http://bicmr.pku.edu.cn/~wyang/ggt/BassSerre.pdf
You can find the construction of the Bass-Serre tree for Amalgamated sums and HNN extensions and some related theorems.
Answer: "Trees" by JP Serre.
Comment: As it's been quoted several times, let me mention that his book *"Arbres amalgames $\mathrm{SL}_2$"*, in French, was published in 1977 by Astérisque, and later (1980) translated into English and published as "*Trees*" at Springer.

Bass-Serre theory textbook


How to run Data Loader using ANT on the server

Question: I have a Data import and export process being carried out by the ANT tool scheduled to run daily from a Desktop.But the issue is when desktop gets auto updates it restarts and scheduled tasks will go off. Is there any way by using tool or plugin available from salesforce to accomplish the same from a server.
Answer: You can't use Ant or the Data Loader on the salesforce server. I would recommend taking a look at Heroku or Amazon EC2 for a low-cost server that can perform the tasks for you (or other cloud compute services, of course), or you might look into writing some Batchable Apex Code to perform your imports and exports; however, without knowing more about what you're trying to do, I can't tell you which would be more effective.


Recessed lights working intermittently

Question: I have 7 recessed lights in my kitchen.  They stopped working over a period of a few months, one by one, until none worked.  Every now and then, one of them will come on, sometimes the one on the back left, some times the center front,etc. That light will sometimes turn it self off.  If I turn it off by the switch, I can't get it back on.  The bulbs have been replaced (I made sure and got the bulbs sized listed in the cans).  What the heck is wrong? BTW, they use the 4 prong bulbs.
Comment: 4-prong bulbs are rare.   Can you post a photo, or link to a website that sells it?  Better yet, a specimen of the old one?
Comment: CFL with a GX24q base?   Is it GX24q-3 or GX24q-4 (they are different)?
Answer: Most recessed lights have a thermal overload built into the can. Once they start going bad they will come on and then go off and eventually they won't come on. Your symptoms you are describing are similar to these thermal overloads faulting.  The other thing I would look at is whether or not this type of recessed can have a ballast or driver they too may be going bad. Depending on the can's age and manufacturer you might be able to have them replaced, but sometimes you have to replace the unit. Before I did that I would check the switch and make sure you have voltage at the load side of the switch. Then I would check to see if I hade voltage at each can by checking the prong receptacles.

Recessed lights working intermittently


how to open another browser instance or tab from within a page viewer web part

Question: I made a simple graphical object in Microsoft Excel 2007; I saved it as as web page and uploaded it to a document library. Thereafter, I used a page viewer web part to show my page. However, whenever I click on one of the hyperlinks the web page has, it opens inside the web part frame and not in another browser instance/tab. How could I achieve it?
Answer: This is more of an Excel issue than SharePoint.  However, when you create links in Excel, there is no way to specify the target of a URL.  (For instance, you would need _blank to create a new window).  When you export from Excel, the target is set to _parent.  Only way to achieve this would be to edit the HTML files themselves to replace _parent with _blank on the targets of the links.
Comment: It seems that excel maintains a list of resources in an xml file, so it wasn't possible to set the target to _blank. My aim is just to have an a graphic in a web page where a portion of it links to another html page inside the same sharepoint site. The graphic is not simple enough and it would be painful to do it writing html, that's why I used Excel in this case.
Comment: update: I hadn't located the right .htm file to make the appropriate changes. It now works as you said.


Working free text-editor for windows 7

Question: Does anyone have a free text-editor that works well in Windows 7?  I'm currently useing Programmer's Notpad 2, but it keeps crashing or having UI bug issues.

LIST

TextPad
NOTEPAD++
GNU Emacs
Zeus Lite
Vim
Answer: Notepad++ is working fine for me with no problems.
Answer: I like these on Windows systems.
As far as I know, they all work with Windows 7.
Hard to learn, but makes you more efficient in the long run:

Vim
Emacs

Easy to learn, but still powerful editor:

TextPad
Notepad++
Comment: +1 for hilarity: "refuse to put any effort into your own productivity"
Answer: Zeus Lite
Answer: Notepad++
I really like Sublime Edit and it works well, but (not very often) shows an alert "Please purchase" (not very annoying. really). You should try!
It can even do editing with many cursors, it has cool snippet engine, it has very useful for projects combination Ctrl+P, etc
Answer: I mostly use Notepad++ and TextPad on Windows 7 and they both work fine.
cheers
Answer: Notepad++ rulz
Answer: Well, there's always Emacs, which works fine on Windows 7.
Beware, though: The user interface elements and keyboard shortcuts are completely different from everything you are used to from Windows (which isn't surprising, since its origins are not in the Windows world). If that's OK for you, you will be rewarded with one of the most powerful text editors in the world.
Answer: Whatever gets your code out and makes you feel comfortable in the process! At the end of the day, it's all preference! :^)
However, I have liked Sublime text for it's nice GUI, similar to TextMate on Mac (if that's where you're coming from). Long time Emacs user, got tired of having to implement every feature that comes with a lot of text editors today...
Answer: I'm gonna have to throw my vote out there for Vim. It's got a steep learning curve, but once you learn it you wonder how you ever coded without it before.
There's something immensely re-assuring about the whole modal way of doing things. It kind of enforces the concept that your code is a structure to be engineered and architected correctly, not a collection of letters that will blow away at the first sneeze.
Wow, that metaphor was a stretch, wasn't it.

Working free text-editor for windows 7


I have a dental health policy and I have a general health policy that includes dental. Can I claim on both?

Question: I had to have a crown for £500. I claimed through the specialist dental insurance. They paid out £350. Can I now claim on the other general insurance policy for the £150 that wasn't covered? I know I mustn't benefit financially from a claim ie claim more than the loss. I feel that I am paying in to both schemes so I should be able to claim on both.
I would be grateful for clarification - I don't want to submit a claim that flags me as being fraudulent!
Answer: In general, no. The Ts and Cs of both policies almost certainly exclude any cover for "double insured" procedures, but you would have to read the small print to be sure. Also the general health policy might only cover dental accidents rather than routine treatments etc.
It might be better to ask "Should I keep paying for dental cover when dental cover is already provided by my health policy?" - to which I would say again, read the small print to work out which policy is better and only keep the specific dental cover if it's giving you something over and above that provided by the general cover.
Comment: I don't think this is necessarily the case. Some policies will cover the excess not covered by the other policies.
Comment: Wouldn't they generally exclude cover for sums you can *recover* under another policy, rather than just a blanket exclusion on claims?
Comment: @Vicky: But then you *couldn't* recover under the other policy, so both policies would provide coverage again.  Catch-22
Comment: @GaneshSittampalam quite possibly, but then you are in the situation where both insurers decline to cover the procedure because the other one covers it. I really don't think there's an easy win here.
Comment: Is there no UK-equivalent to the practice of coordinating benefits when they overlap? The scenario presented in the question is quite typical in the US and the answer would be, "yes - go ahead and claim the remaining amount to the secondary policy."


Google Books API book other editions

Question: I want to find a book (let's call it A) with a certain ISBN. Search for it with its title, only a book (B) with the same title but different ISBN shows up. I can then find the book (A) I want in the "Other Editions" section in the book details of book (B).
Example:
When I want to find the book "the signal and the noise" with ISBN 9781594204111. I typed in "the signal and the noise" in Google Books search and it returned me with the book with ISBN 9781101595954.
Found someone asked the same question in 2012 but no info on whether the feature has been implemented. https://productforums.google.com/forum/#!topic/books-api/VZYH-uoGnQE
The main problem: I want to know all ISBNs of books (of different editions) with the same title. Is it possible to be done with Google Books API?
Comment: And fyi, I am using the Google Books API Library for Java.
Answer: No, they don't still support this. A non-commercial solution can be found in librarything's API though:
http://blog.librarything.com/thingology/2006/06/introducing-thingisbn/
It's a free version of what OCLC offers in their paid xISBN service.
And by the way, I've found that many of the ISBN's returned in the Google API refer to out of print editions. Just try linking them by isbn_10 to Amazon....

Google Books API book other editions


Compiling opencv 2.4.5 with TBB

Question: I have TBB installed to /usr/local/tbb and now trying to compile opencv 2.4.5 with the installed version.
But if i use ccmake, it will download another copy of TBB from the internet. I dont want this.
What are the commandline options for cmake to accept my local installed TBB directories?
Thanks!
Answer: <code>cmake -DWITH_TBB=ON
      -DTBB_INCLUDE_DIR=/usr/local/tbb/include
      -DTBB_LIB_DIR=/usr/local/tbb/lib
</code>

Compiling opencv 2.4.5 with TBB


Why we try to capture variability?

Question: I am new to Statistics and I have a Mathematics background. In Statistics, particularly in Linear Regression and Principal Component Analysis (PCA) so far what I have understood is that the main idea is to try to capture as much as possible variability present in the data. In linear regression, while calculating $ R^{2} (R \ squared)$ measure we are checking the proportion of variability captured by our model and in PCA we are forming a new basis along which our data has the maximum possible variability. Is there any significant result behind this logic? I mean why we have to go after variability? Any help in this matter will be appreciated.
Answer: Statistics is the interface between math (models of the world) and our perception of reality. I suspect what you are looking for is not proof, but an understanding of the assumptions.
Math proofs are a formal logic system that works because it is self contained (in my background as a chemist this would be termed a adiabetic). All proofs rest on assumptions, and incompleteness theorems show that a system cannot prove its own consistency nor prove every statement true.
Data is percieved information about the world (even if technology has captured it). The underlying data generating processes are many and complex and no real world physical system is close to adiabetic,allowing external influences to perturb the system being investigated. Quantum theory tells us that we can never know every physical detail of a system perfectly.
There are uncertainties on both sides of the equation.
The question stats attempts to answer is what can data tell us about the model we have, or vice versa what our model can tell us about our data. The two won't match, so what we are interested in is how much they don't match, i.e. How much does our data vary outside the constraints of our model.
A popular saying on this site is that all models are wrong, but some are useful. Measuring variance explained allows us to assess one aspect of this usefulness, but it is far from the only one. The metric employed should be appropriate to the questions being asked.
So some basic assumptions in assessing variance (I'm sure it will be incomplete, so feel free to comment)

The model is not perfect but explains a maximal proportion of observed phenomena
The data is not pure, it contains noise and biases that are unrelated to the model
We need a model that explains as much of the data generating process as possible
We need a model able to ignore the noise
Processes external to the system under investigation have negligible influence.

Tools exist for assessing the validity of these assumptions, which is why stats is so complicated, but can reveal so much.
It is important to understand the purpose of statistics (something commonly misunderstood by both mathematicians and scientists). The point of statistics is not proof or truth, it is assessing risk.
Comment: Wonderful answer!! I need a little bit more time to assess the aspects described here with my little knowledge ( i would rather say I only have some information not knowledge until now) of Statistics. Thanks ☺
Comment: It is a very short concise answer to a sprawling issue, which is how do we align the philosophies of science and maths. I'll do my best to develop the answer to any follow up.
Answer: In many cases the reason we use regression is to explain variability. In that sense, how much variability is explained is one of the key measures of success.
This may be more clear with an example. I recently worked on a project where we created a regression model to explain employee performance. We did this because our stakeholders (senior management) wanted to know why some employees were performing well and others weren't. That is, why do we see variance in employee performance?
Phrased this way it should be clear that a key performance metric for our model is how much variability it correctly anticipates.
Comment: I am totally convinced with the logic that we are trying to capture variability. But my question is why variability? As a Mathematics student, it's hard to accept it without any formal proof. @indigochild as we see in your model it was a good measure but why I should accept it in general?
Comment: @Satish Maybe someone else can provide a more satisfying answer. At its heart, this isn't an issue of mathematics. The answer lies in the informal logic surrounding how users interpret it. It isn't subject to any kind of formal proof.
Answer: Here's my few cents..
Co-movement of independent and dependent variable is the key here. Let's say we want to find out how height changes with age and we have data for 100 people. Let's say we know that our independent variable (height) varies a lot across the 100 observations, but we want to find out how much of it comes from the co-movement of height and age. Hence, we fit a model and to estimate of how much of the variance in height can be explained from co-movement w.r.t. age.
If in our data, everyone has the same age, the model won't be able to explain ANY of the height's variance, we'll need to find something that explains the movement (variance) of the independent variable. Explaining the movement (variance) of independent variable is a good starting point for all predictive models.
In PCA, the objective is rotate the data to get the best axis for cleanest perspective. Using variance to change the basis is just a way to get this perspective on how data is scattered on a hyperplane.

Why we try to capture variability?


What exactly happens when something mutates?

Question: Several times now I've fought some legendary creature and in the middle of the fight they suddenly mutate and heal back to full.  What other effects does this mutation do?  Does this mean I can't 1 shot a legendary creature with a sneak attack?
Comment: Fat Man. The answer on the most questions regarding Fallout 4.
Comment: You can 1 shot them, but if you get them close to dead but not quite, they will regen health back.
Comment: To add to that, I've noticed when they mutate they glow different colors, usually orange or red. I wonder if they gain defense based on the type of weapon you used against them, or maybe stronger attacks.
Comment: @VanBuzzKill, from the ones I've faced so far, I've definitely noticed stronger attacks.
Answer: This is all from my own observation and I don't have an official source for it. But since I play on survival and found a LOT of legendary enemies yet, they are kinda reliable.

A mutation in Fallout 4 causes the following things to happen to an enemy:

It will regain their health completely
It will get a damage boost of about ~50% (stronger enemies get more)
Certain enemies get a damage reduction against the damage you used most against him before mutation
It may get a random "perk" from a set list.

I could not find out the total amount of perks, but according to the stuff I've seen, this is what may happen:

Green aura: The mob deals much more radiation damage per second . Seen on a legendary glowing one at lvl 16 and a legendary ghoul at lvl 15.
Orange aura: The mob dealt additional DoT damage with each hit. Seen on various enemies past lvl 20. It seems to be seperated between nuclear DoT and "normal" DoT (maybe even poison DoT?), since, when I wear a power armor, some enemies which dealt huge DoT to me before barely dealt any DoT to me.
Red aura: The mob gets a huge damage boost to the boost he already gets. A muted watchbot almost killed me within 2 seconds when he didn't even deal half the damage before. Seen on this Watchbot ~ lvl 24.
Yellow aura: The mob has highly increased movementspeed. Seen on a Mr. Gutsy.
Nothing: The mob doesn't get an aura. Therefore, I assume it doesn't get any special perks. Not sure though, maybe it does, but a weaker version. Maybe also: The stronger the aura, the stronger the perk.
(Unsure!) Blue aura (???): Grants huge damage resistance to the resistance the mob already gets. Was curios, and it could survive 2 Fat Men. Seen only once on a radroach at lvl 26, seems to be extremely rare or I'm colorblind, I was quite tired when i encountered this.

This is all the information I could find out by now, maybe there is more, I'll update the answer once I know it.
Comment: I just found a legendary mr gutsy with a yellow aura.  from what i can tell I think his movement speed has been increased, he zooms around the map now
Comment: @z' I couldn't find one of those by now, but nice to know that there are still things i didn't find yet. I love bethesda games. By the way, the DoT Aura is orange, while the damaging aura is red. I was able to see one of those yesterday. The difference is small, but recognizeable if you got sreenshots.
Comment: @z' Not a problem. Of course, I'll continue to update this answer once i know something new, and everyone should feel free to update this answer themselves or at least leave a comment once they know something not mentioned in here yet.
Comment: ok I was wrong, I don't think the yellow aura makes them fast, it makes them blow up in a nuclear explosion after they die.  Ran into a legendary protectron that spawned the yellow aura:  http://i.imgur.com/urBuZNk.jpg
Answer: To answer your last question: It is very possible to one-shot a legendary enemy. I do it all the time, and highly recommend it.
The only way they mutate is if they're still alive after having been dropped to ~50% or less health. As long as you've got a gun that can take out more than half their HP, you can avoid having to deal with the mutation.
Personally, I prefer the one-shot kill approach whenever possible. I find the Gauss Rifle to be very effective for this (currently at level 70, on default difficulty).
If your best gun can't do the whole job in one shot, but it can still knock off more than half the enemy's HP, save it for last. Work the enemy down a bit (but not to 50%) with something weaker, then finish 'em off with the big gun once their HP is within its damage-dealing capabilities.
Answer: Can't comment on other answers, but the legendary protections always die in a nuclear explosion as long as they are activated. So that could just be very frightening to have a super fast robonuke coming right for you.
Comment: seems that any legendary robot will explode when they die


opauth linkedin email

Question: I'm working on some code and trying to get the email address from linkedin. I have looked at there docs to confirm that they do support sending the email via api now.
I tried to add 'scope' => r_emailaddress. If I look in the raw section of the response I see email-address but this does not seem to be getting added ['auth']['info'] array as email so I have no standerdized way of always getting an email from all of my various providers.
I have also tried the following with out success.

$this->mapProfile($profile, 'email', 'info.email-address');
$this->mapProfile($profile, 'email', 'email-address');

Any thoughts?
http://opauth.org/
Answer: It ended up being this.
<code>$this->mapProfile($profile, 'email-address', 'info.email');
</code>
You also need to add this to linkedinstrategy.php $defaults variable
<code>'scope' => 'r_emailaddress'
</code>

opauth linkedin email


Delete invalid values being validated by Parsely.js without the user having to delete them on their own while maintaining the validation message?

Question: Hello much more knowledgeable developers of the world,
My question as asked in the title is that if it is possible to delete the invalid values entered that are being validated by Parsely.js automatically while keeping the parsly.js message?  I've accomplished this to a degree with the following library I've created which really is just a library full of regular expressions that replaces the improper characters by deleting them.  A few examples of what that library looks like is here:
    //Regex to determine if the string is Alphanumeric (Both letters and numerals).  Deletes any values that don't fit the criteria.
    function hasNumbersAndLetters(input)
    {
        var regex = /[^a-zA-Z0-9\s-,]/gi;
        input.value = input.value.replace(regex, "");
    }

//Compares the string to a regex looking for numbers only, will remove any values that don't fit the regex.

    function onlyNumbers(input)
    {
        var regex = /[^0-9]/gi;
        input.value = input.value.replace(regex, "");
    }

These functions do in-fact work with the onblur event immediately after typing an improper value in the form being validated but cancel out the parsely.js message indicating why that is happening through its validation for being alphanumeric as an example.
This is an example of what one of my inputs looks like:
<input type="text" id="username" name="username" onblur="hasNumbersAndLetters(this)" data-parsley-type="alphanum" required=""  value="<?php if (!empty($username)) echo $username; ?>" />

If you can point me in the right direction it is appreciated.
Answer: Parsley has not been designed with this in mind, and form validation in general does not work this way. You may be able to get away with this by listening to the field:error event and making your changes then, but the interface will suffer. I strongly recommend following community standards which do not "autocorrect" the inputs.


PA2 (Peano Arithmetic in 2º order logic and categoricty)

Question: Second order logic implies categoricity in peano arithmetic. But why are the models isomorphic to the standard model of aritmhetic and not to another non standard model, for example?
Answer: The point is that there is a single second-order sentence which completely characterizes (up to isomorphism) the structure $(\mathbb{N}, 0, 1, <, +, \times)$. Specifically, the standard model is characterized by the property that every element has only finitely many predecessors - and we can write this in second-order logic as $$\forall n\forall F([\forall m(m<n\implies F(m)<n) \wedge \forall m_1, m_2(m_1\not=m_2\implies F(m_1)\not=F(m_2))]$$ $$\implies \forall m<n\exists k<n(F(k)=m));$$ in English, this is just saying "for every $n$, every injective function from $\{m: m<n\}$ to $\{m: m<n\}$ is surjective." This sentence, when conjoined with the finitely many non-induction axioms of Peano arithmetic, characterizes the standard model up to isomorphism.
Comment: Well, it doesn't have anything like a decent proof system. That's pretty terrible. But we do use second- (and higher-)order logic informally, all the time. So you'll have to clarify what you mean when you say mathematicians are hesitant to use it.
Comment: It is said that there are infinite (in metamathematical intuitive sense) numbers, but the sets $ n i \in N $ and $ n<m $ implies this sets are finite. .Thanks for the answer. Now I have not clear my position about second order logic, maybe it is not only first order set theory in disguise. When I started to interest for theoretical basis for maths (my formation is scientific but not mathematical). But, why the mathematicals are so reticents to second order logic then?


How to determine if machine learning models are correlated?

Question: I have several models that I want to ensemble together. I know that this will only help if the models are uncorrelated, e.g. they don't make the same mistakes. Is there a way to figure out if any two models are correlated without actually testing them individually using the data?
Comment: What models are you using? If you are combining models that have an element of randomness (e.g. RF) with something like SVMs you should expect those models to not be particularly correlated. Combining deterministic with random models should help you avoid correlation.
Comment: Thanks that makes sense. I was wondering if there exists a model selection criterion that could identify the correlation between two models. Just trying to save some time.
Answer: One method might be to calculate the residuals of each model and determine their correlation. If errors are correlated, then they fail in similar ways which I believe is what you're trying to avoid.
Answer: It really depends if it is a regression or a classification problem, if your speaking from a strict machine learning perspective. With that in mind, I would, for a classification problem:

inspect the confusion matrix between models
plot key statistics (recal, F1, precision, accuracy) by bin's of the key variables of the model

if it is a regression problem from an ml perspective I would do the same, but inspecting the r-squared, adjusted-r-squared, MSE, MAE and etc.
If your using Bayesian methods strictly, I would chill and Bayesian average all models based on their WAIC share.


USB noise from my Audio interface

Question: I have a new Mackie Onyx 2x2 running into a Win 10 pro Intel i5-2500K CPU @3.30 Ghz w 8 gig ram, running Cubase 10 elements. I have terrible noise via the usb connection to my PC. I have tried various ports, cleaned all of the usb ports but still massive noise. How do I keep the USB cable from picking up all of the noise? The noise doesn't seem to make it onto recorded tracks as much, but monitoring and tracking is a huge pain!
Comment: Troubleshooting is nothing, but guessing without having your system in one's hands. Word "terrible" gives no hint of the origin of the noise. You told it's not in the recorded tracks, but it obviously is too high in monitoring and when playing back. Disconnect all items from PCs own audio connectors and let the headphones be the one and only device connected to your Onyx. (+ the USB cable to the PC). Is there still noise? If inserting one certain device back to the system pulls the noise up, tell what it is, where it's connected to (all connections) and how it gets its power.
Comment: Is it more of hum, from a ground loop maybe?
Answer: You don't have the unspecified noise in your recording, because the audio data are already in digital format.
If you hear it in your monitor, which is likely to be a pure analog path, as was already stated, you managed to build a closed loop from conductors. Tis inductance picks up any varying electromagnetic field, where CPU-related are the most annoying ones.
The loop comprises one complete round. Starting with your USB cables outer shielding you run through the Audio interface, its internal power supply, the power cables inside your walls, to the power plug of your computer, its internal power supply, to its USB port, back to the USB cable. The larger this encircled area, the more signal is picked up, i.e. the louder the noise. Keep in mind, that both galvanic connections (by wires) and capacitive coupling (including stray capacities) are effective in this frequency range.
Or in short: it sounds much like an EMC or EMI problem.
Countermeasures to break this loop, also in combination:

use an USB cable with ferrites (these bulky cylinders close to both ends)
reduce the loops area, by bringing all mentioned cables closer together (often fails, as you'll have a net of loops: reducing one enlarges the other; just a geometric effect)
turn one of the power connectors if your plug design allows it (i.e. interchange conductors this way; sometimes this works)
look for a galvanic breakup of your power supply lines (a fancy description for inserting a dedicated power transformer; BUY, don't build !)
check the impact from your audio cable to the monitor: if it's part of the problem (second loop through monitor, too), consider inserting a DI box in the audio cable (which inserts a transformer, again; lift the ground connection at the DI box, to break that loop, too).
Answer: There are many possible reasons for noisy audio. I personally don't believe it is the cables if the recorded audio is cleaner. In any case it is always good to test with other cables if you have them laying around. I would think it might be something on the software side. More specifically I would begin by increasing the buffer of the audio interface (from its software or DAW). Often the small buffer sizes are too much from the cpu and they produce lags that sound like noises. How much is the cpu usage according to the indicator in cubase?

USB noise from my Audio interface


One of me Gmail accounts is being hacked; how can I inform Google?

Question: I think one of my Google accounts is being attacked because without my desire G-XXX codes are being sent to my phone via SMS. I want to know which email is this code for and want to inform Google for further assistance. how should I reach google and ask them these?
Answer: According to catzrule answer to
"Suspicious "Unusual Activity" text - if spam, where should I report?"

Text (sms) is not something that Google could help with.  Maybe your
  phone company?
Certainly sounds like a phishing attempt;  others may correct me here.
Many sms clients on phones have a "block" feature.  Long press on the
  message and see if you have that option.

That post is from 2016. If you want to make your own post go to https://productforums.google.com/forum/#!forum/gmail
In either case, it worth to check if you have in place all the security measures suggested by Google on Secure an account that has suspicious activity


How I can make this Complex Gradient in illustrator?

Question:
I want to make this complex gradient, what tool should i make ?
Answer: That's not a simple gradient, there is at least some texture in there too, so I wouldn't bother trying to make that exclusively in Illustrator.
How I'd approach it...
Render some clouds in Photoshop (Filter → Render → Clouds):

Place a gradient on top (I've used a radial light → dark gradient on a fill layer):

Set the gradient's blend mode to Multiply:

I then added a levels adjustment layer and adjusted as needed (I actually added two; one directly on the clouds and one above everything. I also slightly over did it so you can better see the effect). I also added a Paint Daubs filter as your example has a similar effect:

You can then save and place the file directly in Illustrator. If you need it to be vector you could always do a full color image trace in Illustrator.
Answer: I think your example is a painted pattern, but something similar can be achieved with a "Gradient Mesh".
Draw a rectangle for the entire background, select it and choose Object>Create Gradient Mesh.
It will ask you for the number of rows and columns. My example used 10 of each. You might try higher numbers to get a more complex gradient.
Your rectangle will now be divided into a grid and each grid crossing is the center of a gradient that blends with its neighbors.
Select them all with the white arrow tool and choose a dark purple. Now, with the white arrow tool select individual nodes and make them a lighter purple.

Experiment with colors and shapes until you get the desired results. Multiple gradient meshes can be placed above each other and transparencies applied to get real organic and random patterns.
Answer: Use blur. At first Draw a thick overlapping stroke over the image:

Arrange the stroke behind the foreground objects. Then apply Gaussian Blur with large radius and reduce the opacity:

You can get more complex effect easily: Duplicate the blurred shape, move the copy and reduce the opacities. A color change also can be useful. Both of them are tried here:

I have found that sometimes Illustrator renders multiple overlapping blurred shapes unpredictably. There seems to be some big unwanted rectangular boxes. I still do not understand that phenomena well enough, but they do not appear if there's only one blurred shape or the opacities are low.


Why did all 3 varieties of my chitted potatoes I planted going into summer (Nov-Dec) vanish?

Question: If you plant chitted potatoes going into summer (Nov-Dec) when temperatures have reached 26 C (South Africa). Will they shrivel up and die? All 3 varieties of mine disappeared?
Comment: Did you take pictures before they disappeared?
Answer: One of mine (out of two) shriveled up and died as soon at it got hot out this year. A lot of gardening is experimentation, you just have to try it and see how the cultivar will react to your particular climate.
Answer: If the soil has been dry too, then yes you probably chose the wrong season
From this source:

Grow potatoes through the summer in cool northern regions. Grow
potatoes in fall, winter, and spring in hot summer southern regions.

and

The ideal temperature for growing potatoes is 60° to 70°F (16-21°C);
temperatures greater than 80°F (26°C) are usually too warm for
potatoes.
Answer: I don't live in South Africa, but I've never known any amount of heat (even much hotter than your stated temperature) in and of itself to shrivel up a potato plant (nor to make it disappear). Yes, heat can potentially make it less ideal to grow potatoes, though, but usually they still have nice green leaves unless there's something else along with the heat causing issues.
Other issues (such as diseases, pests, and nutrient imbalances) can make that happen, however, and they can potentially be worse when it's hot. Some diseases even get worse when there's more sun (especially if the roots are damaged, or the nutrient flow is obstructed).
As for the plants disappearing, that's probably unrelated to the shriveling; that sounds like a pest ate the plants.


Jenkins fails to start on Windows Server after Java Runtime update uninstalled older version of JRE

Question: I have a Jenkins Server running on Windows Server 2012 and Java prompted me to update to a newer version (jre1.8.0_261 to jre1.8.0_271) and during that install it asked to uninstall older versions (for security reasons) which I allowed it to do. When I restarted Jenkins service it failed to restart. Error log indicates this Informational message:
Starting C:\Program Files\Java\jre1.8.0_261\\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "C:\Program Files\Jenkins\jenkins.war" --httpPort=8080 --webroot="C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\war"
And this error:
Service cannot be started. System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at winsw.Util.ProcessHelper.StartProcessAndCallbackForExit(Process processToStart, String executable, String arguments, Dictionary2 envVars, String workingDirectory, Nullable1 priority, ProcessCompletionCallback callback, Boolean redirectStdin, LogHandler logHandler, Boolean hideWindow) at winsw.WrapperService.StartProcess(Process processToStart, String arguments, String executable, LogHandler logHandler, Boolean redirectStdin) at winsw.WrapperService.OnStart(String[] args) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
The informational message gave me a clue to the problem: Jenkins is pointing to the older version of Java location here: C:\Program Files\Java\jre1.8.0_261
However the folder is empty, most importantly there is no bin folder present (no doubt due to the aforementioned uninstall).
The newer version here has the full java binaries: C:\Program Files\Java\jre1.8.0_271
How do you get Jenkins to point to the new JRE?
Answer: There is a pretty simple solution: locate the Jenkins.xml file (for me its located at C:\Program Files\Jenkins\jenkins.xml) and edit it.
Locate the <executable> element and correct it so that it points to the new JRE path, for example in my case I changed
this <executable>C:\Program Files\Java\jre1.8.0_261\bin\java.exe</executable>
to this <executable>C:\Program Files\Java\jre1.8.0_271\bin\java.exe</executable>
Save file and Jenkins starts up fine now.
Answer: Refer to @Jeff Mergler's answer for primary sol'n.
We get around the whole problem by using a link. mklink /D C:Java\jre1.8 C:\Program Files\Java\jre1.8.0_261, and place that in the jenkins.xml. We install jdk manually first, then just stop all our apps, repoint the one link and start all our apps. Then remove old jdk. We also have a link for 8 and one for 11. We do the same on the linux side, where we lifted the solution from!
Also, based on Oracle's new licensing terms, you should be using something like adoptOpenJDK to not run afoul of Big Red's terms.
eg:
C:\Tools\Java>echo %JAVA_HOME%
C:\Tools\Java\jdk

C:\Tools\Java>dir
 Volume in drive C is L103437
 Volume Serial Number is 28B0-4574

 Directory of C:\Tools\Java

2020-10-28  12:43 PM    <DIR>          .
2020-10-28  12:43 PM    <DIR>          ..
2020-08-19  11:59 AM    <SYMLINKD>     jdk [jdk1.8]
2020-10-28  12:41 PM    <DIR>          jdk-220.127.116.11-openj9
2020-08-05  12:14 AM    <SYMLINKD>     jdk1.6 [jdk1.6.0_211]
2020-08-05  12:13 AM    <DIR>          jdk1.6.0_211
2020-03-11  01:31 AM    <DIR>          jdk1.8.0_231
2020-10-28  12:40 PM    <DIR>          jdk1.8.0_271
               0 File(s)              0 bytes
               8 Dir(s)  162,629,304,320 bytes free

C:\Tools\Java>mklink /D jdk1.8 jdk1.8.0_231
symbolic link created for jdk1.8 <<===>> jdk1.8.0_231

C:\Tools\Java>java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b32)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b32, mixed mode)

C:\Tools\Java>unlink jdk1.8

C:\Tools\Java>mklink /D jdk1.8 jdk1.8.0_271
symbolic link created for jdk1.8 <<===>> jdk1.8.0_271

C:\Tools\Java>java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b32)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b32, mixed mode)

C:\Tools\Java> dir

2020-08-19  11:59 AM    <SYMLINKD>     jdk [jdk1.8]
2020-10-28  12:44 PM    <SYMLINKD>     jdk1.8 [jdk1.8.0_271]
2020-03-11  01:31 AM    <DIR>          jdk1.8.0_231
2020-10-28  12:40 PM    <DIR>          jdk1.8.0_271

In the above example,
JAVA_HOME=C:\Tools\Java\jdk and PATH=%JAVA_HOME%\bin;%PATH%. jdk  is a sym-link, presently pointing to jdk1.8, which in the above example was reset from pointing to 1.8.0_231 to 1.8.0_271 ( Don't forget to include /D for directory link.
The jenkins.xml can reference the executable by any of:
<executable>java.exe</executable>
<executable>%JAVA_HOME%\bin\java.exe</executable>
<executable>C:\Tools\Java\jdk1.8\bin\java.exe</executable>
or if you want to validate against a specific version:
<executable>C:\Tools\Java\jdk1.8.0_271\bin\java.exe</executable>
Comment: Added example details
Comment: Hey, @jeff-mergler., how about an Upvote and/or Accepted for my response ? Thx.
Comment: this is interesting! How are you referencing the link created by `mklink` in `jenkins.xml`?


Score for answering a question: 15pts + # of question upvotes

Question: Upvoting questions would increase the likelihood that someone would answer it.  Its a variation of the "put bounty on someone else's question" suggestion.
Comment: Or leftvoted questions!?
Comment: @Welbog: I rightvoted your last comment.  That's what the little flag is for, right?
Comment: What about downvoted questions?
Comment: @Pesto, no, that's for frontvoting, dummy.
Comment: @Welbog: You insulted me, so I should flag the comment.  But on the other hand, I already needlessly flagged one of your comments.  I guess it's a wash, you jerk.
Comment: MY friends please. There's no need for name calling. You're both equally jerkish and dumm-esque. Can't we all just agree that I'm still better than you are?
Comment: @devinb: I'll agree to that on the grounds that you accept that you suck and I hate you.
Answer: Would cause gaming. People would up vote questions they answer regardless of whether or not it is a good one simply because there is a chance it would benefit them.
Comment: So make it +1 for everyone who upvoted it other than the one who supplied the chosen answer, if he indeed upvoted it.
Comment: I'm not following you. If people are aware that upvotes give more rep to accepted answers, but not if it's their own upvotes, then the only upvotes questions will get will be legitimate upvotes and pity upvotes, both of which they get already.
Comment: Why? I don't see how that follows. Do you think that people who answer questions upvote the question as a kind of bribe to have their answers chosen? They will be well aware that their upvotes won't apply if their answer is accepted. If anything it almost makes me think people will *not* upvote questions they answer to prevent other answers from getting the extra +1.
Comment: Yeah, I never considered how it would come full circle, you're right in that aspect. However personally I'm still against the idea because of the bias some question types get towards up votes.
Comment: I didn't think about the bias. It would weigh subjective and C# questions more than they already are, probably. But then again it would encourage lots of answers to really good questions. I don't know. I really don't know if it would be a good thing or a bad thing. Questions that get a lot of upvotes necessarily have gotten a lot of views, and probably have higher chance of being answered anyway (someone should check the latest dump to prove/disprove that), so there's probably no need to provide more incentive to have them answered.
Answer: At first I misread this as 15 points + 10 x question upvotes, which I totally disagree with because it overvalues the upvotes.
But with a small extra incentive, maybe this is the nice middle ground between offering bounty on others' questions and the current system.
A couple questions for clarification:

How would you have them work with the rep cap?  The same way as accepted answers always do?
Suppose a question is at +3, and you get the accepted answer: +18 for you.  Then, two more people come along and upvote the question.  Do you get 2 more rep for those upvotes?
What about downvotes?  Is it fair if they have no effect on this system?
Comment: Well, generally questions with a lot of downvotes get a lot of traffic, so good answers to downvoted questions will probably get more upvotes than if the questions weren't downvoted. Probably. So the lack of a bonus would be offset by this tendency. At least, it seems to me that downvoted questions get a lot of traffic.
Answer: As noted this would be highly open for gaming. But that's not my concern.
This encourages noise. Lots and lots of noise. Questions with a lot of upvotes already have interest and answers. Tendency has already become that for any question with 5+ answers, at least two of them will be content-identical.
This solution provides more of an incentive to answer questions that don't need the help. On the other hand, there are questions with one or no upvotes because they aren't glamorous or sexy, and there's one answer so they do not show up on the 'unanswered' list anymore.
Those are the questions that need extra help, because there isn't interest in them. It's hard to come up with a solution that doesn't involve gaming, but those questions need help.
There was a recent question "What should I do if my partner aligns his brackets wrong", when I saw it, it had 6 upvotes. So, a lot of people would then want to add their two cents, in order to get a shot at getting the extra bonus.
Answer: Perhaps this can only apply to questions which are over a certain age. Maybe they gain additional "Accept" points the longer they stay unanswered, which would encourage users to dig around in the older "unanswered" bin to find some additional rep and close out the languishing questions that have fallen off the front page.


Helper Method detect post - comment from user

Question: I'm trying to create a helper method that will display  {user.name} has no submitted posts." on the profile show view of user if they haven't yet submitted any posts and display the number posts they have . currently on my show view i have <%= render @user.posts %> which displays nothing when there are 0 posts submitted.
the partial for post is :

  <%= render partial: 'votes/voter', locals: { post: post } %>

      <%= link_to post.title, topic_post_path(post.topic, post) %>
      <%= render partial: "labels/list", locals: { labels: post.labels } %>

      submitted <%= time_ago_in_words(post.created_at) %> ago by <%= post.user.name %>

      <%= post.comments.count %> Comments

ive tried :
  def no_post_submitted?(user)
      user.post.count(0)
      "{user.name} has not submitted any posts yet."
  end

on my user show view :
<%= if no_post_submitted?(@user) %>
<%= render @user.posts %>

which im more than sure is wrong but i have no idea how to implement this method .
Answer: Where you are using render @user.posts you can just add a simple conditional:
<% if @user.posts.empty? %>

<%= @user.name %> has no submitted posts

<% else %>
  <%= render @user.posts %>
<% end %>

There wouldn't be much point creating a helper for this unless you need to use it in multiple places.
Comment: Thank you very much this did the trick . i figured but for some reason i thought making a helper method would make this easier but not really.
Answer: Render collection returns nil if the collection is empty so you can use the || operator:
<%= render @user.posts || "{@user.name} has not submitted any posts yet." %>

Or if there is more code render another partial:
<%= render @user.posts || render 'no_posts' %>

Answer: In Ruby methods automatically return the last value so this method:
def no_post_submitted?(user)
  user.post.count(0)
  "{user.name} has not submitted any posts yet."
end

Will always return a string - if you use a string literal in a condition it will be evaluated as true with the warning warning: string literal in condition. Also that is not how you use count - passing 0 will cause it to query on column 0 or just error.

http://apidock.com/rails/ActiveRecord/Calculations/ClassMethods/count

So to fix the method you would do:
def no_post_submitted?(user)
  user.posts.empty?
end

However that conditional is so simple that it does not really warrant a helper method. Instead you would just write:
<%= if user.post.any? %>
  <%= render @user.posts %>
<% else %>
  <%= "{user.name} has not submitted any posts yet." %>
<% end %>

Answer: There are a couple of problems with your solution. Remember, rails is more about convention over configuration.
Your method no_post_submitted? should actually return true/false since its a method ending with ?. Also it should be named no_posts_submitted? for clarity. It should look something like this:
  def no_post_submitted?(user)
    user.posts.count > 0
  end

Then, there should be another helper method that will print your required message, Something like:
def no_posts_message(user)
  "{user.name} has not submitted any posts yet."
end

And eventually you can all plug it in like this:
<% if no_posts_submitted?(user) %>
 <%= no_posts_message(user) %>
<% else>
 <%= render @user.posts %>
<% end %>

Answer: As per the docs:

In the event that the collection is empty, render will return nil, so it should be fairly simple to provide alternative content.

Products

<%= render(@products) || "There are no products available." %>

--
So...
  <%= render(@user.posts) || "#{@user.name} has not submitted any posts yet." %>


C - passing an unknown command into execvp()

Question: I'm writing a fake shell, where I create a child process and then call execvp(). In the normal shell, when I enter an unknown command such as 'hello' it returns 'hello: Command not found.' However, when I pass hello into execvp(), it doesn't return any error by default and just continues running the rest of my program like nothing happened. What's the easiest way to find out if nothing was actually run? here's my code:
if(fork() == 0)
{
     execvp(cmd, args);
}
else
{
     int status = 0;
     int corpse = wait(&status);
     printf(Child %d exited with a status of %d\n", corpse, status);
}

I know that if corpse < 0, then it's an unknown command, but there are other conditions in my code not listed where I don't want to wait (such as if & is entered at the end of a command). Any suggestions?
Answer: All of the exec methods can return -1 if there was an error (errno is set appropriately). You aren't checking the result of execvp so if it fails, the rest of your program will continue executing. You could have something like this to prevent the rest of your program from executing:
if (execvp(cmd, args) == -1)
    exit(EXIT_FAILURE);

You also want to check the result of fork() for <0.
Answer: You have two independent concerns.
1) is the return value of execvp. It shouldn't return. If it does there is a problem. Here's what I get execvp'ing a bad command. You don't want to wait if execvp fails. Always check the return values.
int res = execvp(argv[1], argv);
printf ("res is %i %s\n", res, strerror(errno));
// => res is -1 No such file or directory

2) The other concern is background processes and such. That's the job of a shell and you're going to need to figure out when your program should wait immediately and when you want to save the pid from fork and wait on it later.


Should I use Unity for a "non-game" mobile app?

Question: I have some experience with Unity but I always made games only. Right now I have an idea for an app but I don't think Unity is the most efficient way to do it. Probably Android SDK and OpenGL ES would be better but I have to learn them. So should I learn a new tool or should I stick with what I already know and get this thing done?
Answer: This is very dependent on the app. Unity is not only useful for games, but it should still be something game-like (eg. an architectural walkthrough). For a typical mobile UI app, I would recommend something more like Xamarin
Comment: But which do you think is an easier tool Xamarin or Android SDK?
Answer: This questions is a bit overly broad, but the simplest answer is use the best tool for the job. If you don't think Unity can best suit your application, use the technology that will.