Windows Registry best practices

Question: In what way is the Windows registry meant to be used? I know it's alright to store a small amount of user preferences, but is it considered bad practice to store all your users data there? I would think it would depend on the data set, so how about for small amounts of data, say, less than 2KB, in 100 or so different key/value pairs. Is this bad practice? Would a flat file or SQLite db be a better practice?
Answer: I'm going to take a contrarian view.
The registry is a fine place to put configuration data of all types.  In general it is faster than most configuration files and more reliable (individual operations on the registry are transacted so if your app crashes during a write the registry isn't corrupted - in general that isn't the case with ini files).
Marcelo MD is totally right: Storing things like operation percentage complete in the registry (or any other non volitile storage) is a horrible idea.  On the other hand storing data like the most recently used files is just fine - the registry was built for just that kind of problem.
A number of the other commenters on this post talking about the MRU list have discussed the problem of what happens when the MRU list gets out of sync due to application crashes.  I'm wondering why storing the MRU list in a flat file in per-user storage is any better?
I'm also not sure what the "security implications" of storing your data in the registry are.  The registry is just as secure as the filesystem - the registry and the filesystem use the same ACL mechanism to protect their data.
If you ARE going to store your user data in a file, you should absolutely put your data in %APPDATA%\CompanyName\ApplicationName at least - that way if two different developers create an application with the same name (how many "Media Manager" applications are there out there?) you won't have collisions.
Answer: For me, simple user configuration items and user data is better to be stored in either a simple XML configuration file, a SQLLite db, or a MS SQL Server Compact db.  The exact storage medium depends on the specifics of the implementation.
I only use the registry for things that I need to set infrequently and that users don't need to be able to change/see.  For example, I have stored encrypted license information in the registry before to avoid accidental user removal of the data.
Comment: What kinds of 'security and other implications' are you referring to?
Comment: I don't see how file system's security implications is in any way different from registry's ones.
Comment: Getting access to the Registry in Windows 7 requires elevation, which in all reality it isn't needed unless you are trying to hook into the registry for things like auto start etc.  Thus I stay away as I like to keep my systems as least privileged as possible.
Answer: Using the registry to store data has mainly one problem: It's not very user-friendly. Users have virtually no chance of backing up their settings, copying them to another computer, troubleshooting them (or resetting them) if they get corrupted, or generally just see what their software is doing.
My rule of thumb is to use the registry only to communicate with the OS. Filetype associations, uninstaller entries, processes to run at startup, those things obviously have to be in the registry.
But data that is for use in your application only belongs in a file in your App Data folder. (whiever one of the 3+ App Data folders Microsoft currently wants you to use, anyway)
Comment: non-power users don't, but then they would also have a hard time backing up a file in %APPDATA%/MyApp. The registry is easy to export and import - find your tree (in HKCU/Software/MyApp or whereever) right click and export. As simple as zipping a directory.
Comment: This UX pov gives me bullets for choosing the best practice.
Answer: As each user has directory space in Windows already dedicated to storing application user data, I use it to store the user-level data (preferences, for instance) there.
In C#, I would get it by doing something like this:
Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData);

Typically, I'll store SQLite files there or whatever is appropriate for the application.
Answer: If your app is going to be deployed "in the enterprise", keep in mind that administrators can tweak the registry using group policy tools.   For example, if firefox used the registry for things like the proxy server, it would make deployment a snap because an admin can use the standard tools in active directory to set it up.  If you use anything else, I dont think such things can be done very easily.
So don't dismiss the registry all together.  If there is a chance an admin might want to standardize parts of your configuration across a network, put the setting in the registry.
Comment: Also, if you really want to be enterprise friendly, you can purposefully read settings from the Policies section of the registry and even provide an ADM and/or ADMX template to go along with your application.
Answer: I think Microsoft is encouraging use of isolated storage instead of the Windows registry.
Here's an article that explains how to use it in .Net.
You can find those files in Windows XP under Documents & Settings\\Local Settings\ App Data\Isolated Storage. The data is in .dat files
Comment: Note that a file in Isolated Storage can only be accessed by one particular assembly, so you can't easily do things like deleting user preferences from IS in an uninstaller. It's also tedious manually finding data files for troubleshooting during development. What is needed is a way of generating a unique key for a company to use (e.g. CompanyName\ProductName or GUID) so that multiple .exes can all share the data files, and developers/users can easy fine them if required. So IS is dead. Long live %AppData%.
Answer: I would differentiate:
On the one hand there is application specific configuration data that is needed for the app to run, e.g. IP addresses to connect to, which folders to use for what sort of files etc, and non trivial per user settings.
Those I put in a config file, ini format for simple stuff, xml if it gets more complex.
On the other hand there is trivial per user settings (best example: window positions and layout). To avoid cluttering the config files (which some users will want to edit themselves, so few and clearly arranged entries are a must), I like to put those in the registry (with conservative defaults being set in the app if no settings in the registry can be found).
I mainly do it like istmatt sais: I store config files inside the %APPDATA% folder. Usually in %APPDATA%\ApplicationName, I don't like the .NET default of  APPDATA%\CompanyName\ApplicationName\Version, that level of detail and complexity is counterproductive for most small to medium sized applications.
I disagree with the example of Marcelo MD of not storing recently used files in the registry. IMO this is exactly the volatile sort of user specific information that can be stored there.
(His example of what not to do is very good, though!)
Answer: To me it seems easier to think of what you should NOT put there.
e.g: dynamic data, such as an editor's "last file opened" and per project options. It is really annoying when your app loses sync with the registry (file deletion, system crash, etc) and retrieves information that is not valid anymore, possibly deadlocking the user.
At an earlier job I saw a guy that stored a data transfer completness percentage there, Writing the new values at every 10k or so and having the GUI retrieve this value every second so it could show on the titlebar.
Comment: Yikes!  And I thought some of my uses in the past were bad! (No, not really willing to share!)
Comment: Oh, come on! Don't be shy! We won't tell anybody, honestly!
Comment: I don't get it. Why would this guy write to the registry with one part of his app, and then poll-and-read the value from the registry for display? This seems stupid in a way that has nothing to do with the particular mechanism of persistence.
Comment: That system was used to communicate with a lot of different peripherals and the protocol functions were grouped in DLLs. The problem was that the system wasn't designed to send large blocks of data and it didn't have any provisions for information feedback, so it was going to be a hack one way or the other.
Me? I probably would have used a plain text file.

Windows Registry best practices


What are the differences between seq2seq and encoder-decoder architectures?

Question: I've read many tutorials online that use both words interchangeably. When I search and find that they are the same, why not just use one word since they have the same definition?
Answer: They are not the same, but they can overlap.
An encoder-decoder architecture is composed of an encoder (which compresses the input) and a decoder (which decompresses the compressed input).
A sequence-to-sequence (or sequence transduction) model is a model that converts sequences to other sequences. The most obvious example are models for machine translation, where sequences are sentences in 2 different languages (e.g. English and French). See e.g. NMT or the transformer. These models also use an encoder-decoder architecture.
The variational autoencoder (VAE) uses an encoder-decoder architecture, but it not usually used to convert sequences to other sequences.
So, in conclusion, encoder-decoder architectures are not just used for sequence transduction tasks, and sequence-to-sequence models may not use encoder-decoder architectures, although famous models like the original transformer do.
Comment: @user I don't think GANs have an encoder-decoder architecture, but I honestly don't remember the details. They have a generator and a discriminator (which are trained in some game theory fashion), but I don't remember if they use this ED architecture. Afaik, GANs are mostly used for image generation tasks, so not for sequence transduction tasks, but I don't exclude they may also be used for these tasks. I'd need to check that (i.e. read the paper again). Maybe later.
Comment: Are there any seq2seq problems that don't use encoder-decoder architectures ?
Comment: I can't think of a specific model right now, but I am sure there are (maybe check hidden Markov models or even just simple RNNs). But one reason why the encoder-decoder is useful in the case of sequence modeling is because the input and output sequences may have different sizes (e.g. number of words or characters), so you cannot just map one token to another token. With the ED, you just let the model learn a latent representation (which is what the encoder does) and then the decoder tries output sequence conditioned on the latent vector. Or something like that.
Comment: What about GANs ? Are they seq2seq or encoder-decoder ?
Answer: Yes, you may have read tutorials or texts using interchangeably because of close relationships, but actually, there is a subtle distinction.
Encoder-Decoder: It contains two main components Encoder and Decoder which take information to create context. The decoder takes context and generates the output. The key point is it can be used in various applications like NLP generation, Machine translation, Image Captioning etc... It Supports CNN and RNN or similar (GRU, LSTM, etc...).
Seq2Seq Model: Sequence to Sequence is a type of model that is specifically designed to handle sequences. It is mainly used in tasks where input and output are both in sequences. So, we can say that the seq2seq model also uses the encoder and decoder-based network specific to the nature of data and task. It only supports RNN, LSTM, or GRU.
So, we can say that seq2seq is an encoder-decoder-based architecture while the encoder and decoder model represents a wider range of applications and data.


MinGW: Python enabled GDB on Windows

Question: I use QtCreator 4.6.2, which apparently requires Python-enabled GDB if I want to use it as a debugger.
I tried to install mingw32-gdb-python version 7.5-1 with MinGW installer (graphical interface), and I got gdb-python27.exe file in my bin. But this file can't be opened. I'm getting error saying I'm missing python27.dll. I have Python 2.7 installed, and said DLL is located in C:\WINDOWS\System32. Obviously, System32 is in PATH, so it seems to me that it should be linked on demand.
Simply copying python27.dll to bin directory of MinGW throws an error "Application was not started correctly (0xc000007b)."
Running regular gdb (version 7.6.1-1) still does not allow python command (checked that in case gdb-python27 was only extension to normal gdb).
Did I miss some step here? Shouldn't MinGW provide me with python27.dll (it is a part of few other applications, like OpenOffice)? How can I make it work?
Answer: I was having the same issue. I found that it was due to using Python 2.7 64 bit, when gdb assumes a 32 bit python installation. Switching to Python 32 bit solved the issue. And you shouldn't have to move python27.dll anywhere if you use the 32bit version.

MinGW: Python enabled GDB on Windows


What is Coarse-to-Fine in the context of neural networks?

