I just made a clean install of Fedora 20 as a VM in VirtualBox. I set up the VM to use NAT as part of the network configuration in VirtualBox.  At first I could ping google.com, but could not browse using Firefox. And when I tried to execute yum update I got the following error:  Loaded plugins: langpacks, refresh-packagekit Error: Cannot retrieve metalink for repository: fedora/20/x86_64. Please verify its path and try again   Then I disabled IPv6 in the network settings, and I also disabled this option in Firefox. As a result I was able to browse using Firefox, but I still keep getting the error when doing yum update.  When I do URLGRABBER_DEBUG=1 yum check-update I get:  2013-12-20 11:33:35,612 attempt 1/10: https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=x86_64 2013-12-20 11:33:35,612 opening local file "/var/cache/yum/x86_64/20/fedora/metalink.xml.tmp" with mode wb * Adding handle: conn: 0x1c896d0 * Adding handle: send: 0 * Adding handle: recv: 0 * Curl_addHandleToPipeline: length: 1 * - Conn 9 (0x1c896d0) send_pipe: 1, recv_pipe: 0 * Could not resolve host: mirrors.fedoraproject.org * Closing connection 9 2013-12-20 11:33:45,169 exception: [Errno 14] curl#6 - "Could not resolve host: mirrors.fedoraproject.org" 2013-12-20 11:33:45,169 retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising Error: Cannot retrieve metalink for repository: fedora/20/x86_64. Please verify its path and try again   But when I do ping mirrors.fedoraproject.org I get:  ping mirrors.fedoraproject.org PING wildcard.fedoraproject.org (209.132.181.16) 56(84) bytes of data. 64 bytes from wildcard.fedoraproject.org (209.132.181.16): icmp_seq=1 ttl=63 time=104 ms 64 bytes from wildcard.fedoraproject.org (209.132.181.16): icmp_seq=2 ttl=63 time=115 ms 64 bytes from wildcard.fedoraproject.org (209.132.181.16): icmp_seq=3 ttl=63 time=135 ms   The result of nslookup mirrors.fedoraproject.org is:  Server:     192.168.0.1 Address:    192.168.0.1#53  Non-authoritative answer: mirrors.fedoraproject.org   canonical name = wildcard.fedoraproject.org. Name:   wildcard.fedoraproject.org Address: 209.132.181.16 Name:   wildcard.fedoraproject.org Address: 67.203.2.67 Name:   wildcard.fedoraproject.org Address: 213.175.193.206 Name:   wildcard.fedoraproject.org Address: 140.211.169.197 Name:   wildcard.fedoraproject.org Address: 152.19.134.146 Name:   wildcard.fedoraproject.org Address: 80.239.156.215 Name:   wildcard.fedoraproject.org Address: 66.35.62.166 Name:   wildcard.fedoraproject.org Address: 66.135.62.201 Name:   wildcard.fedoraproject.org Address: 85.236.55.6   I tried using the bridged adapter option in VirtualBox, but I got the same errors.   I followed the suggestion of enabling the DNS proxy in NAT mode, but the same problem persists (I can still browse in Firefox, but yum cannot resolve the host mirrors.fedoraproject.org). Now the ifconfig commands shows this:  p2p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 10.0.2.15  netmask 255.255.255.0  broadcast 0.0.0.0         inet6 fe80::a00:27ff:fea4:a4c6  prefixlen 64  scopeid 0x20<link>         ether 08:00:27:a4:a4:c6  txqueuelen 1000  (Ethernet)         RX packets 723  bytes 695639 (679.3 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 628  bytes 77437 (75.6 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0         device interrupt 19  base 0xd020    An the cat /etc/resolv.conf shows this:  nameserver 10.0.2.3   And finally, I tried "Using the host's resolver as a DNS proxy in NAT mode" and the issue was finally fixed.

I am running a fresh install of Linux Mint Nadia (14). I am following the instructions on Vagrant  but have gotten stuck on the . It seems the Vagrant box cannot connect outside and so I can't install anything using either Chef or Puppet.  In the basic Vagrant resolve.conf contains nameserver 10.0.2.3. But with that set I can't ping us.archive.ubuntu.com.  If I change it to 8.8.8.8 then I can ping us.archive.ubuntu.com but it does not stay set, and after a reboot it changes back to 10.0.2.3 - so provisioning fails again.  Ideally I would like for 10.0.2.3 to work on my setup. Failing that I would like a way to permanently change resolv.conf so that I can do provisioning.


I want to load a class that is in a jar.  I already tried to just load the class using this code:  URL dirUrl = jarFile.toURL(); URLClassLoader ucl = new URLClassLoader(new URL[] {dirUrl}, getClass().getClassLoader()); Class<?> clazz = ucl.loadClass(mainClass); ucl.close();   I get an exception that it couldn´t find the class:  java.lang.RuntimeException: java.lang.ClassNotFoundException: net.api.main         at net.al.Main.onEnable(Main.java:39) ~[?:?]         at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:741) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.Bukkit.reload(Bukkit.java:535) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [spigot.jar:git-Spigot-db6de12-18fbb24]         at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [spigot.jar:git-Spigot-db6de12-18fbb24]         at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [spigot.jar:git-Spigot-db6de12-18fbb24]         at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [spigot.jar:git-Spigot-db6de12-18fbb24]         at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-18fbb24]         at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]         at java.lang.Thread.run(Unknown Source) [?:1.8.0_211] Caused by: java.lang.ClassNotFoundException: net.api.main         at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_211]         at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_211]         at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_211]         at net.al.addon.AddonLoader.loadAddons(AddonLoader.java:129) ~[?:?]         at net.al.Main.onEnable(Main.java:36) ~[?:?]         ... 16 more

Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load JAR files dynamically. I'm told there's a way of doing it by writing your own ClassLoader, but that's a lot of work for something that should (in my mind at least) be as easy as calling a method with a JAR file as its argument.  Any suggestions for simple code that does this?


I know in Linux you have the LX terminal to install an unpack things. Is something like that included in Ubuntu? I an new to Ubuntu and I would like to learn how use it more efficiently.

Possible Duplicate:             I just got ubuntu running on my computer and now I am ready to write a program...but I can't figure out how to open a command terminal. I guess I don't know where to find which version I am running either. Any help would be appreciated. Thank you.


How to replace a word , special character present inside multiple files using windows command only. I have tried using multiple commands, but it doesn’t work.

I am writing a batch file script using Windows command-line environment and want to change each occurrence of some text in a file (ex. "FOO") with another (ex. "BAR"). What is the simplest way to do that? Any built in functions?


Find the series' sum: $\frac{3}{1.2.4} + \frac{4}{2.3.5} + \frac{5}{3.4.6}...$ I tried solving it by writing $3$ as $4-1$, $4$ as $5-1$ but it didn't help. I am still studying so I don't know how to solve it by decomposing it into partial fractions.Is there any other method to solve this? discussion

$\frac{3}{1⋅2⋅4}+\frac{4}{2⋅3⋅5}+ \frac{5}{3⋅4⋅6}+...\text{(upto n terms)}$  The general term seems to be $$T_r= \frac{r+2}{r(r+1)(r+3)}.$$  I see no way to telescope this because the factors of the denominator of the general term are not in arithmetic progression.  Do I have to use something else? Or am I missing some easy manipulation?


I just downloaded Ubuntu, to replace Windows 10, but cannot find how to install it, by running the usual .exe file (or its equivalent on Linux) needed to install a program. Looks also it was downloaded ... on my DVD drive, which seems odd, as normally, if there is no DVD, there is nothing on that drive.  Sorry if this seems a stupid question, I tried to find elsewhere before asking it.

I would like to see a full how-to guide on how to install Ubuntu.


I was writing an app, and for this piece of code(in the end of a method)  if (selectSdfDialog.ShowDialog() == DialogResult.OK) {     Sdf = selectSdfDialog.FileName;     var regex = new Regex("[VQ]\\d{11}");     Serial = regex.Match(selectSdfDialog.SafeFileName).ToString(); }   Resharper gave me a hint to invert the if statement, bringing it to this  if (selectSdfDialog.ShowDialog() != DialogResult.OK) return; Sdf = selectSdfDialog.FileName; var regex = new Regex("[VQ]\\d{11}"); Serial = regex.Match(selectSdfDialog.SafeFileName).ToString();   My question is, is this working faster or somehow better, and if yes, what is the difference for the compiler?

When I ran  on my code, for example:      if (some condition)     {         Some code...                 }   ReSharper gave me the above warning (Invert "if" statement to reduce nesting), and suggested the following correction:     if (!some condition) return;    Some code...   I would like to understand why that's better. I always thought that using "return" in the middle of a method problematic, somewhat like "goto".


So I'm creating roads for my game. When I create 90 degrees turns with the Spin tool, the road spin perfectly and everything, the only thing is that the texture gets stretched out, and I was wondering how I could fix it by saving time. I know how to fix it if I take 2 verticies and straighten them up and doing this with all the others, but I was wondering if I could save time by doing this.   Here is where I want to start the UV mapping :      Any short-cuts or anything I could use to do this fast and easy ?

How can I straighten ALL the vertical UV lines at once? Is there a hot keyshort cut? Or if I have to do them one by one .. is there at shortcut for that? Thank you!


