Your winnings per unit stake on game $n$ are given by independent random variables $\epsilon_n$ such that $P(\epsilon_n=1)=p$, $P(\epsilon_n=-1)=q$ with $1/2<p=1-q<1$. Let $C_n$ be your stake on game $n$ which must lie between $0$ and $Z_{n-1}$, where $Z_n$ is your fortune at time $n$ and $Z_0$ is a constant. Let $\mathcal{F}_n=\sigma(\epsilon_1,...,\epsilon_n)$.  Show that if $C_n$ is any previsible strategy then $\log Z_n-n\alpha$ is a supermartingale with $\alpha=p\log p+q\log q+\log2$ but  for a certain strategy it is a martingale and find that strategy.  I' m not sure if I am even starting correctly. It seems to me that $Z_n$ is given by $Z_{n+1}=Z_n+\epsilon_{n+1}C_{n+1}$ because  the fortune at the next time is given by the fortune at the present time plus (or minus) the stake on the next game. Now I have $$ E(\log Z_{n+1}-(n+1)\alpha | \mathcal{F}_n)=E(\log(Z_{n}+\epsilon_{n+1}C_{n+1})| \mathcal{F}_n)-\alpha-n\alpha $$ so I should prove $E(\log(Z_{n}+\epsilon_{n+1}C_{n+1}| \mathcal{F}_n)-logZ_n-\alpha\leq 0$.  In the conditional expectation I can factor $C_{n+1}$ and since it is measurable wrt $\mathcal{F}_n$ I get $$  E(\log(Z_{n}+\epsilon_{n+1}C_{n+1})| \mathcal{F}_n) =\log(C_{n+1})+E(\log(\frac{Z_{n}}{C_{n+1}}+\epsilon_{n+1})| \mathcal{F}_n) \leq \log Z_n +\log E(\frac{Z_{n}}{C_{n+1}}+\epsilon_{n+1}| \mathcal{F}_n)$$ by using Jensen. So it remains to show $$ \log E(\frac{Z_{n}}{C_{n+1}}+\epsilon_{n+1}| \mathcal{F}_n) \leq \alpha $$ or equivalently  $$E(\frac{Z_{n}}{C_{n+1}}+\epsilon_{n+1}| \mathcal{F}_n)\leq 2p^pq^q.$$ What I can get is that by measurability and independence $E(\frac{Z_{n}}{C_{n+1}}+\epsilon_{n+1}| \mathcal{F}_n)=\frac{Z_{n}}{C_{n+1}}+E\epsilon_{n+1}=\frac{Z_{n}}{C_{n+1}}+p-q$ but I don't think this is less than $2p^pq^q$.  Edit: By factoring $Z_n$ and repeating the steps I get  $$   E(\log(Z_{n}+\epsilon_{n+1}C_{n+1})| \mathcal{F}_n)\leq \log Z_n+\log(1+\frac{C_{n+1}}{Z_n}E\epsilon_{n+1})\leq \log Z_n+\log(2p)$$  because $E\epsilon_{n+1}=p-q$. So the supermartingale condition would be verified if $2p\leq 2p^pq^q$ and equivalently if $1\leq (\frac{1-p}{p})^{1-p}$, however this is true if $1>2p$ unless I didn't reverse some inqualities.   In this way it seems that if we choose $C_{n+1}=\beta Z_n$ for $\beta$ such that $1+\beta(p-q)=2p^pq^q$ we get equalities in the previous steps and therefore a martingale.  Do you think it is correct?

From David Williams' Probability with Martingales     Related question:   What I tried: For no 2, if $\ln Z_n - n \alpha$ is a supermartingale, then for $m < n$, $$E[\ln Z_n - n \alpha | \mathscr F_m] \le \ln Z_m - m \alpha$$ $$ \to E[\ln Z_N - N \alpha | \mathscr F_0] \le \ln Z_0 - 0 \alpha$$ $$ \to E[\ln Z_N - N \alpha] \le \ln Z_0$$ $$ \to E[\ln \frac{Z_N}{Z_0}] \le N \alpha$$ Is that right?  For no 1, for $m < n$, $$E[\ln Z_n - n \alpha | \mathscr F_m] = E[\ln Z_n | \mathscr F_m] - n \alpha$$ $$ = E[\ln \frac{Z_n}{Z_0} | \mathscr F_m] - n \alpha + \ln Z_0$$ $$ = E[\ln \frac{Z_n}{Z_{n-1}} | \mathscr F_m] + ... + E[\ln \frac{Z_{m+1}}{Z_{m}} | \mathscr F_m]$$ $$+ \ln \frac{Z_m}{Z_{m-1}} + ... + \ln \frac{Z_{1}}{Z_{0}} - n \alpha + \ln Z_0$$ Note that $$Z_n - Z_{n-1} \le |Z_n - Z_{n-1}| \le C_n |\epsilon_n - \epsilon_{n-1}| \le 2C_n \le 2Z_{n-1}$$ Also, I think $$\ln \frac{Z_n}{Z_{n-1}} \le |Z_n - Z_{n-1}|$$ Hence we have $$E[\ln \frac{Z_n}{Z_{n-1}} | \mathscr F_m] + ... + E[\ln \frac{Z_{m+1}}{Z_{m}} | \mathscr F_m]$$ $$+ \ln Z_m - n \alpha$$ $$\le E[2Z_{n-1} | \mathscr F_m] + ... + E[2Z_{m} | \mathscr F_m]$$ $$+ \ln Z_m - n \alpha$$ $$= 2(E[Z_{n-1} | \mathscr F_m] + ... + E[Z_{m} | \mathscr F_m])$$ $$+ \ln Z_m - n \alpha$$ One thing to do would be to show that $$2E[Z_{n-1} | \mathscr F_m] + ... + 2E[Z_{m} | \mathscr F_m] \le (n-m) \alpha$$ possibly by showing that $2E[Z_{\{\cdot\}} | \mathscr F_m] \le \alpha$ How would I do that? Something else: $$E[\ln \frac{Z_n}{Z_m} | \mathscr F_m] + \ln Z_m - n \alpha$$ $$ \le E[|Z_n - Z_m| | \mathscr F_m] + \ln Z_m - n \alpha$$ $$ \le E[2Z_m | \mathscr F_m] + \ln Z_m - n \alpha$$ $$ \le 2Z_m + \ln Z_m - n \alpha$$ Now $2Z_m \le (n-m) \alpha?$ We have $$2Z_m = 2\sum_{k=1}^{m} C_k(\epsilon_k - \epsilon_{k-1})$$ $$\le 2\sum_{k=1}^{m} Z_{k-1}$$ I'm not quite sure how to show that $$2\sum_{k=1}^{m} Z_{k-1} \le (n-m)\alpha$$ if that's even true. How can/else can I approach this problem?  For no 3, no idea. Any hints? I think it has something to do with a stopping time. Might we have to use the ff lemma (red box):    ?


I have a file, from which I need to extract words between two patterns  e.g. i need to extract between originatingMessageId  For this input file  userGLN|originatingMessageId0028400000000~20170412194316~1182055~1/originatingMessageId/header|documentException|originatingDocumentId|0028400000000~20170412194316~1182055~1~15~19649/originatingDocumentId|link|operation|DELETE|operation||informationProviderGLN|0028400000000|informationProviderGLN|   the expected output file would be:  0028400000000~20170412194316~1182055~1

I have the following in a file Output.dat. I need to extract the value between dn: uid= and ,ou=  dn: uid=user1,ou=Active,ou=Member,dc=domain,dc=org  dn: uid=user2@abc.com,ou=Active,ou=Member,dc=domain,dc=org  dn: uid=usertest,ou=Active,ou=Member,dc=domain,dc=org  dn: uid=abc1,ou=Active,ou=Member,dc=domain,dc=org   I tried using sed -e '/dn: uid=/,/,ou=/p' output.dat but  it returns complete line instead of value. When tried to use sed -e '/dn: uid=/,/,ou=/\1/p' output.dat  then got the following error: sed: -e expression #1, char 18: unknown command: `\'


Title. I've always wondered how many elements someone not an avatar could master. It is implied in the show that only the Avatar could master all 4 elements and that bending is a skill that one was born with. Is it possible for someone to bend both air/fire, or any other combination of elements?

After reading this question  While it seems that it would break one of the rules of the show, that only the avatar can master all four elements. There would also be good reasons as to why someone couldn't learn all four, there is always the opposing element that is hardest for the Avatar to learn. I don't see any reason why someone couldn't learn to bend two elements (not master, but just bend since Thadeus's Answer  to the previous question is apparently the Definitive Answer on the subject.)    Many benders do learn to bend beyond their element such as Toph becoming a metal bender and Katarra bending blood. Now metal is considered part of the Earth but so is sand and it seems that sand is moved more like water. Iroh was able to adapt a water bender technique to fire bending which means it is possible to learn and use different bending styles. Also Iroh spent time connecting to the spirit world and that seems to be the main reason the Avatar is able to bend all 4 elements. So if someone was connected to the spirit world or even their past life that would fulfill that requirement.   Would it be possible to bend two elements?  There do seem to be times where it has been done in the series such as bending mud which is both Earth and Water. And there would definitely be limits such as a Earth bender couldn't bend Air and a Water bender couldn't bend Fire. But why couldn't a Fire Bender learn to bend Air. They both use breath control as a main focus of their bending. It also states on the Energybending wiki entry that all bending used to be done as an inner bending but that it became element bending.   So with new bending techniques being formed all the time, already stated used of combined elements being used, an assumed spiritual connection to a past life or a spiritual journey been taken, energybending rediscovered is it possible that two elements could be bent by one bender who is not the Avatar?


I had sfdx working like 10 minutes before.  However, now it is crapping out:  $ sfdx force module.js:96     throw e;     ^  SyntaxError: Error parsing C:\Users\wlee0264\AppData\Local\sfdx\plugins\node_modules\salesforcedx\package.json: Unexpected token � in JSON at position 1     at Object.parse (native)     at readPackage (module.js:92:52)     at tryPackage (module.js:102:13)     at Function.Module._findPath (module.js:186:20)     at Function.Module._resolveFilename (module.js:467:25)     at Function.Module._load (module.js:417:25)     at Module.require (module.js:497:17)     at require (internal/module.js:20:19)     at Object.<anonymous> (C:\Users\wlee0264\AppData\Local\sfdx\tmp\heroku-script-658969795:10:14)     at Module._compile (module.js:570:32)   The only thing I remember doing was messing with ssh keys when pushing to github.  Any ideas?

