I'm trying to set the srcCompat of an ImageView but got this error instead.  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.pangelyn/com.example.pangelyn.SwipeRight}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageResource(int)' on a null object reference  I've checked multiple post in SO already but nothing seems to work.  Java file:   private void loadLocale() {     SharedPreferences prefs = getSharedPreferences("Settings", Activity.MODE_PRIVATE);     String language = prefs.getString("Lang","");     setLocale(language);      ImageView imageView = findViewById(R.id.imageView_flag);      if (language.equals("en")) {         imageView.setImageResource(R.drawable.usa);     }     else if (language.equals("in")) {         imageView.setImageResource(R.drawable.indonesia);     }     else if (language.equals("fil")) {         imageView.setImageResource(R.drawable.philippines);     } }   XML file:              <ImageView                 android:id="@+id/imageView_flag"                 android:layout_width="30sp"                 android:layout_height="30sp"                 android:layout_alignParentRight="true"                 android:layout_marginRight="5sp"                 android:background="@drawable/stroke"                 android:padding="3dp"                 android:scaleType="centerInside"                 app:srcCompat="@drawable/philippines" />   EDIT:   2020-02-13 23:32:37.312 9854-9854/com.example.pangelyn E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.pangelyn, PID: 9854 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.pangelyn/com.example.pangelyn.SwipeRight}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageResource(int)' on a null object reference     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)     at android.app.ActivityThread.-wrap11(Unknown Source:0)     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)     at android.os.Handler.dispatchMessage(Handler.java:106)     at android.os.Looper.loop(Looper.java:164)     at android.app.ActivityThread.main(ActivityThread.java:6494)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageResource(int)' on a null object reference     at com.example.pangelyn.SwipeRight.loadLocale(SwipeRight.java:164)     at com.example.pangelyn.SwipeRight.onCreate(SwipeRight.java:42)     at android.app.Activity.performCreate(Activity.java:7009)     at android.app.Activity.performCreate(Activity.java:7000)     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)      at android.app.ActivityThread.-wrap11(Unknown Source:0)      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)      at android.os.Handler.dispatchMessage(Handler.java:106)      at android.os.Looper.loop(Looper.java:164)      at android.app.ActivityThread.main(ActivityThread.java:6494)      at java.lang.reflect.Method.invoke(Native Method)      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

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?


Just wondering if this would be a good idea or not, but when entering tags into the Tags section of the question would it help if the tag showed the number of online users currently following that tag. That way a user would know when the peak traffic times are in the area they have a problem in. This could stop genuine questions going unanswered.

