I have the following code:  function timeLine (wrapper,slider,boxwidth,labels,labelWdth) {     this.wrapper = wrapper;     this.slider = slider;     this.boxwidth = boxwidth;     this.labels = labels;     this.labelWdth = labelWdth;      this.setupBlocks = function(){                   $(this.wrapper+' .blocks').each(function(){             // Get longest block for some reason this causes us problems!             newWidth = $(this).data('cover') * this.boxwidth;              $(this).width(newWidth+'px');             $(this).css('margin-left',$(this).data('left') * this.boxwidth+'px');         })       }   The problem I am finding is that the this.boxwidth variable within the setupBlocks function is returning NULL.  If I defined these properties at a function level shouldn't this.variable still be available?  I guess the jQuery each is overwriting that, so how can I set the this. list as completely global?  I thought you had to have this for JS classes in this format (as per  which I was using as I normally don't do Classes with JS).

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


Do any form of electromagnetic waves like visible light have mass? It is known that all electromagnetic waves have energy. According to Einstein's  $$ E^2=p^2c^2 + m^2c^4 $$  formula, the energy of a particle like photon, which shows wave properties as well, is derived from its mass and momentum. Some suggest that photons are indeed mass-less and that photons have energy due to there momentum, but momentum itself is equal to mass times velocity, $p=mv$.Then how can a body have momentum and not mass? The experiment on photoelectric effect by Einstein clearly proves Planck's theory of energy packets(photons) as correct, thus providing concrete evidence for the wave-particle duality of photons. Could anyone provide an explanation that is understandable to interested high-school students? Thank you:)

As an explanation of why a large gravitational field (such as a black hole) can bend light, I have heard that light has momentum. This is given as a solution to the problem of only massive objects being affected by gravity. However, momentum is the product of mass and velocity, so, by this definition, massless photons cannot have momentum.  How can photons have momentum?   How is this momentum defined (equations)?


I have a doubt in understanding about the degrees of freedom (dof) ......as I have learned dof is nothing but the necessary parameters to specify the location and configuration of a system.....if that's so then why is there only two extra dof for diatomic molecules to account for the rotation of its molecules? The molecule can rotate about any axis which passes through the line joining the two atoms....when freely moving in space. So why we account dof as two only to uniquely specify it's configuration ? It should be greater than two

I was reading about the equipartition theorem and I got the following quotations from my books:  A diatomic molecule like oxygen can rotate about two different axes. But rotation about the axis down the length of the molecule doesn't count. - Daniel V. Schröder's Thermal Physics. A diatomic molecule can rotate like a top only about axes perpendicular to the line connecting the atoms but not about that line itself. - Resnick, Halliday, Walker s' Fundamentals of Physics.  Why is it so? Doesn't the rotation take place that way?


I have a question regarding RegEx - I try to use negative lookahead in order to exclude found expressions as of specific rule, but it seems like my knowledge of the syntax is not enough to get around the problem. I currently have a regex pattern: ([A-Z]{2}\d{4}|[A-Z]{1}\d{5,6}|\b(?!20\d\d\b)\d{4,6}) which among other things is supposed to filter out expressions with 4 to 6 digits (excl. the ones which might be dates for year - preceeding negative lookahead) (the last alternative in the provided expression). As it happens, for this regex I would also need to exclude numbers which are happening after hyphen (so basically I found out that for the data I'm working with, sometimes it happens that I have codes like X-1234 for which it finds 1234 but then I'm sure it's not a code I'm interested in (I know that those codes would be always separated by space or would be at the beginning of whole sentence, e.g. "1234 xxxx yyy zzzz" or "xxxx 1234 yyyy".) Would you have any ideas how to incorporate this kind of condition in the provided RegEx in order to make it work? I assume it has to be next to the negative lookaround for 20\d\d, but I couldn't find a way to incorporate it so it doesn't disable the whole pattern. Would much appreciate any help or ideas!

Can a regular expression match whitespace or the start of a string?  I'm trying to replace currency the abbreviation GBP with a £ symbol. I could just match anything starting GBP, but I'd like to be a bit more conservative, and look for certain delimiters around it.  >>> import re >>> text = u'GBP 5 Off when you spend GBP75.00'  >>> re.sub(ur'GBP([\W\d])', ur'£\g<1>', text) # matches GBP with any prefix u'\xa3 5 Off when you spend \xa375.00'  >>> re.sub(ur'^GBP([\W\d])', ur'£\g<1>', text) # matches at start only u'\xa3 5 Off when you spend GBP75.00'  >>> re.sub(ur'(\W)GBP([\W\d])', ur'\g<1>£\g<2>', text) # matches whitespace prefix only u'GBP 5 Off when you spend \xa375.00'   Can I do both of the latter examples at the same time?


I am using DUALBOOT (Windows+Ubuntu)  I am unable to access my windows content in Ubuntu platform. When i am trying to use Ubuntu, I am getting this error  Error mounting /dev/sda6 at /media/satya/New Volume: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sda6" "/media/satya/New Volume"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda6': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


I used Wolfram to find the answer which is $\log(10)$ but can't solve no matter how hard I try.  $$\int_0^1\frac{x^9-1}{\log x}{\rm d}x$$

/A problem from the 2012 MIT Integration Bee is $$ \int_0^1\frac{x^7-1}{\log(x)}\mathrm dx $$ The answer is $\log(8)$. Wolfram Alpha gives an indefinite form in terms of the logarithmic integral function, but times out doing the computation. Is there a way to do it by hand?


I convert an image from one format to another and want to use the switch to process different formats. System.Drawing.Imaging.ImageFormat is public sealed class and switch doesn't work with it. The below code is working, but I want to use the switch here. Can you help me with some advice?  public static void ConvertImageFormat(Image image, string targetImageFilePath, int newWidth, int newHeight, ImageFormat imageFormatToConvert)     {         using (Bitmap bitmap = new Bitmap(image, newWidth, newHeight))         {             using (Graphics graphic = Graphics.FromImage(bitmap))             {                 graphic.InterpolationMode = InterpolationMode.HighQualityBicubic;                 graphic.SmoothingMode = SmoothingMode.HighQuality;                 graphic.CompositingQuality = CompositingQuality.HighQuality;                 graphic.PixelOffsetMode = PixelOffsetMode.HighQuality;                  graphic.DrawImage(image, 0, 0, newWidth, newHeight);                  if (Equals(ImageFormat.Png, imageFormatToConvert))                 {                     bitmap.Save(targetImageFilePath, ImageFormat.Png);                 }                 else if (Equals(ImageFormat.Gif, imageFormatToConvert))                 {                     bitmap.Save(targetImageFilePath, ImageFormat.Gif);                 }                 else if (Equals(ImageFormat.Jpeg, imageFormatToConvert))                 {                     ImageCodecInfo[] arrImageCodecInfo = ImageCodecInfo.GetImageEncoders();                     using (EncoderParameters encoderParameters = new EncoderParameters(1))                     {                         encoderParameters.Param[0] = new EncoderParameter(Encoder.Quality, 90L);                         bitmap.Save(targetImageFilePath, arrImageCodecInfo[1], encoderParameters);                     }                 }                 else                 {                     throw new Exception($"Convert to <{imageFormatToConvert.ToString()}> from " +                                         $"<{new ImageFormatConverter().ConvertToString(image.RawFormat)}>" +                                         $" image format is not supported now.");                 }             }         }     }

Seeing as C# can't switch on a Type (which I gather wasn't added as a special case because is relationships mean that more than one distinct case might apply), is there a better way to simulate switching on type other than this?  void Foo(object o) {     if (o is A)     {         ((A)o).Hop();     }     else if (o is B)     {         ((B)o).Skip();     }     else     {         throw new ArgumentException("Unexpected type: " + o.GetType());     } }


I'm having reasonable success with notifications and fragments in my Android App although occasionally I get an error, as shown below, in my Firebase error log  Although it rarely occurs, about 5-6 per 10,000 notifications over 3 months to the app, it is a bit annoying because the notification is lost (maybe that's an acceptable level of crashes!)  I'd love to fix it in my code if I could, but I don't quite understand what this log is telling me  Does it mean anything to you..? Any help appreciated  NullPointerException - FragmentManagerImpl.execSingleAction  Exception java.lang.NullPointerException:  android.support.v4.app.FragmentManagerImpl.execSingleAction (FragmentManager.java:1623) android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss (BackStackRecord.java:637) android.support.v4.app.FragmentPagerAdapter.finishUpdate (FragmentPagerAdapter.java:143) android.support.v4.view.ViewPager.setAdapter (ViewPager.java:511) com.support.android.policeman.MainActivity.setupViewPager (MainActivity.java:156) com.support.android.policeman.MainActivity.refreshFragments (MainActivity.java:454) com.support.android.policeman.MainActivity$7.run (MainActivity.java:425) android.os.Handler.handleCallback (Handler.java:730) android.os.Handler.dispatchMessage (Handler.java:92) android.os.Looper.loop (Looper.java:176) android.app.ActivityThread.main (ActivityThread.java:5419) java.lang.reflect.Method.invokeNative (Method.java) java.lang.reflect.Method.invoke (Method.java:525) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1046) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:862) dalvik.system.NativeStart.main (NativeStart.java)    Ok, so I'm a bit of a novice. However, thanks @altskop for the tip on how to understand this log and below is the bit of code where it is throwing the fatal error (viewPager.setAdapter(adapter) is line 156 to be exact)  private void setupViewPager(ViewPager viewPager) {     Adapter adapter = new Adapter(getSupportFragmentManager());     adapter.addFragment(new SenderListFragment(), "Loopy");     adapter.addFragment(new MessageListFragment(), "Poopy");     adapter.addFragment(new ContactListFragment(), "Scoopy");     viewPager.setAdapter(adapter); }   Is there a reason why the new adapter create wouldn't work, and if it returns null, what can I do..?

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?


Im stuck with this very simple code were I'm trying to create a function that takes a parameter and adds 1 to the result and returns it but somehow this code gives me no results. (I've called the function to see if it works.)  Somebody please help me since I'm very new to python :)  def increment(num):     num += 1 a = int(input("Type a number ")) increment(a)`   I changed it to   def increment(num):     return num + 1 a = int(input("Type a number ")) increment(a)`   but still no results are showing after I enter a number, Does anybody know?

