How can the game graphics be stabilised when after each frame hundreds of calculations are taking place?

I am building a very basic 2D game purely using pygame library in Python 3x. The "game object" is blit(ed) onto the screen using a loop and after each pass, there are calculations taking place in the background for example, to test for collision. Now as the game get's more complex with more features, the calculations take longer and hence the "game object" is put onto the screen once, but disappears for a split second when the calculations are taking place and appears again during the second pass, meaning it flickers. How can I tackle this problem? I cannot move ahead with more complex calculations for other features without avoiding the flickering due to more time required for the calculations.


Continue loop after the first assignment

I have a problem with contiunation of the loop. Here is a code of the hangman for Python. Although using the list or just print for each character seem to be easier ways to proceed the task, I would like to know, where is the problem of the presented solution in order to avoid the future troubles.  word='heksakosjokontaheksafobia'  def hangman(input, word_to_guess):     users_guess=input('What is the first letter of your first thought?\n')     print (users_guess)     if users_guess in word_to_guess:         unknown_chararcters='*'*len(word_to_guess) # The creation of a string showing number of uknown characters         print(unknown_characters)         for char in word_to_guess:             if char==users_guess: # Checking whether input is included in word_to_guess                 ind=word_to_guess.index(char)                 unknown_characters=unknown_characters[:ind]+users_guess+unknown_characters[ind+1:] # Substitution of '*' with input             continue         print(unknown_characters) hangman(input, word)   As you can see, the word includes many 'a', however for input==a the output is:  What is the first letter of your first thought? a ************************* ****a********************   How can I force the loop to iterate over the following characters of a string?


How do I get bash completion to work with aliases?

Case in point:   I'm a on mac with bash v3.2.17, I'm using git installed via macports with the bash_completion variant.  When I type git checkout m<tab>. for example, I get it completed to master.  However, I've got an alias to git checkout, gco. When I type gco m<tab>, I don't get the branch name autocompleted.  Ideally I'd like autocompletion to just magically work for all my aliases. Is it possible? Failing that, I'd like to manually customize it for each alias. So, how do I go about either?


Use of Predictable Network Interface Names with alternate kernels

Almost constantly, I use kernels from the , or kernels I have compiled myself, using the Ubuntu kernel configuration.  The problem is when I am using the stock kernel it seems to default to using predictable network interface names (i.e. "p4p1"), but when I use any alternate kernel it seems to default to using the old method (i.e. "eth0").  While not really relevant to this question, I had a hard disk failure on my test computer and am doing a new install of Ubuntu Server 14.04.2.  I have not been able to determine what is the difference between the kernels. I suspect a kernel configuration parameter, but have been unable to identify which one.  My question: How can I make predictable network interface names work consistently across all kernels?  Additional notes: Somewhere I saw to disable predictable network interface names to add this to grub:  GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"   so, I thought the opposite might help:  GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=1"   but it made no difference. Actually, I can never get the non-stock kernel to use biosdevname, no matter the setting. And I can never get the stock kernel to generate a /etc/udev/rules.d/70-persistent-net.rules file (even though, that is not what I want), no matter the setting of net.ifnames. If I have net.ifnames=1, then at least the non-stock kernel doesn't generate an incorrect /etc/udev/rules.d/70-persistent-net.rules file.  Excerpts from /var/log/udev: stock kernel:  KERNEL[9.216730] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 IFINDEX=2 INTERFACE=p4p1 SEQNUM=1945 SUBSYSTEM=net ... UDEV  [9.241073] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 ID_BUS=pci ID_MODEL_FROM_DATABASE=P8P67 and other motherboards ID_MODEL_ID=0x8168 ID_NET_NAME_MAC=enxf46d04652d8e ID_NET_NAME_PATH=enp3s0 ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. ID_PCI_CLASS_FROM_DATABASE=Network controller ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Co., Ltd. ID_VENDOR_ID=0x10ec IFINDEX=2 INTERFACE=p4p1   From Ubuntu PPA kernel 4.1RC5:  KERNEL[10.772566] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 IFINDEX=2 INTERFACE=eth0 SEQNUM=1962 SUBSYSTEM=net ... UDEV  [11.185866] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 ID_BUS=pci ID_MODEL_FROM_DATABASE=P8P67 and other motherboards ID_MODEL_ID=0x8168 ID_NET_NAME_MAC=enxf46d04652d8e ID_NET_NAME_PATH=enp3s0 ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. ID_PCI_CLASS_FROM_DATABASE=Network controller ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Co., Ltd. ID_VENDOR_ID=0x10ec IFINDEX=2 INTERFACE=eth0 SEQNUM=1962 SUBSYSTEM=net USEC_INITIALIZED=3227   Note: I have temporarily moved past this issue by allowing a /etc/udev/rules.d/70-persistent-net.rules file to be created, and then editing it for proper device names. Ultimately, I would like to get rid of the file.


How to Select host USB device for access from the guest?

I want to use USB on my VirtualBox Windows 10(guest).This is my USB   This is my VBoxManage output   VBoxManage list usbhost Host USB Devices:  UUID:               95889d61-8b37-4088-ae5b-fc6500bb05fc VendorId:           0x275d (275D) ProductId:          0x0ba6 (0BA6) Revision:           1.0 (0100) Port:               3 USB version/speed:  1/Low Product:            USB OPTICAL MOUSE  Address:            sysfs:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4//device:/dev/vboxusb/001/002 Current State:      Busy  UUID:               1d8a7ecf-85dd-4320-bd9b-03e7ae8540e3 VendorId:           0x058f (058F) ProductId:          0x6387 (6387) Revision:           1.5 (0105) Port:               0 USB version/speed:  2/High Manufacturer:       Generic Product:            Mass Storage SerialNumber:       35CE8FB1 Address:            sysfs:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1//device:/dev/vboxusb/001/004 Current State:      Busy   But the problem is when I enter VirtualBox.Where should I find device to properly set host and guest?  EDIT  I HAVE SOLVED THIS,THIS helps


I have microwave oven, but I can't bake cakes and cookies in it. So I need an electric oven, but people are suggesting I buy a convection microwave to do both baking and normal microwaving. Will that work? Or do I really need to get an electric oven to bake?


Java split() method strips empty strings at the end?

Check out the below program.   try {     for (String data : Files.readAllLines(Paths.get("D:/sample.txt"))){         String[] de = data.split(";");         System.out.println("Length = " + de.length);     } } catch (IOException e) {     e.printStackTrace(); }   Sample.txt:   1;2;3;4 A;B;; a;b;c;   Output:   Length = 4 Length = 2 Length = 3   Why second and third output is giving 2 and 3 instead of 4. In sample.txt file, condition  for 2nd and 3rd line is should give newline(\n or enter) immediately after giving delimiter for the third field. Can anyone help me how to get length as 4 for 2nd and 3rd line without changing the condition of the sample.txt file and how to print the values of de[2] (throws  ArrayIndexOutOfBoundsException)?


Can I circle around an opponent and avoid opportunity attacks?

I have had trouble finding this information in the PHB.  If as a fighter I stand on one side of an enemy, can I move to the other side of him as long as I stay in reach so that I don't provoke an opportunity attack? (Presumably facing him at all times — like how enemies circle each other in the movies.)  e.g. Me (M) moving around an enemy (E) along the four-space path marked by arrows:   ☐ M ☐          ☐ → ↓  ☐ E ☐    ——>   ☐ E ↓  ☐ ☐ ☐          ☐ M ←    (Start)         (End)


When ever I try to install "dh-modaliases", why i am getting this answer: "fahadhemu@hemu:~$ apt-get install dh-modaliases E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?" please help


What is the certain difference between libraries and frameworks ? Especially in JavaScript

I was making research about frameworks as a beginner JavaScript learner and I saw people also use libraries so I didn't understand what is the difference between them and why people use these libraries and frameworks ?


How can i open the applications from the folder? Theres an option in mac, where you can access the applications folder and run an app from there. Is there a way in ubuntu?


What is the difference between blender render and cycles render?

Sorry noob question, I've been bouncing back and forth from different tutorials some are in cycles render and some are in blender render  can i ask what is the big difference? by the looks i am stuck in one when i start to place textures?  The first tut was a cup in cycles render, but then i picked up something else on blender render and i've been going that way for a while, other tuts have been going that way anyway. Which should i choose and i gather i will have to stick to it or re adjust all 'graphics'? I've done a bit of searching for a definitive answer but can't find anything :D  I'm surprised there is no cycles render tag.  Thanks for any help :)


Trying to recall series of novels set in palaeolithic Europe with time travel from near present

I read this series in the 80s I think. It was set in the Stone Age or earlier.   There was the usual disparate band of youngsters but who had time travelled from the near future. Think there was a reality show theme to it. One or more had increasing telekinetic powers.  The climax of one of the books was a was the breaching of a the straits of Gibraltar leading to the formation of the Mediterranean.


I have a  that notify me when some thing is modified on a directory.  I need to make indicator that takes over the notifications instead of pop up at my screen. I want the notifications to be displayed using this indicator.  So basically the question is devided into two parts:   How to make my own indicator? How to redirect the notifications to be displayed on the indicator?   Using Ubuntu 12.04


Confused why momentum is conserved in 2 falling bodies problem

I was doing a physics problem out of my textbook, which could paraphrased as follows:  There’s a frame suspended at rest from a coiled spring. A mass of flexbile putty is dropped onto the frame, causing the frame and putty to move downwards together. What is the maximum distance the frame goes downward?   The problem could clearly modeled as a collision followed by an energy conservation problem.   However, after thinking about it, I couldn’t come up with a justification why momentum should be conserved in this inelastic collision, considering that the net external forces on the frame-putty system are not zero (putty experiences gravitational force, frame experiences gravitational and elastic, right?).   After reviewing the solution, they give no justification why momentum should be conserved in this case, but they utilize an inelastic collision with momentum conservation.   Any thoughts on what I’m missing here?


How to change the timeout between sudo sessions?

What is the default timeout interval of a sudo session? How to edit that?


Ubuntu restore deleted files from find -delete

So I just recently downloaded Linux Ubuntu and I was experimenting with some of the functions to get used to Linux. While I was trying to learn I wrote in the terminal find . -delete -name (file name) thinking it would delete just that specific file BUT it deleted ALL my personal files in just about EVERY directory from home (I used this command in the home directory so kind of makes sense). I used a very specific file name though so I can't imagine that any other file would have the same name as it (it was "asdfasdf"). Is there anything I can do to restore all my information? And how should I have coded to just remove the specific file using find and NOT rm?


Hi I try to update Ubuntu 20.10 to 21.04 but they showing up to date   Please help me regrading this, Thank you.


Apt is seemingly unable to do anything useful for me, repeatedly giving messages of this form:  dpkg: dependency problems prevent configuration of linux-server:  linux-server depends on linux-image-server (= 3.2.0.37.44); however:   Version of linux-image-server on system is 3.2.0.37.45.  linux-server depends on linux-headers-server (= 3.2.0.37.44); however:   Version of linux-headers-server on system is 3.2.0.37.45. dpkg: error processing linux-server (--configure):  dependency problems - leaving unconfigured   This is basically the same problem as  which got closed Duplicate to an answer that is totally useless for this situation.  None of the advice in  helps.    Explicitly:  sudo apt-get clean sudo apt-get autoclean sudo apt-get update   all have no not effect.  While  sudo apt-get -f install sudo dpkg --configure -a sudo apt-get -u dist-upgrade sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade   all give some form of the error message above.


