Towers of coins puzzle
Problem about a process with bins of balls
Saving image from PHP URL Fundamentally, what does a friction force do for a rolling object? I am very confused by the way my textbook explains it. In my textbook , it says:  A wheel rolling on a horizontal flat surface at a constant velocity experiences no friction force. Why?   On the same surface, there is an acceleration of the wheel pointing to the right (probably caused by a force), so the ball is angularly accelerating in the clockwise direction. In this case, a friction force appears, and it is also pointing to the right. How come? What does the friction do for this wheel?  On an inclined plane, a ball freely rolls down the surface. The direction of friction is up the ramp, which confuses me because in the previous example the friction force was in the direction of the wheel's acceleration.   And there is a difference if a wheel is freely rolling and if there is a torque acting on the ball's center of mass. WHY???  What does friction do in these cases? How does it cause an object to roll? Start a git commit message with a hashmark (#) I am being prompted with the following error while using \pagestyle{headings} on a book class LaTeX document:  Overfull \hbox (240.44835pt too wide) has occurred while \output is active \OT1/cmr/m/sl/12 CHAPTER 1. THE CITY OF CARTHAGE WAS THE CENTRE OF THE ANCIENT CARTHAGINIAN CIVILIZATION \OT1/cmr/m/n/12 2   The following is the offending code:  \documentclass[12pt,letterpaper,oneside]{book}  \pagestyle{headings}   \begin{document}  \pagenumbering{arabic}  \chapter{The city of Carthage was the centre of the ancient Carthaginian civilization} The city of Carthage was the centre of the ancient Carthaginian civilization. The city developed from a Phoenician colony of the 1st millennium BC into the capital of an ancient empire.[2] The area of Carthage was before inhabited by Berber people who also became the bulk of Carthage's population and constituted a significant part of its army, economy and administration. Native Berbers and settling Phoenicians in Carthage mixed in different ways including religion and language, creating the Punic language and culture.  The name of Carthage, Latin: Carthago or Karthago,  meaning "New City"   The first civilization that developed within the city's sphere of influence is referred to as Punic (a form of the word "Phoenician") or Carthaginian. The city of Carthage is located on the eastern side of Lake Tunis across from the centre of Tunis. According to Greek historians, Carthage was founded by Canaanite-speaking Phoenician colonists from Tyre (in modern Lebanon) under the leadership of Queen Elissa or Dido. It became a large and rich city and thus a major power in the Mediterranean. The resulting rivalry with Syracuse, Numidia, and Rome was accompanied by several wars with respective invasions of each other's homeland.  Hannibal's invasion of Italy in the Second Punic War culminated in the Carthaginian victory at Cannae and led to a serious threat to the continuation of Roman rule over Italy; however, the Romans gained the upper hand by invading Africa and defeating Carthage at the Battle of Zama in 202 BC. Following the Third Punic War, the city was destroyed by the Romans in 146 BC. However, the Romans refounded Carthage, which became the empire's fourth most important city and the second most important city in the Latin West. It later became the capital of the short-lived Vandal kingdom. It remained one of the most important Roman cities until the Muslim conquest, when it was destroyed a second time in 698.  The ancient Greek philosopher Aristotle wrote extensively on Carthaginian politics, and he considered the city to have one of the best governing institutions in the world, along with those of the Greek states of Sparta and Crete.[5][6]  \section{Topography} Carthage was built on a promontory with sea inlets to the north and the south. The city's location made it master of the Mediterranean's maritime trade. All ships crossing the sea had to pass between Sicily and the coast of Tunisia, where Carthage was built, affording it great power and influence.  \end{document}    The \hbox refers to:      How can I solve this issue using \pagestyle{myheadings}? Or how can I solve this issue keeping the book class heading format? I am running logistic regression on a small dataset which looks like this:    After implementing gradient descent and the cost function, I am getting a 100% accuracy in the prediction stage, However I want to be sure that everything is in order so I am trying to plot the decision boundary line which separates the two datasets.  Below I present plots showing the cost function and theta parameters. As can be seen, currently I am printing the decision boundary line incorrectly.    Extracting data  clear all; close all; clc;  alpha = 0.01; num_iters = 1000;  %% Plotting data x1 = linspace(0,3,50); mqtrue = 5; cqtrue = 30; dat1 = mqtrue*x1+5*randn(1,50);  x2 = linspace(7,10,50); dat2 = mqtrue*x2 + (cqtrue + 5*randn(1,50));  x = [x1 x2]'; % X  subplot(2,2,1); dat = [dat1 dat2]'; % Y  scatter(x1, dat1); hold on; scatter(x2, dat2, '*'); hold on; classdata = (dat&gt;40);   Computing Cost, Gradient and plotting  %  Setup the data matrix appropriately, and add ones for the intercept term [m, n] = size(x);  % Add intercept term to x and X_test x = [ones(m, 1) x];  % Initialize fitting parameters theta = zeros(n + 1, 1); %initial_theta = [0.2; 0.2];  J_history = zeros(num_iters, 1);   plot_x = [min(x(:,2))-2,  max(x(:,2))+2]  for iter = 1:num_iters  % Compute and display initial cost and gradient     [cost, grad] = logistic_costFunction(theta, x, classdata);     theta = theta - alpha * grad;     J_history(iter) = cost;      fprintf('Iteration #%d - Cost = %d... \r\n',iter, cost);       subplot(2,2,2);     hold on; grid on;     plot(iter, J_history(iter), '.r');  title(sprintf('Plot of cost against number of iterations. Cost is %g',J_history(iter)));     xlabel('Iterations')     ylabel('MSE')     drawnow      subplot(2,2,3);     grid on;     plot3(theta(1), theta(2), J_history(iter),'o')     title(sprintf('Tita0 = %g, Tita1=%g', theta(1), theta(2)))     xlabel('Tita0')     ylabel('Tita1')     zlabel('Cost')     hold on;     drawnow      subplot(2,2,1);     grid on;         % Calculate the decision boundary line     plot_y = theta(2).*plot_x + theta(1);  % &lt;--- Boundary line      % Plot, and adjust axes for better viewing     plot(plot_x, plot_y)     hold on;     drawnow  end  fprintf('Cost at initial theta (zeros): %f\n', cost); fprintf('Gradient at initial theta (zeros): \n'); fprintf(' %f \n', grad);   The above code is implementing gradient descent correctly (I think) but I am still unable to show the boundary line plot. Any suggestions would be appreciated.    logistic_costFunction.m  function [J, grad] = logistic_costFunction(theta, X, y)      % Initialize some useful values     m = length(y); % number of training examples      grad = zeros(size(theta));      h = sigmoid(X * theta);     J = -(1 / m) * sum( (y .* log(h)) + ((1 - y) .* log(1 - h)) );      for i = 1 : size(theta, 1)         grad(i) = (1 / m) * sum( (h - y) .* X(:, i) );     end  end   EDIT:  As per the below answer by @Esmailian, now I have something like this:  [m, n] = size(x);  x1_class = [ones(m, 1) x1' dat1']; x2_class = [ones(m, 1) x2' dat2'];  x = [x1_class ; x2_class] Why can one bend glass fibers without breaking it, whereas glasses one comes across in real life is usually solid?  Is there also a good high-school level explanation of this? Started new job. Rollover previous employer 401k to new 401k, IRA or Roth IRA? When using QuickLook to quickly look through multiple images (pressing space and then using the arrow keys to navigate), some images will not get displayed by QuickLook when hitting them up a second time (going back for example).   A GIF does a much better job than me showcasing the issue. So here's me previewing a few random images:    I have tried deleting   ~/Library/Preferences/com.apple.QuickLookDaemon.plist ~/Library/Caches/com.apple.QuickLookDaemon/Cache.db ~/Library/Caches/com.apple.QuickLookDaemon32/Cache.db ~/Library/Containers/com.apple.quicklook.ui.helper  and restarting, unfortunately to no avail.  Repairing permissions and restarting the Finder in 32-bit mode, as suggested  by others, don't appear to have any effect on this issue either.  This happens with all kinds of images, no matter their source or format. What is a historical lock, and what is it used for? Historical locks are sometimes applied to questions.   What is a historical lock? What is the purpose of a historical lock? How are questions affected by historical locking? When is it appropriate to lock a question for historical reasons?  When is it not appropriate? How do I request a historical lock for a question? What should I do if I notice a serious problem with a historically-locked question or one of its answers? Russian SE has a slightly longer and more storied history than Japanese SO How to show this function's discontinuity?  $ f(n) = \left\{     \begin{array}{l l}      \frac{xy}{x^2+y^2} &amp; \quad , \quad(x,y)\neq(0,0)\\      0 &amp; \quad , \quad(x,y)=(0,0)    \end{array} \right.$ How to generate PDF/A and PDF/X? I have heard about PDF  PDF/A (for archival) and PDF/X (for printing). How to generate LaTeX documents like that?  I'm also interested in answers with plain TeX and ConTeXt, and hopefully with both pdfTeX and XeTeX engines. How can I repair a toilet that is leaking at the base? Flushing the toilet causes a small amount of water to leak out from under the base of the toilet on one side. Stops after 2-3 seconds. Also noticed there is a higher pitch dripping of water which sounds like it is coming from the top part of the toilet. Lastly, the base of the toilet is slightly loose due to one of the bolts attaching it to the floor coming loose. How bad does this sound? I'm concerned this could cause some rotting to the floor (upstairs) - obviously needs to be fixed but do I really need a plumber or can I unscrew the toilet and fix this myself? I know zilch about plumbing. Evaluating this integral $ \small\int \frac {x^2 dx} {(x\sin x+\cos x)^2} $ The question:      Compute$$ \int \frac {x^2 \, \operatorname{d}\!x} {(x\sin x+\cos x)^2} $$   Tried integration by parts. That didn't work.  How do I proceed? Can I change the ordering for grouped dock items to be static? In the Ubuntu dock on Ubuntu 18.04, multiple windows of the same application are grouped and orange dots are shown to tell you how many windows of the application are opened. When you click on the icon, a small screen capture of each of the windows is shown.  However, these screen captures are shown in an order that's based on which window was last active on the desktop. This is something that clashes with the way I use the dock. I'm used to mentally mapping the windows to their dock positions. As such, I will often be trying to get to "the top one" and then I end up needing several clicks before I actually get to the terminal (or some other application) that I was looking for.  Is there some way to make sure that the order of these screen captures does not change whenever a window becomes active? On several occasions, I was reading a question thinking "I know a guy that knows the answer to this" and that guy (or gal) also happens to be a registered user. How can I bring this to the attention of this user? We know that you can't transfigure food, so you have to grow it or buy it. Ditto money.  I'm sure that aside from some medicinal plants Herbology Professor had there were no farmlands at Hogwarts. So they must have bought food (as well as potions ingredients for Snape etc...). And they needed to pay the teacher salaries.  Where did all that money come from according to canon?  Ministry funding?  Tuition?  Patent money on Dumbledore's inventions?  Philanthropic donations by Malfoys and co?  Other? What happens when a field turns on or off? Short Setup  I am curious about the the mechanics of fields, whether , , etc.  So as a specific example in order to simplify (hopefully) how to ask this question, consider  or , specifically interactions between .  My specific curiosity is in how we handle the "sudden" creation or loss of a source and how the source then creates its associated field.  My naive guess is that the loss of a source (e.g., annihilation) might be easier to handle, but let's focus on creation of a source for now.  Questions  The specific example of pair production interested me because I was wondering:   How does the field arise from the sources?   Meaning, is it delayed until after the source  fully "condenses" from the , for instance? Or does the field slowly "turn on" as the source "condenses"?   Perhaps I should have asked whether it we know if it takes time for sources to form (I assume it does).  If so, can we describe this from first principles or is it empirically based?  Am I asking that in a very uncomfortable manner?  If so, I would appreciate any suggestions.  For instance, is there a better word than "condense"?  I was thinking about water condensation as a very loose analogy to the purpose of the Higgs field in the formation of massive objects.  Why can they be produced without immediately recombining?   That is, how "close" are the two sources spatially after formation and what energies are needed to overcome the associated potential?  Does the field emanate/propagate as if from a point source?   I ask because I am trying to determine whether this is a simple  issue (i.e., far away it's just like a point source) or if the field emanates only from the "surface" of the source (e.g., ). If it starts from "within" the source as the source forms, do we know how to handle this mathematically?   My concern arises from the "similar" problem of bubble formation, where the bubble starts with zero radius which would require an infinite energy.  Perhaps the analogy is not appropriate?     Purpose  I ask these questions because it struck me this morning, while driving to work, that I did not know how and when a field "turned on."  I started to think about pair production and then quickly became confused (not difficult to do) and thought many of the quantum whisperers on this site would be much better at explaining these nuances than any of my failed rummaging through Wikipedia or scholarly articles and old text books. finding the index of a max value in R For macro photography, how do I choose between a compact camera or a mirrorless interchangeable-lens camera (without considering a lens)?   What indicator(s) should I look for when making the choice?