I'm trying to make a program in which if you type in "open" to the java console it ends.  When I type in open, the if statement below doesn't run.              if(input=="open") {                 System.out.println("You escaped!!");                 break;             }   I've also tried .equals and it still doesn't work      if(input.equals("open")) {         System.out.println("You escaped!!");         break;     }   However when I print out input as shown below, the input is open.  This makes no sense because if the input was open, then the if statement above should have run.              else{                 //otherwise check what was written                 System.out.println(input);             }   Here is my full code:  class Password {     public static void main(String args[]) throws java.io.IOException {         //holds letters put in         char letter;          //holds full line of input         String input;           for(;;){             input="";              //makes the input equal what was inputed on the line             for(;;){                 //gets next char                 letter=(char) System.in.read(); //get a char                 //if the line hasn't ended then add that char to input                 if(letter!='\n'){                     input+=String.valueOf(letter);                 }else{                     //other wise line has ended so input is finished                     break;                 }             }             //if open was typed in then end the program             if(input.equals("open")) {                 System.out.println("You escaped!!");                 break;             }else{                 //otherwise check the input                 System.out.println(input);             }         }     }   }


What package brings an application to the system

Some application may installed with a bunch of packages. For example, vim can go along with packages: vim-gnome, vim-gtk, vim-nox etc. To uninstall application I need to define what is the exaxt package actually installed me an application. How to define it? I would like to get it via command line.     The answer for my question slightly differs from answers to :  $ dpkg -S "$(readlink -f `which vim`)"


Disparity in the equations of motion for a particle in a central field

Hello! I am considering the motion of particle in a central field and appear to derive inconsistent equations of motion when the Euler Lagrange equations are applied directly to (1) the Lagrangian  $L(r,\dot r, \dot \phi)$ and (2) when conservation of angular momentum is used eliminate $\dot \phi$ to write $L(r,\dot r)$:  Method 1: The Lagrangian for a particle in a central field is $$ L = \frac{1}{2}m\left(\dot r^2 + r^2 \dot \phi^2\right) - U(r)$$ Langrange's equation, ${\rm d}(\partial L/\partial \dot q)/{\rm d}t = \partial L/\partial q$, for $q=\phi$ yields conservation of ang. momentum:   \begin{align} &\frac{{\rm d}}{{\rm d}t}(mr^2\dot \phi) = 0 \quad \Rightarrow \quad  mr^2\dot \phi = \text{constant} = M (\text{say})\\ \end{align} Langrange's equation for $q=r$ becomes  \begin{align} m\ddot r = mr\dot \phi^2 - {\rm d}U/{\rm d}r = \frac{M^2}{mr^3} - {\rm d}U/{\rm d}r \end{align} where the second equality holds from conservation of ang. momentum.   Method 2: Now if we use conservation of ang. momentum $\dot \phi = M/(mr^2)$ to eliminate $\dot \phi$ from our original Lagrangian we have $$ L = \frac{1}{2}m\dot r^2 + \frac{M^2}{2mr^2} -U(r)$$  Lagrange's equation for $r$, ${\rm d}(\partial L/\partial \dot r)/{\rm d}t = \partial L/\partial r$, gives $$m\ddot r = -\frac{M^2}{mr^3} - {\rm d} U/{\rm d} r$$  Compare this to the radial momentum equation of method 1. Note the difference in sign of the term $M^2/(mr^3)$!!  Any ideas of how to resolve the disparity?  Resolution of Disparity. Ref:  in particular the answer by @Craig J Copi. Essentially when computing $\partial L/\partial r$ in method 2 one must remember that although $M$ is a constant of the motion ($\dot M = 0$) that $\partial M/\partial r = 2mr\dot \phi = 2M/r \neq 0$


A coworker insisted that this sentence was incorrect but I argued that it is correct. Here is the sentence in question:        There are potholes that need attended to right away on southbound I-75   near Dearborn Street.


Constructing a circle which is tangent to a line and circle and passes through a point.

I am trying to solve a geometry problem. as first step I am trying to construct it on Geogebra:  To complete the construction I need to draw a circle which passes through the point $O$ and is tangent to the line $AB$ and also tangent inside the circle which passes through $AB$ (the bigger circle). So the center of this circle is a point which has the same distance to the line and to the point $O$ and to the circle but I don't know how I can find this point.


\footnote reference doesn't jump to correct page

I have a footnote, and when I click the reference link in PDF, it jumps to the start of the document. It never shows up the page where the footnote is or should be.    code:  \footnote{\label{foot_note1}The above equations assumes the terms (2 NA) should be replaced by ${\text{NA}_{\text{condenser}}+\text{NA}_{\text{obj}}}$}


Standard cat concatenates files line by line (row by row, if you will). I find myself needing a horizontal cat command more and more often recently; i.e. a command that takes a list of files and concatenates them horizontally, column by column. So far I’ve used ad-hoc workarounds but I’d like to know if there exists a good solution for this.  To clarify, consider the following comparison between cat and hcat of two files:  $ cat a.dat 1.dat a b c d 1 2 3 4 $ hcat -s ' ' a.dat 1.dat a b 1 2 c d 3 4   (Unlike for cat we need to specify a separator since by convention UNIX files don’t have a column separator at the end.)


I want to start signal processing and I need a book that satisfies my mathematical requirements: I am in the third grade of high school and I don't know any useful thing about limit, differential, ...  Please help me.


How to write a word within some text using Latex

is it possible in latex to write a word within some text either by introducing a white figure and then wrapping the text around it or some other maybe more clever way. I want something like this, where I have tried using simple spacing to write "LA":  kesf kng k nrkeh ekrhgek elkrgn rkngel gnekgk bwngenw alsmf kanskgna  sakng ksng-   a kang nknga kakg me fw aklgn rgn ngsk  ks skgnd-  sl   nsgk dn ldgk nskgds l dskg nlsrgn l-  rkgngrn           nrlnr nrkn rllsngrgj  lfdnggnel rng-      ek   krgn kl   rkkf lrnmgl hfhj hj ksgks lrnglkrg negk lke kenler lkerng ke nrkle ngrle l   I believe this question is similar to the following .  however, in my case I am not interested in just any shape, but letters only. And I would like to be able to write any word of any length. Is there any tool out there that can do this task automatically instead of one having to define the length/shape of every letter.


How to prove that the closed unit ball in $\mathbb{R}^n$, with the subspace topology, is not a manifold?

Our definition of a manifold $M$ is a Hausdorff topological space such that for every $x \in M$, there exists a neighborhood $U_x$ that is homemorphic to $\mathbb{R}^m$ for some $m$. We define the closed unit ball in $\mathbb{R}^n$ to be the set $\{x \in \mathbb{R}^n \colon \|x\| \leq 1\}$.  The claim is that the closed unit ball is not a manifold. The open unit ball is clearly a manifold, so I assume that for every point $x$ on the boundary of the closed unit ball, none of the neighborhoods of $x$ are homemorphic to $\mathbb{R}$. However, I am having trouble doing so. I have tried proving this by contradiction by supposing such a homemorphism exists and showing there exists a topological property of $\mathbb{R}^n$ that the closed unit ball doesn't have.


I am running Ubuntu16.04  Upon executing  sudo wpa_passphrase DataRoom connect@data > /etc/wpa_supplicant.conf I get bash: /etc/wpa_supplicant.conf: Permission denied  Thanks for the help


What does Star Trek have against marriage and families?

Slightly tongue-in-cheek, but thinking about it I can't think of a single* main character in any of the Star Trek shows who is married with kids. And yet in the traditional Navy (and other armed forces) it's common-place. In TNG we even know Enterprise is bigger to hold families but they are 'civilians'.  *OK as I write this I think of some exceptions, but none are a full family unit:   Beverly Crusher obviously has a son... but is she married? Neelix has a normal family setup, for his species, but it is shown as a novelty due to so many differences to our norms Sisko has a son but again isn't he separated?   The main characters are typically not in their early twenties but mature, established officers. People who often would have families even though they might not feature in the show.  Are there any happily married Star Trek characters? It seems the only time characters have families or spouses, these are in some way dysfunctional or sources of strife, for the purposes of narrative.


Hard drive capacity on Windows server 2008 r2 not fully recognized

I am running Server 2008 release 2. I am almost out of hard drive space on the c partition. It is a 40 gig partition that is reporting 2.3 gig of free space. When I examine the properties of each folder size on this partition it adds up to about 28 gigs of used space. I can't determine why 10 gigs of capacity is not being recognized.  This system is using a PERC H700 raid adapter.


$x_{1}...x_{n}$ are independent continuous random variables with common distribution function $F(x)$,compute $E(F(x_{(n)})-F(x_{(1)}))$

$x_{1}...x_{n}$ are independent continuous random variables with common distribution function $F(x)$,consider the order statistics $(x_{(1)},...,x_{(n)})$, compute $E(F(x_{(n)})-F(x_{(1)}))$  I have no idea to this problem, anyone could help me? Thanks!


The expression $a^3+11a-6$ is always divisible by 6. I came across it while programming and ran it in a function in a calculator. Upon trying to solve it by myself, I found $a^3+11a-6$ is always even, as when $a^3$ is odd so is $11a$ and when $a^3$ is even so is $11a$, and odd+odd=even and even+even=even. Now, I tried to find if the number is divisible by $3$, but I couldn't. Can anyone help me out? Why should this expression always be divisible by $6$, we know it is but why? And is there a way to find if an expression is divisible by a certain number. Thanks for any help.


How can I avoid windswept muffins in a convection oven?

I have a very small multi-function oven (about the size of a microwave) and for baking, the recommended setting is the "convection" one.  Things bake fine in terms of taste, but muffins and cupcakes often get a sort of windswept look.  The fan has clearly blown them into a lopsided shape while they're rising, but before they've set.  With cupcakes, it's easy enough to trim them and hide it with icing, but not for muffins.  Is there any way to avoid this effect, other than trying to bake them on a setting without the convection fan?  Does this happen in larger convection ovens as well or is it just because mine is so small?


From , there are three interpretations of the degrees of freedom of a statistic:     In statistics, the number of degrees of freedom is the number of   values in the final calculation of a statistic that are free to vary.      Estimates of statistical parameters can be based upon different   amounts of information or data. The number of independent pieces of   information that go into the estimate of a parameter is called the   degrees of freedom (df). In general, the degrees of freedom of an   estimate of a parameter is equal to the number of independent scores   that go into the estimate minus the number of parameters used as   intermediate steps in the estimation of the parameter itself (which,   in sample variance, is one, since the sample mean is the only   intermediate step).      Mathematically, degrees of freedom is the dimension of the domain of a   random vector, or essentially the number of 'free' components: how   many components need to be known before the vector is fully   determined.   The bold words are what I don't quite understand. If possible, some mathematical formulations will help clarify the concept.  Also do the three interpretations agree with each other?


Possibility to Travelling together on returning

I am from Sri Lanka and my husband is staying in New Zealand. My husband (alone) wants to come to Sri Lanka  and pick my self and our son and return to New Zealand. We are planning for this trip between 19th and 30th December 2015.We have no visa issues. Anyhow my husband is required to buy a return air ticket for immigration purposes.  To enable three of us to depart Sri Lanka with seats together in the same flight  and in order to get the best deal pls tell, who should buy tickets? Is it my husband (from New Zealand) OR myself (from Sri Lanka)? In what way can we get best results?


In high school I was taught energy was conserved. Then I learned that nuclear reactions allow energy to be converted into mass. Then I also heard that apparently energy can spontaneously appear in quantum mechanics. So, are there any other caveats with the conservation of energy?


Likelihood Ratio Testing in Multinomial logistic regression using SPSS

I am doing multinomial logistic regression.  Dependent variable is categorical with 6 categories. 6 Independent variables are measured on an interval scale (included as covariates in SPSS)  Now I am watching the LR test. None of the independent variables have a $\chi^2$ value and no degrees of freedom are shown, so significance is not specified. (except for the constant, which is significant and has 5 df's). One variable is redundant in the parameter estimates.   When I omit the redundant IV in the model, there are $\chi^2$values, df's and significance values for the independent variables. Was the first model over-parametrised or something?  what is the explanation for this situation? And is it valid to omit one independent variable in the model?


How to loop through all the properties of a class?

I have a class.  Public Class Foo     Private _Name As String     Public Property Name() As String         Get             Return _Name         End Get         Set(ByVal value As String)             _Name = value         End Set     End Property      Private _Age As String     Public Property Age() As String         Get             Return _Age         End Get         Set(ByVal value As String)             _Age = value         End Set     End Property      Private _ContactNumber As String     Public Property ContactNumber() As String         Get             Return _ContactNumber         End Get         Set(ByVal value As String)             _ContactNumber = value         End Set     End Property   End Class   I want to loop through the properties of the above class. eg;  Public Sub DisplayAll(ByVal Someobject As Foo)     For Each _Property As something In Someobject.Properties         Console.WriteLine(_Property.Name & "=" & _Property.value)     Next End Sub


What is the mean of bijective is an open condition ? And why the Lie algebra of $Gl(V)$ can be identified with $gl(V)$ ?


Set different settings for different Wi-Fi networks

Can I set IP address manually on one Wi-Fi network and "Using DHCP" for another? So when I connect to the first one my mac uses static IP, when I connect to 2nd one - use DHCP.    Edit 1.    What I do all the time is. When I come at work I set DHCP for Wi-Fi. When I come home I set "manually" and specify IP, subnet mask, and router. I don't have problems with Proxies. I need to setup my Mac's IPs correctly.    Edit 2. Location works just fine.  Thanks to people in comments.


Calculating large Bell number modulo a composite number

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


Prove that $n(n^2 - 1)(n + 2)$ is divisible by $4$ for any integer $n$   I can not understand how to prove it. Please help me.


Quadratic equation sum from Russian book


Installing the latest Node.js / MongoDB?

How can I install Node.js and MongoDB so they are the most current versions?  The available versions from package manager are not up to date, and  for Node.js doesn't get updated on a regular basis.


Finding Windows 7 Product Key Before Reinstall

I got drafted into repairing a friend's laptop. He got a virus and after removing it the laptop would no longer boot into Windows. After banging my head against the wall for several days I've finally admitted that at this point a reinstall is the only option. I've already backed up most of his important stuff to an external using a Linux live cd.  Here's the issue: The laptop came with a recovery partition, which is unfortunately not working. So I burned a copy of the official Windows 7 install disk and want to use that. But the laptop is a few years old and the sticker on the bottom with the product key is illegible. To my knowledge the key isn't written down anywhere else, and I don't want to start the reinstall without being able to activate it.  So, is there any way to find the Windows product key without being able to read the sticker or boot up windows? I can access the filesystem using the live cd, but thats about it.  Thanks


WFS in OpenLayers4 returns data but doesn't display any

I can't get this WFS to work. I tried to stick to the OL-WFS examples - no luck.  let vectorLayer = new ol.source.Vector({   format: new ol.format.GML(),   url: function(extent) {     return 'https://geodienste.hamburg.de/HH_WFS_Statistik_Stadtteile_Wahlergebnisse' +       '?version=1.1.0&request=GetFeature&typename=Statistik_Stadtteile_Wahlergebnisse:Buergerschaftswahl_15.02.2015_-_Wahlbeteiligung_in_Prozent;   },   strategy: ol.loadingstrategy.bbox });  this.featureLayer = vectorLayer;  return new ol.layer.Vector({   source: vectorLayer,   style: new ol.style.Style({     stroke: new ol.style.Stroke({       color: 'rgba(0, 0, 255, 1.0)',       width: 2     })   }) });   This query returns 1.5mb of data - but nothing gets displayed. I also tried the same with this format:  new ol.format.WFS({gmlFormat: ol.format.GML2()})   As well as new ol.format.GML 2 & 3 - no luck. And I tried it with this line of code at the end of the url:  '&bbox=' + extent.join(',') + ',EPSG:6.9:25832'   If I add this (as seems to be recommended in the OL examples) the 1.5mb of data is not returned. It should be a very simple thing to include this data in an OL map!


Scroll windows from the same program and show the desktop with GNOME

On my old ubuntu, I had Unity, and there was two options I'd like to find on GNOME:   Being able to scroll with the mouse while the mouse is over an icon in the Ubuntu Dock on the left, to switch between the windows. Having an icon to click on to minimize all windows and show the desktop.   I cannot manage to find if it is possible with GNOME.


Are the apostrophe placements correct in every example?  • two weeks' vacation • four days' personal time • three months' sabbatical time • ten nights' accommodations • three hours' sleep • eight months' pregnancy • eight months pregnant • five minutes' time • a penny's worth • two pennies' worth • a nickel's worth • two nickels' worth • a dollar's worth • five dollars' worth • two seconds' time • five years' probation  Thank you kindly.


An alternative to "pray" without a religious connotation

When I write, I try my best to leave religion and words that carry some divine connotation out of it. I recently stumbled upon the phrase in one of my texts:      [...] but pray it never happens.   I am wondering how to rewrite it, removing the connection with deities but keeping the same effect/meaning. Any ideas?


MacBook Pro keyboard replacement: Refurbished or new components?

I'm about to send my 2016 MacBook Pro for a top case replacement due to a failing keyboard. Since the battery will also be replaced as a part of the top case, I'm wondering if Apple installs a refurbished battery or a brand new one? And for that matter, is there any way to really tell?


How can I change/convert a Ubuntu MBR drive to a GPT, and make Ubuntu boot from EFI?

I recently have upgraded my PC, my new Motherboard (ASUS M5A99X EVO) uses UEFi instead of the regular MBR option.  I have a Ubuntu 11.10 installation that I did when I had my previous hardware (MSI MS 7267) , Ubuntu alone boots fine, and so does Windows 7, however Windows 7 is using UEFI (GPT) boot whereas Ubuntu is using MBR.  I have my OSs in separate drives, so that GRUB2 wont' get replaced by the Windows Bootloader and viceversa, as I said both OSs boot fine on their own, but to do that I have to disconnect one drive in this case the Ubuntu drive as it prevents Windows from loading.  Now my question is, How can I change/convert Ubuntu's drive so that instead of using MBR it uses GPT and allow Windows to boot?.   Preferably without reinstalling the whole system or lose any data.  And if I were to wipe the drive, How can I install Ubuntu in GPT, UEFI, whatever it is mode?.  I have used gdisk to convert from MBR to GPT, but now Ubuntu can't boot seems like grub just doesn't start.  I have re installed the OS, and the drive is GPT now by default however grup-pc is still being used instead of grub-efi.  How can i make Ubuntu boot from EFI?.


I am wondering about the correct use of lesser/smaller in the following phrase:     This library has a smaller/lesser number of books than the National Library.   I did find  on nearly the same question, where one answer states: "As a general rule, 'smaller' is used for size, whereas 'lesser' is used for quantity." In this particular example, however, I am not quite sure how to approach this, as 'number' in this sentence refers to an amount, which you could argue has a size, and 'smaller/lesser number' as a whole only refers to a quantity.   To me, 'a smaller number' sounds better, but I am not a native speaker and I can't make out a clear reason for choosing one over the other.


Deleting ummerged Git branches that were actually merged after rebasing

Git is able to pick up the merged branches and we can delete them but in some cases, let's say you have a bunch of branches which were rebased before a merge and its tracking branch at remote wasn't updated. Now this local branch was deleted as well.  Any way to figure out which branches on remote are the ones that are safe to delete?


Is it possible to execute a left shift in a single clock pulse?

I am currently designing my own 16 bit CPU and want to have a logic left shift instruction. I can make it shift only 1 position easily, but I want it to shift it b positions. Is that possible in a single clock pulse (or a constant number of clock pulses).  Example (using 4 bits):  Input A: 0011  Input B: 0010  Desired output: 1100


PostGIS get geometries within a radius of n meters using WGS84

select * from zones z where st_intersects(z.geom, st_Buffer(ST_SetSRID(ST_Point(2.336031, 48.863172), 3857),1));   It looks like the 1 in the st_buffer is being interpreted as degrees, I need to find geometries within n meters of a given point.  I did find a reference to a new function (st_Buffer_Meters) but that didn't seem to do anything different.


About MKP Capacitors for Inverter Welding Machine

I need your help with capacitors...   I'm restoring a 160A inverter welding machine, model Fimer X164. One of the capacitors has cracked and I need tochange that..   Information about the capacitor on the board (i.e. exploded):  PILKOR 10nF 300V-Y2 PCY2 130 MKP  I can't find an identical capacitor but find similar values.  I have  1- 10 n K 400 RIFA 404 FVN  2- RIFA 271 Y 522 250V MP  Can I use capacitor 1? Or what do you suggest as a replacement for this capacitor?


What is the effect of marking as duplicate?

Early on it surprised me that questions marked as duplicate seem to still function normally. They can be answered, voted on, and commented on.  So what does happen when a question is marked as duplicate?  Clearly the 'duplicate' banner and a comment with a link to the duplicate are added.  Does anything else happen?


As you can see below, we're missing some words.    User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36


Ubuntu 17.10 is using onboard intel as VGA adapter instead of nvidia card

After upgrading to 17.10 I noticed that my installation is using my onboard Intel graphics as VGA adapter instead of my Nvidia 940M.  I already installed the additional drivers from the software & updates, but this had no effect.  Output of lspci -k | grep -EA2 'VGA|3D'  00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)     Subsystem: CLEVO/KAPOK Computer HD Graphics 530     Kernel driver in use: i915 -- 01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940M] (rev a2)     Subsystem: CLEVO/KAPOK Computer GM108M [GeForce 940M]     Kernel modules: nvidiafb, nouveau   And after running gpu-manager  last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot can't access /run/u-d-c-nvidia-was-loaded file /etc/modprobe.d is not a file can't access /run/u-d-c-fglrx-was-loaded file /etc/modprobe.d is not a file /etc/modprobe.d is not a file /etc/modprobe.d is not a file can't access /opt/amdgpu-pro/bin/amdgpu-pro-px /etc/modprobe.d is not a file Looking for fglrx modules in /lib/modules/4.13.0-16-lowlatency/updates/dkms Error: can't open /lib/modules/4.13.0-16-lowlatency/updates/dkms Looking for nvidia modules in /lib/modules/4.13.0-16-lowlatency/updates/dkms Error: can't open /lib/modules/4.13.0-16-lowlatency/updates/dkms Looking for amdgpu modules in /lib/modules/4.13.0-16-lowlatency/updates/dkms Error: can't open /lib/modules/4.13.0-16-lowlatency/updates/dkms Is nvidia loaded? no Was nvidia unloaded? no Is nvidia blacklisted? no Is fglrx loaded? no Was fglrx unloaded? no Is fglrx blacklisted? no Is intel loaded? yes Is radeon loaded? no Is radeon blacklisted? no Is amdgpu loaded? no Is amdgpu blacklisted? no Is amdgpu versioned? no Is amdgpu pro stack? no Is nouveau loaded? no Is nouveau blacklisted? yes Is fglrx kernel module available? no Is nvidia kernel module available? no Is amdgpu kernel module available? no Vendor/Device Id: 8086:191b BusID "PCI:0@0:2:0" Is boot vga? yes Vendor/Device Id: 10de:1347 BusID "PCI:1@0:0:0" Is boot vga? no Error: can't access /sys/bus/pci/devices/0000:01:00.0/driver The device is not bound to any driver. Skipping... Skipping "/dev/dri/card0", driven by "i915" Skipping "/dev/dri/card0", driven by "i915" Skipping "/dev/dri/card0", driven by "i915" Found "/dev/dri/card0", driven by "i915" output 0:     card0-eDP-1 Number of connected outputs for /dev/dri/card0: 1 Does it require offloading? yes last cards number = 1 Has amd? no Has intel? yes Has nvidia? no How many cards? 1 Has the system changed? No main_arch_path x86_64-linux-gnu, other_arch_path i386-linux-gnu update-alternatives: error: no alternatives for x86_64-linux-gnu_gfxcore_conf Current alternative: /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf Current core alternative: (null) Current egl alternative: /usr/lib/x86_64-linux-gnu/mesa-egl/ld.so.conf Is nvidia enabled? no Is nvidia egl enabled? no Is fglrx enabled? no Is mesa enabled? yes Is mesa egl enabled? yes Is pxpress enabled? no Is prime enabled? no Is prime egl enabled? no Is nvidia available? yes Is nvidia egl available? no Is fglrx available? no Is fglrx-core available? no Is mesa available? yes Is mesa egl available? yes Is pxpress available? no Is prime available? yes Is prime egl available? no Single card detected Nothing to do No change - nothing to do   How can I set my Nvidia card to be my main display adapter?  Thanks in advance


