Let's say I have a Transform-component-type, and a Color-component-type (to keep things simple). I also have an entity E that is assigned both of these component-types. To render E, my engine will internally have to bind a uniform-buffer containing both a mat4-transformation-matrix, and a vec3-color. Now I think I heard conflicting opinions about whether there should be a strict 1-to-1 component_type-to-system relation, or whether it is considered more appropriate to have systems which act on multiple component-types. In the latter case I'd know how to do things. I would have a RenderSystem, which only considers entities which have both a Transform, and a Color component. For the first case I don't have a solution though.. Both the TransformSystem and the ColorSystem wouldn't know how to render the entity, since they only hold a subset of what is required by the shader. So I would just jump head-first into implementing my ECS as having one system potentially acting on multiple component-types, but I first wanted to hear from people having more experience with ECSs. Are there good solutions in an ECS that maps systems 1-to-1 to components to achieve behavior that is the effect of the presence of multiple different component-types, or is a solution in which one system requires the presence of multiple component-types generally preferable?

I'm planning to develop a game in C# (but I don't think that language matters) and I'll be using Entity Component System since I know by design that my game will have a lot of different game items with different twisted behaviours and logics. I have some experience using Unity ECS which I find very easy and intuitive. I've also programmed games in the past using the old "inheritance approach" and I found that pattern very not scalable. As far as I know, a pure ECS (which is not what Unity implements) works like this:  A GameObject is just a collection on Components, it may be seen as a wrapper class or as a shared index in some parallel arrays of Components. A Component is a collection of data (basically a record) which holds the data needed by its relative System to handle it. It does not implements game logic itself. A System is a world object which loop through each GameObject which has a component it can process and update game logic of that component.  My point is: if the Systems are the ones responsible for the actual game logic update (practically speaking, the game logic code is written inside the system), is there a 1:1 relation between every component and every system ? Let me explain with an example: let's say I have 2 components:  RenderSpriteComponent RenderLightSourceComponent  The first one does a simple 2D sprite rendering (using OpenGL or whatsoever); the second one send a light source to the rendering shaders. They do similar operations but with some actual differences. My question is: since they behaviour is different, should I implement two different Systems which will handle them separatly? If not, should I add a bunch of IF statements or overloads to handle those two components inside the same System? From my point of view both ways seem unnecessary, especially if the ECS should improve code scalability. Using one of those approach would force me either to implement a different system for each component I have (implying a lot of GameObjects loops) or either to fill my Systems with if and overloads making them impossibile to understand after a certain point. Furthermore, from what I can see and understand, Unity implements a different version of this pattern in which every component implements its own logic (in the Update method) and the GameObject is a wrapper class which has an internal list of components to update. Systems don't exist at all (or if they do they do, they do so for other reasons). This implementation looks easier and more "elegant" from my point of view, but I can't understand why it's not so spread and everyone sticks to the "classic" ECS implementation which has those "problems" I've described above. At the same time, I do not have control over the priority of the components updates, which can be useful in some cases. I understand there isn't an "absolute" better way to design your game structure, but I'd like to know how is generaly implemented. Or which factors would make a way better than the other.


