Should I add my current supervisor as the coauthor of my paper if I am going to transfer to a new university?

Question: I am transferring to a new university. And I found a new supervisor at another university. I have told this to my current advisor. But I am still staying at the current lab as the transfer procedure would take like two or three months.
During the two months, I have been collaborating with my new supervisor on the paper and using his experimental facilities remotely. The paper is now almost finished and then we are going to publish. I will consult with my current and future supervisor. But before that, I want to ask if there is a regulation about this.
Answer: Everyone who makes a sufficient contribution to your paper for authorship should be an author on your paper (and no one else).
It doesn't matter what institution they are at nor does anything else: everyone that contributes at a level appropriate for authorship is an author.
Standards for what contribution constitutes a sufficient contribution for authorship vary by field, and your plan to consult both your new and old advisor is a good one because part of their mentorship is in helping you make decisions about what governs authorship in your field.
Comment: Concise explanation, plus 1.
Answer: There don't seem to be regulations, as such, about authorship. There are, however, conventions that vary by field. There is also scientific honesty to consider. If your current supervisor contributed then s/he is likely someone eligible for authorship, otherwise it would be only by "courtesy" which is, itself, a problematic and possibly unethical practice.
However, the conventions in some fields are so strong that a student better not dare to break them.
Note that in some other fields, only the student would be an author and neither supervisor. But in those fields the supervisor probably doesn't provide a physical laboratory and all that goes with it. But acknowledgements are given for contributions in any case.
Consult someone in your own field that you can trust to let you know about the conventions and the strength with which they are "enforced."
However, also note, that if it is in accord with the conventions of your field, then including your current advisor, even with minimal contribution might be a valid political act if it advances your career in some way. Many would, of course, think this a terrible thing to do, but their fields likely have different conventions.
I assume that in the fields in which "authorship" is given away for little work, that readers of papers understand the situation pretty well and are less likely to be misled about who does the work than you might suppose. Thus, in a certain sense, you can also consider such things to be moot.
Answer:
During the two months, I have been collaborating with my new supervisor on the paper and using his experimental facilities remotely. The paper is now almost finished and then we are going to publish.

Assuming (as the above statement implies) that your current supervisor had no involvement commensurate with authorship, then this sounds like a clear-cut case that you should not add your current supervisor as an author. Adding him/her as an author would be unethical, because:

he/she did not do the work;
naming him/her as an author would imply his/her endorsement of the paper, which he/she may not have even read (and with which he/she may, in reality, disagree strongly or consider unsound); and
he she would be expected to be able to answer detailed questions about the paper, its methodology, and any underlying data (although a paper specifies a "corresponding author", a reader is entitled to expect any of the "authors" to be able to comment/present/lecture on it, and an author unable to do so would, quite rightly, suffer serious professional humiliation).


JSON.deserialize Array of Objects