How to prove $\int_0^1\frac{1-x}{(\ln x)(1+x)}\ dx=\ln\left(\frac2{\pi}\right)$?

A friend asked me to prove     $$\int_0^1\frac{1-x}{(\ln x)(1+x)}\ dx=\ln\left(\frac2{\pi}\right)$$   and here is my approach:  \begin{align} I&=\int_0^1\frac{1-x}{\ln x}\frac1{1+x}\ dx\\ &=\int_0^1\left(-\int_0^1x^y\ dy\right)\frac1{1+x}\ dx\\ &=\int_0^1\left(-\int_0^1\frac{x^y}{1+x}\ dx\right)\ dy\\ &=\int_0^1\left((-1)^n\sum_{n=1}^\infty\int_0^1x^{y+n-1}\ dx\right)\ dy\\ &=\int_0^1\left(\sum_{n=1}^\infty\frac{(-1)^n}{y+n}\right)\ dy\\ &=\sum_{n=1}^\infty(-1)^n\int_0^1\frac1{y+n}\ dy\\ &=\sum_{n=1}^\infty(-1)^n\left[\ln(n+1)-\ln(n)\right]\tag{1} \end{align}    Now how can we finish this alternating sum into $\ln\left(\frac2{\pi}\right)$?  My idea was to use   $$\operatorname{Li}_a(-1)=(1-2^{-a})\zeta(a)=\sum_{n=1}^\infty\frac{(-1)^n}{n^a}$$  and if we differentiate both sides with respect to $a$ we get  $$2^{1-a}(\zeta^{'}(a)-\ln2\zeta(a))-\zeta^{'}(a)=\sum_{n=1}^\infty\frac{(-1)^{n-1}\ln(n)}{n^a}\tag{2}$$  wolfram says that $\sum_{n=1}^\infty(-1)^n\ln(n)$ is divergent which means we can not take the limit for (2) where $a\mapsto 0$ which means we can not break the sum in (1) into two sums. So any idea how to do (1)?    Other question is, I tried to simplify the sum in (1) as follows  \begin{align} S&=\sum_{n=1}^\infty(-1)^n\left[\ln(n+1)-\ln(n)\right]\\ &=-\left[\ln(2)-\ln(1)\right]+\left[\ln(3)-\ln(2)\right]-\left[\ln(4)-\ln(3)\right]+\left[\ln(5)-\ln(4)\right]-...\\ &=-2\ln(2)+2\ln(3)-2\ln(4)+...\\ &=2\sum_{n=1}^\infty(-1)^n\ln(n+1) \end{align}  which is divergent again. what went wrong in my steps?  Thanks.


Most Efficient Way to Retrieve Date Ranges

What's the most efficient way to retrieve date ranges with a table structure like this?  create table SomeDateTable (     id int identity(1, 1) not null,     StartDate datetime not null,     EndDate datetime not null ) go   Say you want a range for both StartDate and EndDate.  So in other words, if StartDate falls in between @StartDateBegin and @StartDateEnd, and EndDate falls in between @EndDateBegin and @EndDateEnd, then do something.  I know there are a few ways to probably go about this, but what is the most advised?


Evaluating the limit $ \lim_{x \to 0} \frac{x}{p} \lfloor \frac{q}{x} \rfloor$

$$\lim_{x \to 0} \frac{x}{p} \left\lfloor \frac{q}{x} \right\rfloor =\;\;\; ?$$   My attempt:  $\frac{q}{x}-1 < \lfloor \frac{q}{x} \rfloor \le \frac {q}{x} $    . Then I consider four cases. In case 1 I took x and p both positive and then I multiplied above by $\frac{x}{p} $ and took limit and applied squeeze theorem. In other cases I did the same. My answer is $ \frac{q}{p} $.    Is the solution correct?


Restoring Database to a smaller test envrionment

I don't believe this is possible but wanted to check.  I've got a bi-weekly job running to restore the full backup to a test environment so the devs have something fresh to destroy without damaging the actual environment. The problem is cropping up that the test environment has less space than the production environment (it's stuck on one drive instead of a number of drives).  When copied across the database is now using over 95% of the hard disk allocation that it has. Is there any way along side the Restore Database WITH MOVE to resize those files? There is free space in a number of the files that could be shrunk and the file size is never going to change from the backup as it doesn't have data getting thrown at it so technically they can get cut all the way back to their data size.  The alternative, which I don't really want to do, is shrink the files on the production environment that have a bit too much space available at the minute.  Any tips or ideas of anything to do? Adding a new hard disk unfortunately isn't an option as the drive bay attached is full.  Ste


Why do I get black areas instead of pattern fills when compiling with xelatex?

I want to draw this picture with TikZ. I've used the following code. But the outcome was not good (fig1). While the Fig 2 is the correct form.  I do not know where is the problem? My texlive version is 2012.  Please guide me in this regard.   \begin{tikzpicture} \begin{axis}[area legend, axis x line=bottom, axis y line=left, domain=0:1, legend style={at={(0.03,0.97)}, anchor=north west}, axis on top,xmin=0] \addplot[pattern=crosshatch dots, pattern color=blue,draw=blue, samples=500] {sqrt(x)} \closedcycle; \addplot[pattern=crosshatch, pattern color=blue!30!white, draw=blue!30!white] {x^2} \closedcycle; \addplot[red,line legend] coordinates {(0,0) (1,1)}; \legend{$\sqrt x$,$x^2$,$x$} \end{axis} \end{tikzpicture}


I have this circuit and I need to find an equivalent resistance. I am very confused by the shape of the circuit because it appears like a more complex problem than I think it should be.  Ultimately, I think this is simply a series of 3 resistors and the total resistance should be 3R. Is this correct or do the extra wires matter?


What does it actually mean for an electron to be excited?

I've been confused on the connection between photons and electrons for a very long time.  Some examples of questions I"ve asked are linked here:      In their answers, when people address photons, they always talk about the electrons jumping to higher energy states and dropping to lower energy states.  But...what does this mean? Does a higher energy state mean that the electron is vibrating faster? That it's further away from the nucleus?  What ARE energy states, and why do changes in them produce photons?  What I've gotten from my other questions is that electron vibrations on one atom cause other electrons elsewhere to vibrate, and the transmission of that vibration from one electron to another IS a photon...so that means a change in an energy state the same thing as an electron vibration?


Find a basis for the vector space of symmetric matrices with an order of $n \times n$  This is my thought: by definition of symmetry, $a_{i,j}=a_{j,i}$. Therefore, the basis should consist ${n^2-n} \over 2$ matrices to determine each symmetric pair. In addition, it should also consist $n$ matrices to determine each term in the diagonal.    Therefore, the dimension of the vector space is ${n^2+n} \over 2$.   It's not hard to write down the above mathematically (in case it's true).    Two questions:     Am I right? Is that the desired basis? Is there a more efficent alternative to reprsent the basis?     Thanks!


What's the determinant of the male-biased birth sex ratio in humans?

Will the baby be male or female? If it was a random biological switch then, with a huge sample number, the sex ratio at birth would be exactly 50-50. But it isn't; the ratio is about 51-49 in favour of males. So how does this inequality arise?  Further to @Remib's comments. I was specifically thinking of the sex ratio in humans. Would it be true to say that the genetic determinant of the sex ratio would be exactly 50:50 M/F? If the disparity is environmental, then how does it work, and wouldn't an environmental effect be more variable than the 51:49% that we see?


Is the following definition of '$=$' between numbers (natural, whole, rational, real, complex) correct?  $a=b$ iff $a$ and $b$ denote the same number.     EDIT:   This is the first page of my book ""        It is said that '$=$' is an .  So what does the book mean by '$=$'?


How can i add custom menu in QGIS Using python

I am tried to add a custom main menu in QGIS Desktop Application. Here I am already added custom sub menu in QGIS but I want to add a custom main menu in QGIS using Python.  See the blow image.


Do the protons inside the nucleus repel each other by the electrostatic force? If they do, why doesn't the repulsion drive the protons apart so that the nuclei get disintegrated?


Show hidden apps (⌘H) in Mission Control

In OS X 10.8.5 if I hide an app with ⌘ cmd+H, it does not show in Mission Control until it has been revealed again via the app switcher or dock.  Is it possible to show windows for hidden apps in Mission Control?


Not serializable class with strings only

I have a class called Libro which contains strings only:  public class Libro {      private String titolo;     private String autore;     private String editore;     private String sottotitolo;     private String genere;     private String dpubb;     private String lpubb;     private String soggetto;     private String isbn;     private String note;     private String prezzo;     private String npag;      //getters, setters, constructors... }   Then I created an object called a belonging to the Libro class, and I tried to write it to a coso.dat file  try{     ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("C:\\Users\\Workbench\\Documents\\NetBeansProjects\\coso.dat"));     out.writeObject(a);     out.close(); }catch(Exception e) {System.out.println("Damn");}   Then I opened the file with NotePad and it seems that I tried to serialize an unserializable class:   ¬í {sr  java.io.NotSerializableException(Vx ç†5  xr java.io.ObjectStreamExceptiondÃäk9ûß  xr java.io.IOExceptionl€sde%ð«  xr java.lang.ExceptionÐý>;Ä  xr java.lang.ThrowableÕÆ5'9w¸Ë L causet Ljava/lang/Throwable;L  detailMessaget Ljava/lang/String;[  stackTracet [Ljava/lang/StackTraceElement;L suppressedExceptionst Ljava/util/List;xpq ~     t ginobook.classi.Librour [Ljava.lang.StackTraceElement;F*<<ý"9  xp   )sr java.lang.StackTraceElementa  Åš&6Ý… I  lineNumberL declaringClassq ~ L fileNameq ~ L  methodNameq ~ xp   t java.io.ObjectOutputStreamt ObjectOutputStream.javat writeObject0sq ~    \q ~ q ~ t writeObjectsq ~    ôt ginobook.forms.FormNuovot FormNuovo.javat btnCreaActionPerformedsq ~     q ~ q ~ t access$1500sq ~    Œt ginobook.forms.FormNuovo$15q ~ t actionPerformedsq ~    æt javax.swing.AbstractButtont AbstractButton.javat fireActionPerformedsq ~      ,t "javax.swing.AbstractButton$Handlerq ~ q ~ sq ~    ’t javax.swing.DefaultButtonModelt DefaultButtonModel.javaq ~  sq ~    q ~ $q ~ %t  setPressedsq ~     üt *javax.swing.plaf.basic.BasicButtonListenert BasicButtonListener.javat  mouseReleasedsq ~    …t java.awt.Componentt Component.javat processMouseEventsq ~    üt javax.swing.JComponentt JComponent.javaq ~ /sq ~    šq ~ -q ~ .t processEventsq ~    ¼t java.awt.Containert Container.javaq ~ 4sq ~    q ~ -q ~ .t dispatchEventImplsq ~    öq ~ 6q ~ 7q ~ 9sq ~    gq ~ -q ~ .t  dispatchEventsq ~    t java.awt.LightweightDispatcherq ~ 7t retargetMouseEventsq ~    q ~ >q ~ 7q ~ /sq ~    rq ~ >q ~ 7q ~ <sq ~    èq ~ 6q ~ 7q ~ 9sq ~   ºt java.awt.Windowt Window.javaq ~ 9sq ~    gq ~ -q ~ .q ~ <sq ~    öt java.awt.EventQueuet EventQueue.javaq ~ 9sq ~     aq ~ Hq ~ It  access$500sq ~    Åt java.awt.EventQueue$3q ~ It runsq ~    ¿q ~ Mq ~ Iq ~ Nsq ~  ÿÿÿþt java.security.AccessControllert AccessController.javat doPrivilegedsq ~     Lt 5java.security.ProtectionDomain$JavaSecurityAccessImplt ProtectionDomain.javat doIntersectionPrivilegesq ~     Vq ~ Uq ~ Vq ~ Wsq ~    Ût java.awt.EventQueue$4q ~ Iq ~ Nsq ~    Ùq ~ Zq ~ Iq ~ Nsq ~  ÿÿÿþq ~ Qq ~ Rq ~ Ssq ~     Lq ~ Uq ~ Vq ~ Wsq ~    Øq ~ Hq ~ Iq ~ <sq ~     Ét java.awt.EventDispatchThreadt EventDispatchThread.javat pumpOneEventForFilterssq ~     tq ~ `q ~ at pumpEventsForFiltersq ~     iq ~ `q ~ at pumpEventsForHierarchysq ~     eq ~ `q ~ at  pumpEventssq ~     ]q ~ `q ~ aq ~ hsq ~     Rq ~ `q ~ aq ~ Nsr &java.util.Collections$UnmodifiableListü%1µìŽ L listq ~ xr ,java.util.Collections$UnmodifiableCollectionB €Ë^÷ L ct Ljava/util/Collection;xpsr java.util.ArrayListxÒ™Ça I sizexp    w    xq ~ px   What did I do wrong..? I'm sorry if the question may seem stupid, but I just couldn't find any answer to it


I have this API which I can't change:  public interface A<T> {   void onClick(T widget); } public interface B<T> {   void use(A<T> a); }  public interface C {   B<?> apply(); }   I have an instance c of a C object, and I need to call apply(), and then call use() on the result and provide an Anonymous Inner Type. Here is what I tried:  B<Object> b = (B<Object>) c.apply(); b.use(new A<Object>() {    onClick(Object o) {    }  });   This works, however it produces a unchecked warning. Is it possible to avoid it?  Thanks


Non-Parametric Test Failed to reject the null

I have conducted 2 tests for my event study.   One is the parametric T test which rejected the null hypothesis, and my returns on event day is very significant.   However, I have conducts the non-parametric rank test. No matter using event window 1 day to 20 days, I couldn’t reject any null hypothesis. My return on the event day is way higher than the rest of the days, still it cannot reject the null hypothesis   Does anyone know what could affect on this? I have tested the normality, it is not normally distributed.   EDIT: @jbowman @EdM The event study deals with announcement returns of a large M&A transaction in the US. Data for the returns was obtained from Thomson Reuters. Assuming the data to be normally distributed I started using the market model and t-test. For the market returns I use the S&P 500 index. I use different event windows to see if for example, insider trading occurs before the event date. My estimation window is 220 days, event window in the largest specification 41 days.  The non-parametric rank test is the Corrado test, based on his paper from 1989 (see link below). I use this test since it is easily implemented in Excel, and it was recommended by my finance lecture as check for parametric tests. In the Corrado test abnormal returns obtained from the market model are ranked and compared to the average return.   On the announcement date I have large abnormal returns (31%) that are highly statistically significant at the 1% level (t-value 16.4). The abnormal return on the event date is ranked 1st, however for the announcement date I only obtain a p-value of 8%. Therefore, I wonder why a return ranked first, is not significant at conventional levels. I have checked my calculation multiple times, and do not think i have made an error. The file provided by my university shows similar results for announcement returns of another company, that has large abnormal returns on the announcement date. If I extend the event window, with multiple extreme returns occurring after another, the rank test becomes significant.   Corrado (1989):


Would a water manipulating Devil Fruit user be able to swim?

If all Devil Fruit users in One Piece anime are not capable of swimming, what about a Devil Fruit user whose ability is to control water? Can such a person able to swim or evade the Devil Fruit's curse?


Do we say "accuse somebody for" or "of"?

In one of my essays, I wrote:      She accused him for lack of morality    and it was marked as a syntactic error. Do we use for or of with the verb accuse?


Debian 10 systemd, how to disable autostart of graphical environments

I installed a graphical environment on a server and I have decided that I no longer want to run that environment at boot. How can I disable it with systemd? This is gnome desktop environment.


We thought we would generate postive SEO results by putting our links into sudomains off of our main site.  So our main site is foo.com and the link to a clinic would then be clinic1.foo.com, clinic2.foo.com, etc.  I'm only seeing via google webmaster tools that 2 of our pages are being indexed on foo.com, as we are early on in launching, should we abandon this scheme and go with a more traditional subdirectory URL structure?  If you would like to see the live version rather then the example above you can find it via  and you can simply click on any clinic.   Thanks in advance.


when I boot ubuntu 14.04 off a usb/DVD to install it wont recognize windows 8.1 and only says " erase disk and install ubuntu ". this is the ubuntu that will work with my laptop. i do not want to get rid of windows 8 and the recovery partition because it will be like throwing $200 down the drain.


Does the holodeck have to work extra hard for Geordi Laforge?

Geordi's visor is capable of seeing spectra outside of the normal human visual range. The holodeck creates its environment at least partly by creating actual holographic images. Such images would be simpler to simulate if they remained within that same visible spectrum. But this would not be as satisfying to Geordi as to most other participants.


Take a look at this picture (from APOD ):   I presume that rocks within rings smash each other.  Below the picture there is a note which says that Saturn's rings are about 1 km thick. Is it an explained phenomenon?


Specifically, how to upgrade from 18.04 to 18.10 (next development version) from the command-line?

I am ready to upgrade to the next version of Ubuntu.  I know that Ubuntu 18.10 has not yet been released, but I like to live on the edge.    It also makes me feel good to get massive upgrades of over 100 packages on some days.  This really makes me feel that I am getting my money's worth (even though it is free software and I haven't paid anything for it!).  I therefore would like to upgrade from Ubuntu 18.04 to 18.10 now.  When I run sudo do-release-upgrade, it tells me that no further upgrades are available.  Similarly in /etc/update-manager/release-upgrades there are no options for the development release.  Is there a special command to upgrade to the current development release?


I have this entry in my crontab (Proxmox 6 on Debian 10) : * 3 * * * scp -i /home/myuser/.ssh/proxmox_user.id_rsa /nas-zfs/backup/dump/vzdump-lxc-*-$(/bin/date +"%Y_%m_%d")* proxmox_user@proxmox2:/mnt/ftp-backup/proxmox1/dump  When I run scp... from the shell, it works and does not prompt me for a password. proxmox1 : server from which the files are copied proxmox2 : server to which the files are copied proxmox_user : a user on proxmox2 that can authenticate with a ssh key I cannot find the cron logs yet in Proxmox (it differs from a standard debian) but the job obviously fails to run.  Any help is of course welcome ;-)