Anyone on a MAC got this update to work? Anyone know how to fix?  It hangs for me on finishing up.   Now all I get when executing sfdx at the cli is:  module.js:540     throw err;     ^  Error: Cannot find module '/Users/xxxx/.local/share/sfdx/client/package.json'     at Function.Module._resolveFilename (module.js:538:15)     at Function.Module._load (module.js:468:25)     at Module.require (module.js:587:17)     at require (internal/module.js:11:18)     at Object.<anonymous> (/Users/xxxxx/.local/share/sfdx/client/dist/versions.js:6:15)     at Module._compile (module.js:643:30)     at Object.Module._extensions..js (module.js:654:10)     at Module.load (module.js:556:32)     at tryModuleLoad (module.js:499:12)     at Function.Module._load (module.js:491:3)   Tried to reinstall, reboot, etc to no avail.  Update: After several reboots and using the download link from  I was able to get it repaired. All other links did not work.  Would be interested to know if others have issues with this update.  Update 10-18-2018 Still not working. Update hangs on finishing up Update 12-17-2018 Still not working. Update hangs on finishing up (6.44.0) Update 8-01-2019 Seems to have been resolved with latest releases


Is there any way to use C#-like constructor syntax in C++ when you have multiple constructors for the same class, for example:  class complex { public:     double re, im;      complex(double r, double i)     {         re = r;         im = i;     }      complex():this(0.0d,0.0d)      {      } };   this particular example didn't seem to work, but is there any ?

As a  developer I'm used to running through constructors:    class Test {     public Test() {         DoSomething();     }      public Test(int count) : this() {         DoSomethingWithCount(count);     }      public Test(int count, string name) : this(count) {         DoSomethingWithName(name);     } }   Is there a way to do this in C++?  I tried calling the Class name and using the 'this' keyword, but both fail.


Whilst I've seem some similar questions, I can't troubleshoot the problem I am having as they tend to be specific to that user asking.  When I run my PC > 24 hours (I have reasons why I do this), my RAM usage creeps up. I had my PC on all weekend, and my ram was maxed out at 100%.  When I check in task manager, the usage is not accounted for at all. I have 32GB RAM, and usually the highest usage on the RAM will be a Google Chrome process with half a gig usage, a handful of processes over 100MB total, then others with smaller amounts. Never enough to account for the actual usage.  After looking through other answers I downloaded Process Explorer, and looked at the Working Set column. There is a process there called "memory Compression", with 6,344K private byes but a working set of 2,6922,748K. Thats at time of writing, where my PC hasn't been on as long as I noramlly would let it run in total before a reboot. Total RAM usage currently sits at 50%.  Some people suggested it might be a driver with a memory leak, but I am unsure how to diagnose a problem further here.  Theres an image of some of what I'm seeing. In 1-3 days, I would expect to see that at 32 GB, but with seemingly no extra processes using RAM etc.

Since I upgraded to Windows 10, my system has been consuming RAM excessively    I've been reading a bit and determined it's likely a driver leaking memory. So I got myself the Windows Driver Kit and tracked memory usage with poolmon:    However, I don't really know how to proceed from here. Is the item tagged "smNp" the culprit in this issue? How do I go from there to actually identifying the driver?  I tried some stuff like "C:\Windows\System32\drivers>findstr /s smnp ." but it returned no results. I also took a look at the pooltag.txt file and this is the description I found for it:      So yeah, any help would be appreciated. Thanks in advance.


I have performed principal component analysis (PCA) in Matlab via  [U,S,V] = svd(X)  Now I have to show the principal directions of the considered principal components; either by finding a way to plot them or interpret them in terms of the features.  If I have chosen 6 of the 12 PCs, I am still not able to plot them. So how can I interpret them in terms of the features?

Is it possible to visualize the output of Principal Component Analysis in ways that give more insight than just summary tables? Is it possible to do it when the number of observations is large, say ~1e4? And is it possible to do it in R [other environments welcome]?


I am trying to use template_list with custom items but I cannot make them change values on double click. I want to change 'name' property the same way I can rename items in other lists (with double click).  Part of the code:  class ListItem(bpy.types.PropertyGroup):     """ Group of properties representing an item in the list """       name = StringProperty(             name="Profile Name",             default="Untitled")      empty_name = StringProperty(             name="Name of Empty holding profile",             description="",             default="")  class BLS_UL_List(bpy.types.UIList):     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):         custom_icon = 'OUTLINER_OB_LAMP' if index == context.scene.BLStudio.list_index else 'LAMP'          # Make sure your code supports all 3 layout types         if self.layout_type in {'DEFAULT', 'COMPACT'}:             layout.label(item.name, icon = custom_icon)          elif self.layout_type in {'GRID'}:             layout.alignment = 'CENTER'             layout.label("", icon = custom_icon)  class BLS_ProfileList(bpy.types.Panel):     bl_idname = "bls_profile_list"     bl_label = "Profiles"     bl_space_type = "VIEW_3D"     bl_region_type = "TOOLS"     bl_category = "Light Studio"      def draw(self, context):         layout = self.layout         scene = context.scene          props = scene.BLStudio          row = layout.row()         col = row.column()         col.template_list("BLS_UL_List", "Profile_List", props, "profile_list", props, "list_index", rows=4)   EDIT: Problem solved thanks to poor's comment. The solution is to change  layout.label(item.name, icon = custom_icon)   to  layout.prop(item, 'name', text='', icon = custom_icon, emboss=False, translate=False)

How can I make a Interface which is similar to the Material-Interface within Blender via Python?    It should look like these. Could you guide me to the right direction? I don't think it's in bpy.ops, right?  Thank you very much!


Suppose force (sufficient to move a block & imagine it(the block of course) to be extremely long and rigid ) is applied at one end of the block and the Block starts moving.   Now force must be transmitted through the material of block  the block is rigid so the other end block moved as soon as force was applied   Doesn't the force appear to transmitted at faster than light speed?

I was reading Landau & Lifshitz's Classical Theory of Fields and I noticed that they mention that an extended rigid body isn't "relativistically correct".   For example, if you consider a rigid rod and apply a torque at one end, by definition of being rigid, the whole body must start rotating at the same instant. But the information about the force being applied cannot travel faster than the speed of light.   The book hasn't mentioned how to resolve this paradox, and after thinking about it for a while, I'm wondering if one can even define a rigid body in a relativistically correct manner.  To summarize: How does one define a rigid body in special relativity?


As explained in amoeba's beautiful answer  one can use a singular value decomposition of the data matrix, $\mathbf{X} = \mathbf{USV}^\top$, to do a principal component analysis, if it is assumed that the data matrix $\mathbf{X}$ is centered. The principal directions will then be given as the columns of $\mathbf{V}$.  Now, I have come across some statistical analysis where the data matrix was centered and standardized for the data to have unit variance before being used in a singular value decomposition. The analysis then proceeded in using the columns of $\mathbf{V}$ as principal directions.  Can any of you think of a reason to do this standardization step before running the singular value decomposition? Is the result of such a procedure in terms of what PCA should tell you even meaningful?

What are the main differences between performing principal component analysis (PCA) on the correlation matrix and on the covariance matrix? Do they give the same results?


I cannot add any (or maybe just the first?) Objects to my Arraylist  A Bikestore is an Object which contains a name and an Arraylist of all it's bikes  bikes have 3 different attributes (2 Strings, 1 double)  Bikes are added to the Store within an "addbiketocollection()" method and within this method I use the .add function.   public class Bikes      String brand ; String color; double price;  Bike(String brand, String color, double price){     this.brand = brand;     this.color = color;     this.price = price; }  public class Bikestore {  String name; ArrayList<Bike> Collection = new ArrayList<>();  Bikestore (String name, ArrayList<Bike> Collection){     this.name = name;     this.Collection = Collection; }   public void AddBikeToCollection (Bike NewBike) {     Collection.add(NewBike);   }    Mainclass     Bike Bike1 = new Bike ("Cube", "Black", 400);      Bikestore SellingBikes = new Bikestore ("SellingBikes", null);      SellingBikes.AddBikeToCollection(Bike1);  }   when I try to add bikes to the bikestore I get a nullpointerxception Exception in thread "main" java.lang.NullPointerException  I have already googled my problem and watched some videos but none of these contained an arraylist with objects.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Problem:     A block tied to a string is rotating with an angular velocity $\omega$ on a frictionless table. The string passes through a hole in the center of the table. If the string is pulled and the length of the string reduces to half, find the new angular velocity of the block.   Question:  I know this question can be easily solved using conservation of angular momentum of the block because no external torque acts on it. The answer to this question will be $4 \omega$.  What I wanted to know was that why would the the speed change at all? The tension due to string acts perpendicular to the direction of motion so it cannot change the angular velocity. So which force changed the angular velocity of the block??

A mass is attached to a rope, and put into a circular motion. If I pull the string from the center, the tangential speed of the mass will increase (by conservation of angular momentum).   I am applying a force only in the radial direction, so how can the tangential velocity increase if there is no tangential force?


Does anyone know or recognize this symbol or what it could be associated with on an Android phone? Attached is a screenshot showing five of them.

I'm concerned about an app on my child's phone. I saw an app icon in the notification area that looked strange (Andy Android head, slightly tilted as its icon).  How can I find out what app it is from just having seen that icon in the notification bar?


How to remove the Fonts app from Ubuntu 20.04? And also how to view package name of system apps?

Since I have not been able to open Dash Home in 12.04.4 see , I am hoping for a work-around. Is there another convenient way to open apps/programs without having to search through folders? Is this question clear enough? For example, I just installed Kile (publishing program) from the Software Center, but I can't find a link/tile/icon/shortcut to open it. Thanks, to whomever can help.


According to the Sith "Rule of Two", established by Darth Bane circa 1000 BBY, there can only be two Sith at a time. If the Sith Lords followed this rule, how is it that Palpatine, Darth Maul, and Count Dooku were all active Sith at the same time?

I read on Wookieepedia that  was still plotting with Darth Sidious during "The Phantom Menace".   If Plagueis is Sidious' Master and Maul is Sidious' Sith Apprentice doesn't that violate the Sith's ?