I installed Wordpress on my site via  tutorial. One of the prerequisites is to secure Apache with Let's Encrypt and there is a tutorial that I followed for that   Unfortunately I am finding that enabling this security has blocked access to some of my subdomains that are located on different servers which do not have support for TLS/SSL certificates. So I'd like to try to remove or disable this security and I'm not sure how to go about doing that.


What are the different types of solder used for?

How do I know when to use lead, flux-core, lead-free, or any other kind of solder out there? Do you have any tips on solder gauge for specific applications?


Areas of physics and physical scenarios where jerk comes up

I am a high-schooler and I learnt that the third derivative of displacement with respect to time$\left(\frac{d^3s}{dt^3}\right)$ is known as jerk. I am curious to know where does this come up in physics. I never encountered this while studying high school physics and that's why I'm keen on knowing its applications.


Why is the relativistic Lorentz factor defined this way?

My question is: why has the  the form  $$\gamma = \dfrac{1}{\sqrt{1 - \dfrac{v^2}{c^2}}}$$  and not, for example one of those:  $$\gamma = \dfrac{1}{\sqrt{1 - \dfrac{v}{c}}}$$  or  $$\gamma = \dfrac{1}{\sqrt{1 - \dfrac{v^2}{2 c^2}}}$$  or  $$\gamma = \dfrac{1}{\sqrt[3]{1 - \dfrac{v^2}{c^2}}}$$  Or one of the other many possibilities?  I mean: nobody ever told me where did the definition of $\gamma$ came from. Can you explain it to me?