using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; using System.Threading;   //Top of the script #pragma warning disable 0649  public class Player : MonoBehaviour {      // Initialize variables.     private Rigidbody rb;     private bool isMovingRight = false;     private bool hasPlayerStarted = false;     public float speed;     public float maxspeed;            [HideInInspector]     private bool canMove = true;      [SerializeField]     GameObject particle;          [SerializeField]     GameObject gems;      [SerializeField]     private Text scoreText;     private int score = 0;      public Text ScoreText { get => ScoreText1; set => ScoreText1 = value; }     public bool CanMove { get => CanMove1; set => CanMove1 = value; }     public bool CanMove1 { get => canMove; set => canMove = value; }     public Text ScoreText1 { get => scoreText; set => scoreText = value; }          // Use this for initialization     void Start () {         rb = this.GetComponent<Rigidbody> ();     }      // Update is called once per frame     void Update () {         if (Input.GetMouseButtonDown (0) && CanMove1 == true) {              // If the game hasen't started yet.             if (hasPlayerStarted == false) {                 hasPlayerStarted = true;                 StartCoroutine (ShowGems (2.5f));             }                              ChangeBoolean ();             ChangeDirection ();         }          if (Physics.Raycast (this.transform.position, Vector3.down * 2) == false) {             FallDown ();         }          // increase speed         if (speed < maxspeed)             speed += 0.1f * Time.deltaTime;      }        // Hide the gems for the first 2.5 seconds (avoiding bugs).     IEnumerator ShowGems (float count) {         yield return new WaitForSeconds (count);          // Checks if player hasn't fallen off before showing grms.         if (CanMove1 == true) {             gems.SetActive (true);         }     }               // Control player direction.     private void ChangeBoolean() {         isMovingRight = !isMovingRight;     }     private void ChangeDirection() {         if (isMovingRight == true) {             rb.velocity = new Vector3 (speed, 0f, 0f);         }          else {             rb.velocity = new Vector3 (0f,0f,speed);         }     }       // When the player falls off the platform.     private void FallDown() {         CanMove1 = false;         rb.velocity = new Vector3 (0f,-4f,0f);                         // Return to main menu.         StartCoroutine (ReturnToMainMenu (1.8f));                }      // Return to main menu.     IEnumerator ReturnToMainMenu (float count) {         yield return new WaitForSeconds (count);         SceneManager.LoadScene(0);               }       // When the player hits a gem.     void OnTriggerEnter(Collider other) {         if (other.gameObject.tag == "Gem") {              // Remove the gem.             Destroy (other.gameObject);                      // Create the particle effect.             GameObject _particle = Instantiate (particle) as GameObject;             _particle.transform.position = this.transform.position;             Destroy (_particle, 1f);              // Update the score.             score++;             ScoreText1.text = "Score: " + score.ToString();         }     } }


i have a line in crontab:  * * * * * date >> /home/pana/temperatures.txt; hddtemp /dev/sda >> /home/pana/temperatures.txt ;hddtemp /dev/sdb >> /home/pana/temperatures.txt ;sensors >> /home/pana/temperatures.txt ;printf "_________________________\n" >> /home/pana/temperatures.txt   And all i get is date, then double nothing, then sensors output and then printf. Hddtemp do not write output.  That file is 777, code is inserted through sudo crontab -e. Syslog:  Jan 19 14:17:01 knedlik CRON[7099]: (CRON) info (No MTA installed, discarding output) Jan 19 14:18:01 knedlik CRON[7108]: (root) CMD (date >> /home/pana/temperatures.txt; hddtemp /dev/sda >> /home/pana/temperatures.txt ;hddtemp /dev/sdb >> /home/pana/temperatures.txt ;sensors >> /home/pana/temperatures.txt ;printf "_________________________\n" >> /home/pana/temperatures.txt)   It is probably something dumb, but i cant see it!