Is there any way to view the number of users online at any given time (or even an approximation)?  This could be really useful to provide an indication of whether your question is likely to get answered any time soon.  It could also provide a bit of an indication for why your question is getting very low views - if there are only a few users online, then that could be the reason for little interest in a question, whereas if there are lots of users online and the question still doesn't garner many views, then maybe it needs to be rephrased or something.  I know that this can't be used definitively, but it could be used as a rough guide, and could also just be an item of interest.  Perhaps it could show the number of users that have been seen in the past 5 / 10 minutes? (Shouldn't be too hard, since each user page already shows the last time that they were seen).


Staying away from LaTeX for barely more than 2 years has devastating effects. I think once I knew how to protect this stuff, but I have no idea now. I defined the newcommand below to be faster in writing C++ code inline (and I have a similar macro for other languages). However, it looks like it doesn't really like the # of include statements: \documentclass{article}  \usepackage{minted} \newcommand{\cpp}[1]{\mintinline{c++}{#1}}  \begin{document}  \noindent \mintinline{c++}{#include <iostream>} % ok \\ \cpp{#include <iostream>} % renders as `##include <iostream>`  \end{document}

I'm using the following command to create my own version of \mintinline:  \newcommand{\inline}[1]{{\mintinline[fontsize=\normalsize]{text}{#1}}}   This works except when I'm using the hash character. For instance:  \inline{Class#method()}   Which gets rendered with two hashes (i.e. Class##method()). When I replace my own command with \mintinline[fontsize=\normalsize]{text}{…}, everything is fine.  What am I doing wrong in my \newcommand definition?


I just finished an animation project, and suddenly my camera is looking really weird.   The camera has 2 child of modifiers, to two empties (circle and sphere) I haven't animated the camera at all, only animated the empties  I believe I have pressed a shortcut (I'm a noob and I dont know all of them). I've searched around the internet but unfortunately cant find a solution, I dont even know what this is called.

I have a problem with rendering in cycles. In blender render my object is rendering fine, but in cycles when I pushed F12 I got only this:    One more thing: when I click 0 on keyboard I'm not in camera persp, but in object as camera, it looks like invisible layer, I don't know how to undo this, and be in camera persp again.  Does anybody have any idea how to fix this?


I have a Kona Rove ST 2019.  only say "Spokes: Stainless Black 14g". How do I know the precise reference so I can buy some spare ones online?

I have a  and under description for Spokes it says "Stainless PG"...but when I look for spokes there are a multitude of sizes, thicknesses, butted, double-butted, etc.!  How do I know what to get for my bike to replace a broken spoke?


How to prove that  $$1^2+2^2+...+n^2=\frac{n(n+1)(2n+1)}{6}$$ without using induction.  If we don't know the right side of this expression, how to get right expression. I tried with partial sums and binomial formula but can't get it.  So the problem is: $$1^2+2^2+...+n^2=?$$  Thanks for replies.

I was looking at: $$\sum_{k=1}^n{k^2}=\frac{n(n+1)(2n+1)}{6}$$  It's pretty easy proving the above using induction, but I was wondering what is the actual way of getting this equation?


$$\sum_{n=1}^\infty \frac{(-1)^n \ln(n)}{n} $$  How do I determine if this converges or diverges?     I should be able to show this with just the basic library of Calc II tests (Geometric, p-series, Divergence (nth term) test, Integral test, Direct Comparison test, Alternating Series Test, or Ratio test) None of these involved derivatives, either

Stumped on yet another absolute convergence problem. (Converge conditionally, absolutely, or diverges)  $$\sum_{n=1}^\infty \frac{(-1)^n \ln(n)}{n} $$  First, I tested for absolute convergence, and the series reduced to $\frac{\ln(n)}{n}$   .....Using direct comparison, $\frac{\ln(n)}{n} > \frac{1}{n}$ I determined this diverges.  So, it does not converge absolutely.  Next, to use the alternating series test on the original series, you need to make sure the magnitude of the terms are decreasing.  Well, they are not:  $$\sum_{n=1}^\infty \frac{(-1)^n \ln(n)}{n} = -0 + .35 - .37 + .35.... $$  So, without using the alternating series test, how do I determine if the orig. series converges or diverges?  How can I use the divergence test (Nth term test)?  I'm not sure what the nth term tends to with that (-1) oscillation.  Just focus on $\frac{\ln(n)}{n}$  But we established that diverges, right?   But, I am told this series converges conditionally.  Do I use integral test?


The random variable $A$ has a $\chi^2$ distribution with $p$ degrees of freedom. The random variable $B$ is independent of $A$ and has a $\chi^2$ distribution with $q$ degrees of freedom. Show that $(A+B)$ and $(A/(A+B))$ are independent and determine their distribution. So far I worked out that: $(A+B)$ will have a $\chi^2$ distribution with $(p+q)$ degrees of freedom. $(A/(A+B))$ is a division of two $\chi^2$ distributions, which is pretty close to an F-distribution. I cant figure out how to get their distributions and show the independence.

If $X= x_1/(x_1+x_2)$ and $Y= (x_1+x_2)/(x_1+x_2+x_3)$ where   $x_1,x_2,x_3$ independent chi-square variates with d.f $n_1,n_2,n_3$   respectively, are $X$ & $Y$ independent?   I know the condition for independence of two random variables and the usual method followed i.e using joint distribution . But is there any short way to establish independence in the above question?


Is there any actor who has played, in different Star Trek episodes, both a Starfleet crewmember (of the Enterprise, Voyager, etc.) and one of the alien strangers encountered by the crew?  Clarifications:   All series (TOS, TNG, DS9, etc.), plus the stand-alone films, are included in the scope of this question. (I'd be most interested in an actor who's appeared in both these roles in the same series, but also in whether anyone's been e.g. a crewmember in TOS and an alien in TNG.) Neither of the roles in question needs to be a recurring role; either or both could be a one-off appearance. The crewmember role needs to be that of one of the primary vessels (the Enterprise, the DS9 space station, etc.)

got me to thinking about how there have been many actors who have had several roles across the Star Trek franchise. It seems that once an actor demonstrates good performance in that franchise, it is very likely (at least more so than in other franchises, or it might just be my imagination) that they will be seen as another minor or major character later on.  So, I'm now curious to know which actor has had the most distinct roles in the franchise. Some likely candidates have already been named in the linked thread (e.g.: Majel Barrett, Jeffrey Combs) but I'd like to know if these are really the top ones?  Note that this question is asking about distinct roles. That is, variations of the same character (e.g.: holographic or dream-state representations, shapeshifters or alien possessions, etc.) do not count. I'd also like to exclude very closely related characters (e.g.: ancestors, descendants, similarly-crafted androids, etc. - I was originally going to include these, but then realized that  might be an all-too-easy winner).  Also, to keep this question in an SE-sized scope, I'm only looking to draw from primary-universe live-action productions up to and including ENT.  That includes:   TOS, and related films TNG, and related films DS9 VOY ENT   This excludes:   J.J. Abrams' Star Trek universe TAS Books Comics Video Games Fanfic   Related:


I would like to write a program in C that can shutdown a computer. In order for me to do this, I must execute the command "shutdown -h now". This is to be done in the terminal or command prompt. How can I tell the program I would like it to execute the command in the command line?

How should I run another program from within my C program? I need to be able to write data into STDIN of the launched program (and maybe read from it's STDOUT)  I am not sure if this is a standard C function. I need the solution that should work under Linux.


I use VirtualBox for Ubuntu on my Windows 7 computer. I set up SSH and got in through Putty just fine. However I wanted to know how to see who was connected. So I Googled a bit and found "who" and tried it.  myname@ubuntuComputer:~$ who myname :0           2014-07-02 17:55 (:0) myname pts/0        2014-07-02 17:58 (:0) myname pts/4        2014-07-02 19:49 (nameOfHomeComputer.home)   Can anyone explain to me what these figures all mean? Why are there three? What are the 0's and pts/0 pts/4 thing?

When I run w -  to see who is logged on and what they are doing, i see this:   USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT  user  tty7     :0               08:14   10:32m 44:10   0.50s gnome-session  user  pts/0    :0.0             09:15    9:30m  0.24s  0.24s /bin/bash  user  pts/1    :0.0             14:14    4:32m  0.20s  0.20s bash  user  pts/5    :0.0             18:27    9:24   0.28s  0.28s bash  user  pts/7    :0.0             18:35    9:57   0.40s  0.40s bash  user  pts/8    :0.0             18:37    0.00s  0.22s  0.00s w   What are the pts/ ?


What kind of behaviour change should I expect to see, if I feed a 12V 50kHz frequency, with 50% duty cycle,  or a 100Hz 50% duty cycle, across a DC Motor?

What is a suitable frequency for 15V/3A DC motor? Is there any effect on the motor when the frequency is changing? I am confused with this until now and the Internet shows a lot of theory that confuses me.


So, here's my question:  I'm trying to replace anything in a string that is not an "A" or a "C" case insensitively. My strings are all three characters. (In reality the specific two letters will change, which is why I'm not hardcoding the negated values.)  So, I thought I'll do  re.sub(r'[ac]', "X", "ABC", re.IGNORECASE)   But, what I got back was 'XXC'. I expected 'AXC'.  The full range of my data would be  map(lambda s: re.sub(r'[^ac]', "X", s, re.IGNORECASE), [ "ABC", "ABc", "AbC", "Abc", "aBC", "aBc", "abC", "abc" ])   and what I get back is this:  ['XXC', 'XXc', 'XXC', 'XXc', 'aXX', 'aXc', 'aXX', 'aXc']   Why does the re.IGNORECASE replace the "A"'s? and, why does it sometimes replace the C's? (Notice how it turned "abC" to "aXX".  if I do this:  map(lambda s: re.sub(r'[^acAC]', "X", s), [ "ABC", "ABc", "AbC", "Abc", "aBC", "aBc", "abC", "abc" ])   I get what I want:  ['AXC', 'AXc', 'AXC', 'AXc', 'aXC', 'aXc', 'aXC', 'aXc']   Must I use r'[^acAC]'?? Is there no way to case insensitively complement a regex?  It's interesting to me also, that in vim, if I put all those strings into a text file and do     :%s/[^ac]/X/gi   I get the right thing. (And, blasphemous as this might be, if I do this in perl:       #! /usr/bin/perl      use strict;      foreach my $gene ( "ABC", "ABc", "AbC", "Abc", "aBC", "aBc", "abC", "abc") {                 my $replaced = $gene;             $replaced =~ s/[^ac]/X/gi;             printf("%s\n", $replaced);     }   I get   AXC AXc AXC AXc aXC aXc aXC aXc   So does Ruby:  irb(main):001:0> ["ABC", "ABc", "AbC", "Abc", "aBC", "aBc", "abC", "abc"].collect{|s| s.gsub(/[^ac]/i,"X") } => ["AXC", "AXc", "AXC", "AXc", "aXC", "aXc", "aXC", "aXc"]   How can I do the equivalent in python without doing r'[^acAC]'?  Thanks!

The Python docs say:     re.MULTILINE: When specified, the pattern character '^' matches at the beginning of the string and at the beginning of each line (immediately following each newline)... By default, '^' matches only at the beginning of the string...   So what's going on when I get the following unexpected result?  >>> import re >>> s = """// The quick brown fox. ... // Jumped over the lazy dog.""" >>> re.sub('^//', '', s, re.MULTILINE) ' The quick brown fox.\n// Jumped over the lazy dog.'


I have been reading this site quite a bit getting my first ever Ubuntu box running and had a question,  Currently my drive has partitions showing like this     /dev/sda1   *        2048    31459327    15728640   27  Hidden NTFS WinRE    /dev/sda2        31459328    31664127      102400    7  HPFS/NTFS/exFAT    /dev/sda3        31664128   656826936   312581404+   7  HPFS/NTFS/exFAT    /dev/sda4       656828414   976771071   159971329    5  Extended    Partition 4 does not start on physical sector boundary.    /dev/sda5       656828416   971048959   157110272   83  Linux    /dev/sda6       971051008   976771071     2860032   82  Linux swap / Solaris   I believe sda1 is Acer recovery disk or something, sda2 is the one I have been using to boot Windows and sda3 seems to be my main Windows storage drive.  I am wondering what is going on with sda4. It appeared like that after I had to re-install Ubuntu (I messed my first install up trying to get Acer wireless to work).  Should I worry about this? Everything runs fine so far in both Ubuntu and Windows. If I just ignore it, could anything happen?  I am dual booting Windows 7 and Ubuntu 12.04.  I should also note, just before I installed Ubuntu I had to do a recovery/repair of Windows 7. It wouldn't even load past the boot screen so I did a repair from the Windows cd. Not sure that affects anything.  Thanks

Tried to install Ubuntu 12.04 from USB-stick alongside the existing Win7 OS 64bit, and now I'm not sure if install was completely successful: Disk Utility tool claims that the Extended partition (which contains Ubuntu partition and Swap) is "misaligned" and recommends repartition. What should I do, and if should I do this repartition, how to do it (especially if I would like not to lose the data on Win7 partition)?  Background info: A considerably new Thinkpad laptop (UEFI BIOS, if that matters). Before install there were already a "SYSTEM_DRV" partition, the main Windows partition and a Lenovo recovery partition (all NTFS). Now the table looks like this: SYSTEM_DRV (sda1), Windows (sda2), Extended (sda4) (which contains Linux (sda5; ext4) and Swap (sda6)) and Recovery (sda3). Disk Utility Tool gives a message as follows when I select Ext: "The partition is misaligned by 1024 bytes. This may result in very poor performance. Repartitioning is suggested."  There were couple of problems during the install, which I describe below, in the case they happen to be relevant.  Installer claimed that it recognized existing OS'es fine, so I checked the corresponding option during the install. Next, when it asked me how to allocate the disk space, the first weird thing happened: the installer give me a graphical "slide" allocate disk space for pre-existing Win7 OS and new Ubuntu... but it did not inform me which partition would be for Ubuntu and which for Windows. ..well, I decided to go with the setting installer proposed. (not sure if this is relevant, but I guess I'd better mention it anyway - the previous partition tools have been more self-explanatory...)  After the install (which reported no errors), GRUB/Ubuntu refused to boot. Luckily this problem was quite straightforwardly resolved with live-Ubuntu-USB and Boot-Repair ("Recommended repair" worked just fine). After all this hassle I decided to check the partition table "just to be sure"- and the disk utility gives the warning message I described.  I checked my disk specs on Hitachi/HGST website, and yes, it's Advanced Format ("Advanced Format, 512-byte emulation").  Also, fdisk gives me the following:     Device Boot      Start         End      Blocks   Id  System  /dev/sda1   *        2048     3074047     1536000    7  HPFS/NTFS/exFAT /dev/sda2         3074048   523241959   260083956    7  HPFS/NTFS/exFAT /dev/sda3       939907072   976771071    18432000    7  HPFS/NTFS/exFAT /dev/sda4       523243518   939907071   208331777    5  Extended Partition 4 does not start on physical sector boundary. /dev/sda5       523243520   932153343   204454912   83  Linux /dev/sda6       932155392   939907071     3875840   82  Linux swap / Solaris   Apparently sda4 (extended) partition is off by 2 bytes (sda4 starts on 523243518, sda5 523243520), but if I understood correctly, this should not be a problem, as the logical partition sda5 seems to be OK(?). In other words, there should be no need for repartitioning?


Reading package lists... Done E: The repository 'cdrom://Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423) focal Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

Every time I try update (using sudo apt-get update) my Ubuntu I get this problem:  W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   How can I fix it? I use Ubuntu 16.04 LTS


I play D&D with my friends, and our DM sent us on a quest to poison someone with wine. It turns out there was a bomb on the bottom of the bottle, which exploded and killed us all. Are there any rules against just creating random weapons such as bombs like this? Also am I just being butt-hurt about it, or is it very cheep and a stupid way to kill all your players.

Rule Zero: All other rules can be changed by the GM.   I appreciate that there is a massive amount of work that goes into being a GM and the last thing that any GM wants or deserves is to have his players constantly questioning everything they do. However, a group I am currently playing with has been having a huge problem with a GM who has been using rule 0 to deny virtually every skill check and give all his custom enemies powers that have either no save or unbeatable DCs. Then, whenever he realizes he has made the fight unwinnable he brings in one of his level 60+ GMPCs to instantly win the fight, making us feel even more helpless.  We try to hold our tongues and not be the dreaded Rules Lawyer, but he keeps pulling out stuff so ridiculous that we have to question it… and every time we do we find that he is either misunderstanding or completely disregarding the rules. When this happens he always jumps immediately to rule 0. He probably cited rule 0 around 6 times in our last session (and we only had one combat encounter).


I am trying to prove a time series is stationary and I think I am misunderstanding something. My question is   $$\ X_t=U_1 sin(yt) + U_2cos(yt) $$ with $E[U_1]=E[U_2]=0$  and $E[U_1^2]=E[U_2^2]=\sigma^2$ and $y=(2 \pi w_0)$ is a constant.  it was pretty easy to show that the mean does not depend on t, but then my book gave me the autocovariance = $ \gamma (h)=\sigma^2 cos(yh)$ and I am struggling to reach this.   my thoughts... let $s=t+h$ $$cov(x_t, x_s) = E[(x_s - \mu_s)(x_t - \mu_t)]=E[x_s x_t] - 0 =E[x_s x_t]$$  so we need the expectation at two different time periods. I tried to  $$\ E[x_t x_s]=E[(U_1 sin(yt) + U_2cos(yt) )(U_1 sin(y(t+h)) + U_2cos(y(t+h)) )]$$  but after continuing with this line, nothing came of it. I don't think we need to use trigonometric identities, so can anyone point me in the right direction?

Hey I need some help with this exercise:  Assume $z_{ t }$ be a sequence of independent normal random variables, each with mean 0 and time independent variance $\sigma^{ 2 }$, and let c be a constant. Is the following process for a time series stationary? If it is stationary specify the mean and the autocovariance function:  $$ x_{ t }=z_{ 1 }*cos\left( ct \right)+z_{ 2 }*sin\left( ct \right) $$  So for a weak stationarity time series the mean and covariance function should be independent of time. I'm not sure how to calculate them by hand without R.  Thanks for help.


I want to use spoiler tags to hide a bulleted list, but the formatting doesn't seem to be working properly.  Can an option be added for using spoiler tags ! with a bulleted list?  This is apparently a longstanding issue as . It would be helpful if a workaround was implemented.    Failed Attempts  > - Spoiler        Spoiler      >! - Spoiler      - Spoiler   > !- Spoiler     - Spoiler   > - !Spoiler        !Spoiler      !> - Spoiler !> - Spoiler

While trying to assist with the formatting of a , I discovered there's not a lot of parity between how spoilers and quote blocks (which are superficially quite similar) handle nested Markdown formatting.  (Simple HTML works fine.)  For example, here's a variety of typical Markdown nested inside a quote block:     heading            paragraph  code block          nested         list                 even nested quotes!               with nested nested formatting!           Aside from the code and quote blocks not standing out due to matching background colors, everything works exactly as expected.  Sadly, the same is very much not true for spoilers:      ### heading   ---   paragraph       code block   - nested  1. list   > even nested quotes!  >  > - with nested nested formatting!   Eek!  Any chance of changing spoilers to act more like quotes?  Needing complex formatting in spoilers isn't a terribly common scenario, but when you do, the inconsistency is jarring and a bit frustrating.


I have an ASUS K550JX laptop. Recently I replaced my hard disk with an SSD. I also took out my optical drive and replaced it with my old HDD (using a Hard disk caddy). But there's a small but annoying issue that I'm facing right now. Whenever the old hard drive isn't in use (no reads or writes) it is turned off and when needed, it has to be turned on again which takes a few seconds and can cause a few seconds of waiting in whatever I'm trying to do (reading a PDF document can be very annoying as changing pages requires the old hard disk to get to speed). My question is that is this done by the operating system?(I'm on windows 10) or is it a BIOS setting?(in which I didn't find anything) If this is done by the operating system is there any setting that I can change to prevent this? I have changed a few settings in power options and turned off a few power saving features but they don't seem to do anything useful.

First off I did try the power options setting and it's on 'Never' but that did nothing. The drive still spins down after 15-20 seconds of not being used. I need it to spin all the time because it's more efficient with my way of using it. Also listening to music from that drive is absolutely destroying the drive making it spin up and down all the time causing immense wear and tear. Any ideas on how to stop it from spinning down? Please don't suggest bat files that keep creating editing a file.     Oh and here is the model of the drive: wdc wd10jpvx-22jc3t0 and my OS is Windows 10 64 bit.


Noticed a small bug in Mathematics Stack Exchange, though perhaps it might exist anywhere using MathJax. The winter hat (in this case, "Gimme Space") shows up inside the rendered expressions. I do not know why it is in that expression specifically. The post shown below is .

My "hat" is shown twice in my answer, once in my sig, and again above. MacOS 10.14.6; Safari Version 14.0.2 (14610.3.7.1.10)


In XeLaTeX, it’s convenient to customize font families for body text through the fontspec package. But I intend that the math equations be displayed in a custom font, say Comic Sans MS. How to do that in XeLaTeX? \documentclass{article} \usepackage{fontspec} \begin{document} % I want this equation to be typeset in Comic Sans MS % Is there any command like % \setmathfont{Comic Sans MS} ? \begin{equation} p\land q \lor r \to s \end{equation} \end{document}

Relevant to those:         I'm trying to change the font at math-mode: If it's with "s": \setmathsfont -  it doesn't compile, if it's without the "s: it's doesn't change the font...  Here is MWE:  \documentclass{scrartcl}   \usepackage{unicode-math} \setmathfont{Arial}  \begin{document}  \[ a+b^{2}+5 \]  \end{document}   The output is:   Can you help to understand how to change the font at math-mode?  Thank you!!


maybe I am already looking at it, but I can't see it, so I would be glad if someone can give me a short hint.   \documentclass[12pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[german]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \renewcommand{\theequation}{\textit{Eq. \thesection.\arabic{equation}}}   \begin{document}  \section{Vogelpohlsche Volumenformel} \begin{equation} n = \frac{10^{-8} F}{6 C \cdot \eta \cdot V} \label{eq:Example} \end{equation}  A reference to the equation \ref{eq:Example} is helpful.  \end{document}   As with this MWE, I redefined the numeration of the equation that it appears on the right as "Eq. 1.1", which works fine. But when I am referencing the equation inside text, I normally write the whole word "equation" and add the reference.  Here it gives me also the abbrevation for the reference ("A reference to the equation Eq. 1.1 is helpful."). What is the way to have the "Eq." in the numeration but not in the reference?  I want to avoid additional packages or so and I also looked up former questions like this one without seeing the solution    Thanks for your input and have a nive day to you all!

How can I change the labelling of an equation? Instead of (1.1), (1.2) I want to have (Equation 1.1), (Equation 1.2), ...  Document class is scrbook.  I use the following related packages:  \usepackage{amsmath,amssymb,amsthm}   Example of an equation:  \begin{equation} \label{eqn:example} a+b=c \end{equation}


I'm messing around with Unity 2017's post processing tools while making a 2D game that benefits from the parallaxing effect using a perspective camera.  Please note that the game is mostly made using sprites.   Now, I have a playerGround, a backGround and a foreGround. I wish to blur the background and foreground only but not the playerground.  I'd like to know how to do this as playing with the focal length didn't do anything, everything receives the same blur amount regardless of the distance from camera.

I'm trying to fake a DOF effect for Sprites by using 2 cameras, one for the sharp objects, one for the blurred ones. I have set up the layers like Blur and Sharp accordingly.   So I have these 2 cameras, and I use Unity's Blur (optimized) script to blur things, and I have this script on only one camera, the one that is responsible for the blurred render.   I have the cameras like:  Cam 1:   Clear flags: Don't clear (this is the main, sharp cam) Culling mask: sharp layer has no blur effect (or any other post proc effect).   Cam 2:   Clear flags: don't clear (this is the blur cam) culling mask: blur Has Blur (optimized).    Now, if this blur cam is on the back, meaning its depth is LESS than the main cam's depth, I have a sharp player ground and a blurry background. However, I need a blurry foreground too that should be on top of the player ground.  The issue starts when I set the blur camera's depth higher than the main cam's. In this case, everything gets blurred, no matter that the main cam has no blur effect on it.   Question is, how to set this up so only the desired layers get the blur?


void xsdValidation(char *xsdName, char *xmlName){  char *terminalCommand;  system("xmllint --noout --schema ", xsdName , xmlName); }   I have a little problem with that. I have a code to valide my xml. And my xml's name and xsd's name came from as a argument. How can i concat these 3 things?

I'm working in C, and I have to concatenate a few things.  Right now I have this:  message = strcat("TEXT ", var);  message2 = strcat(strcat("TEXT ", foo), strcat(" TEXT ", bar));   Now if you have experience in C I'm sure you realize that this gives you a segmentation fault when you try to run it. So how do I work around that?


I have the following code which is attached to my window. Whenever the user presses a keyboard, that character is saved to a 8 character long array in a StringBuilder class.  When the user types "somecode" then the something() method should be called.  static StringBuilder    s   = new StringBuilder("aaaaaaaa");  public static void listen() {       Main.sc.setOnKeyPressed(new EventHandler<KeyEvent>() {             @Override             public void handle(KeyEvent event) {                 {                     for(int i=0; i<7; i++) {                         s.setCharAt(i, s.charAt(i+1)); // the characters move 1 position backwards                     }                         char c = event.getText().charAt(0);                     s.setCharAt(7, c);                      System.out.println(s.toString());                      if(s.toString()=="somecode") {                         System.out.println("--------------------------");                         something();                     }                 }             }         }); }   My output is:  aaaaaaas aaaaaaso aaaaasom aaaasome aaasomec aasomeco asomecod somecode   However the something() method is never called, nor is the "-----------------" displayed.  EDIT: This has been tagged as duplicate, however .equals() is not working either  if(s.equals("somecode")) {                         System.out.println("--------------------------");                         something();                          }

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?


What does this number equal if it goes on forever? $$\frac{\frac{\frac{\frac{\frac{1}{2}}{\frac{3}{4}}}{\frac{\frac56}{\frac78}}}{\frac{\frac{\frac{9}{10}}{\frac{11}{12}}}{\frac{\frac{13}{14}}{\frac{15}{16}}}}}{\frac{\frac{\frac{\frac{17}{18}}{\frac{19}{20}}}{\frac{\frac{21}{22}}{\frac{23}{24}}}}{\frac{\frac{\frac{25}{26}}{\frac{27}{28}}}{\frac{\frac{29}{30}}{\frac{31}{32}}}}}$$ $$.$$$$.$$$$.$$  Treat the fraction in blocks, one divides what is under it, then that pair is divided by the next pair, those four are divided by the next four. ETC  Edit.  I'm reformatting as I can't read the original... aged eyes I guess ;-( but in deference to almagest's comment I am leaving the original too. $$\frac{\frac{\frac{1}{2}\Big/\frac{3}{4}}{\frac{5}{6}\Big/\frac{7}{8}}\Bigg/   \frac{\frac{9}{10}\Big/\frac{11}{12}}{\frac{13}{14}\Big/\frac{15}{16}}}   {\frac{\frac{17}{18}\Big/\frac{19}{20}}{\frac{21}{22}\Big/\frac{23}{24}}\Bigg/   \frac{\frac{25}{26}\Big/\frac{27}{28}}{\frac{29}{30}\Big/\frac{31}{32}}}   \cdots$$

I was given this problem 30 years ago by a coworker, posted it 15 years ago to rec.puzzles, and got a solution from Barry Wolk, but have never seen it again.  Consider the series:  $$1, \frac{1}{2},\frac{\displaystyle\frac{1}{2}}{\displaystyle\frac{3}{4}},\frac{\displaystyle\frac{\displaystyle\frac{1}{2}}{\displaystyle\frac{3}{4}}}{\displaystyle\frac{\displaystyle\frac{5}{6}}{\displaystyle\frac{7}{8}}},\cdots$$  Each fraction keeps its large bars while being put atop a similar structure. This can also be represented as $$\frac{1\cdot 4 \cdot 6 \cdot 7 \cdot\cdots}{2 \cdot 3 \cdot 5 \cdot 8 \cdot\cdots}$$ terminating at $2^n$ for some $n$, where it is much closer to the limit than elsewhere.  The challenge:   Find the limit, not too hard by experiment In the last expression, find a simple, nonrecursive, expression to say whether $n$ is in the numerator or denominator Prove the limit is correct-this is the hard one.


I need to split a string by single spaces and store it into different arrays of strings. The delimiter is 1st a space then the commas.     like -   input: "add s1,s2,s3"  my output should be :     a[] = "add" b[] = "s1" c[] = "s2" d[] = "s3"

I'm trying to iterate over the words of a string.  The string can be assumed to be composed of words separated by whitespace.  Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.  The best solution I have right now is:  #include <iostream> #include <sstream> #include <string>  using namespace std;  int main() {     string s = "Somewhere down the road";     istringstream iss(s);      do     {         string subs;         iss >> subs;         cout << "Substring: " << subs << endl;     } while (iss); }   Is there a more elegant way to do this?


As per Wikipedia, plagiarism is "wrongful appropriation" and "stealing and publication" of another author's "language, thoughts, ideas, or expressions" and the representation of them as one's own original work.  While there are words that depict plagiarism in the context of "literature" and/ or "art/ music" (e.g. piracy, appropriation, borrowing, counterfeiting, lifting, literary-theft, etc.), I was not able to think of single-word alternatives that indicate plagiarism of "ideas".   Do such alternatives exist, or should I simply refer to it as "idea plagiarism"?

I'm looking for a word that has the same meaning as "plagiarism" but in relation to plagiarized ideas only, i.e. not related to writing, art work, drawing etc.


today I was reading a book and I read the following sentence: "But as he was speaking, step by step everything was shown to me." I would like to understand why is it written as Shown (past participle) and not as Showed (past simple). Thx!

I need advice on the best use of the verb show.  When do you use showed? I find myself substituting has shown, even when I meant to use the preterit in my sentence.  I prefer "she has shown" over "she has showed"; are there differences in phrasal verbs, such as "show up" or "show out"?  Do you ever use "shew" and its family?


In light of the recent changes to the question close-vote system, which comes along with a drive to change the attitude/thought process behind the votes, a "cancel hold vote" option makes a lot of sense to me.  The case for and against it has been made in the past (), and apparently the conclusion was "this is not a bad idea". However, this discussion took place several years ago and the intent to implement seems to have fallen by the wayside, plus this discussion was outside the context of the recent change in language from "closed" to "on hold".  These recent changes make the cancellation of hold votes more important; the implication is that we want to emphasize to the asker that they ought to come back and edit their question to get it re-opened (that has, in fact, always been the goal). What if they do so immediately?  If I am voting to place a question "on hold", I will usually leave a comment regarding my decision and motive. Occasionally, my comment will prompt the OP to make improvements to his/her question before the 5 required votes were cast. I can and should retract my close vote if/when the OP satisfied the objections that drove me to cast the vote in the first place.  This saves reviewer time, since it is now dropped from the queue, and it reinforces to the OP that votes to hold are not a death sentence for their inquiry. That isn't to say it won't make it back on the chopping block, but if I challenge and then am mollified, I should be able to indicate that.

Sometimes you vote to close something and the OP then changes it to fix the issue or issues. You can't take a close vote back though. It would be nice if you could.    With the new Duplicate close changes and the review queues, it's even more important to be able to remove accidental or erroneous close votes: close votes now place a banner on the question (for dupes) or put the question into a queue for other users to look over.  An easy "undo" button could save a bunch of people some time and grief for these accidental/no longer desired close votes.


Tuition can easily get in the tens (if not hundreds) of thousands of dollars for a 4-year degree. This is unarguably many times over what the university needs to cover the costs of offering their services. Why is this the case if they are usually run under a non-profit architecture?  Where is all this money going?

Where is the money going to?   How can it be that interested students pay so much, but many academic salaries are so low (excluding the obvious full professor in a field where the industry pays for getting research results, like IT).


Where can I ask questions about which laptop to purchase?   I need help to choose between two laptop brands; is there a Stack Exchange site for these type of questions?

Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.


I had developed a tool by using C# (ArcObjects) and I want to (import that customized DLL and) call a particular function from that class by using ArcPy.  How can I achieve this?

I would like to be able to script some things that are not exposed via arcgisscripting or ArcPy.   How do I access  from Python?


I have been studying Blender on and off for a couple of months but I feel like I always hit a roadblock. I wanna start from the beginning(kind of). Can someone give me a routine they used to study or a roadmap which I can follow or just which concepts I should first(again)?

Since asking for tutorials, videos, resources, links to other content or downloads is considered off topic here, this is a specifically created Community Wiki which gathers resources for Blender and it has been approved by the .  Just write in the appropriate answer/section. If you have concerns, questions, post a  question, so we don't clutter the comments, but you can link your meta question from the comments.  Questions regarding such resources are not allowed anymore, except for very specific and on topic requests (ask on  if you're unsure about your question). Follow the instructions made in the question about how to post, what can be posted, etc.  Learning             Assets    (also see: )   Reference Images/Blueprints (also see: )    Tools    (also see: )      Other   Special Interest ()     Also see the .


It's like this:  ---- Minecraft Crash Report ---- // My bad.  Time: 7/22/17 1:49 PM Description: Initializing game  org.lwjgl.LWJGLException: Pixel format not accelerated     at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)     at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)     at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:247)     at org.lwjgl.opengl.Display.createWindow(Display.java:306)     at org.lwjgl.opengl.Display.create(Display.java:848)     at org.lwjgl.opengl.Display.create(Display.java:757)     at org.lwjgl.opengl.Display.create(Display.java:739)     at bhz.at(SourceFile:635)     at bhz.aq(SourceFile:458)     at bhz.a(SourceFile:404)     at net.minecraft.client.main.Main.main(SourceFile:123)   A detailed walkthrough of the error, its code path and all known details is as follows: ---------------------------------------------------------------------------------------  -- Head -- Thread: Client thread Stacktrace:     at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)     at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)     at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:247)     at org.lwjgl.opengl.Display.createWindow(Display.java:306)     at org.lwjgl.opengl.Display.create(Display.java:848)     at org.lwjgl.opengl.Display.create(Display.java:757)     at org.lwjgl.opengl.Display.create(Display.java:739)     at bhz.at(SourceFile:635)     at bhz.aq(SourceFile:458)  -- Initialization -- Details: Stacktrace:     at bhz.a(SourceFile:404)     at net.minecraft.client.main.Main.main(SourceFile:123)  -- System Details -- Details:     Minecraft Version: 1.12     Operating System: Windows 10 (x86) version 10.0     Java Version: 1.8.0_141, Oracle Corporation     Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation     Memory: 48543712 bytes (46 MB) / 151007232 bytes (144 MB) up to 523501568 bytes (499 MB)     JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx512M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     Launched Version: 1.12     LWJGL: 2.9.4     OpenGL: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.     GL Caps:      Using VBOs: Yes     Is Modded: Probably not. Jar signature remains and client brand is untouched.     Type: Client (map_client.txt)     Resource Packs:      Current Language: ~~ERROR~~ NullPointerException: null     Profiler Position: N/A (disabled)     CPU: <unknown>

Similar to  on the bugs in Minecraft, I would like a complete list of what error codes exist in Minecraft and how they occur, as well as how they can be resolved.


Why would a cuboid with seams as shown unwrap as a cube? I eventually found one tutorial example of a cuboid rather than a cube being unwrapped. Its result as illustrated in the article was as expected but in 20 attempts I could only reproduce it once. All the other attempts with different seams, different unwraps, renders etc produced a cube's unwrap.

I'm having problems using the UV mapping in blender 2.67. Specifically, I am trying to unwrap a really simple mesh, but the UV map is still giving me a net where some of the boxes are completely out of proportion to the others, which causes the texture to stretch horribly. Here is a picture to illustrate:    The mesh only has those three faces you can see in the picture, and the single seam on the front corner. It's a trivially simple mesh, so I really don't understand why the two side faces are being stretched in the UV map to be the same size as the top face. I've tried clicking the average islands scale button as suggested by some of the answers to other questions but that has no effect. It's frustrating because it seems so simple.  Hopefully someone can show me the presumably simple mistake I am making!  Edit: Just to make this clearer, I have already added a seam as the first answer suggests i do. Hopefully this picture will make that clearer, the yellow arrow is pointing to the edge i seamed. The mesh is only three faces so should only need this single seam. The image shows the mesh from infront and behind/underneath so it should make more sense.    Double Edit: One more picture for clarity on the seam issue. The mesh is unfolding correctly, it is just the scale of the unfolded map that is incorrect (in relation to one another)


How can I get line numbers to appear automatically each time I call vim? I know ":set number" works interactively and I tried to put it in .bashrc, but it didn't work.

I know that from inside vim the command to display line numbers is :set number.  Is it possible to invoke vim so that line numbers are shown from the beginning?


A research paper from a computer vision conference I made was published in IEEE Xplore, but also in some other places (where it is open).  Can I publish it to arXiv?

Having a paper accepted at an IEEE conference I would like to upload it to ArXiv. From the :     Can an author post his manuscript on a preprint server such as ArXiv?   Yes. The IEEE recognizes that many authors share their unpublished   manuscripts on public sites. Once manuscripts have been accepted for   publication by IEEE, an author is required to post an IEEE copyright   notice on his preprint. Upon publication, the author must replace the   preprint with either 1) the full citation to the IEEE work with   Digital Object Identifiers (DOI) or a link to the paper’s abstract in   IEEE Xplore, or 2) the accepted version only (not the IEEEpublished   version), including the IEEE copyright notice and full citation, with   a link to the final, published paper in IEEE Xplore.   I am not quite sure what this exactly means. I have the latex source for the document I submitted to the conference. What modifications do I have to make in detail?  Do I have to add an extra page with "IEEE copyright notice and full citation, with a link to the final, published paper in IEEE Xplore". Where can I find the IEEE copyright notice?  I suppose I am not allowed to change any of the content, but what about the template? Do I have to use the format I submitted to the conference?


When trying to access ~/.bash_profile from Ubuntu Xenial (16.04) in Windows Subsystem for Linux I get the following error:   -bash: /home/<username>/.bash_profile: No such file or directory   Where is it located and how do I edit it?  Thank you!

I want to put new aliases to my .bash_profile file, but I cannot find this file. Where is it supposed to be?


how can i convert 2016/02/12 09:00 PM format date and time to Unix timestamp.Thanks in advance

How do I get timestamp from e.g. 22-09-2008?


Why should moderators' user cards show a diamond (♦) when they post a question or answer or comment?  I don't mean "why do they" -- the answer to which is, "because they're moderators" -- but why should they, i.e. why is that a good thing, and isn't it a bad thing i.e. a source of confusion and noise?  Aren't moderators simply like other users, not especially authoritative about the suject matter?  Instead why isn't the ("official") diamond shown:   Always-but-only on Meta (not on the main site) Never in Qs and As on the main site Only sometimes i.e. optionally in comments on the main site, i.e. when posting an official comment in their capacity as moderator, rather than e.g. posting a comment about content as any other user might?     Disclosure: I am a site moderator of a small site.

As per the , this FAQ will serve the following purposes:  To be the canonical reference for moderators across the Stack Exchange sites for things that are beyond question (typically, "how" questions) For situations that a moderator will face, provide information to help understand the nuances of that situation, so that the moderator can make best possible decision that is in the interest of their Stack Exchange site and Stack Exchange in general (typically, "when" questions) To bring new moderators on sites (pro tempore or elected) up to speed quicker.  Essential Reading       Tools             Post content                Voting to Close     Comment flags    Profile content     Abuse     Post notices    Chat       People      Miscellaneous


Consider a test mass starting at rest from radius R to a point planet of mass M. What is the time taken for the test mass to reach the planet?  I saw somewhere on the internet (don't ask where please :|) that one can simply use Kepler's law in this situation - i.e. time taken is simply 1/4 of the period of an elliptical orbit with half-major axis length R:  $$ T = \frac{\pi}{2}\sqrt{\frac{R^3}{GM}}$$  BUT if I manually integrate the kinetic energy equation,  $$ \frac{1}{2}\dot{r}^2 = GM\left(\frac{1}{r} - \frac{1}{R}\right) $$ $$ \rightarrow T\sqrt{2GM} = \int^{R}_{0}{\frac{\mathrm{d}r}{\sqrt{\frac{1}{r} - \frac{1}{R}}}}$$ $$ = \space...\space = R\int^{R}_0{\sqrt{\frac{1}{r} - \frac{1}{R}}\space\mathrm{d}r} = \space... \space = R\int^{\infty}_0{\frac{2u^2\space\mathrm{d}u}{\left(u^2+\frac{1}{R}\right)^2}} $$ $$ = \space...\space = R\int^{\infty}_0{\frac{\mathrm{d}u}{u^2+\frac{1}{R}}} = \frac{\pi}{2}R^{\frac{3}{2}}\space \therefore \space T = \pi\sqrt{\frac{R^3}{8GM}}$$  Why is there a $\sqrt{2}$ factor discrepancy? Is it because Kepler's law is invalid when the minor axis length is zero? Thanks for any insight.

My friend and I have been wracking our heads with this one for the past 3 hours... We have 2 point masses, $m$ and $M$ in a perfect world separated by radius r.  Starting from rest, they both begin to accelerate towards each other. So we have the gravitational force between them as:  $$F_g ~=~ G\frac{Mm}{r^2}$$  How do we find out at what time they will collide?  What we're having trouble with is this function being a function of $r$, but I have suspected it as actually a function of $t$ due to the units of $G$ being $N(m/kg)^2$.  I've tried taking a number of integrals, which haven't really yielded anything useful.  Any guidance?  No, this is not an actual homework problem, we're just 2 math/physics/computer people who are very bored at work :)


Just a question mostly!  Using JsplitPane, can you display multiple different GUI's including jext fields, file openers, buttons etc dependant on which button is selected?  Example:  Jsplitpane Left component, 3 buttons, gui1  gui2 and gui3  jspltpane right component,  if gui1 is slected, then display gui1, etc.  Reasoning- I have multiple different programs i wish to compile into one program, preferably using jsplitpane as a means to selecting which tool to use.  code so far: created a basic jsplit pane with left and right components (jpanel)  In left component added multiple buttons with action listeners.  In right component, can add buttons labels etc, but how can i assign those buttons/labels to only display if "gui1 " is pressed, and other buttons/labels if "gui2" is pressed.  Thanks!!  fyi, this code is within a jtabbedpane to avoid confusion. gbcjp4 is for the tabbed pane and gbctsp is for the split pane within.      //Create the tool selection pane.     JPanel toolselectionPane = new JPanel();     toolselectionPane.setLayout(new GridBagLayout());     GridBagConstraints gbctsp = new GridBagConstraints();     gbctsp.insets = new Insets(5, 5, 5, 5);     gbctsp.fill = GridBagConstraints.BOTH;       JScrollPane toolselectionView = new JScrollPane(toolselectionPane);      //Add the scroll panes to a split pane.     JSplitPane tsplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);     tsplitPane.setLeftComponent(toolselectionView);     tsplitPane.setRightComponent(toolView);     tsplitPane.setDividerLocation(150);      tsplitPane.setPreferredSize(new Dimension(700, 600));      //Add the split pane     gbcjp4.gridx = 0;     gbcjp4.gridy = 1;     gbcjp4.anchor = GridBagConstraints.EAST;         jp4.add(tsplitPane,gbcjp4);        //LEFT SIDE TOOLS SPLIT PANE      gbctsp.gridx = 0;     gbctsp.gridy = 0;     toolselectionPane.add(SaveEvidencebtn,gbctsp);       gbctsp.gridx = 0;     gbctsp.gridy = 1;     toolselectionPane.add(hashingbtn,gbctsp);      //RIGHT SIDE TOOLS SPLIT PANE     //buttons etc here depending which button is selected.

To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action.  So, what's the correct way of doing such a thing? I've tried  panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();   but this won't work. What would you suggest?


I cannot see any files on my external hard drive after using on TV. I have already posted details in  post. I can repair some files using recovery software, but I would like to know a reason of this behavior and I don't wish to recover all files every time after using TV. Please, help me.

I have HDD with a lot of video files. Usually I connect my HDD with TV to watch videos. Today I've connected the drive to my PC and noticed some hidden files, but nothing related to video. The files are:   $RECYCLE.BIN  System Volume Information (32KB) .mediaDB_3495978201.db (19KB)   In explorer I see that 159GB free of 596GB. How can I found hidden video files and recover it?  I have added screen with broken drive G.


From what I know, initalizing a variable is when you set a value to it. For example:  String s;        // declaring the String (throws an error if you use in conditionals) String s = null; // declaring and then initializing the String (no error)   However, when a String is declared, isn't it automatically initialized to null? Therefore, the compiler shouldn't throw an error.  I also noticed that String s = new String(); does not produce any errors when used with conditionals but String s; does. I thought these two statements were essentially the same thing and the latter was even encouraged over the former.  My questions are, why does String s = new String(); work but not String s; (when using conditionals to set their value)? Shouldn't both strings be automatically initalized to null, therefore not causing an error?  Bonus question: Since String objects are automatically initialized to null, why does the following code print an empty String?  String s  = new String(); System.out.println(s);   EDIT: Apparently I don't think straight when I'm tired. This whole question is a mess, I have no idea what I was thinking. Apologies to those who had to try and understand it.  Also, the on default values:     Local variables are slightly different; the compiler never assigns a default value to an uninitialized local variable. If you cannot initialize your local variable where it is declared, make sure to assign it a value before you attempt to use it. Accessing an uninitialized local variable will result in a compile-time error.   Which answers the above question.

Consider this:  public class TestClass {      private String a;     private String b;      public TestClass()     {     a = "initialized";     }      public void doSomething()     {     String c;          a.notify(); // This is fine     b.notify(); // This is fine - but will end in an exception     c.notify(); // "Local variable c may not have been initialised"     }  }   I don't get it. "b" is never initialized but will give the same run-time error as "c", which is a compile-time error. Why the difference between local variables and members?  Edit: making the members private was my initial intention, and the question still stands...


I am planning to build a desk that is nearly 12 feet wide to support 3 computers. There will be two cabinets on both ends, and if possible I would prefer to not need a 3rd cabinet or post in the middle to support it from sagging. Below is a picture similar to what I would like to accomplish.  What techniques could I use to strengthen the top of the desk?

I'm currently about to embark on redeveloping my home office.  We have a room with a small alcove and want to mount a desk top inside it. The approx size is 220cm x 80cm   We can source the wood we want no problem and are considering a hard wood with a nice finish that is around  8cm thick (2inches)  I want the desk to be as free floating as possible with the obvious exception of mounting at the rear and sides into the wall.  The left side wall is plaster into brick, the rear and right side wall are plasterboard with cavity behind .  My question is what is the best way to mount the desk without having to put in a strengthening leg in the centre?  Thanks for your help :)


I have a weird problem, so my instructor told us to create a simple program using vectors that will first ask the user how many integers they want to enter, and after the numbers were entered via a space as a delimiter the output should add 2 to each vector element.  Ex -   How many numbers are you going to enter = 4 (Lets assume the user enters 4)       Enter the numbers = 11 45 71 24 (Lets assume the user entered these 4 numbers)  THE OUTPUT SHOULD BE THIS = 13 47 73 26 (with spaces added 2)   Since using vectors is a must, i know how to add add 2 with a normal integer vector output but when it comes with spaces i have no idea, so far the program i wrote will accept everything before the space into the vector and will add 2 to it.   #include <iostream> #include <vector> #include <algorithm> using namespace std;  int main() {     vector <int> userInput;     int input;     int number;     int num1;     cout << "How many numbers are you going to enter ? :";     cin >> number;     cout << "Enter the Numbers : " << endl;     cin >> input;      userInput.push_back(input);     cout << "Vector Contains : ";     for (unsigned int i = 0; i < userInput.size(); i++)     {         cout << userInput[i] + 2;     }        system("pause>nul");     return 0; }

I'm trying to iterate over the words of a string.  The string can be assumed to be composed of words separated by whitespace.  Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.  The best solution I have right now is:  #include <iostream> #include <sstream> #include <string>  using namespace std;  int main() {     string s = "Somewhere down the road";     istringstream iss(s);      do     {         string subs;         iss >> subs;         cout << "Substring: " << subs << endl;     } while (iss); }   Is there a more elegant way to do this?


How to prove following statements in the simplest way: $$ \sin(x)=x\prod\limits_{n = 1}^{\infty}\Big(1-\frac{x^2}{\pi^2n^2}\Big),\quad \cos(x)=\prod\limits_{n = 1}^{\infty}\Big(1-\frac{4x^2}{\pi^2(2n-1)^2}\Big). $$ We are learning infinite products, but the teacher just gave it to us without proof. I`ve read  and that material is too hard to understand(i mean Weierstrass factorization theorem, as proof follows from it). Is there any simpler way?

How to prove the following product? $$\frac{\sin(x)}{x}= \left(1+\frac{x}{\pi}\right) \left(1-\frac{x}{\pi}\right) \left(1+\frac{x}{2\pi}\right) \left(1-\frac{x}{2\pi}\right) \left(1+\frac{x}{3\pi}\right) \left(1-\frac{x}{3\pi}\right)\cdots$$


List<Integer> intList = new List<Integer>(); intList.add(11); intList.add(12); intList.add(13); intList.add(14); while(intList.iterator().hasNext()){  }   why is the CPU time limit exceeding here ?

Why this code isn't working? In my mind the next() method should move the cursor for the next item of the list...  List<string> listX = new List<String> {'A','B','C'}; while(listX.iterator().hasNext())     system.debug(listX.iterator().next());   When I try to run it I receive a error message of exceed a governor limit of CPU time. It's happend because the next() method doesn't move the cursor for the next list item. Every time returns "A".


If you abuse your lens by just stacking a bunch of extension rings one on top of the other, will this start to affect your image circle?  For instance, you have a lens that can just about cover your sensor with the image circle and you add a bunch of extension rings to focus up-close. Will the image circle start to show on your sensor or will it even widen? Or does it even matter?  Also, is it possible to express this relationship mathematically or does it depend on internal lens design too much?  Note: I ask about focused images, so I assume you still can focus on the object with all the extensions.

I am a beginner in this topic, so I dont know if it is possible what I try to do.  First of all, I have the following HF35HA-1B lens:   It says the maximum sensor size is 2/3", but I have a non-standard 25mmx25mm image sensor, so I want to do some hackings. I know the flange focal distance of Cmount lenses is 17.526mm, but what if I move the image sensor further back from the lens? I suppose the further I go from the lens, the bigger image I get. But how can I calculate the radius of the image circle? I did a very easy test, in which I could make sure that even if I move the sensor back the image is focused for closer objects, so I think that is not an issue. But I would like to calculate the image circle to make sure the image sensor is in the image circle. Is it even possible what I am trying?:)  I would appreciate any comments!


So I'm trying to make a villager that would sell items to a player in a server. I was doing well until I messed up my brackets, and now I don't know what to do.  This is the command:  /summon Villager ~1 ~ ~ {Profession:2,CustomName:"Apollos",CustomNameVisible:1,Career:1,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,NoAI:1,Invulnerable:1,Attributes:[{Name:"generic.knockbackResistance",Base:"1f"},{Name:"generic.movementSpeed",Base:"0f"},{Name:"generic.maxHealth",Base:99999}],Offers:{Recipes:[{buy:{id:"diamond_block",Count:12},buyB:{id:"diamond",Count:5},maxUses:9999999999,sell:{id:"dragon_egg",Count:1,tag:{display:{Name:"&c&lDragon Egg",Lore:["Used in shops","It is a currency"]},rewardExp:false},{buy:{id:"dragon_egg",Count:1,tag:{display:{Name:"&c&lDragon Egg",Lore:["Used in shops","It is a currency"]},maxUses:9999999999,sell:{id:"diamond_block",Count:8},rewardExp:false},{buy:{id:"nether_star",Count:4},maxUses:9999999999,sell:{id:"dragon_egg",Count:1,tag:{display:{Name:"&c&lDragon Egg",Lore:["Used in shops","It is a currency"]},rewardExp:false},{buy:{id:"obsidian",Count:64},maxUses:9999999999,sell:{id:"nether_star",Count:1},rewardExp:false},{buy:{id:"obsidian",Count:64},buyB:{id:"obsidian",Count:64},maxUses:9999999999,sell:{id:"fire_charge",Count:1,tag:{display:{Name:"&c&lEmber",Lore:["Used in shops","It is a currency"]},rewardExp:false},{buy:{id:"fire_charge",Count:2,tag:{display:{Name:"&c&lEmber",Lore:["Used in shops","It is a currency"]},maxUses:9999999999,sell:{id:"dragon_egg",Count:1,tag:{display:{Name:"&c&lDragon Egg",Lore:["Used in shops","It is a currency"]},rewardExp:false},{buy:{id:"dragon_egg",Count:1,tag:{display:{Name:"&c&lDragon Egg",Lore:["Used in shops","It is a currency"]},maxUses:9999999999,sell:{id:"fire_charge",Count:2,tag:{display:{Name:"&c&lEmber",Lore:["Used in shops","It is a currency"]},rewardExp:false}]}}   The error that I'm getting is:     Data tag parsing failed: Expected non-empty key at: ... is a currency"]},rewardExp:false},<--[HERE]]

Often, when making a command block contraption, you need to set an entity's data tag. These tags can sometimes be very long, with many layers of nested curly and square brackets. For example, this is the command to summon a villager with a single custom trade:  /summon Villager ~ ~ ~ {Profession:3,Career:2,Offers:{Recipes:[{buy:{id:minecraft:diamond,Count:6b}},sell:{id:minecraft:diamond_hoe,tag:{ench:[{id:16s,lvl:10s}]}]}}   The single-line command block interface of Minecraft makes it incredibly difficult to find and fix errors, especially when it comes to mismatched brackets. In fact, for illustration purposes, I put an error in the above command.  What techniques can I use to find and fix unbalanced square or curly brackets when writing long and complicated data tags?


Have a look at . The profile picture is overflowing.    While his  looks fine. Please fix this.

strikes . This time it's:    Link to the original profile picture:  I noticed it can be fixed by changing the image source from http://graph.facebook.com/{id}/picture?type=large to http://graph.facebook.com/{id}/picture?type=normal. (or enforce maximum width in the CSS itself) Edit: now the image height is constrained to 128 pixels, so when the width is bigger than the height and both more than 128 pixels, it leads to something like this: ()


Is there any way to determine if a function is periodic or not from the taylor series expression of it?  Elementarily,it can be easily argued that the series must be an alternating one,but that does not guarantee it's periodicity.Is there any trick?

Given the Taylor series $\sum a_k (x - x_0)^k$ of an analytic function, it is possible to determine whether the function is periodic more-or-less directly from the coefficients $a_0, a_1, \ldots$ of the series (equivalently, the derivatives $f'(x_0), f''(x_0), \ldots$ of $f$ at $x_0$)?  (For simplicity, I'm happy to restrict if necessary to the case that the series converges on all of $\mathbb{R}$. Note too that it's no real loss of generality to take $x_0 = 0$.)  (This was motivated by .)


After posting an answer, I noticed this alignment issue:        Browser: Google Chrome  As you see, the word "ok" on top-right is out of range. Can this please be fixed?

The 'ok' on the 'Your Answer' dialog on unregistered sites is a bit too high:     You can see the top of the k is outside the actual box, increasing the margin-top by 10px in the containing div fixes it.


How to get the current quarter start date and no. of days in the current quarter

wanted to get end date for Current Fiscal Quarter in apex any ideas, how to get this information.


mklink /d link_folder target_folder    How to add link_folder to Windows 10 Explorer quick access list? Now if you drag it to quick access, the added folder point to target_folder .

Scenario:   Create SymLink: C:\Data\workspaces --> C:\Users\****\Documents\workspaces Navigate to C:\Data\Workspaces in explorer Click and drag the the path from the address bar onto "Quick Access" in the navigation pane.   Expected Result:   Clicking on the shortcut takes you to C:\Data\workspaces   Actual Result:   Clicking on the shortcut takes you to C:\Users\****\Documents\workspaces   How do you make it so that the shortcut points to the correct path. (the SymLink)  Command Used to create the SymLink:  mklink /D C:\Data\workspaces C:\Users\****\Documents\workspaces   Updated with pictures:  Please note the workspaces symlink inside C:\Data:    When I double-click on the symlink it works correctly. (note the address bar.    When i pin it to the Quick access bar, however, it uses the address that the symlink points to and NOT the symlink address.


I didn't read the books (obviously), so I am kind of confused. Do Men live that long in Tolkien's world? I know Gandalf is supposedly an old-timer as well, but he's a wizard so it kind of doesn't count :D

In the extended version of The Two Towers, Aragorn says to Eowyn that he is 88 years old. He said it was due to his royal lineage or something like that.  I did not remember that fact from the books, but it's been a while since I last read them. Anyway, how is it that being the heir of Isildur grants him such a long life?


I installed Ubuntu for the first time. I am very happy with it.  My question is How can I erase Windows XP from my Hard drive and just keep Ubuntu?  I Finally had success with the direct download to my hard drive after several failures on DVD and Cd's I would like to totally get rid of XP.!

I installed Ubuntu in the dual-boot configuration so that I can still boot up in Windows. But I just want to get Windows off of the machine.  Anyone know how to do this without having to go through another Ubuntu install? Also are all of the Ubuntu updates safe to take? Does Ubuntu have restore points in case something goes haywire from the updates?


is it possible to wrap a text inside a triangle like the following image?

How do I confine text within a shape such as a circle or triangle?  I don't want text along the perimeter, I would like it to break appropriately at all the inner edges.


Is "...not legal advice, nor is it intended to be" the proper usage of "nor" in the prior partial statement?

This is the classic usage of neither/nor:     I would neither hide nor run away.   But is the following construction grammatical? (More than two choices, no neither)     I wasn't going to play dead.   I wasn't going to hide.   Nor was I going to run away.


Lets say i want to print 3 lines and a number next to each separated with 3 tabs and the output seems like this:   this is a line          3 this is a medium line           3 this is a very long line            3   ok all these lines are separated with the "3" number with 3 tabs. Is there any way to make all the "3" numbers appear the one below the other like this? :   this is a line                  3 this is a medium line           3 this is a very long line        3

As the title says, is there an easy way to output two columns to the console in Java?  I'm aware of \t, but I haven't found a way to space based on a specific column when using printf.


My server is having a problem with high cpu usage and 503 error occured all the time for a certain domain which is being hosted on my server together with other websites. The other websites on the same server are working fine. The problem only happens to this domain with the folllowing error:  [Sat Sep 26 12:15:08.831092 2015] [fcgid:warn] [pid 7760:tid 140509674608384] [client 5.157.42.89:44960] mod_fcgid: can't apply process slot for /usr/local/safe-bin/fcgid55.sh /usr/local/directadmin/data/users/aaa/php/aaa.com.ini -d sendmail_from="aaa@aaa.com" -d open_basedir="/home/aaa/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php55/lib/php/" -d mail.log="/home/aaa/.php/php-mail.log", referer: http://aaa.com/   And got around 7-10 process pids @ 100% cpu usage with the same commandline:  /usr/local/php55/bin/php-cgi55 -d sendmail_from="aaa@aaa.com" -d open_basedir="/home/aaa/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php55/lib/php/" -d mail.log="/home/aaa/.php/php-mail.log"   My server is on Centos 6. Directadmin. Nginx with Apache 2.4.16. Php 5.5.

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


as according to special relativity the relative speed is $u'=\frac{(u-v)}{1-(uv)/c^2}=\frac{0}{0}$ because $v=c$ the speed of second photon with respect to any inertial observer and $u=c$ speed of first photon with respect to same observer so $u'$ the speed of first with respect to second photon should also be $c$ according to second postulate of special relativity but how

Quite a few of the questions given on this site mention a photon in vacuum having a rest frame such as it having a zero mass in its rest frame. I find this contradictory since photons must travel at the speed of light in all frames according to special relativity.  Does a photon in vacuum have a rest frame?


I've never even been able to get Ubuntu to work . . . and I've tried multiple times. Current iteration: won't run as its own program (always wants to copy to a disc), won't copy to a disc (speaking of Ubuntu glitches, the file is TOO BIG FOR A DISC), and if I zip file it, it fits on a disc but won't run. Yes, the Windows tax is  a necessary evil.

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


I have a computer with Arch linux. I want to know which desktop environment is installed.   My ultimate goal would be to install Gnome. Is it possible to have two desktop environments.

I am writing a bash script that needs to know which desktop environment (XFCE, Unity, KDE, LXDE, Mate, Cinnamon, GNOME2, GNOME3,... ) is running.  How can I obtain that information?


I do not like the youtube link showing how to do a grid in photoshop.  It is really archaic, drawing line by line etc etc. I have a portrait that I need to draw grid over.  Is there a simple way in Photoshop CC?

Suppose I need to draw a grid in Photoshop, each square being the same size, and a certain amount of pixels tall and wide, and the grid lines having a certain pixel width. Like this:     Currently I do this by drawing one square, copy+pasting+moving+merging it a few times to create one row, copy/pasting that a few times to create more rows above each other.  It works, but feels very clumsy, I'm sure there ought to be a more efficient way to do this?  What are some efficient methods for creating a grid of equally sized squares?


I was wondering about the minimal polynomial of real number $$u=\sqrt[3]{2+\sqrt{5}}+\sqrt[3]{2-\sqrt{5}}$$ over field $\mathbb{Q}$.  As you can see , I worked out that $u$ is a root of monic rational polynomial $x^3+3x-4$. This is not irreducible: $$x^3+3x-4=\left(x-1\right)\left(x^2+x+4\right)$$ and the second, quadratic, factor has complex roots $\frac{-1\pm i\sqrt{15}}{2}$.  Can I claim that the minimal polynomial of $u$ over $\mathbb{Q}$ is $x-1$?  In other words: does this prove that $\sqrt[3]{2+\sqrt{5}}+\sqrt[3]{2-\sqrt{5}}=1$?  In case it does, how can we demonstrate $u=1$ working on the roots in a way different from how I did in the link?  Edit:  $\sqrt[3]{2-\sqrt{5}}$ is meant to be the real cube root of $2-\sqrt{5}$.

We have $$ \sqrt[3]{2 +\sqrt{5}} + \sqrt[3]{2-\sqrt{5}} = 1 $$  Is there any way we can get this results through algebraic manipulations rather than just plugging it into a calculator?  Of course, $(2 +\sqrt{5}) + (2-\sqrt{5}) = 4 $, maybe this can in some way help?


I suspect the cause might be the naming conventions of the arms, but I'm not sure.  Here's a picture of the model and armature with names.

I have a problem with flipping pose, I try to do the same thing as in . On 3:25, he flips the pose by Ctrl+C, Ctrl+Shift+V. In my case, it only flips some rotations, but legs stay in the same place:    I did everything exactly like in this video. I've tried to changing from "ZYX Euler" to "Quaternion" (saw this in some other question here) but it didn't helped.  Here is my blend file:


As a python newbie, I have a dictionary d:  d={'a':{'1':4,'2':6},'b':{'1':5,'2':10}}   I need to find for each key ('a','b') the sub-key for the highest value and bundle them together in a new dictionary, newd, which looks like  newd={'a':'2', 'b':'2'}   what is the best way to achieve this?

I have a dictionary: keys are strings, values are integers.  Example:   stats = {'a':1000, 'b':3000, 'c': 100}   I'd like to get 'b' as an answer, since it's the key with a higher value.  I did the following, using an intermediate list with reversed key-value tuples:  inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1]   Is that one the better (or even more elegant) approach?


From Wikipedia:      Freeman Dyson showed that the imperviousness of solid matter is due to quantum degeneracy pressure rather than electrostatic repulsion as had been previously assumed.   Could someone expand or explain regarding this Wikipedia excerpt as it is, (like most of physics, unfortunately) , a complete surprise to me.  Two questions:   In simple terms, is it possible to show how Dyson demonstrated this? Does it eliminate the role of electrostatic repulsion in ordinary life, such as standing on the floor, or just supplement the electrostatic repulsion effect?   EDIT as noted in the comment below by John1024 The same wikipedia article also states: "At commonly encountered densities, this [degeneracy] pressure is so low that it can be neglected." So, standing on the floor is still an electrostatic effect   but I would still be interested in the derivation and at what densities it applies, presumably neutron star levels.  As dmckee lists below, there are possible duplicates, but unfortunately I don't follow them as well as another year of studying physics would allow me too.  They don't seem to contain, on first looking at least, a derivation of Dyson's conclusion or the density at which one effects supersedes the other.  It's a fascinating area of physics, imo, so any answers  (the simpler the better, although I have studied basic Degeneracy Pressure in neutron stars) to these questions would be greatly appreciated.   END EDIT

There is this famous example about the order difference between gravitational force and EM force. All the gravitational force of Earth is just countered by the electromagnetic force between the electrons on the surface of my feet and the ground.  But also wave-function of electrons(fermions) do not overlap each other due to Pauli exclusion principle.  So which one is the true reason of me not flopping inside the earth forever? Is it only one of them(my guess is Pauli exclusion) or is it both?


How would one attack a sum like this:  $$\lfloor 1 \cdot \sqrt{2} \rfloor + \lfloor 2 \cdot \sqrt{2} \rfloor + \lfloor 3 \cdot \sqrt{2} \rfloor + ... + \lfloor n \cdot \sqrt{2} \rfloor$$  or simply:  $$\sum_{i=1}^n\lfloor i \sqrt{2} \rfloor$$

[A001951 A Beatty sequence: a(n) = floor(n*sqrt(2)).][1]  If $n = 5$ then  $$\left\lfloor1\sqrt{2}\right\rfloor+ \left\lfloor2\sqrt{2}\right\rfloor + \left\lfloor3\sqrt{2}\right\rfloor +\left\lfloor4 \sqrt{2}\right\rfloor+ \left\lfloor5\sqrt{2}\right\rfloor = 1+2+4+5+7 = 19$$  Sequence from $1$ to $20$ is:  $S=\{1,2,4,5,7,8,9,11,12,14,15,16,18,19,21,22,24,25,26,28\}$  I want to find answer for $10^{100} n$?


but I don't quite understand it. Can someone explain how it works?  Example from the link:  public static void printPersonsWithinAgeRange(     List<Person> roster, int low, int high) {     for (Person p : roster) {         if (low <= p.getAge() && p.getAge() < high) {             p.printPerson();         }     } }   EDIT: question already answered here: .  EDIT 2: Oracle tutorial:

Consider:  List<String> someList = new ArrayList<String>(); // add "monkey", "donkey", "skeleton key" to someList     for (String item : someList) {     System.out.println(item); }   What would the equivalent for loop look like without using the for each syntax?


I have no idea what I did or hit to get the footer info I usually see (e.g. # tris, edges, vertices, faces per visible project meshes or actively-edited mesh) to disappear. The screenshot was taken from my current project's Object mode; it currently only shows my version number, and this change persisted even after rebooting Blender. How do I get the footer back?

Is there a way to get Statistic info in Blender? Or heads up display? Like when I select a group of vertices, I need a way to know how many vertices are selected and How many polygons "or triangles my scene has.


I often connect to my work computer from home via remote desktop over a vpn.  I have set the display settings in the connection to 1920 x 1080 (the max resolution of my laptop screen) but the window that opens up, though full screen, is a lower resolution.  I used to connect from this same laptop  at a lower resolution but upgraded the screen.  I have edited the connection in notepad and the height and width are specified there as 1080 and 1920 respectively.  I've also tried adjusting it on the connection settings before connecting and have tried setting as full screen but still always get the lower resolution. I am running Windows 10 Pro on both my laptop and work computer.

Problem: When I use remote desktop from a Surface Pro 4, running Win 10, to a Win7 or Win2003 system, the high dpi of the Surface results in the remote desktop being too tiny to see. In this case, the remote is the surface (with high resolution display), and the host is low (legacy 92 dpi) resolution display.  This issue is discussed and demonstrated  and   However, the problem I experience is the following:  Yes, there is the Zoom feature in the rdp client. However, when I use it, I lose the ability to go full screen on the client (to use all client real estate, and to get alt-tab and other keys passed up to host). After 30 min of use, I can say clearly that the zoom feature in the win10 RDP client is NOT useful for real work.  We made sure the Win7 hosts are already on Win7-SP1 with kb2923545 installed. This makes no difference that we can see.  I tried using Remote Desktop Connection Manager, , but it appears to lack the ability to give me a zoomed , full screen experience (perhaps I failed to find it, but I poked it a lot! There is a report that the current 2.7 version lacks the needed functionality, and that the older 2.2 version should work, but we did not find the 2.2 version for download).  So.... my old Vaio laptop is great for remote desktop, and my new Win10 Surface is, currently, unusable as a remote desktop remote client.  How do I get my new Surface as usable as the old Vaio?  Note: We are looking to use the Win10 Surface as a real rdp client to Win7, 2008 and Win2003 hosts. Right now, from all our work so far, this is simply a missing feature. (And we are suffering!)  Note: Please don't tell us to "log out and start a new session" on the host: This defeats the purpose, is not useful, and is a huge regression from the functionality we had before trying the Surface. Also, please don't tell us that only win10-win10 gives the right experience. We had a fine experience using legacy-dpi remote systems. The problem is the high-dpi surface.


I had this issue for over a month now, Searched the whole internet, tried using public dns settings, uninstalled my antivirus, disabled my firewall, tried opening the client as administrator, reinstalled once, tried using an ethernet cable instead of wifi.

There was an error logging into the game. Please try again. If the issue persists, please visit the League of Legends website for updates   what should I do now?


$query  = $this->db->prepare("INSERT INTO `images` (`anunt`, `image_location`) VALUES(?, ?)");          $query->bindValue(1, $iddd);         $query->bindValue(2, $image_location);           try{         $query->execute();   or this  $ret = sql_query("INSERT INTO images (anunt, image_location) VALUES ('" .$iddd. "', '" .$image_location. "')");   Or another way maybe? What advantages are with the bind one? I read something that it's hard to sql inject.

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?


How can I create an advanced addon for Blender 2.8x that is displayed in the n menu (right panel of the viewport) with multiple settings. What are the most important GUI scripts, how to add settings, how to access settings between multiple files, how to add icons, how to read the documentation to find lines of code?

I have a suite of several addons that I grouped together in a custom tab in Blender 2.7x, assigning the bl_category to the name of my custom suit:  class Panel1(bpy.types.Panel):  # Blender 2.7x     bl_label = "Panel 1"     bl_space_type = "VIEW_3D"     bl_region_type = "TOOLS"     bl_category = "MyToolSuite"   In Blender 2.80, I would like to group the tools together in a new properties tab.  How can I create a custom properties tab?  The following works to put my panel inside an already-existing tab, but does not work to create a new tab to hold all my panels:  class Panel1(bpy.types.Panel):     bl_label = "Panel 1"     bl_space_type = "PROPERTIES"     bl_region_type = "WINDOW"     # bl_context = "object"     # this puts my panel in the Object tab     bl_context = "MyToolSuite"  # this does nothing?   What else needs to be done to create a new tab in Blender 2.80?  Thanks!


I'm using MySQL (5.5.65-MariaDB) and have an application which consists of a table, generated_text_tbl. The following is some sample data from this table. ----------------------------------------------- id | substance_id | display_id | generated_text    ----------------------------------------------- 1  | 54           | 139        | foo ----------------------------------------------- 2  | 54           | 139        | bar ---------------------------------------------- 3  | 1933         | 139        | baz -----------------------------------------------   4  | 38           | 27         | xyz -----------------------------------------------  id is an AUTO_INCREMENT field. The substance_id and display_id are foreign keys which refer to records in other tables (substances.id and display.id respectively). I want to output the text from the generated_text field - separated with a HTML line break character (
) - if where matching substance_id and display_id rows exist. If there is no match (i.e. an individual row) then generated_text should still be output, but does not need the
 character since there is nothing to separate. I have a solution to this problem which works in PHP but I want a pure SQL solution if possible. I've written out the logic I have since this technically works, albeit in PHP. For the example data above the correct output would be as follows:  foo
bar : because there are 2 rows where the substance_id and display_id match (both are 54 and 139 respectively). baz : there is only 1 row WHERE substance_id = 1933 AND display_id = 139. xyz: same logic as above, there is only 1 row WHERE substance_id = 38 AND display_id = 27.  Logically my PHP script works like this:  All unique substance_id's are loaded into an array. Equivalent to SQL SELECT DISTINCT(substance_id) FROM generated_text_tbl.  All unique display_id's are loaded into an array. Equivalent to SQL SELECT DISTINCT(display_id) FROM generated_text_tbl.  Loop through (1) with an inner loop on (2). This effectively cycles through every substance_id and display_id combination, i.e.:  substance_id = 54 AND display_id = 139 (2 rows) substance_id = 54 AND display_id = 27 (0 rows) substance_id = 1933 AND display_id = 139 (1 row) substance_id = 1933 AND display_id = 27 (0 rows) substance_id = 38 AND display_id = 139 (0 rows) substance_id = 38 AND display_id = 27 (1 row)   It then obtains an array of generated_text based on the condition above. If the array size is greater than 1 element then a
 character is added between each. If it's just 1 element then a
 character isn't required because there is only 1 row of generated_text so nothing needs breaking up.  // Store the output text  $output = '';   // e.g. $result contains MySQL rows WHERE substance_id = 54 AND display_id = 139  if (sizeof($result) == 1) {      $output = $result['generated_text'];  } else {  foreach ($result as $key => $value) {      $output .= $value['generated_text'] . "
";  }      $output = (substr($output), 0, -4); // Remove trailing
  }   The result of var_dump($output) for the above script is foo
bar, which is what I want.   Although this logically works it is inefficient (when there are thousands of rows in the generated_text table). Is there a pure SQL solution to this?

Using MySQL, I can do something like:  SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;   My Output:  shopping fishing coding   but instead I just want 1 row, 1 col:  Expected Output:  shopping, fishing, coding   The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.  I've looked for a function on  and it doesn't look like the CONCAT or CONCAT_WS functions accept result sets.  So does anyone here know how to do this?


sudo dd if=/home/user/Downloads/windows10.iso of=/dev/sdb sync  I followed this method but when I plug in the pendrive to install windows 10  I  get an error " boot device not found insert cd/usb and click or enter...." What do I do?

When I tried to boot my PC into Windows 10 I got a screen with a sad face saying unmountable_boot_volume.  After searching it said I needed a Windows 10 USB or CD which I do not have.  I still have access to Kali Linux on my PC by booting up with my SSD.  How can I make a bootable Windows USB with a ISO in Kali Linux OS?


Email format is like : local_part @ domain_part.com          Local_part & domain_part should not begin or end with special characters ( @#&()*,./{}<>^%[]~`!$=\|;:? ) including hyphen (-)          Local_part & domain_part may contain above special characters like (#$%&*- etc) in middle only.           Limit of lengths for local_part is 64 & domain_part is 255 characters respectively.          domain_part must not contain all numbers

Is there a regular expression to validate an email address in JavaScript?


I submitted a journal paper to IEEE Transaction on Circuits and Systems for Video Technology on June 12th. Today, after 40 days, I checked its status and it went from "In Peer Review" to "Awaiting Recommendation". What does "Awaiting Recommendation" mean? Also, Considering that it usually takes the review process about 100 days to finish, should I expect the manuscript to be rejected?  Thanks

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


By same result I mean, if two elements are equal(), am I obliged to make them have same hashCode() as well? What can go wrong if I don't do that? First thing that came up to my mind is that 2 elements could be 'equal' in ArrayList, but not in HashSet. Is it bad practice to allow such behavior? And what problems could it make other than using contains() in them?

What issues / pitfalls must be considered when overriding equals and hashCode?


I am looking for an advice on a very lightweight local server or option for version of control of system administration changes.   We have few secure Ubuntu servers that are not on the network, but we want to track changes to the configuration and the modifications to the installed packages (e.g. install MongoDB, modify its configuration).  Does anyone have any recommendation for an agile, lightweight tool and approach to version control?

I would like to keep track of changes in /etc/  Basically I'd like to know if a file was changed, by yum update or by a user and roll it back if I don't like the chage. I thought of using a VCS like git, LVM or btrfs snapshots or a backup program for this.   What would you recommend?