I'm trying to understand Python's approach to variable scope. In this example, why is f() able to alter the value of x, as perceived within main(), but not the value of n?  def f(n, x):     n = 2     x.append(4)     print('In f():', n, x)  def main():     n = 1     x = [0,1,2,3]     print('Before:', n, x)     f(n, x)     print('After: ', n, x)  main()   Output:  Before: 1 [0, 1, 2, 3] In f(): 2 [0, 1, 2, 3, 4] After:  1 [0, 1, 2, 3, 4]


i want to be notified when when user trys to open a file from the explorer.  How could this be done? I tired hooking some winapi in the explorer.exe with no hope.  I also want to intercept this call and cancel it.

We are trying to develop a small application that can monitor the programs/processes that are executing in a windows machine.  If the program/process is not supposed to run, it should be blocked. It works similar to an antivirus.  This is the basic idea.  I want to know the ways to hook into the OS to get notified about every single program/process trying to run in the machine.


I started playing around with the compiz manager animations bit, but they're quite boring. I wondered if there are any I can download and if so where from?  I'm using Ubuntu 12.04 LTS

I installed Compiz on my laptop running Ubuntu 11.10 last week. The way I installed it was kind of different, I opened up a terminal and typed this command:       sudo apt-cache search compiz    After that, I installed all the packages that appeared in the terminal window. I enjoyed all the effects of Compiz like Paint fire on screen, Desktop Cube, but I can't help  but noticing people having some extra plugins which I don't have, such as Atlantis, Snow, Tile and much more.  Where are they getting all those plugins and how do I get them?


Dumb car crash question.  I think this is a conservation of momentum problem.    In one scenario, two 4000 lb cars (car A and car B) each traveling at exactly 35 MPH in opposite directions have a perfect head on collision with each other. In the other scenario, one 4000 lb car (Car A) traveling at 35 MPH hits a steel reinforced concrete bridge abutment (i.e. a huge mass with zero speed.)     Which Car A sustains more 'damage'?    My gut feel is that both experience exactly the same crash damage, but I'm at a loss to describe why.    (Question inspired by a temporary stretch of freeway near my home, with just a painted double line between opposing directions of traffic.. It's quite scary...)

This question has been asked using 50 & 100 mph reference, see  Phys.SE post and links therein. However, I am interested in the potential injuries to occupants of the autos. As the one going into the wall has occupants going 50 miles per hour.  The 2 cars have occupants in each car only going 25 mph at time of crash.  Would the occupants of the 2 cars not have as much damage as the car with the wall as the 2 cars would decelerate based  on the crushing of the cars.  Knowing that the 2 cars would be absorbing the energy more than the 1 into the wall at 50 mph.


Let R be a ring. Suppose that there exist an element r ∈ R with r^n  =0, for some n  ≥ 1.  Prove that 1-r is invertible.

Let $(A, +, \cdot)$ be a ring with $1$.  An element $a\in A$ is nilpotent if there exists $n\in \mathbb{N}$ so that $a^n=0$.      Show that if $a$ is nilpotent then $1+a$ and $1-a$ are invertible.


As the title says, is there a way to get the input level in mac?    I want to get the value indicating in the input level bar(System Preferences -> Sound -> Input) in the pic.  Is it possible?  There are solutions on how to set the input and output volume but I can't find any solution to get the input level value.

I am interested in using my old MacBook as an audio baby monitor. My imagined workflow is to set a noise threshold for the internal microphone in the MacBook when baby is stirring or whining and to use Messages to text me or my wife when the threshold is reached.  When I'm looking in System Preferences, I can see the Input level for the microphone is picking up noise, but how can I get a quantifiable number in Terminal?  I've seen online about osascript -e "get volume settings" to access a numeric value for how sensitive the microphone should be set, but I can't find a way to access how loud of an input is coming in at any given time.  Any ideas out there?


I suspect that the Jacobson radical of the ring  $$A = \begin{bmatrix} R & M \\ 0 & S \\ \end{bmatrix}$$  should be   $$\mathfrak{J}(A) = \begin{bmatrix} \mathfrak{J}(R) & M \\ 0 & \mathfrak{J}(S) \\ \end{bmatrix}$$  I know how to classify the left/right/two-sided ideals of this ring (T.Y. Lam, Chapter 1, Page 18) but I don't know how to find the maximal ones!  I'd like to see a proof of my conjecture if it's indeed true.  EDIT: I believe that this is not a duplicate of the linked question because first of all, this question is more general. Secondly, it requests the proof for something that is worth having its own separate question and thirdly, there's no proof in that linked question.

Let $A$ be the $\mathbb{C}$-subalgebra of $M_4(\mathbb C)$ consisting of matrices of the form   \begin{pmatrix} * & * & * & *\\ * & * & * &*\\ 0 & 0 & *&0 \\ 0 & 0&* &* \end{pmatrix}   Then how would I find the Jacobson radical $J(A)$ of $A$?    I don't really understand finding the Jacobson radical of $\mathbb{C}$-subalgebras.  Any help on this would be greatly appreciated, thank you!


I know there is a file in /media folder, then I searched with locate command, but it doesn't locate the file. I did sudo updatedb, then locate command again, but it doesn't locate the file.   I suspect locate path environment parameter since /media folder filesystem is on a seperate hard disk from the main stuff.   Should I edit locate path environment parameter?? How do I do it? or Am I missing more??

Files from my external hard drive are no longer indexed after rebooting.  I have to remount and then run  # updatedb   after each reboot.  The problem is updatedb takes a few minutes for my external hard drives.  Is there any way I can retain indexing for my externals after I reboot so that the locate command can search through my externals?  EDIT:  Per Request here are my specs:  $ cat /etc/updatedb.conf PRUNE_BIND_MOUNTS="yes" # PRUNENAMES=".git .bzr .hg .svn" PRUNEPATHS="/tmp /var/spool /media" PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf fuse.glusterfs fuse.sshfs ecryptfs fusesmb devtmpfs"  # mount /dev/sda5 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) none on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) none on /dev type devtmpfs (rw,mode=0755) none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev) none on /var/run type tmpfs (rw,nosuid,mode=0755) none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) gvfs-fuse-daemon on /home/me/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=me) /dev/sdb1 on /media/me type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sdd1 on /media/Little Boy type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sde1 on /media/Fat Man type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)  # on_ac_power; echo $? 255


How do I insert a value in MySQL that consist of single or double quotes. i.e  Ali said, "This is Ashok's Pen."    The single quote will create problems. There might be other escape characters.  I am using php to enter data into the database?  How do you insert the data properly?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Simply put. Sometimes I have a question that fits on more than one QA site.  Example: An applescript question could be asked in both Ask Different and Stack Overflow.  Ask Different should be the proper Site to ask the question, but Stack Overflow has a bigger community and a lot of support for applescript questions.  Is asking the same question on both sites encouraged? If not, what's the recommended approach?  Thank you in advance,  PS: Should I even be asking this question in Meta Stack Exchange instead of the AD or SO Meta Sites?

It is possible to migrate a question from one Stack Exchange site to another by closing, but if I have a question that I think is on-topic for multiple Stack Exchange sites, is it OK to post it on both (multipost)?   For example, I have a question that's earned me the tumbleweed badge on SO and I'm not sure what the best thing to do with it is. It's about a web server so it might be answerable on Server Fault but it's really more of a programming thing, hence the posting the question on Stack Overflow.    Is there any way to make the question visible on multiple sites (crosspost) and then accept the answer wherever it came from?


Perhaps spam flags are slightly more helpful than normal flags and deserve capitalisation?

Looks like a text inconsistency to me:   Spam flags are Helpful Other flags are helpful


Article saying it used as hash function producing a 128-bit hash value. It can still be used as a checksum to verify data integrity, but only against unintentional corruption. So when it's neither encryption nor encoding, Is it only use as securing and verify data integrity but not concern of decoding?

I know that md5 shouldn't be used for password hashing because of collisions and possibility of making dictionary attacks e.g. using rainbow tables. But what about other uses? Can I use md5 for encrypting data?  Say, attacker gains access to database where sensitive data was stored using md5. He wants to know just this data that was hashed, not another data that gives this hash. Can he do it?  I know that there are better cryptographic hash functions so don't suggest to use them if md5 is enough.


Cannot find the jungle temple in terraria. We have scoured our map for hours. Please help us!

On my 1.2 Terraria Map I have been mining from left to right in my large underground jungle using my rocket launcher. Despite this, I have had no luck on finding the Underground Jungle Lihzahrd Temple. I have been searching the layer above where lava constantly spawns. Have I simply spawned in a world without one or am I searching in the wrong place? I have also considered using the clentimator with Dark Blue ammo to provide light, should I do that?


I thought it was a Tantalus-like metaphor, suggesting a donkey will walk toward a carrot dangling from a stick forever, given the stick is tied to the donkey. It seems to be used as reward versus punishment metaphor. Why would the average Joe find a carrot a reward?

What does the phrase, carrot of profits, mean? The  is      And for smaller companies, using the carrot of profits 20 years away isn’t likely to sway VCs who can see no further than three.   A little of profit?