Question: I read in many paper that mentions coarse-to-fine as a technique in deep learning, but I could never figure what exactly they mean. Is it related to multiscale inference, where they use coarse and fine input images?
Comment: This question is probably incomplete , was part of it lost in copy/paste ?
Comment: Opps I don't know what happened. Completing it now.
Answer: "Coarse to Fine" usually refers to the hyperparameter optimization of a neural network during which you would like to try out different combinations of the hyperparameters and evaluate the performance of the network.
However, due to the large number of parameters AND the big range of their values, it is almost impossible to check all the available combinations. For that reason, you usually discretize the available value range of each parameter into a "coarse" grid of values (i.e. val = 5,6,7,8,9) to estimate the effect of increasing or decreasing the value of that parameter. After selecting the value that seems most promising/meaningful (i.e. val = 6), you perform a "finer" search around it (i.e. val = 5.8, 5.9, 6.0, 6.1, 6.2) to optimize even further.
Comment: That's a good answer for the amount of information given. Since he was talking about images there are some methods that train multiple regressors for  coarse-to-fine detection of objects. I find this a lot in facial landmark detection.

So coarse-to-fine might mean:
- Oposite to exhaustive grid search or
- Oposite to one shot-detector / yolo


Should image size be specified in html?

Question: I recall it was long ago best practice to hardcode width and height for any image (generally so it allocated appropriate amount of space while loading), but now with most people on high speed and things generally more dynamic, what is the best practice for this? Is it still preferred that any content image have inline size set with html?
Answer: It doesn't matter if you set the size using HTML attributes or in a stylesheet, but you should still specify the size for images.
Eventhough images are loaded a lot faster nowadays, there is still a noticable delay between the page being displayed and the images pop up. It's still irritating when the layout of a page changes while the images are loading.
Answer: Yes, it is still preferred.
Plenty of people are not on high speed connections, and mobile is becoming more common.
Answer: It doesn't have to be inline - you can do it in external CSS. Some older browsers, if you don't specify the size, will just treat it as 0px;
Answer: Its always best to use CSS
You could hardcode the image height and width like this
.myimg img {
width: 10px;
height: 10px;
}

Comment: a lot of people are saying to use CSS. What about in situations where images are part of content and variably sized? would I create a custom class for different images? Have a stable of image size classes.. (vertical/horizontal, different aspect ratios, small/medium/large), or just size those ones in the html?
Answer: your image file itself should be the size you want it to display as, for the most part, if your concerned about slow loading especially!  if you've got a 500X800 px image, that you only want to show as 100X200, scale it down!  the file size will be much smaller so it will load faster :)
Comment: in general yes, although a lot of new responsive techniques do not require this (though you'd still want it to be no larger than absolutely necessary)
Answer: I would say yes if you want to make sure the white space is included in case of the image does not load or during document load. But no if you're scaling/resizing the image with those attributes, as its unnecessary load on the browser and causes image distortion.
Answer: If you are designing for cross browser compatibility, then you should at the very least specify the height and width in your CSS for the image itself.  I have found inconsistency between FireFox, IE, Opera, etc if sizes are not specified specifically for the image.  Due to the fact that each browser, not to mention different versions,  handle adherence to HTML Standards differently.  I have found that some browsers will do its best to extrapolate the HTML designers intent, while others just croak on the first error.  I would also recommend em sizes, rather than pixel or %'s if you intend for the website to be viewed from a mobile device such as a tablet.    I will say, however I have just started playing with HTML5 so I don't of the difference in HTML5 with respect to images.
Answer: I just answered a similar question on Wordpress Stack Exchange and also on Webmaster Stack. I am posting it here intending to clarify and help more people. (admins/moderators: if this isn't allowed, let me know the proper way to help).

doesn't really means you need to specify width and height in the html. What it means is that is you gotta reserve te proper space and when the image is loaded, the browser doens't have to reflow and repaint the page.
Besides, if you hardcode the dimensions, it kinds of defeats responsive behaviour. If your layout is not responsive, it's ok, but if you want to keep some responsiveness, you could use only CSS to achieve the results.
Most of time, using both width and max-width:100 will do the work, but this post from Smashing Magazine has an interesting technique: instead of using max-width:100%, you can use The Padding-Bottom Hack :
"With the technique, we define the height as a measure relative to the width. Padding and margin have such intrinsic properties, and we can use them to create aspect ratios for elements that do not have any content in them.
  Because padding has this capability, we can set padding-bottom to be relative to the width of an element. If we also set height to be 0, we'll get what we want. [...]
The next step is to place an image inside the container and make sure it fills up the container. To do this, we need to position the image absolutely inside the container, like so:"

.img-container {
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    background-color: black;
}

.img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

Should image size be specified in html?


How the pass Jython modules to wsadmin tool

Question: I'm using the Websphere 8 Thin Client to connect to my remote WAS instance.
I'm trying to import some Jyton files by passing python.path to wsadmin but it cannot find them. I keep hitting NameError on the Jython class.
C:\MyThinClient>wsadmin -host <ipaddress> -port 8880 -lang jython -javaoption "-Dpython.path=C:/MyThinClient/Jython/"

WASX7209I: Connected to process "server1" on node XYZNode01 using SOAP
  connector;  The type of process is: UnManagedProcess WASX7031I: For
  help, enter: "print Help.help()"
  wsadmin>AdminApplication.listApplications() WASX7015E: Exception
  running command: "AdminApplication.listApplications()"; exception
  information:  com.ibm.bsf.BSFException: exception from Jython:
  Traceback (innermost last):   File "", line 1, in ? NameError:
  AdminApplication

The path passed contains the AdminApplication.py file.
I've tried passing the Jython path with back-slash and forward-slash but no joy. Any ideas?
Answer: Try with option -Dwsadmin.script.libraries, like below. It worked for me
C:\MyThinClient>wsadmin -host  -port 8880 -lang jython -javaoption "-Dwsadmin.script.libraries==C:/MyThinClient/Jython/"


Difference in real diode characteristics vs shockley equation

Question: I was wondering about the voltage drop in real diodes (0.7 V in Si diodes, 0.3 in Ge diodes etc.). According to my experience this drop is linked to the used material, but the shockley equation which should describe a diode never uses any material constant. So, how is the material constant introduced in a diode equation for modelling the additional voltage drop compared to an ideal diode?
Answer: Shockly diode equation is given by:
$$\style{}{I=I_S(e^{V_D/nV_T}-1)}\tag1$$
Where,

\$I_S\$ is the reverse bias saturation current.
\$V_D\$ is the voltage across the diode
\$V_T\$ is the thermal voltage
\$n\$ is the ideality factor, also known as the quality factor or emission coefficient.

I see two material dependent parameters here:

The reverse saturation current, \$I_S\$ depends on the material.
The parameter \$n\$ depends on fabrication process and semiconductor material.

EDIT
From equation (1),
$$V_D = n \cdot V_T \ln\left(\frac{I}{I_S}+1\right) \approx n \cdot V_T\ln\left(\frac{I}{I_S}\right)$$
$$V_D \approx n \cdot V_T \cdot \ln10 \cdot \log_{10}\left(\frac{I}{I_S}\right)$$
Assuming room temperature and \$n=1\$,
$$V_D \approx 0.05916 \cdot \log_{10}\left(\frac{I}{I_S}\right)\tag2$$
Typical values of the saturation current at room temperature are:

\$I_S = 10^{-12}\$ for silicon diodes;
\$I_S = 10^{-6}\$ for germanium diodes.

For a current of 1.0 mA:

\$V_D \approx 0.53 V\$ for silicon diodes (9 orders of magnitude)
\$V_D \approx 0.18 V\$ for germanium diodes (3 orders of magnitude)

For a current of 100 mA:

\$V_D \approx 0.65 V\$ for silicon diodes (11 orders of magnitude)
\$V_D \approx 0.30 V\$ for germanium diodes (5 orders of magnitude)

Further increase in current won't cause much increase in \$V_D\$ (0.05916V per decade is the rate of change of \$V_D\$ with respect to \$I\$). Hence in the common cases (current in the range of mA), the voltage drop remains constant around 0.6V for silicon diodes.
And hence values of 0.6 or 0.7 Volts are commonly used as voltage drop for silicon diodes and 0.3 for germanium diodes.
source: wikipedia
Comment: The questioner did ask for the "additonal voltage drop compared to an ideal diode". The above equation (Shockley) applies to an ideal voltage only and does not take into consideration the voltage drop across the path resistance.
Comment: @arc_lupus, what do you mean with "get into trouble"? As I have explained in my answer (below) there is a linearizing effect caused by the  diode´s ohmic path resistance. Thus, the voltage drop does NOT remain constant around 0.6V (as mentioned before). Rather, a tangent drawn at the linear part of the I-V characteristic crosses the voltage axis at a voltage of app. 0.65 volts. A corresponding verification can be found in many textbooks.
Comment: @arc_lupus, one more information (perhaps it helps): It is easy to construct the I-V characteristics of a real diode. At first, draw the ideal exponential curve for the pn junction. At second, draw a straight line with the slope 1/Rpath (ohmic law for the path resistance). At third, add both curves horizontically (because both voltage drops within the diode are added). As a result, you get the linearized diode characteristics.
Comment: I already know the Shockley equation, but if I want to calculate a real diode with it, I get into trouble...
Comment: @arc_lupus please see the edited answer.
Comment: @arc_lupus,the V-I relationship of a REAL diode can be found as folows:
Answer: The Shockley equation does NOT describe the equation of the part called "diode".
It establishes the voltage-current relation of the pn junction only. This exponential function is linearized (for increasing currents) caused by the ohmic path resistance.
EDIT:
The known exponential function has a factor Io (reverse saturation current) which is different for Si and Ge. This factor contains the carrier concentration factor which is proportional to the material-dependent potential gap (1.1 for Si and app. 0.6 for Ge).
Comment: Thus I have to add a constant value (how do I get this?) to the result of my shockley equation? (And why is the shockley equation called "diode equation"?)
Comment: But a schottky diode is made of metal-semiconductor rather than semiconductor-semiconductor (P-N) doped regions. Does it still comform to this equation?
Comment: @arc_lupus: For the pn junction the exponential function is exp(Vj/Vt) with Vj: Voltage across the junction and Vt: thermal voltage. For the whole diode you have to add the ohmic voltage drop across the path resistance Rp. This can be expressed as exp(Vd-I*Rp) with Vd: external diode voltage. Note that I=f(Vd). This causes the effect of linearizing the exponential function.
Comment: Anything wrong with my answer (seems to be "not useful")?
Comment: No, thus I gave you an upvote. And thanks for your help, too!


How to create userstory in rally through an api?

Question: Does rally provide any built in api to create user story?
We need an api which can create userstories in rally by ca technologies through our web application.
Answer: What language are you looking to interact with?  There are a bunch of tools.
HTML/JS (Custom apps): https://help.rallydev.com/apps/2.0/doc/
Java: https://github.com/RallyTools/RallyRestToolkitForJava
.NET: https://github.com/RallyTools/RallyRestToolkitFor.NET
Ruby: https://github.com/RallyTools/RallyRestToolkitForRuby
And more...
There are also tons of code examples floating around once you have a language picked out...


Sizing of a SharePoint infrastructure

Question: I'm working for a customer that need all features of SharePoint 2013 enterprise and I have to estimate a correct sizing of the infrastructure. On this SharePoint, there will be almost 300 users with about 300 pages viewed/day.
The AD is already existing.
Could you help me on this task??
Thanks in advance.
Comment: Not a direct answer, but good info nonetheless: http://sharepointintheprivatecloud.wordpress.com/2011/06/26/sharepoint-infrastructure-best-practices/
Answer: Your requirement seems pretty low to me (300 page views / day) but best practices would dictate a small farm to exist of 1 WFE server, 1 APP Server and 1 SQL Server, and a seperate AD which you already have, anyway. Use the Hardware Requirements recommended by Microsoft to have an idea of individual server requirements. You need to read the document carefully, but to give you an idea:

They consider <10.000 users a small deployment
4 cores minimum on all servers
8GB to 12GB RAM

Do keep in mind that each component places it's own requirements on the infrastructure, a big one being Search and another one being Office Web Apps (seperate server). This is a good overview, but keep in mind that the values may have been updated since then (I know they have on MSDN since SP 2013's release).
EDIT:
In this slideshare, it is mentioned that 500 concurrent users can bring a 4 server farm (4 cores, 16GB RAm each on average) to a crawl.
Comment: Thanks! One question, I already have my sharepoint installed on a single server, is it possible to change the infrastructure or do I have to rebuild my solution??? Thanks!
Comment: When you say *My* SharePoint, do you mean the production environment or your development machine ? The development machine can be just the one server, given it has enough RAM and CPU resources.
Comment: I have no development environment... only production (shame)
Comment: It is possible to transition to a farm setup, take a look at t his post for pointers: http://sharepoint.stackexchange.com/questions/32549/moving-sharepoint-to-new-server

Sizing of a SharePoint infrastructure


What is an approximate ancillary statistic?

Question: In the article Assessing the Accuracy of the Maximum Likelihood Estimator: Observed Versus Expected Fisher Information the authors use the expression "approximate ancillary statistic". This expression is used in a lot of others articles.  Anyone know's the definition of approximate ancillary statistics?
Answer: So, better late than never I guess. The textbook "Principles of Statistical Inference" explains this rather cleanly (excerpt here):

A statistic $a$ is approximately ancillary for the estimation of $\theta$ if the asymptotic distribution of $a$ is free of $\theta$

So, it allows you to condition on statistics that are weakly associated with $\theta$ as long as this dependence approaches zero in some suitable sense.
The observed Fisher information is one such "approximate ancillary" and using it as your variance term for a Wald-type confidence interval about the MLE will approximate a full conditional inference given some true ancillary (should it exist). The beauty of their result is that observed Fisher information is universally available for well-behaved (regular) parametric models and it provides some reassurance that the conditional (post-data) confidence will be approximately equal to the unconditional (pre-data) coverage.
Note however that the authors of the paper you read were not able to theoretically establish the approximate ancillarity of observed information for non-translation models, although they suspect it was the case based on simulations.
Comment: Also, some general discussion here: http://www3.stat.sinica.edu.tw/sstest/oldpdf/A20n41.pdf


Execute reindex from different server

Question: As we know, reindexing will use a lot of resources and make the magento slowdown during the process. So, I was thinking, if there any possibilities to run reindex from different server. For example, I have magento running on server A. So, I have also server B only to execute the reindex. The reindex process only happened in server B. Yes it doesn't make any sense if I think of this way. btw, Is it possible? Is there any other way to avoid low performance of magento during the reindex process?
Answer: No, it won't work.
PHP is single threaded, at worst, your reindex will occupy a single core at 100% - which is nothing to worry about.
What reindexing does do however, is apply locks on the database, and have it perform several intensive queries which no matter how many web servers you have,  is going to have an effect on your entire stack.
There's two really simple things you can do to improve poor indexing performance,

Just get proper hosting, sized appropriately for your store
Don't reindex. Well, not during production hours anyway. Just have a single batch process run nightly via cron to perform the task and set them all to manual
Do not install a third party indexing module, reindexing asynchronously won't do anything other than cause random erratic periods of downtime throughout the day

This is all relative really, as indexing strategy can be a challenge for high transacting stores or large catalogue stores.
But if you are processing less than 100 orders per hour, or have less than 20k products - it shouldn't be a bottleneck.
Answer: Yes it is possible. But:
a)
you have to reindex not only on a other servers. You have to do it on a different database and copy reindex tables. This makes it tricky to script it.
b)
You can not do it for all indexers because to many tables are affected
We do it for the longest running index: Catalog URLs. The easy thing is: Only one table - core_url_rewrite - is affected.
Pseudo Code:

