What animals would dominate after the apocalypse?

Question: After a large nuclear war, most of the survivors get the hell out of dodge, and leave the large cities to build communities in places with nearby water sources, land for farming, and etc. But, the cities they left behind are still there, so my question is, which animals would be able to survive in those abandoned cities?
Comment: Anyone here, I need your help. I'm the Bryan who wrote "how would people in the 17th century react to modern clothing". I haven't been able to log back in to my account. I left for one day from the website, and the next day it said I wast my logged in. I typed in my passwords but it didn't work. Any one here have a solution,'ore know were I can get one?
Comment: Go to the help center: https://worldbuilding.stackexchange.com/help/reset-password and https://worldbuilding.stackexchange.com/help/merging-accounts
Comment: Also, I'm not sure if you posted a question just to ask a question in comments, but this question is too broad anyways.
Comment: You should not have a password because you are not registered : https://meta.stackexchange.com/questions/68524/what-does-it-mean-when-someones-an-unregistered-user/68525
Answer: Cities will be reclaimed by the surrounding biomes.
The species that are native (or comfortable) in city's climate will dominate there after people have left. Native species will get competition from people's pets, mostly dogs and cats, but dogs and cats are not likely to dominate in the long run. Birds of all kinds will find abandoned cities very comfortable because they should be able to find plenty of refuge on the roofs and upper stories. Good rock climbers, like goats and large felines may also like it there.
City's underbelly, its tunnels and basements are not going to be much occupied, unlikely to what most post-apocalyptic lore would claim. There will be no food there, and those areas would be like natural caves, mostly empty of any inhabitants.
Of course, you can get creative and populate your cities with all kinds of mutant animals, even sapient ones.
Answer: While the other answers have focused on mammals and avians, I'd like to draw attention to several other types of animals that will do well after an apocalypse:
1. Insects
Yup, these creatures will definitely survive and breed. Flies, cockroaches, ants, and beetles are commonplace and will have access to sufficient food. Bees and wasps also have potential, while mosquitoes are only likely to do well where warm-blooded creatures with thin skin exist.
I can easily envisage giant, mutated versions of these insects terrorising city wildlife.
2. Arachnids
Yup, spiders. There are large numbers in cities currently, and they'll survive and breed since their usual prey, insects, will be plentiful. Large-scale variants are also possible, though not to the extent of insects.
3. Reptiles
Especially in tropical, semi-tropical, and arid regions, reptilian animals such as lizards and snakes will abound. Lizards will feed on insects, snakes will feed on small mammals.
Comment: Cockroaches only survive outside the tropics because of humans. If the cities outside the tropics are abandoned, that means the heat is off. That means after the first winter, no more cockroaches.
Comment: Cockroaches survive cold weather up to the freezing point. The Oriental breed of roaches (the hardiest) only die at -9 degrees Celsius. Several studies show that roaches can adapt to weather extremes given time.
Answer: There will be lots of animals reclaiming the cities, many of them dependant on the native biome and the nature of the apocalypse.
Rats will probably bloom soon after the apocalypse, but without humans to keep supplying them with food they will soon start dying out, this can be really troublesome to any nearby comunity as those rats can start invading nearby settlements.
Dogs will probably be left behind by the thousands and it will take no time for them to go feral and start roaming the streets looking for food. Once again, they can endanger nearby settlements as food on the cities dwindle.
Finally you will have cats, they will be less of a problem, but your survivors will probably be eating cat meat very soon.


Socket data read wait time

Question: I have application where I am listening on multiple sockets using select. If I start processing request that came in from Socket A and in the meanwhile if another request on socket B arrives then I want to know how long does socket B request had to wait before I could get it. Since this is a single threaded application I cannot spawn a new thread and go back to select to monitor again and instantly start processing request from socket B.
Is there a 'C' api available to get me this metric or is this just not possible to get?
Comment: There is nothing stopping you signalling the socket object to another thread, or threapool, for action so that you can get back to the select() quicker.
Comment: Like I said it's a single threaded application so I just have one thread which reads the request does work and then comes back to select
Answer: There is no a straightforward way how to measure the interval between the 'data ready' time and 'data read' time because there is not any timestamp written together with the data. Moreover the situation is even more complex because a stream oriented socket may receive several data segments till select is closed and the it is not what interval should be measured.
If the application data processing is longer than packet processing in the kernel the you can do a reasonable measurement in following way:

print current time and some unique data id based on application protocol when select wakes up due to socket B data availability.
log any packet received for the socket B. You can use either a network traffic capture tool like wireshark or tcpdump. Or you can configure an iptables firewall rule (if it is running on linux) with target -j LOG.
Write a simple script/program that correlates the captured packets and the application log and subtract received and start processing time.

Of course the idea above does ignore the kernel processing time. If you really need exact time I have to introduce a new thread to your application.

Socket data read wait time


how to iterate through a json that has multiple pages

Question: I have created a program that iterates through a multi-page json object.
def get_orgs(token,url):
    part1 = 'curl -i -k -X GET -H "Content-Type:application/json" -H "Authorization:Bearer '
    final_url = part1 + token + '" ' + url
    pipe = subprocess.Popen(final_url, shell=False,stdout=subprocess.PIPE,stdin=subprocess.PIPE)
    data = pipe.communicate()[0]
    for line in data.split('\n'):
        print line
        try:
            row = json.loads(line)
            print ("next page url ",row['next'])
        except :
            pass
    return row
my_data = get_orgs(u'MyBeearerToken',"https://data.ratings.com/v1.0/org/576/portfolios/36/companies/")

The json object is as below:
[{results: [{"liquidity":"Strong","earningsPerformance":"Average"}]
,"next":"https://data.ratings.com/v1.0/org/576/portfolios/36/companies/?page=2"}]