In the following code, I want to swap two objects but the first method (swap1) which swap the object reference variables of the two objects doesn't work while the other method (swap2) which swaps the values of the objects' data fields x.radius & y.radius work properly so what's the problem with the first method? why when I swapped the two reference variables of the two objects, they didn't refer to each other?  public class Main {     public static void main(String [] args) {         TestCircle circle1 = new TestCircle(1);         TestCircle circle2 = new TestCircle(2);         swap2(circle1,circle2);         System.out.println("After swap2: circle1 = " +         circle1.radius + " circle2 = " + circle2.radius);      }      // false swap     public static void swap1(TestCircle x, TestCircle y){         TestCircle temp = x;         x = y;         y = temp;     }      // real swap     public static void swap2(TestCircle x, TestCircle y){         double temp = x.radius;         x.radius = y.radius;         y.radius = temp;     }  }  class TestCircle {     double radius;      TestCircle(double newRadius){     radius = newRadius;     } }

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


I updated Windows three weeks ago and since then I began having a high RAM % usage, even when there was no program on. Today I realised that this might be a memory leak.    How can I solve the problem?

I've had a memory leak issue with Windows 10 for about a year now, but I really want to fix this now as it is having a sizable impact on my work.  As you can see from the picture below, I have 8GB of RAM. 92% of it is in use, even though the applications don't exceed 1GB.  I upgraded from Windows 7 Pro 64-bit to Windows 10 last year.  Ask for more details, I don't know what else to provide. I'm at a loss as to what could be causing this.


How to typeset this equation?    Please help me.

I want to write a conditional expression such as the following.    What is the best way to express such conditional expressions in Latex?


I am using shortcut Ctrl+Alt+T for opening a new Terminal window. I am using one of the terminal very often (calculator and simple commands) and I want to set up another shortcut (like Ctrl+Alt+R or any other, I don't care) to switch to this specific terminal window (using gnome-terminal in Unity, Ubuntu 12.04).  Is this possible (and how)?

I tend to use the terminal a lot,  So I wondering if there is a way I can make Ctrl+Alt+T focus the existing terminal if there is one, otherwise create a new terminal?


I have been having to use the Xfce 4 Terminal because I want to have a see through background, and I couldn't get it working in the Gnome Terminal, but as there are some disadvantages of using the Xfce 4 Terminal over the Gnome one, I was wondering if there is in fact a way to make the Gnome Terminal transparent?  People have previously told me to go to the preferences section, then to the background tab, and change the transparency settings there, but I am unable to find the background section.    OS Information:  Description:    Ubuntu 15.04 Release:    15.04   Package Information:  gnome-terminal:   Installed: 3.14.2-0ubuntu3   Candidate: 3.14.2-0ubuntu3   Version table:  *** 3.14.2-0ubuntu3 0         500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages         100 /var/lib/dpkg/status

About 10 minutes ago I set up my basic Terminal app to be semi-transparent and was really happy with the result. Now, some updates ran and the whole "Background" tab is gone from Terminal settings. Was this option removed? If yes, why? Why would anyone do that?  I'm running gnome-terminal 3.10.2 from the Gnome3 ppa.


Hello I need to calculate the symmetric group of the tetrahedron but I don't know how to deal with this problem. I think that the answer is $S_4$ and  we have $|S_4| = 4! = 24 $ permutations So can you tell me what to do just write all the permutations and it's all?

Exercise :  Find the Symmetry Group of :   The Tetrahedron The Cube The sphere with radius $r=1$ on $\mathbb R^3$   Discussion :  I am having a hard time understanding and solving exercises like this on my Algebra and Applications course. For example, I know that the answer to the first question is $S_4$ through lectures but I do not know how to prove it and most questions online/here revolve around extended questions of these and not these. Sorry for not providing an attempt, but I am really trying to grasp on how to solve them and work on these questions. I would appreciate any help, hint or thorough solution/discussion to help me get how I work on these.


I would like to create a function that take a list and sum all number in the list. For instance, in the list ["a", 1.50, 2, u'week', 250, 12], the function will return the output 255.50 (1.50 + 2 +250 +12).  def sum(list):    sum = 0    for item in list:       if type(item) == 'a number'          sum += item    return sum   By what could I replace the line if type(item) == 'a number'?

What is the best possible way to check if a string can be represented as a number in Python?   The function I currently have right now is:  def is_number(s):     try:         float(s)         return True     except ValueError:         return False   Which, not only is ugly and slow, seems clunky. However I haven't found a better method because calling float in the main function is even worse.


The discovery of electric forces resultet in the discovery of the force mediated by the electric field $\vec{E}$ (this is $\vec{F} = e \vec{E}$) at first. But later, it was observed that charges also exert magnetic forces. My question is:  WHY electrically charged particles exert both electric forces and magnetic forces and not ONLY the electric force?  Lies the answer in gauge theory in quantum mechanics or are there other theories for the existence of both forces?

So my physics teacher assigned us an article about how special relativity causes magnetism in a wire with a current, even with the low drift velocities of electrons in a current.  It seemed that the basis of the article was that magnetism is just relativistic electricity, so I was wondering how a permanent magnet worked? It makes sense to me that a moving charged particle attracts unmoving particles of the opposite charge, but how do the orbits of electrons in a magnet cause it to have a magnetic field?


My laptop is a 64 bit machine, but I need to download a 32 bit version of the Ubuntu OS because my school has said that a particular program I need 'was made with the intention that the user will not be running it on a 64 bit version of the Ubuntu OS'. That is pretty much true because I have tried many ways to run it, and all my attempts have failed.  The problem is that after I have downloaded the client for the 32 bit version of Ubuntu (I'm sure it's the client for 32 bit because I have even redownloaded it) and installed it into my computer, the system settings in Ubuntu will say that I have the 64 bit of the OS installed. I check this by going to system settings > Details > OS type. My question is... how do I install a 32 bit version of the Ubuntu OS on a 64 bit window 7 machine?

I'm a completely new user of Linux and since my computer is not a good machine I wanted to install 32 bit OS, I downloaded ubuntu desktop for 32 bit but when I check in system settings under details it says my OS type is 64 bit, I downloaded it from the site  choose Ubuntu 12.04 LTS and set it as 32-bit (machines with less than 2GB RAM).


I have a string of different emails     ex: "email1@uy.com, email2@iu.it, email3@uu.edu"  etc, etc   I would like to formulate a Regex that creates the following output     ex: "email1,email2,email3"  etc, etc   How can I remove characters between an "@" and "," but leaving a "," and a Space  in C#  Thank you so much for the help!!

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


Will be traveling with my family of 4 to UK and Spain, although we have set up foreign currency cards in GBP and Euro, can we carry cash with us? If yes, how much and does it require some sort of declaration, etc.?

How much money can an Indian tourist carry to London. Is there a regulation by the Indian government or Uk Govt.


So, I sadly got a question ban in Stack Overflow, however, it is unclear to me why... I have read through everything that I could find in the Help Center. It seems to me that I have a permanent ban and am strongly and sadly considering closing my account as a result (which is quite a hassle). The only reason that I am posting this question, is because I got the ban the morning after getting up-votes for some of my questions. Am I being punished for getting irregular up-votes? If so, the system seems like it needs a bit of tweaking...  So, did I really do something wrong, and what should I do?

If you are reading this, you may have been affected by one of our post quality bans. If so, it is important that you  to understand what has happened and how to regain the permissions that you lost. While trying to ask a question, one could see:  We are no longer accepting questions from this account. See  to learn more.  Likewise, for answers:  We are no longer accepting answers from this account. See  to learn more.   Why am I getting this message? Are deleted posts taken into account too? Is a question/answer ban the same as a suspension? How do I avoid getting a question ban? How long do I have to wait before I can post again? What can I do to release the ban? How can I reactivate my account? Can I simply create a new account? I'll just ask somewhere else on the SE network, and they'll migrate my question to the correct site! Will a ban on one Stack Exchange site affect my standing on other sites in the network? Does this apply to meta sites too? My account is in good standing. Why am I still blocked?


What the difference between Creation Phase and Execution phase in hoisted variables and functions. also how Execution Context is working at this case in javascript console  Refer to this example :  b(); console.log(a);  var a = 'Hello World';  function b() {     console.log('Called b!'); }   Output:  Called b! undefined   How can you explain this scenario:   in function case it returns Called b!  in variable case it returns undefined

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?


I've heard that there is a command that gives me the ability to give myself a sword with Sharpness 32767 and Knockback 32767. How do I use commands to give myself said sword on a server that uses the Essentials mod?

I'm making a mini game (bomb squad) and the armor needs to be enchanted. I know that armor can be enchanted through command blocks and that is what I intend to do. I am wondering if it is possible to enchant armor twice in one command block or should I need multiple command blocks as I have done in the past?


I needed a feature in the latest version of a program (kicad) so I added the "live" PPA and successfully downloaded & upgraded. But I don't need the very latest all the time, and the upgrades are frequent and huge and take a long time to download on my rural broadband. Hence my question - I would like to keep the program and maybe upgrade occasionally, but not every time, I'm happy with what I've got for the time being.

Because of  I'd like to prevent apt-get upgrade and Update Manager from updating the "libgtk2.0-0" package.   How can this be achieved?


A user posts a blatantly off-topic political message on a Stack Exchange site, but expresses it in civilized language. For example, something like this might qualify:     Don't vote for [politician], he wants to raise your taxes (source) and supports interference with the X process to accomplish Y and otherwise has been found to be less than trustworthy in previous projects (source). Please vote instead for McStamper, he loves low taxes and lowering the cost of living for lower-income families (source).   The post is blatantly off-topic on the site and clearly doesn't belong anywhere near it. Is such a post considered red-flaggable as rude or abusive, or should it be handled as a regular off-topic post (vote to close if a question, flag as NAA or VLQ if an answer, downvote in either case, etc.)?  Obviously, a political rant that compares a certain politician with certain intimate parts of the body or with waste products, or that is otherwise offensive by its very nature is red-flaggable, but does "ordinary" political screed rise to that level, or is it more akin to a regular, non-red-flaggable post such as a programming question posted on Meta or a WiFi driver installation issue posted on Stack Overflow?  To be clear, I'm not asking whether such posts should be allowed to remain. I'm asking whether they are sufficiently bad that the red-flag process (six flags to delete, automatic 100 rep penalty, being fed into SpamRam) is called for in such cases.

When flagging, there are two special case options: spam and rude or abusive.   What is spam, and when should I flag content as such? What is considered offensive, rude or abusive content? How does the spam flag differ from the rude or abusive flag? What is the effect of these special flags? When are these flags removed?


Why does the following gives the line I am searching:    grep '<appointment-id internal:ref=1.2.3/>' test.xml   OUTPUT is <appointment-id internal:ref=1.2.3/>     While the following breaks it into 2 lines?    a=($(grep '<appointment-id internal:ref=1.2.3/>' test.xml))   for i in "${a[@]}"; do       echo "checking $i"        grep  -n "$i" delete.xml done       The output is:     checking <appointment-id checking internal:ref=1.2.3/>   The file is:    <note>       <to>Jim</to>       <from>John</from>       <heading>Reminder</heading>       <body>Some text</body>       <appointment-id internal:ref=1.2.3/>  </note>

Say I have this file:  hello world hello world   This program  #!/bin/bash  for i in $(cat $1); do     echo "tester: $i" done   outputs  tester: hello tester: world tester: hello tester: world   I'd like to have the for iterate over each line individually ignoring whitespaces though, i.e. the last two lines should be replaced by  tester: hello world   Using quotes for i in "$(cat $1)"; results in i being assigned the whole file at once. What should I change?


Can I make light dig a hole by increasing it's frequency? Can I relate force with wave using the equation $c=$ wavelength$\times$frequency?

I am something of a dilettante in physics, so please forgive me if the answer to this question is painfully obvious. The question is simple, can something that theoretically has no mass exert a force. I have been tossing around this and other similar questions in my head for a while now and have not really found any concrete answers to my inquiry. I am thinking about how light seems to be able to push objects but yet has no mass, however I expanded the question to be more encompassing in hopes of further learning.


I make an AJAX call and import the data to my html. Now I want to make an alert when I click a certain div.  In the past I always used .on() on elements after an AJAX call. This time its not working but AjaxComplete is working.  Any explination for this ?  NOT WORKING :  $( ".morec" ).on("click",function() { alert('test'); });   WORKING :  $(document).ajaxComplete(function(){ $( ".morec" ).click(function() { alert('test'); }); });

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


I'm trying to understand the SVM algorithm but not able to understand what weight vector and bias is ? Could anyone explain it in laymen terms.

How does a  work, and what differentiates it from other linear classifiers, such as the , , or ? *  (* I'm thinking in terms of the underlying motivations for the algorithm, optimisation strategies, generalisation capabilities, and run-time complexity)


I have been reading about this and am  finding a lot of questions similar to what I'm asking, but they also all have extra components and I just want a simple answer. I think I already know but I am new to DnD so please bear with me. I have a lvl 5 Assassin and I use two short swords.  Assassinate ability says "In addition, any hit you score against a creature that is surprised is a critical hit." Surprise condition is listed as "If you’re surprised, you can’t move or take an action on your first turn of the combat, and you can’t take a Reaction until that turn ends." I asked my DM if that meant that if I surprise an enemy, would both my main hand and offhand crit, with only my main hand getting sneak attack? His answer was basically, "to prevent overkill he is limiting the assassinate crit to only the attack action, and not the bonus action." So my main attack would trigger assassinate crit, but not my bonus action attack. I don't agree but I can't find any official proof otherwise. I know in the end it's his call but that seems like it really limits me, because the whole idea of an assassin is to jump them right off the bat and then go to normal fighting. I feel the RAW backs me up but I don't want to push it. How do I argue this? Should I argue this after he made a ruling? Am I even right? I love playing with them and don't want to push it, but I also want to take advantage of what seems like a major class feature.

Does the Rogue's Assassinate feature (auto-crit on surprised targets) allow for multiple crits if you make multiple attacks that round, either through two-weapon fighting or extra attacks gained through multiclassing?  As an example: my 3rd level Human (Variant, TWF feat) Rogue-Assassin rolls high on his stealth roll, and gets up behind his target.  With two daggers, he gets 2 attacks per round if he uses his bonus action as well.  Do both of these attacks qualify for Assasinate's auto-crit feature?  That is: would I do 2 criticals for       4d4+4d6+2*DEX damage   or a single critical and a non-critical for       3d4+4d6+2*DEX damage?   Additionally, if I gained the Extra Attack feature through multiclassing, would I get crits on all 3 of my attacks, or just the first one?


I sometimes see error messages saying     System Program Problem Detected   I would like to have this popup window giving me these error messages supressed or removed. Actually, ANY error/or message window after starting up the desktop. Is there any way to do this?  I have notifications turned off.

The system crash dialog is annoying me, how can I turn it off? I'd also like to know how to turn it back on just in case I need it to report a problem.


My understanding is that the system timezone is CST. Is this correct? When Day Light Saving time occurs does this change to CDT?

I have both Sales Cloud and Marketing Cloud connected and use data shared for a Journey when new records are created.  In my object that is triggered in the journey I have a Date/Time field which gets stored in SC in UTC, however in MC timezone settings are not stored in the field.  This means when using functions like SystemDateToLocalDate(@recordTimestamp) returns the wrong time as it thinks the original date is in CST (the system timezone instead of UTC).  Is this expected behavior?


I was wondering if it's at all possible to attach a document to an email that is sent as part of a workflow?  I've managed to create a workflow to email users to let them know when their phone is ready for collection but I was wondering if I could get a document attached to that email or if I'm dreaming too big?  Any help much appreciated.

I'm creating a custom list for a helpdesk app.  I want the user to fill out a form in sharepoint (2010) and add attachments from screenshots, etc.  The workflow should send an email to our helpdesk system with the files attached.  Using sharepoint designer, i can only say yes there is an attachment, but i can't seem to attach the file to the email.  Any suggestions?


I have a milling deck that uses . One of his abilities is:     Creatures you control have "{T}: Target player puts the top X cards of their library into their graveyard, where X is this creature's toughness."   Since that ability will effect all my creatures, does Phenax have to be played on the field or could he remain in the command zone and I still use that ability on my creatures?

has an ability that functions whilst in the command zone. As a newbie to the Commander format, that leaves me unclear about something:  Whilst a Commander is in their Command zone and remains there, what effect do they have on the game?   Are all of a Commander's abilities active? (e.g. ) Can they use their activated or mana abilities? (e.g. ) Can they do anything else (apart from being able to be cast)?   I suspect all their abilities are active and can be used, but I've been told only the ones that specifically mention being in the command zone (e.g. Oloro's ability) are active.


I am confused with something about String arrays. If I change the array in a method and access it within the method, it stays changed, but if I use the method to change it, then access it right after, it doesn't work.   public class ArrayTester{      public static void main(String[] args){             String[] names = {"Jim", "Gary", "Bob"};             printMe(names);             remove(1, names);             printMe(names);      }       printMe(String[] array){             for(String str : array){                 System.out.print(str + " ");              }             System.out.println();     }      remove(int pos, String[] array){             array2 = new String[array.length - 1];             for(int i = 0; i < pos; i++){                 array2[i] = array[i];             }             for(int i = pos; i < array2.length - 1; i++){                 array2[i] = array[i + 1];             }             array = array2;             //printMe(array); <-- works with printMe here, but not in the              //                    main method     }   }  I expect the result to look like "Jim Gary Bob" and then "Jim Bob" Unfortunately, I get "Jim Gary Bob" twice. However, if I put printMe in the remove method instead of in the main method, I get "Jim Gary Bob" and then "Jim Bob" I'm not sure why it is and I suspect it's got something to do with the way the array is stored, but I can't figure it out.

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?


LEt $A,B$ be sets. Prove that $A \subseteq B \iff P(A) \subseteq P(B) $.  Attempt:  First, take any element of $P(A)$, say $Y$, we know by definition that $Y \subseteq A$ and so $Y \subseteq B$ (given). Therefore, by definition $Y \in P(B)$. and we have the result.  Conversely, suppose $x \in A$, then $\{x\} \in P(A)$ and so $\{ x \} \in P(B)$. (Can we conclude that $x \in B$) ?

Note that $\mathcal{P}(x)$,$\mathcal{P}(y)$ are power sets.  My proof.$\left( \Rightarrow \right)$ Let $t\in x$. Then, $t\in y$. So, since $t\in x$, $t\in \mathcal{P}(x)$. Also, since $t\in \mathcal{P}(x)$, $t\in\mathcal{P}(y)$. Thus, $x\subseteq y \Rightarrow  \mathcal{P}(x)\subseteq\mathcal{P}(y)$.  $(\Leftarrow )$. Similar.  Can you check my proof?


I'm quite new to ConTeXt, and TeX in general and am hoping someone will be kind enough to explain the code in the  to me. I understand the basics, but I don't get why \setuptitle is different from \dosetuptitle, or what \v!<thing>, \c!<thing>, \??dt, etc. are. Thanks! Edit: I didn't quite do my research, ContextGarden does have  that covers my first question.

1st example:  \starttypescript [\s!serif] [paratype]   \definefontsynonym [ParatypeSerif-Regular] [\s!name:PTSerif-Regular] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-Italic] [\s!name:PTSerif-Italic] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-Bold] [\s!name:PTSerif-Bold] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-BoldItalic] [\s!name:PTSerif-BoldItalic] [\s!features=\s!default] \stoptypescript   2nd example:  \definefont[SerifS][\s!file:GenBkBasR at \smallfontsize]   Is \s! only related to fonts? Should I use it in my typescript files?


I am using Windows 7 32-bit on a Dell Vostro 1014 (Intel Core 2 Duo T6670 CPU) and now I want install a 64-bit version of Windows.  My questions:   How can I be sure that my laptop is compatible with 64-bit Windows 7? On the Dell website, I only see drivers for Windows 7 32-bit. Will Windows 7 64-bit supply its own drivers for my laptop, or will I be unable to use the 64-bit version due to the unavailability of 64-bit drivers from Dell? If I try to install 32-bit drivers on Windows 7 64-bit, will the 32-bit drivers work?

I know it's not possible to install a 32-bit driver in the traditional way, but I really cannot find a 64-bit driver for my memory card reader. Is there anyway I can somehow use this device with a 32-bit driver on a 64-bit Windows 7 installation?  I was thinking there might be a way to run a device in compatibility mode? Possibly even have a 32-bit device layer emulator or something?  I'm interested in any method to get this device up and running.


It can be anoying that jQuery event handlers always execute in the order they were bound. For example:  $('span').click(doStuff1); $('span').click(doStuff2);   clicking on the span will cause doStuff1() to fire, followed by doStuff2().  At the time I bind doStuff2(), I would like the option to bind it before doStuff1(), but there doesn't appear to be any easy way to do this.  I suppose most people would say, just write the code like this:  $('span').click(function (){     doStuff2();     doStuff1(); });   But this is just a simple example - in practise it is not always convienient to do that.  There are situations when you want to bind an event, and the object you are binding to already has events. And in this case you may simply want the new event to fire before any other existing events.  So what is the best way to achieve this in jQuery?

Lets say I have a web app which has a page that may contain 4 script blocks - the script I write may be found in one of those blocks, but I do not know which one, that is handled by the controller.   I bind some onclick events to a button, but I find that they sometimes execute in an order I did not expect.   Is there a way to ensure order, or how have you handled this problem in the past?


Is there any build in Equalizer in Ubuntu 18.04 or a third party program that works with this version best?

What I am looking for is to have system wide implementation of sound enhancements like bass boosts, echoes, Fidelity, Stereo enhancement and so on.  Audio Video players have their own equalizer but they enhance only the audio / video files they are playing.  So to enhance sounds playing such as: YouTube, Spotify, System Sound, etc. I need a enhancer software. Back in Windows, I used to use SRS HD audio lab to do the same.  P.S. I have a horrible Speaker set.


As the subject says.  We all know that we can validate the characters in an email address to validate if it is a 'legal' address depending on various standards.  Is it possible to send an email that will be received by the recipients server, but not actually delivered in order to identify if it is a live email address?  I'm currently writing some Access VBA to send out frequent emails to third parties and need to be able to identify before emails go out, that they are going to a live address.

I need to send hundreds of newsletters, but would like to check first if email exists on server. It's called  validation, at least I think so, based on my research on Internet.    There's several libraries that can do that, and also a page with open-source code in  (), but I have hard time reading ASP Classic, and it seems that it uses some third-party library...    Is there some code for SMTP validation in C#, and/or general explanation of how it works?


I understand that the derivative of a function $f$ at a point $x=x_{0}$ is defined as the limit $$f'(x_{0})=\lim_{\Delta x\rightarrow 0}\frac{f(x_{0}+\Delta x)-f(x_{0})}{\Delta x}$$ where $\Delta x$ is a small change in the argument $x$ as we "move" from $x=x_{0}$ to a neighbouring point $x=x_{0}+\Delta x$.  What confuses me is how to interpret its meaning correctly, that is, what does the derivative $f'(x_{0})$ actually describe?   On Wikipedia it says that "the derivative of a function quantifies the rate at which the value of the function changes as we change the input" (or words to that effect). However, the function has a particular constant value, $f(x_{0})$ at a given point $x=x_{0}$ so how can one meaningfully discuss the rate at which the value of the function is changing at that point?  Would it be correct to interpret the derivative of a function at a point as describing how "quickly" it's value changes as we move from that point to (infinitesimally close) neighbouring points? (As such in the example above, in moving from the point $x_{0}$ to $x_{0}+\Delta x$ the value of the function $f$ changes by an amount $f'(x_{0})\Delta x$ for infinitesimally small change $\Delta x$). Is it then simply that the value of the derivative at that point equals the slope of the tangent line to the the function (curve) at that point? (In general then, the derivative of a function is itself a function whose value at each point equals the slope of the tangent line to the curve at that point).

