I've seen many LaTeX Code Snippets like this one   \AddToShipoutPictureBG{%     \AtPageUpperLeft{%         {\color{red}%             \rule[-1cm]%offset PageBorder                 {\paperwidth}%{14.8cm}                 {1cm}%height         }%     }% }   where  most line endings - if not all - are escaped with %. I don't understand the reason, as % marks (per definition) text, which will not interpreted by the compiler. So What is the reason, people escape their line endings?

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


When compiling my bibliography I end up with weird "e. a." abbreviations in front of some entries:  [4] e. a. P. F. Swaszek, R. J. Hartnett, \Analysis of a simple, multiple receiver gps spoof detector," in Proc. ION NTM, San Diego, California, January, 2013. [5] e. a. N. O. Tippenhauer, C. Popper, \On the requirements of successful gps spoofing attacks," in CCS'11, Chicago, 2011. [6] e. a. J. Nielsen, A. Broumandan, \Gnss spoong detection for single antenna handheld receivers," Navigation: Journal of the Institute of Navigation, vol. vol 58, no. 4, pp. 335{344, 2011.   My bib file looks like:  @InProceedings{ pfsrjh1,  author      = "P. F. Swaszek, R. J. Hartnett", title       = "Spoof detection using multiple COTS receivers in safety critical applications", booktitle   = "Proc. ION GNSS", address     = "Nashville, Tennessee", year            = "September, 2013"  } @InProceedings{ Tip1,   author    = "N. O. Tippenhauer, C. Popper, et al",   title     = "On the Requirements of Successful GPS Spoofing Attacks",   booktitle   = "CCS'11",   address = "Chicago",   year      = "2011", } @Article{ Niel1,   author    = "J. Nielsen, A. Broumandan, et al",   title     = "GNSS Spoofing Detection for Single Antenna Handheld Receivers",   journal   = "Navigation:  Journal of the Institute of Navigation",   volume = "vol 58, no. 4",   pages      = "335-344",   year      ="2011" }   There are other entries that do not cause this effect, and are formatted in the same way (at least as far as I can tell) For example:  @TechReport{ DAN019,  author      = "Spirent Communications PLC", title       = "Keeping your eye on the sky", address     = "Paignton, Devon, TQ4 7QR, England", number      = "Spirent Application Note DAN019-TM", institution = "Spirent Communications PLC", year            = "2009"  }   Produces:   [1] S. C. PLC, \Keeping your eye on the sky," Spirent Communications PLC, Paignton, Devon, TQ4 7QR, England, Tech. Rep. Spirent Application Note DAN019-TM, 2009.   Thoughts????

Can someone please explain in a clear and concise way how am I supposed to enter the names of authors in a BibTeX file? I have entries with something like   @article{someid,    author = {Juan A. Navarro P\'erez, Ra\'ul de la Garza and Andr\'es Espinoza},    ...   but somehow the output seems kind of wrong!


I just installed Firefox 57 on my Ubuntu 17.10 box. Firefox came as an tar.bz2 file, so I extracted it and are able to start Firefox by issuing this command: /path/to/firefox.  Is it possible to start Firefox from the GNOME search box, as I could when I installed older Firefox instances by the use of .deb files?

I have made .desktop files for Ubuntu 16.04 to access my Google Chrome profiles, but once I upgraded to Ubuntu 17.10 (it worked up to Ubuntu 17.04) they got removed from the dock and I can't pin them back. Sample File: #!/usr/bin/env xdg-open  [Desktop Entry] Version=1.0 Type=Application Terminal=false Icon[en_US]=google-chrome Name[en_US]=Google Chrome Exec=google-chrome --profile-directory=Default Comment[en_US]=Chrome Name=Google Chrome Comment=Chrome Browser Icon=google-chrome Categories=Browser;Internet;


Recently, I bought the WiFi stick TL-WN823N (EU) V3. I am running ubuntu 18.04 and try to get the stick to work there. While it connects to the WiFi, after some minutes, the connection stops working.   So I went to the , downloaded the driver and tried to install it. Unfortunately, the guide is very technical. It says that before compiling I have to make sure the parameters in makefile.c are suitable for my environment.  ARCH ?= $(SUBARCH) CROSS_COMPILE ?= KVER :=$(shell uname -r)   Could anyone tell me what I have to do here? When I try to compile it without changing anything, I run into compilation errors.  I have read several questions related to the TL-WN823N WiFi stick but I could not find a solution.

I have purchased a TP-LINK TL-WN823N (EU) V2.0 device, which is a USB device that should work as a Network Interface Card, allowing me to connect my computer to wireless networks. Unfortunately, I am unable to find any wireless networks using this device using either wicd or network-manager (no networks appear in the list of networks supplied by either application).  A CD came with the device claiming "Linux support". The CD contained a URL to a corrupted archive file for downloading installation resources. I try to mask my immense frustration.  Here is the additional dmesg output I receive when I connect the device to my computer (similar content is present when I boot the computer with the device connected):  [17096.009912] usb 2-1.2: new high-speed USB device number 4 using ehci-pci [17096.103501] usb 2-1.2: New USB device found, idVendor=2357, idProduct=0109 [17096.103513] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [17096.103527] usb 2-1.2: Product: 802.11n NIC [17096.103529] usb 2-1.2: Manufacturer: Realtek [17096.103530] usb 2-1.2: SerialNumber: 00e04c000001   This is my lsusb, where the offending device corresponds to Bus 002 Device 004:  Bus 002 Device 003: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor Bus 002 Device 004: ID 2357:0109   Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 004: ID 0c45:6433 Microdia  Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   As lsusb -v:   It seems the device is working to me, but no new interface is found in 'ifconfig':  docker0   Link encap:Ethernet  HWaddr 02:42:6e:bf:92:16             inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0           UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)  enp0s31f6 Link encap:Ethernet  HWaddr 30:5a:3a:e1:96:b1             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)           Interrupt:16 Memory:df200000-df220000   lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:412 errors:0 dropped:0 overruns:0 frame:0           TX packets:412 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1           RX bytes:31876 (31.8 KB)  TX bytes:31876 (31.8 KB)   Running 'lshw -class network' as root contains only information about the 'enp0s31f6' interface.  Additionally for sanity, my 'uname -a':  Linux home-z170a-ubuntu 4.4.0-22-generic #39=Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux   I am using Ubuntu 16.04.  My questions are:   Why are no networks present in the list for wicd or network-manager? Why is there no additional network interface created when I plug in the USB device? Is it possible to create this network interface?   Thanks for reading.


I am having a problem at a Java program. Exception in thread "main"  exception in thread main java.lang.nullpointerexception at VenueHireSystem.main (VenueHireSystem.java:27)  is the error that I'm getting. I could really use some help, since i am stuck hours on this spot... import java.io.FileNotFoundException; import java.io.FileReader; import java.util.Scanner;   public class VenueHireSystem {      public static void main(String[] args) {            Scanner sc = null;           try           {               sc = new Scanner(new FileReader("test.txt"));             }           catch (FileNotFoundException e) {} /*        finally           {               if (sc != null) sc.close();           } */                             Manager VenueManager = new Manager();                      String info;           String key;                      while (sc.hasNextLine() && sc.hasNext()){               key = sc.next();               info = sc.nextLine();               if (key.equals("Venue")){                   VenueManager.addVenueAndRoom(info);               } else if (key.equals("Request")){                   VenueManager.RequestBooking(info);               } else if (key.equals("Change")){                   VenueManager.ChangeBooking(info);               } else if (key.equals("Cancel")){                   VenueManager.CancelBooking(info);               } else if (key.equals("Print")){                   VenueManager.PrintBooking(info);               }           }                      sc.close();     }  }

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


