How to find how many objects are live for a particular class at a particular instance?
how many instances for a class exists at runtime in java
Export File Dialog in Blender 2.80 How can I get bring up a popup file browser in Blender 2.80 invoked by a button click in my addon, to define the name and location of a file to be exported?  In Blender 2.7x, I did this via the context window manager in the invoke function, but it is very possible that this hasn't been the preferred method for years, as I'm not finding useful documentation when I search for how to update this.  class MYTOOL_OT_write_data(bpy.types.Operator):     bl_idname = "mytool.write_data"     bl_label = "Write data file"      directory: bpy.props.StringProperty(subtype="FILE_PATH")     filename: bpy.props.StringProperty(subtype="FILE_NAME")      def invoke(self, context, event):  # 2.7x method         WindowManager = context.window_manager         context.window_manager.FILEBROWSERect_add(self)  # &lt;-- error here         return{"RUNNING_MODAL"}      def execute(self, context):         directory = self.directory         filename = self.filename         # Write csv data file using normal python functionality         return{'FINISHED'}   In Blender 2.80, I am getting the error "AttributeError: 'WindowManager' object has no attribute 'FILEBROWSERect_add'".  Thanks for your help.    UPDATED SOLUTION based on brockmann's solution below.  The trick is to use the ExportHelper util (which existed long before Blender 2.80):  from bpy_extras.io_utils import ExportHelper  class MYTOOL_OT_write_data(bpy.types.Operator, ExportHelper):     bl_idname = "mytool.write_data"     bl_label = "Write data file"      filename_ext = ".csv"  # ExportHelper mixin class uses this     def execute(self, context):         filepath = self.filepath         # f = open(filepath, 'w')         # f.write(stuff)         # f.close()         return{'FINISHED'} Fold a plane. then fold again Imagine a piece of paper and you fold it in half and then fold it again. that's what I am trying to do and cant. If I use bones the influence of the bones won't allow me to because I need 2 bones to control the same area. If I try shape keys it just deforms the mesh if I try to make it in multiple steps or does the wrong animation because it draws the shortest path instead of rotating from a point like a piece of paper would. How come unpolarized light does not undergo destructive interference? fsck error on boot: /dev/sda6: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY I'm in a numerical analysis course right now and it's pretty rigorous but I'm enjoying it a lot. I took a lower level course before that was more oriented towards implementation of numerical methods, so it's not my first time with the material.  Anyway, my professor wrote his own course notes and they're fantastic but I wanted some reference material since I'm currently outlining my own notes. Just wondering what the big ones out there are  edit: I would say I'm at an advanced undergraduate level I'm going through MSIL and noticing there are a lot of  instructions in the MSIL.  The MSDN article says they take no action and are used to fill space if the opcode is patched. They're used a lot more in debug builds than release builds.  I know that these kinds of statements are used in assembly languages to align later instructions, but why are MSIL nops needed in MSIL?  (Editor's note: the accepted answer is about machine-code NOPs, not MSIL/CIL NOPs which the question originally asked about.) 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)? I have both Windows 7 and Ubuntu installed on a shared machine. Because a lot of the non-developers use Windows, I'd like to change the boot order to make it easier for them.  Currently the boot order looks like the following:   Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot)  Memory test Memory test Windows 7 on /dev/sda6   How do I change the default order so that Windows 7 is at the top of the list?   Windows 7 on /dev/sda6 Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot)  Memory test Memory test If object A is moving at velocity $v$ (normalized so that $c=1$) relative to a ground observer emits object B at velocity $w$ relative to A, the velocity of B relative to the ground observer is  $$ v \oplus w = \frac{v+w}{1+vw} $$  As expected, $v \oplus 1 = 1$,  as "nothing can go faster than light".  Similarly, $v \oplus -1 = -1$. (same thing in the other direction)  But what if object A is moving at the speed of light and emits object B at the speed of light in the exact opposite direction? In other words, what is the value of $$1 \oplus -1?$$ Putting the values in the formula yields the indeterminate form $\frac{0}{0}$. This invites making sense of things by taking a limit, but $$ \lim_{(v,w)\to (1,-1)} \frac{v+w}{1+vw}$$ is not well-defined, because the limit depends on the path taken.  So what would the ground observer see? Is this even a meaningful question?  Edit: I understand $1 \oplus -1$ doesn't make sense mathematically (thought I made it clear above!), I'm asking what would happen physically. I'm getting the sense that my fears were correct, it's physically a nonsensical situation. Does deleting iCloud photos affect them on devices? If I delete a photo from my iCloud will it also be removed from my devices that are connected to my account? I'm completely new and lost in Ubuntu 12.04, I'm having trouble navigating to my Sublime folder which I know is in my /opt folder. Yet I've tried to no avail to navigate into it via Terminal window. The directory is colored in blue, no idea what this means...but I am able to access the folder using the GUI explorer...?  k@k-Ubuntu:~$ cd /opt k@k-Ubuntu:/opt$ ls Sublime Text 2 k@k-Ubuntu:/opt$ cd Sublime Text 2 bash: cd: Sublime: No such file or directory k@k-Ubuntu:/opt$ cd /Sublime Text 2 bash: cd: /Sublime: No such file or directory High p-values for logistic regression variable that perfectly separates? I'm using R to run some logistic regression. My variables were continuous, but I used cut to bucket the data. Some particular buckets for these variables always result in dependent variable being equal to 1. As expcted, the coefficient estimate for this bucket is very high, but the p-value is also high. There are about ~90 observations in either these buckets, and around 800 total observations, so I don't think it's a problem of sample size. Also, this variable should not be related to other variables, which would naturally reduce their p-values.  Are there any other plausible explanations for the high p-value?  Example:  myData &lt;- read.csv("application.csv", header = TRUE) myData$FICO &lt;- cut(myData$FICO, c(0, 660, 680, 700, 720, 740, 780, Inf), right = FALSE) myData$CLTV &lt;- cut(myData$CLTV, c(0, 70, 80, 90, 95, 100, 125, Inf), right = FALSE) fit &lt;- glm(Denied ~ CLTV + FICO, data = myData, family=binomial())   Results are something like this:  Deviance Residuals:       Min        1Q    Median        3Q       Max   -1.53831  -0.77944  -0.62487   0.00027   2.09771    Coefficients:                 Estimate Std. Error z value Pr(&gt;|z|)     (Intercept)     -1.33630    0.23250  -5.747 9.06e-09 *** CLTV(70,80]     -0.54961    0.34864  -1.576 0.114930     CLTV(80,90]     -0.51413    0.31230  -1.646 0.099715 .   CLTV(90,95]     -0.74648    0.37221  -2.006 0.044904 *   CLTV(95,100]     0.38370    0.37709   1.018 0.308906     CLTV(100,125]   -0.01554    0.25187  -0.062 0.950792     CLTV(125,Inf]   18.49557  443.55550   0.042 0.966739     FICO[0,660)     19.64884 3956.18034   0.005 0.996037     FICO[660,680)    1.77008    0.47653   3.715 0.000204 *** FICO[680,700)    0.98575    0.30859   3.194 0.001402 **  FICO[700,720)    1.31767    0.27166   4.850 1.23e-06 *** FICO[720,740)    0.62720    0.29819   2.103 0.035434 *   FICO[740,780)    0.31605    0.23369   1.352 0.176236     --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for binomial family taken to be 1)      Null deviance: 1037.43  on 810  degrees of freedom Residual deviance:  803.88  on 798  degrees of freedom AIC: 829.88  Number of Fisher Scoring iterations: 16   FICO in the range [0, 660) and CLTV in the range (125, Inf] indeed always results in Denial = 1, so their coefficients are very large, but why are they also "insignificant"? Baire: Show that $f\colon \mathbb{R}\to\mathbb{R}$ is a polynomial in an open bounded set Let $f\colon\mathbb{R}\to\mathbb{R}$ be an infinitely differentiable function, and suppose that for each $x\in\mathbb{R},$ $\exists\  n=n(x)\in\mathbb{N}$ such that $f^{(n)}(x)=0$. For each fixed $n\in\mathbb{N}$, consider the sets $F_n=\{x\in\mathbb{R} : f^{(n)}(x)=0\}$ and let $I=[a,b]$ a finite closed interval.  Show that $$I=\bigcup_{n=0}^\infty(I\cap F_n).$$ Show that there is a non empty open set $A\subset I$ where $f$ is a polynomial.   My attempt:  If $x\in I$ then by hypotesis there is $n$ such that $f^{(n)}(x)=0$ then $x\in F_n$ so then $\bigcup F_n\supset I$ then $$I=I\cap\bigcup_{n=0}^\infty F_n=\bigcup_{n=0}^\infty(I\cap F_n).$$  Let $$B_k=\bigcap_{n=k}^\infty F_n.$$ I want to show that $I\cap B_k$ has non-empty interior for some $k\in\mathbb{N}$. Then there is $A\subset B_k$ and by Taylor's Theorem $f$ will be a polynomial. But I didn't know how to prove this. I tried using the following bigger set: $$B=I\cap\bigcup_{k=0}^\infty B_k=I\cap\bigcup_{k=0}^\infty \bigcap_{n=k}^\infty F_n.$$ I think that it suffices to show that $B^o\neq\emptyset$ maybe using the Baire's Theorem proving that $B$ is a not meagre set.   More general Problem  Let $f$ be an infinitely differentiable function on $[0,1]$ and suppose that for each $x \in [0,1]$ there is an integer $n \in \mathbb{N}$ such that $f^{(n)}(x)=0$. Then does $f$ coincide on $[0,1]$ with some polynomial? If yes then how. I thought of using Weierstrass approximation theorem, but couldn't succeed. Answer: The proof is by contradiction. Assume $f$ is not a polynomial. Consider the following closed sets: $$ S_n = \{x: f^{(n)}(x) = 0\} $$ and $$ X = \{x: \forall (a,b)\ni x: f\restriction_{(a,b)}\text{ is not a polynomial} \}. $$ It is clear that $X$ is a non-empty closed set without isolated points. Applying Baire category theorem to the covering $\{X\cap S_n\}$ of $X$ we get that there exists an interval $(a,b)$ such that $(a,b)\cap X$ is non-empty and $$ (a,b)\cap X\subset S_n $$ for some $n$. Since every $x\in (a,b)\cap X$ is an accumulation point we also have that $x\in S_m$ for all $m\ge n$ and $x\in (a,b)\cap X$. Now consider any maximal interval $(c,e)\subset ((a,b)-X)$. Recall that $f$ is a polynomial of some degree $d$ on $(c,e)$. Therefore $f^{(d)}=\mathrm{const}\neq 0$ on $[c,e]$. Hence $d&lt; n$. (Since either $c$ or $e$ is in $X$.) So we get that $f^{(n)}=0$ on $(a,b)$ which is in contradiction with $(a,b)\cap X$ being non-empty. Combine two datetime variables into one Cannot update grub with parameters on live USB I have booted from a live USB ("Try Ubuntu"), that also has a persistent option set (I used  to create one) to do some tests for .  I'm trying to test  (like ) by doing this  sudo nano /etc/default/grub sudo update-grub   The problem is that that last command gives me this:  /usr/sbin/grub-probe: error: failed to get canonical path of /cow.   It looks like /cow is the file-system that is mounted on /, according to:  :~# df Filesystem     1K-blocks    Used Available Use% Mounted on /cow             4056896 2840204   1007284  74% / udev             1525912       4   1525908   1% /dev tmpfs             613768     844    612924   1% /run ....   Is there a way for me to run update-grub? Can anyone tell me if there is a way with generics to limit a generic type argument T to only:   Int16 Int32 Int64 UInt16 UInt32 UInt64   I'm aware of the where keyword, but can't find an interface for only these types,  Something like:  static bool IntegerFunction&lt;T&gt;(T value) where T : INumeric Do eyeballs exhibit chromatic aberration? Fairly straightforward question. If not, why not?  I suspect that if they do, it is not perceived due to the regions of highest dispersion being in one's region of lowest visual acuity. I just installed a new version of Ubuntu and I want to roll it back to the previous version.  How can I do that? Is that even possible? How would you handle different aspect ratios in a 2d platformer? Say I have a variable named choice it is equal to 2. How would I access the name of the variable? Something equivalent to  In [53]: namestr(choice) Out[53]: 'choice'   for use in making a dictionary. There's a good way to do this and I'm just missing it.  EDIT:  The reason to do this is thus. I am running some data analysis stuff where I call the program with multiple parameters that I would like to tweak, or not tweak, at runtime. I read in the parameters I used in the last run from a .config file formated as  filename no_sig_resonance.dat  mass_peak 700  choice 1,2,3   When prompted for values, the previously used is displayed and an empty string input will use the previously used value.  My question comes about because when it comes to writing the dictionary that these values have been scanned into. If a parameter is needed I run get_param which accesses the file and finds the parameter.   I think I will avoid the problem all together by reading the .config file once and producing a dictionary from that. I avoided that originally for... reasons I no longer remember. Perfect situation to update my code!