I am able to complete the action, however, I am not sure what it really means in calculus to differentiate. I'm just curious as to why I have to to do this.


Here is the code from page 2 in a TikZ-CD manual found . I loaded \usetikzlibrary{cd}, and I loaded quotes.  (Immediately preceding this example, it says "labels can be placed on an arrow by means of the quotes syntax.")  Why is the following code not compiling?  How do I add \psi to the other arrow?  \documentclass{amsart} \usepackage{tikz} \usetikzlibrary{calc,angles,shapes,positioning,intersections,quotes,decorations.markings} \usetikzlibrary{cd}   \begin{document}  \begin{tikzcd}  A \arrow[rd] \arrow[r, "\phi"] &B \\ &C  \end{tikzcd}  \end{document}

The cd package for tikz seems to be failing, or missing. I am using Kile in Ubuntu 10.4, and I installed all the tikz-related packages my package manager could find.  MWE:  \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{cd}   \begin{document}  bla  \end{document}


More often than not, I get more than one really good answer to a particular question that I have posted.  There is no way one can appreciate that more than by up-voting both answers, because we are only allowed to accept one answer, and I have already accepted another answer.     A way to accept more than one answer would be useful.

Often more than one person contributes to the community coming up with the final accepted answer to a question. However, it is only possible to accept a single answer. Restricting to one final answer does make sense for the sake of referencing that answer later, but in many cases that answer is the product of the input from several individuals. I would like to be able to decide how much of a bounty goes to different users, or some other mechanism to recognize the contribution of multiple users. Of course I could always upvote their previous answers, but this is really incorrect if their previous answers aren't the complete, final answer I've accepted.  What think you metaSOrs?