$x_1,x_2,\dots,x_n$ are i.i.d RVs uniformly distributed on $\{1,2,\dots,N\}$.

Let $x_1,x_2,\dots,x_n$ be independent identically distributed random variables uniform on $\{1,2,\dots,N\}$, and let: $Y_n:=\text{the number of different elements in } \{x_1,x_2,\dots,x_n\}$.  Let $T:=\inf\{n:Y_n=N\}$.  What is $E\left[T\right]$?


Is it appropriate to ask for more than one recommendation letter from the same person

I will be applying for Ph.D programs in mathematics and hence I'll be needing letters of recommendation from my professors. There are two or three professors with whom I have a lot of academic interaction and which are also famous in their research areas. As such, having a recommendation letter from them can significantly increase my chances of selection.  Now my question is: Since I’ll be applying to 5–6 universities, is it appropriate to ask for that many recommendation letters from the same person? If not, then how many recommendation letter is considered to be “normal number” to ask for?   I would be very happy if some of the professors here, who themselves write recommendation letters can tell their experience.


Show that this field is finite and count its elements

I want to show that $\Bbb Z[i]/(2+3i)$ is a finite field and count it's elements.  I don't really know how to show that this field is finite.  I start by trying to understand that definition of this ring, so I write   $\Bbb Z[i]/(2+3i)=${$a+bi+2+3i:a,b \in \Bbb Z$}  I don't really know what to do from here. The knowledge needed to solve this shouldn't be much farther than the Chinese Remainder theorem, so I think it should be relatively simple but I don't see how to approach it.  Any help is appreciated, thanks


Problem with Mann-Whitney U-test for large samples

I am comparing two categories (A and B) of social media posts with the corresponding number of likes for each one. I am taking samples of equal size from each category at random and performing a Mann-Whitney U-test using scipy.stats module in Python.   I have chosen U-test since taking the mean of A or B data does not make a lot of sense in my case and I have been relying on medians so far for the comparisons.  I was performing the test with sample sizes in range of 20-100 which gave the expected results that the two categories were similar. So I decided to try larger samples. With sample sizes >= 200, the p-value of the U-statistic was < .05, which could indicate that the distributions of the two samples might be different (at alpha = 5%). However, the visual analysis of the samples (n = 200) shows otherwise, i.e. the difference in the two distributions is very minuscule (see below). Is there something I'm not getting/doing wrong/misinterpreting? Thanks a bunch in advance.


Objects retain info from previous loop iteration

I have a class called run_c which is being used to initialize and execute the run of a kinematics simulation. I assign default values to the attributes of run_c, such as x, before run_c.__init__() is executed. All __init__() is doing is extracting user-input values, aggregated into a dictionary, and assigning them to corresponding attributes in run_c if they exists. For example...  import vars.Defaults as dft class run_c:     ...    dt     = dft.dt    x      = dft.x0    states = [ [], [], [], [] ]    ...     def __init__(self, input):       for key in input.keys():          if hasattr(self, key): setattr(self, key, input[key])       ...       self.execute()   run_c.states is a list of lists that is being used to record the values of run_c attributes as they change with timesteps. Later, within run_c.execute(), I am storing x values in states[1], incrementing the timestep dt, and updating x using velocity and timestep. It's pretty simple stuff, right?...  Here's where the problem begins, though. The first time that the instance of run_c is created, initialized, and executed, it runs perfectly. However, I am operating this simulation by creating, initializing, and executing multiple runs based off of list read from a JSON file. As such, in the driver module...  from Run import run_c def main():    ...    for runEntry in runList:       currRun = run_c(runEntry)       ...    ...   What happens is that all the values that were stored in run_c.states do not get wiped after each iteration of the loop. I thought that new instances of run_c are being created every time I run the loop so as to execute __init__() fresh with new information. Why are the data values, such as old values for x, being retained after the end of each loop?  Update: When I add in a line of code to reset the values of states back to empty lists within __init__(), the problem goes away. But this shouldn't be a necessary step in what I want to do...should it?


Inverse images of images, images of inverse images of a set of vectors

What can be said about$\ f^{-1}(f(S))$ and$\ S$, where$\ f(S):=\{f(x):x \in S\}$?   I feel as if$\ f^{-1}(f(S))$ will be smaller than or equal in size (number of elements) to$\ S$.  For example, if$\ f(x)=x$, then$\ f(\{-1, 0, 1, 2\})=\{-1, 0, 1, 2\}$and$\ f^{-1}(f\{-1, 0, 1, 2\})=\{-1, 0, 1, 2\}$ (same size).  But if$\ f(x)=x^2$, then$\ f(\{-1, 0, 1, 2\})=\{0, 1, 4\}$ and$\ f^{-1}(f\{0, 1, 4\})=\{0, 1, 2\}$, which is a little bit smaller than$\ S$.   What can be said about$\ f(f^{-1}(U))$ and$\ U$, where$\ f^{-1}(U):=\{x \in X:f(x) \in U\}$?   The same size as each other? Always??


How to start proof of triangular inequality?

$$\left| {\left| a \right| - \left| b \right|} \right| \le \left| {a \pm b} \right| \le \left| a \right| + \left| b \right| $$


Could someone please explain me this reviewer comment:  asymmetric distribution could affect Principal Component Analysis results,  symmetry of distribution should be tested. Authors should also indicate if outliers were observed and consequently excluded because they could affect factors  My question: what does it mean asymmetry distribution could affect PCA? And also outliers, could they affect factors?


Add-On Dev: Property Update Event (send variable name?)

If I have a property group with a lot of properties, and I want to define a single update function that is called when any one of them changes, is there a way to send details about the variable being updated to that handler?  Something like..  def OnPropertyChange(self, context, identifier):     property_that_changed = self[identifier]  ...  class Props(bpy.types.PropertyGroup):     MyVal : BoolProperty(update=OnPropertyChange("MyVal"))   If this is not possible, is there any way to use a single handler like this without defining separated/specific handlers for every property? The only strategy I've come up with to get this working is by doing this, which is pretty terrible when you have a lot of them:  def GlobalPropertyChange(self, context, identifier):     property_that_changed = self[identifier]  def PropChangeMyVal(self, context):     GlobalPropertyChange( self, context, "MyVal" )  def PropChangeOtherVar(self, context):     GlobalPropertyChange( self, context, "OtherVar" )  def PropChangeThirdThing(self, context):     GlobalPropertyChange( self, context, "ThirdThing" )   I know it may be possible to define classes and functions dynamically in Python (I haven't tried it yet), which may be better than this in terms of maintenance. But I'm hoping there is a much simpler idea that I'm totally missing out on.  Appreciate any advice


What's the "best" way to create a dynamic sql "in list" clause in Python from an array (or tuple) of strings?

I'm running a dynamic MySQL query from Python (using MySQLDb) which includes an "in list" clause that contains string values.  The function which executes this gets an array of the values.  I could make that array into a tuple or any other kind of collection if it helps.    What's the "best" way to insert this list? Keep in mind that single quotes and commas etc are needed.  Here's an ugly, but safe manual approach:  inList = "" for stringValue in someArray:     if inList != "" : inList += ","     inList += "'%s'" % stringValue querystr = "SELECT * FROM some_tbl WHERE some_column IN( %s );" % (inList)    Alternatively, here's another option.  It's shorter, but relies on the array to string representation remaining exactly the same in the future:  inList = str(someArray).replace("[", "").replace("]", "")    querystr = "SELECT * FROM some_tbl WHERE some_column IN( %s );" % (inList)    EDIT  I think my Python terminology was wrong when I wrote this.  I should be saying "list" not "array".


Can we *please* have an upload image button on the mobile site's post editor?

Like the title says. It's super weird that there isn't one. Workaround is to switch to desktop site and upload from there, although this is really cumbersome given that making the switch mid post clears the post.


Canon custom white balance does not import to Lightroom / Photoshop

I have a Canon SL1.  I snapped several shots this morning with a custom white balance that was set in camera.  When I import the photos to Lightroom, they come in without the custom white balance.  The white balance in Lightroom is set to "as shot", but the white balance is not the custom white balance as shot.   I set the custom white balance from an image within the camera, and the image that it was set from was also imported.  I can't find how to set the white balance from that image in Lightroom.  The Photoshop Camera Raw plugin also renders the incorrect white balance.    Has anyone experienced this issue before?  I really just need to use the in camera white balance.  The RAW thumbnails have the correct white balance in the file explorer.


How do 'malloc' and 'new' work? How are they different (implementation wise)?

I know how they are different syntactically, and that C++ uses new, and C uses malloc.  But how do they work, in a high-level explanation?  See


Combine the Rows into single row in SQL Server

DECLARE @Count BIGINT   SELECT @Count = Count(ID)  FROM Users;   SELECT TOP 50       CustUser.[ID],     CustUser.[FirstName] + ' ' + CustUser.[LastName] FirstName,     CustUser.[NickName],     CustUser.[UserName],     R.[Name] Roles      FROM     (SELECT                 ROW_NUMBER() OVER(ORDER BY US.ID Desc) AS Row,          US.[ID], US.[FirstName], US.[LastName], US.[NickName],          US.[UserName], US.[Password]      FROM           [Users] US) CustUser LEFT JOIN      Category CL ON CustUser.[LoginModeCode] = CL.CategoryCode LEFT JOIN      Category CS ON CustUser.[StatusCode] = CS.CategoryCode  LEFT JOIN     UserRoles UR ON UR.UserID = CustUser.ID LEFT JOIN     Roles R ON R.ID = UR.RoleID WHERE      CustUser.ID = 3 AND      [Row] > (1 - 1) * 50   ORDER BY     FirstName   This query returns the below output  ID   FirstName       NickName          UserName             Roles                 ---------------------------------------------------------------------------- 3     ram              jk                 ram               Developer           3     ram              jk                 ram               TeamLeader     Roles only different in above rows. I am combining two rows.      But I want this output   ID   FirstName   NickName    UserName    Roles                                              --------------------------------------------------------------  3    ram            jk         ram       Developer, TeamLeader


Is there a general method for obtaining small caps with custom fonts?

MWE:  \documentclass[a4paper,12pt,twoside]{memoir} \usepackage{DejaVuSerifCondensed} \usepackage[T1]{fontenc} \begin{document} \noindent\scshape{Hello World}\\ \textsc{Hello World} \end{document}   Explanation and question:  As you can see, I am working with a memoir document class and I've load a font DejaVuSerifCondensed, I am trying to obtain small caps for my header (which I did not place in the MWE as unnecessary). However I can't obtain the desire effect with the \scshape command nor with the \textsc{}.  I've seen other questions like     .   But either they do not adapt to my problem (for what I can see) or they do not solve the problem (following the instructions there and "inserting" the piece of code in mine).  Question here is: is there a general method (piece of code or something) to obtain small caps from a custom font (even if that is one I upload with a ttf)?, if not, what would be the piece of code to select the standard small caps font?


