In what situation can the U.S. military use nukes without the consent of the President?

Question: In what situation can the U.S. military use nukes without the consent of the President, if any situation like this exists?
Answer: Generally, the decision is reserved for the President as Commander in Chief. All other conditions are to assure secure communications and the rule of succession.

The Vice President can only decide if the President is (temporarily or permanently) unable to decide. The 25th Amendment and the Presidential Succession Act define the order of succession.
There might be a breakdown of communications which leaves the US military unable to contact the President or his or her lawful successor. In the past, the US president pre-delegated launch authority to the military if certain conditions were fulfilled.
There is the custom of having a designated survivor away from mass gatherings of the President and most other successors. If something were to happen that kills or incapacitates the President, but leaves a person higher up than the designated survivor alive, then that person higher up is in charge. The designated survivor is just someone in the line of succession who has been briefed and put in touch with strategic communications.
Today a confirmation of a launch order by a second individual is required. As I understand it, this does not in any way limit the authority of the Commander in Chief, it is merely a procedure to authenticate the integrity of the launch orders.
There are media reports that during the last days of the Nixon presidency, cabinet officials conspired to take the solitary launch ability away from the President. That was arguably treason criminal, but push never came to shove.
Comment: What if a US nuclear submarine cannot reach anyone in the command structure? For example, [UK submarines have written orders from the PM which are to be opened in case](https://www.bbc.com/news/newsbeat-36824917) they can't reach anyone in the UK. Does the US not have such orders?
Comment: @JJJ: US SSBN warheads have [Permissive Action Links](https://en.wikipedia.org/wiki/Permissive_Action_Link) and will not detonate without authorisation codes that aren't on board the submarine. So the US relies on its communications, and spends a lot of money on them. The UK can't afford such a communication system, so they don't use PALs and the subs could launch independently. They're just trusted not to do so.
Comment: @JJJ, that would be another case for my second bullet point. But the US considered their communications more survivable than the British ones -- London was much closer to the Soviet Union.
Comment: "That was arguably treason, but push never came to shove." Strictly speaking, disloyalty by someone to prevent them from carrying out a war against a country that the nation isn't currently at war with isn't treason (as define in the constitution), although I'm sure that it would be a crime of some sort.
Comment: @JohnDallman, as I understand it a PAL primarily makes sure that a missile warhead will only explode after a missile launch and missile flight (and not in the tube or in the back of a van). For subs, the communication system makes sure that the crew can know if they should turn the key or not.
Comment: @o.m.: That's safety fusing, not the PAL. See the link.
Comment: @JohnDallman, I had thought of the environmental sensing device as part of the PAL. But it seems it doesn't have to be to make a PAL a PAL.
Comment: @o.m.: Of course, if you have physical access to the weapon, one can always bypass the security systems given some effort.


Surface mount power outlet under kitchen sink

Question: Can I surface mount a power outlet under the kitchen sink?  Or does it have to be a box that sits on the surface of the cabinet wall?
Answer: In the US under the NEC:
A receptacle or other box in a sink base or other cabinet can be either surface mount or flush. There is no requirement or restriction for either.
Comment: Again, maybe the downvoter can explain what was incorrect about this answer. I don't care about the two points, but I am curious as to why someone thinks this is wrong.
Answer: A box can be mounted below the counter top (on the face of the cabinet) not more than 12" below the counter top 210.52.5 exception 5.
Comment: Can that box be mounted on the floor of the cabinet directly below the garbage disposal?
Comment: I think part of the question is *surface mount*. Code generally requires that for surface mounting, only armored cable, conduit or metal raceways and surface mont type boxes be used in most areas, especially where NM cables could be damaged.
Comment: That is if the cables are accessible from the same side of the surface as the surface mounted box.  If the surface mount box is supplied from behind the surface, then regular NM is fine.  It you can look under your sink and see NM (non-armored) cable, then you're at risk of failing inspection.
Comment: What you quoted is for a required counter-serving receptacle and is not relevant to the question. He's asking about putting on inside the cabinet under the sink.


Does SSMS follow the same support lifecycle as SQL Server?

Question: I've found information about the support lifecycle for SQL Server (such as this page for SQL Server 2008/2008R2), but haven't found any information about SSMS. Does SSMS follow the same support lifecycle?
Answer: In the past, the releases lined up - each new SQL Server was accompanied by a new Management Studio.
However, in June of 2015 (concerning SQL Server 2016 and onwards) MS announced separate life cycles:

With the release of SQL Server 2016 Community Technology Preview (CTP)
  2.1, customers can for the first time experience the rapid preview model for their on-premises SQL Server 2016 development and test
  environments and can gain a faster time to production.
In addition, we are delighted to announce our first "preview" release
  of SQL Server Management Studio!  This is our first effort to release
  SQL Server Management Studio (SSMS) in a mechanism outside of the SQL
  Engine releases.  Our goal is to update this frequently with new
  features, fixes and support for the newest SQL Server features in SQL
  Server Engine and Azure SQL Database.

From the MSDN Blog on SQL Server Releases.

Based on your edit to be about support life cycles, I'm not sure that question has an answer since this new direction has been implemented (concerning future releases). As for past SSMS releases, I don't think I know of any updates or support to SSMS after the corresponding SQL Server version has been phased out - so I'd say it's safe to assume they align.
Comment: Ah, sorry, I was asking about support lifecycles (of existing releases) rather than release cycle. I've updated the question to make it clearer.
Comment: @MarkRaymond Added some more that is more relevant to your revised question.
Answer: From BOL (SSMS Release notes), recent versions of SSMS are outside of SQL Server release.

release of SQL Server Management Studio (SSMS) is a stand-alone install outside of the SQL Server release. Our goal is to update this frequently with new functionality, fixes, and support for the newest features in SQL Server and Azure SQL Database.

As far as support is concerned, I would suggest to use the latest release of SSMS.


Docky "Enable Compositing" error and black bar visualized instead of it

Question: I get this black bar across the bottom of my screen when ever I boot up, tried reboot and no joy, keep getting messages from docky telling me to "enable composting". Was using dual monitors before this happened, take the monitor out and i'm stuck with this
Answer: Docky requires a Compositing Window Manager to function properly.  The black bar you see across the bottom is the area where Docky would be showing up if it could run.  The usual compositing window manager for Ubuntu is Compiz, which can be enabled via System > Preferences > Appearance.  From there you can try to enable "Normal" or "Extra" desktop effects in the "Visual Effects" tab.
If Compiz won't play nice with your graphics card, you can enable Metacity's compositing, which will at least allow Docky to run normally. To do this, press Alt+F2, then run gconf-editor. On the left side, browse to apps > metacity > general, then check the box next to "compositing_manager" on the right.
Comment: As a side note, I'm not sure why unplugging a monitor would break compositing, since it sounds like it must have been working before.  You might want to  try reconfiguring your monitor setup in System > Preferences > Monitors.
Comment: Actually, it fixed my problem. Using metacity is everything I need on this little box.
Comment: +1'd from me 2. You actually helped get past this issue on DEBIAN!!!


Maximising windows in dual-monitor setup

Question: I'm using a dual-dual setup and would like to have youtube videos running maximised on one screen while freeing up the other screen for my IDE. However, as soon as I click the mouse the youtube video will revert back to regular size. Is there a work-around for this?
Answer: mplayer can be given a URL to a video and it will handle the download and display.  To get the real URL to a YouTube video, you can use youtube-dl with the user-facing URL (http://youtube.com/watch?v=XXXXXXXX).
So, knowing that, the way I get fullscreen videos under firefox is by using a helper script that feeds the youtube video to mplayer, via the launchy extension that allows sending links to an external application.
To configure launchy, I create a file in ~/.mozilla/firefox/*/chrome/launchy.xml that will create a contextual menu entry in firefox:
<?xml version="1.0" encoding="UTF-8"?>
<configurations xmlns="http://launchy.mozdev.org/configurations">
        <application>
                YouTube to mplayer
                <type>1</type>
                <command>/path/to/bin/yt_mplayer.sh</command>
        </application>
</configurations>

Then, this yt_mplayer.sh script will handle the rest:
#!/bin/bash
URL="${@}"
YT_URL=$( youtube-dl -g "${URL}" )
xterm -T "YouTube-MPlayer from Firefox" -e " \
  echo -e Parameters : \"${URL}\n${YT_URL}\"; \
  mplayer -msgcolor -cache 10000 -cache-min 25 \"${YT_URL}\"; \
  read -p '<Return>' foo \
"

I like to open a xterm to be able to see what's happening with mplayer (especially the buffering stage); that could be skipped if you prefer.
This method has not only the advantage of giving you full control over your video, but also saves CPU cycles as mplayer has much better performance than browser players.
Comment: Great response -- works a treat! Any idea how you could do the same for non-youtube and/or live streams?
Comment: youtube-dl supports more sites than just youtube (see http://rg3.github.io/youtube-dl/documentation.html#d4 for a list), but for live streaming, where they often use RTMP, I know of no automated way; often these sites *want* their stuff to be obfuscated.


Is it safe to keep volcanic sulfur at home?

Question: Took some sulfur stones while hiking on a volcano. Keeping them at home as a piece of decore. Is it safe to store it on a shelf? Can it ignite or somehow do harm to me or to my pets?
Comment: Why might it not be?
Answer: Short answer:
Assuming it is sulfur (likely, but I'm not addressing other compounds in this answer) you should be fine as long as you keep it away from heat (melts at a low temperature and is somewhat flammable).
I've had a chunk of sulfur in my house for about 40 years and never had an issue with it.  I'm pretty sure most of the cleaning products in the house are more dangerous.
Long(er) answer:
From the sulfur MSDS (PDF):

Sulphur is relatively non-toxic to humans, causing only mild local
irritation to the eyes, nose, throat and upper airways. However, under
certain circumstances it may release toxic hydrogen sulphide and/or
sulphur dioxide gas. Sulphur is not listed as a carcinogen by OSHA,
NTP, IARC or ACGIH.
Both molten and solid forms are combustible and will ignite at high
temperatures (>200°C), burning with a pale blue flame that may be
difficult to see in daylight. Sulphur dust suspended in air ignites
easily and can cause explosions in confined spaces. Sulphur dust
clouds can be ignited by friction, static electricity, heat, sparks or
flames. Traces of hydrogen sulphide and sulphur vapor may present an
explosion hazard if evolved into a confined space or enclosed space,
particularly from molten sulphur. The LEL of hydrogen sulphide (4.3%
by volume in air) may be exceeded in enclosed spaces above molten
sulphur.

See also the precautions section on Wikipedia.
Comment: To add to this, it would probably be best to keep any sulfur in an air tight container so it doesn't react with moisture in the atmosphere. Some moisture absorbing silica gel, or similar should also be placed in the same container. Such reactions would produce minor amounts of sulfuric acid, even a vapors, & degrade the sulfur. It would also be best to keep any sulfur away from materials that could corrode, such as iron or steel as any sulfuric acid vapor would deleteriously affect such items.
Answer: This article states that volcanos can deposit heavy metals along with water vapor and sulfur compounds:

When volcanoes erupt they exhale a cocktail of gases – mostly steam, carbon dioxide > and sulphur dioxide – laced with evaporated heavy metals, including lead and
arsenic. To the communities living alongside volcanoes, these gases are often a
considerable source of air pollution and the volatile metals they carry may have
long-lasting impacts on both health and environment.

It's probably best to secure them from being picked up by little hands as they tend to put items (especially their dirty fingers) back in their mouths.
Answer: This won't be a problem if you store it properly.
Make sure it's away from your children..

If it's exposed to the skin it can cause itching

If it's consumed it can cause diarrhea

I suggest you to save it in a jar


What is the precise difference between state and environment and memory?

Question: I was just reading this question regarding the difference between environment and memory. However, the textbook in question, Essentials of Programming Languages, third edition, by Friedman and Wand, also has chapter 4 State, which, as it says, discussed the concept of state. But, as far as I can tell, it doesn't seem to explicitly differentiate between environment, memory, and state, and it is unclear to me what the difference is. What is the precise difference between state and environment and memory?
Answer: Very informally:
An environment is a set of pairs (variable+value) that are accessible to a particular object/process during its execution.
A memory is a set of "locations" in which an object/process can read/store information. Usually a location is associated with a variable and the value of the variable is stored in that location (or in several locations).
The state of an object/system is the set of values of the properties (variables) of the object/system in a particular point in time (during an execution or process).
The big picture:

variables are logical "names" for values that can change in time (modified during the execution). They are called constants (from the viewpoint of a particular object/process) if the object/process cannot modify them.

environment refers to a set of variables from the viewpoint of an object/process; the object/process can read or (if allowed) modify them. Note that the emphasis, when talking about "environment", is usually on the "variables", not their (current) values.

memory is the place where variables are stored. Note that memory is a concept that is at a lower (implementation) level. To define a high-level programming language there is no need to "talk about memory" unless you need to implement it on a real architecture; but it can be useful to understand other concepts such as variables or arrays.

state is a "dump" ("snapshot") of the variables+current values (hence implicitly also a dump of the memory where they are stored) in a particular point in time of the execution/process
Answer: I believe you can consider state and environment to be the same thing. The difference is mostly when writing logical deductions. The environment is the context that makes a given proposition true and may be a just a part of the global state. What memory introduces is aliasing; $A[i] = x$ may be falsified by a preceding $A[j] \leftarrow y$ if $i = j$. Without memory you don't have aliasing and the value of a variable is always the last value assigned to it.


How do you like the new Ribbon Controls in D2009?

Question: How do they compare to the DevXpress ones or the original MSOffice ones.
Are they worth investing time in them (for practical usage now, not academic curiosity which I'll do anyway)?
Answer: From my experience, the new ribbon control implements the entire specification as laid out by Microsoft.  The only issue I noticed was a slight flicker when the form was resized which caused one of the sections to collapse or expand.
Worth spending time in?  Definitely, as they are lighter weight and its a matter of time before someone gets rid of the flicker (could be as simple as a lockwindowupdate inserted in the source?).  It doesn't hurt to use the Delphi action manager, from which all is based.
Comment: Yep, I also notice that slight flicker on my Windows XP machine, but not on my Vista machine (which also happens to be a lot faster).  It happens for me when I change tabs too.
Comment: Don't misuse LockWindowUpdate() for that.
See http://blogs.msdn.com/oldnewthing/archive/2007/02/22/1742084.aspx .
Answer: The only problem I can see with them so far, is the lack of Glass Frame implementation on Windows Vista (see my question here), unless someone has found a way to make that work.  The only part which may not be a problem for youself is there doesn't appear to be a way to customise the theme, which I know some people would like to do in their applications.
Answer: IMO, the DevExpress ribbon control is much more complex than it needs to be.  i own the DevExpress ribbon control but converted to using the delphi TRibbon.  the delphi TRibbon isn't perfect either but i've learned to avoid these problems.


When I should use PCA?

Question: I have a data set with 60000 rows and 32 columns. I want to use SVM (with some more constraints that make it more complicated)and I think 32 columns are too large. So I decided to use PCA. But when I load PCA, the first 20 component describe 85% of data which 20 variables still is too large I think, but it is better than 32.
I am wondering is that ok if I use PCA? when n>>m? if not what is a better option?
Comment: Why is 32 columns "large"? Even by (extremely sketchy) rules of thumb, you have a ratio of 1875 observations to one variable. That is more than reasonable IMO. What I would recommend: try PCA, keep how ever many components you think is reasonable, and validate your model properly. If there is improvement over not using PCA, go with PCA. You can even set the number of components to retain as a tuning parameter itself (pick number of components to whatever validates the best), or retain the PCA variables + original columns as well and fit a regular SVM on the combined dataset.
Comment: I would further advise that the cost parameter in your SVM is crucial and can (usually) adequately control the "complexity" of the fitted boundary. You may not need to do any feature extraction/selection; in fact it might make your model worse.
Answer: If you can, go for some non-linear dimensionality reduction technique. The most powerful are Autoencoders, but you can also use t-SNE or other manifold techniques.
The problem of PCA is that it can extract only latent factors that are linearly associated with your variables. Using non-linear techniques, less variables can let you capture more of the original variance.

When I should use PCA?


What factors should I consider when choosing an IIR filter realization?

Question: IIR filters may be implemented as direct form 1 or 2. But how do you decide which form to use? What are the pros and cons of each?
Comment: @Drazick, GPUs are a whole different game. requiring another quesiton.
Comment: Moreover, what is the best way to implement them on GPU.
Answer: First of all, a bit from wikipedia on Direct Form I and II implementation.
Direct form I requires more memory, but is a somewhat simpler strategy, and is less likely to have round-off and resonance problems.
Direct form II requires less memory, but it has the potential for unusual interactions, larger numbers, and more round off error. Much of this can be reduced by cascading smaller filters, especially 2nd order filters.
Comment: In either case, you should be cascading second-order sections.
Comment: Super weak answer IMO. Technically it answers the question... but only "technically". I would like to see some source code in a language. I know how to implement an FIR filter that is easy. Let's see IIR source code.
Comment: Also, in terms of mathematical operations performed per sample, which is a better implementation I or II?
Comment: So, in short, is it memory vs round-off error trade-off?
Comment: i know how to do FIR filtering. i also know what is direct form I/II/III/IV. what i don't have experience doing is IIR: design or implementation. My original comment was not very constructive. I should have said "I understand what is direct form I-IV, would you please talk more about how you design/implement an IIR filter?"
Comment: @Trevor: Feel free to add to my answer, or create your own.
Answer: A little dated but may deserve a more comprehensive answer, especially since Direct Form II can get you into a lot of trouble.
First of all, there is no "one size fits all" and the best choice depends on your specific application and constraints. What you can consider is

Memory: Direct Form II and Transposed Form II take a little less state memory then Direct Form I and Transposed Form I but in a cascaded second-order section implementation the difference is minor
MIPS: In terms of number of multiplies and additions, all four implementations are the same. However depending on the instruction set of the specific processor, there can be significant differences in implementation efficiency. So "it depends".
Fixed Point properties: This makes a huge difference. Primarily you have to make sure that your state variables don't overflow so you need to analyze the transfer function between in/output and the state variables. Here Direct Form I and Transposed Form II are the clear winners. State variables are bound to +106dB or thereabouts vs input and output. In direct Form II for example, the transfer function from input to state is given by the poles only. I have seen real world examples where this can actually exceed 100 dB of gain. This is an absolute no non for fixed point implementation.
Noise: In terms of truncation and round off error, all implementations are roughly the same. The state variable transfer function problem mentioned in 3) also affects this to some extend and I have seen audible noise issues with Direct Form II filters even when using 32-bit floating point.

So in summary Transposed Form II is more often than not the best choice. In some fixed point scenarios, especially if there are significant noise problems Direct Form I is better since it can more easily augmented with things like Error Spectrum Shaping, etc.
Comment: I figured out today - in a much harder way - why Direct Form I is a better choice for my application. Thanks for a really good answer!
Comment: This is a much more comprehensive and better answer!
Answer: Unless your working with a very resource-scarce system or have extreme requirements it really doesn't matter in practice whether you choose direct form I or II. For instance, if you're doing stuff on a PC or a smartphone it really doesn't matter. Personally, I prefer Form I.
The real issue is normally MIPS and if you plan to do a fixed-point implementation things get more complicated. For instance, on ARM your IIR filter will consume much more MIPS if both coefficients and filter states are 32-bits. 32 bits in states and coefficients is a requirement if you need to implement for instance a low-pass filter with very low cut-off frequency. In those cases you can use a different type of filter, such as for instance a state-variable filter.
Answer: Aside from the technical differences such as numerical accuracy, there is also the issue of stability. When digital filters have pole/zero pairs close to each other, the frequency response can become unstable at various locations (usually approaching Nyquist or approaching zero).
When IIR filters are used for musical applications, the choice of realization can have a profound effect on filter stability when filter parameters are modulated in real time (for example, varying the cut-off frequency on a low pass filter).
I have an open source application that lets you listen to the differences, while time-varying parameters such as cutoff frequency or peak gain, of each of the following realizations:

Direct Form I
Direct Form II
Transposed Direct Form I
Transposed Direct Form II
Lattice Form
State Variable

The project is here:
https://github.com/vinniefalco/DSPFiltersDemo.git
https://github.com/vinniefalco/DSPFilters.git
Comment: You've posted this several times, and I'm inclined to enforce spam policy unless your answers are actually tailored to the questions. None of these posts answer questions directly, and also promote a product. Edit them to directly answer the questions or they will be removed.
Answer: In addition to the comments above about memory, MIPS, noise, and stability; there is another factor that is commonly overlooked.  This factor is reset capability; which happens to be very important in most of my situations.
With a Direct Form II implementation, there are no states for the delayed outputs, therefor if you "reset" a Direct Form II filter to say "5", it's initial output is not going to be 5.  I find this to be quite counter-intuitive which has caused some serious frustration when using Simulink.  For this reason I almost always use a Direct Form I implementation.  Unfortunately Simulink only supports Direct Form I if you have the DSP toolbox, and even then it still doesn't let you set the initial conditions from an input signal.


How do I permanently reset the time zone in Debian?

Question: Dreamhost seems to think that we like PDT, despite being in the Midwest. How do I change the timezone?
Answer: A tool I found to be easier to use is dpkg-reconfigure. Use:
sudo dpkg-reconfigure tzdata

You will be given a multitude of choices, including some that are not included in tzselect.
Comment: This is good stuff, but if you need a non-interactive (and therefore scriptable) option, see my answer below.
Comment: A benefit of doing it this way is that you are doing it in a reproduceable way and limit the chances for doing something wrong like putting in a timezone that does not exist.
Answer: This is presumably a bit late for the OP, and more intended for other searchers who arrive here.
If you need a non-interactive solution, try this solution from changing timezone with dpkg-reconfigure tzdata and debconf-set-selections
echo "Europe/Zurich" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata

You can figure out your timezone by poking around in /usr/share/zoneinfo.  In fact the dpkg-reconfigure command above copies the appropriate file from there to /etc/localtime.  I used to just do that manually, and it seems to work fine.
Don't be too surprised if long running processes don't pick up the change.  eg Apache log timestamps come to mind.  Consider whether that matters, and hence whether you need to restart running processes or even reboot.
Comment: Beware that for this to work, it's a requirement that `/etc/localtime` does not already exist. If it exists and is a softlink to `/usr/share/zoneinfo/whatever`, it's taken as base and it is `/etc/localtime` that is updated accordingly, overwriting your changes.
Answer: To edit it non interactively on recent Debian and Ubuntu versions (Stretch/Xenial etc.), you need to remove /etc/localtime as well, otherwise /etc/timezone will be overwritten.
echo 'Europe/Zurich' > /etc/timezone
rm /etc/localtime
dpkg-reconfigure -f noninteractive tzdata

This answer is based on mc0e' answer. I can not add a comment with my reputation.
Answer: TL;DR
echo "TZ=Etc/UTC" >> /etc/environment
tzconfig

where Etc/UTC is your preferred timezone you found using tzselect.
Longer version
When you're using
dpkg-reconfigure tzdata

the timezone information is not kept after reboot. You can verify your settings with
diff -s /etc/localtime /usr/share/zoneinfo/`cat /etc/timezone`

If you're only updating /etc/timezone, the update won't be consistent with /etc/localtime, thus it's better to execute
tzconfig

Use tzselect to find out which time zones actually exists (or simply browse /usr/share/zoneinfo directory).
In POSIX systems the TZ should take precedence before /etc/localtime:
export TZ='Europe/Berlin'
$ date
Tue Apr 10 08:51:03 CEST 2018
export TZ='Pacific/Efate'
$ date
Tue Apr 10 18:28:33 +11 2018

Using directly TZ can save you many system calls as frequently used date/time related functions has to access filesystem each time some program asks for current date. It's a micro-optimization, but quite simple one.
Comment: @amn No, that won't create a symlink, I've tried to clarify that. But `$TZ` variable is read by `glibc` functions: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
Comment: Are you positive exporting `TZ` in your profile file creates a symlink? That does not sound true at all in my experience. Perhaps you meant "Also make sure to create the symlink..."?
Comment: shouldn't it be `echo "TZ=Etc/UTC" >> /etc/environment` ? you're missing `TZ=` part... (if case someone is still running  ancient debian versions). Also, noninteractive stuff like daemons would still use `/etc/localtime` version instead of one set in `TZ`...
Comment: @MatijaNalis Yes, you're right. Thanks for correction!


Use Automator to run Python script when files added to folder

Question: I have a folder, Books, where I add all of the .pdf files that need to be uploaded to a Kindle. I have a Python script that does that, but instead of manually running it, I want to check whenever files are added to Books, run that Python script. Is there any way to do this using Automator, or even without Automator?
Answer: Launch Automator, and choose 'Folder Action' as the document type.
Then set the target folder in the drop-down menu at the top of the window.
Add a "Run Shell Script" action. You have to choose one of the 'shell' environments in the drop-down menu, which include either the system python /usr/bin/python (which is v2, and EOLed); or a Unix shell, where you can call the python script externally, with something like:
/usr/local/bin/python3 <path to python script> "$1"

Alternatively to using the Run Shell Script action, you could use the AppleScript action with a do shell script command.
Save your workflow. The workflow is saved to ~/Library/Scripts/Folder Action Scripts
You can configure Folder Actions for any folder by right-clicking in the Finder and selecting "Folder Actions Setup".
(I have had intermittent success hacking the saved workflow in a text editor, and altering the 'shell' path to another environment. /usr/bin/swift works, but /usr/local/bin/python doesn't. More work required.)
Comment: I have done everything you said, and I am running it from the zsh shell. When running the Python script from the Automator though, (pressing the run button at the top-right), a subprocess in the Python script fails to work. It says
`FileNotFoundError: [Errno 2] No such file or directory: 'ebook-convert': 'ebook-convert'`
ebook-convert is the command I am running in the subprocess. Is there any way to fix this?
Comment: Are you quoting the full path for this subprocess? From my testing, I wouldn't rely on any assumptions about relative paths.
Comment: I am quoting relative paths, but in my shell Automator script, I change directory to the required directory, I also just tried it with full paths and it didn't work.
Comment: Also, I changed all of the relative paths of absolute paths, and it continued to work when I executed it in the Terminal `python3 kindle.py` but now, in Automator, it gives error 127 when running the subprocess.
Comment: Hello! Thanks for the help! So I understood what was happening. For some reason, ebook-convert wouldn't work for the shell script, so I had to use the full path to the command, which was `/Applications/calibre.app/Contents/MacOS/ebook-convert`, then the arguments, which worked!


How do I edit the top link nav bar in Sharepoint Online?

Question: There is a top level nav bar on our Sharepoint Online intranet site that I cannot seem to edit in any of the menus that I have found. Can anyone offer some advice on how I might remove these links? Unfortunately the developer was a contractor who is long gone and we have no internal support for Sharepoint so I am stuck with dead links that need to be removed.
Answer: If you are talking about the links (locations, about us etc) , they can be modified easily. They must be coming from either Managed navigation or Structural navigation. You can find it by navigating to site settings-> Navigation(Under look and feel)-->Global Navigation settings. If it is marked as Managed navigation, then you should head to the term store management, site settings--> term store management(under Site administration). If it is marked as Structural navigation, then you can choose one from the available options.
If the Global Navigation settings link is missing from the admin page, you can go directly to the admin url: /_layouts/15/AreaNavigationSettings.aspx
If you are talking about the Icon like links(Employee hub,Social etc), then the master page should be holding these. You can modify/remove these by editing the html version of the master page.
Comment: I just wanted to say that I came here from Google and your answer was extremely helpful. Thank you.


HTML Improvements Duplicate title tags in images

Question: For my website Google Webmaster Tool is showing more than 700 duplicate title tags. All are images url. I am in a trouble, because I have uploaded all images to wp-content/uploads. But in WMT the link of images are indexed as url of the post added with alt text of the image as attribute. I don't know from where they are coming from, as I have uploaded them on wp-content/uploads. What should I do to get rid of. Anyone who helps me will be appreciated. This website is on WordPress.
Answer: You are reading this message wrongly. What it is telling you is that multiple pages on your site have duplicate TITLE tags (the ones in your HEAD). Since they are duplicates, it means that you haven't provided anything to distinguish one from the other. This means that users searching Google will see nearly identical results for both pages. WMT is suggesting that you page something different to distinguish them. It seems like what is happeing is that you are using the same title for multiple pages. Maybe you can just add ' - Page 1', ' - Page 2', etc to each of those pages.
UPDATE: OK, it appears that all of your images have been uploaded twice. You want to delete all of the images which end in '*-2'. After you've done that most of those duplicates should disappear. You may need to remove them from the Media Manager in WP to make them fully disappear. If you've linked to any of these duplicates then you'll need to update your links in your blog as well. I hope this is something that can easily be taken care of manually.
Comment: The content may be images but they are being delivered as part of a full webpage. This is an image: http://www.howto-connect.com/wp-content/uploads/windows-8-start-screen-settings-screen1.png and this is a webpage: http://www.howto-connect.com/how-to-add-administrative-tools-to-the-windows-8-start-screen/windows-8-start-screen-settings-screen-2/ . There is a big difference.
Comment: thanks for response mr. krowe. I have not repeated same title in any page. These links access image pages but not post. As you can see    http://www.howto-connect.com/how-to-add-administrative-tools-to-the-windows-8-start-screen/windows-8-start-screen-settings-screen-2/    as well as  http://www.howto-connect.com/how-to-add-administrative-tools-to-the-windows-8-start-screen/windows-8-start-screen-settings-screen/. All the links are accessed in image pages.
Comment: I am unable to understand from where these links came. as i have uploaded all my images in wp-content/uploads
Comment: but I have uploads only images. From where these urls are coming out, I am totally confused.
Comment: Actually these links are coming from media library. each media file has created a link as shown above. But what could be the solution. please. can anyone suggest me for solution?
Comment: See my update for the solution to get rid  most of your duplicate titles.
Answer: WordPress has a "feature" where it creates a page for every image you upload.  This page is useless and WordPress really shouldn't be doing that.
Luckily plugins can fix the problem.  For example Yoast has the ability to redirect the image page URLs to the image itself.  See https://kb.yoast.com/kb/redirect-image-attachment-urls/
If you use a plugin to get rid of the page for each image, you won't have this duplicate title problem anymore.


I have a light on my dashboard and am told it's gearbox oil which I am not sure of. Need your help please

Question:  I have this light on in my Honda fit but I do not know what to do. Need your help please.
Answer: Yep, that means the gearbox oil is due for replacement. It comes on after the appropriate distance interval since the last change has been covered, if I recall correctly the number indicates how far over the interval you've driven. If I'm right on that I think you need to get the fluid changed ASAP, 4600km over is really far!


Is it possible to construct a quasi-vectorial space without an identity element?

Question: I mean if there is any construction that satisfies all the conditions for an vectorial space except it lacks an identity element? This questions was posed to me by a classmate last semester and I have been puzzling over it since then.
Comment: What do you mean by "identity element". Do you mean the zero vector? Then you also need to drop the condition that vectors have "additive inverses".
Comment: See also https://math.stackexchange.com/a/479005/589
Answer: In an old sci.math post by Dave Rusin, he discusses dropping sundry axioms form the usual set of axioms of vector spaces. What is below is taken from there.
So, let's recall what axioms we are dealing with: normally, a vector space $\mathbf{V}$ over a field $\mathbb{F}$ is defined to be a set, together with operations $+\colon\mathbf{V}\times\mathbf{V}\to\mathbf{V}$ and $\cdot\colon \mathbb{F}\times\mathbf{V}\to\mathbf{V}$, written in their usual infix notation, which satisfies the following conditions:

For all $x,y\in\mathbf{V}$, $x+y=y+x$.
For all $x,y,z\in\mathbf{V}$, $(x+y)+z = x+(y+z)$.
There exists a vector $\mathbf{0}\in\mathbf{V}$ such that for all $x\in\mathbf{V}$, $x+\mathbf{0}=x$.
For each $x\in\mathbf{V}$ there exists $y\in\mathbf{V}$ such that $x+y=\mathbf{0}$.
For all $x\in\mathbf{V}$, $\alpha,\beta\in \mathbb{F}$, $\alpha(\beta x) = (\alpha\beta)x$.
For all $x\in\mathbf{V}$, $1x = x$.
For all $x,y\in\mathbf{V}$, $\alpha\in\mathbb{F}$, $\alpha(x+y) = \alpha x + \alpha y$.
For all $x\in\mathbf{V}$, $\alpha,\beta\in\mathbb{F}$, $(\alpha+\beta)x = \alpha x + \beta x$.

You cannot just drop 3, because that would make 4 unintelligible. A way around it is to replace 4 with another statement which, in the presence of all other axioms, is equivalent to 4; namely:

4'. For all $x,y,w\in\mathbf{V}$, if $y + x = w + x$, then $y=w$.

That is, we have right cancellation. (This is important; if you set up cancellation on the "other side" as the identity, you run into some difficulties below)
Note that if you have 1-8, then you get 4'. And if you have 1-3, 4', and 5-8, then you get 4: first, note that since $\mathbf{0}+0x = 0x = (0+0)x = 0x + 0x$, then 4' implies that $0x = \mathbf{0}$. Then given any $x\in\mathbf{V}$, we have $x + (-1)x = (1+(-1))x = 0x = \mathbf{0}$, so 4 holds in this case. That is, 1, 2, 3, 4', 5, 6, 7, and 8, are an alternative way of defining vector spaces, with the added advantage that now you can drop any of the eight and the remaining statements are still intelligible.
If you take 1, 2, 3, 4', 5, 6, 7, and 8, then you can construct objects that are not vector spaces and satisfy any seven of these and not the eighth.

All but 1: Take $\mathbf{V}=\mathbb{R}$, and define scalar multiplication by $\alpha x = x$, and $x+y = x$ for all $x$ and $y$.
All but 2: Take $\mathbf{V}=\mathbb{R}^2$, define scalar multiplication the usual way, and
$$x+y = \left\{\begin{array}{ll}
(0,0) &\mbox{if $x=(0,0)$ or $y=(0,0)$;}\\
|\cos(\theta)|(x+y) & \mbox{if $x\neq(0,0)\neq y$, and $\theta$ is the angle from $x$ to $y$.}
\end{array}\right.$$
All but 3: Take $\mathbf{V}=\emptyset$, with the empty addition and multiplication!
All but 4 or 4': Take $\mathbf{V}=\mathbb{R}\cup\{\bigcirc\}$. Define addition so that it is the usual addition in $\mathbb{R}$, and $r+\bigcirc=\bigcirc+r = r$ for all $r\in\mathbb{R}$, and $\bigcirc+\bigcirc=\bigcirc$. Scalar multiplication is regular multiplication on $\mathbb{R}$, and $r\bigcirc = \bigcirc$ for all reals $r$.
All but 5: Take $\mathbf{V}=\mathbb{R}$, and let $\sigma\colon\mathbb{R}\to\mathbb{Q}$ be any additive homomorphism of abelian groups. Define addition as usual, and scalar multiplication by $r x = \sigma(r)\cdot x$, where the multiplication on the right hand side is the usual real multiplication.
All but 6: Take $\mathbf{V}=\mathbb{R}$ with the usual addition, but zero multiplication: $\alpha x = 0$ for all $x$ and all $\alpha$.
All but 7: Take $\mathbf{V}=\mathbb{C}^2$, addition defined the usual way, and scalar multiplication given by:
$$\alpha(x,y) = \left\{\begin{array}{ll}
(\alpha x,\alpha y) & \mbox{if $x\neq 0$,}\\
(0, \overline{\alpha}y) & \mbox{if $x= 0$.}
\end{array}\right.$$
where $\overline{\alpha}$ is complex conjugation.
All but 8: Take $\mathbf{V}=\mathbb{R}$ with usual addition, and scalar multiplication $r x = r^2\cdot x$, where the multiplication on the right hand side is the usual multiplication of real numbers.

Okay, but "All but 3" was almost cheating. What if we require that $\mathbf{V}$ be nonempty? Then you cannot have a structure that satisfies 1, 2, 4', 5, 6, 7, and 8, and does not satisfy 3:
Suppose $\mathbf{V}$ satisfies 1, 2, 4', 5, 6, 7, and 8, and is nonempty. Let $x\in V$. Then for all $y\in V$, we have:
\begin{align*}
(0x + y) + 0x &= 0x + (0x+y) &\quad&\mbox{(by 1)}\\\
 &= (0x+0x) + y &\quad&\mbox{(by 2)}\\\
&= (0+0)x + y &&\mbox{(by 8)}\\\
&= 0x + y\\\
&= y + 0x &&\mbox{(by 1)}
\end{align*}
By 4', this means that $0x+y = y$, so $\mathbf{0}=0x$ shows that 3 is satisfied.
Comment: @Raskolnikov: If that's the case, then of course the answer is "modules!" (over rings without identity).
Comment: Very nice post. By the way, it could be that with "identity element" he actually meant the multiplicative identity of the field. So, what he's asking might be just "Can we make vector space like structures over something else than a field?". But I'm just guessing. Anyway, +1!
Comment: It would be helpful to explicitly state whether or not these are the same examples given by Dave Rusin (so e.g. readers know whether or not they will miss anything by skipping Dave's post). This cannot be quickly determined by a reader.


Calendar module translation

Question: I have installed the Calendar module and would like to translate a few fields:

At the above screenshot, I'm looking for the day strings ("Sun", "Mon", "Tue", Wed",...). I've been searching everywhere, but can't find where they are located.
Where can I find these strings so I can translate them in the language I prefer?
Answer: Go to Administration > Configuration > Regional and language > Translate interface and search for !day-abbreviation. Then translate these strings to the language you prefer.

Calendar module translation


Do stuns prolong the effects of untargetable abilities

Question: If a vladimir is affected by veigars event horizon or morgana's soul shackle while he is in his sanguine pool,does it prolong the effect and duration of him being untargetable since he is stunned in the current condition?
Answer: No the effect is not prolonged.
According to:

http://leagueoflegends.wikia.com/wiki/Vladimir/Ability_Details

It states that:

When in Sanguine Pool, Vladimir is still stunned when passing through  Veigar's  Event Horizon. If he does this, he will remain in his pool for its duration and remain stunned when coming out if the stun has not expired.
Answer: The "Stunned" condition does not alter animations or affect any other abilities that are currently playing.
This means that "stunned" characters can still appear to "take" actions that were started before the stun went off.
This means that abilities that make you untargetable are not lengthened by stuns -- when the untargetable spell finishes, your champion will become targetable again, playing the appropriate animation (such as coming up from the pool) even while "stunned".
It's the same reason why Corki's Valkyrie, or Tristana's Rocket Jump still continue to move, even if they are stunned while starting the ability.


"Refresh" Question

Question: Since technology develops at such a quick pace these days, it seems that the answers to many questions, including those which received useful responses at the time they were asked, can be updated based on recent developments. For example, someone might have asked for a book recommendation on a given topic in 2010, but by 2012, there might be a better one on the market. Perhaps there should be a way of "refreshing" a question to learn whether a fresher answer is available?
Comment: I've retagged as [tag:discussion], [tag:feature-request] is for when `You have an idea for a new feature, or for a change to the existing functionality.` - from its [tag wiki](http://meta.programmers.stackexchange.com/tags/feature-request/info). Since you are not telling us of an exact way this could work i.e. describe how the feature would work, I think [tag:discussion] is more appropriate.
Answer:
For example, someone might have asked for a book recommendation on a given topic in 2010, but by 2012, there might be a better one on the market.

I think that questions on book recommendations that would fit your description are probably off topic. I don't see how a book question that becomes deprecated in such short time would be a good one, even if it's on topic. Technology may be moving at an extreme pace, but high level concepts don't change that often.
Do you have any examples of existing open questions that would fit your description, i.e. are in need of "refreshing"?

Perhaps there should be a way of "refreshing" a question to learn whether a fresher answer is available?

You can edit any question at any time, and any answer, if you think you're improving them in any way.
You can ask a new question with a link to the earlier question and an explanation why it and its answers don't answer the new one.
And of course, if you have a more current answer to an outdated question, you can always just answer. A new answer will bump the question at the top of the homepage and if your answer is a good one it will get the attention it deserves. It may even outvote the previously highest voted one.

In conclusion: If questions that fit your description exist, they are probably bad ones that slipped through and we should clean them up. I think - but I reserve the right to change my opinion if you provide an example of an existing question.

I've tried to find questions that would fit the general description while still being on-topic, and I think the best example is certifications. It's reasonable that there are going to be a lot of cases where answers on certification exam x in 2010 are going to be very different than in 2012. Most reputable certification bodies will slightly change the code or the title of the certification / exam, in which case you should ask a new question.
Even if that's not the case, I don't think that the set of questions that actually need "refreshing" is large enough to require some sort of unique approach.
Again, if you manage to find at least one existing question that fits the description and is on topic, all of the above may make less sense. But although I tried, I didn't find any (not even a certification one).
Comment: my book example was - an example. If you want a better one, suppose that in 2010 I ask which is the best programming language to use for natural language processing, and say that the most popular response is that python would be the language of choice. Now, in 2012, someone else comes along and has **the same exact question** and sure enough he finds my question and the answers provided, but he wonders whether those responses still hold for 2012 or things have changed; in other words, he wants to know how people would **presently** respond to the question. Hope that makes things clearer.
Comment: Hmmm... If you feel there's actual need to clarify the question, add any and all clarifications there - update it, instead of responding with a comment, so everyone will see the clarification, that doesn't always happens with comments. But I was more asking for an example of an existing question. We can't really argue hypotheticals, too many factors to take into consideration. But I think the example above would fit finely under the "You can ask again, with a link to the earlier question and an explanation why it and its answers don't answer your new question." category.
Comment: @IsaacKleinman I've updated my answer to clearly show I'm asking for examples of existing questions.

"Refresh" Question


Comparing backtesting returns with real trading returns

Question: I have 10 years of backtested simulated performance of some trading strategy (using historical prices), and N months of actual trading performance. What statistical test can I do find out if I'm on target with the backtesting numbers? (both, in terms of expected annual returns and expected annual Sharpe ratio)
Answer: Letting $\psi_1, \psi_2$ be the sample Sharpe ratios of the two periods, the difference $\Delta \psi = \psi_1 - \psi_2$ is asymptotically normal. Under the null hypothesis that the population Sharpe ratios in the two periods are equal, the difference is asymptotically mean zero. The standard deviation is approximately $\sqrt{\frac{1}{120} + \frac{1}{n}}$, when your Sharpe ratios are 'annualized' to monthly terms. So the simplest test would be to reject the null if $|\Delta\psi|> 1.96 \sqrt{\frac{1}{120} + \frac{1}{n}}$.
My answer here is just a realization of @drnexus' answer to this question.
Comment: I would like to amend my answer to state that a slightly more 'precise' version of the test is available via the upsilon distribution: http://arxiv.org/abs/1505.00829 . However, the 2-term approximation to the CDF of the upsilon is exactly the asymptotically normal approach given above.


Is there any way to change the size of preallocate data file in mongodb?

Question: In mongodb data files are preallocates to a particular size,like first data file .0, the next .1, etc. The first file mongod allocates is 64 megabytes, the next 128 megabytes, and so on, up to 2 gigabytes, at which point all subsequent files are 2 gigabytes. Is there any way the default size can be change to 2GB? if so what will be the impact on the performance.
Answer: There is no way to specify your own sizes, the only way to alter the sizes of data files is to specify (or not) the smallfiles option.  That will bring the file sizes down to 25% of the default (max of 512MB rather than 2GB etc.)
You can pre-allocate the files yourself in advance (with dd, fallocate or similar).  I have a sample bash script using fallocate for just such a purpose here on GitHub. You still have to do the progression of sizes up to 2GB first, then allocate the remainder at 2GB though.  If nothing else, full pre-allocation would let you determine if allocation is having any kind of impact on your testing.


How to join a Minecraft Server on Xbox 360?

Question: I know there are Minecraft servers on PC right? There are lots of stuff I wanted to try out on the servers but the problem is I'm on Xbox not PC. Are there any servers on Xbox? If so, how can I join them? Please I'm just a normal player and I don't know really everything about the game.
Answer: I believe servers on Xbox 360 and PlayStation do not exist. You can add someone via Xbox live and they can invite you to they're single player world though.
Hope I helped.


Could electrons tunnel into protons in a white dwarf and turn it into neutron star?

Question: Just like the Sun, where hydrogen ions tunnel into each other to start fusion, which would be otherwise impossible with this level of kinetic energy, could electrons inside a white dwarf tunnel into protons and turn it into a neutron star? Actually I want to know if the Pauli Exclusion Principle can prevent quantum tunneling so I used a compact star as an example.
Comment: There is no Coulomb barrier between an electron and a proton - they are attracted to each other, not repulsed.
Comment: @JonCuster: English is second probably third language but in any case I removed the sentence ;D
Comment: @user6780 - no problem, I'd hate to try and write a technical question in French or Dutch anymore...
Answer: The process you describe is called inverse beta decay or neutronisation. No tunnelling is required because there is no potential barrier keeping protons and electrons apart. The Pauli Exclusion Principle isn't relevant because protons and electrons are distinguishable particles.
There is however an energy deficit; the rest mass of a neutron is greater than the combined masses of an electron and a proton. The electrons therefore need to be mildly relativistic to make the reaction go ahead.
However, there are no free protons in a white dwarf interior, they are instead inside carbon and oxygen nuclei. The energy penalty to convert a proton to a neutron in these stable nuclei is even higher and the electrons need to be highly relativistic (e.g. an electron Lorentz factor $\gamma \sim 27$ for neutronisation of carbon nuclei).
Such conditions occur at very high densities in the degenerate electron gas in a massive white dwarf. When the electron Fermi energy reaches the threshold energy for neutronisation, then free electrons are removed from the gas, softening the equation of state and either leading to the collapse of the white dwarf (into a neutron star) or its thermonuclear ignition and destruction in a type Ia supernova.


How can I widen a wall to match the width of the beam it supports?

Question: My steel beams are 4-1/4" wide. If I run my framing under the beam with 2x4 framing, I'll end up with a 3/4 overhang on one side of the wall. How do I make up this gap? Just use furring strips or is there another method?
Comment: Aren't you forgetting the drywall? 3 1/2" 2x4 + 3/8" thick drywall x2 comes out to 4 1/4".
Comment: Make up the gap for what purpose? If you're looking to enclose the entire thing with drywall, the answer depends partly on how you want to wrap the beam and whether there's lumber against the beam above and below. Photos would help.
Answer: Simply use 3/4" furring strips. There is typically a wood plate above the beam which may need furring as well, that will allow the top edge to be nailed or screwed securely.
Answer: User3757614 is correct that it was an intentional dimension, though I wouldn't use anything less than 1/2" drywall for anything but a strip here and there.
Alternatively and if you want the beam in the wall so you can run up to the ceiling, then you should use 2x8's or larger to stud your wall and notch-out for the beam wrapping. This, will still give you something to screw into and be solid.
A final option is to do a double stud wall or a wall on each side of the beam. But, it's twice the work and typically only needed if you're soundproofing a theater room or loud Man-Cave.


How can i get the status of product in magento cart by customer id and product id?

Question: I want to get the status of customer cart for a particular products that is products added in his cart or removed. I have loop of products and each products have customer and i have customer_id , product_id now i want to check that is this products added in customer cart or not.
Answer: Ad the following method to needed class:
<code>public function getProductInCart($customer, $productId, $storeId = null)
{
    if (!$customer instanceof Mage_Customer_Model_Customer) {
        $customer = Mage::getModel('customer/customer')->load($customer);
    }

    if (!$customer->getId()) {
        return false;
    }

    if ($storeId === null) {
        $storeId = Mage::app()->getWebsite(true)->getDefaultGroup()->getDefaultStoreId();
    }
    $quote = Mage::getModel('sales/quote')->setStoreId($storeId)->loadByCustomer($customer);

    if (!$quote->getId()) {
        return false;
    }

    foreach ($quote->getAllVisibleItems() as $item) {
        if($item->getProductId() == $productId) {
            return true;
        }

    }
    return false;
}
</code>
Using example:
<code>$this->getProductsInCart(customer_id, product_id, store_id)
</code>
Comment: Not working for me i have create a custom module for admin section to verify the products that customer reserve before checkout and i will approve that i try user function and i dont have any storeId and default is is showing 1 so can you please let me know in which table the cart is saved  Then i can check directory from that tables using custom query based on productId and customerId


Desktop Environment that scales GUI according to DPI and monitor size

Question: Does anyone know if there exists a DE that scales GUI based on DPI and monitor size? There's a 15" 4K laptop and 27" 4K monitor that I want to use side by side. My distribution of choice is Linux Mint with Cinnamon, but it clearly calculates the number of pixels to use for GUI elements based on the laptop screen size (or even hardcoded values maybe based on resolution and DPI) and uses those numbers regardless of what's the actual size of the monitor. So everything is almost twice as large on the 27" monitor. Are there other DEs that are better at this? Thanks!
Answer: Gnome + Wayland support this. See How to set per-monitor scaling on Wayland?.
Note that  apps that use XWayland (most non-gnome & non-kde, like Firefox etc.) don't re-scale properly yet.
If a ratio of 2x does not work for you, There will soon be support for fractional scaling as well. It is experimental in Gnome 3.26.
Alternatives:

Work on KDE + Wayland scaling is not as advanced right now AFAIK.
Under X11, you can achieve something usable with some manual work with xrandr. See Is it possible to have two different DPI configurations for two different screens? or Configuring mixed DPI monitors with xrandr


Issue restarting a Windows service

Question: Hi I made some changes in a windows service coding side(some class files related to that),,means i did coding to fetch version value from registry in that class files,,,,After
Answer: Your OnStart method is most probably hanging. Did you recently add any of that threading/timer code.
Is your tracer logging any information?
Can you write some debug code to log where you are getting to and what exceptions are being thrown?
Answer: So it looks like OnStart is throwing an exception (in SpoER.Init()?, and it has permissions problem as well), this is causing the service to try and stop straight away.
I would suggest following the exception information you have given to try and locate the problem. It would be even better to move the bulk of this code into a separate class so you can write a console app which shares the same code as the service. By using the console app you can easily debug it.
Answer: Now i got the mistake,,What actually i was doing is i am copying DLL created in the debug mode  and copying into the Installer path..Actually what i need is i have to copy DLL obtained from the release mode and copy into the installer side

Issue restarting a Windows service


Craft on Heroku with buckateer as a middleman for Amazon S3

Question: We are using Craft on Heroku and wants to use S3. The problem is that we want to use a Heroku element (buckateer) as a middleman. Buckateer only gives you an IAM user without listbuckets permissions. So you get "S3::listBuckets(): [AccessDenied] Access Denied". Is there a smart and easy way to set the bucket manually without going into the core files?
Answer: I found a solution that lets you overwrites the core file S3.php without touching the core files.
By adding this snippet to config/general.php
// S3 override
const BUCKET_NAME = 'YOUR BUCKET NAME';
require_once('../craft/plugins/gm/S3.php');

return array(
   ...
);

And duplicate the S3.php file and add it to the plugins folder you can make the needed changes.
Comment: That is clever. Not clean, but definitely clever.
Comment: I know, but as long as it works and is simple for the front-end developers here.
Answer: Sorry, there's not a clean way of doing that in Craft 2. What you can do, though, is manually create an entry for the Asset Source in the craft_assetsources table in database.
This is improved in Craft 3, so, yay!


Do you need to know in detail the last papers of your future PI in preparation for a postdoc interview?

Question: I have an interview for a postdoc position next week. The project was running for 9 months or so and they already have some preprints out. This specific position says that the researcher will work closely with the 3 PIs, so it broadens the area for me a little bit since each one has different research areas. Do I need to know in detail the papers that are out in this project? I'm asking this because I've noticed that people say "do your research and look at the latest publications of your future lab".
Comment: I think asking in details about the papers is unlikely, and silly.
Comment: How many preprints are we talking about here? But, yes, you should read them to get a reasonable idea of what they are doing and where they might be going.
Comment: I have found 3. But these papers, that are important, don't directly align with the project's aim, or at least, they are a bit general.
Comment: If they are all you have to go on, what else can you do?
Comment: Nothing really, I am reading the papers. Can I expect a question about these papers?
Answer: In an interview for a postdoc, you should be able to explain two things:
First, what your future research plans are (and why this topic is right for you, due to your past work or other background).
And, second, why you chose to apply for this position, and why you think you are a good fit (or rather, the fit) for the position. This implies that you know what is going on research-wise in this place, and that you can explain how you both will be able to add to the research performed there, and how the topics researched there will help you to form your research profile (first point).
To this end, it is essential that you know what is going on in the place, and what your potential future PI and their group are working on.  However, this does not mean that you have to study the most recent papers - it is more important that you have the big picture of where their research is heading. Of course, knowing their most recent papers in more detail does not hurt, but a PI will usually not expect you to impress on specific details of one paper.  And it might well be that the last 3 papers, for some reason or the other, don't accurately reflect on their primary research interest.  In that case, saying how interesting you find [topic of the paper] could even be counterproductive.
Answer: The advice "look at the latest..." is good advice. Whether it is necessary to do depends entirely on the views of the PI. They may care deeply, or not at all. Certainly it is better to be as prepared as possible, even if their main concerns are elsewhere.
If the position is competitive, then it is likely that other candidates will be as prepared as they can. Due diligence, I guess.
Even if you only bring questions about those papers to the interview you will be better off than being completely unprepared.
Answer: You can flip it around and ask: 'Is it reasonable to apply to a post doc position without doing some basic research on your future boss and workplace?' I would think not.
That said, for none of my post doc interviews any detailed knowledge of the papers from the lab was unnecessary. It was much more important to have a big picture idea about the general topic and to be able to follow any contribute to a conversation about that research area.


How to display contents of mounted /boot and '/' root partitions?

Question: How to display contents of mounted /boot and '/' root partitions of Debian on SSD drive from Linux Live CD?  I know ls -1 to list directory contents, but what is exact steps to get this?
Answer: Mounting a HDD
To mount a HDD that's physically connected to your system, you first need to identify the device handle that's been assigned to it. I typically use the command line tools blkid or lsblk to find out this information.
blkid
$ sudo blkid
/dev/sda1: UUID="XXXXXX" TYPE="ext4"
/dev/sda2: UUID="XXXXXX" TYPE="LVM2_member"
/dev/mapper/fedora_greeneggs-swap: UUID="XXXXXX" TYPE="swap"
/dev/mapper/fedora_greeneggs-root: UUID="XXXXXX" TYPE="ext4"
/dev/mapper/fedora_greeneggs-home: UUID="XXXXXX" TYPE="ext4"

lsblk
$ lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                         8:0    0 465.8G  0 disk
├─sda1                      8:1    0   500M  0 part /boot
└─sda2                      8:2    0 465.3G  0 part
  ├─fedora_greeneggs-swap 253:0    0   7.7G  0 lvm  [SWAP]
  ├─fedora_greeneggs-root 253:1    0    50G  0 lvm  /
  └─fedora_greeneggs-home 253:2    0 407.6G  0 lvm  /home
sr0                        11:0    1  1024M  0 rom

So we can see from the above that I've got a ext4 partition on /dev/sda1, and a LVM partition on /dev/sda2. Since you're interested in your /boot device, that's typically formatted as a ext4 partition, so to mount it:
$ sudo mount -r /dev/sda1 /mnt

And it should be accessible to you under /mnt as a read only directory.
Mounting an ISO
If on the other hand you'd like to mount an ISO, you can do so, by using the mount command, along with the loop option.
$ sudo mount -o loop <some.iso> <mount point>

Example
$ sudo mount -o loop VBoxGuestAdditions_4.3.10.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only

And you can now see the ISO's contents:
$ ls -l /mnt/
total 57016
dr-xr-xr-x. 2 root root     2048 Mar 26 14:04 32Bit
dr-xr-xr-x. 2 root root     2048 Mar 26 14:04 64Bit
-r-xr-xr-x. 1 root root      647 Oct  8  2013 AUTORUN.INF
-r-xr-xr-x. 1 root root     6966 Mar 26 13:56 autorun.sh
dr-xr-xr-x. 2 root root     2048 Mar 26 14:04 cert
dr-xr-xr-x. 2 root root     2048 Mar 26 14:04 OS2
-r-xr-xr-x. 1 root root     5523 Mar 26 13:56 runasroot.sh
-r-xr-xr-x. 1 root root  9901516 Mar 26 14:01 VBoxLinuxAdditions.run
-r-xr-xr-x. 1 root root 20784640 Mar 26 14:14 VBoxSolarisAdditions.pkg
-r-xr-xr-x. 1 root root 16900432 Mar 26 13:55 VBoxWindowsAdditions-amd64.exe
-r-xr-xr-x. 1 root root   311584 Mar 26 13:46 VBoxWindowsAdditions.exe
-r-xr-xr-x. 1 root root 10463320 Mar 26 13:47 VBoxWindowsAdditions-x86.exe

Comment: I tried mount command, bit it says "mount: only root can do that"
Comment: @triwo - Correct, you need to prefix it with `sudo`. I realized I left that out. I added it, sorry about that.
Comment: And unmounting also requires `sudo` prefix?
Comment: @triwo - correct. Only root can mount/unmount.
Answer: ls /boot
ls /

… however you might want to expand upon your question, as Debian / SSD drive / live CD are (more or less) irrelevant to listing directory contents. Maybe you're asking where the boot and root partitions from a live CD are mounted, e.g. /mnt/gentoo and /mnt/gentoo/boot?.
Comment: Debian on SSD drive not booting, and I want to list contents of these partitions (on SSD drive) using Live CD. How to mount and unmount partitions for this?
Answer: If the files you want to look at are in an ISO, mount the ISO in Windows as a Virtual CD.  Once you use the LiveCD as an installer, you cannot view the filesystem as the contents are extracted to RAM or /tmp (still in RAM) and then mounted as / and boot, thanks to the SqushFS.  Note that viewing the mounted ISO in Windows will show squashfs as a file, although you can't see what is in it.


How to Configure DHCP to Assign a Specific IP Address to a MAC Address in IOS

Question: How can I manually configure DHCP to give a certain IP address to a specific MAC address in Cisco Packet Tracer?  I know how to configure DHCP, but I don't know the configuration which is used give an IP address to a specific MAC.
Comment: Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: Simple:
<code>ip dhcp pool (hostname)
   host (ip address) (netmask)
   hardware-address (mac)
</code>


aws data pipeline testing tools

Question: Our team is building an AWS product which uses several sets of tools like Lambda, SNS topics, EC2, data pipelines etc. I would like to know what type of testing tools/strategies that can be used to perform integration testing on these services. For an example integration of two lambdas and how they perform when they are integrated. I did an R&D and found out that for unit testing we can use AWS toolkit plugin in Eclipse but that covers only the unit testing. I want to perform an integration testing on this. Your answers are highly appreciated.
Answer: Let me revive this topic so others can contribute and I'll share few cents of my recent experience.
Firstly I think the important bit is to TEST the application under test - could be an API, a process or GUI hosted or supported by any of the above AWS services.
Our efforts must be more centered on achieving the quality outcomes than the cool ways to access these services using code.
The reason why I say that is you'll end up spending more tine trying to solve how to code to access and use those services (lambda, EC2, SBS) than the actual testing.
Quickest alternatives like AWS CLI could be explored to use these services.
For example I had a similar situation to test some of my apps hosted by these services.
I used cypress.io and used cy.exec(<aws command>) to achieve the access and usage of aws services.
Ex: cy.exec('aws s3 ls').then((data) => {
cy.log(data)
// this prints your s3 buckets in json format
})

That was the most simplest of examples. Use them as commands and pass your object names (S3 bucket names or topic names) dynamically if you don't want to hard code.
Answer: AWS Data Pipeline is a web service that you can use to automate the movement and transformation of data. With AWS Data Pipeline, you can define data-driven workflows, so that tasks can be dependent on the successful completion of previous tasks. Quickest alternatives like AWS CLI could be explored to use lambda, EC2, SBS services.
You can use cypress.io and cy.exec to achieve the access and usage of aws services.
Components of AWS Data Pipeline work together to manage your data:

A pipeline definition specifies the business logic of your data management. For more information, see Pipeline Definition File Syntax.
A pipeline schedules and runs tasks by creating Amazon EC2 instances to perform the defined work activities.
Task Runner polls for tasks and then performs those tasks. For example, Task Runner could copy log files to Amazon S3 and launch Amazon EMR clusters.

AWS Glue is a managed ETL service that you control from the AWS Management Console.ETL is a three-step process: extract data from databases or other data sources, transform the data in various ways, and load that data into a destination.
In the AWS environment, data sources include S3, Aurora, Relational Database Service, DynamoDB, and EC2. Amazon Redshift is a data warehouse and S3 can be used as a data lake. ETL testing support integrations with non-AWS data sources through graphical interfaces, and offer attractive pricing models.

aws data pipeline testing tools


Are there any terms equivalent to 'Americana' for other cultures?

Question: Given the available definition of Americana as pertaining to "artifacts, or a collection of artifacts, related to the history, geography, folklore and cultural heritage of the United States", are there any equivalent terms which pertain to folklore and cultural heritage of locales or cultures other than those of the United States?
Comment: While this isn't exactly about demonyms, it's closely related to them so I added the tag.
Answer: There are three suffixes principally added to a concept to represent all things relating to that concept:

-ana  (or -iana) : (Forming plural nouns) denoting things associated with a person, place, or field of interest: Americana, Victoriana

Examples in the wild include Australiana, Canadiana, Kiwiana, and Rhodesiana, noting that Rhodesiana applies specifically to Rhodesia and not the modern state of Zimbabwe.
This seems to be the most productive suffix, and a web search will turn up a scattering of results for collection of + Egyptiana, Hiberniana (for Ireland), Israeliana,  Vietnamiana, and even South Africana.

-ica : a collection of things that relate to a specific place, person, theme, etc.

This is an older lot, but some terms in active use include Hebraica and Judaica (pertaining to the Hebrew and Jewish people), Hispanica (Spain), and Nipponica (Japan), although the last sounds dated to me. Japonica is a word, but seems only to refer to plants originated in Japan.

-ia : 2. things derived from or relating to (something specified): militaria

I could not think of any examples in current usage for a particular country. It is suggested to be more productive than -ica, but since so many countries already end in -ia or -a, it would not make a suitable derived form in this particular set.
Answer: Australiana has an almost identical meaning for items of historical and cultural interest from Australia. It is also the name of a famous (in Australia) comedy skit from the 80's by Austen Tayshus.
Answer: You might add Judaica to the same list.

the literature, customs, culture, etc, of the Jews.
books or artefacts of Jewish interest, esp as a collection.

The meaning is perhaps more restricted than Americana and Australiana, and incorporates a different morpheme, but is in the same ball park.
The morpheme -a, added to adjectives in -an, -ean, -ian, is not only restricted to demonyms, though.  One also has, for instance, Dickensiana, and Shakespearena.  In a similar vein, there is a collection of essays in defence of evolution by Asa Gray, called Darwiniana, and the popular name of one of Tchaikovsky's suites is Mozartiana.
Answer: A less colloquial alternative would be "material culture".
Comment: It feels like this is an answer to a different question, i.e. what is a less colloquial alternative to 'Americana'. I was looking for equivalent terms (which could be used in place of this term) which describe cultures _other_ than those of the United States.
Comment: Americana is, essentially, American material culture, but *material culture* can and is used to describe other cultures.  For example:  "Soviet material culture provides an interesting perspective on how the cold war was perceived by Russians."


Why there is only 4.5V at the 5V output of my arduino board?

Question: I have an Arduino Uno R3. At the 5V output port of the board with nothing connected and blinky running while powered through USB, I can measure only 4.5V. Is this normal? Or is there anything wrong with my board?
Comment: If it's directly powered from the USB with no on-board power supply then it should have been designed to run from the full range of USB power and 4.5V is OK.  If the board makes it's own regulated power from the USB and that's supposed to be 5V, then it's not OK.  Post a schematic of the board.
Comment: http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
Comment: i am a bit scared because I have once powered the board externally with wrong polarity. I don't know if that made any component faulty.
Answer: Now that you've posted the schematic, a straight answer is possible.  That schematic is a sloppy mess, but I know that's not your fault.  It doesn't say much about the folks that designed your arduino board though.  Yucc.  It makes you wonder what else they didn't pay much attention to.
The board can be powered from USB or a external supply.  When from USB only, there is a diode from the USB power to the "5V" supply.  The USB supply voltage is nominal 5V, but can be lower than what you actually measured in some cases.  What you measured is about expected with 5V from the USB then with a diode drop in series.
It looks like there is at least a reverse blocking diode (D1) at the external DC power input.  That means if you hook up the external supply backwards the board won't run but nothing will be damaged.  You therefore didn't break anything, at least due to providing the wrong external supply polarity.
Comment: @Majenko: A design may be optimized for cost instead of performance or robustness.  That by itself is OK as long as it's not pretending to be what it's not.  However, there is no excuse for a sloppy schematic, whether the circuit reflects something "cheap" or not.
Comment: "It makes you wonder what else they didn't pay much attention to." - you don't want to go there - frankly I'm surprised the Arduino boards even work at all!  The number of corners they have cut I'm amazed it's not round ;)
Comment: @Majenko what are you talking about?? :/
Comment: @0xakhil The "quality" of the Arduino design.
Comment: I knew there was a reason why I don't like the Arduino :)
Answer: Olin is wrong, there is no diode between USB input and 5V(i suppose he's talking about the internal diode of the T1 mosfet) . when there is voltage from the USB port, the MOSFET  will be turned on by the op amp (U5A) and this will bypass the internal diode of the mosfet. depending on the Rds(on) of the mosfet, there will be a series resistance between USBVCC and +5V and that is approxim. 70mOHM according to the mosfet datasheet
Answer: That'll be because your USB is only providing 4.5v.
That is perfectly normal and within tolerance.
In fact, the microcontroller will run happily from 3.3v should you wish it to.
Comment: Correct, USB power bypasses the 5V regulator. If 5V is desired you must provide an input voltage >= 6VDC (I believe) via the barrel jack or VIN header pin.
Answer: I had same issue, dead MOSFET was the reason.
I just removed it and solder wire there.
Actually it's not good way to fix, but it works, but you should not use external DC in with that fix.
It's just video to show problem (USB 5v in and 4.5 after MOSFET)
http://youtu.be/g3qYECB3tc8


Changing IOR for Subsurface Scattering in Cycles

Question:
I am using subsurface scattering node in cycles and want to change IOR of mesh (human muscle). But there is no option to do so. IOR option comes with Glass BSDF node but it changes my mesh appearance. Is there anyone how to to that?
Does anyone know physical background (formulas, or law) behind subsurface scattering node in cycles. How much light will penetrate, etc? I checked in blender wiki but it is not stated there.
Thanks
Comment: Refraction is when light get bent while traveling through an object. Subsurface scatering is when light enters the mesh and gets scattered inside. It does not "pass through" so to speak. there for their is no IOR(index of refreaction). Besides, refraction on a human muscle would just look plain weird...
Comment: Try using a Fresnel node.
Answer: Well, I'm really happy that you asked this question.  I decide to try using the Fresnel Input Node to modulate the various Input sockets of the SSS shader and the results are interesting.  Using Fresnel for the radius adds depth, but it does dampen the SSS effect for the front facing poly's, so maybe it would be better to mix this setup with a stock SSS node.  Using 3 Fresnel Nodes with different IOR values and a Combine node for the Radius not only adds depth but adds a tone gradient which makes the SSS results interesting I think.
Here is a basic setup which uses a model that I recently rebuilt for someone so it can be used with Cycles bake.
There is an Environment Texture set to a value of 3 and a front facing overhead sun light at about 11:00.
The model on the Left uses a stock SSS shader with radius values of 0.9, 1.5, 0.7. for the hair.  The values are 2.0, 1.45, 0.35 for the face.
The model in the center uses a Fresnel node plugged directly into the Radius of an SSS node so all 3 values have the same input.
The model on the right uses 3 separate Fresnel nodes to control the 3 values of Radius for the SSS node.  The Fresnel values are the same as the radius values for the model on the left.
It's subtle and mostly just visible at the edges the way I did it here, but if you put some effort into it you may get somewhere with this.
Answer: For materials like skin you don't use index of refraction but you use index of reflection. You can achieve this by mixing your sss node with a glossy shader and change the amount of 'glossyness' as you like. Then you plug a color mix into the roughness value of the glossy node. Then you plug in a fresnel node with the IOR value you want into the factor. Then if you change the value of your two colors you are able to control the amount of specularity based on the angle of the light.
Hope this is what you are looking for!
-Bert


Limit notation question

Question: lim(d^2 --> infty) d - 1 = infty
Is this valid notation, or must it be written using lim(d --> infty) instead? I would like to express that as d^2 tends to infinity, d - 1 tends to infinity as well. Is there a better way to write this?
Comment: It sounds to me then, like you are saying $\lim_{d \rightarrow \infty} (\sqrt{d} - 1) = \infty$.
Answer: Consider that $d-1
$ is a function of $d^2$. Why sould it be $\sqrt{d^2}-1$ and not $-\sqrt{d^2}-1$?
For the first one, you get the limit $\infty$ and for the second one, $-\infty$.
You should probably change your notation.
Answer: You can write
$$\lim_{d\to\pm\infty} d-1=\infty$$
or more accurate
$$\lim_{d\to\pm\infty} d-1=\pm\infty$$
or if you want
$$\lim_{d^2\to\infty} d-1=\infty$$

Limit notation question


What is the Token Standard used by the balances pallet to issue the native token for the chain in the substrate kitchen sink node?

Question: We are using the kitchen sink substrate node with the standard balances pallet. No changes. The chain mints native tokens using the usual processes. My question is: what token standard is used in the standard Substrate balances pallet? ERC-20, or BEP or EVM Compatible? Or something else? I have not seen this discussed.
Comment: I believe that token standards are specific to smart contracts and therefore DOT and other Substrate based tokens from the balances pallet do not use a token standard. Can anyone confirm that?
Answer: I don't think any external 'token standard' is applicable here. If you would like to know what kind of operations are supported you can look at the traits implemented by balances pallet: Currency, LockableCurrency, ReservableCurrency.
Comment: Thank you, Adam!


Buying a phone in Turkey instead of registering old phone: what happens to the latter?

Question: I'm a foreigner who is going to live in Turkey for 9 months. After two weeks here I bought a SIM card and I received the usual messages about the registration. If I remove the SIM and put it in a phone I purchased here, will my previous phone get blocked or will I still be able to use it with no card?
Comment: Could you clarify what you mean by "use it with no card"? Are you asking if you can still make phone calls (for example) from your old phone even when it has no SIM?
Comment: No, I clearly do not intend to use it for calls if I remove the SIM. If I transfer it to a phone I buy in Turkey (I plan to use it as a router most of the time anyway), would my old phone *somehow* stop working? Since they seem to collect IMEIs and whatnot. I have read several articles about this but I'm still rather confused.
Comment: asserting that you "clearly" don't mean using it as a phone is all well and good, but to me it still seems the most straightforward interpretation of what you wrote. Perhaps instead of getting huffy about what you don't mean, you could tell us what you *do* mean: when you ask if you'll still be able to use it, what use do you have in mind?
Comment: Who is/was your network provider for your old phone? Is your old phone locked to that network? It may help you get better answers if you edit your question to include what research you've done
Answer: SIM stands for Subscriber Identity Module. It identifies the phone it is in to the cellular network. When removed from the previous phone, that phone will no longer register itself to that network and so will not be able to receive calls, text or data for the number with the SIM.
The phone itself will still work and you are free to put back your old SIM in it which will connect in roaming mode so that you can communicate on the old number which is generally costly due to roaming fees but those depend on the plan of the old SIM.
Not inserting any SIM in the old phone still leaves it as a functional device which will be able to connect to WiFi, use Apps that don't require the SIM, watch videos, play music, etc. You can even install some apps that allow to make and receive VOIP calls and text while you are connected to a WiFi network.
All modern phones should work without a SIM card. A very long time ago, over 10 years, some models refused to access any functions until a SIM was placed. Even so, it was a simple task to edit the firmware to disable the check since I wanted to give the phone to my young daughter to play with.
Answer: If you used a turkish SIM card in your phone, the phone's IMEI will be blocked in Turkey after a certain time unless it is registered.
In this thread on tripadvisor https://www.tripadvisor.co.nz/ShowTopic-g293974-i368-k11432822-I_used_my_mobile_in_2017_in_Turkey_will_it_be_blocked_2018-Istanbul.html A user claims, that using the phone in your home country with a local SIM will reset the IMEI ban in Turkey. But I haven't found any other information to confirm this.


Mathematically rigorous books on programming and computer science

Question: I would like a mathematical approach to programming languages and computer science, not just the theoretical aspects of computer science. Is there any such text out there? After all, the world has a huge supply of mathematical texts.
Comment: I wish there was a community on non math books that have a nice math-y style. I find it really hard to read non mathematical introductory stuff (like electronics). Some of it feels extremely ambiguous to me and i believe most of it could be remedied with precise definitions and stuff like that.
Comment: Can you clarify what exactly you're looking for? There are certainly math-oriented books on computer science (both theoretical and applied), but I don't think you'll find something like "Java for Mathematicians." (Nor do I know what that would entail; software engineering is more about organization and procedures and memorizing the niceties of various languages than any real science or math.) Or are you looking for a mathematical treatment of programming languages and parsing, compilation, etc. in general?
Comment: Yes, I am looking for a mathematical treatment of programming languages, parsing, compilation, etc.
Answer:
I would like a mathematical approach to programming languages and computer science, not just the theoretical aspects of computer science.

This sounds like you want a more formal book about programming languages themselves from a mathematical perspective, rather than the more standard "undergrad" CS theory (algorithmics, complexity theory, data structures analysis, etc...).
I think, however, it is very useful to know the basics of computability theory (automata, regular languages, Turing machines, Lambda calculus, context-free grammars, etc...), before looking at this area. Understanding compilers/interpreters deeply also requires it. (PS: for many graduate CS courses at most major universities, they have a publicly available syllabus/website with book recommendations present; it can be useful to check them).
Anyway, many mathematical treatments of programming languages tend to come from a type theory and lambda calculus approach, which allow formalizing programming and the language itself. This is particularly prevalent among introductions to functional programming languages (a fact which may not be appreciated by all its would-be users).
Two popular books that somewhat follow this approach are:

Types and Programming Languages by Pierce
An Introduction to Functional Programming Through Lambda Calculus by Michaelson

Note that the former book does not neglect Object-Oriented Programming.
There are also other angles to look at, however, which tend more formalized from a logic perspective, such as operational semantics (e.g., this book).
Related:
[1],
[2],
[3],
[4].
Answer: How about "The art of computer programming" by Donald Knuth?


Modifying the icon in the firefox search box for a website's search engine/feature? (ie. GoogBinHoo, Wikipedia, Ebay, Superuser, etc)

Question: Does anybody know how to change the icon in the firefox search box to a custom made icon? For example if I wanted to change the google icon that is next to the google search box(or wikipedia, ebay, yahoo, bing, youtube, superuser :], etc), how would I do this? Is there a place where the file for this icon is stored that I can just modify? Could I change where firefox looks for this icon using about:config, userchrome.css, or some other way?
Answer: I haven't tried it out, but here is a link where you can create your own search plugin with your own custom image:  http://www.scriptsocket.com/firefoxplugins.php
Answer: See this article : Update Firefox's search bar with new Google favicon.
The data in the article and (especially) in the comments will tell you how to change this favicon to any 16x16 image, and also contains links to several such images:

Locate the searchplugins folder in your Firefox install folder.
(typically C:\Program Files\Mozilla Firefox\ on Windows).
Open the google.xml file with a text editor.
Locate a section that starts with <Image width="16" height="16">. You will see it is followed by a long series of characters (such as "the encoded Google icon").
Replace it with this equally unreadable code:
the new encoded Google icon
Ensure the closing </Image> stays there and the text in-between is preserved.
Save the file and restart Firefox.
Comment: Never post link only answers as the links eventually all die.
Comment: @TomášZato: You are right in one sense: I just now tried accessing the above link and found that the Mozilla database was down. I resurrected the text from the Google Cache and pasted it above.


What tribe is Chakotay from?

Question: During Voyager, Chakotay's Native American heritage is repeatedly mentioned and emphasized. What tribe is he from? Do tribes as such still exist in his time? Does he hold membership in one or more tribes?
Comment: http://memory-alpha.wikia.com/wiki/Chakotay%27s_tribe
Comment: This could've been answered with a simple internet search.
Answer: Chakotay's tribe and their beliefs were referenced in numerous episodes. Per this Memory Alpha page linked by Paulie_D. (emphasis added)

Chakotay's tribe was a group of Native Americans descended from the ancient Rubber Tree People... Their ancient language, also shared with their cousins in Central America, appeared almost unchanged from that of the Sky Spirits.

And...

The Rubber Tree People were an ancient Native American tribe who lived in the rainforests of Central America on Earth.

Tattoo confirms that the "Sky Spirits" who visited and genetically modified the Rubber Tree People in 43,000 BC were actually Ancient Aliens (TVTropes link!) that, by amazing coincidence, originally came from the delta quadrant.
Members of the tribe lived on a colony (possibly Dorvan V) near the Cardassian border in Chakotay's time, although some remained in the jungles of Central America to live in the way of their ancestors.
Out of universe, the Rubber Tree People are not an actual native tribe, although they were intended to be a "pre-Mayan culture." There was some criticism of the ritualistic practices shown in Voyager, which appeared to be an amalgamation of native stereotypes as written from a European perspective. For example a "Mayan medicine wheel" is shown, which doesn't exist in real life. The actor who portrayed Chakotay, Robert Beltran, is not a Native American. Here's a random essay I just found that discusses the topic in depth.
Answer: It is strongly implied, though not explicitly ,that Chakotay's group were followers of some form of Neo-transcendentalism. They were not an old, historic culture... they were members of different ethnicities who had lost their ancestral traditions and revived them, intermixing anything they could get their hands on. Strictly taken they were "fake-natives" and Chakotay seems to have been aware of it as he never took his ancestral tradition quite serious until he was somewhat older and matured and finally got to respect his tribe for what it was and accepted and endorsed the culture they had made on their own.
Comment: What evidence is there that this is strongly implied, what makes you think this? Could you find some quotes to back up your points and [edit] them in?

What tribe is Chakotay from?


What happens when astronomical bodies made up of Dark Matter collapse or collide?

Question: Does dark matter not produce heat or radiation after a collision etc?
Or, we detect radiations having no generators?
Comment: As I understand it there aren't really "bodies made up of dark matter", because being very weakly interacting it has no way to shed relative momentum and collecting into a "body". Instead you get widely dispersed gasses.
Comment: A sort-of DM objects, "Dark Matter Stars", are theorized to have existed in the early Universe. They'd consist of part DM, part normal matter, but the DM would be so dense that DM particles would frequently collide and, assuming DM is its own antiparticle, annihilation would happen and release EM radiation which would heat up the ordinary matter in the dense clouds, preventing them from collapsing into normal stars. These DM stars would be clouds of maybe a few thousand AUs extent, glowing in the infrared but not in optical light.
Answer: It appears Dark Matter (DM) does not radiate any electromagnetic radiation, hence the 'Dark' part of the name.  It does however appear to collect together due to gravity, hence the 'Matter' part.  It appears to only very weakly interact with other types of matter during 'collisions' and therefore has no method of shedding momentum or energy in a collsion and does not therefore collapse as ordinary matter will under gravity.
The Bullet cluster is a great example of two amounts of DM passing through each other while the ordinary matter collides and is left in the middle.
The exact nature of DM is purely speculative at this moment in time; ATLAS at the LHC hopes to find particles that would fit the bill (supersymmetric neutrinos) but has yet to find any proof of these.
Comment: *Aside:* There are at least half a dozen "direct dark matter" experiments either running or building right now, and these are based on some very general assumptions about the physics that applies. The collider experiments get there under a more restrictive set of physics assumptions.