I am planning to buy a 38 inch 3840 x 1600 pixels ultra-wide monitor for my desktop computer. But sometimes I need to make Windows think the resolution of the monitor is 2560x1440 and make the display area to be a 2560x1440 pixel region on the physical monitor. In other words, instead of stretching the contents to the full 38-inch monitor screen, the areas beyond the 2560x1440 pixels display area should be black. I did see some answers about similar needs such as . My need is indeed similar, but I also need Windows to think there is only one monitor and its display resolution is 2560x1440. This is because I use proctor software, such as HonorLock, for exams, and such software insists that I use only a single monitor and will maximize the Chrome window to span the whole screen area. If I make the full 38-inch screen available, the exams would be unreadable.

Possible Duplicate:          I have a broken 20" LCD monitor which displays random pixels in the top 200 lines of pixels. I want to limit the display in such a way that when I maximize a window it will not be in the bad area and to limit the cursor position so it won't be in the bad area.


I have a line dataset. The dataset is vast and the lines are single features in the data layer. I would like to merge the lines which join at some point. How can I do this using ArcGIS 10.1?  For example: This is the layer, where line fragments are individual records:   Where separate lines meet other separate lines, I would like to join these to form 1 single line record:

I am trying to dissolve multiple lines for stream networks into individual features. The dataset contains many stream networks so a complete dissolve of the whole dataset wont do as I would like to only dissolve streams that are in the same network (illustrated in the pictures below).  I've tried using the Unsplit Line tool and the Dissolve tool in ArcGIS 10. The tool will only join two lines together, i.e. lines that share a common end point. This is illustrated in the screenshots below.    Here is the orignal dataset with the lines split, a single line feature is highlighted    This is the same feature highlighted after using the unsplit/dissolve tool. As you can see it has only joined two lines together rather than all of the lines that are touching.  The features in the same network do not have a common attribute either.


Let $d>0$ be a number. Is there a function $f: \mathbb{R} \to \mathbb{R}$ such that $f$ is not Riemann integrable on the interval $[a-d, a+d]$ if $f$ is continuous at $x = a$?

If we have a real valued function $f$ continuous at some point $a$, is it necessarily true that $f$ is Riemann integrable on the interval $[a - \delta, a + \delta]$ if a $\delta > 0$ exists?


On my company laptop, I can activate the VPN connexion, but it's slow, and it will redirect all my traffic, including the web browser.   I'd like to be able to use the VPN only to SSH into the company's server. And I'd like my other traffic (internet browsing) not to use the VPN.  I think this can be achieved using the Windows Firewall, but I have no idea how.  The VPN client is Pulse Secure, and it's managed by the company. I can't edit its configuration, enable or disable split tunneling, or anything. I can only configure the firewall or some other rule to try and bypass it. I can't use a virtual machine to connect to the VPN and SSH from the VM. But maybe this leads to an idea for a solution: I noticed that two network adapters show up, one for my Wifi connexion and one for the VPN adapter. Is there a way to say "never use the VPN adapter, unless for this specific VM"?  This question was marked as a duplicate of , but this other question does not explain how I can modify the proper settings in Windows directly, and I don't even know what these settings are.

I have two network cards. If I connect to a network using VPN then to access other websites I have to pass through a proxy server.  Is it possible to use my other network card to connect to the Internet directly without passing through the proxy?


I wish to know the difference between these words. I only know few examples of them being used in speech for now: Mandatory circumcision and Obligatory military service. In my native language, we use same word in both cases so I can't seem to be able to tell the diffrence.

As a non-native speaker, I wonder what the rules are for preferring one of "mandatory", "obligatory" or "compulsory" over the others.  The  yields examples such as these:  Mandatory: 4865 cases   mandatory safety nets around trampolines mandatory health care reform mandatory sentence for first-degree murder Unemployment sent me a letter, said this was a mandatory class. To stave off matting, daily brushing with a paddle brush is mandatory. He believes he can fill the role of rangy wing scorer that seems almost mandatory for championship teams. "Self-deprecation is mandatory here", he said.   Compulsory: 1060 cases   compulsory health insurance states that prohibit compulsory unionism compulsory celibacy for the clergy added to the school curriculum as a compulsory second language U.S. imperialism can be thought of as a system of compulsory heterosexuality My landlord and mother made my weekly visits to the center compulsory if I was to continue running my business rent free from her basement.   Obligatory: 808 cases   the obligatory happy ending when the obligatory compliments were out of the way I would hang up on my father after the obligatory five minutes the laptop computer has become nearly obligatory on campus   "Mandatory" is presumably related to "mandate" and used when it's a matter of law or regulation.  "Obligatory" is presumably related to "obligation" and used when it's a matter of moral, social or other obligation rather than law. (Like "the obligatory happy ending".)  "Compulsory" seems to mean that you are forced to do something, but the forcing mechanism is unspecified?  Is this approximately correct, and are there other rules of thumb for when to use which term?  There seems to be some cases where the terms are interchangeable: "Mandatory health insurance" and "compulsory health insurance" would be equally acceptable, wouldn't it?   Would "school curriculum compulsory second language" read the same if we substitute "mandatory" or "obligatory"?