Dump whole database and import on a different database on a physical different server.
Run reindex process
Rename table core_url_rewrite to core_url_rewrite_new
Dump table
Import renamed table on your live database
Rename your live table to core_url_rewrite_old (to have a backup)
Rename reindexed table to core_url_rewrite

You have to do the renameing process to have a backup and because import maybe takes a while.

Execute reindex from different server


How to calculate the approximate volume of material used in 3d print?

Question: Is there a reasonable way of approximating the volume of material used for 3D print by knowing only the STL file volume and infill percentage?
Or what is the formula for calculating the exact volume and which parameters can be fixed to reasonable values?
Can this be done easily using Slic3r or CuraEngine in command line?
Note:
Supposedly 3Dhubs use Cura[*] software to calculate the print volume.
Any help is appreciated.
[*] www.3dhubs.com/talk/thread/calculate-print-volume
Comment: @dsalaj, so what you are saying is that you want to know the *volume of the material used*, and not the volume of the final print?
Comment: @TormodHaugene You are right. I was ignorant thinking these two are the same. Obviously the volume after melting, cooling, etc. will change. I was able to work out the volume of material used know simply by using the filament length (calculated by Cura) and filament diameter.
Comment: @TormodHaugene Thank you. Yes I have. I only need to figure out how to do it from command line with CuraEngine. I will do that, thanks.
Comment: `by knowing only the STL file volume` which else volume do you want?
Comment: Are you sure you want the volume, or are you asking for the amount of print material required to print?  The volume does not depend on the infill percentage, but the print material usage does.
Comment: @emackey Yes I am sure, I would like to know the volume needed independent of material type. It does depend on infill. With low infill the voids in the final print will be greater and thus the volume also. But any help is welcome. Do you know how to calculate amount of material required using CuraEngine?
Comment: @dsalaj, so you found your answer then? Good to hear. :) Would you mind adding what you found out as an answer to this question and accept it? That will make it much more visible and useful to other users!
Comment: Just as a small addition: Slic3r gives the amount of used filament in grams when slicing in Repetier. I find this very helpful because it my filament spool is also bought by weight. And I know the weight of the final piece.
Comment: Use simplify 3d. It is built in!
Answer: Possible way to calculate the volume of material used is to multiply the filament length (calculated by CURA after slicing and displayed in lower right corner) and surface of filament tip.
Volume = Filament_length * ( Filament_diameter / 2 )^2 * PI
Of course do not forget to convert all values to the same order of magnitude (e.g. cm³).
Comment: This is the correct answer for the *volume of material used* as talked about in the comments.  Note that a traditional geometric volume of the final print would of course include the interior empty space between infill supports, not just the volume of the material used (for example, print a watertight model and dunk it in water, check the amount of water displacement).  But for material used, this is the correct formula.


Could not acquire lock for index: catalog_category_product

Question: after upgrade from M2.3 to 2.4.5, I removed cron and enabled maintenance mode,Truncate cron_schedule table, mview_state version id is 0 but when i try to re-index it gives errors Could not get lock for index: catalog_category_product
Please help me i dont understand why reindexing didn't work
Answer: A similar question already exists and has been answered: 2 errors Could not acquire lock for index: when reindexing
Since you've already set mview_status to 0 focus on the second answer. If that doesn't solve your issue please update your question with additional context including the steps you tried to resolve the issue and the outcomes including any relevant logs or screenshots.
Good luck!


What do gamer points do?

Question: Gamer points are what you get when you unlock an achievement but I don't know what you can do with them. Are they just to brag or can you cash them in or can you buy a game?
Comment: PlayStation & Steam profile 'levels' would be a good approximation of Gamerscore on other systems
Answer: They don't "do" anything, they're just a counter for what you have achieved.
I.e., a gamer score of 10,000 is more impressive than a score of 5,000.
For the most part, the harder the achievement, or the longer it takes, the higher the achievement score. Finishing a level might be worth 10 Gamerscore, Finishing the campaign on Normal difficulty might be worth 50. Completing it on Hard might be worth 100.
However there are exceptions to this rule, like the "Go Get Some Sun" achievement in CoD: WaW, worth 0 Gamerscore, but requiring a lot of time and effort.
On the other hand, all 1000 Gamerscore from "Avatar: The last Airbender - The Burning Earth" can be easily unlocked in under 5 minutes.
Comment: It's a kind of achievements, like badges and rewards, etc.

What do gamer points do?


Do I have to store refresh token in database?

Question: If I generate refresh tokens with expire time of 14 days, do I have to store them in my database and compare them when an access token is renewed, or verifying them (with jwt library) is enough?
Also, does it make sense to generate new refresh tokens for the users when they attempt to obtain a new access token?
Answer: The idea behind cryptographically singed  tokens is that you can pass them through untrusted parties and still trust their content as long as the signature is valid and the private key has not been compromised.
If your refresh token contains all the information needed to issue a new access token and the signature is valid (meaning no one has modified the token content) you can trust the token.
The only reason why you would want to store some parts of the refresh token is so you can check if the token has been revoked. Revocation is a bit more difficult with stateless tokens because the token itself stays valid even though you want to revoke it. Usually you would want to store a "user must reauthenticate" bit in the database and check that if your issue a new access token with a valid refresh token.


Terminal velocity on the moon? Is it possible and how long would it take?