My response var is a binary variable. In the predictor variable i have a type variable with levels as l1,l2,l3,l4. And when i run a logit (glm(redonse ~ type, family = "binomial"), Some levels of type variable turn out to be insignificant. i.e typel2 comes out to be insignificant. So my question is that, could i drop a that level for a variable somehow. ie i drop typel2 (treat typel2 as NULL or so)and then run the glm. i hope the question is clear.

After seeking clarification about linear model coefficients  I have a follow up question concerning non-signficant (high p value) for coefficients of factor levels.  Example: If my linear model includes a factor with 10 levels, and only 3 of those levels have significant p values associated with them, when using the model to predict Y can I choose to not include the coefficient term if the subject falls in one of the non-signficant level?  More drastically, would it be wrong to lump the 7 non-significant levels into one level and re-analyze?


I found a weird bug in SO today when I tried to down vote an answer that had completely wrong suggestion to solve an issue. Now, when I down-voted the answer, it had already been deleted (possibly by mods) but my screen did not refresh. And when I tried to post a comment reasoning the down-vote it failed.   There was nothing wrong till that point but the real surprise came after that when I found that the down-vote has caused a deduction of 1 reputation from my SO. The situation persisted until few refresh of my browser window and after that I found the original reputation point has been restored. However, when I logged into meta SO to report the issue, I still found that meta SO is showing that older wrong reputation point for SO. Please see the screenshots:  Status at SO        status at SO at meta SO        Now, I am really eager to know:   Is this a known issue of SO? If not, where should I report it for resolution? What is the original status of my SO account?   Thanks in advance.

The title basically says it all: "Why is downvoting a question free but downvoting an answer not?"  I ask this because I think bad answers are a lot more damaging than bad questions. If it is a a bad question it might lead to some minutes wasted for the people that read it. But a bad answer can lead to big bugs into production code. False faith in how stuff works, or can even be bad propaganda.  So why does it cost me that silly 1 rep. I know it shouldn't matter. I have plenty of rep, but still I hesitate that tiny bit before doing it.


During Dumbledore's Army training, members practice stunning and frequently hit each other. However we never see anyone being revived with Rennervate.  Is this because they are too young and not powerful/well trained enough at this point for the effects to be as severe?  In summary, why do Dumbledore's Army members not feel the full effects of being stunned?


I have a program written in Scala. I wanted to measure the execution time of different independent code blocks. When I did it in the obvious way (i.e. inserting System.nanoTime() before and after each block), I observed that the the execution time depends on the ordering of the blocks. The first some blocks always took more time than the others.  I created a minimalistic example that reproduces this behaviour. All code blocks are the same and call hashCode() for an array of integers, for simplicity.  package experiments  import scala.util.Random  /**   * Measuring execution time of a code block   *   * Minimalistic example   */ object CodeBlockMeasurement {    def main(args: Array[String]): Unit = {     val numRecords = args(0).toInt     // number of independent measurements     val iterations = args(1).toInt      // Changes results a little bit, but not too much     // val records2 = Array.fill[Int](1)(0)     // records2.foreach(x => {})      for (_ <- 1 to iterations) {       measure(numRecords)     }   }    def measure(numRecords: Int): Unit = {     // using a new array every time     val records = Array.fill[Int](numRecords)(new Random().nextInt())     // block of code to be measured     def doSomething(): Unit = {       records.foreach(k => k.hashCode())     }     // measure execution time of the code-block     elapsedTime(doSomething(), "HashCodeExperiment")   }    def elapsedTime(block: => Unit, name: String): Unit = {     val t0 = System.nanoTime()     val result = block     val t1 = System.nanoTime()     // print out elapsed time in milliseconds     println(s"$name took ${(t1 - t0).toDouble / 1000000} ms")   } }   After running the program with numRecords = 100000 and iterations = 10, my console looks like this:     HashCodeExperiment took 14.630283 ms   HashCodeExperiment took 7.125693 ms   HashCodeExperiment took 0.368151 ms   HashCodeExperiment took 0.431628 ms   HashCodeExperiment took 0.086455 ms   HashCodeExperiment took 0.056458 ms   HashCodeExperiment took 0.055138 ms   HashCodeExperiment took 0.062997 ms   HashCodeExperiment took 0.063736 ms   HashCodeExperiment took 0.056682 ms   Can somebody explain why is that? Shouldn't all be the same? Which is the real execution time?  Thanks a lot, Peter     Environment parameters:   OS: ubuntu 14.04 LTS (64 bit)   IDE: IntelliJ IDEA 2016.1.1 (IU-145.597)   Scala: 2.11.7

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


What does ` in Linux means? The sign with tilde on keypad. Does it evaluates the expression?

I am trying out the command  $ b=5; echo `$b`; -bash: 5: command not found   but it does not print 5 as it is supposed to. What am I missing here?   seems to say that ` evaluates the commands within and replaces them with the output.


I have downloaded the latest version for NER from this . Then after extracting it, I have run this command.  java -cp stanford-ner.jar edu.stanford.nlp.ie.crf.CRFClassifier -prop austen.prop   This is not working and getting following exception.  CRFClassifier invoked on Mon Jul 25 06:56:22 EDT 2016 with arguments:    -prop austen.prop Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory     at edu.stanford.nlp.io.IOUtils.<clinit>(IOUtils.java:42)     at edu.stanford.nlp.util.StringUtils.argsToProperties(StringUtils.java:942)     at edu.stanford.nlp.util.StringUtils.argsToProperties(StringUtils.java:891)     at edu.stanford.nlp.ie.crf.CRFClassifier.main(CRFClassifier.java:2994) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     ... 4 more   In the folder, stanford-ner-2015-12-09 there is another folder lib, it already contains slf4j libraries but still it is not executing above command. I just downloaded and then extracted files and run that command to make a model but this exception is coming. I will be thankful to you if you can help me.

I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?


While , I came across a post with duplicate answers (auto).      All three answer(, , ) are very similar posted by same user.    I'm interested in knowing how this works.  Does this work for copied answers of different users?  Is something that can be be shared to us on how it works or detected?

In the  there are flags for duplicate answers. For users without the rep, this is what it looks like:      In  Martijn states that those flags are system generated to help in detecting undesired behaviour. There is also  that guides how to handle those flags.   Looking at the current flags I conclude that answers that are an exact copy of the same user are detected. Shouldn't that same flag also be automatically raised if an exact copy of an answer by another user is found? I assume 'almost' exact copies will generate to much false positives?


>>> d = {'key':'value'} >>> print d {'key': 'value'} >>> d['mynewkey'] = 'mynewvalue' >>> print d {'mynewkey': 'mynewvalue', 'key': 'value'}   why the last added 'mynewkey': 'mynewvalue' came first in dictionary

Here is the dictionary I have  propertyList = {     "id":           "int",     "name":         "char(40)",      "team":         "int",     "realOwner":    "int",      "x":            "int",     "y":            "int",      "description":  "char(255)",      "port":         "bool",     "secret":       "bool",     "dead":         "bool",     "nomadic":      "bool",      "population":   "int",     "slaves":       "int", }   But when I print it out with "\n".join(myDict) I get this  name nomadic dead port realOwner secret slaves team y x population id description   I know that a dictionary is unordered but it comes out the same every time and I've no idea why.


What is the structure of this sentence (his only condition being, that they were new ones) in this context below (from perfume 2015 movie script)?  He did not differentiate between what are good smells from bad, at least not yet  he was very greedy.  the goal was to possess everything the world had to offer in odors. his only condition being, that they were new ones.

There is this sentence:     There are several parts to this problem, the most important (part) being that many of the learners find it rather boring.   I would like to know if the phrase in bold-faced type is short form of a clause or something. If yes, what is the original form of the sentence?  To me, it sounds like the original form is "the most important of which is that..." As in:       The man who lives next door = the man living next door   Does it follow the same rule or is the case different? And, can we simply use the verb "is" instead and say "the most important is that ..." If yes, what is the difference between "...being that..." and "...is that..." in the sentence? Is it only a matter of style?


When I do man passwd, it opens the manual for PASSWD(1). So what is PASSWD(5) and how to open its man page?

I wanted to access man pages for command chmod.  Command whatis chmod gave this output:  chmod (2)            - change permissions of a file  chmod (1)            - change file mode bits  But I was actually looking for chmod(2).  When I type man chmod, man pages for chmod(1) appears.   Both man chmod(2) and man 'chmod(2)' commands show error.   I tried running info coreutils 'chmod invocation', but output is some kind of documentation which doesn't look like a typical man page.


How do you show that  the sequence $$a_n=\left(1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\dots+\frac{1}{n}\right)-\ln(n)$$ is convergent.  Give a convincing argument, that $a_n$ converges to a number called gamma. Using a picture if you want. Remember the anti-derivative of $\ln(x)$ is $\frac 1x$  I am not sure how to give a convincing argument that this sequence converges to $\gamma$ I never heard of this number gamma before.

Hi there I'm trying to solve an exercise which is part of my homework and I would really appreciate a hint how to solve it.  Given the sequence $a_n=1+\frac{1}{2}+...+\frac{1}{n} - \log(n)$ it asks me to prove that it is convergent and to prove that limit when $n$ approaches infinity of $a_n$ is $c$ where $c$ is between $0$ and $1$.  So far I proved its montony and that the sequence is decreasing. I could need a hint on how to bound it though. Thanks in advance.


Like units can be added together or, subtracted from one another. However, multiplication and division of units does not have such boundations. multiplication is just repeated addition, similarly division is repeated subtraction. How in the world we don't have same conditions as that on addition of like units?

Dimension analysis is a nice tool to create functions using physics dimensions that are desirable for our lives. I know, as an axiom, of sorts to me, that addition and subtraction must conserve units, and thus are actually relatively uncommon in physics equations.   Now, for why that is, I would tell someone it's the same reason why you only can add terms with the same qualities as that term in math as well (such as $x^2$ only being able to be added with scalar multiples of $x^2$, the same applying to $y^5$ or $ e^{-2x}\cosh(3x)$, for example). Except in the case of inputs, we have... (and here is where my explanation gets shady), vector units or magnitudes with magnitude 1 of things such as $\text{meters/second}$, $\text{Newtons}$, $\text{Tesla}$, $\text{Joules/Coulomb}$ etc.   However, I can't seem to necessarily explain why I couldn't say, add $x^2$ to $x$ or a velocity to a force other than my body simply not letting me out of habit, and my only explanation is: "You just can't", or "It'd look bizarre."  I need a better explanation for this. Could someone enlighten me? My two questions:   Why does adding and subtraction break down at things with different dimensions? Why does multiplication/division allow for it?


I know that if $A \cap B $ is non empty then the union is connected, but how can I ensure that if the closure of $A$ and $B$ has commom points implies in $A \cap B $ is non empty?

$A,B$ are connected subsets of a topological space $X$.  What I've tried:  As $B$ is connected, so is its closure $\overline{B}$. We have:  $\overline{B}\cap A\neq \emptyset$  $\overline{B} \cap B\neq \emptyset$   hence, $\overline{B}\cup A \cup B$ is connected. However, this isn't what I want.  I was thinking of trying to show that $A\cap \overline{B} \neq \emptyset$ implies $A \cap B \neq \emptyset$, though I don't think this would be true if $A$ is closed.  Any hints?


Why does this happen and how do I prevent it?

I am working in Illustrator (15.0.2 (CS5) or 16.0.0 (CS6)) and when I try to move objects small distances, they snap to the nearest two pixels on some invisible grid. I can't find anything in the preferences. Here are some screen shots:


I try to plot quadratic fonction.  \documentclass{article} \usepackage{tikz}  \begin{document} bad, negative square equal...negative!   \begin{tikzpicture} \draw plot (\x,\x^2/4/1.0); \end{tikzpicture}  good \begin{tikzpicture} \draw plot (\x,\x*\x/4/1.0); \end{tikzpicture} \end{document}   I found a solution, but why this surprising result? Is there a way to use the square function?

I have some files with TikZ graphics that have suddenly changed appearance since I upgraded to PGF-2.10.  Here is a minimal example:  \documentclass{minimal} \usepackage{tikz} \begin{document} \pgfversion\par \begin{tikzpicture} \draw[blue] plot[domain=-1:1] (\x,{\x^2 + \x^3}); \draw[xshift=4cm,blue] plot[domain=-1:1] (\x,{(\x)^2 + (\x)^3}); \end{tikzpicture} \end{document}   In PGF 2.00 I had this:    while in 2.10 I have this:    The one on the left in PGF 2.10 looks like the graph of y=x^3 but could also be y=x^3 + x|x|.   This has been  on sourceforge and  on the pgf-users mailing list.  Although I haven't checked myself yet, the bug remains open and some of the commenters below report that problems still exist in the CVS version.   Geoffrey Jones notes the bug is in the 2.00 CVS version:     Hi Matthew, not an answer, just an FYI   that's too large for the comment box.   My compile of your code through pgf   v2.00 produces the result you see with   v2.10, above:       I.e., the difference you observe seems   to pre-date v2.10.   There is a workaround by inserting parentheses.  But since I have so many old lecture files I'd rather find a solution that doesn't involve rewriting my TikZ code.  And I'm squeamish about using the CVS bleeding edge code even if it were fixed, since I don't want to introduce other problems.  Ideally I'd like a simple patch that I can stick at the preamble, or just fix one file in the PGF distro.


I'm using regex to replace some text inside my code like this :   text.replace(     /\{\#(variable)\#\}/g,     this.options.vars[i].companyName, );   I want to use a variable inside the pattern because I have a string like this lorem ipsum {#variable1#} dolor {#variable2#}, but I can't find a way to pass a variable inside the pattern.

I would like to create a String.replaceAll() method in JavaScript and I'm thinking that using a regex would be most terse way to do it.  However, I can't figure out how to pass a variable in to a regex.  I can do this already which will replace all the instances of "B" with "A".  "ABABAB".replace(/B/g, "A");   But I want to do something like this:  String.prototype.replaceAll = function(replaceThis, withThis) {     this.replace(/replaceThis/g, withThis); };   But obviously this will only replace the text "replaceThis"...so how do I pass this variable in to my regex string?


I installed Ubuntu 18.04 and find in very inconvenient: Alt-Tab (switch between applications) can bring you to a different desktop.  Usually I keep windows related to different activities on different desktops, e.g. the git desktop (some terminal windows and a text editor, sometimes gitk), the remote server desktop (two terminals with ssh, Firefox with a page from that server, and a text editor), the corporative mail desktop (Firefox with e-mail web interface, Skype, one more text editor), the source code desktop (IDE, some terminal shells and a text editor), etc.  In other words, Terminal and Gedit have many windows on different desktops, and these windows are unrelated, so grouping windows by application does not work.  How do I switch between windows on the current workspace?

I am looking for a clean and fast method to force GNOME in Ubuntu 14.04 to switch between active apps only on the current workspace when pressing the shortcut alt + tab.


According the the Big Bang theory, the universe started as a 0-dimensional point of infinite density. Shortly thereafter, it underwent inflation and grew to some measurable size, and continues growing to the present day.  If, when inflation started, the universe was a "ball" of some measurable size, that implies that some of the matter-energy was close to the "outside" of the ball and some was close to the "center", even if there is no "outside" of the ball.  Why is it not possible to determine how far something is from that "edge"? If the answer is that the "edge" is farther away than light travels in 13.7 Gy, I can accept that. It is still some finite distance away, albeit too large to measure.  Am I completely off in my thinking? What is wrong with my logic?

My question related kind of to asking what the shape of the universe is. Say a hypothetical alien civilization built an faster-than-light spaceship. If they keep flying would they end up where they began? ie space itself is curved...or would they hit some invisible barrier?


I am writing a piece of software that requires the use of a class in another file. When I run the program and put in a value, I get the error Exception in thread "main" java.lang.NullPointerException class. Here is my code:      package chap8lab.salesperson;  import javax.swing.JOptionPane;  public class Chap8LabSalesPerson {  public static void main(String[] args) {     final int LIMIT = 10;     Salesperson[] peep = new Salesperson[LIMIT];     int i = 0, a = 0;     String q = "q", strInput = "";       JOptionPane.showMessageDialog(null,         "This program collects salesperson data.");         while (!strInput.equals(q))         {         strInput = JOptionPane.showInputDialog(null,                 "Enter sales person ID (\"q\" to quit)");         if (!strInput.equals(q) && !strInput.matches("[a-z][A-Z]"))         peep[i].setEmpID(Integer.parseInt(strInput));         if (!strInput.equals(q))         strInput = JOptionPane.showInputDialog(null,                 "Enter sales amount (\"q\" to quit)");         if (!strInput.equals(q) && !strInput.matches("[a-z][A-Z]"))           peep[i].setSalesAmt(Double.parseDouble(strInput));         i++;         if (strInput.equals(q))             i--;         }         while (a < i)         {             JOptionPane.showMessageDialog(null,                      "Employee ID: " + peep[a].getEmpID()                     + " Sales Ammount: " + peep[a].getSalesAmt() + "\n");          a++;         }         JOptionPane.showMessageDialog(null,                      "Thank you for using this program.\nHave a nice day!");     }  }   Here is my class file Salesperson.java:       package chap8lab.salesperson;  public class Salesperson { private int empID; private double salesAmt;  public Salesperson() {     empID = 9999;     salesAmt = 0; }  public void setEmpID(int newEmpID) {     empID = newEmpID; }     public int getEmpID() {     return empID; }        public void setSalesAmt(double newSalesAmt) {     salesAmt = newSalesAmt; }   public double getSalesAmt() {     return salesAmt; }  }   Any help is greatly appreciated.

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


I am trying to find a right $R$-module $A$ and a left $R$-module $B$ such that the tensor product $A\otimes_R B$ has an element that is not of the form $a\otimes b$ for any $a,b$ in $A,B$ respectively. I could not find any. Is there any simple example? Thanks in advance   Edit: You may bring other examples, or consider my own example that taking $A,B$ to be $K^2$ for a field $K$, then $e_1\otimes e_1 + e_2\otimes e_2$ where $e_i$ are the canonical basis elements of $K$ is such an element but how can it be proved using elementary methods?

Let $(e_1,e_2)$ be the standard basis of $\mathbb{R}^2$. Why can the element $e_1\otimes e_2 + e_2\otimes e_1$ in $ \mathbb{R}^2\otimes_{\mathbb{R}} \mathbb{R}^2 $ not be written as a simple tensor $v\otimes w$ for $v,w\in \mathbb{R}^2$?  If we suppose $e_1\otimes e_2 + e_2\otimes e_1=v\otimes w$, then can we conclude that $e_1=\lambda e_2$ for some $\lambda \in \mathbb{R}$? This would give a contradiction since $e_1$ and $e_2$ are linearly independent. However, I am not sure if the argument is valid.


I have a bit of spare time so I'm trying to figure out some math problems! (THis is just a hobby of mine, so please be patient with me haha) Say that we have a lie algebra $L= gl(n, \mathbb{C})$. I'm trying to show that the killing form on $L$ is given by: $$k(a,b) = 2nTr(ab) -2(Tr(a))(Tr(b))$$  So I'm struggling (as usual!) with carrying out these basic calculations. Taking a basis element of $gl(n,\mathbb{C})$, say $e_{r,s}$ and then trying to calculate $ad(a)ad(b)(e_{r,s})$. I should express this result in terms of the basis and find the cofficient of $e_{r,s}$... I think... but How do i acutally go about doing this? From this, i'm supposed to be able to deduce that if $n \geq 2$ then $sl(n,\mathbb{C})$ is semisimple, but I'm not seeing the connection. I'd appreciate if one of you genius's could walk me through this!!

Consider the Killing form of the Lie algebra $\mathfrak{gl}_{m}$. Then $\{e_{ij}\}$ is a basis for this Lie algebra where $e_{ij}$ is a matrix with 1 in the $i$th row, $j$th column and 0 everywhere else. Then every $A = (a_{ij}) \in \mathfrak{gl}_{m}$ can be written as $A = \sum_{i, j = 1}^{m}a_{ij}e_{ij}$. Since $[e_{ij}, e_{kl}] = \delta_{jk}e_{il}-\delta_{li}e_{kj}$, we have $ad(a)e_{ij} = \sum_{kl}(a_{ki}\delta_{lj} -a_{jl}\delta_{ki})e_{kl}$. From this we have $$ad(a)ad(b)e_{ij} = \sum_{k, r, s}(a_{rk}b_{ki}\delta_{sj} + a_{ks}b_{jk}\delta_{ri} - a_{ri}b_{jk}\delta_{sk} - a_{js}b_{ki}\delta_{rk})e_{rs}.$$ From this how can I see that the Killing form is $2m tr(ab) - 2tr(a)tr(b)$. I know that the Killing form is just the trace of the above centered equation, but I seem to be getting confused with all the indices.


I want to install Sublime Text 3 , but had a problem, my terminal is showing this error:     dpkg: error: dpkg status database is locked by another process   What shall I do?

I just wondered if somebody could tell me what this means:  E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. reidsr@ubuntu:~$ sudo dpkg --configure -a dpkg: error: dpkg status database is locked by another process reidsr@ubuntu:~$    How do I run sudo dpkg --configure -a  manually?


An important legal result hinges on the meaning of the word "any" in this sentence:  "If the effect of the domiciliary requirement under subparagraph (A) is to render the debtor ineligible for any exemption, the debtor may elect to exempt property that is specified under subsection (d)."  My opposition argues that because the debtor is still eligible for some exemptions, he cannot elect to exempt property that is specified under subsection (d). I argue that the effect of the domiciliary requirement rendered my client ineligible for some exemptions, therefore I can elect to exempt property that is specified under subsection (d). It seems like it should be a simple issue, but it has now confused judges all the way up to the 9th Circuit Court of Appeals In other words, one party argues that this sentence means: As long as the debtor is eligible for at least one exemption, the [result occurs]. The other party argues that this sentence means: If the debtor is ineligible for at least one exemption, the [result occurs]. Which is correct, and why?

Given the following question, in the context of a poll or vote:  Should any employee of Company X be allowed to assume absolute authority in any project with Company X's name associated?  Under the rules of English, are both of these interpretations valid, therefore making the question ambiguous?  Interpretation #1  "Should any employee of Company X (without restriction; meaning, regardless of their standing in the Company and the amount of support they've received) be allowed to assume absolute authority in any project (without restriction; meaning, any project they wish to embark upon, with or without informing anyone or getting anyone's buy-in) with Company X's name associated?"  Under Interpretation #1, someone would only respond by voting "Yes" if they felt that replacing the word any with every in the original question would be perfectly acceptable. If they could think of just one situation where this would be unacceptable, they'd have to vote "No."  Interpretation #2  "Should any employee of Company X (ever) be allowed to assume absolute authority in any project (whatsoever) with Company X's name associated?"  Or -- perhaps more clearly --  "Are there any circumstances or conditions under which a Company X employee embarking upon a certain project would be allowed to assume absolute authority over the project with Company X's name associated with it?"  Under Interpretation #2, someone would only vote "No" if they felt that no justification can exist for allowing an employee to have this absolute authority on a project with Company X's name associated. If they felt that some conditions would make it acceptable, then they'd have to vote "Yes".  Q: Are both of these interpretations valid? If not, which one(s) are incorrect?


While creating a backup of a table, I am using the following Syntax -  CREATE TABLE new_table LIKE original_table; INSERT new_table SELECT * FROM original_table;   But while executing the first Statement only, I am getting the folowing error:     SQL-Fehler: ORA-00922: Fehlende oder ungültige Option   00922. 00000 -  "missing or invalid option"   I am new to SQL but this should be simple execution.

I know the statement:  create table xyz_new as select * from xyz;   Which copies the structure and the data, but what if I just want the structure?


(This seems like an obvious / common question, but I couldn't find it when searching - maybe I wasn't using the correct terminology...)  I want to login over ssh to a remote machine, tar a directory, and download it to my local machine. I don't need to leave a copy on the remote server. Currently I ssh in, create the tar archive, logout, scp the file to my machine, the ssh back in to remove the archive. Not exactly efficient...  I know this doesn't work, but I'm thinking something like:  scp user@remote:"tar czf - /my/directory/" ./my/local/destination/archive.tgz   Or is there a better way?  Thanks.

I'd like to essentially tar/gz a directory on a remote machine and save the file to my local computer without having to connect back into my local machine from the remote one. Is there a way to do this over SSH? The tar file doesn't need to be stored on the remote machine, only on the local machine. Is this possible?


i make a small program in java about Metro Station in Egypt so i specified the lines the passeger take a metro from it and the line they go to by boolean  in default at classes boolean value is false but i want to make 4 variable changing in Main   this code specify the index of the stations in line 1 and make source1 true in the same time  it works if i write it inline  but when i write it in function  always source1 is false as defualt  and i can solve it  please help  public void Searchinline1(String []line1,String sourceStation,String destinationStation,boolean source1,boolean destination1,int sourceindex,int destinationindex) {      for (int i = 0; i < line1.length; i++) {         if (sourceStation.equalsIgnoreCase(line1[i])) {             source1=true;             sourceindex=i;         }         if (destinationStation.equalsIgnoreCase(line1[i])) {             destination1=true;             destinationindex=i;         }     }  }

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


I'm working on writing automated UI tests and using singleton pattern (lazy) to store UI object references.  How can I dispose _appMenu.Value? Could anyone please help?  private static Lazy<AppMenu> _appMenu = new Lazy<AppMenu>(() => new AppMenu(_logger,_reporter));  public static AppMenu Instance {     get     {         return _appMenu.Value;     } }  private AppMenu(ILogger logger, IReporter reporter) {     _logger = logger;     _reporter = reporter;     AppMenuContainer = MainWindow.Instance.MainWindowContainer.FindSingle<TabPageList>(GenericProperties.AppMenu); }

I have a singleton that uses the "static readonly T Instance = new T();" pattern. However, I ran into a case where T is disposable, and actually needs to be disposed for unit tests. How can I modify this pattern to support a disposable singleton?  The interface I would like is something like:  var x = Foo.Instance; var y = Foo.Instance; // x == y ... x.Release(); // this causes the next Foo.Instance to return a fresh object              // also, it assumes no further operations on x/y will be performed.   Note - the pattern has to be thread-safe, of course.  Edit - for the purpose of production code, this is a true singleton. The thing is that it locks some files, and so for cleanup in unit tests we have to dispose it.  I would also prefer a pattern that can be reused, if possible.


What is the purpose we run ssh-agent with eval `ssh-agent`  not just ssh-agent  ?

What can you do with the eval command? Why is it useful? Is it some kind of a built-in function in bash? There is no man page for it..


I have a div inside of a div and I want to position the div in the centre.

hi

     How do I make .messages centred to .dialogs-icon?    I want to make horizontally center positioning

How can I horizontally center a
 within another
 using CSS?

Foo foo


We've all been taught in primary school how we're supposed to use 'an' instead of 'a' when we talk about an object whose name starts with a vowel, in its singular form.     -> An Apple -> An Ostrich-> An Elephant   But when we refer to one university, universe or even adjectives like useless, we use 'a' instead of 'an'.     -> A University-> A Useless Boy-> A Unique sight   Why is that so ? I get the fact that we use 'an' for words which start with consonants occasionally, for words like 'Hour','Honor', because the 'H' is silent. But what of the exceptions in the case of words starting with A,E,I,O,U ? Or is the just for certain words that start with 'U' ?

Which indefinite article should precede hour — a or an?        an hour     a hour      Does the usage of an vs a depend on the pronunciation — a history, a hobby, but an hour, an honor?


Suppose $f$ is a continuous decreasing function on $[0, \infty)$ and $\int^{\infty}_0 f(t)\ \mathrm {d} t$ converges. Prove that $\lim\limits_{x\to\infty} xf(x) = 0\ $. I am currently preparing for my final calculus examination and this question appeared in last semester's paper. I have been staring at it for hours but have no idea how to even approach it. Any hints/intuitions on how to work this will be greatly appreciated :) P.S. I am only taking an introductory calculus module in college, so please do not provide solutions which require "heavy machinery" :)

Let $f:\mathbb{R}_+ \to \mathbb{R}_+$ be a monotone decreasing function defined on the positive real numbers with $$\int_0^\infty f(x)dx <\infty.$$ Show that $$\lim_{x\to\infty} xf(x)=0.$$   This is my proof: Suppose not. Then there is $\varepsilon$  such that for any $M>0$ there exists $x\geq M$ such that $xf(x)\geq \varepsilon$. So we can construct a sequence $(x_n)$ such that $x_n \to \infty $ and $x_n f(x_n ) \geq \varepsilon$. So $$\frac{\varepsilon}{x_n}\leq f(x_n) \implies \sum_{n\in\mathbb{N}}\frac{\varepsilon}{x_n} \leq  \sum_{n\in\mathbb{N}} f(x_n) \leq \int_0^1 f(x)dx.$$ So we get a contradiction.  I feal like I have the correct idea but some details are wrong.  Any help would be appreciated.


I am finding it hard to buy Hungarian Forint in Bangalore, India. Can I take euros to Hungary? Will those work ?

The official currency of Hungary is the Forint but so far everything I have looked for prices online, such as trains, buses and taxis, are quoted in Euros and Forints. Hotel reservation asked that I pay in Euros at the hotel. Considering that I will only spend a few days in Budapest, are Forints necessary? Or can I pay for transport, admissions and food in Euros? In such a case, how is the conversion rate set?


Suppose $(S,d)$ is a non-compact metric space. Is it possible to construct an unbounded continuous function from $S$ to $\mathbb{R}$? If it is possible, please show the construction method :)  Here's my attempt to solve this problem: Because $S$ is not compact, we can find a neighborhood assignment function $N(x)$ so that a finite cover is not possible. Then each time we can find an uncovered point from the union of neighborhoods before, and change the function by $f(x):=max\{f(x),\text{a function which equals to the indice of this point at that point and gradually vanishes at further points from the selected point}\}$. However I'm concerned that while this function is unbounded, there may be some invalid points for this function (goes to infinity)...  EDIT: As I found out there is a duplicate question, however the elementary solution is not presented in that question, so I still wish to know about this problem. :)

Suppose $X$ is a non-compact metric space. Show that there exists a continuous function $f: X \rightarrow \mathbb{R}$ such that $f$ does not achieve a maximum.   I proved this assertion as follows:  If $X$ is non-compact, there exists a sequence which has no converging subsequence. Therefore, the set $E$ of elements of this sequence is infinite and has no limit points. Therefore, in the induced topology, $E$ is a countable discrete space. Let $e_n$ be a enumeration of $E$. Define $f: E \rightarrow \mathbb{R}$ as $f(e_n)=n$. Since $E$ is discrete, $f$ is continuous. By Tietze (note that $E$ is closed in $X$), there exists a continuous function $g: X \rightarrow \mathbb{R}$ which extends $f$. But $f$ is unbounded, then so is $g$, and $g$ does not achieve a maximum. $\square$  My first question is: Is everything in the proof fine?  Now, my second question is: Can you provide me a proof which is more elementary? (Not using Tietze, for example. This exercise is just after the definition of compactness. I suppose this proof is not what was intended.)  And my third question is: Does the proposition hold for arbitrary topological spaces? If not, can you provide a counter-example?


Let  $R$  be  a  ring  such  that  the  only  right  ideals  of  $R$  are  $(0)$  and  $R$.  Prove  that  either  $R$  is  a  division  ring  or  that  $R$  is  a  ring  with  a  prime  number  of  elements  in  which  $ab=  0$  for  all  $a,b\in R$.    I  don't  want  the  proof.  I  am  stuck  at  one  point.  Why  does $R$  have  to  be  finite  here?

Let $R$ be a commutative ring such that $R$ has no nontrivial ideal. Then show that either R is a field or R is a finite ring with prime number of elements and $ab = 0$ for all $a,b \in R$.  I am facing difficulty in proving the above!!


I want to do a dual boot of Windows XP and Ubuntu 14.04 on a very old Acer Aspire 3690 laptop. Are there any peculiarities of installing Ubuntu with dual boot on Acer Aspire laptops?   To be specific, I don't want to mess partition that contains recovery copy of Windows XP. Laptop HDD is divided into 2 partitions, one for OS, another for data. I've already formatted and cleared the data partition and want to install Ubuntu there. Is it safe to do, will Ubuntu install not mess with the rest of the hard drive? On laptop it says that it was designed for Windows XP, it worries me too.  I also want to install a 64-bit version of Ubuntu. I'm aware that on such laptop it's generally useless, I just need to develop applications for my 64 bit Ubuntu desktop. But I don't know if hardware can support this. This are hardware parameters:  CPU: Intel Celeron M 420 1.60 GHz  Chipset: Intel 940GML Express  Video: Intel GMA 950  RAM: 512 mb   Also I guess I need to install a "lighter" version of OS on such laptop. What would be the best solution in such case? Lubuntu?

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


This is a hack I just discovered:  DEBUG=true $DEBUG && echo "Hello"   And this just happens to work because true is an actual command which returns 0, and the && operator is happy with that:  » true » echo $? 0   Is there a non-hackish way of execute a piece of code if a variable is set, to whatever value, except the empty string? Something like this, but as a readable one-liner (like the one above):  myvar="ggg" if [ "$myvar" != "" ] ; then echo "Hello" ; fi

I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing:  if [ -z "$STATE" ]; then     echo "Need to set STATE"     exit 1 fi    if [ -z "$DEST" ]; then     echo "Need to set DEST"     exit 1 fi   which is a lot of typing. Is there a more elegant idiom for checking that a set of environment variables is set?  EDIT: I should mention that these variables have no meaningful default value - the script should error out if any are unset.


I have a properties file (server.properties) and it looks like this:  ipaddress=10.x.x.x serverName=someName  and a lot of other values.  Let's say it is located at C:\Server\server.properties  Is there a way to modify the values using a batch script.  What would I do if I want to change serverName from "someName" to "myName" ? I can't use line numbers because it can change anytime.  This is not a duplicate of   I am trying to figure out how to replace the value of a property. Not replacing one word with another.  Thanks.

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?


Sorry for the silly question, but I came across the following C# code and I'm wondering what the [Flags] portion is and what it does.  [Flags] public enum UserFlags {      //... }   Thank you in advance.

From time to time I see an enum like the following:  [Flags] public enum Options  {     None    = 0,     Option1 = 1,     Option2 = 2,     Option3 = 4,     Option4 = 8 }   I don't understand what exactly the [Flags] attribute does.  Anyone have a good explanation or example they could post?


I have been looking for the information since yesterday and could not find anything... I have sharepoint 2012 fundation and my SQL Server 2010 Evaluation is short of space (we already used 10GB), however I have SQL Server 2008 R2 license.  Question:   Is it possible to migrate my SQL Server 2012 sharepoint database to SQL Server 2008? Will the new database be compatible with my sharepoint? could you please send me a link with the instructions?   thank you very much

What are my options if I need to move a database from SQL Server 2012(32bit) to SQL Server 2005(64bit)?  I know I cannot:   restore a backup of the database on SQL Server 2005 detach & attach   I know I can:   use import data wizard, and I tried it on one database, but it only moves data, and even that was troublesome as I needed to do a lot of work creating temp tables to maintain identity columns, recreating all FKs, indexes etc.    Is there an easier option?


So, one of my dwellers just came back from exploration and his happiness is only at 10%. I put him back to full health, reduced his radiation and even made him have sex. But he is still at 10% and I don't know why. I've gotten him working at a place he is good at. And his wife is also working with him but he is still at 10%. What should I do? Should I wait for his happiness to climb up or is it gonna stay at 10%?

All my vault dwellers look really unhappy and bummed out and aside from making babies I'm not sure how to make them happier.  Am I missing something really obvious?


How can i update a dictionary with keys from a list dict_keys and values from a list dict_values? I have tried using for loop in this way: for i in dict dict_keys:     for o in dict_values:         dict(i) = o

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


I have a data set that contains records of distinct groups identified by a 'type' variable. Depending on value of this 'type' variable certain other variables are either applicable or not. Effectively these variables will be null when they not applicable...however I didn't think the usual methods to handle null values such as imputation make sense in this scenario. One thought I had was to train separate models for each 'type' effectively getting rid of the variables that would not be applicable for each type. I am fairly new to the world of data science and machine learning and would appreciate hearing what other methods I can consider to handle this type of data set.

Consider a statistical problem where you have a response variable that you want to describe conditional on an explanatory variable and a nested variable, where the nested variable only arises as a meaningful variable for particular values of the explanatory variable.  In cases where the explanatory variable does not admit a meaningful nested variable, the latter is usually coded either as NA in the data set, or if it is coded with a value, that value is merely a placeholder that does not have any meaningful interpretation.  This situation tends to arise whenever you have an explanatory variable indicating the existence of a thing, and one or more nested variables describing the characteristics of that thing.  Some examples of this kind of situation in statistical problems are the following:   The explanatory variable is an indicator of whether a survey participant is married, and the nested variable is some characteristic of the spouse (e.g., education, age, etc.); The explanatory variable is an indicator of the presence of an item in a space, and the nested variable is a measure of some characteristic of the item (e.g., size, distance, etc.); The explanatory variable is an indicator of the occurrence of an event and the nested variable is a description of some characteristic of the event (e.g., duration, magnitude, etc.).   In these kinds of situations, we often want to build a regression-type model (in the broad sense that includes GLMs, GLMMs, etc.) describing the relationship between the response variable and the other variables.  It is not obvious how to deal with the nested variable in this type of model.  Question: How do we deal with the nested variable in this type of model?    Note: This question is designed to give a generalised answer to a recurring question on  regarding nested variables in regression (see e.g., , ,  and ).  This question is designed to give a generalised context-independent example of this problem.


I'm kinda new to OpenGL, I am currently trying to make a class which can handle drawing vertices into the screen and it doesn't seem to work, it doesn't draw anything. I know that this problem has nothing to do with shaders cz It works when I do it without a class (directly in the main.cpp file). Model.h #include <glad/glad.h> class Model { private:     GLuint VAO, VBO, EBO;  public:     Model(float vertices[], unsigned int indices[]);     void Draw(); };  Model.cpp #include "Model.h" Model::Model(float vertices[], unsigned int indices[]) {     glGenVertexArrays(1, &this->VAO);     glGenBuffers(1, &this->VBO);     glGenBuffers(1, &this->EBO);      glBindVertexArray(this->VAO);      glBindBuffer(GL_ARRAY_BUFFER, this->VBO);     glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);      glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, this->EBO);     glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);      glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0);     glEnableVertexAttribArray(0);      glBindBuffer(GL_ARRAY_BUFFER, 0);     glBindVertexArray(0); }  void Model::Draw() {     glBindVertexArray(VAO);     glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0); }  Main.cpp #include <iostream> #include "Model.h" #include "Shader.h" #include "Window.h"  int main() { std::cout << "Start" << std::endl;  float vertices[] = {      0.5f,  0.5f, 0.0f,      0.5f, -0.5f, 0.0f,     -0.5f, -0.5f, 0.0f,     -0.5f,  0.5f, 0.0f }; unsigned int indices[] = {     0, 1, 3,     1, 2, 3 };  Window window("MyWindow", 800, 600); window.Show();  Model square(vertices, indices);  Shader testShader("testVertexShader.glsl", "testFragmentShader.glsl");  glViewport(0, 0, 800, 600);  while (!window.ShouldClose()) {     /*glClearColor(0.2f, 0.3f, 0.3f, 1.0f);     glClear(GL_COLOR_BUFFER_BIT);*/           testShader.Use();     square.Draw();      window.Update(); }  testShader.Delete(); window.Close();  std::cout << "End" << std::endl;  return 0;  }

How do I determine the size of my array in C?   That is, the number of elements the array can hold?


The "Manage off-topic close reasons" page should be easily accessible. As of now a mod has to keep going to random questions and finding it through the close dialog. Can you please add a link to it, in the Moderator Tools?

I would like the link where moderators can edit close reasons to be part of the moderator links page.  Please add:   To the page:   Perhaps under the Data Alteration Pages section


I am given that $p(x)$ is a polynomial of the form $x^n + a_{n-1}x^{n-1}+ ... + a_1 x + a_0$, where $a_1, a_2, ... , a_n$ are integers.  I am also given that $x = \frac{a}{b}$, $\gcd(a,b) = 1$ (thus $\frac{a}{b}$ are in their lowest terms), $p(\frac{a}{b}) = 0$, and $|b| > 1$  Use the factorization of $b$ to contradict the assumption that $a$ and $b$ are coprime.   We have been using the Bezout theorem quite a bit in class so I first started off with that then took it to the power of $n$, so $(ax + by)^n$, then attempted to use the binomial theorem in an attempt to group the $b^i$ terms together, but after that I am unsure how to proceed in proving that $a$ and $b$ are coprime.  Any hint or help is appreciated. Thank you.

Let $P \in \mathbb{Z}[x], P(x) = \displaystyle\sum\limits_{j=0}^n a_j x^j, a_n \neq 0$ and $a_0 \neq 0$; if $p/q$ is a root of P (with p and q coprimes) then $p|a_0$ and $q|a_n$  I've managed to prove the first part ($p|a_0$) and I suppose I'm not far from proving the second, though I'd really like some feedback since I'm just starting with making proofs of my own.  Proof:  $P(x) = a_n(x-p/q)\displaystyle\prod\limits_{j=2}^n (x-r_j)$, with $r_j$ being the other n-1 roots of P(x).  It follows that $a_0 = a_n(-p/q)\displaystyle\prod\limits_{j=2}^n (-r_j)$  Then, $-p/q|a_0$ and obviously $p/q|a_0$. Rephrasing, $a_0 = l\frac{p}{q} = \frac{l}{q} p$ with $l \in \mathbb{Z}$.  This implies $p|a_0$ if $l/q \in \mathbb{Z}$, but this is trivial since $q|lp$ and q and p are coprimes, so $q|l$.  Therefore, $p|a_0$.  As for the second part, we want to see that $q_i|a_n \forall i \leq n$.   We define $d$ as the least common multiple of $\{q_1, q_2,...,q_n\}$. Then, $q_i|a_n \forall i \leq n \iff d|a_n$.  Also, it follows that $d|\displaystyle\prod\limits_{j=1}^n q_j$, so we want to see that $a_n = l \displaystyle\prod\limits_{j=1}^n q_j$ with $l \in \mathbb{Z}$. Here's where I have my doubts with the proof as I have no way to show that l is indeed an integer.  Rearranging the previously given equation for $a_0$:  $a_n = a_0 \displaystyle\prod\limits_{j=1}^n \frac{-q_j}{p_j}$  Using the previous reasoning, as $p_i|a_0 \forall i \leq n$, then $a_0 = k \displaystyle\prod\limits_{j=1}^n p_j$.  Replacing $a_0$:  $a_n = k \displaystyle\prod\limits_{j=1}^n -q_j$, which is equivalent to $q|a_n$ as shown earlier.


I want to split a comma separated string with JavaScript. How?

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


I am looking to create a Python script that will take X,Y coordinates from one field in an attribute table, compare them to another set of X,Y coordinates in a different field, and populate a field with the shortest distance between those two points based on a road layer.  So just to visualize it..  Origin:X,Y      Destination:X,Y         Distance: 130.34km

I am developing a few scripts in Python for QGIS 1.8 to automate some geo-tasks and one of them would be to calculate the shortest distance from a hospital to each building in a town.  I would like to take advantage of the already existing Qgis plugin but, as it is a C++ plugin, I am not sure whether it is possible to access it from Python? Is there a binding or a trick for that?  If not, any further advice would be appreciated! As the base data is OpenStreetMap data stored in a PostGIS DB, I may also try with pgRouting. But the QGIS plugin would be my favourite choice if possible.  PS: this question is close to this one:  but I believe it's still different enough to be worth a new thred.


public Item getItem(ulong itemId) {     Item item = items[itemId]     return item; }   Now the problem is: the callee of getItem must be able to retrieve information that item holds; but not modify it.  Sorry, but I know C++ better than C#... I'm afraid I must fall back to C++ for a teeny tiny while just to make myself clear what I'm trying to achieve... So this is what I'd do in C++ in this situation:  const Item& getItem(unsigned long itemId) {     const Item& item = items[itemId];     return item; }   Very well - now whoever called getItem may call getters on item, but not setters.  I need to achieve a similar result in C#... is it possible?

The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from within a const function, or try to use a non-const function of a const object. So without copying the const approach, is there a methodology I can use in C# that has the same ends?    I'm aware of immutability, but that doesn't really carry over to container objects to name but one example.


I want to show that $a(x) = \det[C(a)-x I]$ where $a(x)=a_0+ax+...+a_{r-1}x^{r-1}+x^r$ and $C(a)$ is the companion matrix:  $$\begin{vmatrix} 0&1&0&\dots& 0 \\ 0&0&1&\dots& 0 \\ 0&0&0&\dots& 0 \\ \vdots&&&&\vdots\\ 0&0&0&\dots& 1\\ -a_0&-a_1&-a_2&\dots&-a_{r-1} \end{vmatrix}$$  I've tried Laplace on this, and I sense that I need to reduce the final matrix in some triangular form, I'm little rusty in matrix algebra.  Some hints?

of a monic polynomial $f \in \mathbb F\left[x\right]$ in $1$ variable $x$ over a field $\mathbb F$ plays an important role in understanding the structure of finite dimensional $\mathbb F[x]$-modules.  It is an important fact that the characteristic polynomial and the minimal polynomial of $C(f)$ are both equal to $f$. This can be seen quite easily by induction on the degree of $f$.  Does anyone know a different proof of this fact? I would love to see a graph theoretic proof or a non inductive algebraic proof, but I would be happy with anything that makes it seem like more than a coincidence!


For example, a linear transformation T that maps between two vector spaces V and W. Does T map the zero vector of V to the zero vector of W? Is that a rule for linear transformations? Or no? I've never seen a rule like this explicitly stated, but at the same time I can't think of an example where this wouldn't be a case.

Let $T$ be a linear transformation from a vector space $V$ to $W$ that are defined over a field $\mathbb F$.   Now, $T(\mathbf0)=\mathbf0$.   Which implies the zero vector in $V$ can't move or be transformed to a new vector in $W$. Why is it so?   Does it also have a geometrical significance?


When I click on the "Request New Password" button, I get the following message:  Not Found  The requested URL /user/password was not found on this server.  Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.  Apache Server at berniesdogtraining.com Port 80

I have been given a Drupal site which I have to get it running.  I have Apache / Drupal / MySQL up and running, and created a new .conf file in Active Sites, and set the document location to /var/www/html/  I have edited my hosts file so that I have an entry for   127.0.0.1 samplesite.com   If I browse to samplesite.com/index.php I see the index of the site. So far so good. It is all styled, and as I see genuine content I must be hitting the database  Now no matter what link I click on on that page, I get a 404 error. (Looking in the log files its a 404 523 error if that has any bearing on it.)  I then found out the admin userid (using drush), reset the password, and cleared all caches. Still the 404 errors.  If I go to samplesite.com/user or samplesite.com/admin, I still get the 404 error, not an admin login page.  As this is an existing site, and works online, I am blaming something in my setup / configuration (being as the url on a failed link is similar to samplesite.com/about, I am assuming it is in the navigation configuration, but now I am stuck).  Is there an apache url rewriting module (or drupal one?) that needs some configuration? Or can anyone suggest something else I may have overlooked in apache / drupal configuration?  I now have the line $base-url = 'samplesite.com'; in my settings.php file, and none of the other urls work. However it accepts that I am logged in as admin as I have an additional admin menu at the top of the page. (none of the links work though) Curiously, if I disable wifi, then the page doesn't load at all (I wouldn't have thought that wifi on or off would affect localhost)  Ok, My fix came when I followed this thread   I needed to add in the following.  <Directory /var/www/html>    RewriteEngine on    RewriteBase /    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </Directory>   However I only got here because of the help I received along the way, I think this was just the missing piece.


