Read backspace, DEL and friends from stdin in pure Python?

If one googles backspace python stdin or so, there are a lot of SO results and none that solve my problem. They are all about what the backspace char is not how to get it.     Here's a function that reads a single keypress from stdin, courtesy :  def read_single_keypress():     import termios, fcntl, sys, os     fd = sys.stdin.fileno()     # save old state     flags_save = fcntl.fcntl(fd, fcntl.F_GETFL)     attrs_save = termios.tcgetattr(fd)     # make raw - the way to do this comes from the termios(3) man page.     attrs = list(attrs_save) # copy the stored version to update     # iflag     attrs[0] &= ~(termios.IGNBRK | termios.BRKINT | termios.PARMRK                   | termios.ISTRIP | termios.INLCR | termios. IGNCR                   | termios.ICRNL | termios.IXON )     # oflag     attrs[1] &= ~termios.OPOST     # cflag     attrs[2] &= ~(termios.CSIZE | termios. PARENB)     attrs[2] |= termios.CS8     # lflag     attrs[3] &= ~(termios.ECHONL | termios.ECHO | termios.ICANON                   | termios.ISIG | termios.IEXTEN)     termios.tcsetattr(fd, termios.TCSANOW, attrs)     # turn off non-blocking     fcntl.fcntl(fd, fcntl.F_SETFL, flags_save & ~os.O_NONBLOCK)     # read a single keystroke     try:         ret = sys.stdin.read(1) # returns a single character     except KeyboardInterrupt:         ret = 0     finally:         # restore old state         termios.tcsetattr(fd, termios.TCSAFLUSH, attrs_save)         fcntl.fcntl(fd, fcntl.F_SETFL, flags_save)     return ret   Hacky as it is, it would appear to be cross-platform.  Implementing that is a utility function from :  def until(char) -> str:     """get chars of stdin until char is read"""     import sys     y = ""     sys.stdout.flush()     while True:         i = read_single_keypress()         _ = sys.stdout.write(i)         sys.stdout.flush()         if i == char or i == 0:             break         y += i     return y   Which works really well, except pressing backspace does nothing, and you can't move the cursor (which import readline; input() allows you to (at least on a Python built with GNU Readline)).  I understand the fact that the best way to implement both of these is probably curses. I also understand that curses defeats the standard-libraryness and cross-platformness of this module.  What I'm looking for is a way to read stdin in a way that will capture backspace, and, for a special bonus, DEL and preferably the arrow keys too.  The module targets Pythons both 2 and 3, but I'm okay with a solution that targets just Python 3, because people really need to stop using 2.    If you think I'm flaming mad for wanting to do this without curses, well, that's the point.


There are a fair number of questions which are fine content-wise, but which suffer from poor presentation due to the poster's lack of command of English. Such questions may seem obscure or downright non-sensical to an impatient reader, but to a fellow native speaker the mistakes and intended meaning are perfectly obvious.  Perhaps it would make sense to solicit specific editing help from fellow native speakers? This could consist of a tag saying something like "edit-from:arabic" or so, and anyone familiar with typical beginner's mistakes in English of native Arabic speakers would be able to bring out the intended meaning, and remove the tag in the edit. As an extra feature, users could register themselves as "bilingual" and get alerted about appropriate edit requests.  What do you think?


The theorem 1 is the result in Emil Bjornson's paper (PILOT-BASED BAYESIAN CHANNEL NORM ESTIMATION IN RAYLEIGH FADING MULTI-ANTENNA SYSTEMS).  I want to know the proof omitted. Please, help me.


On standardizing features for glmnet during a nested CV

I have noticed from some of the questions posted here, who also post their line of code, that they have set the standardize option of glmnet to "FALSE".    It seems that users either: 1) just use the default standardize=TRUE and let glmnet automatically standardize the variables prior to fitting the model sequence, 2) or set to standardize=FALSE and rescale the variables themselves.  I have tried to track how cvglmnet codes implement variable standardization but have not been able to find out how it is done.   How the variables are standardized  in the code are especially of interest to me because I am running glmnet on nested cross validation, which means that I would have to constantly rescale my variables each time my training set and test set changes, correct?  (Rescale both training data and test data to have values ranging from 0 to 1 based on the min and max of the training data).   To this end, I have been trying to edit parts of the glmnet code...so that the inputs to the glmnet, cvglmnet, lognet, cvlognet functions will be the rescaled values calculated according to the current training set's min and max. I am wondering whether it is right to do so, and am wondering how are other glmnet users standardizing their variables?


Suppose A is a transitive set. Prove that P(A) is also a transitive set.

Anyone has any idea on how to proof the statement? I have been struggling as I don't even know how to start


Is RSA key size the size of private key exponent?

I have implemented a key pair generation scheme for RSA algorithm. I have taken the length of private key exponent as RSA key size, but then I've got to know that RSA key size is the size of the modulus $n$. Is it wrong to take RSA key size as the size of the private key exponent?  To generate a private key of 1024 bits, I increase the size of private key exponent regardless the modulus $n$.


The whole div remains on left, I tried withe below but no luck    .captionhome {   width: 600px;   padding: 10px;   border: 5px solid black;   margin: 50px;   font-weight: bold;   font-size: 16px;   text-align: center; }
WARNING: This product contains nicotine. Nicotine is an addictive chemical.


Is it okay to have a series in a series? If not then is there another way to structure it?

"In a research process you need to identify the problem, review related literature, set the research questions, objectives and hypothesis, choose the study design and sample design, collect, process and analyze data, and write the report." This is a series and the series inside it are:  set the research questions, objectives and hypothesis   choose the study design and sample design   collect, process and analyze data  I think the sentence looks ugly and somewhat incomprehensible. Is there a better way to structure this sentence? Is the series in a series allowed?


AC calculation with a Defense Fighter + Shield + Defensive duelist

I try to create a lvl 4 character with a lot of AC. I'm not sure if it's ''legal''  So here it is:   Studded leather armor : 12 AC Dex mod : +3 Shield + 2 AC Fighter Defensive style : +1 Ac Feat Defensive Duelist : +2 AC (In reaction with Finesse weapon) Also use Shield spell sometimes if possible? : +5 AC   Is there anything that prevents all of these to work at the same time?


I found that some say managed code and unmanaged code. What is the difference? Is it only for .Net?


Hi, I'm trying to fit this large matrix equation into the page margins, but I keep getting double subscript error, any suggestions are welcome, tnx!  Here is the code:  \begin{equation}\\ %\renewcommand*{\arraystretch}{1.1} \resizebox{1 \textwidth}{!}  {$ \begin{bmatrix} V_{A} \\ V_{B} \\ V_{C} \\ 0\\ 0\\ 0\\ \end{bmatrix} = \begin{bmatrix} R_A+X_{AA} & X_{AB} & X_{AC} & X_{AN_1} & X_{AN_2} & R_{AG}+X_{AG} \\ X_{BA} & R_B+X_{BB} & X_{BC} & X_{BN_1}& X_{BN_2} & R_{BG}+X_{BG} \\ X_{CA} & X_{CB} & R_C+X_{CC} & X_{CN_1}  & X_{CN_2} & R_{CG}+X_{CG} \\ X_{N_1A} & X_{N_1B} & X_{N_1C} & R_N_1 +X_{N_1N_1} & X_{N_1N_2} & R_{N_1G}+X_{N_1G} \\ X_{N_2A} & X_{N_2B} & X_{N_2C} & X_{N_2N_1} & R_{N_2}+X_{N_2N_2} & R{N_2G}+ X_{N_2G} \\ * &* &* &* &* &*\\ \end{bmatrix} \begin{bmatrix} I_{A} \\ I_{B} \\ I_{C} \\ I_{N_1} \\ I_{N_2}\\ I_G\\ \end{bmatrix} $} \end{equation}


How to make left-right transition of overlay image ffmpeg

I have used the below command to make a left to right transition of overlay image over a video.     ffmpeg -i Test.mp4 -i transparent.png -filter_complex   "overlay=x='if(gte(t,0), -w+(t)*100, 3)':y=450" out.mp4   The overlay image is moving from left to right continuously. I need it to stop at certain point, like a left to right transition. How to do that?


What is the plural of the abbreviation of "multiplicity automaton", "MA" or "MAs"?

The "multiplicity automaton (MA)" is a model in compute science and its plural is "multiplicity automata". Should the plural of the abbreviation be MA or MAs?      is not a duplicate as it is focused on cases like "ATMs" where the expanded form "automated teller machines" has a regular plural ending in "s." Unlike "machines," the word "automata" has an irregular plural that does not end in "s." It's unclear from the linked answers how abbreviations that end in words like this should be pluralized. A high-ranking  mentions "VIPs," but a high-ranking  says     VIPs' is a strange one. It could be argued that the expanded acronym,   when pluralized, should be 'Very Important People' rather than 'Very   Important Persons'. Using this argument, 'VIP' could be used as a   singular or plural noun. "The VIP has arrived." "The VIP have   arrived." I'm not sure anyone else would agree with my logic, though.


How would gravitons be detected indirectly or directly, in space or on earth? And what experiments are going on to find gravitons?


Can't connect Realtek RTL8821CE WiFi on Lenovo Ideapad

I am using  (). I am novice to ubuntu. I installed it along with windows 10. I can't connect wifi in ubuntu 20.04. I don't have any other source to connect the device except wifi. Plz help.   sudo lshw|grep -A15 'network\|Wireless' [sudo] password for ripon:   *-network UNCLAIMED             description: Network controller             product: RTL8821CE 802.11ac PCIe Wireless Network Adapter             vendor: Realtek Semiconductor Co., Ltd.             physical id: 0             bus info: pci@0000:01:00.0             version: 00             width: 64 bits             clock: 33MHz             capabilities: pm msi pciexpress bus_master cap_list             configuration: latency=0             resources: ioport:3000(size=256) memory:a1200000-a120ffff     *-pci:1          description: PCI bridge          product: Cannon Point-LP PCI Express Root Port #13          vendor: Intel Corporation          physical id: 1d.4          bus info: pci@0000:00:1d.4   lspci -knn | grep Net -A3; rfkill list  01:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter [10ec:c821]     Subsystem: Lenovo RTL8821CE 802.11ac PCIe Wireless Network Adapter [17aa:c024] 02:00.0 Non-Volatile memory controller [0108]: Phison Electronics Corporation E12 NVMe Controller [1987:5012] (rev 01)     Subsystem: Phison Electronics Corporation E12 NVMe Controller [1987:5012]     Kernel driver in use: nvme 0: hci0: Bluetooth     Soft blocked: no     Hard blocked: no