{    int a,b,c,d,e; float percentage;  cout<<"marks= "; cin>>a; cin>>b; cin>>c;  cin>>d; cin>>e;  percentage= (a+b+c+d+e)/5; cout<<"Percentage= "<<percentage<<endl;  if (percentage<40) cout<<"fail";  else if (percentage>=40,percentage<=49) cout<<"third division";  else if (percentage>=50,percentage<=59) cout<<"second division";  else if (percentage>=60) cout<<"first division";  }   When i submit this to my lecturer, he said that it is theoretically wrong to use comma in the condition, and is suppose to be &&. However, I have successfully run this program. Can anyone explain to me?


(I redesigned the entire magazine as well but that’s another story)

Finally, can someone settle the argument about the period going inside or outside of the close paren in this free-standing sentence?


Use ArcMap to record dominant land classification per DEA in Ireland

I have a shapefile consisting of Ireland District Electoral Areas (DEA), in which there are over 3000 polygons. Secondly, I have a shapefile consisting of the Land Use classifications in Ireland. A DEA in the first shapefile can contain many classifications from the second shapefile. So far, I have used the ArcGIS union tool to combine both shapefiles, but I'm unsure how to proceed. I'm wanting to record in a separate column of the attribute table, the dominant land classification per DEA. I only want to know the dominant land classification (in terms of the DEA) and not the rest of the classifications intersecting that DEA. Here is a sample figure of the unified DEA and Land Use classification shapefiles, categorised by land use. It is easier to see in the pink regions the outline of the DEA in which there can be numerous land classifications.


My tyre says 700x38 on the side of it. what size inner tube would I need for the wheel? I've ordered a 700x35 inner tube but it seems a little too big for it?


Windows 10: Pin an item to left side of Start Menu?

Has anyone figured out how to pin an item to the left side of the start menu? Articles online about this are referencing an older version of 10 where this was possible.   No matter the size of Start, clicking Pin to Start Menu will create another column and pin a tile there Cannot drag from right side to left, or from anywhere for that matter   Here's how my Start appears, after removing Most Used and Recently Added. Simply want an app pinned anywhere in the gray area:


Template class does not compile with undefined reference to overloaded operator error

When i compile this: header: template <unsigned int n> class Wektor{ private:     double tab[n]; public:     double get(int i) const {         return tab[i];     }     void set(int i, double x) {         tab[i] = x;     }     double operator [] (int x) const;     Wektor() : tab{0} {}     Wektor operator + (Wektor V) const; };  source: #include "Wektor.hh"  template <unsigned int n> Wektor<n> Wektor<n>::operator + (Wektor<n> V) const{     Wektor T{};     for(int i=0; i<n; i++){         T.set(i, (*this)[i] + V[i]);     }     return T; }  main file: #include "Wektor.hh" #include <iostream>  int main(){     Wektor<2> a, b, c;     a.set(0, 1);     a.set(1, 2);     b.set(0, 1);     b.set(1, 1);     c=a+b; }  error: undefined reference to `Wektor<2u>::operator+(Wektor<2u>) const' And i can't use "friend" cause it's college task :(


In an anti-matter universe, would an anti-matter black hole emit anti-matter gamma radiation?

In an anti-matter universe, when an anti-matter black hole is consuming a large anti-matter star, would it emit anti-matter gamma radiation, or would gamma radiation be the same in either a matter or anti-matter universe?


I've just finished downloading Ubuntu for my C710 and rather than it being in Ubuntu it is still Chrome OS.  How do I install Ubuntu on a Chromebook?


Distribution of a "simple" Maximum Likelihood Estimator

Let $(X_1,\dots,X_n)$ be a random sample from a population $X$ having probability density function $$f(x;\vartheta,\lambda)=\lambda\,\vartheta^\lambda\,x^{-(\lambda +1)}$$ $$\vartheta>0\qquad\lambda>0\qquad x\geq\theta$$ If $\lambda$ is known (hence fixed):   Find $\hat{\vartheta}_n$, the MLE (Maximum Likelihood Estimator) of the parameter $\vartheta$ and verify if it is unbiased Find the distribution of $\hat{\vartheta}_n$ If $\hat{\vartheta}_n$ is biased, propose an unbiased estimator in the class of the estimators of the type $c\cdot\hat{\vartheta}_n$, with $c$ an appropriate constant   While I'm pretty confident on how to solve the first and last point, I'd like some advice on the second one.    1.  To find the MLE $\hat{\vartheta}_n$, the likelihood function is calculated: $$\mathscr{L}(\underline{x};\vartheta) = \lambda^n\,\vartheta^{n\lambda}\,\left( x_1 \times\dots\times x_n \right)^{-(\lambda +1)} \qquad\qquad(\vartheta\leq x_i,\, \forall\,i=1,2,\dots,n)$$ Given the condition on $\vartheta$, the value that maximizes the likelihood function can be starightforwardly seen to be $\hat{\vartheta}_n = \min{\left(x_1,\dots,x_n\right)} = x_{(1)}$ where $\left(x_{(1)},\dots,x_{(n)} \right)$ is the sample re-arranged in non-decreasing order.  We have to verify if $\mathbb{E}\left(\hat{\vartheta}_n\right)=\vartheta$, so we calculate $$\mathbb{E}\left(\hat{\vartheta}_n\right)=\mathbb{E}\left(x_{(1)}\right)=\mathbb{E}\left(x\right)=\int_\vartheta^{+\infty} x\,\lambda\,\vartheta^\lambda\,x^{-(\lambda +1)}\stackrel{\lambda>1}{=}\frac{\lambda}{\lambda-1}\vartheta\neq\vartheta$$  So the MLE is biased.  2?  $\hat{\vartheta}_n = x_{(1)}$ has the same distribution of every $x$ random variable, that is $f(x;\vartheta,\lambda)$.  Am I right about this? No, I'm not!  3.  Given what was calculated at point 1, if $c=\frac{\lambda -1}{\lambda}$ we have that $c\cdot\hat{\vartheta}_n$ is an unbiased MLE.  Any help/correction would be greatly appreciated!