Question: Is there a way to find this out? If so please tell me the formula or just tell me how much time would it take for a 100 lb human to reach terminal velocity
Comment: what causes terminal velocity to occur on Earth?
Answer: The aerodynamic drag at high speeds is an inertial effect. Air has a mass, so pushing it out of your way takes energy and the faster you push it the more energy it takes. That's why drag increases with speed.
I won't go through the derivation, but the equation that relates the aerodynamic drag to velocity is:
$$ F = \tfrac{1}{2}C_d\,A\,\rho\,v^2 \tag{1} $$
where $\rho$ is the density of the atmosphere, $A$ is the cross sectional area and $C_d$ is a fudge factor that factors in the effect of turbulence.
The parameter $A$ is the same on Earth and the Moon because it's just down to the shape of a human. The parameter $C_d$ won't be the same because the Moon's atmosphere is too thin to develop turbulence on a short length scale, but $C_d$ is generally of order one so let's just ignore it and bear in mind that our answer is going to be approximate.
If we start on Earth then terminal velocity is when the aerodynamic force given by equation (1) equals the gravitational force $mg$, so we get:
$$ mg = \tfrac{1}{2}A\,\rho_e\,v_e^2 \tag{2} $$
where the subscript $e$ refers to the earth and remember that we are ignoring the parameter $C_d$. On the Moon the surface acceleration is about $0.165g$ so for the Moon we get:
$$ 0.165mg = \tfrac{1}{2}A\,\rho_m\,v_m^2 \tag{3} $$
We use equation (2) to substitute for $mg$ in equation (3) to get:
$$ 0.165 \left(\tfrac{1}{2}A\,\rho_e\,v_e^2\right) = \tfrac{1}{2}A\,\rho_m\,v_m^2 $$
And we can rearrange this to give an equation for the terminal velocity on the Moon, $v_m$, which is what we're after:
$$ v_m^2 = 0.165 \left(\frac{\rho_e}{\rho_m}\,v_e^2\right) \tag{4} $$
Now the great thing about this equation is we known the terminal velocity for a human on Earth is around $v_e = 55$ m/sec in the belly flop position, and the density of air on Earth is around $\rho_e = 1.25$ kg/m$^3$. So if we knew the density of the atmosphere on the Moon, $\rho_m$, we could just plug the numbers into equation (4) to give $v_m$.
But this is the problem. I can't find definitive values for the density of the Lunar atmosphere. From the data on the NASA Moon fact sheet I estimate the ratio $\rho_m/\rho_e$ is in the range $10^{-14}$ to $10^{-15}$. If we take the high end of this range we get:
$$ v_m = \sqrt{0.165 \times 10^{14}\times (55)^2} \approx 2 \times 10^8 \text{m/sec} $$
which is a goodly fraction of the speed of light! You're obviously never going to reach that speed by freefalling from rest on the Moon.
Comment: +1 for converting the aural apparatus of a porcine related beast into a small container composed from the liquid output of an oriental worm. Lovely answer.
Answer: Terminal velocity on Earth is achieved when the acceleration due to Earth's gravitational field is balanced out by air drag (which increases as a function of velocity). Due to the fact that the Moon essentially has no atmosphere (you have a few gas molecules but it is nearly a vacuum), there wouldn't be a terminal velocity on the Moon because there's essentially no force counteracting the pull of its gravity. You'd just keep accelerating until you smacked into it.
Answer: John Rennie has computed the terminal velocity due to the Moon's very thin atmosphere, but realistically there's another constraint on how fast the Moon's gravity can make an initially stationary object. In the moon's gravitational field, the gravitational potential energy per unit mass is reduced during a fall from $-\frac{GM}{r}$ to $-\frac{GM}{R}$, where the moon has mass $M$ and radius $R$, and the falling mass starts a distance $r$ from the moon's centre. The speed at which the mass hits the surface is then at most $\sqrt{\frac{2GM}{R}}=2376\text{m/s}$ (computed here), and even that can only be reached if (a) the object starts at infinity and (b) other masses don't spoil the calculation. However, we can get almost as high a final speed upon hitting the ground provided $r>>R$, which is realisable even if the test mass starts far closer to the Moon's centre than to the Earth's.
Answer: Think about it this way - what causes an object to have terminal velocity?  What reason is there for gravity to suddenly "stop" accelerating an object?  Terminal velocity on Earth is roughly 120 mph, yet we know objects in space, such as planets, move far faster than that due to gravitational attraction towards each other.  What's the difference between Earth and space?
An atmosphere that creates air resistance, or drag.  When an object falls in Earth, it is affected by air resistance.  Eventually, this air resistance "catches up" with the velocity, and they match each other.  But at his point, gravitational acceleration doesn't suddenly just stop.  Instead, the velocity and air resistance both increase at the same rate, which is why it looks like the object does not continue to gain speed once reaching terminal velocity.  There is no net acceleration, since gravity and air resistance both exert equal amounts of force that cancel out each other.
The moon does not have an atmosphere, meaning there is no air resistance.  Thus, there is no terminal velocity - an object falling on the moon will continue to gain speed until hitting the surface.  This is the same case with objects in space or in a vacuum... no air resistance or drag force = no terminal velocity.
If you want to read more on air resistance and terminal velocity, here is a link to the a Physics Classroom lesson on it:
http://www.physicsclassroom.com/class/newtlaws/Lesson-3/Free-Fall-and-Air-Resistance


whirlpool/ hop stand duration and temps

Question: I've been using hop stands for all of my beers, but they all have been slightly different.  I was wondering what you guys would recommend in terms of when to add the hops (at what temperature) and for how long. I add a minimal bittering charge at 30 or 15 min depending, then add the rest of the hops during the hop stand.  Usually the hops stand is about 20 min, then I turn on the wort chiller and run it until its cold enough to pitch (66-68F typically).  If you guys have any recommendations, I'd appreciate it. Thanks! Also, I do dry hop after fermentation is complete and let that stand for 4-5 days.
Comment: You might check this question / answer, which discusses the timing of flame-out hop additions: http://homebrew.stackexchange.com/questions/7169/should-the-late-addition-portion-of-a-recipe-be-altered-based-on-immersion-coun
Answer: We did an experiment about this at www.experimentalbrew.com for our Experimental Brewing podcast.  Here is a link to the experiment parameters and results....https://www.experimentalbrew.com/experiments/hop-whirlpool-does-steeping-lower-temperature-improve-final-hop-character
Comment: Great link, Think some of these podcasts will find their way into my phone :)

whirlpool/ hop stand duration and temps


How do I replace my faucet with these connectors?

Question: My laundry tub has been leaking for weeks...sometimes at 3 gallons a day. I bought a new faucet to install but these co
Comment: Hello, and welcome  to Home Improvement. You got cut off while typing  your question; would  you  edit  it to finish it and make it clearer? Thanks.
Comment: For your faucet you need to buy the co  - - - - ?  Please we are waiting with baited breath.  *Well to be fare we already had baited breath*.
Comment: Not entirely sure how fishing is done up in AK, but down here we usually just have bated breath and save the bait for the boat. :P Voting to close as unclear/incomplete.
Comment: @isherwood I knew there was a reason i was not catching anything. I seem to not be the only one. https://www.phrases.org.uk/meanings/bated-breath.html
Answer: Well, while we wait for the question to be completed... those things pictured are plumbing tees on your water lines, presumably in your basement.  The technology is this "new" plastic called PEX.
But that is all besides the point - Normally your supply lines run up into your cabinet and to a local shutoff valve.  The sink faucet normally connects to the shutoff valve.  If your laundry sink is in the open, then you should trace the line to the faucet.  Looking for some valve.  If you don't find one, curse at the plumber, and plan on cutting one into this line close to the sink, after you shutoff your main.
Plumbers that do PEX often have specialized tools which are more that homeowners want to invest in.  Ask at the store for simpler connectors.


Is the current version of Remote Desktop secure?

Question: I remember when I first started using Remote Desktop with Windows XP Pro many years ago, that it wasn't secure to use without vpn.
Now, with Windows 7, when I connect to my home computer i get some message about the certificate not being from a trusted CA. Are my remote desktop connections being encrypted?
Answer: Changes have been made regarding FIPS since Windows Server 2003 SP1 and it is now much more secure to use. You can enable certain security features via the group policy editor (run gpedit.msc from start menu):
Answer: Correct me if I am wrong, but you didn't need a VPN before to access RDP securely, it was just considered safer, as you had another barrier that you would have to access to get through in order to connect to the remote machine.
That in itself doesn't speak to the security of Windows / RDP, which has RSA RC4 encryption for the RDP connection.
Those settings are all available from (Windows 2003/2008 Server):
Programs > Administrative Tools > Terminal Services Configuration
And from there you could set 3 different types of encryption, high / med / low, there are details on that here: http://www.windowsecurity.com/articles/Windows_Terminal_Services.html
There are many other sources that speak on its security.
Now is it insecure? Could be, it is vulnerable to the same attacks that any Windows server suffers from.  Depends on how the server itself is setup.
Answer: Since Version 6 (Vista/2003 SP1 upwards) the RDP protocol has supported TLS and 128bit encryption via RC4. It's not military grade unless you are talking about the military in the 90s, but for most uses it will be more than enough.
As far as the trusted CA message goes, do you trust your server to be the one providing the certificate? It's akin to signing your own SSL certificate as far as I know.


How big can a rocky planet get?

