What do the terms "CPU bound" and "I/O bound" mean?

Question: What do the terms "CPU bound" and "I/O bound" mean?
Comment: If Memory bound its a problem: http://stackoverflow.com/questions/11831844/unobservedtaskexception-being-throw-but-it-is-handled-by-a-taskscheduler-unobser?lq=1
Answer: It's pretty intuitive:
A program is CPU bound if it would go faster if the CPU were faster, i.e. it spends the majority of its time simply using the CPU (doing calculations). A program that computes new digits of π will typically be CPU-bound, it's just crunching numbers.
A program is I/O bound if it would go faster if the I/O subsystem was faster. Which exact I/O system is meant can vary; I typically associate it with the disk, but of course, networking or communication, in general, is common too. A program that looks through a huge file for some data might become I/O bound since the bottleneck is then the reading of the data from disk (actually, this example is perhaps kind of old-fashioned these days with hundreds of MB/s coming in from SSDs).
Comment: I/O is "input/output".
Comment: `old-fashioned` no it's not, bandwidth isn't latency.
Comment: How does this tie into understanding HTTP communication on a mobile device?  I've seen CPU usage spike from using **java.nio** operations.
Comment: Computing new digits of π is 100% IO-bound. In fact, it's generally not even possible to do the calculations in RAM, even with hundreds of GB -- you need swap, and that means fast SSDs. (This makes sense -- you need to generate trillions of digits, and the digits depend on one another.)
Comment: @Charles true enough for _new_ digits of pi, though it'd apply for just any digits (i.e., crunching numbers, as the author stated). I'd say given the age of the answer, you could probably snip the "new" part from the answer here without changing the author's intent.
Comment: @Rogue The answer gives only one example of a CPU-bound task, and it's one where increasing disk speed by 10% would increase speed by 10%, but you couldn't get that much speed improvement by increasing the CPU by a factor of 1000. It's not a good example.
Answer: CPU Bound means the rate at which process progresses is limited by the speed of the CPU. A task that performs calculations on a small set of numbers, for example multiplying small matrices, is likely to be CPU bound.
I/O Bound means the rate at which a process progresses is limited by the speed of the I/O subsystem. A task that processes data from disk, for example, counting the number of lines in a file is likely to be I/O bound.
Memory bound means the rate at which a process progresses is limited by the amount memory available and the speed of that memory access.  A task that processes large amounts of in memory data, for example multiplying large matrices, is likely to be Memory Bound.
Cache bound means the rate at which a process progress is limited by the amount and speed of the cache available.  A task that simply processes more data than fits in the cache will be cache bound.
I/O Bound would be slower than Memory Bound would be slower than Cache Bound would be slower than CPU Bound.
The solution to being I/O bound isn't necessarily to get more Memory. In some situations, the access algorithm could be designed around the I/O, Memory or Cache limitations.  See  Cache Oblivious Algorithms.
Comment: thanks for the clear and useful summary esp. on the reference to Cache Oblivious Algorithms
Answer: Multi-threading is where it tends to matter the most
In this answer, I will investigate one important use case of distinguishing between CPU vs IO bounded work: when writing multi-threaded code.
RAM I/O bound example: Vector Sum
Consider a program that sums all the values of a single vector:
#define SIZE 1000000000
unsigned int is[SIZE];
unsigned int sum = 0;
size_t i = 0;
for (i = 0; i < SIZE; i++)
    /* Each one of those requires a RAM access! */
    sum += is[i]

Parallelizing that by splitting the array equally for each of your cores is of limited usefulness on common modern desktops.
For example, on my Ubuntu 19.04, Lenovo ThinkPad P51 laptop with CPU: Intel Core i7-7820HQ CPU (4 cores / 8 threads), RAM: 2x Samsung M471A2K43BB1-CRC (2x 16GiB) I get results like this:

Plot data.
Note that there is a lot of variance between run however. But I can't increase the array size much further since I'm already at 8GiB, and I'm not in the mood for statistics across multiple runs today. This seemed however like a typical run after doing many manual runs.
Benchmark code:

POSIX C pthread source code used in the graph.
And here is a C++ version that produces analogous results.

plot script

I don't know enough computer architecture to fully explain the shape of the curve, but one thing is clear: the computation does not become 8x faster as naively expected due to me using all my 8 threads! For some reason, 2 and 3 threads was the optimum, and adding more just makes things much slower.
Compare this to CPU bound work, which actually does get 8 times faster: What do 'real', 'user' and 'sys' mean in the output of time(1)?
The reason it is all processors share a single memory bus linking to RAM:
CPU 1   --\    Bus    +-----+
CPU 2   ---\__________| RAM |
...     ---/          +-----+
CPU N   --/

so the memory bus quickly becomes the bottleneck, not the CPU.
This happens because adding two numbers takes a single CPU cycle, memory reads take about 100 CPU cycles in 2016 hardware.
So the CPU work done per byte of input data is too small, and we call this an IO-bound process.
The only way to speed up that computation further, would be to speed up individual memory accesses with new memory hardware, e.g. Multi-channel memory.
Upgrading to a faster CPU clock for example would not be very useful.
Other examples

matrix multiplication is CPU-bound on RAM and GPUs. The input contains:
2 * N**2

numbers, but:
N ** 3

multiplications are done, and that is enough for parallelization to be worth it for practical large N.
This is why parallel CPU matrix multiplication libraries like the following exist:

http://www.netlib.org/scalapack/pblas_qref.html
http://icl.cs.utk.edu/magma/software/

Cache usage makes a big difference to the speed of implementations. See for example this didactic GPU comparison example.
See also:

Why can GPU do matrix multiplication faster than CPU?
BLAS equivalent of a LAPACK function for GPUs

Networking is the prototypical IO-bound example.
Even when we send a single byte of data, it still takes a large time to reach it's destination.
Parallelizing small network requests like HTTP requests can offer a huge performance gains.
If the network is already at full capacity (e.g. downloading a torrent), parallelization can still increase improve the latency (e.g. you can load a web page "at the same time").

A dummy C++ CPU bound operation that takes one number and crunches it a lot:

serial
parallel

Sorting appears to be CPU based on the following experiment: Are C++17 Parallel Algorithms implemented already? which showed a 4x performance improvement for parallel sort, but I would like to have a more theoretical confirmation as well

The well known Coremark benchmark from EEMBC explicitly checks how well a suite of problems scale. Sample benchmark result clearing showing that:
Workload Name                                     (iter/s)   (iter/s)    Scaling
----------------------------------------------- ---------- ---------- ----------
cjpeg-rose7-preset                                  526.32     178.57       2.95
core                                                  7.39       2.16       3.42
linear_alg-mid-100x100-sp                           684.93     238.10       2.88
loops-all-mid-10k-sp                                 27.65       7.80       3.54
nnet_test                                            32.79      10.57       3.10
parser-125k                                          71.43      25.00       2.86
radix2-big-64k                                     2320.19     623.44       3.72
sha-test                                            555.56     227.27       2.44
zip-test                                            363.64     166.67       2.18

MARK RESULTS TABLE

Mark Name                                        MultiCore SingleCore    Scaling
----------------------------------------------- ---------- ---------- ----------
CoreMark-PRO                                      18743.79    6306.76       2.97

the linking of a C++ program can be parallelized to a certain degree: Can gcc use multiple cores when linking?

rigid body dynamics, sometimes used in game engines, can be parallelized and sped up on the GPU, e.g. MuJoCo and PhysX both support it

How to find out if you are CPU or IO bound
Non-RAM IO bound like disk, network: ps aux, then check if CPU% / 100 < n threads. If yes, you are IO bound, e.g. blocking reads are just waiting for data and the scheduler is skipping that process. Then use further tools like sudo iotop to decide which IO is the problem exactly.
Or, if execution is quick, and you parametrize the number of threads, you can see it easily from time that performance improves as the number of threads increases for CPU bound work: What do 'real', 'user' and 'sys' mean in the output of time(1)?
RAM-IO bound: harder to tell, as RAM wait time it is included in CPU% measurements, see also:

How to check if app is cpu-bound or memory-bound?
https://askubuntu.com/questions/1540/how-can-i-find-out-if-a-process-is-cpu-memory-or-disk-bound

Some options:

Intel Advisor Roofline (non-free): https://software.intel.com/en-us/articles/intel-advisor-roofline (archive) "A Roofline chart is a visual representation of application performance in relation to hardware limitations, including memory bandwidth and computational peaks."

GPUs
GPUs have an IO bottleneck when you first transfer the input data from the regular CPU readable RAM to the GPU.
Therefore, GPUs can only be better than CPUs for CPU bound applications.
Once the data is transferred to the GPU however, it can operate on those bytes faster than the CPU can, because the GPU:

has more data localization than most CPU systems, and so data can be accessed faster for some cores than others

exploits data parallelism and sacrifices latency by just skipping over any data that is not ready to be operated on immediately.
Since the GPU has to operate on large parallel input data, it is better to just skip to the next data that might be available instead of waiting for the current data to be come available and block all other operations like the CPU mostly does

Therefore the GPU can be faster then a CPU if your application:

can be highly parallelized: different chunks of data can be treated separately from one another at the same time
requires a large enough number of operations per input byte (unlike e.g. vector addition which does one addition per byte only)
there is a large number of input bytes

These designs choices originally targeted the application of 3D rendering, whose main steps are as shown at What are shaders in OpenGL and what do we need them for?

vertex shader: multiplying a bunch of 1x4 vectors by a 4x4 matrix
fragment shader: calculate the color of each pixel of a triangle based on its relative position withing the triangle

and so we conclude that those applications are CPU-bound.
With the advent of programmable GPGPU, we can observe several GPGPU applications that serve as examples of CPU bound operations:

Image Processing with GLSL shaders?

Local image processing operations such as a blur filter are highly parallel in nature.

Is it possible to build a heatmap from point data at 60 times per second?
Plotting of heatmap graphs if the plotted function is complex enough.