Can't there be an infinite number of prime triplets separated by 2?

I came across a question on brilliant.org where it had been mentioned that $X, X + 2, X + 4$ are all prime numbers for $X = 3$. So is there any other $X$ for which $X, X + 2, X + 4$ are all primes and the answer was no.  So, can we say that there cannot be infinite number of prime triplets separated by $2$.   Please explain why?


How do I install 18.04 on a 32Bit machine?  The graphical version, not the console version - which I have already installed.  I answered NO to password but when I boot to Ubuntu I'm asked for a username and password - which of course there is none.  I would like to do a re-install but to the graphical Ubuntu as mentioned above.  Thanks


Why my website giving "The site ahead contains harmful programs" error?

My site is: . It's build using Wordpress.  My lastest Post is: , after making this post for the last 5 days I'm getting The site ahead contains harmful programs problem.  Because of this I'm getting low traffic.  How do I resolve this issue?  But main site working fine.


trying to overwrite 'file', which is also in package '*', how to solve?

I'm not able to update anything. I'm on 13.10.   When I try to install updates I get this:  dpkg: error processing /var/cache/apt/archives/librhythmbox-core7_3.0.1-0~13.10~ppa1_amd64.deb (--unpack):  trying to overwrite '/usr/lib/librhythmbox-core.so.8.0.0', which is also in package librhythmbox-core8 3.0.1-1ubuntu5~ppa0 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing:  /var/cache/apt/archives/librhythmbox-core7_3.0.1-0~13.10~ppa1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)   Does anyone have a solution ?


Why do we refer to something related as  our sister_______?  For example:  Please visit our sister hotel You can find that on our sister site  Why don't we use brother? Is it wrong to use brother?


In a house with shared ownership, if one person moves out and the other assumes mortgage, how do we determine who owns what share in the end?

Let us assume a shared ownership house, where everything is 50/50 in terms of deposit, monthly payments, bills, and eventually estate agent costs, and lawyer costs when the house is sold.  If the mortgage is over 25 years and for the first 5 years both owners live in the house and split everything 50/50, how do the calculations and ownership percentages change if one of the owners decides to move on and rent elsewhere, leaving the other owner to pay 100% of the mortgage bills etc etc?  After the 25 years, do both owners still get 50/50 when the house is sold?


Is upgrading from LTS to LTS as reliable as doing a fresh install?

Having run into many snags and stability issues when upgrading (update-manager -d) from just release to release (For example: 13.04 - 13.10), I soon learned and have been told that it is always more reliable to just do fresh installs.  However, when it comes to LTS to LTS upgrading (update-manager -d), I was told by a #ubuntu op that this is AS RELIABLE as doing a fresh install. I have a hard time understanding how that can be. If just release to release is prone to instability, what makes an LTS to LTS upgrade any different? How can it be as reliable as a fresh install?


How to share Desktop PC internet with android

I'm using Ubuntu 14.04.2 LTS on my desktop pc . I've a android phone with kitkat update . I'm using a broadband line for internet . Now how can I use my pc internet in my android phone . I can do in on Windows 8 . But what about ubuntu ?


I want to add a plane as shown . In this video (please watch it at 0.25 speed), the author creates a plane. His plane appears upright, and it is shown in the Hierarchy. I do the same, but my plane lays flat on the floor and doesn't appear in the Hierarchy. What am I doing differently than he does? Thank you!


How to enumerate with Roman numerals the items of the command \numcases

my code  \begin{subequations}     \begin{numcases}{}     q - 1 & \text{se $\psi = \psi_0$ e $\chi = \chi_0$} \label{roman*}  \\     -1    & \text{se $\psi = \psi_0$ e $\chi \neq \chi_0$} \\     0     & \text{se $\psi \neq \psi_0$ e $\chi = \chi_0$} \\     & \text{Se $\chi \neq \chi_0$ e          $\psi \neq \psi_0 \Rightarrow \lvert G(\psi,\chi)\rvert = \sqrt{q}$}     \end{numcases} \end{subequations}   it lists with (1a), (1b), I want to put "i", "ii" ...


Why, intuitively, does redundancy in a multiple linear regression increase the standard error of the partial regression coefficients?

In his book "Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences", J. Cohen says that redundancy in the independent variables of a multiple regression model increases the standard errors of that variables. He shows this giving an example, but I can't find a good explanation. Why is this true? I'd also be happy about a mathematical explanation.


Prove that $AB-BA=I_2$ cannot hold whatever the real $2\times 2$ matries $A, B$

How can I prove that $AB-BA=I_2$ cannot hold whatever the real $2\times 2$ matries $A, B$.    Suppose $A=\pmatrix{ a_{11} & a_{12}\\ a_{21} & a_{22}}$ and $B=\pmatrix{b_{11} & b_{12} \\ b_{21}& b_{22}}$.    Then $AB=(c_{ij})$, where $c_{ij}=\displaystyle\sum_{r=1}^2a_{ir}b_{rj}, i,j=1,2$ and $BA=(d_{ij})$, where $d_{ij}=\displaystyle\sum_{s=1}^2b_{it}a_{tj}, i,j=1,2.$    Now $AB-BA=I_2\implies c_{ij}-d_{ij}=\displaystyle\sum_{r=1}^2a_{ir}b_{rj}-\displaystyle\sum_{s=1}^2b_{it}a_{tj}$. $\implies a_{12}b_{21}-b_{12}a_{21}=1, a_{21}b_{12}-a_{12}b_{21}=1,$    $b_{12}(a_{11}-a_{22})+a_{12}(b_{22}-b_{11})=0,$    $a_{21}(b_{11}-b_{22})+b_{21}(a_{22}-a_{11})=0$.     From the first two, $a_{12}b_{21}=b_{12}a_{21}$ is ambiguous. Hence the result follows.  I am looking alternative method to show the result. Is there any other way to show this result?


What is the safest way to clean up /boot partition?

I have 200 MB assigned for the /boot partition.  Whenever I try to update the kernel, I receive an error message that basically states /boot is full.  What can I do to cleanup /boot and remove/backup the older kernels?


Class using generics is calling wrong version of method (superclass rather than subclass)?

I am trying to refactor some code, moving common code shared among a few caches to a base class.  Here's a simplified concept of it:  public abstract class DBObject {     public void copyTo(DBObject other) {        other.setId(this.id);     } }   public class Person extends DBObject {     public void copyTo(Person other) {        super.copyTo(other);        other.setName(this.name);     } }   public class PersonCache extends Cache<Person> { }  public abstract class Cache<T extends DBObject>  {     Map<Long, T> idToCachedMap;     private Class<T> tObjectClass;      public void initialize() {         // does stuff to populate the idToCachedMap     }      public void updateCache(T cachedObjToUpdate) {         T cachedObj = idToCachedMap.get(cachedObjToUpdate.getId());         T oldCachedObj = tObjectClass.newInstance();;          cachedObj.copyTo(oldCachedObj); // PROBLEM HERE         // do other stuff...     } }   The problem I'm running into is that when I call updateCache(Person) on a PersonCache, the copyTo methods that get invoked on the objects are that in DBObject, as opposed to the one in Person.  As a result, only some of the data is actually copied (in this example case, the ID, but not the name).    It seems to me that since both cachedObj and oldCachedObjs are guaranteed to be Person objects if it's a PersonCache, the copyTo method that should be called is the one on the Person class.  I feel like there must be something about how generics work that I'm missing that is causing this behavior.  I know if I override copyTo in the Person class to be a signature of copyTo(DBObject other) rather than copyTo(Person other) it then does call the copyTo on the person class - but that'd be a sloppy way to rewrite it and I think I'm missing something that might be cleaner.


Can you stop the cops appearing in payday 2

Is it possible to set off an ecm jammer and kill all the guards and cuff all the civilians so the alarm is never set off in a bank heist?


Looking for an intuitive explanation why the row rank is equal to the column rank for a matrix

I am looking for an intuitive explanation as to why/how row rank of a matrix = column rank. I've read the proof at  and I understand the proof, but I don't "get it". Can someone help me out with this ?   I find it hard to wrap my head around the idea of how the column space and the row space is related at a fundamental level.


The hospital is "in Church Road" or "on Church Road"?

I've been discussing the usage of "in Church Road" over "on Church Road" with my colleagues in a sentence such as "The supermarket is in Church Road". Whilst it is overwhelming clear that "on Church Road" is the favoured option in this discussion, it remains unclear as to whether the use of "in Church Road" is completely uncommon or incorrect in this context.  The case regarding "Church Street", we feel, is clearly a simple case of who is speaking, but "Church Road" is presenting us one or two problems.  Any help?


Cursor disappears intermittently, always after opening System Settings

Similar questions have been asked, I admit. I have just done a fresh, new install of ALWAYS disappears when I open System Settings.


Bijection between power sets of sets implies bijection between sets?

Is it true that if $X$ and $Y$ are sets and there is a bijection between $\mathcal{P}(X)$ and $\mathcal{P}(Y)$ then there is a bijection from $X$ to $Y$ ?. I believe this should be obvious, but I can't see why this is so. A proof or a counter example would be highly appreciated.   Thanks.


Javascript to check whether a checkbox is being checked or unchecked

I have a javascript routine that is performing actions on a group of checkboxes, but the final action I want to set the clicked checkbox to checked or unchecked based on if the user was checking the box or unchecking.  Unfortunately, every time I check for whether it is being checked or unchecked, it returns "on" indicating the user is always checking the box!  Any help would be appreciated, I've also included the javascript.  // Uncheck all the checkboxs with the same Tax Credit for (i=0; i<arrChecks.length; i++) {     var attribute = arrChecks[i].getAttribute("xid")     if (attribute == elementName)     {         // if the current state is checked, unchecked and vice-versa         if (arrChecks[i].value == "on")   // <-- This is always returning true, even if the box is being unchecked         {             arrChecks[i].checked = 1;         } else {             arrChecks[i].checked = 0;         }      } else {         arrChecks[i].checked = 0;     } }


Use of writing function in specified manner in javascript or angularjs

I have been writing functions like   var functionname = function(param) { }   rather then   functionname(param) { }   does it provide any advantage of the format or any garbage collection happens when i write like the first syntax?


Prove by Double Counting Method $\sum\limits_{k = 0}^m \binom{m}{k}\binom{n}{r + k} = \binom{m + n}{m + r}$

Show by combinatorial arguments that:   $$\sum_{k = 0}^m \binom{m}{k}\binom{n}{r + k} = \binom{m + n}{m + r}$$  Hello ,  I want to prove this argument by double counting method, i kinda have an idea of proving by comb args. but not by double counting... Can someone give any clues or ideas? thanks :)


Why don't waves with different wavelengths interfere with each other in white-light?

The book I'm reading about optics says at some point that "each color (wavelength) contained in the white light interferes only with itself". But why is this so?  Edit: I moved the rest of the question .


RHEL Java Application returns "No space left on device" but only 3% used