Question: I'm trying use the Box 2.0 API which returns everything in JSON. This is great because I can use JSON.deserialize. I've run into one issue when getting the folder and file structure. Box returns it as an array of objects that can contain both files and folders. I'd like to have different Apex classes that represent files and folders, but can't figure out if it is possible to deserialize the JSON into these two different classes. The other option I have is to create a single class that is a superset of all fields. Here's a snippet of the JSON.
<code>{"item_collection": {
    "total_count": 2,
    "entries": [
        {
            "type": "folder",
            "id": "344470651",
            "sequence_id": "0",
            "etag": "0",
            "name": "Signed and returned by you"
        },
        {
            "type": "file",
            "id": "2778062467",
            "sequence_id": "0",
            "etag": "0",
            "sha1": "92da54134a52f3e264ab9ed346b3be95c9b2cdad",
            "name": "Welcome.pdf"
        }
    ]
}
</code>
Am I stuck doing the superset class or is there a way to get them split into separate classes?
Answer: Using the http://json2apex.herokuapp.com app developed by metadady and superfell was able to parse your JSON into apex class
<code>//
// Generated by JSON2Apex http://json2apex.herokuapp.com/
//

public class JSON2Apex {

    public Item_collection item_collection;

    public class Item_collection {
        public Integer total_count;
        public List<Entries> entries;
    }

    public class Entries {
        public String type;
        public String id;
        public String sequence_id;
        public String etag;
        public String name;
        public String sha1;
    }

    public static JSON2Apex parse(String json) {
        return (JSON2Apex) System.JSON.deserialize(json, JSON2Apex.class);
    }

    static testMethod void testParse() {
        String json = '{\"item_collection\": {'+
        '    \"total_count\": 2,'+
        '    \"entries\": ['+
        '        {'+
        '            \"type\": \"folder\",'+
        '            \"id\": \"344470651\",'+
        '            \"sequence_id\": \"0\",'+
        '            \"etag\": \"0\",'+
        '            \"name\": \"Signed and returned by you\"'+
        '        },'+
        '        {'+
        '            \"type\": \"file\",'+
        '            \"id\": \"2778062467\",'+
        '            \"sequence_id\": \"0\",'+
        '            \"etag\": \"0\",'+
        '            \"sha1\": \"92da54134a52f3e264ab9ed346b3be95c9b2cdad\",'+
        '            \"name\": \"Welcome.pdf\"'+
        '        }'+
        '    ]'+
        '}'+
        '}';
        JSON2Apex obj = parse(json);
        System.assert(obj != null);
    }
}
</code>
Please try and it does magic .Thanks to metadady and Superfell and whoever built this app on herouku platform
Once we have the List of Entries(List entries)you can separated by using the Type in an another list .
Comment: Yes, this is what I've done with the superset class. I was hoping for something a little more elegant. There's the potential that there are a lot Entries so looping through them to separate into Files and Folders is pretty resource intensive.
Answer: @Mohith Shrivastava, do you have the code of loop through item_colletion and entries to get the data after JSON2Apex obj = parse(json)?
Thanks in advance,

JSON.deserialize Array of Objects


Digital Circuits (GATE)

Question: For two input AND gate what will be the output if one input is 3.3v and other input is 5v?
Ref: VCC=5v, GND=0v.
Comment: What does the datasheet say?
Comment: What are your thoughts? What do you think might affect the output?
Comment: This is completely unanswerable without more information. Provide the specifications for the specific AND gate you have in mind.
Comment: Also, what logic standard? CMOS or TTL will give the same result for this particular question, but there are others out there: ECL, CML, ...
Answer: It depends entirely on what logic family the gate comes from.
If it's a TTL gate, the output will be high, because any input above about 0.8 V is considered high.
If it's an HC family CMOS gate, in principle there's no guarantee what the output will be. To be a valid high input, the voltage must be at least \$0.7 \times V_{dd}\$. Realistically, 3.3 V will always be effectively high, and the output will be high, but specifications like propagation delays will not be guaranteed.
If it's an ECL gate, 3.3 V is too low to be a valid logic high and the output will be low (low being a voltage between \$V_{cc}-1.95\$ and \$V_{cc}-1.63\$ for the MECL 10H family).
Of course there are many other logic families, so you should be sure you know which one you are using when trying to answer this kind of question.

Digital Circuits (GATE)


Discovering portals in rural areas

Question: I've explored Ingress in two places: Manhattan and rural New Hampshire. At least for leveling purposes, it was trivial to walk around Manhattan and interact with portals. How might one find portals in a less dense part of the world? At the moment, I'm limited to dragging the Ingress Intel Map around likely areas, but this is pretty inefficient and requires I zoom very far in to see unclaimed portals.
Answer: You can improve your odds on the Intel map slightly (and I agree that it's still a pain) by zooming in enough with the map's controls to show the portals that you want and then zooming out with your browser (eg this would be Ctrl-minus in Firefox) to make everything smaller.
Comment: Don't forget that doing this will load too much data and exploring the map will take too long if you do this in a dense area.
Answer: Post Offices, Libraries, and emergency services such as Fire Stations tend to have portals.
This doesn't give a lot of options, but it means that even a small town should have a few portals that will be easy to find.
Answer: First off you can always zoom to that area on the intel map and ask in faction chat - local players can tell you the best spots.
Otherwise, my best bets for higher portal density in rural areas are:
- Main Streets (and nearby 'downtown' areas)
- Colleges
- Parks and public gardens
- Larger Cemetaries with elaborate tombstones
- Larger Churches with multiple buildings
These are things you can usually pick out on Google Maps and then lookup on Intel.
For unclaimed portals in 1s and 2s use Google Maps to find Churches, Post Offices, and Libaries.  Those are either going to have portals or be good for you to submit.
You could always drive around and see what pops up on the scanner too.

Discovering portals in rural areas


Why is the term "aboriginal" never applied to Native Americans?

Question: It seems that the term is almost exclusively used to describe pre-colonial Australians, but most definitions that I found don't specify any given ethnicity.
Comment: This isn't an answer, but the premise of the question is not quite true. Firstly, anthropologists use the terms "aboriginal" and the similar "autochthonous" much more widely than the layman, and I think you could find reference for "aboriginal North/South Americans". A second problem is, there are some genetically, ethnically, and culturally quite distinct "Native American" & Inuit groups in N.A. They actually originate from different waves of immigration into the continent from Asia, and later mixed to varying degrees. So who was the "first" (i.e. aboriginal)?
Comment: @Mari-LouA Most "why" questions that try to puzzle out "reasons" for historical language choices are a bad fit for the Stack Exchange Q&A format. Like most **autochthonous** peoples, our **Indians** go by various names depending on the context and tradition of that people and of those mentioning them. You are unlikely to find a good answer for why some people call one set of **indigènes** one thing and a different set another thing. Do keep in mind that that all these words for **natives** are exonyms unchosen by that particular people, just something others call them.
Comment: America is also a huge continent, it includes all the countries in Latin America as well as North America. So precisely *which* native Americans?
Comment: @Mari-LouA The term *Native American* really does refer to indigenous peoples who settled (or were resettled) within the boundaries of the United States; the current preferred term in Canada is *First Nations* (to distinguish the Eskimos and Métis from other aboriginal peoples). Moreover, the English-speaking world, to my knowledge, usually counts two continents in the Western Hemisphere, not one.
Comment: Perhaps FracturedRetina could include some of their research, and provide support that *aboriginal* is used exclusively towards the indigenes of Australia. Because I don't believe that is the case, I have heard of [Canadian aboriginals](https://www.google.co.uk/#q=Canadian+aboriginals&*).
Comment: Noldorin beat me to it.  There's a meaning of who was there at the time you arrived vs. who has been there for a very long time (all or most of recorded history) vs. who were the original humans there.
Comment: I have most certainly seen the term applied to "American Indians", though not recently.  Probably back in the 60s and 70s, before "Native Americans" gained traction.  There has been an ongoing struggle since perhaps 1955 to come up with satisfactory terms for both "Native Americans" and "African Americans" that satisfy a reasonable majority of the parties needing a term.  I suspect we're not there yet.
Comment: I'm voting to close this question as off-topic because it is based on the presumption that "aboriginal" is never applied to Native Americans.
Comment: @choster That's a perspective which is somewhat dependent on language, culture, and continent. To many Europeans, *America* refers to the entire New World. In that vein, people speaking Spanish and Portuguese also commonly refer to American abos as  *indios/índios*, no matter whether you're on the Navajo Nation or deep in the Amazon jungle.
Answer: This is more a matter of custom, fashion and etiquette than meaning.
Native American means per M-W:

a member of any of the indigenous peoples of the western hemisphere;
especially :  a Native American of North America and especially the
U.S. — compare American Indian

"Native American" while the preferred usage is potentially ambiguous particularly is varied for example to "Native Coloradan" which can refer without capitalization to someone born in Colorado, but with capitalization to someone who is a Native American who lives in Colorado.
Also, the term Native standing alone rather than qualified to refer to indigenous people is often considered mildly derogatory. Hence one would avoid saying: "The natives consider corn, beans and squash their traditional foods."
American Indian is a mildly outdated term that means more or less exactly what Native American does.
There can be dispute over whether the indigenous people of Hawaii or Alaska count as "Native American" (they do not for U.S. Census Bureau purpose), and it would actually be quite rare to refer to people who are indigenous to the Americas south of the United States as "Native Americans" unless they are part of a tribe or culture that existed both to the North and to the South of the current Mexican border.
According to the U.S. Census Bureau for the most recent 2010 Census (the definitions of racial and ethnic categories have shifted somewhat in almost every census):

The concept of race is separate from the concept of Hispanic
origin. Percentages for the various race categories add to 100
percent, and should not be combined with the percent Hispanic.
White. A person having origins in any of the original peoples of Europe, the Middle East, or North Africa. It includes people who
indicate their race as "White" or report entries such as Irish,
German, Italian, Lebanese, Arab, Moroccan, or Caucasian.
Black or African American. A person having origins in any of the Black racial groups of Africa. It includes people who indicate their
race as "Black, African Am., or Negro"; or report entries such as
African American, Kenyan, Nigerian, or Haitian.
American Indian and Alaska Native. A person having origins in any of the original peoples of North and South America (including Central
America) and who maintains tribal affiliation or community attachment.
This category includes people who indicate their race as "American
Indian or Alaska Native" or report entries such as Navajo, Blackfeet,
Inupiat, Yup'ik, or Central American Indian groups or South American
Indian groups.
Asian. A person having origins in any of the original peoples of the Far East, Southeast Asia, or the Indian subcontinent including,
for example, Cambodia, China, India, Japan, Korea, Malaysia, Pakistan,
the Philippine Islands, Thailand, and Vietnam. It includes people who
indicate their race as "Asian Indian," "Chinese," "Filipino,"
"Korean," "Japanese," "Vietnamese," and "Other Asian" or provide other
detailed Asian responses.
Native Hawaiian and Other Pacific Islander. A person having origins in any of the original peoples of Hawaii, Guam, Samoa, or
other Pacific Islands. It includes people who indicate their race as
"Native Hawaiian," "Guamanian or Chamorro," "Samoan," and "Other
Pacific Islander" or provide other detailed Pacific Islander
responses.
Two or more races. People may have chosen to provide two or more races either by checking two or more race response check boxes, by
providing multiple responses, or by some combination of check boxes
and other responses.

Despite this guidance, empirically, the vast majority of Hispanic people who are Mestizo (see below) report their race as "Other" rather than "Two or more races" listing both European and Native American as the Census Bureau which the Census Bureau would usually consider to be correct.
As noted in the comments, the term First Nations is the preferred term for the indigenous peoples of Canada who are not Inuits or other indigenous Arctic people.
Historically, Inuits were called Eskimos (although Inuit is a somewhat more exclusive term than Eskimo that excludes the indigenous people of the Aleutian Islands of Alaska also known as Native Alaskans. Eskimo is a term that has fallen out of favor for no obvious reason other than that this is not what members of that group of people call themselves, and not because Eskimo was particularly derogatory when it was in use. The historical archaeological culture that was ancestral to and is in continuity the modern Inuit is called the Thule (the Thule are not Paleo-Eskimos).
Arctic peoples of Canada and Alaska who have since died out and been replaced by Inuits are still called Paleo-Eskimos in the academic literature and sometimes even in the popular press without offense (in general, offending a group of people who have died out tends to be harder to do than offending a group of people who still have living representatives). Paleo-Eskimos would include the Dorset archaeological culture and the Saqqaq cultures of Arctic North America.
Latin America has its own set of terms to describe persons of indigenous or partially indigenous origins, the most important of which is Mestizo which means a person of combined European and indigenous American (also called Amerindian descent). Many people use the word Hispanic not in the sense defined by the U.S. Census Bureau but to refer to someone who appears to be Mestizo.
"Aboriginal", "indigenous" and "autochthonous" have very similar meanings.
indigenous is used in both technical and non-technical writing and has fewer connotations than most other terms of the type. It means per M-W in the relevant sense of the word:

1:  produced, growing, living, or occurring naturally in a particular
region or environment * indigenous plants * the indigenous culture

Aboriginal is usually used in common speech and capitalized to refer to indigenous Australians or by anthropologists in a mildly outdated choice of words to refer to indigenous people. It means per M-W:

1:  being the first or earliest known of its kind present in a region *
aboriginal forests * aboriginal rocks
2:  of or relating to the people who have been in a region from the
earliest time :  of or relating to aborigines * aboriginal languages *
aboriginal tribes/customs/art; specifically, often capitalized :  of
or relating to the indigenous peoples of Australia

autochthonous is almost always used as a technical term by anthropologists. It means when referring to people per M-W:

1:  indigenous, native * an autochthonous people * autochthonous plants

In some cases, anthropologists will use the term autochthonous to distinguish, for example, between indigenous people of the Americas who are descended from the founding population of the Americas, and indigenous people of the Americas who arrived many thousands of years later such as the Thule and Paleo-Eskimos, in the context of a discussion of the arrival of the later arriving groups.
Similarly, in some contexts, a person of Bantu ethnicity in Southern Africa might be called indigenous or autochthonous (e.g. relative to Europeans and migrants from China and India) even though in other contexts that term might be reserved to the Khoisan (a.k.a. Bushman) people who resided in a particular part of Africa until the Bantu migration reached that part of Africa ca. 1000 BCE.
Why?
Some of the distaste for the use of the word "Aboriginal" comes from the historical extreme level of prejudice that was suffered by Aboriginal Australians which Native Americans and others do not wish to be associated with and which carries a lot of historical baggage.
It can be compared to the terms "Idiot" or "Moron" which at one point in term were technical terms to refer to individuals in particular low IQ ranges but developed a derogatory sense and as a result came to be disfavored.
Prior to "Native American" the common term to refer to indigenous people of the United States was "Indian" (and it remains the correct term of art in U.S. law relating to Native Americans).
But, in addition to being ambiguous (because the term "Indian" means both person from India and Native American), it was also developing a moderate derogatory sense and was increasingly not a term that Native Americans felt comfortable applying to themselves. The term "indigenous" or "aboriginal" was never in wide use to refer to Native Americans outside of anthropology circles.
In part, this happened because the concept of "indigenous peoples" was not well developed at the time of first contact with Columbus and early European settlers of the Americas when the indigenous people of the America were Christened "Indians", but by the time that contact between the English and Aboriginal Australians was initiated, the more general concept of an "indigenous" or "Aboriginal" people was better established.
Unlike, Inuit, however, "Native American" was never a self-referential term of these peoples for themselves, and unlike Inuit it is a grouping of a variety of peoples rather than to a single coherent ethnicity and identity. Generally, a Native American is a Sioux or Apache or Navajo or Ute first, and a Native American second.
Comment: Please note the statement: "Prior to "Native American" the common term to refer to indigenous people of the United States was "Indian" (and it remains the correct term of art in U.S. law relating to Native Americans)." Hence, the Bureau of Indian Affairs and legal terms like "Indian Country." American Indian is another way to resolve the ambiguity in the word "Indian" standing alone (which was less of a big deal when people from Indian figured less prominently in American life).
Comment: Please don't tell the [Bureau of Indian Affairs](https://www.bia.gov/WhoWeAre/BIA/). Nor the Indians.


Throttle position as a function of engine torque and speed

Question: In the figure attached showing the throttle position versus an IC engine produced torque, I didn't understand why does the torque value at a specific rpm vary for different throttle positions. My knowledge for these curves is that the torque actually increases due to more air-fuel mixture entering the chamber. now if we took the 20% throttle position from the graph, or any other percent, we can see that the torque is increasing;but how does that happen when the amount of air-fuel mixture is held fixed (ie : the throttle opening is fixed at (20% for example); and thus the air-fuel mixture entering the combustion chamber is fixed and predetermined by this percentage. Then how would the torque value increase? unless of course we vary the throttle position?
Comment: I think your title may be backwards. Torque and speed would be a functon of throttle position. (Throttle position would be the "input to the functon".)
Comment: My 1985 Nissan 300 ZX had an electronic dash that produced this graph ( Hp , RPM, throttle position) in real time. It was pretty interesting.
Answer:
why does the torque value at a specific rpm vary for different throttle positions

This is the difference in acceleration when you fully open the throttle versus open it part-way.  For a spark-ignition engine, if you open the throttle more, you let in more air, and so you can also apply more fuel.  A carbuerator does this automatically by adding more fuel according to the air flow through it.  A modern electronic engine measures the air flow and injects proportionally more fuel.  More fuel equals more energy, more torque, and more power.  A compression ignition (diesel) engine doesn't actually have a throttle, the air charge is the same and more fuel is applied as you press the accelerator pedal.

now if we took the 20% throttle position from the graph, or any other percent, we can see that the torque is increasing;but how does that happen when the amount of air-fuel mixture is held fixed

The air isn't really fixed, only the throttle valve position is fixed.  The throttle valve is just a block to the inlet of the engine.  Wide open throttle means minimal blockage.  A higher RPM engine pulls more vacuum at the intake which pulls in more air (and thus more fuel is added).  Combustion produces more and more energy at higher RPM, but losses add up until they overcome the increase in torque, and less is then available to do work.
Answer: Regardless of the position of the throttle if the torque demand ( total torque load on the engine, eg, torque from the wheels and drive train sum of frictions), is less than the available torque, the engine will rev up and more RPM means more fuel, more torque!
Vice versa, if the torque demand is more than available torque the RPM will decrease, regardless of the throttle position, and the engine torque will decrease!
Answer: just my opinion it has to do with inertia opening the throttle allows air to fill the manifold and slug the closed valve and reverse direction when the valve opens it is fighting the inertia of the reverse charge and still has to fill the cylinder partial throttle angle vs rpm allows the runner to fill until the intake valve opens and the inertia helps fill the cylinder until piston speed increases like a merry go round if you get it spinning it has inertia so if you pull hard it gets moving and after its moving its storing energy that throws you and breaks your spine and everyone laughs
Comment: Without any punctuation in the answer, it is difficult to understand what you mean. Could you please edit your answer to include punctuation?
Answer: The Torque/Speed curves (T vs w) are generated for a specific throttle position.  IC Engines don't make T very well at low w.  It's physics; The pistons need to draw in the fuel-air mixture.  (e.g., to hold constant T at w = 0 would mean the valves seal perfectly and theirs no blow-by the rings.  Need to get fuel/air in and exhaust out.  4-stroke.)  This is why T is increasing with RPM for ICE/Otto Cycle.
So, the basic shape is a T vs w curve that rises to a peak T value, then levels off and/or decreases.  (An electric motor curve is down sloping due to back EMF (and other effects depending on control.)


Drupal Services OAuth

Question: I have been working on this issue for a couple weeks now, and I can't find a solution for the life of me. The fact that I have found no decent documentation (on Drupal's website, or anywhere else) is no help either. And the questions already on here are outdated (Services 2.x).
I'm trying to create a REST service for a Drupal Commerce backed site. For now all the service must do is allow for basic CRUD operations on the Order resource, and be secured with OAuth, OAuth 2.0 isn't necessary. It must also be called with a script on a server, so login re-directs are impossible (everything is done with 2-legged authentication).
The current stack is:

PHP 5.3.15
Drupal 7.15
Commerce Kickstart profile (7.x-2.0-rc1)
Services 7.x-3.2
OAuth 7.x-3.0+18-dev
OAuth Authentication 7.x-3.2
REST Server 7.x-3.2
Commerce Services 7.x-1.x-dev (This is the module I have added my custom Order code to)

I can kind of get the Retrieve/Index functions to work for Orders if I use an OAuth PHP library and just call the token request every time (I'm not even sure what's going on there, except that it authenticates...). If I try to POST to Orders and create an order though, I get 406 with the script, and 401 when I try a direct POST request from the REST Console in Google Chrome, even when OAuth is disabled.
This has made debugging a nightmare since I have no idea what's going on inside my create function. I tried stripping it of its order creation logic and just echo back the request payload. Still get the 406/401 errors.
I assume I get the 401 errors because orders require a user authentication (even if OAuth is turned off for the service).
I don't understand why I'm getting the 406 errors though. I accept application/json, which is what my REST server is set to return.
Orders were not being created even before I commented out the order creation logic. (Which I use elsewhere in the site effectively.)
Appreciation in advance.
-T
Comment: In the past few months the services module has been updated so that you are required to send a token in the header for all POST, PUT, and DELETE requests.  Make sure this is not the issue you're having: https://drupal.org/node/2013781
This does not affect GET requests.
Comment: I suggest checking out [RESTws](https://www.drupal.org/project/restws), this will be in D8 core.
Answer: Get requests did not need session authentication, POST, PUT, DELETE require session authentication to know the user and check if he has right permissions to complete the request or not.
Oauth authentication have many types of auth you must ensure that you are authentication the user not the an app (for example) so the request is authorized to complete.

Drupal Services OAuth


Updating Multiselect Picklist based on the value of another multi picklist

Question: There are two multiselect picklist values in our org.Say, SalesOrg and Division.I want to update the first value of division picklist based on the first value of salesorg picklist.Is it possible to auto update that way using process builder,workflow or trigger?
Answer: Yes, You can update the Second Multi Pick list Values based on First Multi Pick list Value using Process Builder.
Step 1 : Set the condition based on the Value from Multi pick list One

Step 2: Use the Update Records action and set the Second Multi Pick list Values


Tesseract OCR to PAGE

Question: The tool Tesseract OCR to PAGE located here is a Windows tool to run tesseract and output a file in page format (an xml file that contains structural information about the document). Do you know of any mac version of this kind of tool?
This question is linked to my previous: How do I segment a document then output bounding boxes and labels using tesseract
Answer: You can run this tool using wine an example is included in my answer to the question linked in the question.

Tesseract OCR to PAGE


hadoop RC file format : merge small files in hdfs

Question: I am seeking for way of combining small RC files generated by Map-reduce program.
What is best of going merge of small RC files to large one RC files.
Answer: You can try getmerge command . This takes a source directory and a destination file as input and concatenates files in source directory into the destination file.
Example , if Hive table name is search_combined_rc, you can get the combined rc file into a single file.
hadoop fs -getmerge /user/hive/warehouse/dev.db/search_combined_rc/ /localdata/destinationfilename
Since RCFile's cannot be opened with the tools that open typical sequence files, you can try using rcfilecat tool to display the contents of RCFiles. you need to move back the file from local directory to HDFS.
hive --service rcfilecat /hdfsfilelocation
Comment: did this work? I think there may be another way where you can have all  in one file by setting the number of reducer 1 .


Are Truffula Trees copyrighted?

Question: If I intend to use a Truffula Tree (from Dr. Seuss' The Lorax) in a logo design for a company, would that be breaking copyright laws?
Comment: This question appears to be off-topic because it is about legal matters, not design.
Answer: Expanding on bemdesign's answer: even if it were legal you would  not want to use somebody else's concept/artwork as your logo. It would make it hard to enforce as your own trademark/brand.
Answer: As this is a legal question and as we are not your lawyer and finally as the answer can vary by location (different laws) - this question is unanswerable by us here at StackExchange.
All this being said, if you ever find yourself asking "Is this legal?", it's usually a good sign to rethink your current design and try to come up with something better.

Are Truffula Trees copyrighted?


Regional language not working on google chrome only

Question: I had installed malayalam language keyboard (from keyboard layout settings in systemsettings) in Ubuntu on my Dell laptop. and I can type malayalm language in any window or application except google chrome. so i cant search a word in malayalam directly.. Is there any settings to change.. Please help
Comment: malayalam, is this a typo ? Do you mean Malaysian
Comment: @markkirby Malayalam is the language spoken in the Indian state of Kerala.
Answer: PLease follow these instructions to set Keyboard in Chorome

Wrench Icon > Options > Under the Hood > Change font and language
  setting (under Web Content) > Languages(Tab) > Do these settings:

1. Add > malayalam > OK
2. Click on malayalam and move it up.

There is no Malayalam spell check by default, however you can install an extension from the chrome web store, just search for Malayalam Dictionary or click here this might help ?
Or with some more reserch I found this

To add a new language and dictionary to Chrome, do the following:
Load chrome://settings/languages directly in the web browser by
  pasting it into the address bar and hitting enter afterwards.
Or click on the Hamburger button located on the top right, select
  Settings, then Show advanced settings, and there language and input
  settings.
The languages menu displays all installed languages. You can only
  install spell checking support for languages that are installed in the
  browser, so click on add first on the screen to add another language
  to Chrome.


django payment gateway

Question: I require a simplest payment gateway in which user comes in click on buy button enters his card details and whatever the process includes to generate a reciept i want in a very simple manner.i have searched alot but i am not able to understand i am trying to understand paypal..
please suggest me a simplest payment gateway in django.I am developing a project and i am stuck very badly in it.
Thanks in advance
Answer: simplest? If you require custom amounts - paypal it is. Read this: http://uswaretech.com/blog/2008/11/using-paypal-with-django/ or https://github.com/johnboxall/django-paypal
If you require even simpler way and you don't care about strict payments amounts and still want easy donations, use flattr, then all you will need to do is to add facebook/digg-like button. More: https://flattr.com

django payment gateway


Is using gravitational manipulation to reverse one's center of gravity to walk on ceilings plausible?( in a fictional sense)

Question: While brainstorming for my story I thought of a character utilizing their gravity-controlling ability to "flip" their center of gravity and walking on the ceiling/street pole /side-of-skyscraper as if it were the ground. (less Spider-Man and more Inception). Essentially up would become down, and I'd like to know if that makes any sense. If not what would? Since I'm relatively new to writing, I'd like a more experienced writer's point of view on how such an ability should work.
Comment: Sanderson's Stormlight Archive series has some characters that can temporarily (until energy runs out) modify the 'down' direction for themselves or others.   They can also do it fractionally, so that the weight of someone/something can be partially or completely negated without causing it to float away.  It that what you are looking for?
Comment: You cannot flip the centre of gravity! It is a point and it has no direction. Flipping it will do absolutely nothing. You want to flip the direction of gravity rather.
Comment: Hi Meek, I noticed you've accepted 3 different answers to this post so far. Generally, it's best to wait at least a few days before accepting an answer, as you can then select the one you consider best, while also allowing other people more time to provide answers of their own.
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comment: H.G.Wells did something like this in his (rather silly) short story 'The Truth about Pyecraft'. The physics can't possibly work, but it is still a good read.
Comment: FYI have you heard of an old game called inversion, they have a mechanic like this maybe reading or looking at that could server as some reference for you
Comment: Hirohiko Araki did exactly what you're saying with Enrico Pucci's '[C-MOON](https://jojowiki.com/C-MOON#Gravity_Shift)' in Part 6 JoJo's Bizarre Adventure, and it was nothing short of awesome, so I wouldn't give it much more thought. Just go with it and it'll be great, I'm sure.
Comment: There is no way to shield gravity in real-life that we know of.  Maybe anti-matter could work but that has other issues!  What is acceptable in fiction is of course up to the fans.  If some magnetization were involved, it would appear more realistic.
Comment: @stackoverblown: Flipping the mass to be negative would work, but would probably also have some other side effects too.
Answer: Fictional sense
From a fictional sense, anything can make sense. It's called suspension of disbelief. Where normal sunlight hitting an incredibly efficient 1m² solar panel can't run a computer, it can somehow power Superman to move faster than light, punch through walls, and fire miniature copies of himself (yes, really). It only has to make some fictional sense in the universe you create.
Flipping your own center of gravity might seem like a solution, but if we look at it technically, it falls apart. Your center of gravity is a dot, which can move, but that will not matter. Even if it flips compared to your body it might be around your waist at first and at your neck after, making you only top heavy.
But assuming you mean the gravitational pull, then still no. Let's surmise you flip your own pull of gravity, basically becoming a push. The Earth's gravitational pull hasn't changed and is much, much stronger. Just compare the mass of you to the Earth for a quick reference, as more mass has more gravity. You'll only succeed in becoming trivially lighter. It can be imagined as having a concrete slab twice your weight floating above you. Sure, it "negates" the pull of your own body toward the ground, but the Earth has so much gravity to spare it's negligible.
Let's say you flip gravity itself for just yourself. You could walk on ceilings, as the ceiling is directly opposite the Earth, but flipping it to the wall will be met by maybe some gentle floating. What is powering the gravity that pushes you into the wall? There is no Earth-sized object to push from or pull from.
That all being said, if you just say someone can decide what direction the available gravity pulls them in, no one will bat an eye. It makes fictional sense. You have the gravity of the Earth pulling you down, so now they decided it is going sideways to a wall instead. Are they in space? Different pull from some celestial bodies. As long as it makes just a lick of sense, no one will care.
Comment: I have not done the math, but i am pretty sure if you make a gravitational field above you with a pull of 9.81m/s² on a local scale (i.e the field is just a few meters across at most), that will rip you apart. If it is a point mass, you have just make a black hole. If it is a spherical mass, the Gravitational pull on the surface would be insane as well.

But again, not sure if exactly
Comment: It may be worth noting that we can ruin this effect if we try too hard to explain what's happening.  As you explain, if the author just says someone can change which direction gravity pulls them, then fine, it's magic.  It does whatever the author says it does.  But if the author then continues from there to say the power works by flipping the character's center of gravity, now they've invited some portion of the audience to say "wait, what?  that's not how center of gravity works at all."
Comment: @ErikHall that would mean adding a whole Earth floating above your head. I'm talking about cancelling out the gravity that your own body makes. That is so insignificant we can disregard it compared to the Earth, so messing with it will result in a net zero. If you mess with the gravity of the Earth instead of your own you have bigger problems.
Comment: If gravity manipulation can somehow make your mass *negative*, then the earth's gravitational field would push you away.
Answer: Either you modify the gravitational field locally so it points upwards.. but that will make anything caught in that area fall upwards.
Or you flip the mass of the hero to negative. Only the gravitational mass, otherwise things get REALLY funky.
In either case, walking on ceilings will be the least interesting effect by a large margin. In both cases he could go to space with no effort (dont forget the space suit though) and also function as a perpetuum mobile. You could get around that by stating he somehow takes energy for the flipping from some, very very large, reservoire wich eventually will get depleted if he does physical work with his ability.
Also in the second case his sh*t (when "flipped") will probably be the most valuable substance in the known universe.
I think the best way to deal with this if you "just" want ceiling-walking without all the physical consequences, is to don't overthink it and mostly ignore physics. Or make it a dream like inception, so logic and physics do not need to apply.
Comment: Awesome answer. The hero having negative mass makes a lot more sense than having a "flipped centre of mass". However I think it could be fun if both phrasings were used in the story, by different characters, and one of the characters maybe being annoyed when people say "flipped centre of mass" and telling them "no!! that's not how this works!! this phrasing doesn't make sense!" but people are still going to call it that.
Comment: In most homes, wouldn't the sheetrock be so thin you'd anti-fall right through it? Commercial buildings aren't much better, in the US at least you see alot of ceiling tiles, and those aren't even fastened.
Comment: Thank you! For clarification's sake, my story is set in a  hero world, so the ability would be used for traversal( i e "hopping" from building to building and shifting one Center of mass on the Fly)I will simply using ceiling crawling as an example. In practice the hero would be able to do this on a virtually anything. As for space travel with this, that does sound super cool.
Comment: @JohnO Yeah, most public buildings have a very thin "fake ceiling" in every room, slightly below the true ceiling of the room, whose main purpose is hiding all the stuff that's on the ceiling, including pipes and wires. That thing would completely break if someone was to anti-walk on it, not to mention anti-fall from ground height.
Answer: I sense some confusion in your wording.
First of all, as explained in other answers, on a purely scientific base, gravity cannot be inverted. However, one can go with negative mass and have a repulsive gravity, which pushes up instead of pulling down, and sprinkle it with a good dose of suspension of disbelief. Wells' The first man in the Moon and its Cavorite is probably an egregious example for this.
But... you can't reverse one's center of gravity. By its definition

The center of mass is the unique point at the center of a distribution of mass in space that has the property that the weighted position vectors relative to this point sum to zero. In analogy to statistics, the center of mass is the mean location of a distribution of mass in space.

The center of mass of a distribution of positive masses is the same as that of the same distribution but with negative masses.
Comment: @Meek just say "negative mass" and it'll make sense. See how magnets can have a positive or negative charge, and inverting the charge changes the direction of the force, from repulsion to attraction and vice versa? Gravity doesn't have an equivalent of that, all masses are positive numbers, but in fiction you can totally decide that the hero suddenly has "negative mass" and everyone will understand that he's now repulsed by gravity instead of being attracted.
Comment: Well in this scenario, it's purely fictional, but I'd like to have a certain level of realism. The characters' ability would allow them to manipulate the Earth's gravitational pull. Specifically, they can reverse, increase or negate the effects of gravity on themselves or others by touch. Would it be feasible then? I apologize for my ignorance.
Answer: This is a fun twist of science that the masters of science fiction take advantage of.  The world does not obey our physical laws.  We construct our physical laws to mirror the world around us.  So if some characters can walk on the ceiling, the reason they can do so is because they can walk on the ceiling.  There's nothing about centers of masses or gravities or anything like that.  It's simply the thing that is done.
Now we do like to come up with the wordings for our laws.  We want to have a law like "If one does XYZ, one's center of gravity is flipped."  But the crucial thing is that we invent those wordings, not the world.  They're phrases for our benefit as human beings.  The world doesn't care.
And this leads to interesting directions because we get to consider who is coming up with these terms.  As many of the answers have pointed out, the center of gravity is a point, with no orientation, so in the strictest physics-textbook sense, the center of gravity cannot "flip."  You need an orientation to flip.  So its unlikely that a group of people with a solid physics background would use that phrasing first.   They'd try others.
For instance, many of the answers have suggested making the individual have "negative mass."  Would that fit the story better?  If a thing had negative mass, all forces would accelerate it in the "wrong" direction.  This includes the object being pushed.  If the object is pushed around in the "right" direction, "negative mass" would really have to mean "negative gravitational mass."  There's "gravitational mass" and "inertial mass" and a standing curiosity in science is that, for some reason, gravitational mass and inertial mass are exactly the same.  We'd be unlikely to give up that convenience.
We could say that the force of gravity is inverted.  This would fit well with your description of gravity manipulations, and it's relatively easy to decouple from other effects.  This is a likely phrasing.
Its possible that the phrase was invented by non-physics majors.  They may have used the term "flip your center of gravity" just because it sounded good.  They may use the phrasing because it "feels right."  Maybe one of them is a skater and "flipping" fit well with their understanding of how skateboards move.
And its also possible that "flip your center of gravity" was indeed a physically accurate phrasing.  Physicists facing such a gravity manipulation ability would certainly plumb the secrets of this ability.  They may find that this is new physics and adapt new patterns to fit the predictions.  For instance, they may find that a center of mass is less of a point and more of a dipole, which is an abstraction that has an orientation and thus can "flip" (dipoles show up in magnetics).  Perhaps we have to recognize that there is a new spatial dimension within which a dipole can be flipped.
This is similar to what was done in the Saga of the Skolian Empire.  In that saga, there is faster-than-light travel.  They originally thought the world operated using our modern relativistic rules, where you cannot exceed the speed of light.  However, what they found was that velocity was not just a real number, it was complex.  "You cannot travel at the speed of light" became a singularity that you rotate around to get yourself into the faster-than-light regime.
Catherine Asaro builds a world full of physicists who explored this strange behavior for quite some time before deciding that complex numbers were the "correct" description of what was going on.  But remember, the world never cared about what we called it.  This use of math was simply what we used to make sense of the world.
Comment: I completely agree with all of your arguments about phrasing. However, being precise matters. If someone told me their power was specifically "walk on the ceiling", I'd immediately wonder: does this mean they can walk upside down with inverted gravity, or is there something special about *ceilings*? Could they walk upside down on a surface which is not a ceiling? I know that not everyone is bursting with questions like I am. And confusion can be fun too. Characters in the story might assume that the power works one way, but then in a later situation they're surprised because it doesn't.
Comment: And characters with different backgrounds would react differently. Maybe the hero can only walk upside down on ceilings, and not on other non-ceiling surfaces, and some characters find this totally logical, but a character with a more physics-oriented background would be surprised because they'd be trying to understand the hero's power in terms of reversed gravity, and that's not what it is.
Answer: It's not plausible that you could negate the force of gravity for one object and not other nearby objects. It would violate the equivalence principle, which guarantees that no property of any particular object affects how it moves under the influence of gravity. Even if you suppose that negative-mass objects are possible, general relativity predicts that they fall downward like everything else. (So does Newtonian gravity, for that matter.)
Reversing one's center of gravity doesn't make sense. From context, I think that when you say "center of gravity" you really mean mass.
Comment: 'Center of gravity' and 'center of mass' both mean the same thing, and neither makes sense in terms of 'reversing' it.
Comment: @GlenYates O guess benrg meant "reversing mass" (i.e. have something of negative mass). Though that is completely speculative physics.


How to access lists of a sub-site in Sharepoint using web services?

Question: I'm experiencing problems when trying to access my sharepoint site using web services (on powershell) given the following configuration:

my site is located at https://sharepoint.company.tld/sites/siteid/
the WSDL was fetched from https://sharepoint.company.tld/_vti_bin/Lists.asmx (redirected from https://sharepoint.company.tld/sites/siteid/_vti_bin/Lists.asmx)

After building the web service DLL (following these steps), I do a
$list = New-Object Lists

and try to obtain a list by it's GUID (known to me):
$docs = $list.GetList("GUID-HERE")

This results in an exception:

Retrieving the list by it's name is the same.
Doing a $list.GetListCollection() returns me the lists known by https://sharepoint.company.tld and yes, my list is not amongst these. Only some lists containing webparts that shall be used for the real sites and similar stuff.
So, here's the question: Is there any way how I could tell the web services that they shall not access a list located under https://sharepoint.company.tld but to search my lists located at https://sharepoint.company.tld/sites/siteid/Lists?
Comment: If you paste full code, I can tell you exactly where you have to make the change
Answer: Check out this:
http://www.nivot.org/2008/02/29/ManipulatingRemoteSharePointListsWithPowerShell.aspx
You just need to set up Url property
$list.Url = "http://sharepoint/sites/root/subsite/_vti_bin/lists.asmx"


Which is faster/better for caching, File System or Memcached?

Question: I don't think it's clear to me yet, is it faster to read things from a file or from memcached?  Why?
Comment: You are going to have to get more specific, what are you data sets and access patterens, is this a local memchaced server or distibuted? what is the network access cost? how large is the information your are storing? what disks are you running?
Comment: Questions like these are better suited for http://superuser.com/
Comment: I don't know that much about the details, I guess in basic terms: simple setup, simple app, 1 memcache server, 100 files...
Answer: Memcached is faster, but the memory is limited. HDD is huge, but I/O is slow compared to memory. You should put the hottest things to memcached, and all the others can go to cache files.
(Or man up and invest some money into more memory like these guys :)
For some benchmarks see: Cache Performance Comparison (File, Memcached, Query Cache, APC)
In theory:
<code>Read 1 MB sequentially from memory       250,000 ns
Disk seek                             10,000,000 ns
</code>
http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf
Comment: The benchmarks you linked show the exact opposite of your statement - that Memcached is slower than reading from local disk. Could you clarify the discrepancies?
Comment: On my system which has a fast SSD, file cache is faster than memcached, but slightly slower than memory store.  Speed of disk will be a factor when using file store.  SSDs are great at accessing tons of small files with extremely fast seek time compared to HDD.
Answer: There are quite a few different aspects that might favour one or the other:

Do you need/want to share this data between multiple servers? The filesystem is local, memcached is accessed over a network.
How large are the items your caching? The filesystem is likely to be better for large objects.
How many memcached requests might be there per page? TCP connections and tear-downs might take up more time than a simple filesystem stat() on the local machine.

I would suggest you look at your use case and do some profiling of both approaches. If you can get away with using the filesystem then I would. Adding in memcached adds in another layer of complexity and potential points of failure (memcached client/server).
For what it's worth the other comments about disk vs memory performance might well be academic as if the filesystem data is being accessed regularly then it'll likely be sitting in OS or disk cache memory anyway.
Answer: "Faster" can not be used without context.
For example, accessing data in memcached on remote server can be "slower" due to network latency. In the other hand, reading data from remote server memory via 10Gb network can be "faster" than reading same data from local disk.
The main difference between caching on the filesystem and using memcached is that memcached is a complete caching solution. So there is LRU lists, expiration concept (data freshness), some high-level operations, like cas/inc/dec/append/prepend/replace.
Memcached is easy to deploy and monitor (how can we distinguish "cache" workload on filesystem from, let's say kernel? Can we calculate total amount of cached data? Data distribution? Capacity planning? And so on).
There are also some hybrid systems, like cachelot
Basically, it's memcached that can be embedded right into the application, so the cache would be accessible without any syscalls or network IO.
Answer: In fact, it is not as simple as that reading from memory is much faster than reading from HDD. As you known, Memcached is based on tcp connection, if you make connection each time you want to get sth or set sth to memcached server(that is most of programmers do), it proberly performs poorly than using file cache. You should use static Memcached object, and reuse the object. Secondly, the modern OS's will cached files that are frequently used, that makes file caches might be faster than memcaches which are actualy TCP connections.
Answer: Cache Type | Cache Gets/sec
Array Cache | 365000
APC Cache | 98000
File Cache | 27000
Memcached Cache (TCP/IP) | 12200
MySQL Query Cache (TCP/IP) | 9900
MySQL Query Cache (Unix Socket) | 13500
Selecting from table (TCP/IP) | 5100
Selecting from table (Unix Socket) | 7400
Source:
https://surniaulula.com/os/unix/memcached-vs-disk-cache/
Source of my source :)
https://www.percona.com/blog/2006/08/09/cache-performance-comparison/
Answer: You're being awefully vauge on the details. And I believe the answer your looking for depends on the situtation. To my knowledge very few things tend to be better than the other all the time.
Obviously it woudln't be faster to read things of the file system (assuming that it's a harddrive). Even a SDD will be noticably slower than in-memory reads. And the reason for that is that HDD/FileSystem is built for capacity not speed, while DDR memory is particulary fast for that reason.
Good caching means to keep frequently accessed parts in memory and the not so frequently accessed things on disk (persistent storage). That way the normal case would be vastly improved by your caching implementation. That's your goal. Make sure you have a good understanding of your ideal caching policy. That will require extensive benchmarking and testing.
Answer: It depends if the cache is stored locally.  Memcache can store data across a network, which isn't necessarily faster than a local disk.
Comment: checkout     - [ ] https://github.com/donnemartin/system-design-primer#latency-numbers-every-programmer-should-know
Answer: If that file is stored in disk, and it is accessed frequently, there will be a high probability of finding it in the RAM (as a recently accessed file) or I am missing something here?
Yes the first read will be from the disk which is awefully slow, but what about the subsequent reads (assuming that file is hot and its getting lots of reads) this should be even faster than memcached as this is a pure RAM read


How can I reduce sodium chloride levels in water, without removing other minerals?

Question: How can I reduce sodium chloride levels in water, without removing other minerals?
Good day,
I make a sole from Himalayan Salt which I add to my Reverse Osmosis treated water to ensure my body isn't rob of essential minerals, but the levels of sodium chloride are very high. How would I remove some of the NaCl without affecting the other minerals?
Comment: What you are asking is not possible using any conventional system that you would be able to obtain. Your only real solution is to take a different approach. Buy the individual salts (e.g., KCl, NaCl, CaCO3) and make a mixture yourself.
Comment: If you remove the NaCl from Himalayan salt there isn't much left.
Comment: Other than fluoride, drinking water is **not** a useful source of minerals. You get all you need from a normal diet. As for fluoride, most toothpastes and some mouthwashes contain supplements.
Answer: Removing a major component does not make sense. Better is to balance it with other ions, as $\ce{K+, Ca^2+, Mg^2+, HCO3-, H2PO4-, SO4^2- }$.
But the gain and safety to provide nutrients by the form of dissolved salts is questionable. I think, providing minor mineral nutrients by $\ce{NaCl}$ of whatever origin is a bad idea in the first place.


Does anybody know a physical explanation for the refractive index independence of the Sagnac Interferometer fringe shift?

Question: It is generally accepted that the fringe shift produced in a fiber optic Sagnac interferometer is independent of the refractive index of the fiber.  In fact, the waveguide aspect of the fiber is not of any consequence, the counter propagating beams may propagate in any dielectric medium. Does anybody know a physical explanation for this effect, other than the special relativistic (On the Experiment of F. Harress) or general relativistic (Sagnac Effect) explanations? It has been reported that(Modified Sagnac experiment for measuring traveltime difference between counter-propagating light beams in a uniformly moving fiber) the Sagnac effect is produced even when the moving path is effectively a straight line. This later configuration approximates an inertial frame, and with in an inertial frame one should not be able to measure one's state of motion!
Answer: In order for the refractive index to be of no concequence it must be the case that the refractive index has at least two effects, in such a way that they drop away against each other. As we know, the higher the refractive index, the slower the propagation of the light, and the wavelength is correspondingly smaller. That is: the frequency of the light is independent of the refractive index of the medium.
As we know, the frequency of the light comes into effect in the following way. The Sagnac device executes comparison of the amount of cycles of the counter-propagating light and the amount of cycles of the co-propagating light. if the counter-propagating light goes through half a cycle more than the co-propgating light the shift of the interference pattern will be half the distance between two lines of the interference pattern
I'm guessing that the refraction index effects drop away against each other in such a way that the difference in amount of cycles remains the same, whatever the refractive index of the medium.

Further reading:
The discussions of the Sagnac effect by Kevin Brown are very good, and quite accessible:
Sagnac and Fizeau
The Sagnac effect
For a deeper discussion than that I recommend the following article by Olaf Wucknitz:
The Sagnac effect, Twin Paradox, and space-time topology
Olaf Wucknitz also discusses the fiber optic conveyer experiments

In my opinion the article by Olaf Wucknitz is by far the most insightful article about the Sagnac effect, way ahead of anyone else.
Comment: Thank you. After going through the suggested references and others, I guess it may be some thing along these lines.  If we ignore the so called Fresnel drag for a moment, in a dielectric medium light travels with a velocity of c/n. Compared to a free space interferometer, this would have produced a larger fringe shift (by n^2). But with the increased velocity produced by the Fresnel drag, this amplification effect of the refractive index is reduced. In practical situations, where (c n)^2 >> (r \omega)^2, the observed fringe shift is essentially equal to that of a free space interferometer.
Comment: @JKrsl Well, the concept of Fresnel dragging is rooted in pre-relativistic physics. If it is granted that special relativity is valid then Fresnel dragging is not applicable. I don't know whether the independence of index of refraction is explained. Max von Laue did not address it, in my opinion. I concur with Olaf Wucknitz that GR isn't necessary to account for the Sagnac effect. Kevin Brown (mathpages) asserts specifically that the index of refraction drops out of the equation. [Sagnac and Fizeau](https://www.mathpages.com/home/kmath169/kmath169.htm)
Comment: We may call it SR velocity addition or Fresnel drag (FD). With FD, the time required for the propagation of the beams are: $\frac{2n^2\pi r}{cn-r\omega}$ and $\frac{2n^2\pi r}{cn+r\omega}$. The difference of the propagation times is $\frac{4n^2\pi r^2\omega}{c^2n^2-r^2\omega^2}$. When $c^2n^2>>r^2\omega^2$, the $n^2$ term cancels out, giving the familiar expression.


Why is the shadow of the earth not visible during sunsets?

Question: I would imagine that during a sunset, for a brief moment of time, there would be a shadow of the earth seen in the clouds but I have never seen this. Why does it not happen?
Comment: During sunsets you sometimes see nearby clouds lit from underneath, whereas distant clouds are darker. Isn't this the effect you're looking for?
Comment: https://www.skyandtelescope.com/astronomy-news/observing-news/earths-shadow-07292014/
Comment: Depends if that is just night, or a shadow from the earth obstructing the light that is sent from the sun towards the clouds. Night is more like when the sun goes out of view and everything is slowly darker, but there is no immediate "shadow" once the sun sets down.
Comment: A few minutes after sunset, a bluish gray band of sky grows upward from the opposite horizon as that part of the atmosphere passes into shadow.
Answer: To have a sharp shadow, you need a point source of light.  But the Sun is extended enough that it does not set all at once, so there is not a sharp shadow.  Also, there is refraction of the redder light, so instead of seeing a shadow, you'd see reddish clouds-- which I wager you see quite often (though much of that effect is from the way the atmosphere scatters away the blue light-- those effects are hard to disentangle but you know refraction matters because you see how the Sun's shape is distorted upon setting).


To check a site collection contains variation or not using powershell

Question: We are migrating to SharePoint Online and we want to check that which all sites are using variations in SharePoint 2013. Is it correct that if a site contains variation labels then that site is using variations or is there any other criteria? Please let me know if there is any powershell script to check that.
Answer: Yes, if a site contains variation labels, that site is using variations.
I am afraid there is no PowerShell script to check if the site is using variations.
More reference:
Automate Variations in SharePoint 2013 Using PowerShell & C#.


Will there be any scenario, where Spark RDD's fail to satisfy immutability.?

Question: Spark RDD's are constructed in immutable, fault tolerant and resilient manner.
Does RDDs satisfy immutability in all scenarios? Or is there any case, be it in Streaming or Core, where RDD might fail to satisfy immutability?
Comment: No, it will never fail! If the underlying infrastructure is immutable, how would you want it to fail satisfying immutability?
Comment: Yes, I agree the structure is immutable. I was just trying to check if there is any case. its also resilient and fault tolerant, which allows to re-compute in failures. Does re computation ensure the immutability as well.? consider, working in streaming windows and creating a dstream, which is a pack of RDDs and imply the failure and re-computation, and does it guarantee immutability.?
Answer: It depends on what you mean when you talk about RDD. Strictly speaking RDD is just a description of lineage which exists only on the driver and it doesn't provide any methods which can be used to mutate its lineage.
When data is processed we can no longer talk about about RDDs but tasks nevertheless data is exposed using immutable data structures (scala.collection.Iterator in Scala, itertools.chain in Python).
So far so good. Unfortunately immutability of a data structure doesn't imply immutability of the stored data. Lets create a small example to illustrate that:
val rdd = sc.parallelize(Array(0) :: Array(0) :: Array(0) :: Nil)
rdd.map(a => { a(0) +=1; a.head }).sum
// Double = 3.0

You can execute this as many times as you want and get the same result. Now lets cache rdd and repeat a whole process:
rdd.cache
rdd.map(a => { a(0) +=1; a.head }).sum
// Double = 3.0
rdd.map(a => { a(0) +=1; a.head }).sum
// Double = 6.0
rdd.map(a => { a(0) +=1; a.head }).sum
// Double = 9.0

Since function we use in the first map is not pure and modifies its mutable argument in place these changes are accumulated with each execution and result in unpredictable output. For example if rdd is evicted from cache we can once again get 3.0. If some partitions are not cached you can mixed results.
PySpark provides stronger isolation and obtaining result like this is not possible but it is a matter of architecture not a immutability.
Take away message here is that you should be extremely careful when working with mutable data and avoid any modifications in place unless it is explicitly allowed (fold, aggregate).
Answer: Take this example:
sc.makeRDD(1 to 100000).map(x=>{
  println(x)
  x + 1
}.collect

If a node fails after the map has been completed, but the full results have yet to be sent back to the driver, then the map will recompute on a different machine. The final results will always be the same, as any value double computed will only be sent back once. However, the println will have occurred twice for some calls. So, yes, immutability of the DAG itself is guaranteed, but you must still write your code with the assumption that it will be run more than once.


Streamlining what roles and users see

Question: Another question I may not be phrasing right because having a hard time finding an answer. I would like the following functionality for my site. If I am assigned the role of Administrator, I can see all the pages on the site, pretty basic, but if I fellow contributor has a different role, let's say, Baseball Editor, then the only pages I want them to "see" in the Page Dashboard are the pages they have the ability to edit, which in this case would be only the Baseball pages they are assigned. The would not be able to even view or see the Football pages, for example. Anyone know of a solution or point me in the right direction? Thank you!
Answer: There are a couple of options here. One, which I've found the easiest, is to move content you want to protect into custom post types. From there, you create specific permissions (capabilities) for each CPT, and WP will automatically only show the content that the current user has permission to edit in the back end.
The other option is to seek out a plugin. There are a few role plugins available which allow you to set permissions in various ways, such as selecting certain pages that each user or user group can edit. You're then dependent on the plugin, but it's easier to set up and get going that way and doesn't require any URL changes like CPTs may.

Streamlining what roles and users see


Math 2D graphs: best way of graphically (black and white or using colors) representing overlapping curves

Question: what's the best way to represent multiple 2D Cartesian-style graphs drawn in the same Caryesian plane and having zero or more possibly intersecting parts of intersection length 0 to open or closed k or infinity. How to do this (a): using one color, (b): using shades of gray, including or excluding white and or black, (c):using a disjoint set of perceptually distinct colors, (d) using any combination of (perceptually distinct or related) colors.
Answer: The best way is to do your own homework assignments.
This creates the best user experience, as you can check your knowledge, test your ability, learn from the process, and understand any mistakes you make.
Comment: This doesn't answer the question. Overlapping graph segments? What's the best way to represent these graphically. Your typical homework assignments have a few curves overlapping at most at single points on the plane, not at entire line segments as I described it.


What to do after unzipping the Java EE 7 sdk .zip file?

Question: I am quite new to Linux. I have been trying to install the Java EE 7 SDk on my ubuntu. I downloaded and unzipped the file "java_ee_sdk-7u1.zip". Which creates another folder named glassfish4 on my downloads directory. What are the next steps??I already have JDK 8 installed on my ubuntu. the JAVA_HOME variable is set at "/usr/lib/jvm/java-8-oracle".
Answer: What you should do next depends on what you want to do. I guess when you want to develop something you surely use a very good java IDE. In this case, the IDE needs to know the place of your SDK so that it can use the compiler and the libraries. In IDEA, you only need to tell where you unpacked the SDK zip and it sets up everything for you. On my machine, I have all java SDK's in my home directory and the IDEA and it looks like the following

When you are using another IDE like Netbeans or Eclipse, then the way to tell the IDE about the SDK might be a bit different, but the general approach is the same.


What is the most native way to generate desktop notification in BSD unixes

Question: macOS has its "osascript" with "display notification", Linux has its "notify-send". Both are the most native way to generate DE notifications. What is the most native way to generate desktop notification in BSD unixes?
Comment: I think it would depend on what _"desktop system"_ you're using, wouldn't it?  BSD is the base OS and most don't really include a _desktop_ beyond the basic X11 distribution and applications, with a basic window manager.  The most basic X11 app for notifications would be `xmessage`.
Comment: Isn't notify-send just a freedesktop idea? Should it then not apply to a the major desktop environments (say, GNOME, KDE), no matter whether you're running them on Linux or *BSD? It really isn't very "Linux-native": it just is a client making no use of specificities of the Linux kernel.
Comment: @GregA.Woods FreeBSD, at least, does not include X11 anything in a base install.
Comment: If you mean "base install" without any graphics environment, then the simplest notification tool is `write(1)`.  See also `mesg(1)`.  Available in all BSDs since the 1980s.  However "desktop" seems to imply some kind of graphical UI and environment.
Answer: As stated in OP's comment, most dekstop environments, in particular KDE-Plasma and Gnome use their own implementations to display notifications based on kernel agnostic DBus. Implementation that just cannot be replaced. ( Some notification daemon is started at DE launch time )

If all you want is to generate DE notifications, the standard way to proceed is to conform to the kernel agnostic Desktop Notifications Specification which the libnotify library implements.
If you also need a daemon because your DE does'nt implement anything then you should probably go with the notification-daemon.
Comment: @reportaman : It depends on what you mean by "native". From my understanding of the word, notify-send can't be said so since it is no more than a tool based on (and distributed by) libnotify. The most "native" and now standard way to send notifications is using DBus and conform to the Desjtop Notifications Specifications, libnotify being the most "native" API for their implementation. My understanding of your question was that, since you knew notify-send, you had the intention to write something else from scratch.
Comment: I am looking for a command line utility like notify-send which is considered the most standard across DE on BSD's. It seems from Marcus Muller's comment that notify-send is the most native command line way to generate notifications? Do you think thats not the case?
Comment: No, my intention is to write a function in shell script function that generates DE notifications for as many operating systems as possible. Thanks for your explanation and answer though.


How many news and articles cards should be visible on a desktop screen?

Question: The aim is to create a minimal news page and based on a UX law, I thought it would be a good idea to limit the number of news articles a user can see on a screen and it could be 3, to eliminate the overwhelming feeling by showing many options at once. But at the same time, there are going to be many new articles updated on the website per day.
What number do you think would be a better solution?
Comment: Hi, it's going to be difficult to give you an answer without knowing much about the project. Can you edit the question to give us as much information as possible about the new outlet and its goals for your project, and maybe show us what you've been working on so far? Thanks.
Answer: Beware magic numbers!
First, thank you for asking. Cool project!
Now I am not going to give you a straight answer but a warning instead: There will be no UX law telling you what the "correct" number of headlines is. Anyone who tells you otherwise is lying. You will need to attack this problem from many different angles, all of which have their own laws and rules. Some stuff that comes to mind:
Define a use case
Here is an UX law that is also a rule to live by: Never do anything for no reason ;)
What is your reasoning behind building this? Why a minimalist news page? Really define your idea very clearly, then forget everything you know about news pages and design what you think is the best solution to just your problem.
That may yield you quite different results. For example, if your goal is to inform your user about everything need-to-know in a certain niche, your number of articles will probably be different from solving the need of feel-good entertainment.
Consider the truly terrible site 9gag, who originally settled for nine posts per page because that balanced some packed entertainment but was reasonably fast to load (I guess), and also because they could build their whole brand around the "9", which happens to be a bad play on words in Cantonese.

Brand Identity
Obviously, your front page says a lot about your product, who you want to be, what you are. Consider for example the NYT:

That would be around 11 articles, but the exact number is not the point - the point is that the NYT is known to look somewhat like this, so they probably will never radically change this - it's their brand identity.
Create your own brand identity and stick to it.
Innovation Tokens
There is this concept of innovation tokens - it is basically saying that you cannot and should not try to innovate in every area, but only the relevant ones. So think long and hard about whether you want to innovate on the front page! If not, go for the usual number of articles one would find on whatever site your users are getting their news from currently (this might be just CNN or something or the existing minimalist news apps that are out there).
Decision Fatigue
Why a minimalist news app? If your reasoning is to stop your users from being overwhelmed by all the information out there, it may be worth researching the concepts of Analysis Paralysis and Decision Fatigue. While that won't yield you an exact number either, it will give you a lot of guidance.
User Characteristics / Expertise
Who are your users?
That also matters - consider for example expert software like HackerNews or the Bloomberg Terminal, both considered minimalist in some sense - and their astonishingly high number of front page articles.

If you innovate, go extreme
If you do decide to go innovate on the number of articles, I would urge you to go extreme! You need uniqueness to stand out in the myriad of news services - and the character of your product is also a big part of UX. Maybe go for one single article? Or try to fit every article of the day on the front page? Both could be considered minimalist.
TLDR: There is no hard and fast rule, define your use case, stare at it, find your answer
Comment: What a detailed answer, I truly appreciate the time you put and for sure consider the ponts you have made.
Answer: It all depends on the amount of information you are going to display on your cards and the size of your text. For example: cover image, excerpt, author, etc.
I recommend

3 is good if you display a lot of information
8 for a list with headline and excerpt
Comment: Thanks for you reply!


Exercise after lesion

Question: I suffered a small lesion some weeks ago, and the spot is still a little bit sore, but no pain. Should I wait until I don't feel no soreness at all, or is it oK to restart exercising?
Answer: Wait till you fully recover and 100% fit to carry on your workout. If the injury hasn't healed properly(soreness is an indication to that), then you may risk further damage. Also, consult with your doctor and take his advice on this.
Comment: Wouldn't you say exercising very light would actually help relieve him from the soreness?
Comment: @MJB: No, actually I wouldn't, Op said that there was a lesion, and we are not aware of the degree of soreness and what wasthe level of injury. I'd rather go for a safe bait.
Comment: Fair enough, you're right that we don't know the degree of soreness.

Exercise after lesion


Why these can't be an amplifier?

Question: I am asking if we have a voltage signal must be amplified
why we can't mount it in a resistance less than one and take the output as a current by using Ohm's law I = V/R and R is less than one ?
Comment: Current is current, and voltage is voltage. Confusing the two doesn't make you look clever.
Comment: Because in  I = V/R  the left side of the equation is current, whereas you are saying that you wish to amplify voltage.
Comment: But can i take current as indication of voltage?
Comment: Amplifier increases power of the signal, by definition.   Do you wish to take voltage \$ V \$, apply it across resistance \$ R \$, dissipate power \$P = V^2/R \$, and call that an amplifier?  What are you ultimately trying to accomplish?
Answer: You are right that on constant resistance, you can determine the voltage by measuring the current. But in no way, current an voltage are equivalent.
Voltage tells you how much energy is in a single electron, which can also be interpreted as a kind of pressure on the electrons. On the other hand, current tells you how many electrons are passing through a wire in a specific time.
That's why we talk about voltage sources (that output a constant voltage, independent of the load resistance), and as they have a maximum current they can produce, they need a minimum resistance. Check your audio amp - it likely is specified for speakers with at least 8 or 4 Ohms. Or check your wall wart power supplies, they are specified with a maximum current (typically 1 to 2 amps for smartphone chargers), which means they can not keep up the specified voltage, if the resistance gets too low (below 5 Ohms on a 5 Volts, 1 Amp supply).
On the other hand, we talk about current sources, those are outputting (we often call it sourcing) a specific current, independent of load. These kind of sources have a maximum voltage (called the *compliance voltage) they can emit. If the resistance is too high, these sources fail to emit the current they are specified to emit. Some LED drivers are built as current sources, because the LED itself needs a specific current for effective operation, while its resistance (and thus the voltage) are dependent on the temperature and age of the LED.
You are talking about amplification in your question. Actually, you need to specify what you want to amplify, and how you want your amplifier to behave. For example, you can have (typical audio amps are built this way) a voltage source, whose output voltage is controlled by the input voltage. (The modelling theory, for example used by Spice) calls this a voltage controlled voltage source). Is this case, you can write down a number, called the voltage gain, which is the factor between output and input voltage. The output current depends on the output voltage and the output resistance. On the other hand, you might already have a voltage of the value you want, but the voltage source is only able to source a couple of milliamps. You need hundreds of milliamps for your application (e.g. a DC motor), though. You can build an amplifier that outputs the same voltage as it has on the input, but only takes a little amount of current on the input, but is able to emit large currents on its output. This amplifier has a voltage gain of 1, but the current gain (ratio between output and input current) can be several orders of magnitude.
What's definitely wrong is the idea to compare the number of volts to the number of amperes, and concluding that something got amplified, because there are more amperes than volts (that's what you get on a resistance below 1 Ohm). If something gets amplified, you have more of the same quantity than you had before. So you might have more voltage than without the amplifier, or more current than without the amplifier, and in most but very exotic cases, you have more power (product of current and voltage) than without the amplifier.
Answer: You are wanting to increase voltage, so you need to look at the equation as:
V = I x R

What happens if you keep the current constant, and make R small - notice that the voltage will get smaller?
Now if you could some how keep the current constant and increase the resistance, notice that the voltage goes UP. That all sounds great, why not add a bigger resistance, who needs those silly amplifiers...
Well, not so fast. There is another equation you need to think about, and its the power one.
P = V x I

If you keep the current the same, but increase the voltage, then the power in the signal will have to increase - this is really what amplification is, adding power to a signal.
Unfortunately, resistors are passive devices, so called because they cannot add power, only dissipate it. If you think about it, if a resistor could add power, it would have to have some power supply, otherwise you would be getting free energy.
Comment: I do not want to increase voltage , i want to take the current as an indication to the voltage , it is just a Resistance factor between them
Comment: @MohamedOsama how are you planning on measuring the current? How much current can the source of your signal provide?

Why these can't be an amplifier?


Low FPS after upgrading to Ubuntu 16.04

Question: recently just installed 16.04, from 14.04 - did a fresh install - erased Hard drive. Everything went fine except now I get a drop of FPS from playing games, specially on steam. In fact, the reason why I switched to 16.04 from 14.04 was that thought that 16.04 had a better handle on FPS. It wasn't doing that before on 14.04. Games thru wine and steam were working fine (14.04) and I was getting 30 Fps, not sure if it's the new kernel. Using Nvidia proprietary drives 340 and Nvidia 710M. If there's any configuration you guys can suggets that would be highly appreciated. I red the forum first on any possible problem with Nvidia on 16.04. All of them was about it not working, well mine's working, it's just not working like it used to. Thanks!
Comment: Try a newer driver - 361 is the latest I think.
Comment: Normally it's recommended to delay upgrading to a new LTS version until after the first point release in this case, 16.04.1 is scheduled for release on  July 21st according to https://wiki.ubuntu.com/XenialXerus/ReleaseSchedule
Comment: Besides video driver issues, another possibility is somehow CPU frequency scaling not increasing the CPU frequency. It is known to be an issue with some games, where they switch CPUs in some odd manor, resulting in the scaling driver not thinking there is enough load to warrant raising the frequency, and the game thinking there isn't enough CPU power to run at a higher frame rate. Try performance mode for whatever CPU frequency scaling driver you are using.
Comment: Sorry for the late reply. I've been using windows for now. Can't wait for 16.04.1 to be released. Windows is OK but I prefer Ubuntu as my gaming machine. Makes me better at understanding how computers work
Answer: Ubuntu 16.04 has a lot of problem with video driver with Linux kernel 4.4.0. I suggest you to install Linux kernel 4.6.0 with this guide. In my case my nVidia started to work much better
Comment: Nvidia is very well supported I believe.
Comment: In my case nVidia fan run at maximum speed and I have also some glitch in the Unity bar and my pc, because of these problem, did not want to turn off or restart (as soon as i installed linux kernel 4.6.0 these problems disappeared). Ubuntu developers had announced that there is a compatibility issue on AMD GPUs, but I suspect that also nVidia GPUs had some problem with 4.4.0 kernel

Low FPS after upgrading to Ubuntu 16.04


Database busy during one thread is writing in one table and other thread accessing the data from other table

Question: I am inserting lot of data in some tables in background thread.During inserting if app accessing the data from other table I got an Database busy error.I am using FMDatabase.
how to solve these issue?
Answer: Use FMDatabaseQueue, it's meant for situations like this.


Can I visit the USA and come back to Canada with expired Canadian visa?

Question: I am currently in Canada on a work permit. My work requires me to visit the US frequently and I have been there multiple times. Recently my Canadian visa has expired I need to visit the US again. Can I visit the US with my expired Canadian visa and come back to Canada?
Comment: For clarity, you have a current/valid Canadian Work Permit *and* a (now expired) Tourist Visa or similar?
Answer: Yes, you are allowed to travel to Canada using a valid work (or student) permit instead of a visa, provided you have only gone to the USA or St. Pierre and Miquelon.
Timatic (the database which airlines use to verify that your travel documents are sufficient for travel) states, in relevant part:

Passengers with a valid student or work permit are allowed
    to return to Canada from the USA or St. Pierre and Miquelon
    without obtaining a new visa, if  they have not left the USA
    or St. Pierre and Miquelon to a third country and are
    returning within the period of entry authorized (expiry date
    of student or work permit) or within 6 months of original
    entry stamp.
Comment: I'm not sure the "Yes" is correct, as the OP has not revealed or confirmed that their proposed re-entry into Canada will occur "...within 6 months of original entry stamp."
Comment: @DavidSupportsMonica Entry stamp is only for visitors who entered without being given a visitor record or other status document. Study or work permit holders can enter Canada without visa subsequent to visits to US (and only US/StPM) as long as the permit is valid. I should note however not all airline agents are well-trained and one may encounter difficulty and must be prepared to escalate (non-budget AC/WS usually are better on subtlties of Canadian regulations).


Displaying closed cases in the dashboard

Question: I'm using compucorp's fork of civiCase. Nice!
Currently in the case manager page, only active cases are displayed (as confirmed by the "Satus: All open cases" placeholder). I'm trying to display by default both active and closed cases.. But I can not find a toggle to do so, any advice?
Answer: The code seems to support a "showCasesFromAllStatuses" parameter on that page but I have no idea how to set it.
It looks like they removed the mechanism for it in https://github.com/compucorp/uk.co.compucorp.civicase/pull/825, but left some of the code behind.
As a workaround you can comment out this line, but the text in the dropdown will still default to "All Open Cases", but the table will be showing all statuses. https://github.com/compucorp/uk.co.compucorp.civicase/blob/f815d9886bb8d34d8584b8245339e2cb0b9f3d80/ang/civicase/case/list/directives/case-list-table.directive.js#L383


Dependence of change in entropy on temperature

Question: The thermodynamic definition of entropy is expressed as
$$dS = \frac{dq_{rev}}{T}$$
I understand that it depends on amount of heat transferred because heat transfer can be understood as the degree of dispersion of energy but what does the temperature dependence actually mean?
Comment: By "what does [it]... actually mean", do you mean "how can we intuitively understand why there is a temperature dependence"?
Comment: yes @ericksonla, I'm looking for an intuitive explanation.
Answer: An analogy that I like is one paraphrased from Peter Atkins' great book "The Laws of Thermodynamics - a VSI":

Imagine two rather different places in terms of noise - a silent
  library and a busy train station. Imagine that the temperature is the amount of noise at the given place - a measure of the "state of noise". Let's say that you laugh out loud,
  corresponding to supplying energy as heat.
In the library, where there is little background noise (low $T$) this would cause a large amount of disturbance and
  disorder - corresponding to a large increase in entropy. On the busy
  train station, on the other hand, you laughing would go largely
  unnoticed - there is lots of background noise already (high $T$). The (relative) amount of additional disturbance and
  disorder would be much smaller, corresponding to a smaller increase of
  entropy.

In a very cold system, even a tiny amount of supplied energy in terms of heat would cause a large change in entropy. On the other hand, supplying the same amount of energy to a really hot system - with lots of molecular motion going on - would cause a minuscule change in entropy.
Disclaimer: Note that the analogy and explanation above are two ways of convincing yourself that the entropy change due to added heat is inversely proportional to the system temperature. They do not claim to be correct or physical in any other sense, so read them with a (large) pinch of salt.
Comment: that's a good way to think about it but i would also like to hear the physical side of it.
Answer: What this equation is saying essentially is that the level of disorder can be modeled as the number of configurations if you have a number of particles and a number of quanta of energy. It's like having three cups and three balls; all the balls can occupy one cup or one ball can occupy one cup and two can occupy another etc. Hence an increase in energy would result in an increase in entropy (more balls and more configurations). Temperature is defined as the average energy of the system. Hence if energy is concentrated (all the balls are in one cup) then the average temperature per particle will be lower and the entropy will be lower which makes sense since the system is more ordered with all the balls in one cup.
I hope this helps answer the question somewhat
Comment: Thanks for answering but isnt this the statistical definition of entropy? I believe there might be an alternate explanation that does not involve talking about microstates
Answer: If in defining entropy we did not divide the heat by T, heat could flow from a cold body to a hot body with no change in entropy i. e. without breaking the second law.
This does not happen.
Likewise, in order for heat to flow from a hot body to a cold body, the loss of entropy of the hot body has to be smaller than the gain of entropy of the cold body.
Answer: I am also often confused and have no clear answer. Consider melting of ice. If we do not allow any physical change (no movement, no pressure change, no volume change), it will not happen. Without volume change when heat is added to gas, entropy cannot increase. We may say the heat was transferred to internal energy...
I think the temperature dependance of entropy is not the nature of entropy Itself but it is caused by the changes of parameters affecting entropy that are affected by temperature such as volume, pressure.. Most thermodynamic equations are  for gases. For liquid and solids the final equations may not be the same as those for gases although all definitions should be the same. Based on statistical definition of entropy, $S=k_\mathrm{B} \ln{W}$, it is obvious that there is no temperature term but it is assumed that particles can freely interchange positions. If particles cannot move ($0\, \pu{K}$), $W=1$ and entropy will be 0 regardless of how many different particles are three. When we calculate entropy changes for melting we just consider $\Delta H$ and T but we do not think about volume changes or anything else. All such changes are already included in the delta H value we use and assumptions. If molecules are not allowed to move, melting will no happen because crystalline state is that molecules cannot move. All reversible processes in thermodynamics allow changes associated With them as long as they are reversible. So, I would prefer not thinking too much about details. Leave them to physicists...
Answer: This is a bit of a "chicken-and-egg" problem, as those ultimately dealing with definitions tend to be. The concepts of entropy and temperature were originally developed empirically and were later modified and merged into a coherent theory of thermodynamics. It turns out that temperature can be defined as follows (this follows from the combined 1st and 2nd laws of thermodynamics):
$$T^{-1}=\left( \frac{\partial S}{\partial E} \right)_V$$
$T^{-1}$ describes the sensitivity of the system's entropy to the addition of energy at constant volume.
What the equation means can also be interpreted if we define entropy as follows (modifying a statement in the OP):

entropy can be understood as a measure of the degree of dispersion of energy (the number of possible configurations of the system given the current energy)

When a fixed amount of energy is added to a system more configurations become accessible (invoking concepts from statistical mechanics). At a lower temperature the number of additional configurations - in proportion to the initial number - increases by a greater amount than at a higher temperature. This can be restated as "a higher entropy change results when a very small fixed amount of energy is added to a system at low temperature". This explanation of the difference between the entropy change at low and high temperatures is captured by the silent library/busy train station analogy presented in another answer.