I am trying assignment and I am unable to think about this problem. Can someone please help.      Question is ->   prove that $ (n-1)^2  $  divides $ n^k -1$ iff (n-1) divides k.    I shall be really grateful.

How do you prove this?  $$\left(n-1\right)^2\mid\left(n^k-1\right)\Longleftrightarrow\left(n-1\right)\mid k$$


I was once critiqued for using a "wrong" test because the test I chose didn't actually prove causation. I admit that I'm not a statistician. My education is very incomplete. What statistical tests actually PROVE causation? I thought there was no way to use statistics to prove causation. I invite correction if this is erroneous.

In his 1984 paper , Paul Holland raised one of the most fundamental questions in statistics:     What can a statistical model say about   causation?   This led to his motto:     NO CAUSATION WITHOUT MANIPULATION   which emphasized the importance of restrictions around experiments that consider causation.  Andrew Gelman makes :     "To find out what happens when you change something, it is necessary to change it."...There are things you learn from perturbing a system that you'll never find out from any amount of passive observation.   His ideas are summarized in .  What considerations should be made when making a causal inference from a statistical model?


If $f$ a is a function and $A$ is a set, what could the notation  $$f|_A$$  mean? Is it perhaps "restricted to set $A$"?

If $F$ is a function and $U$ is a set, then what does $F|U$ mean?   In , the Inverse Function Theorem, the notation is used  Also, the file in stating the Lemma 2.14 states that $A \in U$, what does this mean? A set is an element of another set? What is $A$?  EDIT: Could someone kindly explain to me what is going on in Lemma 2.16. How does $\delta$ come into play? I dont see the role in the lemma. I also don't see why this proves one-to-one


Can I use Desktop version of Ubuntu linux in my office environment, I do not need any extended support for my desktops.

I'm really concerned because a need to know if Ubuntu is totally free for a company. I mean, if I use a private software, I have to pay that license package, but Have I to pay for use Ubuntu? Have I to get a license?


Is it possible to use \addfontfeature for specific characters? Something like this MWE in order to get every e of the document with double size:  \usepackage{fontspec} \usepackage{hyperref}  \setmainfont{Latin Modern} \setmainfont{Latin Modern}[Scale=2.0, range = {e}]  \begin{document}  Test   \end{document}

Suppose that I have the following XeLaTeX document:  \documentclass{article} \usepackage{fontspec} \setmainfont{Arial} \begin{document} Proin quis (tortor) orci. Etiam at risus et $(a + b)x$. \end{document}   Is there a way to globally set, for example, the font Georgia for just the parentheses?  A similar thing could be done in the math mode with unicode-math. For example,  \documentclass{article} \usepackage{fontspec} \usepackage{unicode-math} \setmathfont[range="0028]{Georgia} \setmainfont{Arial} \begin{document} Proin quis (tortor) orci. Etiam at risus et $(a + b)x$. \end{document}     Possibly related:


The goal: Install a regular Ubuntu Mate system on an USB stick.  What I've done so far:  1) Using an Ubuntu Mate installation USB stick. Selecting another USB stick as target using the default software provided for that, named Ubiquity. Result: Several attempts made, doesn't work. At least the final step - installing grub - fails.  2) Using a freshly installed Ubuntu Mate. Selecting a USB stick as target using the software Ubiquity that comes along with the installation. First: The software titles to install "Kubuntu" not "Ubuntu Mate". Second: It tries to unmount system partitions - the one the current system is using. Result: Doesn't work. Hangs at least after determining the current time over a network time server. The GUI just hangs, no recovery of the application possible.  So could anyone please tell me how to install a regular (not an installation) Ubuntu Mate on an USB stick? My goal is to run Ubuntu from that USB stick later.

If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about.   I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install.  To do this, I need to install the nVidia drivers first (sigh).  To do this, I need changes to persist a reboot.  To do this, I need to really install Ubuntu on a USB key.  How do you do that?    What I tried   I tried to make a USB key from , then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself. I tried, from my installed copy of Ubuntu:  sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso   ...but the installer didn't detect the disk properly.


I am trying to achieve ^ over any letter in math formula. In normal text, it works with \^letter. However in my case, I am using      \begin{align*}     \mathcal{L} = \frac{1}{n}\sum_{i=1}^{n}(y^{i}-\^{y}^{(i)})^{2}     \end{align*}   which outputs nothing on the place where y with ^ should be. What is a workaround for this or how can I achieve it?  Thanks for help.

I need to display the symbol '^'  d <- dist(fascores, method = "euclidean")^2   How do I do that?


When the onLoad function is called this code runs. The timeout is set to 2 minutes but the server always returns an error after 10 seconds despite the timeout field. How can I set the timeout to be longer?      sforce.connection.sessionId = "{!$Api.Session_ID}"; sforce.connection.remoteFunction({     url : '{!endpointUrl}',     requestHeaders: {         "Content-Type":"text/xml",     },     requestData: xmlBody ,     method: "POST",     onSuccess : function(response) {         var parser = new DOMParser();         var xmlDoc = parser.parseFromString(response,"text/xml");         var pdf = xmlDoc.getElementsByTagName("Contents")[0].childNodes[0].nodeValue;         document.getElementById("PdfObject").src = "data:application/pdf;base64," + pdf;     },     onFailure : function(response) {         alert("There was a problem. Please try refreshing the page or try again at another time. " + response);     },     async:true,     timeout:120000 });

CPU time out limit was being hit while processing child records on the inline opportunity visualforce page, to handle this i wrote a remoteActionFunction on the page that invokes controller method that's taking long to process and when i get CPU LIMIT exception in the result, i am invoking javascript call back function that invokes a action function which handles the same code asynchronously(@future).  Question: by setting the timeout (Visualforce.remoting.timeout = 120000;) can't we overcome CPU TIME out limit of 10,000 ms.


I want to know if there are any tricks or shortcuts to write the factorial of a large number, like $20!,$ as the product of its prime factors.  For example, $5!= 5 \times 3 \times 2^3$

How does one find the highest power of a prime $p$ that divides $N!$ and other related products?  Related question: How many zeros are there at the end of $N!$?    This is being done to reduce abstract duplicates. See   and  for more details.


A reddit comment claimed that you would require $e$ random numbers between $0$ and $1$ to add up to $1$. So I wrote a python program to verify this. Conducted the experiment with 100 thousand times 200 times. The Standard deviation of the results was $0.00271225$ ( from $e$, not from their mean ).  I Have two questions, first, while conducting the experiment, the result was undoubtedly over 1 most of the times. What should I do to the number of random number required in these cases. The above $SD$ does NOT take in account those excess over 1. It treats them as if the total was $ = 1$  Second, how to prove this?  Here's the program if you can understand Python    (Sorry, cant post image directly)

Consider $N=\min\{n: S_n>1\}$, where $S_n=X_1+\cdots+X_n$ and $(X_i)_{i=1}^\infty$ is i.i.d. uniform on $(0,1)$. So, $N$ is the first time that $(S_n)_{n=1}^\infty$ crosses $1$. I'd like to calculate $E(N)$. To this end I'd like to calculate $\Pr(N\gt k)=\Pr(S_k\lt 1)$.  Is there a way to actually do this for any arbitrary $k$? I mean, certainly there is as I know about the distribution of $S_n$ but the formula is just formidable when you move with $k$ toward $\infty$ and even though tractable with a computer, I don't think it's tractable without it.  Is there maybe a better way to calculate the expectation? Thanks for any help.


I am using Windows 8.1  and Ubuntu 13.10 as in dual boot. I have changed my disk size using disk management. accidentally I delete Ubuntu partition at all. Once I restarted the system, I am getting message 》》 error: no such partition. entering rescue mode. . . Does anybody know how to fix this ?

I was trying to resize my EXT4 partition and something went wrong. I lost it. The space in once consumed is now being represented as Unallocated. How do I recover the partition?


Let $f$ be a twice differentiable function such that $f(0)=0$ and $f(1)=1$. Also, $f'(0)=f'(1)=0$. Prove that $f''(x)>4$ for some $x \in (0,1)$.  Any help would be appreciated.  My initial attempts were using Lagrange's Mean Value Theorem first between $f(0)$ and $f(1)$ to show that $f'(t)=1$ for some $t$ in $(0,1)$.  Now applying LMV between $f'(t)$ and $f'(0)$, and $f'(t)$ and $f'(1)$ I could prove it if t lies in either $(0,1/4]$ or in $[3/4,1)$. Don't really know where to go next.


If we consider a simple dc circuit with just a resistor, we notice that V is constant and so is the length through which current is flowing, hence the electric field is constant. So why does drift velocity also remain constant shouldn't it be increasing linearly?

I have seen in several textbooks that say that when we connect a conductor with a battery then electrons start moving (drifting) in the battery in random up and down motion in the opposite direction of the applied electric field, the average velocity of electrons during this motion is then said to be the drift velocity , but it is also claimed that this drift velocity is constant.   Why is it so? If a constant electric field is present then why wouldn't the drift velocity just increase?


I'm trying to write a quick bash function that populates a README.md with a $1\n followed by underscores the length of $1.  The code I found in other stackexchange questions showed that to print a character <n> times, use  printf '=%.0s' {1..<n>}   and indeed, this works (obviously replacing <n> with a number).  To create my README.md, I thought the function would look something like this:  make_readme() {     echo "$1 $(printf '=%.0s' {1..${#1}})" > README.md }  make_readme "Some project"   This, however, produces a file with this text:  Some project =   As far as I can tell, ${#1} within the $(...) is being replaced with the empty string.  My guess is that command substitutions get their own argument scopes, and since there are no arguments passed to the substitution, $1 is being replaced with nothing.  I did finally finagle a couple workarounds:  make_readme() {     underline="printf '=%.0s' {1..${#1}}"     echo "$1 $(eval "$underline")" > README.md }   or  make_readme() {     echo "$1" > README.md     printf '=%.0s' {1..${#1}} >> README.md }   but it seems like there should be a way to do this in one line.