I wonder why the Wizarding Legal System doesn't use Unbreakable Vows in their legal system. Having the judges swear "to uphold the law to their best ability while acting in their official role" would really cut down corruption, making it almost impossible to abuse ones position.  Likewise, having accused criminals forced to swear "to not intentionally commit perjury while before the Wizengamot today, and to vocally correct any mistakes in [accused's] claims when realizing a mistake has been made". This would make it a more limiting Vow, as it only lasts for the duration of that particular day, and could be used for any trial about a crime of specific severity.  Most likely, it's not used simply because the Wizarding World is based on, and created from, corruption and power-lust. The very goverment exists more for the sake of being able to obtain power than to create a good country. The members of the Wizengamot want to be able to do illegal and immoral acts to further their own power, so they refuse to make laws that might limit their ability to do so (or increase the risk of them geting caught).

The meat of the question stems from several things in HP lore:   people could get falsely accused and go to jail for nothing (Sirius Black for instance) people could betray other people (Potters + Pettigrew + Fidelius charm) people could say that they are not Death Eaters and were under influence of Imperius (Lucius Malfoy)   So, basically the vow of the following format could save both Ministry, Order of Phoenix (who whouldn't mind killing a Death Eater even if it would enforce stringent discipline in their ranks, eg taking the vow), Death Eaters (who actually used it casually (Snape-Malfoys)), bankers etc. from a world of headache:     Giver: "I swear to tell the truth regarding matter X and I swear not to conceal any facts that may pertain to the understanding and the appropriate line of questioning by Receiver"      Receiver: "I swear to hear the truth from the Giver and act accordingly and justly"      Binder: "I bind you bla-bla-bla"     Why wasn't it used as proposed? Maybe there is some rationale I'm missing.


I still don't quite understand the concept of OOP in C++.   Is using friend function a bad practice? Does it reduce encapsulation? Why should I use friend function instead of changing my private members to public members? I found that friend function can reduce a lot of codes(eg. setter/getter methods). When should we use friend functions but not other approach?  Thank you.

I have been reading through the  and was curious about the  declaration. I personally have never used it, however I am interested in exploring the language.   What is a good example of using friend?    Reading the FAQ a bit longer I like the idea of the << >> operator overloading and adding as a friend of those classes. However I am not sure how this doesn't break encapsulation. When can these exceptions stay within the strictness that is OOP?


I want to read a text file which is local in my system.I found many examples where most of them are using XMLHttpRequest(),I do not want to use any of the servers like Wamp,Xampp,Apache etc & also I have seen examples which takes i/p(Browse Button) from user,I don't want that also .  I want to hard code the File path and read the file Please suggest any Example or Links

Is there local file manipulation that's been done with JavaScript? I'm looking for a solution that can be accomplished with no install footprint like requiring .  Specifically, I'd like to read the contents from a file and write those contents to another file. At this point I'm not worried about gaining permissions and am just assuming I already have full permissions to these files.


I was measuring the performance of inline functions when I encountered this really weird behavior. fun normalFunction(block: () -> Unit) = block()  inline fun inlineFunction(block: () -> Unit) = block()  The following piece of code produces the output 0.315988524. var x = 0  println(measureNanoTime {     repeat(1_000_000_000) {         normalFunction {             x += it         }     } } / 1E9)  Replacing normalFunction by inlineFunction produces the output 0.307185642; slightly faster as one might expect. Now to the weird part. If I run both pieces of code directly in the same function (renaming x to y in one instance or encapsulating both blocks with run { ... }) then the produced output varies drastically depending on which block is run first:  normalFunction then inlineFunction produces the output 0.320697598 and 0.310288507 inineFunction then normalFunction produces the output 0.310213495 and 5.515626813  The weirdness ends when the two pieces of code are extracted to individual functions. The only thing that comes to my mind is GC but the inline function shouldn't really have any overhead memory wise. Does someone have an idea why this might happen? Should I file a bug report? Here are the two complete versions for clarity: fun main() {     run {         var x = 0          println(measureNanoTime {             repeat(1_000_000_000) {                 normalFunction {                     x += it                 }             }         } / 1E9)     }      run {         var x = 0          println(measureNanoTime {             repeat(1_000_000_000) {                 inlineFunction {                     x += it                 }             }         } / 1E9)     } }  fun main() {     run {         var x = 0          println(measureNanoTime {             repeat(1_000_000_000) {                 inlineFunction {                     x += it                 }             }         } / 1E9)     }      run {         var x = 0          println(measureNanoTime {             repeat(1_000_000_000) {                 normalFunction {                     x += it                 }             }         } / 1E9)     } }

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


Every time I try to assign a shortcut to switch the language by using (Shift+Alt) the system does not accept it. However it accepts other shortcut buttons.

When I try to set the default combo for switching to different language layouts in my keyboard from Shift+Super+Space to Alt+Shift I can't.  I used to have this combo since Ubuntu 14 and even before that when I used to have Windows. Now for some stupid reason it does not allow (actually nothing happens its not like I get an error or the combo is used elsewhere). How could I bypass this bug?


I want to study the convergence of the integral $$\displaystyle\int_{\mathbb{R}^n} (1+|\xi|^2)^{-s} d\xi,$$   where $s \in \mathbb{R}$.   More precisely, I want to prove that the integral converges if $s > \frac{n}{2}$.   I tried using polar coordinates $\xi= r \cos \theta$, with $r >0$ and $\theta \in ]0,2\pi[$. Then we obtain  $$ \displaystyle\int_{\mathbb{R}^n} (1+r^2|\cos(\theta)|^2)^{-s} dr d\theta  $$ but I have no idea to how to continue.

$\forall x \in \mathbb R^d$ and $m > d/2$.  I know that $\int_{\mathbb R^d}{(1+|x|^{2})^{-m}dx}$ is integrable, but how can I prove?  Thanks!


I have a set of exponentially distributed random variables $X_i \sim \exp(\mu_i)$ with rates being also random with some distribution. Is there a way to find the distribution (or the CDF if it is easier) of $Y$ the sum of $X_i$,  $$Y=\sum\limits_{i=1}^N X_i,$$  other than the following:  $$f_Y(x) = \sum\limits_{i=1}^N \prod\limits_{j=i} \frac{\mu_i}{\mu_j-\mu_i} \mu_i e^{-\mu_i x}. $$  I found the above expression earlier, where $\mu_i$ is different for each $X_i$, but in my case, the rates are random with some distribution $f_\mu (\mu)$.   Is there any other expression for the sum?  Edit: My Question was marked as duplicate, but I never found where the duplicate original was. As far as I can see, the closest questions are either dealing with identical rates of the exponential, which is not my case or had the formula that I stated, which is not helpful for me.

I have a sequence $T_1,T_2,\ldots$ of independent exponential random variables with paramter $\lambda$. I take the sum $S=\sum_{i=1}^n T_i$ and now I would like to calculate the probability density function.  Well, I know that $P(T_i>t)=e^{-\lambda t}$ and therefore $f_{T_i}(t)=\lambda e^{-\lambda t}$ so I need to find $P(T_1+\cdots+T_n>t)$ and take the derivative. But I cannot expand the probability term, you have any ideas?


On Stack Overflow, I have the privilege to upvote a question. But, I don't have it for downvoting the questions. Does the reputation differ to downvote and upvote?

On Physics Stack Exchange I have 96 reputation points. I'm able to upvote something, but when I tried downvoting a question it said that my vote would be recorded, but not displayed.  Is there a different amount of reputation points needed to downvote than to upvote?


Suppose that $\lim_{x \to \infty}f(x) = l$, $l \in \mathbb R$. Prove that $\lim_{x \to 0} f(\frac1{x^2}) = l$.  Is it enough for me to say: Let $g(x) = \frac1{x^2}$. So, $\lim_{x \to 0} g(x) = \infty$. Then $\lim_{x \to 0} f(\frac1{x^2}) = \lim_{g(x) \to \infty}f(g(x)) = l$

Suppose that  $\displaystyle \lim_{x \to \infty} f(x) = \ell$ where $\ell \in \mathbb R$. Prove that  $\displaystyle \lim_{x \to 0} f(1/x^2) = \ell$.  Does this involve reciprocal of functions? I am guessing that if $f(x) = \ell$ as $x \to \infty$, then $f(1/x^2)$ as $x$ goes to 0 will be same as $f(x)$ as $x \to \infty$. Therefore the limit will be same. Am I right?  Thanks.


A lot of supporters of string theory say that it has to be right because the quantum gravity is necessary for the universe, is this true? Does the universe need quantum gravity?

What I am interested to see are specific examples/reasons why gravity should be quantized. Something more than "well, everything else is, so why not gravity too". For example, isn't it possible that a quantum field theory on curved space-time would be the way treat QFT and gravity in questions where the effects of neither can be ignored?


I understand the concept of the gradient being a vector of the partials of f with respect to each variable, so essentially the gradient gives you a direction in the input field to travel in order to get the maximum increase in the function f. What I don't understand is why the magnitude of that gradient is the actual maximum rate of change of f - it feels right that it should be but I can't quite join the dots and see a proper reason for it.

I want to understand intuitively why it is that the gradient gives the direction of steepest ascent. (I will consider the case of $f:\mathbb{R}^2\to\mathbb{R}$)  The standard proof is to note that the directional derivative is $$D_vf=v\cdot \nabla f=|\nabla f|\,\cos\theta$$ which is maximized at $\theta=0$. This is a good verification, but it doesn't really help me understand the result.


04 and I was trynna install a Screen recorder in my ubuntu. I installed SimpleScreenRecorder and when I was trying to record the files there was this error "H.264 decoder is required to play this file." So I tried to fix it by using commands : "sudo apt-get install ubuntu-restricted-extras" Link to the website I got to know about SimpleScreenRecorder:  Link to the command I got for solving the problem:  After I did the command I found out that the command I ran was for ubuntu 18 so maybe that's why the problem is coming. Now i have this thing on my notification: "An error occurred, please run package manager from the right-click menu or apt-get in a terminal to see what is wrong. Error: Broken count>0. This usually happens when you install packages that have unmet dependencies." Problems that is occurring when i try to install any package from terminal: E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 11285 (apt-get) N: Be aware that removing the lock file is not a solution and may break your system. E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?  Note: I am super new with Linux and i don't know anything, please have patience with me. Thank you

I'm trying to run this command in the terminal:  sudo apt install software-properties-common   This is the error message I get:  E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)   E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend),     is another process using it?


I want to run Android Simulator on my pc which requires virtualization enabled from bios.I am not able to goto bios because bios is locked with password.Please tell me how can i unlock bios so that i can change the vitualization setting?  I have searched on google but not getting correct solution.  EDIT:  i tried    Remvoing the bios cell,hard drive,battery for 10 minutes.    On removing bios cell clock is wiped out but bios password is not reset

I am using android studio.I want to run my app on simulator but it is asking me to install intel haxm,.When i install intel haxm it says that vitualization is not enabled/.To enable virtualization i need to goto bios but issue my bios is password protected & i don't know password.So please tell me is there any other way by which i can enable the virtualization without going into bios?


I have just installed Ubuntu 18.04 on my Asus UX490 and now I cannot change the volume but I can mute/unmute.  I can move the volume bar right/left but volume does not change. However, when I move it to left most side or just click the sound icon, computer mutes/unmutes correctly.  Also when I try to change the volume with fn+f11/f12 I see the volume level thingy changing in the middle of the screen but sound does not change as well. However, again, I can mute/unmute with fn+f10.  Similar things happen when I try from Setting > Sound. Under this menu in the "Choose a device for sound output:" list I only see "Speakers - Built-in Audio".  Another thing, if I change the sound in a player (let's say youtube) sound changes.  I tried these two but they did not help.       PS: Just to make it clear, this is the first time I installed any Ubuntu version on this laptop. I mean, I do not say "it was working and got broken after I installed 18.04"

Using Ubuntu 16 LTS  I installed ubuntu on my new asus zenbook3 ux390. Nearly everything works fine except the volume controls don't work. The volume is either on or off. I can adjust volume in specific apps or websites (like youtube) successfully, but the internal volume control either wants to be muted or at 100%.


This question came up as an exercise in my quantum text? I typically find these "word" questions quite difficult. I want to answer: "What is meant by the stationary states?" as concisely as possible. I would say something along the lines of " Normalizable/(sufficiently smooth) solutions to the time- independent Schrödinger equation". But perhaps there is a better answer ( perhaps more physical)... Any suggestions? Many thanks!

If a quantum state is an eigenstate of the Hamiltonian, then it is stationary. But can a state be stationary if it is not an eigenstate of the Hamiltonian? If yes, how can one prove whether a state is stationary?


This is another trigonometric equation I can’t solve.  I tried using $t= \tan(\frac{x}{2})$ but got a 4th order poynomial I couldn’t solve. I can’t See how to simplify into similar terms to allow me to solve. I could do it if $p = 0$. This is a different question than that asked previously as it contains a cos and a sin term.

This problem has baffled me. I have tried using $t = \tan(x/2)$ identities but end up with a 4 th order polynomial I cant solve.


In English-speaking TV shows, characters sometimes say something similar to dips to say to other people they are taking something for themselves before others do.  Neither Google, Wiktionary or Urban Dictionary give positive results for this so the word may be misspelled.  What is the word and what is its origin?

has this entry for dibs:     Children's word to express a claim on something, 1932, originally U.S., apparently a contraction of dibstone "a knucklebone or jack in a children's game" (1690s), which is of unknown origin.   However, while  entry for dibs gives the same definition and origin as an abbreviation of dibstone, it traces the first known use to 1812.  An  of dibs shows that it was indeed used in the early 1800s, having peaks in the 1840s and 1880s. After the 1880s peak, it drops gradually and does not really rise again until the 1980s. In fact, 1932 seems to be during one of the word's lowest points.    Given this information, why does Etymonline trace its origin to this low point in 1932 when it was actually in use over a century earlier? I'm looking for an explanation for the disparity between these sources. As far as I can determine, there is not another meaning of dibs to explain its earlier appearances.


I have built a new lightning application that allows users to complete a certain process that is defined by the business.  If I was building this purely for classic users, I would embed the lightning app into  Visualforce Page and use either  formula field or a detail button to open the page in a new tab (this is the outcome I am looking for). However, roughly half of the users in this org are currently using Lightning Experience which I am not nearly as familiar with.  This question comes with 2 parts:  a) is there a way for me to implement that if you are in classic it will open the VF page with the lightning app embedded, and if you are in lightning it will open the lightning app?  b) how do you navigate from a standard page to a lightning app in the lightning experience whilst still displaying the header (Salesforce logos and tabs etc)?  Hopefully someone can help me out. Lightning applications are a brilliant way to build applications but it is not much use to me if it is this difficult to implement  This is unique to the similar question that exists as it advises to use SLDS with a Visualforce page, however I have developed an actual lightning app using lightning component. Whether I render the wrapper VF page, the direct VF page OR straight to the lightning app URL it never displays the header and side bar in the Lightning Experience. The simple question would be how do I navigate from a standard record to a lightning app that is built to perform a process on the data within that record, whilst maintaining the header and sidebar?