https://www.youtube.com/watch?v=fE0P6H8eK4I "Real-Time Fluid Dynamics: CPU vs GPU" by Jesús Martín Berlanga
Solving partial differential equations such as the Navier Stokes equation of fluid dynamics:

highly parallel in nature, because each point only interacts with their neighbour
there tend to be enough operations per byte

See also:

Why are we still using CPUs instead of GPUs?
What are GPUs bad at?
https://www.youtube.com/watch?v=_cyVDoyI6NE "CPU vs GPU (What's the Difference?) - Computerphile"

CPython Global Intepreter Lock (GIL)
As a quick case study, I want to point out to the Python Global Interpreter Lock (GIL): What is the global interpreter lock (GIL) in CPython?
This CPython implementation detail prevents multiple Python threads from efficiently using CPU-bound work. The CPython docs say:

CPython implementation detail: In CPython, due to the Global Interpreter Lock, only one thread can execute Python code at once (even though certain performance-oriented libraries might overcome this limitation). If you want your application to make better use of the computational resources of multi-core machines, you are advised to use multiprocessing or concurrent.futures.ProcessPoolExecutor. However, threading is still an appropriate model if you want to run multiple I/O-bound tasks simultaneously.

Therefore, here we have an example where CPU-bound content is not suitable and I/O bound is.
JavaScript async and Node.js worker_threads
The situation is similar to Python's.
JavaScript is fundamentally single threaded. Not sure if this is part of the language standard or not (for Python it is not, there isn't even a language standard besides the reference CPython implementation AFAIK).
JavaScript has the async keyword which allows execution to stall, and it then it start executing something else. You can write stuff like:
async function myfunc(init) {
  ret = init
  for (let i = 0; i < 1000000; i++) {
    ret += i*i + 2*i + 3
  }
  return ret;
}

async function doNetworkRequest(init) {
  // Some native method that gets network data.
}

const [first, second, myfunc_ret1, myfunc_ret2] = await Promise.all([
  doNetworkRequest('example.com'),
  doNetworkRequest('example2.com'),
  myfunc(1),
  myfunc(2),
])

where await says "wait for all these async things to finish before moving on".
However, only one of the async methods can run at a time on your CPU, so the CPU intensive work of myfunc does not get sped up by this at all.
The prototypically IO bound operation of network access however can get sped up, as this would fire both network requests one after the other, and just wait for both to return while the servers/network do the work.
The fact that there is an actual keyword in the language dedicated for this, async, is telling: unsurprisingly, network requests are very important in the browser dominated context of JavaScript.
With the advent of Node.js however, people started to want to parallelize CPU workload as well more and more, and they reached a similar solution to CPython: create separate processes rather than threads. This is done with the worker_threads library, which:

actually takes a JavaScript script path as input, and launches a new interpreter instance to run it
since the processes don't share memory space, you pass messages between instances with a messaging system

https://medium.com/@Trott/using-worker-threads-in-node-js-80494136dbb6 contains a good example.
The documentation of worker_threads once more states the difference as mentioned elsewhere in this answer:

Workers (threads) are useful for performing CPU-intensive JavaScript operations. They do not help much with I/O-intensive work. The Node.js built-in asynchronous I/O operations are more efficient than Workers can be.

On the browser there's also Web Workers, not sure how it compares to Node's implementation: What's the difference between Web Workers and Worker Threads?
Comment: Man, how do you manage to be so competent and give a write like this one?
Comment: @MikayilAbdullayev thanks! I tend to only answer "important questions" and I tend to come back to them over and over as I learn new relevant stuff.
Comment: @CiroSantilliOurBigBook.com ~Hats off bro!
Answer: CPU bound means the program is bottlenecked by the CPU, or central processing unit, while I/O bound means the program is bottlenecked by I/O, or input/output, such as reading or writing to disk, network, etc.
In general, when optimizing computer programs, one tries to seek out the bottleneck and eliminate it.  Knowing that your program is CPU bound helps, so that one doesn't unnecessarily optimize something else.
[And by "bottleneck", I mean the thing that makes your program go slower than it otherwise would have.]
Answer: Another way to phrase the same idea:

If speeding up the CPU doesn't speed up your program, it may be I/O bound.
If speeding up the I/O (e.g. using a faster disk) doesn't help, your program may be CPU bound.

(I used "may be" because you need to take other resources into account. Memory is one example.)
Answer: When your program is waiting for I/O (ie. a disk read/write or network read/write etc), the CPU is free to do other tasks even if your program is stopped.  The speed of your program will mostly depend on how fast that IO can happen, and if you want to speed it up you will need to speed up the I/O.
If your program is running lots of program instructions and not waiting for I/O, then it is said to be CPU bound.  Speeding up the CPU will make the program run faster.
In either case, the key to speeding up the program might not be to speed up the hardware, but to optimize the program to reduce the amount of IO or CPU it needs, or to have it do I/O while it also does CPU intensive stuff.
Answer: IO bound processes: spend more time doing IO than computations, have many
short CPU bursts.
CPU bound processes: spend more time doing computations, few very long CPU bursts
Answer: See what Microsoft says.

The core of async programming is the Task and Task objects, which
  model asynchronous operations. They are supported by the async and
  await keywords. The model is fairly simple in most cases:

For I/O-bound code, you await an operation which returns a Task or
  Task inside of an async method.
For CPU-bound code, you await an operation which is started on a
  background thread with the Task.Run method.

The await keyword is where the magic happens. It yields control to the
  caller of the method that performed await, and it ultimately allows a
  UI to be responsive or a service to be elastic.

I/O-Bound Example: Downloading data from a web service
private readonly HttpClient _httpClient = new HttpClient();

downloadButton.Clicked += async (o, e) =>
{
    // This line will yield control to the UI as the request
    // from the web service is happening.
    //
    // The UI thread is now free to perform other work.
    var stringData = await _httpClient.GetStringAsync(URL);
    DoSomethingWithData(stringData);
};

CPU-bound Example: Performing a Calculation for a Game
private DamageResult CalculateDamageDone()
{
    // Code omitted:
    //
    // Does an expensive calculation and returns
    // the result of that calculation.
}

calculateButton.Clicked += async (o, e) =>
{
    // This line will yield control to the UI while CalculateDamageDone()
    // performs its work.  The UI thread is free to perform other work.
    var damageResult = await Task.Run(() => CalculateDamageDone());
    DisplayDamage(damageResult);
};

Examples above showed how you can use async and
  await for I/O-bound and CPU-bound work. It's key that you can identify
  when a job you need to do is I/O-bound or CPU-bound, because it can
  greatly affect the performance of your code and could potentially lead
  to misusing certain constructs.
Here are two questions you should ask before you write any code:
Will your code be "waiting" for something, such as data from a
  database?

If your answer is "yes", then your work is I/O-bound.

Will your code be performing a very expensive computation?

If you answered "yes", then your work is CPU-bound.

If the work you have is I/O-bound, use async and await without
Task.Run. You should not use the Task Parallel Library. The reason for
  this is outlined in the Async in Depth article.
If the work you have is CPU-bound and you care about responsiveness,
  use async and await but spawn the work off on another thread with
  Task.Run. If the work is appropriate for concurrency and parallelism,
  you should also consider using the Task Parallel Library.
Answer: I/O bound refers to a condition in which the time it takes to complete a computation is determined principally by the period spent waiting for input/output operations to be completed.
This is the opposite of a task being CPU bound. This circumstance arises when the rate at which data is requested is slower than the rate it is consumed or, in other words, more time is spent requesting data than processing it.
Answer: An application is CPU-bound when the arithmetic/logical/floating-point (A/L/FP) performance during the execution is mostly near the theoretical peak-performance of the processor (data provided by the manufacturer and determined by the characteristics of the processor: number of cores, frequency, registers, ALUs, FPUs, etc.).
The peek performance is very difficult to be achieved in real-world applications, for not saying impossible. Most of the applications access memory in different parts of the execution and the processor is not doing A/L/FP operations during several cycles. This is called Von Neumann Limitation due to the distance that exists between the memory and the processor.
If you want to be near the CPU peak-performance a strategy could be to try to reuse most of the data in the cache memory in order to avoid requiring data from the main memory. An algorithm that exploits this feature is the matrix-matrix multiplication (if both matrices can be stored in the cache memory). This happens because if the matrices are size n x n then you need to do about 2 n^3 operations using only 2 n^2 FP numbers of data. On the other hand matrix addition, for example, is a less CPU-bound or a more memory-bound application than the matrix multiplication since it requires only n^2 FLOPs with the same data.
In the following figure the FLOPs obtained with a naive algorithms for the matrix addition and the matrix multiplication in an Intel i5-9300H, is shown:

Note that as expected the performance of the matrix multiplication in bigger than the matrix addition. These results can be reproduced by running test/gemm and test/matadd available in this repository.
I suggest also to see the video given by J. Dongarra about this effect.
Answer: I/O Bound process:- If most part of the lifetime of a process is spent in i/o state, then the process is a i/o bound process.example:-calculator,internet explorer
CPU Bound process:- If most part of the process life is spent in cpu,then it is cpu bound process.
Comment: How would the calculator be an IO bound process? Surely it would be CPU bound. If your calculator spends most of it's time blocked by accessing the network or disk then I'd suggest something is wrong with it.
Comment: I thought the calculator example was clear: most of the time its waitin for the user to press a button, thus waitin for I/O.
Comment: @psp is right but the calculator example is still superficially hard to see as io bound because of its name, "calculator." That implies that the program's chief purpose is to perform long cpu calculations, but if you look at your calculator on your desktop it's a very simple one that only does calculations that take nanoseconds to complete. Thus most of the time it's waiting for user input, which is IO.


Truck still overheating after radiator and thermostat replacement

Question: 2000 Chevrolet Silverado 5.3 overheating drove vehicle to work and blew the top of my radiator.   So i replace the rad. And thermostat thinking that's my problem.   Bleed the system turn on heater in vehicle waited to get heat no heat at all bleed system again. I revved the engine: nothing. Could my heater core be causing my overheating problem?
Comment: Exactly how are you bleeding the system?
Comment: If the heater core was broken/clogged, the truck wouldn't overheat, but you might not get heat in the cabin. As soon as the truck warmed up, the thermostat would open, which would allow hot coolant to enter the radiator, and cold coolant from the radiator would get sucked into the engine.
Answer: did you try leaving the rad cap off when first cranking the engine waiting until the thermostat opens to see if the coolant is circulating ...may be the water pump impeller thats defective...if no movement then chances are the water pump is shot
Answer: My guess would be the water pump is broken.
This would explain why you aren't getting any heat; the water pump isn't pushing hot coolant to the heater core.
It would also explain why the engine is overheating even after you replaced the thermostat; the water pump isn't pushing/pulling enough hot/cold coolant out of/into the engine
This should be easy to test. When the truck is cold, start the engine. The thermostat probably won't open for a couple minutes, so the water pump will only be pumping coolant to the heater core. Locate the heater core inlet and outlet hoses on the firewall (probably to the left of the engine?). Unplug both hoses from the heater core. If the water pump is working fine, the hose which takes hot coolant out of the engine will start shooting coolant everywhere.


Is there a package for using SQL to manipulate Pandas dataframes in Python?

Question: Rather than learn a new package/language, I'd like to use my existing SQL skills to manipulate pandas dataframes in Python. Does anyone know of a way to do this, or perhaps a package that will allow me to do this?
Comment: I am unfamiliar with an SQL language implementation for pandas.  Closest I might be able to get you is: https://pandas.pydata.org/pandas-docs/stable/comparison_with_sql.html
Answer: I found a package called pandasql, which is based on sqldf for R. It seems quite a bit slower than doing the transformations with the pandas package, but it gets the job done. Just put the SQL query into a string like this:
query_string = """
    select * from df
"""

Then use the string in the pandasql.sqldf package, as follows:
new_dataframe = pandasql.sqldf(query_string, globals())

Choose globals() or locals(), depending on the scope you want for your variables.
As I mentioned, it seems a bit slow, but I couldn't find anything else. I may use this from time to time until I become better at Pandas.
Sean
Answer: Based on my experience you can almost do everything that can be done using pandas in your sql. I've not seen recent versions of pandas but I remember that sql is even better because using pandas you are restricted to the size of memory. If memory fills out you may crash, something that does not happen using sql commands. You can save your pandas data frame in a csv file and manipulate that csv file using your sql. This link and also here may help you. Also for importing your csv file to your sql, you have not specified what sql you have but this link may help you. Other sqls also provide this behavior.
Comment: @Sean_Calgary If you are using big data, I recommend you using your sql. I forget to say this in the answer :)
Comment: Thanks for the answer. My data are already in a pandas dataframe for various reasons. I'd rather not export to CSV, run my SQL, and then import again... Thanks though! I'll check out your helpful links.
Answer: There's actually a new package called dataframe_sql that does just what you're looking for. It's different from Pandasql in that it translates sql directly to pandas methods, which eliminates the slow down caused by that package. If you want information about installation or how it works you can check it out here
Answer: You can use the below option for Google BigQuery SQL:
import pandas as pd
from google.cloud import bigquery