How do I add this extra partition to my installed Ubuntu system?

I started installing Ubuntu by watching a video tutorial about doing a disk partition installation, for that, inside Windows' 7 own disk partitioning tool. After a defrag I cut 100GB that I pretended to use on my Ubuntu installation for a little try out, now, while installing, I never really chose where I wanted Ubuntu to be installed, so I guess it just made a partition by itself of the minimum that the installation tells you it needs.  How can I now give the other 92 GB I had left apart only for that task?  Here's what my partitions look like now.     Here's a df:    And here's the GParted tool un ubuntu:


“Any physical theory is always provisional, in the sense that it is   only a hypothesis: you can never prove it.”      Excerpt from Stephen Hawking, A Brief History of Time, iBooks.   So does that mean that Theory = Hypothesis?


As the title stated, I am wondering the integers $x,y$ that satisfy the equation $x^2-y^3 = 23$.


Multiplicative Euclidean Function for an Euclidean Domain

Does there exist an Euclidean domain with no multiplicative Euclidean function?     An Euclidean domain, denoted $R$, is an integral domain  with an Euclidean function $d : R\setminus \{0\} \to \mathbb{N}$ such that  $1)\quad d(a) \leq d(ab)$, and  $2)\quad a = bq + r$ with either $r = 0$ or $d(r) < d(b)$.   I am interested in multiplicative Euclidean functions. That is, $d(ab) = d(a)d(b)$.  For example, one can choose  $\mathbb{Z}$ with $d(n) = |n|, \quad \mathbb{Z}[i]$ with $d(\alpha) = N(\alpha), \quad F[X]$ with $d(f) = 2^{\deg(f)}$ for a field $F$,  or, kind of a stupid example, any field $F$ with $d(a) = 1$.  I am new here. Thank you in advance.


To be honest, I am quite bit confused about the "faked death" scene of Sherlock himself in the BBC series Sherlock. The beginning of Season 3, Episode 1 shows that he escaped with the help of the rope/cord attached to the back of his coat and he seemingly broke into the nearby building and then left from there. However when Anderson confronts him later, he actually tells another story of him jumping on an inflatable sofa (or something like that) and escaping the site. All the while John is hypnotised. So I was looking for an answer that would help clear my dilemma.


Auto slice an image file based on transparency

I have multiple small icons in a single file. They are separated with transparency. So I can manually select them and save individually. But this takes long time with many parts.  Is it possible to automatically save each non-transparent piece to separate file?


How do I find which layers has a specific font family in a PSD with many layers, groups and several different font families?