I am working on a project and building automation test suite for a webpage. A certain part of the webpage looks like this.  The corresponding HTML is as follows:
                                                                        Try us out for 14 days. If you aren't satisfied, we'll refund your money.
                                                                                Our customer service team is available Monday to Friday,
                                                                                8AM - 12AM (Midnight) EDT, via phone, email or live chat.
  I want to write an XPath for just the text "Our customer service team is available Monday to Friday,". In particular, I want to verify the text in my automation suite of the corresponding line. Is there any way to write an xpath using contains() or text()? P.S. I tried the following xpath //p[@class='customer-service']/text()[2]  and this was the result.

I have below HTML code, in that I have to come up with XPath for the 2nd line of text: "Policy Count - 0".
 "Premium Volume - $"
 "Policy Count - 0"
  How do I do that?


I found the following puzzle:     Use all the digits from 1 to 9 without repeating, to form two numbers such that     their product is maximum. A digit used should be unique across both the numbers. For example, the numbers formed could be 1234 and 56789.   I know that the answer is 9642 and 87531.  It is obvious that digits should form the numbers in descending order.  I've spent so much time trying to prove that:   for the maximum product numbers should be 4-digit and 5-digit why people use greedy algorithm for solving the puzzle so that they start from the first digit and add one by one other digits?   Thank you.