selectQuery = """SELECT * FROM mydataset.mytable"""
bigqueryClient = bigquery.Client()
df = bigqueryClient.query(selectQuery).to_dataframe()
print(df)


Reasonable Number of Directed Graph Nodes and Edges

Question: How many directed graph nodes are typically represented in the browser? I'm working with some large data-sets with nodes and edges more then 400,000. I'm wondering if I am going down a fruitless path trying to represent them in the browser via arbor.js or similar JS libraries. What's the most effective way to allow a large number(large relative to my domain of real estate transactions, maybe 1-10,000) of users to visualize and browse a large directed graph of up to 500,000 records?
Answer: Limiting what is shown on screen is a necessity with that large of a graph, not only for performance reasons, but you would cause information overload for users. depending on how this information is used there are a few different way to determine what to display.

If you need to show how to get from A to B.

Show only nodes and edges on the "best" path(s) however best is determined.

If users need to navigate from node to node.

show only current node and connected nodes.

Optionally only show incoming/outgoing connections
Answer: You're asking way too much from JavaScript (an interpreted language), and the amount of data you're trying to transfer will take a while to load.
The Web is not really designed for this.  Ryathal has the conventional Web solution, and if it's good enough you'll save yourself a lot of grief by using it instead of something fancier.  The browser end shouldn't be too bad.  You'll need a serious program on the server to locate and grab the right bits of the network, but you'll need that anyway.
I suspect what you want is a desktop app.  Then you can devise a fancy display connected to megabytes of data.  I'll state what I know about this approach and hopefully inspire people who know more to say something--or inspire you to stick with the conventional Web solution:
Java has its Web Start and Applets (though I've never heard of anyone doing anything big with applets), and there are ways to move an .exe over the web.  Silverlight ought to work here theoretically, as either a slicker Applet or JavaScript-replaced-with-a-compiled-language, but I don't think Microsoft intended it to be used this way.  A socket connection can move data faster than a normal web connection.  None of this will be transparent to the user (though Silverlight would come close), it will all take time to start up, and, worse, all of it will cause security problems.  If your clients are desperate for your solution you'll do okay here; your competitors have nothing better.  If you're trying to lure people away from YouTube and Facebook, forget it.
Comment: I'm displaying a network of real estate transactions. I won't expect a lot of users, just a lot of data to each user. I'll focus on filtering what is sent to the browser.
Answer: I would tend to think that javascript has grown up to where it can handle these issues and SVG (finally) is getting real momentum.
Check out d3 and browse around.  Directed graph might not be your best option.  Be sure to check out hive plots and this example. Matrix, cord diagrams. Very cool stuff out there.


How do you make the green beans served at Din Tai Fung?

Question: Does anyone know how to make these?  I'm pretty sure they are just blanched and fried (w/garlic), but I can't seem to get it right.
Answer: I think the problem lies in that the beans are not water blanched, but rather oil blanched.  The technique is called "dry frying", and is a traditional Sichuan cooking method.  The oil temp is kept low to dry out the inside while cooking the outside of the food.  After the dry frying you can then stir fry the food.  This technique should give you the required look and texture to the food.  Hope this helps.
Comment: At what temperature and for how long? Will the color stay as vivid as the pictures?
Comment: Dry frying is much lower temp than deep frying.  I say around 220-225 degrees, which is higher than boiling water (212 degrees). You will have to experiment with time, but I would say try starting with about 5-8 minutes.  Stir often to keep things heating evenly. Drain well, then you can just add it back into a empty hot wok and then start with the rest of the recipe.  I think this will give you the texture and flavor you are looking for.  In my experience, this technique gives you very dark green beans that are crispy outside (from stir frying in high heat) and dry inside from this method.
Comment: That makes sense as it is a Taiwanese chain.  Anyways, I will try this post back times and temps when I get it right.  Thank you both JG sd and Jolenealaska.
Answer: This picture is from a menu online. Does this look like what you are trying to make?

If so, I think you're right, they're just blanched and stir-fried with garlic. Be sure you're salting the blanching water, shock them in ice water and allow them to thoroughly drain. Mince a couple of cloves of garlic, stir-fry the garlic for several seconds in a small amount of hot, almost smoking neutral oil (peanut oil would be a good choice), add the beans and stir-fry until hot. Salt to taste. The picture doesn't look like it's anything more than that, but I haven't tried them. Are you picking up other flavors?
Comment: If they are fried only, instead of blanched, I would expect to see some brownness and less vivid green. If you're not getting as much crunch as you want, I suspect that you are cooking them too long in the water. Bring a large pot of well salted water to a full boil, add the beans, stir for 30 seconds or *even less*. Drain and get them *right* into ice water. Is that close to what you have tried? Also, be sure that the stir-fry oil is very hot.
Comment: Yeah, I've tried that but it just doesn't have the same crunch.  I just read somewhere that they might be frying (in place of blanching) then stir-frying- would that make sense?
Comment: Yes, you have been very helpful, thank you.  I'll try the quicker blanch this weekend.  Here is the link I was talking about (with a picture) about 3/4 down the page:  http://spencerhgray.com/2011/06/20/din-tai-fung-dumpling-paradise/
Comment: @justin The skin looks a bit more wrinkled in that picture than in mine but they still look too green to only be fried. In that picture they also look like they might be lightly glazed, perhaps with a small amount of honey or mirin. Do you taste any sweetness? Or sense any stickiness?
Answer: I too have been looking for the recipe for string beans from din tai fung and although I haven't found the exact recipe, I figured more than half the battle was getting the right texture for the beans.  Alas, I came across this blog which most closely resembles what we're looking for: http://userealbutter.com/2011/06/20/chinese-dry-cooked-string-beans-recipe/
The technique described there is to first wash, trim and pat dry the beans. Then they are deep fried in oil, uncrowded, 3-4 min per batch.
I know this post has been inactive for a while but I was so happy I found it that I wanted to share, as I am sure there are others searching for the same thing!
Comment: Hello @Rebecca. Welcome to Seasoned Advice!
Comment: Hello Rebecca, and welcome. We are glad that you are sharing this example with us. But links do become inaccessible over time, and our users like to know a bit more about the content before going to the other site. So, our rule is that we summarize the content of articles we find elsewhere in our own answer, pointing out the most important insights from there. For a short guide on posting on our site, you can see http://cooking.stackexchange.com/help/how-to-answer.
Answer: They also use reduced chicken stock.
Comment: Could you elaborate? Do you mean the beans are blanced in reduced chicken stock? Or what do you mean?


Errors  when installing Mysql Server 5.1

Question: I'm trying to install mysql server,and I'm getting the following error.
sudo apt-get install mysql-server-5.1
Reading package lists... Done

Building dependency tree

Reading state information... Done

Suggested packages:

  tinyca mailx
The following NEW packages will be installed:

  mysql-server-5.1

0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.

Need to get 0 B/6,259 kB of archives.

After this operation, 13.6 MB of additional disk space will be used.

Preconfiguring packages ...

Selecting previously deselected package mysql-server-5.1.

(Reading database ... 158432 files and directories currently installed.)

Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.62-0ubuntu0.11.10.1_i386.deb)
...