K-means: Why minimizing WCSS is maximizing Distance between clusters?

From a conceptual and algorithmic standpoint, I understand how K-means works. However, from a mathematical standpoint, I don't understand why minimizing the WCSS (within-cluster sums of squares) will necessarily maximize the distance between clusters. In other words, can somebody show how this  is equal to maximizing the distance between clusters? It would be helpful to see a derivation that shows all of the steps or please point me to the appropriate reference(s).  Update I found this Witten and Tibshirani  but it isn't obvious how to get from equation 7 to equation 8.


No menu bar in gedit 3.18.3 on Ubuntu 16.04

Gedit usually shows the menu bar when the mouse is hovered over the top of Unity (desktop) no matter where or how gedit is displayed. This is ok.  When started from terminal using   sudo gedit   there is no menu bar anywhere.   crashed the system.  Alt+F does not work.  "To show the menu in the window's title bar go to Settings >> Appearance >> Behavior and click Show Menu In The Window's Title Bar." from   This change does work normally but still no menu bar with sudo gedit  I could go on with at least 5 other attempts but figure you get the idea.  Can this be fixed?


Stack Overflow question  appears to have been protected by someone, but I can't see any evidence for it. Why?  As far as I can see, it's a pretty poor question without any answers from a user who has consistently posted poor questions just containing links to his site.  Am I missing something?


Can a Druid use Conjure Animals to conjure a new creature and then Wild Shape into it?

For example, let's say I have a level 8 Druid who has never seen a Quasit before, and I use the spell Conjure Animals to conjure 2 Quasits. On my next action, may I use my Wild Shape to change into a Quasit?


How font sizes at iPhone 6/6+ compare to earlier iPhones?

How font size is different in iPhone 6 / 6 Plus as compared to earlier iPhones (e.g. 5S)--given both the different screen size and DPI?   Did the perceived* font sizes in system interfaces and built-in apps grow proportionally with screen size?  [*] Perceived--i.e. as measured in milimeters/inches, not in pixels. What are Apple's guidelines for app developers in terms of font sizes for 6/6+ as compared to earlier iPhones? How strictly are they enforced via app moderation (or any other means)? Should all apps effectively demonstrate the same font size for similar UI elements, or they are allowed to decide on the size individually? Should DisplayZoom and Dynamic Type be strictly supported by every app developer?   The reason I'm asking is that with iPhone 4 I struggle with a small font in most of the apps I use--so curious whether it will change if I switch to iPhone 6/+.


How do I change the desktop background from command line?

How can I change my desktop background from command line?


What is the evidence that dark energy exists? (as of 2020)

Astrophysicists believe that dark energy exists and makes up ~70% of the universe's energy content. What is the evidence that dark energy exists? Wikipedia gives :   Supernovae. A specific type of supernovae (type 1A) are supposed to be standard candles - that is, their luminosity is known. In turn this lets us measure distance to faraway galaxies, check how fast those galaxies are receding from us, and check if that recession speed is increasing over time. CMB. Data from the Cosmic Microwave Background indicates the universe is approximately flat. Visible matter + dark matter can account for ~30% of the energy content required to make the universe flat, leaving ~70% for something else - dark energy. BAO. Baryon acoustic oscillations act as a "standard ruler" that lets us measure how the Hubble constant varies with redshift (i.e. time), and see if the recession speed is increasing with time. Late-time ISW. ISW stands for integrated Sachs-Wolfe effect. The idea is that, usually, a photon that enters a potential well gains energy as it falls in and loses energy as it emerges, and gain/loss exactly cancel. If a universe is expanding in accelerated fashion, then this is untrue; the potential wells / hills are smoothed out and there is a permanent shift in the photon's energy and therefore temperature. If we see a correlation between hot and cold spots on the CMB and the locations of superclusters and voids, then it's a sign of accelerated expansion. Galaxy evolution. This uses (known) evolution of early-type galaxies as a standard clock. Once we know how long it takes for a galaxy to evolve from one state to another, as well as their redshifts, we can reconstruct how the Hubble constant varies over time, and see if the recession speed is increasing with time.   Two questions:   Did I understand any of these five methods wrong? Are there any other lines of evidence for the existence of dark energy?


how to choose with javascript a select option html

I have to choose an option from a html file: <select id="color">     <option>red</option>     <option>yellow</option>     <option>green</option>     <option>orange</option> </select>  for example i want to select green. I have already tried: var color = "green" document.getElementById("color").options.value = color; document.getElementById("color").value = color;  but they don't work. (option tag must be withouth name, id, ...)


External monitor not detected on 13.04 on a Dell XPS 13 via Mini DP

I upgraded my Dell XPS 13 Developer Edition laptop from 12.04 to 13.04 and now it seems the Mini Display Port isn't working at all. I've tried using an Apple-branded Mini DP to VGA adaptor and a generic Mini DP to HDMI adaptor and neither is detected. Here's my terminal output:  hellocatfood@computerfood:~$ xrandr -q Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767 eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 294mm x 165mm    1920x1080      60.0*+   59.9     40.0      1680x1050      60.0     59.9      1600x1024      60.2      1400x1050      60.0      1280x1024      60.0      1440x900       59.9      1280x960       60.0      1360x768       59.8     60.0      1152x864       60.0      1024x768       60.0      800x600        60.3     56.2      640x480        59.9   VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis)   Any suggestions for making this work are very welcome!


Organization of a c++ program in memory - stack and heap

I am learning c++ and would like to know how a program like this is organized in primary-memory. I understand that there are a stack (with stackframes) and a heap. And I know that dynamically allocating something allocates it on the heap. This is done  by operators like malloc or new. But I cant see them in this small c++ program.   The program consists of a main-class and a class named MyClass. This class has:   one constructor one member variable (int) one member-function   The main-class defines an object to Myclass and as well defines a pointer to this object.  SO - how are all this organized in memory?  #include <iostream> using namespace std;  class MyClass {     int i; public:     MyClass(int n) {         i = n;     }     int get_nmbr() {         return this->i;     } };   int main() {     MyClass myClass(100), *p;     cout << myClass.get_nmbr() << endl;     p = &myClass;     cout << p;     return 0; }


How should a ? What are the factors to consider? What are the pros and cons of the variants?  Factors that makes up a good URI   Stability over time Short Give the user an idea what is linked Easy to type Easy to guess (relevant only for a few links like "/jobs") Search engine friendly URI schema should be consistent over the whole site URI schema should allow future extensions   Any more?  Examples   example.com/articles/3252 example.com/articles/how+to+design+good+uri example.com/articles/3252/how+to+design+good+uri example.com/good-uri-design example.com/articles/good-uri-design example.com/a/good-uri-design


I have visited usr/bin directory, but there's no file called cat. How can I find where cat file is stored? I also used Linux global search which did not work. Thanks


Connection pooling and multi-threaded applications

Can connection pooling be used only in multi-threaded or multi-process applications?   Is it possible to make use of connection pooling in web application implemented using PHP and MySQL?  If yes, please provide an example of such an application.


why console message display multiple times?