Is it beneficial to join a strong team? Do I get any valuable bonuses (lure modules installed in your area worth it?) from high-level friendly gyms?   Or is it better to choose weaker team in order to have more opportunities to fight?  Does the choice matter for endgame (level 20+ let's say)?

In my case, I joined team Instinct but it looks like all the gyms in my area are taken by Mystic.  I'm not a high enough level to battle these gyms now, and since they aren't mine I can't train. How much will this set me back in the game, if at all?


So far I know that if $A \subset B$ then every element that is in $A$ will be also in $B$ but there will be at least one element in $B$ that is not in $A$  What about $A \subseteq B$?  site says that $A \subseteq B$ says that "$A$ is a subset of $B$. set $A$ is included in set $B$." But well, it's pretty much the same definition as $A \subset B$.  So my question is, $A \subset B$ and $A \subseteq B$, what is the difference?

If every element of set A ia an element of set B then we say that A is subset of B. A is said to be proper subset if A does not equal B.  My question is - whether the symbol we use to show subset is  same as that for proper subset? I have seen that A is subset of A itself is shown by the same symbol as that for the subset while when we write improper subset, we usually write equal to sign with symbol of subset. So, please help me to know this.


The following packages have unmet dependencies:  virtualbox-qt: Depends: virtualbox (= 4.3.18-dfsg-1) but 4.3.18-dfsg-1 is to be installed                Depends: libgcc1 (>= 1:4.1.1) but 1:4.9.1-16ubuntu6 is to be installed                Depends: libqt4-network (>= 4:4.5.3) but 4:4.8.6+git49-gbc62005+dfsg-1ubuntu1 is to be installed                Depends: libqt4-opengl (>= 4:4.7.2) but 4:4.8.6+git49-gbc62005+dfsg-1ubuntu1 is to be installed                Depends: libqtcore4 (>= 4:4.8.0) but 4:4.8.6+git49-gbc62005+dfsg-1ubuntu1 is to be installed                Depends: libqtgui4 (>= 4:4.8.0) but 4:4.8.6+git49-gbc62005+dfsg-1ubuntu1 is to be installed                Depends: libstdc++6 (>= 4.6) but 4.9.1-16ubuntu6 is to be installed

Occasionally, when I'm installing stuff, I get an error like the following:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages.   How can I resolve this?


The question:     Using $S_n = \sum_{k=1}^{n}H_k$ where $H_k$ are the harmonic numbers, show $S_n = (n+1)H_n - n$.   So far I have   $S_n = \sum_{k=1}^{n} H_k = \sum_{k=1}^{n} \sum_{j=1}^{k}\frac{1}{j} $  is there perhaps some way to change the summation index?  Or would the next step come from  $S_n = \sum_{k=1}^{n}[1+ \frac{1}{2} + \frac{1}{3} + ...+\frac{1}{k-1} + \frac{1}{k}]$  Any help would be appreciated.

This is motivated by my answer to .     gives the following identity:   $$ \sum_{k=1}^nH_k=(n+1)H_n-n $$  Why is this?    Note that I don't just want a proof of this fact (It's very easily done by induction, for example).  Instead, I want to know if anyone's got a really nice interpretation of this result: a very simple way to show not just that this relation is true, but why it is true.    Has anyone got a way of showing that this identity is not just true, but obvious?


Problem:    Suppose $f(x)$ is a polynomial with integer coefficients. If $f(a)=17$ for some integer $a$, show that $f(x)$ has at most $3$ integer roots.  I tried to solve this problem but ended up getting the result as a maximum of $4$ integer roots. Here's the method I used:  Assuming that the three integer roots are $\alpha$,$\beta$,$\gamma$ $f(\alpha) = f(\beta) = f(\gamma) = 0$  As $f(m) - f(n) = k  * (m-n)$, where $m,n,k$ are integers  $f(17) - f(\alpha) = k  * (17-\alpha)   17 - 0 = k * (17-\alpha)$  $(17-\alpha)$ can now be $-17 , -1 , 1 \text{ or } 17$ Thus $\alpha$ can be $34 , 18 , 16 \text{ or } 0$  Similarly $\beta$ and $\gamma$ can take any of the remaining values, leaving one last value for a fourth root.  Could anyone suggest any other methods or point out where exactly I went wrong?

The question that I am trying to answer is :  Suppose is $p(x)$ is a polynomial with integer coefficients. Show that if $p(a) = 1$ for some integer a then $p(x)$ has at most two integer roots.  I have no idea how to get started. Any help would be awesome!


Looking for the code for a Latex integral symbol with a half circle, concave cave down, and an arrow pointing in the clockwise direction.  Does such a symbol exist?

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


Let's say I have three ArrayList and a HashMap as follows:  public HashMap<Integer, ArrayList<String>> m = new HashMap<>(); public ArrayList<JSONObject> A = new ArrayList<>(); public ArrayList<JSONArray> B = new ArrayList<>(); public ArrayList<String> C = new ArrayList<>();   And I do:  m.put(0, C);//setting values to the hashmap C.clear();//resetting value of C   But this also clear the C inside m hashmap, resulting m = [0, ""]. Why is this the case in Java?   What I was expecting is this  int A = 1; int B = 2; int C = A+B //result is 3   Now if i set A=0 this shouldn't affect the final value of C  Can someone please explain this to me?

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?


We are making a game filled with thousands of cars. We were wondering if we need a licence to use body designs of lets say a Lamborghini, Ferrari, Impala. etc. We do not want to pay money to use the designs in our game, of course we are going to make our own car brands though. Can we use a similar body design??

We are small team which working on car racing game but we don't know about licensing process for branded cars like Nissan, Lamborghini, Chevrolet and etc.   Do we need to buy any licence for using real car brand names, models, logos,... or we can use them for free?  Second option we think about using not real brand with real models is it possible? If someone have experience with that, fell free to share it.  Any information about that is welcome.


Let's say a=(1,2) and b=(3,4) What should print(a+b) give?  I expect the output (4,6), but the actual output is(1,2,3,4)

Is there anyway to get tuple operations in Python to work like this:  >>> a = (1,2,3) >>> b = (3,2,1) >>> a + b (4,4,4)   instead of:  >>> a = (1,2,3) >>> b = (3,2,1) >>> a + b (1,2,3,3,2,1)   I know it works like that because the __add__ and __mul__ methods are defined to work like that. So the only way would be to redefine them?