Question: If I get the numbers right, at about 17 Jupiter masses a mainly gaseous planet would ignite into some type of star. What about rocky planets? Is there a theoretical limit to their size, so that they can grow up to size x? (I'm imagining a "liquid" planet would congeal into rock after certain gravity value, and would somehow fit into the "rocky class" as well).
Comment: I think that other question covers it.   The issue isn't how massive the heavy/rocky elements can get, the issue is accumulation of too much gas to be classified as a rocky planet.    The maximum mass of an Earth like planet is surprisingly small before it begins to resemble something like Neptune.      I like your idea of gravity so strong that liquid resembles solid, but I don't think that's realistic.   Large planets accrue large atmospheres.   The pressure, and the internal temperature, not the gravity becomes the key factors on any liquids.
Answer: Giant planets have an abundance of H and He. Hydrogen burning occurs at relatively low temperatures. Rocky planets, on the other hand, don't have much hydrogen and even less helium. For them, the first relevant process would be C burning, which occurs at about 8 solar masses.
But this is valid only as a thought experiment. Rocky planets loose or don't accrete H/He mainly because of insufficient mass. If they were massive, they would consist of H/He and therefore "ignite" at 17 Jupiter masses.
Comment: That's "oh wow" :D makes sense, and took me a while to realize how science gives you answers that are true and funny. I'm attempting the most 'realistic' space game ever (in some aspects :P). What you say not only solved a big question (I'm polishing a planet generator), it opened possibilities for new ideas the moment I read it. If I ever pull it off, and star construction is an option, after your permission, the wiki of the game will say that such bodies were nicknamed "olaf b's". Many thanks :)

How big can a rocky planet get?


Tumblr display photoset posts as a slideshow

Question: I'm working on a new blog theme that I started about an hour ago, and sadly I've already hit a bump in the road. The theme is wide-set, meaning it is wider than tumblr's default photo, photoset, and video size. I've already conquered the photo size (wasn't that hard!) and the video size (thank god, I've been trying to resize videos for months!) but I'm stuck at photosets. I found the plugin "photoset killer" very helpful, but it doesn't completely do the job. I'd like to use a script that kills the layout of the photoset (display just the images one after another), resizes all of the images to exactly 728 pixels, even if they're stretched, and then display them in a slide show. I know this sounds complicated, but it's really not once you think about it. I don't need a fancy slide show at all, just a 728 x the height of the tallest photo in the photoset, that has arrows on the sides to navigate between photos. Any help at all would be greatly appreciated, and the website i'm doing it on is http://jamestestblog.tumblr.com/
Edit: I've seen this done before and it IS possible, I just don't remember where. It may have been on a pixel union theme. I really need help here guys..
Answer: In tumblr documentation for photosets {block:Photos} {/block:Photos} block exists, which will be executed so many times, as how many images are in the photoset. Try to output each image in photoset with this block.
Images will be not in an iframe and full under your CSS control, with this trick.


Are there StackExchange paid-answers services?

Question: Is there some kind of paid service on StackExchange Websites where one can ask a question which will cost him some money, but he will receive an answer no matter how general or basic the question is? And of course this service/answer should be private.
Comment: Related: https://meta.stackexchange.com/questions/303637/se-paid-membership-with-payout-to-users-who-answer-questions and https://meta.stackexchange.com/questions/25615/offering-actual-money-as-a-bounty
Answer: There is to my knowledge no such service.
One of my issues with this is that involving money may give the idea that the quality of answers somehow is magically increased. In actuality, I believe that it decreases as more people would want to answer purely to get at the money, assuming the idea was to pay people to answer.  Getting paid does not make your Unix knowledge better or sharper. Paying for an answer does not make the answer better.  If everything additionally is done in private, then this totally short-circuits any corrective peer review process.
You should be able to ask questions without paying.  If you ask a simple question, chances are that it has been addressed before, in which case the question can be marked a duplicate.  If the question is too general, then it's an issue with the question, and no amount of money would make it easier to answer.
Answer: I'm not currently aware of one, no.
Kusalananda pointed to a couple posts on the main discussion site, Meta Stack Exchange:

SE paid membership with payout to users who answer questions - asked in 2017 and which was closed as a duplicate of Would it better the community if we got compensated for posts? Even with minuscule alt coins? from 2014.

Offering actual money as a bounty? - asked in 2009 and officially declined in 2011.

There are several answers worth reading in those threads. The votes and discussion there indicate a negative reception to the idea.
Looking at U&L, I found some previous discussion:

How to deal with 'paid help' questions? - asked in 2012.
I would be happy to pay real money for succesful solution to my question - asked in 2015.

... both of which echo the "no" sentiment.
Comment: I believe the question is not about mixing/transforming the existing SE sites with any paid service, like most of these links say. But if there is a separate private service, offered by Stackoverfow the company, like "Teams", where additionally to hosting/supporting the creation and maintenance of a private knowledge base, someone could hire professionals of specific domains, dedicated to that service. I am not aware of if such a choice is available for Stackoverflow "Teams".


Leaving a hot wire in the wall or ceiling

Question: I am redoing a ceiling fan with new wiring. I have the walls open at the switch box. There is an old knob & tube hot wire coming in and then it goes out to the ceiling fan. I have run new wiring to the ceiling fan and have put an outlet right below where the new plastic box is going for the switch. I can't find where the feed is for the hot wire, it is somewhere in the ceiling. I have gone to the other fixtures that are on the same breaker and don't see the hot wire being fed from there. What do I do with this?
Comment: Are you asking if it's OK to leave the K&T wire in the ceiling box and just not use it (which would be the easiest) or are you hoping to remove all unused K&T wire, but not sure where it originates? Sometimes K&T is spliced inside walls and ceilings w/o a box.
Comment: It is hot at the switch and that is where I would have to leave it. There are only two wires that come into the switch box, the hot coming in and then it goes out to the light. If I disconnect the wires at the switch, the wire going to the light is going to be dead but the other wire is going still be hot. I am planning on getting my new feed from the outlet box directly below the new switch box.
Comment: If that's as far as you want to tear into things, there's nothing wrong with wirenutting or taping it and leaving it in the box. The worst thing about K&T is its age and only you know the condition of its insulation. Tape it all up if you have to and don't bend it around too much.
Comment: It hit me right after I clicked add comment. You want to get rid of the old sw box right? You said your wall is open so you're looking right at it along side of the stud? Remove the old box and cut the hot wire or both of them within a few inches of a knob or tube and tape or wirenut it. If you can't see a knob or tube, beef up the insulation with tape or heat shrink tubing for a few inches and gently staple it to the center of the stud.
Answer: You must terminate the wire in a box and it must remain accessible with a cover plate.  You need to terminate it with the appropriately sized wire nut.
This may help locate the hidden splice:  get a voltage sensor ($5), turn off all breakers except for this one.  Put the sensor on high sensitivity and start sweeping around on the ceiling.  You might get lucky and find a hidden box or at least you'll get to know how the wires are run and get a better feel for which switch or light box contains the feed.
Comment: Perhaps a new "knob" is needed so that the wire is properly tensioned?
Comment: I am not sure that a new knob would do anything, the issue is what to do with the old hot wire for the switch/ceiling fan that is being replaced, not anything to do with tension.


How can I programmatically show the toolTip on a TextInput when a validator returns "invalid"?

Question: I have a form with a TextInput that has a custom Validator. I call the Validator logic and handle the result programmatically. This all works fine, except for one problem. The TextInput gets highlighted when it is invalid, but the toolTip that contains the errorMsg does not display until I roll the mouse cursor over the TextInput. Is there anyway to get the toolTip to show programmatically?
Answer: You will probably need to programmatically re-create the text of the tooltip using the ToolTipManager.createToolTip function in your validator result handling function.
Check the documentation at the link, it seems pretty straightforward to spawn an instant tooltip.
Comment: Yeah, I was hoping to not have to go that far. To me, it should be much simpler than that - the ToolTip already exists, it's just not being displayed. I don't need to recreate an existing item, just show the one that's already created.
Comment: I think that may be your only option.  I imagine that behind the scenes, when you set the toolTip property in MXML, it's silently registering mouserOver and mouserOut event listeners for that UIComponent, then retrieving that stored toolTip string value from the UIComponent and calling createTooltip and destroyTooltip in the event listeners.
Answer: Eric,
You may have a look at:
Better form validation in Flex
This may help you to customize the validator .


How to Start/Stop a Windows Service in Safe Mode

Question: I installed SharePoint on W2K8 64 bit VMWare workstation. I cannot boot up because it freezes as it attempts to install Windows Updates. One error in the log says that Windows Messaging service should be running but I was not able to start this in Safe Mode. Has anyone got some suggestions on how to get my VM back up?
Answer: Is the question about how to start a service in safe mode, or how to resolve your problem booting into Windows in Normal mode?  Have you tried Last Known Good Configuration?
Comment: I was wondering how to start the service in safe mode.
Answer: Resolved problem be rebuilding VM. Note: one error I made was installing Powershell 2.0 without uninstalling 1.0 - not sure if this contributed to the problem or not.


How do I prove that all primitive recursive functions are computable?

Question: I stumbled across an exam question, and I am not sure how to prove that that all primitive recursive functions are computable. Is there a formal definition of this?
Comment: By definition, arguably; they are clearly a subset of the $\mu$-recursive functions which are Turing-equivalent.
Comment: And how do you prove they are Turing-equivalent? One direction uses exactly this result.
Answer: You prove it by structural induction over the definition of primitive recursive functions. The definition of computable is: a function is computable if it is computable by a Turing machine. There are many other equivalent definitions.
Comment: So do I need to provide a definition of TM that computes those functions?
Comment: No, you use the Church-Turing thesis to just present an informal algorithm. You can find many examples in any textbook on computability theory (aka recursion theory).
Comment: There is no need to invoke the CTT here, since we can easily have a true proof.
Answer: There are different definitions of computability.

A function is computable if there is a terminating Turing machine which computes the result.
A function is computable if there is a µ recursive function which computes the result.
A function is computable if there is a lambda expression in untyped lambda calculus whose beta reduction terminates and which computes the result of the function.
...

All these definitions are pretty formal (i.e. "execution" can be done by a machine). The definitions have been invented at the beginning of the 20th century in order to find a precise definition for the predicate "can be computed mechanically".
It can be proved that all these definitions are equivalent. E.g. for any terminating Turing machine there exists a µ recursive function which calculates the same result. For any µ recursive function there exists a terminating Turing machine which calculates the same result. These proofs can be found in recursion theory. The proofs are general. I.e. they apply to all Turing computable functions, to all µ recursive computable functions etc.
Since the primitive recursive functions are a subset of µ-recursive functions they are clearly computable in the sense of µ recursive functions. Since all µ recursive functions are Turing computable, clearly all primitive recursive functions are Turing computable as well.
Comment: OK but doesn't this beg the question? How would you prove that the $\mu$-recursive functions are computable?


What is wrong with mixing "taller" and "tallest" like this?

Question:
Although the towers appear identical, the west tower is the tallest, standing 16 feet taller than the east tower.

What might be wrong? Does it have to do with comparative and superlative degrees?
Comment: You could add *"... and 20 feet taller than the central tower"* to make the sentence *"correct"*. (But if this sentence is given in isolation on a standardized test, how do you know that there isn't a central tower?)
Comment: In fact, I can construct a perfectly factual and cromulent sentence along these lines: *"The West Peak of Mt. Tamalpais is the highest, at 785 meters, barely one meter higher than the East Peak"*. (There's a Middle Peak, but it's not worth mentioning in this sentence, being nearly 30 meters below the other two.)
Comment: Yes.
Comment: I am inclined to believe that the question takes into account only two towers, and seeking the answer in that same perspective
Comment: @vickyace; what do you mean "I am inclined to believe"? You are the only one who actually knows what the context is. If it really is a test and no context is given, then clearly the examiner *intends* to imply there are only two towers, and is basing 'the correct answer' on that. But as Peter Shor said, in this form we do not know how many towers there are, so the sentence is strictly neither right nor wrong.
Answer: Technically the right way to phrase a comparison between two entities is to use the comparative ("taller"). You would use the superlative ("tallest") only if you were comparing three or more objects. So you would write:

Although the towers appear identical, the west tower is the taller (of the two), standing 16 feet taller than the east tower.

However this piece of grammar is relatively little known, and you would find the sentence you wrote acceptable to most people.
Comment: I agree that most people would -- quite reasonably -- find nothing to quarrel with in the use of _tallest_, despite the existence of the convention whereby *taller* is supposed to be used when only two objects are being compared. But that is _only_ a convention, and I question the usefulness of this one because (like the equally pointless "fewer vs. less" convention for count nouns vs. non-count nouns) it adds nothing to our understanding of the situation. Conventions should _serve_ us; we should not allow ourselves to be enslaved by them (or try to enslave others to them, for that matter).
Comment: Always choose the least of two evils.
Answer:

Although the towers appear identical, the west tower is the tallest, standing 16 feet taller than the east tower.

What might be wrong? Does it have to do with comparative and superlative degrees?

Grammatically, it is fine. This is true even if the set of towers is that of exactly two.
Though, the use of a superlative -- when the set under comparison consists of exactly two -- could sometimes be considered to be of an informal style.
In the 2005 textbook by Huddleston and Pullum, A Student's Introduction to English Grammar, page 197:

Prescriptive grammar note
Usage manuals commonly say that the superlative is incorrect when the set has only two members (the tallest of the twin towers). However, the superlative is the default for set comparison, and it's fairly common as an informal variant of the comparative with two-member sets. It is relatively unlikely when the two-member status of the set is explicitly given in an of phrase, as in [6.a] ("Kim is the taller of the two"), but sentences like Kim and Pat were the only candidates, and Kim was clearly the best are certainly grammatical.

There's also related material in the 2002 reference grammar by Huddleston and Pullum et al., The Cambridge Grammar of the English Language (CGEL), page 1162:

6.2 Comparative grade in set comparison
The central case: the better of the two
Comparative forms are found in set comparison when the set contains just two members:
[2] - - - - COMPARATIVE - - - - - - - - - - - - - - SUPERLATIVE - - - -

i. a. Pat is the [more reliable] of the [two]. - - b. Pat is the [most reliable] of the [three].

ii. a. Which of the [two] is the [better] value? - - b. Which of the [three] is the [best] value?

Comparative more and better cannot substitute for superlative most and best in [b]: a superlative is required if the set contains three or more. In [a], however, the superlative is found as an alternant to the comparative, though it is generally restricted to informal style. The superlative is used more readily in those cases where the dual nature of the set is less immediately or explicitly indicated than it is in [i.a/ii.a] themselves -- as in the following example from a linguistics textbook:

[3] For lexical units with identical grammatical properties, two alternative criteria for membership of the same lexeme will be proposed. The first is [the most important].

Topics like this one is sometimes discussed in usage dictionaries, such as The Merriam-Webster's Dictionary of English Usage. In my copy of MWCDEU, there is the entry "superlative of two", pages 716-7. Here are some excerpts from it:

superlative of two
The notion, so beloved of modern commentators, that the superlative degree should not be used of only two seems to have had its origin in the 18th century. Joseph Priestley was one of the earliest to express it (Leonard 1929 cites a 1769 edition), but he only gave one example of the superlative of two and concluded, "This is a very pardonable oversight." Campbell 1776 was the next to take it up. He did so speculatively, allowing both "the weaker of the two" and "the weakest of the two," but preferring the comparative to the superlative on "the most general principles of analogy," which principles he did not explain. Lindley Murray 1795 took his discussion of the superlative straight from Campbell, but in later editions he eliminated any element of doubt. "The weaker of the two" became "the regular mode of expression, because there are only two things compared." Campbell's speculation had become a rule.
. . .
Two things should be noted about the rule. First, as Lamberts 1972 points out, it makes no difference from the standpoint of communication whether you use the comparative or the superlative of two. The rule serves no useful purpose at all. It is therefore a perfect shibboleth, serving no practical function except to separate those who observe the rule from those who do not.
The second thing is that the rule has never reflected actual usage. From the examples collected by Otto Jespersen and other historical investigators, it is plain that many of our best writers have used either the comparative or superlative of two, as suited their fancy at the time. Among the writers who found the superlative appropriate for two are Shakespeare, Milton, Defoe, Addison, Goldsmith, Dr. Johnson, Chesterfield, Austen, Byron, Scott, Irving, Hawthorne, Thackeray, Disraeli, Ruskin, Emerson, Stevenson, Thoreau, and James Russell Lowell. There is clearly a strong literary tradition for the practice. Here are some examples from our collection: . . .

We cannot agree as to which is the eldest of the two Miss Plumbtrees -- Jane Austen, letter, 31 May 1811

dinghy, dingey. The first is best -- Fowler 1926

Crane wrote two fine stories, The Open Boat and The Blue Hotel. The last one is the best -- Ernest Hemingway, Green Hills of Africa, 1935

. . . It seems clear from our experience in gathering examples of the superlative of two for this book that they are plentiful and can be readily found by anyone who is interested enough to look for them.
We conclude that the superlative of two is alive and well in current English. The rule requiring the comparative has a dubious basis in theory and no basis in practice, and it serves no useful communicative purpose. Because it does have a fair number of devoted adherents, however, you may well want to follow it in your most dignified or elevated writing. . . .

And so, I hope this is enough info for your purposes.
On issues of current English usage, a decent usage dictionary (such as MWDEU) can often be helpful and easy to read. As for grammaticality, it seems to be practical to do a quick look-see in the 2002 reference grammar CGEL.

What is wrong with mixing “taller” and “tallest” like this?


Do you need to know the filename to conduct a Directory traversal

Question: If my websites has a directory traversal vulnerability (linux) and my other php pages have complicated filenames (e.g. efj93ehdsijgdij3g.php), could an attacker still access other files? Or an attacker strictly needs the right filename in order to successfuly conduct a directory traversal?
Comment: It depends, in most cases yes. However there are lots of other files an attacker would look at rather than your pho files, such as /etc/shadow. If your directory traversal is used in an include() you have a lfi vulnerability and again there are easier targets such as /proc/self/environ. Should an attacker succeed with exploitation of lfi your file name complexity no longer matters.
Comment: Seems right (and I am using the include() funct) but could you expand about the cases in which they can exploit the directory traversal or what depends?
Comment: Expanded on my comment as an answer..
Answer: Directory traversal is a rather broad vulnerability that can lead to a variety of attacks, depending on context.
On its own, it only means that an attacker supplies a file or directory name, and can travers to files or directories outside of the expected directory. This can facilitate attacks such as:

LFI
Reading of files outside of the desired directory
Uploading files outside of the desired directory, possibly leading to code execution (for example if the only thing preventing code execution is securing the desired directory)
moving files outside of the desired directory
Viewing directories outside of the desired directory, which may help an attacker gather information about the target system
etc

Giving your files complicated filenames could only possibly help in the case of reading out files outside of the directory, and only if you do not provide the ability to list files.
Renaming your files may seem like a good idea as defense in depth - security by obscurity should never be your only line of defense -, but it's not really worth it, as there are larger attack surfaces than reading out your PHP files.
In the case of LFI, an attacker can still read out system files which can have severe consequences. Depending on your configuration, they may be able to:

read out /etc/shadow, crack the passwords, and gain access to the system
inject code into various log files and include them, leading to code execution
inject code into proc/self/environ and include it, leading to code execution
etc

So renaming files may prevent an attacker from reading out those specific files, but doesn't really limit the damage of LFI. It also leads to reduced maintainability, making it not worth the trouble.
Answer: Having to know the file name depends upon the vulnerable code, sometimes you can get directory listings. However there are lots of other files an attacker would look at rather than your php files, such as /etc/shadow.
If your directory traversal is used in an include() statement you have a rfi or lfi vulnerability and again there are easier targets such as setting the user-agent to <?php passthru($_GET['c]); ?> and traversing to /proc/self/environ or your web server logs. Or any other location where the attacker can control content written on your hard drive (uploaded files, temporary files, session files, database files, smtpd/sshd logs, etc, etc). Should an attacker succeed with exploitation of lfi your file name complexity no longer matters as an attacker could just run commands like ls to list files.
A good way to prevent traversal attacks is to compare the user supplied data against an array of acceptable values, or simply call basename() on the user supplied data prior ot the include() as long as there is no user (attacker) controlled files in the same directory.


Unaffected XP orbs

Question: I am making a adventure map in which I am using the new 1.10 tag "NoGravity" on XP orbs to make them float around at night on a grassy plain, but they can be affected by a players presence and are pulled towards them, is there any way to make them unaffected by nearby players but still move naturally and be pickup-able?
Answer: You could put XPOrbs on other entities, like invisible armor stands. If you do, orbs will only be pulled towards the player from 1 block range (it's point-blank range, so it should be fine).
You were also talking about orbs moving naturally, but I can't see them move at all. Could you explain it?
Comment: What I meant by that was their natural motion when they are spawned, as I am using the NoGravity tag on them, after they spawn from mob death or such I do not want them to be still entities. so they will, for example still move inside of a designated area, a bit like how a butterfly in a jar can still fly around in a jar, it might not, but it does have that choice. From what you gave me I will make the armor stands do the moving, thanks!

Unaffected XP orbs


How do you combine exposed filter string text searches into one input field for Drupal 7 Views?

Question: Currently I have a bunch of exposed filters in my view but I want to combine them where I can search them using only one input field. How can this be done?
Answer: If you want to be super-flexible in your search, essentially searching through the whole listing rather than just a particular field or two, I'd suggest you simply add the 'Search Terms' filter.
If you go to add another filter to your view, you can narrow the options by the 'Search' related ones and select the 'Search Terms' one:

You can name it anything you want, but it will essentially search through your entries the way a regular search does - so, by default, it will search through all fields that are displayed on your node, not just the ones you're displaying in your view at the moment.  Hope that makes sense - just another option to consider in the mix.  :-)
Comment: This search term filter is so good! The fact that it's so flexible (because of the view) and it seems to use the Drupal search index (which makes it fast) makes it a great solution.
Comment: Boriana, you have no idea how much you have inadvertently helped me. Can't thank you enough!!!!
Comment: I don't understand how this filter works. I have multiple nodes, all of them have the word "official" in their title, body, and multiple other fields. Yet when I search this filter for "official" there are no results.
Comment: This is what I have expected. Thank you very much :)
Answer: Set your basic filters. And then add the 'global: combine fields filter'.
Set it to exposed. Select the fields you want to use as filter field.
Answer: In Drupal 7, if you don't want to use any of the other module, you can use Global: Combine fields filter to get the desired functionality. By using the same, you can select multiple fields on which you want to perform search.
Comment: The 'global: combine fields filter' is indeed the best option, unless you want to include fields of a referenced entity or field collection. Then you need the Views filters populate module. See also [my comment here](http://drupal.stackexchange.com/questions/144212/global-combine-fields-filter-views-does-not-include-referenced-entities-conte/160665#160665). And note that when using the 'global: combine fields filter' you need to make sure to enable the core search module, or you will not find the filter Search: Search Terms option.
Answer: Views filters populate module might be helpful for your issue.

This is an utility module. Its sole purpose is to fill in one blank that seems not easy to be done using normal views, which is to use one exposed string filter to search on multiple fields.
Bear in mind, that, for now, only populates STRING exposed filters, so those filters that take an array (options) or special types won't work, although it may not be difficult to extend it.

Also check this answer.


Polynomials $X^n$ and $(1-X)^n$ are coprime

Question: Let $n\in \mathbb N-\{0\}$ . How can we show that the polynomials $X^n$ and $(1-X)^n$ are coprime? Do we have to do an induction on $n$? it is clear that $X$ and $(1-X)$ are coprime by Euclid's algorithm. We can write $(1-X)^{n+1}=\sum_{k=0}^{n+1}{(-1)^k{k\choose n+1}X^k}$ but then how to proceed for the induction. thank you for your help.
Answer: The only irreducible divisor of $x^n$ is $x$. By the binomial theorem,
$$(1-x)^n=1+x\left(\sum_{k=1}^n(-1)^k{n\choose k}x^{k-1}\right).$$
But then if $x|(1-x)^n$ we have that $$x\bigg|\left((1-x)^n-x\left(\sum_{k=1}^n(-1)^k{n\choose k}x^{k-1}\right)\right).$$
Of course this means $x|1$ which is impossible. Hence no primes are shared by $x^n$ and $(1-x)^n$ so they are coprime.
Comment: Hugues : What do you mean by prime divisor here? irreducible ?
Comment: @palio yes, irreducible is the same thing in this context.
Answer: Let $Y = 1 - X$, we have
$$1 = (X + Y)^{2n-1} =
\left( \sum_{k=0}^{n-1} + \sum_{k=n}^{2n-1} \right) \binom{2n-1}{k} X^k Y^{2n-1-k}$$
Let $j = 2n-1-k$ in the second sum and notice $\displaystyle\;\binom{n}{k} = \binom{n}{j}$, we get
$$1 = \left( \sum_{k=0}^{n-1} \binom{2n-1}{k} X^k Y^{n-1-k} \right) Y^n
+ X^n \left( \sum_{j=0}^{n-1} \binom{2n-1}{j} X^{n-1-j} Y^j\right)
$$
Since $1$ can be expressed as a linear combination of $X^n$ and $Y^n = (1-X)^n$ over the
polynomial ring of $X$, $\gcd(X^n, (1-X)^n) = 1$.
Answer: Suppose $p(X)$ is a monic divisor of both $X^n$ and $(1-X)^n$. Then for $p(X) \mid X^n$, any root of $p(X)$ has to be $0$. Because of $p(X) \mid (1-X)^n$, any root of $p(X)$ has to be $1$. Therefore $p$ cannot have any roots and we must have $p(X) \equiv 1$, which is to say that $X^n$ and $(1-X)^n$ are coprime.
Comment: There are polynomials without roots in given fields, like $x^2+1$ over the reals, you need to account for algebraic closure considerations with this approach, or classify the divisors (it's definitely easily salvaged)
Answer: We have according to Newton's identity:
$(1-X)^n=\sum\limits_{k=0}^n{n\choose k}(-1)^kX^{n-k}=1+X\sum\limits_{k=1}^n{n\choose k}(-1)^kX^{n-k-1}$
Put $P=\sum\limits_{k=1}^n{n\choose k}(-1)^kX^{n-k-1}$
It means that $\exists P\in\mathbb{C}[X],\,(1-X)^n-P(X)X=1$.
According to Bezout's theorem, $\gcd\left((1-X)^n,X\right)=1$ and so $\gcd\left((1-X)^n,X^n\right)=1$ (because if $\gcd(P,Q)=1$ then $\forall(n,m)\in\mathbb{N}^2,\,\gcd(P^n,Q^m)=1$).
Answer: As you say, the case $n=1$ is clear. So suppose that $n >1$ and we know the result for $n-1$.
Suppose that the gcd is not $1$. Then some irreducible polynomial $f(X)$ of positive degree divides both $X^{n}$ and $(1-X)^{n}.$
Then (from the first, and using $f(X)$ irreducible) $f(X)$ divides $X$ or $X^{n-1}$ ( so, in any case, as $n>1$, $f(X)$ divides $X^{n-1}$). Simillarly, from the second, $f(X)$ divides $(1-X)$ or $(1-X)^{n-1},$ so in any case, as $n >1,$  $f(X)$ divides $(1-X)^{n-1}$. Hence we know that $f(X)$ divides both $X^{n-1}$ and $(1-X)^{n-1}$, so divides their gcd, which is 1 by induction, a contradiction as $f(X)$ has positive degree.


Cannot install xubuntu 11.04 because of "signal out of range"

Question: Just grab iso from official site, burnt it on a cd, tried to install, after the first language selection menu, monitor turned black with message: "signal out of range". What can I do, especially, can I do something right there, without burning new iso, because I'm currently out of blank CDs, will I have this kind of problems after the installation? Please Help!
Comment: duplicate? http://askubuntu.com/questions/38264/monitor-displays-signal-out-of-range-until-the-graphical-interface-is-loaded-afte
Comment: @Rinzwind no, that question is about "after installation", I even can't install!
Comment: sorry! you are right.
Answer: I have found a solution based on GUTSY here: http://ubuntuforums.org/showpost.php?p=4380153&postcount=8  Yes, I know Gutsy is alot older so this might not even come close to 11.04's install but #10 will always work :-D
edit: #9 is certainly invalid for 11.04. #5 is the one that will tell you if this still works in 11.04. Please report back with the answer ;-)
From that post:

First, boot your system with the Ubuntu Live CD.
At the Ubuntu boot up screen, make sure that the first item (Start or Install Ubuntu) is active and press F6.
Replace the words "quite splash --" with "single" without the quotes and press Enter to continue.
Some text messages will flow. When the boot process is complete, you will find yourself logged as root in text mode.
When (or if) you reach the text prompt at the end of the boot up process, issue this command: dpkg-reconfigure -phigh xserver-xorg  Select "vesa" as the driver and "1024x768" and "800x600" as the resolutions.
Exit the root session either with "exit" or "Ctrl+D".
The system will automatically load to the graphical Live CD environment. If not, you can force it manually by entering "startx".
If this does not work, then repeat the same steps and select a different low resolution proportional to your screen size.
Normally, this step is not necessary, but just for your information; you can also write "nano -w /etc/X11/xorg.conf" or if you are familiar with Vi Editor, "vim /etc/X11/xorg.conf" to edit the resolutions manually in the "xorg.conf" file.
Otherwise, the only option you have is to download Ubuntu Alternate CD from:
http://www.ubuntu.com/getubuntu/download
Comment: man, I have brand new iso burnt on cd and windows and fresh empty hard drive on which I want to install ubuntu. Is there any possibility I can use command line during the installation, to be able to issue #5?
Comment: could you please explain step by step what should I do. Currently I'm on installation main screen appearing after language selection (Try.., Install, ... etc), my actions?


Steelhead Salmon's Mercury content

Question: How does Steelhead salmon compare with Atlantic farm raised salmon when it comes to mercury content?
Answer: Sorry, I know that this is old, but I wanted to follow up with some related data.
Caveat: I'm not a scientist, but my dad was a biochemist who worked in the aquatic biology field for more than 50 years, and I picked up a few things.
In 2001, a multi-species study was done on several species of fish including two types of local salmonid trout - cutthroat trout (Oncorhynchus clarki) and kokanee (O. nerka) in a large freshwater lake in Washington State (Lake Whatcom). Both of these fish are morphologically similar to Steelhead Trout (O. mykiss) in its non-anadromous form (also known as rainbow trout).
What all this means is, these are good marker-species to use because they are a lot like steelhead.
In a nutshell - even though these fish were raised in the wild and ate whatever they could catch (insects, small crustaceans and the like), their mercury levels were lower than most commercially-caught fish.
The cutthroat trout showed a mean of 0.08mg/kg mercury and the kokanee showed a mean of 0.12mg/kg mercury. This is pretty low. The paper that I used for my research is here: Mercury in Sportfishes of Lake
Whatcom, Washington, Including a
Review of Potential Impacts to
Aquatic Resources and People
Farmed steelhead/rainbow trout from the Columbia River and Washington and British Columbia coastal waters are very environmentally sound, having earned a "Best Choice" rating from Seafood Watch (https://www.seafoodwatch.org/seafood-recommendations/groups/trout?method=farmed&q=Trout,%20Farmed&t=farmed%20steelhead%20trout&type=rainbow&location=domestic&o=1327878260).
There are two sub-cultivars of this species - those that are raised in pens which are truly anadromous (i.e., they smolt, and spend half their lives in freshwater and the other half in saltwater), and those that are raised in raceways on one of the coastal river systems such as the Columbia, which are not anadromous and would technically be called rainbow rather than steelhead.
It is arguable that their flavor is not as strong in a salmon-y, fishy way as wild-caught fish. Those that are raised in pens are closer to wild-caught, because pens do not restrict the passing of small crustaceans and other species and thus allow the pen-raised fish to have a diet much closer to their natural one.
While I do prefer wild-caught fish for their flavor, I have often purchased and prepared locally-farmed steelhead.
I fundamentally have a problem with invasive-species that are farmed here in the Pacific Northwest (such as, for example, Atlantic Salmon). I do not have any issues with farmed steelehad, because it is a local species anyway and it seems to be a sustainable food source.
Lastly, here's a picture of some smoked steelhead I made in December of last year:
Answer: Actual numbers (ppm, etc.) depend on exactly where the fish were raised and how old they were when caught. Steelhead feed on zooplankten as fry, but they eat other fish, squid and mollusks as adults. Therefore, they take in whatever mercury has been consumed by their prey; the older they are when caught, it higher the probable mercury content in their bodies.
Farm-raised salmon are fed manufactured feeds which have strict limits on mercury content, and they have very little access or opportunity to capture wild prey, so their mercury content is usually significantly less.
Given the high levels of antibiotics, fungicides and other chemicals involved in fish-farming, however, there are substantially more of those chemicals in the fish. I'll take the mercury.
Comment: I'll take farmed according to organic standards, but good answer overall.

Steelhead Salmon's Mercury content


Is there a filter hook that I can use to change how taxonomy term names are displayed?

Question: I need to hide a custom taxonomy's terms' names on the frontend while preserving them on the backend. Instead of the terms' names I need to display pseudonyms. I can't find a single filter hook to do that. I've tried the ones in sanitize_term_field but that only works when the context is 'display'. It seems most of the time the context is 'raw' and there is no hook for that.  Does anyone know how to filter term names before they are displayed on the frontend?
Answer: The dynamic filter "term_{$field}" is probably what you're looking for, where the field is "name."
One approach is to have an array of names and their pseudonyms, then do a check-and-return on them so they'll display the replacement.
add_filter( 'term_name', function( $value ) {
    $terms = [
      'old' => 'new',
    ];

    // basic example check, loop through an array for real
    if ( 'old' === $value ) {
        return $terms['old'];
    }

    return $value;
} );


What pedals to get this effect?

Question: What kind of pedals should I purchase to make my guitar sound like this (Slash, Nightrain):
Comment: Please add some detail to the question so that it is searchable and useful to others.
Comment: @petilon did you make a separate account to edit this?
Answer: The effects Slash used are a Dunlop DCR-ISR Crybaby Rack, Dunlop Heil Talk Box, Boss DD-5 Digital Delay and a Boss GE-7 Equalizer (to boost his amplifier volume in the solos when playing live).
He gets his sound from his amp since he uses a high end marshal(a Marshall JCM 2555 Silver Jubilee back then), so an amp will get you a better slash sound than anything else.
Comment: are you interesed in simulating the tone in some software? there are many presets that will get you tones for lots of songs
Comment: @petilon as the answer points out, the tone *isn't from pedals* (aside from the delay on the lead, which you can hear clearly after the rhythm stops), a big part is the amplifier. There are pedals that aim to create a "driven amp" tone - this one is specific to the Marshall JCM: http://www.weehbo.com/products/jcm-drive/. There are forum threads on getting a "Slash tone" from Orange amps - see e.g. http://www.ultimate-guitar.com/forum/archive/index.php?t-1038943.html
Comment: Thank you for the answer, Hussein. I did find a youtube video where Shash's guitar tech talks about the pedals. I am aiming for the tone in this particular video though, and I hope I don't have to get all the pedals Slash uses -- I couldn't afford it. If I can get just one or two pedals to get close to the tone in this video that would be great. As far as amp, I have an Orange Micro Terror.
Answer:

These guys have a great video about how to sound like Slash's band Guns'n'Roses on a budget.
Here's the gear they chose:
SLASH:

Tone City   Angel Wing
Seymour Duncan Pickup Booster
MXR Talk Box
MXR Carbon Copy
Epiphone 1960's Tribute Plus
Marshall DSL 40C

IZZY STRADLIN:

Fulltone Plimsoul
Epiphone Sheraton II Pro
Backstar Artist 15

What pedals to get this effect?


What type of number is this $\frac{\sqrt2}{2}$?

Question: $$\frac{\sqrt{2}}{2}$$
In this monomial, an irrational number is divided by a rational number. However this is not a general case but can any one tell me that when we divide an irrational number or multiply an irrational number or its multiplicative inverse by a rational number then what type of the number we get in output? Either rational or irrational?
Comment: ***Hint:*** Product of rational numbers is again rational.
Comment: You have changed the clue. OK then.
Comment: It's definitely irrational, but it's not transcendental. It's an algebraic number but it's not an algebraic integer (minimal polynomial is $2x^2 - 1$).
Comment: See [this answer](http://math.stackexchange.com/a/878098/242) for the general ideal behind this (complement of subgroup closure).
Answer: Suppose that
$$\frac{\sqrt{2}}{2}= \frac{p}{q}$$
with $p$ and $q$ integers. Multiply through by $2$ to get
$$\sqrt{2}= \frac{2p}{q}$$.
That would make $\sqrt{2}$ be rational, which it's not. So the assumption that
$\frac{\sqrt{2}}{2}$ is rational must be wrong.
More generally: irrational divided by rational is still irrational.
Comment: I used a method called "proof by contradiction". You suppose something is true, use logic to arrive at a contradiction, and conclude that the assumed thing must in fact be false. In this case, I assumed that $\sqrt(2)/2$ was rational...which led to a contradiction. So the assumption is false, and we see that $\sqrt{2}/2$ must actually be rational.
Comment: How you taken fraction of $p$ and $q$ equal to $\frac{\sqrt2}{2}$ however the quotient of two fractions you stated can't be equal. One is rational and one is irrational i.e. $\frac{\sqrt2}{2}$?
Comment: Alright then, I must accept your answer now however this is not an unique answer but you helped me out at my confusions with your comment. :)
Answer: If $p$ is a rational (non-zero) number, and $x$ is irrational, then
$$
px, \quad \frac px, \quad \frac xp, \quad p+x, \quad p-x
$$
are all irrational. This can be proven by contradiction. Assume, for instance, that $px$ is a rational number, call it $q$. That is, set $q = px$. Now divide through by $p$, and we get $$\frac{q}{p} = x$$
The left-hand side is a fraction of two rational numbers, so it is rational. The right-hand side is $x$, so it is irrational. These two can therefore not be equal, and therefore the assumption that $px$ is rational must be false.
The others can be proven the same way. Be careful, however, because for each of the five expressions
$$
xy, \quad \frac xy, \quad \frac yx, \quad x+y, \quad y-x
$$there are some irrational numbers $x, y$ such that makes it rational (although not all at once).
Comment: @SufyanSheijk I assumed that $px$ was _rational_, and I give the name $q$ to whichever rational number that happens to be. This leads to a contradiction, meaning that the assumption must have been wrong.
Comment: Since you said that product of rational and irrational is irrational then you let $q=px$ and then dividing by $p$, you got the equation in the form $\frac{q}{p}$. I don't think it clears my query. Since I can't understand how you assumed $q$ as an integer however it's an irrational number. How can an irrational number be an integer?
Comment: Yeah I know it.. Alright.
Answer: Let $a$ irrational and suppose $b=\dfrac{n}{m}a$ ( $n,m \in \mathbb{Z}$) be rational i.e. $b= \dfrac{p}{q}$ ( $p,q \in \mathbb{Z}$).
You have:
$$
\dfrac{p}{q}=\dfrac{n}{m}a \Rightarrow a=\dfrac{pm}{qn}
$$
that is rational : contradiction!
Answer: Suppose that $\frac{\sqrt{2}}{2}=\frac{p}{q}$, then $\sqrt{2}=\frac{2p}{q}$, hence $\sqrt{2}$ would be rational, this is clearly a contradiction.
Answer: be careful with terminology! the same number is the denotation of many different expressions, e.g.
$$
\frac{\sqrt{2}}{2} = \frac1{\sqrt{2}} = 2^{-\frac12} = \sin \frac{\pi}4
$$
none of these is properly described as a polynomial btw
Comment: very kind of you! yes, i was just trying to be helpful wrt notation. the answer to your specific question follows directly from the definition: $x$ is irrational if it cannot be expressed as the ratio of two integers. if $\frac{p}{q}x$ (for integers $p$ and $q$ were rational then $\exists m,n \in \mathbb{Z}$ with $\frac{p}{q}x=\frac{m}{n}$. this gives $x= \frac{mq}{np}$ which contradicts the assumed irrationality of $x$ - (in fact Emilio's answer points this out clearly)
Answer: If you make the product of an irrational number $a$ with a non-null rational number $b$ then you will always get an irrational number, because :
$$a=(ab)\times b^{-1} $$
So if $ab$ happens to be a rational number then, because $b^{-1}$ is a rational number you end up by saying $a$ is a rational number (because a product of  rational numbers is always a rational number), which is false.
However there is no general rule if you ask irrational $\times$ irrational because :
$$\sqrt{2}\times \frac{1}{\sqrt{2}}=1\text{ is rational} $$
$$\sqrt{2}\times \sqrt{3}=\sqrt{6}\text{ is irrational}$$
The main point is that $\mathbb{Q}$ is stable under multiplication and inverse of non-null elements (i.e. it is a field).
You have exactly the same thing appearing when considering algebraic numbers vs. transcendant numbers.


Post doctoral while working on self employed job

Question: I am in need to know if there is a provision wherein I could do a post-doctorate in the USA for a year or two, while I am owning my own Biotechnology firm back in my home country?
Answer: This is a complex issue with a lot of variables. If your post-doc is for work completely unrelated to the work of the company then there is probably no serious issue as long as you faithfully complete the required work.
However, you will also face several issues if there is some relationship. For example, will you have conflicts of interest between the two aspects? That would make it hard-to-impossible to carry on. Likewise, are there intellectual property issues? In other words, is it possible that you will learn something in the post-doc that is, for contractual or other reasons, off-limits to your company. There may be other issues as well if there is any overlap.
For issues such as these, both the post-doc project PI and a lawyer should be consulted.
Comment: No My firm has nothing to do with the academic project and there is no common interest, one is on plants and other on animal and food or agriculture products and research. My firm is not self-owned but a partnership of recent origin. As I wasn't finding opportunities in academic, I had to decide to be self-employed. However, after two year struggle, I received some notable reputation in terms of publications from my PhD work that i think would help me in the academic expeirence.
Comment: We have no issues in the firm documentation that prevent the partners from going for a post-doc. but I was concerned if the financial aid for post-doc is government aided, do they have any restrictions that prevent the candidate from having alternate income unless he is fails to fulfill the work requirements of post doc?
Comment: @AvinashKumar, I doubt there are any financial restrictions for a post-doc, unlike for some scholarships. It is a job like many others.
Comment: Thank you very much Dr. Buffy. It sounds like a good news to me. I am glad I could discuss this matter here at academia with you.