i make a simple example in jquery .In my example user can added multiple entries using add button. Example "one" ,"two" .There is 'X' text in each entry .I am binding click event on 'X' span .    Issue event is bind multiple times why ? example add two entry "one" and "two" .click "X" on first entry (one) .it show console message two times why ?  $(function() {     $('#btn').click(clickhandler)     function clickhandler(params) {         var user= $('.username').val();         var str = '
'+user +'  X
'          $('#wrapper').append(str);         $('.abc').on('click',function () {           console.log($(this).prev('span').text())          })     } })   Thanks


Are escape pods placed at strategic locations around the Enterprise?

In Star Trek: Beyond I noticed that Kirk ejects directly from the bridge when the Enterprise is going to crash.   Does he have the only escape pod that ejects from the bridge? Is is so he can give final orders on the bridge before ejecting?   Surely there is not enough room on the bridge for all the crew. Do other key members of the crew have their escape pods at their respective stations?   I would expect to find Bones' pod in the sickbay.   Do the enlisted crew have their pods down below or perhaps at a muster area?


How do the Incredible Hulk's pants stay on but not his shirt?

I guess I can live with the fact that the  changes size drastically when he transforms, but why does his shirt rip off and not his pants?  I think that we need a little better answer than "it keeps us tied to the fact that inside he's still human".


Why doesn't this perpetual motion machine using the buoyant force work?

I realize this isn't possible, but I can't see why not, especially if you change the model a little bit so that the balls simply travel through a tube of water on the way up, rather than exactly this model.  Please be clear and detailed.  I've heard explanations like "the balls wouldn't move" but that doesn't do it for me - I really do not see why the balls on the right would not be pulled/pushed up, and the rest of the chain wouldn't continue on.


Oscillations of Dielectric Slab in Parallel plate capacitor

In the book Principles of Physics by Resnick Halliday: The decrease in Potential energy of a parallel plate capacitor due to a dielectric is because the slab would start to oscillate and the energy would transfer back and forth between the kinetic energy of the moving slab and potential energy stored in the electric field. First of, can somebody provide me the math of the SHM and could somebody explain why it would become the potential of the capacitor i.e. the electric field and not the potential of the slab? As the slab is doing SHM, shouldn't the slab(and not the capacitor) have potential energy at one point of time and kinetic at another like a spring? If the SHM is because of the electric field due to the conducting plates in capacitors, won't they always be in one direction (Plus, it's magnitude is not even a function of distance!)? Could someone be kind enough to provide the math and the reason for Potential and Kinetic Energy transfer question?


What is a reasonable depth and diameter for postholes dug in clay soil to support an 8' fence?

What is a reasonable depth and diameter for postholes dug in clay soil where the frost line is no more than 12” and that will support an 8 foot tall solid wood fence that uses PostMaster metal posts?  I hope to have someone else install an 8 foot high PT wood fence.  There will be no light or air passing through or under the fence and it will be heavier than average, given the additional height and board weight.  One side will run for 135’.  The attached diagram provides more detail.  The PostMaster Installation Instructions describe a 30” deep, sloped, 10” diameter hole, filled with 6” of gravel plus 24” of concrete for a 6 foot high fence.  They caveat that the “exact diameter and depth will be determined by local weather and soil conditions.”  Got it.  Huntsville, AL; very clay soil.  Maximum wind gusts of 65 mph.  (This is not in the normal tornado path and is not intended to withstand a tornado.)  In reviewing the StackExchange posts on fencing and post holes I came across the concept that the diameter of the pier may be increased to compensate for a shallower post hole.  I would like to know the recommended depth and diameter without relying on the 2 buttress posts, which are my small overbuild idea.  We will be able to walk under them.  26 APR 18 update: I just found a Master Halco youtube video specifying 6-8" diameter holes dug 36" deep for an 8' board-on-board fence, such as I would like to have.   - I also spoke to a fence builder experienced using PostMaster posts who opined that the 10" diameter and 30 deep holes were more than adequate, but that the gravel was of no value in our climate.  So, 30" x 10" dia inches of concrete vs. 36" x 8" dia of concrete.


Is there an equivalent of $\pm$ but for $\times$ and $\div$?

Is there mathematical sign that combines multiplication ($\times$) and division ($\div$) operations? Would that ever be used? For example $4({\times}{\div})2$ would give $8$ and $2$, like $4\pm 2$ would give $6$ and $2$.


Claims and questions regarding $n$-ball distribution?

CONTEXT  In my research, I am utilizing an $n$-ball distributions along with two related distributions. I'd like to make certain I have a firm handle on the way to describe my three distributions. I have been looking for reference books on the subject [1], I've got some guidance, but have not been able to find what I'm looking for yet.   In this post, I attempt to deal with the simplest case that i am concerned with. I'm modelling my approach to this based on the format I find on wikipedia (e.g. [2])  QUESTIONS   What is the characteristic function of the uniform distribution on a ball in $\mathbb{R}^𝑛$? [edit: solution offered by @whuber in the below solution.]  What is the entropy of the uniform distribution on a ball in $\mathbb{R}^𝑛$? [edit: solution offered by @whuber in the below comment.]  MY UNDERSTANDING  The $n$-ball distribution here is a generalization of the uniform distribution.   Parameters  By $n\in \mathbb{N}$ I denote  the dimension of the ball.  By $R\in \mathbb{R}, R>0$ I denote the radius of the $n$-ball.  By $\gamma$ I denote a parametrization of the $n$-ball given as $\gamma: (0,R) \times  \left[0, \pi\right) \times \cdots \times  \left[0, \pi\right)  \times \left[0, 2\pi\right) \rightarrow \mathbb{R}^n$, which is defined by: $$\gamma\begin{pmatrix}r\\\\ \phi_1 \\\\ \vdots \\\\ \phi_{n-1}\end{pmatrix} \rightarrow   \begin{bmatrix}    r \cos{(\phi_{1})} \prod\limits_{i=1}^{1-1} \sin{(\phi_{i })} \\\\   r \cos{(\phi_{2})} \prod\limits_{i=1}^{2-1} \sin{(\phi_{i })} \\\\   \vdots \\\\   r   \cos{(\phi_{n-1 })} \prod\limits_{i=1}^{n-1-1}   \sin{(\phi_{i })} \\\\   r   \prod\limits_{i=1}^{n-1}   \sin{(\phi_{i })} \end{bmatrix}. $$  Support $$i = {1, 2, \ldots, n}$$ $$x_i = (-R,R)$$ $$0\leq \sum_{i=1}^{n}x_i^2 < R^2$$  Probability Density Function  With respect to the indicator for the $n$-ball, $\mathcal{I}(\left\|\textbf{x}\right\|_2 <R)$, the probability density is $$\frac{\Gamma\left(\frac{n}{2} + 1\right)}{\pi^\frac{n}{2} R^n}\,\mathcal{I}(\left\|\textbf{x}\right\|_2 <R)$$  Mean  $$E(X_i) = 0$$  Variance  $$\textrm{Var}(X_i) = \dfrac{1}{n+2} R^2$$  $$\textrm{Cov}(X_i,X_j) = 0\quad\quad i \neq j$$  Entropy  $$\log\left(\frac{\Gamma\left(\frac{n}{2} + 1\right)}{\pi^\frac{n}{2} R^n}\right)$$  Characteristic function  $$\phi_n(t) = e^{-i\frac{|t|}{R}} \,_1F_1\left(\frac{n+1}{2};n+1; i\frac{2|t|}{R}\right).$$  BIBLIOGRAPHY  [1]   [2]


How to make Windows 10 BSOD show more details like older versions of Windows

I would like to know if there's any way to make Windows 10 show more details when crashing like Windows 7 did. In Windows 10, the Blue Screen of Death:    hides the parameters of the kernel panic:    The MSDN article  explains how to attach a debugger in the section titled "Reading Bug Check Information from the Debugger".  Motivation  I have a BSOD issue right now (). If you can help with it it would be great.  We do need the actual log files (called .dmp files) as they contain the only record of the sequence of events leading up to the crash, what drivers were loaded, what was responsible, etc.  Answered own question from Microsoft  Thanks for the help I just had to reinstall my windows using the UEFI method. It seems my BIOS firmware has buggy legacy support - I think.  When I'm using UEFI method to boot into a new version of Ubuntu there are no kernal panics. Everything runs smoothly.


Listing line number of results in `find` and `ls`

Is it possible with either find or ls to see, in a list of results, if any given entry is the nth result, what n is?  So, for example, pretend ls -l returns:  total 0 -rw-rw---- 1 bigdog bigdog 0 Jan  3 17:13 a -rw-rw---- 1 bigdog bigdog 0 Jan  3 17:13 b -rw-rw---- 1 bigdog bigdog 0 Jan  3 17:13 c   Is there a way to get ls to return 1,2,3 for files a,b,c respectively?  Or, find . -type f returns:  ./a ./b ./c   Any way to get something like:  1 ./a 2 ./b 3 ./c   I am aware of ls  | wc -l and the like, but that is not what I'm looking for.


How do I parse a string to a float or int?

In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or parse the string "31" to an integer, 31?  I just want to know how to parse a float str to a float, and (separately) an int str to an int.


How to prevent open tasks from being reassigned when opportunity owner is changed?

Salesforce transfers ownership of all open tasks on the opportunity currently if the opportunity owner is changed. How can I write my trigger to prevent this from happening?


Angle between lines joining tetrahedron center to vertices

What are the angles formed at the center of a tetrahedron if you draw lines to the vertices?  I'm trying to make these:     I need to know what angles to bend the metal.


Is there a limit to how many credentials SSMS can remember?

Using SQL Server Management Studio that came with SQL Server 2008 R2, I make connections to the same server using a number of different sets of SQL Server Authentication credentials. On my development machine, I use the Remember password checkbox extensively to avoid having to look up the password each time.  When I choose a Login which I have previously connected with (using Remember password), the Password entry field gets populated with asterisks, and clicking Connect allows me in - most of the time. But sometimes, with no pattern that I can discern, on choosing a previously-used Login, the Password field will prepopulate with asterisks, but clicking Connect tells me the login fails. I enter the password, click Connect, and get in, and then typically the next time I use the same login it will work.  My suspicion is that there is a maximum number of credentials that SSMS is prepared to remember, and only the most-recently-used n credentials are actually remembered, but I can't find any mention of such behaviour in the documentation.  Is there a known limit on how many credentials SSMS will remember?


First item on center and second item at last in flex

Pretty common question I guess, but couldn't find any solution to fix it.  Code is:

A

B

   Should look like this:    first-item will be at middle and second-item should be at last.  What I've tried:  .container {   display: flex;   justify-content: center; }  .container .second-item {   align-self: flex-end; }   How could I achieve it using flex or in any other way of css?


Trigonometric Functions And Identities Question .

If $A$ , $B$ and $C$ are the angles of a triangle , I have to show that :   $ \tan^2 \cfrac{A}{2} + \tan^2 \cfrac{B}{2} + \tan^2 \cfrac{C}{2} \ge 1 $ .   I had only arrived at $A+B+C = \pi $ , thus $\cfrac{A}{2} + \cfrac{B}{2} + \cfrac{C}{2} = \cfrac{\pi}{2} $   What to do next?


How to direct main domain pages to sub domain

One of my client had a wordpress website say www.example.com.au in wordpress  As they wanted to have separate websites for different locations, we created subdomains for each location like sydney.example.com.au,  melbourne.example.com.au and perth.example.com.au.  For this we moved the main site www.examle.com.au to sydney.example.com.au and  created a html landing page on the main url www.example.com.au. Also created 2 websites for other 2 sub domains.   Thr landing page has 3 buttons for users to choose specific location websites like sydney.example.com.au or melbourne.example.com.au or perth.example.com.au. All three sub domain sites are built in wordpress.   What I want to accomplish is www.example.com.au to stay as it is and  www.example.com.au/about-us/ to be redirected to sydney.example.com.au/about-us/  www.example.com.au/team/ to be redirected to sydney.example.com.au/team/  www.example.com.au/faq/ to be redirected to sydney.example.com.au/faq/  www.example.com.au/contact-us/ to be redirected to sydney.example.com.au/contact-us/  If you can help write htaccess redirects, it would be highly appreciated


When does Thorncaster Sliver's ability resolve?

When you attack with  and the ability triggers, does it do the damage from the attack first or the ability first?


Compare: Which is bigger? $3^{\sqrt2}$ or $2^{\sqrt 3}$

Compare: Which is bigger? $\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad$ $\Large{3^{\sqrt2}}\quad$ or  $\quad \Large{2^{\sqrt 3}}$  My attempts: Let,  $\quad$ $a=3^{\sqrt 2}$ and $b=2^{\sqrt 3}$ We have  $$a^\sqrt{3}=3^\sqrt{6}\\ b^\sqrt{3}=8<3^{\sqrt{4}}<3^\sqrt{6}=a^\sqrt{3} $$ $$a^\sqrt{3}>b^\sqrt{3} \Longrightarrow a>b$$  Question-1:  Is my solution correct?  Question-2:  I saw the following solution was approved on another site.  But, the last line seems wrong to me. Am I right?


Creating if-else statement for two combo boxes in ArcGIS API for JavaScript?

I have an ArcGIS JS API application where I have an "origin" combo box that must be populated for request type, in the following series of combo boxes I would like for a value to be chosen based on the 1st value.  If I have an e-waste item chosen in my request type box, I would like for the second series of boxes to contain an e-waste product before the request can be submitted. This holds true for the other request type values and the following series.  My initial code which does not allow a request to be submitted unless a value is chosen in the request type box is;   function ValicateRequestData() { if (dijit.byId("cbRequestType").getValue() == "") {     ShowSpanErrorMessage("spanServiceErrorMessage", messages.getElementsByTagName("spanErrorMsgType")[0].childNodes[0].nodeValue);     return false; }  if (dijit.byId("cbRequestType").getValue() == "") {     ShowSpanErrorMessage("spanServiceErrorMessage", messages.getElementsByTagName("spanErrorMsgType")[0].childNodes[0].nodeValue);     return false; }   The above box populates with items such as bulky items, e-waste, etc.  I would then like a second box "cbMFEWASTE" to have  a value required if e-waste is chosen in the above box before a request is submitted...  my application is based on the ArcGIS Public Info Center JS API App


Is there any easier (less no. of steps or calculations) proof for this using congruences: $89|2^{44}-1$. My proof: $$2^6\equiv-25\mod89$$ $$2^5\equiv32\mod89$$ Now square both equations: $$2^{12}\equiv625\equiv2\mod89$$ $$2^{10}\equiv-44\mod89$$ Now multiplying: $$2^{22}\equiv-88\equiv1\mod89$$ Since $2^{44}-1=(2^{22}+1)(2^{22}-1)$, it is proved.


C# Need faster method to find the maximum double value from a sub array

I need a faster method to find the maximum double value from a sub array.  This is how I do it now:  static double FindMax(double[] x, int startIndex, int endIndex) {     int i = startIndex;     double max = x[i++];     double value;     while(i <= endIndex)     {         value = x[i++];         if (value > max) max = value;     }     return max; }   But it is a bit slow. I need a faster method. Any tips?


I wanted the following url www.example.com/userprofile.php?username=username To www.example.com/username  Below is my htaccess file  Options All -Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] RewriteRule ^([^\.]+)$ $1index [NC,L] RewriteRule ^([^\.]+)$ $1login [NC,L] RewriteRule ^(.*)$ userprofile.php?username=$1 [QSA]   When i type www.example.com/username the GET username is echoed as   username.php   I've tried everything but can't get a solution  Any help is appreciated


I've been working on a web app using Django, and I'm curious if there is a way to schedule a job to run periodically.   Basically I just want to run through the database and make some calculations/updates on an automatic, regular basis, but I can't seem to find any documentation on doing this.  Does anyone know how to set this up?  To clarify:  I know I can set up a cron job to do this, but I'm curious if there is some feature in Django that provides this functionality.   I'd like people to be able to deploy this app themselves without having to do much config (preferably zero).  I've considered triggering these actions "retroactively" by simply checking if a job should have been run since the last time a request was sent to the site, but I'm hoping for something a bit cleaner.


How can I remove the password protection from a RAR archive?

I have a directory in which there are lots of password protected .RAR files/archives.  The passwords of these individual archives are known.  I want to remove the password protection from all of them without extracting the contents. Since each file is larger than 1 GB, decompressing & then recompressing without password encryption is not a good option for me. How can I easily do that? I'm using WinRAR 3.80 on Win7. Any other 3rd party tools are welcomed.


If schadenfreude is pleasure from another’s misery, what is displeasure caused by another’s success.


On average, how many times must I roll a dice until I get a $6$?  I got this question from a book called Fifty Challenging Problems in Probability.   The answer is $6$, and I understand the solution the book has given me. However, I want to know why the following logic does not work: The chance that we do not get a $6$ is $5/6$. In order to find the number of dice rolls needed, I want the probability of there being a $6$ in $n$ rolls being $1/2$ in order to find the average. So I solve the equation $(5/6)^n=1/2$, which gives me $n=3.8$-ish. That number makes sense to me intuitively, where the number $6$ does not make sense intuitively. I feel like on average, I would need to roll about $3$-$4$ times to get a $6$. Sometimes, I will have to roll less than $3$-$4$ times, and sometimes I will have to roll more than $3$-$4$ times.  Please note that I am not asking how to solve this question, but what is wrong with my logic above.  Thank you!


What does it mean to "brick" your phone?

I'm considering unlocking the bootloader on my Verizon Galaxy S3 (SCH-I535).  However, a  I was reading made this statement:     Once you have unlocked your phone’s bootloader using this app, you must not receive any over-the-air (OTA) updates or via Samsung Kies. Doing so will result in bricking your phone.   I understand that bricking a phone means rendering it unusable, but does this also mean unrecoverable?  When a phone is "bricked", does that mean it is virtually impossible to restore it to a working state?  I'm a little concerned about the risk if that is the case.


ITIN-Issue-IRS requesting for original passport/Certified copies

I have submitted my wife's ITIN application (W7) along with 2012 federal tax return copy at the local tax office on 14th March 2013 in NJ. The person at the tax office did verified my wife's Passport, W7 form and he returned few last papers from my TAX returns with a stamp on it stating "RECEIVED WITH REMITTANCE" and finally told us it will take 8 weeks to get the ITIN and Refund if my Refund is approved.  Again on April 15th I received a notice form IRS requesting original passport or certified copies from the authority who issued the passport even though IRS official has verified the original passport. I chose the second option and certified the passport copies  from Indian embassy and did an express mail to IRS   did anyone has any issues even after sending the certified copies   Please share.


I came across this line in a site:      Can u make sth effective for a sports betting related product?   I can't understand what is meant by sth effective here. I tried to google it but was unable to understand. Can anybody explain to me what is meant by this word? Is it an English word or is it from another language?


How can I evaluate $\int_{-\infty}^{\infty} e^{-x^2} dx$ without using polar coordinates

I know from probability class that the area under the bell curve $e^{-x^2}$ is $\sqrt{\pi}$. I would like to be able to verify this, so in other words, solve this integral: $$\int_{-\infty}^{\infty} e^{-x^2} dx $$ The proof we saw in class used polar coordinates, but I don't like polar coordinates! Is there another way to evalutuate it?  Thanks!


finitely generated k-algebra and polynomial ring

Let $k$ be a field and let $A \neq 0$ be a finitely generated $k$-algebra, and $x_1, \cdots, x_n$ generate $A$ as a $k$-algebra. Is there any relationship(inclusion, homomorphism, etc.) between $A$ and $k[x_1,\cdots,x_n]$?  How about the case if $x_1,\cdots,x_n$ are algebraically independent over $k$?


Modifying (i.e., partially overriding) microtype's character protrusion settings for specific characters

I would like to disable or modify character protrusion (enabled by microtype) for specific characters.  Let me illustrate the issue with the en-dash, which protrudes far too wide for my taste:     (left: without protrusion; right: with protrusion)  I am however unable to disable protrusion with \SetProtrusion:  \documentclass{memoir} \usepackage{mathptmx} \usepackage[T3,T1]{fontenc} \usepackage{microtype} %\usepackage[protrusion=false]{microtype} \SetProtrusion   { encoding = T1,     family   = ptm }   { \textendash = {,0} }   \begin{document}  Word word word word word word word word word word word word word word -- word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word ...  \end{document}   I also get the following warning:  Package microtype Warning: protrusion codes list `ptm-T1' will override list (microtype)                `q.tex/9' for font `T1/ptm///' on input line 105.   According to , including a line \LoadMicrotypeFile{ptm} just before \SetProtrusion helps; if I try this, this does seem to address the issue for -- (\textendash), but (1) the annoying warning stays and (2) my code disables all protrusion (by overriding the whole list of protrusion values with my short list). What is the right way to partially override default character protrusion settings? Ideally there will be a way that does away with any warnings while not disabling important microtype functionality.


Why is my array element not allowing me to set a value to it?

I am writing a homework assignment that creates a full deck of 52 cards. I am having a slight problem at line 18.    hearts[x].setSuit("Hearts");   Here is the rest of the code:   public class FullDeck  { public static void main(String[] args) {     //Creates four arrays for each deck     Card[] hearts = new Card[13];     Card[] clubs = new Card[13];     Card[] spades = new Card[13];     Card[] diamonds = new Card[13];        //Fills the hearts deck      for(int x = 0; x < hearts.length; ++x)     {          hearts[x].setSuit("Hearts");         hearts[x].setValue(x+1);         System.out.println("The " + hearts[x].getRank() + " of " + hearts[x].getSuit());     }    } }   The client class for the Card type:  public class Card { private String suit; private int value; private String rank; public String getSuit() {   return suit; } public int getValue() {   return value; } public String getRank() {   return rank; } public void setSuit(String s) {   suit = s; } public void setValue(int v) {   final int LOW = 1;   final int HIGH = 13;   if(v >= LOW && v <= HIGH)      value = v;    else      value = LOW;   if(value == 1)     rank = "Ace";   else     if(value == 11)       rank ="Jack";     else       if(value == 12)          rank = "Queen";       else          if(value == 13)            rank = "King";          else            rank = Integer.toString(value);  }   }    If I could have a detailed explanation please as to what exactly is going wrong would be very appreciated :). I'm new to coding in java as well so any tips from veterans out there will be kindly noted, thank you!


Why do I have to solve for $x$ in this proof, if I choose not to find a counterexample?

If $x$ is irrational then $3x+2$ is irrational.  My Working:   Proof by contraposition:   $3x + 2$ is rational and $x$ is rational  $x = a/b$  $y = c/d$  $3x + 2 = c/d$  $3x = (c/d) - 2$  $x = c-2d/3d$  $a/b = c-2d / 3d$  I am having a hard time understanding as to why do we end up solving for $x$ in this equation to determine weather $3x+2$ is rational or not if $x$ is rational.


How to convert a list to string when retrieved from a config file?

I am trying to search for few strings from the logline and exclude those lines. If I try with string directly it works but if I read the strings from a config file, it doesn't. The problem is due to the type. Can someone put some light into this in converting the list to string? Code match1 = config.get('sky_messages', 'matches') match = list(match1.split(","))  print(match1) print(match) print(type(match1)) print(type(match))  Config File [sky_messages] matches = ['Conviva', 'conviva', 'EDID', 'CONVIVA']  Output ['Conviva', 'conviva', 'EDID', 'CONVIVA'] ["['Conviva'", " 'conviva'", " 'EDID'", " 'CONVIVA']"] <class 'str'> <class 'list'>  How can I get the string as match1?


Is there some in-Universe (or somewhat canonical) explanation for why Harry wears glasses - either 100% of the time, or at least, when playing Quiddich?  Surely, given assorted spells, there should be one to repair either the issues with his near-sightedness, or, more likely, to act as lenses (being how magic is used to replace ANY technology, it ought to be able to replace lense-making).   P.S. I seem to recall a spell to make someone see better from afar, but not sure of the details.


How can I generate a 1 Hz clock from 50 MHz clock coming from an Altera board?

I have an Altera DE2 board that outputs a 50 MHz clock and I'm trying to write a verilog module that can bring it down to 1 Hz. How can I do this?


Glossaries and custom section headings broken

I've a document, where I use the glossaries package to manage acronyms for me. Sometimes, I use a \gls{} command inside a section heading, and I have defined page headers to have the current section heading. However, when a section heading contains a \gls{} command, the headings for those pages render incorrectly, with what appears to be some code from the glossaries package appearing instead. MWE: \documentclass[a4paper, 12pt]{report} \usepackage[toc,xindy,nonumberlist,acronym,shortcuts]{glossaries} \usepackage{fancyhdr} \begin{document} \pagestyle{plain} \pagestyle{fancyplain} \renewcommand{\sectionmark}[1]{\markboth{\thesection #1}{}} \newacronym{ecg}{ECG}{electrocardiogram} \chapter{test} \gls{ecg} is ecg \pagebreak \section{\gls{ecg}} waffle here \end{document}  I should note, I am compiling this with TL2011, but I have also had a friend with TL2013 test it.


An approximate eigenvalue for $ T \in B(X) $.

This is a problem from Conway’s Functional Analysis:     Definition An approximate eigenvalue for $ T \in B(X) $ is a scalar $ \lambda $ such that there is a sequence of unit vectors $ x_{n} \in X $ such that $ T(x_{n}) - \lambda x_{n} \rightarrow 0 $.    Show that any eigenvalue for $ T $ is an approximate eigenvalue for $ T $, and that any approximate eigenvalue for $ T $ lies in the spectrum of $ T $, which we denote by $ \sigma(T) $. If $ X $ is a Hilbert space, show that $ \lambda \in \sigma(T) $ if and only if either $ \lambda $ is an approximate eigenvalue for $ T $ or $ \overline{\lambda} $ is an eigenvalue for $ T^{*} $.


Determining if an IP is within a specific range on Android

I need to check if an IP address is within a specific netmask, ex:  ip: 85.12.12.13 netmask: 85.12.0.0/14  I've no idea how to achieve this with java (Android), any tips ?


Showing the exponential sequence is strictly increasing

My goal is to show that the sequence   $$\left(\frac{1}{n} +1\right)^n = e^1$$  is strictly increasing. My attempt was to show this by induction. After checking for $n=1$ and $n=2$ I assumed it to be true for $n-$ and $n$:  $$\left(\frac{1}{n-1} +1\right)^{n-1} < \left(\frac{1}{n} +1\right)^n = $$  And then to show the inequality for $n$ and $n+1$. This led me nowhere. Another attempt was to secretly assume that I can view $n$ as a real parameter and then differentiate with respect to $n$. My thought was that if the resulting derivative was strictly positive for positive $n$ or rather $n\geq 1$ then the statement would hold. But I strongly suspect that this is not so easy as it seems.  Can anyone offer help?


I have previously asked question here but it was closed because I did not react fast enough I think. NEvertheless, my problem is still the same: I have a set of points (meteorological stations) with 5km buffers around them. Additionally, I have a set of polygons (municipalities) in which those stations are located. Each station buffer can be over 1,2,3... polygons and those can be completly different polygons.   I would like to have data on how much of the buffer is filled by each polygon but I was not able to find a function or a way to do it. So for example for point A I would have that in the buffer of 5km there is 80% of polygon B and 20% of polygon C as the output, so 4 values, two for IDs of the polygons and 2 for the percentage overlap (it could be only 2 values for other buffer or 6 etc. etc.).  Main difference to the other similar question provided is that I have 2 vector layers (Buffer with 500 buffers and Municipalities a shape file with 500 different polygons). Previous questions were analyzing this question in situations in which I know precisely the polygons and buffers analyzed, at least that is how I understood them, so after trying to use those approaches on my dataset I was not able to replicate them.


During the period between January and today, I have added many changes to my resume that i want to make an employer noticed of. I doubt between 'have done' and 'had done'.     " I would like to inform you that some changes have been brought to my resume from   the first time I had contacted you through your website(January 2014) "      Or      " I would like to inform you that some changes have been brought to my   resume from the first time I have contacted through your website(January 2014)"   Please to help me resolve the problem i have with past usage once and for all, any link or doc is highly appreciated.


Easiest way to setup Ubuntu as a VPN server

I know there are many tutorials on the net for setting up VPN client and server.  I you find one that is simple/short, I am interested only in the server part.   For client, I will use OS X so I prefer a solution that uses L2TP over IPsec or PPTP because I suppose Cisco IPsec would cost something.  I don't want to spent too many hours setting it up. You know, maybe someone already made a setup script :)  Note: I am using an EC2 micro instance running Ubuntu 12.04 on it.


If we can see the light reflected off objects, why can't we "see" light?

It's said that light is invisible because photons don't strike each other, then why we do see the reflected light from other objects?


The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from within a const function, or try to use a non-const function of a const object. So without copying the const approach, is there a methodology I can use in C# that has the same ends?    I'm aware of immutability, but that doesn't really carry over to container objects to name but one example.


Where to place user created systemd unit files

Where should I put systemd file for e.g. Nginx nginx.service or something like that on Ubuntu 16.04 ?


How do I drill a 2⅛ inch door knob hole over an existing 1½ inch hole?

I need to replace the door knob for this interior door:    The door knobs I've found at the stores require a 2⅛ inch hole.  Mine is only 1½:    Did door knobs used to be smaller?  Is there some place I can find a replacement door knob that will fit my door?  If I need to modify the door to fit a modern door knob, will the new hole completely overlap the old? and can I reuse the latch hole?


How to update libavcodec on Ubuntu 14.04 : vulnerability associated

The  fix to the error in Firefox showing libavcodec may be vulnerable is contained in the following , however the vulnerability referred to in the notification is not exactly described.     The libavcodec notification that Firefox displays does not make sense in situations where the reported vulnerability may not even exist because libavcodec is not installed. If the libavcodec vulnerability does not exist, the notification may be advising to install a supported version of libavcodec, but even so it does not explain why it should be installed.  What vulnerability is the Firefox notification reporting about? How is installing a libavcodec package that wasn't installed before from a PPA equivalent to fixing a vulnerability in libavcodec, and not equivalent to putting the cart before the horse?


In this first instance the main clause only stands alone if you  omit (then).  But in the other example it clearly has a main clause. So would this be classed as an embedded main clause as it only works as a independent clause if it's adjusted and or if it's joined with a dependent clause.  If I have enough money, then I will buy a new car.  If it rains, the picnic will be cancelled.  The picnic will be cancelled if it rains.


Will I lose all my files from XP OS if I install Ubuntu?

I have a simple question.  I have a disc particion to C, D and E on my Windows XP and I want to install Ubuntu.   Will I lose all my files from D and E (it's like 50 gb, and I don't have an external HDD) when I install Ubuntu? Or the system while installing it offers me options to save my files somewhere or...?


Overshoot when plotting fast oscillating function with pgfplots

When plotting fast oscillating data from a table with pgfplots, an overshoot of the curve was observed (due to interpolation?). If the same data was plotted using Matlab, no overshoot occurred. The same phenomenon was observed when plotting a fast oscillating function, instead of data from a table. Here is the minimum working example, where a chirp signal sin(x^2) is displayed:    \documentclass{article} \usepackage{pgfplots} \begin{document}  \begin{tikzpicture} \begin{axis}[xmin=0,xmax=150,ymin=-1.2,ymax=1.2,width=0.4\textwidth,height=0.3\textwidth]     \addplot[         thick,         mark=none,         domain=0:150,         samples=1000,     ] {sin(x^2)}; \end{axis} \end{tikzpicture}  \end{document}   The figure was compiled using PDFLaTeX, from the MiKTeX distribution. One can note that the curve overshoots 1 in absolute value, starting around the abscissa x=50. How to remove these spurious peaks?


Finding the shortest distance between two lines

I know how to find the distance between a point and a line, not between two lines.  Find the shortest distance between the lines $(-1,1,4) + t(1,1,-1)$ and $(5,3,-3) + s(-2,0,1)$  Any help would be appreciated.


If we want to transmit electic current for a long distance, we must minimize a heat that releases because of the resistanse. We cannot make a cable wide because it is expensive and it will be massive. So, we must decrease a current because $Q = I^2R\Delta t$. A power that we want to transmit is constant, $P = UI$, so we must increase the voltage. Nevertheless, $Q = \frac{U^2}{R}\Delta t$, so if we increase the voltage, the heat will increase too. And for addition, $U = IR$, so if we decrease the current, the voltage will decrease too.  Could you, explaine in details where I have a mistake.  P.S. sorry for my English, I am not a native speaker.


How to calculate the resistance of a complicated circuit?

I learned in high school the basic rules of how to compute resistance between two points, given a network of resistors.  You try to rearrange the circuit so into parallel parts and series parts, then compute the resistance of each piece individually using those rules, until you're left with just one number, and you're done.  Maybe I explained that poorly, so consider the following schematic:         – Schematic created using   Sorry it's so large, that seems to be the default.  Anyway, it's easy to compute the resistance from A to D (regardless of the values of the all the resistors)- A-B-D, A-D, and A-C-D are all series connections (easy to compute) then you combine them with the parallel formula and you're set.  But!  How do you compute the resistance from B to C?  There seem like lots of possible ways to think about it, and they all generate different answers.  I've left the specific numbers off the diagram because this isn't homework and I don't care about the answer specifically, I just want to understand the principles involved and how to solve the problem.  Any help, or links to especially readable guides, would be very much appreciated.


Display a complete number without scientific writing php

Hello I would like to display in my code a full number to 20 decimal without scientific notation. I think it's a memory problem in php. can you help me ? thanks function get($l, $c) {     $value = 0;      if (0 <= $c && $c <= $l && $l < 5000) {         $tab = [];          for ($i = 0; $i <= $l; $i++) {              for ($j = 0; $j <= $c; $j++) {                  if ($i == $j || $i - 1 <= 0 || $j <= 0) {                     $tab[$i][$j] = 1;                     $value = $tab[$i][$j];                 } elseif ($i != $j) {                     $tab[$i][$j] = ($tab[$i - 1][$j - 1]) + ($tab[$i - 1][$j]);                     $value = $tab[$i][$j];                 }             }         }     }     return $value; } echo get(67, 34); // found  :1.422652073762E+19 , excpected:14226520737620288370


Is there a name for artifacts for taking a photo of LCD / LED screens and how to remove or avoid it?

The following is a photo of a game console 3DS, although the 3D is turned off:    There is "fish nest" artifacts, and sometimes the lines even curve on some photos.  iPhotos on a Mac seems to try to minimize its effect, but if the window is being resized, the fish nest can change shape along the way of the resize, and then its effect is minimized once the resizing is done.  Is there a name for such artifacts, and are there ways to avoid it and/or correct it if that's the only photo you have?


add the user name to menu when user is logged in

i have this code but its not working it throws syntax error, unexpected '}' error  function my_custom_menu_item($items, $args) {     if(is_user_logged_in() && $args->theme_location == 'primary')     {         $user=wp_get_current_user();         $name=$user->display_name; // or user_login , user_firstname, user_lastname         $items .= '
Welcome '.$name.'
';         $items.= //Change Password, Logout, etc     }     elseif (!is_user_logged_in() && $args->theme_location == 'primary') {         $items .= '
Log In
';         $items.= //Sign up, Lost Password     }     return $items; } add_filter( 'wp_nav_menu_items', 'my_custom_menu_item');


In PostGIS, does casting an `ST_Envelope` to a geography take the earth's curvature into account?

Using PostGIS, I have a table of data with geographic points defined as last_known_coordinates GEOGRAPHY(POINT,4326). I want to find all of these within a geographic bounding box with given top left and bottom right geographic coordinates, and be sure that the calculations are geographic, not geometric, e.g. that the results account for the curvature of the earth. The query I'm using is roughly: SELECT * from table WHERE last_known_coordinates && ST_MakeEnvelope(?, ?, ?, ?, 4326)::geography  As you can tell I'm a bit new to this, and I know what I want, but not necessarily how to do it correctly. Other answers hint that this is correct, but I'd like to know for sure: Does the ST_Envelope produced by ST_MakeEnvelope, when cast to a geography, take the curvature of the earth into account?


I'm getting a List of object A, then I use Apache Commons Collection4 to transform the obtained List from having A instances to having B instances.      listOfBs = (List<B>) CollectionUtils.collect(listOfAs, componentTransformer);   However, eventually I need to have an Array of Bs not a List.  So my question is, which is faster.   Convert the list using CollectionUtils.collect Create an array using listOfBs.toArray(new B[listOfBs.size()])   Or   Loop over the listOfAs Transform each A object to a B object Add each B object to an array (B[])   The difference between the first approach and the second approach is that the first approach has much less code, but I'm not sure if the toArray method bares a hidden loop or expensive operations.  What I see in the second approach is that I'm sure I'll loop only once over the listOfAs list.  So which approach is faster ?


I am having trouble importing a big excel table into latex

I have an excel file including the following table. How should I create something similar to it? Is it better to use the table code in latex or make a figure from it and import it to latex (I did this but the quality of picture was so bad).  If I have to create a table, how should I automatically import those values to latex, because the values are too much to be written without any automatic routine.


I have to break out of the loop if the user inputs a specific input. But I am unable to do that using the if loop to break out of the while loop. I also tried using the same condition in the while loop as well, but that doesn't work either.   import java.util.Scanner;  public class Main {     public static void main(String[] args) {             String quit;         Scanner c = new Scanner(System.in);          while (true) {             leapOrNot y = new leapOrNot();               System.out.println("press x to stop or any other letter to continue");             quit = c.next();             if (quit == "x" || quit == "X") {                 break;             }        }     } }  class leapOrNot {     final String isLeap = " is a leap year.";     final String notLeap = " is not a leap year.";     int year;     public leapOrNot() {         Scanner a = new Scanner(System.in);         System.out.println("Enter a year after 1581: ");         year = a.nextInt();         /* if (a.hasNextInt() == false) {             System.out.println("Enter a 4 digit integer: ");             year = a.nextInt();         }         couldn't make this condition work either         */         while (year < 1582) {             System.out.println("The year must be after 1581. Enter a year after 1581: ");             year = a.nextInt();             continue;         }          if (year % 4 == 0) {             if(year % 400 == 0 && year % 100 == 0) {                 System.out.println(year + isLeap);             }             if (year % 100 == 0) {                 System.out.println(year + notLeap);             }             else {                  System.out.println(year + isLeap);             }         }         else {             System.out.println(year + notLeap);         }     } }


We are performing an inter-comparison experiment for three devices that can measure concentration (cells/mL). We take one solution and run it through each device, and we compute mean concentration and variance on that device. I would like to find the average of the means and weight it according to sample size and variance.  I found an example applet which illustrates calculation, but cannot determine the source code formula:     Given sample size, variance, and mean what is the formula for pooling these measurements to obtain an ensemble mean?  Is there a better approach?


How do you refer to letters of the alphabet?

If you're talking about a particular letter of the alphabet, how do you format it? Do you just write it? Do you put quotes around it? Do you italicize it? Do you just have to write it out?     Does the h come before the g or after it?   Does the 'h' come before the 'g' or after it?   Does the h come before the g or after it?   Does the aitch come before the gee or after it?      Which of those would be right? Any of them?


GT 730 Driver Installation Issues on Ubuntu 14.04 64-bit

I have purchased a PNY GeForce GT 730 Graphics Card for my Dell Inspiron i3-3240 desktop, but neither the nouveau drivers nor the proprietary NVIDIA drivers will get me past GRUB without a blank screen. After experimenting, I found that the VGA output after GRUB was being directed by the onboard integrated graphics card VGA.  I looked in the BIOS, but found no option to disable the onboard graphics; Dell Support has informed me that the option was not supported on my computer.  I have tried drivers nvidia-331 and nvidia-340 from the xorg-edgers PPA, the installed nouveau, and the drivers on NVIDIA's website, but all to no avail.  Any suggestions?


Essentially, I want to know how to run 2 (or more) find commands in one - an "or" search rather than an "and":  find . -name "*.pem" find . -name "*.crt"


Considering that all frames are equivalent, isn't it up to the observer to say "The earth turns around the sun" or "The sun turns around the earth"? Isn't this more or less like arguing about which meridian should be considered the null-meridian, or whether time should be counted according to years before/after Jesus Christ or the conquest of Mecca?


I want to justificate following equation:  $$\sum_{k=0}^n \frac{(-1)^k}{k!(n-k)!}\frac{1}{2k+1} = \frac{2^n}{(2n+1)!!}$$  I calculated the both sides for $n$ from 1 to 10 and it was true. How the mathematical induction can be applied to this equation? Or is there other way to justificate it?


How do apertures which seem too large to physically fit work?

A 400mm f4.0 lens is supposed to have a maximum aperture diameter of 10cm. Looking at such a lens they don't seem big enough to fit that kind of aperture including all the mechanics for control inside them. Do modern lenses have a way of focusing light into a smaller aperture to behave like a bigger one or are they really always the size that the formula (fstop = focal length / aperture diameter) suggests?


Can I filter stackoverflow.com dashboard ?  I mean, can I see questions related to 'python' or 'ruby' only on dashboard (when I am logged in) ?   Also, I am not sure if this is the right place to ask the question.


I have a Verizon Ellipsis 8 tablet, and I was wondering: should I be able to run Pokemon Go on it?   Each time I try to open up the app, it loads about 3/4 of the way and then it crashes. I have the newest software downloaded for it and I have tried a bunch of other things.   Any help would be appreciated.


I am using Windows 7 and have multiple FTP client applications working without any problem. However, when I use command-line FTP, I can get connected, log in (after entering user name and password), but it always gets disconnected when the dir or ls command is used. The response is:     Connection closed by remote host.   How can I fix this problem?


I have a two-dimensional image plotted by Matplotlib using the PGF backend. It is stored in the figures subdirectory (since I have a lot of images and don't want to clutter up the main folder). As an example of the generation process:  from matplotlib import pyplot as plt import numpy as np  plt.imshow(np.random.randn(200, 200)) plt.title('Some random data') plt.savefig('figures/test.pgf')   The figures subdirectory now contains test.pgf and the raster image test-img0.png. The PGF file includes the command \pgfimage[interpolate=true,width=4.810000in,height=4.810000in]{test-img0.png}} to include the PNG. Since it (by design) does not contain the figures/ prefix, I need to find a workaround. According to a comment at a top of the PGF file (and backed up by ) I can use the import package to make things work:  \documentclass{article}  \usepackage[margin=2cm]{geometry} \usepackage{import} \usepackage{pgf}  \begin{document}  \begin{figure} \begin{center} \import{figures/}{test.pgf} \end{center} \end{figure}  \end{document}   When I compile this (xelatex test), I get the message  Package pgf Warning: File "test-img0.png" not found when defining image "pgflastimage". (pgf) Tried all extensions in ".pdf:.jpg:.jpeg:.png:" on input line 62.   The PGF file is found, so the resulting PDF has the axes, title etc, but just a placeholder instead of the PNG.  I also tried defining \graphicspath{{figures/}} but PGF doesn't seem to use that either.   Adding the figures directory to the TEXINPUTS environment variable prior to compiling works, but it isn't the cleanest workaround. I could also edit the PGF file to include the path, but I'd have to do that every time I regenerate the image. Can anybody suggest why import isn't working, or an alternative method?


How to use Parameter in SQL WHERE clause?

My question is regarding a SQL server query.  Assume a user types a text "text1 text2 text3...textn" in a search textbox. Now I want to send this to a SELECT's  WHERE clause using a parameter.    cmd.Parameters.AddWithValue("@colname", textSearch.Text).    I want to write in this way    SELECT ... WHERE (colname LIKE text1 OR colname LIKE text2 OR colname LIKE text3 OR ....... colname LIKE textn)  OR (colname LIKE 'text1 text2 text3 ...textn')   How can I do this in SQL?


Calling functions from creating the function name

So I came into the problem of having functions with very similar names. For example, "func_this()", or "func_that()", and I wanted to create another function that would generate the string names of these functions, so that I can use it to call these functions. Here is an example code:  rand_var1 = "foobar" rand_var2 = "this" rand_var3 = "that"    def func_foobar():     print("Hello Foobar.") def func_this():     print("Hello This.") def func_that():     print("Hello That.")  def func_rand(var):     local_var = "func_" + var1  # to produce the func name     local_var()  # to call the func  func_rand(rand_var1)   Through "func_rand()", I want to create a "local_var" string that has the same name as a previously defined function. I want to then use this to call the function.   For example, if I pass in func_rand(rand_var1), it would create a variable, "local_var", that refers to the string "func_foobar". I want to then use "local_var()", hoping that it would do that same as "func_foobar()", but it does not work. I am new to Python and am not sure if there is any other way to do this. Help please :3


Exception by BufferedOutputStream.flush: Attempt to invoke virtual method 'void java.io.OutputStream.write(byte[], int, int)'

An app gets the following exception occasionally:  Stack trace:  java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.OutputStream.write(byte[], int, int)' on a null object reference     at java.io.BufferedOutputStream.flushInternal(BufferedOutputStream.java:185)     at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:85)   from:  bufferedOutputStream.flush()   I assume it is not because bufferedOutputStream is null, but something else.  If may understanding correct?  If so, what is it?  bufferedOutputStream.write(byteArrayData, iOffset, iDataLength); bufferedOutputStream.flush();


QGIS 1.8 Vector layer from ODBC connection

I have successfully set up an ODBC link from a FileMaker DB to QGIS, and using Layer/Add Vector Layer I can get a layer with a fully populated attribute table listed in the Layers Panel.  I now want to plot datapoints from the new layer but cannot work out how to tell QGIS that the new layer has georeferenced information and which fields contain the LAT/LONG data.  I guess that I am expecting to find a window similar to that which appears when you create a layer from a Tab Delimited file, where you define which fields contain the LAT/LONG data.  Can anyone help me out?  Thanks


Does Stephen Hawking believe that General Relativity is wrong?

Stephen Hawking recently said that black holes do not exist. According to Wikipedia, black holes are predicted by General Relativity. So it would seem to follow that Stephen Hawking believes that General Relativity is wrong.  Am I missing something?


I want to install an apk programmatically on Android 7. As I searched I have to use provider for that, but the app keeps crashing. I will be thankful if anyone could tell me why. Android manifest: (inside application tag)         <provider             android:name=".GenericFileProvider"             android:authorities="com.hamed.demo"             android:exported="false"             android:grantUriPermissions="true">             <meta-data                 android:name="android.support.FILE_PROVIDER_PATHS"                 android:resource="@xml/provider_paths"/>         </provider>  code to install: Intent install = new Intent(Intent.ACTION_VIEW); install.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); install.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); // the following line crashes Uri apkUri = FileProvider.getUriForFile(AppsList.this, BuildConfig.APPLICATION_ID + ".provider", file); install.setDataAndType(apkUri, downloadManager[0].getMimeTypeForDownloadedFile(downloadId)); startActivity(install);  provider_path.xml in res/xml: <?xml version="1.0" encoding="utf-8"?> <paths xmlns:android="http://schemas.android.com/apk/res/android">     <external-path name="external_files" path="."/> </paths>  and my GenericFileProvider class is exatly form  But when it reaches the line I added comment on, app crashes and I face this error: E/AndroidRuntime: FATAL EXCEPTION: main                   Process: com.hamed.demo, PID: 13090                   java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10000011 pkg=com.hamed.demo (has extras) } in com.hamed.demo.AppsList$6@ce55de9                       at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1153)                       at android.os.Handler.handleCallback(Handler.java:751)                       at android.os.Handler.dispatchMessage(Handler.java:95)                       at android.os.Looper.loop(Looper.java:241)                       at android.app.ActivityThread.main(ActivityThread.java:6274)                       at java.lang.reflect.Method.invoke(Native Method)                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)                    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.PackageItemInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference                       at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:584)                       at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:558)                       at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:400)                       at com.hamed.demo.AppsList$6.onReceive(AppsList.java:217)                       at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1143)                       at android.os.Handler.handleCallback(Handler.java:751)                        at android.os.Handler.dispatchMessage(Handler.java:95)                        at android.os.Looper.loop(Looper.java:241)                        at android.app.ActivityThread.main(ActivityThread.java:6274)                        at java.lang.reflect.Method.invoke(Native Method)                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)   If that matters, the downloaded apk is located in downloads directory of internal storage of the device. Thanks


Pi is defined as the ratio of $\frac{c}{r}$. Many ancient scintist try to find the value of pi. Some of the values are $\frac{22}{7}$(good hold upto 10 decimal point), $\frac{355}{113}$ (good hold upto 63 Decimal point).  modern computer determine upto million decimal point.   my qustion is that how ( algorithm  or formula ) modern computer find the value of pi ?


How does Linux kernel compare to microkernel architectures?

I read once that one advantage of a microkernel architecture is that you can stop/start essential services like networking and filesystems, without needing to restart the whole system. But considering that Linux kernel nowadays (was it always the case?) offers the option to use modules to achieve the same effect, what are the (remaining) advantages of a microkernel?


Indonesian citizen traveling LAX-YYZ-LHR-CAI; do I need transit visas?

I am an Indonesian citizen flying from Los Angeles (LAX), transiting in Canada at Toronto (YYZ), then transiting again in the U.K. at London (LHR), and going to Cairo (CAI), Egypt as my final destination.  Do I need transit visas for Toronto (YYZ) and London (LHR), considering both involve less then 6 hours' layover time? Would I need any other kind of visa?


Share internet from connected wifi like Connectify

Can i share Wifi like Connectify in ap mode? XUbuntu 14.04


Esaki effect implementation on simple oscillator circuit

I am trying to learn basic oscillator circuits with the help of this   But when I connected the components, my LED is not blinking. Rather, it is giving bright light.  The components I have used are 1K resistor 18V battery 200uF capacittor 2N2222 transistor and LED with 100 ohm resistance.  Here is the circuit:      From above page:


What would happen if you were to look at a picture of a Basilisk?

Would you be petrified by it, or would nothing happen? Or is it not possible to take a photo of a Basilisk?


Why does cold metal seem colder than cold air?

(I apologize for this elementary question. I don't know much about physics.)  Let's say that I put a metal pot in the refrigerator for several hours.  At this point, I guess, the pot and the air (in the refrigerator) have the same temperature.  Now, I touch this pot. It feels very cold. But when I "touch" the air (that is inside the fridge) it doesn't "feel" as cold. I don't feel the same "ouch!" that I feel when I touch the pot.  Why is that? Why does the metal seem colder than air although they both have the same temperature?  (I know that gas has less particles in it in one unit of volume compared to solids and liquids, but since "temperature" means "the average kinetic energy", these fewer air particles are supposed to hit my hand in a velocity that's going to compensate for their lower number, aren't they?)  A related question, for clarification:  If I use a thermometer to measure the temperature of the pot & air (let's assume it's a thermometer that has a probe that can touch objects), will it show the same reading for both? If so, what makes the thermometer different than my hand? I mean, my hand is sort of a thermometer, so why would it fail whereas a non-human thermometer would work?


What is the cover of the Ender's Game depicting?

I'm asking about the main cover used by the novel (found on most of the 1985 and 1991 editions), not about the movie tie-in cover.  The four individual items that I notice:   The planet (Earth? Bugger home planet? Ender's World?) Big artificial satellite (Battle School? Eros? Something else?) Small, yellow ship. (Shuttle to/from battle school? Fighter in third invasion? Colony ship?) Dots in space (ships? coordinates?)   Any ideas? Is it even one scene or is it just several stuff collaged together?


Ubuntu 16.04 does not install. (There is only the ubuntu start screen but no installation)

I want to install Ubuntu 16.04.  , but after choosing "Try Ubuntu" or "Install Ubuntu", there is only the , which seems to be loading, and stops.  After this, nothing moves. There is only the Ubuntu Screen but no Desktop or Installation Process.   Only command line opens.  What can I do to install Ubuntu 16.04 properly on UEFI (PC model: ASUS GL522 V)?


How to trim white spaces in a string in C?

I am trying to write a C program which trims any occurrence of white spaces in a string and prints the resultant string.But ain't getting the desired result and I am getting some random symbols as the output. Please help me.  #include<stdio.h> #include<string.h> int main() {     char s[100];char a[100];int i;     printf("enter the string:\n");     gets(s);     int len=strlen(s);     for(i=0;i<len;i++)     {          if(s[i]!=' ')          {              a[i]=s[i];          }     }      for(i=0;i<len;i++)     {          printf("%c",a[i]);     }    }      Input:  Hello Hello      Expected Output:  HelloHello.      Current Output:Hello◄Hello


I have tried to convert my php code using php to javascript ajax. Could you please correct me what supposed to gone wrong since my php code is still activate.  html code:  <form method="post" enctype="multipart/form-data" action="testadd.php"> <input type="file" name="image" id="image">
 <input type="submit" name="submit" value="upload" id="submit"> </form>   php:      <?php          if(isset($_POST['submit'])){             if(getimagesize($_FILES['image']['tmp_name']) == false){                   echo "Please select an image";                   echo "
";             }else{                 $image = addslashes($_FILES['image']['tmp_name']);                 $name = addslashes($_FILES['image']['name']);                 $image = file_get_contents($image);                 $image = base64_encode($image);                 saveImage($name, $image);            }          }          displayImage();          function saveImage($name, $image){           $con = new PDO("mysql:host=localhost; dbname=testimages", "root", "");           $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);           $stmt = $con->query("INSERT INTO images(id, name, image) VALUES(38836929, '$name', '$image') ON DUPLICATE KEY UPDATE image='$image', name='$name'");           $stmt->execute();         }         function displayImage(){             $con = new PDO("mysql:host=localhost; dbname=testimages", "root", "");             $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);             $stmt = $con->query("SELECT * FROM images");             $stmt->execute();             while($result = $stmt->fetch(PDO::FETCH_OBJ)){                  echo 'image . '">';                  echo '
';                  echo $result->name . ' ';             }         }   ?>   javascript:     $(document).ready(function(){     $("#submit").click(function(){          var image = document.getElementById("image").value;          alert(" " + image);          if(image == ""){             alert("please select image");         }else{             $.ajax({                 type: "POST",                 url: "testadd.php",                 data: "image=" + image,                 success: function(data){                     if(data == success){                         alert("test");                     }else{                         alert("fail");                     }                 }              });         }         return false;     }); });   Could you please check what supposed to be the problem in order to be fixed.


What's the physical meaning of the imaginary component of impedance?

As you know, impedance is defined as a complex number.  Ideal capacitors: $$ \frac {1} {j \omega C} \hspace{0.5 pc} \mathrm{or} \hspace{0.5 pc} \frac {1} {sC} $$  Ideal inductors: $$ j \omega L \hspace{0.5 pc} \mathrm{or} \hspace{0.5 pc} sL $$  I know that the reason why they 'invented' the concept of impedance is because it makes it easy to work with circuits in the frequency domain (or complex frequency domain).  However, since in real-life circuits both voltages and currents are real numbers, I'm wondering if there is any actual physical meaning behind the imaginary component of impedance.


Can connecting high demanding current devices to usb port damage it?

Lets say i powered a led strip rated at 5V and 3.6A by my laptop usb port via usb cable, what will happen?  -will it just be limited to 900mA since thats max current for usb 3.0  -or will it try draw out 3.6A from the usb port and break it  extra: what if i wired the led strip to an arduino that has a max current of 1A  and powered it with usb port, what will happen then?


Where does the energy required to stop a moving body come from and go?

For a long time, I have been thinking about this: In order to stop a moving body, I have to apply impulse to change the existing momentum to $0$. For the impulse I have to impart force on the moving body . That means I have to eliminate all the kinetic energy associated with the moving object in order to bring it to a halt. Thus, work is done on the object, right? If work is done, energy must be given by me...  Here is where my confusion arises:   If I eliminate the associated kinetic energy of the body, where does this energy go? The work(?) done by me on the moving object to stop it obviously uses energy from me. Again, where does this energy go?


I need the bounds/full extent of a WMS layer in Leaflet. I don't think L.TileLayer.WMS has a getBounds() method. I had this issue with L.ImageOverlay, and added the functionality via:  L.ImageOverlay.include({     getBounds: function () {         return this._bounds;     } });   Is there a solution for L.TileLayer.WMS? Or will I have to start parsing the WMS getCapabilities request for its LatLongBoundingBox or BoundingBox elements?  EDIT  I've just found a duplicate: . This question is still relevant, since Leaflet 1.0 has since been released.  EDIT 2   does not answer my question - its answer is to parse the getCapabilities response manually. Is there any other way?


I've rooted my phone.  Now what?  What do I gain from rooting?

This is a common question by those who have just rooted their phones.  What apps, ROMs, benefits, etc. do I get from rooting?  What should I be doing now?


Having a contructor extend into a sub-class from an abstract class?

I currently have an abstract class such as   abstract class Users {     private List<string> SelectedUsers;      public Users(List<string> SelectedUsers)     {         this.SelectedUsers = SelectedUsers;     } }   and a sub-class  class UsersTypeOne : Users {      //What do I put here in order to call the constructor in the abstract class }


Creating sharp edge between smooth mesh surfaces

I want to create a sharp edge between two smooth mesh surfaces. The upper surface has already been smoothed out nicely, merely using the Shading/UVs > Smooth Face function in the Tool Box (top left of picture), after selecting all its faces. However, when I do the same thing in the lower surface, the common edge between the two surfaces (= top edge of selected faces in picture) is also smoothed out (the picture is before that operation), which I don't want. I tried Shading/UVs => Smooth Edge=> Sharp, but that does not work. I don't want to use a modifier (because I want to control things intra object).


I would like to set up a server which could support a data science team in the following way: be a central point for storing, versioning, sharing and possible also executing Jupyter notebooks.  Some desired properties:   Different users can access the server and open and execute notebooks that were stored by them or by other team members. The interesting question here is what would be the behavior if user X executes cells in a notebook authored by user Y. I guess the notebook should NOT be changed: Solution should be self-hosted. Notebooks should be stored either on the server or on Google drive or on self-hosted instance of owncloud. (Bonus) Notebooks will be under git versioning control (git may be self-hosted. Cannot be bounded to GitHub or something of that sort).   I looked into  and . With the former, I didn't understand how to allow cross users access. The latter seems to only support GitHub as the storage of the notebooks.  Do you have experience with either of the solutions?


Finding the most popular tags on Careers

I am trying to find the tags on Stack Overflow Careers that have the most jobs. On most Stack Exchange sites, I can easily do this by clicking on the "Tags" link from the home page, but I don't see this link on Careers. How can I view the most popular tags?  EDIT: I tried accessing the URL  and that didn't work.


This question is from .     A combination on $n$ objects can be represented by an   $n$ bit binary vector, $(X_n, X_{n-1}, \dots, X_2, X_1)$,  where each bit,   $X_k \in \{1, 0\}$, expresses whether the corresponding object is   included in the combination or not. A set of combinations   can be represented by a set of the $n$ bit binary vectors.   We call such sets combination sets. Combination sets can   be regarded as subsets of the power set on $n$ object.      We can represent a combination set with a Boolean function by using n   input variables for each bit of the vector. The output value of the   function expresses whether each combination specified by the input   variables are included in the set or not. Such Boolean functions are   called characteristic functions. The operations of sets, such as   union, intersection, and difference, can be executed by logic   operations on characteristic functions.   Can anyone please make me understand this characteristic functions with an example?


cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?

The Case: I need to run some commands/script at certain intervals of time and for this I have two options:  set up a cron-job implement a loop with sleep in the script itself.  Question: Which is the better option from resource consumption point of view, why? Is cron the better way? Does cron use some kind of triggers or something making it efficient over the other? What procedure does cron use to check and start the jobs?


Let $a,b\in\mathbb{Z} \backslash \{0\}$. Show that  $a\mid b$, $b\mid a$ $\implies a=\pm b$.  I can see why this is true, but not write it down.


A couple has 2 children. What is the probability that the couple has one boy and one girl given that they have at least one girl?

This is what I have so far: All possible combinations:  BB GG BG GB  $P$(Boy $\mid$ Girl)$= 1/2$ given that the sample space is reduced to  GG and GB  However, I am not sure if this is the right way to approach this question.


Is there a command where I can teleport myself to a specific kind of block?

I can't find my house and I have specific kind of blocks in it like beacons, enchantment tables, furnaces, stuff like that. I didn't put a bed and I never viewed the coordinates.


Why static method cannot make values change unless I return the values

I learned static method today, and I am confused about how values change inside the static method.  When I write static method like this   public class test{ public static int printInt(int t,int n){ System.out.println(t); t= t + n; return n; } }   and call it in main  public class Method { public static int i; public static int m; public static void main(String[] args){     i = 5;     m = 6;      test.printInt(i,m);     System.out.println(i); } }   the t do not change as I suppose to. If the static method only make change into values that you return?


What are the common beep code alerts for most BIOS out there?    Author note: I'm posting this QA after finding an excelent resource leading from


Why is it always raining in Blade Runner universe (Los Angeles)?

Is there any explanation or background information that connects climate related changes with the timeline in Blade Runner?  There have been sprinkled info related to nuclear war, massive solar farms (2049), dead trees, etc.   Is there something I can read to know more about this movie's universe with regards to its climate?


Interpreting t-SNE dimensions in terms of the original features

I have a dataset of 223 multilabels. I'm sure some of those labels are correlated so I want to merge them. For that I'm using sklearn tSNE to reduce the dimensions.  How can I "describe" the new dimensions in terms of the former ones, I need something like this:  0.5(rock) + 0.1(pop)       generated popRock     0.2(rock) + 0.5(christian) generated christianRock


Ubuntu 18.04 login loop caused after running fsck

I have been a Linux (Ubuntu) user for over 5 years now, currently running Ubuntu 18.04 on my Acer laptop. I always put my laptop to sleep instead of shutting it down to resume from whatever I was doing quickly. Sometimes if I try restarting it, it boots to the advanced section saying some part of the disk is corrupt and requires I run fsck. I have never run into a major issue performing this operation until recently. After executing fsck on the /dev/sda4 (my main hard drive) I couldn't log in again . It became an infinite login loop. I tried every solution I found online but none worked. I created another user through tty and could successfully log into the new account, but not my own.  What else can I try?


Single variable complex analysis vs the world of the functions $f:\Bbb R^2 \to \Bbb R^2$.

Is there any advantage to studying  single variable complex analysis as it is right now instead of just studying the world of the functions $f:\Bbb R^2 \to \Bbb R^2$?  I'm asking this because any function $\gamma: \Bbb C\to \Bbb C$ can be written as $\gamma(z)=u(x,y)+v(x,y)i$ and so we can associate the function $F: \Bbb R^2 \to \Bbb R^2, F(x,y)=(u(x,y),v(x,y))$ and study all the properties of a complex valued function as a real vector valued one.


Null pointer exception with map fragment

I'm using the master-flow detail template in android studio, and I keep getting a null pointer error when I try running my code when I call the following method in the onCreate() method of a Fragment class:      private void setUpMapIfNeeded() {     fm = getActivity().getSupportFragmentManager();     if (mMap == null) {          mMap = ((SupportMapFragment) fm.findFragmentById(R.id.mapFragment)).getMap();     } }   My layout is the following:  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightSum="1"> <fragment     xmlns:map="http://schemas.android.com/apk/res-auto"     android:id="@+id/mapFragment"     android:name="com.google.android.gms.maps.SupportMapFragment"     android:layout_width="match_parent"     android:layout_height="0dp"     class="com.google.android.gms.maps.SupportMapFragment"     android:layout_weight="0.9"     tools:context=".CategoryDetailFragment"/>  <LinearLayout     android:orientation="horizontal"     android:layout_width="match_parent"     android:layout_height="40dp">      <Button         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:text="@string/record_audio"         android:id="@+id/recordaudiobutton"         android:onClick="displayLongitudeLatitude"/>     <TextView         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:id="@+id/longitudeTester" />  </LinearLayout>      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mark.markmaptester2/com.example.mark.markmaptester2.CategoryDetailActivity}: java.lang.NullPointerException         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2367)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2419)         at android.app.ActivityThread.access$800(ActivityThread.java:151)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)         at android.os.Handler.dispatchMessage(Handler.java:110)         at android.os.Looper.loop(Looper.java:193)         at android.app.ActivityThread.main(ActivityThread.java:5323)         at java.lang.reflect.Method.invokeNative(Native Method)         at java.lang.reflect.Method.invoke(Method.java:515)         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)         at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.NullPointerException         at com.example.mark.markmaptester2.CategoryDetailFragment.setUpMapIfNeeded(CategoryDetailFragment.java:177)         at com.example.mark.markmaptester2.CategoryDetailFragment.onCreate(CategoryDetailFragment.java:72)         at android.support.v4.app.Fragment.performCreate(Fragment.java:1766)         at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:917)         at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)         at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)         at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)         at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:551)         at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1174)         at android.app.Activity.performStart(Activity.java:5353)         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2340)                 Perhaps it is a simple fix however I can not identify the problem Thanks


I'm trying to write a program that finds the salvage value of an item after entering the purchase price, annual depreciation, and years of service.   Annual Depreciation= (Purchase Price-Salvage Value)/Years of Service   When inputting 5000, 8, 5.25 I should return 4958.00000


Suppose $A$ is of first category in $X$,then $A=\cup_n A_n$ where each $A_n$ is nowhere dense.Now my question is can we write $A=\cup_n \bar A_n$ or can a category I set be expressed as a countable union of closed sets with empty interior?  Addendum I think what I though was wrong because consider the cantor set $C$,which is of first category,so $C-\{x\}$,for some $x\in C$ is also first category.But $C-\{x\}=\cup _n (C-\{x\})$,although $C-\{x\}\neq \cup_n C$,note that $Closure(C-\{x\})=C$. Does there exist a first category set that is not $F_\sigma$?We can find $(0,1)$ as an example $F_\sigma$ set which is not of first category.But I am having problem in finding example of a first category set that is not $F_\sigma$.


Can I change default greeter in Ubuntu 17.10?

Is it possible to change default greeter in Ubuntu 17.10?