This isn't a question about the pros/cons of Lightning/Visualforce, but is a question about how to build custom UI for the period of time (a year or many years?) where some users/orgs have Lightning Experience turned on and other users/orgs don't.  Is the answer that you have to implement the custom UI twice, once in Lightning and once in Visualforce? Or is there a better approach?  (I am thinking particularly about managed packages that in principle should work in all sorts of orgs, but the problem also applies to once-off code in an org if only some users have Lightning Experience turned on.)  PS  The comment thread on the question below includes a link to Trailhead's  which looks like a good resource on how to get existing Visualforce to work in both classic and lightning environments. I'm getting the impression that building app UI that uses Lightning technology at all (client side MVC etc) will not be commercially rational (and there are certainly technical limitations too) for some time to come...


I have an older bike I love with a Shimano RD TY22 WD rear derailleur with a dropout claw hanger that needs to be replaced. I cannot find one listed anywhere. Are there any derailleurs available to replace this one? Thanks!

To cut a long story short, I have a full suspension mountain bike. Its rear derailleur mech (see title) is broken, had a trip round the spokes and age has degraded the main springs. I therefore need to replace it. Now, its old, and you can get the model, but its new, old stock so I want to upgrade the rear mech, not just replace.  So I need a Shimano rear mech, for 7 speed rear wheel, that bolts directly to hanger that is part of frame (Direct Attach). Can someone suggest how to select a  replacement mech? I am happy with the rest of the system, which is Dual SIS, and grip shift.  Thanks in advance,  Jawapower


Is there a single word that describes that deep seated sense of dread and doom, the feeling that something in your personal world is not right, or is about to be absolutely ruined (other than foreboding)?

It may be something that will happen to the person who is having the feeling but it may also be to several persons, as might occur with a highly destructive earthquake, for instance.   The word or phrase would be used in the following sentence:      “I’m no spiritualist but I have a feeling of ___. I hope it’s just a feeling."   EDIT - The phrase I'm looking for conveys a much stronger feeling than "I have a bad hunch". It is about something catastrophic which the person feels is "going to happen in a few minutes".


When installing Ubuntu 20.04 Desktop with the GUI there is a screen where you can choose "Erase disk and Install Ubuntu" with an "Advanced features..." button. If you click that button, you can select "Use LVM with the new Ubuntu installation" and "Encrypt the new Ubuntu installation for security". What exactly does that encrypt, the boot partition, the Home folder, the entire hard drive or something else?

I'm in the middle of installing 13.10 and the Ubuntu page I was following on how to install from a USB stick says nothing about these two choices (on the Installation type screen):     1) Encrypt the new Ubuntu installation for security (you will choose a security key in the next step).      2) Use LVM with the new Ubuntu installation (this will set up Logical Volume Management. It allows taking snapshots and easier partition resizing)   I'm a writer using the computer for mostly writing ebooks but I also do all the things most people do: buy stuff online, online banking etc. I want my information to be safe but I don't want to overburden my system with security stuff either. And I've read a lot of the similarly themed questions here on the forum but they've all been about stuff more technical than I'm concerned about.   Can somebody please just tell me in real layman's terms about the implications of these two choices? Thank you.


I am currently working on my thesis and I discovered a nasty problem. I use the following code to reference a table:  \fref{tab:alternatives}   Now I defined the table like this:  \begin{table}[h]     \centering     \begin{tabular}{l|*{10}{c}}     %removed the content     \end{tabular} \label{tab:alternatives} \caption{Comparing functionalities} \end{table}   Now when I generate the pdf fancyref produces the following: "First in table 2.2" but the table is called: "Table 2.1.: Comparing functionalities"  How can this be?

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.


Why does $\vert z\vert = z^5 $ have 6 solutions in $\mathbb{C}$  I tried to solve it with the polar method and I only found 5 solutions.  $$  z_{(n+1)} = e^{\left(\frac{2\cdot\pi}{5} +\frac{2\cdot\pi\cdot n}{5} \right)} \quad with\quad n=0,1,2,3,4 $$  There must be something special with the $\vert z\vert$ , but I can't find what.

Why does this equation have 6 solutions in $\Bbb{C}$,      $$|z| = z^5$$


A vector bundle is said to be flat if it is endowed with an linear connection with vanishing curvature, ie. a flat connection.  Is the tangent bundle $TS^2$ of a $S^2$ flat? My question  is also about how do we know if our bundle is flat or not? What are the obstacles to this?    Let we have a flat connection $\nabla$. This is equivalent to the fact that we have a parallel transport $P_{\gamma (t)}$. Fundamental group $\pi_1 (S^2) = 0$. Then parallel transport is path-independent (because connection is flat). We can take an arbitrary vector $X \in T_pS^2$ and spread it around the manifold by the parallel transport. Thus, we obtain a non-trivial nondegenerate global vector field $X(q)$, where $q \in M$. But this contradicts the Hairy ball theorem.  Is my reasoning correct?

For example, a sphere $S^2$ in $\mathbf{R}^3$ is apparently not flat with respect to the Euclidean connection, but can we define a flat connection and thus with affine charts on $S^2$?


To use COMPLETELY PROPER English, I've been told that Hell should be capitalized when referring to a location.  For example: Go to Hell!  However, does one capitalize it when it's used as part of a phrase instead of a location?  For example: I sure as Hell won't go!  or  I sure as hell won't go!  Any help in this matter is appreciated.  Thank you.

I am of the belief that Hell should be capitalized because real or not, it is the name of a place, and thus a proper noun. It should be capitalized correct? I have seen it written without capitalization plenty of times, but I suspect that most of those were just due to laziness or illiteracy (it tends to be written with a lower-case ‘h’ mostly on the Internet–sigh). Other uses, including expletives seem to use it as a place name as well:   What [in] the Hell‽  Go to Hell!    Google gives mixed results and checking the WikiPedia entry for  to get a proper definition does indicate that it is a location, but even on that same page, there are plenty of instances with a lower-case ‘h’. Is there a situation in which it would not be capitalized? What about uses as an adjective:  that job was Hell?