I want to use $var in a shell brace expansion with a range, in bash. Simply putting {$var1..$var2} doesn't work, so I went "lateral"...   The following works, but it's a bit kludgey.    # remove the split files echo rm foo.{$ext0..$extN} rm-segments > rm-segments source rm-segments   Is there a more "normal" way?


I noticed that the top point of the reputation graph is not showing the current reputation as expected. I think this happened after I have reported  some suspicious ratings and I have received some user removed messages and a drop on the reputation as well. But there is about 400 difference and I can't see what it is.  I tried to force it recalculate my reputation by visiting the/reputation page but didn't succeed.  Edit: after investigating on reputation history, the only reason that could cause this is the bounty awarded by a deleted user.

On Stack Overflow, when I look on my account it currently shows 1,040 reputation. However the graph shows 100 more reputation, sitting at 1,140.  Is there some sort of bug or error happening to cause this? How can I fix this?


Let $a$ and $b$ be rational numbers. Show that $\mathbb{Q}(\sqrt{a}, \sqrt{b}) = \mathbb{Q}(\sqrt{a}+ \sqrt{b})$.  I think this question might have been asked before, but Google and the stackexchange search don't show anything.

Show that if $\sqrt{a}+\sqrt{b}\neq 0$, then   $\mathbb{Q}(\sqrt{a}+\sqrt{b}) = \mathbb{Q}(\sqrt{a},\sqrt{b}),  \forall a,b\in\mathbb{Q}$   It has something to do with $\sqrt{a} = -\sqrt{b}\implies a^2 = b^2$  The inclusion $\mathbb{Q}(\sqrt{a}+\sqrt{b})\subseteq \mathbb{Q}(\sqrt{a},\sqrt{b})$ is obvious  Now take $x\in \mathbb{Q}(\sqrt{a},\sqrt{b})$, that is: $x = c + d\sqrt{a} + e\sqrt{b} + f\sqrt{ab}$. I need to show that this is in $\mathbb{Q}(\sqrt{a}+\sqrt{b})$, that is, $x = g + h\sqrt{a} + i\sqrt{b}$, but I can't get that $\sqrt{ab}$ removed


I have the following code:  public class Main {      static void swap (Integer x, Integer y) {         Integer t = x;         x = y;         y = t;     }      public static void main(String[] args) {        Integer a = 1;        Integer b = 2;        swap(a, b);        System.out.println("a=" + a + " b=" + b);     }  }   I expect it to print a=2 b=1, but it prints the opposite. So obviously the swap method doesn't swap a and b values. Why?

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


I feel intimidated in learning TikZ. I was wondering if there are some nice materials (or just your replies) at different level:   for providing big picture, which is important to beginners to not lose direction during learning. for comprehensive reference.   Examples are important, but only examples are not always clear for understanding the big picture and organization.


I have written a loop to iterate all .out c binary file and copy their outputs into a text file (the output for every binary file is just a one line hash value, one line output for one program). Here is my code so far:  for j in {1..10} do     ./gcc-$j.out >> gcc-result.txt done   Unfortunately, some binary files have some unknown issues and cannot be correctly executed (they got stuck and cannot proceed to the next program).  I am not going to fix those c code but I want my bash to automatically jump to executing the next program within a given timeout (say 10 secs), and also write "0" to the gcc-result.txt.  Thanks in advance if you have idea to solve this issue.

I want to start a process from a shell script, allow it to interact with the user (so I cannot just background it, grab the PID, launch sleep followed by sanity checks and kill), but if it is still running after a set period of time (say, two minutes), then and only then do I want to kill it.  The intention is to simply implement a wallclock-run-time timeout for a program that doesn't have that capability built in.  Is there a way to do this, preferably from a bash shell script?


can a real function $f$ on $[0,1]\cap\mathbb{Q}$ be differentiable?  if so, and if the derivative of $f$ is zero, then is $f$ is a constant function?

Let $f$ be a differentiable function on $\mathbb{R}$ such that  $$f'(x)=0,\forall x\in \mathbb Q.$$  Prove or disprove that  $$f(x)=c$$  for some constant $c$. I've heard this problem is true, but I'm not sure. Can you prove it or provide a counterexample?  Auxiliary question: I wonder the converse of it, if $f′=0$ for all irrational, can we say that $f$ is constant?


I am a new to python programming. I've followed the "Learn python the hard way" book but that is based on python 2x.   def print_one_line(line_number,f):     print(line_number,f.readline())   In this function every time it prints A line and a new line.  1 gdfgty  2 yrty  3 l   I read the documentary that if i put a , (comma) after readline() then it won't print a new \n.  Here is the documentary:      Why are there empty lines between the lines in the file? The   readline() function returns the \n that's in the file at the end of   that line. This means that print's \n is being added to the one   already returned by readline() fuction. To change this behavior simply add a ,   (comma) at the end of print so that it doesn't print its own .   When I run the file with python 2x then it is OK, but when I do it in python 3x then the newline is printed. How to avoid that newline in python 3x?

I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h>  int main() {     int i;     for (i=0; i<10; i++) printf(".");     return 0; }  Output: ..........  In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout.


I have a wordpress site and having 50k visits a day I am currently using a dedicated server but I feel the site is quite slow and sometimes reach a downtime when traffic spike up. I am looking to amazon or something similar, just wandering if they are better and cheaper than cPanel

This is a "catch-all" question designed to serve as an answer for all questions about choosing web hosting.  Pro Webmasters no longer accepts new questions about how to choose hosting.  All future questions pertaining to finding web hosting should be closed as a duplicate of this question. For more information about this policy please see .    How to find web hosting that meets my requirements?  What we're looking for in answers to this question are the basics about web hosting:   What is web hosting? What is the difference between shared, VPS, and dedicated hosting? How does a content delivery network relate to web hosting? Anything else you feel is helpful in finding a web host.   What we do not want is:   Endorsements or recommendations for specific web hosts We do not want your experience or other subjective information (just the facts please)


I currently am using the following program for encrypting files using AES:  #include <openssl/aes.h>  void encrypt(FILE *ifp, FILE *ofp){   int bytes_read, bytes_written;   unsigned char indata[AES_BLOCK_SIZE];   unsigned char outdata[AES_BLOCK_SIZE];    /* ckey and ivec are the two 128-bits keys necesary to      en- and recrypt your data. Note that ckey can be      192 or 256 bits as well */   unsigned char ckey[] =  "thiskeyisverybad";   unsigned char ivec[] = "dontusethisinput";    /* data structure that contains the key itself */   AES_KEY key;    /* set the encryption key */   AES_set_encrypt_key(ckey, 128, &key);    /* set where on the 128 bit encrypted block to begin encryption*/   int num = 0;    while (1) {     bytes_read = fread(indata, 1, AES_BLOCK_SIZE, ifp);      AES_cfb128_encrypt(indata, outdata, bytes_read, &key, ivec, &num,            AES_ENCRYPT);      bytes_written = fwrite(outdata, 1, bytes_read, ofp);     if (bytes_read < AES_BLOCK_SIZE)   break;   } }   However, how can I make this program encrypt all the files in the same folder as the running program itself, instead of taking a file as input?

How can I determine the list of files in a directory from inside my C or C++ code?  I'm not allowed to execute the ls command and parse the results from within my program.


Suddenly I deleted my NTFS partition from the Disk in Ubuntu and later I created a new partition of the same name from the one I deleted before.  Now I have some files in there I'm missing.   I want to retrieve my data before formatting this partition. What can I do to achieve this. I tested Testdisk, but it won't help.

About two weeks ago I had a problem with my PC that my brother wrote a question about at .  I still haven't solved the problem, so my PC is unusable now.  Now I think that it would be simpler to re-install both Win7 & Ubuntu than repair them, but there're some data on their partitions. I want to recover this data.  These partitions are not mountable for some reason. I don't know why.  sudo fdisk -l about the problematic partitions:     Device    Boot      Start         End      Blocks   Id  System /dev/sda1            2048     147912703    73955328   83 Linux /dev/sdb2            206848   174079999    86936576    7  HPFS/NTFS/exFAT   And in GParted:      And the error of the mount command:  Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   And the exact same message for /dev/sda1  How can I recover my data from those HDDs?  EDIT     I have tried to specify the type of the drive:  $ sudo mount -t ext4 /dev/sda1 /olddisk mount: wrong fs type, bad option, bad superblock on /dev/sda1,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so $ sudo mount -t ntfs /dev/sdb2 /olddisk NTFS signature is missing. Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   EDIT     sudo ntfsfix /dev/sdb2 returns:  Mounting volume... NTFS signature is missing. FAILED Attempting to correct errors... NTFS signature is missing. FAILED Failed to startup volume: Invalid argument NTFS signature is missing. Trying the alternate boot sector Unrecoverable error Volume is corrupt. You should run chkdsk.


