How much overhead is there in calling a function in C++?

Question: A lot of literature talks about using inline functions to "avoid the overhead of a function call". However I haven't seen quantifiable data. What is the actual overhead of a function call i.e. what sort of performance increase do we achieve by inlining functions?
Comment: Voting to close as "too broad". This cannot really be answered sensibly. It depends on compiler, hotspot detection, CPU (caching, speculative execution, branch target buffering), and many more factors
Answer: On most architectures, the cost consists of saving all (or some, or none) of the registers to the stack, pushing the function arguments to the stack (or putting them in registers), incrementing the stack pointer and jumping to the beginning of the new code.  Then when the function is done, you have to restore the registers from the stack.  This webpage has a description of what's involved in the various calling conventions.
Most C++ compilers are smart enough now to inline functions for you.  The inline keyword is just a hint to the compiler.  Some will even do inlining across translation units where they decide it's helpful.
Comment: on x86 (and many other arches) not ALL the registers need to be backed up because they are expected to be changed by function calls. C calling convention on x86 typically doesn't preserve eax, ecx and edx.
Comment: @Martin York: C's ABI is not part of the standard -- it can't be, the standard is architecture agnostic, while the ABI depends on architecture.  The standardized ABIs for C, which let it be used as a base interchange and glue language, are done by the OS or chip manufacturer.  BeOS has a C++ ABI.
Comment: Pushing all function parameters to the stack is the C ABI. C++ does not specify a specific ABI as part of the standard (unlike C). Thus allowing each compiler to optimize as required. Hence most C++ compilers don't push all parameters to the stack.
Comment: Yup, and for Itanium Intel provided the C++ ABI.
Answer: I made a simple benchmark against a simple increment function:
inc.c:
typedef unsigned long ulong;
ulong inc(ulong x){
    return x+1;
}

main.c
#include <stdio.h>
#include <stdlib.h>

typedef unsigned long ulong;

#ifdef EXTERN
ulong inc(ulong);
#else
static inline ulong inc(ulong x){
    return x+1;
}
#endif

int main(int argc, char** argv){
    if (argc < 1+1)
        return 1;
    ulong i, sum = 0, cnt;
    cnt = atoi(argv[1]);
    for(i=0;i<cnt;i++){
        sum+=inc(i);
    }
    printf("%lu\n", sum);
    return 0;
}

Running it with a billion iterations on my Intel(R) Core(TM) i5 CPU       M 430  @ 2.27GHz gave me:

1.4 seconds for the inlinining version
4.4 seconds for the regularly linked version

