Can't pass null for argument 'pathString' in child() When i try to open the activity (app crashed)
What is a NullPointerException, and how do I fix it?
Configuring Firefox to use a proxy from the command line I'm looking for a way to tell Firefox to use a proxy in Ubuntu Ludid (10.04.1 LTS).   I'm installing Ubuntu semi-automatically on several identical machines. For this, I use a script that, amongst other things, sets system-wide proxy settings:  echo "export http_proxy=http://myproxy:3128/" &gt; /etc/profile.d/proxy.sh echo "export HTTP_PROXY=http://myproxy:3128/" &gt;&gt; /etc/profile.d/proxy.sh chmod a+x /etc/profile.d/proxy.sh   I can confirm that the variables are set correctly when checking in a shell. Most programs respect this setting and use my proxy. Firefox, however, does not. When I open its network connection settings dialog, however, it is pre-set to "use system settings" for the proxy.   What does Firefox expect here? A differently-named variable? Can I set something in FF's prefs.js? (Re?)Install Ubuntu on a Dell laptop that had Ubuntu preinstalled I need to use binary variables (values 0 &amp; 1) in k-means. But k-means only works with continuous variables. I know some people still use these binary variables in k-means ignoring the fact that k-means is only designed for continuous variables. This is unacceptable to me.  Questions:     So what is the statistically / mathematically correct way of using binary variables in k-means / hierarchical clustering? How to implement the solution in SAS / R? More Efficient Spatial join in Python without QGIS, ArcGIS, PostGIS, etc I'm attempting to do a spatial join much like the example here: . However, that approach seems really inefficient / slow. Even running this with a modest 250 points takes almost 2 minutes and it fails entirely on shapefiles with > 1,000 points. Is there a better approach? I'd like to do this entirely in Python without using ArcGIS, QGIS, etc.  I'd also be interested to know if it's possible to SUM attributes (i.e. population) of all the points that fall within a polygon and join that quantity to the polygon shapefile.       Here is the code I'm trying to convert. I get an error on line 9:  poly['properties']['score'] += point['properties']['score']   which says:     TypeError: unsupported operand type(s) for +=: 'NoneType' and 'float'.    If I replace the "+=" with "=" it runs fine but that doesn't sum the fields. I've also tried making these as integers but that fails as well.  with fiona.open(poly_shp, 'r') as n:    with fiona.open(point_shp,'r') as s:     outSchema = {'geometry': 'Polygon','properties':{'region':'str','score':'float'}}     with fiona.open (out_shp, 'w', 'ESRI Shapefile', outSchema, crs) as output:         for point in s:             for poly in n:                 if shape(point['geometry']).within(shape(poly['geometry'])):                       poly['properties']['score']) += point['properties']['score'])                     output.write({                         'properties':{                             'region':poly['properties']['NAME'],                             'score':poly['properties']['score']},                         'geometry':poly['geometry']}) Installing Ubuntu on one of two hard drives I have two hard drives. One is used for Windows and one is empty. I want to install Ubuntu on the empty hard drive. The Windows hard drive is disk0 in Windows and the empty hard drive is disk1. When I install Ubuntu and it asks where I want to install it, I choose "Something Else" but I am stuck there. What do I choose for "boot loader installation"? Extending the User model with custom fields in Django What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes).  I've already seen a   to do it, but can't decide on which one is the best. What is the relativistic calculation of travel time to Proxima Centauri? It has already been  how fast a probe would have to travel to reach Alpha Centauri within 60 years.  NASA has done  into a probe that would take 100 years to make the trip.  But I am interested in this question from a slightly different perspective.  I would like to know how long the trip from our solar system to Proxima Centauri would take for both a ship and for an observer on Earth while accounting for the effects of general relativity on a .  The following assumptions may be made:   The ship starts and ends at 0 km/s relative to the Earth observer. The ship experiences a constant force of acceleration of 20 g until the half-way point and then a constant force of deceleration of 20 g until the destination. The path traveled is such that accleration is in only one spatial direction. The distance traveled is 4.25 light years.   Calculate (accounting for general relativistic effects):   Time of trip for Earth-based observer. Time of trip for ship-based observer. Maximum speed.   You don't need to consider mass, or life-support systems, or method of propulsion; I am really only interested in the effects of relativity on the perceived time of the trip. Can multiple different HTML elements have the same ID if they're different elements? Keep items in inventory on death in Minecraft I once played a vanilla Minecraft adventure map (called "Herobrine's Mansion") that prevented the player from losing their items on death. Which commands can be used to prevent the player from losing their items on death (in vanilla Minecraft)? $\lfloor x\rfloor + \lfloor y\rfloor \leq \lfloor x+y\rfloor$ for every pair of numbers of $x$ and $y$ I have a map a at the link below:    I added one of my GeoServer WMS layers to the map, now I try to add the attributes window pop up on click. I found to examples on the OpenLayers 3 homepage, but I cannot put together a working code...      Is there any chance to have a working sample somewhere? How can I move my /home directory to another partition if it's already part of the / partition? I have a wonderful running Maverick Meerkat install going on right now. I want to move my /home to another partition as per many suggestions.   How can I go about doing this without reinstalling the entire Ubuntu system? Can I simply create the partition with gparted and then change the mount point of /home in fstab to reflect it or is it a bit more difficult? How can slightly blurred photos be improved in post processing? 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] Is there a simple way to change the thickness of a curved tube without scaling its overall size? E.g. scaling the minor radius of an already created torus without affecting its major radius or change the bevel width of a curve that has already been converted to a mesh. How does the EMH hold onto a phaser while having bullets go through him? In the Voyager episode: "Future's End, Part II" the doctor rescues B'elanna and Chakotay.     PORTER: They've got lasers! A black man and some bald guy.  (The EMH   enters. Porter and Butch's bullets go straight through him.)       PORTER: God in heaven help us.       EMH: Divine intervention is unlikely.  (The EMH phaser stuns them,   then unties Torres and Chakotay.)   In an earlier episode of Voyager, "Phage":     PARIS: But a hologram is just a projection of light held in a magnetic   containment field. There's no real matter involved. (The EMH slaps   Paris.)       EMH: Now, you hit me.  (Paris's hand passes through the EMH's head.)       EMH: The magnetic containment field that creates the illusion of my   body can be modulated to allow matter to pass through it or be   stopped. I might be able to modulate the holographic lungs in the same   way, allowing oxygen and carbon dioxide to pass from the lungs to the   blood stream.   In order to make the above adjustments the doctor had to touch several buttons on a control panel. I realize the time I refer to above he was using the holo-emitter instead.    How does it work exactly that the doctor can have bullets pass straight through him but he's able to hold on to a phaser without it falling out of his hand? Can he simultaneously have part of his body be transparent and the rest be more like matter at the same time? What if the bullets hit the hand holding the phaser? I think one had a shotgun as I recall so there probably would have been pellets going all over the place. Finding the uniquely determined region of a PDE (a) Solve the equation $yu_x+xu_y=0$  with the condition $u(0,y) = e^{-y^2}$. (b) In which region of the xy plane is the solution uniquely determined?     I did the first part but I don't understand how to do part b.  I read   But I don't understand how the argument is based. A more clear explanation is appreciated How is the Integral of $\int_a^bf(x)~dx=\int_a^bf(a+b-x)~dx$ Can Some one tell me what this method is called and how it works With a detailed proof   $$\int_a^bf(x)~dx=\int_a^bf(a+b-x)~dx$$  I've been using this a lot in definite integration but haven't seemed to have realized why it is true.  But whatever it is it always seems to work.  Basically a proof of how it is always true. I want to have a  video background that will loop on some frames of my presentation. Can anyone help me to do that? if a complex function $f$ is real-differentiable, then $f$ or $\overline{f}$ are complex-differentiable This is an exercise from Remmert's Theory of Complex functions.  Let $D\subset \mathbb{C}$ be a domain and $f:D\rightarrow \mathbb{C}$ a real-differentiable function. Assume that the following limit exists:  $ \mathrm{lim}_{h\rightarrow 0} \left|  \frac{f(c+h) - f(c)}{h}   \right|.$  Show that either $f$ or $\overline{f}$ is complex-differentiable.  I've tried showing that $\frac{\partial f}{\partial \overline{z}} = 0$ or $\frac{\partial \overline{f}}{\partial z} = 0$ by using the fact that there exist continuous functions $g$ and $h$ such that in $D$ one can write   $f(z) = f(c) + (z-c)g(z) + (\overline{z} - \overline{c})h(z)$   and that  $g(c)= f_{z}(c)$ and $h(c) = f_{\overline{z}}$ and then plugging this into the limit above. Does this approach works and I just can´t see how to do it? Can someone give a hint or a guideline solution to this?