Given $A = B \times C$  Using any $9$ digits form two numbers $B$ and $C$.All digits must be used exactly once.   What is the maximum possible value of $A$?


More specifically, what is $e^i$ (exact value)? Can I use regular exponent rules for imaginary numbers? Do regular exponent rules apply to both (like a complex number)?

What is a real number to the power of an imaginary or complex number? e.g. 3i. I have searched through sites about imaginary numbers, but none seem to say anything about imaginary indices. Examples and explanations would be appreciated.


I've got a problem with removing duplicates at runtime from my list of object.  I would like to remove duplicates from my list of object and then set counter=counter+1 of base object.  public class MyObject  {    MyObject(string name)     {       this.counter = 0;       this.name = name;    }    public string name;    public int counter; }  List<MyObject> objects_list = new List<MyObject>(); objects_list.Add(new MyObject("john")); objects_list.Add(new MyObject("anna")); objects_list.Add(new MyObject("john")); foreach (MyObject my_object in objects_list)  {     foreach (MyObject my_second_object in objects_list)      {         if (my_object.name == my_second_object.name)          {            my_object.counter = my_object.counter + 1;            objects_list.remove(my_second_object);         }     } }   It return an error, because objects_list is modified at runtime. How can I get this working?

Anyone have a quick method for de-duplicating a generic List in C#?