My Java Application returns following Exception when saving a new file in /opt/wso2 on a CentOS 6.4:  Caused by java.io.FileNotFoundException: ... (No space left on device)  Caused by: java.io.FileNotFoundException: /opt/wso2/FrameworkFiles/trk_2014062500042488825_TRCK_PatfallHospis_pFromHospis_66601fb3-a03c-4149-93c3-6892e0a10fea.txt (No space left on device) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:212) at java.io.FileOutputStream.<init>(FileOutputStream.java:99) at com.avintis.esb.framework.adapter.wso2.FrameworkAdapterWSO2.sendMessages(FrameworkAdapterWSO2.java:634) ... 23 more   But when I run df -a I can see that the partition still has plenty of space available:  [root@stzsi466 wso2]# df -a Filesystem           1K-blocks      Used Available Use% Mounted on /dev/mapper/vg_stzsi466-lv_root                       12054824   2116092   9326380  19% / proc                         0         0         0   -  /proc sysfs                        0         0         0   -  /sys devpts                       0         0         0   -  /dev/pts tmpfs                  4030764         0   4030764   0% /dev/shm /dev/sda1               495844     53858    416386  12% /boot /dev/sdb1             51605436   1424288  47559744   3% /opt/wso2 none                         0         0         0   -  /proc/sys/fs/binfmt_misc  [root@stzsi466 ~]# df -i Filesystem            Inodes   IUsed   IFree IUse% Mounted on /dev/mapper/vg_stzsi466-lv_root                       765536   45181  720355    6% / tmpfs                1007691       1 1007690    1% /dev/shm /dev/sda1             128016      44  127972    1% /boot /dev/sdb1            3276800    6137 3270663    1% /opt/wso2   What is the problem here? Is it caused by the Java on CentOS 6.4? I have another server running Redhat REHL 6.4 and all works fine - same Java etc.   Does anyone know of this problem?


Powering an Arduino with ATX power supply

I am working on a project that requires the use of a PC Power supply with my  Arduino Uno. I would like to use a Molex to power my Arduino and I have a few questions. My power supply is rated 18A on the 12V rail, and 28A on the 5V rail. My question is which rail would be best to use, and should I use Vin, 5V, or the DC power plug. Also, would the same advice work for an Arduino nano? All help is appreciated.


vertical alignment in tabularx environment

I am using tabularx environment and in the MWE I have three columns. The first column contains short text, the second column contains long text and the third column contains short text again. \documentclass{article}     \usepackage{tabularx}  \begin{document}  \begin{tabularx}{6cm}{|p{2cm}|b{2cm}|p{2cm}|}  short 1 & long text spanning more than one row & short 2 \\ \end{tabularx}  \end{document}  As expected, the result is that both short 1 and short 2 align to the bottom.  If I change the setting on middle column from b{2cm} to p{cm}, as expected both short 1 and short 2 align to the top. I would like to make short 1 align to the top and short 2 align to the bottom. How can I achieve that? Thanks in advance. EDIT: Following the suggestion by @NBur who pointed me out to , I've implemented the following changes: \documentclass{article}     \usepackage{tabularx}  \newcolumntype{C}{b{2cm}<{\vfill}}  \begin{document}   \begin{tabularx}{6cm}{|C|b{2cm}|p{2cm}|}  short 1 & long text spanning more than one row & short 2 \\ \end{tabularx}  \end{document}  Unfortunately this code brings up the text only by one line and not all the way up to the top of the cell, so it does not work.  Are there any other suggestions?


Analysing pre-and-post intervention study with anonymous responses

The study I am analysing is a pre-and-post intervention questionnaire of students' views before and after studying a module.  The questionnaire was distributed in three different geographical locations, where the same instructor was delivering the same module at different times within one year.  The scale used is a 5-point Likert scale (which I can also convert into a binary agree/disagree variable if needed).   The surveys are anonymous, so I can't match the sample.  However, in some samples, all the students answered both the pre-and-post questionnaires (same $N$) and in others this was different (different $N$).   Overall I have 343 respondents for the pre-intervention questionnaire, and 378 respondents for the post-intervention questionnaire.  However in two of the three locations, I have equal pre and post intervention responses, but they are anonymous: so they are not independent, but not matched. (This is a weakness of the data, and will be reported in the results).  My questions are: a) Given the sample size, would running an unpaired t-test on the full sample be appropriate? Or should I be going for a non-parametric test?  b) Can the subsamples where there are equal respondents (i.e. all students answered both pre-and-post questionnaires) be analysed as non-independent non-matched samples?


Where to post a question on machine learning web-service implementation

I tried to post the question below on Stack Overflow, then on Cross Validated, then on Server Fault but my question has been stated as off-topic each time. I'm a bit fed up because I have posted far more answers than questions on Stack Overflow and the day I need some help: no way. I always asked how could I make this question not off-topic or where would it be better to post then, but no answer. Just a downvote or on-hold response. I know it is not a programming issue but there are many very, very similar questions on Stack Overflow so I am really surprised. It seems a bit more picky when it relates to questions on R.     R web-service for real-time prediction with online learning      What free framework or R packages should I use to deploy R as a web   service handling many models for real-time prediction (with online   learning) ?      It should be able to address those key points:         allow parallel processing/requests while handling a memory/cpu policy preventing reaching memory/cpu limits.   update many models in parallel safely (ie. prevent concurrent updates). able to quickly load/unload many models on a single machine   because not all models (ie. >1000) could fit in memory.   handle large streams with low footprint (out-of-core).   able to use VowpalWabbit and StreamMOA R packages.   web service could be Http or Thrift based.         Thanks a lot for any help!   FYI, the different versions of my question:   1st try on SO:  CV:  2nd try on SO:  Server Fault:


Is light always in this dual state or when it is acting as wave, there is no particle nature and vice versa?


when trying to move files, I get this error:  Error moving file /home/cassius/Desktop/Unity/18x18: Permission denied   I get this error even after giving the file im trying to move, (unity) full permission, and chmod 777.  Anything helps, Thanks!


How do I put a texture on top of a normal map?

I recently downloaded a model and it came with two images, a normal map and an image for colors. How do I put both of them on the model.  These are the two images


What does it mean to say image is formed at infinity?

In case of a concave mirror, when the object is at the focus, my book states that the image is formed at infinity and is highly magnified, real and inverted. But the reflected rays are parallel and will never meet, so no image will ever be formed no matter the distance, right?  How can an image be formed at infinity?


Solving recurrence equation with generating indices of positive indices

I don't know how to solve recurrence equation with positive indices like $$a_{n+2}  + 4a_{n+1}+ 4a_n = 7$$ by generating functions. How to solve such kind of problems.


Java: Why does my class automatically inherits constructor from superclass?

When I try the code on the bottom of this question, the output is:  a a b a b c   So this means that the constructor from B and C call the constructors from their superclasses. But why? I thought that the superclass' constructor only get's called when used with the super() function like this:  public sportscar(String name, int weight, int topspeed){     super(name, weight);     this.setTopspeed(topspeed); }   But if it automatically takes over the constructor from the classes they extend from, why would we use the super() function? I know that normal methods extend to there sub-classes automaticaly, but I thought that the constructor was different.  If anyone can clear this out for me, thanks a lot!  Code:  public class App {     public static void main(String[] args) {         new A();         new B();         new C();     } }  public class A {     public A(){          System.out.println("a ");     } }  public class B extends A {     public B(){          System.out.println("b ");     } }  public class C extends B {     public C(){          System.out.println("c ");     } }


I have this problem with Comodo:     (Reading database ... 143450 files and directories currently installed.) Preparing to unpack cav-linux_x64.deb ... Unpacking cav-linux (1.1.268025-1) over (1.1.268025-1) ... Uninstallation succeed! dpkg: dependency problems prevent configuration of cav-linux:  cav-linux depends on libssl0.9.8 (>= 0.9.8m-1); however:   Package libssl0.9.8 is not installed. dpkg: error processing package cav-linux (--install):  dependency problems - leaving unconfigured Errors were encountered while processing:  cav-linux   Is any simple solution or is better to wait for Comodo updates that fit Ubuntu 18.04 LTS 64-bit.  Thanks


50 Degrees angle construction possible without protactor?

Is 50 degrees angle construction possible without a protactor or a sine table ? Only using Compass and a ruler.


Will 4k video look better than 1080p video on 1080p TV/monitor?

Topic  Just wondering about this? If I play a 4k video on 1080p monitor/TV, will it look better than playing 1080p video on the same monitor/TV?


Problem. Use Tutte's 1-factor theorem to prove that every 3-regular graph with no bridges has a 1-factor.  I honestly have no idea how to approach this problem. I have drawn a couple of graphs to gain some insight to no avail. Any hints or tips will be greatly appreciated.


Why is any pgr_* routing function taking forever based on OSM data in an pgrouting enabled DB

I loaded the German OSM dataset into the pgrouting DB by using osm2po 4.7.7. Everything works fine i have osm2po set up via it's config and it's working like a charm through it's Java part.  I had the *_2po_4pgr table imported without any problems. Even the *2po_v table gets imported, though I don't completely understand the relation of this table.  I executed the pgr_createTopology function which ran for quite a while (12000secs) while calculating all 6m edges. I thought this would do the deal, but still it's unbearably slow.  I would like to know if i forgot something. I was thinking of using pgRouting instead of the java library but at the moment its performance-wise just out of comparison.


How do you search through a friend's Facebook profile for a specific post?

Is there a way to search through a friend’s Facebook profile for a post you remember some of the words of? I've tried using Ctrl+F but it appears only part of the posts get loaded each time you view a profile. Is that right? I've tried scrolling really far down in the history but wasn't able to find it and the post was made recently.


No Windows 10 Upgrade icon in Windows 7 running in Parallels

Clarification: while this question is very much related to other questions regarding Windows 10, it also covers specific aspects relating to using Parallels Desktop. These aspects are not covered in other questions; therefore, this question is not a duplicate.  I have Windows 7 Ultimate running on my Mac (OS X 10.10.4) via Parallels Desktop 10.2.0.  I want to upgrade to Windows 10, but I don't seem to have the upgrade icon in the system tray. I've run Windows Update multiple times, but no joy. I've also tried everything at  and at .  I can confirm that GWX.exe is present in C:\WINDOWS\System32, but when I try to run it (either via the command line or through the GUI) nothing happens.  What should I try next? I'm confident I've tried all the standard troubleshooting steps for this, so is there perhaps something about Parallels that means the upgrade process will work differently?


I mean, what does the character t in size_t mean? This question had occured to me years ago when I was learning cpp for the first time. Why the designer of this language chooses to use this character rather than size_i, size_n, size_l, etc.? I'm thinking about it's the abbreviation of int, but not sure if there's a better answer.


Vim-Latex: Inverse and Forward Searching partially enabled. (Environment: Vim-Latex Suite, Sumatra, MikTex)

This is a question directed to those who are familiar with compiling Tex using Vim. My OS is Windows 8.1 Problem Description: Inverse and Forward Search is partially enabled. When I double click at a paragraph in the PDF file (in Sumatra), if I double click at the first sentence, then I can be sent back to the corresponding paragraph in .tex file opened in Vim. However, if I click at any line further than (including) the third line of the same paragraph, I would be told that: No synchronization info at this position.   The weird thing is, after a random number of lines, inverse search would again point to the .tex file again. For forward search, I can only say the following:  Sometimes, for the paragraph where inverse search is partially enabled, it works by sending the focus of window to the PDF document and pointing to exact corresponding paragraph.  Sometimes, forward search will send me to a random paragraph in PDF file.  And sometimes, the forward search fails. Sumatra complains that: No result found around line # in file ~\kkk.tex   My Vim is on Github: . I am not sure if I am asking this question in the correct forum. If not, please direct me to the correct site/forum/mail-list.


How to solove $f(x)=\int_{x-1}^x {f(t)dt}$

$f$ is real valued continous funtion. $f(x)=\int_{x-1}^x {f(t)dt}$, then $f$ is constant function? I prove that If there is an interval where the function value of $f$ is constant. But I generally failed to prove.


Udev - Network cable hotplug event not catched

I'm running a buildroot custom linux (kernel 4.9.87) on a custom board based on an Atmel Sama5d2.  I'm trying to configure the network on the eth0 interface using dhcp only at hotplug.  Originally, the interface was configured at boot using auto eth0 into /etc/network/interfaces  I changed it to allow-hotplug eth0 to have the following file  # cat /etc/network/interfaces   auto lo iface lo inet loopback  allow-hotplug eth0 iface eth0 inet dhcp   After this change, udhcpc is not run at boot and is not blocking linux boot for 30 seconds anymore if the cable is not plugged.  However, nothing happens when I plug or unplug the cable.  If I mannually run ifup -a I obtain an IP address on eth0 interface.  From this results, I don't think the problem comes from network configuration but more from handling low level events.  I've tried to monitor the plug/unplug of the cable using udevadm but I can't see any kernel event when I'm pluging and unpluging the cable (but I can see events from usb subsystem for example).  I have also written a udev rule to log events in case udevadm was not relaying this subsystem events.  # cat /etc/udev/rules.d/20-network.rules  SUBSYSTEM=="net", ACTION=="add", RUN+="/test.sh add" SUBSYSTEM=="net", ACTION=="remove" , RUN+="/test.sh remove"    However, nothing is trigerred by this rule neither.    So right now I think I have an issue detecting network cable hotplug.  I could be a kernel configuration mistake as well as a hardware wiring mistake.  I don't really know how the plug/unplug event is detected at hardware level however I think that the event is sent to udev either directly by the driver itself or by one of the numerous kernel frameworks in which it's deployed.  Do you think I may be missing some kernel configuration ?  Do you think it's possible to trace the state cable at a lower level than using udev ? Maybe by directly interfacing with sysfs ?


Best practice for parsing REST API response

I am trying to connect to an external system via REST API. The below is the JSON response. {"coord":{"lon":-0.1257,"lat":51.5085}, "weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}], "base":"stations", "main:{"temp":292.86,"feels_like":287.94,"temp_min":292.04,"temp_max":293.71,"pressure":1027,"humidity":45}, "visibility":10000,"wind":{"speed":6.17,"deg":260},"clouds":{"all":23},"dt":1617027097,"sys":{"type":1,"id":1414,"country":"GB","sunrise":1616996538,"sunset":1617042474},"timezone":3600,"id":2643743,"name":"London","cod":200}  I am parsing it in the below manner but I would like to know if there is any standard method of parsing data. Right now, I somehow feel the below method is inefficient since the JSON string is a mix of list, array of list and objects. Could you please suggest me best practice while parsing the JSON string>         Http http = new Http();         HttpRequest request = new HttpRequest();         request.setEndpoint('http://api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=8ce9a754cab8e60ec7891a776bab165e');         request.setMethod('GET');         HttpResponse response = http.send(request);         system.debug(response.getBody());         system.debug(response.getStatusCode());                  //Parse the JSON String into a Map         Map<String, Object> jsonParse = (Map<String, Object>)Json.deserializeUntyped(response.getbody());         system.debug('jsonMap'+jsonParse);                  //Get the weather information - array of list         List<Object> listObject = (List<Object>)jsonParse.get('weather');                 for(Object o: listObject){             Map<String, Object> weatherMap = (Map<String, Object>)o;             system.debug('weatherMap '+ weatherMap.get('description'));             system.debug('weatherMap '+ weatherMap.get('id'));             system.debug('weatherMap '+ weatherMap.get('main'));             system.debug('weatherMap '+ weatherMap.get('icon'));         }                  String base = (String)jsonParse.get('base');         system.debug('base' + base);                  Map<String,Object> main = (Map<String,Object>)jsonParse.get('main');         Decimal temperature = (Decimal)main.get('temp');         Decimal pressure = (Decimal)main.get('pressure');         Decimal humidity = (Decimal)main.get('humidity');         system.debug('temperature '+ temperature);         system.debug('pressure '+ pressure);         system.debug('humidity '+ humidity);                  Map<String,Object> coord = (Map<String,Object>)jsonParse.get('coord');         Decimal latitude = (Decimal)coord.get('lat');         Decimal Longitude = (Decimal)coord.get('lon');         system.debug('latitude '+ latitude);         system.debug('longitude '+ longitude);


How can I get the proj4 string or EPSG code from a shapefile .prj file?

I have to work with a shapefile defined in an unusual projection, which my GIS software does not know about. How can I get the proj4 definition or the EPSG code for the projection?


I have a piece of software I have to install on company laptops. The installer needs a serial to work properly, but I don't have it (my manager isn't here so I can't ask him). The installer tells me to ring a phone number which doesn't appear to be connected anymore.   I would download win32dasm and ollydbg and have a go at cracking the installer but I don't really have time and I haven't done it in years.   There is a zip file on the disc that looks like it contains all the program files but it is passworded. Is it feasible to crack this or will it take ages?


declaringn a variable in java class (private,static,final)

There are many discussions about static and final variables in Java.  I really want to know the differences between the following declarations. Seems to be confusing  public class foo() {     private static final int a;     private static int b;     private final int c;     private int d;     public static final int e;     public static int f;     public final int g;     public int h; }   Which one can be modified/accessed inside/outside of the class?  P.S: The question in  is a larger scope. Mine is focusing on some confusing points!


I am currently writing a little bootstrap code for a service that can be run in the console. It essentially boils down to calling the OnStart() method instead of using the ServiceBase to start and stop the service (because it doesn't run the application if it isn't installed as a service and makes debugging a nightmare).  Right now I am using Debugger.IsAttached to determine if I should use ServiceBase.Run or [service].OnStart, but I know that isn't the best idea because some times end users want to run the service in a console (to see the output etc. realtime).  Any ideas on how I could determine if the Windows service controller started 'me', or if the user started 'me' in the console? Apparantly  is not the answer. I thought about using commandline args, but that seems 'dirty'.  I could always see about a try-catch statement around ServiceBase.Run, but that seems dirty. Edit: Try catch doesn't work.  I have a solution: putting it up here for all the other interested stackers:      public void Run()     {         if (Debugger.IsAttached || Environment.GetCommandLineArgs().Contains<string>("-console"))         {             RunAllServices();         }         else         {             try             {                 string temp = Console.Title;                 ServiceBase.Run((ServiceBase[])ComponentsToRun);             }             catch             {                 RunAllServices();             }         }     } // void Run      private void RunAllServices()     {         foreach (ConsoleService component in ComponentsToRun)         {             component.Start();         }         WaitForCTRLC();         foreach (ConsoleService component in ComponentsToRun)         {             component.Stop();         }     }   EDIT: There was another question on StackOverflow where the guy had problems with the Environment.CurrentDirectory being "C:\Windows\System32" looks like that may be the answer. I will test today.


I need to include many JPG images in a LaTeX document. They are quite "heavy" (many MBs each), but in my document they will be printed in a very small size (~2x2 cm). Obviously  \includegraphics[width=2cm]{...}   actually lets me include them as expected but the resulting PDF file is too "heavy" (some GBs).  I know I could use an external image editor to decrease the file size but, for a couple of reasons too long to explain here, I'd prefer to set the image resolution (so that a lower resolution implies a lower PDF file size) from within LaTeX.  Is there a reasonably simple way to achieve it?  I'm using pdfLaTeX and the document I'm working on has no other peculiarities:  \documentclass{article} \usepackage{graphicx}  \begin{document} \includegraphics[width = 2cm]{example.jpg} % ... \end{document}


Show that trace is a unique linear functional

If $W=M_{n\times n}(\mathbb F)$ and $f$ is a linear functional on $W$ such that $f(AB)=f(BA)\;\forall A,B\in W$, and $f(I)=n$, then $f$ is the trace function.    I have tried to generate useful matrices that can be represented in the form $AB-BA$ for some $A$ and $B$. My idea was to generate a basis for $W$ of the form $AB-BA$ plus the identity.


Highlighing and hit detection on a geographic game

I'm developing a geographic game where you select a country and it highlights. At first I thought about using 196 images (1 for the world, 195 for each country highlight) with the same size, and the country images would only have the country drawn and the rest is transparent. That way they'd overlap perfectly.  This design doesn't feel quite right, and it would cause trouble doing hit detection on cases where a country is inside another one.  What's the best approach for this situation?


Why ArrayList is faster than HashSet in java?

I used to thing that HashSet is a pretty fast data structure implementation because it uses hashes (and is implemented via HashMap in its turn). I was solving some problems and decided to check performance issue, so here it is:     You are given an array with numbers - [11, 3, 11, 11, 3, 2, 0, -2, 2]    You are supposed to write a function that returns the number that appears "odd" number of times.    Here is my solution:  public class OddNumInArray {  public static List<Integer> oddNumList(int [] ar){     Collection <Integer> l = new ArrayList<>();     for (int n: ar) {         if (l.contains(n)) {             l.remove(n);         }         else {             l.add(n);         }     }     return (List) l; }  public static Set<Integer> oddNumHSet(int [] ar){     Set <Integer> l = new HashSet<>();     for (int n: ar) {         if (l.contains(n)) {             l.remove(n);         }         else {             l.add(n);         }     }     return l; }  public static void main(String [ ]arg) {     int [] a1 = new int [10000000];     for (int i=0; i<10; i++){         a1[i]=(new Random()).nextInt(5);     }     long cur= System.nanoTime();     System.out.println(oddNumList(a1));     long c1 = System.nanoTime()-cur;     System.out.println("TIME CONSUMED:" +c1);     cur= System.nanoTime();     System.out.println(oddNumHSet(a1));     long c2 = System.nanoTime()-cur;     System.out.println("TIME CONSUMED:" + c2);     System.out.println("c1/c2*100: "+ (new Double(c1)/new Double(c2)*100)); }  }   And here is an output:  [1, 0] TIME CONSUMED:101804000 [0, 1] TIME CONSUMED:183261000 c1/c2*100: 55.55137208680516   So, why is implementation with ArrayList is quicker than one with HashSet by almost 2 times? Thank you.


Say I have a huge text file (>2GB) and I just want to cat the lines X to Y (e.g. 57890000 to 57890010).  From what I understand I can do this by piping head into tail or viceversa, i.e.   head -A /path/to/file | tail -B   or alternatively  tail -C /path/to/file | head -D   where A,B,C and D can be computed from the number of lines in the file, X and Y.  But there are two problems with this approach:   You have to compute A,B,C and D. The commands could pipe to each other many more lines than I am interested in reading (e.g. if I am reading just a few lines in the middle of a huge file)   Is there a way to have the shell just work with and output the lines I want? (while providing only X and Y)?


What is the best place to upload files for use in questions?

Let's say I have a file, such as a HTML file or a Node project in a ZIP file. Where is the best place to upload this file when adding it to a question on Stack Overflow or another SE site?


I am trying to sort the output of a dictionary by the third column, or more specifically the count of values that appear in the example results. For context, the original answer provide was here: . I was unable to derive an answer from  or  therefore am asking here.  The original out put is produced from:  for k in ret.keys():     print '%s %d' % (k,ret[k])   Which results in:  google com 1132 akamaiedge net 378 bing com 381 microsoft com 197   And tried:  x = ret.keys() sorted(x,key=operator.itemgetter(3)) for k in x:     print '%s %d' % (k,ret[k])   which results in:  google com 1132 akamaiedge net 378 bing com 381 microsoft com 197   And lastly tried:  for k in sorted(ret.keys(),key=operator.itemgetter(3),reverse=True):     print '%s %d' % (k,ret[k])   Which resulted in a similar output to the first:  microsoft com 197 akamaiedge net 378 google com 1132 bing com 381   Additionally, the value of ret.keys() is:  ['google com', 'akamaiedge net', 'bing com', 'microsoft com']   Solution for my specific scenario is:  for k in sorted(ret.keys(), key=lambda k:ret[k], reverse=True):     print "{:15} - {}".format(k, ret[k])


python store string to array not characters

I'm new to python. I tried to store bunch of strings to an array and at the end print out the array, however it print out as a long list of characters. here is my code:  user_with_no_records = [""] for user_test_docs in json_data['results']:    ... do something here ...    user_with_no_records.extend(user_test_docs['userId'].replace("'", '"')) ... pprint(user_with_no_records)   instead of print out :  "1234-4a20-47c0-b23c-a35a", "53dd-4120-4249-b4f6-ebe2"   it print out  "1","2","3","4","-","a","2","0"....


So, long story short: An Halogen (MR16/GU5.3) light in my bathroom went out and I replaced it with an led light (from Wilko UK, 3 pack). I know nothing of electrics, but thought heck, I should be able to change a light bulb, right?  A couple of weeks go by and the Led goes out, too. I still had 2 bulbs in the "3pack" I bought, maybe this one was just dodgy? Replaced with new Led. 2 weeks later, same thing happens.  I'm wondering if, based on the supplied images, anyone could guide me in terms of what bulb to buy (Halogen or Led!), so I can stop wasting money buying the wrong bulbs.  First picture shows the old bulb (top of my hand) and the new led I bought (bottom).  Second picture shows the transformer.  Did I buy the wrong bulbs or is my issue somewhere else?


Is it possible to delete files to Recycle Bin using Windows command line?

When deleting files from the Windows 10 command prompt is there a way to have them go to the Recycle Bin so they can be undeleted if necessary? I know MS-DOS had this ability long ago, but it does not appear that exists in Windows now.


Fedora GUI software update inconsistent with dnf command line update

During a Gnome session I received an upgrade notification from Software Update so I switched to a tty (I never run 'dnf upgrade' inside an X session) to run the update but 'dnf upgrade' shows that no updates are available. The Software Update gui clearly shows a higher version for the new packages but a 'dnf list updates' does not display them.  Can someone tell me what I am doing wrong? Is the gui tool using different repositories?


Short story about aliens trying to eliminate dogs from the Earth

The story is about a series of anomalous incidents leading to the death of many people. Turns out, these explosions centered around dogs. Aliens are in orbit, intent on destroying every dog on the planet because their extrapolations show how dogs will be the triumphant race in the universe. The story ends deep underground where the military has a bunch of dogs, and they're training them to get revenge on those aliens. Last scene is from a dog's point-of-view, about wanting to feel grass under his feet, sunshine on his face, and wanting to please humans by chasing a ball.


Identify this circuit symbol with two overlapping circles

I came across some images of schematics and have never seen this component before - what is it?


Can't select chat profile if user is in too many rooms

So I noticed a curious thing today. If you want to view a person's chat profile for any reason, and they are in a large number of chat rooms, the following happens:     As you can see, the large list of chat rooms means that the part where you can view their profile is shoved off-screen. Scrolling up/down on the page just moves the window, but doesn't let you actually get to the profile link.   Is there some way around this (short of putting a limit of how many rooms a person can be in, to keep the list bounded)?


So I've got the shout in my shouts list and I've unlocked all three parts of it, but I can't seem to be able to use it all, just the first part.  Am I missing something? I still have a quest for 'Learn the first word of Durnehviir's shout' but it's showing as me having already got it.  What gives?


Stirling's approximation for Gamma function

Is that true for any $x>0$, the gamma function   $ \Gamma(x)\le x^x? $  I know this is true for integers but am not sure for any $x>0$.


Is it possible to create an  shader in Cycles? Specifically for something like , , , etc..


Union of two vector subspaces not a subspace?

I'm having a difficult time understanding this statement. Can someone please explain with a concrete example?


Bad formatting on Avatar when viewing profile

It looks like for whatever reason, 's avatar gets cutoff when browsing with Chrome Version 69.0.3497.100 on Windows 10:    When using Microsoft Edge, the frame around the avatar looks correct, but for whatever reason its slimmer than other profiles.  It happens to   , so I'm guessing it's an issue with their description?  Is this a bug?


Why are the login boxes on the left and how can I easily move them to the center?

I wonder why Ubuntu chose to put the login forms at LightDM in the left instead of centering it. I find it totally ugly and a mental effort when I boot up and try to find the login with my eyes wandering from the center to the left.  Are there any reasons for designing it the way it is? (I could not find anything on the Ubuntu wiki.)   Would there be a super simple way to center everything?


Shapefile for India which is up-to-date to display regional borders

I need a shapefile for India which is up-to-date to display the regional borders. By up-to-date (in 2014), I mean that it includes Telangana as a state. Many shapefiles that I downloaded do not have Telangana as a state as it was partitioned a month ago, it is displayed as part of Andhrapradesh.  So I need the latest shapefile.


Differentiating an "initial value problem"?

I have the following ODE  $$y' = 2 - \sin(xy), \qquad 1 \le x \le 3$$   with initial condition $y(1)=-\frac 12$. I have to prove that $|y''(x)| \le 40$ over the domain $[1,3]$.   I thought perhaps just do partial differentiation on y' and then draw it on a graph using the x domain and show its always under 40, but that doesn't seem to work... any help? If it helps, the question is in the context of an Euler question. Cheers.


Show that if F is a finite field, then $F^F=P_F$.

The hint is: Let F has as elements $a_1,...,a_n$. Note that if $$f_i(x)=c(x-a_1)...(x-a_{i-1})(x-a_{i+1})...(x-a_n)$$, then $f_i(a_j)=0$ for $i\neq j$ and the value $f_i(a_j)$ can be controlled by the choice of $c\in F$. Use this to show that every function on F is a polynomial function.  First, I need to construct a polynomial $p(x) \in F[x]$ such that $p_i(a_i)\neg 0$ and $p_i(a_j)= 0$ When $i\neq j$ and explain why such a polynomial exists.  Next I think I need to show for all $a\in F$ that f(a)=p(a).  Using Fraleigh’s seventh edition of A First Course in Abstract Algebra. Need help with problem 22.31c. I’m completely lost. Thank you!


Distance command and tag command not working

I was experimenting with some command blocks and tried to make it so that when you had different colours of wool in a specific order in your inventory it would give you certain special abilities. The command sequence I used was:  Command block 1, repeating       execute @e[type=minecraft:snowball] if entity @p[nbt={Inventory:[{Slot:6b,id:"minecraft:red_wool"}]},nbt={Inventory: [{Slot:7b,id:"minecraft:blue_wool"}]},nbt={Inventory:[{Slot:8b,id:"minecraft:yellow_wool"}]},distance=1] run tag @s add path   Command block 2, repeating    execute @e[tag=path,type=snowball] run setblock ~ ~-2 ~ white_wool keep   The snowball should leave behind a path of white wool wherever it is thrown, as long as the player throwing it has the specific wool sequence in their inventory. The problem is that it wont work and I'm not sure why. I got it to work where all snowballs thrown leave behind a path if one player has the sequence, but I want it to be only snowballs thrown by a specific player. I also tried by giving the player snowballs with tags but the tag disappears when you throw the snowball.


Can you provide any examples of non-conservation of energy in any GR or other scenario?

Some people say that dark-energy density remains constant in an expanding universe. However this is something that's still rather hypothetical. It's rather atypical too, in that we have no examples of non-conservation of energy. If you move towards the $E=hf$ photon it appears blue-shifted, but it hasn't actually gained any energy. It hasn't changed at all, instead, you changed. If you drop a brick, gravity converts potential energy into kinetic energy. But it doesn't create any energy. It doesn't do work on the brick, instead you do work on the brick when you lift it up. In similar vein the ascending brick doesn't lose any energy. Nor does the ascending photon. See Einstein talking about  in the digital papers hosted at Princeton. Note that he doesn't say light changes frequency as it climbs out of the gravitational field. He says it's emitted at a lower frequency. There are no perpetual motion machines.   However some people say things like "any reasonable definition of energy that has been found leads to non-conservation in many GR scenarios". Only I don't know of any example of non-conservation of energy. Can you provide any? Either in a GR scenario, or in any other scenario?  I will award a 200-point bounty on this question. I will award it to the answer that I think is the best. If I don't much like any of the answers, I will still award the bounty to one of them.   Edit: now the question has been closed I have to withdraw the offer of a bounty I'm afraid. Apologies to those who have answered.


I'm a recent newcomer to LaTex and while I've overcome most of the learning curve, I still encounter some difficulties. For instance, when I run my code to insert a figure:      \begin{figure}     \caption{Unemployment by Race}     \centering     \includegraphics[width=0.5\textwidth]     {C:/Users/ageis/Documents/Unemployment by Race.png}      \end{figure}   The figure is too small and LaTex puts the last half of my image's name into the pdf output beneath the figure.      I want the image to be at least 550 by 600 in pixels and the "by Race.png" bit in the space beneath the figure to be gone. What can I do?


How is the range of Google Maps new drive time feature defined?

I just noticed Google Maps new feature.  It allows the user to get approximate drive times for a specific date and time using average traffic conditions.  This is a feature which .  It allows the user to choose to depart at a specific time or arrive at a specific time.  In the later case it recommends a time for the user to leave.  The drive time is given as a possible range of times (see the screencap below).    My question is; how is this range of times defined?  Is it the minimum to maximum range, the 90% confidence interval, or perhaps the 25th to 75th percentile?