Processing triggers for man-db ...

Processing triggers for ureadahead ...

Setting up mysql-server-5.1 (5.1.62-0ubuntu0.11.10.1) ...

120427 19:04:07 [Note] Plugin 'FEDERATED' is disabled.

120427 19:04:07  InnoDB: Initializing buffer pool, size = 8.0M

120427 19:04:07  InnoDB: Completed initialization of buffer pool

120427 19:04:07  InnoDB: Started; log sequence number 0 44233

120427 19:04:07  InnoDB: Starting shutdown...

120427 19:04:13  InnoDB: Shutdown completed; log sequence number 0 44233

start: Job failed to start

invoke-rc.d: initscript mysql, action "start" failed.

dpkg: error processing mysql-server-5.1 (--configure):

 subprocess installed post-installation script returned error exit status 1

Errors were encountered while processing:
 mysql-server-5.1

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

How can i install mysql-server? Someone pls help me
Answer: Try this:
sudo mv /etc/mysql/my.cnf /etc/mysql/my.cnf.bak; sudo apt-get install --reinstall mysql-server-5.1 mysql-server-core-5.1 mysql-client-5.1

Comment: same error again :(

Errors  when installing Mysql Server 5.1


Ford-Fulkerson Algorithm not "pushing back" flow

Question: I am told that with every flow network, the Ford-Fulkerson algorithm produces an execution that never decreases the value of the flow on any of the edges (i.e. never "pushes back" the flow on any of the edges). I am wondering how that can be possible. Can we choose augmenting paths that allow us to never "push back"?
Comment: Who tells you this? It's wrong. Please reference your source. (If it were true, greedy approaches would work. We know they don't, that's why we need the whole business with residual networks in the first place.)
Comment: Since FF doesn't specify how augmenting paths are found, I think the question should be interpreted as "for every flow network, there exists an execution of FF that never pushes back flow" - where we're allowed to specify at each stage of the algorithm which augmenting path should be used.
Answer: No, it is not true that "the Ford-Fulkerson algorithm produces an execution that never decreases the value of the flow on any of the edges". If you look at the wiki article of Ford and Fulkerson method you will see the following pseudocode:
Algorithm Ford–Fulkerson
Inputs: Given a Network $G = (V,E)$ with flow capacity $c$, a source node $s$, and a sink node $t$
Output: Compute a flow $f$ from $s$ to $t$ of maximum value
$f(u,v) \leftarrow 0$ for all edges $(u,v)$
While there is a path $p$ from $s$ to $t$ in $G_f$, such that $c_f(u,v) > 0$
  for all edges $(u,v) \in p$:
    Find $c_f(p) = \min\{c_f(u,v) : (u,v) \in p\}$
    for each edge $(u,v) \in p$
      $f(u,v) \leftarrow f(u,v) + c_f(p)$ (Send flow along the path)
      $f(v,u) \leftarrow f(v,u) - c_f(p)$ (The flow might be   "returned" later)
In the last line $f(v,u)$ is clearly decremented.
In the example below one will have to decrease flow in the middle edge to get max-flow. There is no other way.

If you want to know, if there exist a sequence of augmenting paths that never decrease the flows, then the answer is possibly yes. Proof might be non-trivial though.
Comment: This answer is based on a misreading of the question. The question is "does there exist an execution that doesn't bush back flow?" rather than "do all executions not push back flow?". My gut feeling is that it is true (where pushing back flow is interpreted as actually decreasing the value of flow where it was previously increased).
Comment: I think I understood the quetion correctly. He says "never decreases the value of the flow on any of the edges",  which is not correct. Then comes the second part of the question, where he asks, how "Can we choose augmenting paths that allow us to never push back?" to ensure his incorrect assumption.
Comment: Moreover, his question is related only to Ford-Fulkerson method.
Comment: @shreesh When you say "Proof follows from min-cut max-flow theorem.", can you elaborate?
Comment: Since proof seemed to be tough, I have modified the statement to only talk about the possibility. Probably will need to check  exponential number of augmenting paths to choose one which will not reverse flow. But even with minimum residual flow augmented path, I could not complete the proof. So I gave up.


What strategies could be employed so as to avoid identity theft and credit card frauds?

Question: Other than getting a credit card with a minimal limit and using it exclusively for online purchases, what other strategies could be employed so as to avoid identity theft and credit card frauds?
Comment: There are some answers here:  https://money.stackexchange.com/questions/84900/how-should-i-protect-myself-from-the-equifax-breach-without-making-my-own-life-m/84903#84903
Answer: Some credit card companies, like Citi, offer the ability to auto-generate a one time use credit card number linked to your card.
Otherwise, sticking to trusted, mainstream sites is your best bet.  The Amazons of the world (probably) have more oversight on their employees.
But really, it is a crap shoot.  Once you send your information over the Internet, you do not have any real guarantee of what is happening to it.
Answer: Why do you care?  Any credit card these days has zero fraud liability.  Even if your account number is stolen, you're not on the hook for anything. If you see a bogus transaction, call your CC company and report it. You'll get refunded and a new card will be issued.
Just be sure to use a Credit Card, not a Check/Debit Card, so you have a buffer between the transaction and your checking account.  If your Check/Debit card gets hit with a fraudulent transaction, you may be in trouble when a rent check bounces.
Other tips:

Make sure you review your statements every month to catch fraudulent transactions (good point MrChrister).  It is a really good idea to use something like Mint.com or Quicken and check it weekly/daily so if a fraudulent transaction shows up you can catch it quickly.  Mint can send you an alert on large transactions, which can catch something major, but smaller transactions may slip through, so review the list regularly.
Have multiple credit cards and spread your spending across them.  That way if one gets closed down due to fraud you can use the other one until a replacement arrives.
Comment: And stay *very* on top of your credit card statements.  You have zero liability if you report it within 60 days.
Comment: very good points
Comment: Your card can be compromised in "real life" too (card skimmers at gas pumps or ATMs.... or pencil and paper at sit-down restaurants where they take it away to charge you...) You really just need to *keep a very close eye on it* (which is probably easier to do with fewer accounts).
Comment: Keep receipts, use a program like mint or quicken to watch the transactions, match the transactions to the receipts. Anything suspicious, call the bank. I usually go through my receipts once a week.
Answer: In addition to the good advice already mentioned, with any site you're buying things from, start by making sure the URL starts with https.  This will at least encrypt the the information you send.
Another purchase option I see more and more is the use of PayPal.  Going this route means that none of your credit card information goes to the seller--it stays with PayPal.
Edit: Commenters on my answer make a good point in indicating that PayPal isn't regulated the same way that credit card companies are, so protections aren't the same.  While this is true, using PayPal doesn't mean you're completely devoid of protection.  It will be worth your while to read the page on PayPal's site dealing specifically with purchase protections.
Comment: +1 for the SSL, but PayPal is not held to the same rules and regulations as normal credit card merchants.  I am *very* wary of using PayPal for transaction of $20 or more.
Comment: I agree with the Paypal comment; you lose most of the protections given by using a credit card.  Essentially, you are buying the ability to send money, not buying a product (from the perspective of your credit card).  So, your credit card company will not help you out if the seller never sends your goods, or if the goods are not as advertised.  Your credit card company would only help you if the money transfer did not happen.
Answer: Who cares? Stealing your credit card info isn't identity theft, it's credit card fraud.
The fraudsters are playing with the bank's money, so your only problem is to monitor your statement and report instances of fraud. When you report it, you get a new card and account number. I had a waiter in a restaurant skim my card. I discovered it on the next statement, made 1 ten-minute phone call, and that's about all there is to the story.
Now if you are using a debit card online, that's a whole other story, since there's a real risk that you'll bounce a check before realizing what's going on.
Answer: If you use credit cards with a contactless payment RFID tag in them, be careful where you place them about your person. As (in the UK) any payment under £20 does not have to be acknowledged by the cardholder, criminals could use a portable RFID scanner on your wallet in your back pocket to scan your card details or make bogus charges. Either keep them in a breast pocket or stump up for an RFID blocking wallet (I've seen ones for as little as $20).
Of course, this is a rare form of crime at the moment, but as the world moves away from magstripe & signature or chip & pin, occurrences are only going to increase.


Branding better for new-to-intermediate users?

Question: Although Unix & Linux has gotten rid of the 'for advanced users' part of its description, it still comes across to me as a site for advanced Unix users - perhaps just server admins, even.  This recently caused me to create the Debian Area51 proposal, which I now accept is a dupe of this site (well, a subset anyway).  But it led me to thinking: is there a way that U&L can better brand itself to indicate that it's open not only to advanced users and server admins, but also new-to-intermediate users of all Linux distributions (except Ubuntu, of course!)  I'm not sure exactly how to do it, but if you Google for "Debian Q&A", it would be nice if this site came up at least in the top 10.  I don't think it's very 'discoverable'.  If you're going to welcome beginner questions about all distros, the look-and-feel of this site right now doesn't feel appropriate; it feels very "command-liney".  ;-)  These days, new users of Linux will almost certainly be using a GUI, alongside a commandline.
Comment: I don't think "except Ubuntu" is really an "of course". Ubuntu users and questions are welcome here too, as long as the questions are not very distribution/culture specific.
Comment: That was the wrong Google search term. It should have been something like *How to do X in Debian*.
Comment: @Tshepang I disagree.  If the question hadn't yet been asked on this site, it wouldn't have been linked on Google.  Other sites with perhaps similar questions would be, but none of them may answer the specific question one has when Googling.  What one therefore needs is a site where one can ask it and get a good answer, which would seem to be here.
Comment: I agree. My reasoning was based on the fact that if you have a specific question, you google it, instead of searching for a site where you can ask (or search) such a question
Comment: Unless you can't find the answer to the question, after which you may search for such a site. :-)
Comment: I would think you would then go ask on the official channels (mailing list, IRC, and/or forums). Why you use a 3rd party service?
Comment: There are plenty of StackExchange sites which have alternatives on the web (in fact, I defy you to find one that doesn't!)  The fact is, StackExchange sites often have better quality answers than you'll get elsewhere (or answers at all!) and it's often much more likely you'll get a good answers to your question if you ask here.
Comment: Now you are speaking like someone who already knows the goodness of Stack Exchange. I was referring to someone who didn't. If that guy doesn't find decent answers, the next best thing was to ask on the official channels. Anyways, my point is that their Google search term will be *How to do X in Debian* instead of *Debian Q&A*.
Comment: And mine was that their second search may be *Debian Q&A*.
Comment: Instead of the official channels?
Comment: idk, I've asked a few gui questions, and answered some too. Ask more Gui questions?
Answer: I don't think the look-and-feel, or arbitrarily matching "Debian Q&A", is the correct way to think of this.
If you want to attract (quality) beginners, make sure there are a lot of quality beginner Unix questions on the site! That is what will lead beginners here in the first place.
Therefore, if you want to make this site more hospitable to beginners:

Ask (and potentially even self-answer) lots of great beginner questions. This has to happen first; we can't expect beginners to magically materialize without a corpus of good beginner Q&A pairs.
Generously share links to great questions and answers wherever new Unix users tend to congregate.
http://blog.stackoverflow.com/2010/09/announcer-booster-and-publicist-badges/
Love and reward your newest users for being awesome!
https://unix.stackexchange.com/review
https://unix.stackexchange.com/users?tab=newusers


What is the average time for a utility patent to be approved?

Question: What is the average length of time for a utility patent to be approved?
Comment: Can you edit your question to be more specific about the country where it will be filed?
Comment: 15 months so far and haven't heard a word yet
Answer: The USPTO says in its FAQ from 2003 (http://www.uspto.gov/main/faq/)
--
Currently, the average patent application pendency is 24.6 months. Applications received in the U.S. Patent and Trademark Office are numbered in sequential order and the applicant will be informed within eight weeks of the application number and official filing date if filed in paper.  If filed electronically, the application number is available within minutes.
--
So just over two years - that said, I am willing to bet the variance is much higher since some patents can be quickly approved while others might need several back-and-forths with USPTO before they are. We had a few pending in our org in software and they were all 4-5 years old and still being discussed.
Answer: I am pasting a chart from a posting on the PatentlyO blog from this year showing the rise and fall of the average pendency. There is also data available by Technology Center. Pendency is from filing to either abandonment or issue. The time to allowance would be less.


What is the best approach to design registration page

Question: I have seen users (including me) who get frustrating registration page and eventually decide to quit the site. (To be frank few of my friends left registration due to annoying captca verification) As I am in a process of designing a kind of social site for which user needs to login to perform certain action. I don't want my users to quit site just because it is either too complex or require more information. The other side of story is that I do need more information from user. Now my question is that what is the possible details I can keep on my registration page to make it comfortable to the user to easily jump to the main site and then how can I capture the remaning information?
Answer: First and foremost:

Don't require registration in a first place. OpenID is one of the ways to avoid registration.
If no registration is not an option, require only the most basic fields you really need to register someone. In 99% of cases, the only field which should be required is the e-mail address. You may put a password field too to avoid perturbing users' habits, but it's not mandatory.

You mentioned that you "need more information". I don't know your particular case, but in general, when a website requires more information, it's a bad sign. E-mail. Password. That's all those websites need. No names. No addresses. No phone numbers. Don't ask me my pet's name or the age of my girlfriend or if I traveled a lot in 1998 or if I'm homosexual. It's not your business.
Asking additional info is the worst thing you can do during registration (especially by making the fields mandatory). If some social website asks me my phone number, I won't give it. Never. Because it's my phone number, because I'm not convinced that this website can't live any longer without knowing the phone number, and because I don't even know how this information will be used. If the phone number is required, I'll either leave the website, or type something like "12345".
If, eventually, some particular features of your website require this additional information, then make those features unavailable just after the registration, and invite persons to enter this information to access those features.
First example
If you're sending no-spam text messages to persons when their friends try to reach them, then there would be persons with no phone numbers who will never receive those notifications, and persons who made an additional step by entering their phone numbers after registration who will be notified.
Second example
If you're making an e-commerce website where goods may be sent by mail, you can hardly send anything without knowing a mailing address. This doesn't mean that you should force persons to give their address during registration. Why do you think they have time? Why do you think they will order something right now? Postpone this step until you really need their address, i.e. when they are actually purchasing something.
Comment: +1, but OpenId doesn't avoid registration, it just avoids having to come up with another username/password pair. And there are users that do not want to register everywhere with their "general" openid, so offering registration using a site specific username/password in addition to openid is still advisable.
Comment: I don't agree. It still is registration when you are creating a new account with the site (a new entry in their users table). Association would only be possibly if you already have an account at the site. Like SO allows you to associate multiple (OpenId) authentication providers with your account.
Comment: Every single time I have /tested/ openid with "normal" users as opposed to technical folk it's caused more problems than it's solved. Every. Single. Time. Has anybody's experiences been different?
Comment: @MarjanVenema: OpenId is transparent when it comes to registration. From the user's point of view, I would rather call it *association* (with an OpenId account) rather than a registration.
Comment: @adrianh: good point. See [What makes OpenID so difficult to use by persons with no technical background?](http://ux.stackexchange.com/q/39855/6729)
Answer: My general tips would be:

Question whether you really need all the information you're asking for.
Ask for as little information up front as possible. Not the minimum that your site needs to run as a business - but the minimum that the user needs to continue at this point. You can collect the rest later on.
Explain why you need the information to the user. Don't just say "E-mail", explain with "So we can let you know when your purchase ships".
Allow the user to enter subsidiary registration information later on. Look to sites like LinkedIn that nudge users with "Profile 80% complete" and other messages.
If you really, really cannot avoid a long form all the usual long-form advice about breaking it into self-contained chunks, showing status/progress, etc. apply.
Investigate options like logging in with facebook / twitter / linkedin / google+ / openid / mozilla persona. But please test them with your users first.  I have regularly seen these cause problems as well as help (especially open ID - which I've never seen help overall). The general advice would be to only offer options that are related to your product (e.g. Tool for handingly social media followers? Twitter login a no-brainer). But test early and test often.
Do you need registration at all? It's a question that sometimes needs to be asked. Again - do test.
Answer: Ask: Is it really worth it?
If people are leaving your website without registering, that's a big red flag to me that they either don't really need to use your site - or don't understand the value of your website. If the value were otherwise very clear, then it'd be worth the effort of providing the information you so dearly need to provide them the promised service/experience.
The funny thing about human beings is that we're actually VERY adaptable creatures. If there is something we REALLY want, we'll jump through hoops a hundred times - or give up after we're tired of trying/failing too many times - or find other better options.
My suggestion is to do some usability interviews to find out what people think the website can do for them just from looking at the "logged out" experience. Then have them go through the registration process and see if they think it was actually worth the effort.
Worse comes to worse, you can always pay people for their time & trouble to register if you can make that kind of investment ;)


Singing notes while playing scales

Question: I've heard, that singing or humming notes while playing scales or arpeggios is good for you. Is that so? In what way? If I am not a singer, why should I be singing the notes?
Answer: Let me make it clear; I am no singer, but I have found it very useful to hum the notes of a scale/arpeggio when practicing them on the guitar.
One of the reasons why I do is if I hum the notes while I play, then if I was to go wrong, firstly I would hear that I had gone wrong, and then I would be able to go back to the point of my mistake, and be able to identify the note that should have been played from the corresponding note in the 'hummed' scale.
Secondly, it has helped me become much more aware of what the notes actually sound like. This helps loads when I am figuring out a chord sequence or riff to a song. I can hum the note/chord pitch from the song, and then be able to identify the general area of notes that that pitch is from, making it much easier to pinpoint the note/fret that is played.
Sadly, I cannot listen to a song, and hear a note, and be able to say 'oh, that's an F' immediately, but hopefully that will come with practice.
Comment: Sounds like you're learning ear-training. It's one side of a music theory course in school. They teach how to listen, take apart melodies and chords, and write them down. If you can write them down, you can play them, so it's an important thing to be able to do when studying various music styles.
Comment: I am not doing any formal musical study, (apart from Saxophone lessons :) ) but I am very into identifying notes and chords by ear, practicing whenever I can.
Answer: When you start trying to write or improvise you own tunes one good tactic (for some people...) is to sing the melody you want to play either in your head or  out loud and try to mimic it on the fret board.
This is a two way street. If you sing out as you are practising you will develop a better sense of where the shapes and intervals you are looking for can be found.
I also find it is a good memory aid when learning a song as it encourages you to learn how the song sounds rather than just which frets to play. It's a small distinction but an important one.
Comment: +1. An important component to soloing is letting the song breathe. That doesn't just mean leaving holes in it, it means putting them where you'd breathe while singing the solo so it sounds alive and human. And, as @runrunraygun was mentioning, it helps to hear how it sounds. As guitarists it is easy to get into a bad habit where solos are just riffs. People don't sing riffs, they sing melodies, and getting them to walk away humming one of your solos is a real testament of your ability to get them to remember your playing. So, make your playing more voice-like and you'll be a step ahead.
Comment: Additionally, it will build your "tone memory" as you do this. It's exceedingly useful to listen to a song and be able to pick it apart without having a guitar in your hands. I have learned many a song this way, just from memorizing the tones of scales and chords and matching them as I listen to the song.
Answer: Because when you singing solo while playing it, this makes your soloing not just a running-down-scale solo, but something more interesting than that. You have theme melody or combination of notes which makes sense to play! or anyway answer is: for extending your imagination!
Answer: The human voice is probably the most interesting musical instrument there is.  To be able to articulate vocal sounds (ie words) as well as notes is something only a few instruments can mimic (guitar, trumpet, sax come to mind).
With guitar then, vocalised notes - ie. notes that you are singing/humming, will have vocal articulations that sound much more interesting than musical scale type soloing.  A good old B.B. King Blues lick is instantly recognisable and hummable.
This is why Blues solos are always popular - the bends, slides, hammer-ons, pull-offs that we can consider soloing techniques - when combined together, do go a long way to mimicing the sound of person singing.  It's emotive.  It reaches out and connects.
Arguably, scalar music can still be interesting (Joe Satriani comes to mind instantly) but the responsibility is on the player to retain some musicality to it instead of it sounding like some exercise - or worse still - just gibberish that you can't hum either way.
So if you learn to sing/hum the notes that you want to hear - your playing should improve on a level that is more attuned with the human characteristic.  Your slides and bends will sound more "melodic" or personal/human simply because you are articulating your notes the way you would sing.
It helps you write better songs/melodies because people can always relate back to a human voice (eg. while we're on the subject, can you hum "Surfing with the Alien" to yourself?  I bet you can - even the wild fast parts).  Or you can construct better melodies with/without scalar runs because you can hear how your voice sounds behind or in front of it.
It's all music at the end of the day - and if you have 2 instruments to play with to create great music, why not?

Singing notes while playing scales


How can I send custom bitmap to frame buffer?

Question: I was trying to make a CPU-based ray tracer but I know after all the calculation I will end up with an array of pixels. I don't know how to paint it on the screen. What are the various ways to do that? I am using C++ and I am working on Windows 10. I know OpenGL(useless since I am not gonna use my GPU), Allegro 5 game library and I am also familiar with win32 C++ API.
Comment: You could try SDL as that supports software rendering / direct FB access and is in some ways simpler to use. Otherwise you could stick with openGL and use texImage2D to upload your software framebuffer to the GPU.
Comment: On win32 you can get away with GDI, flushing memory to screen is relatively fast. Look for CreateDIBSection
Comment: What platform? What libraries are you familiar with? Do you have any requirements or limitations in doing this? Your question as posed seems a bit too broad. Can you narrow it down a bit?
Comment: Thanks for mentioning about the SDL. And yes texImage2D can be used to put image in gpu but then what to do? Is there any function in OpenGL so that i can copy the image data directly to default framebuffer?
Comment: To supplement my answer: You will need to draw a full screen quad with texture mapping enabled, you can follow a simple texture mapping tutorial for this, it's fairly straight forward.
Answer: This answer uses GDI and a little bit of MFC. The MFC bits aren't necessary and just there for my convenience. You can hit the Windows API directly if you need to.
In your window class have some data members for the bitmap. I currently use MFC's CBitmap for convenience:
CBitmap             bitmap_;
unsigned char*      bitmapBits_;

bitmapBits_ is a pointer to the bitmap data that you can write directly into.
Before rendering, you'll need to create the bitmap using CreateDIBSection() and get the pointer to the bits of the bitmap:
BITMAPINFO bmi;
memset(&bmi.bmiHeader,0,sizeof(bmi.bmiHeader));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = widthOfTheImage;
bmi.bmiHeader.biHeight = heightOfTheImage;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24;
bmi.bmiHeader.biCompression = BI_RGB;

void* bitmapBits;
bitmap_.Attach(CreateDIBSection(0,&bmi,DIB_RGB_COLORS,&bitmapBits,0,0));
if(bitmap_.m_hObject == NULL)
    AfxMessageBox("CreateDIBSection() FAILED!\n");
bitmapBits_ = reinterpret_cast<unsigned char*>(bitmapBits);

When writing to the bitmap bits, you first need to determine the row size (see here).
// Compute the row size of a DIB.
// (See https://en.wikipedia.org/wiki/BMP_file_format#Pixel_storage and ComputePitch() from atlimage.h)
const unsigned int rowSize = ((24 * imageWidth + 31) / 32) * 4;

Then you can write the colour information into the bitmap's data. Note this is a bottom-up DIB; memory earlier in the buffer represents scanlines lower in the image. Another way of putting it is that the the first element of the bitdata relates to the bottom-left. Colour components are in BGR order.
unsigned char* dibPtr = &bitmapBits_[pixelY * rowSize + pixelX * 3];
dibPtr[0] = ???; // blue between 0 and 255
dibPtr[1] = ???; // green between 0 and 255
dibPtr[2] = ???; // red between 0 and 255

Sorry if the previous part is already known to you, as you asked simply how to get it painted to the screen. Here's my simplified paint routine from my MFC application:
void RendererWnd::OnPaint()
{
    CPaintDC dc(this);

    CDC dcMemory;
    dcMemory.CreateCompatibleDC(&dc);
    CBitmap* oldBmp = dcMemory.SelectObject(&bitmap_);
    dc.BitBlt(0,0,imageWidth,imageHeight,&dcMemory,0,0,SRCCOPY);
    dcMemory.SelectObject(oldBmp);
}

There are going to be many other ways of doing this. If you're doing a long render and want to update the window periodically then you'll probably want to have a timer in your window. When this timer fires you want to request a repaint of your window using InvalidateRect(). You'll need to synchronise access to the bitmap data between your rendering thread(s) and the thread that's doing the painting. This will ensure the painter can access the bitmap when it's not being written to. I use a CRITICAL_SECTION for this.


If the prices for cotton increased during the Industrial Revolution, how would the increase affect the market for farm land?

Question: Since cotton was a major crop on farm land, if the price of cotton increased, the price of farm land would also increase. This would increase the demand for farm land and shift it to the right. Would the supply curve of farm land also increase because more individuals would want to sell their land? Or would just the demand of farm land would shift to the right?
Comment: This is more an economics question than a history one.
Comment: Welcome to History:SE. What has your research shown you so far? You might find it helpful to review the [site tour](https://history.stackexchange.com/tour) and [Help Centre](https://history.stackexchange.com/help) and, in particular, [How to Ask](https://history.stackexchange.com/help/how-to-ask).
Comment: Appreciate the responses, it made it way more clear! Sorry first time poster, I'm taking a econ-history course (undergrad level).
Comment: You have to consider that all farm land is not equal.  In particular, cotton only grows in hot climates with plenty of water, like parts of the US South.  So at 1st order, only suitable cotton-growing land would be affected.  There might be 2nd order effects, as potential cotton land planted to other crops was converted, raising the demand for non-cotton land to grow those other crops.
Answer: This is more an economics question than a history one. The supply curve represents the relationship between supply and price, not the absolute value of supply.
If more people sell their land because of the increased price, it doesn't mean that the relationship change. But if more people want to sell their land with the same price (e.g. when people become afraid that price will crash in the future), then you can say that the supply curve "shifts to the right".
Illustration: see the curve below. There is more supply at B than A, but B and A are within the same curve.
Answer: Yes cotton demand did make some farmland more valuable, but not all farmland.

In 1781 cotton spun amounted to 5.1 million pounds, which increased to 56 million pounds by 1800. In 1800 less than 0.1% of world cotton cloth was produced on machinery invented in Britain. In 1788 there were 50,000 spindles in Britain, rising to 7 million over the next 30 years.

The price of cotton did increase during the industrial revolution.  Demand dramatically increased and this fueled the dramatic increase in cotton as a cash crop.  It wasn't just farm land which would be necessary to supply the ever increasing demands of the automated looms of the early industrial revolution.  It was farmlands with proximity to ports and roads so the cotton could be transported. This meant that centralized production had a huge advantages over smaller farmers.  It was the large farms which mass produced farm goods which filled most of the demand for cotton.  Those institutions which massed produced farm goods at the dawn of the industrial revolution were known as Plantations.
Prominent plantation crops included rubber, sugar cane, tobacco, figs, rice, kapok, sisal, and Indigofera, used to produce indigo dye.  The demand for cotton would become one of the plantations greatest cash crops.
Yes cotton demand did make some farmland more valuable, but not all farmland.  Just the large aristocratic farmers who were in a position to export cotton on the large scale that was required to meet demand.


How to avoid accents when singing?

Question: Sometimes, on certain songs, I start to sing in an accent that kind of mimics the original vocals. One song in which I have this problem is Three Days Grace's Let It Die. How can avoid the accent while still staying true to the original sound of the song?
Comment: Given that the accent is part of the original sound of the song, you *can't* avoid the accent while still staying true to the original. You have to choose whether you'll be true to the original recording, aim to use your own accent, strike a balance, or go for something else entirely!
Answer: Conscious voice training and feedback will help you immensely.
Try video recording yourself trying to sing with different accents. Really accentuate the movement of your lips,tongue and cheeks so you can see the effect. Memorise these different movements- visually at first, then the feeling.
Now try the song again, and when you feel yourself skipping into the default accent consciously use different muscles.
Additionally, think of singing phrases differently. As an example, singing Guns n' Roses Civil War in a different style is difficult if you keep in all of his trademark noises, but gets much easier if you use your own fills and phrasing.

How to avoid accents when singing?


How do you share a blender.file?

Question: I am new to blender and have been working on a project that displays "fire" in texture but doesn't show up in render and so, I need to "share the project with others by making it a downloadable link like on youtube" in order for me to solve the problem with insight and knowledge from others because I would like to finish this project simply because I spent too much time on this project haha so any help would be greatly appreciated
Comment: Do you need a method to share a file across the internet? or is something else wrong? a blend file can contain everything that's needed in a project, it requires no additional files. if you are using libraries, which I doubt, you can zip those.
Comment: Thank you for your response and yes, that's exactly what I want/need to do! How do I make the file downloadable (as a link, to be exact) like how people release their models to the public on youtube with tutorials for downloading because I feel like other blender users would have to look at it because my knowledge is limited being that I just started and so I wouldn't be able to answer what the more technical user would probably expect me to know.
Answer: Before uploading make sure to pack all external data.
Images used as textures, backgrounds or environments do not get saved into the .blend file by default. To include those as part of the file you have to Pack them. In the File menu press File>External Data>"Pack all into .blend"

PLEASE NOTE:
Image sequences, video files and Simulations Cache Folders will not be packed. For those it would be better to place them in a common folder along with the blend file and zip them (or bundle them with any other packaging software). And share the whole folder. For convenience you might also want to make the blend file work with relative paths, so that you don't have to re-create the folder structure used on the original computer.
For more info, read this page form the manual: https://docs.blender.org/manual/en/dev/editors/info/file.html?highlight=find%20missing%20files#file
To save the baking cache for physics simulations see: Can I save the baking cache? or Is there a way to save a baked cloth simulation (in .blend file or to disc)?

If the question is where to host a file for a question asked on this site please use:
https://blend-exchange.giantcowfilms.com/

Note
https://blend-exchange.giantcowfilms.com/ can olny host .blend files (not zipped folders) used as part of questions and answers on this site, and they have to be smaller than 30MB. To share larger files or bundled content on zipped files there are numerous free or paid websites and services. But that part of the question is beyond the scope of this site, so do your own research.
Comment: How would I download the file to my hard drive I have a Mac desktop because when I go to place the folder in "blend-exchange" I can't find it :/
Comment: https://blend-exchange.giantcowfilms.com/help/

How do you share a blender.file?


Q: Is the crust getting thinner or is the mantle getting smaller

Question: Volcanoes spit out magma onto the surface of the crust or crevices on the surface, but the magma comes (in effect) from the mantle right? If that's the case, isn't the mantle turning into the crust by the mantle hardening into mountains and volcanoes? Or maybe the mantle doesn't change size, it just melts more of the crust to suit its size needs. If that was the case, the areas of Earth that aren't constantly spitting magma onto the surface would eventually be thinned out to the point that a hole or giant crack would appear leading straight to the mantle and that would be bad.
Comment: keep in mind crust is also being turned back into mantle at subduction zones.
Comment: Please consult Wikipedia on the topic of [plate tectonics](https://en.wikipedia.org/wiki/Plate_tectonics), this answers all your questions.
Answer: The crust is actually getting thicker very gradually as the Earth cools down. This process is well seen on Mars, where due to its smaller size and greater distance from the sun, Mars is cooling faster than the Earth. No one knows exactly how thick the Martian crust is, but what we do know is that magma can no longer find its way to the surface. All the Martian volcanoes are extinct.
On Earth, the magma ejected from volcanoes is mostly recycled oceanic crust. Sea floor spreading from the mid-ocean ridge pushes the oceanic crust on the Pacific Plate toward the continental crust on,for example, the North American plate, where it is forced to dive  beneath the continental crust and driven down into the mantle. For a number of reasons (friction, water content etc) this causes it to melt, and being lighter and more fluid than the mantle it rises to the surface, where it escapes through volcanism.
This is not the whole story, because if oceanic crust is disappearing as it is pushed below the continental crust of another plate, it must somehow be replaced. This happens at the mid ocean ridge, where a deep chasm plunges through the comparatively thin oceanic crust, enabling fresh magma from the mantle to rise up and create new ocean floor. This is constantly spreading out in opposite directions from the mid ocean ridge, hence the term 'sea floor spreading'.
Comment: "the magma ejected from volcanoes is mostly recycled oceanic crust": no, it's not. In most cases it is the mantle that melts, the oceanic crust just brings the water which allows meting by metasomatism, but the source rock of the magma is peridotite.
Comment: Thank you Michael Walsby! Exactly what I was looking for.


Have Multiple Inputs to Programming Block

Question: Originally, I had a simple program to move until the robot hit a wall, then it reversed and turned and moved again, repeated to infinity. It works by turning the motors on, waiting for input from the touch sensor, then reversing, turning, and continuing. Now I want to add a second wait on the touch sensor to trigger the reverse and turn sequence, but I can't add two different ports to wait from, or have two different triggers to start the reverse and turn. Is there any way to have a trigger from two different wait inputs?
Comment: This question about NXT could maybe help you: http://bricks.stackexchange.com/questions/3027/how-to-use-two-nxt-bricks-for-3-motors-and-4-sensors
Comment: That would work, but I'm aiming for a solution with the software so I don't have rely of external implants.
Answer: You can do this with parallel programs and a logic variable. You will need 3 loops, one for each sensor and one for the motor. In the sensor loops, wait for the touch sensor to be pressed and then set a logic variable to true. In the motor loop, have a switch block that tests the logic variable. If it is true, reverse and turn around and then set the logic variable to false. If the logic variable is already false, just go forward.
Comment: Thanks a lot. I considered using a variable to track it, but I wanted to know if there was a simpler, more intuitive way. Your script is probably better than what I could have come up with.
Answer: Here is another pattern that watches more than one sensor.  Instead of parallel code blocks setting a variable value, this code combines sensor outputs to feed a logic block which feeds a switch.  No variable is used.
Note that only the touched side of the switch statement is used.  Not an important difference, I just find it easier to follow.
The other pattern might be described as event driven, which is used widely in programming.


RabbitMQ Question - Is there a way to print log message to console?

Question: I am running RabbitMQ on windows 7  ( currently for debug reasons).
I want to see the messages on the open console each time I send a message.
Is there a way to rout the logs to the open console?
10x
Answer: Create a logger application that connects to rabbitMQ creates a queue that consumes all messages sent from the broker, this works best with a fanout exchange or a topic exchange where you can set the routing key to be # (ie for everything).  As you consume each message you can print it to the console or to a log.  This will be separate from your apps and you can easily turn it of or on when ever you want.  It should not slow down noticably the current system by adding a single extra queue.
Answer: You can do it in, the programming language you are using to Publish and consume messages from RabbitMQ.


can someone disarm our ADT alarm system by removing the cable?

Question: We have an ADT alarm system , the other night I heard a neibor saying he could disarm our alarm system .. he tried telling someone ells how to do it .. said it was the 3rd cable to the right or the internet , and tv cable.
is this true? .. and , would he have to have access to the basement to do so? .. also .. if disconnected will it set off the alarm.
we are scared now that he will enter our home.
Comment: Yep, though ADT will likely detect the disconnect and take action. http://blog.frontpointsecurity.com/burglars-do-cut-phone-lines-adt-customer-tells-sad-tale-of-real-break-in
Comment: ADT will sell you a cellular backup connection if you worry about someone cutting your voice or internet connection. You should make sure your system also has an adequate battery backup system to prevent disabling of the system by cutting power.
Answer: When an alarm trips, it can send out one or more of three types of alerts:

local - an audible alarm rings at the property
direct police connection - when the alarm rings, it goes off in the police station itself (rare)
central station - an alarm goes to the alarm monitoring company, which then alerts the police in certain circumstances (such as no one answers or fails to give a password following a callback to the house).

Some alarm setups are local only, some remote (police or central station) only, and some are both.
Two things control whether the alarm will go out:

is there power?
is there a connection to the monitor (if any)

Almost all serious alarms have battery backup to ensure that, even if the power is cut, the basic alarm system is still functional. If there is no battery backup, cutting power lines will nullify the alarm.
Local: Assuming power, AC or battery, a local alarm will ring upon intrusion, regardless of whether cables are cut.
Remote: Connections to police or central stations are most often handled through conventional telephone lines.  These may be landline connections or cable/internet connections (if phone service is via the cable system or other internet provider).
Even if power is cut, landline telephone service is often still active, since landlines have their own power feed. But if the telephone line is cut, the signal cannot go out.
Cable/internet phone, on the other hand, relies on modems that need AC power. If power is cut, cable phone does not work. If the cable line is cut, this would also prevent a signal going out.
Cellular remote: Some alarm systems offer a cellular connection. This is like having a dedicated cellphone built into the alarm system. These systems function even if the landline or cable line is cut. They will continue to function even if the AC power is cut (assuming a battery backup, which would be standard on a cellular type setup).
Whether your system would survive a wire attack depends on the type of system you have. Only a cellular based system with a battery backup can withstand all attacks on the wires that feed a property.  But many systems will detect a disruption of power or telephone connection, make a call to the owner to see if there is a problem, and alert authorities of the monitor does not get satisfactory assurances. The level of security is a function of how much you are willing to pay and how concerned you are about various levels of risk, and the particular protocols of the alarm monitoring service.
Comment: Internet connection equipment (media converters, cable modems, etc.) tend to draw very little power, making them great candidates for being put on a small dedicated UPS. This is especially but not exclusively useful if you also have VoIP instead of a regular dedicated landline, and as a bonus can provide lightning protection for the sensitive equipment. I guess you could call this an extension to the "battery backup" discussion.
Answer: As others have said, unexplained disconnection of a modern monitored alarm system may be treated as suspicious by the monitoring service, unless an entire neighborhood goes black and they can confirm a wiring problem. (Or may not. Ask your provider.)
If you want a more positive signal, cellular backup is indeed an option. Indeed, there are now systems available which have only cellular connections, and some which can be set up to let you monitor the system from your own phones/tablets if you prefer to DIY rather than contracting it out.
Answer: Lots of good answers already but I will add that some installations will include a trap that looks like a phone line but isn't.  If it is cut, a silent alarm is triggered via either the real POTS line or a cellular connection.
The ordering of the wiring on the outside of the house is meaningless but it is easy to identify coaxial cables (cable TV/internet) vs the typical 2-pair cable used in most residential settings for phone/DSL.
You can protect these cables with metallic conduit which will make tampering much more difficult.  Typically the telco network interface devices (box on the exterior of your house) will be locked as well.
Cameras on this area of your house is another good deterrent.


Why hasn't the "9th Planet" been detected already?

Question: In the comments to this question, there was considerable doubt placed as to the subject of if the so called "9th planet" really exists. That wasn't really the intent of the previous question, so I ask this. Why hasn't this "9th planet" been detected before now, if it even exists?
Comment: Last year, i started cataloging all the pebbles in my garden.  I've found a nice shiny one by the apple tree roots.  My question is - why wasn't this pebble found before now?
Comment: [Closely related question](http://physics.stackexchange.com/q/230973/40456) on [physics.se].
Comment: naively, because it is very small and far away.
Comment: Strongly related: http://astronomy.stackexchange.com/questions/8605/if-alpha-centauri-as-solar-system-exactly-mirrored-our-own-what-would-we-be-ab
Answer: Brown and Batygin, the authors of the paper on the possible planet, have a webpage addressing this.
A few reasons not already covered:

It moves quite slowly - the authors estimate 0.2-0.6 arc seconds per hour - so standard surveys may not notice the movement and fail to recognize it as a solar system object.

Eris, which is the most distant confirmed object still known in the
  solar system, moves at a speed of 1.5 arcseconds per hour, which is so
  slow that it was missed the first time around. Most surveys of the
  outer solar system would not be able to find Planet Nine, even if it
  were quite bright, as they would just think it is a stationary star.

If the planet is near aphelion, it might be an order of magnitude further away than any major or minor planet we've found so far (excluding exoplanets, which are found by methods that don't apply in this case). The authors suggest an aphelion between 500 and 1200 AU. For comparison, Pluto is at 30-50 AU, while Eris at around 100 AU wasn't discovered until 2005. The potential 9th planet would be far larger than Eris, but is also likely to be much further away, and thereby fainter.
The WISE survey eliminated Saturn-sized planets within 10,000 AU, and Jupiter-sized planets within 26,000 AU. But the potential 9th planet is far smaller than those. WISE has also done a more sensitive search, which would pick up Neptune-sized objects, but that search has so far covered only a limited part of the sky.
The planet will be far harder to spot if it has the Milky Way in the background - there are too many stars potentially drowning out a faint object.

Here's the authors' summary:

Estimated orbit for the putative 9th planet. The horizontal axis is the right ascension. The colored segments are regions where it should have been found by existing surveys.
Illustration by Brown and Batygin, assuming fair use applies.

The biggest unexplored territory is where, statistically, it is most
  likely to be: near aphelion. Sadly, aphelion is also very close to the
  Milky Way galaxy. Ugh.
So where is it? Probably distant. 500 AU+. Probably fainter than 22nd
  magnitude. Very possibly in the middle of the Milky Way galaxy.
Now go find planet nine.

More details on the authors' webpage: http://www.findplanetnine.com/p/blog-page.html

Finally, the gravitational dominance of the Sun reaches halfway to the nearest star. There's still plenty of unexplored territory for planets smaller than Saturn to hide in.

Note the log axis. We have a good map for the inner 50 AU, and are starting to find objects around 100 AU, but solar system objects might exist all the way to the outer edges of the Oort cloud.
Illustration from wikipedia.
Comment: Wow, nice job finding that page! +1 for that alone. But seriously, excellent answer. Nice job picking up on the parallax angle (pun absolutely intended).
Comment: @PearsonArtPhoto - more precisely, the "gravitational dominance" of the Sun (assuming that we're talking about 2 stars) would extend to the center of mass between them. Add more bodies and it gets much more complicated (as well as begging a definition of "gravitational dominance").
Comment: The current dominance of the Sun might extend half-way to the nearest star now, but statistically we come close to other stars frequently, maybe a light year or closer, which could easily mean that any far out object would no longer be orbiting, depending on how close of a pass.
Comment: Good point. I'm assuming that if the Oort cloud can be stable, it should be possible for larger bodies to remain stable as well. But I'm a hobbyist, not a professional astronomer, so I'll leave it for someone more knowledgeable.
Answer: This graph from XKCD says a lot about why that is the case

The bottom line is, the 9th planet is too small to be detected through WISE, and too far/small to have been detected through visible observation. Most likely this hypothetical planet is a long ways away, possibly as far as 1200 AU, and not particularly large, making it difficult to see. WISE was able to rule out the existence of any Saturn sized object up to 10,000 AU. This hypothetical object is about 1/5th to 1/10th the mass of Saturn. It is also far more likely to be more compact, as Saturn is rather low density. Bottom line, if it is visible in WISE, it would be on the very edge.
Comment: Me is Randal, and he is measuring from the center of the planet.
Comment: @Peter: I think the point is that the "visible at night" / "visible in daytime" line seems to be drawn at around 0.1 solar diameters, i.e. the size of a small red dwarf star. Basically, anything bigger than that would have to be a proper star, capable of fusing hydrogen and emitting its own light, which would make it more visible. But yes, to properly match the description, the line really should turn down on the left enough to include the moon (and, for that matter, the earth, and some birds and airplanes) in the range of daytime-visible objects.
Comment: Who is 'me' here? Earth is probably not that far from me!
Comment: @MycrofD Randall Munroe is measuring distance between his location on the surface of the Earth and the center of any depicted object.  I'm a little surprised he didn't include the sun on this chart.
Comment: Shouldn't the region "planets we would see during the day" include the moon?
Comment: Yea, the chart isn't perfect. Mars shows up as further than Jupiter, for instance. That should be the case, and I don't think all of the planets are quite in the right area...
Comment: The problem is 'me' and earth both should be at origin..that is what i think.. where am i wrong?
Comment: @MycrofD: As above, Randall is measuring from the center of planets.
Comment: So would the sun's center or edge be at the top of the main diagonal line that Earth is on (1 AU)? While I find the graphic cool and applaud the creativity, it's a bit unintuitive and hard to follow for me. I guess people's minds work differently than others and am glad it clears things up for others.
Answer: There are many normal methods that we use to detect exoplanets, but none of them work well in the case of the 9th planet. Here are some of the main ones.

Radial velocity. The Sun is not moving significantly with respect to Earth, and the hypothetical planet is too far away from the Sun to have much of an impact.
Transit. This is obviously impossible, as the planet never passes between Earth and the Sun.
Gravitational microlensing. Again, the planet does not pass between us and the Sun.
Direct imaging. This is difficult to begin with. The planet is also far away and would have a low absolute magnitude.

As to why indirect evidence for the planet wasn't accumulated earlier - well, objects in the Kuiper Belt and beyond (including the perturbed Trans-Neptunian Objects (TNOs)) were only first observed in 1992, and we've only built up significant data in recent years.
Answer: Possible reasons that the planet has not been picked up previously:

It's not there.
Photographic proper motion surveys cover the whoke sky. To avoid these planet 9 would have to be fainter than about 18th or 19th magnitude. This puts a lower bound in the size/albedo/distance combination for any planet 9. The proposed planet could easily be fainter than 20th magnitude.
Targeted searches for trans-Neptunian objects (TNOs) use big telescopes with wide fields of view. Nevertheless they do not cover anywhere near the whole sky and are generally limited to perhaps magnitude 22-23.
Deep searches can go much fainter, but are "pencil beam" surveys and so have little chance of blindly picking up a particular object, or are single epoch and so cannot detect motion due to parallax and orbital motion.
Infrared surveys (WISE and 2MASS) covered the whole sky. They were sensitive enough to pick up gas giants at the proposed distance of planet 9, because giants are kept hot by gravitational contraction. However, if planet 9 were rocky/icy and had no internal source of heat then it could have been too cold to detect.
Answer:
The clipping above from the Albuquerque Journal doesn't really answer your question, but astronomers have been hunting for a largeish planet beyond Pluto for quite some time now. See also:
http://www.zetatalk.com/theword/tword26b.htm
http://www.bibliotecapleyades.net/hercolobus/esp_hercolobus_2_02.htm (under "United States Naval Observatory Calculations")
http://www.bibliotecapleyades.net/hercolobus/esp_hercolobus_3d.htm
EDIT: Just to beat this to death, Percival Lowell may have been the first person to detect the 10th planet. Quoting https://en.wikipedia.org/wiki/Percival_Lowell:

Pluto's mass could not be determined until 1978, when its satellite
  Charon was discovered. This confirmed what had been increasingly
  suspected: Pluto's gravitational influence on Uranus and Neptune is
  negligible, certainly not nearly enough to account for the
  discrepancies in their orbits.[21] In 2006, Pluto was reclassified as
  a dwarf planet by the International Astronomical Union.

Of course, the same page continues to state:

In addition, it is now known that the discrepancies between the
  predicted and observed positions of Uranus and Neptune were not
  caused
  by the gravity of an unknown planet. Rather, they were due to an
  erroneous value for the mass of Neptune. Voyager 2's 1989 encounter
  with Neptune yielded a more precise value of its mass, and the
  discrepancies disappear when using this value.[22]

If you're willing to selectively believe Wikipedia, it's possible that Lowell did detect a 9th planet and that it wasn't Pluto.
One reason to disbelieve Wikipedia (and the given source) and to credit Lowell here is that this 9th planet does have an effect on Uranus' and Neptune's orbits, so the discrepancies Lowell noted wouldn't have disappeared, they would have simply been reduced.
Answer: Adding to the other excellent answers here, if there were an unobserved "Planet 9" the possibility of it being a difficult to observe primordial black hole has been raised.
According to Phys.org's Scientists propose plan to determine if Planet Nine is a primordial black hole if Planet 9 were a primordial black hole it could be detected by the Vera C. Rubin Observatory by observations of occasional accretion flares from cometary debris.
But its a big if.

Dr. Avi Loeb, Frank B. Baird Jr. Professor of Science at Harvard, and Amir Siraj, a Harvard undergraduate student, have developed the new method to search for black holes in the outer solar system based on flares that result from the disruption of intercepted comets. The study suggests that the LSST has the capability to find black holes by observing for accretion flares resulting from the impact of small Oort cloud objects.
"In the vicinity of a black hole, small bodies that approach it will melt as a result of heating from the background accretion of gas from the interstellar medium onto the black hole," said Siraj. "Once they melt, the small bodies are subject to tidal disruption by the black hole, followed by accretion from the tidally disrupted body onto the black hole." Loeb added, "Because black holes are intrinsically dark, the radiation that matter emits on its way to the mouth of the black hole is our only way to illuminate this dark environment."

This is discussed further in their arXiv preprint Searching for Black Holes in the Outer Solar System with LSST accepted for publication in Astrophysical Journal Letters.
Note that LSST now refers to the Legacy Survey of Space and Time, and the Vera C. Rubin Observatory used to be called the Large Synoptic Survey Telescope. What is the LSST now?