I have not come up with a solution for the following warning:  main.cpp: In member function 'void MyClass::increase()': main.cpp:350: warning: conversion to 'short unsigned int' from 'int' may alter its value   main.cpp:  class MyClass { public:    MyClass() : myShort(0) { }    void increase() { myShort *= 60; } // Line 350  private:    unsigned short myShort; };  int main(int argc, char** argv) {    MyClass myObj;    myObj.increase(); }

Very basic question: how do I write a short literal in C++?  I know the following:   2 is an int 2U is an unsigned int 2L is a long 2LL is a long long 2.0f is a float 2.0 is a double '\2' is a char.   But how would I write a short literal?  I tried 2S but that gives a compiler warning.


This is a search result for         I realize (from seeing the above search results) that my question hasn't been asked before. But as soon as I start typing, all the relevant results appear in the Questions that may already have your answer (which should've appeared on my first search!!)        Just for fun,         I no longer bother with searching first and just start typing my question instead.   Why does the [Questions that may already...] functionality work better than the search bar?

The search engine that works behind the scenes to generate the "Questions that may already have your answer" is staggeringly amazing; even this first draft at a not very good title brings up exactly the question I was going to ask as the first result:   On the other hand, the search bar doesn't do quite such a good job:   So I'd like to propose that a little of the "New question screen" magic go into the search bar. Or to propose this in a little less wishy-washy way; that (in addition to normal search results) top results from the "Questions that may already have your answer" box go into the search box as if the search had been phrased as a new question. This will help casual users who may search but may not (attempt to) ask. This will additionally be helpful for experienced users because (due to draft saving) you cannot have two independent new question pages open at once. As such, I can't use the new question-based search while also drafting a question