Let $X_1,X_2,X_3,...$ a series of i.i.d. variables with  $X_i \sim \mathcal{U}(0,1)$. Let $N=\inf\{n\mid \sum_{i=1}^{n}X_i\geq1\}$ Prove that $E(N)=e$.    I don't really have a clue how to even start proving that. Can someone please help? Thanks.

Choose a random number between $0$ and $1$ and record its value. Do this again and add the second number to the first number. Keep doing this until the sum of the numbers exceeds $1$. What's the expected value of the number of random numbers needed to accomplish this?


I want to add one day to a particular date. How can I do that?  Date dt = new Date();   Now I want to add one day to this date.

I'm working with a date in this format: yyyy-mm-dd.  How can I increment this date by one day?


What is the best way to detect if a user leaves a web page without first saving?  I have searched before I posted this question, but I haven't found related topics to deal with ASP.NET (I have controls DropDownList, ListBox, TextBox....)

What is the best way to detect if a user leaves a web page?  The onunload JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser).  Creating one will probably be blocked by current browsers.


I'm having trouble aligning some text for math definitions that I am writing in LaTeX.   Here's what I currently have:  \newcounter{defctr} \newenvironment{defn} {\noindent   \refstepcounter{defctr}   \textbf{Definition \thesubsection.\thedefctr:} }{\par\noindent%   \ignorespacesafterend} \counterwithin*{defctr}{subsection}   In some cases, this works fine. However, there are a few instances in which it does not work in the way I want it to. Here is an example of the command not working properly:    The "definition" is not aligned with the rest of the text.

I see that the code in many packages and examples contains percent signs % at the end of (many) lines. What are they used for? Do they affect the parsing of those lines?


Question We can take the kinematic equations for constant acceleration and apply them to projectiles in free fall. One of the equations then reads: $$\Delta y=(v_0\sin \theta )t-\frac{1}{2}gt^2$$ where $v_0$ is the projectile's initial velocity, $\theta$ is the angle of projection, $g$ is the gravitational field strength, and $t$ is the time taken to reach some vertical displacement $\Delta y$. Rearranging into a quadratic function gives: $$\frac{1}{2}gt^2-(v_0\sin \theta)t+\Delta y=0$$ and this has the roots: $$t=\frac{v_0 \sin \theta ±\sqrt{(v_0\sin\theta)^2-2g\Delta y}}{g}$$ I have always thought that there are two roots because any projectile reaches the displacement $\Delta y$ at two moments: once while ascending and once while descending. Is this the correct way to interpret the roots? Does this physical interpretation always hold true, or are there exceptions? Motivation A colleague and I both solved  by Walter Lewin. I used the "+" when dealing with the two roots, and he used the "-". We both acquired the same result ($t=1.549\text{ s}$), but using two different methods. I don't want to post all of the details of our solutions because it would be too lengthy. I'm trying to figure out the mistake in my work or in my colleague's work, and our two approaches are mainly distinguished by how we dealt with the two roots for $t$.

There are negative times and negative $x$ and $y$ displacement in parametric equations; what do they represent? And is it possible to tell the object's velocity, direction and acceleration from just a parametric equation?


Not really sure how to go about this in general terms, for example: say you have a group G containing a & b such that ab=ba. Show that if a has order m in & b has order n (in N), & gcd(m,n)=1, then ab has order mn.

I want to show that if $g,h\in G$ are group elements with finite coprime orders $m$ and $n$ and $gh=hg$ then the order of $gh$ is $mn$.    We have that  $$ (gh)^{mn}=g^{mn}h^{mn}=1 $$  using $gh=hg$, so $|gh|\leq mn$. On the other hand, $mn=\operatorname{gcd}(m,n)\operatorname{lcm}(m,n)=\operatorname{lcm}(m,n)$, since $m$ and $n$ are coprime. I am not sure how to proceed, I tried assuming that $|gh|<mn$ and arriving at a contradiction, but it did not take me anywhere.


I have a variable I'm setting to true, then later checking things in a couple different functions and re-setting it to false if a check fails.  Setting it here...  $(document).ready(function() {     //Set enable_submit to true, then run checks to see if it should be reset to false     var enable_submit = true; }   Doing other checks.  Then, seeing if it's still true or not here...  function change_submit_button_state() {     if (enable_submit == true) {         $("button[type=submit]").prop("disabled", false);     } else {         $("button[type=submit]").prop("disabled", true);     } }   The problem is I'm getting a "ReferenceError: enable_submit is not defined" and the line referenced in the error is the if (enable_submit == true) { line from above.  Is there a way around this?

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


i'm using a Debian 9 with Postfix and i've got issues with my mails sending to google mail.  After sending a mail, i will instantly get a response: "Undelivered Mail Returned to Sender".     Our System has detected that this message is 550-5.7.1 likely suspicious due to the very low reputation of the sending IP 550-5.7.1 address. To best protect our users from spam, the mssage has been 550-5.7.1 blocked.   My score on mail-tester.com is 10/10 (the only warning stated is a missing unsubscribe link).  I've added an SPF-Record, a DKIM Signature and DMARC-Record. A reverse DNS entry is also added.  I've looked up several blacklist and all stated that i'm good to go.  I was wondering if the issue would solve itself after some time. The Mailserver was setup ~three weeks ago and after two weeks, mails were accepted from gmail for a few hours (going in gmails junk-folder, but at least no bounce). A bit later they were getting bounced again.  Google Postmaster-Tools doesnt show anything due to low message amount (as those are just private mail accounts, no bulk/newsletter mails).  Is there anything else I could have missed?  Thanks for your time!

This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating?


The sentence I am unsure about is:     A rigid adherence to the doctrine of precedent would have resulted in   a country where segregation was lawful but minimum wages were not.   I'm confused by the subjunctive, and in particular the proper usages of 'was' and 'were'. Are they used properly above?

In which cases should I use the subjunctive mood?     I suggest that every applicant fill out the form carefully.        If she were rich, she would live on Long Island.


I was task with implementing a background thread to do backend async processing with the twist being were certain cases where the job needed to be externally stopped.  I implemented it by wrapping everything within the Runnable in a try catch block and catch the InterruptionException, if caught the thread will simply return and exit.  Runnable task = () -> {     try {         while (true) {             // do stuff               // sleep for interval             Thread.sleep(this.checkInterval);         }     } catch (InterruptedException ex) {             // cleanup and exit             return; // exit thread     } catch (Exception ex) {             // cleanup and exit             return; // exit thread     } };   I'm using the ExecutorService SingleThreadExecutor and submitting the job like the following.  this.job = executorService.submit(task);   Then I am stopping the thread using   boolean canceled = this.job.cancel(true);   It seems to work fine since the cancel causes an InterruptionException if the thread is running.   Is this code safe, meaning when cancel is called its always guaranteed to kill the thread?

I have a program that continually polls the database for change in value of some field. It runs in the background and currently uses a while(true) and a sleep() method to set the interval. I am wondering if this is a good practice? And, what could be a more efficient way to implement this? The program is meant to run at all times.  Consequently, the only way to stop the program is by issuing a kill on the process ID. The program could be in the middle of a JDBC call. How could I go about terminating it more gracefully? I understand that the best option would be to devise some kind of exit strategy by using a flag that will be periodically checked by the thread. But, I am unable to think of a way/condition of changing the value of this flag. Any ideas?


I have following code:  # python 3.8    normtable = [[None, None],[None, None],[None, None]] calctable = [[None]*2]*3 print('Before update - Normaltable: \t\t'+ str(normtable)) print('Before update - Calculatedtable: \t'+ str(calctable)) normtable[0][0] = 'hello' calctable[0][0] = 'hello' print('After update - Normaltable: \t\t'+ str(normtable)) print('After update - Calculatedtable: \t'+ str(calctable))   Output is like this:  Before update - Normaltable:        [[None, None], [None, None], [None, None]] Before update - Calculatedtable:    [[None, None], [None, None], [None, None]] After update - Normaltable:         [['hello', None], [None, None], [None, None]] After update - Calculatedtable:     [['hello', None], ['hello', None], ['hello', None]]   Why does the calculated list behave differently? I understand that lists are mutable and thus if the same list is used in another list and the second list edited the first one is also edited as both point to the same values. This explains, why that after multiplying the same list with factor 3 all three lists will always contain the same information. But then why would the *2 not do the same and as a result all strings change to 'hello' and not just the first ones? What would be an alternative way to have this list set up with a variable size?  Thanks in advance, best answer will be marked.

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


If I am about to purchase the world of warcraft game now, when I buy the base game WOW, does it include Legion?

I ordered World of Warcraft Legion expansion online as a physical CD, and I was wondering if that included the base game or do I have to have the base game first in order to use this expansion pack CD? Also, if I don't have to buy the base game first do I get a 30 day game time with this?


Find the sum of series $\sum_{n=1}^{\infty} \frac{2n-1}{2^n}$

How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method.  In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$


I would like to show icons if the user zooms to level 7 or more and hide the markers when zoom level is 6 or lower. I've tried using the 'zoomend' property in my function like so:  var shelter1 = L.marker([55.1, 11.6], {icon: shelterIcon}).addTo(map);      map.on('zoomend', function() {         var currentZoom = map.getZoom();         if(currentZoom >= 7) {           shelter1.bindPopup("Shelter");         }         else {           shelter1.hide();         }     });   I know that hide() is not valid. But I need something similar. Couldn't find anything in the Leaflet documentation.

I've added a polygon layer and a point layer to my leaflet map.   I would like the points to appear after a certain zoom level or when a "click" event occurs e.g. (polygons.on("click", function....)  I have looked at different questions here and also this   But I am still unable to understand what to do in my code.   Here is my code:


I need to prove that   $$\sum_{k=0}^{n}\cosh(kx) = \frac{\sinh((n+1/2)x) + \sinh(x/2)}{2\sinh(x/2)}$$  Can you help me out? How do I even start?

I'm trying to calculate the trigonometric sum : $$\sum\limits_{k=1}^{n}\cos(k x)$$  This is what I've tried so far : $$\renewcommand\Re{\operatorname{Re}} \begin{align*} \sum\limits_{k=1}^{n}\cos(k x) &= \Re\left(\sum\limits_{k=1}^{n}e^{i k x}\right)\\ &= \Re\left(e^{i x}\frac{1 - e^{inx}}{1 - e^{ix}}\right) \end{align*}$$  How can I go on ?


Kindly help me. i have created a run time spell check system. The problem i am facing is, when the system returns the correct spelling, it shows the word hyper linked. If the user clicks that hyper link, it should overwrite the word with the suggested work. Unfortunately the jQuery created hyper link is not triggering  i have created this dummy project, because actual code is very lengthy. JSfiddle link is this:       Testing

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I have some php scripts on a hosting, but hosting time is different from my local time (GMT+8) How set the right time() script to be  GMT+8 ?  When i use:  <? echo time(); //it show me the hosting time; ?>

Some issues with timezones in PHP have been in the back of my mind for a while now, and I was wondering if there are better ways to handle it than what I'm currently doing.  All of the issues revolve around reformating database stored dates:  When dealing with a site that has to support multiple timezones (for users), to normalize the timezone offest of stored timestamps I always store it with the server timezone using the CURRENT_TIMESTAMP attribute or the NOW() function.   This way I don't have to consider what timezone was set for PHP when the timestamp was entered (since PHP time functions are timezone aware). For each user, according to his preference I set the timezone somewhere in my bootstrap file using:  date_default_timezone_set($timezone);   When I'm looking to format dates with the php date() function, some form of conversion has to take place since MySQL currently stores timestamp in the format Y-m-d H:i:s. With no regard to timezone, you could simply run:  $date = date($format,strtotime($dbTimestamp));   The problem with this is that date() and strtotime() are both timezone aware functions, meaning that if the PHP timezone is set differently from the server timezone, the timezone offset will apply twice (instead of once as we would like).  To deal with this, I usually retrieve MySQL timestamps using the UNIX_TIMESTAMP() function which is not timezone aware, allowing my to apply date() directly on it - thereby applying the timezone offset only once.  I don't really like this 'hack' as I can no longer retrieve those columns as I normally would, or use * to fetch all columns (sometimes it simplifies queries greatly). Also, sometimes it's simply not an option to use UNIX_TIMESTAMP() (especially when using with open-source packages without much abstraction for query composition).  Another issue is when storing the timestamp, when usage of CURRENT_TIMESTAMP or NOW() is not an option - storing a PHP generated timestamp will store it with the timezone offset which I would like to avoid.  I'm probably missing something really basic here, but so far I haven't been able to come up with a generic solution to handle those issues so I'm forced to treat them case-by-case. Your thoughts are very welcome


what i am trying to do is create an instance of class "location" and calling methods-"getLongitude()" and " getLatitude()" to get latitude and longitude and show them using "toast" but i am getting errors.  Here is my code and the errors:  CODE   package autogenie.maptrial;   import android.content.Context;  import android.location.Location;  import android.support.v7.app.AppCompatActivity;  import android.os.Bundle;  import android.widget.Toast;    public class MainActivity extends AppCompatActivity { Location loc; Double lon,lat;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);       lon=loc.getLongitude();     lat=loc.getLatitude();        Context context = getApplicationContext();     String s=String.valueOf(lon)+"  "+String.valueOf(lat);     int duration = Toast.LENGTH_LONG;      Toast toast = Toast.makeText(context,s, duration);     toast.show();   } }     THE ERRORS:     java.lang.RuntimeException: Unable to start activity   ComponentInfo{autogenie.maptrial/autogenie.maptrial.MainActivity}:   java.lang.NullPointerException      and      java.lang.NullPointerException                                                                           at autogenie.maptrial.MainActivity.onCreate

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have an interview with a professor for a Ph.D. position in the US next week. As I was going through the possible questions that a professor can ask, so I was wondering what if they ask me if I have any questions regarding working in that specific lab? I mean yes I can ask some basic questions (which may be irrelevant too). As there are so many people from academia, what you usually expect a candidate to ask? What can be a reasonable and valid question?

I'm currently applying for a Ph.D in Germany. Next week I'm sitting down with my potential Ph.D advisor to have a talk about the program.    Currently I'm collecting questions about things like   teaching duties included? working hours   what's the salary? vacation? budget for conferences?   I think I'm missing some important stuff.  My real question is: What should I ask my potential Ph.D advisor in advance, before actually signing a contract / starting?  (The question  is related, but I feel it doesn't fit my situation)


