Why are there only 7 periods in the periodic table?

Question: Is seven a hard theoretical limit (there can't be an eighth period) or is it there just because we haven't discovered/synthesized anything beyond that?
Comment: I don't have any trouble *theorizing* the 27th period. Synthesizing those elements is a "bit" more complicated.
Comment: It's an interesting and complex subject:  https://en.wikipedia.org/wiki/Extended_periodic_table
Comment: The  stability of heavy nuclei with too many protons has little to do with periodicity of patterns in electron  behaviour.
Comment: https://chemistry.stackexchange.com/questions/2786/what-are-the-g-blocks-predicted-properties https://chemistry.stackexchange.com/questions/43144/how-long-the-block-starting-with-element-121-will-be
Answer: There is no theoretical limit to the number of rows, but...

On one hand, as Tom Lehrer states, there may be many others but they haven't been discovard.
On the other hand, after all s, p, d, f orbitals are filled in the seventh period, there might be a new row, or there might be an extension of the seventh row, as a new type of orbital (g? Anyone know it there's a name?). Each orbital has double an odd number (double because the Pauli Exclusion Principle allows pairs of electrons of opposite spins), so the next orbital would have 18 electrons. Is it possible? Inner electrons would be moving at very high speeds, and they'd also shield outer electrons from attraction by the positive nucleus.
On the gripping hand, transuranics may last a few seconds... or a few attoseconds, so getting spectra might be problematic.
Comment: This is more of a few random comments then an answer :/ And you *ask* about thing you should know before you start writing!
Comment: Meh, finding duplicates is *way* more useful.
Comment: The S, P, D and F orbitals aren't all filled. Each of the outer shells has more S, P, D, F and G orbitals with room for more electrons. It's just that the lower number elements we already know don't use those outer orbitals.
Comment: @Mithoron, agreed, this is *not* intended as an answer, but as hints to the questioner where to look for info.
Answer: On the other hand,  it will be difficult to synthetize elements heavier than Oganesson ($\pu{Z = 118}$) for lack of neutrons. When the number of protons increases through the periodic table, the ratio neutrons/protons is also increasing. In oxygen-$16$, this ratio $\ce{n/p = 8/8 = 1.0}$. In iron-$56$, this ratio is $\ce{30/26 = 1.15}$. In uranium-$238$, it is $\ce{146/92 = 1.59}$. For heavier atoms, this ratio keeps increasing.
One of the problems to be solved for creating the last elements (tenessine, oganesson) was to find a not too heavy nucleus having enough neutrons to be used as missile sent on a target already rich in neutrons. Calcium-$48$ is a rare isotope of calcium, but a good choice with $20$ protons and a ratio neutron/proton = $28/20 = 1.4$. This value is the highest possible value among the $30$ first elements. When $\ce{Ca-48}$ is sent on a target like uranium-$238$ ($92$ protons), no nucleus can be made with a number of protons greater than $92 + 20 = 112$, which is copernicium Cn. And this collision will produce a nucleus with a maximum of $28 + 146 = 174$ neutrons, which gives the isotope $\ce{Cn-286}$. This nucleus is already rather instable, as its half-life is shorter than $1$ minute. If a lighter isotope of calcium had been used as missile, there would not be enough neutrons to make any isotope of copernicium. Of course lighter isotopes of copernicium have also been found.
It is extremely difficult to produce a nucleus with more protons than Copernicium-$252$. For making heavier atoms, it is necessary to hit a nucleus having more protons than uranium. But these targets are more and more radioactive. For getting the last atom, oganesson ($\ce{Z = 118}$), it was necessary to send missiles made of $\ce{Ca-48}$ nucleus on a target made of Californium-$252$ ($\ce{98}$ protons and $154$ neutrons), whose half-life is $\pu{2.2 y}$. Used as a target hit by $\ce{Ca-48}$ nucleus, it may produce a nucleus with a maximum of $98 + 20 = 118$ protons, and $28 + 154 = 182$ neutrons, which is oganesson-$300$. This is a maximum formula. For some reason, some neutrons have been ejected in the collisions, and real oganesson nuclei have been obtained with less than $182$ neutrons.
Now the yield of this synthesis is wretched. A total of only $14$ atoms of oganesson has been produced in the first publication, and they last less than one second. And to obtain this result, it was necessary to bombard the target of californium with an intense bundle of calcium-$48$ non-stop for three months and registering non-stop all particles emitted by this bombardment. And those particles were mostly made of smaller objects than oganesson. $14$ atoms have been obtained in three months, during which the target was quickly decaying.
To produce heavier atoms than oganesson, one should find a missile heavier than $\ce{Ca-48}$ with a higher ratio neutron/proton, like $\ce{Se-82}$, where $\ce{n/p = 1.41}$, or like $\ce{Sn-124}$, with a ratio $\ce{n/p = 1.48}$. One should also use a target heavier than Californium. But heavier atoms have shorter and shorter half-lives.
Comment: Probably a very naive question, but could one send two streams of missiles at the target? Or are the chances of three atoms combining into one essentially zero?
Comment: Good question. I am not a specialist of this domain. But  the probability that one missile hits the target and produces a new nucleus is extremely low, I doubt the yield would be better in a triple collision. In order to produce 14 nuclei of oganesson, they had to bombard many millions calcium ions per second, and wait three months. About one nucleus par week !
Answer: One other possibility is that if we were to advance into an eighth period with the creation of new elements for which we can characterize chemical properties (we have begun to do so with hassium, atomic number 108 and copernicium, 112), we may find that the  periodic recurrences we have come to know from previous periods break down.  We may have the elements but not a good placement for them in the Periodic Table as it is currently rendered.
Two factors might be considered, one theoretical and one "experimental" (meaning "experiments" with computer calculations).  On the theoretical side, the eighth period would include elements with atomic numbers equal or greater than 137, this number being the reciprocal of the fine-structure constant.  The idea that such elements are impossible has become passe, but the theories that enable those elements also imply that relativistic effects will become a predominant factor in the electronic structure and properties, much more so than we currently see in Periods 6 and 7.  Such relativistic effects were not accessible when Mendeleev first conceived the Periodic Table and not prominent across known elements even after Einstein's theories came.  We should therefore expect the relativistic effects to scramble the periodic expectations based on lighter elements.
More concretely, computer calculations indicate that the electron-shell structure on which the Periodic Table is based is already breaking down in known superheavy elements.  According to Ref. [1] and as reported in Chemistry World, oganesson (atomic number 118) is approaching a non-shell, Fermi-gas electron structure, driven by those same relativistic effects  described in the previous paragraph.  Such a breakdown in the shell structure would imply a breakdown in the periodic evolution of chemical properties based on such a shell structure.  The Periodic Table may end in a fog.
Reference
1.
Paul Jerabek, Bastian Schuetrumpf, Peter Schwerdtfeger, and Witold Nazarewicz, "Electron and Nucleon Localization Functions of Oganesson: Approaching the Thomas-Fermi Limit", Phys. Rev. Lett. 120, 053001 – Published 31 January 2018.
Comment: Oh good I don't have to answer. I have slightly different information expecting the breakdown at 120 because the energy difference after putting in the relativistic corrections says that 120 should be 1s8 1p8 rather than 2s8 but the difference is guessing whose theory is better.
Comment: I don't have anything much to add. I show a breakdown at 120 because the orbital energies are wrong, another breakdown at 137 because electron orbital velocity is too high and another breakdown at 173 because the electric charge energy is enough to create electron-positron pairs. The result of these is relativistic corrections are no longer remotely negligable, which means it can't be periodic anymore.
Comment: We want to see your take on this breakdown @joshua!
Answer: The periodic system is based on chemical properties and electronic structure.
Even the seventh period does not have a relevant chemistry. The lifetime of the respective isotopes is so short an atom hardly has time to relax into its electronic ground state before the nucleus decays. Everything we could "know" about the electronics of the eigth period would be based on conjecture, speculation. Unscientific, because not only practically, but principally unfalsifiable.
Unless someone goes and finds stable isotopes out there ... ;)


Do stars made by universe getting smaller or larger in mass?

Question: Do stars made by universe getting smaller or larger in mass compared to stars made 180 million years after the Big Bang? If they are getting smaller, is this due to the fact that the universe is expanding and the interstellar mass that made stars is getting less denser?
Comment: I can't understand your question. Are you asking whether stars forming now are larger or smaller than stars that were formed in the early history of the universe? And by larger, do you mean in terms of mass, radius or both?
Comment: Technically, that's a yes and a no. The Population III stars had masses over ~500 solar masses, while no such star exists today. So, it could be yes, but it is also no because there are still stars that are very massive but also ones that are very small.
Comment: I think you are looking for the time evolution of the "initial mass function" for stars
Comment: ...there are also stars do not exist *yet*, because there was no time yet to form. Afaik Sun will be such a star in its red giant phase. The long-term tendency is that stars will be smaller.
Comment: @RobJeffries Thanks for pointing that out, I edited the question more specific now.
Answer: The size of stars depends on the amount of non-hydrogen elements ("metals") affecting the opacity of the gas that forms them. Metals make it easier to radiate away heat when a gas cloud is collapsing, making it easier for a large amount of gas to accrete (although it may mainly act by increasing the minimum mass of stars that form). There is a fair disagreement about whether the first stars ("population III") were very massive (hundreds of solar masses) or actually small, but I think the rough consensus is that very massive stars were likely. Once they emerged and died, they added metals to the interstellar medium and star formation eventually became more like the present.
The expansion of the universe does not have much effect once gas become trapped in dark matter halos and start to form galaxies.
Once the star has formed opacity and mass determines its structure and luminosity. It turns out that for increasing metallicity the maximum stable mass of a star decreases (section B.2). For the eventual metallicity at the end of the stelliferous era Adams and Laughlin estimate a maximum mass star as only 30 solar masses.
Answer: The first stars formed in the universe are likely to have a "top-heavy" mass function. There would be more high-mass stars (as a fraction of all stars) than in the present day and the most massive stars would be more massive than the most massive stars formed in the present day. On the contrary, there would be more low-mass stars formed in the present day than in the early universe.
Details:
The first stars formed from primoridal gas with no heavy elements, just hydrogen and helium produced in the big-bang. Such gas is very transparent to radiation. In the present day universe, some of this primordial material has been processed in previous stellar generations and so stars form from gas which has a small, enriched fraction (about 2% by mass) of heavier elements - mainly oxygen, iron, carbon, nitrogen and nickel.
This is an important difference. These additional chemical elements are more opaque to radiation. This for example prevents the formation of very massive stars in the present day. The reason is that the radiation generated in their hot interiors couples sufficiently well to their outer layers to prevent them collapsing to become stars. In the early universe, this restriction isn't present and very massive stars are able to form.
This is not the full story. In addition to preventing very massive stars from forming, the extra "opacity" of gas in the present-day universe makes it more likely that a collapsing gas cloud will fragment into smaller pieces as the collapse continues, because the same heavy elements are more effective at radiating away energy themselves. The Jeans mass, which is the mass at which a cloud becomes unstable to collapse, is proportional to $T^{3/2} \rho^{-1/2}$, where $T$ is the temperature and $\rho$ is the density. As collapse proceeds, the density goes up. Now compressing a gas makes it hotter. In fact if energy cannot escape (a so-called adiabatic compression, much like in a petrol engine cylinder), then the temperature goes up so much that the collapse is halted because the Jeans mass rises and the cloud stabilises. However, if energy can escape, effectively radiated away by the heavy elements in the gas, then the temperature can remain constant and the Jeans mass can go down with increasing density. This leads to fragmentation of the cloud into smaller clumps and leads to the the production of smaller stars.
Thus the change in behaviour has little to do with the expansion of the universe. The characteristics of star formation are a local phenomenon driven by local conditions of density and temperature. These conditions (bar the heavy element fraction discussed above) will be broadly similar in collapsing gas clouds near the beginning of the universe, the present day or the future, because gravity acts to clump together material into the denisties required to initiate star formation.


switching between strings on violin

Question: So I'm learning a song on my violin which is played at 100 bpm and I'm having trouble switching between two eighth notes, a C on the high E string and C on the A string. I thought I'd shift up and then just play the lower C on the D string using my pinkie so I wouldn't have to shift all the way down to first or second position on the A string. But when I'm trying switch, even when I'm going slow, it sounds really squeaky and the lower C isn't... ringing or heard all that well. To be clear, I'm trying to switch from fourth position on the high E string to the C way up on the D string swinging over my pinkie. Any suggestions would be appreciated.
Comment: Is there some reason you're playing the high C in fourth position?  Can't you be in second position for the whole thing?  Maybe you should tell us about the passage before the high C?  In general, skipping over a string is something you want to try to avoid.
Comment: It would be helpful if you told us your level of play/experience, and also what the piece in question is.  there often are well-known fingerings for specific passages in common musical works.
Answer:
To be clear, I'm trying to switch from fourth position on the high E
string

In that case your first finger is on the lowest B on the E string and your second finger is on the C. The C on the A string is then one octave below that. The "correct/normal" way to play consecutive notes an octave apart is with the fourth finger on the high note and the first finger on the low note on the next lower string. To that end you need to play the first C in second position not fourth and it will become much easier. You need to arrange your shifting and fingering to play the first C in second position.
Playing this way will be much easier than crossing from E to D string without touching the A string and will sound much better. The tone quality differences between E and D strings are much greater than between E and A.

switching between strings on violin


Does freetype comes pre-installed on Mac?

Question: I am relatively new to Mac OS X environment.
I was trying to install freetype library to display text in OpenGL, but I failed.
I read on some forum that freetype comes pre-installed with Mac OS X mountain lion.
I just wanted to confirm this.
If it does in fact comes with Mac then how can I include it in my project?
If it doesn't comes with Mac then what is the ideal set of step one would follow to install freetype in Mac?
Answer: The dynamic linking library comes pre-installed, so you can use any software that requires freetype2 out of the box:
<code>/usr/X11/lib/libfreetype.6.dylib
</code>
However, the actual headers and such required to build a freetype2 project do not ship with OS X. To get these, you need to install Xcode; when you install Xcode with any version of the OS X platform SDK, it comes with freetype2:
<code>/Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/freetype2/freetype/freetype.h
</code>
These days, I think you have to go through the App Store in order to download Xcode, but it is free and that is about all you need to get started developing GL / freetype2 software on OS X. I believe they stopped including Xcode on the OS X install DVDs with the release of 10.6, so registering as an Apple Developer or going through the App Store is probably your only option.

By the way, you are going to have to jump through some hoops when you start using OpenGL on OS X for the first time. It is a little different from most platforms, particularly when it comes to loading (or rather not loading) extensions at run-time. Apple implements the full feature set for OpenGL 2.1 / 3.2 core for all OS X 10.7+ systems even if the underlying GPU does not support it all - it has software fallbacks for anything not supported by hardware.
So you don't have to worry about loading extensions based on the installed GPU capabilities, but you do have to worry about whether using a feature will throw you onto a software path. You also have to put up with longer than average wait time for new versions of OpenGL to be implemented, but this is the price you pay for guaranteed feature set support I suppose.
I would suggest you use something like glfw or SDL2 when starting out, especially if you don't like Objective C (does anyone, honestly?). A lot of newer OpenGL context management these days needs to be done using Objective C (cocoa); Apple is not a big fan of their own C APIs (carbon). glfw and SDL2 hide all this stuff from you so you never have to write a single piece of ugly Objective C code if you do not want :)
Comment: In Mountain lion the directory where freetype comes preinstalled is..<
**/Developer/SDKs/MacOSX10.7.sdk/usr/X11/include/freetype2/freetype**
Comment: Much appreciated.
I am trying to run a project on Mac, which is already functional on windows. I got it up and running using Carbon, the program works fine, but no text is visible in the Mac version.
So thought of using freetype2, which has an added advantage of Anti-aliasing.
I am trying to locate the freetype.h header file now.
Comment: @2am: Ah hah, that is why I included the path in my answer. When you install Xcode, it (usually) puts the platform SDK it ships with in `/Developer/SDKs/MacOSX10.n.sdk/`. Development frameworks will also show up relative to this path. Interesting side note, these days to get platform SDKs for older versions of OS X you often have to download an older version of Xcode - it used to be really simple on the Apple developer site to download an arbitrary SDK version :-\
Answer: Use below command solve my issues.
<code>brew install freetype
</code>
ref: https://formulae.brew.sh/formula/freetype


NPSP with custom record types

Question: We have created custom record types for Account and Opp, but upon lead conversion it always results in an organization and donation type even though we have removed npsp's lead convert page and using the standard. Is there a way to use custom record types with npsp?
Comment: have you checked the record types are enabled for the profiles you are using and that the NPSP ones are not the default?
Comment: @dave yes, I have done that yet it results in npsp's record type after conversion.
Answer: There is no way to specify custom Account record type in NPSP lead conversion or in standard conversion.  You would have to write a custom lead conversion process with Apex that creates the account record before converting the lead, then sets the account ID in the LeadConvert class and then proceeds with lead conversion.

NPSP with custom record types


Input text from one file, output it to another

Question: The challenge:

Input text from one file and output it to another.  Solution should be a complete, working function.

Note: This is a code-trolling question. Please do not take the question and/or answers seriously. More information here.
Comment: Code-trolling is in the process of being removed, as per [the official stance.](http://meta.codegolf.stackexchange.com/q/1514/3808) This question has a fair amount of votes with one extremely highly voted answer. It recieved just slightly over 50% "delete" votes on [the poll](http://chat.stackexchange.com/transcript/message/15398254#15398254), but only by about 8%, so I am locking it for historical significance.
Answer: C
The whole point of having multiple programming languages, is that you need to use the right tool for the job.
In this case, we want to copy bytes from one file to another.
While we could use something fancy like bash or ruby, or fall to the power of ASM, we need something quick, good with bits and fast.
The obvious choice is C.
The SIMPLEST way of doing it would be like so:
#include <stdio.h>
#define THEORY FILE
#define AND *
#define PRACTICE myfile1
#define SOLUTIONS myfile2
#define ARE fopen
#define IMPORTANT "r"
#define BAD "w"
#define LOL fclose
#define PLEASE fgetc
#define HELP fputc
#define ME return
#define NEVER for
#define SURRENDER !=
#define VERY filename1
#define NOT filename2
#define _ 1

int copyFile(char* filename1, char* filename2)
{
  THEORY AND PRACTICE = ARE (VERY, IMPORTANT);
  THEORY AND SOLUTIONS = ARE (NOT, BAD);
  NEVER (;_;)
  {
    HELP(PLEASE(PRACTICE),SOLUTIONS);
  }
  ME _SURRENDER_;
}

This  is evil because it will read garbage on things like cygwin, is completely chinese for a beginner, will scare him when he realizes it's a call for help and, obviously, because C.
Comment: `#define VERY filename1` `#define NOT filename2`
Comment: Also, if you `#define _ 1`, you can make `(;_;)` with the for-loop, to make it look like a smiley.
Comment: `#define LOL fclose` made my day
Comment: Changed those defs for you. I kept them the same on the function declaration for MORE confusion!
Comment: `#define LOL fclose`, which is never used is my masterpiece though.
Comment: Great job!  You made me laugh with those names!
Comment: You could also use `#define USUALLY filename2`, depending on your disposition at the time.
Comment: I don't know... it won't be better than the `$$` trick I did on the RNG question.
Comment: We all know calling fclose is never necessary...
That's why I never actually call it, the macro is there for good practice.
Comment: I read `NEVER (;_;)` as "NEVER CRY". Brilliant.
Comment: I just keep getting +1s here. wow.
Answer: sh
I like the simplicity of this one.
echo File1.txt > File2.txt

Really only works properly if File1.txt contains "File1.text"...
Comment: @user2509848 It puts the text "File1.txt" into `File2.txt`, not the actual contents of `File1.txt`
Comment: Could just as well be sh as there isn't anything bash specific.
Comment: make it ksh, he'll have to figure out where to get it
Comment: What is wrong with it?
Comment: But this doesn't actually cheat the question...
Comment: @Jeremy It's meant to look convincing and deceive the asker (which it did in this case), not actually carry out the task.
Comment: @Kaya True, I changed my answer to reflect that.
Comment: @syb0rg you say it doesn't copy the contents. t big deal.. so  `type file1.txt >file2.txt` or copy. maybe i'm missing something.
Comment: @barlop It's not supposed to be a big deal... this is a code-troll.
Comment: Changing the `echo` to a `cat` would do the job.
Comment: sh?  That would even work on windows! (or `type` for `cat`)
Answer: AutoHotKey
WinActivate, file1.txt
SendInput ^a^c
WinActivate, file2.txt
SendInput ^a^v^s

You must first open the files in notepad or some other text editor that makes the window names start with the file names. Then it copies the contents of file1 to the clipboard (literally, using ctrl+c), and pastes it into file2, overwriting anything currently in it, and saves.
Solves the problem, but in a very inconvenient and pretty useless fashion. It would probably by easier to just copy and paste manually.
Comment: Excellent! I wonder what the teacher would think?
Answer: As everyone knows, perl is very good for manipulating files.  This code will copy the contents of one file to another, and will do so with extra redundancy for good measure.
#Good perl programs always start thusly
use strict;
use warnings;

my $input_file  = 'File1.txt';
my $output_file = 'File2.txt';
open(my $in, '<', $input_file) or die "Couldn't open $input_file $!";

my $full_line = "";
while (my $line = <$in>) {
    #Get each letter one at a time for safety,
    foreach my $letter (split //, $line) {
        #You could and should add validity checks here
        $full_line .= $letter;

        #Get rid of output file if it exists!  You are replacing it with
        # new content so it's just wasting space.
        unlink $output_file if (-e $output_file);

        #Write data to new file
        open(my $out, '>', $output_file) or die "Couldn't open $output_file $!";
        print {$out} $full_line;
        close($out);
    }
}

To be safe, test this out on a small file at first.  Once you are convinced of its correctness you can put it into production for use on very large files without worry.
Comment: The first pass through it writes the first character of the old file to the new file.  The second time through it deletes the new file and writes the first two characters of the old file to the new file.  The third time, three characters, etc. etc.  Not only is it redundant, but if your computer crashes you will (possibly) have a partial file!
Comment: Does this code output it once, destroy the file, then try to output it again from the first output file?
Answer: C#
In order to achieve this, you must make sure to do several things:

Read string from file
Download Microsoft File IO and String Extension for Visual Studio
Remove viruses from string ("sanitize")
Write file to path
Delete and reload cache

Here's the code:
static void CopyTextFile(string path1, string path2)
    {
        try
        {
            FileStream fs = new FileStream(path1, FileMode.OpenOrCreate); //open the FTP connection to file
            byte[] file = new byte[fs.Length];
            fs.Read(file, 0, file.Length);
            string makeFileSafe = Encoding.UTF32.GetString(file);

            using (var cli = new WebClient())
            {
                cli.DownloadData(new Uri("Microsoft .NET File IO and String Extension Package")); //get MS package
            }

            fs.Dispose();

            File.Create(path2);
            StreamReader read = new StreamReader(path2);
            read.Dispose(); //create and read file for good luck

            var sb = new StringBuilder();
            foreach (char c in path1.ToCharArray())
            {
                sb.Append(c);
            }

            string virusFreeString = sb.ToString(); //remove viruses from string

            File.WriteAllText(path2, virusFreeString);
            File.Delete(path1);
            File.WriteAllText(path1, virusFreeString); //refresh cache
        }
        catch
        {
            //Don't worry, exceptions can be safely ignored
        }
    }

Answer: In four simple steps:

Print the file.  You can use the lpr command for this.
Mail the printouts to a scanning service.  (You will need postage for this).
The scanning service will scan the printouts and do OCR for you.
Download to the appropriate file location.
Comment: Good job creating a useless answer!
Comment: Is this RFC1149 compatible?
Comment: @user2509848 I would say good job creating useless job instead of answer...
Answer: Java
A lot of people find it useful to attempt to use regular expressions or to evaluate strings in order to copy them from one file to another, however that method of programming is sloppy. First we use Java because the OOP allows more transparency in our code, and secondly we use an interactive interface to receive the data from the first file and write it to the second.
import java.util.*;
import java.io.*;

public class WritingFiles{

 public static void main(String []args){
    File tJIAgeOhbWbVYdo = new File("File1.txt");
    Scanner jLLPsdluuuXYKWO = new Scanner(tJIAgeOhbWbVYdo);
    while(jLLPsdluuuXYKWO.hasNext())
    {
        MyCSHomework.fzPouRoBCHjsMrR();
        jLLPsdluuuXYKWO.next();
    }
 }
}

class MyCSHomework{
    Scanner jsvLfexmmYeqdUB = new Scanner(System.in);
    Writer kJPlXlLZvJdjAOs = new BufferedWriter(new OutputStreamWriter( new  FileOutputStream("File2.txt"), "utf-8"));
    String quhJAyWHGEFQLGW = "plea";
   String LHpkhqOtkEAxrlN = "f the file";
   String SLGXUfzgLtaJcZe = "e nex";
   String HKSaPJlOlUCKLun = "se";
   String VWUNvlwAWvghVpR = " ";
   String cBFJgwxycJiIrby = "input th";
   String ukRIWQrTPfqAbYd = "t word o";
   String  CMGlDwZOdgWZNTN =   quhJAyWHGEFQLGW+HKSaPJlOlUCKLun+VWUNvlwAWvghVpR+cBFJgwxycJiIrby+SLGXUfzgLtaJcZe+ukRIWQrTPfqAbYd+LHpkhqOtkEAxrlN;
    public static void fzPouRoBCHjsMrR(){
        System.out.println(CMGlDwZOdgWZNTN);
        kJPlXlLZvJdjAOs.write(jsvLfexmmYeqdUB.next());
    }

}

In theory (I haven't tested it) this makes the user manually input the content of the first file (word by word) and then writes it to the second file. This response is a play on the ambiguity of the question as to what it means by "input text from one file," and the crazy variable names (generated randomly) were just for some extra fun.
Comment: I was thinking about making something similar to this... not misinterpreting the part *input text frome one file*, but following a mathematician's approach saying *I've reduced the problem to an already solved one.* => handling screen input. Didn't come up with a good solution though...
Answer: sh
Like @Shingetsu pointed out, one has to use the right tool for the right job.  Copying the content from one file to another is an old problem, and the best tool for such file-management tasks is using the shell.
One shell command that every programmer has to familiarise themself with is the common tac command, used to tack the content of files together, one after another.  As a special case of this, when only one file is passed in it is simply spit out as-is again. We then simply redirect the output to the appropriate file:
tac inputfile.txt >outputfile.txt

Simple and to-the-point, no tricks!
Answer: Perl
Antivirus included.
#!/usr/bin/perl -w
use strict;
use warnings;

print "Copy the text of the file here: (warning: I can't copy files with newlines):\n";
my $content = <STDIN>;

print "\n\nPlease wait, removing viruses...";
my @array = split(//,"$content");
my @tarray;

foreach my $item (@array)
{
    if ($item ne "V" && $item ne "I" && $item ne "R" && $item ne "U" && $item ne "S")
    {
        push(@tarray, $item);
    }

}

print "\n\nNow copy this into the target file:\n";

foreach my $item (@tarray){ print "$item"};

Comment: That's true. But if you want to really remove viruses, there is a CPAN module to do that: http://search.cpan.org/~converter/Mail-ClamAV-0.29/.
Comment: No, it only removes the letters V, I, R, U, S from the file.
Comment: Very interesting, does it just pretend to check for viruses, or does it really do it?
Comment: Oh. Since you say "removing viruses", maybe you should remove 'E' too.
Answer: Windows Batch
(because you gotta have this supposedly "dead" language ;-)
@echo off
setlocal enabledelayedexpansion
for %%I in ('type %1') do set this=!this!%%I
echo !this!>%2 2>nul

You simply call this as copy.bat file1.txt file2.txt (or whatever files you want)
If only it would keep line breaks...
Comment: `setlocal enabledelayedexpansion` and `set thisline=!thisline!%%I` works only in Windows CMD. In DOS must work simple `set thisline=%thisline%%%I`
Comment: I updated the title.
Answer: Linq
Efficiency is not important, correctness is. Writing in a functional style results in more clear and less error-prone code. If performance does turn out to be a problem, the last ToArray() line can be omitted. It's better to be lazy anyway.
public void CopyFile(string input, string output)
{
    Enumerable
        .Range(0, File.ReadAllBytes(input).Length)
        .Select(i => new { i = i, b = File.ReadAllBytes(input)[i] })
        .Select(ib => {
            using (var f = File.Open(output, ib.i == 0 ? FileMode.Create : FileMode.Append))
                f.Write(new byte[] { ib.b }, 0, 1);
            return ib; })
        .ToArray();
}

Answer: Smalltalk
There is a library yet ported to several Smalltalk dialects (Visualworks, Gemstone Squeak/Pharo, ...) named Xtreams that makes this task more than easy.
FileStream would be as simple as 'foo' asFilename reading and 'bar' asFilename writing for example in Visualworks, but are dialect specific.
For this reason I demonstrate the algorithm with dialect neutral internal Streams instead.
A good idea could be to process each byte code in increasing order:
| input |
input := 'Hello world' asByteArray reading.
^((ByteArray new writing)
    write: ((0 to: 255) inject: ByteArray new reading into: [:outputSoFar :code |
        | nextOutput |
        nextOutput := ByteArray new writing.
        ((input += 0; selecting: [:c | c <= code]) ending: code inclusive: true) slicing do: [:subStream |
            | positionable |
            positionable := subStream positioning.
            nextOutput write: (outputSoFar limiting: (positionable ending: code) rest size).
            nextOutput write: (positionable += 0; selecting: [:c | c = code])].
        nextOutput conclusion reading]);
    conclusion) asString

Of course, it is also possible to process in random order, but i'm afraid that it makes the code a bit too compact:
| input output |
input := 'Hello world' asByteArray reading.
output := ByteArray new writing.
(0 to: 255) asArray shuffled do: [:code |
        output += 0.
        (input += 0; ending: code inclusive: true) slicing do: [:subStream |
            | positionable |
            positionable := subStream positioning.
            output ++ (positionable += 0; rejecting: [:c | c = code]) rest size.
            output write: (positionable += 0; selecting: [:c | c = code])]].
^output conclusion asString

EDIT
Ah stupid me, I didn't saw the log2 solution:
| input output |
input := 'Hello world' asByteArray reading.
(output := ByteArray new writing) write: (input collecting: [:e | 0]).
output := (0 to: 7) asArray shuffled inject: output into: [:outputSoFar :bit |
        (ByteArray new writing)
            write:
                (((input += 0; collecting: [:e | e >> bit bitAnd: 1]) interleaving: outputSoFar conclusion reading)
                    transforming: [ :in :out | out put: in get << bit + in get]);
            yourself].
^output conclusion asString

Answer: C++
This is somewhat based on Shingetsu's answer, but I couldn't resist.  It is fully functioning, but no student would submit it to their teacher (I hope). If they are willing to analyze the code, they will be able to solve their problem:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#define SOLVE ifs
#define IT >>
#define YOURSELF ofs

ifstream& operator IT(ifstream& ifs, ofstream& ofs) {
  string s;
  SOLVE IT s;
  YOURSELF << s;
  return ifs;
}

void output(ofstream& ofs, ifstream& ifs) {
  while (ifs) {
    SOLVE IT YOURSELF;
    ofs << ' ';
  }
}

int main() try {

  ofstream ofs("out.txt");
  ifstream ifs("in.txt");

  output(ofs, ifs);

  return 0;
}
catch (exception& e) {
  cerr << "Error: " << e.what() << endl;
  return 1;
}
catch (...) {
  cerr << "Unknown error.\n";
  return 2;
}

Comment: -1 (not really), not enough JQuery. Also too much error checking. I think you even closed the file! Gawd.
Comment: I could have known JQuery was coming up!
Answer: BASH
on terminal #1 with the IP, 192.168.1.2
nc -l 8080 | gpg -d > mydocument.docx

on terminal #2 with the IP, 192.168.1.3
gpg -c mydocument.docx | nc 192.168.1.2 8080

This will encrypt and send mydocument.docx, using nc and gpg, over to terminal #1
You will have to type the password on terminal #2, then on terminal #1
Comment: Can you mark the code?
Comment: im a newbie, but here goes,
_nc -l 8080_ tells netcat to listen on port 8080.
anything sent to 192.168.1.2:8080 will show up on terminal #1
on terminal #2, gpg encrypts mydocument.docx, and pipes that to netcat.
_nc 192.168.1.2 8080_ sends the encrypted mydocument.docx over to terminal #1
when #1 recieves it, it unencrypts it with _gpg -d_ , and saves i
Answer: Python
Inputs text from file1.txt and outputs it to file2.txt
It's complete and "working". No one said anything about writing the input as it is. All input characters appear in the output. "getchar" is the trolling part.
from random import choice as getchar

f1 = open("file1.txt")
s1 = []
for line in f1:
    for char in line:
        s1.append(str(char))
s2 = ''
while len(s1) > 0:
    x = getchar(s1)
    s2 += x
    s1.remove(x)
f2 = open("file2.txt" , 'w')
f2.write(s2)

Answer: Mathematica, 44 characters
Implementation
f = (BinaryWrite[#2, BinaryReadList@#]; Close@#2) &

Execution
f["one file", "another"]

Check
check = Import[StringJoin["!diff \"", #, "\" \"", #2, "\" 2>&1"], "Text"] &;
check["one file", "another"]

Comment: Where is the troll?  I do not know Mathematica.
Comment: It's a ridiculously serious answer.
Comment: Oh. Did you read the rules for Code trolling? http://codegolf.stackexchange.com/tags/code-trolling/info
Comment: Not exactly, but the answer is absurd since I could have used _Mathematica_'s `CopyFile` function.
Answer: DELPHI / PASCAL  ( copy from f1.txt to f2.txt )
program t;

{$APPTYPE CONSOLE}

uses
  classes;

var a : TStringlist;
begin
   a:=TStringlist.Create;
   a.LoadFromFile('e:\f1.txt');
   a.SaveToFile('e:\f2.txt');
   a.Free;
end.

Answer: MASM
I'm certainly not an assembly expert, but below is my little snippet:
include \masm32\include\masm32rt.inc

.code

start:
call main
inkey
exit

main proc
LOCAL hFile :DWORD
LOCAL bwrt  :DWORD
LOCAL cloc  :DWORD
LOCAL flen  :DWORD
LOCAL hMem  :DWORD

.if rv(exist,"out.txt") != 0
  test fdelete("out.txt"), eax
.endif

mov hFile, fopen("source.txt")
mov flen, fsize(hFile)
mov hMem, alloc(flen)
mov bwrt, fread(hFile,hMem,flen)
fclose hFile

invoke StripLF,hMem

mov hFile, fcreate("out.txt")
mov bwrt, fwrite(hFile,hMem,flen)
fclose hFile

free hMem

ret

main endp
end start

Answer: PHP
function copyFile($input, $output)
{
    return file_put_contents($output, file_get_contents($input));
}

Answer: C++
Did you notice the "complete, working function" bit?
Anyway, here is my answer:
#include <stdlib.h>
int main(void)
{
  system("echo < input > dest");
}

Answer: Lua
io.read()

Run with an input file containing text from one file and output it to another. Solution should be a complete, working function..
Comment: People one day will have enough of these answers :( I already had.
Answer: #!/bin/sh
contents=`< $1` ; echo "$contents" > $2

Looks reasonable, but rather inefficient if the file is large.
Works fine on ASCII files except when the input file contains -n, -e or -E.  (Because these are interpreted as arguments by echo.)
Does not produce the correct output for all (most) binary files.
(Using printf "%s" "$contents" > output under /bin/bash works a little better, but that still drops NULL bytes.)
Oh and of course it doesn't work for filenames_containing_spaces.  But such files are illegal under UNIX%20policy anyway.


Why 250 is a rude word in Chinese?

Question: In mordern Chinese, why is the number 250(二百五) a rude word? Why do people use this number for stupid person?
Comment: https://chinese.stackexchange.com/questions/5171/etymology-of-%E4%BA%8C%E7%99%BE%E4%BA%94
Comment: @fefe  Thanks! I did not realise it has been asked before.
Answer: Since it's purely colloquial, there are several possible origins exist.
One source claims that it comes from Paijiu (a gambling game). there are 二板 (four) and 幺五 (six, one plus five). They're the weakest combination in this game. Therefore, 二板五 was invented to call people who accomplish nothing. 二百五 (250) pronounces similarly to 二板五.
Another source says 二百五 comes from literatures in early 20th Century. In Bizarre Happenings Eyewitnessed over Two Decades by Wu Jianren, there is: "...(He) bought a tongzhi(official) with 250 (silver liang), and wanders everyday in the world. " In 1913, a short film (《二百五白相城隍庙》, Fools in Shanghai) depicted a peasant who was in his first visit to Shanghai. He didn't know the etiquettes in cities and made many troubles. Since he was called 二百五, it soon became a popular word indicating stupid people.

Why 250 is a rude word in Chinese?


Is Html.BeginForm() necessary?

Question: What does Html.BeginForm() do and is it necessary?
Answer: Essentially, it outputs a
<form>

tag into the HTML output. The form tag is required if your page POSTs (i.e. a button is pressed to submit the form), so that the browser knows where to submit the form.
The reason it might be working right now for you, is because you might not have any buttons - jsut links (I dont know what your application is, so just guessing here).
In short: if you want to be able to submit a form to an action, yes, that tag is required. If you do it all through links, you dont need a form tag, and thus BeginForm is not really needed.
HTH.
P.S. read Scott Guthrie's blog posts on ASP.NET MVC, they really help a lot to get you started.
Comment: Not really sure how this answers the real question.
Comment: I can write out my own form and action tags and they will work fine.  The whole point of this method is to abstract out the functionality and make it adaptable.
Answer: BeginForm() simply writes out the form tag using the parameters supplied to it.  If you don't have a form you won't or if you're doing all of your page interaction with AJAX you might not need it.  If you only have links on the page, then a form is unnecessary.  Unless you use AJAX, though, you can't do POST requests to your controller actions without using it to inject your form tag or injecting your form tag manually.
Answer: It's not necessary at all.  It's simply a helper which handles setting up the form tags.  It's a good idea to use it though.  My intuition says they will enhance this helper to handle things like XSS attacks etc. that you currently have to deal with using the AntiForgeryToken helper and associated attribute.

Is Html.BeginForm() necessary?


Is Vietnamese a noun or an adjective?

Question: If I say I am Vietnamese. Is Vietnamese a noun or an adjective? According to OALD, Vietnamese can be a noun or an adjective. If it's a noun, why don't we say I am a Vietnamese? Because its meaning is a person from Vietnam.
Answer: The ODO says

Vietnamese
  ADJECTIVE
  Relating to Vietnam, its people, or their language.
'He liked Asian people, Vietnamese people in particular, and their culture, considerably more than he liked Australian culture.'
'We were representing a Saturday morning Vietnamese language school.'
NOUN
  1 A native or inhabitant of Vietnam, or a person of Vietnamese descent.
'From the 1400s on, the Cambodians lost territory to both the Siamese and the Vietnamese.'
2 [mass noun] The language of Vietnam, spoken by about 60 million people. It probably belongs to the Mon-Khmer group, although much of its vocabulary is derived from Chinese.
'Lady Borton, who speaks Vietnamese, finds the atmosphere far more hospitable now than in the early years of independence.'

In

I am Vietnamese.

Vietnamese is an adjective. This is the correct way to say that you are from Vietnam.
Vietnamese can be a noun in certain usages. There is the usage when referring to the language in NOUN 2, and there is the usage in NOUN 1,

The Vietnamese are known for their exquisite cuisine.

Notice the usage of the definite article. This is what the Cambridge Dictionary says on the matter:

the

used before some adjectives to turn the adjectives into nouns that refer to people or things in general that can be described by the adjective:
She lives in a special home for the elderly.
The French were defeated at Waterloo in 1815.

There is also

?I am a Vietnamese.

The Cambridge Dictionary suggests this usage is grammatically fine:

Nationalities, languages, countries and regions
  from English Grammar Today
  When we refer to a nation or region, we can use:
  [...]
  – a singular noun that we use for a person from the country or region: a Turk, a Japanese, a German, a Brazilian, an Asian

However, in my opinion, at best, I find this usage questionable (?) or awkward. To me, it borders on ignorant or offensive, especially if it's said about the person (e.g. ?She is a Vietnamese). That's why you're less likely to hear it. So although it is grammatical, my recommendation is to reword it (e.g. She is/I am Vietnamese).
Note that the issue is with the singular noun with the meaning  in NOUN 1 above and that it is not unique to "Vietnamese". I did not intend to provide an exhaustive list, nor do I intend this to be a perfect rule, but my cursory observation is that the usage of the indefinite article with -ese, -ish, and -ic forms is awkward or incorrect (*): *a Vietnamese, *a Chinese, *a British, *an Arabic. There are also other cases, such as *a French and *a Dutch.
You can find a longer list of nationality adjectives here. The issues have also been discussed on ELU and ELL in the following:

Can I say "A Chinese" in English?
Why can we say 'an American' but not 'a British'?
Why is "a Japanese" offensive?.
Comment: The usage depends on the nationality referred to. It is clearly wrong to say "I am an English" or "I am a French", compared with "I am an Englishman", etc. But it is perfectly correct to say either "I am a German" or "I am German" - German can be either a noun or an adjective. The only  English *noun* for "a Vietnamese person" is "a Vietnamese". To say "I am a Vietnamese person" or "I am a Vietnamese man/woman/boy/girl" is clumsy.
Comment: To expand the examples from @alephzero - "I am an Italian" doesn't sound awkward to me (native BrE speaker), but "I am a Vietnamese" certainly does.
Comment: To be clear, *Vietnamese* is fine as a plural noun, but awkward as a singular noun.
Comment: A related question to the "a Vietnamese" part - [Why is "a Japanese" offensive?](https://ell.stackexchange.com/q/183/9161)
Comment: +1 for pointing out the 'awkwardness'
Comment: @Andrew _The Vietnamese_ is fine, but _They are some Vietnamese_ sounds strange. It should be _They are some Vietnamese **people**_.
Comment: In tennis, commentators will often say of players *the [nationality]* when referring to a player. For instance, *What a save by the Swiss!* (referring to Roger Federer). This is more obviously true of *the Brit*, *the Canadian*, and *the American*, which are more commonly used in general conversation. But the same can apply to anyone. However, it's the definite article in those cases. Still, the indefinite article can be used in other contexts.
Comment: Perhaps worth noting (since this is ELL) that *Vietnamese* can also be used as an adjective when the noun isn't a person. A *Vietnamese dish* (such as Bánh canh), a *Vietnamese village* (a village in Vietnam), etc.
Comment: *Vietnamese* is perfectly fine as a singular noun when used to refer to the Vietnamese language; but here, the word doesn't refer to the language.
Comment: It would be better to call "Vietnamese" in "The Vietnamese are known ... " a [substantive adjective](https://en.wiktionary.org/wiki/substantive_adjective) rather than a noun. It's still an adjective, but used in a place where a noun would otherwise be expected.
Comment: If ' I am a Vietnamese' is awkward, what should I say if I refer to a number of Vietnamese? For example, there are a lot of people from diffenrent countries in a room and two of them are Vietnamese, so can I say 'there are two Vietnamese in the room'?
Comment: @Thanhgiang In my opinion, that is also awkward. Also, to me, using the definite article when referring to one person is awkward (\*I am the Vietnamese who...). I don't know how common those feelings are. I think some people might disagree. In your example, I would say "There are **two** Vietnamese **people** in the room. There is **one/a** Vietnamese **person** in the room." Note that "Vietnamese" is an adjective in those examples, and so "**a** Vietnamese person" and "Vietnamese people" are okay.
Comment: @Thanhgiang I realized something else might not be clear. It is not offensive if *you* (a non-native speaker) say it. If you say it, it just sounds awkward or incorrect. However, here is a simplified example. If a native speaker calls *you* "a Vietnamese" (e.g. "She is a Vietnamese"), then it can sound offense. It can possibly be interpreted as bigotry or racism. If someone called my dear Vietnamese friend "a Vietnamese", I would be **very** upset. That's what I meant. Please let me know if you still need clarification. :)
Answer: According to Oxford learner's dictionaries about Vietnamese, Vietnamese is a noun and an adjective too.
1. Vietnamese is an adjective:
To answer a question like "What nationality are you?". You will answer this question:

I am Vietnamese.

In this case, it is used as an adjective like:

I am American
I am Italian
I am French

To mention Vietnamese people, add "the" before "Vietnamese".There are some example:

The Vietnamese were very friendly and kind.

You can use "the Vietnamese" in following case:

I am the Vietnamese who sang the USA national anthem yesterday.

2. Vietnamese is a noun:
You can use "a Vietnamese" to show a sentiment (a pride or a shame)

I am a Vietnamese and I don't want anybody to criticize my country

Is Vietnamese a noun or an adjective?


How much of a difference do good lenses make?

Question: I recently purchased a Celestron PowerSeeker 114EQ and with it I got three lenses (which I assume are low quality), a 4mm, a 20mm and a 3 x Barlow.

I can get pretty decent views of the moon but a very blurry, small view of Jupiter with the 4mm and Barlow.  I can see the color of the storm rings for example, but barely.  I've not had a chance to have a go at Saturn yet.  A view similar to this...

I've been reading up on this and was looking at purchasing a 4-8mm Plössl lens but I'm not sure if the lens is my weak spot or some other aspect of the telescope.
Another thing to note is that I've been using it in a pretty bright street, looking up very close to street lights.  I've not had a chance to take out somewhere with less light pollution.
So what I'm asking is, how much difference would a lens upgrade make, specifically to my image quality?
Comment: Quarter wave is a measurement of how smooth the mirror is at a certain wavelength: A little: https://www.physicsforums.com/threads/wave-ratings-for-mirrors.5960/  A lot: http://www.rfroyce.com/standards.htm In your case, it just means there's nothing extraordinary about the mirror. The sky may have been bad the night you went out, but I've seen Jupiter look like that plenty of times through a middle-range 105mm Newtonian. A 30cm Dobsonian will get you a better view.
Comment: Yeah I was just wondering if there was a focusing problem with that lens if the image was blurry, it is the best combination for magnification though as you said.
Comment: Quarter wave optics on mirror and secondary? That image description sounds about right for resolving colors on Jupiter with a four inch Newtonian. The Galilean moons are nice little points, right?
Comment: My initial thought would be if those are the lenses provided along with the telescope then they are probably the most suitable ones to use. Did you try using the 20mm lens with Jupiter?
Comment: Those are the ones that came with the telescope but I understand that usually that means they are cheap and not very good.
I used the 20mm to find Jupiter but it doesn't really have the magnification to see anything.
Comment: What are "quarter wave optics" but yes the moons of Jupiter are small, white, star like points.
So that's the best image I can expect from my telescope, rather than it being a function of cheap optics?
Answer:
...a very blurry, small view of Jupiter with the 4mm and Barlow...

Be aware that a 4mm eyepiece and a 3x barlow at the same time will give you a very high magnification - too high!  For regular Jupiter viewing I would suggest you stick to 100x or 200x at most, unless the air is exceptionally still. (After a few sessions you'll find out what "Still" air means.)
A lot of beginner scopes like this are sold with barlows that tend to give too much power, my advice is to keep it packed away for most sessions.
So I'd stick to using that 4mm on its own, jupiter will look quite small but with practice you can usually tease a bit more detail out of the image.
I don't have one of these scopes, but my experience of comparing cheap modern eyepieces with expensive ones is that the lower cost ones are generally OK these days. 4mm is quite a high power so the extra magnification will cause a lot of blurriness and it will take patience to get the focusing at its sharpest, so don't panic if everything is looking fuzzy at the moment.
For a first stage I would suggest a few things that are nothing to do with the eyepieces at all...

Collimation - look this up, it just means adjusting the two mirrors
so your eye is looking right down the tube in a straight line. For a
long focal length scope like yours, it's not likely to be a problem
unless one of them is wildly out of line.
Tube currents/thermal behaviour - on almost any cold night, when
the tube and main mirror are still warm from being indoors, rising
air currents in the tube will mess up your image and make it
shimmery, at high power. Low power will look OK. It might take an hour or so for the image to improve (a guess)

Anyway, in summary my guess is changing the eyepieces straight away won't make a dramatic difference. Eyepiece makers will say otherwise of course :)
Comment: For most nights, I'd tend to suggest using the 20mm eyepiece and the barlow instead of the 4mm.  It's only about 2/3rds of the magnification; but inexpensive short focal length eye pieces have almost no eye relief.  I rarely used my 6mm plossel because holding my eye within an mm or two of the eyepiece would often result in accidentally bumping it.
Comment: I've had experience with upper atmosphere turbulence.  I could barely get Jupiter at all on those days.  The blurry image I speak of was on a very calm, very clear night.
The problem is that the telescope is quite sensitive and adjusting focus shakes it, ALOT.  I'm looking at making a servo to control that without touch though.
Thanks, this was really helpful.


Can gas get produced at room temperature?

Question: Is there any reaction between solid/ liquid elements/compounds at room temperature that produces gases??
Comment: Lots, for example, solid magnesium in aqueous hydrochloric acid can releases hydrogen gas.
Comment: You seem to be implying that you don't think this should be the case. As @santiago said the complete opposite is true. Perhaps you could give us some more detail about why you are asking the question?
Answer: Yes, there are many. One you can make in your kitchen is to mix baking soda and vinegar; it makes carbon dioxide gas.
Comment: There are more than several. There are a *vast* number.
Answer: There is an incredible amount of such reactions. Consider the equation from thermodynamics,
<code>ΔG = ΔH - TΔS
</code>
where
ΔG is change in Free Energy
ΔH is change in Enthalpy
T is Temperature and
ΔS is change in Entropy.
It is known that a reaction is spontaneous and favorable if ΔG is negative. We therefore see that a reaction that increases entropy (ΔS > 0) will be more likely to be favorable. Although not quite technically correct, Entropy can be thought of as a measure of disorder. Therefore, if a reaction results in products that are more chaotic than the reactants, it will be more likely to be favored.
A reaction of solids, liquids, or both that produce a gas will increase the entropy of the system. This is because gasses are much more chaotic and unordered than solids or liquids. Therefore, there will be not just many, but an unfathomably large number of reactions that will take place at room temperature that will spontaneously occur.
And if the reaction results in a release of heat (ΔH < 0), then it is guaranteed to occur at any temperature if it produces gas in this way.
Some examples include explosives, in which much gas is produced at incredible rates. Acid-metal reactions produce Hydrogen gas as well.
Comment: I doubt the OP understands the thermodynamic aspect at all, else the question would not have been asked in the first case.
Comment: @user223679 I was thinking that may have been the case so I tried to explain it as well as I could.
Comment: Yes. No doubt about your answer quality. Just that it could be a bit too much for the OP. Anyway, future visitors will benefit from it :)
Comment: @user223679 Thanks, but one question, what does OP stand for?
Comment: Good question. I use OP for Original Poster but it varies throughout SE and other communities. Some go with Original Post. [Look here](http://www.abbreviations.com/OP). Btw, where are you from?


My coworker left his garbage in my cubicle. How can I get him to remove it?

Question: I currently work in a room with two others. The room is a little cramped and my coworker got a new table six weeks ago. The table came in parts and was self-assembled. Once assembled he failed to make use of the new table, prefering his old one. The new one mostly just took up space. He also failed to get rid of the packaging cardboard that came with it. Today when I arrived at work I found he had finally switched tables and placed the old one in my corner instead of keeping it in his own, limiting my space. What further infuriates me is that he has not even managed to dispose of the cardboard packaging yet, tucking it instead in my corner between the old table and the wall. The local recycling points is outside, one floor down at the side of the building and he has access to it. The coworker has so far ignored two requests to at least take out the cardboard. It feels like the space alloted to me in the company is the others' garbage dump. How should I act in this situation?
Comment: Do you not have cleaning/maintenance staff that tidies up periodically? Are there no policies for disposal of such trash? Feel free to move the old table out of your area, if people are redecorating without consulting office mates.
Comment: I don't know how this could possibly be a problem. *Tell him to remove it.* And while he's doing it, take your space back for good measure.
Comment: Have you considered just saying to him "hey, can you please pick up your trash over here"? Presumably you're both adults; neither of you should need the Internet's help in dealing with this basic human interaction. If you say nothing, nothing gets fixed; this isn't a complex issue and you shouldn't need to have other people involved.
Comment: hello, consider [edit]ing the question to make it better fit site topics laid out in [help/on-topic]. In particular, [this guidance](http://meta.workplace.stackexchange.com/a/2696) may help to learn what is expected of questions here. Good luck!
Comment: maybe you could send him an email ?
Comment: Could you elaborate what you mean that he ignored your requests? It's hard to imagine how he could ignore you if you said something like  "Hey, colleague, I noticed you got rid of that table you weren't using, but you left the cardboard packaging. Will you be able to take care of that today or tomorrow?"
Answer: I would remove the cardboard from between the old table and wall in your area and place it on his desk bringing the issue to the forefront.
I'm assuming the requests have been polite? Verbal/written? If he has chosen to ignore these and if he isn't your superior/manager, then I would simply place them on his desk forcing him to move them
Comment: I would even go as far as putting a post-it note on the refuse, saying something to the affect of "Please take care of your own flotsam".
Comment: I like this answer because it doesn't include getting the boss involved at all.  Minor thing like this should be able to be resolved without a superior.  It's not unreasonable to put it back on his desk leaving him to deal with it.  It is, after all, his garbage.
Comment: Two verbal polite requests within two hours. If I remember correctly this is the second time this stuff has been placed in my corner. The first time I believe happened some weeks ago and I did then return the cardboard back to his corner. And now it's back.
Comment: In this case, I would just ask "why do you keep putting the cardboard here? WHy can't you take it down to the recycling area?" - the key is to get the issue out in the open.
Answer: There are two options.

Escalate the problem to your next common superior. This might force your coworker to remove their garbage, but it will reduce both yours and your coworkers standing with your superior, as they now have the impression that you both lack the social skills to solve your conflicts yourself. Your coworker will be more careful with infringing your rights in the future, but might now hold a grudge against you.
Remove it yourself. That way you avoid a conflict with your superior and your coworker, but your coworker might now believe that they can get away with ignoring reasonable but inconvenient requests from you.
Comment: I'd send the coworker a friendly, clear and concise email asking him to clean it ip, mentioning the offending items exactly. If that goes nowhere after a few days, hand the issue over to your boss but don't whine about it, simply forward the mail to your boss, tell him you've made several verbal requests before that email, that this did not solve the issue, and that you would prefer to focus your energy on your work rather than solving this issue. Your standing might take a hit, but not as badly as your coworker's will since he can't even clean up after himself after multiple civil requests...
Comment: Option 2 is bad in the long haul. Then this workers attitude will simply be "whatever... someone else will clean up" regarding leaving stuff around. Firmly talking to your colleague to know what you expect in your office space is much better than either of the two suggested options IMO. BUT if that doesn't work then use option 1 escalation.
Answer: As Philipp said, escalating to your superior risks getting your supervisor to regard both of you more negatively. So that's not an optimal choice. And removing the garbage runs the risk of your coworker learning that dumping crap on you is a viable way of getting rid of it without trouble for himself, so that's also not an optimal choice.
Instead, I'd go for a cooperative solution that still doesn't mean you get used as a garbage man:
When your coworker and you are both in the office, say "How about we get this stuff out of here. I'll grab that thing and you take the other." Make sure he does grab the other thing, then go with him to throw them away.
You'll have shown him that you don't accept working in a dump; you'll have done so without being either confrontational or passive-agressive about it, and if anyone notices, they'll see that you're being helpful but not being used as a janitor. Plus you'll have a clean office.
Answer: I was in a similar situation in the past. My team accumulates a lot of furniture and other pieces of "space occupying hardware" that is usually dumped near my desk. I work on a mezzanine floor and since it is difficult to move them downstairs, my team mates and other people in the company found it convenient.
One fine day, someone decided to leave furniture that had sharp edges blocking where I sit. I had to navigate around the desk when I arrived in the morning. My team has a mailing list and I decided to send a polite email saying that while I don't mind the furniture being near my desk, it has sharp edges and blocking access to other furniture. I asked for help to find a new home for the same. We had a meeting and immediately discarded it. My manager also mailed the concerned asking not to dump stuff in my area(This was happening for a while when I sent that email).
People stopped treating my workspace like a warehouse. I think you have to discuss this with your team mates and manager to resolve it. It is important that you are comfortable within your workspace.
Answer: Assertive communication usually works better than being submissive or escalating.
In this situation, I would have walked up to him and said:

Would you be handing over the cardboard boxes to the recycling point today?

This is different from you doing it yourself or bringing in big brother (Boss) to bash him up. By doing this, you are gently nudging him to act while also letting him save face. Most people would take the hint, respond with, "yeah, sure, I will do it today", and then do it.
If he agrees but doesn't actually do it, you ask him again next day, perhaps a bit more firmly.
It is never a good idea to escalate trivial issues to the boss. Regardless of who was right or wrong, your manager would see both of you as being immature. Such perceptions contribute to your career progress. Typical scenario could be:

Boss's boss: Hey, I hear Steinin has been doing a great job. Do you think we should consider him for a leadership role?
Boss: Uhm, well, I don't know about that one. We probably have to give him more time. The other day he complained to me about some cardboard boxes left at his desk.

As for the table though, I don't know if it could be "recycled" in the same way as cardboard boxes, and if the desk belongs to your company, neither you nor your colleague should dispose it on your own. On that one, it is okay to ask your Boss what to do.

Boss, there's an old desk in our room, which we no longer have any use for. Could we move it out somewhere to reduce the clutter?

Notice how this is better than, "Boss, my coworker got a new desk, but he isn't getting rid of the old one. What should I do?"
Comment: When I left for the weekend I made a firm but polite final request for my coworker to remove the stuff. When I came to the office this morning, the garbage was gone.


Shortcut to unindent in Powerpoint

Question: In many applications shift-tab will unindent: but it just indents further on powerpoint.  What is the shortcut?
Answer: ⇧⇥ is the shortcut for unindent, but you need to select the paragraph to unindent. If you have no selection, or just a word, the shortcut doesn't work.
Answer: It seems that my external keyboard (on macbook pro) were the culprit: entering shift-tab does work when pressed directly on the mbpro itself.  I have not noticed this shortcoming in other applications so wondering if there were some low-level keycodes being captured by PowerPoint - i.e. not properly using the standard Mac keyboard interfaces.

Shortcut to unindent in Powerpoint


Difference between line of sight (LOS) comoving distance and transverse

Question: I am having some difficulty wrapping my head around distance measures in cosmology. From my understanding LOS comoving distance is the radial distance from us the observer to the object of interest while taking into account the universe's expansion, thus line of sight comoving distance. However in a paper I am reading (Distance measures in cosmology, 2000, David W. Hogg) transverse comoving distance seems to be equal to LOS comoving distance, assuming the universe is flat (which seems to be an accepted assumption, from my reading), so what is the difference?
Answer: The Transverse Comoving Distance $D_M$ is used to calculate the Comoving Distance $D_{12}$ between two events with the same redshift separated in the sky by an angle $\boldsymbol{\delta \theta}$
$$\boxed{D_{12}=D_M \cdot \delta \theta}$$
If $D_C$ is the Comoving distance between any of the 2 events and us, (LOS)
$$D_C=D_H \int_0^z \frac{dz'}{E(z')}$$
Then,
for $$\Omega_k>0 \Rightarrow D_M=D_H\frac{1}{\sqrt{\Omega_k}}\sinh \left ( \sqrt{\Omega_k} \, D_C/D_H\right )$$
for $$\Omega_k=0 \quad \Rightarrow \quad D_M=D_C$$
and for $$\Omega_k<0 \Rightarrow D_M=D_H\frac{1}{\sqrt{|\Omega_k|}}\sin \left ( \sqrt{|\Omega_k|} \, D_C/D_H\right )$$
If you are not interested in the Comoving Distance between two events with the same redshift separated in the sky by an angle $\delta \theta$, you do not need to use the concept of Transverse Comoving Distance.
Comment: You didn't address the question.  $D_A$ is used often as a factor for calculating Luminous Distance ($D_L$) as $D_L = (z + 1)^2 D_A$, so I'm not interested in it's use so much as whether it is, in fact, in a flat universe, the same value one would get when calculating $D_C$.


what is the optimal database connection strategy

Question: i have a asp.net mvc website which runs a number of queries for each page.  Should i open up a single connection or open and close a connection on each query?
Answer: It really doesn't matter.  When you use ADO.NET (which includes Linq to SQL, NHibernate and any of the other ORMs), the library employs connection pooling.  You can "close" and "reopen" a logical connection a dozen times but the same physical connection will remain open the whole time.  So don't concern yourself too much with whether or not the connection is open or closed.
Instead, you should be trying to limit the number of queries you have to run per page, because every round-trip incurs a significant overhead.  If you're displaying the same data on every page, cache the results, and set up a cache dependency or expiration if it changes infrequently.  Also try to re-use query data by using appropriate joins and/or eager loading (if you're using an ORM that lazy-loads).
Even if the data will always be completely different on every page load, you'll get better performance by using a single stored procedure that returns multiple result sets, than you would by running each query separately.
Bottom line: Forget about the connection strategy and start worrying about the query strategy.  Any more than 3-5 queries per page and you're liable to run into serious scale issues.
Answer: If you are running multiple queries on a page in regular ADO.NET, then they are run in sequence and connection pooling is going to mean it doesn't matter.  Best practice is to open connections on demand and close them immediately - even for multiple queries in the same page.  Connection pooling makes this fairly efficient.
When you are using multiple queries, your performance could improve significantly by opening multiple connections simultaneously and use asynchronous ADO, to ensure that all the requests are running at the same time in multiple threads.  In this case, you need a connection for each query.  But the overall connection time will be reduced.
There is also the potential to use MARS on a single connection, but I'm not a big proponent of that, and it's a lot more limited in functionality.
Answer: If you are fairly sure that the transactions will finish quickly then use a single connection.
Be sure to check all return results and wrap everything in exception handlingwhere possible.
Comment: @should i just store a cached connection object
Answer: To avoid unnecessary overhead it's better to use a single connection.  But be sure to run the queries in a "try" block and close the connections in a "finally" block to be sure not to leave connections hanging.
try-finally
Answer: unitofwork?? this is a great strategy to employ. nhibernate and many others use this pattern.
give it a google for specific details relevant to your needs..
jim


Is It Possible For A Computer To Have A Desire?

Question: I suppose another way to ask it is, is it possible for a computer to feel?
Comment: First, answer an easer question. Is it possible that your next door neighbor can feel? How do you know? Once you have a good test for your neighbor, you can apply the same test to a computer. Otherwise you're just a *meat chauvinist*, as Scott Aaronson puts it.
Comment: I've not heard that term.  Interesting.  The answer to the easier question is to shoot your neighbor in the foot through the structure(s).  A computer or robot would or could, like the person, emit communications indicating problems and need for a fix.
Comment: Smart skin technology has been being developed these years, from which robot gets pressure signal from the skin and response to it. The response can be programmed such that, when the pressure is local and high, robot arm will be move away faster. This makes a robot "feel" and "response" to environment.  A desire can be programmed similarly. For example, a robot is programmed looking for energy when its energy level is low.
Comment: Perhaps I didn't understand your comment. How would shooting your neighbor in the foot show that he can feel? Certainly he gives off the appropriate physical signs of being in acute pain. He jumps around (on the good foot) and howls in pain and periodically screams at you, "Why did you shoot me in the foot?" But subjectively, he doesn't feel a thing. He has no subjective experience at all. He's a philosophical zombie. https://en.wikipedia.org/wiki/Philosophical_zombie
Comment: So shooting people in the foot is not a good way to determine if they can feel or not. Even if it was a good method, you should still avoid it. You can contemplate the reasons for that in your jail cell :-)
Answer: What we define as feelings is something that's determined by our brain structure, chemistry (ultimately DNA). Anything that has a similar brain structure and chemistry, would to some extent experience similar feelings to us (especially the animals we're closest to like chimps and bonobos).
But a machine, made up of sensors and computer chips, even if it was self aware it would have feelings completely alien to us.
It's a kind of arrogance that we have that makes us think the feelings we feel must be universal, as opposed to something that's just unique to us and created by our biology.
It is possible for a AI to feel, but it's impossible for us to be able to feel the things an AI could feel, and likewise for them with us.


Itunes like rating system in html

Question: I'm making a mobile web app and am trying to make a star rating system that resambles the one in itunes where you can swipe over the stars and lift you finger on the star you want to choose. I'm using jQuery mobile. Using the swipe event doesn't seem to do the trick, while it stops the web page to stick to your finger (you can swipe around the area you attach the event to without the page itself moves) it is intended for either "swipe left" or "swipe right". Not "swipe away as you want".
Is there a suitable event i can use that also enables me to get the coordinates of the finger position?
Example code:
<code>$("#mapPage").live("pageinit", function () {
    $('div.stars').swipe(function() {
        console.log("swiped");
    });
});
</code>
Example 2:
<code>$('div.stars').scrollstart(function(event) {
    event.preventDefault();
    // stuf in here only triggers in scroll start
    // but i want i to trigger as the finger position gets updated
});
</code>
Comment: Could you post some example code you have tried?
Comment: Now i've updated with a couple of examples.
Answer: I figured it out. This is the code i used:
<code>$('div.stars').bind('vmousemove', function(event) {
    event.preventDefault();
    console.log('scroll position: ' + event.pageX);
});
</code>

Itunes like rating system in html


Normalized Iteration Count does not work. What am I doing wrong?

Question: As you can see from the title, I'm busy programming a little programm for visualizing fractals in Java. Anybody who deals with fractals will come to the point where he/she searches for a solution to get these stupid "bands" away, when you just colour a pixel by the number of iterations it took to escape.
So I searched for a more advanced colouring algorithm, finding the "normalized iteration count". The formula I'm using is:
float loc = (float) 1 - Math.log(Math.log(c.abs())) / Math.log(2);

Everybody on the Internet is so happy about this algorithm, everybody uses it, everbody gets great results. Except me. I thought, this algorithm should provide a float between 0 and 1. But that doesn't happen. I did some calculations and came to the conclusion, that this algorithm only works for c.abs() >= Math.E && c.abs() <= Math.exp(2) (that is Math.E * Math.E).
In numbers this means, my input into this equation has to be between about 2.718 and 7.389.
But a complex number c is considerd to tend towards infinity when its magnitude gets greater than 2. But for any Input smaller than Math.E, I get a value greater than one. And for any number greater than Math.exp(2), it gets negative. That is the case if a complex number escapes really fast.
So please tell me: what am I doing wrong. I'm desperate.
Thanks.
EDIT:
I was wrong: the code I posted is correct, I just
1. used it the wrong way and so it didn't provide the right output.
2. had to set the bailout value of the mandelbrot/julia algorithm to 10, otherwise I would've got stupid bands again.
Problem solved!
Comment: @karatedog, When implementing smoothing you need to increase the bailout to a value much larger than 2 -- and actually, larger than 10 as well (the OP may have discovered this by now).  I suppose I should explain why as an answer.
Comment: The bailout value to should be 2, not 10.
Answer: As you've already discovered, you need to increase the bailout radius before smoothing will look right.
Two is the minimum length that a coordinate can have such that when you square it and add the initial value, it cannot result in a smaller length.  If the previous length was 2.0, and you squared it, you'd have a length of 4.0 (pointing in whichever direction), and the most that any value of c could reduce that by is 2.0 (by pointing in precisely the opposite direction).  If c were larger than that then it would start to escape right away.
Now, to estimate the fractional part of the number of iterations we look at the final |z|.  If z had simply been squared and c not added to it, then it would have a length between 2.0 and 4.0 (the new value must be larger than 2.0 to bail out, and the old value must have been less than 2.0 to have not bailed out earlier).
Without c, taking |z|'s proportional position between 2 and 4 gives us a fractional part of the number of iterations.  If |z| is close to 4 then the previous length must have been close to 2, so it was already close to bailing out in the previous iteration and the smoothed result should be close to the previous iteration count to represent that.  If it's close to 2, then the previous iteration was further from bailing out, and so the smoothed result should be closer to the new iteration count.
Unfortunately c messes that up.  The larger c is, the larger the potential error is in that simple relationship.  Even if the old length was nearly at 2.0, it might have landed such that c's influence made it look like it must have been smaller.
Increasing the bailout mitigates the effect of adding c.  If the bailout is 64 then the resulting length will be between 64 and 4096, and c's maximum offset of 2 has a proportionally smaller very impact on the result.
Answer: You have left out the iteration value, try this:
float loc = <iteration_value> + (float) 1 - Math.log(Math.log(c.abs())) / Math.log(2);

The iteration_value is the number of iterations which yielded c in the formula.


How to temporarily suspend iTunes Connect payments for app earnings?

Question: I should temporarily suspend Apple's payments for sales of my apps on AppStore.
Other markets allow you to change the minimum amount to receive your payments, or suspend payments for a few months. Is there any way to do it on iTunes Connect as well?
Answer: You can adjust your app's price tier in iTunes Connect, including making it free and including setting start and end dates for the price tier change.
See these instructions from Apple for details of the steps to take for the app itself.
See these instructions from Apple for details of the steps to take for an in-app-purchase.
Comment: Thanks, I know that I can offer my apps or in-app for free for a period of time, often I did during promotional periods. But this is not my question. I would like to continue to sell my applications but delay payments for a few months, as can be done on other marketplaces.


Can't remove value from list item

Question: I have a list that has a dropdown box as one of its columns. We changed the values in the dropdown box and now some of the items in the list refuse to allow us to blank out that column (so it has no value), the dropdown box doesn't show the blank value as an option and requires one of the items to be there. Is there any way to fix this other than to blow away the column and start from scratch?
Answer: The only way to create an option to set a list to [blank] is to put a non-printing character in the list of choices and have that be the default to avoid having 2 blank choices at the top for a new item. This allows you to set an item to [blank] and I believe it still functions for the sorting/filtering options of a list. I had an example of one I used, but I can't seem to find the code anywhere. I pasted it in between these quotes, but I am not sure if it will translate over. " " Regular and non-breaking spaces will not work.
Edit: Here is the original answer that I found it in. How to Add Blank to choice field?
Comment: Thanks, cfoote. Do you know the ASCII code of the non-printing character? Here's a page with different characters: http://www.ascii-code.com/
Answer: Here is one way I found to do it:

In the Additional Column Settings section, set Require that this column contains information to No, set Allow 'Fill-in' choices to Yes.

You should then be able to edit the data element containing the column and choose Fill-in rather than any of the drop-down options but leave the fill-in box blank. This will wipe out the previous data value.
In my case I normally DON'T want to allow fill-ins so I then just switched the Allow 'Fill-in' choices back to No and everything is as I wanted it.
New data elements would allow blank data or the choices from the dropdown as it always did without having to screw around with phony or non-printing characters and the data I wanted blanked out was gone.
Answer: Not sure if this will fulfill business part of your requirement, but a column in a SharePoint list can be optional or required. If you set it to be optional (not required) you will be able to leave it empty.
Comment: No, thats not true!
If the item has allready a value than it's not possible to set blank again.
Comment: Thanks, Toni. The column isn't required, that's the weird thing about it.
Comment: If you don't set up choice column as required you can't to make this field empty at this form. Som it will have some value, but can't be empty

Can't remove value from list item


Strategy for designing a plugin API

Question: I am working on an application for which a rich plugin API is crucial. What is the best process for creating an API that is intuitive and easy to learn?
Answer:
What is the best process for creating an API that is intuitive and easy to learn?

First, create an API that works.
Then, after using it for a while, get feedback on the parts that are not intuitive or easy to learn.
Third, rewrite the API to be more intuitive and easier to learn.
Then, after using the revised API for a while, get more feedback on the parts that are not intuitive or easy to learn.
When you get to the 3.0 rewrite of the API to be more intuitive and easier to learn, you may actually have something that works.
This is very, very hard to do "out of the box".
It takes experience, and -- more importantly -- it takes a lot of back and forth between the producers and consumers of the API's.
Until you know your users, you have a lot to learn about them and what amounts to "intuitive" and "easy to learn".
Most API's don't really strive for this.  They strive for "efficient" or "simple" or something that's much easier to achieve.
Here's the point.

"Intuitive" and "easy-to-learn" are very personal attributes.  What is intuitive for one person is stupid to another.  What is easy to learn for one person is baffling to another.
You can't achieve "Intuitive" and "easy-to-learn" without knowing your users really, really well.
You can't know your users really, really well until you interact with them by providing them an interface, which they use, and then you get detailed feedback on their experience.

Learning about your users takes a lot of back and forth between you and them.
You must make active steps to learn about your users so that you know what constitutes "intuitive" and "easy-to-learn".  When your users argue amongst themselves, you'll learn a lot about what "intuitive" really means. [Hint: it means nothing.]
One easy way to take active steps to learning about the users is to cycle through several releases.  There are other ways to learn about your users.
Comment: Using APIs that achieve a similar goal might also be useful.
Comment: @Mahmoud Hossam: isn't that advice essentially the same as the @Dmitry Negoda answer?
Comment: yeah, sorry, I wasn't paying attention.
Comment: So, in other words: iterate.
Comment: @S W: Close.  But, no.  "Iterate" is not a good one-word summary.  I hate to repeat the entire answer in the comments, but I'll change the emphasis so that "iterate" is *not* the answer.
Answer: Look for existing Plugin APIs. I whould recommend Eclipse (based on Extension Points) and Netbeans (based on Lookups). Well, it also depends on to what extent you wish the plugins to extend your application. In Eclipse, you can change virtually every aspect of the application. We are using Extension Points approach in our GWT application. Another good architectural pattern for plugins is the Chain of Responsibility.
Comment: I have bad memories of Eclipse's plugin APIs, juggling XML files, etc. I will take another look though, I was a newer programmer then.
Comment: Wouldn't looking at a strongly typed, offline app not quite make sense for a javascript based API?
Comment: Netbeans (based on Lookups)? I am not a java prorgammer, but isn't that based on an implementation of an interface/inherited base class. Which kind of is very similar to extension points?

Strategy for designing a plugin API


xubuntu 14.04 user file access

Question: Running Xubuntu 14.04.  I have several user accounts set up as "desktop users", but when they are logged in, they are unable to open ANY files in their HOME folder.  Error messages vary, but typically indicate that access is denied or user does not have permission.  When I am logged in on my account (as administrator) I have no problem accessing files in my HOME folder.  Any ideas?  I am new to Linux.
Comment: Did you check the file permissions?
Comment: Please run `ls -l /home/` from the command line and post the output.
Comment: Welcome to the Ask Ubuntu community! Make sure before you post a question that you've tried to figure out your issue. You are most lightly experiencing issues with permissions, which you can find many good articles on if you search for 'ubuntu permissions'.
Answer: Users should own their own files.
Open a terminal with CTRLALTT or your preferred method
issue the command sudo chown -R *username* */path/name* where username is the name of the user you want to give ownership to and /path/name is the path to their home directory. This should resolve the vast majority of your issues.
Example sudo chown -R joe /home/joe
Once you have completed this task for all users they will be able to access all the files in (and under) their homes.
for more detail see man chown
here's an example of what you might see with the command ls-l which was requested of you.

You'll note the permissions bits in the far left column
d indicates a directory
the 1st letter is d if it's a directory, or - if it's not
r indicates read permission a - here means that permission doesn't exist (denied)
w indicates write permission a - here means that permission doesn't exist (denied)
x indicates execute permission a - here means that permission doesn't exist (denied)
these 3 are broken up into 3 sets for User, Group, and Others
The User is the owner of the files, Group is everyone belonging to the listed group (in this case the owners group) and Others is everyone else without exclusion. Unless your network is very safe and all users are trusted you need to be very careful with the Others bits.
The next field is the number of links, this is followed by the name of the owner and name of the group referred to by the aforementioned bits, then the file size, date, and filename (or directory name if it starts with a d as previously explained)
You'll note that there are 2 directories in the image above. (both start with d)
You'll note that lost+found is a directory, owned by user root of the root group which only root (the owner) has access to. That access is complete, and unrestricted in any way for user root. No other user has access to this even if they belong to the group root. you'll note the bits for group and others are all --- (or = 0)
The other directory is the home of user tvbox who owns it. tvbox (the owner) has rwx permission (complete, unrestricted). members of the group tvbox who are not the user tvbox do not have write access but can otherwise see and enter the directory. Others can also see and traverse the directory. I can change that with the chmod command. As I dont want those that aren't in the tvbox group to have access I'll issue the command chmod o-rx tvbox/ to change only the directory access or chmod -R o-rx tvbox/ to remove read and execute permissions the the tvbox folder and all files and folders within it.
After running one of the above th tvbox directory looks like this:
 drwxr-x--- 61 tvbox tvbox   12288 Feb 22 17:12 tvbox

As you can see the permissions for others are all denied (non-existent)
We can change the permissions for the group by using a g in place of the o or the user (owner) buy using a u in that location you can change them for everyone at once by stringing them together, for instance chmod ugo+rwx filename would give full access to the user, the group and all others. (illustrative -  not what you normally want) Changing to a - from a + would remove the permissions
So u = user, g = group and o = others, r = read, w = write and x=execute There's also a way to use chmod numerically. 4=read 2=write and 1=execute and you can add the numbers to obtain the desired result. chmod 776 filename would give full access to owner and group and deny others execute permission while allowing read and write. This is great shorthand for system adminstrators who need to rapidly change permissions on numerous files and directories.
The -R means recursive and it can be very dangerous to use it with any command if you aren't sure exactly what you are doing.

xubuntu 14.04 user file access


Why is C/C++ preferred for game developers?

Question: Some people say it offers more control to developers, but what is it precisely that can be controlled through C++ which can't be controlled using, for example, Java?
Answer: Java runs in a virtual machine, while C++ is run directly on the hardware. What this means is that you have more control over where your memory goes and what is done with it in C++.
Java is a garbage collected language. You do not have direct control over your memory. You can allocate new chunks of memory, but you do not have (fine) control over when it gets deleted. The garbage collector checks every piece of memory you allocated every x frames and determines whether it's garbage or still being used.
For games this can be disastrous. Every few frames some garbage collector comes along to check every single allocation you've made to see if it's still being used? Talk about a slowdown!
Secondly, most of the libraries we use were either written in C or written in C++. I'm talking about Scaleform, Havok physics engine, PhysX, SpeedTree, etc. All professional packages, used extensively in the industry. If another language wants to be king, it better support them.
My personal view is that Java is really nice for desktop applications and apps, but not for games. Java has a lot of nice tools for developers and it can theoretically be run on any platform that has an implementation of the Java Virtual Machine, but I still prefer C++ because I need that control over my memory. Especially when you start working with exotic data structures (red-black tree, doubly linked list, etc.) it helps to keep a good overview of all your memory allocations.
I'm not saying: don't use Java. I'm saying: think about why you're using Java. Minecraft was built in Java, so it is certainly possible to build games in Java. But would it have been a better game, had it been built in C++? Well, it certainly wouldn't have been so cheap to get it running on the big three (Windows, MacOS, Linux), but even so, it encountered lots of platform-specific bugs in its development, bugs that Java couldn't smooth over.
There are tons of C++ frameworks now for beginning programmers. There's really no excuse not to learn it, especially if you want to further your career in the industry.
Comment: Just a nitpick, but under most operating environments native code runs in a virtual machine. Java runs in a virtual machine inside a virtual machine.
Comment: @RTS: It is a bit of a stretch to call op -> micro-op translation a virtual machine, if that's what you're getting at.
Comment: No, I was talking about the virtual machine that all applications get put into by modern operating systems to allow for safe multitasking. This occurs on OS that run on architectures without micro-ops (RISC). This includes virtual memory, software interrupts, systems for concurrent hardware access, the operating systems scheduler and the handling of the register file.
Comment: @RTS I'm not sure that task isolation really qualifies as a VM. It's a RM (Real Machine) with some protection built in. There's no obvious instruction abstraction layer between fetch/exec. Compilers and linkers generate relocatable code as a requirement. The CPU provides hardware support for much of this - which removes the "virtual" aspect.
Answer: Short answer: C++ compiles to native code, so performance is up to the developer,not a runtime or VM.
Long answer:
C++ being "faster" has nothing to do with C++. At the moment, it is one of very few languages available that are supported by tools that produce standalone, native code for multiple platforms.
Back in the day, you could use C, C++, BASIC/2, Delphi, etc
, and get efficient, freestanding executables. The choice of language was a matter of personal preference and market forces.
These days, the assumption that "C++ is faster" is essentially a self-fulfilling prophecy, though LLVM is in a good position to change that as it makes whatever goes into the parser moot, as it once was.
Borland had it right: Multiple languages that were parsed, first optimizations applied, then passed to a common backend compiler and linker. Which is effectively one of LLVMs major accomplishments.
Java is structured in such a way that it would be very difficult to implement without the JVM. Oddly enough, C#, commonly, and incorrectly, assumed to be roughly equivalent to Java, already compiles to native code on several platforms, including iOS.
Top of my Christmas list? A time machine to go back and add properties, real exception handling and actual WORKING polymorphism to C++, and get rid of the f"d up arrow syntax crap that the parser can figure out on its own. I wrote a preprocessor for that 10 years ago because it's freaking stupid.
Comment: What doesn't work about C++'s polymorphism?
Comment: Do you mean indirect member access (as in h->x)? Removing that would make handle and smart pointer types way less useful. If you argue to change it just for raw pointers, you just made the language less consistent.
Comment: @LarsViklund yes, that's what I mean. But, while the address, dereference and member operators (&,*,::,->...) all have different meanings, most of the time its possible to infer the drsjted result from context. Things could have been simplified up front, as is done in other languages. A minor sticking point, but one that has the potential to increase code complexity (and thus dev time and cost).


Putty and screen under CentOS 6

Question: My current work enviroment is Windows workstation with Putty. And almost always i run "screen" session.
When i started using CentOS 6 i noticed strange behavior with screen. When I run screen in Putty ssh session the size of window (terminal) is reseted (rows and cols were  changed).
For me this is very anoying and i'm unable to resolve this. Maybe someone know what to change in Putty config or terminal settings (termcap/termininfo or screenrc) to stop this behavior?
I hope someone understand me. English is not my best side...
Answer: According to a bunch of links from a quick Google Search, one of these solutions should work:

A: Add this line to your ~/.screenrc or /etc/screenrc:
termcapinfo xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

B: Always run screen with the -A option
C: Dig arround PuTTY's settings until you find an option to disable remote screen resizing (unlikely)
Comment: FYI, Debian (and therefore Ubuntu) already has the described `termcapinfo` command in its `/etc/screenrc` file.  RHEL/CentOS does not, because it is commented out (`termcap` and `terminfo` commands on line 65; `termcapinfo` is equivalent to both).

Putty and screen under CentOS 6