I was just able to access the new Joomla private beta, but I never committed to the proposal (though I did followed it).  Here's my  showing I never committed, and here's my .  The steps I used to gain access were something like this. I can't remember exactly, and there are no other private betas to test the process on.   Visit the  Click on the  link in the message/alert banner at the top. The meta and all of it's questions were visible without signing up. Do something (can't remember exactly) to get to the signup page for the meta. Switch to the login tab. Log in with my existing Stack Exchange account. Watch as I am redirected to the Joomla SE home page and can view everything. ????? Profit   I confirmed that I was able to vote and make comments, since I immediately received an association bonus. It was my understanding that private betas were only to be accessible by those who committed, but until this is fixed, everyone enjoy unauthorized access to private betas.  Oh, don't feel that I'm asking for my ill-gotten Joomla SE account to be deleted. I'd love to be the only participant in the private beta that didn't commit.

According to Area51,  is still in private beta. But yet I just signed up on it  (already deleted the profile now) despite I didn't commit to the proposal or recieve any mail.  Why did this happen?


Please read this first:    This is what I am attemptng here.  I used the first method from this site to define a template class in a cpp file:    It looks like this:  b.h :  #ifndef B_H_ #define B_H_ class B   { public:     B(); }; #endif   a.h :  #ifndef A_H_ #define A_H_ template<class T> class A   { public:     A();     int get();  private:     int val; }; #endif   a.cpp  #include "a.h"  template <class T> A<T>::A() { }  template <class T> int A<T>::get() {     return 42; }  // No need to call this TemporaryFunction() function, // it's just to avoid link error. void TemporaryFunction () {     TestTemp<B> TempObj; }   main.cpp  #include "a.h" int main(int argc, char** argv){         A<B> ab;     ab.get(); }   I have to change get to virtual or I get:     undefined reference to `A::get()'   I don't understand this. This is just a sample of the real code (that is too large). If it does not reproduce, I will provide more details tomorrow.   gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


as you can see I have opened node editor panel and I also clicked new but I can't see nodes

I'm still learning, but I'm trying to follow a tutorial to apply texture to a model. I only want to apply the texture to one object in the scene, so I selected it, unwrapped it, and painted over it. Now I selected it in the Edit Mode (I can't select it in the Object mode because all is locked together) and went into Node Editor, but the nodes are greyed out.  Why?


We know that there are infinite number of primes so as there are infinite number of primes of the form $4n+3$ where $n\in Z^+$.   A note on Burton's book (Elementary Number Theory) somehow says that it is of high chance to expect that there are also infinite number of primes of the form $4n+1$. However it is not yet proven by the time the book was published.  A quick search on net gives infinitude of primes of the form $3n+1$ and $5n+1$.  The question is: The problem: Are there infinitely many number of primes of the form $4n+1$ still an open problem or it was already proven? If so, where can I find the proof? Thanks a lot.

Question: Are there infinitely many primes of the form $4n+3$ and $4n+1$?  My attempt: Suppose the contrary that there exist finitely many primes of the form $4n+3$, say $k+1$ of them: $3,p_1,p_2,....,p_k$  Consider $N = 4p_1p_2p_3...p_k+3$, $N$ cannot be a prime of this form. So suppose that $N$=$q_1...q_r$, where $q_i∈P$  Claim: At least one of the $q_i$'s is of the form $4n+3$:  Proof for my claim: $N$ is odd $\Rightarrow q_1,...,q_r$ are odd $\Rightarrow q_i \equiv 1\ (\text{mod }4)$ or $q_i ≡ 3\ (\text{mod }4)$  If all $q_1,...q_r$ are of the form $4n+1$, then $(4n+1)(4m+1)=16nm+4n+4m+1 = 4(\cdots) +1$  Therefore, $N=q_1...q_r = 4m+1$. But $N=4p_1..p_k+3$, i.e. $N≡3\ (\text{mod }4)$, $N$ is congruent to $1\ \text{mod }4$ which is a contradiction.  Therefore, at least one of $q_i \equiv 3\ (\text{mod }4)$. Suppose $q_j\equiv 3\ (\text{mod }4)$  $\Rightarrow$ $q_j=p_i$ for some $1\leq i \leq k$ or $q_j =3$  If $q_j=p_i≠3$ then $q_j$ | $N = 4p_1...p_k + 3 \Rightarrow q_j=3$ Contradiction!  If $q_j=3$ ($\neq p_i$, $1\leq i \leq k$) then $q_j | N = 4 p_1...p_k + 3 \Rightarrow q_j=p_t$ for some $1 \leq i \leq k$ Contradiction!  In fact, there must be also infinitely many primes of the form $4n+1$ (according to my search), but the above method does not work for its proof. I could not understand why it does not work. Could you please show me?  Regards


I am trying to create a diamond pickaxe with two effects. I would like it to be Unbreaking, and that it can only break Obsidian. The problem is, I'm not sure how to go about it. Can someone help me with this?

This question was recently split into different questions for each workaround. See   meta posts for more information.   Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s stone_pickaxe{Unbreakable:1b} give @s item_frame{EntityTag:{Invisible:1b}} summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}} summon tnt ~ ~ ~ {Fuse:20s}


I am looking for bash function suitable to do some simple arithmetic expressions on point values For intance i=1 let "i_mod=${i}+1"; echo $i_mod gives me 2  but if i=1.0 let "i_mod=${i}+0.5";echo $i_mod gives me an error instead of 1.5  or alternatively one of the sollution that has already been suggested in other topic: i=1.0 echo "$(($i+1.0))" -bash: 1.0+1.0: syntax error: invalid arithmetic operator (error token is ".0+1.0")

Using echo "20+5" literally produces the text "20+5".  What command can I use to get the numeric sum, 25 in this case?  Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.  I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line.


I have a custom object and it has a lookup field to Accounts, Contacts, and Leads. Using recordTypes I have 3 different layouts so that only the relevant lookup is seen on the page layout. The page layout seems to be responding as expected right now, but the compact layout (I believe that's what I'm referring to), not so much.  Now, I am struggling here to understand, 1) why these buttons appear here by default anyways (new contact, new opportunity, etc?), 2) why not just standard new, edit, delete options for the actual record I'm dealing with.    So can I remove any of these from the view? And can I add more practical ones like "New"?

I know lightning doesn't support javascript buttons. I know there are alternative routes to do this with actions, lightning components, and visualforce. I'm asking how to do something that according to my research is supported but doesn't seem to work.  From the      Custom buttons and links that define their content source as URL are   now supported in Lightning Experience and the Salesforce1 mobile app.   This feature was previously available in Salesforce Classic only.   Seems straight forward. Create the button, add it to the classic page layout, see it in lightning. But for the life of me, I can't figure out how to get this thing to show up.  Here's the custom button, pretty basic   I've got it setup as the only button on the page layout, it's the assigned layout when I edit the page in lightning.   But in lightning I'm getting nothing   What am I doing wrong? Seems like I'm following the instructions outlined in this . Even though it's in the release notes, it's not mentioned in the . Other peopler have had  and have gotten it working eventually. What am I missing? Are there other factors to consider? Are those documented anywhere?


I have my smartphone with Android 4.0.1 version. It is original Chinese brand TOOKY.  Can my phone OS change to Ubuntu? Please explain.

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


My son is 2 1/2 years old. He has been going potty on the potty off and on since he was 18 months. He was interested due to having cousins just a little older than him. Unfortunately the problem we are running into is he won’t tell me when he has to go.   Most people say he is too young to know that he has to go, but he knows well enough to run out of the room or into a different room when he has to go. Even when I ask him he will say no then go in the other room and purposely pee or poo. If I take him to the potty he will fight and not want to sit on it but when he finally sits he goes potty. We’ve tried having potty parties and sticker charts. Sometimes He won’t even tell us when he potty’s he will just change his undies and keep going with playing.  How can we potty train our toddler?

My little boy has just turned three years old. I have only just recently stopped the nappies, but my little one doesn't like the potty. I've worked on that he sits on it with his tablet watching kids programmes and he uses it.   The only problem is that he only uses it when he wants to, most of the time he will just pee anywhere he is stood and I know they do that and accidents happen.   I just get frustrated sometimes as I'm asking him every 5 to 10 minutes if he needs to go potty. I have also done a sticker chart for him but that isn't working either, he still just goes where he wants.   Am I doing something wrong here? Can anybody give me some ideas how to get him to tell me he needs the loo, even though I'm asking him every 5 to 10 minutes if he does!? Any help will be appreciated!


I installed Ubuntu Budgie 19.10 3 weeks ago, and deleted its partition, because I didn't like it. Since day one my PC boots into Windows automatically without the grub boot menu showing. If I wanted to boot to Ubuntu, when starting PC I keep pressing F11 for boot options then I can choose Ubuntu now with LTS released.     I want to reinstall Ubuntu, but I can't install it on the SSD because as it shows it still there. I tried this video's  method, but I get access denied at the second command.

I have Windows 8 pre-installed, and then I installed GRUB with Ubuntu. Ubuntu is not my thing, so now I want to remove it along with GRUB. From what I have learned, with UEFI, GRUB does not overwrite the windows bootloader in the EFI partition and is stored elsewhere. How would I remove GRUB and make my PC use the Windows bootloader instead? It should be noted that I created a separate /boot partition when installing Ubuntu.


The following mockup code ends up in ConcurrentModificationException, that happens (as i understand it), due to the fact that i am iterating over a set, which i am modifying.  Set<String> data = new HashSet<String>(); data.add("a=1"); data.add("b=2"); data.add("c=3"); data.add("d=4");  for (String s : data) {     data.remove(s); }   But why is it exactly? Please help clarify

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


How can I prove this equality please?   Edit: MathJax version:  $$ \sum_{k=0}^{n}\sin (kx)=\frac{\sin\left(\frac{n+1}{2}x\right)\sin\left(\frac{n}{2}x\right)}{\sin\left(\frac{x}{2}\right)} $$ $$ \sum_{k=0}^{n}\cos (kx)=\frac{\sin\left(\frac{n+1}{2}x\right)\cos\left(\frac{n}{2}x\right)}{\sin\left(\frac{x}{2}\right)} $$

How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series:  $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$  There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2  a + (n-1)\cdot d}{2}\biggr)$$   How do we prove the above two identities?


I have an issue on including the Excel-Writer-XLSX module in the @INC path. I did some research before posting this question and tried several solutions, but they all failed.  So I did   $sudo perl -MCPAN -e 'install Excel::Writer::XLSX'   But after I run the code, I got this message   --can't locate Excel/Writer/XLSX.pm in @INC(you may need to install the Excel::Writer::XLSX module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level/...)   This is not a duplicate question, because the Excel::Writer::XLSX module has been successfully installed in my computer and I don't need to install it again. The thing is when I checked my library folder, the perl5 folder is not there, as it was suggested by the @INC path. Instead, Perl5 folder is in my user folder...and actually the module can be found in the lib folder inside the perl5 folder I'm not quite sure what is happening...Why the @INC path shows the perl/5.18 is inside the library folder? If you know how to solve this issue, please advice. Thank you so much!