I'm using Visual Studio 2012 Professional. I was writing a simple function this morning, something like this example which is really not important:      public DateTime getDeadline()     {         var deadline = DateTime.Now.Date;         if (deadline.DayOfWeek == DayOfWeek.Sunday)                  return deadline.AddDays(-2);         if (deadline.DayOfWeek == DayOfWeek.Saturday)             return deadline.AddDays(-1);         return deadline;     }   I wanted to read more information about DateTime's "DayOfWeek" property from Microsoft's MSDN page. So I typed "DateTime.DayOfWeek" into Google search and naturally the first result is what I wanted.  My question is simple...  does Visual Studio 2012 have a way to get from the IDE directly to the MSDN page for a class or property so I don't have to use a web search?

I'm looking for a plugin or way to simply go from any namespace, type, method, property, etc in my .Net code to the MSDN page that covers it via a context menu item or hyperlink-like mechanism.  Does anyone know of anything that will do that?    The "Go to Definition" option when you right click almost covers this, but it doesn't quite work well enough - no support for namespaces and you often end up at an ugly metadata page.  I'm still on vs2005, so if vs2008 is better at this I'd like to know about it.


I installed some weeks ago  Oracle Virtual Box 6.1 to Ubuntu 20.04.1 without any problems. Since 10 January 2021 I have tried to install it to to my backup  computer with the same configuration but it does not work. I have followed many instructions I have found with Google, but without success. My conclusion is that something has been updated in Virtual Box or Ubuntu since my last installation which makes the VB broken. Has anybody else this problem with installing  Oracle Virtual Box 6.1 to Ubuntu 20.04.1  and know how to solve it? As my last trial I tried the official VB page instructions on  and I followed "Debian-based Linux distributions" by using "focal" in "mydist" But when I try to open a new box I get error:  Kernel driver not installed (rc=-1908) The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing '/sbin/vboxconfig' as root. If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information. where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.  I tried : sudo /sbin/vboxconfig But I got a serie of other and errors and tried to solve with Google, but they are too long to describe.

I tried to use my Virtual Box and this is the error I received - (I just updated to the new Ubuntu also) and I am VERY new at this Linux OS.     Kernel driver not installed (rc=-1908)      The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or   there is a permission problem with /dev/vboxdrv. Please reinstall the   kernel module by executing      '/etc/init.d/vboxdrv setup'      as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS   package first. This package keeps track of Linux kernel changes and   recompiles the vboxdrv kernel module if necessary.


If my data is stationary, can I also write that it is homoscedastic? Does stationarity imply homoscedasticity of the data?

I'm having trouble distinguishing between the concepts of scedasticity and stationarity. As I understand them, heteroscedasticity is differing variabilities in sub-populations and non-stationarity is a changing mean/variance over time.   If this is a correct (albeit simplistic) understanding, is non-stationarity simply a specific case of heteroscedasticity across time?


Let's say I am a wizard, and I possess the ability to become an Animagus.  Could I choose a Phoenix to be the animal that I transform into?  And would I acquire the Phoenix's power of regeneration?

I blame fan fic for this question, in particular a fic wherein Harry becomes an Animagus in the form of a Niffler.      The Niffler is a British beast. Fluffy, black, and long-snouted, this burrowing creature has a predilection for anything glittery. Nifflers are often kept by goblins to burrow deep into the earth for treasure. Though the Niffler is gentle and even affectionate, it can be destructive to belongings and should never be kept in a house.   Fantastic Beasts and Where to Find Them - Page 30 - Scholastic Books   Q: Are there any instances of an individual whose Animagus form is a magical creature?  For sources, let's please stick to any magical creature found in the seven novels and three ancillary books, tidbits from Pottermore, or creatures as described in interviews with J. K. Rowling. Please note that I am not a fan of the Harry Potter wikia as a source.


I'm sure there is an easy answer for this, though I only really have experience with PHP. Why does the "pizza" array change when I pass it to my function as "my_pizza" and only make changes to "my_pizza"? How do I keep my original array I pass to the function outside of the function? Once the function is finished running, the pizza array should have not changed. I noticed if I change my string variable (pie) it will stay the same after the function runs, unlike the array.  In short, I want the first set of results to be identical to the second.  var pizza = []; pizza.push('crust'); pizza.push('ham');  var pie = "apple"  function bake_goods(my_pizza, my_pie){     console.log(my_pizza);     console.log(my_pie);      delete my_pizza['1'];     my_pie = "peach";      console.log(my_pizza);     console.log(my_pie); }  //first run  bake_goods(pizza, pie); //console logs //['crust','ham'] //apple  //['crust'] //peach  //second run  bake_goods(pizza, pie); //console logs //['crust'] //apple  //['crust'] //peach

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


I am just starting to use libLAS and I had a small issue.  I have next code to generate a las file with georeferenced points:  std::ofstream ofs; liblas::Header header; liblas::SpatialReference srs; srs.SetFromUserInput("EPSG:4326"); header.SetSRS(srs); header.SetPointRecordsCount(1); ofs.open("H:\\temp\\test2.las", std::ios::out | std::ios::binary); liblas::Writer writer(ofs, header);  liblas::Point point(&header); point.SetCoordinates(1.0, 2.0, 3.0); writer.WritePoint(point);  point.SetCoordinates(5, 5, 5); writer.WritePoint(point);  point.SetCoordinates(-1, -1, -1); writer.WritePoint(point);  header.SetPointRecordsCount(3);  writer.SetHeader(header);  writer.WriteHeader(); ofs.Close();   When I run lasinfo over this file I get: It says that I have 3 points, but my spatial reference is none.    Same code above, but if I comment this line:  //writer.SetHeader(header);   I can see the spatial reference, but the number of points is 1.    Am I doing something wrong?

I am trying to write georeferencing information to a '.las' file using liblas and c++.  Here is my code:     ofstream ofs;    ofs.open("test.las", ios::out | ios::binary);    liblas::Header header;    liblas::Writer writer(ofs, header);     liblas::Point point(&header);    point.SetCoordinates(1.0, 2.0, 3.0);     writer.WritePoint(point);    header.SetPointRecordsCount(1);     liblas::SpatialReference srs;    srs.SetFromUserInput("EPSG:4326");    header.SetSRS(srs);    writer.SetHeader(header);    writer.WriteHeader();   But, when I check the file using lasinfo tool I get:   Spatial Reference:           None   If I check proj4, the information is stored, so I don't know why lasinfo doesn't print it:  Code  : std::cout << srs.GetProj4() << std::endl; Output: +proj=longlat +datum=WGS84 +no_defs    However, when I use lasinfo tool with others las files not written by me I can see the WKT and geotiff output.  What am I doing wrong?