(It appears to fluctuate by up to 0.2 but I'm too lazy to calculate proper standard deviations nor do I care for them)
This suggests that the overhead of function calls on this computer is about 3 nanoseconds
The fastest I measured something at it was about 0.3ns so that would suggest a function call costs about 9 primitive ops, to put it very simplistically.
This overhead increases by about another 2ns per call (total time call time about 6ns) for functions called through a PLT (functions in a shared library).
Comment: Interesting. I wonder if it is because of a cache miss when you use the function.
Answer: There's the technical and the practical answer.  The practical answer is it will never matter, and in the very rare case it does the only way you'll know is through actual profiled tests.
The technical answer, which your literature refers to, is generally not relevant due to compiler optimizations.  But if you're still interested, is well described by Josh.
As far as a "percentage" you'd have to know how expensive the function itself was.  Outside of the cost of the called function there is no percentage because you are comparing to a zero cost operation.  For inlined code there is no cost, the processor just moves to the next instruction.  The downside to inling is a larger code size which manifests it's costs in a different way than the stack construction/tear down costs.
Answer: Your question is one of the questions, that has no answer one could call the "absolute truth". The overhead of a normal function call depends on three factors:

The CPU. The overhead of x86, PPC, and ARM CPUs varies a lot and even if you just stay with one architecture, the overhead also varies quite a bit between an Intel Pentium 4, Intel Core 2 Duo and an Intel Core i7. The overhead might even vary noticeably between an Intel and an AMD CPU, even if both run at the same clock speed, since factors like cache sizes, caching algorithms, memory access patterns and the actual hardware implementation of the call opcode itself can have a huge influence on the overhead.
The ABI (Application Binary Interface). Even with the same CPU, there often exist different ABIs that specify how function calls pass parameters (via registers, via stack, or via a combination of both) and where and how stack frame initialization and clean-up takes place. All this has an influence on the overhead. Different operating systems may use different ABIs for the same CPU; e.g. Linux, Windows and Solaris may all three use a different ABI for the same CPU.
The Compiler. Strictly following the ABI is only important if functions are called between independent code units, e.g. if an application calls a function of a system library or a user library calls a function of another user library. As long as functions are "private", not visible outside a certain library or binary, the compiler may "cheat". It may not strictly follow the ABI but instead use shortcuts that lead to faster function calls. E.g. it may pass parameters in register instead of using the stack or it may skip stack frame setup and clean-up completely if not really necessary.

If you want to know the overhead for a specific combination of the three factors above, e.g. for Intel Core i5 on Linux using GCC, your only way to get this information is benchmarking the difference between two implementations, one using function calls and one where you copy the code directly into the caller; this way you force inlining for sure, since the inline statement is only a hint and does not always lead to inlining.
However, the real question here is: Does the exact overhead really matter? One thing is for sure: A function call always has an overhead. It may be small, it may be big, but it is for sure existent. And no matter how small it is if a function is called often enough in a performance critical section, the overhead will matter to some degree. Inlining rarely makes your code slower, unless you terribly overdo it; it will make the code bigger though. Today's compilers are pretty good at deciding themselves when to inline and when not, so you hardly ever have to rack your brain about it.
Personally I ignore inlining during development completely, until I have a more or less usable product that I can profile and only if profiling tells me, that a certain function is called really often and also within a performance critical section of the application, then I will consider "force-inlining" of this function.
So far my answer is very generic, it applies to C as much as it applies to C++ and Objective-C. As a closing word let me say something about C++ in particular: Methods that are virtual are double indirect function calls, that means they have a higher function call overhead than normal function calls and also they cannot be inlined. Non-virtual methods might be inlined by the compiler or not but even if they are not inlined, they are still significant faster than virtual ones, so you should not make methods virtual, unless you really plan to override them or have them overridden.
Answer: The amount of overhead will depend on the compiler, CPU, etc.  The percentage overhead will depend on the code you're inlining.  The only way to know is to take your code and profile it both ways - that's why there's no definitive answer.
Answer: For very small functions inlining makes sense, because the (small) cost of the function call is significant relative to the (very small) cost of the function body.  For most functions over a few lines it's not a big win.
Answer: It's worth pointing out that an inlined function increases the size of the calling function and anything that increases the size of a function may have a negative affect on caching. If you're right at a boundary, "just one more wafer thin mint" of inlined code might have a dramatically negative effect on performance.

If you're reading literature that's warning about "the cost of a function call," I'd suggest it may be older material that doesn't reflect modern processors. Unless you're in the embedded world, the era in which C is a "portable assembly language" has essentially passed. A large amount of the ingenuity of the chip designers in the past decade (say) has gone into all sorts of low-level complexities that can differ radically from the way things worked "back in the day."
Answer: There is a great concept called 'register shadowing', which allows to pass ( up to 6 ? ),values thru registers ( on CPU )  instead of stack ( memory ). Also, depending on the function and variables used within, compiler may just decide that frame management code is not required !!
Also, even C++ compiler may do a 'tail recursion optimiztaion', i.e. if A() calls B(), and after calling B(), A just returns, compiler will reuse the stack frame !!
Of course, this all can be done, only if program sticks to the semantics of standard ( see pointer aliasing and it's effect on optimizations )
Comment: Both are actually 'tail call optimisation': tail recursion is simply the special case of tail calling that calls itself.
Comment: The optimization you describe is not "tail recursion optimization", what you describe is real optimization...but tail recursion optimization is when a recursive function can be changed into function which loops because the recursion occurs at the end or "tail" of the function.
Comment: @EvanTeran this is definitely tail call optimization. The compiler is optimizing out a **call** at the **tail** of the function.
Answer: Modern CPUs are very fast (obviously!). Almost every operation involved with calls and argument passing are full speed instructions (indirect calls might be slightly more expensive, mostly the first time through a loop).
Function call overhead is so small, only loops that call functions can make call overhead relevant.
Therefore, when we talk about (and measure) function call overhead today, we are usually really talking about the overhead of not being able to hoist common subexpressions out of loops. If a function has to do a bunch of (identical) work every time it is called, the compiler would be able to "hoist" it out of the loop and do it once if it was inlined. When not inlined, the code will probably just go ahead and repeat the work, you told it to!
Inlined functions seem impossibly faster not because of call and argument overhead, but because of common subexpressions that can be hoisted out of the function.
Example:
Foo::result_type MakeMeFaster()
{
  Foo t = 0;
  for (auto i = 0; i < 1000; ++i)
    t += CheckOverhead(SomethingUnpredictible());
  return t.result();
}

Foo CheckOverhead(int i)
{
  auto n = CalculatePi_1000_digits();
  return i * n;
}

An optimizer can see through this foolishness and do:
Foo::result_type MakeMeFaster()
{
  Foo t;
  auto _hidden_optimizer_tmp = CalculatePi_1000_digits();
  for (auto i = 0; i < 1000; ++i)
    t += SomethingUnpredictible() * _hidden_optimizer_tmp;
  return t.result();
}

It seems like call overhead is impossibly reduced because it really has hoised a big chunk of the function out of the loop (the CalculatePi_1000_digits call). The compiler would need to be able to prove that CalculatePi_1000_digits always returns the same result, but good optimizers can do that.
Answer: There are a few issues here.

If you have a smart enough compiler, it will do some automatic inlining for you even if you did not specify inline. On the other hand, there are many things that cannot be inlined.
If the function is virtual, then of course you are going to pay the price that it cannot be inlined because the target is determined at runtime. Conversely, in Java, you might be paying this price unless you indicate that the method is final.
Depending on how your code is organized in memory, you may be paying a cost in cache misses and even page misses as the code is located elsewhere. That can end up having a huge impact in some applications.
Comment: Sorry, the virtual bit is the wrong way around. If your object is on the stack, within that function the compiler will know the type at compile time. Hence, it can resolve calls immediately, and doesn't need to put in a vtable lookup
Comment: I'm not sure I see the point of this comment. Obviously in situations where there is no dynamic dispatching this is not going to be an issue.

However, in many cases you will be using pointers and potentially polymorphic code, and it is not uncommon to see code upcasts or downcasts stack objects.
Answer: There is not much overhead at all, especially with small (inline-able) functions or even classes.
The following example has three different tests that are each run many, many times and timed. The results are always equal to the order of a couple 1000ths of a unit of time.
#include <boost/timer/timer.hpp>
#include <iostream>
#include <cmath>

double sum;
double a = 42, b = 53;

//#define ITERATIONS 1000000 // 1 million - for testing
//#define ITERATIONS 10000000000 // 10 billion ~ 10s per run
//#define WORK_UNIT sum += a + b
/* output
8.609619s wall, 8.611255s user + 0.000000s system = 8.611255s CPU(100.0%)
8.604478s wall, 8.611255s user + 0.000000s system = 8.611255s CPU(100.1%)
8.610679s wall, 8.595655s user + 0.000000s system = 8.595655s CPU(99.8%)
9.5e+011 9.5e+011 9.5e+011
*/

#define ITERATIONS 100000000 // 100 million ~ 10s per run
#define WORK_UNIT sum += std::sqrt(a*a + b*b + sum) + std::sin(sum) + std::cos(sum)
/* output
8.485689s wall, 8.486454s user + 0.000000s system = 8.486454s CPU (100.0%)
8.494153s wall, 8.486454s user + 0.000000s system = 8.486454s CPU (99.9%)
8.467291s wall, 8.470854s user + 0.000000s system = 8.470854s CPU (100.0%)
2.50001e+015 2.50001e+015 2.50001e+015
*/

// ------------------------------
double simple()
{
   sum = 0;
   boost::timer::auto_cpu_timer t;
   for (unsigned long long i = 0; i < ITERATIONS; i++)
   {
      WORK_UNIT;
   }
   return sum;
}

// ------------------------------
void call6()
{
   WORK_UNIT;
}
void call5(){ call6(); }
void call4(){ call5(); }
void call3(){ call4(); }
void call2(){ call3(); }
void call1(){ call2(); }

double calls()
{
   sum = 0;
   boost::timer::auto_cpu_timer t;

   for (unsigned long long i = 0; i < ITERATIONS; i++)
   {
      call1();
   }
   return sum;
}

// ------------------------------
class Obj3{
public:
   void runIt(){
      WORK_UNIT;
   }
};

class Obj2{
public:
   Obj2(){it = new Obj3();}
   ~Obj2(){delete it;}
   void runIt(){it->runIt();}
   Obj3* it;
};

class Obj1{
public:
   void runIt(){it.runIt();}
   Obj2 it;
};

double objects()
{
   sum = 0;
   Obj1 obj;

   boost::timer::auto_cpu_timer t;
   for (unsigned long long i = 0; i < ITERATIONS; i++)
   {
      obj.runIt();
   }
   return sum;
}
// ------------------------------

int main(int argc, char** argv)
{
   double ssum = 0;
   double csum = 0;
   double osum = 0;

   ssum = simple();
   csum = calls();
   osum = objects();

   std::cout << ssum << " " << csum << " " << osum << std::endl;
}

The output for running 10,000,000 iterations (of each type: simple, six function calls, three object calls) was with this semi-convoluted work payload:
sum += std::sqrt(a*a + b*b + sum) + std::sin(sum) + std::cos(sum)

as follows:
8.485689s wall, 8.486454s user + 0.000000s system = 8.486454s CPU (100.0%)
8.494153s wall, 8.486454s user + 0.000000s system = 8.486454s CPU (99.9%)
8.467291s wall, 8.470854s user + 0.000000s system = 8.470854s CPU (100.0%)
2.50001e+015 2.50001e+015 2.50001e+015

Using a simple work payload of
sum += a + b

Gives the same results except a couple orders of magnitude faster for each case.
Answer: As others have said, you really don't have to worry too much about overhead, unless you're going for ultimate performance or something akin. When you make a function the compiler has to write code to:

Save function parameters to the stack
Save the return address to the stack
Jump to the starting address of the function
Allocate space for the function's local variables (stack)
Run the body of the function
Save the return value (stack)
Free space for the local variables aka garbage collection
Jump back to the saved return address
Free up save for the parameters
etc...

However, you have to account for lowering the readability of your code, as well as how it will impact your testing strategies, maintenance plans, and overall size impact of your src file.
Answer: Each new function requires a new local stack to be created.  But the overhead of this would only be noticeable if you are calling a function on every iteration of a loop over a very large number of iterations.
Comment: You mean "new stack frame", rather than "new stack", yes?
Answer: For most functions, their is no additional overhead for calling them in C++ vs C (unless you count that the "this" pointer as an unnecessary argument to every function.. You have to pass state to a function somehow tho)...
For virtual functions, their is an additional level of indirection (equivalent to a calling a function through a pointer in C)... But really, on today's hardware this is trivial.
Comment: The compiler will hardly ever inline a virtual function, so you're making a moot point.  The only exception is when the object type is known at compile time, then the indirection can be skipped.
Comment: There is no noticable difference between direct call and call via pointer on modern CPUs. The overhead of virtual functions comes from vtable look up. And it is significant.
Answer: Depending on how you structure your code, division into units such as modules and libraries it might matter in some cases profoundly.

Using dynamic library function with external linkage will most of the time impose full stack frame processing.
That is why using qsort from stdc library is one order of magnitude (10 times) slower than using stl code when comparison operation is as simple as integer comparison.
Passing function pointers between modules will also be affected.
The same penalty will most likely affect usage of C++'s virtual functions as well as other functions, whose code is defined in separate modules.
Good news is that whole program optimization might resolve the issue for dependencies between static libraries and modules.


How to select random data points in Google spreadsheet?

Question: I have a Google spreadsheet document with over 1000 data cells in one column. I want to select 5 random samples from this data set, and copy these to a new column. And repeat this process, n number of times. How do I do this?
Comment: Do you want sampling with replacement or without replacement? That is, can the previously selected values be selected again?
Comment: @Normal Human I think I've figured out with replacement, using VLOOKUP and adding a column for indexes. Then I used RANDBETWEEN to pick search key to be fed into VLOOKUP. If you can give a process for sampling without replacement, I'd appreciate it. Thanks!
Comment: You don't need a column for indices: just use random [OFFSET](https://support.google.com/docs/answer/3093379?hl=en) from the top of the list. Without replacement... I'll have to think about it.
Comment: Also, a problem with using randbetween or other random spreadsheet functions is that your samples will be drawn again with every edit to the script. This won't help if you want to analyze the sample.
Comment: Yes, I did observe RANDBETWEEN running every time I made a change to the spreadsheet. I'll have a go at randomizer.org
Answer: To implement sampling without replacement with only spreadsheet functions is not easy. Sampling with replacement is easy enough with randbetween, but if you use it, the samples will change with every edit to the sheet (unless you "stabilize" them by copy-pasting values only, but this is still awkward).
I suggest using an existing solution, such as randomizer.org. It provides a CSV file with random integers in a given range, with or without replacement. The CSV file can be easily imported into Google Sheets: it looks like the table below.
If Randomizer is the name of the sheet with these numbers, and your dataset is in column A of another sheet, then
=offset(A1, Randomizer!A5, 0)

will give the corresponding random element of your list. Copy-paste this command around a 5-by-n range to create the samples.
Note: offset 0 corresponds to the top cell of the data range, so the range of numbers provided to randomizer should begin with 0.
+-------------------------------+-------+-------+
| Research Randomizer Results:  |       |       |
| 20 Sets of 5  Numbers Per Set |       |       |
| Range: From 0 to 999 -- No    |       |       |
| Set 1                         | Set 2 | Set 3 |
| 221                           | 67    | 779   |
| 667                           | 575   | 966   |
| 898                           | 897   | 933   |
| 131                           | 244   | 559   |
| 739                           | 745   | 901   |
+-------------------------------+-------+-------+

Comment: Thanks. I did see the selected data points changing with every change to the spreadsheet. I didn't think much about it. I'll have a go at randomizer.org


Using GWT, how to load an image and access image attributes & http status codes

Question: Using GWT I am loading images from a server I do not control.  Currently, I use GWT new Image( url) and then use ImageHandlers and ErrorHandlers to catch what happened and put the images in my buffer and the DOM.  Then I make the images visible sequently to animate the process.  But now I need a bit more, I need to know the error code, e.g.304 that the server returned for the image and also I need to get at the header response attribute, 'Last-modified'.  For 304, I know I need to resubmit the request later when the server will have created a new version ( with exactly the same url ) which I think I can manage, but it will then have a new 'Last-modified' and I need to know that DateTime.
By using new Image(url), I am letting the browser do the loading, but I don't know how to get at the details of the load.
Q1:Is there a way to pull more info from an image?
GWT Image just seeems to wrap a JS object.  I look in Firefox Console-Network, but don't see much detail there either. Is Last-modified and error code forgotten by the time it gets (or doesn't) in the DOM tree.
If the answer to Q1 is no the information is gone or inaccessible, ..
Q2: Do I need to stop using the browser to fetch images and do it with an XmlHttpRequest and then presumably I have access to the response codes and the header attributes. SOP is not an issue.  But how then do I get from say the Response OutputStream to an Image?  Do I have to Base64 encode it or is there a better way?  Will one of the other non-url constructors for image help, say Image(Element) or Image(ImageResource). Then the issue becomes how to make a response stream into a Element or ImageResource?
Note: This other question 'How to print error message of why image failed to load?' is related, but doesn't get to an answer.
Answer: Getting Error codes, and getting the response as a stream must be done with an HTTP client (GWT has the built in RequestBuilder). You can also try to get the error code with native JS, using the method described here.


how to prove that quotient group $\mathbb{R}/\mathbb{Z}$ and the circle are diffeomorphism?

Question: Are quotient group $\mathbb{R}/\mathbb{Z}$ and the circle are diffeomorphism? How to prove? Hope someone give me some advise or some reference documents. Thank you.
Answer: I know some information for the problem and I hope it helps you by considering another point of view. We know that the set of all complex numbers of absolute value $1$ makes a multiplicative group denoted by $T$. We can easily verify that for ant fix $y\in\mathbb R$, the map $f_y:\mathbb R\to T,~~ f_y(x)=\exp(iyx)$ is a homomorphism. So we can have $\mathbb R/\mathbb Z\cong T$. It is just to verify that the latter isomorphism and its inverse are both differentiable. Sorry if this is due to Group theory. Above function can be regarded as $$g:\mathbb R\to T=S^1\\g(x)=\exp(2\pi xi)$$ also.
Comment: I like the approach...+1


uboot-menuconfig not available in make targets

Question: I'm trying to setup a custom default environment for u-boot while building an embedded Linux system with Buildroot. I was able to achieve this in u-boot standalone, but I'm unable to reproduce the same through Buildroot's Kconfig.
Running uboot-menuconfig fails:
$ make uboot-menuconfig
make: *** No rule to make target 'uboot-menuconfig'.  Stop.

and the uboot-menuconfig target is missing from the help message:
$ make help
Cleaning:
  clean                  - delete all files created by build
  distclean              - delete all non-source files (including .config)

Build:
  all                    - make world
  toolchain              - build toolchain
  sdk                    - build relocatable SDK

Configuration:
  menuconfig             - interactive curses-based configurator
  nconfig                - interactive ncurses-based configurator
  xconfig                - interactive Qt-based configurator
  gconfig                - interactive GTK-based configurator
  oldconfig              - resolve any unresolved symbols in .config
  syncconfig             - Same as oldconfig, but quietly, additionally update deps
  olddefconfig           - Same as syncconfig but sets new symbols to their default value
  randconfig             - New config with random answer to all options
  defconfig              - New config with default answer to all options;
                             BR2_DEFCONFIG, if set on the command line, is used as input
  savedefconfig          - Save current config to BR2_DEFCONFIG (minimal config)
  update-defconfig       - Same as savedefconfig
  allyesconfig           - New config where all options are accepted with yes
  allnoconfig            - New config where all options are answered with no
  alldefconfig           - New config where all options are set to default
  randpackageconfig      - New config with random answer to package options
  allyespackageconfig    - New config where pkg options are accepted with yes
  allnopackageconfig     - New config where package options are answered with no

Package-specific:
  <pkg>                  - Build and install <pkg> and all its dependencies
  <pkg>-source           - Only download the source files for <pkg>
  <pkg>-extract          - Extract <pkg> sources
  <pkg>-patch            - Apply patches to <pkg>
  <pkg>-depends          - Build <pkg>'s dependencies
  <pkg>-configure        - Build <pkg> up to the configure step
  <pkg>-build            - Build <pkg> up to the build step
  <pkg>-show-info        - generate info about <pkg>, as a JSON blurb
  <pkg>-show-depends     - List packages on which <pkg> depends
  <pkg>-show-rdepends    - List packages which have <pkg> as a dependency
  <pkg>-show-recursive-depends
                         - Recursively list packages on which <pkg> depends
  <pkg>-show-recursive-rdepends
                         - Recursively list packages which have <pkg> as a dependency
  <pkg>-graph-depends    - Generate a graph of <pkg>'s dependencies
  <pkg>-graph-rdepends   - Generate a graph of <pkg>'s reverse dependencies
  <pkg>-dirclean         - Remove <pkg> build directory
  <pkg>-reconfigure      - Restart the build from the configure step
  <pkg>-rebuild          - Restart the build from the build step

busybox:
  busybox-menuconfig     - Run BusyBox menuconfig

uclibc:
  uclibc-menuconfig      - Run uClibc menuconfig

linux:
  linux-menuconfig       - Run Linux kernel menuconfig
  linux-savedefconfig    - Run Linux kernel savedefconfig
  linux-update-defconfig - Save the Linux configuration to the path specified
                             by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE

Documentation:
  manual                 - build manual in all formats
  manual-html            - build manual in HTML
  manual-split-html      - build manual in split HTML
  manual-pdf             - build manual in PDF
  manual-text            - build manual in text
  manual-epub            - build manual in ePub
  graph-build            - generate graphs of the build times
  graph-depends          - generate graph of the dependency tree
  graph-size             - generate stats of the filesystem size
  list-defconfigs        - list all defconfigs (pre-configured minimal systems)

Miscellaneous:
  source                 - download all sources needed for offline-build
  external-deps          - list external packages used
  legal-info             - generate info about license compliance
  show-info              - generate info about packages, as a JSON blurb
  printvars              - dump internal variables selected with VARS=...

  make V=0|1             - 0 => quiet build (default), 1 => verbose build
  make O=dir             - Locate all output files in "dir", including .config

For further details, see README, generate the Buildroot manual, or consult
it on-line at http://buildroot.org/docs.html

However u-boot is enabled and is correctly built along with kernel and file system. Is there a config option I'm missing?
Answer: Obviously there was such a config option. I was building u-boot with the legacy build system that does not include Kconfig configuration; therefore, menuconfig was not available.
To have uboot-menuconfig among the accepted targets I had to select Kconfig instead of Legacy in the Bootloaders -> U-Boot -> Build System menu.


What majors study both computer and maths?

Question: I would like to apply for a Master degree.
I'm looking for a major that study both Computer and Maths.
Can anyone tell me what such major are?
Comment: You could try some areas of applied math or theoretical CS.
Comment: Computer science is essentially a kind of mathematics, although it doesn't actually _study_ computers.  Also, a lot of fields _use_ computers these days, so it might help if you clarify how you want computers to be involved.  (And how you want math to be involved, for that matter.)
Comment: Combinatorics maybe ?
Comment: I don't know in which country you are studying. However, in the UK this depends on the university itself and the Msc program they provide. What part of computer science do you like? Is the programming part or other popular topics (e.g., big data, etc.). Also what you want to do after Msc?
Comment: Also, if you have skills in both computers and math you are pretty much equipped for any sort of scientific research.  You could think about applying your skills to problems in, say, physics, or biology.  Of course you would have to learn those subjects too, but you'd have a nice head start.
Answer: As an example, the University of Oxford (UK) as an MSc program in Mathematics and the Foundations of Computer Science, which not only has courses in computer science and mathematics, but in particular also offers courses on the interplay between these areas.
Answer: If you like applied, Computational Mathematics could be a good option.
Answer: Many scientific fields nowadays rely heavily on computation (physics, statistics, biology, etc). You could go into any of these with a computational focus in mind (develop new computational methodology, algorithms, improve speed/performance of existing algorithms).
Answer: I'm not sure what your prior experience/work is, but if you have a little experience in Computer Science, another option is Cryptography.
Though it's usually not an explicit major, one typically studies it through a given Mathematics program, and if you concentrate on the applied side of things (i.e., writing actual algorithms and performing time/space analyses of them), you'll be deep enough in the weeds to be forced to learn more Computer Science along the way.


Searching a HDF5 dataset

Question: I'm currently exploring HDF5. I've read the interesting comments from the thread "Evaluating HDF5" and I understand that HDF5 is a solution of choice for storing the data, but how do you query it ? For example, say I've a big file containing some identifiers : Is there a way to quickly know if a given identifier is present in the file ?
Comment: Which of the options from Richard Corden response did you used?
Answer: I think the answer is "not directly".
Here are some of the ways I think you could achieve the functionality.
Use groups:
A hierarchy of groups could be used in the form of a Radix Tree to store the data.  This probably doesn't scale too well though.
Use index datasets:
HDF has a reference type which could be used to link to a main table from a separate index tables.  After writing the main data, other datasets sorted on other keys with references can be used.  For example:
MainDataset (sorted on identifier)
0: { A, "C", 2 }
1: { B, "B", 1 }
2: { C, "A", 3 }

StringIndex
0: { "A", Reference ("MainDataset", 2) }
1: { "B", Reference ("MainDataset", 1) }
2: { "C", Reference ("MainDataset", 0) }

IntIndex
0: { 1, Reference ("MainDataset", 1) }
1: { 2, Reference ("MainDataset", 0) }
2: { 3, Reference ("MainDataset", 2) }

In order to use the above a binary search will have to be written when looking up the field in the Index tables.
In memory Index:
Depending on the size of the dataset it may be just as easy to use an in memory index that is read/written to its own dataset using something like "boost::serialize".
HDF5-FastQuery:
This paper (and also this page) describe the use of bitmap indices to perform complex queries over a HDF dataset.  I have not tried this.
Answer: H5Lexists was introduced for this in HDF5 1.8.0:
http://www.hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-Exists
You can also iterate over the things that are in an HDF5 file with H5Literate:
http://www.hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-Iterate
But you can also manually check for previous versions by trying to open a dataset. We use code like this to deal with any version of HDF5:
bool DoesDatasetExist(const std::string& rDatasetName)
{
#if H5_VERS_MAJOR>=1 && H5_VERS_MINOR>=8
    // This is a nice method for testing existence, introduced in HDF5 1.8.0
    htri_t dataset_status = H5Lexists(mFileId, rDatasetName.c_str(), H5P_DEFAULT);
    return (dataset_status>0);
#else
    bool result=false;
    // This is not a nice way of doing it because the error stack produces a load of 'HDF failed' output.
    // The "TRY" macros are a convenient way to temporarily turn the error stack off.
    H5E_BEGIN_TRY
    {
        hid_t dataset_id = H5Dopen(mFileId, rDatasetName.c_str());
        if (dataset_id>0)
        {
            H5Dclose(dataset_id);
            result = true;
        }
    }
    H5E_END_TRY;
    return result;
#endif
}

Answer: Perhaps this paper will be very helpful to you.
http://www.cse.ohio-state.edu/~wayi/papers/HDF5_SQL.pdf
Is this what you need? You can query a HDF5 data with SQL, which is a declarative language.
Unlike FastQuery, there is no index in this work, but our group also provides an open source version with bitmap index.
Moreover, if you want to complete the query (especially for aggregation) in real time, you should consider approximate aggregation or online aggregation. I have also developed some products which directly work on HDF5.
Furthermore, some queries over HDF5 can be much more complex than what you may have seen in relational databases. Some queries are array-oriented rather than relational table-oriented. Just google "SciQL", then you can find some complex and unique query types for array-based data model, which can certainly be applied to HDF5. Do you need to perform those kind of queries? I have also developed a product to support some of the complicated query types there.
Answer: What do you mean by identifier ? If you mean an attribute, check this tutorial. In C:
status = H5Aread(attr_id, mem_type_id, buf);
status = H5Awrite(attr_id, mem_type_id, buf);

Comment: By identifier, I mean something like a unique name, a primary key. The example describes how to create an attribute, but how can it be used for searching ?

Searching a HDF5 dataset


Is it possible to get the mnemonic phrase back, if I have a few private keys derived from this mnemonic phrase?

Question: I used my mnemonic phrase to create a lot of accounts long time ago. I have the private keys of some account derived from this mnemonic phrase. Is there a possible way to find the mnemonic phrase back/find the private keys of all another account derived from this mnemonic phrase? Thank you!!
Answer: a secret recovery phrase is generated using an hd wallet. Private keys are basically children of this phrase, but there's no way to go back to the parent having just the private key.


Change HDD partitions after installation

Question: I am new to Ubuntu.
I want to know how to re-partition my hard disk after installation.
I had used the gnome-disks application during install,
but now the HDD can't be unmounted as it contains the OS.
How can I revise the partition?
P.S I have tried gparted but it didn't work
Answer: First, you might use your Ubuntu live CD/USB to make partitions changes on your bootable hard drive. You can make a number of online operations (I mean during you are on your system), but be sure to:

Always umount partitions before formatting or deleting them.
If you change hard drive layout (e.g. deleting partition) always prefer rebooting in order to allow a proper partition refresh in memory.
Comment: See https://opensource.com/article/18/6/how-partition-disk-linux


Get Entry Slug from specific Locale

Question: I have a multilingual entry setup using different sites for each language. I want my assets sorted by slug, but since the slugs are different in each language, all assets are saved three times. My idea was to sort them not just by slug, but by the slug of their primary site sibling. So that all the assets from the same entry (no matter if they are uploaded on the DE, EN or FR site) are being saved in one folder using the slug of the EN site. Is this even possible?
Answer: This might not be a full blown solution but given the current entry, you can get the corresponding entry of another site by using
{% set otherLocaleEntry = craft.entries.siteId(lang.id).id(entry.id).one() %}

As you can see you only need the id of the desired language's site and the entry id. You then have the entry of the other language and you can get its slug.
Comment: Thanks Mike! Your answer pushed me into the right direction. I added a separate answer in which i edited your code accordingly and also prepared it to use inside a matrix field.
Answer: Thanks to MisterMike's answer I was able to get what I want. My asset location path is now set to {{craft.entries.siteId(1).id(id).one().slug}}. The siteId 1 is the ID of the site from which i want to use the slug.
To use this location path inside of a matrix/neo field, you would have to add owner like this: {{craft.entries.siteId(1).id(owner.id).one().slug}}.
With this location path, all assets from all languages are being saved into one single folder which uses the slug of the entry that is part of the primary site (siteId(1)).

Get Entry Slug from specific Locale


Can researcher re-publish their own published research somewhere else?

Question: Let's say I (first author) have published my research in a paywalled, non-open access journal. Can I publish a simplified version of the article, using some of the same figures as in the paywalled article onto elsewhere? Like a blog? Do I need to go through some licensing process as if I were not the author myself?
Comment: What does the agreement you signed with the publisher of the paywalled non-open access journal say?
Comment: Most modern agreements will let you publish the entire article on your blog, perhaps with some conditions.  But it varies.
Comment: To avoid trouble of that kind, send a version of the article to a preprint server before publication in a journal.
Answer: While copyright law varies, I suspect that you can't do that unless you have specific permission from the copyright holder. That is probably whoever published your work initially.
Publishers usually detail what license they grant back to authors, so you can look to that for guidance. To do more requires explicit permission.
But it also requires care in writing so that you don't wind up self-plagiarizing. You need to cite and not over-quote yourself, pretty much as if the original was that of another author. There may be some leeway in the latter.
You also need to deal with co-authors if you aren't sole author. First author gives no additional rights for such things.
The new publisher also needs to be aware that there are copyright restrictions on (some parts of) the work and that you can't grant them full and unrestricted rights to the work.
For purposes of a blog that you publish yourself, you an write "about" your work, citing as necessary. This is probably already covered in your license. Monetizing the work might be an issue, and if what you put on the blog lessens the value of the published work to the copyright holder you may also run into issues.


Significance of binary variables

Question: If I have variables $X_1$, $X_2$, ... $X_n$ whose values are only 1 or 0, in order to explain a variable $Y$, is there a way to determine which ones are significant, and also, how could it be measured?
Comment: This is a regression problem.  The method to select depends on the nature of $Y$ and, to some degree, on how frequently the various combinations of the $X_i$ appear in the data and precisely how you view $Y$ as depending on the $X_i$.  If you could disclose that information you would have much better chances of attracting answers that go beyond the generic advice "use regression" or "use ANOVA" (which is essentially the same thing).
Answer: The simplist approach is an ANOVA using a model with no interaction terms (leave in the interaction terms if you want to test them).
Comment: I tried fitting a logistic regression model for a simple case, which consisted of a variable that contained values of 0 and 1 and another variable (dependent) that is a copy of the other one. I expected the independent variable to be significant, but in the summary the p-value for the Wald test was extremely high (equal to 1), indicating that the independent variable was not significant. What could be the problem?

Significance of binary variables


What does the term "save scumming" mean?

Question: What does the phrase "save scumming" mean? What is the origin of the phrase?
Answer: Save scumming refers to the practice of repeatedly saving and reloading to manipulate outcomes or avoid unfavorable consequences. It is believed to have originated with players of the roguelike genre.
Comment: Doubtful on the latter, because one hallmark of a roguelike is that save scumming isn't actually possible without drastically interrupting the game before it can autosave into the save slot.
Comment: @shadur when I searched for the term I found multiple sources which indicated that was the origin. Probably should cite them here though. Just noticed that the question I didn't find when I made this post last night is tagged with [roguelike].
Comment: @Shadur The top-voted answer at [What does it mean to "savescum"?](https://gaming.stackexchange.com/a/96507/4797) says the same thing: "*The term originated in the Roguelike community […]*".

What does the term “save scumming” mean?


Schengen Greece Visa/passport withdrawal process

Question: My schengen visa is being consulted however I need to withdraw the passport as I have a scheduled travel.
What is the process of Passport withdrawal and how many days does it take?
Comment: Did you apply via VFS Global? If you wish to withdraw your application you are usually required to visit the application centre and submit your withdrawal request. VFS may not be able to provide you any definite timelines to get your passport back but you can check the status of your passport on their website. Fees are not usually refundable.
Answer: In most cases the application is done locally. So you will have to contact them directly and ask when you can come by and pick up the passport, thus withdrawing you application.
Often the local consulate (which you have not supplied) web site will contain information on how to deal with the matter that the passport is needed during application. This is, however, the exception to the rule and not always possible.


database for web analytics

Question: what database to choose to store information about site visits, key characteristics: big amount of data, many page requests per second, different reports for data presentation, i think to use MySql, any suggestions?
Comment: Why not use Google Analytics instead?
Answer: Consider letting the server log the requests and parsing them asynchronously. You don't need ACID for analytics, and you don't need to process them while talking to a client.
Answer: Most mainstream databases are good for that (including mysql, postgres, oracle etc). MySql is fine though, especially if you've used it before.
Be sure look at licenses as well: MySql is GPL (the database and the connectors), Postgres is BSD, Oracle (and a few others) you need to pay for.
Answer: Most web analytics companies use some kind of distributed file system to store logs, such as HDFS, QFS... The reason is that the data is too big for the traditional database.
Analytics reports are generated via MapReduce job.
If you want to do an adhoc query, you normally use something like Hive/Pig/Sawzall.

database for web analytics


How to fix flickering sound

Question: I switched completely to Ubuntu 12.04  everything is fine instead when I play any track or video, the visual performance is good but the sounds flickers always and when I try to increase the volume it starts to flicker more. I installed Ubuntu restricted extras, checked my hardware, hardware drivers etc.
Answer: I recently had a similar issue with 12.04.3 on an old laptop; it seems that kernel 3.8 struggles with some soundboards. I suggest you try installing kernel 3.2 (package linux-image-3.2.0-23-generic) and set it up to boot by default. Check out this guide for details.
Comment: thank you Luis but, as i am new to Ubuntu 12.04 its hard for me to understand, i carried on with the guide you shared but i didn't get anything then also i tried, still my problem is unsolved please will u help me with easier ways.            thanks..
Answer: I had similar problems when using a USB DAC on an unpowered usb hub.  Plugging the DAC straight into my laptop made it go away.
If you're not using an internal soundcard, consider whether your device is getting sufficient power, at least in my case, the DAC was just rebooting several times per second.

How to fix flickering sound


Lost Partition After Installing Ubuntu 16.04

Question: I used to dual-boot Windows and Ubuntu on my previous laptop and everything worked just fine. I got a new 500gb HP Laptop and after installing Ubuntu, I realized that about 100gb was missing. Ubuntu is allocated to 114gb and Windows is allocated to 256gb. I have no idea where the other space went to and I want to know if it can be recovered.
Comment: I suggest installing gparted (sudo apt-get install gparted), where you can check your drives and see where are those missing Gb's. Have you tried?
Comment: I haven't, and I don't know how to use it. Can you please guide me through?
Comment: ok Ill post and answer for you
Comment: **You're (Probably) missing NOTHING.** A typical factory installed Windows 10 includes a recovery partition and a typical automated Ubuntu installation creates a swap partition. If there are just a few MB of unallocated space at the beginning or at the end of the drive, leave it alone. That's for better alignment only.
Answer: Use Gparted, you can install it by typing
<code>sudo apt-get install gparted
</code>
It has got a GUI so it is pretty easy to use, it is a package to display all your mounted drives with their partitions and sizes included.

https://gparted.org/
Here is the official website with help, for your information it would be enough to install it and check the differences, if you would like to manage your partitions however, you will have to mount it live and do it from your live medium (flash disk e.g.).
Comment: Thank you,  I've seen the unallocated space. How do I recover it?
Comment: It is the last sentence of the help - if you would like to manage your partitions however, you will have to mount it live and do it from your live medium (flash disk e.g.). You can check youtube for video tutorials of: How to extend volumes (like here https://www.youtube.com/watch?v=cDgUwWkvuIY&t=334s ) or you can create a new question thread (in case you are unable to find existing one).


Computer recommendations for magazine layout?

Question: We have been using Mac Pro computers and are being asked to consider mini or iMacs.
Comment: Can you add information about the screens you have and that you are considering moving to? This may be more significant than performance difference. Especially if the Mac Pros are old.
Answer: The only real reasons to stick to a Mac Pro:

More than two monitors needed
More than 32GB of RAM needed
More than 1 internal hard drive needed
PCIx expansion cards needed

If you aren't using any of the above items, then a mini or iMac would work just fine. The Minis and iMac have plenty of processing power for most design work.
The Minis can use up to 16GB of RAM and iMacs can go up to 32GBs of RAM. External hard drives can be daisy chained for use (Firewire or Thunderbolt) as well.
The only time I would strictly suggest sticking with a MacPro is if video editing is common. The additional cores of a MacPro really speed video processing much more than Minis or iMacs are capable of. But this really only means time spent waiting. The Minis and iMacs can certainly edit video, it just takes a bit longer.


How many books are there in Esperanto?

Question: I felt pretty motivated about reading Esperanto literature, especially after finding the baza legolisto, and thought "I'll cover the basics in a year!".  After reading this article I felt a bit floored - and therefore my question how many books there are in Esperanto.
Comment: Could someone who voted by question down tell me why?
Answer: Most of the fiction published in Esperanto consists of translations. If you mean books containing fiction originally written in Esperanto, then there aren't so many: about 200 novels have been published, and 400 volumes of short stories, and some of these books are very short. We are still at the stage at which a very determined person with a lot of money could conceivably read all of them. However, the quality is uneven, so it is a good idea to start with other people's recommendations. Of the novels, about two-thirds date from after 1980. Since then the rate has been about 3½ per year. You can find a detailed list on Sten Johansson's website.
Reading fiction, both original and translated, is a good way to get comfortable with Esperanto. And it is advisable to keep a pocket dictionary on hand to look up words, as that is one of the most efficient methods of expanding vocabulary.
Answer: La Katalogo de UEA has about 7461 titles (or 7262, see below), if I managed to count them correctly.

NOTE: It doesn't allow just listing all titles and requires searching by some criteria, so I tried in two ways:

I first picked titles with price of less than 1€ (361) and then with price of more than 1€ (7100), which makes 7461, assuming there is no overlap or missing titles.
I selected all titles published after year 1887 (duh), which shows 7262 titles.

In any case, there are more than 7000 books there.
Answer: I had read that there was a library of books translated and written in Esperanto by Montagu Butler. His library is listed first in this Wikipedia article of all books/library that are written in Esperanto.
https://en.wikipedia.org/wiki/Esperanto_library
Comment: Bonvenon al Stack Exchange, Sparkfist! I don't think he made all of that himself, but the library seems to have been named after him. Thank you!

How many books are there in Esperanto?


Tag synonym request: message-loop

Question: I suggest making messageloop a synonym of message-loop, because they both mean exactly the same. Because I am not able to do this on stackoverflow, I am asking for this on meta.
Answer: Just retag all of the messageloop ones to message-loop; you should have the permission to do that.
Well, merged, anyways! =)

Tag synonym request: message-loop


Is a Skyrim Blood Mage feasible?

Question: Ever since I saw the Equilibrium spell I thought that it might be possible to play a 'Blood Mage' like character. Instead of putting points in magicka you could put them into Health. Equilibrium would be used at the early stages of the game before enchanting was high enough to give you free spells. After that the absence of magicka wouldn't really be noticed and the extra health would be useful.
Are there any special effects on artifacts or perks in the game that would be useful to this character build?
Are there any potential downsides in this character design?
Some of the higher spells use more magicka than is available at the start of the game.
Would it be better to use items with +magicka to cast higher level spells or to put some attribute points into magicka instead of health?
Comment: Cool idea. You might want to split this into multiple specific questions though, as it's very broad at the moment.
Comment: LOL. I never could focus on one style, on any of my play throughs. Every single RPG, I end up with a tank style, no matter if I start for the aim of magic or stealth or what, I always find heavy armor and big weapons to fight with, and sample other stuff late game.
Answer: Sort and simple answer is yes! My second character is based around this build. I am currently level 32 and I am quite enjoying it. I rarely use equilibrium as I rarely run out of magicka and when I do I have a loooot of potions from hoarding them around.
At the moment I am dual casting apprentice level destruction - and yes this more than enough to kill frost dragons. maybe it takes a few more hits but it staggers dragons (not Alduin) and I am waiting till my enchanting is 100 so I can make my destruction free and not waste anymore perks. I use rune spells and conjuration (fire, storm and dremora lord) regularly to give me a tactical advantage.
Early game I'd suggest having a follower but not really that necessary later on.
I used restoration perks to increase my magicka regen by 50% so I can use atronach stone.
i use arch mage's robe, morokai's mask and self enchanted amulet and ring for giving more magicka+magicka regen. So I suggest doing college of winterhold quests asap. Right now I have around 430 magicka and 410 health.
Hope this answers your question though I am a month late :p
Edit:
I will put up my character build here and edit it every so often if it helps:

level: 35 (atronach stone)
Enchanting - lvl 100 (and I always use grand souls for enchanting my
gear)
Destruction - lvl 90
conjuration ~ lvl 86
alteration - lvl 33 (I am including this as this is the next skill I
will try to develop)
gear: orcish armor (destruction+alteration), ebony helmet
(destruction+alteration), ring (destruction+conjuration), amulet
(destruction+conjuration), ebony gauntlets (magicka+something nice). So
this makes all my destruction cost 0 magicka.

I tested this at the last part of the main quest-line

from the point where you enter Skuldafn.

It works rather well, would work better with some (crowd) control spells eg. paralysis from alteration, or some illusion spells etc.
Comment: also I suggest using the following mod for anyone trying to use atronach stone + conjuration: http://www.skyrimnexus.com/downloads/file.php?id=3352
Answer: I would not worry too much about not having enough mp to cast higher level spells. Reason being that since you are emphasizing enchanting as a skill you want to keep improving, the highest perk in enchanting gives you the ability to dual enchant items, so for all of your reducing cost items, you can also give them an increase to magicka as well. Be careful though, because not all enchants are available to any specific item. Rings and necklaces are work wonders though.
Answer: Fortify Magicka and Fortify Health Regeneration are great combo's to put on items for Blood Mages.
Also choose a Fortify Restoration potion before choosing the Atronach. This highly increases your magicka pool and freezes your magicka regeneration entirely which in this case is good; you relie on your Health to use your spells and this way you are more forced to use your Equilibrium spell.
The legally highest possible enchantments you can get per item is Fortify Magicka 108 and fortify Healing Rate 54%. This includes being a Vampire Necromage and the ability to use Ahzidal's Armor as well as the Black Book that can lead you to ways to fortify all of your crafting abilities even further.

Is a Skyrim Blood Mage feasible?


Which Lego set do I have? mostly yellow and seems to be based off of construction

Question: The Lego set includes one minifigure with a blue cap, a red shirt, and blue pants. It also includes a window piece, some yellow connections, a black digger piece with the same connection and wheels. The set is mostly yellow and seems to be based off of construction. I tried to find it on other sites, but couldn't find anything. The set appears to be from the 2010s, and seems to be made for younger kids, but not quite Duplo.
Comment: A photo of the more distinctive pieces may prove useful here.
Answer: Best match I can find fitting that description is set 4667 - Loadin' Digger from 2004.

This set is from the 4 Juniors line, and features a non-traditional minifigure, larger than the iconic ones, from the Jack Stone line of figures.


Music in the background

Question: My 5yo always asks Alexa to put songs in the background while she plays, paints etc. There is background music almost all day. Wondering if this has some long term potential to affect her concentration or other abilities? (I know background music gets me totally out of focus but I don't want to force my sensitivities on her).
Comment: I can "tune out" background noise, of any type like music, or engines etc etc - comes from having to focus on the job in hand. Some can do it, others not. Sounds like you cannot but your daughter can.
Answer: In many of the research articles I have reviewed, the idea of background music negatively affecting our children development has been proven. As we all know, we can not control every situation and there is background noise everywhere we go, BUT, when we can control the situation around us, we should. "Yes, it's true…as much as tv can help those long days pass, it is important to be aware that the quantity and volume of background noise has been found to have adverse effects on the development of language skills in young children" (Hillsberg, 2021). Background noise can be anything from the television to music, even a constant dog barking. Additionally, it has been proven that a clear space and quiet areas, help focus the mind and increase concentration.
Based on the research. I would turn off Alexa when trying to concentrate on certain tasks.
Reference
Hillsberg, B. (2021, December 16). Does background noise interfere with language development? Speech Sisters. Retrieved October 20, 2022, from https://speechsisters.com/does-background-noise-interfere-with-language-development/
Answer: Anecdotally, some people focus really well with music and find it hard to focus without it, and others can't focus with music. As a teacher, I always had some students who would want to work on their homework while listening to the music because it drowned out the other sounds in the classroom. I also had some students for whom music was too distracting and they needed to focus without music vying for their attention.
Personally, I have music on most of the time, regardless of what I'm doing: cleaning, dishes, programming, playing games, etc. If I need to focus, I listen to instrumental background music that doesn't excite me, like video game soundtracks, piano, or classical music.
The only exception is if I'm driving in an unfamiliar situation at high speeds, I'll turn the music down and pay attention to all things around me (which is a pretty standard behavior).
Comment: I hope this doesn't sound harsh: you didn't answer the question. OP asks for information regarding "if this has some long term potential to affect her concentration or other abilities?" The answer to this question should be based on a scientific study of music's long term effect on some aspects of cognition. If you can't find such a study, then you do not know the answer. A personal anecdote isn't definitive.
Comment: Many studies are based on what teachers have noticed especially with regards to how children learn and the conditions in which learning happens. AFAIK there is not one scientific paper defining learning with 100% certainty.
Comment: @SolarMike - I was a scientist, and I know better than to expect anything is 100% reliable (well, I know with 100% certainty that we who are alive today will someday cease to be alive. But I can't think off the top of my head that it's been *studied*. Why study the obvious?) We're not asking for the moon. Any reasonably reliable study will do just fine.

Music in the background


Does WARP still imply Compensated Law of Demand even if one of the goods is indivisible?

Question: Consider 2 goods, $x_1$ and $x_2$. Let's assume $x_1$ is indivisible (we can only consume integer units of $x_1$). And suppose the consumer satisfies budget balance and homogeneity of degree 0, and WARP. Can we still say compensated law of demand holds?
Answer: According to proposition 2.F.1 in Mas-Colell, Whinston and Green (MWG):

If the demand function is
(a) homogeneous of degree zero and
(b) satisfies Walras' law (all wealth is spent),
then the demand function satisfies WARP if and only if it satisfies
the compensated law of demand.

In MWG, the proof that (a), (b) and WARP imply the compensated law of demand uses only (b) and WARP. (It is only the converse - i.e. that (a), (b) and the compensated law of demand imply WARP - that requires condition (a).)
Thus, if your extra assumption about demand does not prevent the demand function from satisfying (b) and WARP, then the compensated law of demand holds by the proof in MWG.
Condition (b) can hold for demand functions where $x_1$ is integer-valued as can WARP.

If you had assumed both goods are only consumed in integer values, then condition (b) would be violated because it would not be possible to spend all wealth for all combinations of prices and wealth. Then, one would have to see if the proof of the relevant part of proposition 2.F.1 in MWG can be amended. It turns out that it can, if instead of Walras' Law we assume just that $p\cdot x(p,w)\leq w$ for any prices $p$ and wealth $w$. Call this condition (b').
The proof boils down to showing that for any compensated price change from $(p,w)$ to $(p',w')=(p',p'\cdot x(p,w))$ we have, when $x(p',w')\neq x(p,w)$, that:
$$p'\cdot[x(p',w')-x(p,w)]\leq 0 \tag{2.F.3}$$
and
$$p\cdot[x(p',w')-x(p,w)]>0\tag{2.F.4}$$
Consider $(2.F.3)$. We have $p'\cdot x(p',w')\leq w'$ by condition (b') and $p'\cdot x(p,w)=w'$ since it is a compensated price change. Thus $(2.F.3)$ holds. Consider $(2.F.3)$. Because $p'\cdot x(p,w)=w'$, $x(p,w)$ is affordable at $(p',w')$. and so by WARP $x(p',w')$ must not be affordable at $(p,w)$. Thus $p\cdot x(p',w')>w$. Also $p\cdot x(p,w)\leq w$ by (b'). Thus  $(2.F.4)$ holds.


Will it affect my academic career if I leave my PhD programme in the middle?

Question: I am currently doing my masters. I have done my bachelors and masters from the same university in a remote part of Asia. My experience in my university as an undergrad and grad student is not good. My department environment was not conducive to learning or research. As undergrads, we were encouraged to memorize rather then understanding, developing intuitions or solving problems. Whatever I have learnt, I learnt from the resources available on the internet e.g. OCW, YouTube etc. Only a couple of professors are involved in research. They are not at all helpful or encouraging. They always need to boost their ego, never ready to discuss anything, never ready to accept their mistakes if they made one. The teacher-student relationship is more like, dare I say, a master and slave type of relationship. I actually didn't work with any of them. The main reason I want leave my university and do PhD somewhere else is because of the toxic environment here. Now as I am thinking of applying for PhD abroad, I have this fear that I may not feel at home with the university/ department/ professor/ colleagues that I get into. If I then leave the programme, would that decrease my chances of getting into another university? I know that I might need LOR from the faculty members but since I don't have much experience in academia, I would really appreciate if someone can explain how the situation would become. Thank you.
Answer: Such things depend more on why you leave rather than just the fact that you do. If you establish a poor record then it is harder to get in to another program.
But it also depends on where you want to study and the nature of the program that you enter. Some programs give you some room and time to catch up with missed knowledge and some programs provide an especially supportive environment for students.
However, at some level, nearly every student is in your situation at some point. Starting research on a narrow but deep problem can leave you a bit lost for a while until you get all of the very specific background needed to go deeper.
But if the alternative for you is to not try, then that alone will negatively affect your career also. And even taking a gap to "catch up" can be good or bad, depending on what you do with the time and how you can verify that you've made necessary progress.
The advice for nearly every student is to just do it and do your best.
Comment: Hi @C26, Thanks for the suggestion. Ehsan had some really good encouraging words for PhD aspirants. Thanks!
Comment: Nice answer from @Buffy. I also point the OP to [this](https://academia.stackexchange.com/a/132559/68021) answer. I think it's good to go the distance and complete things. My PhD is part-time and I was feeling pretty lost for the first three years. It's only in the fourth year that things have started to feel more concrete.
Comment: Hi @Buffy, Thank you very much for such an elaborate answer. Really appreciate it. I completely understand and agree with you on how starting a career in research can be challenging and how things can vary from one institute/discipline to another. I will be applying on programmes where I basically can extend my MS thesis work. So, I won't be completely new to the field. One thing I forgot to mention is that the main reason I want leave my university and do PhD somewhere else is because of the toxic environment here. My biggest fear is what if I find myself in a toxic environment again.


Is is possible for mods or admins to edit someone else's comment?

Question: Made a comment, edited said comment, came back and I swear my comment was subtly different than what I had written. It showed that the comment had been edited 3 times -- I might have done it twice. I've since deleted said comment, but I'm wondering who, if anyone, has the ability to edit my comments.
Answer: Yes. ♦ moderators and devs can edit anyone's comments. Typically, this is only exercised just to do minor spelling fixes, remove dangerous content, or at request as per some flags.
We are also not limited as to how long of a window we can edit anyone's comments, but editing any comment other than our own is in fact tracked.
Comment: @tvan We're elected under the trust that we *not* do that. Like I intentionally qualified in my answer, this is generally done only for spelling fixes, dangerous content removal, and at the author's request; changing the intent of the comment is pretty standard abuse. If we have to make significant changes that the author should know about, most of us will actually notify the author in the process, should we edit rather than entirely delete the comment (which we also can do, recall).
Comment: @Jacob You've got a lotta posts ahead of you to clear that up, then. ♪
Comment: @Grace Note - so someone can change what I've said and I get no notification of it and can't find out who it was.  That seems...wrong.
Comment: @Grace Note - I'm more of a trust and verify kind of guy.  Why not make the changes transparent?  That is, instead of the hover over saying "this comment was edited" say "this comment was edited by the owner" or "this comment was edited by a moderator".
Comment: @tvan Because comments are lightweight, oft unimportant, and usually the nature of the edit of a comment is insignificant. We likewise do not indicate when a comment was edited, or what was changed about it. If it still concerns you, I invite you to make a proper feature request out of it.
Comment: @Grace Note - anyway I can see who has edited my comment if someone other than I did it?
Comment: Note that only the "diamond"( the elected or appointed mods) can do this, 10K users can **not**
Comment: @Jacob I don't really call 10k users moderators, so that's technically the intent, but I'll just clarify that. ♪
Comment: True, but some people think of 10K users as mods, so I wanted to clarify that.
Comment: 10k users have access to mod tools, therein lies where people are too lazy to remember the difference that a moderator has a diamond and 10k do not @jac
Comment: @tvan Only moderators and above get access to that info, so there's no way you can see that unless you can get elected or ask a moderator to find out for you.


Super graph restriction based on girth

Question: Let $n$ be the minimum possible size of a 4-regular graph with girth $g$. Consider a graph with a minimum degree of at least four with girth $g$, can I say that the size of such graph must be at least $n$ (as each vertex has at least four neighbours, making the graph more denser than a 4-regular graph; hence, in order to obtain the same girth it requires more vertices) or there might be such a graph with size less than $n$?

Girth is the length of the shortest cycle in the graph.
Answer: No, you can't say that, unless you prove it to be true.  The way to know what you can say is to try to prove it; if you can prove it, you can say it, otherwise you can't.
It is possible that offering more freedom in the permissible degrees for each vertex allows constructing a smaller graph, so you can't trivially infer the conclusion you wish for.

Super graph restriction based on girth


Data filtering in React using Lodash

Question: I am currently making a Table component in React.js. My goal is to implement a search function similar to that one being used at https://www.datatables.net/.
Below is my code using filter and includes functions from Lodash library. This code does not work because it only looks for exact matches. For example if an object in my data array has fruit: "apple", the filter "app" has no matches.
<code>  data = filter(data, (row) => {
    return includes(row, this.state.filter);
  });
</code>
Is there any way I can implement fuzzy search with any of lodash's built in functions? If not can you suggest another way?
Answer: lodash will not have what you need. Depending on your search requirements you could utilize a distance metric based search such as Levenshtein. Or maybe a substring  length metric. For a library drop in, look at fuzzy
Answer: So, they are searching where characters in first and last name match what you are typing.
In lodash, you can use a filter like this..
<code>.filter(contact => !(this.state.filter && contact.lastName.toLowerCase().indexOf(this.state.filter) == -1 && contact.firstName.toLowerCase().indexOf(this.state.filter) == -1))
</code>
This is assuming you are setting the search value to the state and that you are wanting to match the firstname / lastname fields.  You should be able to modify this to meet your needs.

Data filtering in React using Lodash


What is the meaning of "I have attitude"?

Question: what does the phrase "I HAVE ATTITUDE" mean in this picture?
Comment: "Having attitude" means being tough in some sense. As in standing ones' ground.
Comment: Welcome to EL&U. One of the expectations of Stack Exchange is that you demonstrate your initial research efforts; for example, the first place to check for the meaning of a word would be a dictionary. In the OALD, *[attitude](http://www.oxfordlearnersdictionaries.com/definition/english/attitude)* includes a meaning of *confident, sometimes aggressive behaviour that shows you do not care about other people's opinions and that you want to do things in an individual way* which seems clear enough. Please take the site [tour] and review the [help] for further guidance.
Comment: Of course, "having attitude" may simply mean that you're not on the level.
Comment: It's a pun.  Positive Mental Attitude: the generic meaning of "attitude."  But then "attitude" in large red all-caps has a more specific meaning: you "have attitude" means you're nobody's pushover, you don't let anyone get away with anything (e.g. disrespect).
Comment: But isn't the whole point of this question to ask what the idiom "I have attitude" means in this particular context as opposed to asking in general what "I have attitude" means? Doesn't that fall under "Word choice and usage" from the help centre? This is clearly a pun on PMS, and understanding that this is a pun on PMS makes the choice of "having attitude" much more understandable and interesting than just understanding what "having attitude" means as an idiom.
Answer: To have attitude is a relatively modern idiom, originating in the US. The OED still only includes it as a draft addition to the dictionary, from 1997. Though the examples go back to 1962.
It is in two parts  -senses 6a, and 6b.

a. Aggressive or uncooperative behaviour; a resentful or antagonistic
  manner. In phrs. to cop an attitude, to give attitude, etc., to assume
  such a manner. slang (orig. U.S.).
b. Hence, any highly independent or individual outlook, approach,
  appearance, etc.; self-possession; style, swagger, front; esp. in with
  (an) attitude. slang (orig. U.S.).

Though the OEd does not include it, it is sometimes expressed as an attitude problem.
Answer: As the comments on the question say, 'have attitude' is being tough/strong-willed/assertive/kick-ass.
The usage here emphasises this meaning even further though: 'I have P.M.A.' appears to be playing on 'I have PMS', i.e. premenstrual syndrome. Premenstrual syndrome is often associated with being grouchy and irritable, and with 'PMA', this slogan is slamming that stereotype with the result of coming out even more tough-skinned and strong than by just saying 'I have attitude'.
Comment: Why has this been downvoted? I've answered the question and given an explanation for why the meaning of 'having attitude' comes out particularly strongly in context and thus why this question is different to the previous question about having attitude. Also why was the answer below downvoted?


Does Buxus grow berries or flowers in the winter?

Question: Does all species of Buxus grow berries or flowers in the winter?
Comment: Your plant (in the other question) is not a Buxus: Buxus has opposite leaves, your plant has alternate leaves. The leave forms are similar to normal Buxus, but many Ilex (not the wild European one) have similar leaves.
Answer: Buxus flowers are rather insignificant; their seeds are in an not-very-noticeable fruit that quickly dries to a capsule. Here's an example. Note that this is a close-up of the flowers. If you're looking for a broadleaf evergreen with showy fruits, then you'd be better off with an Ilex.


Pictures of trigger point muscle fascia

Question: Are there any pictures of an actual trigger point looks like? All I am able to find online are animations.
Comment: I found plenty of pictures of therapists conducting trigger point therapy on their patients. Are you looking for a picture of the actual trigger point picture underneath the skin?
Comment: You can use @TheLastWord in your comment such that your comment will be seen in the inbox of the tagged user.
Comment: Yes, exactly...
Comment: @TheLastWord Yes, exactly.
Answer: You could have easily find these using a simple google search, however I will point several out:

See figure 1 of this article for an ultrasound image of a trigger point. Really interesting!
See figure 1 of this article for a schematic representation, and figure 2 for a real image. Although you did not ask for a deeper understanding of this topic, if you want to read more about it I would recommend reading this paper as it covers a lot of aspects (such as pain signals to the brain).
This article covers different imaging techniques and facilitates interpretation by using arrows to point out the trigger points.

If this is not what you are looking for please specify what you mean with "pictures"? (vibration sonoelastography, schematic, ultrasound, etc.) I cannot point you in a direction for real life images (if these even exist).
Comment: This is so insightful. Thanks for aggregating all of the info in this answer.

Pictures of trigger point muscle fascia


Why does Akrotiri and Dhekelia have a different relation to the EU than Gibraltar?

Question: Out of the British Overseas Territories, only Gibraltar is in the European Union.  Akrotiri and Dhekelia is also in Europe, at least according to the EU interpretation of admitting Cyprus as a member state.  Then why is the British Overseas Territory of Akrotiri and Dhekelia treated differently from Gibraltar?
Comment: Not a contrasted answer, but the wikipedia article (section Demographics) lists that the residents are either Cypriots or British military personnel and their families. Also `the United Kingdom is committed not to use the Areas for civilian purposes. This was stated in 2002 as the primary reason for the exclusion of the Areas from the scope of the British Overseas Territories Act 2002.` So basically, there are no natives "Akrotirians" or "Dhekelians".
Comment: Not sure whether that's the level of explanation you're seeking but one answer to the "why" question is "because the membership agreement for the UK (and probably for Cyprus too) provides for it". Accession treaties are full of minute technical provisions like that. Incidentally, the geographic location is neither here nor there, as you can see in the table some Portuguese or French territories are (almost) fully part of the EU.
Answer: As pointed out in the Wikipedia article that you point to Governance they are military bases only. Gibraltar on the other hand is a member under special rules covering its status as a colony of the UK. Gibraltar is not a member in the sense that the UK or France are members.
Gibraltar

Gibraltar is a British overseas territory. The British Nationality Act
  1981 granted Gibraltarians full British citizenship.
The governor enacts day-to-day matters on the advice of the Gibraltar
  Parliament, but is responsible to the British government in respect of
  defence, foreign policy, internal security and general good
  governance. Judicial and other appointments are made on behalf of the
  Queen in consultation with the head of the elected government.
Gibraltar is part of the European Union, having joined through the
  European Communities Act 1972 (UK), which gave effect to the Treaty of
  Accession 1972, as a dependent territory of the United Kingdom under
  what was then article 227(4) of the Treaty Establishing the European
  Community covering special member state territories, with exemption
  from some areas such as the Customs union and Common Agricultural
  Policy. After a 10-year campaign for the right to vote in European
  elections, since 2004 the people of Gibraltar have participated in
  elections for the European Parliament as part of the South West
  England constituency.[38]
The United Nations Committee on Decolonization includes Gibraltar on
  the United Nations list of Non-Self-Governing Territories.[39]
  Gibraltar has been on the list since December 1946.[40]

Governance

The basic philosophy of their administration was declared by Her
  Majesty's Government in 'Appendix O' to the 1960 treaty with Cyprus,
  which provided that the British government intended:
Not to develop the Sovereign Base Areas for other than military purposes.
Not to set up and administer "colonies".
Not to create customs posts or other frontier barriers between the Sovereign Base Areas and the Republic.
Not to set up or permit the establishment of civilian commercial or
  industrial enterprises except insofar as these are connected with
  military requirements, and not otherwise to impair the economic
  commercial or industrial unity and life of the Island.
Not to establish commercial or civilian seaports or airports.
Not to allow new settlement of people in the Sovereign Base Areas other
  than for temporary purposes.
Not to expropriate private property within the Sovereign Base Areas except for military purposes on payment of fair
  compensation.[19]
The ancient monuments and antiquity (in particular the site and remains of Curium, Sanctuary of Apollo Hylates near Curium, the
  Stadium of Curium and the Church and remains of the Monastery of St.
  Nicholas of the Cats) will be administered and maintained by the
  Republic of Cyprus. Licences for antiquity excavation will be issued
  by the Republic but will be subject to the consent of the authorities
  of the Sovereign Base Areas. Movable antiquities found in excavations
  or discovered will be the property of the Republic.[20]


What mean"subject" in the sentence?

Question: I have a problem in this sentence
I cannot understand the meaning of "subject" in the sentence:

Guthrie has also demonstrated that the landscape must have been subject to intense and continuous winds, especially in winter

As the Logman dictionary, "subject" can play roles as a noun, an adjective, and a verb, therefore this can different meanings. this word, subject, cannot be a verb because if it plays a role as a verb it should have been written in the past form.
Comment: Welcome to EL&U. Where did you get that sentence from? Did you copy it from somewhere or you wrote it yourself?
Comment: Welcome to English Language & Usage. Try looking up *subject to* as a phrase.
Comment: Thank you. I copy this text from a text
Answer: subject to

affected by or possibly affected by (something)
likely to do, have, or suffer from (something)
dependent on something else to happen or be true

Merriam-Webster
In the example sentence, definition 1 is in play. The landscape is affected by something, namely "intense and continuous winds."
Answer: In this sentence, "must have been subject to" means "must have been exposed to" and "must have been under".
If you translate the sentence word-by-word in order, you can guess the meaning.
"subject" is not a verb in this sentence. "have been" is the verb.
Answer: In your example, "subject" is an adjective: From the OED

Subject (adjective):
II. Expressing a relationship of liability, exposure, or dependence between a person or thing and a state, condition, or experience. Chiefly in predicative use, with to.
4.b Exposed to violent treatment, damaging weather, or the like.
1726   G. Leoni tr. L. B. Alberti Archit. I. 7   The Isle of Lemnos..being very subject to Lightning.
1907   Broad Views Feb. 143   Ferry boats cross 90 miles of the Michigan Lake,—subject to storms quite as violent as those which afflict the Channel.
2003   E. Mumford Redesigning Human Syst. iv. 58   The family of the 'black leg', who remained at work when others were on strike, was subject to abuse and ignominy.

What mean"subject" in the sentence?


Would a question about seemingly contradictory sources for voter fraud be on topic?

Question: With all that's been made of President Trump's voter fraud panel in the news recently, I was looking around the internet when I stumbled upon two seemingly contradictory sources regarding cases of voter fraud.  One source states that there have been less than 100 cases of voter fraud, whereas another claims more than 1000.  Would this be appropriate for our site?
Comment: Can you specify your question? Is the claim about the number of cases claimed by the Trump election commission (ie one sources says they claim to have found 100 cases, while another says that they claim 1000 found cases)? That would certainly be on-topic. Whether those numbers are actually true might be off-topic as it is about a current investigation. Can you add your sources here? That would make it easier to determine if this is on-topic or not.
Comment: @tim Trump isn't actually one of my sources.  The New York Times is one of the sources, although there are plenty that claim the less than 100 number.  The 1000+ is the Heritage Foundation, in a big PDF available on their website.
Answer: Yes, if you can link to the two sources and they are notable (e.g. widely read).
[I am already suspicious that they have some sort of caveats or qualifiers, so they aren't talking about the same thing, but my mind is open - a direct contradiction between two sources is always more fun.]
Comment: I agree, I'm pretty sure the two sources are using two different definitions.  One is the New York Times and the other is the Heritage Foundation.  Thank you, I'm going to put the question together in a bit.


Need to enforce data integrity using REST API

Question: We are consuming a REST API which created an insert on Lead object. We want to enforce data integrity from the external application to salesforce so that any field level changes on the external application throws a compile error in the salesforce side. I know this can be done easily with SOAP but the question is how can we enforce a data contract between Salesforce and external application using REST API?
 Can we create a JSON object structure on the legacy application which would be referenced as an object in the salesforce side and data sent as a JSON Post? The goal is to enforce field level changes on both applications consistently instead of loose coupling which REST provides? Any thoughts?
Buyan
Answer: Not sure exactly what you are planning, but any validation that you implement in Force.com, e.g. in a Validation Rule or Trigger, is enforced on all access, whether in the browser or via the SOAP or REST APIs.
Answer: An invalid xml/json request will return a 400 error to the calling application. This is the most of a "contract" that you can feasibly have with salesforce.com, because the service itself is compiled only when changes occur, not on each request. You could generate a WADL/WSDL that describes the contract between salesforce.com and your external system, but that would only cause a compilation error in your external application, not in salesforce.com.
Comment: Thanks for your reply. Since the data contract resides in the external application, is there a way to create the compilation error in salesforce so that we can get the modified changes and fix salesforce call out instead of external application? Do you have any sample code or links which describes the contract?
Comment: Not for REST applications, unless you can manage to import a REST WSDL (which I don't think you can yet). But a simple change in the external system won't trigger a compilation error in salesforce.com anyways, because salesforce.com doesn't recompile code for no reason, and it has no way to dynamically load the contract and compile against it. You will, however, get an error that you could send an email for once a break occurs-- like I said, you'll get an appropriate error message from the system when the data no longer matches up correctly.


My mint plant leaves are slightly yellowish and seems to be dropping. Does anyone know why is this so?

Question: I bought my mint plant somewhere in January, but now I noticed the mint plant's stem are very long, and the leaves are slightly yellowish. The leaves are very fragile, and soft, not strong like they used to be. The plant also seem to be drooping slightly. What should I do?
Comment: It is likely that the long stems are the result of insufficient light. For the fragile leaves it would be easier if you could upload a picture so that we can see the plant and even the pot, otherwise there are too many possible answers.
Comment: Northern or Southern hemisphere? Plant is indoors or outdoors? In ground or potted? I'd guess at Northern, indoors, potted, and desperate for light, But I'm guessing, since you didn't mention these things.
Answer: From the stem length detail, I would conclude that it's lack of light. If it's inside, mint likes morning sun but the afternoon sun can dry it out in the pot. Make sure it stays moist if inside.


Coulomb's law and Plasma

Question: Does Coulomb's law apply to Plasma?
Comment: What is Your problem? Coulombs law is for any kind of  charge. Why do You ask?
Comment: @Georg Thank mate. I want to know that, is it applicable for Plasma charge or not? You give the answer. You should give it as an answer.
Comment: @Georg Coulomb's law does not apply to any kind of charge because it is only the static limit of Maxwell's equations.  If you want to know about electrodynamics in a plasma, Coulomb's law is not the tool to use.
Comment: Coulomb's law is the reason for plasma oscillations having a finite frequency at long wavelengths. This is a classical indication that there is such a thing as the Higgs mechanism.
Answer: You will be enlightened by this article in wikipedia:

Except near the electrodes, where there are sheaths containing very few electrons, the ionized gas contains ions and electrons in about equal numbers so that the resultant space charge is very small. We shall use the name plasma to describe this region containing balanced charges of ions and electrons.[4]

So plasma is mainly neutral, viewed from afar. Coulombs law applies within the plasma for each individual ion and electron, in a many body statistical conglomerate, a different phase of matter.
Thus it will depend on the problem you want to solve whether coulomb's law should be used explicitly, for example near electrodes, or conducting surfaces.
Answer: To add a little info about the very good answer of anna v, I will say that in plasmas, a very common parameter is the Debye Length. This length can be referred to as the "characteristic length after which the charge of a charged particle in the plasma, in efficiently screened by it". To summarize, if Coulomb's law features a potential varying as 1/r, where "r" is the distance to the charged particle, in plasmas this potential, due to a single charged particle immersed in the plasma, goes like (1/r)*exp(-r/lambda_D) where lambda_D is the Debye length. So, to the 1/r dependency, plasma adds exponential decay, which is a lot stronger. This is why we speak of screening of the field due to an electrode, or to a probe, or to some charged dust particle, or to a single ion, after "a few Debye Lengths" (thus the "Debye Sphere" mentionned in the wikipedia article mentionned by anna v).
So, short answer: in plasmas replace 1/r by (1/r)*exp(-r/lambda_D) in the potential created by a point charge, in the derivation of Coulomb's law.

Coulomb's law and Plasma


Boolean Problems

Question: I'm trying to create a sort of cup for printing. I started with a sphere and then a smaller sphere and Boolean differenced to get a hollow sphere. Then I wanted to cut an off-center hole in the hollow sphere by using a sphere or cylinder. I tried to do this again with boolean difference but now it looks like this
How do I join the two together/make faces between the two layers? Or am I just going about designing this all wrong?
Answer: I think it's better do all the modelling without thickness and, once finished, apply a "solidify" modifier that will give you the needed inner face. Also the booleans operations, as they create "bad" geometry (triangles, Ngons, no edge loops) should be avoided if possible: the image illustrate a quick way to join a circle (8 vertices) to a mesh sphere (Bridge edge loops) and the result after subsurf and solidify modifier, 2 minutes of modelling.

Another shape obtained with the solidify + subsurf from an UV sphere:
Comment: This is what I understood from your response http://i.imgur.com/PBPgfqW.png I'm not sure how to get the cut out to be more or less where I had it in the original post especially as the circle that I created doesn't exactly line up with the surface of the sphere
Comment: I'm essentially looking to model this http://i.imgur.com/VrI1oLx.png
Comment: Take an UV sphere, delete  some top vertices, apply a solidify modifier, insert some additional loop cut near the edges, add a subsurf modifier, then rotate the mesh in the needed direction. If you want to make the cut in position you will need al lot more of geometry to get a similar result, and you will have to start with an icosphere and boolean cut it with a rotated cube. 10.000 vertices with the first method are smoother than 150.000 with the second. See my updated answer for references.
Comment: To flaten the bottom, once you rotated and subdivided but before solidifying, box select some bottom vertices, scale Z zero and move in the appropriate Z location.
Answer: Two methods come to mind instantly. The first is manually, where you selest one or two vertices on one loop, either the inner or outer, then select a vertex (if you want the resulting face to be a triangle) or two (if you want the resulting face to be a quad), continuing aroud the the edges until the two loops are bridged. Another may require some fiddling. Select a segment of the loop around the hole in the inner sphere and a segment of the loop around the hole in the outer one, select the two edge loops, and bridge them. The fiddling will be obligatory if the inner and outer loops do not have the same number of segments.

Boolean Problems