prevents a universal axiomatic system for math. Is there any reason to believe that it also prevents a  for physics?    Edit:  I haven't before seen a formulation of Gödel that included time. The formulation I've seen is that any axiomatic systems capable of doing arithmetic can express statements that will be either 1) impossible to prove true or false or 2) possible to prove both true and false.  This leads to the question: Are theories of (nearly) everything, axiomatic systems capable of doing arithmetic? (Given they are able to describe a digital computer, I think it's safe to say they are.) If so, it follows that such a theory will be able to describe something that the theory will be either unable to analyse or will result in an ambiguous result. (Might this be what forces things like the Heisenberg uncertainty principle?)


I am attempting to write a script to list all the shebang lines in python files.  What I would like to do is  sudo bash -c 'for logf in $(find / -name "*.py"); do fgrep '#!/usr/bin' "$logf"; done'   This gives error bash: !/usr/bin': event not found. I understand why, although the meaning of the error is unclear.  The trouble is I can't figure out how to pass a string to bash which includes another string without command execution.  If I leave off the "#!" it works, but of course includes a number of other lines.   I have tried practically every combination of escape and string without success.


Changing color of text snippet in a verbatim environment

Is it possible to change color of part of the text that is in a verbatim environment?  Lets say I have this verbatim section. I want to change the color of the marked lines into blue.  \begin{verbatim}     BOT: (Begin of Transaction)          SQL-DML-1; // update Kunden (...)             --> (C1, C2, C3)  /* MAKE THIS RED */         SET CONSTRAINTS C4 IMMEDIATE;             --> (C4)          /* MAKE THIS RED */         SET CONSTRAINTS C3 DEFERRED;          SQL-DML-2; // update Produkte (...)               --> (C1, C2, C4)  /* MAKE THIS RED */         SQL-DML-3; // update Bestellungen (...)             --> (C1, C7, C4)  /* MAKE THIS RED */         EOT: (End of Transaction) (COMMIT) /* INSERT MATH SYMBOL HERE */             --> (C3, C5, C6)  /* MAKE THIS RED */         RBT: Roll-Back-Transaction (alles rückgängig gemacht)             \end{verbatim}   Additionally, is it possible to make mathematical symbols in a verbatim environment? I know that this is contradictory per se, but maybe there's a kind of hack to to this.


May I save a tex file as a picture file?

Is there a way to save or export a tex file so as to produce a jpg/jpeg/png file?


I am having issues creating dirs using a variable in a script. Ex:  read user mkdir $user{01..10}   Interestingly, it will work like this:  read user mkdir {01..10}$user   Any way to get around this, or what am I missing?  Thanks


Why is this certain type of code considered to be good programming practice and why some is considered bad?

During common programming constructs I have seen that for eg.  class Showframe {    psvm(String args[])    {       Artframe artframe = new Artframe(new Drawing());       //some commands    } }  class Artframe extends JFrame {     Drawing drawing;    public Artframe(Drawing drawing)    { this.drawing = drawing; }    //some commands }  class Drawing {    //some things over here }   I want to know why do we do that? Why not  Drawing class same as above  in ShowFrame   instead of : Artframe artframe = new Artframe(new Drawing());  we write :       Artframe artframe = new Artframe();   and change the constructor of Artframe class to :     drawing = new Drawing();   I mean why do we not do this?? What is wrong in this and why is it considered to be bad programming practice?


Why do I get "Permission denied (publickey)" when trying to SSH from local Ubuntu to a Amazon EC2 server?

I have an instance of an application running in the cloud on Amazon EC2 instance, and I need to connect it from my local Ubuntu. It works fine on one of local ubuntu and also laptop. I got message "Permission denied (publickey)" when trying to access SSH to EC2 on another local Ubuntu. It's so strange to me.  I'm thinking some sort of problems with security settings on the Amazon EC2 which has limited IPs access to one instance or certificate may need to regenerate.  Does anyone know a solution?


What is the influence of C in SVMs with linear kernel?

I am currently using an SVM with a linear kernel to classify my data.  There is no error on the training set.  I tried several values for the parameter $C$ ($10^{-5}, \dots, 10^2$).  This did not change the error on the test set.  Now I wonder: is this an error caused by the ruby bindings for libsvm I am using () or is this theoretically explainable?  Should the parameter $C$ always change the performance of the classifier?


I have basic tcp application written in C. It basically sends data to a tcp server. I have connected two PC's with cross cable. I send data from one, and successfully get this data from another one. I have built this mechanism to test If somehow connection broken by unhealty ways (ruptured cable etc.), I want to be informed as client. But things doesn't work as I wanted.If I manually stop tcpserver, client side is informed, but when I start program, connection establishes, data starts to flow, then I unplug the cable, and both sides behaves like nothing happened. Client still sends data with no error, and server still shows the client connected but data flow stops. After a few minutes, I plug cable again, the datas -which considered as sent but not sent- flushes suddenly then program continues normally. How can I detect a broken connection like this? Any help would be appreciated. Here is the code;  #include <arpa/inet.h> #include <stdio.h> #include <string.h> #include <sys/socket.h> #include <unistd.h>  int main() { const char* server_name = "192.168.5.2"; const int server_port = 30152;  struct sockaddr_in server_address; memset(&server_address, 0, sizeof(server_address)); server_address.sin_family = AF_INET;  // creates binary representation of server name // and stores it as sin_addr // http://beej.us/guide/bgnet/output/html/multipage/inet_ntopman.html inet_pton(AF_INET, server_name, &server_address.sin_addr);  // htons: port in network order format server_address.sin_port = htons(server_port);  // open a stream socket int sock; if ((sock = socket(PF_INET, SOCK_STREAM, 0)) < 0) {     printf("could not create socket\n");     return 1; }  // TCP is connection oriented, a reliable connection // **must** be established before any data is exchanged if (connect(sock, (struct sockaddr*)&server_address,             sizeof(server_address)) < 0) {     printf("could not connect to server\n");     return 1; }  // send  // data that will be sent to the server const char* data_to_send = "HELLO THIS IS DATA!"; while(1) {     int err = send(sock, data_to_send, strlen(data_to_send), 0);      if(err==-1)     {         printf("ERROR \n");         break;     }     else     {         printf("sent  \n");         sleep(1);     }  } printf("EOP\n");  // close the socket close(sock); return 0; }


Can't zoom close to object with small unit

When working with relatively small units (mm) and small object I am not able to zoom in so I can see the object. It looks like part of the view is obscured (as shown on screenshot).


In McDonald's 2016 annual report Balance Sheet, it shows Total Liabilities is greater than Total Assets. So it's Total Stockholder's Equity appears to be negative, with these fields reported as negative figures:  Accumulated other comprehensive income Common stock in treasury   What is the meaning of these 2 fields? Does it indicate any unhealthy financial position when they are negative?


The following code produces a negative phantom (from the comment in ):   \newcommand{\negphantom}[1]{\settowidth{\dimen0}{#1}\hspace*{-\dimen0}}  However, when used inside an equation like  $$a\negphantom{\inf_{t>0}t^2}b$$  I get an error. The solution is to do  $$a\negphantom{$\inf_{t>0}t^2$}b$$  Is it possible to define negphantom in such a way that it respects being inside an equation or not? (the latter solution is not perfect, since the \inf is not in displaystyle).


Does $\langle\Omega|\mathrm{e}^{\mathrm{i}Px}=\langle\Omega|\mathrm{e}^{\mathrm{i}0x}$? $(\langle\Omega| =$ ground state of the interacting theory)

Let $\langle\Omega|$ be the ground state of an interacting theory, just as Peskin & Schroeder(PS) describes on page 82 and page 213. On page 213 PS do the following   $$\tag{1}\langle\Omega|\phi(x)|\lambda_{\vec{p}}\rangle = \langle\Omega|\exp(+\mathrm{i}Px)\phi(0)\exp(-\mathrm{i}Px)|\lambda_{\vec{p}}\rangle \\ =\langle\Omega|\phi(0)|\lambda_{0}\rangle\exp(-\mathrm{i}px)\bigg|_{p^0=E_{\vec{p}}} $$  In the above $|\lambda_0\rangle$ is an eigenstate of the full interacting hamiltonian $H$. The ket $|\lambda_{\vec{p}}\rangle$ is the boost of $|\lambda_0\rangle$ with momentum $\vec{p}.$ Furthermore $E_{\vec{p}} = \sqrt{p^2+m_\lambda^2}$ and $\vec{P}|\lambda_0\rangle = 0.$  I assume PS used $$\tag{2}\langle\Omega|\mathrm{e}^{\mathrm{i}Px}=\langle\Omega|\mathrm{e}^{\mathrm{i}0x}$$ in $(1)$.   Is $(2)$ true?   I thought $\langle0|\mathrm{e}^{\mathrm{i}Px}=\langle0|\mathrm{e}^{\mathrm{i}0x}$ where $\langle0|$ is the ground state of the free theory.   I hope I have provided enough info for the question to make sense.


Upper bound of $\left(1+\dfrac{1}{2}\right)\left(1+\dfrac{1}{4}\right)...\left(1+\dfrac{1}{2^n}\right)$

In a calculus book that I'm reading, there is a problem as follows:  Prove that this sequence $x_n=\left(1+\dfrac{1}{2}\right)\left(1+\dfrac{1}{4}\right)...\left(1+\dfrac{1}{2^n}\right)$ is monotonic, bounded and then converges.  I can prove that this sequence is increasing, but I found no way to find the upper bound for $x_n$. Please give me some hint to find the upper bound, and may be the limit of this sequence also. Thanks


How do I get a list of all subdomains of a domain?

I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option:  dig @ns1.foo.bar some_domain.com axfr   But this never works. Has anyone a better idea/approach


How do i get a 2 decimal answer in this code? because i get more than 2

import java.util.Scanner; public class bmi {     public static void main(String[] args) {         Scanner scan = new Scanner(System.in);          float height,heightSquared,BMI;          int weight;          System.out.println("Your height in meters:");          height = scan.nextFloat();          System.out.println("Your weight in kilograms:");          weight = scan.nextInt();          heightSquared = (height*height);          BMI = weight/heightSquared;          if (BMI < 18.5) {             System.out.println("Your BMI result:"+ BMI + "(UNDER-WEIGHT)");         }         else if (BMI > 18.4 && BMI < 24.6) {             System.out.println("Your BMI result:"+ BMI + "(NORMAL-WEIGHT)");         }         else if (BMI > 24.9 && BMI < 30) {             System.out.println("Your BMI result:"+ BMI + "(OVER-WEIGHT)");         }         else {              System.out.println("Your BMI result:"+ BMI + "(OBESSE)");         }      } }   This is my code for getting the body mass index (BMI) of a person it's okay when running but my only problem is how do i turn the answer in 2 decimals? for example:  Your height in meters:  1.70  Your weight in kilograms:  50  Your BMI result:17.301032(UNDER-WEIGHT)  i want the output to be only 17.30 or in 2 decimals. what should i change?


Which field property enables us to multiply on both sides by the same value, while preserving equality?

I am currently reading through Rudin's Principles of Mathematical Analysis and I am learning about fields and their properties. Note that this is the initial chapter - I am just starting off.  I was wondering which field property enables us to multiply on both sides of an equation and still preserve equality.  There is a very clear proposition stated in the book that gives me this for inequalities: $$ \text{If} \ \ x > 0 \ \ \text{and} \ \ y < z \ \ \text{then} \ \ xy<xz. $$  However, the only proposition that seems useful for this in the case of equalities, is stated as an implication and not an equivalence: $$ \text{If} \ x\not= 0 \ \ \text{and} \ \ xy=xz \ \ \text{then} \ \ y=z. $$  Any help would be much appreciated.


Was Padmé made to still appear pregnant for her funeral?

During Padmé's funeral in  she still appears to be very pregnant as her casket is drawn through the street, even though she had already given birth to twins before she died. You could perhaps make the argument that it is remaining baby weight, but judging from how thin she was before giving birth (to twins, no less) there wouldn't seem to be enough baby weight to make her still appear just as pregnant as before.  So that lead me to think that she was purposely made to still appear pregnant for her funeral, so that the Emperor (and/or Vader) wouldn't suspect that there were any little Skywalkers running around. There's no overt mention of this sort of ruse in the movie. Is there any other source that makes reference to Padmé being made to still appear pregnant for her funeral?


How to detect a 16 bit overflow with CCS

I have to add numbers with this script:  for(i=1; i<1000 ;i++) sum=sum+i;   it will overflow at 32768 and after that it goes to -32768 because it cant exceed the 16 bit limit.   i want to count the overflows with an int c.   Thanks


Is it right to use "both" in negative sentences?

I've just come across a film review by an American author where he says:  "I can assure you that both are not typical in any part of this state".  In negative sentences like that, my inclination would be to use "neither one of them is..." instead (or, depending, none of them is/are...).   Is it right to say "both are not..." ?


When back, if I say "Out of office until Thursday"

I am always confused when I get an email stating "out of office until Thursday". Is the sender back on Thursday or still out of office (o.o.o.) on Thursday and only back on Friday? Is there a good reference that defines the meaning? Please do not tell me that it would be better to state "back on Thursday", since this does not answer the question.


Peer reviewing process in top math journals

I submitted a a short note, less than 10 page long, to a very prestious journal in mathematics. It has been about 4 months and I have not heard back. I wonder if that means the note made it pass through the initial assessment and is under review or it simply doesn't mean anything. The status of paper reads: reviewing.  How does the reviewing process differ from lower tier journals to much more selective and reputable( whatever that means)journals?


How to upgrade gcc-5 to gcc-7 in Ubuntu 16.04?

This is a follow up question to .  Following the answers therein, I was able to install gcc-7.2 by:  sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install -y gcc-7   However, after the install, the gcc/g++ command still defaults to 5.4.0  gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609   Is it possible/safe to have gcc-7 as the default and remove the old gcc-5.x files entirely?    Note that, different from the said duplicate, I'm looking to remove/replace gcc-5.x instead of setting a symlink.


How to install Broadcom wireless drivers offline?

I have installed Ubuntu alongside Windows 8.1. But the wifi is not working in Ubuntu (perhaps the drivers are not present), which worked fine in windows. Also I cant connect with Ethernet since my laptop does not have an Ethernet port. So is there any way for me to connect to the internet in ubuntu? Edit: Output of the terminal command  lspci -knn | grep Net -A2:  vikram@vikram-Inspiron-11-3148:~$ lspci -knn | grep Net -A2 01:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)     Subsystem: Dell Device [1028:0018]     Kernel driver in use: bcma-pci-bridge vikram@vikram-Inspiron-11-3148:~$    I did what Pilot6 suggested. Here is the output:    vikram@vikram-Inspiron-11-3148:~$ sudo dpkg -i *.deb [sudo] password for vikram:  Selecting previously unselected package bcmwl-kernel-source. (Reading database ... 163804 files and directories currently installed.) Preparing to unpack bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb ... Unpacking bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) ... Selecting previously unselected package dkms. Preparing to unpack dkms_2.2.0.3-1.1ubuntu5.14.04_all.deb ... Unpacking dkms (2.2.0.3-1.1ubuntu5.14.04) ... Setting up dkms (2.2.0.3-1.1ubuntu5.14.04) ... Setting up bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) ... Loading new bcmwl-6.30.223.141+bdcom DKMS files... First Installation: checking all kernels... Building only for 3.16.0-30-generic Building for architecture x86_64 Building initial module for 3.16.0-30-generic ERROR (dkms apport): kernel package linux-headers-3.16.0-30-generic is not supported Error! Bad return status for module build on kernel: 3.16.0-30-generic (x86_64) Consult /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/make.log for more information. modprobe: FATAL: Module wl not found. update-initramfs: deferring update (trigger activated) Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for initramfs-tools (0.103ubuntu4.2) ... update-initramfs: Generating /boot/initrd.img-3.16.0-30-generic vikram@vikram-Inspiron-11-3148:~$


how to send multiple parameters to restful webservice

i want to send multiple parameters to restful webservice in salesforce      HttpRequest req = new HttpRequest();             req.setHeader('Content-Length', '0');             req.setHeader('Content-Type', 'application/json');             req.setHeader('Authorization', 'Bearer ' + token);             req.setEndpoint('https://end point address');             req.setMethod('POST');           /// here i have to pass multiple parameters like this////                     req.setBody("parameters");             req.setBody("parameters");             req.setBody("parameters");  i want to send few parameters like       String id;     String status;     String reason;  ////////////////////////////////////////////////////////             Http http = new Http();             req.setTimeout(60000);              HTTPResponse respns = http.send(req);             String json= respns.getBody();   can i have some suggestions regarding this,sending multiple parameters to webservices


Coldfusion query output order totals by day

I have been trying to work out how to query a database with MSSQL 2012 & CF 10 to output the totals of a days transactions in its own result set.  <cfquery name="myquery" datasource="#mydatasource#"> SELECT paid,orderTotalCost,orderTotalGST,orderID,orderCountry,orderDate,orderState FROM storeOrders WHERE paid = <cfqueryparam cfsqltype="cf_sql_bit" value="#arguments.paid#"> AND orderDate BETWEEN <cfqueryparam cfsqltype="cf_sql_timestamp" value="#arguments.startDate#"> AND <cfqueryparam cfsqltype="cf_sql_timestamp" value="#arguments.endDate#"> </cfquery>   trying to output the data   Monday    | 100 Tuesday   | 200 Wednesday | 300 Thursday  | 400 Friday    | 500 Saturday  | 600 Sunday    | 700   My SQL Skills arent very good, so Im hoping someone on here could kindly help me out as to how to sum up the data and return it as its own column ?  thanks in advance


I get the error shown below while trying to implement dependent dropdown for country state as shown below while trying to submit form which implements  AJAX in drupal 8 for country - state dropdown I get the error  Error "An illegal choice has been detected. Please contact the site administrator.". How can I make sure default value of State is retained like its retained for Country ?
    namespace Drupal\custom_changes\Form;  use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\custom_changes\NameTable\NameTable; use CommerceGuys\Addressing\Subdivision\SubdivisionRepository;  /**  * Simple Form  *   */ class CustomDicForm extends FormBase {   /**    * @inheritdoc    */   public function buildForm(array $form, FormStateInterface $form_state )   {      $form['country'] = [       '#type' => 'select',       '#title' => $this->t('Country'),       '#options' => [         '' => t('Select'),         'IN' => t('India'),         'GB' => t('UK (Great Britain)'),       ],       '#ajax' => [         'callback' => '::stateCallback',         'event' => 'change',         'wrapper' => 'state-list',         'progress' => [           'type' => 'throbber',           'message' => $this->t('Updating States...'),         ],       ],     ];     if (isset($form['#options'])) {       $form['state'] = [         '#type' => 'select',         '#prefix' => '
',         '#suffix' => '
',         '#title' => $this->t('State'),       ];     }     else {       $form['state'] = [         '#type' => 'select',         '#prefix' => '
',         '#suffix' => '
',         '#title' => $this->t('State'),         '#options' => ['' => t('Select')],       ];     }     $form['submit'] = [       '#type'=> 'submit',       '#value' => t('Submit'),     ];      return $form;   }   public function stateCallback(array &$form, FormStateInterface $form_state) {      $country = $form_state->getValue('country');      $form_state->setValue('state', '');      $form['state']['#options'] = ['' => t('Select')] + $this->getAllStates(        $country      );       return $form['state'];   }    /**    *     *  Get the State from Country    *  @return array $states    *    */    public function getAllStates($country) {     if ($country == "GB") {       // as GB does not give values so adding hard coded values       return ['A','B','C','D','E','F'];     }     else {       $subdivisionRepository = new SubdivisionRepository();       // Get the subdivisions for Brazil.       $states = $subdivisionRepository->getAll([$country]);       $in_states = array();       foreach ($states as $key => $state) {         $in_states[] = $key;       }     }     return $in_states;   }    /**    * @inheritdoc    */   public function getFormId()   {     return 'custom_changes_dic_name_form';   }    /**    * @inheritdoc    */   public function submitForm(array &$form, FormStateInterface $form_state)   {     parent::submitForm($form, $form_state);     $form['country']['#default_value'] = $form_state->getValue('country');     $form['state']['#options'] = ['' => 'Select'] + $this->getAllStates($form['country']['#default_value']);     $form['state']['#default_value'] = $form_state->getValue('state');     $first_name = $form_state->getValue('first_name');       $last_name = $form_state->getValue('last_name');     //@todo check how to pass exception     $this->nameTable->insertData($first_name, $last_name);     }  }


How is possible for current to flow so fast when charge flows so slow?

How is it possible for current to flow so fast when charge flows so slowly?  We know electrons travel very slowly while charge travels at ~the speed of light.


How to disabled Viber running without uninstalling it?

How do I stop Viber running, without uninstalling the app? When I go Menu→More options→Exit it just comes back. I want it to turn it off completely, so it's not waiting to come on in the background.


Use inclusion-exclusion to find explicit formula for $P(A_k)$. Where is independence used?

Probability with Martingales        This was answered  using bounds and  using PGF. I would like to try inclusion-exclusion.  Let $H_1, H_2, ...$ be independent events with $P(H_k) = p$ where $H_k$ means the kth toss is heads.  It seems that ($\cap$ omitted)  $$A_0 = H_1$$  $$A_1 = H_2 \cup H_3$$  $$A_2 = (H_4H_5) \cup (H_5H_6) \cup (H_6H_7) := \bigcup_{i=1}^{3} E_{2,i}$$  $$A_3 = (H_8H_9H_{10}) \cup ... \cup (H_{13}H_{14}H_{15}) := \bigcup_{i=1}^{6} E_{3,i}$$  $$\vdots$$  $$A_k = (H_{2^k}...H_{2^k + k-1}) \cup ... \cup (H_{2^{k+1} - k}...H_{2^{k+1} - 1}) := \bigcup_{i=1}^{2^k - k + 1} E_{k,i}$$  So by inclusion-exclusion, we have  $$P(A_0) = p$$  $$P(A_1) = p + p - p^2$$  $$P(A_2) = 3p^2 - 2p^3$$  $$P(A_3) = \ldots$$  It gets tricky starting $A_3$  $$P(A_3) = P\left(\bigcup_{i=1}^{6} E_{3,i}\right)$$  Attacking that directly is going to lead to problems.  What about this?  $$P\left(\bigcup_{i=1}^{6} E_{3,i}\right)$$  $$ = P\left(\bigcup_{i=1,4} E_{3,i} \cup \bigcup_{i=2,5} E_{3,i} \cup \bigcup_{i=3,6} E_{3,i} \right)$$  $$ := P(F_{3,1} \cup F_{3,2} \cup F_{3,3})$$  Each $F$ is a union of disjoint sets.   Also, I notice independence isn't being used. I guess the $H_k$'s and the $A_k$'s are independent. What about some subset of the the $E$'s? The $F$'s?


Why do I get the Exception In Initializer Error?

I was trying to make a simple Spreadsheet java app. For this I am using JTable in swing. My code is as follows:  import javax.swing.*; import java.awt.*;  public class Main {      private JFrame Frame;     public Font f = new Font("Candara", Font.PLAIN, 14);     public JFileChooser choicer = new JFileChooser();     public String dir;     private JTable Table;     public String[] columns;     public String[][] data = new String[10][2];     public static Main m = new Main();      /**      * Launch the application.      */     public static void main(String[] args) {         EventQueue.invokeLater(new Runnable() {             public void run() {                 try {                     m.Frame.setVisible(true);                 } catch (Exception e) {                     e.printStackTrace();                 }             }         });     }      /**      * Create the application.      */     public Main() {         initialize();     }      /**      * Initialize the contents of the frame.      */     private void initialize() {         Frame = new JFrame();         Frame.setTitle("Spreadsheet");         Frame.setBounds(100, 100, 1000, 800);         Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);          JMenuBar menuBar = new JMenuBar();         Frame.setJMenuBar(menuBar);          JMenu File_Menu = new JMenu("File");         File_Menu.setFont(f);         menuBar.add(File_Menu);          JMenuItem New_Doc = new JMenuItem("New Document");         New_Doc.setFont(f);         New_Doc.addActionListener(e -> {             choicer.setCurrentDirectory(new java.io.File("."));             choicer.setDialogTitle("New Document");             choicer.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);             choicer.setAcceptAllFileFilterUsed(false);              if (choicer.showOpenDialog(new JPanel()) == JFileChooser.APPROVE_OPTION) {                 dir = String.valueOf(choicer.getCurrentDirectory());             }         });         File_Menu.add(New_Doc);          JMenuItem Save_Doc = new JMenuItem("Save Document");         Save_Doc.setFont(f);         File_Menu.add(Save_Doc);          JMenuItem Open_Doc = new JMenuItem("Open Document");         Open_Doc.setFont(f);         File_Menu.add(Open_Doc);         Frame.getContentPane().setLayout(null);          m.newTable();         Table = new JTable(data, columns);         Table.setBounds(10, 11, 964, 718);         Table.setFillsViewportHeight(false);         Frame.getContentPane().add(Table);         Table.setDragEnabled(false);      }      public void newTable() {         int i = 1;         columns = new String[10];         while (i <= 10) {             columns[i - 1] = String.valueOf(i);         }          i = 0;         int j = 0;         while (i < 10) {             while (j < 2) {                 data[i][j] = String.valueOf(i + j);             }         }      }  }   When I run this code, I get the following message:       Exception in thread "main" java.lang.ExceptionInInitializerError   Caused by: java.lang.NullPointerException     at Main.initialize(Main.java:76) (this line is: m.newTable();)     at Main.(Main.java:34)     at Main.(Main.java:13)     Why does this happen?  Additionally, is there something wrong in the way in which I'm setting the bounds for the Table?


Converting Base64 string to file and saving locally using vbscript

I'm getting the error mentioned below when i try to decode a base64 string to file and save it locally. I've done some research online and couldn't find the solution. Thanks in advance.  Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.      Const adTypeBinary = 1     Dim str      str = strBase64Content 'base64 string here      Dim objXML      Dim objNode      Set objXML = CreateObject("Msxml2.DOMDocument.6.0")     Set objNode = objXML.createElement("b64")     objNode.DataType = "bin.base64"     objNode.Text = strBase64Content     decodeBase64 = objNode.nodeTypedValue      Set objNode = Nothing     Set objXML = Nothing      set stream =  server.CreateObject("ADODB.Stream")     stream.Open     stream.Type = adTypeBinary     stream.Write decodeBase64     stream.SaveToFile "C:\"     stream.Close


I have a random variable $X(a) = \log(a)$ where a is normal distributed $\mathcal N(\mu,\sigma^2)$. What can I say about $E(X)$ and $Var(X)$? An approximation would be helpful too.


I'm having a fight with ads, popups and tracking cookies. But I'm having some issues.  Software used:    Chromium 18.0.1025.168   Extensions used:   Adblock Plus (Beta)1.2 AdBlock+ Element Hiding Helper1.1.9.18 Better Pop Up Blocker2.1.6 Ghostery3.0.0   With this configuration, I'm always getting this error:      Warning: This extension failed to modify a network request because the modification conflicted with another extension.   I know if I disable "better popup", this goes away. It's perfectly normal, due to those extensions trying to block the same things. Problem is, I can't live without all of them! Can anyone advise me about some good configuration?   Can't live without adblock plus, because I hate ads. Better popup blocker is essential too (believe me, chrome doesn't block a lot of popups, and I have a website or 2 that can prove that.) And ghostery is a must... I can't bare the idea of being tracked all the time by some companies.   So I'm kinda lost here! everything is needed, but they conflict with each other. I mean, it has to exist a perfect combination out there, I know I'm not the only one hating the privacy issues nowadays! I am really thankful for any tips guys.


How to separate posts loop in to two columns?

I need to separate WordPress posts loop in to 2 columns , left ( all odds )  and right ( all evens ) .   Currently I am doing this with 2 separate loops but would like to make it with one  and  would like this to be done by the WP coding standards as much as possible.
     <?php          $row_start = 1;          while ( have_posts() ) : the_post();              if( $row_start % 2  != 0) {// odd                 get_template_part( 'blog','item');             }             ++$row_start;          endwhile;     ?>

     <?php         $row_start = 1;         while ( have_posts() ) : the_post();          if( $row_start % 2 == 0) {// even             get_template_part( 'blog','item');         }         ++$row_start;          endwhile;     ?>
   Any help is appreciated!


K balls in N boxes, no boxes contain 1 ball

Haven't been able to find something similar, hope this isn't redundant. I've managed to widdle down a problem to a k balls in n boxes (boxes and balls being distinguishable). All assumptions are pretty classic (equiprobability, without exclusion, etc.) and I am looking to find the probability of no boxes containing exactly one ball.    I thought I'd arrive to a meaningful result by using Jordon's formula and being a bit smart about defining the events, but I've been hitting dead ends for days. I was wondering if a combinatorial approach could work. It is not very far from trivial when looking for how many combinations leave no box empty, I imagine it has to be possible. I worked a bit on trying to count those scenarios with very little success. If anyone could confirm or deny that the approach is possible or suggest a new one I'd be happy to dig it :)  Thanks in advance, Cheers!  //EDIT  To make the problem a bit more interesting, how about we divide the k balls into two categories (let's go for j black ones and k-j white ones) and look for the probability that no black ball is alone in one box.  To clarify, two black balls in one box do not count, as a white ball alone in a box. The only scenario that counts is a black ball being alone in any box.  Here is the approach I've been using: We start by placing the black balls at random in the n boxes (non exclusive) and then count possible arrangements of white balls not leaving any black ball alone using occupancy vectors. Only problem is that occupancy do not account for the variety of the balls, or at least how I've been using them.  Any ideas/novel approaches from here?  Thanks again!


I am using ubuntu 14.04 LTS. Every time a software is updated it downloads the full software of new version. I feel like some optimization might help us make it faster with fewer data downloading. Maybe software sources could tell us which portion of software has been updated. Why is this not done?  I'm not looking for any tools. I'm asking why OS don't do this.


Which book can i  refer to gain a great deal of  aspects on Schwarzchild metric without any tensor calculus


When should I create a service for a class?

It seems that in Drupal code anything that is neither hook nor Plugin nor Controller nor any other thing with a standard functionality should be a Service. For sure, services make sense when we want to give other modules the possibility to change the functionality that we are writing. But I can think of a lot of scenarios where it is absolutely sufficient to have a normal class. When we just want to create an instance, call a method, nothing else. How can I decide if a class is sufficient, or if a service makes sense? Edit This is not opinion based. There must be a clear and objective reason why we use services in Drupal, and I want to know this reason.


Bash command does not execute from script, but works when entered in terminal

I have some strange problem with a very simple script. I am setting LD_LIBRARY_PATH for a library. When I type this command in terminal:  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/some/path echo $LD_LIBRARY_PATH   Output from echo showed the linker path is correctly added. But when I put the exact same command into a .sh file:  #!bin/bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/some/path   After execution, output from echo showed the linker path is not added. The script has been set to executable, and executed from correct directory. Could someone let me know what may have gone wrong? Thank you!


I wanted to put an image from a company onto my 3D model. How would I do this with blender cycles? I have the image file and I want to put it on the torso of my character (which is about 4 faces put together) I would really appreciate any help!


Integer reciprocals in arithmetic progression

Let $m_1,m_2,\ldots,m_k$ be $k$ positive integers such that their reciprocals are in AP. Show that $k<m_1+2$. Also find such a sequence.     Whatever way I tried, whichever formula I used, I could not eliminate the $m_k$ term, which I reckon would be the ideal scenario to find the solution. I am exhausted of any further ideas, please help. Thank you.


Cycles not rendering image or movie clip used as background in the viewport

First time I've used cycles rendering engine.  I'm using a movie clip as the background in short animation. Selected RBGA under Property Tab, and Transparent under Film Tab.  It looks good and individual frames in OpenGL active viewport render, and looks fine.  When I try to get it to spit out PNG files of the finished animation the objects render out fine, except no movie clip background as Blender Render engine did when using Paper Sky setting.  Operator error, or am I trying to do something Cycles won't do?  Haven't found an answer in my searches so far.  Can anyone point me in the right direction please.   Addition:  I think I found my problem after a couple more hours of research.  Post should read "operator ignorance" instead of operator error.  Too tired to try the solution tonight, everything looks better in the morning. Thanks anyway.  Sorry, I just saw your posts.  Really tired.  Much appreciation.


how do I install myself as owner in 14.04?

How do I install myself as owner?  The system keeps telling me I'm not authorized.  I put in my profile but that didn't seem to do anything.


Texture look lighter in material view than in render view

So i am trying to texture my mesh with cycles render and im wondering why does my mesh look better on render view than in material view with the textures? In material view it is so mutch lighter. Is there a way to fix it? or is there anything to fix it and its just like it is?  Also tips and tricks for texturing is appreciated  Here is an image:


Use Canon DPP only to correct lens for my Powershot G7X Mark II and export RAW

I recently bought a Canon Powershot G7X Mark II. I am using Linux and I found darktable to be a decent photo editor. However, my RAW pictures come with a distortion which darkens the corners and displays my photos as if I had some vignette on them.  I looked at the  camera list and the Mark II model is not supported yet.  Then I learned about Canon's DPP, which does have lens correction included. It does it automatically, it is already done by the time I open the photos in the DPP.  Besides the DPP only being available in Windows, I can't figure out the way to apply the lens correction on the RAW files and store them somewhere accessible from Linux.  I have saved a few of these files in TIFF format, so I could see if they're as editable as a RAW. However, when I compare the edited files in darktable (RAW vs TIFF), they're clearly different.


Carrying two iPads (and other electronics) to India from USA

I will be taking two iPads (one iPad Air and one iPad Mini) to India from the USA. One of them I bought in India (I have the receipt) and one I bought while in the US. I am not carrying a laptop with me.    I am also carrying two Apple TV with me, inside my checked in luggage and maybe couple wristwatches as well.    Will there be any problem with customs in India?


Geographical landing pages not showing up on Google search results

Problem we have: One markets' geographical landing pages do not appear on search results.  Few months ago we discovered that robots.txt are blocking Google from indexing that markets' pages. We fixed it. Resubmitted the sitemap to Search Console.  Few months have passed but: 1. Search Console is not showing any results for the geo landing pages (last 90 days). 2. Google Analytics shows only few (11) pageviews in the past 2 months.  We cannot figure out where to look next.   Any ideas?  Regards, Kristina


How to prevent a secondary HDD from spinning down?

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.


Need to select an input name with hook inside

My code:  document.querySelector('input[name=fos_user_registration_form[gender]]:checked')   it doesn't work because of [gender].   Do you have an idea to select this type of input ?


"Good for Me!" as a response to someone doing something nice for you

I have done many nice things for a relative (e.g. reorganize the outdoor deck space) and upon seeing whatever I try & do nice for her she replies "Good for Me!"    I find this offensive—am I wrong?  What is she actually saying when she says "Good for me", so I can explain it to her?


VirtualBox Drive Error (kernel driver not installed (rc=-1908) )

So, I am using a Thinkpad by lenovo. I have been upgrading it every year, and it runs Very good for its model age. I have Installed VirtualBox On my system. I like crunchbang because of its style. So, what i did with VirtualBox is that I Made a Virtual Machine for Windows 7 In VirtualBox. Everytime I Start It, the same   "kernel driver not installed (rc=-1908)" Error   comes up. I have tried the /etc/init.d/vboxdrv setup Command, and nothing works. the terminal Refuses it, and says that the command is not a Command. I'm Actually Trying to use VirtualBox to DJ With Virtual DJ. Icecasting doesnt work on linux, so that is the reason why i was trying to make a Windows 7 Virtual Machine. Please Help, I'm only 14, and my knowledge of the internet is Very big, But my knowledge of Errors is really shitty. Thank you -Ray


I am a U.S. citizen and will be laying over in Paris for 23 hours.  I want to go into Paris and look around.  Will I need to have a visa or something to do so?


This is one of the most famous and trending question in today's world. Well , before you answer this question I want to say that before answering this question you must know about the Big Bang Theory & Big Bang Theory .  { My motive to ask this question is that think deeply to answer this question and not by guesses .}


Is the product of two factorial always smaller than the factorial of the sum?

Let's imagine that we have two positive integers $k_1$ and $k_2$ so that $k = k_1 + k_2$. Can we assume that for any pair of $k_1$, $k_2$: $$ k_1! k_2! \leq k! \quad \text{?} $$ Intuitively, I would say yes, but I'm looking for a proof.


A day before I had a reputation of 1430 but next day my reputation changed to 1428, with no trace of any reputation change. Can some one guide me what could have possibly happened?


In a list, should it be 'A,' 'B,' 'C,', etc., or 'A', 'B', 'C'?  Should commas go inside or outside?


Is AirBnb categorized as "hotel" or "staying with a person" for schengen visa online application from India? I am confused about putting hotel name and other details like phone number and email. Staying with a person probably means without paying, but I paid for AirBnb. Please help.


I want to know how I can make a simple renderfarm. I won't use the network render plugin because it is boring and doesn't support single image rendering (it does so only rendering it on one node). So is there any scalable solution for building a big rendering cluster like ILM (Industrial Light and Magic) is using with loads of cores and ram. As operating system, ubuntu or some other linux distributions should be used.  It should be a free and easy solution.


Java if-else with nested switch statement: the speed of sound

Alright, so my teacher gave me the question here:  The speed of sound depends on the material the sound is passing through. Below is the approximate speed of sound (in feet per second) for air, water and steel:  air: 1,100 feet per second water: 4,900 feet per second steel: 16,400 feet per second   Write a program  that asks the user to enter “air”, “water”, or “steel”, and the distance that a sound wave will travel in the medium. The program  should then display the amount of time it will take.  Prompts And Output . The program  prompts for the medium with: "Enter one of the following: air, water, or steel: " and reads the medium. If the medium is not air, water or steel the program  prints the message : "Sorry, you must enter air, water, or steel." an nothing else. Otherwise the program  prompts for the distance with ("Enter the distance the sound wave will travel: " and reads it in and then prints "It will take x seconds." where x is the time calculated by your program .   and this is what I have so far.  import java.util.Scanner; //Scanner for input //Class name public class TheSpeedOfSound {  public static void main(String[] args)//main section  {   //varibles   String speed;   double distance;         double time;   //set scanner   Scanner keyboard = new Scanner(System.in);   //ask for the type of speed input   System.out.println("Enter one of the following: air, water, or steel: ");   speed = keyboard.nextString();   //determine if it is a correct variable       if (speed = "air" || speed = "water" || speed = "steel")          //ask for the distance input          System.out.println("Enter the distance the sound wave will travel: ");        distance = keyboard.nextDouble();          //set switch          switch (speed)          {          //determine which speed used             case "air":                time = distance/1100;                System.out.print("It will take" + time + "seconds.");                break;             case "water":                time = distance/4900;                System.out.print("It will take" + time + "seconds.");                break;             case "steel":                time = distance/16400;                System.out.print("It will take" + time + "seconds.");                break;          }       else          System.out.print("Sorry, you must enter air, water, or steel.");     } }    My problem is that apparently the nested switch statement messes up the if-else statement and the program recognizes the else near the end of the program as part of a separate if-else statement. I've tried switching the if and else statements contents and that only succeeded in the program not recognizing the (period) in:       speed = keyboard.nextString    So, how might I get around this conundrum? straight up answers are not requested, but hints or similar examples would be appreciated.


Transit between terminals at Dubai airport

I will be traveling from Bombay to Tbilisi with a halt at Dubai.  Now the arrival at Dubai is in terminal 1 by jet airways and departure is from terminal 2 by fly Dubai. The transit time is 7 hours and 30 minutes. Is there a shuttle service within the airport for which I will not require a transit visa or will I have to leave through immigration and then travel outside by road to terminal 2 for which I will require a visa. I'll be traveling with my Indian passport.  PS. I have spoken to jet airways and they said they will give my boarding pass for flydubai in Bombay itself, but they are not sure with the visa.


90s Sci-Fi series about a vigilante with a bullet proof suit

I'm trying to find an old series that I saw on TV in the 90s.  I don't remember exactly the plot just fragments but it was about a vigilante of some sort. I remember he had a cool black costume that had some sort of force field around it that made it bullet proof. I remember a motorcycle too (not sure though) which also had the same force field.  It was a short TV series or maybe it was a pilot for something that didn't make it into a series.


Is there a Stack Exchange site for software architecture questions?

The stackoverflow.com guidelines request specific questions that programmers would ask, no vague questions that would elicit discussion or debate. But as an architect a lot of my questions are just that. In a lot of cases I'm looking for other professionals opinions on a topic. An example is a question I was planning on asking today: "What are considered the best architectures for high volume data capture?" I have a need to design a system to capture a lot of small data elements and wanted to hear other opinions of the best way to do that.    Is there a Stack Exchange site to discuss those kinds of questions?


Why isn't tension in a tug-of-war twice the balance's reading?

I have a question related to how the reading of the balance is equal to the tension of the string. In my opinion, the reading of the balance should be twice as much as the tension. This is the diagram I drew:  Here isn't it very obvious that there are $2$ forces acting on the spring and pulling it in opposite directions, each with a magnitude $10N$? Therefore in my opinion, the reading $= 20N$. But of course, it isn't so, the reading is $=10N$. I want to know what is wrong in my reasoning.


Can I send a link from my phone to my desktop?

I have "Chrome To Phone" that lets me click a button on my desktop browser to open the page on my mobile.  I'd like to be able to do the reverse -- sometimes, you take one look at a page and decide that it just isn't suitable for reading on a phone.  I know that I can look at the "tabs on other devices" in Chrome (from the desktop) and see the open page on my phone, but I don't always remember to do so.  I'd like a "push", rather than a "pull".


How do I find the sources of a 'Can't reach this page' in the notification area?

The screen grab shows a notification that reappears seemingly at random. I have tried turning off Avast and MBAM in case they are blocking a web request but it didnt help. The image has scroll bars and scrolling down offers a 'Refresh this page' link but clicking it doesn't help. The notification does n ot time out and remains until I log out. I recently updated to Win10 2004 but had to roll back because it was unstable. Now rolled back to 1909. I also tried dism /online /cleanup-image /restorehealth - the log shows so problems were fixed. I also tried sfc/scannow which fixed some issues. However this still keeps appearing. Any help tracking down the app that is raising this notification would be much appreciated. I have tried to research checking what web pages are being requested - but didn't get anywhere. Image showing screen grab of lower right corner of screen: shows a customised 404 page:


How can I delete multiple Facebook Posts on my timeline?

I'm trying to clean my Facebook profile's Timeline, but I don't like the idea of going through them all posts and delete one by one.  Is there any tool, option or something that I'm missing, that allows you to delete multiple posts simultaneously?     Note: I'm talking about Timeline posts, not a Facebook Page as I found  mentioning that


This problem comes up a lot when I write text that describes other's work.     to enable personalized Web searches was first proposed in [32], however in [9] it was showed to be computationally inefficient. [33] iterated upon the method and made it suitable for real-time use....   My question is if this is poor style? I've written such paragraphs myself but I have also seen them in real, published research. Hence the question.


Was Thanos immune to the annihilation wave?

In Avengers: Infinity War Thanos was building the Infinity Gauntlet to annihilate half of the living beings.       After he collected all the Infinity Stones, he snapped his fingers and unleashed the wave.   Was he immune to the annihilation, or unleashing it was for Thanos like pulling the trigger in Russian roulette with 50% chance of committing the suicide?


As an ESL teacher, I am currently teaching the topic on nouns as adjectives. Some examples are shoe shop, boat-race, apple tree, etc. One of the rules of nouns as adjectives that I have learnt is that when nouns are used an adjectives, they are usually in singular form. Some cases that seem like exceptions but aren't really, are news reporter and sales manager, as we all know that news and sales are really singular nouns ending with an s.   But for these other job titles, Systems Analyst and Systems Manager, could anyone give me a clear explanation on why we use the plural form systems instead of its singular form before I resort to telling them it's an exception?


Question titles collapse "-- " (double minus signs) to "-- " (mdash)

-- in a title is collapsed to —. This probably isn't so great if the title  .  Is this intended behavior?    Running this query on data.stackexchange (I don't claim to be good at SQL):  SELECT     sum(case when Title LIKE '% -- %' then 1 else 0 end) AS [mdash],     sum(case when Title LIKE '% <!-- %' then 1 else 0 end) AS [comment],     sum(case when Title LIKE '%[a-z0-9]-- %' then 1 else 0 end) AS [decrement],     sum(case when Title LIKE '% --[a-z0-9]%' then 1 else 0 end) AS [increment],     sum(case when (Title LIKE '%-- %' OR Title LIKE '%--- %')               and Title NOT LIKE '% -- %'               and Title NOT LIKE '% <!-- %'               and Title NOT LIKE '%[a-z0-9]-- %'               and Title NOT LIKE '% --[a-z0-9]%' then 1 else 0 end) AS [uncategorized] FROM Posts   I get the following results:  mdash comment decrement increment uncategorized 7665  34      368       1752      472   The vast majority of valid uses cases would be unaffected by Tim Stone's proposal


how to search a name that include apostrophe in SQL

i want to search a title that include apostrophe in it. i call the title from variable.  for example:  $mytitle = "Daddy's Home";   then i try to search it.  $apostrophe = $val; $replacementsapostrophe = [ "'" => "''", ]; $newval = strtr($apostrophe, $replacementsapostrophe);  $query2 = $db->prepare ("SELECT category, id_master_post, master_post_name FROM `master_post` WHERE master_post_name = '$newval'"); $query2->execute(); $value2 = $query2->fetch();   Error given     Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or   access violation: 1064 You have an error in your SQL syntax; check the   manual that corresponds to your MariaDB server version for the right   syntax to use near 's Home 2'' at line 1 in   C:\xampp\htdocs\piratefiles\list.php:31 Stack trace: #0   C:\xampp\htdocs\piratefiles\list.php(31): PDOStatement->execute() #1   {main} thrown in C:\xampp\htdocs\piratefiles\list.php on line 31   im already try '%''%' still not working.


cut command behaving differently when its output is " * "

I am trying to create a shell script, below is a part of which where i am trying to extract some value from a record in a file:  tgt_val=`cat $file_name | grep "$string_name" | cut -d"|" -f$column_no`   This work perfectly when the specified column has some numeric or string value however it fails when th column has value as " * "  eg:  102|Sam|*|USA   This command would work correctly for column 1,2 & 4  However in case of column 3 it gives me output as all the files in present directory.  Someone please help over this.


Let $f(x)=\log x$, and $g(x)=x^i$, where $0<i<1$. How can I correctly proof that $f(x)=o(g(x))$?  Try 1: By the definition of little-o, a function is little-o of other function if $|f(x)|\leq C|g(x)|$ for all $x>m$. I was thinking of choosing $i$ to be 1, then proof that $\log x = o(x)$ but I am not sure if this is correct.


In a quaternion, are j and k not just equal to i?

I have been listening to many videos and reading but I am very confused. Firstly, I read that quaternions exist in $\mathbb{R}^4$ which would seem to exclude imaginary numbers completely (I would have guessed). But secondly, if a quaternion is sort of like a complex number, why do we need $j$ and $k,$ why can't we just use $i$ throughout ($a+ib+jc+kd$) is different somehow than ($a+ib+ic+id$) and if so, in what way does $i$ differ from $j$ and $k$? Also, if quaternions have something to do with rotation is 3D space, why is a quaternion in a hypersphere? If we want to do something with rotations in on the plane, is 3D space involved?


Why should the second PCA vector i.e. vector with largest variance in reduced subspace be orthogonal to the first PCA vector?


Identifying a "finding Earth" series of SciFi novels

I am trying to remember a SciF series of books I started reading in my early to mid-teens (1980-86) where the main character was searching for humanity's mythical home planet Earth, which I never did finish.  These were generally paperbacks I borrowed from the library or picked up in 2nd hand book shops.  The main character (male) was a mercenary who made his way from planet to planet financing his space fares by taking various contracts, generally each novel's main plot involved a single contract, but with a larger story arc of searching for humanity's lost home planet.  Unique things I remember about the series;   The main character tended to wear a one piece combat suit, like chain mail covered in some kind of polymer plastic. He was a skillful knife fighter. Interplanetary travel took time, rich passengers took drugs which slowed down their perception of time and aging. Slow-time? Each planet had a shanty town around the spaceport in which lived unfortunates who could no longer pay for passage off world. There was a religious order who fed these unfortunates at the cost of brainwashing them against violence. Most characters don't believe in the one home world myth, due to the number of races of human. At one point the main character gains the spectrum fingerprint of Earth's sun.   Some vague plots I remember from the series;   Searching for immortality fungus on a world overrun by fungi. Hunting giant lizards for gems that grew in their brains.


Question: An ant starts at one vertex of a solid cube with side of unity length. Calculate the distance of the shortest route the ant can take to the furthest vertex from the starting point.  Now, in the answer, the cuboid is unfolded and a rectangle of side 1 and 2 is formed. Calculating the hyptoneuse gives the distance.   That was the proposed solution. I wanted to calculate it via sqrt(1+1+1). Why is my answer wrong?


Disable the ">" operator in Rstudio linux terminal

For an interactive session via SSH on a Linux cluster in Rstudio, it is very easy to accidentally execute the keyboard shortcut for "run in terminal" when commands are highlighted in Rstudio console. This results in behavior such as  \> library   or  Var1>Var2   being executed in terminal, which creates a library or Var2 file in the remote working directory if the terminal is logged in at the bash prompt.   In a worst case scenario this would result in overwriting files in the remote working directory.   I would like to disable ">" in these sessions, but I am not sure how to do this.


When to use bold, italics, small caps, typewriter etc.?

I'm a little confused on the purposes of each kind of text in LaTeX. I know the function of some of them, but sometimes people use each for different reasons. For example:   \texttt is for code (no discussion right?). \emph is to make emphasis. \textsc is used for names, right? \textbf when should I use it? \textmd When should I use it?   And something more: If I write for example "HI-TECH C PIC Compiler" in between a paragraph, the capital words doesn't look very good. Is it convenient to use \textsf?  Can normal text be mixed with different types? Under which circumstances?  P.S: I'm using the article class with the normal font.


how to redirect with jquery a page to another when a counter ends?

Hello programmers this is my question today, what function in jquery do i need so when a counter reach the number 100 that page is redirected to the main menu?


Is cancer caused by vitamin B17 deficiency?

I have read in an article on the internet that cancer is caused due to deficiency of vitamin B17 which has been removed from our diets long ago in the western food. But some people say that vitamin B17 does not work. So, is it deficiency of vitamin B17 which causes cancer i.e. can this vitamin really be used to cure cancer?