Does Java Graphics (Graphics2D) uses graphics card? does java Graphics or Graphics2D class uses graphics card? I am trying to draw a ton of things inside paintComponent() method in my JPanel, and I'm scared that it might take longer than it should.
Java2D Performance Issues I'm having performance oddities with Java2D. I know of the sun.java2d.opengl VM parameter to enable 3D acceleration for 2D, but even using that has some weird issues.   Here are results of tests I ran:  Drawing a 25x18 map with 32x32 pixel tiles on a JComponent Image 1 = .bmp format, Image 2 = A .png format  Without -Dsun.java2d.opengl=true  120 FPS using .BMP image 1 13 FPS using .PNG image 2  With -Dsun.java2d.opengl=true  12 FPS using .BMP image 1 700 FPS using .PNG image 2  Without acceleration, I'm assuming some kind of transformation is taking place with every drawImage() I do in software, and is pulling down the FPS considerably in the case of .PNG. Why though, with acceleration, would the results switch (and PNG actually performs incredibly faster)?! Craziness!  .BMP Image 1 is translated to an image type of TYPE_INT_RGB. .PNG Image 2 is translated to an image type of TYPE_CUSTOM. In order to get consistent speed with and without opengl acceleration, I have to create a new BufferedImage with an image type of TYPE_INT_ARGB, and draw Image 1 or Image 2 to this new image.   Here are the results running with that:  Without -Dsun.java2d.opengl=true  120 FPS using .BMP image 1 120 FPS using .PNG image 2  With -Dsun.java2d.opengl=true  700 FPS using .BMP image 1 700 FPS using .PNG image 2  My real question is, can I assume that TYPE_INT_ARGB will be the native image type for all systems and platforms? I'm assuming this value could be different. Is there some way for me to get the native value so that I can always create new BufferedImages for maximum performance?   Thanks in advance...
Can a multiclass sorcerer/cleric use the Metamagic class ability with non-sorcerer spells? For example, using Twinned Spell when casting cure wounds to heal two creatures instead of just one? How do I "parent" objects? I'm looking for a way to have two separate objects be connected, so that when I move the first object the second one will move also. The term parent is used, but how do I parent a object? $R$ is commutative, $I$,$J$ are ideals, $I+J=R$, then $IJ=I\cap J$ If $R$ is a commutative ring and $I$ and $J$ are ideals s.t. $I+J=R$ then show that $IJ=I\cap J$.  I've already shown that $IJ \subset I\cap J$, now I need to show the reverse inclusion.   I'm a bit lost, so far i'm just figuring out what pieces I have to work with.  Such as:  $\forall r\in R$ $\exists i\in I ,j\in J$ s.t. $i+j=r$  $\forall ij\in IJ$, $ij=i_1$ and $ij=j_1$ for some $i_1\in I$, $j_1\in J$.  Also, if I let $x\in I\cap J$, then $x=i_2=j_2=i+j$ for some $i_2\in I$, $j_2\in J$  Anyone, having problem getting to the conclusion here, thanks in advance English questions and negation with *do* in syntax Has the Magical Community breached the Final Frontier? (aka Wizards in Space?) Have they? Given that Muggles put the first man in space in 1961, even by 1991 a lot of Muggleborns perfectly aware of the space-travel would have passed through Hogwarts and into the Ministry, even the Department of Mysteries (which seems to be a bit like their research division/Area 51 combo) And even leaving Muggle technology (which Wizards don't care for or about) aside, Humans have wondered about air travel to &quot;other worlds&quot; and meeting aliens from the time of the Ancient Greeks, surely some Witch or Wizard somewhere might have wondered if it really was possible to fly to the moon? So, is there any canon (aka Books + Pottermore + Rowling interviews) evidence of the Wizarding community having ever travelled or trying to travel to space / other planets or satellites? ETA: Note, I am also totally okay (and in fact would be eager for) historical &quot;Famous Wizard&quot; card-like tidbits from canon-sources.  AWESOME example (that I'm frankly not expecting): When the Muggles managed to land on the Moon, the Department of Mysteries had to scramble to hide the Silver-backed Moon Dragon conservatory they had been maintaining near the landing site. ALSO AWESOME example (that I am hoping for): Warlock Flibberti and Witch Tigget misused this earth-based spell and amusingly found themselves on the moon with their pet monkey instead! A potentially dangerous Request.Form value was detected from the client Every time a user posts something containing &lt; or &gt; in a page in my web application, I get this exception thrown.  I don't want to go into the discussion about the smartness of throwing an exception or crashing an entire web application because somebody entered a character in a text box, but I am looking for an elegant way to handle this.  Trapping the exception and showing     An error has occurred please go back and re-type your entire form again, but this time please do not use &lt;   doesn't seem professional enough to me.  Disabling post validation (validateRequest="false") will definitely avoid this error, but it will leave the page vulnerable to a number of attacks.  Ideally: When a post back occurs containing HTML restricted characters, that posted value in the Form collection will be automatically HTML encoded. So the .Text property of my text-box will be something &amp; lt; html &amp; gt;  Is there a way I can do this from a handler? When performing machine learning, the performance of the machine learning method is dependent on the original function $f$ that we are trying to learn (let's forget for a moment the non-deterministic error and focus on the properties of $f$).  I have a conceptual question. What would make a function easy to learn? For instance, a linear function can be easily learnt by linear methods such as linear regression and SVM. But in the general case, what would make a function easier to learn for decision trees or a neural network?   I believe feature engineering helps us move to a feature space in which the function we want to approximate is easier to represent. But what properties exactly are we trying to achieve for this function? General integral to find resistance My question is: is there a simple and truly general equation for the resistance between two electrical equipotential surfaces?.  Obviously, if so, what is it, and if not, why?  It would be very difficult to solve, granted, but I just want to see a calculus equation that is fully descriptive.  I have two frameworks under which this could be entertained, I'll write those out and then explain the motivation.  To start with, we need propose that the volume separating the two surfaces has a volumetric resistivity, $\rho$ in units of $(\Omega m)$.  Single Volume Framework  We can limit the discussion to a defined volume, then the surfaces reside in that volume or on the surface of it.  This volume may have a constant resistivity $\rho$ while everywhere outside the volume is completely electrically insulating.  Infinite Volume Framework  An alternative to the above approach that might make the task more or less difficult would be to replace a constant resistivity with a spatial dependence $\rho(\vec{r})$ and no longer require a boundary condition.  In that case we only have 3 mathematical inputs to the problem, which is the resistivity defined for all $\vec{r}$ and a definition of the two surfaces, $S_1$ and $S_2$.  Known Algebraic Analogs  The  that I find insufficient is:  $$R = \rho \frac{\ell}{A}$$  Where $l$ is the length of the restive material that is any shape which has translation symmetry over that length, and $A$ is the cross-sectional area.  Obviously, this is a rather simple equation that won't apply to more complicated geometry.  Even more  seem to give equations that fall short of what I'm asking.  For example:  $$R = \rho \int_0^l \frac{1}{A(x)} dx$$  I think it's obvious that an equation such as this is built upon a myriad of assumptions.  For a thought experiment, imagine that the area starts out as very small and then pans out to very large quickly.  Well, accounting for the larger area in the above sense underestimates the resistance, because the charge has to diffuse out perpendicular to the average direction of flow as well as parallel to it.  I have some reasons to suspect this might actually be rather difficult.  A big reason is that all the approaches I'm familiar with require the flow paths to be established beforehand, which can't be done for what I'm asking.  So maybe this will result in two interconnected calculus equations.  Motivation  I had an interest in , and it occurred to me that I can't quickly and simply write down the equation for resistance between two points.  The unique thing about Squishy Circuits is that it calls for two types of dough, one that conducts and one that is mostly insulating.  However, the recipes aren't perfect and because of that, the young children who play with these circuits regularly encounter the limits of conductor and insulator definitions.  If you make your conductor dough too long and/or too thin, you will encounter dimming of the light you connect with it.  Similarly, a thin insulator layer will lead to a lot of leakage current which also dims the light. How do I choose what shows up in PuTTY title bar from Linux? In the PuTTY configuration there's an option in Terminal &rarr; Features called Disable remote-controlled window title changing. Without that enabled, the title bar of PuTTY will change every time I press return in the console.  I was thinking it'd be a more clean solution to set the title bar text from Linux than to specify one for every PuTTY client I have laying around. So where can I modify what Linux sets as the window title?     $ uname -a Linux drevo 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64 GNU/Linux  $ cat /etc/debian_version 6.0.4 Cannot determine size of graphic A classic exponential inequality: $x^y+y^x>1$ How to block any app from being installed? My mom has an android tablet and she doesn't even know what a site is, her e-mail, or even the password of her facebook account. She's an average user. The internet is facebook in her eyes. She has no need for apps or anything, it's just, only, precisely facebook. All is facebook.  How can I completely disable installing apps in android so they can't be installed in any way or form, I mean, not by URL, not by clicking, not by app store, not even by another program. Just disable the entire thing altogether.  Doesn't need to be safe, have locks, passwords etc. I'm not trying to secure the device from intruders, attackers or robbers, I'm trying to secure it from its very own user.  Please help. I just had to remove two anti-virus apps that were opening adware pages when she tried to open facebook lite, and that's obviously a no-go, apps which she "had not installed." Clearly there's some voodoo going on here for them to just popup, or maybe she just did it unknowingly, but none of that's relevant. How can you just disable installs so this couldn't ever happen again? It appears that in PHP objects are passed by reference. Even assignment operators do not appear to be creating a copy of the Object.  Here's a simple, contrived proof:  &lt;?php  class A {     public $b; }   function set_b($obj) { $obj-&gt;b = "after"; }  $a = new A(); $a-&gt;b = "before"; $c = $a; //i would especially expect this to create a copy.  set_b($a);  print $a-&gt;b; //i would expect this to show 'before' print $c-&gt;b; //i would ESPECIALLY expect this to show 'before'  ?&gt;   In both print cases I am getting 'after'  So, how do I pass $a to set_b() by value, not by reference? Grub not showing on startup for Windows 8.1 Ubuntu 13.10 Dual boot I am having issues with input in VMware Workstation Player 12 in windowed mode or on multiple screens. When typing something in the VM and moving mouse cursor out of the VM without clicking on anything (for example on the second screen with host OS), the typing in that VM stops until I move the cursor back into VM.  Can this feature be disabled somehow so I am able to type in the virtual machine even when cursor is outside of it?  Both guest and host are Win10 x64 OS. $X$ is Hausdorff if and only if the diagonal of $X\times X$ is closed Easy way to concatenate two byte arrays Writing ISO 19139 compliant XML metadata from spreadsheet? I am looking at a way to migrate the metadata from a spreadsheet into ISO 19139 compliant XML metadata documents for a collection of shapefiles. I can parse the data out of the spreadsheet into strings without issue however I am getting lost on how to take those strings and use them to populate the elements.   This example:  covers most of what I want to do, however I would need to generate the tree beforehand based on the ISO 19139 schema. PyXB seems to have schema bundles for OpenGIS but I would like some insight on how to connect everything. What does the volatile keyword do? In C++ what problem does it solve?  In my case, I have never knowingly needed it. How is the value of $\pi$ ( Pi ) actually calculated? When I was a child I was taught $\pi$ (Circumference/Diameter) is an irrational number  and can be approximated to $22/7$ but $= 3.(142857)(\ldots)$.      But where does this value comes from?  In short How do I derive $\pi$?