I'm asking a solution for general case, but specific one may work either. I have installed oracle jdk, used update-java-alternative to make that default and uninstalled openjdk that came with my distribution. Now when I install a package that depends on jre/java, it installs openjdk-jre again. So one possible solution is to keep that openjdk installed. I am asking if there exists another, ie to pretend that openjdk-jre is installed, while in truth it's not. I seek for solution that would stand any update, which in the first solution is not possible (default jre world be set to openjdk one after update). Any standard way for debian is preferred to some hacky way to edit apt list files.

I installed Opera 12.16 from a .deb for reasons. Just assume that I need this specific browser of this specific version and that there’s no alternative.  However, that deb depends on packages (such as the gstreamer0.10 series) which are not in my distribution anymore (Debian testing). This makes apt fail on every operation except apt remove opera with dependency errors:  # apt install cli-common Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies:  opera : Depends: gstreamer0.10-plugins-good but it is not installable          Recommends: flashplugin-nonfree but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).   apt --fix-broken install will just propose to remove opera:  # apt --fix-broken install Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED:   opera 0 upgraded, 0 newly installed, 1 to remove and 92 not upgraded. 1 not fully installed or removed. After this operation, 46.6 MB disk space will be freed. Do you want to continue? [Y/n]   Currently, my workaround is to install Opera when I need it, and remove it as soon as anything else needs to be done with apt. This is annoying.  Any suggestions? Ideally, I’d like to make apt ignore the dependencies of opera forever, since it works well-enough for my purposes.