I have two people in my video - one in the foreground and the other in the background. I want to place an image of a cage over the person in the background of the video, but the issue I have is the person in the foreground would then be covered with the image also. How do I place this image behind the person in the foreground to make the scene realistic? (I'm using the video editor workspace).

I am working with masking. Here is my node setting with the mask.   And here is my node settings  And what am i getting is this.    I tried invert node and many settings. It just doesnt work. Where am i going wrong


We have a saying in Tagalog:     Aanhin pa ang damo, kung patay na ang kabayo.   which literally translates to English as     What is grass good for, if the horse is already dead.   Basically, the idea is, something (help, benefit, etc.) arrives too late for it to be useful. What is/are the equivalent/s of this saying in English?

In Flemish we have a saying "Vijgen na pasen". Translated: "figs after Easter". It means a solution comes too late to be of any use.  What is the English equivalent for this?  Some googling gives me "Closing the barn door when the cow has bolted", but the explanation seems to point more towards the wrong solution for a problem.


I switch workplaces quite regularly (e.g. from 34" to 24" monitors to solely using my MB Pro) and thus I would like to store and load my desktop arrangements in a simple way. For example, I would like to load arrangement A when I work on a 34" display and load arrangement B on a 24" monitor. With "arrangements" I mean the number of desktops created and the distribution of applications to those individual desktops. Is that possible through Apple software or third-party apps? I run Mac OS 10.15 on a MB Pro 16" 2019.  PS: The suggestion in this post does not help me as it does not allow me to store & load different desktop setups but rather assign applications to monitors:

When running my MBP, I attach an external monitor, a keyboard and trackpad to it so I have two separate desktops which are contiguous; like it's a "fancy" desktop.   Back in the day on Mavericks, it behaved properly: when I unplugged the external monitor to, say, take the laptop into a meeting, it would just put all of the desktops separately on the built in display, roughly preserving which window stayed on which desktop so all you'd have to use was a run a restore tool like Display Maid to restore your window positions when you plug your external monitor back in. This was handy because you didn't have to manually clean up your desktop when done.   Now, with El Cap, it would seem that when you unplug the external monitor, it used the monitor count of whichever screen had the most desktops and merges the windows from the two "combined desktops" into one desktop in a way that seemed to be random, which is clumsy.   Worse, setting back Display Maid to restore the original configuration automatic doesn't work like it used to - previously it saved positions on all desktops in one action, but now it does it one screen at a time and forcing you restore eech desktop separately, which is tedious. It would seem that Display Maid is not great software anymore.  Is there some other utility out there that must work better so you can restore how your windows and desktop setup was as it was before you unplugged the external monitor. Any ideas?


Given a normed, finite-dimensional vector space $V$, where we define the metric $d(x,y)=\|x-y\|$. Show that this space, under this metric, is complete - that is, every Cauchy Sequence converges.   I'm looking for, preferably, a linear algebra-based approach if possible. I've already tried writing this in terms of the basis and studying the coefficients. I also looked at the sequence $\| x_n\|$ but I haven't made much connections.

Can you read my proof and tell me if it's correct? Thanks.  Let $V$ be a vector space over a complete topological field say $\mathbb R$ (or $\mathbb C$) with $\dim(V) = n$, base $e_i$ and norm $\|\cdot\|$. Let $v_k$ be a Cauchy sequence w.r.t. $\|\cdot\|$. Since any two norms on a finite dimensional space are equivalent, $\|\cdot\|$ is equivalent to the $l^1$-norm $\|\cdot\|_1$ which means that for some constant $C$, $\varepsilon > 0$, $k,j$ large enough, $$ \varepsilon > \|v_j - v_k\| \geq C \|v_j - v_k\|_1 e_i= C \sum_{i=1}^n |v_{ji} - v_{ki}| \geq |v_{ji} - v_{ki}|$$ for each $1 \leq i \leq n$. Hence $v_{ki}$ is a Cauchy sequence in $\mathbb R$ (or $\mathbb C$) for each $i$. $\mathbb R$ (or $\mathbb C$) is complete hence $v_i = \lim_{k \to \infty} v_{ki} $ is in $\mathbb R$ (or $\Bbb C$) for each $i$. Let $v = (v_1, \dots , v_n) = \sum_i v_i e_i$. Then $v$ is in $V$ and $\|v_k - v\| \to 0$:  Let $\varepsilon > 0$. Then $$ \|v_k - v\| \leq C \|v_k - v\|_1 = C \sum_{i=1}^n |v_{ki} - v_i| \leq C^{'}n \varepsilon$$  for $k$ large enough.


I have been using Ubuntu 17.04 and it's the only operating system on my 500 GB hard-drive. I have only one partition (i.e root partition). Now I want to go back to 16.04 LTS but I want to keep my existing data intact so I want to create an additional partition to store my data(movies and the like) and reinstall Ubuntu 16.04 on the other partition. How do I go about doing that?

I want to reinstall Ubuntu keeping my data intact. I have 160 GB hardrive (sata or pata I don't know but it's slim and made in China) with a 40 GB ext3 partition, a 4GB swap memory and 3 other partition with a FAT32 file system. I have around 4GB space on my drive where Linux is installed.  I'd like to keep the data intact, especially the Downloads folder, desktop, and /var/www; And I no longer have access to any other machines or external storage devices.


Hi I want to make thousand separator for integer values I been tried on format('%n',[total]) but not working, it says      wrong argument on %n   also been trying currency format but the result is my country currency format I just want to make 'total' is show as thousand separated

var i : integer;  i := 1234567;   Given the above, I want the string "1,234,567" as output (assuming UK locale). IntToStr just gives me "1234567". I'm sure there's a one-liner for this, but I can't find it...


Currently the same question can be listed in both as linked and as related. This seems inefficient and confusing.  Example:

If a related question is also linked in the OP, need it really be linked twice in the sidebar under both "Linked" and "Related"?    I would have thought just displaying under 'linked' would suffice, as the OP presumably linked it because it was relevant, and displaying here shows they considered it. Showing it in 'related' as well serves only (so far as I see) to occupy a space that could otherwise be used for another related question.  What added value does the second link provide?


I have deleted my ubuntu volume in hard disk. Now each time I restart I get in grub recovery mode. How can I solve this problem?

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I wanted to make a grassland using a brush stroke from Photoshop as the leaves(object) for the a particle hair simulation. Even though, when i render just that image aloe, it keeps its transparency but after rendering the whole particles simulation together, a lot of artifact appear. just in cycles. not in Eeve. Thanks alor Here is the file and some images

I have a simple scene where I have simple planes and textures using the alpha channel of the PNG as transparency.    The way I created the files makes the Alpha channel 000 black and 255 pure white. Here is one texture if you want to examine it.      When I prepare a scene using cycles, it works fine.    I can add more planes this way.    But when I add a third one, the intersection of the planes begin to form a shadow.    Stacking 4 planes make the shadow obvious. It is rendered on the spot where the images are combined.    Here is .  What settings can I change? I changed bounce samples... but this is not about bouncing...  Any tips?


I have an old Mac Air 1,1 that has Office for Mac 2011 installed on it. I paid for the software and it installed the version on my machine. I don't have access to my live.microsoft.com account anymore and there's no way for me to get MicroSoft people/support to give me the keys again.  I need a way to extract the keys from my current installation of Office on my mac. For instance, in Windows, the keys used to be loaded in the registry at a certain place, under a certain key. Some programs could fetch them for you. Is there any such way I can do it for a Mac?

I want to use Migration Assistant to transfer my data from a Macbook Pro to a Macbook Air. I'm told that I need my product key for MS Office 2011.   Is there a way to find my product key on my mac?


Finding all real  number $n$ in $$5^n+7^n+11^n=6^n+8^n+9^n$$  Try: From given equation $n=0,1$ are the solution But i did not understand any other solution exists or not Although i have tried like this way $$\bigg(\frac{5}{9}\bigg)^n+\bigg(\frac{7}{9}\bigg)^n+\bigg(\frac{11}{9}\bigg)^n = \bigg(\frac{6}{9}\bigg)^n+\bigg(\frac{8}{9}\bigg)^n+1$$ Right side is strictly increasing function. but i have a confusion whether left side is strictly increasing or not could some help me how to solve it, thanks

Find the number of natural solutions of $5^x+7^x+11^x=6^x+8^x+9^x$   It's easy to see that $x=0$ and $x=1$ are solutions but are these the only one? How do I demonstrate that?  I've tried to write them either:  $$5^x+7^x+11^x=2^x*3^x+2^{3x}+3^{2x}$$  or  $$5^x+7^x+11^x=(5+1)^x+(7+1)^x+(11-2)^x$$  and tried to think of some AM-GM mean inequality or to divide everything by $11^x$, but those don't seem like the way to go. Any hints?


My Professor is asking that we format our DFAs to include terminal nodes that look like this, but I can't seem to figure out how to do it  My Question is how do I make the concentric circles on the terminal q1? Here is what I've done so far: \begin{tikzpicture}[roundnode/.style={circle, draw=black!60, fill=white, very thick, minimum size=0.5in}] \node[roundnode](q1) {$q_1$}; \node[roundnode, right= of q1] (q2) {$q_2$}; \path[thick,-to] (q1) edge [bend left] node[above] {$1$} (q2)                  (q1) edge [loop above] node[above] {$0$} (q1)                  (q2) edge [loop above] node[above] {$1$} (q2)                  (q2) edge [bend left] node[below] {$0$} (q1); \end{tikzpicture}  which produces:  which is close enough for all of the credit, except for the concentric circles on q1, how do I do that? (Please not the assignment is not on my LaTex skills, but the diagram I am drawing, so this question is not a plea for somebody to do my homework) Ideally, I'm looking for a solution that makes use of the xnode/.style={...} property, I'd like to add a different type of node called terminalnode that, here's an example of the code for what I mean: \begin{tikzpicture}[roundnode/.style={circle, draw=black!60, fill=white, very thick, minimum size=0.5in},                      terminalnode/.style={...}] \node[terminalnode](q1) {$q_1$}; \node[roundnode, right= of q1] (q2) {$q_2$}; \path[thick,-to] (q1) edge [bend left] node[above] {$1$} (q2)                  (q1) edge [loop above] node[above] {$0$} (q1)                  (q2) edge [loop above] node[above] {$1$} (q2)                  (q2) edge [bend left] node[below] {$0$} (q1); \end{tikzpicture}  Is that possible, and if so, then how do I do it? Edit Per Request, here is the entire file I'm working with \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{epsf} \usepackage{tikz} \usetikzlibrary{positioning}  \newcommand{\Reals}{\mathbb{R}}      % real numbers \newcommand{\Naturals}{\mathbb{N}}   % natural numbers \newcommand{\Integers}{\mathbb{Z}}   % integer numbers \newcommand{\Rationals}{\mathbb{Q}}  % rational numbers \newcommand{\Complexes}{\mathbb{C}}  % complex numbers  % math symbols  \newcommand{\IFF}{\mbox{$\Longleftrightarrow$}}    % biimplication \newcommand{\THEN}{\mbox{$\Rightarrow$}}           % implication  \begin{document}  \begin{tikzpicture}[roundnode/.style={circle, draw=black!60, fill=white, very thick, minimum size=0.5in}] \node[roundnode](q1) {$q_1$}; \node[roundnode, right= of q1] (q2) {$q_2$}; \path[thick,-to] (q1) edge [bend left] node[above] {$1$} (q2)                  (q1) edge [loop above] node[above] {$0$} (q1)                  (q2) edge [loop above] node[above] {$1$} (q2)                  (q2) edge [bend left] node[below] {$0$} (q1); \end{tikzpicture}  \end{document}