EDIT: I want the difference between singleton class and a class with only static members. I don't want to compare the singleton class with the static inner class, because java doesn't allow static classes rather than static inner classes.  A Singleton class allows user to have only one object for that class. By this we can restrict the user to have only one instance of the attributes.   This could be achieved by using a class which has only static members and static methods (Not a static inner class)  So, What is the Difference between the following 2 classes  Singleton class:  public class Test {     public static void main(String args[]) {         Singleton s = Singleton.getInstance();         s.foo();     } }  class Singleton {      private static Singleton obj = new Singleton();      private Singleton() {     }      public static Singleton getInstance() {         return obj;     }      public void foo() {         // something...     } }   class with only static methods and members:  public class Test {     public static void main(String args[]) {         NotSingleton.foo();     } }  class NotSingleton {     public static void foo() {         // something...     } }

What real (i.e. practical) difference exists between a static class and a singleton pattern?  Both can be invoked without instantiation, both provide only one "Instance" and neither of them is thread-safe. Is there any other difference?


p and q are odd primes. I know I should use Fermat's little theorem, but truly I have no idea how to use it. May someone help me how to apply this theorem in this problem, or maybe give me some hints about it? $({p-1})^{q-1}+({q-1})^{p-1}\equiv 101\pmod{pq}$  i think i should explain why i would ask this again since i can get the below method of using Fermat's little theorem to get the solution of p and q.

The question is:   Find two distinct odd primes p and q such that  $({p-1})^{q-1}+({q-1})^{p-1} \equiv 101 \pmod {pq}$ Well... I only have the idea to write down     ${p-1}^{q-1} \equiv -1^{q-1} \equiv 1 \pmod {p}$   Actually, I solve this question by brute force and get p=11 q=3; however, I wanna know some wise solutions...  Mine is .... a bad one  Please help me to solve this question :(


$ sudo apt-get update #Don't get any errors $ sudo apt-get dist-upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.  $ sudo update-manager -d   Ubuntu checks for updates, tells me my computer is up to date. But there are only two options now "Ok" and "Settings". According to  and several other websites, there should be an option to upgrade it to 14.04, but I'm seeing none. How can I upgrade to 14.04?

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


Im really new to coding and ive been trying to make this minecraft plugin. Every time I launch it I get this error.   Here is the "launcher.NitroLauncher.onEnable" class.  package launcher;  import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.plugin.java.JavaPlugin;  public class NitroLauncher extends JavaPlugin {     private NitroLaunch launch;     private static NitroLauncher plugin;     private ReflectiveOperationException e;      public <Plugin> void onEnable() {         NitroLauncher.plugin = this;         try {             this.launch = (NitroLaunch)Class.forName("me.R1J.nitro.NitroPlugin").asSubclass(NitroLaunch.class).newInstance();             @SuppressWarnings("unchecked")             Plugin plugin2 = (Plugin)this;             new BukkitRunnable() {                 public void run() {                     NitroLauncher.this.launch.launch(NitroLauncher.this);                 }             }.runTask((org.bukkit.plugin.Plugin) plugin2);         }         catch (InstantiationException | IllegalAccessException | ClassNotFoundException ex2) {             String str = e.getMessage(); ;             ;             e = new ReflectiveOperationException(str);;             e.printStackTrace();         }     }      public Object getValue(Object pojo) throws IllegalArgumentException     {       try {         return _method.invoke(pojo, (Object[]) null);       } catch (IllegalAccessException | InvocationTargetException e) {         throw new IllegalArgumentException("Failed to getValue() with method "             +getFullName()+": "+e.getMessage(), e);       }     }      public void onDisable() {         if (this.launch != null) {             this.launch.shutdown();         }         this.launch = null;         NitroLauncher.plugin = null;     }      public static NitroLauncher getPlugin() {         return NitroLauncher.plugin;     } }   Any help would be greatly appreciated!  Thanks

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


I want to find the number of elements in $GL_2(\mathbb Z_p)$, where $p$ is a prime.   The first row can be chosen in $p^2-1$ ways as we can not take both zeros. The second row must be chosen in such a way that it is not a linear combination of the first. Total number of rows those are linear combinations of the first row is $p$. Thus total possibilities for the second row is $p^2-p$. Thus $|GL_2(\mathbb Z_p)|=(p^2-1)(p^2-p)$. Am I right?

$F$ is a finite field of order $q$. What is the size of $\operatorname{GL}_n(F)$ ?  I am reading Dummit and Foote "Abstract Algebra".  The following formula is given:  $(q^n - 1)(q^n - q)\cdots(q^n - q^{n-1})$.  The case for $n = 1$ is trivial.  I understand that for $n = 2$  the first row of the matrix can be any ordered pair of field elements except for $0,0$. and the second row can be any ordered pair of field elements that is not a multiple of the first row.  So for $n = 2$  there are $(q^n - 1)(q^n - q)$ invertible matrices.  For $n\geq 3$, I cannot seem to understand why  the formula works.  I have looked at Sloane's OEIS A002884.  I have also constructed and stared at a list of all $168$ $3\times 3$ invertible matrices over $GF(2)$.  I would most appreciate a concrete and detailed explanation of how say $(2^3 - 1)(2^3 - 2)(2^3 - 2^2)$ counts these $168$ matrices.


I want to fit my table into a two-column page and I am using a table* package. This is my code:   \centering   \begin{tabular}{@{}lllll@{}} (table information) \end{tabular}   \label{tab:1} \end{table*}  However, the sentence is too long, so the sentence exceeds the page margin. Would really appreciate if someone could help!

I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


How do I tell QGIS that my labels should not cover features in layer 1 and layer 2, while it is OK to cover layers 3 and 4?  qgis version 2.18.7

With QGIS 2.12.2, how can I set up layer labeling to avoid placing labels where features from another layer already exist?  For example, if I have a stream/river polyline layer that contains lake "centerlines", and I place a "lake" polygon layer above it in the drawing order, I don't want the river layer to place a label inside the lake.  Instead, I would rather have the river labeled outside of the lake (as needed).  That way, I can place labels from the lakes layer and I don't run into label collisions.  Here is an example, where (I have intentionally put the lines on top for visual purposes) what I am hoping to achieve is no river center-line labels shown inside the lake polygon:


So I just installed something via a .deb file and I see no reason why I should have to close all of my apps and log out to get it to show up in the HUD. Is there a command that tells the HUD to check for new programs?

I've been using Synapse for a while now. The  regrading the lacking ability to remember recurrent launches was fixed.  I've been launching the same documents I am working on at the moment for the past months and there was no issue. But today, for some mysterious reason, Synapse doesn't remember any of these, nor can it find them in its search. I had to browse and launch them myself! (How medieval is that! :) )  So, did something happen? Can I find out what and why? And most importantly: can it be fixed?  NB: problem also posted .


I am using this script:  #!/bin/bash   case "$1" in    start)     echo "Iniciando servicio"        export http_proxy=socks5://192.168.1.2:9090     export https_proxy     <----I don't want it exported        ;;   stop)     echo "Deteniendo servicio"      ;;   *)    echo "Usage: $0 {start|stop}"     exit 1     ;; esac   but when executing it and by env I don't get the variable that I created :(  root@:~# /etc/init.d/a start Iniciando servicio root@:~# env SHELL=/bin/bash NO_AT_BRIDGE=1 PWD=/root LOGNAME=root LS_OPTIONS=--color=auto HOME=/root TERM=xterm USER=root SHLVL=1 SSH_CLIENT= PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAIL=/var/mail/root SSH_TTY=/dev/pts/0 TEXTDOMAIN=Linux-PAM _=/usr/bin/env   I tried running the script with source but it doesn't work because I want to export a single variable not all

I have multiple Amazon EC2 accounts and want to quickly be able to switch variables, such as $EC2_HOME, using a script.  I have have a shell script set up like this:  #!/bin/sh export EC2_HOME=/home/me/.ec2 echo $EC2_HOME   When I run the script I know that EC2_HOME is set, but I thought that using export would make the variable stick around after the script completed. It does not, as running echo $EC_HOME does not show anything.  I know this must be very rudimentary Linux scripting knowledge, but I don't know it. I tried looking for related questions without luck - so my apologies if this is a duplicate.


I recently reinstalled Minecraft and launched the game in the latest version(1.16.3). Everything works fine on that end but when I decided to play an older version of the game I noticed how all the previous versions of Minecraft don't show up. All I see is the current version when creating a new installation. I remember before how the launcher would load all the released versions from 1.0 to current so I don't understand why it's not there anymore. I've looked online and haven't seen a solution yet. I want to play on servers that don't support 1.16.3 yet.

So this if the first time this has ever happened too me and I was wondering what it is. I just downloaded Minecraft and there is no area where i can change my version too 1.8.9/1.7.10 all i see when I do it is blank  Im just Wondering on how come even tho i hit the Repair button on the minecraft.msi download it dosnt fix it... If there is a way too fix this let me know cause my friend wants too play and I cant cause of this..


How can I load GeoDataFrame (populated from shapefile) to PostGIS when GEOM column contains MULTILINESTRING and LINESTRING e.g.:  LINESTRING (14.2384666 46.6304714, 14.2386703 46.6304123)  MULTILINESTRING ((13.90433020000000042 46.61830880000000121, 13.90393929999999934 46.61873270000000247, 13.90390771785250124 46.61876445408692859),(13.90327032848085764 46.61940531353186401, 13.90327032848085587 46.61940531353186401))   I have tried with "to_sql" but I need to specify GEOM type and when I chose   'geom':Geometry('MULTILINESTRING', srid=4326)}   I got an error: ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'LineString'

Shapefiles can mix simple POLYGONs and MULTIPOLYGONs in the same data source. Spatial databases like PostGIS and SpatiaLite are strict, and will not put a POLYGON in a MULTIPOLYGON geometry column.  I've gotten used to using  to fix this issue. But now I am trying to use GeoPandas to do some file processing, including converting from shapefile to GeoPackage (with a bunch of stuff in the middle), and I am running into this error:  gdf.to_file("garbage.gpkg", "GPKG")   ValueError: Record's geometry type does not match collection schema's     geometry type: 'MultiPolygon' != 'Polygon'   Is there a GeoPandas equivalent to ST_Multi that I can use to fix the geometry before saving to the GeoPackage or SpatiaLite format?


I'd like to understand something in this code:  Save   Where does the return onclick="return false;" go to?

Many times I've seen links like these in HTML pages:  Click here !   What's the effect of the return false in there?  Also, I don't usually see that in buttons.  Is this specified anywhere? In some spec in w3.org?


Prove: $$\frac{\tan A+\sec A-1}{\tan A-\sec A+1}=\frac{1+\sin A}{\cos A}$$  My attempt:  LHS= $$\frac{\tan A+\sec A-1}{\tan A-\sec A+1}$$ $$=\frac{\frac{\sin A}{\cos A}+\frac{1}{\cos A}-1}{\frac{\sin A}{\cos A}-\frac{1}{\cos A}+1}$$ $$=\frac{\sin A+1-\cos A}{\sin A-1+\cos A}$$ $$\text{Using componendo and dividendo}$$ $$\frac{\sin A+1-\cos A+\sin A-1+\cos A}{\sin A+1-\cos A-\sin A+1-\cos A}$$ $$\frac{2\sin A}{2-2\cos A}=\frac{\sin A}{1-\cos A}=\frac{\sin A(1+\cos A)}{(1-\cos A)(1+\cos A)}$$ $$\frac{\sin A(1+\cos A)}{\sin^2 A}=\frac{1+\cos A}{\sin A}$$ $$\text{Which is not equal to right hand side!}$$  Have I done something wrong in the componendo dividendo step? I dont know how to use componendo dividendo rule . I saw it being used like this in some question and hence applied it here the same way. Maybe I am wrong in application of that rule. Please tell me the right way to use it. Thank you.

We need to prove that $$\dfrac{\sin\theta - \cos\theta + 1}{\sin\theta + \cos\theta - 1} = \frac 1{\sec\theta - \tan\theta}$$  I have tried and it gets confusing.


Here on Stack Exchange we often see answers on  questions, that use tools other than the bash language, such as awk, sed, grep, etc.   These tools are specific in POSIX, so they should be available on most systems, but I was wondering if any systems exist where bash is available but not awk. Or does the availability of bash imply by necessity all POSIX tools?  Please consider all possible platforms, such as embedded systems, stripped down installations for working with old hardware, MS windows emulators, etc.

Are there versions of Unix that don't have awk installed by default?   I am fine with an answer containing some really old outdated Unix variant which predates awk's creation; but would ideally prefer some specialist niche stripped down embedded modern one which excludes awk by design from core install.  (the impetus for asking: someone claimed that an SO answer using nothing but standard unix command line tools sans awk is useless, since every Unix has awk. I am pretty sure that last part is wrong, but don't recall any specific examples, just the fact that they exist).


Heisenberg’s uncertainty principle is very commonly used to justify why we can’t get to$\ 0$ Kelvin by saying it is impossible to make particles stand still because they will either have an undetermined position or an undetermined momentum.  However, in solid state physics, it is common refering to a system where all the particles are in the lowest possible energy levels (in the ground state) as being at$\ 0$ Kelvin.  If we have a system composed of a set of harmonic oscilators, all of them in the ground state, than the “system at ground state” picture would tell us the system is at$\ 0$ Kelvin. On the other hand, if we considered the “uncertainty implies no$\ 0$ K" picture, the zero point motion of the oscilators would be used to argue that the system is not at$\ 0$ Kelvin.  How would this tension be solved? In this situation, how would we undoubtedly state whether the set of harmonic oscilators in the ground state is at$\ 0$ K or not?

I got to read Volume I of Feynmann's lectures. It said that at absolute zero, molecular motion doesn't cease at all, because if that happens, we will be able to make precise determination of position and momentum of the atom. We do know that Heisenberg uncertainty principle holds for microscopic particles in motion. But what then is wrong to consider that all molecular motion ceases at absolute zero? In other words, does the uncertainty principle not hold when there is no motion?  Need some help!


This is an exercise I'm trying to solve. My attempt $$c=2^{\aleph_0}\leq\aleph_0^{\aleph_0}\leq (2^{\aleph_0})^{\aleph_0}= 2^{\aleph_0\cdot\aleph_0}=2^{\aleph_0}=c$$ So all values in the inequality are equal and $c= \aleph_0^{\aleph_0}$ But I don't know how to prove $n^{\aleph_0}=c$ I would like a similar approach to the one I made (if it's valid :/ ) Thank you!

Hello I am studying cardinal arithmetic, and found out that: $$\mathfrak{c}^{\aleph_0} = (2^{\aleph_0})^{\aleph_0} = 2^{\aleph_0 \aleph_0} = 2^{\aleph_0} = \mathfrak{c} $$  However I found this equivalence in :  $$\mathfrak{c}^{\aleph_0} = \aleph_0^{\aleph_0} = n^{\aleph_0} = \mathfrak{c}^{n} = \aleph_0 \mathfrak{c} = n\mathfrak{c} = \mathfrak{c}$$  where $n$ is any finite cardinal $\geq 2$.  I do not know how they got each line of those equivalences. Could somebody help, please?  Thanks


Months ago, I asked  I think it's fairly easy to adapt the arguments given in the answers to that one to prove that $x - 1$ always reaches $1$ as well.  It's also well known that $3x - 1$, $5x - 1$ and $5x + 1$ all have readily found cycles that don't include $1$. I think I also found cycles for $7x + 1$ but I seem to have misplaced the relevant notebook.  My question today is: which other variants of $3x + 1$ have been studied and proven to always or not always reach $1$? And is there a paper or a book that gathers a lot of the available research on the variants?

Generalize the $3x + 1$ problem as $cx \pm 1$, where $c$ is a positive odd integer and $x$ is a positive integer iterated through the function as far as possible to discover a cycle. If $x$ is even, then you halve it. But if $x$ is odd, you do either $cx + 1$ or $cx - 1$ as the case may be. (If you prefer, $c$ may be negative and you disallow $cx - 1$ for the odd branch; then $|-3x + 1|$ and $3x - 1$ are kind of the same).  With $3x - 1$ and $5x + 1$ it is somewhat well-known that many $x$ don't lead to 1, while with $3x + 1$ the question is unresolved despite intense scrutiny by many professionals and amateurs. For which other $cx \pm 1$ is the question of ultimate arrival at 1 still undetermined despite study by more than a few people? I would appreciate journal articles that look at several different $cx \pm 1$.


I'm a bit of a novice Linux user and I'm trying to prepare a CentOS VM through Azure.  I have it built and can operate on it through the serial console on the Azure portal.  I've installed GNOME and now I'm trying to install xrdp so I can access it through RDP.  The instructions I found said a requirement first was to first install the EPEL repo which I did this way:  rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm  That completed with no issue.  But when I tried to actually install xrdp this way:  yum -y install xrdp tigervnc-server  I get errors that look like this:  Error: Package: 1:xrdp-selinux-0.9.11-1.el7.x86_64 (epel)            Requires: selinux-policy >= 3.13.1-252.el7.1            Installed: selinux-policy-3.13.1-229.el7_6.15.noarch (@updates)                selinux-policy = 3.13.1-229.el7_6.15            Available: selinux-policy-3.13.1-229.el7.noarch (base)                selinux-policy = 3.13.1-229.el7            Available: selinux-policy-3.13.1-229.el7_6.5.noarch (updates)                selinux-policy = 3.13.1-229.el7_6.5            Available: selinux-policy-3.13.1-229.el7_6.6.noarch (updates)                selinux-policy = 3.13.1-229.el7_6.6            Available: selinux-policy-3.13.1-229.el7_6.9.noarch (updates)                selinux-policy = 3.13.1-229.el7_6.9            Available: selinux-policy-3.13.1-229.el7_6.12.noarch (updates)                selinux-policy = 3.13.1-229.el7_6.12 Error: Package: xorgxrdp-0.2.11-1.el7.x86_64 (epel)            Requires: xorg-x11-server-Xorg(x86-64) = 1.20.4            Installed: xorg-x11-server-Xorg-1.20.1-5.6.el7_6.x86_64 (@updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.6.el7_6            Available: xorg-x11-server-Xorg-1.20.1-3.el7.x86_64 (base)                xorg-x11-server-Xorg(x86-64) = 1.20.1-3.el7            Available: xorg-x11-server-Xorg-1.20.1-5.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.el7            Available: xorg-x11-server-Xorg-1.20.1-5.1.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.1.el7            Available: xorg-x11-server-Xorg-1.20.1-5.2.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.2.el7_6            Available: xorg-x11-server-Xorg-1.20.1-5.3.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.3.el7_6  You could try using --skip-broken to work around the problem  You could try running: rpm -Va --nofiles --nodigest  So I research that and someone said I could resolve these dependencies by installing the following:  rpm -Uvh http://scientificlinux.mirror.ac.za/7.6/x86_64/updates/security/selinux-policy-3.13.1-252.el7.1.noarch.rpm  But when I do that I get another dependency error that looks like this:  error: Failed dependencies:         selinux-policy = 3.13.1-229.el7_6.15 is needed by (installed) selinux-policy-targeted-3.13.1-229.el7_6.15.noarch  But that seems really odd because isn't the version of selinux-policy that error is saying I need the version I have installed according to my xrdp error?  Anyway, that was the brick wall on my journey.  I'm not sure what to do next.  And if I can't get xrdp installed is there another way to access the GNOME desktop of my machine?  I am a novice at both Linux and Azure and I didn't see a console option besides the serial console on the Azure portal.  Thanks.

I'm trying to install XRDP and I'm hitting the following:  [root@box ~]# yum -y install xrdp Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile  * base: centos.serverspace.co.uk  * epel: mirrors.coreix.net  * extras: mirror.sov.uk.goscomb.net  * updates: mirror.sov.uk.goscomb.net Resolving Dependencies --> Running transaction check ---> Package xrdp.x86_64 1:0.9.10-1.el7 will be installed --> Processing Dependency: xrdp-selinux = 1:0.9.10-1.el7 for package: 1:xrdp-0.9.10-1.el7.x86_64 --> Processing Dependency: xorgxrdp for package: 1:xrdp-0.9.10-1.el7.x86_64 --> Running transaction check ---> Package xorgxrdp.x86_64 0:0.2.10-4.el7 will be installed --> Processing Dependency: xorg-x11-server-Xorg(x86-64) = 1.20.4 for package: xorgxrdp-0.2.10-4.el7.x86_64 ---> Package xrdp-selinux.x86_64 1:0.9.10-1.el7 will be installed --> Finished Dependency Resolution Error: Package: xorgxrdp-0.2.10-4.el7.x86_64 (epel)            Requires: xorg-x11-server-Xorg(x86-64) = 1.20.4            Installed: xorg-x11-server-Xorg-1.20.1-5.6.el7_6.x86_64 (@updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.6.el7_6            Available: xorg-x11-server-Xorg-1.20.1-3.el7.x86_64 (base)                xorg-x11-server-Xorg(x86-64) = 1.20.1-3.el7            Available: xorg-x11-server-Xorg-1.20.1-5.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.el7            Available: xorg-x11-server-Xorg-1.20.1-5.1.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.1.el7            Available: xorg-x11-server-Xorg-1.20.1-5.2.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.2.el7_6            Available: xorg-x11-server-Xorg-1.20.1-5.3.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.3.el7_6  You could try using --skip-broken to work around the problem  You could try running: rpm -Va --nofiles --nodigest   Now, I get that it's missing a dependency, however, it appears to be saying it requires xorg-x11-server-Xorg version 1.20.4.   It then continues to say version 1.20.1-5.6.el7_6 is installed.  From where I'm sitting, 4 is in the range 1-5 so I'm unclear what the issue is. They all seem to be for the right architecture.  Is 1-5 a version string in and of itself as opposed to a range, or -if not- what am I missing?  Solution: Thanks to , here's a workaround:     Having the same issue, I installed manually archived xorgxrdp   yum -y install https://archive.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/x/xorgxrdp-0.2.9-1.el7.x86_64.rpm   then   yum -y install xrdp and it works


How to Tag pane text has a lower z-index than footer text, results in really hard to read information when the pane overlaps the footer.  Edit Since this question has been incorrectly marked as duplicate, I will explain the difference. The older question merely points out that the sidebar covers the footer, however my question points out that there's an error with the z-index of the sidebar which makes the sidebar hard to read.    Steps:   start creating a new question focus on the Tags field scroll down the page until the How to Tag pane overlaps the footer observe that the sidebar text and footer text are visible on the same plane rendering the sidebar text illegible   Suggestion:    Give the element #content #sidebar #scroller a z-index of 1

I have noticed that while asking questions and scrolling to the bottom of the page, the right sidebar containing recent questions covers the footer partially. Also, a part of it goes beyond the browser's boundary. It may not be a big problem but it still doesn't look good.    This also happens on the  page


What i want to know is that if the properties of the quantumn nature reduses if the particles combine? Or were we missing any fundamental relation to particle or boby made up of particles?

Many introductory quantum mechanics textbooks include simple exercises on computing the de Broglie wavelength of macroscopic objects, often contrasting the results with that of a proton, etc.  For instance, this example, taken from a textbook:     Calculate the de Broglie wavelength for      (a) a proton of kinetic energy 70 MeV      (b) a 100 g bullet moving at 900 m/s   The pedagogical motivation behind these questions is obvious: when the de Broglie wavelength is small compared to the size of an object, the wave behaviour of the object is undetectable.  But what is the validity of the actual approach of applying the formula naively? Of course, a 100g bullet is not a fundamental object of 100g but a lattice of some $10^{23}$ atoms bound by the electromagnetic force. But is the naive answer close to the actual one (i.e. within an order of magnitude or two)? How does one even calculate the de Broglie wavelength for a many body system accurately?


NOTE: I am looking for a probabilistic solution only. For a non-probabilistic solution, see .     Show that if the edges of $K_6$ are coloured using two colours, then it contains two monochromatic triangles.   We first define the random variable $X$. Given any colouring of $K_6$, $$X=\text{number of monochromatic triangles for that colouring}$$  Now, we number the vertices of the  graph with numbers from $1$ through $6$. We define $$X_{i,j,k} = \begin{cases}   1, & \text{if i, j, k form a monochromatic triangle}  \\   0, & \text{otherwise}. \end{cases}$$  It is easy to see that $X=\sum X_{i,j,k}$. Now, by linearity of expectation, $$\mathbb E[X]=\sum \mathbb E[X_{i,j,k}]$$  Since there are $\binom63=20$ triangles, the sum on the right side has exactly $20$ terms. By symmetry, we can say that $\mathbb E[X_{i,j,k}]=\mathbb E[X_{a,b,c}]$. Hence, $$\mathbb E[X]=20 \mathbb E[X_{1,2,3}]$$  Now note that the triangle formed using $1,2,3$ can form $2$ monochromatic triangles (one of them blue, the other red), and the remaining $15-3=12$ edges can be coloured in $2^{12}$ ways. Hence there are $2^{13}$ edge-colourings where $1,2,3$ form a monochromatic triangle. The total number of edge-colourings is $2^{15}$, and so $\mathbb E[X_{1,2,3}]=\dfrac{2^{13}}{2^{15}}=\dfrac14$. Thus $$\mathbb E[X]=20 \mathbb E[X_{1,2,3}]=20\cdot \dfrac14=5$$  But this is clearly incorrect. There can't always be $5$ monochromatic triangles. So what am I doing wrong?  Thanks in advance.

Let $K_n$ be a complete $n$ graph with a color set $c$ with $c=\{\text{Red}, \text{Blue}\}$. Every edge of the complete $n$ graph is colored either $\text{Red}$ or $\text{Blue}$. Since $R(3, 3)=6$, the $K_6$ graph must contain at least one monochromatic $K_3$ graph. How can I prove that this graph must contain another (different) monochromatic $K_3$ graph. I saw proofs which uses the fact that there are at most $18$ non-monochromatic $K_3$ graphs. Since there are $20$ $K_3$ graphs (how can you calculate this) there are at least 2 monochromatic $K_3$ graphs. Are there other proofs?


Can anyone provide citations for the following formula:  x=(a-b)((x-min(x))/(max(x)-min(x))+a  I have tried this formula and I got good results

I have constructed a social capital index using PCA technique. This index comprises values both positive and negative. I want to transform / convert this index to 0-100 scale to make it easy to interpret. Please suggest me an easiest way to do so.


The Switch has a screenshot button and lets me take lots of awesome screenshots. But there doesn't seem to be any way to move them off of the device, other than posting them to Twitter/Facebook.   Is there any way to do this? Ideally without using a flash card? (As that would involve also acquiring a reader for said card for my computer... it's 2017, let me email them!)

I have an SD card on my console and have it set to store screenshots on the card.  But it doesn't seem like there's a way to view or otherwise extract those screenshots without having to pull out the SD card and use a reader to access them.  But this is not a desirable option since the Switch has to be turned off before removing the card.  Connecting the Switch to a (Windows) computer doesn't work, it's recognized as a USB device but nothing else.  I can't imagine how it would work if I didn't have an SD card.  How else are we expected to access these screenshots?


I got the following error after configuring proxy in /etc/apt/apt.conf as Acquire::http::proxy http://192.168.96.0:8080:  e: syntax error /etc/apt/apt.conf:2: extra junk at end of file.   and I don't have the proxy authentication. How do I fix this?

I'm trying to configure some proxies for a guest virtual machine and now I'm getting:  sudo apt-get update E: Syntax error /etc/apt/apt.conf.d/95proxy:4: Extra junk at end of file   The content of the file is:  cat /etc/apt/apt.conf.d/95proxy   Acquire::http::proxy  "http://10.0.0.60:3128/" Acquire::ftp::proxy "http://10.0.0.60:3128/" Acquire::https::proxy "http://10.0.0.60:3128/"


Can not connect to  HP\SQLEXPRESS  a network related or instance specific error while spablishing a connection to sql server. The server was not found or was not accessible. Verify that instance name is correct .and the sqlserver is allow to access the remote connection. error 26  Note: We are getting this error while connecting to local database on our pc. while connecting to online database its not generating this error

Recently I have developed software using SQL Server 2012. Now when I try to connect, I get this error message:     Cannot connect to AAFI\SQLEXPRESSA network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)


I need help solving this task so if anyone had a similar problem it would help me. $\sum\limits_{k=m}^{n}{n \choose k}{k \choose m}={n \choose m}2^{n-m}$ I tried this: $\sum\limits_{k=m}^{n}\frac{n!k!}{k!(n-k)!m!(k-m)!}={n \choose m}2^{n-m}\\\sum\limits_{k=m}^{n}\frac{n!}{(n-k)!m!(k-m)!}={n \choose m}2^{n-m}\\\frac{n!}{m!}\sum\limits_{k=m}^{n}\frac{1}{(n-k)!(k-m)!}={n \choose m}2^{n-m}$ Shift $z=k-m\rightarrow k=z+m$ $\frac{n!}{m!}\sum\limits_{z=0}^{n-m}\frac{1}{(n-(z+m))!(z+m-m)!}={n \choose m}2^{n-m}\\\frac{n!}{m!}\sum\limits_{z=0}^{n-m}\frac{1}{(n-z-m)!z!}={n \choose m}2^{n-m}$ And now with this part I don’t know what to do next. I tried something this way. $\frac{1}{(n-m)!}+\frac{1}{(n-1-m)!}+...+\frac{1}{n-m}!={n \choose m}2^{n-m}$ But now I don’t know how to calculate the expression on the left side. Thanks in advance !

Prove that for $n,m\geq0$, that     $\sum\limits_{k=m}^{n}{{k}\choose{m}}{{n}\choose{k}}=2^{n-m}{{n}\choose{m}}$.     I wrote $2^{n-m}$ as $\sum\limits_{k=0}^{n-m}{{n-m}\choose{k}}$ using the binomial theorem. Then I drew a Venn-diagram with a set $A$ which has $k$ elements, and a set $B$ which is a subset of $A$ with $m$ elements. from which I think you can interpret the left side of the equality in the question as the number of ways in which you can first choose $k$ elements from the sample space (with n elements) and then choose $m$ elements from $A$. However, I am not entirely sure how to interpret the right side of the inequality then. Could anyone please comment on my approach and tell me what I should do next if it's correct and otherwise tell me how else it should be done?  Furthermore, could anyone please tell me how I should interpret the summation in terms of combinatorics? Because I do not really see what the summation does in terms of sets/how I should visualize this in a diagram or how I should just see this in general. Thank you in advance.


I have an Excel file that I need to import into a (new) Oracle table.  What is the best way to do this?

I am looking for a free tool to load Excel data sheet into an Oracle database. I tried the Oracle SQL developer, but it keeps throwing a NullPointerException. Any ideas?


I know that intensity determines the no. of electrons and the current produced. But if the intensity is constant and the frequency changes, the kinetic energy of the photoelectrons changes, so their velocity changes. So if the frequency increases, the kinetic energy of the photons increases so they move faster. In that case, the number of photoelectrons moving through a space in unit time increases because their velocity is more so the electrons are traveling faster. That is my reasoning behind this. But why does frequency not affect the current?

We all know that the amount of current flowing b/w the plates is independent of the frequency. If I were to ask why doesn't it depend then you'd probably say that it depends on the number of electrons rather than the frequency or you might show me a current vs frequency graph.  But here is my theoretical argument. Electric current is defined as the amount of charge flowing through a point/space/wire per unit time. Let I be current due to photo electrons ejected by photons of some frequency. Now if I would increase the frequency, the kinetic energy of the ejected electron would increases, therefore it will move faster and therefore contribute more current (charge will through the same point many times per unit time) . Thereby, giving a net current greater than I.  What is wrong with my argument?  After thinking a lot, I came up with a possible reason. However fast the electrons may move, but when they hit the metal plate, they would lose their velocity and start moving in drift velocity. Now there is a problem with this argument. If this were to be true then I should expect to see a big chunk of extra electrons getting stuck at the anode.  If my reasoning was correct, then why can't I see a big charge buildup at the anode.


In the "Show Applications" tab in Ubuntu it is possible to group icons together using the create a folder and then add to folder option in the Ubuntu Software (which is described in detail )  However, since I often reinstall my system, I was wondering if it were possible to do this using terminal, or by editing menu's configuration file hidden in depths of the system folders? This would automate the whole thing and save me a lot of time by not doing it manually.

Dose anyone know how to make application folders like the 'utilities' folder? It's because I have a lot of apps and want to group them by topic.


I know from the ratio test that the series converges and I used wolfram alpha to determine that the answer is 1, but what are the steps involved to reach this answer?

How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method.  In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$


Using the combination \MakeTextLowercase and \cftchapterfont in the memoir class with the hyperref package causes strange issues when attempting to make the table of contents’ chapter titles minuscule.  \documentclass{memoir} \usepackage{hyperref} \renewcommand*{\cftchapterfont}{\MakeTextLowercase} \begin{document} \tableofcontents \chapter{This Is a Chapter} \end{document}     The first errors are like this, and then follows a load of missing/extra {/} and control sequences.  ! Undefined control sequence. \find@pdflink ...ode \protected@edef \Hy@testname                                                   {#2}\ifx \Hy@testname \@em... l.1 ...entsline {chapter}{Contents}{1}{section*.1}   I think some packages/fonts have an option to always use minuscule small caps, but I want to use garamondx and from my reading of the garamondx manual, I have yet to find a way. How can I make hyperref behave?

When using memoir and hyperref I can't make chapters lowercase in the TOC or I get all sorts of errors.  Here's a MWE:  \documentclass{memoir} \usepackage{lmodern}  % \renewcommand{\cftchapterfont}{\scshape}              % WORKS \renewcommand{\cftchapterfont}{\scshape\MakeLowercase}  % DOESN'T WORK  \usepackage{hyperref} % Without hyperref it's all good  \begin{document}   \tableofcontents*   \chapter{One}   \clearpage   \chapter{Two} \end{document}   Any ideas what's going on and how to fix it?


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

john@ubuntu01:~$ sudo ls -l /var/opt/gitlab/git-data/repositories/GL/www.git total 25068 drwxr-xr-x  2 git  git      4096 aug 14 19:58 branches -rw-r--r--  1 git  git        66 aug 14 19:58 config drwxrwxrwx  2 root root     4096 aug 15 14:56 custom_hooks -rw-r--r--  1 git  git        73 aug 14 19:58 description -rw-r--r--  1 git  git        23 aug 14 19:58 HEAD lrwxrwxrwx  1 git  git        47 aug 14 19:58 hooks -> /opt/gitlab/embedded/service/gitlab-shell/hooks drwxr-xr-x  2 git  git      4096 aug 14 19:58 hooks.old.1471193907 -rw-r--r--  1 git  git      1329 aug 15 14:48 index drwxr-xr-x  2 git  git      4096 aug 15 13:58 info drwxr-xr-x 71 git  git      4096 aug 15 14:55 objects -rw-r--r--  1 git  git        98 aug 15 13:58 packed-refs -rw-r--r--  1 git  git  25618530 aug 15 14:03 post-receive.log drwxr-xr-x  5 git  git      4096 aug 14 20:31 refs john@ubuntu01:~$ ls -l /var/opt/gitlab/git-data/repositories/GL/www.git ls: cannot access '/var/opt/gitlab/git-data/repositories/GL/www.git': Permission denied   Here are ACLs  john@ubuntu01:~$ sudo lsattr /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks -------------e-- /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks/post-receive   I have never seen this before. No permission to LS even with 777? I need to share this folder for more convenient development. How can I solve it? Thank you.  EDITED: (here are your requests)  john@ubuntu01:~$ sudo ls -ld /var/opt/gitlab/git-data/repositories/GL/www.git drwxrwxrwx 8 git git 4096 aug 15 14:48 /var/opt/gitlab/git-data/repositories/GL/www.git john@ubuntu01:~$ sudo ls -ld /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks drwxrwxrwx 2 root root 4096 aug 15 14:56 /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks   EDITED MORE  sudo ls -ld /var/opt/gitlab/git-data/repositories/GL/www.git ls: cannot access '/var/opt/gitlab/git-data/repositories/GL/www.git': No such file or directory   hmmm... what is this?


I am just wondering that where we can translate the Format setting labels which is configured in Manage display of content type. I checked in configuration translation, user interface translation but i didn't find the label which i am searching for.Can anyone help me in this regard. please find below screenshot for reference:

I've created a custom field formatter widget for numeric fields. The formatter has A LOT of settings to customize the visual output of that number, to whatever designers/marketing wants (adding a lot of HTML markup, with[out] leading/trailing zeros, zeros as dash, one or two fractions, rounding, prefixes/infixes/suffixes,... ).  Some of those settings are language-dependant though, so I'd like to enter different formatter settings in  /en/admin/structure/types/manage/MY_CONTENT_TYPE/display /de/admin/structure/types/manage/MY_CONTENT_TYPE/display /fr/admin/structure/types/manage/MY_CONTENT_TYPE/display  I've noticed that there is a $langcode parameter in   but I don't know how to make  language-aware.  Is it possible at all to have language-specific settings in a field formatter? If yes, how to I store and retrieve those settings in the correct language?


I have a function mentioned below in python:  >>> students=[]  >>> def add_student(name): ...     students.append(name)   How can i get actual text of add_student?

Suppose I have a Python function as defined below:  def foo(arg1,arg2):     #do something with args     a = arg1 + arg2     return a   I can get the name of the function using foo.func_name. How can I programmatically get its source code, as I typed above?


I have a file with size of 32 MB, I have downloaded it from DocuShare server to DocuShare temp folder. I am trying to read the file content from it to create a file. I get error when I URL encode my base64 content. I am not getting any exception when I run the same code a simple java application. But when I use the same code in DocuShare service to get document content I get Exception. HTTP Status 500 - org.glassfish.jersey.server.ContainerException: java.lang.OutOfMemoryError: Java heap space  org.glassfish.jersey.server.ContainerException: java.lang.OutOfMemoryError: Java heap space  File file = new File(filePath); FileInputStream fileInputStreamReader = new FileInputStream(file); byte[] bytes = new byte[(int)file.length()]; fileInputStreamReader.read(bytes); String encodedBase64 = String encodedBase64 = java.util.Base64.getEncoder().encodeToString(bytes); String urlEncoded = URLEncoder.encode(encodedBase64);   How to fix this error?  Do I need to increase my tomcat heap size?

I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After a quick research I found  and others saying on Windows machine the JVM defaults max heap size as 64MB.  Given this situation, how should I deal with this constraint?  I could increase the max heap size using command line option to java, but that would require figuring out available RAM and writing some launching program or script. Besides, increasing to some finite max does not ultimately get rid of the issue.  I could rewrite some of my code to persist objects to file system frequently (using database is the same thing) to free up the memory. It could work, but it's probably a lot work too.  If you could point me to details of above ideas or some alternatives like automatic virtual memory, extending heap size dynamically, that will be great.


If someone or some group of people are abusing the @user handles and asking trolling questions. Is there some way to mute the person and prevent notification from the specific user's usage of @ handle to notify me?

Stack Overflow has successfully borrowed at least one XBox feature (Achievements).  I'd like to see another feature borrowed as well. Let's say I'm playing Halo online and another player is being a bigot.  I have the option to add him to a list of ignored users.  After doing that, all the racist things he says will never be heard through my headphones anymore. Now, on Stack Overflow, I'd like the ability to add a user to a list of ignored users.  This would hide all of that user's comments, and maybe his questions and answers as well (not sure if hiding questions/answers is necessary). This serves multiple purposes:  It would make it easy for users to avoid other users' flamebait. It would give users a more appropriate response to flamebait. The ability to start flame wars would be reduced, since fewer users would see those comments. Users would now have an incentive to be more diplomatic, as there is now a negative consequence to the behavior (the silent treatment). Administrators could review which users are the most often ignored, which would be a strong indication that someone should be  or even locked out of their account. Administrators wouldn't have to spend as much time dealing with complaints about abusive users, since users would have a better way to respond.    makes a good point in a comment to an answer, that I thought should get more visibility:  I had a problem, reported it and got the response "not bad enough to do anything about, sorry". Which is kind of true, because the only options available to the mods are the nuclear one (penalty box) and the zero-effect one (do nothing). We need a middle ground option where abuse can be handled for you without also being handled for everyone.


Just see this screenshot. Why does it return TRUE instead of False? What is going wrong here?    Sanity check:

There are a  on this topic, but no simple and definitive answers.    Can someone please tell me how to permanently disable cell rounding on the .csv file which is created by script?  Basically, '377635637222436751' is being converted to '377635637222437000' automatically and that isn't really acceptable for my needs.  I've tried this: Tools->Options->Calc->Calculate "Precision as shown"   and this: Format > Cells > Numbers > Category > (scroll down for) Text. (but considering my script creates the .csv -- this option isn't very good since it must be done after the file is created)  And neither is working.  The number stays rounded -- even after formatting the column after the file is created.  Does anyone have any suggestions?


Help Please help me I bought this phone from a friend and I factory reset it and this is what shows up

I won a Samsung Galaxy S6 Edge, signed into it with my Google account, played around with it, wiped it, and sold it.  Now the person can't get past setup because it's saying he must login with an account previously synced to the phone.   Is there anything I can do from my side to remove this lock?


I am trying to implement an inheritance chain whereby methods declared on the base type return the derived type by value.  For example, I have a base class Base with a method func().  On a derived class Derived, I want func() to return an instance of Derived by value.  To do this, I am trying to use : the base class takes the derived class via a template parameter, and then makes the method return the template type.  Here is my header file:  #pragma once  template<typename Derived> class Base {   public:     Derived func() const; };  class DerivedA : public Base<DerivedA> {   public:     DerivedA() : Base() {}     DerivedA(const Base<DerivedA>& other) : Base(other) {} };   So far so good.  I define the function in a cpp file:  #include <iostream>  template<typename Derived> Derived Base<Derived>::func() const {     std::cout << "Calling func" << std::endl;     return Derived(*this); }   And then I call it in a main function:  #include "demo.h"  int main() {     DerivedA a;     a.func();     return 0; }   Unfortunately, compiling this code results in the following linker error.  main.cpp.o: In function `main': main.cpp:6: undefined reference to `Base<DerivedA>::func() const' collect2: error: ld returned 1 exit status   Here is my CMakeLists.txt:  cmake_minimum_required(VERSION 3.7) project(demo)  set(CMAKE_CXX_STANDARD 11)  set(SOURCE_FILES main.cpp demo.cpp demo.h) add_executable(demo ${SOURCE_FILES})   Oddly, if I move the definition into the header file, the code compiles without the linker error.  How do I properly define the function (ideally in a cpp file) and make the linker error go away?

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


I got wrong result when using SimpleDateFormat.parse(). Code here:  public static void main(String[] args) throws ParseException {         String format = "yyyyMMdd";         String date = "19890416";         SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);         java.util.Date date2 = simpleDateFormat.parse(date);         System.out.println("date2 = " + date2);         System.out.println("Locale.getDefault() = " + Locale.getDefault()); }   result:  date2 = Sun Apr 16 01:00:00 CDT 1989 Locale.getDefault() = zh_CN   there is my question: why in the result it shows up 01:00:00, instead of 00:00:00?  What should I do if I want 00:00:00?  Anyone can help? Thanks!  Update: I want to know, when define format as "yyyyMMdd", why the default hour shows up "01", thanks.

When I create a new Date object, it is initialized to the current time but in the local timezone. How can I get the current date and time in GMT?


Judging from the below quote was Snape already a double agent when he found out about the meaning of the prophecy?     'Well, Severus? What message does Lord Voldemort have for me?       'No - No message - I'm here on my own account! ... 'I - I come with a   warning - no, a request - please -' ... 'What request could a Death   Eater make of me?' 'The - the prophecy... the prediction...   Trelawney...'       'Ah, yes,' said Dumbledore. 'How much did you relay to Lord   Voldemort?'       'Everything - everything I heard!' said Snape. 'That is why - it is   for that reason - he thinks it means Lily Evans!'       'The prophecy does not refer to a woman,' said Dumbledore. 'It spoke   of a boy born at the end of July -'       'You know what I mean! He thinks it means her son, he is going to hunt   her down - kill them all -'       'If she means so much to you,' said Dumbledore, 'surely Lord Voldemort   will spare her? Could you not ask for mercy for the mother, in   exchange for the son?'       'I have - I have asked him -'       'You disgust me,' said Dumbledore, and Harry had never heard so much   contempt in his voice..   This quote seems to imply that Dumbledore was:   Not suprised to see Snape Had given Snape information to relay to Voldemort   However, the general consensus (from what I remember) is that Snape became loyal to Dumbledore only after Lily's death. Given that both sides usually know they are dealing with a double-agent. How did Snape become one?  Option 1: Voldemort sent Snape to find information on Dumbledore.  Option 2: Snape went to Dumbledore to help save Lily.  Option 2 does not seem to fit based on what I take the quote to imply. So, if Option 1 is the case, do we know when it happened?  This question is not a duplicate of  because that question is about when Snape became a Death Eater not a double-agent.

Based on discussion in comments on , was Severus Snape a Death Eater (real one, with Dark Mark) before he overheard Sybil give the Prophecy to Dumbledore and relayed it to Voldemort? Or was he made a DE after that?  Canon sources only please (books/interviews/Pottermore)


I've written a $_GET query that passes strings on from a URL to a select query used to find information in MySQL.  The problem is, unless the URL query includes quotation marks, it won't work.  Is there any way to pass a string without the quotation marks ?  Here's the relevant code:    $query = $_GET['query'];  connect to database code..  $sql = "SELECT * FROM table1 WHERE col1 RLIKE $query";  result code ...

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


If the device fits an orientation change while I am editing a comment, the Post button and down arrow no longer respond to taps.   App Version: 1.0.85 Device Manufacturer: LGE Device Model: VS425PP   OS Version: 5.1.1 (161331805d4f5)

There's a bug in the Android app where a comment can be typed in but not posted, meaning the post button does nothing and I have to back out of the question and go back in to post the comment. This definitely happens when the screen rotates, and also other times but I haven't identified them exactly.  I have version 1.0.78.  Edit: This had stopped happening but now started happening again when I updated to Android 6.0.1, now with version 1.0.85.


I am trying to run TauDEM algorithims with zero luck. I am running QGIS 2.4, have installed TauDEM 5.0.6, MPICH2 and still am getting nowhere. I either get a problem loading output layers or directory name is invalid. Please help.

I'm having trouble setting up TauDEM to work in the processing tools of QGIS 2.0.1.  I download TauDEM from  and select "TauDEM 5.2 Command Line Executables for 32 bit Windows PC". I extract them to a directory called "C:\work\taudem".  I then go into QGIS processing menu > "Options and configuration" under TauDEM I set the "TauDEM command line tools folder" to "C:\work\taudem".  When I execute a TauDEM tool I keep getting errors saying:     Oooops! The following output layers could not be open.


How do I write the symbol ≢ ("not equivalent to") in LaTeX? Is there a way to put a slash through \equiv? \notequiv doesn't exist.

I want to negate the symbol whose code is \models (this would be specific to Formal Logic). How can I do that? I tried a number of combination, but didn't find how this could be done. I tried \neqmodels, \nemodels, \notmodels, \nmodels  but all of them are wrong.  Is there a general way to negate symbols?


I have a macbook pro and i am looking to get a gaming pc.  Ive downloaded a few games on steam that are mac and windows compatible.  I play them on my mac.  Would i be able to sign into my steam account on my windows pc and download the windows version without having to buy it again?

I recently switched from Windows to Mac. Steam says I have fewer Mac specific games than total games and it should be an equal amount unless you can only download, install, and play once from your account. I thought I bought it so that it would work across all operating systems. If this is true, is there a work around or a discount for re-purchasing for the other OSes?


This line:  enum commandLine : int   should define following enums as int but no, it does not. What is wrong here?  using System;  enum commandLine : int {     DRIVELETTER = 0,     URL } namespace not_int {     class Program     {         static void Main(string[] args)         {             String driveLetter;              driveLetter = args[commandLine.DRIVELETTER]; //  Cannot implicitly convert type 'commandLine' to 'int' ... Yes You Can!             driveLetter = args[(int)commandLine.DRIVELETTER]; // This works but feels like talking to a grown-up like he was a child:             // You see, here we have an integer but to you it looks like an integer of a different type. Here I tell you it's an integer of the type you want, like your candies ...             // This way you are happy like with your friday candy ...         }     } }

If I have the following enum:  public enum ReturnValue{     Success = 0,     FailReason1 = 1,     FailReason2 = 2     //Etc... }   Can I avoid casting when I return, like this:  public static int main(string[] args){     return (int)ReturnValue.Success; }   If not, why isn't an enum value treated as an int by default?


Are there any sites like Stack Overflow where we can ask computer science and more theoretical questions? What do you guys/gals use other than this site?  EDIT: Even though I really didn't get satisfactory answers, I am closing the bounty.  I have been using comp.lang.* and the guys there have been pretty helpful. But I hope Stack Overflow welcomes more theoretical and broad range of questions that may or may not have straightforward answers. I also hope I don't need to tag my questions with a vague title like 'computer-science'.

There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.


Good evening all!  The assignments are getting confusing! Again, not asking for a straight up answer but rather a pointer in the right direction so any help is appreciated.  Edit 2: Here is the exercise in question if it helps clear anything up:    I'm wondering how I can set the dailyFee variable in the CarRental.java file using the UseCarRental.java file. The if statements from CarRental.java don't seem to be working properly (inputting size doesn't set the dailyFee variable). Additionally, if I enter "l" for the size, it's not prompting to LuxuryCarRental.java. Here is the code:  CarRental.java  import javax.swing.JOptionPane;  public class CarRental  { private String name; private String zipCode; private String size; private double dailyFee; private int rentalDays; private double totalFee;  public CarRental(String name, String zipCode, String size, double dailyFee, int rentalDays, double totalFee) {     this.name = name;     this.zipCode = zipCode;     this.size = size;     if (size == "e")     {         this.dailyFee = 29.99;     }     else if (size == "m")     {         this.dailyFee = 38.99;     }     else if (size == "f")     {         this.dailyFee = 43.50;     }     this.dailyFee = dailyFee;     this.rentalDays = rentalDays;     totalFee = dailyFee * rentalDays; }  public CarRental(){}  public void display() {     JOptionPane.showMessageDialog(null, "Luxury car for " + name + " from zip code " + zipCode + "\n"             + "Type = " + size + "\n"             + "Daily Fee = " + dailyFee + "\n"             + "Days = " + rentalDays + "\n"             + "Your rental is $" + totalFee); }  //includes getters and setters but I didn't include them in this post   LuxuryCarRental.java  import javax.swing.JOptionPane;  public class LuxuryCarRental extends CarRental {     public LuxuryCarRental(String name, String zipCode, String size, double dailyFee, int rentalDays, double totalFee, String includeChauffeur)     {         super(name, zipCode, size, dailyFee, rentalDays, totalFee);         if (size == "l")         {             dailyFee = 79.99;             includeChauffeur = JOptionPane.showInputDialog(null, "Include chauffeur? Y/N");             if (includeChauffeur == "Y")             {                 totalFee = totalFee + 200;             }         }     } }   UseCarRental.java (incomplete)  import javax.swing.JOptionPane;  public class UseCarRental  {      public static void main(String[] args)      {         CarRental userInfo = new CarRental();         userInfo.setName(JOptionPane.showInputDialog("Enter name"));         userInfo.setZipCode(JOptionPane.showInputDialog("Enter zip code"));         userInfo.setSize(JOptionPane.showInputDialog("Enter type of car" + "\n" + "e - economy" + "\n" + "m - midsize" + "\n" + "f - full" + "\n" + "l - luxury"));         userInfo.setRentalDays(Integer.parseInt(JOptionPane.showInputDialog("Enter days to rent")));           System.out.println(userInfo.getDailyFee());          userInfo.display();      } }   As you can see, I'm completely stumped as to how I can use setDailyFee in UseCarRental.java to set the dailyFee variable, which is need to make the totalFee calculation.  Edit: Being asked to explain why this is not a duplicate question. I fixed the string comparison issue (not updated here yet) but the core issue is still setters and inheritance.  Edit 3: Well I guess the question of the century (for clarity's sake) is: how do I set dailyFee value? I thought that it would be set by the if statement in CarRental.java once size is entered?

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


I want to remove "morrowind" and "manual". How do I do that?

I recently tried to install the Logitech Gaming Software (version 9.02.65) in my Ubuntu 18.04 environment. Since Logitech only provides this program for Windows and Mac, I wanted to install it on Ubuntu using Wine 4.0. However this didn't work out so well (in fact the GUI was completely unusable) so I decided to remove the Logitech Software and put it inside a Windows Virtual Machine.  I am now however left with an unwanted (and unusable) Logitech Gaming Software Link in my Ubuntu Launcher. The Link is not situated in /usr/share/applications nor is it in ~/.local/share/applications.  My question: Where could the Logitech Gaming shortcut be situated and more importantly, how can I remove it from the launcher?


In the famous Christmas carol , presents like "geese a-laying" and "swans a-swimming" are mentioned. What does the "a" refer to in this context?

I have always found the a- prefix to words (as in anew, ajar, aside, awake, afoot, a-hunting, etc.) fascinating. The NOAD says on this topic:     a- 2.  prefix      •to; toward : aside | ashore.      • in a specified state or   manner : asleep | aloud.      • in the   process of (an activity) : a-hunting.      • on : afoot.      • in : nowadays.      ORIGIN   Old English , unstressed form of on.      a- 4. prefix      1 of: anew.      [ORIGIN: unstressed form of of ]      2 utterly: abash. [ORIGIN: from Anglo-Norman   French (corresponding to Old French   e-, es-), from Latin ex.]   While this gives quite a few examples, it leaves some areas of doubt to me:   At what time did this phenomenon happen? It seem quite restricted to words of Saxon origin, as I don't see it used with words of Romance languages. Is that a consequence of point 1, or is it because usage wouldn't aggregate an Old English prefix with, e.g., a word of French origin? Were there others words formed which haven't endured?  Arguably subjective: I wonder how it came to pass that the same prefix is used with so many different meanings.


I'm using Lubuntu 12.04.  I was trying to change my computer name to "main" and I messed up, I'm not sure what to do now.  I was following the directions on .  Here's what I did:  sudo leafpad /etc/hostname   I changed the name, then stupidly closed the file, before changing "/etc/hosts"  Now when I try to move on to the next step (sudo leafpad /etc/hosts), or try any command that begins with "sudo" I get this error:  sudo: unable to resolve host main No protocol specified No protocol specified   I can see that the problem is that I've changed the hostname, so the computer's bewildered by my efforts to use sudo because now hostname and hosts don't match. All I need to do is change the name in hosts, but of course I can't do that without sudo.  Any ideas?

When I run sudo the terminal is stuck for a few seconds and then outputs an error message. My terminal looks like this:  ubuntu@(none):~$ sudo true sudo: unable to resolve host (none)   What can I do to solve it?


When ever I launch Chrome it manifests at a specific size at the top left corner of my screen. Everytime I have to manually resize it and position it in the center of the screen.   How can I change the window size and position on the screen upon launch?

I want my windows to be a specific size (not full screen) and to be in the middle of the screen by default. When I close the application and re-open it, it will be the dimensions I want it to be by default. Is there an easy way to do that? I'm using Ubuntu 11.10 and the Unity desktop enviroment.


I have been trying to solve   It is not an ongoing contest problem.  We can calculate $10^7$th Bell number modulo a prime number greater than $10^7$ in $O(n)$ using this formula $$B_n=\sum_{k=1}^{n}\frac{k^n}{k!}\sum_{j=0}^{n-k}\frac{(-1)^j}{j!}$$ We can store the partial inner sum for future use, without calculating again and again. For example $B_{10^7}$ $\text{mod}$ $1000000007$ $=29987405$.  But in the problem the modulus is $30!$, so we can't do modular inverse operations. I tried to reduce the formula to $$B_n=\sum_{k=1}^{n}\frac{k^n!(n-k)}{k!(n-k)!}=\frac{1}{n!}\sum_{k=1}^{n}\binom{n}{k}k^n!(n-k)$$ $!n$ denotes subfactorial function.  I am stuck here. Can anyone help?  I asked the same question at , so far I haven't got any response.

I have been trying to solve   It is not an ongoing contest problem.  We can calculate $n$th Bell number modulo a prime number greater than $10^7$ in $O(n)$ arithmetic operations, using this formula $$B_n=\sum_{k=1}^{n}\frac{k^n}{k!}\sum_{j=0}^{n-k}\frac{(-1)^j}{j!}$$ We can store the partial inner sum for future use, without calculating again and again. For example $B_{10^7}$ $\text{mod}$ $1000000007$ $=29987405$.  But in the problem the modulus is $30!$, so we can't do modular inverse operations. I tried to reduce the formula to $$B_n=\sum_{k=1}^{n}\frac{k^n!(n-k)}{k!(n-k)!}=\frac{1}{n!}\sum_{k=1}^{n}\binom{n}{k}k^n!(n-k)$$ $!n$ denotes subfactorial function.  I am stuck here. Can anyone help?


I'm trying to get the difference between these 2 recursive strategies.  The definition I was told is the following:  Tail Recursion: A call is tail-recursive if nothing has to be done after the call returns i.e. when the call returns, the returned value is immediately returned from the calling function  Head Recursion: A call is head-recursive when the first statement of the function is the recursive call.

Whilst starting to learn lisp, I've come across the term tail-recursive. What does it mean exactly?


I am trying to study scattering theory using "Quantum Mechanics Concepts and Applications"  by  "Nouredine Zettili" . He starts from the formula  $${d \sigma( \theta,\phi) \over d \Omega  } = {1 \over J_{inc}}{d N( \theta,\phi) \over d \Omega  } $$    where   ${d \sigma( \theta,\phi) \over d \Omega  }$  is called differential cross-section. $ J_ {inc} $ is the incident flux.   But the book does not try to  explain all the terms in the equation, so I don't get an intuitive idea about this equation.  Can anyone please give a good derivation for this equation and explain all the terms in the equation and give an intuitive idea about this equation? Your small efforts are so precious for me please help me  to move more

I would like to know what exactly the term  means. It comes from electron scattering experiments which are used to deduce the charge distribution of a nucleus and the cross section is given as a function of the scattering angle. But I don't understand what it means.


I recall seeing this TV show when I was younger, probably a repeat (the sets and dress looked like a 1960s or perhaps even 1950s); I think it was an episode from a science fiction series, but can't be sure. It was in black and white.  The opening scene shows a group of people in white coats sitting at science stations (probably meant to be computers) in a white, ascetic-looking room. Suddenly -- as in, he's not there, then in the next frame he is -- a man appears and starts smashing the computers with an axe. He's subdued, but when the rest of the compound is searched several anomalies are found, including a motorised cart with the body of another scientist in it driving in small circles outside the research complex. The dead scientist was in the room with the rest of them the moment before the vandal appeared.  When the vandal is questioned the show jumps to tell his story: he was working merrily away when time stopped for everyone except him and the dead man, whose action was what stopped time. He did it deliberately, I think as part of an alien invasion. After trying to stop the traitor, he finished up outside armed with a machine gun, with the traitor in a cart. Because the traitor can manipulate time (a power granted by the invaders to help them) he's always somewhere other than he seems to be (where he was when he said whatever he's saying), so the vandal starts shooting in a circle, ultimately hitting the traitor, who's in the moving cart. He then goes back into the lab to destroy the equipment and start time again.

I remember as a kid watching something on TV that looked like it was filmed in the late ‘60s or ‘70s. I can’t remember if it was a series or a movie (although I think it may have been a movie) and can only remember a particular scene. There was a chase in tiny electric buggies. The protagonist was chased to an open, urban space. The pursuer then started shooting at the protagonist, but the protagonist seemed to be able to jump time somehow so that the person shooting always missed. They eventually shot away from the protagonist and ended up wounding him in the protagonist’s timeline, and he slumped back (in his buggy I think) with a bullet wound in his chest. I appreciate it’s not a lot of to go on, but it’s just one of those random things that’s stuck in my head since childhood and annoyed me periodically since!


I have a 9 volt, 2.5 amp battery (5 9volts connected in parallel). I would like to step the voltage of the battery down to 6 volts while keeping the same current. How might I do this?

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


For the different vehicle categories, what are the fastest? And where or how can I get them?   Since fully upgrading a vehicle costs a lot of money, it would be nice to know which vehicles are the fastest, so I could focus all upgrades on that particular vehicle.

I found an Attrazione in Salander, which has traditionally been fastest in previous games, but I don't like sinking upgrades money into a car unless it's for keeps. What car is fastest in Saints Row IV (before and after upgrades), and how can I get it? Is there any way to get stats on the car in-game?


I am using latex to write my thesis report, so i use the glossary package to generate the acronym list , but i get a small space between acronym and it description ,here is my minimal code:  \documentclass{report} \usepackage{graphicx} \usepackage[colorlinks]{hyperref} \usepackage[savewrites,nopostdot,toc,acronym,symbols,nogroupskip]{glossaries}  \makeglossaries   \newacronym{CICS}{CICS}{Customer Information Control System} \newacronym{EHDM}{EHDM}{Enhanced Hierarchical Development Methodology} \newacronym{ASF}{ASF}{Algebraic Specification Formalism} \newacronym{ProCos}{ProCos}{Provably Correct Systems} \newacronym{HOL}{HOL}{Higher Order Logic} \newacronym{LOTOS}{LOTOS}{Language Of Temporal Ordering Specification} \newacronym{CCS}{CCS}{Calculus of Communicating Systems} \newacronym{CSP}{CSP}{Communicating Sequential Processes} \newacronym{RAISE}{RAISE}{Rigorous Approach to Industrial Software Engineering} \newacronym{VDM}{VDM}{Vienna Development Method }  \begin{document}     \tableofcontents     \chapter{Sample}     This is a sample document that uses the dummy glossary entries     supplied with the glossaries bundle for testing.     \gls{ASF} \gls{CICS}     Here are all the entries (including acronyms):      \gls{ASF} \gls{CICS} \gls{CSP} \gls{ProCos}     \gls{VDM} \gls{RAISE} \gls{CCS} \gls{ASF}     \gls{HOL} \gls{EHDM} \printglossary[type=acronym,style=tree]  \end{document}    and I get this output:     How can I change the space between the acronym entry and it description?? Can you help me please??

How can I vertically align entries in my acronyms' list? I use the Glossaries package to generate it. Here is MWE:  % !TeX program = xelatex % !TeX encoding = utf-8 % !TeX spellcheck = ru_RU  \documentclass[12pt, a4paper]{article}  \usepackage{polyglossia} \setdefaultlanguage{russian} \setmainfont[Ligatures=TeX]{Times New Roman}  \usepackage[xindy={glsnumbers=false}, nonumberlist, nopostdot, nogroupskip]{glossaries} %\setglossarystyle{super} % uncomment for style "super" \makeglossaries  \begin{document}  \newacronym{bam}{ДАП}{Двунаправленная Ассоциативная Память} \newacronym{ai}{ИИ}{Искусственный Интеллект} \newacronym{am}{АП}{Ассоциативная Память} \newacronym{ann}{ИНС}{Искусственная Нейронная Сеть} \newacronym{an}{ИН}{Искусственный Нейрон} \newacronym{it}{ИТ}{Информационные Технологии} \glsaddall  \printglossaries  \end{document}   With the default style I have the following:  As you can see, the long names are not vertically aligned. What I want can be achieved with the    \setglossarystyle{super}   But it this case, short names lose the BOLDness, some small horizontal indent appears and the spacing between lines becomes smaller:  where RED is some extra indent, which I don't need. Thank you for your answers!


Issue: I have installed the LaTeX plugin in Coreldraw X6 from this  and everything works perfectly except for the $\mathbb R^n$ command. Whenever I type it the plugin doesn't compile.   Question:      1) Is there a command I should write in so that the plugin read the package amsmath? For instance, I've tried    \usepackage{amsmath}  $\mathbb R^n$   and nothing happened.     2) Is there any fix to this issue? Or command I should write in the plugin Macro?

I am using WinEdt 6 for compiling my TeX documents. I am getting an error with contains the line $\mathbb{Z}$ showing that it is undefined control sequence. How should I rectify it? Should I include any math packages or something. I am a beginner in using TeX.


i have class basically just a row of a table.  this row contains many columns.   for testing purpose, i  will need to output the reads i get .  so i need to output all of the columns in the row.  the class is like       public class tableRow     {         public tableRow()         {}     public string id     public string name     public string reg     public string data1     ....     ....     ....    <lot more columns>  }     then i need to write like:  Console.WriteLine("id: " + tableRow.id); Console.WriteLine("name: " + tableRow.name); Console.WriteLine("reg: " + tableRow.reg); Console.WriteLine("data1: " + tableRow.data1); ... ... ... <lot more Console.WriteLine>   So i want to know ,  is there an easy way to get all of these output , without so much console.writeLine?  thanks

So for viewing a current object's state at runtime, I really like what the Visual Studio Immediate window gives me.  Just doing a simple  ? objectname   Will give me a nicely formatted 'dump' of the object.    Is there an easy way to do this in code, so I can do something similar when logging?


what is the main utility of Interface. we know that we can implement dynamic behaviour using interface but i guess it is not only the utility. so i like to know when we have to write interface and when we need to go for abstract class.  show me 5 or 10 most important uses of interface in real life scenario.  another main use is coming to my mind that project manager or team lead will implement basic skeleton through interface and other developer follow it.  so please guys show me with sample code few most important use of interface which we can do with abstract class or concrete class.   one guy told me like this way which is not very clear to me  interfaces are defined contracts between classes or structs, consumers can exchange the implementation by a different one as long as the same contract is met that is the method names and signature that compose a specification that classes and structs can work against rather than working against a concrete implementation.  The important part about interfaces is to know when to use them and as a matter of fact it's quite simple, when you want two or more unrelated objects to have the same common functionality but not necessarily the same implementation you will want to use interfaces; otherwise, when you  have related objects that have a shared functionality and implementation then you may consider to use an abstract class instead of an interface.  this thing is not clear specially  when you want two or more unrelated objects to have the same common functionality but not necessarily the same implementation you will want to use interfaces; otherwise, when you  have related objects that have a shared functionality and implementation then you may consider to use an abstract class instead of an interface.  it would be nice if anyone explains with sample code when to go for interface & when abstract class. show me few best important area which is always handle with interface with sample code or best interface uses with sample code.thanks

When should I use an interface and when should I use a base class?   Should it always be an interface if I don't want to actually define a base implementation of the methods?  If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand having interfaces for ISheds or IBarks (IMakesNoise?), because those can be placed on a pet by pet basis, but I don't understand which to use for a generic Pet.


I know that coherent states are the eigenstates of the annihilation operator and i assumed that  $a^{+} |n \rangle =\sqrt{n+1}|n+1\rangle$ was the creation operators eigenstate, why is this not an eigenstate?

How can I find the eigenstates of creation and annihilation operator in QM?   My attempt:  Such eigenstate will obey: $$ a^{\dagger} |\psi \rangle = \alpha |\psi \rangle. $$  We can expand $|\psi \rangle$ in terms of the quantum SHM eigenstates: $|\psi \rangle = \sum_{n=0}^{\infty} c_n |n\rangle $.  Knowing the action of the creation operation of quantum SHM eigenmodes ($a^{\dagger}|n\rangle = \sqrt{n+1}|n+1\rangle)$:  $$ a^{\dagger} |\psi \rangle = a^{\dagger} \sum_{n=0}^{\infty} c_n |n\rangle = \sum_{n=0}^{\infty} c_n \sqrt{n+1}|n+1\rangle$$  from which the state $|0\rangle$ is now missing, so it will never be equal to the RHS of the first expression, $\alpha |\psi\rangle = \sum_{n=0}^{\infty} \alpha c_n |n\rangle $.


I have a file like this:  user1, 10 user2, 5 user2, 6 user1, 15 user3, 23 user1, 15   I'd like to have totals by column 1 (user1, user2, user3), and make it look like this:  user1, 40 user2, 11 user3, 23   What would be the best way forward? A while loop on the first column and sum up the 2nd column as long as it's the same?

With Unix script, I'd like to add values in column 1 if text in column 2 is the same and print the sum.  I have a file that is:    7 GeneA 2 GeneB 6 GeneC 2 GeneB 9 GeneA   I want the output to look like:   16 GeneA 4  GeneB 6  GeneC   Thanks


My program should check whether the input is a palindrome or not. The given program compiles and runs successfully. Program prints reverse string correctly but gives wrong output. Please help!  class Palindrome {     public static void main(String[] args)     {            String str,revStr="";         System.out.println("Enter something to check if it is a palindrome");         Scanner sn = new Scanner(System.in);         str = sn.nextLine();         for(int i=str.length()-1;i>=0;i--)         {             revStr+=Character.toString(str.charAt(i));         }         if(revStr==str)         {          System.out.println("The string "+str+" is a Palindrome");          System.out.println(revStr);         }         else         {             System.out.println("The string "+str+" is not a Palindrome");             System.out.println(revStr);         }     } }   output:  Enter something to check if it is a palindrome nitin The string nitin is not a Palindrome nitin

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


I have recorded my session which looks good on my terminal (when doing cat typescript), but shows gibberish everywhere else.  Is it possibile to use knowledge of my terminal to produce a portable output using command line?   At "small scale" I can workaround this by copying scrollback buffer and pasting into a new file. This proves my terminal knows how to do this!  EDIT: Just realized that this may be very specific, so I'll share that I used tmux but hopefully there exists a general solution using terminal capabilies etc.

I can use the "script" command to record an interactive session at the command line.  However, this includes all control characters and colour codes.  I can remove control characters (like backspace) with "col -b", but I can't find a simple way to remove the colour codes.  Note that I want to use the command line in the normal way, so don't want to disable colours there - I just want to remove them from the script output.  Also, I know can play around and try find a regexp to fix things up, but I am hoping there is a simpler (and more reliable - what if there's a code I don't know about when I develop the regexp?) solution.  To show the problem:   spl62 tmp: script Script started, file is typescript spl62 lepl: ls add-licence.sed  build-example.sh  commit-test         push-docs.sh add-licence.sh   build.sh          delete-licence.sed  setup.py asn              build-test.sh     delete-licence.sh   src build-doc.sh     clean             doc-src             test.ini spl62 lepl: exit Script done, file is typescript spl62 tmp: cat -v typescript Script started on Thu 09 Jun 2011 09:47:27 AM CLT spl62 lepl: ls^M ^[[0m^[[00madd-licence.sed^[[0m  ^[[00;32mbuild-example.sh^[[0m  ^[[00mcommit-test^[[0m         ^[[00;32mpush-docs.sh^[[0m^M ^[[00;32madd-licence.sh^[[0m   ^[[00;32mbuild.sh^[[0m          ^[[00mdelete-licence.sed^[[0m  ^[[00msetup.py^[[0m^M ^[[01;34masn^[[0m              ^[[00;32mbuild-test.sh^[[0m     ^[[00;32mdelete-licence.sh^[[0m   ^[[01;34msrc^[[0m^M ^[[00;32mbuild-doc.sh^[[0m     ^[[00;32mclean^[[0m             ^[[01;34mdoc-src^[[0m             ^[[00mtest.ini^[[0m^M spl62 lepl: exit^M  Script done on Thu 09 Jun 2011 09:47:29 AM CLT spl62 tmp: col -b < typescript  Script started on Thu 09 Jun 2011 09:47:27 AM CLT spl62 lepl: ls 0m00madd-licence.sed0m  00;32mbuild-example.sh0m  00mcommit-test0m         00;32mpush-docs.sh0m 00;32madd-licence.sh0m   00;32mbuild.sh0m          00mdelete-licence.sed0m  00msetup.py0m 01;34masn0m              00;32mbuild-test.sh0m     00;32mdelete-licence.sh0m   01;34msrc0m 00;32mbuild-doc.sh0m     00;32mclean0m             01;34mdoc-src0m             00mtest.ini0m spl62 lepl: exit  Script done on Thu 09 Jun 2011 09:47:29 AM CLT


Page1.php       (I have the same function button for alots  but diferent ID)  when they its load from page with ajax dont works  Page2.php   <input type="button" id="reload">

     Only work at first time but when push reload the script (alert) dont work again, i can see the page its loaded fine but script no.

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


Prove that $$\sum_{cyc}\frac{x}{1-x^2}\ge \frac{3\sqrt{3}}{2}$$ where $xy+yz+zx=1$ and $0< x,y,z <1$  I have a proof :Let $2A,2B,2C$ be the angles of an acute angled triangle, also let $x=\tan A,y=\tan B,z=\tan C$ easy to check $0< x,y,z <1$. $$\sum_{cyc}\frac{x}{1-x^2}=\frac{1}{2} \left(\sum_{cyc} \tan 2A \right)\ge \frac{3\sqrt{3}}{2}$$ Because in a triangle with angles $2A ,2B,2C$ $$\sum_{cyc} \tan 2A\ge 3\sqrt{3}$$ I am however looking for alternative proofs!

For $0 \lt a, b, c \lt 1$, if $ab + bc + ca = 1$, show that $$\frac a{1 - a^2} + \frac b{1 - b^2} + \frac c{1 - c^2} \ge \frac {3 \sqrt 3}2.$$  I want to use trigonometric substitution:  For the angles $A, B, C$ of any acute triangle, $$\tan A + \tan B + \tan C = \tan A \tan B \tan C,$$ $$\frac 1{\tan A \tan B} + \frac 1{\tan B \tan C} + \frac 1{\tan C \tan A} = 1.$$  Also, $\tan A, \tan B, \tan C \gt 0$. So I substitute $a, b, c$ for $\frac 1{\tan A}, \frac 1{\tan B}, \frac 1{\tan C}$ respectively. Then the inequality in question becomes $$\frac {\tan A}{1 - \tan^2 A} + \frac {\tan B}{1 - \tan^2 B} + \frac {\tan C}{1 - \tan^2 C} \le -\frac {3 \sqrt 3}2.$$  Here $A, B, C \not = \frac {\pi}4$ since $a, b, c \not = 1$.  By the trigonometric identity $\tan 2A = \frac {2 \tan A}{1 - \tan^2 A}$, we have  $$\tan 2A + \tan 2B + \tan 2C \le -3 \sqrt 3,$$  where $0 \lt A, B, C \lt \frac {\pi}2$, $A, B, C \not = \frac {\pi}4$, and $A + B + C = \pi$.  How do I proceed?  Edit: The restriction $a, b, c \lt 1$ was added after the question had received some answers, thanks to Michael Rozenberg, who pointed out this mistake.


How can windows be displayed side by side instead of overlapping on taskbar :     Right clicking &including holding shift key) on taskbar dows not appear to contain this option.

There are three options for customizing taskbar buttons in Windows 7:   Always combine, hide labels Combine when taskbar is full Never combine   Is there any way to hide labels and not combine taskbar buttons? Or even better, to exclude only certain applications from combining?  My main problem is that I switch a lot between two instances of a single application, and having to hover over combined icon and then choosing the correct one. Alt-Tabbing is not a good alternative when I'm switching between more than three applications; clicking on taskbar only once is what I'm looking for.


I checked my calculations and I am getting a negative number. Can LIFs be negative?

I'm trying to find outliers using 1.5 x interquartile range but I'm getting a negative value for the lower bound. I found Q3 and Q1 which are 13.30 & 3.00 respectively but for the lower bound i get -12.45 which seem odd. Is there something I'm doing wrong?   There are 43 numbers in this chart so I just get (75/100)*43 to find Q3 and (25/100)*43 to find Q1


I unable to disable the desktop or anything, but when I reboot, all I can see is the mouse and a dialog appear saying that compiz has crashed. The terminal (Ctrl+Alt+t) doesn't work, and neither control alternative delete to log out works. What can I do to restore everything?

I've been messing around with Unity and broke something, how do I "start over"?


How do you install a Netgear wireless adapter on a Ubuntu 14.04 and where do I download the install package from a windows laptop?

I have the latest version of Ubuntu, but it will not recognize my wireless adapter (Netgear WNA3100).  How do I get it to search for (any) USB device and how do I get it to use it to gain access to the internet?


If decide to go to bold mode and then I type inside maths, the maths won't be bold.  \documentclass{article} \begin{document}  \textbf{The unknown $x$ is to be found.}  \end{document}   will produce     Of course, I could do  \textbf{The unknown $\mathbf{x}$ is to be found.} but I was wondering if there is a simple way to tell LaTeX:     Please, for this part, boldify both text and maths

Let me preface this by saying I am fairly hack-and-slash when it comes to LaTeX and so my solutions aren't generally very elegant. Also I will try to be specific with my question, but if you need more information feel free to ask. I am currently writing up solutions to worksheets and was wondering if there was a way I could bold the entire question (formulas and all)? My current set up is something like this:  \begin{document}  \item %The question  \Sol{% Here goes the solution, this personalized command changes the margins a bit}  \end{document}   So basically what I would like to do is have the question number and the question in bold. I believe there is a way to change all math to bold and so I figured I could rig up something like:   \newcommand{\Q}{#1}{*Start-Math-Bold* {\bftext{\item{#1}}}*End-Math-Bold*}   and just use \Q{The question} to achieve desired result. Any thoughts?


Since unicellular organisms can survive, why would there be evolution of multicellular organisms?

I read a story this week on Richard Lenski who has been 'evolving' E. coli for more than 50,000 generations now.  One comment I read was from someone who doesn't accept Evolution who pointed out that we haven't seen a single celled organism 'evolve' into a multi-celled organism.  Another person responded and said that a bacteria is not going to evolve into something that isn't a bacteria.  So, if Evolution created single celled organisms and then multi-celled organisms how might that change have happened?  And is it possible to recreate that set of driving forces to make a bacteria something other than a bacteria?  To that end, what advantage does being multi-cellular have over being unicellular (if that's even a word)?


I am faced with the following situation: My GUI needs a Panel with some special methods (Adding a message to display, adding an image...). Easy so far. Now, this element is supposed to be exchangeable from the outside! One version has a pink background, one has a purple one, one is upside down, to name some random examples. My basic idea was to define an abstract class extending JPanel,  with the required methods defined as abstract methods as well. The question that now keeps me stuck is: where do the implementations belong? I cannot have a jar implement an abstract class from the main apllication, and then have the application use that jar. That idea alone sounds totally broken!  So, how do I solve this properly? I feel like I am missing something obvious here...  EDIT: Plugin is the word I was missing! Marked this as duplicate, the linked answer tells me exactly what I was lookign for :)

How would you implement a Plugin-system for your Java application?  Is it possible to have an easy to use (for the developer) system which achieves the following:   Users put their plugins into a subdirectory of the app The Plugin can provide a configuration screen If you use a framework, is the license compatible with commercial developement?


I understand that it's possible to find 3 distinct evenly spaced square numbers is possible by finding a rational solution to the equation: $x^2+y^2=2r^2$ Where $r$ is a rational number. But I have no idea how to apply this to finding a larger amount of evenly spaced perfect squares, or if it is even possible.

It is easy to find 3 squares (of integers) in arithmetic progression. For example, $1^2,5^2,7^2$.  I've been told Fermat proved that there are no progressions of length 4 in the squares. Do you know of a proof of this result?   (Additionally, are there similar results for cubes, 4th powers, etc? If so, what would be a good reference for this type of material?)    Edit, March 30, 2012: The following  in MO is related and may be useful to people interested in the question I posted here.