I am using 'next' key to iterate,but at times it points to "Invalid Page" ( a page that doesn't exist). Does JSON object have a rule about how many records are there on each page ? In that case , I will use that to estimate how many pages are possible.
EDIT: Adding more details
The json has just 2 keys ['results','next']. If there are multiple pages, then the 'next' key has the next page's url (as you can see in the output above). Else , it contains 'None'.
But, problem is that at times, instead of 'None' , it points to the next page (which does not exist). So, I want to see if I can count the rows in Json and divide by a number to know how many pages the loop needs to iterate through.
Comment: To me it's unclear what you are trying to achieve. Your problem seems to be that you request some JSON from a server. The JSON contains an URL to the next dataset for lack of a better word. Are you having problems extracting the correct URL, or is the URL that you extract from the response incorrect? In the later case the problem is not in your code. Why are you using curl instead of a built-in python solution like [urllib.request](https://docs.python.org/3.5/library/urllib.request.html)?
Comment: Hi Maurice, thanks for your reply. I am sitting behind a proxy in my company and curl works fine. For urllib2 or requests, I get an authentication error.
Comment: @Maurice, I have edited the question to give more details about the problem
Answer: In my opinion using urllib2 or urllib.request would be a much better option than curl in order to make the code easier to understand, but if that's a constraint - I can work with that ;-)
Assuming the json-response is all in one line (Otherwise your json.loads will throw an Exception), the task is pretty simple and this will allow you to fetch the amount of items behind the result key:
row = [{'next': 'https://data.ratings.com/v1.0/org/576/portfolios/36/companies/?page=2', 'results': [{'earningsPerformance':'Average','liquidity': 'Strong'}, {'earningsPerformance':'Average','liquidity': 'Strong'}]}]
result_count = len(row[0]["results"])

The alternative solution using httplib2 should look something like this (I didn't test this):
import httplib2
import json
h = httplib2.Http('.cache')
url = "https://data.ratings.com/v1.0/org/576/portfolios/36/companies/"
token = "Your_token"
try:
    response, content = h.request(
        url,
        headers = {'Content-Type': 'application/json', 'Authorization:Bearer': token}
    )
    # Convert the response to a string
    content = content.decode('utf-8') # You could get the charset from the header as well
    try:
        object = json.loads(content)
        result_count = len(object[0]["results"])
        # Yay, we got the result count!
    except Exception:
        # Do something if the server responds with garbage
        pass
except httplib2.HttpLib2Error:
    # Handle the exceptions, here's a list: https://httplib2.readthedocs.io/en/latest/libhttplib2.html#httplib2.HttpLib2Error
    pass

For more on httplib2 and why its amazing I suggest reading Dive Into Python.


How can I change permissions for the folder including subfolders?

Question: How can I change permissions for the folder including subfolders?
Answer: If you don't want to do this from the GUI, you could use the command line program cacls using the /T option.
(or use icacls which is the new version of cacls).
If you want to use the GUI, right-click the folder, choose properties, then click the security tab. Click Advanced, then click Change Permissions. Add the user/group you want to give permissions to (and select the permissions you want to give), then check the box that says "Replace all child object permissions with inheritable permissions from this object".
UPDATE: Eating my own dog food, another real world scenario yesterday when we needed to reset all permissions on a folder with a few million files in it (and remove inheritance):
This was on Windows Server 2008 R2, so you need to run a CMD Prompt as Administrator (advisable for Server 2008 R2 and above). At the CMD prompt:
icacls E:\Store\*.* /grant:r "OURDOMAIN\Domain Admins":F /grant OURDOMAIN\ITAdmins:F /T /C /inheritance:r /Q

.
To explain each part of this command:

icacls

the command

E:\Store\*.*

the folder and files which need permissions reset

/grant:r

grant permissions and replace all existing permissions

"OURDOMAIN\Domain Admins"

user/group that we're giving permissions to (the quotes are needed because "Domain Admins" has a space)

:F

grant Full Access permissions

/grant

grant additional permissions (no need for :r this time)

OURDOMAIN\ITAdmins

an additional user/group to give permissions to

:F

grant Full Access permissions

/T

apply to subfolders too

/C

Continue on file errors (e.g. Access Denied)

/Q

Suppress all success messages i.e. don't tell me the millions of files that have the permissions applied, just tell me the ones which failed

For any files that fail, you may need to run TAKEOWN then run the icacls command again (on the failed files):
takeown /F E:\\Store /A /R /D Y

You may want to pipe output to a file because there isn't a "quiet" option on takeown.
Use takeown /? to see other options available.
Comment: @Sergey - I've added instructions for the GUI method. Hope this helps.
Comment: Can I do this from the GUI? I couldn't find such option.
Comment: Thank you, it works! You finished a lot of painful hours of trying!
Answer: Simply Use :
ICACLS "PATH OF DIRECTORY (FOLDER)" /grant "USER":F /T

In Following example I am setting permission for Everyone to all sub-folders/files of a folder named Hardik in my D drive. then my cmd code would be like this,
ICACLS "D:\Hardik\*" /grant "Everyone":F /T

For more details please visit this link..
Answer: using this script in powershell.. save it as perm.ps1
param(
[string]$i
)

    Import-Module NTFSSecurity

      if(test-path $i)
      {
            write-host Taking ownership of Directory $i -fore Green
            Get-Item $i | Set-NTFSOwner -Account 'qd'
            Get-Item $i | Add-NTFSAccess -Account 'qd' -AccessRights FullControl

            $items = @()
            $items = $null
            $path = $null
            get-childitem $i -recurse -force | ForEach {

                    $path = $_.FullName
                    Write-Host ...Setting permissions to $path -Fore Green
                    Get-Item -force $path | Set-NTFSOwner -Account 'qd'
                    Get-Item -force $path | Add-NTFSAccess -Account 'qd' -AccessRights FullControl
                }
       }

in powershell first issue "Install-Module NTFSSecurity"
Then "perm.ps1 d:\yourfolder"
Why would you use this? In case, the other solution does not work..
Answer: Step to change the permission for a folder and its subfolder files.
In Linux, you can notice various folders and files exist. You need to set appropriate permission and ownership to ensure proper work access.
The permission 755 is required to set for directories. (drwx.r-xr-x);
Three types of permission.
•   r- read
•   w- write
•   x- execute permission
            find /foldername -type d –exec chmod 755 {} \;

Example: find /var/www/user –type – exec chmod 755 {} ;
Permission 644 is vital for files. (-rw-r--r--);
         [find (filename) -type f –exec chmod 644 {} \;][1]

Example: find /var/www/user/ -type f –exec chmod 644 {} ;


Data center fact in Puppet

Question: In hiera examples, I have seen people putting a fact called dc or datacenter in their hierarchies. However, its not clear anywhere as to how the fact is implemented to determine the data center. Is there something that already exists for the same? Or does everyone write their own custom fact? Would appreciate some help on understanding this.
Comment: I imagine how you would implement a datacenter fact depends on the source of the datacenter value for your environment. If you don't currently have a source for this information, you need to start with that.
Comment: Precisely. I just don't understand how to start with that. How do others do this? How I usually work with any kind of machine is that I log into the management interface of the infra provider, and provision a new machine which I get in some time depending on if it is a virtual machine or bare metal. There is nothing in the machine that I have which I can use for determining the data center or location of the machine. The only way I can think of achieving this is a have a process for bootstrapping a machine which is location aware and that puts a meta data file which may have this info.
Comment: Does the above process sound good enough? Is that what everyone does or is there something else that people do to achieve this?
Comment: Maybe you can tell what datacenter it is based on the subnet? Read the default gateway value and set the datacenter value based on a conditional test.
Answer: What are you describing is generally done by extending the core set of facts on the server. There are two ways of adding additional facts:
Custom facts - facts created through ruby code
External facts  - facts generated by either output from an external script or even a static text-based data source
Either way, those facts can be generated programmable based on one more combination of attributes and/or deliberate identification of the server's role and location. In the case of the data center fact, if the datacenters are distinguished by IP address, you can specify the data center off of that.

Data center fact in Puppet


Programing a search button with Google Earth API

Question: I´m using the google earth API, I have create an input type text, in which i will like to include some direction, the I create a button witch is suposed to use the text include in the forst button.
I will like to what I should do (better with explications) in javascript to use the text in the first button as the direction to go in the map when clicking the second button.
thank
Answer: One way of doing this is to use the Google Places API, which will return the coordinates (amongst other details) of the place being queried.  So will the Google Maps API geocoder, which you can use along with your Earth API application.
Whatever you use, you will eventually need the latitude and longitude of the location, at which point you can fly to it (see https://developers.google.com/earth/documentation/camera_control for snippet examples of this.)
If this does not answer your question please provide more details on exactly what you're trying to do and where you are stuck.


MySql WorkBench Can't connect to MySQL server on '127.0.0.1' (111)

Question:
I have install mysql Workbench using ubuntu software center, now i want to create a connection but facing this problem.
Comment: Try the answers in this url : http://stackoverflow.com/questions/1420839/cant-connect-to-mysql-server-error-111
Comment: I have not created a linux sql server , i have installed Mysql Workbench
Answer: Ok, This means that you need to install MySQL first, or connect to a machine with MySQL installed. Check this URL on how to do so on Ubuntu
https://www.linode.com/docs/databases/mysql/install-mysql-on-ubuntu-14-04
Answer: I faced this problem once. The issue was that the allowed host for root was localhost. The host was not unable to map localhost to 127.0.0.1. In your my.cnf file, set the bind address as follows:
bind-address = 127.0.0.1
To allow all IPs use %.
Restart the server and then check.
Answer: same issue i faced with mysql workbench 6.3.8 build 1228 CE (64-bits) community with kubuntu 18.04 version.
i set connection method standard tcp/ip over ssh and when i try to connect to remote server it asks for ssh password and after successful ssh tunnel it asks for remote mysql password ( which was expected as i did not store passwords in keychain -- option available there in connection window ) and when i entered it i got same above error.
after checking at server mysql log i found this line:
Access denied for user 'root'@'localhost' (using password: NO)
but i already entered the password while workbench asks me.
finally i try edit connection and store mysql password there in keychain option and it works fine.


Universal word part for ~ in 'you can ~ by it'

Question: We have words like 'visible' and 'audible'.  You can see it or hear it, respectively. But is there a word part for 'you can ~ with it'?  Like: "You can see with this chip.  It's visifying.'
Comment: I think OP is asking whether there is an affix like *-ble* which expresses "providing the ability to"
Comment: I'm not sure I really understand what you're asking here. You see with your eyes. I don't understand seeing with a chip. Could you try and explain a little more?
Comment: You remember that movie where the lead man's vision is resorted by a computer chip that's implanted into his skull?
Comment: Do you mean a microchip? Does the chip actually give the man the ability to see? You will have to be more specific.
Answer: English does not have any suffix I know of which expresses the sense providing the ability to do something.
Ordinarily we would construct such a sense with the verb enable, followed by the ordinary English noun which expresses the ability:

This device enables hearing.
  This chip enables sight.
  This method enables speech.

If you require an adjectival form this would be constructed with NOUN + - + present participle OR past participle of enable:

Wolfpack has just introduced a new sight-enabling chip.
  Wolfpack has just introduced a new speech-enabled robot.

But that doesn't work very well with gerunds, due to the horror aequi principle which avoids juxtaposing similar forms:

? Wolfpack has just introduced a new hearing-enabling device.

If you really really desperately require a one-word, Latinate form you might try -potentiate, -potentiating, -potentiated:

Wolfpack's visipotentiating chip will launch a revolution in intelligence gathering.
  Wolfpack's device audipotentiates sufferers from conductive hearing loss.
  Wolfpack's new loquipotentiated robot can carry on actual conversations!

But that's really really far-fetched.
Comment: Wow, StoneyB!  This is really informative.  Thank you
Answer: The question is unclear but let me try.

You can see with this chip. It's visible. -what's the problem in this?

Or you want...

You can visualize with it. Here, visualize means make something visible to the eye.

Or...
Audible and Visible in this context are adjectives and you looking for another adjective for the word see? If yes, then it's seeable or viewable -though the former one is not too frequently used.

seeable (adj) - Capable of being seen; or open to easy view.
Comment: Maulik: Reverse dictionary for "as a means of" or "used for" (i.e., 'as a means of seeing').  Perhaps 'pro' in "pro-vision" or "pro-audio".
Comment: @Wolfpack'08 I din' get anything you said!
Comment: Okay.  Basically: `visible: can be seen; visipotentiating/pro-vision: enables vision`.  Visible is like 'in the vision'.  vision-enabling is like 'turns the eyes on'.
Answer: If you're looking for a word that encompasses either "visible" or "audible", consider "perceivable":

Adj....capable of being perceived especially by sight or hearing; "perceivable through the mist"

or "perceptible":

adj.
  Capable of being perceived by the senses or the mind: perceptible sounds in the night.

In the context of your phrase, this would read, "You can perceive with it." If you wanted to form a compound modifier, you could then add, "It's perception-enabling," but it's a little more awkward. I can't think of a non-compound alternative to "visifying", which itself is not commonly accepted as a word.
You could also use "sense" instead of "perceive" here, but I would recommend against using "sensible" for your purposes. Its first definition fits the meaning, but it's somewhat more ambiguous because people often use "sensible" to mean logical or reasonable, more or less. BTW, the technical distinction between sensation and perception (in psychological literature, at least) is between the actions of the sensory organs (e.g., the eyes receiving light) vs. mental processes in conscious experiences (e.g., a person becoming aware of light).


220V/1ph/60Hz equipment to operate on 208V/3ph/60Hz

Question: Can an equipment built for 220V/1ph/60 Hz be connected to a 208V/3 ph/60Hz grid by using only two lines of the 110V each across the load?
Answer: A line and neutral of a 208-volt distribution system will provide 120 volts. That is only a bit more than half of the needed 220 volts. Any 220-volt load will operate very poorly or not at all. If you can get two 120-volt hot lines from a 208-volt system, you will have 208 volts. That would probably provide reasonably acceptable operation for many 220-volt items and even the more common 230-volt equipment.
Answer: Yes, but 208V/3ph would not have a 110V phase voltage. You have to be careful.
Answer: 3 phase, 208 volts has a phase voltage (line to neutral) of 120 volts AC and not 110 volts. If you applied 110 volts there is no guarantee that the equipment (unspecified) will work under all reasonable circumstances.


How can I combine two datasets and assign factors to each?

Question: I have a very basic question (just starting with R).
I have two datasets (xlsx files) with one variable (x) and 11 observations.
I need to combine these two tables to one table with the variable x (ending up with 22 observations and 1 variable).
But I still need to be able to distinguish which observations belonged to group1 and which to group2 --> so I guess I have to add a Factor like A for group1 and B for group 2.
How can I add this factor so that it remains with the values after combining/stacking the datasets?
Thanks already in advance!
Answer: Hierarchical indices
Have a look at here (scroll a bit underneath for the code)


C++ getenv doesnt update

Question: I'm trying to make a program that a bash script runs. I want the bash script to be able to change the state of the c++ program, and the only thing I could find was to use environment variables. Thing is, its seems getenv only gets the value at the time when the program was run.
Bash
export BLINK=1
./blink &
sleep 5s
unset BLINK

C++
int main(int args, char **argv) {

    char *blink = getenv("BLINK");

    while(blink && blink[0] == '1')
    {
        std::cout << getenv("BLINK") << std::endl;
        usleep(500000);
    }

    return 1;
}

So what this does is run the blink program, wait 5 seconds then unset the environment. The C++ program however always sees the enviorment value as 1 and never stops. How do I get an updated environment variable while the program is running? Or is there a better way to have a bash script control the state of a c++ program.
EDIT I should note, I do not want to just kill the process either because it has to turn off hardware when it ends.
Comment: That's not how the environment works. A spawned process gets a copy of its parent's environment when it starts and then the two are not connected anymore. If you want to talk to your application then you need a communications channel. Signals, pipes, sockets, standard input, control files that the program polls for, etc.
Comment: For reference: since the current question is "how do I do this impossible thing, or any other thing", I'm voting to close. A complete survey of UNIX IPC mechanisms is way too big. Do read up on the stuff Etan mentioned though, figure out what you need, and come back when you have a new question.
Answer: It is not possible to modify program environment after it is started. You have to use another method of interprocess communication. The simplest one is to register handler for some signal to your app (e.g. SIGUSR1), and then send it using kill -SIGUSR1 <pid> command.
There are also other solutions available, e.g. create named pipe (using pipe shell command), and check periodically if someone wrote something to it. If yes, exit loop.
You can also use sockets if you want, but this could be more complicated.
Answer: The C++ programs environment is not changing when you change it in bash - since when you start your program it gets a copy of the parent's environment and has no access to the parent process's environment.
You can use a file to easily share data, however.
Bash
echo "1" > blink.txt
./blink &
sleep 5s
echo "0" > blink.txt

C++
#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
#include <unistd.h>
using namespace std;

string getfile(const string& filename) {
    ifstream in(filename.c_str(), ios_base::binary);
    in.exceptions(ios_base::badbit | ios_base::failbit | ios_base::eofbit);
    return string(istreambuf_iterator<char>(in), istreambuf_iterator<char>());
}

int main(int argc, char* argv[]) {
    string blink = getfile("blink.txt");
    while(blink[0] == '1')
    {
        std::cout << getfile("blink.txt") << std::endl;
        usleep(500000);
    }

    return 1;
}

C++ getenv doesnt update


$0 (Program Name) in Java? Discover main class?

Question: Is there a way to find the name of the program that is running in Java? The class of the main method would be good enough.
Answer: Try this:
    StackTraceElement[] stack = Thread.currentThread ().getStackTrace ();
    StackTraceElement main = stack[stack.length - 1];
    String mainClass = main.getClassName ();

Of course, this only works if you're running from the main thread.  Unfortunately I don't think there's a system property you can query to find this out.
Edit: Pulling in @John Meagher's comment, which is a great idea:

To expand on @jodonnell you can also
  get all stack traces in the system
  using Thread.getAllStackTraces(). From
  this you can search all the stack
  traces for the "main" Thread to
  determine what the main class is. This
  will work even if your class is not
  running in the main thread.
Comment: There is no garantee main thead to be running when you'll try to find app name from other threads. Main thread could finish normally and some other background threads not yet finished. Don't think it is legitimate to do this trick other then from main thread.
Comment: Good trick. In general, one would call this from main(), so there is only one thread at this point, but in case this is called from elsewhere, we better have this thread problem in mind...
Answer: System.getProperty("sun.java.command")

Comment: i believe this only works on the HotSpot VM.  see http://java.dzone.com/articles/programmatically-restart-java
Answer: To expand on @jodonnell you can also get all stack traces in the system using Thread.getAllStackTraces(). From this you can search all the stack traces for the main Thread to determine what the main class is. This will work even if your class is not running in the main thread.
Comment: It is possible for the main thread to stop running but the application still continues (other non-daemon threads). This likely happens in many GUI/Swing applications since the common idiom is for the main thread to invoke on EDT to create the first frame and then terminate.
Answer: This is the code I came up with when using the combined responses of jodonnell and John Meagher.  It stores the main class in a static variable to reduce overhead of repeated calls:
private static Class<?> mainClass;

public static Class<?> getMainClass() {
  if (mainClass != null)
    return mainClass;

  Collection<StackTraceElement[]> stacks = Thread.getAllStackTraces().values();
  for (StackTraceElement[] currStack : stacks) {
    if (currStack.length==0)
      continue;
    StackTraceElement lastElem = currStack[currStack.length - 1];
    if (lastElem.getMethodName().equals("main")) {
      try {
        String mainClassName = lastElem.getClassName();
        mainClass = Class.forName(mainClassName);
        return mainClass;
      } catch (ClassNotFoundException e) {
        // bad class name in line containing main?!
        // shouldn't happen
        e.printStackTrace();
      }
    }
  }
  return null;
}

Answer: Also from the command line you could run the jps tool. Sounds like a
jps -l

will get you what you want.
Answer: For access to the class objects when you are in a static context
public final class ClassUtils {
    public static final Class[] getClassContext() {
        return new SecurityManager() {
            protected Class[] getClassContext(){return super.getClassContext();}
        }.getClassContext();
    };
    private ClassUtils() {};
    public static final Class getMyClass() { return getClassContext()[2];}
    public static final Class getCallingClass() { return getClassContext()[3];}
    public static final Class getMainClass() {
        Class[] c = getClassContext();
        return c[c.length-1];
    }
    public static final void main(final String[] arg) {
        System.out.println(getMyClass());
        System.out.println(getCallingClass());
        System.out.println(getMainClass());
    }
}

Obviously here all 3 calls will return
class ClassUtils

but you get the picture;
classcontext[0] is the securitymanager
classcontext[1] is the anonymous securitymanager
classcontext[2] is the class with this funky getclasscontext method
classcontext[3] is the calling class
classcontext[last entry] is the root class of this thread.

Answer: Try this :
Java classes have static instance of their own class (java.lang.Class type).
That means if we have a class named Main.
Then we can get its class instance by
Main.class
If you're interested in name only then,
String className = Main.class.getName();
Comment: But in this case you do not know which class is the "main" class.
Answer: Or you could just use getClass().  You can do something like:
public class Foo
{
    public static final String PROGNAME = new Foo().getClass().getName();
}

And then PROGNAME will be available anywhere inside Foo.  If you're not in a static context, it gets easier as you could use this:
String myProgramName = this.getClass().getName();

Comment: This makes no sense at all. It only works if I knew that `Foo` was the main class. But then I wouldn't need to do this.
Comment: I don't think this solves the problem. The poster does not know which class contains the `main` method that was invoked when Java started up (perhaps it is part of a third party library).


How do I to set Gmail as default email program in Windows 10?

Question: I use Gmail as my default email client. What do I have to do to have  mailto:email@example.com open Gmail instead of opening the standard Windows email program?
Comment: It may depend on the browser you're using.
Answer: When using Google Chrome check the following link: http://lifehacker.com/5883372/set-gmail-as-your-browsers-default-email-client-with-a-simple-hack
Basically the following:
Open Gmail in Chrome. Press Ctrl+Shift+J (Windows) or Cmd+Opt+J (Mac) to open Chrome's built-in JavaScript console.
Paste the following into the console and press Enter:
navigator.registerProtocolHandler("mailto", "https://mail.google.com/mail/?extsrc=mailto&url=%s", "Gmail");

Chrome will prompt you, asking if you'd like to "Allow Gmail (mail.google.com) to open all email links?"
Click the Use Gmail button.
That's it!
Comment: Shouldn't need to use a console window hack. It should be right there in the settings. Let me see if I can track that down.
Comment: I believe chrome will ask it eventually when using gmail repetitively
Answer: It depends on the program you're trying to send the email from. Unfortunately, some programs are designed to work only with the native email clients. A supported solution (IMAP is for sending & receiving) for this is to configure Outlook or the native client with your cloud-based email service, make sure to set your default email accordingly. one thing to note, if you use two-way authentication, you'll need to generate an app-specific password.


Applying one page template to another page

Question: I need to know how can I apply one page template to another page in SharePoint Online?
Answer: The only way I've been able to do this is open Designer - copy the page and paste it right back into the library - it will create a name like Page (2)...just change the page name and then you can edit it how you like.  You can copy and paste from one site to another too...but I don't think you can actually create a page template - just sites and lists..
Comment: Can I do the same thing but under Site Settings --> Site Content and Structure--> Actions--> Copy and to copy same page to the same page library in the same site?
Comment: Could you please answer can I do like I mention in above comment?
Comment: Personally I have never done it that way b/c I generally want to keep my content.  I say try it out.


Wireless power transfer through stainless steel

Question: The SS in question is 316, and is only weakly magnetic.
Does anyone know whether this is possible?
Comment: How thick is it? How much powah? For thin stuff it's possible, though there may be losses & heating which may or may not be acceptable.
Comment: It's bad - 12mm. As for how much, probably around the 1W level. It's only an idea at present for removing a connector from a vacuum system.
Comment: Is the stainless vessel grounded or electrically floating? What is the geometric configuration?
Answer: It's not its magnetic properties that are the problem - it will have induced into it AC eddy currents that will pretty much kill off your magnetic field. I don't think you'd get 1 watt through 1 mm SS let alone 12 mm unless you were operating at 10 Hz (that's hertz not kilo hertz).
EDIT (not related to the question) - you'd be surprised about the odd magnetic properties of "mm sizes" of 316 SS at between 50 kHz and 1 MHz, specifically 300 kHz. Just stuff I've observed when designing food and pharmaceutical metal detectors.
Comment: I believe sub mm thickness is often also used as EM shielding to block the more magnetic (current coupled) portion of waves.
Answer: I think you have a reasonable chance of doing this at mains frequency. 316 SS is quite resistive and almost non-magnetic at room temperature so a 60Hz field should easily penetrate 12mm- skin depth at 50 or 60Hz is more than 5cm.
There would be a lot of leakage inductance so the resulting transformer would have a lot of effective series impedance.
I'm visualizing something like an 'pot core' shape turned from iron or magnetically soft steel with the SS wall between the two halves.
Answer: This is certainly possible.
Since you do not list any efficiency requirements, one solution might be to drive an AC current across (not though) the stainless steel, and use a pickup inside the vessel to inductively generate power inside the vessel. The coil does not touch the stainless steel wall.

Here I am showing the half of the AC where the current if flowing from left to right across a wall of the vessel (the arrow pointing left). This generates the circular magnetic field lines around the path of the current though the stainless steel wall.
You would position the interior pickup coil so that these circular field lines cut though it as the get bigger and smaller (the coil is parallel with the path of the current in the wall).
You would pick the number of turns for the interior coil based on the volts/amps you need inside the vessel.
Think of it as a transformer where the primary (the stainless) has 1 turn.
If you need DC inside the vacuum, then you'd need to rectify and filter the power coming off the interior coil.
There are many ways you could potentially make this arrangement more practical, but they are dependent on the geometry of your setup.
Comment: There is no suggestion of using mains voltage here! Considering that the vessel wall is SS, the AC source voltage would very low- almost certainly less than 1 volt.
Comment: Hmmm...**_WARNING: ELECTROCUTION HAZARD_** besides that "little drawback," the theory is workable/doable...just that energizing a (most likely human accessible) SS surface from AC mains is a terrible Idea!
Comment: At those kinds of voltage current points (potentially >10A at ~1V) I'd be a little worried about electrolytic effects (depending on the nature of the whole system), especially as 316 is 10-15% Cr!
Answer: There is no way you are going to move 1W of power through 12mm of SS, thin sheets are used for EMC shielding for a reason, it is decent at absorbing magnetic fields as well as electric ones.
Can you give more details about the device, maybe there are other methods of power transfer...
Comment: Strictly speaking, you are confusing a power level which is required for an efficiency requirement which hasn't been given.  If the experiment is "serious" enough that the chamber has a 12mm thick wall, I'd imagine something like 1% efficiency - 100 watts expended to couple 1 watt through - might not be unacceptable.  At what frequency that could be achieved is an interesting question.  Of course whatever power regulator or filter or related stuff goes on the inside has to be vacuum rated (or at least not outgass problematically), a complication which may make the idea less interesting.
Answer: Would it be acceptable to replace the connector with a nickel-plated, ferrite/mild-steel 'core?'
If so, you could rabbet-joint & NASA low-gas-epoxy in a small diameter transformer core so that a portion of it sits flush with (or even behind, say, 1-2mm of un-removed SS) the 'device-side' surface, to closely couple the magnetic flux from your exterior coil to the base of your device, where your secondary windings are placed, to receive the power.
If that's not an option, then I guess there's always the "put a 300W electro-magnet on the outside of the SS & deal with the losses" approach. However, I'm guessing that you most likely aren't trying to design an induction cooker that heats your whole SS surface with 299W of power.
Also, while not generally a 'preferred' option, it may be 'feasible' to transfer a small amount of power through 12mm of SS using ultrasound (or other physical vibrations), rather than E/M coupling. This would be a "far from efficient" approach, and 1W would likely be approaching an upper-limit for plausibility, but if all else fails, it could be worth consideration.
Answer: At my opinion, typical double U-shaped transformer divided into two parts will solve the problem due to low permittivity and conductivity of vacuum steel. But there will be problems due to vacuum. Typical lamellar core has large and developed surface area and and thus will bring unacceptable contamination into vacuum system. The coil has same problem. Thus, it is necessary to make core yourself from bulk steel, make coil frame from PTFE or something other with low gassing, and wind the inside coil from wire washed with gasoline. Transformer should work at low frequency to reduce Eddy currents.
Another way is to use existing door or vacuum pipe, which is isolated from the chamber by rubber ring, as second electrode. (chamber is first) Typical KF or CF flanges can be made insulated by putting polyimide film between touching steel surfaces while not altering sealing surfaces.


What's the preferred way to put music in a java applet?

Question: Is there an easy way to put music in a java applet? Preferably streaming so that it doesn't need to be preloaded.
Comment: As this isn't game development specific, you might get a better response at http://www.stackoverflow.com/.
Answer: You might try something like this, though as the author said he didn't stream so it stuttered. You'd want to preload a certain amount of the sound before feeding it to the Line.
Comment: Yes, it's not exactly what I'm looking for, but I guess there is no other easy way to do this. Thanks for the answer.
Answer: This site may help you, it contains a lot of examples of how to use the Java sound API (loading, playing, streaming, recording...).


monerod doesn't connect to peers

Question: I have installed the Monero GUI and it was giving some errors so I went back to the cli.  When I run ./monerod everything seems to work fine but when I do status it gives me -
Height: 1346603/1346603 (100.0%) on mainnet, not mining, net hash 99.90 MH/s, v5, up to date, 0(out)+0(in) connections, uptime 0d 0h 11m 57s
Why is it not connecting to peers? When I do start_mining  it gives the error Error: Mining did not start -- BUSY. I looked at this to try and solve my issue but it still did not connect. I am using Ubuntu 17. Thank you for any help.
Answer: We can't tell without more information.
If you'd left monerod not running for a long time, it's plausible that it'll try to contact nodes which were running, but are not (either they're now down, or they were on dynamic IPs which changed since, etc).
It is also possible that peers banned your node. This would normally only happen if your node is on a bad fork and sends incorrect data to those other nodes. Check you are using monerod 0.10.3.1.
Another possibility is that your network connectivity is down.
To check what the network layer is doing: set_log 1.
To try and reset the set of known peers: exit monerod, rm ~/.bitmonero/p2pstate.bin, start monerod again
Comment: I am using monero 0.10.3.1 and connected to the internet while I am running monerod, I also reset the known peers with no avail. I have been getting a warning "no two valid MoneroPulse DNS checkpoint records were received" But I read somewhere else that it wasn't an issue.  When I set log_level one I get many errors and warnings, the most prevalent are "-4, LEVIN_ERROR_CONNECTION_TIMEDOUT". I restarted monerod just to see if I would get the same errors and I had no output besides the dns warning.
Comment: The DNS warnings are indeed ignorable at this pont. Timeouts are also ignorable, they're typically about trying to reach nonexistent nodes.
Comment: Then what am I to do? None of the options above worked.
Comment: What is the top hash shown when you run the `diff` command ?
Comment: TH: f67cfa6b68c204d2f0ad7af2bbcfd5b233fba400a24bb7152ce11e5cc63f2ab2
Comment: OK, that's a valid block on the chain. The best thing at this point is to file a bug on github.com/monero-project/monero/issues with the information above, plus the log you get by restarting monerod with this flag: --log-level 1,net.cn:DEBUG,net.p2p:DEBUG

monerod doesn't connect to peers


Are there any Limitations to how much and what can be amended or abolished in the UN charter and ICJ statute

Question: It seems like there aren't rules for amendment for ICJ and UN charter beyond a procedure for how they are to be amended. Does the UN or ICJ have a basic structure doctorine or entrenched clause that details what can't be amended ?
Answer:
Does the UN or ICJ have a basic structure doctrine or entrenched
clause that details what can't be amended?

No.
This is mostly because these bodies as such are mostly impotent and so there is not a strong incentive to litigate them or a strong need to amend them. Neither the UN charter or the ICJ have had provisions that have been heavily litigated.
Countries are mostly at peace with the notion that the UN is mostly a talk shop and that the ICJ is mostly a forum in which issues are resolved by mutually consenting sovereign parties.


Performance difference between Sandbox and Production instances?

Question: I am seeing little bit difference in the page response time in sandbox and production org's. Actually, i am thinking the production org instance is faster than the sandbox instance because it might be running on powerful servers. Is that true?
Answer: According to this article from 2013, Sandboxes are configured with a 4 node clustered database tier while Production have an 8 node clustered database tier.
While that may have changed since publication, I would guess they do have more powerful servers running production.
Comment: Never seen any documentation on it before looking at your article, but yes, I always assumed this was the case.  Just makes sense.
Comment: extra bit: note that in general, don't fall into the trap thinking that if response time is 'slow' in sandbox it will get 'better' in PROD. I evaluated an appexchange product (nameless) for weeks which had horrible response time in sandbox but vendor alleged that it would be snappier in PROD. Not true at all. Heavy use of SOQL, DML and CPU will be slow, regardless of number of nodes.
Answer: In some situations sandbox and production can perform similarly, but SOQL query performance can vary greatly due to the following factors:
Different hardware configurations
Differences in data skew
Data fragmentation in production (as opposed to contiguous data in sandbox as a result of the sandbox copy process)
Different usage patterns
Differences in the presence of custom indexes and skinny tables
All of these contribute to differences in run time. In a lot of cases, SOQL queries in sandbox can have a lower run time, and you may often find customers are frustrated because SOQL queries - particularly queries in Batch Apex start() methods - execute fine in sandbox but time out in production.
The two main contributors to query performance differences are contiguous tables created during the sandbox copy process, and resources competing for cache.


Find all triangles of which perimeter and area are numerically equal

Question: Find all triangles of which perimeter and area are numerically equal. I have got    solution for right angle triangles but not of others
Comment: Infinite.
Comment: You've had a few answers, Satvik --- any questions?
Comment: After running a program on JavaScript, there are only five of these triangles.
5,12,13
6,8,10
6,25,29
7,15,20
9,10,17
Now this is very vague and has no actual evidence behind it, so if you can take these numbers and figure out why this is, you will have a strong answer.
Good luck and keep me updated if you find anything!
Answer: Area = $rs$, where $r=\text{inradius}$ and $s=\text{perimeter}/2$
You can see that $rs=p \implies r=2$
There are infinite triangles with inradius as $2$
Comment: I think that this answer is pretty vague. There are definitely infinitely many triangles with $\text {r}=2$ but at least the ways of finding it should've been mentioned as the question asks- *"Find all triangles....."*. Note that the word $2$ is meaningless because that doesn't ensure the fact that the sides are Integers.
Answer: The area is $A = \sqrt{s(s-a)(s-b)(s-c)}$, where $s$ is the semiperimeter. Thus we get
$$(a+b+c)^2 = \frac{a+b+c}{2}(\frac{a+b+c}{2} - a)(\frac{a+b+c}{2} - b)(\frac{a+b+c}{2} - c).$$
We can further simplify this to
$$16(a+b+c) = (-a+b+c)(a-b+c)(a+b-c).$$
Let $u = -a+b+c$, $v = a-b+c$, $w = a+b-c$. Then
$$16(u+v+w) = u v w.$$
In particular any $u,v$ such that $uv > 16$ give a solution for $w$:
$$w = \frac{16(u+v)}{uv-16}.$$
Now for such $u,v,w$ we have that $a = \frac{v+w}{2}$, $b = \frac{w+u}{2}$ and $c = \frac{u+v}{2}$ are the sides of a triangle whose area is equal to its perimeter.
Answer: There is some information at Wikipedia. As another answer notes, these are precisely the triangles with inradius 2. But more information is given, for example, that there are exactly five such triangles with integer sides.
Comment: The claim about integer sided triangles should follow straightforwardly from the formula $16(u+v+w) = uvw$ in my answer. There are basically finitely many cases to check.
Answer: The problem makes not much sense in euclidean plane geometry, for the following reason:
Let $E$ be an euclidean plane and suppose that a unit of length has been chosen by marking two points $A$ and $B$. This automatically defines a unit of area, namely the area of a square with sidelength $|AB|$; in the same way as the length unit  "mile" automatically carries with it the area unit "square mile".
In $E$ we have the operation of stretching available. Linear stretching of any figure by a factor $\lambda>0$ multiplies all lengths in this figure by $\lambda$, and all areas by $\lambda^2$.
Now take any (nondegenerate) triangle $T\subset E$. In terms of the chosen length unit $T$ has a certain  perimeter $2s>0$ and a certain area $A>0$. Then stretch $T$ by the factor $\lambda:={2s\over A}>0$. You obtain a triangle $T'$ with perimeter $\lambda\cdot 2s={4s^2\over A}$ and area $\lambda^2\cdot A={4s^2\over A}$. It follows that for $T'$ the perimeter and the area are numerically equal.
This implies that there are no distinguished shapes of triangles for which the perimeter and the area are numerically equal.
Comment: I agree. $1 m^2 = 10^4 cm^2$ while $1 m = 100 cm$.
Comment: I think the phrase "numerically equal" in the question takes cares of this. Measure length in whatever units you like, area in the square of that unit: then you can ask for the two to be numerically equal.
Comment: @Gerry Myerson: See my edit.
Comment: OK, no distinguished *shapes* of triangles, but, as the other answers show, there are still *individual* triangles, and one can catalog them in various ways.
Answer: It should be pointed out that regarding integer sided triangles whose area is
numerically equal to its perimeter that no equilateral triangle exists, since that would imply that [sqrt(3)/4]*s^2 = 3s, obviously impossible. For isosceles
triangles, using the equation derived in (1), w = 16(u + v)/(uv -16) , suppose
we let u = v, which is the same as triangle side a =b. Then we have:
w = 32u/(u^2 - 16). This Diophantine equation has the unique solution u = 12, w = 3, and of course v =12. Then p = u + v + w =27, and 2a = p - u =15, so there can be no integer solution for an isosceles triangle. Ed Gray
There are 5 triangles with A = p:((5,12,13),(6,8,10),(29,25,6),(20,15,7),(17,10,9). These results are obtained by solving : 16(u+v+w) = uvw


Zip attachment for Wordpress

Question: I noticed that there is no option to upload .zip files to wordpress.com. Lots of blog services give permission to their users for this. I'm a programmer and a lot of my blogs contain code samples. How can I attach my codes to my blogs?
Comment: Use a 3rd party service like gisthub or pastebin. There are plenty to choose from.
Answer: You can use a free account at http://box.net or Ubuntu One to upload and share .zip files, but unless you have a LOT of code that you want to share, you're probably better off embedding your code samples into your posts.
Wordpress now supports posting source code on blogs hosted through their site:

While WordPress.com doesn't allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages [...]
Comment: Thanks. Sometimes it's just needed to post the entire project. I previously used dropbox but I was looking for another solution.

Zip attachment for Wordpress


Moving on from Solidworks

Question: I have worked with Solidworks throughout my time at university on the Solidworks student licence. However, I want to start using Computer aided design for commercial use and being on the student licence, I cannot do this. Is there a computer aided design software similar to solidworks that I can purchase outright, or is affordable.
Comment: Welcome to Software Recommendations! We will need much more information to give good recommendations here – asking for "a tool like X" is never giving enough details, even if linked. You should always list your requirements explicitly. Please see [How to ask for an alternative to some software](//softwarerecs.meta.stackexchange.com/q/48/185) and the questions linked to it for details. Especially missing: waht features do you need, what OS must it run on, how much may it cost?
Comment: The question shows no effort made by the questioneer.  The needs he/she is looking to fulfill are not defined.
Answer: The closest thing to Solidworks out there that is truly free and open source is FreeCAD. Despite all its limitations and idiosyncrasies it shares the same base concept of parametric design based on sketches and constraints and is pretty capable for things from small to medium complexity.
It can output technical drawings to PDF and DXF and export to common formats like STEP and has a rich ecosystem of workbenches and third party addons.
A close alternative that shares the same base workflow but can't output technical drawings is the Salome Platform.
Other than that there are multiple more affordable commercial CAD solutions out there, some subscription model based, some single payment permanent license, and even some free web based ones (the price being your privacy and independence).
Answer: I hate to break it to you, but if you want to be a professional design engineer you are going to need adequate tools. Some clients might not even consider you if you don't use Solidworks. My experience with open source solid modeling software has not been good. There may be new options I'm not experienced with (such as this). You might consider Autodesk Fusion 360. I found it quite capable and an easy transition from Solidworks. Licensing is not free, but very reasonable considering the capabilities. You can try it for free. For the record, I have no affiliation with Autodesk.

Moving on from Solidworks


Is falling onto a mattress safe?

Question: What happens to the body of a 3 year old when dropping her constantly from 6 foot tall father to 3 inch foam mattress topper on a bed for fun?
Comment: Are you asking because this happened and the child seems hurt? Because in that case the answer is "go see a doctor".
Comment: Constantly? I'd say that was too often. Once in a while as a fun thing to do, fine. I hope he doesn't hold her up 6 feet over the bed?
Comment: There are many, many variables that make this unanswerable. What's the length of the drop? How hard is the mattress? Is she landing on her back, butt, neck, or randomly? Is this five times or a hundred times?
Answer: It depends on what you mean by constantly, and the exact height, the firmness of the bed, position of the child on landing, etc.
Fundamentally, the most problematic thing is happening in her head.
A man falling 30 feet hitting a concrete abutment will die of internal injuries, because while the outside of his body stops suddenly, the contents of the body cavities remain in motion (the inside of his body is still falling.) That means that things will rip loose inside his body (for example his right or left pulmonary artery will tear at the junction where they are first supported by underlying structures because his heart is still falling.) This is known as a deceleration injury.
The brain is particularly vulnerable to deceleration injuries, especially in babies. When your 3 year old hits the bed, everything inside of her jiggles a little bit on impact, including her brain.
This video shows the brain of an adult with a "coups/contrecoups" injury. It's dramatic because it's a car accident. But your 3 year old may be experiencing these types of injuries on a much, much smaller scale when she's dropped from a height onto a bed; it depends on many factors. And while a few times will most likely not hurt her in any way, multiplying this many times increases the chance of injury.
Bouncing is fun! That's why trampolines are fun. But the American Academy of Pediatrics discourages any use of trampolines, because of this kind of injury and others.
All kids jump on beds (under their own power), and mostly, he worst thing that happens is they fall off the bed and break an arm or something. As a mom who likes kids to have fun, I allowed my kids to jump on their beds. We (their dad and I) would also toss them in the air on a sheet, but note that the deceleration is much more gradual in that case.
As I said, a lot depends on various factors. Not knowing them all, I would advise against that activity just to be on the safe side.

Is falling onto a mattress safe?


Forget your sin and move forward

Question: Should we forget our previous sin after true repntance as it is not allowing to move forward i m totally stucked always thinks about previou sin. I m not able to focus on my study what should i do??
Answer: yes, you move forward and think about your previous sin and do not do them again. if you repentance with true heart Allah Almighty absolutely forgive your previous sins.

Forget your sin and move forward


What are com ports and why does a PC need them?

Question: As per the title, I'd like to know the purpose of the com ports, since computers have physical USB ports as well. I've searched the web but without any convincing answer.
Comment: Equating a COM port to USB is like comparing one apple to a fruit basket.  A COM port implements one end of a RS232 connection, which is a point-to-point interface.  USB is a *bus* just like PCI, to which you can attach numerous devices to the *bus*.  PCI is an internal bus, whereas USB is external and hot-pluggable
Answer: A traditional com port normally implemented RS-232 which is a rather simple serial protocol that according to the Wikipedia article dates back to 1969. It can be implemented using relatively simple logic that suited technology of the time. Downsides are that it operates at a relatively low speed and the protocol has no concept of identifiying a device and it's capabilities, so for example if you had an RS232 printer you needed to let the software side know both the kind of printer connected and the baud rate of the attached device.
The USB protocol came out in the mid-1990s and apart from operating at a higher speed introduced the idea of a device being able to identify itself both with a particular class, such as say HID (human interface device) for a keyboard along with a vendor and product ID so that a particular device driver could be loaded in the case of devices that needed device specific support.
The "plug and play" functionality came at the expense of much more complex logic that would have been impractical twenty years earlier especially for low-cost devices. But a PC doesn't really require a com port, and indeed as USB is becoming the standard for connecting peripherals many PCs and laptops ship with USB ports but no serial ports.
Comment: *"when it comes to a PC a com port ...are really all the same thing."* -- Key point: "COM" is PC-centric terminology.   *"...dates back to 1969."* -- That's just the date of one standard.  Serial communication interfaces date back much earlier (e.g. CCITT and Teletypes).  Back in the early days of computers, each manufacturer created their own interfaces, and the most popular ones became *defacto* standards and then elevated to IEEE standards (e.g. Centronics parallel printer interface became IEEE 1284).  RS-232 is just one of many asynchronous serial communication interfaces.
Comment: Where is the com port in all of this?
Comment: @Med.ali when it comes to a PC a com port / serial / RS232 port are really all the same thing. You can also get those over USB (using something called the USB CDC class) via an adapter, but that's not something normally built into a PC just another USB peripheral to allow connection to RS232 devices.
Answer: Keep in mind that personal computers and computers in general predate USB. Before USB, we also needed some type of ports to connect out peripheral devices to computers.
"Com" port is one of those ports. It's also much simpler than USB, so due to its simplicity it's still somewhat popular. It was also in use for many decades before USB became popular, so it became sort of standard and can still more or less work well with modern operating systems, unlike parallel ports that were also very popular at one time.
Answer: Some info about serial or com ports

An Asynchronous port on the computer used to connect a serial device to the computer and capable of transmitting one bit at a time. Serial ports are typically identified on IBM compatible computers as COM (communications) ports. For example, a mouse might be connected to COM1 and a modem to COM2. With the introduction of USB, FireWire, and other faster solutions serial ports are rarely used when compared to how often they've been used in the past. The picture shows the DB9 serial port on the back of a computer.

Why does a PC need it?
It doesn't. We may need it - the PC not!
Think of it like this: why do you we still need CD players while we all use iPods and MP3?
Well most of us don't. But some old devices don't have modern (affordable) USB alternatives, and if the old device with com port works, why replace it?!
Answer: To add to the answers above:
For certain applications, COM ports are still useful, but mostly in niche cases. For example it is possible to build a simple and cheap PIC microcontroller program using a COM port. In this example the port isn't actually used for RS-232, the control signals are manipulated in non-standard ways. As such it is not possible to use a USB to RS232 adapter because of the non-standard use.
However even these applications are becoming fewer and farther between. Because of the widespread availability and low cost of microcontrollers with USB slave capability, many programmers are now USB based natively. But if you want to make a USB programmer, you would still need to program the microcontroller the first time, so a COM port would still be useful.


Running VISTA on H/P w/ flat panel TV for monitor. Everything perfect until I downloaded a few items

Question: The problem: I am running VISTA on my H/P pc, which is connected to a Samsung flat panel TV.  Recently downloaded some VISTA updates and Adobe FLASH.  Now the TV, which is my monitor, has terribleresolution - and I can't change it.  It is either too large and blurry or too small and blurry.  I've tried to change to resolution in the Control Panel and have also tried to fix this using ClearType functionality.  For ClearType, I downloaded a tool from MS and that did nothing.  any help would be appreciated.
Answer: Some more information would have helped, for example which MS tool.
I suggest to use system restore to rollback your system to before the problem happened, then redoing the updates in a controlled manner, to find out which one caused the problem.
See Using Windows 7 or Vista System Restore.


Broken "unmet dependencies" list won't let me purge or install anything

Question: I tried installing Steam today on my laptop, and to no surprise it's broken and needs tweaking just like every single time I have ever installed Steam on Linux.
In my process of trying to fix the missing dependencies, I managed to completely and utterly break my apt-get functionality it appears.
Here's what is going on.
sudo apt-get install cowsay

which pops out the lovely and rather completely useless message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
cowsay is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libllvm3.6:i386 : Depends: zlib1g:i386 (>= 1:1.2.0) but it is not going to
be installed
 libpciaccess0:i386 : Depends: zlib1g:i386 (>= 1:22.214.171.124) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

So I do the next logical step, the console is telling me to run:

    sudo apt-get -f install

Alright, well try that.  Nope, I'm just going to give you the illusion that I'm working and make you mad:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  zlib1g:i386

The following NEW packages will be installed:
  zlib1g:i386

0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
6 not fully installed or removed.

Need to get 0 B/52.9 kB of archives.

After this operation, 182 kB of additional disk space will be used.

Do you want to continue? [Y/n] y

(Reading database ... 386548 files and directories currently installed.)
Preparing to unpack .../zlib1g_1%3a1.2.8.dfsg-2ubuntu1_i386.deb ...
Unpacking zlib1g:i386 (1:1.2.8.dfsg-2ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/zlib1g_1%3a1.2.8.dfsg-2ubuntu1_i386.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/zlib1g/changelog.Debian.gz', which is different from other instances of package zlib1g:i386

Errors were encountered while processing:
 /var/cache/apt/archives/zlib1g_1%3a1.2.8.dfsg-2ubuntu1_i386.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

At this point, I feel like I've tried everything.  I followed a pretty lengthy guide on try reconfiguring my dpkg, using apt-get clean, and so on.  Rebooting has done nothing for me.
I'm completely lost.  I'd just reinstall Linux but I don't want to backup all my work just because Steam broke my freaking apt-get.
Answer: I just fixed it.  What I had to do was outlined in this post:
Broken dependencies due to libjackd
So I went to /usr/share/doc and then took zlib1g and zlib1g-dev and renamed both with a .old on the back.  This allowed me to do my
apt-get -f install

and things seem to be happy now.


Using MongoDB as Spring batch job repository

Question: I am working on a spring batch solution and planning to use MongoDB as a job repository. I am looking for a references on this implementation but could not get any references. Then I was checking the spring-batch-core-3.0.7.RELEASE.jar, there I could not able to see MongoDB schema. Does this mean Spring batch does not support MongoDB as job repository?
Answer: That is correct.  Mongo is not a suitable data store for the job repository due to the transactionality requirements of the job repository.  The data store must be ACID compliant in order to be used which is why we have focused our efforts on relational databases for the repository implementation to date.
Comment: @tero17 Gitter is a better location for this kind of question: https://gitter.im/spring-batch/Lobby
Comment: so you don t recommand working spring batch with MongoDb together !! any whys ?
Answer: There is a recent (v1.0.0 in 2021-11-02) project to handle that, it's not managed by Spring team :
https://github.com/europeana/spring-batch-mongo

This library provides MongoDB JobRepository support for Spring Batch.

On official Spring side, there is this opened issue :
https://github.com/spring-projects/spring-batch/issues/877


Why do you add wp_footer() in footer file to add an admin bar in the top of the page?

Question: Adding Code in the footer to place an admin bar at the top of the page seems extremely unintuitive.  Even using the word wp_footer opposed to something like wp_header to add a header seems awkward.  Is there something I'm missing?  I coming from a Java background.
Comment: It's a normal frontend approach to bend things with position absolute. In this case it is performance for most reasons. Imagine the admin bar blocking the whole page while loading > bad experience. While loading it in the footer enables the browser to build the page much faster first, then load all the admin stuff when the "important part" is finished.
Comment: Welcome to [wordpress.se]. Our site is different from most - if you have not done so yet, consider checking out the [tour](https://wordpress.stackexchange.com/tour) and [help center](https://wordpress.stackexchange.com/help) to find out how things work.
Answer: The reason is because wp_footer() was the only place WordPress could output HTML into a theme when the admin bar was introduced.
The front-end output of themes is determined pretty much entirely by the theme, but WordPress needs to support themes and plugins loading their own scripts and styles. To support this WordPress added two functions in version 1.5 (2005): wp_head() and wp_footer(). Theme authors add these to their templates so that they, and plugin developers, can hook into them to add scripts and styles. wp_head() is placed between the  tags, for scripts that need to be loaded there, and wp_footer() gets put before the closing  tag (i.e. at the foot of the page), for scripts that need to be loaded there.
The admin bar was introduced in WordPress 3.1 (2011). The reason it uses wp_footer() is because at that time it was still the only way to add the HTML for the admin bar to the front end in a way that was compatible with existing themes. This means that the HTML for the admin bar is output at the bottom of the page, but CSS is used to position it at the top of the screen.
Theoretically WordPress could've required that theme developers add a new hook at the top of all pages, and output the admin bar there, but that would mean that none of the themes that were already available would be compatible.
Finally, in WordPress 5.2 (2019) a new function was introduced: wp_body_open(), which is placed at the very top, after . This hook could be used to output the admin bar HTML at the top, but this has not been done, likely for backwards compatibility reasons, and because wp_body_open() is nowhere near as widely adopted as wp_footer() at this stage.
When it comes to developing a theme, wp_footer() is required for more than just the admin bar. It's also required to support plugins loading their scripts at the bottom of the page. Since it's been required for 15 years now, omitting it will prevent many plugins from working, not just the admin bar. This is in fact its main purpose, which is why it's called wp_footer(), and not wp_header().
Comment: Wow!  Great answer Jacob!  Thank you!
Answer: There are at least three good reasons to do this.
First, you want the page content to load first so the visitor has a reason to stay on site. By removing things that are not the main content to the end, the visitor can start reading while the page is still loading.
Second, SEO. You want the first content that Google finds to be the article if at all possible. SEO aware themes put sidebars and everything else after the post even if they will display before or above.
Third, the bar is rendered with a lot of Javascript. Best practice (for the above to reasons) is to render Javascript only when the content is finished. after all, Javascript cannot work with DOM objects that are not yet loaded. Thus all Javascript is put at the end of the page so that the Document Ready Function can fire moments after it has been included in the page.


synonym with 'aside'

Question: I remember seeing a word that has the same meaning as aside - something that a character in a play says to the audience, but which the other characters on stage are not intended to hear - perhaps longer than this one. But I don't find it on synonym dictionaries. Is it my illusion that I saw it?
Answer: A stage whisper.
n.
1. The conventional whisper of an actor, intended to be heard by the audience but supposedly inaudible to others on stage.
Answer: The meaning is not exactly the same but have you looked at "soliloquy"?
Comment: It would be helpful to include the definition and explain why you think it applies so that your answer can stand on its own without needing the reader to do more research.

synonym with 'aside'


Path connectedness of comb space

Question: I'm studying elementary topology and stumbled upon the comb space. It says in my notes that the comb space is "obviously" path connected, however I fail to see this. Of course I can create a path between every two points, but if I choose the points (0.5,0) and (0,0.5) I don't see how the function can be continuous at (0,0), which it has to pass through, as it's not a smooth transition.
I imagine my mistake is understanding what continuity really is in a topological space, but can't really put my finger in it.
Appreciate any help!
Comment: Doesn't the comb space contain the line segments from $(0,0)$ to $(1,0)$ and from $(0,0)$ to $(0,1)$? Isn't their union path-connected? Aren't your two points in this subset?
Comment: Your question suggests that you are confusing "continuous" with smooth. A path does not have to a smooth curve, since it doesn't have to be differentiable. Your intuitive sense that you can't have "sharp angles" isn't right, here.
Comment: It does, hence why I understand that I can create a path, I still fail to see why the function is continuous at (0,0)
Comment: Ahhh, my bad, I'm an idiot, yes, I somehow managed to confuse differentiability with continuity! Must be too early for math :)
Answer: If you want to define a path from $(\frac12, 0)$ to $(0, \frac12)$ you can just use parametrisations of the line segments via $(0,0)$: $p_1(t) = (1-t)(\frac12,0) + t(0,0) = (\frac12(1-t), 0)$ from $[0,1]$ to $X$, is clearly continuous, and the same holds for $p_2(t) = (1-t)(0,0) + t(0, \frac12) = (0,\frac12 t)$ from $[0,1]$ to $X$. Then we can combine these paths in the usual way:

$p(t) = p_1(2t) = (\frac12(1-2t), 0) = (\frac12-t, 0)$ for $0 \le t \le \frac12$.
$p(t) = p_2(2t-1) = (0, \frac12(2t-1))= (0,t-\frac12)$ for $\frac12 \le t \le 1$.

This is continuous by the glueing or pasting lemma: $p$ is defined on
two closed sets $[0,\frac12]$ and $[\frac12,1]$ separately by a continuous formula (composition of $t \to 2t$ on $[0,\frac12]$ and $p_1$ etc.) and coincide
with each other on the overlap $\{\frac12\}$, as $p(\frac12) = p_1(1) = p_2(0) = (0,0)$, which is needed to make this at all well-defined as a function. So $p$ is then in total a continuous function. There is no problem of continuity at $(0,0)$ at all, it's just the standard joining point of the two separate continuous paths in $X$.
Comment: See [here](https://math.stackexchange.com/q/838497/4280) for a proof of the pasting lemma. It's also in Munkres.

Path connectedness of comb space


Is there a tree whose branchs intertwine together?

Question: Is there a tree whose branches intertwine together? in the sense of forming braids and also if there are trees whose branches literally going through each other.
Answer: Not in any ordered sense - trees may produce crossing branches, but not to any particular shape. You're probably thinking of trees which have been shaped, pruned and trained, either by braiding, pleaching or other formations, to make certain forms. Information on pleaching is contained in this link https://www.gardenista.com/posts/gardening-101-pleaching/ but for more general tree shaping, this Wikipedia article names quite a few methods https://en.m.wikipedia.org/wiki/Tree_shaping
Answer: Ficus macrophylla, the strangler fig, grows aerial roots which naturally intergraft
See here https://en.m.wikipedia.org/wiki/Strangler_fig


Does Linux cut power to usb devices that consume too much power?

Question: If I short an Arduino, will Linux detect that something is wrong and dissable the port? The Mabook will display a warning and dissable the device.
Comment: It shouldn't be the kernel's responsibility.  The kernel only sees IRQs, and a short circuit would not send an IRQ interrupt.  The hardware should be capable of protecting from a short circuit (although that is often not true with customer grade hardware, you're likely to lose the USB port).
Answer: Short circuit protection is the role of the hardware in the USB interface. USB 2.0 s7.1.1 says

A USB transceiver is required to withstand a continuous short circuit of D+ and/or D- to VBUS, GND, other data line, or the cable shield at the connector, for a minimum of 24 hours without degradation.

Linux will report a short circuit if the USB transceiver hardware reports that condition to Linux. See source/drivers/usb/core/hub.c:port_event(). In this case Linux avoids sending data to the port for 0.1 to 0.5s in order to give a short-term even time to dissipate and disables the port if the over-current condition persists.
If you are developing USB hardware you might choose to use a USB powered hub (with over-current protection, see the USB attribute wHubCharacteristics) as a sacrificial device to protect your more expensive computer, rather than rely upon your computer's USB transceiver operating within specification. Note that in some USB designs overcurrent protection is implemented using a polyfuse and these have a limited number of triggering events and also can take some time to resume operation, presumably time you'd rather spend swapping in another hub and continuing to develop your device.
When a USB device is inserted Linux checks that the USB configurations proposed don't exceed the rated current for the port (see drivers/usb/core/generic.c:usb_choose_configuration()), but that's for non-error conditions where it can be assumed that devices don't draw more current than requested by their software.
Comment: Personally, I wouldn't use an expensive device like a MacBook for hardware development. Attach the hardware to a RaspberryPi or similar and SSH from the MacBook to the RPi. If you do let out the blue smole then the financial hit isn't much and you still have your development platform intact.


Why this question isn't closed?

Question: Invers laplace tranformation
I want to ask why this question isn't closed even though the user has not shown any work. I flagged this post 10 days before but still no action. Why is it so? I know many such question have been asked before but I want to know specifically why this post is not closed?
Comment: @GEdgar i don't have reputation for casting close votes however i hve raised many flags by which question have been closed
Comment: To add to what OP clarified, they did raise a "close" flag, not a "moderator attention" flag. This is the appropriate action at this level of reputation.
Comment: You should vote to close, not flag.  Our moderators are busy enough; it is up to the users to close bad questions.
Comment: @quid however the question was closed after I posted this question
Comment: Yes, because some saw it and closed it (including me). I'll write an answer to explain the situation in general terms.
Answer: The short is that nobody looked at the post (or maybe somebody looked but nobody took action). Why exactly this was the case is impossible to know.
The longer version.
First, to be clear, you did take the correct action, which was that you raised a "close" flag. This is the  equivalent  of voting to close for users that do not yet have that privilege. (By contrast, it would not be appropriate to raise a flag for moderation intervention.)
This action puts the question in the close review queue. There other users (not moderators) are asked to express their opinion. They can either add a vote to close, or vote that it should not be closed.
In the specific case neither happened for ten days. This is unusual. It's impossible to know why exactly it happened. But here are a few points.

There is a backlog of posts, because too few users review. Thus, some delay is expected but not that long.

The question only had rare tags and thus low visibility. Various users filter by tags.

The subject is a bit advanced. Some reviewers might not have felt comfortable to vote because of this.

Now what to do in such a case?
Beyond the obvious and non-satisfying to simply wait an option is what was already mentioned in a comment, namely to post in the chatroom CURED about the post. In this room various active users coordinate reviewing of posts.
You can go there, post a link to the question and say that you flagged to close it but the flag is still pending. But only do this after a reasonable waiting-period of a few days at least. In the current case it would have been appropriate. But do not do this right away or as a substitute for raising the flag to close.
In principle there are other ways to get more attention, like posting to meta or raising flags for moderator attention, but this is in general discouraged if the goal is merely to get a post closed.
Comment: If a question goes into the close review queue, and no one votes on it, does it stay in the queue indefinitely? or does it get automatically dropped from the queue after some period of time passes?
Comment: It gets dropped; but the mechanism is indirect. Votes and flags to close "age away"; this starts after 14 days (or earlier if there are many views) at a rate of one per day, or something close to that. Thus if nobody does something at some point there will simply be no more active votes or flags, and as a consequence the question leaves the queue (or maybe it would be better to say is not included anymore). This used to be different. See https://meta.stackexchange.com/questions/250223/age-close-votes-after-14-days-regardless-of-views-allowing-recasting

Why this question isn't closed?


Will the Sun rotate slower in red giant form?

Question: When the Sun runs out of hydrogen to fuse it will grow bigger in size and my question is does it rotate more slowly, like a spinning ice skater extending their arms to reduce angular velocity? What consequences will accompany with a slower dynamo (big ball of plasmas), such as more frequent solar flares or perhaps more dark spots?
Answer: Indeed conservation of angular momentum dictates that in a single star like the the Sun, rotation should be much slower when it becomes a red giant. This is because at the present time the Sun does not rotate at vastly different rates with depth, thus when it expands, the moment of inertia increases drastically and convection in the outer envelope will ensure that slow rotation is enforced throughout most of the star.
The consequence for magnetic activity will be that the Sun will become magnetically inactive (in relative terms - magnetic activity will not be absent, but its signatures will be much reduced when expressed as a fraction of the stellar luminosity) as a red giant, because dynamo-generated magnetic activity is strongly correlated with rotation rate.
In general it is found that giant stars are magnetically inactive and slowly rotating, but there are exceptions. If a star considerably more massive ($\sim 3-5M_{\odot}$) than the Sun evolves to become a giant it may have preserved a considerable amount of angular momentum, since such stars are not magnetically active on the main sequence and are unable to lose their angular momentum through a magnetised wind in the same way that a solar-type star does. Secondly, it is possible that some rapidly rotating giants (e.g. the FK Com stars) could be the result of mergers in binary systems or possibly even giant planet engulfment. In which case the angular momentum is from the binary system and these stars can be very magnetically active. Finally it is also found that giants in close binary systems (the RS CVn stars) can be fast-rotating and magnetically active because tidal locking in the binary system enforces rapid rotation. The FK Com and RS CVn stars manifest many signs of extreme magnetic activity - hot X-ray coronae, chromospheres, coverage of large fractions of the surface by cool starspots. We thus deduce that the difference between these and the vast majority of magnetically-inactive giants is their rapid rotation.
Comment: @KingLogic That is a good point. Planet engulfment  (for the Sun) won't take place until the asymptotic giant branch phase so considerably after it has become a red giant. The possibility of planet engulfment for other red giants is already mentioned.
Comment: Note-its angular momentum might increase because it has swallowed up some planets, asteroids, etc.


Mac Pro early 2009 FireWire problems

Question: I have an early 2009 Mac Pro and a FireWire audio interface that I haven't used in a couple of years. I just plugged it in to the Mac and nothing happens. The device doesn't get power, and even if I connect external power to the device the system still doesn't see it. I found an article online that said to try resetting the NVRAM. I did that but the problem still exists. This is the only FireWire device I have and I only have one cable, so I don't have a way of seeing if the problem is the device or the cable. Does anyone have any ideas about how to track down the problem? Is there some way I can see if the FireWire ports are functioning without a device? (I did try all 4 ports.)
Comment: Try [Apple Hardware Test (AHT)](https://support.apple.com/en-us/HT201257).  Hold the D key while booting from a powered off state with the AC adapter connected.  See if it gives you an error code and edit your question with the results.
Comment: I tried this several times and can't get anything to happen. I unplugged everything except my keyboard and monitor, shut down, started power up and held the D key right away. All I see is the gray screen and eventually the system boots as usual. Is there some trick to this?
Comment: Your hardware test software may be on Disk 2 of your OS X installation media.  Do you still have these available?
Answer: You can lookup connected FireWire devices in the Apple system profiler under Hardware > FireWire
Open the System Information or System Profiler app from the Utilities folder of your Applications folder. Or just hold down the Option key while choosing System Information or System Profiler from the Apple menu.
Most FireWire devices will show up out of the box. FireWire audio devices usually require additional third party driver software.
Comment: The device doesn't show up in System Information. To clarify, I've used this audio interface on this Mac before and the software for the device is still there. I'm running Yosemite now and was probably running Mavericks last time I used the device. I hadn't updated the driver software when I made my original post but I just did it and the behavior is the same. Also, even if if the device isn't recognized, shouldn't it at least be getting bus power? And shouldn't the system say that there's something there even if it doesn't have the right software?
Answer: Definitely check the driver for the interface. Download the most recent version from the website (the brand of interface i.e., Focusrite, Presonus, etc...). Hope this helps!
Comment: How would a device driver have anything to do with the device not getting power *connected to external power*?

Mac Pro early 2009 FireWire problems


Upgrading from Qgis 2.4 to 2.12 on Ubuntu 15.04

Question: This should be a simple question. On Ubuntu 15.04 how can I get Qgis upgraded from 2.4 to 2.12?
Comment: What version do you have in your repository? I do a 'sudo apt-get update && sudo apt-get upgrade' and I get the newest version from the QGIS repository (vs. the UBUNTUGIS repo...)
Answer: The Ubuntugis unstable ppa does not offer new versions of QGIS anymore.
So you have to add qgis.org to your repositories to get the newest versions.
See https://www.qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu for instructions.
Apart from editing the sources.list, you can use the Ubuntu Software Center to add the additional repositories as well.

I am using Linux Mint 17.3, and I added the ubuntugis ppa with
deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu trusty main
deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu trusty main

and qgis.org as additional repository:
deb http://qgis.org/ubuntugis trusty main

You would have to switch from trusty to vivid. Both need a key, in my case 314DF160 and D71472C4.
After that, run in a terminal
sudo apt-get clean
sudo apt-get update
sudo apt-cache policy qgis

and you should see what is installed and what you can upgrade to.
Comment: OK I have tried but adding 'deb http://qgis.org/ubuntugis/ vivid main' or 'deb http://qgis.org/debian/ vivid main' to my sources.list will still not pull down Qgis 2.12.
Comment: Did you miss the `http://`, the qgis keyring and maybe a restart?
Comment: The 'comment' editor hides the http:// but yes it was there. I tried the Lubuntu Software Center also. What **exactly** should I be entering as the full string? 'ppa'? 'deb'? 'ubuntu vivid'?
Comment: See my extended answer.
Answer: Here is how I did it. I found a page with a good link:
https://askubuntu.com/questions/645343/how-do-i-install-qgis-2-8-on-ubuntu-15-04
[EDITED SLIGHTLY]
To install the newest version of QGIS I added the QGIS repositories to my /etc/apt/sources.list file:
sudo leafpad /etc/apt/sources.list
and inserted these lines:
deb http://qgis.org/debian vivid main
deb-src http://qgis.org/debian vivid main
Remember to add the GPG keys as follows:
gpg --keyserver keyserver.ubuntu.com --recv 3FF5FFCAD71472C4
gpg --export --armor 3FF5FFCAD71472C4 | sudo apt-key add -
Then run:
sudo apt-get update
sudo apt-get install qgis python-qgis qgis-plugin-grass
This installed qgis 2.12.3-Lyon


The security level of secret share compared to homomorphic encryption

Question: I want to compare additive secret share to Paillier encryption. However, I haven't found out how to set the parameters in such a way that the security level is consistent. Additive secret share (explained in SecureML) just like this: $a_1 = a - a_0 \mod 2^l$
Comment: Please check the edits made to the post. Please format the question to the best of your abilities and re-read before posting.
Answer:
I haven't found out how to set the parameters in such a way that the security level is consistent.

The problem is that they can't be consistent; secret sharing will always score better on "cryptographical security" than Pallier, no matter what parameters you use.
With Pallier, if you have the ciphertext and the public key, one could recover the plaintext with enough computation.  If you chose the parameters (e.g. size of the modulus) well, this amount of computation is far more than what any realistic attacker could hope to achieve, however it will still be possible.
With secret share (of which additive secret sharing is one example), this is not true; if you have $t-1$ shares (where $t$ is the "threshold, that is, the number of shares you need to recover the secret - in your example, you would have $t=2$), and nothing else, you cannot learn anything about the secret.  This holds no matter how much computational resources you have - you literally don't have enough information.  To compare to Paillier, this would be as if you were asked to decrypt a ciphertext, but you weren't given the ciphertext.
Now, as for advice as to address your comparison, I would suggest setting your Paillier parameters to be infeasible to break by current adversaries - this might have $n$ to be perhaps 2048 bits (so $n^2$ would be 4096 bits).  While this won't be a true apples-to-apples comparison, it would be not unreasonable either in terms of practical security.


$X,Y$ be Banach , $T \in \mathcal B(X,Y)$ be onto ; then , for every sequence $y_n \to y \in Y$ , $\exists x_n \to x\in X$ s.t. $T(x_n)=y_n , T(x)=y$?

Question: Let $X,Y$ be Banach spaces , $T:X \to Y$ be a surjective continuous linear transformation , then is it true that for every convergent sequence $\{y_n\}$ in $Y$  , converging to $y \in Y$ , there exist a sequence $\{x_n\}$ in $X$ , converging to $x \in X$ , such that $T(x_n)=y_n , \forall n \in \mathbb N$ and $T(x)=y$ ?
Answer: If $T$ is onto, this is the open mapping theorem:
You first choose $x$ with $Tx=y$. Then you look at the images of small open balls around $x$. These images are open and contain $y$ and thus contain all but finitely many $y_n$. Hence, you can choose $x_n$ in the balls as needed.
Comment: Could you please expand a bit on this? Unfortunately I am not able to fill in all the details. I see that for any $B_r (x) \subset X$, the image $T (B_r(x)$ is open and $y \in T (B_r(x))$. Therefore, there exists an $\epsilon > 0$ such that $B_{\epsilon} (y) \subset T (B_r(x))$, but I do not see how to get the result from here.
Comment: Sure. You consider a sequence of such $r$. E.g., $r=\frac{1}{k}$. Once a $y_n$ is no longer in the image, you can allocate a $x_n$ from the last ball. If a $y_n$ is in all such images, you just take a $x_n$ from the ball with radius $\frac{1}{n}$. If it is in none of the images, you just allocate any $x_n$ from the preimage. Overall, for every $k$, all but finitely many $x_n$ are in the ball with radius $\frac{1}{k}$. Hence, $x_n \to x$.


Gravitional force

Question: Does the gravitation of Earth have a limit? when a body projected vertically with $v=11km/s$ (escape velocity) from Earth's surface does this means that it does not return back to Earth?
Answer: I assume this question is about classical mechanics. Therefore gravitational force doesn't have a limit.
According to conservation law of energy (P.S. Gravitational energy $E_p = -\frac{GMm}{r}$):
$\frac{1}{2}mv^2-\frac{GMm}{r}=0,\ when\ r\rightarrow\infty$
Therefore, the escape velocity is $v=\sqrt{\frac{2GM}{r}}$.
Comment: By the way, in general relativity, gravitational force transmits at the space of light. Therefore, it has a range of about 4.6 billion light years (since the Earth is 4.6 billion years old).
Comment: Really, there's a point when gravity from Earth was non-existent and then suddenly it is there? What about the mass from the gas nebula that the solar system came from? Doesn't that count? At 4.6 billion light years out, you can't determine that the gravity is from a planetary body, or a gas cloud; it would appear to be a point.
Answer: Yes, this is exactly the definition of the escape velocity.
I cannot remember the number for it, but I'll trust you that it is 11.
Either way, you derive this by doing an integral, where you take the final position at infinity. That is, you assume that the particle that you shoot up into the air/ space goes off forever and never comes back.
It follows from Classical Mechanics and Newtonian gravity, so
$$ {F} = m {a} = G\frac{Mm}{r^2} $$
Then we can write
$$ a = \frac{d^2x}{dt^2} = v \frac{dv}{dx} $$
So we can set up an integral over displacement to solve for velocity.
As regards you're first question, 'Does the gravitation of earth have a limit?', the answer would be no. By General Relativity, all of the 'stuff' (matter and energy) in the universe causes gravitational interactions with everything else. This gravitational interaction would propagate at the limiting speed to infinite distance (for a massless graviton), and so even when the particle is really really really ... really far away, the Earth can still be exchanging this gravitational interaction with the particle that we 'shot' out into space.
But we must make some assumptions to 'solve' the problem in the Classical case and come up with an escape velocity.
Of course, we can also say that since we observe the accelerating cosmic expansion of the universe, if that particle went so far away that it traveled hundreds of Mpc to a distant galaxy cluster, then the expansion would mean that it's distance to us would indeed keep getting larger.
But then we would need to know what the fate of the universe is, which we do not!
If, say, there will be a 'Big Crunch', as some people say, then everything in the universe would eventually come back to the same infinitesmial small point, and it would be correct to say that 'the particle are the Earth (or at least what would be left of it) are to be found at the same place'. I don't know if that's good enough for you to say that the particle 'came back' to the Earth.
But if the Cyclic Model of the universe is correct, such as in String Cosmology and Brane World Scenarios of cosmology, the universe does not actually contract, rather some extra dimensions do, so then there would not be the particle 'comming back'.
So in short, for your second question, yes.
For your first question, we don't know for sure what will happen!
Answer: In classical mechanics the gravitational force does not have a spacial limit, i.e. any mass no matter how far it is from the earth will experience its gravitational pull (and vice versa).
However, this does not mean that any object thrown into space will eventually return to earth. This is due to the fact, that the gravitational force on an object becomes smaller (proportionally to the square of the distance) as it moves further away from earth. So, if you shoot a mass away at a high enough velocity (for earth this is about 11 km/s as you mentioned), the decelerating gravitational force will decrease faster than the velocity of the mass. The mass will never stop decelerating but also never halt and return. It has thus "escaped" earth's gravitation.

Gravitional force