Consider the following code:   \begin{document}    \begin{figure} \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=5 cm, scale = 1, transform shape]   \node[initial,state] (A)                                    {$s_0$}; \node[state]         (B) [right of=A]                       {$s_2$}; \node[state]         (C) [above of=B]                       {$s_1$}; \node[state]         (D) [below of=B]                       {$s_3$};  \path[->] (A) edge [left]       node [align=center]  {$ c = c + 1 $} (C)       (A) edge [above]      node [align=center]  {$ c = c + 5 $} (B)       (A) edge [left]       node [align=center]  {$ c = c - 1 $} (D)       (B) edge [right]      node [align=center]  {$ c = c - 1 $} (D)       (C) edge [loop above] node [align=center]  {$ c = c + 1 $} (C)       (D) edge [loop below] node [align=center]  {$ c = c - 2 $} (D);  \end{tikzpicture} \caption{An example of SST} \end{figure}  \end{document}   I get the following automaton :    How can I draw S2 and S4 as final states (double circle)?


Can I also move or copy directory hierarchy of a file when I mv or cp the file?  For example, if I mv or cp dir1/dir2/file elsewhere, it will only mv or cp file. What if I want to also mv or cp dir1/dir2? Rather than mkdir -p dir1/dir2, can it be done with one command?

I have a folder structure with a bunch of *.csv files scattered across the folders. Now I want to copy all *.csv files to another destination keeping the folder structure.  It works by doing:  cp --parents *.csv /target cp --parents */*.csv" /target cp --parents */*/*.csv /target cp --parents */*/*/*.csv /target ...   and so on, but I would like to do it using one command.


I have installed the GNOME Shell Theming extension and enabled it in the gnome-tweak-tool.  I have installed some themes in my ~/.themes folder but still I cannot select any shell themes.   How can I enable and select GNOME Shell themes?

I've installed the GNOME Shell in Ubuntu 12.04 and I want to change the "Shell Theme", But it doesn't allow me to do that.  The alert says something like: "The GNOME-Shell extension is not activated", and I want to install it with the console, But it returns me an error.  How can I solve this problem?


I KNOW this has been asked but for the love of God someone please tell me a way around it! My first playthrough she lived. Did not have Wrex from ME1 because it was before I had downloaded the patch to import to ME2. the 3rd play through I had Wrex, paragon'd Eve, saved Maelon's data and let him live and had full paragon and she died. I have replayed ME2 2x hoping it was just a corrupt file but still she is about to die. So I have everything right, have replayed ME2 multiple times and STILL she is too stressed and Mordin says I don't have the data. Also, I did select BOTH options on how to save the data, the one for "Just in case" and they "you should help the Krogan" option. Didn't change. I don't understand. Especially since my first playthrough I didn't have it happen. I know it's a glitch, but there has to be SOME way around it. Because now the glitch carries over in EVERY game.

My husband has played through to the genophage curing three times now and all 3 times Mordin tells Shepard that Eve has died from the stress and fatigue of the testing... However, in Mass Effect 2, he saved Maelon's research data and when importing the saved file, it even says the the data was saved..   He has also done all the quests before the genophage final quest. She does not get blown up by the bomb, she just dies from stress of the testing. Does this mean he could have a glitch with his Mass Effect 2 save.. or is it a Mass Effect 3 glitch?  Any ideas would be greatly appreciated!


I get the way the system works, unfortunately it's not fair on the victim - in this case me. Here's the deal:  Today I have been serial upvoted, and have hit the rep cap as you can see in this screenshot:    Fair enough, tomorrow morning in the early hours a script will run and these will be reversed - but they won't be reversed in a way that doesn't punish me. I get why the system is in place and I'm not disputing that, however I feel that the way the system works is inadequate.   Today, I have gained '200 reputation' from seemingly one user spamming me with around 20 ish upvotes in the space of 90 seconds. Tomorrow, I will lose 200 rep, this will show as a negative red bar on my profile stating serial upvoting reversed. Still fine with this.  However, today I cannot get any more legitimate upvotes, and any upvotes I get will not be offset against the 200 reputation I lose tomorrow. Additionally, if I want to repcap tomorrow, I will need to get 400 reputation.  I know this isn't a bug - but it feels like one. Essentially at any point in time I could go and upvote any user to the point where it will get reversed for serial upvoting, and this will prevent that user from generating any real reputation during that period of time. Surely the system should actively push back against the people who're doing this, as they're currently getting away with what is basically trolling other users anonymously.  Why do I get punished because one person decided to serial upvote me?

I've just been the 'victim' of some serial up-voting:    This has pushed me over the rep cap for the day, so any other up-votes I receive today won't 'earn' the rep so-to-speak.  My question is this: What happens when these serial up-votes are inevitably reversed when the midnight script runs? At what point do those votes that previously didn't count towards my reputation get converted into actual reputation points? Is it automatic, or after a reputation re-calc, etc.?  I realise there are plenty of questions about serial up-voting on this site, but after trawling through most (all?) of them I couldn't find one that discussed how the rep cap is affected by the reversal.  I know I could just wait and see what happens but I'm impatient ;)


I am using Spring Integration filter to do a structural validation of the incoming payload and if the validation fails then i want to add some custom headers to the original message.  The filter code is below :  @Service("structureValidationFilter") public class StructureValidationFilter implements MessageSelector {  @Override public boolean accept(Message<?> message) {     // TODO Auto-generated method stub     boolean status=true;      if(message.getPayload() instanceof CFKRequestBody) {         CFKRequestBody body=(CFKRequestBody)message.getPayload();         if(!body.getInitiatingPartyId().equalsIgnoreCase("BPKV")) {             message = MutableMessageBuilder.fromMessage(message).                     setHeader("BPKV_ERROR_CODE", "Ïnvalid Initiating part id").                     setHeader("HTTP_STATUS", "400").build();              return false;            }      }     return status; }  }   But the headers are not populating in the Message. Not able to see the headers added in the next component. What am i doing wrong here.

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I’m taking Graph Theory lecture, and in the assignment there is a question about finding the determinant of a matrix $J_n-(1+\lambda)I_n$ where $J_n = (1)_{n \times n}$ and $I_n$ is the identity matrix of order $n$.   I have seen this problem before in the Linear Algebra course, and solved it by computing eigenvalues of the given matrix. However, since the final goal of this problem is finding eigenvalues of a complete graph $K_n$ by using this, it seems to be better to use different method.  I tried to use induction on the size of the matrix, but it does not seem to work well. I would be glad if someone give me a little bit of hint about this question.

The matrix is   $$\begin{pmatrix} 0&2&2\\ 2&0&2\\ 2&2&0 \end{pmatrix} $$  I have calculated the equation for eigenvalues, which is $\lambda^3-4\lambda-16=0$, but how do I solve this equation? Can this matrix be diagonalized?


I'm writing a loop that checks whether a connection has been established.  I'm doing   ping -c 1 8.8.8.8 while [ $? -ne 0 ] do   sleep 0.5   ping -c 1 8.8.8.8 done   Now I'm not sure how this works, if the ping request got blocked on its way out (iptables or other) the command and the script will hang indefinitely. What I want is to stop waiting for a reply after 1 sec and send a new request. That until I get a reply faster than 1sec, the $? is equal to 0 and it breaks the loop.

What is the -w (deadline) flag in ping for? I cannot find a description of it in the ping man page; only for -W, which takes seconds as a parameter. What is the difference between them, and how can I set a ping timeout (if host is not responding) to 200ms?


I know that battery chargers are more than just transformers (they are switched-mode power supplies), still, shouldn't input and output power be equal? Example: Input: 110/240V and 1.5A Output: 19V and 3.42A (65W) In the case of Input above the power is obviously way more than 65W. If Input indicates maximums and maximum V and A are drawn, how does the charger dissipate the extra power to meet the Output power demand?

If a power supply says the input power is 100-240V, ~1.5A, I'm assuming that the "1.5A" draw would be at 100V, not at 240V, right?  I.e. would the total max watts be 150W regardless of the input voltage?    The context of this is trying to determine the maximum draw for something based on the input power specs on its power supply to ensure a circuit doesn't get overloaded if too much is on it.  I want to make sure to get the max draw correct whether this is in the US at 110V or Europe at 220V.    As a side question, the output rating on this supply is 19V, 3.42A.  Does that mean that it's pretty inefficient?


My question is simple (and maybe I am wrong  asking this question even) what is the geometrical interpretation of determinant of a matrix in general ?  I could not think anything.

What is the geometric meaning of the determinant of a matrix? I know that "The determinant of a matrix represents the area of a rectangle." Perhaps this phrase is imprecise, but I would like to know something more, please.  Thank you very much.


I have over 200 reputation in  for a long time now.  On all sites I joined, I got the association bonus, e.g. in  I got it when joining back in July 2017.  Also, on sites I joined before getting 200 rep on SO, I got the bonus on June 17th 2015, e.g. .  However, my reputation on  is still 1, and I didn't get the bonus there for some reason.  Can this please be fixed so that I get the 100 rep association bonus on Arqade?  This is not a duplicate of , because I created my Arqade account before I could've gotten the association bonus, but after I became eligible for that bonus I did not receive it.

I'm a long time user with more than 1500 rep on the main site I visit. I have recently joined the physical fitness beta site and .   I believe this is a bug in the beta portion of the site. I have gotten the association bonus on all other sites I have joined.