I get this error:  Can't locate Foo.pm in @INC  Is there an easier way to install it than downloading, untarring, making, etc?


Could someone give a hint on this proof?

How to prove this question? If a graph with $n$ vertices and $n$ edges it must contain a cycle?


I have a real-time point-to-move 2D game with one playable character to control. I want to create smooth player movement using physics and appropriate velocity. Basic setup:  The player has a maximum speed The player has appropriate acceleration and deceleration parameters  How I achieving the required behavior right now: // float currentVelocity = 0 // const float acceleratePerSecond = 35 // const float deceleratePerSecond = 35  // ...  Vector2 positionToMoveTo = pointToMove.position; Vector2 playerPosition = playerRigidbody.position; Vector2 point = positionToMoveTo - playerPosition;  if (point.magnitude > 1) // If player is far enough {     if (point.magnitude >= currentVelocity) // Hack for smooth slow down     {         currentVelocity += acceleratePerSecond * Time.fixedDeltaTime; // Accelerate a little     }     else     {         currentVelocity -= deceleratePerSecond * Time.fixedDeltaTime; // Decelerate a little     } } else // If player is close enough - stop movement {     currentVelocity = 0;     pointToMove.isActive = false; }  currentVelocity = Mathf.Clamp(currentVelocity, 0, playerService.MaxSpeed); // Clamping to fix max speed playerRigidbody.velocity = currentVelocity * point.normalized;  This code is working but it is really hacked on the second if statement. Closer to end point player starts shaking, when the current velocity increasing in the first frame and decreasing in the next frame many times. So the question is: How can I achieve the required smooth point-to-move movement using velocity vector? Why I need to use velocity and can't use plain MovePosition of Rigidbody2D? That's because I rotate a player based on that velocity. It is bad to rotate a player based on pointToMove position because the real front of the player is the current velocity vector. Some test briefs:  If object is far enough:     acceleration        max speed        deceleration |-----------------o-----------------o-----------------|                  _____________________         ________/                     \________  ______/                                       \_______ /                                                      \   If object is closer:      acceleration      deceleration |-----------------o-----------------|                ______         ______/      \_______  ______/                     \______ /                                   \  Appreciate any help. Thank you.

I have a point entity that I would like to move to a target point (in 2D).  I think I would like it to accelerate away from its current position (the point could already have a velocity), to some maximum velocity, and decelerate as it approaches the target, eventually coming to a stop on the target.  I think both the acceleration and deceleration should have constant magnitudes, but given that the entity can have a velocity, which may not be in the same direction as the target, the direction of the acceleration/deceleration could be different every frame.  I am not coding in any particular language or framework yet, and just want to know if this is easy/possible. Am I describing something that is quite common (like a targeted missile that stops at the target/an AI controlled space ship in a game)? If it is hard, is there another way I can achieve the same kind of motion?


As we know, there is an equation for gravitational force $$F = \frac{Gm_1m_2}{R^2}$$ While for electromagnetism, it is $$F = q(E + v × B)$$ So is there any true formula to find the weak and strong force?

Electromagnetic interaction has classical electromagnetism as its classical limit. Is it possible to similarly describe strong and weak interactions classically?


This is something that I have been pondering for some time. The fundamental principles of special relativity are usually presented as forming a twofold:   There is no absolute reference frame of inertia, i.e. the laws of physics do not depend on the frame of reference.  The speed of light is a constant in every reference frame.    To me, it always felt like the second one might actually be regarded as a consequence of the first one. That is, the propagation of light being an electromagnetic phenomenon, its physical description ought not to depend on the reference frame. Thus, the speed of light should be a constant.   Yet, once I get it written down, this does not seem right either.  As, what we call the speed of light, is really the speed of any massless particle, its invariability should not really depend on its electromagnetic nature.   Is there not a way to derive the fact that all massless particles travel at the speed of light in every reference frames from principle 1 only?  Any thought?

Einstein 1905 gives the following axiomatization of special relativity (Perrett and Jeffery's translation):   The laws by which the states of physical systems undergo change  are not affected, whether these changes of state be referred to the one or the other of two systems of coordinates in uniform translatory motion. Any ray of light moves in the "stationary" system of coordinates with the determined velocity $c$, whether the ray be emitted by a stationary or by a moving body.   What other axiomatizations are possible?  References  Einstein, "On the electrodynamics of moving bodies," 1905, Annalen der Physik. 17 (1905) 891; English translation by Perrett and Jeffery available at


I have an Indian passport and I'm currently working in Germany.  I am travelling from Dusseldorf--London Heathrow--Chennai. Transit time in London Heathrow is 1 hour 30 minutes, and connecting flight to Chennai departs on the same day and it is also from the same terminal.  I have a German residence permit(Aufenthaltstitel), and my German visa is type "D".  Could you please let me know if I require a transit visa in London?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


I was asked an interesting question today. I've thought about it before but couldn't come up with a good answer.  If the values of a column are only going to be <= 255 characters, is there any real difference between using varchar(255) and varchar(max).  I realize that varchar(255) has a limit of 255 characters and varchar(max) 2 gb but they only use as much space as needed for the actual values stored. I'm not counting the extra space needed for the var part because as far as I know it's the same (or is it?). So in terms of performance & space is there a difference?

Someone was reviewing my DDL code for creating tables and suggested, when they saw I saw using VARCHAR(256) fields for text I expect to be pretty small, like a first name or whatever, that I should always just use VARCHAR(MAX) and linked . I read it but it seemed dated, as it was focusing on 2005, and didn't seem to offer any real justification to allocate potentially up to 2 GB per row on all text fields.   From a performance, storage, etc. standpoint, how should one go about deciding whether to use VARCHAR(MAX) or a smaller more specific type for modern versions of SQL Server? (e.g., 2008, 2012, 2014)


I wonder - why, when some folder has read or read-write permissions for GROUP (or other), the members of the GROUP (or other) can't access this folder?   I'm almost sure there is a logical explanation, but I can't find it. Let me give an example.  Initial circumstances  1. There are two users, called admin and guest.  2. There is a folder, called /var/www/test-dir:  $ getfacl -pt /var/www/test-dir/ # file: /var/www/test-dir/ USER   root      rwx GROUP  admin     r-x other            r-x   3. Within these permissions all users are able to access the folder:    USER    root    rwx (7) is able to access the folder. GROUP   admin   r-x (5) is able to access the folder. other   guest   r-x (5) is able to access the folder.  guest@host:~$ cd /var/www/test-dir/ guest@host:/var/www/test-dir$ ࢒    Cases  Case 1: other has r-- permissions but admin can't access the folder:  root@host:~# chmod 574 /var/www/test-dir/    USER    root    r-x (5) is able to access the folder. GROUP   admin   rwx (7) is able to access the folder. other   guest   r-- (4)  is unable to access the folder.  guest@host:~$ cd /var/www/test-dir bash: cd: /var/www/test-dir/: Permission denied      Case 2: other has rw- permissions but guest can't access the folder:   root@host:~# chmod 656 /var/www/test-dir/    USER    root    rw- (6) is able to access the folder. GROUP   admin   r-x (5) is able to access the folder. other   guest   rw- (6) is unable to access the folder:     Case 3: GROUP has r-- permissions but admin can't access the folder:  root@host:~# chmod 745 /var/www/test-dir/    USER    root    rwx (7) is able to access the folder. GROUP   admin   r-- (4) is unable to access the folder. other   guest   r-x (5) is able to access the folder.     Case 4: GROUP has rw- permissions but admin can't access the folder:  root@host:~# chmod 467 /var/www/test-dir/    USER    root    r-- (4) is able to access the folder. GROUP   admin   rw- (6)  is unable to access the folder. other   guest   rwx (7) is able to access the folder.

I am having a bit of trouble understanding what the execute permission means for directories. Do I understand it correctly that anything in a directory for which a user does not have x-rights is inaccessible even if the things inside the directory gives specific rights to the user?  Or will the user still have direct access to the things in the directory, but simply cannot list what is in the directory?  (What I am really trying to understand is how safe a directory is from access from other users if they do not have x-permission for it.)


I tried to post answer in this , but it is posted as comment and not as answer. Whats wrong with this? and I tried three time, all are posted as comments.  If you check that comments, It clearly shows the format that I made it through the editor.

I posted an answer (pointing to another question already asked) but when I hit submit, I saw my answer appear as a comment to the question instead.   I tried it a couple of times and still the same result. The answer gets eaten up and is transformed into a comment.   Is this a bug?


There is an identity between the divisor function of the odd numbers and the "odd" divisor function of power $3$(I don't know if there is a name for function for this type, if there is , sorry for my ignorance), that is  $$\left(\sum_{n=1}^{\infty}\sigma_1(2n-1)x^{2n-1}\right)^2=\sum_{k=1}^{\infty}\left(\sum_{d|n,\frac{n}{d}\mbox{ is odd}}d^3\right)x^k$$ where $\sigma_1(n)$ is the sum of all positive divisors of $n$. This is equivalent to proving $$\left(\sum_{n=1}^{\infty}\sigma_1(2n-1)x^{2n-1}\right)^2=\sum_{k=1}^{\infty}\frac{k^3 x^k}{1-x^{2k}}$$ I tried some calculation via Mathemtica, it seems to be true.This sequence seems to be , but I cannot find some way in cracking this problem. The square seems annoying and I can't get rid of it.  Thanks for your attention and helping hand.

Given the positive integer numbers $n$,prove that $$\sum_{k=1}^{2^{n-1}}\sigma{(2^n-2k+1)}\sigma{(2k-1)}=8^{n-1}$$  where $\sigma(n)$ is defined as $$\sigma{(N)}=\sum_{d|N}d$$  This problem I think is very interesting, and have nice methods?  Thank you everyone.  and I find some of this     or can see: