C++ Changing the values of members of a const struct

I have a struct which is defined in types.h with the following code:  struct data_Variant {      FlightPlanSteeringDataRecord steeringData;     FlightPlanType               flightPlan    :  8;     MinitoteLegDataType          legDataType   :  8; // discriminent, either current or amplified     unsigned                     spare         : 16;     union {             // currentLeg =>             CurrentLegDataRecord currentLegData;              // amplifiedLeg =>             AmplifiedLegDataRecord amplifiedLegData;     } u;   };  I am then trying to pass an instance of that struct as a parameter to a function in a C++ source file called dialogue.cpp:  void dialogue::update( const types::data_Variant& perfData){ ... }   I now want to change the value of some of the members of that struct inside this update() function. However, if I try doing this as I usually would, i.e.  perfData.etaValid = true;   I get a compile error which says: "C2166: l-value specifies const object". As I understand, this is because perfData has been declared as a constant variable. Am I correct in thinking this?  Since I didn't write this part of the code, but only want to use it to update the value displayed on the GUI, I don't really want to change the perfData variable by removing the const keyword, in case I break something else. Is there any way to change the value of a variable that has been declared as const?  I have tried declaring the same struct variable in another part of the code, without using the const keyword, to see if I can change the values of some of its members there... i.e. in Interface.cpp, I have added the following code to a function called sendData():  types::data_Variant& perfData; perfData.steering.etaValid = true; perfData.steering.ttgValid = true;   However, I now get the following compile errors on these lines:  error C2653: 'types' is not a class or namespace name error C2065: data_Variant: undeclared identifier error C2065: 'perfData': undeclared identifier error C2228: left of '.steering' must have class/ struct/ union   Is there a way of updating the values of this struct? If so, how should I do it, and what am I doing wrong here?  I have added the following function to the dialogue.cpp source file, as suggested in the answer:  void dialogue::setFPTTGandETAValidityTrue( FlightPlanMinitoteTypes::FlightPlanMinitoteData_Variant& perfData) { SESL_FUNCTION_BEGIN(setFPTTGandETAValidityTrue)     perfData.steeringData.fpETAValid = true;     perfData.steeringData.fpTTGValid = true; SESL_FUNCTION_END() }


How do I fix the "Duplicate sources.list entry" warning?

When I run sudo apt-get install -f I get this output:  Reading package lists... Done Building dependency tree        Reading state information... Done The following package was automatically installed and is no longer required:   libedbus1 Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. W: Duplicate sources.list entry http://extras.ubuntu.com/ubuntu/ precise/main amd64 Packages (/var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages) W: Duplicate sources.list entry http://extras.ubuntu.com/ubuntu/ precise/main i386 Packages (/var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages) W: You may want to run apt-get update to correct these problems   How do I fix these warnings?


Move existing Windows 7 or 10 installation to new computer?

I have a Windows 7 64-bit installation on my current PC, and I want to move it to a new PC .. I do NOT have a problem with licensing, as the new system already has its own new Windows 7 license, which I intend to use.  I want to use my existing installation, because it has 3 years worth of installed office related software development software, which installing again could take weeks !  I'm assuming that I can use Windows 7's Backup and Restore feature to backup a system image to a network location, then restore that network stored system image on the new PC ?  Again, like I said, I don't have a WIndows 7 licensing issue, as both machines are corporate provided and come with their own licences.


In Interstellar, how did humans survive the first time in order to communicate?

Throughout Interstellar, there are many references to "They" - the advanced species that created a multidimensional spacetime artifact that allowed Cooper to talk with Murphy. The movie makes it pretty clear that "They" are an advanced humanity.  They create the wormhole that enables the whole plot of Interstellar.  My question:   How did these humans survive in order to do this, in the first place?   Humankind only survives because of the effects of the wormhole, both allowing travel to other worlds and a new colony and Cooper communicating backwards in time. I don't understand how either of these would have happened however given that both are precipitated on humankind already surviving and causing them.


I want to split a character string n by n. I know how to do that 1 by 1 :  \documentclass{article} \makeatletter  \def\s@plit<#1#2>{%   \ifx\empty#2%     #1%   \else     #1,\s@plit<#2>%   \fi}  \def\Split#1#2{\s@plit<#2\empty>} \makeatother  \begin{document} \Split{1}{123456789} \end{document}   It gives : 1,2,3,4,5,6,7,8,9  But I also want 1,23,45,67,89 or 123,456,789 ... depending from the first parameter.  EDIT  Work straight and reverse, even with foreach.        \documentclass{article}     \usepackage{tikz,xparse,xstring}  \DeclareDocumentCommand{\split}{smmo}{%     \xdef\Entree{#3}%     \let\Sortie\empty%     \IfBooleanTF #1     {% sans étoile         \loop         \StrRight{\Entree}{#2}[\tmp]%         \edef\Sortie{\Sortie,\tmp}%         \StrGobbleRight{\Entree}{#2}[\Entree]%         \unless\ifx\Entree\empty         \repeat         \StrGobbleLeft{\Sortie}{1}[\Sortie]%     }     {% avec étoile dans l'ordre inverse         \loop         \StrRight{\Entree}{#2}[\tmp]%         \edef\Sortie{\tmp,\Sortie}%         \StrGobbleRight{\Entree}{#2}[\Entree]%         \unless\ifx\Entree\empty         \repeat         \StrGobbleRight{\Sortie}{1}[\Sortie]%     }     \IfNoValueTF{#4}{\Sortie}{\edef#4{\Sortie}}     }  \begin{document} \split{2}{6513782}  \split*{2}{6513782}  \split*{2}{6513782}[\bob]  \foreach \x in \bob {[\x] }  \end{document}


Why can't I use GPU rendering in Blender?

Why is it that Blender will only allow me to render with a CPU (GPU choice is unavailable)? Or is it until I acquire a graphics card that is specially built for such a task?  The images below show a Dell System Diagnostics (Video calibration) and GPU-Z results.      Platform: Dell Inspiron 3521 notebook with Core i3 Intel HD Graphics 4000


I have a list of objects I wish to sort based on a field attr of type string. I tried using -  list.sort(function (a, b) {     return a.attr - b.attr })   but found that - doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribute with type string?


Why don't we pluralize "foot" in measurements?

For example, to answer the question, "How tall are you?" valid answers include:   Five feet. Five foot three. Five feet, three inches.   Why the discrepancy between feet and foot, seemingly only in the second case.    This question is inspired by this question:   edit: I do not believe the answer to this is related to the other question. The explanation for the other question is because of how adjective modifiers work. My question is a very different case, unrelated to adjectives. My observation is that I am asking about a particular exception case which applies only when "foot" is followed by a number which is assumed to be inches. That's extremely specific, and I doubt that the etymology has any relation to why we leave adjective modifiers singular.


Adjust gap between \widehat and letter beneath (in subscripts)

I would like to know how to adjust the gap between a widehat and the letter beneath. Here is a minimal working example:  \documentclass[a4paper,10pt]{article} \usepackage[T1]{fontenc}  \begin{document} \[ E_{\hat{\lambda}}(\lambda) D_{\hat{\lambda}}(\lambda)F_{\hat{\lambda}}(\lambda) \] \[ E_{\widehat{\lambda}}(\lambda)D_{\widehat{\lambda}}(\lambda)F_{\widehat{\lambda}}(\lambda) \] \end{document}     The \hat's in the first line are too small to be properly distinguishable. On the contrary, the \widehat's in the second line are too big and do not seem to belong to \lambda anymore because of the big gap between them.  Any idea to make this formula look better ? In particular, I need to reduce the gap between the \widehat's and the \lambda. In addition, I would like the size of the hats to be somewhere between the size of \hat's and of \widehat's. Any help would be greatly appreciated.


Does $\lim_{k\to\infty} \sum_{n=1}^{k} f(n)$ converge?

I am wondering if there is a rigourous way to show the following series converges: $$ f(x) = \begin{cases} \dfrac{1}{x^2} & x \in \mathbb{N} \\[1ex] g(x) & x \not\in \mathbb{N}\in \mathbb{R} \end{cases}$$ Here, $g(x)$ could be anything, but for interest, wouldn't converge on its own. When we do the following: $$\lim_{k\to\infty}\sum_{n=1}^{k}f(n).$$ Do we get a limit that exists? Intuitively we would, because summation is only defined on the natural numbers (unless we redefined it here, doing some interpolation between points). However, I am not certain this function is integrable, which would suggest the function does not converge (unless my understanding of the Integral Test is wrong, after all, it says nothing of whether the integral exists, just if it converges the sum converges and vice-versa).


How to make procedural broken glass material with a particular shape

Hello, I want to create something like this image does, in cycles. Does anyone know how to make procedural broken glass that can look like this ? I am looking for a way to not have the random voronoi cracks. Thanks!


Why are users with less than 1000 rep unable to see vote-counts?

I know that once a user passes 1000 reputation (or 750 in a smaller site), they gain the ability to see vote-counts, rather than vote total (upvotes - downvotes). However, I don't really understand what purpose this serves. I know that some activities are not given to a new user to prevent spam/abuse (for example, limited voting, commenting, etc.), but what's the harm in letting a new user see vote-count?   And also, it seems to me like certain abilities or more important than vote-counts, but received earlier. For example, a user with 500 rep is trustworthy enough to downvote, award bounties, access the review queues and some other things, but not yet trustworthy enough to see how many down vs up votes a question has.  Why is this privilege designed the way it is? Also keep in mind, I'm not trying to change it, I just want to understand the thought-process behind it, since it doesn't make much sense to me.


How to form a shape with selective shapes in various size?

Basically my question is how to make this like the image that I uploaded. I know that you need to pick a shapes, and a picture of what whatever you would like to form into. Where can I buy or download that illustrator script?


Can Stack Overflow change the password criteria?

Why the crazy password requirements? It a Q&A site, and I have to conform to arbitrarily chosen password complexity criteria.  With a 22 random lowercase characters (entropy 119 bits), the  asks me to:    Just adding uppercase characters to the mix does not satisfy the requirements.  With 125 bits of entropy, It still asks me to:    Fortunately, doing either of these does satisfy the requirements. As long as there are enough unique characters.  The password a1ᓕ♵Ŀꁏꂯ (with a1 replacing Unicode characters to satisfy the numbers and letters requirement, reducing the level of entropy from 112 to 88 bits) still causes the generator to insist that the password:    Sadly, the famous  password doesn't fly, either:    I add entropy in my passwords in other ways than the Password1 (entropy approximately 0) mechanism suggested by these requirements, and prefer to use the Stack Exchange OpenID provider.


If I have a firepit on my screen porch, how high does the ceiling need to be?

I'm building a large screen porch.  The roof is held up by wooden trusses and there is no ceiling.  There will be ceiling fans attached to the joists on the trusses (but they won't be run when we have a fire in the fire pit).  I'm planning a chimney on the ridgeline of the roof.  (The fire pit may be off center, but I figure if the chimney is on the ridge, then the smoke will rise and always find its way up to the chimney.)  I'm thinking about putting a wood burning firepit on the porch.  If I do that, how high would the bottom of the roof trusses have to be to be fire-safe?  (Note I'm not worried about discoloration.)  Also, what if I switched to a propane fire pit?    This is not the same as .  The variations may be slight, but the other question is in enough of a different setting that the answers there didn't give me the answers I needed.


How do I set focus follows mouse in Ubuntu 17.10 and later with GNOME 3?

I found multiple answers on askUbuntu about this topic. But none of them suites to Ubuntu 17.10. So I need to ask again:  How do I set focus follows mouse in Ubuntu 17.10?


Are Stack Exchange URL parameters defined anywhere?

Are the parameters used in Stack Exchange URLs defined anywhere?  For example, I just encountered a stackexchange.com URL with rq=1, and I frequently encounter stackexchange.com URL's with cb=1.


Text files open in Nautilus instead of Text Editor

When I try to open a "plain text document" (no file extension) it opens its folder in the file manager (Nautilus), instead of opening the file in my text editor.  This happens when I open it through Chromium, or through the Dash, or through the command line using xdg-open.  I have set "Geany" as the default application to open "plain text document" with. But this only works if I open the file from within Nautilus.


Executable jar file from Maven with dependencies

Maven jar plugin - java.lang.NoClassDefFoundError from Intellij jar file  I am trying to jar a class from a maven project but getting class not found error.   I have added this to the pom file              <plugin>                 <!-- Build an executable JAR -->                 <groupId>org.apache.maven.plugins</groupId>                 <artifactId>maven-jar-plugin</artifactId>                 <version>3.1.0</version>                 <configuration>                     <archive>                         <manifest>                             <addClasspath>true</addClasspath>                             <classpathPrefix>lib/</classpathPrefix>                             <mainClass>training.avro.KafkaAvroJavaProducerV1Demo</mainClass>                         </manifest>                     </archive>                 </configuration>             </plugin>   I do a maven install and then run   java -jar target/kafka-avro-v1-1.0-SNAPSHOT.jar   Which is the name of my project, this main class runs fine when i run from intellij.   But then I get this error running from the jar  Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/kafka/clients/producer/Producer         at java.lang.Class.getDeclaredMethods0(Native Method)         at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)         at java.lang.Class.privateGetMethodRecursive(Class.java:3048)         at java.lang.Class.getMethod0(Class.java:3018)         at java.lang.Class.getMethod(Class.java:1784)         at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)         at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) Caused by: java.lang.ClassNotFoundException: org.apache.kafka.clients.producer.Producer         at java.net.URLClassLoader.findClass(URLClassLoader.java:382)         at java.lang.ClassLoader.loadClass(ClassLoader.java:424)         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)         ... 7 more


Sudo is working without password? Is this a bug?

sudo commands are running without any passwords. I had not made any setting to make something like "sudo without password" This view show how sudois running without prompting for password   user@user:~$ sudo su -- root@user:/home/user# exit exit usrer@user:~$ who am i user   pts/0        2014-10-01 15:29 (:0) user@user:~$ sudo chown -R user:user /opt/lampp/htdocs user@user:~$ <br/>   Is this a system problem and need update or smth else I did updated my system yesterdaythis is /etc/sudoers `  # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults    env_reset Defaults    mail_badpass Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"  # Host alias specification  # User alias specification  # Cmnd alias specification  # User privilege specification root    ALL=(ALL:ALL) ALL  # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  # See sudoers(5) for more information on "#include" directives:  #includedir /etc/sudoers.d`   and sudoers.d  # # As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on # installation of the package now includes the directive: #  #   #includedir /etc/sudoers.d #  # This will cause sudo to read and parse any files in the /etc/sudoers.d  # directory that do not end in '~' or contain a '.' character. #  # Note that there must be at least one file in the sudoers.d directory (this # one will do), and all files in this directory should be mode 0440. #  # Note also, that because sudoers contents can vary widely, no attempt is  # made to add this directive to existing sudoers files on upgrade.  Feel free # to add the above directive to the end of your /etc/sudoers file to enable  # this functionality for existing installations if you wish! # # Finally, please note that using the visudo command is the recommended way # to update sudoers content, since it protects against many failure modes. # See the man page for visudo for more information. #


convergence in $L^1$ for product of functions

If $f_n$ converges to $f$ in $L^1$ and $g_n$ converges to $g$ in $L^1$. Does it necessarily mean that $f_ng_n$ converges to $fg$ in $L^1$ for finite measure spaces.


What might be a flavor substitution for someone with an onion allergy?

I can't eat onions of any kind, from shallots, green onions, red, white, yellow, or purple. What might I use as a subtitute for flavor?


Why don't the forces of Thranduil and Dain aid Gondor in the Battle of the Pelennor Fields?

It seems, that in The Hobbit movie (Battle of Five Armies), Thranduil leads a impressive force of Mirkwood elves to reclaim his treasure in Lonely Mountain, but he doesn't help in the Pelennor Fields battle. Heres his army in the Hobbit movie:   Dain's army is featured:    My question is why didn't these Elves and Dwarves help Gondor in the Battle of the Pelennor fields? After 60 long years, maybe their forces would have been built up to counter the Sauron-threat..? I have not read the books in a long time, so I cannot seem to think of an answer.


Prove: For a function $f$, if $f^2$ and $f^3$ are analytic in G (a set in C), then $f$ is analytic in C.  I don't get the question. Why would I need to know that $f^3$ is analytic if I already know that $f^2$ is. Can't I just derive the Taylor series expansion? Any help with this would be appriciated!


How to align an object so one of its faces are axis-aligned? (make an object upright for eg)

I'm considering adding a feature to the 3d-printing tools, or to the Transform menu -- whichever is more appropriate.  Background: When 3d printing, one often must rotate an object so some face(s) lie flat on the xy plane, so it'll print flat.  Present method (which works, but is a lot of steps):   Select the desired face (in edit mode) Shift+Numpad7 to view it from its local Top Go to Object mode and add an Empty Check Align to view (so the empty is aligned to the top-down view of the face) Parent the object to the empty (empty becomes parent) Select the empty and clear its rotation (Alt+R) Select and unparent (Alt+P) the object, using Keep transformation Success!   Desired methods: A. Rotating the mesh in edit mode might be satisfactory, so:   Select face Hit button (Make Face Bottom?) in 3d-Printing tools, which rotates the whole mesh so that face aims down.   Note: Sometimes someone may want to align so this is the top or side face, so the button might be better as: Align object to face, followed by a tool option which allows a selection of: "Top, bottom, left, right"    B. Rotating the object itself might also be desired by some, instead:   Select face Shift+7 to view from face's "top" Go to object mode In the transform menu, select Align object view-rotation.  Tooltip: Rotates object to align the current view's rotation with an axis.(Or something more clear). Tool-options allow overriding default of -Z with: Z-, Z+, Y-, Y+, X-, X+   Note: Tool-options may also allow a pulldown of the available Transform orientations, defaulting to global.    The easiest and fastest implementation might be a python addition to the 3d-printing tools, but I believe it worthwhile to consider the usefulness of this feature in normal modeling, and therefore its addition to the transform menu -- this has the secondary positive effect of it working on the object instead of the mesh, thereby retaining the object's local transform orientation.  Advice, suggestions, questions, or assistance are all welcome.


How to install ibus-avro in Ubuntu 17.04

This question is very similar to  In fact, this is the way I installed Avro earlier.   Recently I have installed Ubuntu 17.04 in a new laptop, and followed the same process given in the link. However, after installing (and following the steps) the font is not showing up as Bengali. In n fact, it started typing in Arabic!  Any idea what went wrong? I have followed all the processes multiple times.


I usually go to the right top corner and at the drop down menu I select the tool icon to go to the settings.  However, 19.10 does not have a tool icon.  How can I go to settings now?


Install Ubuntu touch on Android device Motorola G2 XT1068

Can I install Ubuntu Touch on Moto G2 XT-1068?


Easiest way to quickly include or exclude all images from Latex file

I have several images saved in pdf. However, due to the way they are generated, each are 800 Kb each. (The maximum size I worked with previously was 200Kb)  Each figure is included in the file in the standard way:  \begin{figure}[ht]     \begin{center}         \includegraphics{my pdf}     \end{center} \end{figure}   This causes the pdftex to compile very slowly, and after compiling, the images will take a little longer to go from blurry to crystal clear. On average about 20 seconds but that is up from 8 seconds I am used to previously.   Is there a "switch" that allows me to turn on and off including images. Because when I work with the actual texts I do not need those images. This is when I wish to turn them off. After I have finished with the texts, and I want to add the images back in. This is when I should turn the switch on.   I have tried to put all images in a separate folder, and removing path to that folder, but of course that throughs a graphics not found error. Is there some better way to do this aside from commenting them all out?


Presence of autocorrelation and estimation of coefficients

I am a beginner in quantile regression, quantreg package in R.I found that it is a good method to analyze data with outliers or non-normally disturbing data, but can´t find anything about homoscedasticity and autocorrelation assumptions. Research papers using quantile regression don´t mention it. Can somebody help me with the assumptions that the model in quantile regression must fulfill? Are homoscedasticity and no autocorrelation important in this type of regression? I can not find any relevant literature about it. I know that heteroscedasticity and autocorrelation lead to the biased coefficient in the linear regression model and therefore I usually used variance-covariance matrix with appropriate arguments. But how can I interpret the results of quantile regression, if there is a problem with autocorrelation, heteroscedasticity, or both of them?


My Windows disk partitions are appearing under “Other Locations”, When I access the partitions, I can open files, read them, but I cannot create a new folder. I'm using dual boot with Windows 10 and Ubuntu 20.04.


Circular permutations with indistinguishable objects

Given n distinct objects, there are $n!$ permutations of the objects and $n!/n$ "circular permutations" of the objects (orientation of the circle matters, but there is no starting point, so $1234$ and $2341$ are the same, but $4321$ is different).  Given $n$ objects of $k$ types (where the objects within each type are indistinguishable), $r_i$ of the $i^{th}$ type, there are   \begin{equation*} \frac{n!}{r_1!r_2!\cdots r_k!} \end{equation*}  permutations.  How many circular permutations are there of such a set?


The question is basically to find out the solution of the differential equation $$(2x^2+3y^2-7)xdx-(3x^2+2y^2-8)ydy=0$$.  Since the given differential equation is non homogeneous I tried to find out the point of intersection of $2x^2+3y^2-7=0$ and $3x^2+2y^2-8=0$.I got the point of intersection and then I tried to shift the coordinate system to that point.this removed the constant terms.However I was not able to proceed further.Please help me in this regard.thanks.


How to select all edges/vertex between 2

something selecting edges is very time consuming and you dont want to user the shoertcut to select everything just a small part connected by 2 edges.  how to accomplish that, meaning, I select an edge at one end and another at another end an automatically select everything between?  thanks


How to extrude and scale with an even offset?

I'm quite new to Blender, so forgive me if this is a dumb question. I don't even know hot to describe it properly, so:      Basically I want to extrude a rectangle and then scale it along two axis, but without keeping the proportions; I want to reduce them of the same quantity, so that I get something similar to the frame of a picture.


lstlistoflistings isn't showing the lstlistingname

I've actually a problem with my document.  I redefined the listing for my ruby code:  \usepackage{listings} \renewcommand\lstlistingname{Quellcode} \lstloadlanguages{Ruby} \lstset{% basicstyle=\small\ttfamily\color{black}, commentstyle = \ttfamily\color{red}, keywordstyle=\ttfamily\color{blue}, stringstyle=\color{orange}, backgroundcolor=\color{grey}, columns=fullflexible}  \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}} \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}   And redefined the lstlistoflistings.  \renewcommand\lstlistlistingname{Quellcodeverzeichnis}  \addcontentsline{toc}{section}{Quellcodeverzeichnis}  \lstlistoflistings  \newpage   But the lstlistoflistings isn't showing the name, only the number of the lst.  Here is the actually lstlistoflistings:    Can anyone help me and show me how I can get the lstlistingname (Quellcode)  in every line of lstlistoflistings?  Thanks  UPDATE:  Here a MWE:  \documentclass[12pt, a4paper, oneside]{scrartcl}  \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage[ngerman]{babel} \usepackage[hidelinks=true]{hyperref} \usepackage[final]{pdfpages}  \definecolor{grey}{gray}{0.9}  \usepackage{listings} \renewcommand\lstlistingname{Quellcode-Ausschnitt} \lstloadlanguages{Ruby} \lstset{% basicstyle=\small\ttfamily\color{black}, commentstyle = \ttfamily\color{red}, keywordstyle=\ttfamily\color{blue}, stringstyle=\color{orange}, backgroundcolor=\color{grey}, columns=fullflexible}  \usepackage{color} \usepackage{xcolor}  \usepackage{caption} \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}} \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}  \usepackage{geometry} \geometry{a4paper, top=25mm, left=25mm, right=25mm, bottom=20mm, headsep=10mm, footskip=12mm}  \begin{document}   \renewcommand\lstlistlistingname{Quellcodeverzeichnis}  \addcontentsline{toc}{section}{Quellcodeverzeichnis}  \lstlistoflistings  \newpage    \begin{lstlisting}[language=Ruby, caption=StatusCalculator Initialize, label=initialize]   def initialize(project_id)     @project = Project.find(project_id)   end   \end{lstlisting}  \end{document}


Can anyone shed some light on why I cant get a variable from this class?

I have been trying for some time now to get a variable from MySurfaceView to use in my Player class. I cant seem to make it work... I tried getting the touch information from my MainActivity class but it wasn't really where I wanted it and also couldn't seem to make it work. Any help is appreciated!  MySurfaceView.java  package com.Frenchie.SurfaceView;  import ...  public class MySurfaceView extends SurfaceView implements Runnable {      Bitmap bitmap;     SurfaceHolder surfaceHolder;     int LastTouchx;      Player player;      public MySurfaceView(Context context, AttributeSet attributeSet) {         super(context, attributeSet);          player = new Player(context);          surfaceHolder = getHolder();          //Starts the run()         Thread TestThread = new Thread(this);         TestThread.start();     }       @Override     public void run() {         //TODO movement here when display is working         while (true){             Update();             DrawPlayer();         }     }      public void Update(){         player.Update();     }      public void DrawPlayer(){          Canvas canvas = surfaceHolder.lockCanvas();          if (surfaceHolder.getSurface().isValid()) {              canvas.drawColor(Color.BLUE);             canvas.drawBitmap(player.getBitmap(), player.getX(), player.getY(), null);             surfaceHolder.unlockCanvasAndPost(canvas);         }         else{              Log.d("DrawPlayer", "Surface Not Valid");         }     }      @Override     public boolean onTouchEvent(MotionEvent event) {         LastTouchx = (int)event.getX();         //LastTouchy= (int)event.getY();         Log.d("Touch Value ",LastTouchx+"");         return false;     }      public int getLastTouchx() {         return LastTouchx;     }  }   Player.java  package com.Frenchie.SurfaceView;  import ...  public class Player {     //Bitmap to get character from image     private Bitmap bitmap;      //coordinates     private int x;     private int y;      //motion speed of the character     private int speed = 0;      MySurfaceView mySurfaceView;      //constructor     public Player(Context context) {         x = 75;         y = 500;          //Getting bitmap from drawable resource         bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.player);     }      //Method to update coordinate of character     public void Update(){          //updating x coordinate          if (x > mySurfaceView.getLastTouchx()){             x++;         }         else if (x < mySurfaceView.getLastTouchx()){             x--;         }         else{              Log.d("Update","Else triggered");         }      }      public Bitmap getBitmap() {         return bitmap;     }      public int getX() {         return x;     }      public int getY() {         return y;     } }   Messages  E/AndroidRuntime: FATAL EXCEPTION: Thread-4     Process: com.Frenchie.SurfaceView, PID: 26348     java.lang.NullPointerException: Attempt to invoke virtual method 'int com.Frenchie.SurfaceView.MySurfaceView.getLastTouchx()' on a null object reference         at com.Frenchie.SurfaceView.Player.Update(Player.java:36)         at com.Frenchie.SurfaceView.MySurfaceView.Update(MySurfaceView.java:68)         at com.Frenchie.SurfaceView.MySurfaceView.run(MySurfaceView.java:62)         at java.lang.Thread.run(Thread.java:762)   This was not a duplicate of the post suggested.


What is the equivalent terminal commands for installing Languages?

I know I can install any Language and fonts by going clicking Dash->Settings->Language Support->Install/Remove Languages but how can I do this if I'm using Ubuntu Server and I do not have a GUI.


How do I get the headers and footers to reach the top right and bottom right corners of the page? The placement just looks weird now.  \documentclass{article}  \usepackage{fancyhdr}  \pagestyle{fancy}   \lhead{\huge top left header}  \chead{}  \rhead{\huge top right header}  \lfoot{\huge left footer}  \cfoot{\huge center footer}  \rfoot{\huge right footer}  \renewcommand{\headrulewidth}{0.2pt}  \renewcommand{\footrulewidth}{0.2pt} \usepackage[margin=1.8cm]{geometry}  \begin{document}  \huge Will the header and footer appear properly? Will they actually reach the corners of the page? Or will the text be much wider than the header and footer?  \end{document}


Find the limit for the sum of a series with $a_k = \frac{1}{k\cdot 2^k}$

I have to find the following limit:  $$\lim_{n \to \infty} \sum_{k=1}^n\frac{1}{k\cdot 2^k}$$  The exercise also provides me with the following function definition:  $$ f_n(x) = \frac{x^n}{1-x} $$  I tried to integrate this function by parts on the interval $[0, \frac12]$ and it led me something like this:  $$ I_n = \int_0^\frac12 \frac{x^n}{1-x} \, dx = \log2 - \frac{1}{2^n} + n\int_0^\frac12 x^{n-1} \log(x-1) \, dx $$.  This seems to look like a part of my sum terms but I don't know how to finish the integration and I cannot complete the limit. Could you help me please?


Usage of "Who" and "whom" in the given sentence

In the given sentence,"There’s Mr. Som, who they say is the best singer in the country" is "who" is the correct word to be used or "whom"


I have a .shp file (downloaded from ), but it is a bunch of pink lines (I expected something like a bunch of dots or something and I have to transform it into gps coordinates (which I guess it's a .gpx file), but I have a lot of trouble finding the tools to do so and understanding what everything means. Right now I'm using QGIS, and I think once I have the coordinates I should dump the values into PostGIS. Could you guys point me in the right direction about which tools I should use, how or tips about how to do things the right way?  Further explanation: I want to get coordinate points that "shape" the coastline, so given a house's position, it can tell you how far away the coast is from the house.  Edit: I managed to get some stuff with QGIS "extract nodes" option, but I don't see any use for this data:  Shape_Leng,Shape_Area 309.72983208000,4079.18723489000 309.72983208000,4079.18723489000   Values repeat a lot and they don't look like map coordinates. What went wrong?


Customizing bash shell: Bold/color the command

There are a number of tutorials/posts online (e.g. ) about how to customize your prompt in bash by setting PS1.  Is there a way to customize the color/bolding of the command I type?    In other words, as an example lets say that I wanted a green prompt, a bold blue command, and then output in whatever colors would be default.  In the example below, I already know how to make "joe>" show as green, blue, bold, whatever by setting PS1.  But is there a way I can I make git status show as bold for example?  joe> git status # On branch master # Your branch is ahead of 'origin/master' by 2 commits. # ...


Upgrading multiple modules at once crashes the process

Just upgraded from 7.18 to 7.23 and selected to upgrade all modules and all I got is neverending 'Preparing to update your site' on Installing updates page on /authorize.php?batch=1&op=start&id=40  So what if I refresh page or something will the site crash or something?  UPDATE: It just crashed after like 20 minutes of nothing and I got this error:  An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /authorize.php?batch=1&id=40&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {queue} WHERE (item_id = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 8656 ) in SystemQueue->deleteItem() (line 273 of /modules/system/system.queue.inc).Uncaught exception thrown in shutdown function.PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: UPDATE {batch} SET batch=:db_update_placeholder_0 WHERE (bid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] =&gt; a:12:{s:4:&quot;sets&quot;;a:1:{i:0;a:15:{s:7:&quot;sandbox&quot;;a:0:{}s:7:&quot;results&quot;;a:2:{s:3:&quot;log&quot;;a:1:{s:5:&quot;views&quot;;a:1:{i:0;a:2:{s:7:&quot;message&quot;;s:57:&quot;Installed &lt;em class=&quot;placeholder&quot;&gt;views&lt;/em&gt; successfully&quot;;s:7:&quot;success&quot;;b:1;}}}s:5:&quot;tasks&quot;;a:0:{}}s:7:&quot;success&quot;;b:0;s:5:&quot;start&quot;;d:1377856599.71076107025146484375;s:7:&quot;elapsed&quot;;i:0;s:5:&quot;title&quot;;s:18:&quot;Installing updates&quot;;s:12:&quot;init_message&quot;;s:40:&quot;Preparing to update your site&lt;br/&gt;&amp;nbsp;&quot;;s:8:&quot;finished&quot;;s:38:&quot;update_authorize_update_batch_finished&quot;;s:4:&quot;file&quot;;s:35:&quot;modules/update/update.authorize.inc&quot;;s:16:&quot;progress_message&quot;;s:29:&quot;Completed @current of @total.&quot;;s:13:&quot;error_message&quot;;s:22:&quot;An error has occurred.&quot;;s:3:&quot;css&quot;;a:0:{}s:5:&quot;total&quot;;i:12;s:5:&quot;count&quot;;i:12;s:5:&quot;queue&quot;;a:2:{s:4:&quot;name&quot;;s:17:&quot;drupal_batch:40:0&quot;;s:5:&quot;class&quot;;s:10:&quot;BatchQueue&quot;;}}}s:16:&quot;has_form_submits&quot;;b:0;s:11:&quot;current_set&quot;;i:0;s:11:&quot;progressive&quot;;b:1;s:3:&quot;url&quot;;s:36:&quot;/authorize.php?batch=1&quot;;s:11:&quot;url_options&quot;;a:0:{}s:10:&quot;source_url&quot;;s:0:&quot;&quot;;s:8:&quot;redirect&quot;;s:28:&quot;/authorize.php&quot;;s:5:&quot;theme&quot;;s:5:&quot;seven&quot;;s:17:&quot;redirect_callback&quot;;s:11:&quot;drupal_goto&quot;;s:2:&quot;id&quot;;s:2:&quot;40&quot;;s:13:&quot;error_message&quot;;s:110:&quot;Please continue to &lt;a href=&quot;/authorize.php?batch=1&amp;amp;id=40&amp;amp;op=finished&quot;&gt;the error page&lt;/a&gt;&quot;;} [:db_condition_placeholder_0] =&gt; 40 ) in _batch_shutdown() (line 537 of /includes/batch.inc).


How to use the symbol \angle at the section title

I want to use the symbol \angle at a section title but I get an error message:      ! Illegal parameter number in definition of \reserved@a. to be read   again $ l.9   \section{Second section: $\angle$ }   See the MWE:  \documentclass{article}  \begin{document}     This is my document.      \section{First section: $S=\sin(\alpha)$}     Use $\angle$ at normal text.      \section{Second section: $\angle$ } %Here the error occurs     Text at second section.  \end{document}   So the question is, how may I use the \angle symbol in a section title?  Thanks!


How to generate a list of numbers which made from n digit?

how many numbers can we generate from n digit? For example: from 1,2,3, we can generate 1,2,3,12,13,21,....321. And how can we generate a list containing those numbers in python?


Getting Random.h (uses unistd.h) to work on VC++

I'm new to C++. I want to use the header file Random.h (described here ). It uses unistd.h Which gives me an error    "Cannot open include file: 'unistd.h': No such file or directory"  I've googled around and seen that the issue is that unistd.h works with unix not visual express. Some posts suggest using mingw instead but I've tried that and it doesn't work. Can anyone tell me how to get unistd.h (or at least the bits of it I need) to work on Visual Express.  There are some suggestions online but I cant find anything that addresses my particular question. thanks!


Vim: apply settings on files in directory

How do I specify Vim settings for all files under the current directory?  The ideal solution would be if Vim searched for and read a .vimrc in the current directory before searching for ~/.vimrc, and apply the settings there for the entire tree.  I've seen a , but this means the applied settings aren't transparent since they require the plugin to be installed.  In contrast, a modeline is transparent since regardless of a user's vimrc or specific vim invocation the modeline settings will be applied for that file.  Things I tried are   placing a .vimrc in the working directory :so vimrc in the modeline.   I suppose both don't work for security reasons.  I don't need the full power of a vimrc; being bound to settings acceptable by a modeline would suffice.  My goal is to make it easier for vimmers to adopt coding standards in a project.


Why a gold badge isn't shown near a user name in this question?

In this question, Shadow Wizard doesn't have gold badge shown near his name, however he closed this question, having gold support badge and .        Is it a bug or I am missing something?


Drag and drop (or copy/paste) into Program Files in Windows 10

I would like to move a folder from Downloads into Program Files. It used to work in older Windows versions (e.g. 7), but I can't do it in Windows 10 (Version 1607).  I tried the following, it always fails silently:   Drag and drop from one Explorer window to another Copy (or cut), and then paste Using the "Move to" button in the ribbon   The image below shows what I used to get, but no longer see. Any way to get it back? I'm not sure if this was a change in Windows 10, or if there is a problem on my side.


How do we prove $\int_I\int_x^1\frac{1}{t}f(t)\text{ dt}\text{ dx}=\int_If(x)\text{ dx}$

Let $f:\mathbb{R}\to\mathbb{R}$ be Borel-measurable and Lebesgue-integrable over $I:=(0,1)$. Further, let  $\;\;\;\;\;\;\;\;\;\;g : I\to \mathbb{R}\;,\;\;\; \displaystyle x \mapsto\int_x^1\frac{1}{t}f(t)\text{ dt}$  I want to show that $g$ is integrable over $I$ and that it holds  $\;\;\;\;\;\;\;\;\;\;\displaystyle\int_Ig(x)\text{ dx}=\int_If(x)\text{ dx}$  Proof: $\;\;\;$ Please note that $g$ is well-defined, because $f$ is Lebesgue-integrable over $I$. So, by  $g$ is integrable and it holds:  $\;\;\;\;\;\;\;\;\;\;\displaystyle\int_Ig(x)\text{ dx}=\displaystyle\int_I\int_x^1\frac{1}{t}f(t)\text{ dt}\text{ dx}=\displaystyle\int_x^1 \int_I\frac{1}{t}f(t)\text{ dx}\text{ dt}=\displaystyle\int_x^1 \frac{1}{t}f(t)\text{ dt}=\cdots$  How do we integrate $\int_x^1 \frac{1}{t}f(t)\text{ dt}?$


There exists a bijection between $(0,1)$, $(0,1]$ and $[0,1]$?  These 3 sets are not countable and since there are all in $\mathbb{R}$ they should have the same number of elements, so my question which are those bijective functions?  I've been thinking, but I cannot find of any.


Problem with SpO2 calibration for pulse oximeter

I have designed a Pulse Oximeter with IR and red LED. I need to calculate SpO2. How to calibrate the Sp02?


Suppose $E$ is a normed vector space. Let $f$ be a continuous linear functional on $E$ and denote by $M$ the Kernel of $f$. Let $x\in E$. How to show that $$\operatorname{dist}(x,M)=\displaystyle\inf_{y\in M}\|y-x\|=\frac{|f(x)|}{\|f\|}\, ? $$


Electromagnetic waves are photons or photons cause electromagnetic waves ? Its said that when charges are accelerated we get electric and magnetic field that carries energy but then they say that this energy is transferred in the form of photons so its confusing.


My layers are gone and I'm in global view. How do I get them back? I've tried the numbers, shift + numbers, I'm in global view and nothing works. Please help!


How can I abort a running JDBC transaction?

Is there a way to prematurely abort a transaction? Say, I have sent a command to the database which runs five minutes and after four, I want to abort it.  Does JDBC define a way to send a "stop whatever you are doing on this connection" signal to the DB?


Points and polygon with same coordinate system do not line up in ArcMap 10

1st, I added a shapefile with projected coordinate system SL_grid_99 to Table of contents.   2nd, I added my points (excel file) to the table of contents. I displayed XY data and exported point data as shapefile. This is the coordinate system for the points:    It seems that both, point and polygon, have the same coordinate system. However, they are not lining up. As can be seen in the map, the points are in the lower left-hand corner:   How can I make the points and polygon line-up?


Check next value in array, if matches, delete next item (PHP)

I'm attempting to check the next item in the array's sub-items for matching values of only some of the sub-items, then delete found matches.   I'll eventually need to add code before the deletion which will collect the difference between sub-items if a match is found so I can't simply use array_unique().   The following works to an extent;   $n = 1;  for ($i = 0; $i < count($array); $i++) {     if($array[$i]['author'] == $array[$n]['author']     && $array[$i]['parentID'] == $array[$n]['parentID']) {         unset($array[$n]);         //skip the removed item and continue;         $i++;         $n++;     }     $n++;  }   However, it only removes one instance and leaves any matching following conditions. (1 removed below, but 2 not removed)  [0] => Array     (         [parentID] => 85560         [author] => Carla         [revisions] => 1     ) [2] => Array     (         [parentID] => 85560         [author] => Carla         [revisions] => 2     ) [3] => Array     (         [parentID] => 85560         [author] => Charlie         [revisions] => 4     )   Here is the initial input;  [0] => Array     (         [parentID] => 85560         [author] => Carla         [revisions] => 1     ) [1] => Array     (         [parentID] => 85560         [author] => Carla         [revisions] => 2     ) [2] => Array     (         [parentID] => 85560         [author] => Carla         [revisions] => 2     ) [3] => Array     (         [parentID] => 85560         [author] => Charlie         [revisions] => 4     )


How fast can the Earth spin and support life?

In prehistoric times, dinosaurs were so massive that archeologists wonder how they were not crushed under their own weight.  Could the Earth rotate fast enough to make everything considerably lighter and retain an atmosphere?  Could the slowing of the rotation cause extinction among the larger animals in the future if an asteroid hit the Earth at such angle as to slow its rotation?  Update: This question did not do well here and I have written it here. Both answers were up voted by me.


Proper way of installing puttygen on Amazon Linux

I'm trying to install puttygen on an Amazon Linux server. puttygen is provided by the putty package available in EPEL, but installation fails with it unable to find several required C libraries:  Error: Package: putty-0.63-7.el6.x86_64 (epel)            Requires: libgtk-x11-2.0.so.0()(64bit) Error: Package: putty-0.63-7.el6.x86_64 (epel)            Requires: libatk-1.0.so.0()(64bit) Error: Package: putty-0.63-7.el6.x86_64 (epel)            Requires: libgdk_pixbuf-2.0.so.0()(64bit) Error: Package: putty-0.63-7.el6.x86_64 (epel)            Requires: libgdk-x11-2.0.so.0()(64bit)   Currently I'm installing putty on a Centos 6 box, then copying the binary /usr/bin/puttygen on to the Amazon Linux box. This works for my use-case, but I'm not keen on circumventing the package manager in this way. Is there a 'proper' way of doing things?


Determining true mean from noisy observations

I have a large set of data points of the form (mean, stdev). I wish to reduce this to a single (better) mean, and a (hopefully) smaller standard deviation.  Clearly I could simply compute $\frac{\sum data_{mean}}{N}$, however this does not take in to account the fact that some of the data points are significantly more accurate than others.  To put it simply, I wish to preform a weighted average of these data points, but do not know what the weighting function should be in terms of the standard deviation.


Get past times new roman font installation

Can someone tell me how to get past this image in the terminal.


Reinstalling a fresh Windows 7 on a SSD while its original HDD version was upgraded to Windows 10

Many posts around that subject, but this case is a bit specific (I think) since it's not about a migration nor a cloning.   Initially Windows 7 on a 500GB HDD (OEM) then upgrade to Windows 10 (offered by Microsoft)   Now we have a brand new 550GB SSD and would like to install a fresh Windows  on it (and get rid of the old one on the HDD).   Do we have to install the initial (Win 7) or the upgraded (Win 10) on the SSD? What happens with the license, will Microsoft accept the license "transfer" automatically?   We'd prefer to install Windows 7, unless 10 is mandatory (or recommended).  Edit  Actually we'll go for win 10 since we need to switch languages after the install (thanks @Ramhound). Thus the question is back to the classical Win 10 reinstall, and is definitely a dupe . . .


If $A$ and $B$ are $n×n$ matrices, $AB = -BA$ , and $n$ is odd, show that either $A$ or $B$ has no inverse.   I have no clue how to do this and any help/guidance would be appreciated!  Thanks in advance!    $$det(AB) = det(-BA)$$  $$det(AB)= det(-B)det(A)$$  $$det(AB) = (-1)^ndet(BA)$$ since n is odd  $$det(AB) = -det(BA)$$ $$det(A)det(B) = -det(B)det(A)$$ $$2det(A)det(B) = 0$$  Therefore $det(A)=0$ or $det(B)=0$


Not seeing grub after installing Ubuntu alongside windows 10

I have installed Ubuntu 20.04 alongside windows 10 in dual boot. But after the restart I am not able see the grub and directly starts windows 10. Therefore not able to boot ubuntu or change any other boot settings. Current bios is UEFI which is default with disabled legacy support. I searched on internet for solution but everyone says need to modify some grub related file and update the grub. But since ubuntu is not booting I cannot try these methods.


'Should've seen it glow' or 'should've seen it glowing'?

Which one of the following is the correct one?   I should have seen it glow. I should have seen it glowing.   Or are both correct? Would you parse them please?


Standard deviation of a ratio (percentage change)

I have 2 data sets. The first data set, let's call it $X$ has an average value of ($\bar X$) and standard deviation of ($STD_X$), the second set of data also has the average value of ($\bar Y$) and standard deviation of ($STD_Y$). I want to find out the standard error or standard deviation of a percentage change of data set 2 compared to data set 1. So I have $((\bar Y-\bar X)/\bar X)*100$. Now my question is, how do you take into account the standard deviations for this percentage value?


How to access QGIS Plugin Repositories from behind a proxy?

I have been trying to teach myself QGIS by using this forum and others to help. Most of my questions can be answered by downloading plugins that are available through 3rd party repositories but for some reason I am not able to connect with these. Anyone have any ideas why this is the case?


$(a_{n})_{n=1}^{\infty}$ is a convergent sequence of integers. Prove the existence of $N \in \mathbb{N}$ such that $a_i = a_j$ for all $i, j > N$.

Assume $(a_{n})_{n=1}^{\infty}$ is a convergent sequence of integers. Prove   the existence of $N\in\mathbb{N}$ such that $a_i = a_j$   for all $i, j > N.$   I am completely lost on what this question is asking, do I use the definition of a limit to show it converges and doesn't leave epsilon? I have searched and can't find this precise question.


I suspect iptables to refuse some connection attempts I do on some ports. How to view the log of connections refused by iptables?  I use iptables on Kubuntu 14.04 LTS x64.  sudo iptables -v -x -n -L outputs:  francky@francky-Aurora-R4:~$ sudo iptables -v -x -n -L Chain INPUT (policy ACCEPT 1735891 packets, 225230318 bytes)     pkts      bytes target     prot opt in     out     source               destination  6368899 10355529368 fail2ban-ssh  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22  Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)     pkts      bytes target     prot opt in     out     source               destination  Chain OUTPUT (policy ACCEPT 3860995 packets, 5648955269 bytes)     pkts      bytes target     prot opt in     out     source               destination  Chain fail2ban-ssh (1 references)     pkts      bytes target     prot opt in     out     source               destination  6362396 10355135821 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0


open dropdown list from javascript function

Iam trying to show the dropdown option when javascript function is called. but eventually iam not succeed on this. need help Here is my code:  <script> function showState(str){  $('#Acntname').trigger('click');  } </script> ... <select class="input_panel" id="Acntname" >  <option value="0">Select</option> <option value="1">Equity Share Capital</option> <option value="2">Deprication Fund</option>  </select>  <input type="text" class="input_panel" id="accountname" onkeyup="showState(this.value)"/>   i used triggered function to open the dropdown but it doesn't work.


How to add shortcut to unity launcher programmatically?

I'm developing a program in Qt that will help users to manage (create, edit and delete) their quicklists in Unity launcher.  I got to a point where I created .desktop file and I don't know how to programmatically place that file on Unity launcher.   I found two (bad) ways to do this:   Manually drag and drop created .desktop file to unity launcher Edit favorites key with "gsettings set com.canonical.Unity.Launcher favorites" and force unity to reload with "unity --replace"    So, I'm searching for a function or a system command that is called on first 'drag and drop' method so I can do it in my program without need for user to do it manually.  I don't even know where (or how) to search for my solution so any suggestions will be helpfull.


I am more familiar with Windows and Linux where when I close the application window, the application is closed. On Mac Big Sur, commonly, when I close an application, a small dot exists under the icon in the dock, indicating the program is still running. Why is this? For example, while on Linux or Windows, when I close my sole Visual Studio Code window, the application completely closes. The process is completely gone. When I close vscode on mac, a small dot still exists in the doc, and when I open activity monitor, I can see the 'Code' process is still running.


Solving a complex analysis question without using complex analysis knowledge

I am asking about solving this $$\int_{-\infty}^{\infty} \frac{x\sin x}{(x^2+a^2)(x^2+b^2)} dx$$ without using complex analysis' knowledge, but using something like integration by substitution, integration by parts, etc. I can tell the answer is $\frac{\pi}{b^2-a^2}(e^{-a}-e^{-b})$, but I don't know how to do it.


I want to install ntpstat in Ubuntu for checking if NTP is working.


Prompt: Line is deleted by switching through commands

I tried to change my prompt to my own preferences, but when I'm switching through the commands I recently entered (with key-arrows), sometimes the whole line with the prompt is deleted only some chars of the prompt with the chars of the command I recently entered remain:  Expected Output:  bucky in [~]: cd ..   Output:  buccd ..   'buc' is part of the prompt, 'cd ..' is a command I recently typed.  My prompt:  PS1="\[\033[0;34m\u\] \[\033[0;37min\] \[\033[1;32m[\]\[\033[0;31m\w\]\[\033[1;32m]\]\[\033[0;37m:\] "   To give you a visualization here is an image:     If needed, I'm using Ubuntu 16.04


Is the Force from Star Wars a genetically given ability or something that anyone can develop?

Or are some naturally better at it, but certain people with the right genes are able to use it better, like really powerful Jedis are mutants? I've wondered about this before and I've never had it cleared up.


Good mathematical introduction to loop quantum gravity

All websites or papers I could find did only have a mathless introduction for laymen. Does anybody know where to find a precise and mathematical introduction to LQG, for example containing the "interpretation" or "meaning" of holonomy groups and one-loop amplitudes in the theory?


While repairing my soldering iron I damaged a resistor. I need to know the value of this resistor. How can I find the value from its colour code?


Best way to check online status on html5

I need to understand while my web app working if browser is connect to internet or not. This mean I have to use cloud data or localstore one.  When i use navigator.onLine only chrome tell me the truth. Firefox or Safari only check if I am connect to wi-fi.  I create a function that send a ping to a specific website and try to download a little file every time, but if I use my web app on a mobile this is not a good solution.  Can anyone can tell me another idea?


Given a joint density function, what is the conditional expectation $E[Y|x]$?

The random variables $X$ and $Y$ have the joint density $$f_{X,Y}(x,y)= \left\{\begin{matrix}e^{-y}, \mbox{ } 0\leq x \leq y \le \infty \\ 0,  \mbox{   otherwise}\end{matrix}\right.$$ Evaluate the conditional expectation $E[Y|x]$.    I'm not sure if I'm doing this correctly. Please let me know if something is off in my solution. Thanks for reading.  My solution: (My expected value is negative, which I'm pretty sure can never be the case. Also in line 4 and 8, are the domains correct?)  $$E[Y|x] = \int_{-\infty}^{\infty}yf_{Y|X}(y|x)dy.$$  $$f_{Y|X}(y|x) = \frac{f_{X,Y}(x,y)}{f_{X}(x)}.$$    $$f_{X}(x) = \int_{-\infty}^{\infty}f_{X,Y}(x,y)dy$$   $$= \int_{0}^{\infty}e^{-y}dy $$  $$=\left [ -e^{-y} \right]\Big|_0^\infty $$  $$ = -e^{-\infty}-(-e^{0})=1. $$ $$f_{X}(x) = 1, x \geq 0.$$ Thus,   $$E[Y|x] = \int_{0}^{\infty}-ye^{-y}dy$$  $$= -\int_{0}^{\infty}ye^{-y}dy$$ After integration by parts,  $$E[Y|x] = \left [ ye^{-y}+e^{-y} \right]\Big|_0^\infty$$ $$=0-[e^{0} + 0]=-1$$ Therefore, $E[Y|x] = -1.$  Thanks in advance for reading this long problem and responding!


What is the reason that most of ICs (e.g. MCU) has multiple (A/D)GND and (A)VCC pins?   If it is to increase performance of an IC, how does it help to performance? or is it easier for the IC designer to connect some pins externally?    some footprint of ICs have a GND connection under the case, how does it help? Would it improve performance of an IC if I draw a GND under the case even if it is not required?


Im been trying to solve this but nothings popping out

Three numbers form a geometric sequence. If 5 is added to the second term, then the resulting numbers will constitute an arithmetic sequence. If 22.5 is added to the third number, these numbers will again form a geometric sequence. Find the original numbers.


Use of 'it' and 'that' in affirmative replies

Could you please explain the reason for the difference in use between "it" and "that?"  Example:     A.  Is your name Jim?  B. Yes, it is.     We can't say "Yes, that is". Why not?     B.  Is your name Jim?  B. Yes, that's right, it is.     We can't say "Yes, it's right".  Why not?


Show the cirucumcircles of all triangles $PAB$ have the same radius

Given $2$ circles $W_1$ and $W_2$ which intersect at points $X$,$Y$. Let $P$ be an arbitrary point on $W_1$. Suppose the lines $PX$,$PY$ meet $W_2$ again at points $A$,$B$ respectively. Prove that the circumcircles of all triangles $PAB$ have the same radius.  MY TRY:- I tried to use coordinate geometry, but it didn't work. Please help me.


Unable to see changes on reputation tab from downvotes

A little while ago, I lost a little bit of rep from downvotes. However, there was no -2 shown on my reputation tab, but when I clicked on the tab, I could see the changes. In other words, I had to click on the reputation tab to see the changes. Why do I need to click on it in order to see the changes?  Related:


Why is the image of a laser point both real and virtual when shone on a plane mirror?

I shined a laser pointer on a mirror to see how it reflects, quite interestingly, I saw the image of the laser point on the floor inside the mirror and an image on the floor right beneath me OUTSIDE the mirror without any distortions or loss of resolution. So a plane mirror technically should only produce a virtual image  in all cases, but there seems to be a contradiction here as both a real and virtual image are seen at the same time.


Extract maximum values for each objects from a file

I need to extract some values from a file in bash, on my CentOS system. In myfile.txt I have a list of objects called Info_region in which each object is identified with a code (eg. BARD1_region_005 or BIRC2_region_002 etc.) Moreover there are some others columns in which are reported some numerical variable. The same object (same code name) can be repeated several times in my file. I also have a file that contains a completed list with all object codes without duplicates. I would like to obtain an output.txt file in which each object (code name) is reported only once as in my list-file.txt and I would like to associate to this the maximum possible values associated with that code name in myfile.txt. myfile.txt: (columns are separated by tab) Info_region Lig_score   Lig_prevista    Lig_prevista_+1 Int_score   Expo_score  Protac_score BARD1_region_005    0   3   3   0   1   1 BARD1_region_006    0   1   1   0   1   1 BIRC2_region_001    1   6   7   0   1   2 BIRC2_region_001    1   7   8   0   1   2 BIRC2_region_001    0   2   2   0   0   0 BIRC2_region_001    0   12  12  0   1   1 BIRC2_region_001    1   10  11  -1  1   1 BIRC2_region_001    1   2   3   0   1   2 BIRC2_region_001    1   0   1   0   1   2 BIRC2_region_001    1   6   7   0   1   2 BIRC2_region_002    0   0   0   0   1   1 BIRC2_region_002    1   0   0   -1  0.5 0.5 BIRC2_region_003    0   0   0   0   1   1 BIRC2_region_004    0   1   1   0   1   1 UHRF1_region_004    0   0   0   1   1   2 UHRF1_region_004    0   0   0   1   1   2 UHRF1_region_004    1   0   1   0   0.5 1.5 UHRF1_region_004    0   0   0   1   1   2 UHRF1_region_005    0   3   3   1   1   2 UHRF1_region_005    1   0   0   -1  1   1  file-list.txt: Info_region BARD1_region_005 BARD1_region_006 BIRC2_region_001 BIRC2_region_002 BIRC2_region_003 BIRC2_region_004 UHRF1_region_004 UHRF1_region_005  output.txt: Info_region Lig_score   Lig_prevista    Lig_prevista_+1 Int_score   Expo_score  Protac_score BARD1_region_005    0   3   3   0   1   1 BARD1_region_006    0   1   1   0   1   1 BIRC2_region_001    1   12  12  0   1   2 BIRC2_region_002    1   0   0   0   1   1 BIRC2_region_003    0   0   0   0   1   1 BIRC2_region_004    0   1   1   0   1   1 UHRF1_region_004    1   0   1   1   1   2 UHRF1_region_005    1   3   3   1   1   2  Could someone help me please? Thank you!


In the following sentence I'm not sure where to put implicitly:     The language doesn't support Int and (implicitly) converts (implicitly) Int to Double (implicitly).   First I put it at the end, because I learned:     The man drove the car carefully.   But somehow it sounds strange: converts Int to Double implicitly.  Most natural to my ears is implicitly at position two so I would place it there, although comparing  to  indicate to put it at the first place (Same for converts (with s)). But most Google hits show its use with cannot, should, ..., so I'm unsure which one is correct in my example above.  Which one is correct and why?


During episode 11 of Tokyo Ravens, there was a scene on a weekend that Dairenji Suzuka visited Tsuchimikado Harutora's room and explored its inside just to annoy Harutora.  Then after that, Suzuka also asked to enter Tsuchimakado Natsume's room. However, Natsume deliberately refused Suzuka's demand even though that they know that Suzuka can black mail Natsume about revealing her great secret.    Natsume even forced herself to go to her room even when Suzuka was already restraining her.   (Just look at Natsume's worried face XD)   And after that, Natsume was forcibly tied by Suzuka in order for them to visit Her room. The inside of the room was pretty normal, so they wondered why would Natsume be that worried, but as Suzuka monitored the room, she noticed a very complicated barrier that is protecting Natsume's closet. Curiously, Suzuka tried to forcibly open the closet by removing the barrier. Then Natsume desperately crawled going to her room with tears in her face showing her great fear of Suzuka opening the closet and them knowing the contents inside.  (Just look at her annoyingly cute expression as she crawled! XD)   Since Harutora was kind enough to feel pity on Natsume, He ordered Kon to release Natsume from her binding.  As soon as Natsume's binding was released, she desperately called Hokuto (Overpowered) just to protect her secret; Thus destroying her room due to Hokuto's size.    Now, this is my question:   Why was Natsume desperate of not letting them (Suzuka, Harutora, Touji) enter her room, even though its pretty normal? (if there is no exact reason, maybe a girl's perspective will do) What is inside Natsume's closet? Is it so very important that she even protected it with strong barriers and even called Hokuto just to protect it? (there is also a  but the answers did not fill the void in my heart.


I'm attempting to find motion graphics software to visually explain complex topics.  Here's an example of what I'm after:   I've looked at Houdini, After Effects, Boris, etc., but all of those products seem to be overkill for what I'm trying to do.   I'm just looking for a few standard shapes/images (and ability to import my own images) that I can move around and voice over.  (I'm using a PC)


Can a subclass access a superclass' private members?

In Java, class A defines a member variable private int num; Class B is a subclass of class A.   1- If the two classes are in the same package - does B inherit num?  2- If the two classes are not in the same package - does B inherit num?


How to capture the depth and enormity of a deep ravine?

I was recently out on a hike and came across a dry waterfall in a deep ravine. There was a viewing platform, and I took several shots.  The problem is, that everything was flattened. The enormity of the gorge just wasn't there. (This is understandable, we're projecting a 3d space onto a 2d sensor)   What techniques or lenses should I use to capture the depth?


Winning the round before all players have had a turn in Phase 10

Would it be correct to say that before the round can be officially 'over' in Phase 10, everyone playing should be able to take a turn? For example: three people are playing Phase 10 and just started a new phase, we'll say Phase 6: 1 run of 9.  Player 1 picks up from the deck and discards a card from his hand; Player 2 picks up that card and is able to lay down 10 cards and discard the last card-thus, completing and finishing the phase.  However, would Player 3 be entitled to a turn before the round is completed? I can't recall if this is an actual rule in the Phase 10 rule book or if over the years our family had just adopted the rule to let the example Player 3 have a turn to try and be fair.


indian visa rejection: mistaken identity

I am a Bangladeshi citizen. I applied for the indian visa back to back 3 times and every time they rejected my visa. somehow I get to know that my name Mohammad Hossain which is a similar kind of name  matched with some terrorist... so funny it is to me... so for that reason they consider me or my passport into blacklist...  Now what can I do for that... I really need the visa as I want to go there for my wedding shopping in july.


Can we have a notification when the answer to any of my question got edited?

If a user asked a question and got an answer which was not helpful.  After sometime the answerer edits the answer with some good content. How the OP will get to know that?  Is it necessary to add comment check my edited answer?  We can say that the OP should refresh the page to find the helpful answer.  Consider if the OP finds the answer as helpful and accepted that. After sometime if the answerer/anyother user edit the answer to change the content which may not solve the issue.   How will it be notified to OP?  currently we are notifying the OP when there is any comment to the queation or any new answers or any comments with the name of OP with @ to any answer.  This will lead the future visitors to confuse and reduce the quality of post.  Can we have a notification to the original poster when the answer to any of his/her question got edited?


What online tool is suggested for the picture package in LaTeX?

As you know there are online tools for drawing tables for LaTeX.   Is there any online tool which can be used to generate the pictures (any geometrical graphics and shapes) easily?   That means we don't need to manipulate the codes in LaTeX to get the desired graphics. Instead, we can generate the graphics in the tool and then copy and paste the corresponding codes into the LaTeX file.


How to position an xypic diagram within body of text

I have an xypic diagram that I want to have within the body of text (article class). The .tex file looks like this at the relevant place:  \section{A Framework}  What we have now is a picture that looks like the following:  \xymatrixcolsep{3pc} \begin{figure} \centerline{\xymatrix{ *+[F-]\txt{`The World'}\ar[d] & & *+[F-]{\text{Models}} \ar[d]\\ *+[F-]\txt{Propositions $p, ...$}\ar[d] & & *+[F-]{\txt{Sentences $\phi, ...$}} \ar[d]\\ *+[F-]\txt{Informal Theory $T_I$} \ar[d] \ar[rr]_*+[F-:<8pt>]{\small{\emph{Formalisation}}}  & & *+[F-]{\txt{Formal Theory $T_F$}} \ar[d]\\ *+[F-]{\text{Informal Beliefs}}\ar[d] &  & *+[F-]{\txt{Formal Properties}} \ar[d] \\ *+[F-,]{\bf{e.g. Semantic Realism}} \ar@{-}@/^6pc/[uuuu] \ar@{.}[rr] & & *+[F-,]{\bf{e.g. Categoricity}} \ar@{-}@/_6pc/[uuuu] & \\ }} \end{figure}  There are such things as informal mathematical theories, consisting of purely mathematical propositions in natural language, which are in turn about mathematical reality (or, `the world') in some sense.   I want the diagram to be where it seems to be placed in the code, but when I typeset it just sticks to the top of the page, before the section 'A Framework' even begins. How do I move it? Can't seem to find any advice.


Cannot open Android 4.1 on PC as in mass storage mode

I cannot open my phone in Mass Storage Mode. I've tried using the MTP and PTP which were on the list on USB settings and I've tried using Eclipse in ADB (which only copies one file at the time). With MTP, the file transfer stops when it gets on a big file. With PTP, I can only see photos. There's another phone which is older and has this ability to be displayed as a drive, but why doesn't this newer one have it? Is there an app where I can transfer files over Wi-Fi maybe? Don't tell me Dropbox because NSA spies on it and it takes a lot of time to upload it there. Is there an app that bypasses settings and makes my NONROOTED phone capable of initiating Mass Storage Mode?


Based on the question , I was wondering if it is possible to have a series of tetris blocks that is impossible to clear. For example, getting the string TTTSS.. forces the player to lose even with best play.   Assuming that the tetris field is as usual, 20 high by 10 wide.


Don't automatically open the folder of mounted devices

I usually charge my phone through a USB connection. Due to Ubuntu 13.04 detecting and mounting it, Nautlius automatically opens the mounted folder. Can I stop Nautlius from automatically opening the folder of some mounted devices?


Replace internal links with question title in chat

When posting questions or answers, internal links are automatically converted into question titles.  i.e. https://meta.stackexchange.com/q/298748/351462 →   Can the same functionality be added for chat messages?      Related:


Show that ${n\choose r}={{n-1}\choose{r-1}}+{{n-1}\choose {r}}$.


I know there are many questions answered with this title but I have not found any that fit what I'm looking for...  I need to use regex like this "/^ user input $/i" The user input can put the * regex character in front of or behind the text.  If I use the "new RegExp(user input, "i")" does not accomplish the requirements of ^ and $ and the user regex character *.  I had something like this:  var foo = {User input};  var arr = ['Lorem Ipsum', 'simply dummy text', 'nothing'];  arr = arr.filter(function(item){      return /^{foo content here}$/i.test(item); });   Tests:  foo = "Lorem" -> array[] foo = "Lorem*" -> array['Lorem Ipsum'] foo = "Dummy" -> array[] foo = "*Dummy*" -> array['simply dummy text'] foo = "*" -> array['Lorem Ipsum', 'simply dummy text', 'nothing']   Many thanks.


Three linked question on non-negative definite matrices.

1.a symmetric matrix in $\mathbb{M}_n(\mathbb{R})$ is said to be non-negative definite if $x^Tax≥0$ for all (column) vectors $x\in \mathbb{R}^n$. Which of the following statements are true? (a) If a real symmetric $n\times n$ matrix is non-negative definite, then all of its eigenvalues are non-negative. (b) If a real symmetric $n\times n$ matrix has  all of its eigenvalues are non-negative , then it is non-negative definite. (c) If $ A\in \mathbb{M}_n(\mathbb{R})$, then $AA^T$ is non-negetive definite. 2. only one of the following matrices is non-negetive definite. Find it. (a) $\begin{pmatrix} 5 & -3 \\ -3 & 5 \end{pmatrix}$. (b) $\begin{pmatrix} 1 & -3 \\ -3 & 5 \end{pmatrix}$. (c) $\begin{pmatrix} 1 & 3 \\ 3 & 5 \end{pmatrix}$.      3.let $B$ be the real symmetric non-negative definite $2×2$ matrix such that $B^2=A$ where $A$ where is the non-negetive definite matrix in question $2$.write down the characteristic polynomial of $B$.      My thoughts..  For1.  (a) & (b) are true but not sure about (c). For 2. (a) is the correct option since it has all positive eigen values.they are $2,8$. For 3. Eigen values of $B$ will be $\sqrt{2}$ and $\sqrt{8}$. So the answer is $x^2-3√2x+4=0$.      Can anybody help me to verify the solutions of the above problems.


How would one curve specific edges while leaving others alone? I'm trying to model this (circled) object, But can't figure out how to bevel side edges and leave the front-edge flat.     Tried using the bevel modifier in combination with edge creases but that apparently has no effect, not sure what else to do, as I am still very new to modeling/blender.


So I'm a 15 year old teenager who moved to Germany like 6 months ago (with my family of course) and I was wondering if I could travel alone back to my hometown in Croatia for a few days with a bus during my upcoming school holidays. Of course I have my grandmother to take care of me there. (The trip would be long around 20 hours so from Freiburg to Vukovar)


Starring and messy edges when smoothing or using sub surf modifier

I have a problem that when I apply a SubSurf modifier to my project, it has some starring and messy edges around the connection of my spheres. My goal is to have a string of "bubbles" which are smooth. I would also like to be able to rig them under one armature. The seams for UV unwrapping should be able to be placed where the spheres connect. I have used a Boolean modifier to merge the spheres. The problem I am having is that when I try to smooth out the spheres, starring occurs at the top and bottom of them. I have tried using loop cuts, the smooth option in the tools menu, and starting with a high-poly model, but none of that worked for me.  Here is an example of the starring:     Here is how the spheres should connect (Please ignore the starring and high-poly count):     And here is a download to what I would like to end up smoothing out:   If you have questions, please ask.


If I was or If I were? Which one is grammatically correct?

If I wasn't single and I had a girlfriend. If I weren't single and I had a girlfriend.    Could you explain the difference?


Using function in C to seperate words using strtok

I am trying to create function with C that should split string by delimiter and print each to new lines. If I give string as form of char str_working[] = "First,Second,Third"; inside the functions everything seems to work properly. If I give string as an argument to function then the function doesn't print anything.  #include <stdio.h> #include <inttypes.h> #include <string.h>  void seperate(char *str, char *sep);  int main() {     seperate("First,Second,Third", ",");     return 0; }  void seperate(char *str, char *sep) {      // This is showing "First,Second,Third"     printf("%s\n", str);      // When I use this one instead of str everything works fine!     // char str_working[] = "First,Second,Third";      char *token = strtok(str, sep);       // Nothing gets printed here!     while (token != NULL)      {          printf("%s\n", token);         token = strtok(NULL, sep);       }  }


Improve performance of Ubuntu guest in VirtualBox on Windows 10 host

I am trying to run an Ubuntu guest on Windows 10 using VirtualBox. I found the Ubuntu guest was running with slow response after the installation. I found some previous solutions for this problem by changing the settings under machine (like activating 3D acceleration, etc.), but I find my settings are locked. What is the solution for this? How to make the options active?


Can't login with Google on recently released iPhones and iPads

I just switched from an iPhone 7 to an iPhone XR (both are on latest iOS version available).  When I try to login into the Stack Exchange app with my Google account it says:     Request failed   Could not perform this request with your account. Please try logging   back in. If this persist, let us know on meta.   this happens consistently.  I have 2FA enabled on my Google account if it matters.  Is this a known bug?


The problem I've got here is to prove that semi vertical angle of a cone with maximum volume with total surface area constant is equal to $arcsin(\frac{1}{3})$ I am trying to do that by making some relation in terms of trigonometric equations and then differentiating it. Supposing slant height is $l$ and semi vertical angle is $\theta$ then radius becomes $r=l\sin(\theta)$ and height becomes $h=l\cos(\theta)$ Given $$S=\pi r^2+\pi r l=constant$$ $$V=\frac{1}{3}\pi r^2h$$ but somehow i am not able to get the exact relation between  $$V=\frac{1}{3}l^2\cos^2(\theta).l\sin(\theta)$$ then I am taking Derivative of Function $V(\theta)$ and equating to zero to get maxima , but it's not working out , help ?


How do I merge (or zip) two IEnumerables together?

I have an IEnumerable<T> and an IEnumerable<U> that I want merged into an IEnumerable<KeyValuePair<T,U>> where the indexes of the elements joined together in the KeyValuePair are the same. Note I'm not using IList, so I don't have a count or an index for the items I'm merging. How best can I accomplish this? I would prefer a LINQ answer, but anything that gets the job done in an elegant fashion would work as well.


This particular question was part of my analysis assignment I was unable to prove / disprove it.  Let $V$ denote the vector space of all sequences $a=(a_1 , a_2,...,a_n,...)$ of real numbers such that $\sum_{n\geq 1} 2^n |a_n|$ converges. Define ||.||: $V \to \mathbb{R}$ by $||a|| =\sum_{n\geq 1}2^n |a_n|$. Then is $V$ complete normed space or not.  There were four questions to be answered regarding $V$ . I have done 3 but unable to do this. I know about completely normed space but I was unable to do this . The  idea is to show that every sequence of sequence converges to a limit and that limit is to be constructed or guessed but I am unable to do it Kindly guide on how this should be done


Why won't the the public class work in Java?

I'm trying to make a simple bookstore program where people can browse the books and buy some if they want. First they'll choose a genre then choose a title before checking out. If they want to buy more, they'll be sent back to the genre selection.  package finalOOP1;  import java.util.Scanner;  public class main {     //i wanna make a bookstore that sells novels from all genre     public static void main(String[]args)     {         Scanner scan = new Scanner(System.in);         horror h1 = new horror();          System.out.println("Pick a genre:");         System.out.println("Horror");         System.out.println("Adventure");         System.out.println("Fantasy");         String genre = scan.next();          if (genre=="Horror")         {             h1.titles();         }      } }    import java.util.Scanner;  public class horror {       static Scanner scan = new Scanner(System.in);      public static void titles()     {         System.out.println("Pick a book number.");         System.out.println("1.1984");         System.out.println("2.Goosebumps");         System.out.println("3.Dracula");         System.out.println("4.Go back to genre selection");         int choose = scan.nextInt();          if (choose == 1)         {             System.out.println("You chose 1984.");         } else if (choose == 2)         {             System.out.println("You chose Goosebumps.");         } else if (choose == 3)         {             System.out.println("You chose Dracula.");         } else         {             main.main(null); //calling the main method from main.java         }     } }   I haven't made the other genres coz I just wanna try one first, but when I run the main.java, I input Horror, it immediately terminate itself. It didn't show the book titles. I'm wondering if I did something wrong?  I'm new to Java, so I don't really know how this works. Isn't horror.java supposed to work like a function in c++?


Link all Noto Fonts into a giant font in Windows 7

Windows 7 has various fonts that cover different scripts within Unicode. However, the free  provide a good alternative, covering a very large portion of Unicode with a visually uniform design.  I want to make these Noto fonts behave as one giant font in Windows. I know that Windows 7 provides a  mechanism, but I don't know how to link all the Noto fonts together.  Specifically, my questions are:   What registry keys do I need to create in order to define the linked font? What else must I do to enable the font linking feature?


Does a C++ function that returns, but doesn't use, a type need to #include that type?

Does this file required an #include to define FooType? The function's type signature returns FooType* but the function implementation doesn't use FooType.  // test.cpp class FooType;  // Unresolved forward declaration  FooType* GetFoo() { return nullptr; }   It builds without warnings using g++ --std=c++11 -Wall. So is this a legal use of forward declaration?


Allow moderators to edit/delete comments directly from a user's comment list

Moderators currently have access to a nifty list of all a user's comments (500 at a time), which . Unfortunately, we still have to visit the post where the comment was made before we can do anything about those comments, even if there is a pending flag.  The two-step process makes sense when we're trying to figure out if, say, a comment is obsolete; we need the context. It doesn't make sense if, for example, we're just trying to delete the user's 60 comments that all say something like, "You people suck," or "This isn't a homework site. Go RTFM." It's pretty safe to nuke those on sight. After all, moderators are, by definition, trusted users. We should trust them to be able to figure out when to do more investigation and when to nuke from orbit.  I propose fixing this by giving ♦ moderators the ability to edit or delete comments directly from the last-500-comments list. As far as I can tell, this was last , but never got any traction. I think it's time.


Scanning External Drives for Viruses - Ubuntu

So I recently installed Ubuntu onto one of my Computers and would like to uses it to scan external drives USB and what not for viruses that can affect windows PC. Is there a possible antivirus or antimalware detection tool i can use on Ubuntu to look for Viruses/Malware that can affect windows or MacOS computers?


On ubuntu 16.04. When I run lspci -nnk | grep -iA2 net I get:  01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)     Subsystem: Lenovo RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [17aa:383a]     Kernel driver in use: r8169     Kernel modules: r8169 02:00.0 Network controller [0280]: Qualcomm Atheros Device [168c:0042] (rev 30)     Subsystem: Lenovo Device [17aa:4035]     Kernel modules: ath10k_pci  $ rfkill list 0: ideapad_wlan: Wireless LAN     Soft blocked: no     Hard blocked: no 1: ideapad_bluetooth: Bluetooth     Soft blocked: no     Hard blocked: no 2: hci0: Bluetooth     Soft blocked: no     Hard blocked: no   As requested:  $ uname -a; dmesg | grep ath Linux Yinon 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux   Edditional edit:  $ sudo modprobe ath10k_pci modprobe: ERROR: could not insert 'ath10k_pci': Required key not available $ dmesg | grep ath [    1.509368]  [<ffffffff81081212>] warn_slowpath_common+0x82/0xc0 [    1.509370]  [<ffffffff810812ac>] warn_slowpath_fmt+0x5c/0x80   Ethernet works good. How can I find out what is wrong?


Clean way to make footer stick to the bottom of the page?

I am trying to get my footer stick to the bottom of the website, I haven't seen a good answer for making the footer stick to the bottom, when the page height is less than the viewport height and when the viewport height is less than the page height.


Does Ubuntu need regular cleanups like Windows. For example:   Cleaning the logs Temporary files Package cache Dependencies left over   I am not referring to web browsers only.  In case I never do a cleanup, will I have a system like new without my hard drive being full of temporary files, packages, etc.?  Will the performance degrade overtime if a cleanup is not done.


I am asked to determine if a series converges or not:  $$\displaystyle\sum\limits_{n=1}^{\infty} \frac{(2^n)n!}{(n^n)}$$  So I'm using the $n$th root test and came up with $\lim_{n \to {\infty}}\frac{2}{n}\times(\sqrt[n]{n!})$ I know that the limit of $\frac{2}{n}$ goes to $0$ when $n$ goes to infinity but what about the $(\sqrt[n]{n!})$?


Why do we generally round 5's up instead of down?

As an example, the number 15, rounded to the nearest tens, rounds to 20. I understand it's arbitrary, as 10 and 20 are equidistant from 15, I just wonder if there's any discernible logic behind the convention of rounding up. Even something like, 'It just feels more natural', would probably satisfy me. Just had to ask :)


"Featured on Meta" posts are displayed in what order?

As I am aware  posts are displayed in the "Featured on Meta" in the sidebar. The order of the posts is different on Meta Stack Exchange and other sites.   In what order (post created date, last active date, ...) are the posts displayed in the featured box?  On Meta Stack Exchange:        On Stack Overflow:


After the battle when the Witch King of Angmar was defeated his helm and clothing remain.  At this point he either died or dissipated into a bodiless form.   If he was wearing one of the Nine Rings, where did it go after the battle.  If not, is there any evidence of where these were kept?


Is Curse Bringer + Divine Smite + Wrathful Smite + Greenflame Blade RAW, RAI or Neither?

Warlock Hexblade (3), Paladin (x)  Boon: Pact of the Blade  Eldritch Invocations: Curse Bringer. Need minimum 5 lvls   Turn 1.1 Hexblade curse (bonus action)  Turn 2.1 (bonus action) Wrathful Smite  Turn 2.2 (normal action) Greenflame Blade  If melee hit spend 1 spell slot for Curse Bringer (no action) and 1 for Divine Smite (no action)


Can I usefully apply the Lyapunov CLT condition to a finite sum of Bernoulli random variables?

I'd like to get a CLT-like approximate distribution (mostly tail behavior) of the sum $X$ of $n$ independent Bernoulli random variables $X_1, \dots, X_n$, with proportions $p_1, \dots, p_n$. The  seems like it could help (as mentioned in ). But it's an asymptotic result on sequences of random variables. I have not become very familiar with this condition, but it seems like I could artificially construct $X_{n+1}, \dots$ such that the condition always holds? I'm not entirely sure on this point. Is there some way to apply it more meaningfully? If $p_1 = 0.5$ and $p_2, \dots, p_n$ are 0 (or extremely close to zero, like $1/2^{\max(100, n)}$), then clearly I should not be using a normal approximation for the distribution of $X =\sum_{i=1}^n X_i$. My case is not so extreme, but there are some $p_i$ very close to 0/1. Is there some common rule of thumb to use here? I suppose I could compute the Lyapunov CLT term for $\delta=1$ and compare this to $\frac{1}{\sqrt{n}}$ (when sequence is iid Bernoulli($p$) the term seems to decrease as $\frac{c}{\sqrt{n}}$ where $c$ is a function on $p$). The following is this Lyapunov CLT term -- if it approaches $0$ as $n \to \infty$ then the Lyapunov CLT condition is satisfied. $$\frac{1}{s_n^3}\sum_{i=1}^n E \left[ |X_i - E[X_i]|^3 \right]$$ Alternate idea is to use a Chernoff bound.


int main() {     myClass obj;      ....    /* doing things */     ....      delete &obj; /* illegal */ }   Lets assume myClass is a proper C++ class with everything in place. Now, I know this is illegal and this program will crash in runtime. Fist thing is that code is trying to delete a stack object and then again after the scope finishes it will be destoryed once again. I want to know the internals of this illegal operation. i.e. what will happen with delete, will it call the destructor? It may look like crazy to you but please help me to understand.


Odd-degree polynomials have roots (Intermediate Value Theorem)

Let $f(x)$ be a monic polynomial of odd degree. Prove that $\exists A\in \mathbb{R}$ s.t. $f(A)<0$ and there exists $B \in \mathbb{R}$ such that $f(B)>0$.  Deduce that every polynomial of odd degree has a real root.    There are questions that answer the final part, but they do not do so by proving the first part. I am fairly sure that this involves the intermediate value theorem, but not sure how to implement it in this case.


How can i make glitch photos like this picture?    Is there any special software or programming language to make photos like this?


If I stop flipping when I've reached equal heads and tails, what's the chance I never stop?

I toss a balanced coin until the number of heads I get equals the number of tails? What's the chance I never stop?  I have tried considering the reverse event and a recursive reasoning but nothing conclusive. A close question has already been asked here but I don't know the Markov formalism that is used.


Find $\displaystyle \int_{0}^{\dfrac{\pi}{2}} \dfrac{1}{1+\tan(x)^{\sqrt{2}}}dx$.   I am told I should solve this by switching the limits, but I am unsure of the substitution I should use.


Finding $\int_{0}^{1}\int_{0}^{1}\int_{0}^{1} \left\{\frac{x}{y}\right\} \left\{\frac{y}{z}\right\}\left\{\frac{z}{x}\right\} dx\space dy\space dz $

$$\begin{equation}     \int_{0}^{1}\int_{0}^{1}\int_{0}^{1} \left\{\frac{x}{y}\right\} \left\{\frac{y}{z}\right\}\left\{\frac{z}{x}\right\} dx\space dy\space dz \end{equation}$$  I am struggling with the above, I can deal with the case of double integrals but here due to my poor knowledge of triple integrals I am unable to decide what the limits should be in the transformed integral when I apply the substitution $\displaystyle \frac{x}{y}=u\space,\frac{y}{z}=v $ .  The integral turns to $\displaystyle \iiint \left\{u\right\}\left\{v\right\}\left\{\dfrac{1}{uv}\right\}z^2v\space du\space dv\space dz$ , but I have no idea about the limits.   Or even I am doing some mistake in these  steps only.   {.} Denotes Fractional Part


Interpreting p value in SciPy Welch's T-Test

Can someone help me understand the meaning of the p-value of the Whelch's T Test in SciPy?   test = stats.ttest_ind(x, y, equal_var=False)   gives me    Ttest_indResult(statistic=5.4320992218489925, pvalue=7.614106565771353e-08)   But with a statistic of 5.43, shouldn't be a 0.00000... p-value according to the T table instead?


Minecraft 1.13: conditionally apply effect when player holds specific item

Trying to have a levitation effect applied to any player when and only when that player holds a specific item (in this case, a renamed feather).  Pre-1.13 it worked using a string of command blocks that tagged a player using scoreboards and applied the effect to that player, but like many of the command blocks in this world, the 1.13 update broke them.  I realised that I should be able to use the execute if command, but I cannot seem to get it to work - it seems to either apply it to the player closest to the command block (even when another player is the only holding the item) or it applies it to all players.  Command currently looks like this:  execute if entity @a[nbt={SelectedItem:{id:"minecraft:feather",tag:{display:{Name:"\"Levitator\""}}}}] run effect give @p minecraft:levitation 1 4  I tried modifying that by nesting it with various combinations of execute as and execute at, but it still seemed to have the same issues (it would always execute relative to the command block not the player).  Any ideas on how to get this to work?


Show if series $\displaystyle \sum_{n=1}^{\infty}a_n$ has a positive terms and converge then the series  $\displaystyle \sum_{n=1}^{\infty}\frac{\sqrt{a_n}}{n}$ converge too.  I don't have idea what to use here, I'd be greatful for any hints


Is there any way to make a Google search case-sensitive?


How to apply freestyle on only one mesh?

I have a scene in Blender in which I want to apply freestyle effects to just one object. Is this possible. How can I do it? (I'm using Cycles)


How do I transfer my Destiny account from Xbox 360 to Xbox One?

I need help getting my account from my Xbox 360 to my Xbox One. I have a level 31 and level 29 guy and I'd not like to start over.


When to use dynamic vs. static libraries

When creating a class library in C++, you can choose between dynamic (.dll, .so) and static (.lib, .a) libraries. What is the difference between them and when is it appropriate to use which?


How do I utilize hardware-based encryption on an SSD?

Some SSDs support hardware disk encryption. How should I set up Ubuntu to take advantage of it?  There are  on setting up Full Disk Encryption, but it is unclear to me whether hardware acceleration gets used.


Discuss the convergence of the sequence: $a_1=1,a_{n+1}=\sqrt{2+a_n} \quad \forall n \in \mathbb{N}$

Computing the first few terms $$a_1=1, a_2=\sqrt{3}=1.732....,a_3=1.9318....,a_4=1.9828...$$ I feel that $(a_n)_{n\in \mathbb{N}}$ is bounded above by 2, although I have no logical reasoning for this. Since,  $(a_n)_{n\in \mathbb{N}}$ is monotone increasing sequence, it must converge by monotone convergence theorem, and converge to 2.   Can anyone help me to make this more formal? Besides, I would really appreciate if anyone could shed some light on how to find the bound and limit of such sequences (that are not in closed form but in recursion).


Executing dynamic SQL in a SQLServer 2005 function

I will preface this question by saying, I do not think it is solvable. I also have a workaround, I can create a stored procedure with an OUTPUT to accomplish this, it is just easier to code the sections where I need this checksum using a function.  This code will not work because of the Exec SP_ExecuteSQL @SQL calls. Anyone know how to execute dynamic SQL in a function? (and once again, I do not think it is possible. If it is though, I'd love to know how to get around it!)  Create Function Get_Checksum (     @DatabaseName      varchar(100),     @TableName         varchar(100) ) RETURNS FLOAT AS BEGIN   Declare @SQL        nvarchar(4000)  Declare @ColumnName varchar(100)  Declare @i          int  Declare @Checksum   float  Declare @intColumns table (idRecord int identity(1,1), ColumnName varchar(255))  Declare @CS         table (MyCheckSum bigint)   Set @SQL =          'Insert Into @IntColumns(ColumnName)' + Char(13) +          'Select Column_Name' + Char(13) +         'From   ' + @DatabaseName + '.Information_Schema.Columns (NOLOCK)' + Char(13) +         'Where  Table_Name = ''' + @TableName + '''' + Char(13) +         '       and Data_Type = ''int'''    -- print @SQL   exec sp_executeSql @SQL   Set @SQL =          'Insert Into @CS(MyChecksum)' + Char(13) +          'Select '   Set @i = 1   While Exists(        Select 1        From   @IntColumns        Where  IdRecord = @i)  begin        Select @ColumnName = ColumnName        From   @IntColumns        Where  IdRecord = @i         Set @SQL = @SQL + Char(13) +              CASE WHEN @i = 1 THEN                   '    Sum(Cast(IsNull(' + @ColumnName + ',0) as bigint))'                  ELSE                  '    + Sum(Cast(IsNull(' + @ColumnName + ',0) as bigint))'             END         Set @i = @i + 1  end   Set @SQL = @SQL + Char(13) +        'From ' + @DatabaseName + '..' + @TableName + ' (NOLOCK)'   -- print @SQL   exec sp_executeSql @SQL   Set @Checksum = (Select Top 1 MyChecksum From @CS)   Return isnull(@Checksum,0)  END GO


Blender 2.8 Mac OS , modifiers tab missing?

Hi I was using previous versions of 2.8 and now version available today, does not show the modifier tab on the right. I might get lost on UI updates?


What is the difference between "I have a doubt with ...." & "I suspect there is a problem"?

In Indian English, it is widely used as "I have a doubt with .....". While in America English, it is used as "I suspect there is a problem with...".  What is the conceptual difference between these two? Which is recommended/correct way to use?


I'm trying to understand C# and am very confused by this block of code.   Thread thread = new Thread(new ThreadStart(() => {        Thread.Sleep(_rnd.Next(50, 200));        //do other stuff })); thread.Start();   I know a thread is being created and then started but I don't understand the => syntax in this case. From checking other posts on this site, which were hard to find regarding =>, I think it was to do with delegates or that something is being returned? Can anyone shed some light on this? Thanks.