Find all functions $f:\mathbb{N}\to\mathbb{N}$ such that $$f(m^{2}+f(n))=f(m)^{2}+n\text {, for all }m,n\in \mathbb N$$ I was initially unable to solve this problem, so I referred to a hint. The hint is as follows: Let $f(1)=k$. From the given equation, we get $f(m^{2}+k)=1+f(m)^{2}$ and $1+k^{2}=f(1+k)$. Use this to prove that $$f(f(m))^{2}-f(k)^{2}=m^{2}-1 \ \ \ \ \ \ (*)$$ Taking $m=2$, conclude that $f(k)=1 \ \ \ (*)$. Obtain $f(f(m))=m$ for all $m\in \mathbb{N}$. Use this to prove that $$f(n+1)=f(n)+k^{2} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*)$$ By induction $f(n+1)=f(1)+nk^{2}=k+nk^{2}$. Conclude that $k=1$ and hence $f(n)=n$ for all $n\in \mathbb{N}$ This solution is very unclear to me. I have marked all unclear steps with $(*)$. Please breakdown this solution and provide well explained arguments for the marked steps. Please try to use the same notation I have provided in the solution for ease of understanding. Thanks for all help :)

Find all functions such that $$ f(m^2 + f(n)) = f(m)^2 + n$$ for all natural numbers (1,2,3,4,..)  I have been stuck on this problem.   I have tried to set f(1) = k, however, did not make any progress.


Does $n^{1000000}/2^{n}$ converge as $n\rightarrow+\infty$?  To solve this problem, I am only allowed to use elementary properties of limits. This is what I tried. For $n > 1000000$, one has that \begin{align*} \frac{n^{1000000}}{2^{n}} = \left(\frac{n}{2}\right)^{1000000}\times\left(\frac{1}{2}\right)^{n-1000000} \end{align*}  But then I get stuck. This is not homework. Could someone help me out?

In other words, how to prove:  For all real constants $a$ and $b$ such that $a > 1$, $$\lim_{n\to\infty}\frac{n^b}{a^n} = 0$$  I know the definition of limit but I feel that it's not enough to prove this theorem.


I recently shifted to Ubuntu 12.04 from windows 7. I completely removed Windows and then installed Ubuntu.  However, I can't find a way to download and install drivers for my video and audio hardware like I used to be able to do in Windows. Could someone please explain to me how software and drivers, in general, are installed on Ubuntu. Is installing through 'Ubuntu Software Center' the only way to install them?  My laptop model is: Dell Inspiron 14 N4010 (i5/4gb/500gb). Kindly help. Thanks in advance.

I've just installed Ubuntu and I need either video, wireless, or some sort of other manufacturer (non-opensource) driver. How can I run the tool that will fetch all of these for me? I'd like graphical instructions.  Related:


So I just found  in which the accepted answer is only about an advertisement to an app that solves the problem. No offense to anyone, but isn't it too subjective? If the problem can't be solved without app, in my opinion, they should've just say something like:  Sorry, this problem cannot be solved without an extension or external app.  In my opinion, advertising in an answer is against the antitrust law, because accepted answers are always on top AND there is only one seat for an accepted answer. Why wasn't this answer moderated?

Over the course of the past several months, there have been one or more users who have been spamming about an XML parsing alternative named "VTD-XML". I have occasionally assisted the moderators by pointing these answers out to them, and they have responded by deleting the answers, and the offending user (which hasn't stopped this person from immediately creating another user account and continuing). Now, there is a user , who claims to be the actual author of VTD-XML. In my mind, several of his answers, like his  to  looks a great deal like the original spam.  has asked me why I consider his answer to be spam. I decided to do so in public, in an attempt to get him to engage with this community, assuming he's not another sock puppet of the original spammer.  My reason is simple: he's been answering with one or two lines of text, followed by the exact same link to the exact same site that the spammer was using:  VTD-XML may well be worth a look as it is 1/3~1/5 the memory usage of DOM   Now, maybe I'm wrong. Maybe this does not constitute spam. Maybe Mr. Zhang can explain to us why we should not treat these posts as spam. Let's see.  Somehow, I missed the fact that in the same question, on July 31 2009:  how about vtd-xml  http://vtd-xml.sf.net   This one was from a user named "Jimmy Zhang", which has since been deleted. Should I not be suspicious? Additionally, as pointed out by , he's answering a question about Delphi by posting a link to a site that doesn't even mention Delphi! Throughout the nonsense with the sock puppets, I kept asking for some real engagement from the sock puppet. It all just made VTD-XML look bad that instead of truly answering questions, we just kept getting incessant spam against old XML questions. Appeal Mr. Zhang, if you're not just desperately spamming StackOverflow because your product isn't selling, then please answer appropriate questions in a way that will actually help someone use your product to solve their problems.


How can I resolve SQL injection issue for order by clause in the classic asp application?  Here is the demo code:  strSort=request("sort") strSQL="select * from table1" select case strSort case "case1"    strSQL=strSQL & "order by " & strSort case "case2"    strSQL=strSQL & "order by" & strSort end select

What is a strong way to protect against sql injection for a classic asp app?  FYI I am using it with an access DB.  (I didnt write the app)


AWS's Ubuntu image gets bootstrapped with your credentials being added to a user called ubuntu. After the machine comes up, you can SSH into your new box with the ubuntu user.  This user is a sudoer, and based on the sudoers file, this user can do pretty much anything that root can, as long as you preface a command with sudo, without any password being entered. This negates  because there is no interactive password prompt. As far as I can tell, this also pretty much means that you should never run public-facing applications as this user, because if someone could find a way to execute shell commands via your application, they could take control of your system.  My real question is: why does this user exist? Why not just grant SSH access to the root account, with the expectations that someone would create unprivileged accounts to run an app? Doesn't having this ubuntu user just add confusion? I could see someone thinking "my systemd application isn't running as root, it's running as ubuntu, so I am safe".  Am I missing some purpose of this kind of user, which is not root, but is a passwordless sudoer?

Ubuntu disables root login for "security reasons". However it seems to me that it doesn't help with security at all.  If an intruder manages to get your login password for Ubuntu, then he also has the super-user password, since it's the same as the login password.  However if the root password is required, then just having the login won't help the intruder much - that's right isn't it?  So basically, what I want to know is: Why did Ubuntu choose to disable the root password? What are the security reasons?  Please don't answer according to what you "think" was the reason - I'm looking for an answer from official sources, or linked to them.


I cannot align #container and its content in the center vertically. I thought adding further
 tags would be a problematic and I cannot control them.  I want the text and #container to be aligned in the center of .content vertically without adding any extra space.    #container {   display: grid;   padding: 20px;   grid-template-areas: 'sideone sideone sidetwo sidetwo sidethree sidethree';   grid-gap: 20px;   text-align: center; }  .content {   display: table;   margin: 15px;   height: 500px;   width: 100%;   transition-duration: 0.15s;   border: 2px solid #3B3B3B; }

あ - ა

い - ი

う - უ

え - ე

お - ო

か - კა

さ - სა

た - ტა

な - მა

は - ჰა

き - კი

し - ში

ち - ჩი

に - ნი

み - მი

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


Let $(X,p)$ be a compact metric space. Suppose that $g:X\rightarrow X$ is a function such that for all $x_1,x_2\in X$ we have $p(g(x_1),g(x_2))\geq p(x_1,x_2)$.  Prove that, in fact, $g$ must be an isometry ($p(g(x_1),g(x_2))=p(x_1,x_2)$ for all $x_1,x_2\in X$) and that g is bijective.  I am stuck here, and I have tried many times, but still have no idea how to solve the question. Can someone tell me how to solve this question?

Let $(M,d)$ be a compact metric space and $f:M \to M$ such that $d(f(x),f(y)) \ge d(x,y) , \forall x,y \in M$ ; then how to prove that $d(f(x),f(y))=d(x,y) , \forall x,y \in M$ i.e. that $f$ is an isometry  ? I wanted to prove by contradiction , that suppose $\exists a,b \in M$ such that $d(f(a),f(b)) > d(a,b)$ ; I wanted to use the sequences $\{f^n(a)\}$ and $\{f^n(b)\}$ , these have convergent subsequences $\{f^{r_n}(a) \}$ and $\{f^{r_n}(b)\}$ ( without loss of generality we have extracted a common subsequence ) converging to say $x,y \in M $ respectively . Then $d (f^{r_n}(a) , f^{r_n}(b))$ converges to $d(x,y) >d(a,b)$ ;  but I don't know what to do next , please help . Thanks in advance


I am using a Hercules MTB thriller,I drive a maximum of 75 km per week. When should I schedule periodic, quarterly full service for the bike?

It is forecast to rain this weekend so I was thinking I would drop a tarp down over my living room floor and give my bikes a bit of a tune up.    Question  What maintenance needs to be done on your bike?  How often?  Background  Generally speaking I am of the mind: "If it is not broken don't fix it".  However I recognize that there are preventative measures that I can take that will drastically improve the life of my bike and the expense of repairing it.    I am pretty good at noticing when something changes on my bike.  (For example: something is making a slightly different noise, something is not spinning well, etc).  One think that I am concerned about however is when something gradually gets worse in increments that are not noticeable.  For example you forget to oil part X and it gets increasingly noisier or harder to spin etc.  I am concerned that I would not notice it.    I like to do my own work when possible but I will bring the bike in for work when necessary.    Answer Structure  The best answer will have this format:   Daily   this thing this other thing   Weekly   Bla   Monthly   Something   Yearly   What else?   Ideally the bullets should be sorted by importance.  Importance is defined by expense.  If you don't do this thing then it will cost you $X.    It is not necessary to provide a description for each procedure as we can open additional questions for each of those procedures.    Similar Questions      Addresses how much maintenance a bike needs but does not lay out a clear schedule     What to do before putting your bike in storage for winter      Edit (To get the bounty)  What I am looking for is in terms of the Monthly/Yearly sections is what a bike shop would do during their yearly tune ups.  I do most of my own repairs/work and I want to make sure that I am not missing anything.


Are there maximal ideals of $k[x_1, x_2, \ldots]$ (infinite indeterminates) that are not $(x_1 - a_1, \ldots...)$ for $k$ algebraically closed?   I don't think one can apply the Nullstellensatz here...  just thinking about weird counter examples in algebraic geometry, and I'm curious since this ring $k[x_1, \ldots]$ has come up a few times.  Note that there are a countable set of indeterminates.

Let $k$ be an algebraically closed field. Nullstellensatz states that the maximal ideals of the polynomial ring $R=k[X_1,\dots,X_n]$ are precisely those of the form $\langle X_1-a_1,\dots,X_n-a_n\rangle$, with $(a_1,\dots,a_n)\in k^n$.     What if we are working with infinitely many variables, say $\{X_i\}_{i\in I}$, being $I$ an infinite set? Again, the ideals of the form $\bigl\langle\{X_i-a_i: i\in I\}\bigr\rangle$, with $(a_i)_{i\in I}\subseteq k$ are maximal (even if $k$ is not algebraically closed), but what about the converse?


I am interested in finding the functions $f:\mathbb{R}^n \to \mathbb{R}^n$ for which $f \circ U = U \circ f$ for all orthogonal transformations $U:\mathbb{R}^n \to \mathbb{R}^n$. Note that $f$ need not be linear. Any ideas on the conditions on $f$ ?

A random vector $V \in \mathbb{R}^n$ is said to be spherically symmetric. If for every orthogonal matrix  $A$   the distribution of $AV$ is the same as the distribution of $V$.   My question: Let $W$ be  i.i.d. zero mean Gaussian random variable.     Can we show that  for a spherically symmetric $V$ the conditional expectation  \begin{align} E[V|V+W=t]=   g(\|t\|).  \end{align}  That is the conditional expectation is only a function of the magnitude.   My attempt:  \begin{align} E[V|V+W=t]= \int  V  \frac{f_W(t-v)}{f_{V+W}(t)} dP_V(v)= \frac{\int  v  f_W(t-v) dP_V(v)}{f_{V+W}(t)}= \frac{E[ V  f_W(t-V) ]}{f_{V+W}(t)} \end{align}  Therefore, we can show that the two functions in the above ratio only depend on $\|t\|$.   Observe that we can write $t= \|t\| u_t$  where $u_t$ is a unit vector. Then, for any orthogonal matrix $A$ \begin{align} f_{V+W}(t)=f_{V+W}(\|t\|, u_t)&= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|t-V  \|^2}{2}} ]\\ &= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|t-AV  \|^2}{2}} ]\\ &= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|tA^{-1}-V  \|^2}{2}} ]\\ &= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|t A^T-V  \|^2}{2}} ]\\ &= f_{V+W}(tA^T)\\ &= f_{V+W}(\|t\|,  u_t A^T) \end{align}  Since, $A$ was arbitrary  we have that $f_{V+W}(t)=h(\|t\|)$(i.e., only depends on the magnitute).  Now I am not sure how to show that $E[ V  f_W(t-V) ]$ only depends on $\|t\|$?