I am trying to make a command line calculator using Java, I have come up with the code below it works without the if-else ladder,but I can't make it work with if-else, during debugging I tried printing the "z" which is indeed add when the arguments are passed as java name 1 2 add, But I can't seem to trigger the id (z == "add"), please suggest what I am missing.  public class commandlinecal {         public static void main(String arg[])         {                 int x = Integer.parseInt(arg[0]);                 int y = Integer.parseInt(arg[1]);                 String z = arg[2];                 if (z == "add")                 {                         add(x,y);                 }                 else if (z == "sub")                 {                         sub(x,y);                 }                 else if (z=="mul")                 {                         mul(x,y);                 }                 else if(z=="div")                 {                         div(x,y);                 }         }            public static void add(int x,int y)           {                 int result = x + y;                 System.out.println("The sum is" + " "+result);            }           public static void sub (int x,int y)           {                   int result = x-y;                   System.out.println("The sub is"+" "+result);            }           public static void mul (int x,int y)           {                   int result = x * y;                   System.out.println("The multiplication is"+" "+result );           }           public static void div (int x,int y)           {                   float result = x / y;                   System.out.println("The division is"+" "+result);           }         }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I've heard that try/catches are considered to be bad for performance, but that if you're rarely expecting to throw exceptions then they are considered a better way to return failure information rather than using methods/functions with Boolean values.  Does using try/catch in this manner better or worse for performance?  It certainly makes coding easier.  Example:  void DoSomething(){   try{     DoSomethingIffy();   } catch {     // Yikes! Do failure stuff   } }  void DoSomethingIffy(){   if (rareCondition) {     throw new Exception("oops");   } }   vs   void DoSomething(){   if (!DoSomethingIffy()) {     // Yikes! Do failure stuff   } }  bool DoSomethingIffy(){   if (rareCondition) {     return false;   }   else {     return true;   } }

I don't want a discussion about when to and not to throw exceptions. I wish to resolve a simple issue. 99% of the time the argument for not throwing exceptions revolves around them being slow while the other side claims (with benchmark test) that the speed is not the issue. I've read numerous blogs, articles, and posts pertaining one side or the other. So which is it?  Some links from the answers: , , .


I have these tables :  work --> id, name, description  subwork --> id, name , work_id  which work_id is foreign key for work table .   Im using this query to get results :   ("select work.*,  subwork.name from work"                        "inner join subwork on subwork.work_id = work.id")   this will return the repetitive values , on the other hand I need all of data in result so distinct is not helpful . I wanna know is there any way to get results like this :   (work_id, work_name, work_desc, (subwork_name1, subwork_name2, subwork_name3,... ))

Using MySQL, I can do something like:  SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;   My Output:  shopping fishing coding   but instead I just want 1 row, 1 col:  Expected Output:  shopping, fishing, coding   The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.  I've looked for a function on  and it doesn't look like the CONCAT or CONCAT_WS functions accept result sets.  So does anyone here know how to do this?


A friend of mine has this cable, which he bought from an international supermarket chain store - I don't expect them to buy useless crap. It appears to be a totally passive cable, but it's an HDMI->VGA adapter. How can this even work? Didn't work when connecting my laptop to a projector but he assured that the cable worked for him when he used it on his laptop.

I have bought a no-brand, passive HDMI Male to VGA Female adapter, to link up a PC with a more dated monitor. It did not work.  After doing some reading, I have learned that buying such an adapter is often discouraged because in many cases it will not convert the signal from Digital to Analog, or the Motherboard/CPU on a specific computer might not be compatible with that particular adapter.   So my question is: seeing how there are so many of these passive adapters on the market, are there circumstances under which they actually do suffice to connect an HDMI output to a VGA input? Or are they generally just a rip-off?  Example of the kind of adapter I bought:


I have checked everywhere for a solution to this problem and simply cannot find one despite its apparent simplicity.  I keep getting a NullPointerException when calling myFunction():  private static Map<String, Map<String, Integer>> data;  public Class() {     data = new Map<String, Map<String, Integer>(); }  public static void myFunction(String key, String val0, int val1) {     boolean createNewEntry = false;     if(null == data) {         createNewEntry = true;     }     else if(!data.containsKey(key)) {         createNewEntry = true;     }     if(createNewEntry) {         data.put(key, new HashMap<String, Integer>()); // This throws a NullPointerException.     }     data.get(key).put(val0, data.get(key).get(val0) + val1); }   The stack trace (with some project-specific data removed) is as follows:  Could not pass [Event] to [JAR file] v1.0.0 org.[parent].event.EventException     ... (irrelevant) Caused by: java.lang.NullPointerException     at net.[package name].[class].myFunction([source file].java:93)     at net.[package name].[class].otherFunction([source file].java(108)     at net.[package name].[other class].anotherFunction([other file].java(65)     at net.[package name].[main class].on[Event]([main file].java:97) ~[?:?]     at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) ~[?:?]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:[versioning number]]     at java.lang.reflect.Method.invoke(Unknown Source) ~[?:[versioning number]]     at org.[a different package name].plugin.java.JavaPluginLoader$1.execute([a file].java:301) ~[[versioning number]:[more data]]     ... 15 more   Thank you in advance for any insight into this problem.

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?


There are statements in wiki like:     The current measurement of the age of the universe is 13.799±0.021 billion (109) years within the Lambda-CDM concordance model.   My question is how does scientists theorize this value, by relying on which observed facts and data?

The parameters of $\rm\Lambda CDM$ model have been determined to an amazing high precision from the measurements made by the Planck mission. In particular, the Hubble "constant" (the value of Hubble parameter at the present day) has been determined to be $H_0 = (67.3 \pm 1.2 )\, \text{km} \, \text{s}^{-1} \text{Mpc}^{-1}$. They have also given values for the density parameters at the present day (the density divided by the critical density) coming from cosmological constant, $\Omega_{\Lambda,0} = 0.6817$, and from matter, $\Omega_{m,0} = 0.3183$. The age of the Universe $t_0$ can be calculated from other cosmological parameters in this way  $$t_0 = \frac{1}{H_0}\int_0^1 \frac{a\,\text{d}a} { \sqrt{\Omega_{\Lambda,0}a^{4} + \Omega_{k,0}a^{2} + \Omega_{m,0}a + \Omega_{r,0}} },$$   where $\Omega_k = 1 - \Omega$ is the space curvature parameter, $\Omega = \Omega_{m,0} + \Omega_{\Lambda,0} + \Omega_{r,0}$ is the total energy density parameter (the energy density divided by the critical density) and $\Omega_r$ is the energy density parameter coming from radiation.  I have read that the age of the Universe has been established from the Planck mission measurements as $t_0 = 13.82 \times 10^9$ years. My question is: how is this value been calculated? I mean, it has been calculated assuming a flat space geometry, that is, assuming that $\Omega_k = 1 - \Omega = 0$? If not, what values for $\Omega_{r,0}$ and $\Omega_{k,0}$ have been used to perform the calculation?


Yes, I am aware of observations of "massive objects", for example near the center of the galaxy. But is there any evidence that the object in question is a black hole, with all its commonly attributed properties? Or are black holes just an unconfirmed artifact of general relativity, i.e. something that is an abstract mathematical concept and not a real object?  EDIT: That is not an answer to my question. I did not ask about means of detecting them, I am aware of those means. I'm interested if there's anything suggesting that the properties commonly attributed to black holes, other than large mass, have anything to do with reality, or are completely abstract and deduced from math.

I'm not very knowledgeable about physics generally, but know that nothing can escape a black hole's gravitational pull, not even light (making them nearly invisible?).   My question is: What has been obtained from direct observation of a black hole to prove their existence? Please note that I'm not questioning the existence of black holes, but am just curious as to how we have come to realize it.


I have an existing LVM volume group of 3 disks (ext4), with 4 logical volumes. Not quite ready for the leap to a nextgen FS, I  would like to balance the load on the disks. I have seen you can create VG's with striping (RAID0 equivalent), but I would like to convert the existing one. Can this be done?

On my server using LVM, I have a simple linear LV on a single drive (PV). Now, I added 2 more (same size) drives (PVs) to the server.   I want to convert my existing linear LV to a striped LV (RAID0 like) across the 3 drives, if possible, online. This would allow me to enhance performance, thanks to the striping. I know it is theoretically possible.  I tried many things, like creating a striped mirror of my LV, based on , but in my case it is more complicated because I want to keep using the original drive (on the website, it is a migration from a single drive LV to 3 other drives).   I am becoming more and more familiar with the pvmove, lvconvert and other LVM tools but didn't succeed. Please help. :)  If needed, I have very few extra space on another drive (about 5% of my original LV size).  My lvdisplay -m is as follows:   --- Logical volume --- LV Path                /dev/vg_space/vol_space LV Name                vol_space VG Name                vg_space LV Status              available # open                 1 LV Size                260.75 GiB Current LE             66752 Segments               1 Allocation             inherit Read ahead sectors     auto - currently set to     256 Block device           253:0  --- Segments --- Logical extent 0 to 66751:   Type                linear          Physical volume     /dev/sda5   Physical extents    0 to 66751


The achievements drop-down menu in the new top bar shows me when a question/answer earns me reputation and how much, and that's great, but I don't know what caused that to happen. I'd like to know why I received reputation: was it an upvote? An accepted answer? An accepted edit? If I have the list of reputation values in my head I can figure it out, but it would help me to see it somewhere in the drop-down, even as title text on hover.    Edit:  It sounds like the items in the menu can roll up multiple events, and that's why it doesn't show the event there. How about adding a link to my reputation tab to the menu so I can quickly get to a breakdown?

When you accept an answer on one of your questions, you get 2 reputation for it. The achievements dropdown tells you with a shiny green +2 on the topbar, and shows this:    Why did I get +2 for it again?  It would be better if the message told you it was because you accepted an answer, right there in the dropdown, without the need to go into your profile to see more details.


Edits limits (Edits must be at least 6 characters; is there something else to improve in this post?) can be passed easily using html comments. Testing: This is what can be done to skip the edit limit: Using code comment fools the edit and adds them in the number of characters edit. Here is an example: <!--  -->  This code block is long enough to edit the question without touching anything other. Simply copying and placing it at anywhere in the question can skip the edit limit. These automatically get disappeared because these are html comments. Benefit:  Questions can be edited with changes having less than 6 edits  This seems more like a  to me rather than . It must be detected by the site that the edit is no more than addition to a useless html comment (unless it is in a code block or it is a ), so don't let it be edited. The system should let such edits be prohibited. This will save the time of the reviewers by not adding useless edits in the queue.

A follow-up to , and an extension of .   shows that it is possible to circumvent minimum character requirements using null bytes.  Can we exclude such non-printing characters as ASCII NULL and other control characters from counting toward minimum character requirements?  Edit: Users have demonstrated that , unmatched or invalid HTML tags, and other content that is not displayed after Markdown parsing can be used to bypass such requirements as well.  Can we cover this case as well, except for links?


I had the regular version of the game. -CUSA00207- But I think to get the GOTY edition for DLC. -CUSA03173-  Both are for the same region.  The only thing I'm worried about is if the GOTY version will be able to load old save file ?

So I got the vanilla version of Bloodborne when it was on PS+ and got the DLC as well but because of economical reasons I have not been able to continue with PS+. I was in the Old Hunters and my roommate still in the game but looking forward to playing the DLC as well. Since we both work we did not think getting PS+ for a short time (ie. a month or three) would be good because we know we would end up having to renew it several times. But...the complete bundle is available on the PS network for roughly the same price as three months PS+ and it would only be a one time payment. However we need to know if we could access our save files. I have seen this addressed for disk to disk and digital to disk but not when both versions are digital.   Anyone know if it would be no issue to keep playing on our files or would we have to start over?


I have bought a Google Nexus 7 3G Tablet.  But, My country and area doesn't allow me to use 3G sims/Wi-Fi.  We have only 2G sims. When I insert the sim, I can connect to the Internet. I can send and receive SMS messages via "Go SMS Pro" application.   But, I am unable to use voice call system which is available in any simple nokia / samsung java supported mobile.  Will my Nexus 7 allow me to send and receive Voice calls in 2G network? Because, to know sim balance we have to call on *XXX# or to know about data usage (Internet MB), we have to dial a number. Also, to call any phone number, we have to dial. So, what can I do to send and receive Calls like any simple mobile phone?

The Nexus 7 3G is out and I'm wondering whether Android 4.2 tablets are still data-only devices.  Can I install a custom ROM or apk to this tablet so that I can send and receive GSM calls and text messages on it?  If not, why not?  What's missing?  Added: Nexus 7 3G has many  of phones, but not all: It has gps, bluetooth, headphone jack, accelerometer, gyroscope, ambient light sensor, compass and nfc, but does not have a receiver (earpiece), haptic feedback (vibrate) or a rear camera. IF the 8"x5" tablet can be used as a phone, you won't look funny putting it against your ear because it has no earpiece.  Added: The question is about GSM calls and texting, not VOIP or SIP calls or tethering.


We have about 12000 users who doesn't have any roles. we need to change them to "contributor". How can I change them to "contributor"? Should I do on database? if so, which fields I need to update?  I try this code :-  INSERT IGNORE INTO an_usermeta (user_id, meta_key, meta_value) SELECT DISTINCT u.ID, 'wp_capabilities', 'a:1:{s:11:"contributor";b:1;}' FROM an_users u   But when go to wp-admin i don't see any user for contributor role Thanks,

We have about 8000 users who doesn't have any roles. we need to change them to "contributor". How can I change them to "contributor"? Should I do on database? if so, which fields I need to update?  Thanks,


I saw a video online where someone made a first person version of flappy bird, so I was wondering...  If I were to remake a 2D game into a 3D game and change the perspective to first person, and then proceed to release it online (like on itch.io) for free, would there be any repercussions?  The game concept and gameplay would be nearly identical with maybe a few changes, and while the art would be very similar, they'll still be original 3D models that I made myself, and differ from the actual assets used in the original game. All the code is original.  And could I just name it "First person (+ game name)" outright or is it better to name it something original?

Most games build on other games' successes and many are downright clones. Where is the limit of imitation before legal issues come into play? Is it down to literary or graphic work like characters and storyline that cause legal problems, or can someone actually claim to own gameplay mechanics?  There are so many similar clone games out there that the rules are probably very slack or nonexistent, but I'd like to hear the views of more experienced developers / designers.


I am a happy user of Alan Matthes' packages, most of the time. Just noted that certain arguments in his tkz-base package raise a !Package PGF Math Error: Sorry, the operation 'gcd' has not been implemented in the floating point unit. if package pgfplots is loaded, which I can't do without. In the MWE below 1. works fine, 2., 3. and 4. raise the error. Any thoughts there, anyone?  \documentclass{article} % RN. 2 October 2107 %======================= \usepackage{comment} \usepackage{tkz-base} \usepackage{pgfplots} %----------------------- \begin{document} 1.\\     \begin{tikzpicture} \tkzInit[xmax=8,ymax=6] \tkzGrid \tkzAxeXY \draw(-1,0)--(6,7); \end{tikzpicture} %\begin{comment} 2.\\ \begin{tikzpicture} \tkzInit[xmax=3,xstep=0.33333] \tkzDrawX[label=$t$,text=blue,color=red] \tkzLabelX[frac=3,text=blue,below = 9pt] \end{tikzpicture} 3.\\ \begin{tikzpicture} \tkzInit[xmin=0,xmax=7,ymin=-1,ymax=1] \tkzDrawX[trig=2] \tkzLabelX[trig=2] \end{tikzpicture} 4.\\ \begin{tikzpicture} \tkzInit[xmin=0,xmax=7,ymin=-1,ymax=1] \tkzDrawX[trig=2] \tkzLabelX[trig=2,below=8pt] \end{tikzpicture} %\end{comment} \end{document}

Problem description  I have a LaTeX project that relies on both, \usepackage{pgfplots} and \usepackage{forest}.  Since upgrading to TeX Live 2016, the presence of the pgfplots package breaks compilation if the document contains a \begin{forest} environment that has the folder option enabled.  The error message suggests this is because pgfplots wants to use the FPU, but the folder option in the forest environment relies on a Mod operation that is not (yet) implemented in the FPU:     ! Package PGF Math Error: Sorry, the operation 'Mod' has not yet been implemented in the floating point unit.   Because I require both packages in my project, I would like to find a solution for this problem. I suspect that deactivating the FPU via \pgfkeys{/pgf/fpu=false} might be an option, but I'm not sure how I would apply this to the MWE below.  Minimal Working Example  Save the following MWE to main.tex and compile with pdflatex main. Then, uncomment the line marked TODO and try to recompile (which will fail).  \documentclass{standalone}  % NOTE: [edges] option required to enable 'folder' option in % 'forest' environment below. \usepackage[edges]{forest}%  % TODO: Uncomment the line below to break compilation %\usepackage{pgfplots}%  \begin{document}  \begin{forest}%   for tree={folder}% NOTE: Problem only occurs with this option enabled   [foo%     [bla]%     [moo]%   ]% \end{forest}%  \end{document}


Suppose there are two elements $x,y\in \mathfrak{gl}(V)$ for $V$ finite dimensional vector space over an algebraically closed field. If both $x,y$ commute with $z=[x,y]$, then how to show that $z$ is nilpotent?

Let $V$ be a complex-vector space and $x,y\in gl(V)$ such that $[x y]=xy-yx$ commutes with $x$ and $y$. Let $[x y]$. Prove that   (1)$tr(z^{m})=0$ , for every $m\geq 1$.  (2)Deduce that z is a nilpotent map.   I couldn't do the first one. For the second one if we can prove that the possible eigen values of $z$ is only $0$, we are done. From the first one , we have if $\lambda_{1},... \lambda_{n}$ are eigen values of $z$, then $\sum_{i=1}^{n} \lambda_{i}^{k} =0$, for every $k$. From there how can we comclude that $\lambda_{1}=\lambda_{2}=...= \lambda_{n}=0$.  Thanks in advance for any help.


I'm sort of new to linux and I'm having a problem, I'm trying to prevent users from changing the desktop wallpaper (as well as other things but that is the main one)  I know    this has been asked before but none of the current topics helped me and I've been at this for more than a week, They are also kind of old topics.  My configuration is: I installed Edubuntu 14.04, installed gnome (only using gnome for gconf and dconf to get this working, is there a way without gnome?) Have admin account, a standard account and a guest account, Wanting to lock down features on the standard account.  I've already tried doing it in gconf, dconf and using gsettings.  I don't want to use a guest account   I've been trying to use gconf and dconf but it's just not making sense to me, right now I'm trying it in dconf because I couldnt get it to work in gconf, I tried setting it as mandatory and default in gconf but it didnt work (I read that gconf isn't used in the newer versions of Ubuntu in favor of dconf, so that's why I'm trying dconf), right now I'm trying to do  in dconf again (the wallpaper part)  I'm under the impression that I'm supposed to create a file and put all the info they provide in there, like create the user name/database, then the keyfile (how do I make it a .d file?), then dconf update file, right? How do you get it to run after all that?  Do I use a text editor like gedit? I tried going to the directory they said to and nothing is there and I wasn't able to make any new files or directory's in the GUI, and I can't move a file into there. Can you only do that through the terminal?  It would be great if i could restrict it to only the Admin able to change settings so I tried this:   chmod 744 /usr/bin/gnome-appearance-properties   But, I'm getting:  chmod: cannot access 'usr/bin/gnome-appearance-properties': No such file or directory   when I try that.   and I would rather not use this, where you put this in the startup applications:  gsettings set org.gnome.desktop.background picture-uri "file:///usr/share/backgrounds/edubuntu_default.png"  I've seriously tried all the help topics on the forum about this and many other web sites. Please help!  Thanks!

I don't want my users to change the system wallpaper. How do I the lock the wallpaper down? Update  Users are changing wallpaper by right clicking the picture and choosing set as wallpaper. How to restrict this behaviour?  Is it possible to remove Backgrounds Tab from Appearance Preferences? If yes how?


I am facing problem in sending mail to my inbox (gmail account) but everytime it goes to spam folder. Here is the code snippet      //$ticketDetail is array which contain required information to send.        sendOwnershipEmail('dineshnagarscriet@gmail.com', $ticketDetail);             function sendOwnershipEmail($email, $ticketDetail) {             $param = new stdClass();      $param->content = "

".$ticketDetail[0]['ticket_number']."

Ticket with ticket number ".$ticketDetail[0]['ticket_number']." has been requested for tranfer from

".$ticketDetail[0]['oldDepartment']." to ".$ticketDetail[0]['newDepartment']." Department

";                          $param->sendTo = $email;             $param->subject = "Request for Department transfer";                      sendMailFunction($param);     }               function sendMailFunction($param) {             $to = $param->sendTo;             $subject = $param->subject;             $headers = 'MIME-Version: 1.0' . "\r\n";             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";             $headers .= 'From: successive.testing@gmail.com' . "\r\n";             $message = "" .                    "<meta http-equiv='Content-Language' content='en-us'>" .                    "<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>" .                    "" .$param->content.                            "

";           mail($to, $subject, $message, $headers);     }  And I have tried a lot like setting headers as  Reply-To, Return-Path etc but every time it goes to spam. Can you please figure out whats the problem?

This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology.  Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it.  This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam  I figure this is a big topic in which I am essentially an ignorant simpleton.


This script works with any file except .deb files? Anyone know why? #!/bin/bash find /home/andy/.local/share/Trash/expunged/ -type f -exec rm {} \; find /home/andy/.local/share/Trash/files/ -type f -exec rm {} \; find /home/andy/.local/share/Trash/info/ -type f -exec rm {} \; find /media/andy/MAXTOR_SDB2/.Trash-1000/files/ -type f -exec rm {} \;

Before I run this, I want to make sure it is correct. I want to delete any .deb files. find /home/andy/.local/share/Trash/expunged/ -type f -exec rm *.deb  This works on all files except .deb files. #!/bin/bash find /home/andy/.local/share/Trash/expunged/ -type f -exec rm {} \; find /home/andy/.local/share/Trash/files/ -type f -exec rm {} \; find /home/andy/.local/share/Trash/info/ -type f -exec rm {} \;  And it works completely with UM 20.04.


My question can be split into two parts:   Is there any advantage in using a shorter integer variable (e.g. short or unsigned char) to loop over array (or stl container) indexes; and What are the advantages (if any) of using iterators with stl containers.   Code example for problem 1:  const size_t a=100000000; const unsigned char b=5; float array[a][b];  for (size_t j=0; j<a; ++j)   for (unsigned char i=0; i<b; ++i)     std::cout << array[j][i] << std::endl;   Does using unsigned char in the i-loop save me anything? Does array[j][i] implicitly cast i into a size_t?  Code example for problem 2:  vector<float> a(1000,0.); vector<float> b(a);  for (size_t i=0; i<a.size(); ++i)   cout << a[i] << endl;  for (vector<float>::iterator it=b.begin(); it!=b.end(); ++it)   cout << *it << endl;   Is there an advantage in using the iterator approach? If not in this case, then when? And Why?  Bonus question: In for (size_t i=0; i<a.size(); ++i), is a.size() re-evaluated every time? Do I win anything by getting the size first?  const size_t size = a.size(); for (size_t i=0; i<size; ++i)   Does std::vector simply return the value of a member variable when I call vector::size() or does it do something more elaborate?

Take the following two lines of code:  for (int i = 0; i < some_vector.size(); i++) {     //do stuff }   And this:  for (some_iterator = some_vector.begin(); some_iterator != some_vector.end();     some_iterator++) {     //do stuff }   I'm told that the second way is preferred. Why exactly is this?


within the apache error.log I have the mssg: "su: must be run from a terminal" Usually, there are error IDs, the monitored IP and source of the error (php-page)  - all this is missing here.  If I check the apache access.log during the given time-window (the error-mssg before and that one after the entry "su: must be run from a terminal"), there is a hacking-approach:  PROPFIND /webdav/ HTTP/1.1" 403 0 "-" "WEBDAV Client" (the IP is already listed in the abuse IP database.list:  )  Now I wonder, if the "su: must be run from a terminal" is normal behaviour if the PROPFIND was rejected properly - or, if this a clear sign that there is a critical vulnerability. (I have never added/ activated/ used the webdav module for this server.)  I'd be happy if someone could explain/give further information, where/how this plain mssg "su: must be run from a terminal" is coming from/was generated by.

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


In return for being his personal assistant and replying to emails and stuff, a man said that  he'll pay me weekly.  He told me to send him a screenshot after emailing his clients.  He also sent me his identity card.   Another lady asked me to send her scratched steam gift cards and she'll pay me the money with an extra $100. All she asked for is my full name, email address, and bank name.  Are they scammers?

A stranger told me that he will give me an allowance of $ weekly. I know the saying "If it sounds too good to be true, then it is".   He told me that he would  email me his check and I would be able to deposit it via mobile banking. The only information he needs is my email, name on bank account, and bank name.   Is this too much information? Do you think this is a scam? I would definitely know if it was a scam if he asked for my log in but that is not what he wants.  Thank you for your time and answers!


I have recently installed Lubuntu on my acer aspire 4720z and wanted to switch back to windows but the main problem is that i cannot get the iso over the USB by rufus( as it is not recognising my pendrive, i have installed rufus-3.13.exe from the rufus website and ran it from the Lx terminal by the command - wine rufus-3.13.exe but it is not recognizing my USB) I tried to write my USB via an app ( i think it is disk) but when i start my system and tried to USB boot via the pendrive, it says that there is no operating system. PLZ HELP ME OUT. I am trying to install win 8.1 or 10 or 7 but plz get me out of Lubuntu............PLZZZZZZZZ

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.


Hi I've implemented a Binary search tree in java. It enters data fine. But it throws a Nullpointer exception when attempt to search. Please point where I am wrong. thanks in Advance...  class Node{ int data; Node leftChild; Node rightChild;   }  Follwing is my main method and both search and insert methods..  public class Main { Node root;  public static void main(String[] args) {     Main main=new Main();     main.insert(15);     main.insert(12);     main.insert(9);     main.search(12);  }  void insert(int data){     Node node=new Node();     node.data=data;      if(root==null){         root=node;         System.out.println("Root node created: "+root.data);      }else{         Node current=root;         Node parent=null;         while(true){             parent=current;               if(parent.data>data){                 current=parent.leftChild;                 if(current==null){                     current=node;                     System.out.println("Created node: "+current.data);                     break;                 }              }else{                 current=parent.rightChild;                 if(current==null){                     current=node;                     System.out.println("Created node: "+current.data);                     break;                 }             }             if(current==null){                 break;             }          }       }  }  Node search(int data){     Node current=root;     if(root==null){         System.out.println("Empty binary tree");     }else{         while(current.data!=data){             if(current.data>data){                 current=current.leftChild;             }else{                 current=current.rightChild;             }             if(current==null){                 break;             }         }         System.out.print("Data  item Found :"+current.data);     }     return current;  }   }

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 a script which has multiple functions, running in parallel which checks a file and updates it frequently. I dont want two functions to update the file at the same time and create an issue. So what will be the best way to have an atomic update. I have the following so far.  counter(){     a=$1     while true;do         if [ ! -e /tmp/counter.lock ];then             touch /tmp/counter.lock             curr_count=`cat /tmp/count.txt`             n_count=`echo "${curr_count}  + $a" | bc`             echo ${n_count} > /tmp/count.txt             rm -fv /tmp/counter.lock             break         fi         sleep 1      done }    I am not sure how to convert my function to use flock, since it uses file descriptor and it might create issue if I call this function multiple time(or I think so.)

What's a quick-and-dirty way to make sure that only one instance of a shell script is running at a given time?


Bit of a strange situation there. I compiled a static executable of BusyBox 1.32.1 for the ARM platform (32-bit) and strangely it runs without problems on both platforms. Look by yourself: root@smallbuntu /m/n/b/i/n/rootfs# readelf -h bin/busybox-initrd ELF Header:   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00    Class:                             ELF32   Data:                              2's complement, little endian   Version:                           1 (current)   OS/ABI:                            UNIX - System V   ABI Version:                       0   Type:                              EXEC (Executable file)   Machine:                           ARM   Version:                           0x1   Entry point address:               0x1f419   Start of program headers:          52 (bytes into file)   Start of section headers:          1482800 (bytes into file)   Flags:                             0x5000002, Version5 EABI, <unknown>   Size of this header:               52 (bytes)   Size of program headers:           32 (bytes)   Number of program headers:         6   Size of section headers:           40 (bytes)   Number of section headers:         27   Section header string table index: 26 root@smallbuntu /m/n/b/i/n/rootfs#   then: root@smallbuntu /m/n/b/i/n/rootfs# bin/busybox-initrd ls bin         home        media       proc        srv         var boot        kobo        mnt         root        sys dev         lib         modules     run         tmp etc         lost+found  opt         sbin        usr root@smallbuntu /m/n/b/i/n/rootfs# bin/busybox-initrd uname -a Linux smallbuntu 5.8.0-50-generic #56-Ubuntu SMP Mon Apr 12 17:18:36 UTC 2021 armv7l GNU/Linux root@smallbuntu /m/n/b/i/n/rootfs#   uname -a seems to return armv7l by the busybox binary. Here's the normal output: Linux smallbuntu 5.8.0-50-generic #56-Ubuntu SMP Mon Apr 12 17:18:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux  Any idea of what's going on?Thanks!

I'm learning C#, so I made a little C# program that says Hello, World!, then compiled it with mono-csc and ran it with mono:  $ mono-csc Hello.cs $ mono Hello.exe Hello, World!   I noticed that when I hit TAB in bash, Hello.exe was marked executable. Indeed, it runs by just a shell loading the filename!   Hello.exe is not an ELF file with a funny file extension:  $ readelf -a Hello.exe readelf: Error: Not an ELF file - it has the wrong magic bytes at the start $ xxd Hello.exe | head -n1 00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000  MZ..............   MZ means it's a Microsoft Windows statically linked executable. Drop it onto a Windows box, and it will (should) run.  I have wine installed, but wine, being a compatibility layer for Windows apps, takes about 5x as long to run Hello.exe as mono and executing it directly do, so it's not wine that runs it.  I'm assuming there's some mono kernel module installed with mono that intercepts the exec syscall/s, or catches binaries that begin with 4D 5A, but lsmod | grep mono and friends return an error.   What's going on here, and how does the kernel know that this executable is special?    Just for proof it's not my shell working magic, I used  (aka sh) to run it and it still runs natively.    Here's the program in full, since a commenter was curious:  using System;  class Hello {   /// <summary>   ///   The main entry point for the application   /// </summary>   [STAThread]   public static void Main(string[] args) {     System.Console.Write("Hello, World!\n");   } }


I have been playing around with compiling some binaries. It all started because I wanted ffmpeg instead of avconv, now I just can't stop compiling stuff. I must find another hobby !!  Anyway, I configure the build process to install to ~/bin, and I add ~/bin to my path.  My question is :  If I simply delete my binaries from ~/bin, is that the program 'uninstalled' or do you think there might be other stuff installed in other locations too ? Maybe shared stuff ?  (I know I can go and look but wanted to ask).

I used source code to build one package such as below:  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib --with-package-name="Myplugin" --with-package-origin="http://www.ubuntu.org/" --enable-gtk-doc --disable-static make make install   But unfortunately, i discovered that its the latest version, and has lot of bugs, so i need to remove it/uninstall it. But how can i do so? I tried make clean; make uninstall but still i see it exist:  # pkg-config --list-all | grep Myplugin myplugin-.... $ ls /usr/lib/myplugin/libXYZ.so exist....   How do you remove this now?


And, more generally, how can I change accessibility settings via the command line?  Worth pointing out that I'm pretty comfortable with bash already- coming from a systems administration / *nix background- but I just don't know which files to edit or tools to use.  To clarify, I am not asking , the resolution of which modifies a setting under Security and Privacy. What I want to do is change a setting directly under Accessibility. I'll grant the title of that question is misleadingly similar, but the content is entirely divorced from my intent.

I would like to grant accessibility permission to some apps on Mac using Terminal as per this intruction   which is the accessibility tab in System Preferences  Or this    I would like to do that using Terminal so I can setup to install apps (i.e: BetterSnapTool) for many Mac at the same time, given I have admin privilege and this should be applied only on Mavericks and Yosemite  Does anyone know how to do this?  Thanks


Proving $$\sum_{n=0}^\infty \binom {m+n}{n}^{-1}=\frac{m}{m-1}$$   I'm not quite sure what to do with the sum of terms that combinations appear in denominators. I tried to solve the problem via splitting items, but failed.  But when I happened to see the following formula $$ \int_0^1 x^n (1-x)^m\,dx= \frac{n!m!}{(n+m+1)!} $$ I got some idea as follows  \begin{align} \sum_{n=0}^\infty \binom{m+n}{n}^{-1} &= \sum_{n=0}^\infty \, (m+n+1)\int_0^1 x^n (1-x)^m\,dx \\ &= \int_0^1 \left( \sum_{n=0}^\infty (m+n+1)x^n \right) (1-x)^m \,dx \\ &= \int_0^1 \left( \frac{m+1}{1-x}+\frac{x}{(1-x)^2} \right) (1-x)^m \,dx \\ &= (m+1)\int_0^1 (1-x)^{m-1} \,dx + \int_0^1 x (1-x)^{m-2} \,dx \\ &= \frac{m}{m-1} \end{align}  I am looking forward to other methods or a more deep-going idea to solve this problem such as solving it via the property of gamma function, I guess. Thanks for your help in advance!

Do you have any idea to prove the following identity via a combinatorial (or algebraic) method?  $\sum_{n=r}^{n=\infty} {n \choose r}^{-1} = \frac{r}{r-1}$  This is  of the book Chen C.C., Koh K.M. Principles and techniques in combinatorics. The book does not give a solution, although it mentions: "see H. W. Gould, Combinatorial Identities, Morgantown, W.V. (1972), 18-19".  many thanks in advance, Shahram


This falls over on the first elseif. Basically I have a load of dropdowns and I'm trying to work out which filters to select based on if people have selected the dropdown items or not.    An unhandled exception of type 'System.NullReferenceException' occurred in    Based On   private void btnSearch_Click(object sender, EventArgs e)     {         if (ddCompany.SelectedItem.ToString() == null && ddStatus.SelectedItem.ToString() == null)         {             UpdateTicketsList("NO", "NO");         }         else if (ddCompany.SelectedItem.ToString() != null && ddStatus.SelectedItem.ToString() == null)         {             UpdateTicketsList(ddCompany.SelectedItem.ToString(), "NO");         }         else if (ddCompany.SelectedItem.ToString() == null && ddStatus.SelectedItem.ToString() != null)         {             UpdateTicketsList("NO", ddStatus.SelectedItem.ToString());         }     }


Here's a fun one.  I have an an application that runs under tomcat with servlet access. The underlying implementation uses a ThreadPoolExecutor to subdivide the tasks, at this point just an email distributor. I have been adding JUnit tests, slowly getting the code coverage as reported by cobertura to an almost acceptable level.  Some background on the JUnit testing in place:   In the @BeforeClass I am setting up the context for DB connection lookups that are valid in the test environment. In the Servlet test, I am using HttpUnit to acquire an InvocationContext and then an instance of the servlet. Then, I call the primary method in the servlet that does all of the work, and eventually calls out to a thread manager for the appropriate distribution method, and uses the ThreadPool defined earlier. The problem occurs in the spawned threads. The DB access from the servlet works just fine using the created context setup in the @BeforeClass. The Threads don't have access to that context, and fail to get DB Connection info, causing failures in the Thread code.   So, bottom line, anyone have an idea how to test the Thread code, that wants DB access? Or even an entirely new method of unit testing that would work with a multithreaded application that wants DB access.  Any additional details can be provided to a point. I hope I have provided enough information, that providing actual code won't be necessary.

I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield.  I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when two threads interact in a given manner?  This seems like a really key problem for programmers today, it would be useful to pool our knowledge on this one imho.


I am trying to parse an string from a log file in the format: 2011-06-27 10:29:56+0200  If I use datetime.datetime.strptime('%Y-%m-%d %H:%M:%S%z') I get ValueError("'z' is a bad directive in format '%Y-%m-%d %H:%M:%S%z'") thrown  How can I parse a date in this format?

Following on from my previous question, , I have now come across a problem regarding the timezone, and it turns out that it's not always going to be "+0200". So when strptime tries to parse it as such, it throws up an exception.  I thought about just chopping off the +0200 with [:-6] or whatever, but is there a real way to do this with strptime?  I am using Python 2.5.2 if it matters.  >>> from datetime import datetime >>> fmt = "%a, %d %b %Y %H:%M:%S +0200" >>> datetime.strptime("Tue, 22 Jul 2008 08:17:41 +0200", fmt) datetime.datetime(2008, 7, 22, 8, 17, 41) >>> datetime.strptime("Tue, 22 Jul 2008 08:17:41 +0300", fmt) Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "/usr/lib/python2.5/_strptime.py", line 330, in strptime     (data_string, format)) ValueError: time data did not match format:  data=Tue, 22 Jul 2008 08:17:41 +0300  fmt=%a, %d %b %Y %H:%M:%S +0200


We 'know' that $$\lim_{n\to\infty}\left(1+\frac 1n\right)^n=\sum_{n=0}^\infty\frac 1{n!}$$ To prove this, I have started with the inequality $$\left(1+\frac1n\right)^n=\sum_{k=0}^n\frac1{k!}\prod_{j=0}^{k-1}\frac{n-j}n\le\sum_{k=0}^n\frac1{k!}$$ Then I tried to find a strictly increasing sequence of natural numbers $a_n$ such that the following inequality holds for every $n$: $$\left(1+\frac1{a_n}\right)^{a_n}\ge\sum_{k=0}^n\frac 1{k!}$$ I have tried with $a_n=n+1$ and $a_n=2n$, but I couldn't prove it. In fact, I tried some terms with a calculator and it seems to be false for these particular sequences of natural numbers. Is this the way to prove the equality? If it is not, how? EDIT: I should have said this before, but exp and log functions are not already defined. So the answers to the 'duplicate' are useless to me.

I came across this when learning about sequences and series. No one proved it to me tho! Is there a link anywhere? Or would it be beyond what I know? (First term of analysis)


I created a text view dynamically , but the problem is that when I want to set the text size of this text view on a button click, I get:  error: null object reference.  the code:  //in Main class  TextView textview;   //creating the text view on button click Button mbutton1=(Button)findViewById(R.id.button1); mbutton1.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View view){  textview=new TextView(this);  //adding the view to the relativelayout RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams (ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT ); textview.setLayoutParams(params);  //making object for Relativelayout and add the view to activity RelativeLayout relativel=(RelativeLayout)findViewById(R.id.relativelayout); relative1.addView(textview); } });  //now here is the button which must set the size of this text view  Button mbutton2=(Button)findViewById(R.id.button2); mbutton2.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View view){ textview.setsize(20);  } }); //And the error is when I click button 2 it says null object reference.   Edit: This question was closed as duplicate of another but in the other question the answers were why (null object reference)error happens , I know the causes for the problem what I need is an answer on how to set a value for a non existing object in an activity.

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 was just using the "Search all Sites" feature (), and there seem to be several problems with the UI. (I'm using Ubuntu 16.02 + Firefox 64.0 at the moment, but it also fails in the same way on Windows 7 + Chrome 71.0.)  The options at the bottom don't work:   It seems to default to 30 results per page. If I select 50, then "next page", it reverts back to 30. If I "next page" a couple of times, and then select 50 again, it reverts back to page 1.   Obviously, these "state changes" are not being propagated correctly from page to page.  It all works correctly in a site-specific search (e.g., StackOverflow). I note that the style of the controls is different here, so it's probably a different set of code.  This expands on the existing question  (which doesn't have an answer) by pointing out that changing the page size also resets the page index. That one should probably be made a duplicate of this one.

The "items per page" stat is being remembered permanently (cross device, attached to our account, not via a cookie) in the search results of any site.  However, in the , this stat is being reset whenever searching again, choosing the items per page affects only that single search:        I assume this is because stackexachange.com is not attached to ordinary account behind the scenes, so can't use the same server side cache. This can be bypassed by using a different cache probably, or use the network profile if possible.  Can it be done/fixed?


I am intend to visit the United States from the United Kingdom for about 80 days under the Visa Waiver Program (I already have an ESTA approved). After this, I intend to fly to Canada to stay for 3-4 months and then return to the UK. I figured that proof of my intent to leave the United States before the 90 days granted by the VWP, and a further ticket from Canada to the UK would be sufficient proof of intent (as well as supporting documents like mortgage statements, bank statements, etc).  However, when going through the steps to book a flight through Kiwi.com, I found the following statement:     A return/onward ticket (or electronic ticket record) must be to a final destination country other than Canada, Mexico or contiguous (adjacent) countries or territories situated in or bordering the Caribbean Sea . If passenger holds proof of residence in, or is transiting the USA to such a country or territory, an onward/return ticket to that country or territory is accepted.   Passenger can make side trips to Canada, Mexico or Caribbean countries/islands, provided first entering the USA on a carrier participating in the VWP. No additional time is given (extension) based on the departure to contiguous (adjacent) territory .   Does this mean I would be required to provide proof of intent to leave the US for the United Kingdom within the 90 days granted by the VWP? Would my ticket from Canada to the UK several months after those 90 days have passed be sufficient evidence to prove my intent to not overstay in the United States? I've read a fair amount on the DoS website, etc. but this is the first time I have read a statement like this.

Is it possible to enter US on a one way ticket without any problem ? I am coming over to help a friend sail his boat from mainland US down to Caribbean.So am not sure exactly when I will be returning to UK and from where. I have a valid ESTA and am travelling on a UK passport. What supporting documents are customs likely to ask for ?


Leting $\delta:=\sqrt[3]{2}$, prove that $\mathbb{Z}[\delta]$ is the ring of integers of $\mathbb{Q}(\delta)$.   Here's what I've done: let $K:=\mathbb{Q}(\delta)$. Since $[K:\mathbb{Q}]=3$, then $1, \delta, \delta^2$ are $\mathbb{Q}$-linearly independent (in particular, they are $\mathbb{Z}$-independent). Since $1, \delta, \delta^2$ are integers of $K$, we have that $\mathbb{Z}[\delta]=<1, \delta, \delta^2>_{\mathbb{Z}}\subset\mathcal{O}_{K}$.   To prove $\supset$, I did the following: if $z=a+b\delta+c\delta^2$ is an integer of $K$, its minimal polynomial $p(x)=x^3+c_2x^2+c_1x+c_0$ lies in $\mathbb{Z}[x]$ and has roots $\sigma_1(z),\sigma_2(z)$ and $\sigma_3(z)$, where   \begin{align*}  \sigma_1 &:\delta\mapsto\delta\\ \sigma_2 &:\delta\mapsto\omega\delta\\ \sigma_3 &:\delta\mapsto\omega^2\delta \end{align*}  are the embeddings fixing $\mathbb{Q}$ and $\omega^3=1$. Using Viète's relations we get:  \begin{align*}   c_2&=-\sum_{i}\sigma_i(z)= -3a\\          c_1&= \sum_{i<j}\sigma_i(z)\sigma_j(z)=3a^2-6bc\\  c_0&= -\prod_{i}\sigma_i(z)=-(a^3+2b^3+4c^3-6abc) \end{align*}  which gives us restrictions for $a, b, c$, since $c_0, c_1, c_2\in\mathbb{Z}$. Since $\delta z$ and $\delta^2 z$ are also integers of $K$, we calculate its respective minimal polynomials and find new restrictions for $a, b, c$.   After a very tiresome case analysis, I could prove that $a, b, c\in\mathbb{Z}$, concluding the proof.   This solution was given as a hint by the professor, and seems to me not very natural and, above all, way too long. My question is: is there a more natural and/or shorter solution for this? Thanks!

This seems to be one of those tricky examples. I only know one proof which is quite complicated and follows by localizing $\mathbb{Z}[\sqrt[3]{2}]$ at different primes and then showing it's a DVR. Does anyone know any simple quick proof?


A is in a rocket with proper acceleration a0 = 3.00 × 108 m/s2 to the right. As far as I know speed of object is restricted by the speed of light but with dv=a.dt, the rocket will reach the speed of light with in miniute

I'm in a freshmen level physics class now, so I don't know much, but something I heard today intrigued me. My TA was talking about how at the research facility he worked at, they were able to accelerate some certain particle to "99.99% the speed of light". I said why not 100%, and I didn't quite understand his explanation, but he said it wasn't possible. This confused me. Since the speed of light is a finite number, why can we go so close to its speed but not quite?  Edit: I read all the answers, and I think I'm sort of understanding it. Another silly question though: If we are getting this particle to 99.99% the speed of light by giving it some sort of finite acceleration, and increasing it more and more, why cant we increase it just a little more? Sorry I know this is a silly question. I totally accept the fact we cant reach 100%, but I'm just trying to break it down. If we've gotten so close by giving it larger and larger acceleration every time, why cant we just supply it with more acceleration? And how much of a difference is there between 99.99% the speed of light, and the speed of light? (I'm not really sure if "difference" is a good word to use, but hopefully you get what I'm asking).


My initial question below appears to be unclear so I am rewording in more succinctly here. The pre-edit question remains below.  There exists two types of probability theory: 1-norm (classic stochastic theory) and 2-norm (quantum mechanics). 1-norm has been shown to emerge from the lack of information about a deterministic process (statistical mechanics). Have we proven that a 2-norm probability theory cannot possibly emerge from a lack of information about a deterministic process?  Pre-edit question:  From my understanding a ‘hidden variable theory’ is just saying that the current quantum theory is not a complete description of nature, and just like thermodynamics can be reduced to deterministic rules (statistical mechanics), the probabilistic nature of the wave function can be reduced to deterministic rules. Hidden variable theory simply says that it is possible traditional quantum theory is an emergent theory that results from lack of information about the specific state of this new 'hidden variable'.  One crucial difference to note here is that ‘probability’ in the quantum sense is very different than traditional probability. The probabilistic state evolves unitarily instead of stochastically and the traditional probability is recovered by squaring the wave function. This leads to interference and most of the oddities associated with quantum theory.  Scott Aaronson in his paper  reduces the possibility of hidden variable theory to whether we can map unitary to stochastic matrices in a way that has certain desirable properties. Isn’t this just proving that quantum theory cannot be explained with ‘traditional’ stochastic probability? Couldn’t there still be a way to reduce this ‘new’ type of probability down to deterministic rules with missing information (again just like statistical mechanics did for stochastic probability). Is stochastic probability the only possible probability theory that can result from a lack of information? If so, why?

I've always hit two big stumbling blocks in conceiving of the proof or disproof of  as being even valid idea, let alone an answerable question... I feel I must be misunderstanding some very fundamental things.   Quantum mechanics is deterministic, ignoring the bit where we take our complex number and fudge it into a probability. We use computers to make calculations to provide the predictions of quantum mechanics - how is this not itself a hidden variable theory?   From what I understand the famous Bell theorem and work around it doesn't disprove hidden variable theories, just one specific flavour of them, and even then I am not convinced. I feel like I must be missing something again, because this result seems to me in no way profound... although it certainly fits into the picture of the EPR 'paradox' and is a good demonstration of the validity of QM.  I guess the crux of my problem is that this 'area' really addresses wave function collapse and the problems it causes, but I don't see the need for some collapse mechanism to begin with... again I feel like I am missing something really fundamental.  Apologies if this is a bad question. I have had a look around and there are similar questions, but I don't feel that either of my points are addressed...


I am new in designing, i want to upload image in html page . I am using this code.  <form name="myWebForm" action="mailto:youremail@email.com" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="500" /> <input type="file" name="uploadField" /> </form>   my Question is:how we can upload an image in html OR browse an image?

I would like to upload a file asynchronously with jQuery.     $(document).ready(function () {     $("#uploadbutton").click(function () {         var filename = $("#file").val();          $.ajax({             type: "POST",             url: "addFile.do",             enctype: 'multipart/form-data',             data: {                 file: filename             },             success: function () {                 alert("Data Uploaded: ");             }         });     }); });  File <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="button" value="Upload"/>     Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?


My goal is to have a collection of various generic types which will be used to populate a drop down list. The end user will select an item from the list which will then make an API call and return data based on the custom type stored in the list. So I created an interface that my generic class will inherit from: using System.Type;  namespace A {     public interface ICustomCollection     {         int Index { get; set; }         string Name { get; set; }         string ResourceName { get; set; }         Type TType { get; }         Type YType { get; }     } }  Then the generic class which inherits from it: using System.Type;  namespace A {     public class CustomCollection<T, Y> : ICustomCollection         where T : ITType         where Y : IYType     {         public int Index { get; set; }         public string Name { get; set; }         public string ResourceName { get; set; }          public Type TType { get { return typeof(T); } }         public Type YType { get { return typeof(Y); } }     } }  Then, I instantiate the list when the component is initialized and PerformWork once the user selects an object from the drop down list: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Reflection; using Microsoft.JSInterop; using Microsoft.AspNetCore.Components;  namespace A {     public partial class DoWork : ApiBase     {         public List<ICustomCollection> Items { get; set; }         public ICustomCollection SelectedItem { get; set; }          protected override async Task OnInitializedAsync()         {             Items = new List<ICustomCollection>()             {                 new CustomCollection<ClassA, ClassB>()                 {                     Index = 1,                     Name = "Option 1",                     ResourceName = "url/for/api"                 }             };             await base.OnInitializedAsync();                      }          public async Task PerformWork()         {             //At this point, SelectedItem has been populated with the current ICustomCollection Item             var selectedT = SelectedItem.TType;             var selectedY = SelectedItem.YType;              //fails here with conversion error             return returnedData = await CallApiHelper((dynamic)selectedT, (dynamic)selectedY);         }          public async Task<string> CallApiHelper<T, Y>(T object1, Y object2)           where T : ITType           where Y : IYType         {             //base.CallApi implements the same generic type constraints as CallApiHelper             return await base.CallApi<T, Y>(SelectedItem.ResourceName);         }     } }  The error message I'm getting specifically is:  Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The type 'System.Reflection.TypeInfo' cannot be used as type parameter 'T' in the generic type or method 'CallApiHelper<T,Y>(T, Y)'. There is no implicit reference conversion from 'System.Reflection.TypeInfo' to 'ITType'.  which makes perfect sense. Is there a way to extract the underlying type and pass that instead?  I'm open to suggestions....

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


Regardless of the purpose, I wonder whether one can redefine $$ by \[ ... \]?

Is it possible to modify LaTeX so that good old $$...$$ behaves like \[...\] (and by this I mean that it should be synonymous to it).  If yes: Dear LaTeX3 developer, please integrate this into LaTeX3! (Not that I really believe you will actually do this.)  MWE (even if I don't really see its use in this case):  \documentclass{article}  \begin{document}  I've forgotten we're not in the plain \TeX\ world anymore: $$ x = 3\alpha^2 + \beta   = \int f\, d\mu. $$  \end{document}