I already have the points I need, I just need to figure out how to create a nurbs curve that uses those points (I know there are answers around, but I am hoping that since those answers are from over 5 years ago that there might be easier / cleaner methods)
I'm trying to write a script which creates a Nurbs path curve, bevels it, and then stores the location of each vertex/point in that curve. I've been writing it based on the code displayed in the info panel, but it doesn't show what the vertices are supposed to be called - so I can't refer to them in the script.  Update: After following Ratt's links, I modified  for Nurbs Path and am now stuck again, though it's still progress. Below is one version I tried out, but the error message says that Curve has no attribute path_points. Of course it doesn't, because I made that up because I don't know what the Nurbs Path equivalent for bezier_points is.  import bpy import random  def pathPointLoc(cu, typ, points):      for (n) in enumerate(points):         nurb = cu.path_points[n]         print(nurb.location)      return  cu = bpy.data.curves.new("MyCurve", "CURVE") ob = bpy.data.objects.new("MyCurveObject", cu) scn = bpy.context.scene scn.objects.link(ob) scn.objects.active = ob  cu.bevel_object = bpy.data.objects["BezierCircle"] cu.taper_object = bpy.data.objects["BezierCircle"]  pathPointLoc(cu, "NURBS", [(0,0,0,1), (0,0,1,random.randint(1,4)), (0,1,1,1), (1,4,1,1)] )
Equals(=) vs. LIKE When using SQL, are there any benefits of using = in a WHERE clause instead of LIKE?  Without any special operators, LIKE and = are the same, right? I have just bought a Nikon 50mm f/1.8D prime lens.  I took this picture (leg of my glasses frame on a mouse, and a LED desk lamp is on top of it) : f1.8, 1/80s, ISO 200   The purple fringing is right in the middle of the picture. Does it happen very often to this lens? I would like to know what would be the best way to do unit testing of a servlet.   Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use of session parameters?  Is there a way to do this simply using classical tools such as JUnit, or preferrably TestNG? Did I need to embed a tomcat server or something like that? I am using Google Chrome 48.0 32-bit. Today when I launched Google Chrome, I got this message:    This computer will soon stop receiving Google Chrome updates because this Linux system will no longer be supported   I thought Ubuntu 14.04 is supported for five years, what's exactly happening here?  And on 64-bit Ubuntu, I get an error from Update Manager and apt-get update:  Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release  Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)   Some index files failed to download.   They have been ignored, or old ones used instead. The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead Is there a list of Ubuntu versions with default corresponding Linux kernel versions somewhere?  I would specifically like to know the most recent version of Ubuntu that still used Linux Kernel 2.x. In addition to whatever files I may choose to exclude, what files does the system exclude by rule or classification?    It might make sense not to backup Trash or Caches, but I'm looking for a way to tell what files are skipped "behind the scenes." Knowing if the system maintains an exclusion list or exclusion pattern would be very helpful in managing larger groups of macs. Allow HTML in excerpt Here is my excerpt code.  // Generate custom excerpt length function wpbx_excerpt_length($length) {     return 300; } add_filter('excerpt_length', 'wpbx_excerpt_length');   How do I allow html like &lt;a&gt; &lt;b&gt; &lt;i&gt; &lt;br&gt; I finally got dragonrend and defeated Alduin, but I'm still too weak for fighting ancient dragons. Any certain weapon for killing them.  (I've got lvl 20 one handed weapons and lvl 46 for archery, so the Dragonbane is out of the question) I added a user to a group, but group permissions on files still have no effect I changed permissions of a file (chmod g+w testfile) and running ls -l testfile gives:  -rwxrwxr-x 1 user1 user1 0 2011-01-24 20:36 testfile   I then added a user to that group ("/etc/group" has user1:x:1000:user2 line), but am failing to edit that file as user2. Why is this so? Which Stack Exchange site is best for AutoCAD questions like using Blender for graphical design? Distribution of hitting time of line by Brownian motion I came across the following question:     Let $T_{a,b}$ denote the first hitting time of the line $a + bs$ by a standard Brownian   motion, where $a &gt; 0$ and $−\infty &lt b &lt \infty$ and let $T_a = T_{a,0}$ represent the first hitting time of the level $a$.      1) For $\theta &gt; 0$, by using the fact that $\mathbb{E}e^{-\theta T_a}=e^{-a\sqrt{2\theta}}$, or otherwise, derive an expression for $Ee^{-\theta T_{a,b}}$, for each $b$, $−\infty &lt b &lt \infty$.       2) Hence, or otherwise, show that, for $t &gt; 0$,    $$\mathbb{P}[T_{a,b}\leq t] = e^{-2ab}\phi\left(\frac{bt-a}{\sqrt{t}}\right)+1-\phi\left(\frac{a+bt}{\sqrt{t}}\right).$$   For the first part, I ended up, by changing measure, with the (unverified) expression  $$\mathbb{E}e^{-\theta T_{a,b}}=\exp\left(-a\left[b+\sqrt{2\left(\theta+\frac{b^2}{2}\right)}\right]\right).$$  What's the cleanest way to do the second part? It seems I could either do some kind of inverse transform on the moment generating function, or calculate the moment generating function of the given distribution. Both of these seem difficult. Am I missing something, or do I just need to persevere?  Thank you. Finding a 2x2 Matrix raised to the power of 1000 Let $A= \pmatrix{1&amp;4\\ 3&amp;2}$. Find $A^{1000}$.  Does this problem have to do with eigenvalues or is there another formula that is specific to 2x2 matrices? Installing Broadcom Wireless Drivers I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working. Let $M_n$ denote the vector space of all $n\times n$ real valued matrices and for any matrix $A\in M_n$ let $A^t$ denote its transpose. Define the linear map $T:M_n\rightarrow M_n$ as $$T(A)=A+A^t.$$ What is the minimal polynomial of $T$? What are the eigenvalues and the corresponding eigenspaces of $T$? What is the characteristic polynomial of $T$?  I learned about minimal polynomials of operators from $\textit{Linear Algebra Done Right}$ by Axler. In his description he explains how in order to find the minimal polynomial you must find the smallest positive integer $m$ such that $T^m$ is a linear combination of $I, T, T^2, \ldots, T^{m-1}$. That is, the smallest integer $m$ such that $$T^m = a_0I+a_1T+a_2T^2+ \cdots +a_{m-1}T^{m-1}.$$  As for the eigenvalues...since we are working with real-valued matrices, then $A$ and $A^t$ have the same eigenvalues, so if $\lambda \in \mathbb{R}$ is an eigenvalue of $A$ (and hence of $A^t$) wouldn't $2\lambda$ be an eigenvalue of $A+A^t$? I apologize if I am saying utter nonsense... How to calculate overlap between empirical probability densities? I'm looking for a method to calculate the area of overlap between two kernel density estimates in R, as a measure of similarity between two samples. To clarify, in the following example, I would need to quantify the area of the purplish overlapping region:  library(ggplot2) set.seed(1234) d &lt;- data.frame(variable=c(rep("a", 50), rep("b", 30)), value=c(rnorm(50), runif(30, 0, 3))) ggplot(d, aes(value, fill=variable)) + geom_density(alpha=.4, color=NA)     A similar question was discussed , the difference being that I need to do this for arbitrary empirical data rather than predefined normal distributions. The overlap package addresses this question, but apparently only for timestamp data, which doesn't work for me. The Bray-Curtis index (as implemented in vegan package's vegdist(method="bray") function) also seems relevant but again for somewhat different data.  I'm interested in both the theoretical approach and the R functions I might employ to implement it. Search and replace a line in a file in Python I want to loop over the contents of a text file and do a search and replace on some lines and write the result back to the file. I could first load the whole file in memory and then write it back, but that probably is not the best way to do it.  What is the best way to do this, within the following code?  f = open(file) for line in f:     if line.contains('foo'):         newline = line.replace('foo', 'bar')         # how to write this newline back to the file This works as expected:  $ echo a b c | xargs --replace="{}" echo x "{}" y x a b c y   This does too:  $ echo a b c | xargs --max-args=1 echo x x a x b x c   But this doesn't work as expected:  $ echo a b c | xargs --max-args=1 --replace="{}" echo x "{}" y x a b c y   And neither does this:  $ echo a b c | xargs --delimiter=' ' --max-args=1 --replace="{}" echo x "{}" y x a y x b y x c  y   I expected this output:  x a y x b y x c y   As a workaround, I am using printf and two xargs, but that is ugly:  $ echo a b c | xargs printf '%s\0' | \ &gt; xargs --null --max-args=1 --replace="{}" echo x "{}" y x a y x b y x c y   Any idea why this is happening? Significance of the second focus in elliptical orbits 1.In classical mechanics, using Newton's laws, the ellipticity of orbits is derived. It is also said that the center of mass is at one of the foci.   2.Each body will orbit the center of the mass of the system.  My question is : Are the assumptions in 1 and 2 correct?   Follow up question : Assuming the distance from the centre of the mass to each body remains the same, do we have two bodies orbiting the centre of the mass of the system in an elliptical or circular orbit?   Finally : With elliptical orbits, if the heavier mass is supposed to be in one of the foci, if there is any significance to second focus, what is it? Is it a Lagrange point by any chance or does it have some other mathematical property? Google Cloud frequently doesn't have enough resources