I have a text file in which I have, for example, 1084 elements. I list them.  import csv a = [] with open('example.txt', 'r') as csvfile:     file_name = csv.reader(csvfile, delimiter='\t')     for row in file_name:         a.append(int(row[1])) print(a)  [144, 67, 5, 23, 64...456, 78, 124]   Next, I need to take the average of every one hundred elements of the list, average the last 84 elements and bring it to a new list. How exactly can I do this? Maybe with numpy?

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


Question is just out of interest.  If we take md5 hash from all integers from 1 to n, what is the first n, where its md5 collides with some previous md5?  Has anyone ever calculated and proved the smallest integer, where the collision occurs?  If not, is there considerations about md5 pseudo-randomness, which make probability of colliding md5-s higher for consecutive integers than for cryptographically random strings (birthday attack -> 2^64)?  This, for example, might be useful to know, when trying to hide real sequential order numbers.

I am interested in MD5 collisions for small input messages.  The collision examples given at  show two different strings, where only a tiny amount of data has been changed to give the same md5, but it feels more like just changing values that are not factored into the calculation. I've yet to come across an example where two seemingly random things reach the same value. I did try a small script to find out, but obviously it didn't get anywhere near far enough.  One formalisation of my question would be:  What is the minimal $b\in\mathbb N$  such that there exists $a\in[0,b)$ with $\mathbf{MD5}(a)=\mathbf{MD5}(b)$


my question is about creating objects which inherit from a "superclass".  I came up with a few different ways:  function PersonClass_1() {     this.age = 0;     this.gender = "female"; }  PersonClass_1.prototype.doAge = function () {     this.age++; }  // create a new Object that inherits from Person.prototype var p1 = Object.create(PersonClass_1.prototype);  // Call constructor function, with |this| set to the newly // created object |p1|. PersonClass_1.call(p1);    function PersonClass_2() {}  PersonClass_2.prototype.doAge = function () {     this.age++; }  PersonClass_2.prototype.age = 0; PersonClass_2.prototype.gender = "female";  // create a new Object that inherits from Person.prototype var p2= Object.create(PersonClass_2.prototype);  // Call constructor function, with |this| set to the newly // created object |p2|. PersonClass_2.call(p2);    function PersonClass_3() {     this.age = 0;     this.gender = "female";     this.doAge = function () {         this.age++;     } }  // create a new Object that inherits from Person.prototype var p3 = Object.create(PersonClass_3.prototype);  // Call constructor function, with |this| set to the newly // created object |p3|. PersonClass_3.call(p3);   So what I end up with is three objects. The only difference seems to be the actual location of their attributes.  PersonClass_1 has the age and gender in the object itself, and the doAge in its prototype.  PersonClass_2 has the age, gender and doAge all in its prototype.  PersonClass_3 has the age, gender and doAge all in the object itself.  But the behaviour of the three Persons seems to be all the same. Or is their any major difference?

What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };


Let's say I have a UserControl with several child controls  <UserControl x:Class="Any.AnyControl"     <Grid>         <Label Name="label1" Background="Black" />         ... more controls here       </Grid> </UserControl>   and I use it in MainWindow like so:  <Window>     <Grid>          <local:AnyControl/>          // I want to access AnyControl label1 Background property here      </Grid> </Window>   I know how I can access AnyControl label1 Background property in code-behind, but is there any way I can access it in parent XAML?  my code now: in parent XAML  <local:AlertControl LabelBackground="Blue">                              in UserControl    <Label Background="{Binding LabelBackground, RelativeSource={RelativeSource AncestorType=UserControl}}" />   and try with this too  <Label Background="{Binding LabelBackground, RelativeSource={RelativeSource AncestorType=local:AlertControl}}" />

When developing WPF UserControls, what is the best way to expose a DependencyProperty of a child control as a DependencyProperty of the UserControl?  The following example shows how I would currently expose the Text property of a TextBox inside a UserControl. Surely there is a better / simpler way to accomplish this?     <UserControl x:Class="WpfApplication3.UserControl1"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">         <StackPanel Background="LightCyan">             <TextBox Margin="8" Text="{Binding Text, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />         </StackPanel>     </UserControl>      using System;     using System.Windows;     using System.Windows.Controls;          namespace WpfApplication3     {         public partial class UserControl1 : UserControl         {             public static DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(UserControl1), new PropertyMetadata(null));             public string Text             {                 get { return GetValue(TextProperty) as string; }                 set { SetValue(TextProperty, value); }             }                  public UserControl1() { InitializeComponent(); }         }     }


I'm new learner and often confused with countable nouns.  Is there any way that I can know whether a noun is a countable noun?  Thanks

Not all the time I have access to dictionaries. In school, I learned that abstract nouns are not countable; however, English is an ever-evolving language and nothing can be so certain here including  Experts are of only one opinion – it depends on the context!  Now, when it comes to certain nouns, I'm not sure how do natives guess them countable/uncountable. As a non-native speaker, it's difficult for me.   Say – equipment! Now, for a non-native like me, equipment is certainly countable! Equipment for this and that...so two equipments. But then, I'm wrong! I can still guess mood or freedom to be countable - mood of romance, mood of dullness – there is more than one mood so ‘moods’. Likewise, freedom of speech, freedom of roaming here and there - so there's more than one freedom – freedoms!   Is there any way to guess whether a noun is countable? Especially in those cases where I haven't any access to a dictionary. Is there any trick– like I found those tricks for freedom/mood.?


I only remember reading it as a child, so not sure if it was published in 90's or 2000's. In it, a girl is aware of mythological creatures and people who feel an affinity to them, such as banshees, unicorns, harpies or kraken. Each kind of creature is assigned an element, so kraken is water, harpies are air, dragons are fire etc. The girl thinks she discovers her creature and the medium society leaves it at that, but then she discovers she has affinity to another creature, then another, then she finds out she's this universal medium for all kinds of mythological creatures.  There's a big baddy who wants her for her powers, but I can't remember his ultimate goal.  Anyone remember reading anything similar? Cheers.

I remember reading a series of children's (or possibly young-adult) books some time between 2000 and 2010, about a girl (I think) who was able to commune with animals somehow. She was able to use their powers in the form of conceptualised weapons, although the use of such a weapon often didn't bear any real resemblance to the physical weapon it was named after. For example, I think the "sword" was a way of combining the power of lots of creatures together to do something - I think she used it to heal an animal. Other named weapons were the hauberk (or possibly halberd - I had only a vague notion of what these words meant when I read the books) and (I think) the shield, although I forget what they did. The girl in question has some natural affinity with animals. Over the course of the first book she learns that people exist who are capable of bonding with one particular kind of animal and gaining some of the powers of that animal; but she is special in that she can bond with any animal, and she learns to use this power over the course of the book. She learns that others like her used to exist, but she is the only one known at the time of the first book. I think some of the animals involved might be mythical. In one of the later books, there was something to do with a wind farm, and I remember a scene where it's mentioned that the wind turbines were spinning very fast in a catastrophic storm. There was definitely a kraken at some point in the series. I was in the UK, and I suspect the books were UK in origin. I want to say that the girl's name was Meg, but I'm only about 5% confident on that.


#include <stdio.h> int main() {     int n, range, i;     printf("Enter an integer to find multiplication table: ");     scanf("%d",&n);     printf("Enter range of multiplication table:");     scanf("%d",&range);     for(i=1;i<=range;++i) {     printf("%d * %d = %d\n", n, i, n*i); } return 0;   }  I need to display odd next to multiples that are odd and even next to even multiples.

How can I check if a given number is even or odd in C?


I have a function that rounds a value according to a policy  double round(double f, Policy p);   What I want to do now is to build a version of this that can be applied only to a container of doubles (there's no point in having a container of any other type due to the way the rounding works).  template <class Iterable> Iterable<double> round(     Iterable<double> y, Policy p){     for (auto&& e : y){         e = round(e, p);     }     return y; }   I know my template syntax is not correct, but what should it be?

I've seen some examples of C++ using template template parameters (that is templates which take templates as parameters) to do policy-based class design. What other uses does this technique have?