Get source and output paths in QGIS 3 processing algorithm

How can I find the complete path of the INPUT (r_in_name) and OUTPUT (r_out_name) rasters for the gdal datasets in the following code: from qgis.processing import alg from qgis.core import QgsFeature, QgsFeatureSink import numpy as np from osgeo import gdal, gdal_array, osr @alg(name="quantilizearaster", label=alg.tr("Quantilize a raster)"), group="rastertools", group_label=alg.tr("Raster Tools")) @alg.input(type=alg.RASTER_LAYER, name="INPUT", label="Input layer") @alg.input(type=alg.RASTER_LAYER, name="OUTPUT", label="Output layer") def quantilize(instance, parameters, context, feedback, inputs):     """     This algorithm takes an INPUT raster and quantilize its values in five classes; result is a quantilized OUTPUT raster.     """  source = instance.parameterAsRasterLayer(parameters, "INPUT", context) output_raster = instance.parameterAsRasterLayer(parameters, "OUTPUT", context)  r_in_name =   # r_in_name must be a string of the complete path to the INPUT raster, including its file name (*.tif) r_out_name =  # r_out_name may be a temporary OUTPUT raster file       dataset = gdal.Open(r_in_name)     band = dataset.GetRasterBand(1) nodata = band.GetNoDataValue() array = dataset.ReadAsArray()  new_array = array nan_array = array  nan_array[array == nodata] = np.nan  percentile_80 = np.nanpercentile(nan_array, 80) percentile_60 = np.nanpercentile(nan_array, 60) percentile_40 = np.nanpercentile(nan_array, 40) percentile_20 = np.nanpercentile(nan_array, 20) percentile_0 = np.nanpercentile(nan_array, 0)  for i, v in enumerate(new_array):     for j, element in enumerate(v):         if element > percentile_0 and element <= percentile_20:             new_array[i,j] = 1         if element > percentile_20 and element <= percentile_40:             new_array[i,j] = 2         if element > percentile_40 and element <= percentile_60:             new_array[i,j] = 3         if element > percentile_60 and element <= percentile_80:             new_array[i,j] = 4         if element > percentile_80:             new_array[i,j] = 5  new_array[ new_array != new_array ] = nodata  geotransform = dataset.GetGeoTransform() wkt = dataset.GetProjection()  # Create gtif file  driver = gdal.GetDriverByName("GTiff") output_file = r_out_name  # r_out_name may be a temporary OUTPUT raster file  dst_ds = driver.Create(output_file,                        band.XSize,                        band.YSize,                        1,                        gdal.GDT_Int16)  #writting output raster dst_ds.GetRasterBand(1).WriteArray( new_array ) #setting nodata value dst_ds.GetRasterBand(1).SetNoDataValue(nodata) #setting extension of output raster # top left x, w-e pixel resolution, rotation, top left y, rotation, n-s pixel resolution dst_ds.SetGeoTransform(geotransform) # setting spatial reference of output raster srs = osr.SpatialReference() srs.ImportFromWkt(wkt) dst_ds.SetProjection( srs.ExportToWkt() ) #Close output raster dataset  dataset = None dst_ds = None   return


How to pass filenames from "find" to "tr"?

I am trying to learn how a couple of commands works and I want to make a simple script that will change uppercase letters in file names to lowercase. I created that script:  find * -exec bash -c \      'echo "${1##*/}" | tr "[:upper:]" "[:lower:]";' _ {} \;   It works, but it only writes with echo lowercased file names, instead of changing them. On the other hand this piece of code:   find * -exec bash -c \      'tr "[:upper:]" "[:lower:]";' _ {} \;   acts as if I would only use:   tr "[:upper:]" "[:lower:]"   So, I want to learn and understand how to pass filenames that I can get from find and do anything with them using tr. Went already to manuals and google and found nothing.


Full-height CSS layout, with multiple columns

I have a layout that is working, but it has one very annoying problem.. when the content is taller than the screen, the background stops.  This is the desired layout in bad-ASCII-art format:  _____________________  _ |    | long    |logo|   | |    | content |    |   | |    |         |    |   | |    |         |    |   | |grad|         |grad|   | Viewport |    |         |    |   | |    |         |    |   | |    |         |    |  _| |    |         |    | |    |         |    | _____________________  |2em| <-20em->| 2em|   ..or with short content..  _____________________  _ |    | short   |logo|   | |    | content |    |   | |    |         |    |   | |    |         |    |   | |grad|         |grad|   | Viewport |    |         |    |   | |    |         |    |   | |    |         |    |   | |    |         |    |   | _____________________  _|   Basically it looks like a single column, with a glow as a column either side. Over the left-glow is a logo. When the content is short, it is still the full-height.  I have tried using the , which fixes the middle column, but then the gradients only extend as far as the content (in the left column, a single &nbsp;, in the right column the logo)    Here is what the layout looks like:    And the problem (when the browser window is shrunk vertically):    Finally, the problem HTML/CSS,


Eighties post-apocalyptic book series with teleporters

This is (I believe) a 1980s series of books set in the US after a nuclear war. The central characters I think are constant across the books although I only read one of them. One character is a weapons and explosives expert. The story features  secret US government teleportation technology developed before the war and located around the country in facilities like Cheyenne Mountain.


Image was not shown in LaTeX (with TeXstudio GUI), only a black filled box is shown

This is the mini example that I used.  \documentclass[a4paper,11pt,reqno,twoside]{amsart} \usepackage{amsmath} \usepackage{amsfonts} \usepackage[demo]{graphicx} \usepackage{float}  \begin{document} \section{A section} \begin{figure}[H] \centering \includegraphics[scale=0.8,keepaspectratio]{figure1.JPG} \caption{Write some caption here}\label{figure1} \end{figure} \end{document}   The following figure is the display in dvi viewer:    The following is the actual image in file "figure1.JPG" that LaTeX is supposed to display:    What is the problem in my LaTeX code?


Does a CPU keep its processing speed after years of use? Is electron migration an issue that affects CPUs?

I want to know definitively if I can build computers using USED processors and expect the same performance as new processors of exactly the same make and type with exactly the same motherboard and drives.  I have searched for several days now online without finding a definitive answer or any studies that explain whether CPUs decline in speed after extended periods of use.  I want to know if a used but functional CPU will provide the same performance as a new-from-the-box CPU.  Edit:  To be clear, I am looking for a definitive scientific answer, supported by evidence, so that I can make informed decisions when building computers and refurbishing computers.  I think this different enough from other questions asked that relate to this topic.  CPU processing speeds will decline as the temperature increases and heat transfer compound may need to be replaced, but aside from this will a CPU lose overall processing power or 'wear out' after extended use?  If so, what causes this?  I have heard of electron migration in motherboards, but could this actually cause a CPU to slow down with use?  From what I understand about electron migration, it is more likely to cause outright failure of the CPU rather than a gradual slowing of processing speed.


Will search engines divert worldwide traffic away from a website with a country specific TLD?

I have a website that contains world-wide suitable content, although it is in English. The site is just information; not ecommerce. However, it has a ccTLD of ".co.uk", so will search engines specifically drive UK users towards my site and divert the rest of the world away from my site?  Or, will the site simply rank marginally higher for UK users and be mixed in with the 'bigger pot' for the rest of the world?  Does having a .com site make it more 'world-wide' or do the search engines check to see where a site is actually hosted (by IP)?


Proving that the counting measure is a measure on $\mathcal A$

Here is the problem: Let $\Omega$ be a nonempty set and $\mathcal A$ $=$ $\mathcal P$($\Omega$). Define $\mu$ on $\mathcal A$ by $\mu$($E$) equal to $N$($E$) if $E$ is finite and $\infty$ if $E$ is infinite, where $N$($E$) denotes the number of elements of E. Prove that $\mu$ is measurable on $\mathcal A$.  I have already proved the first two conditions for $\mu$ to be measurable on  $\mathcal A$.   However, I am stuck on proving the third condition [i.e $\mu($$\bigcup_{n=1}^{\infty}E_n$) $=$ $\sum_{n=1}^{\infty}\mu$($E_n$)]  This is what I'm thinking:  Let $\{E_n\}_{n=1}^{\infty}$ be a sequence of pairwise disjoint sets, and consider the following three cases:  1.) Suppose for some $k$ $\in$ $\Bbb N$, we have $N$($E_k$) = $\infty$.  2.) Suppose that for all $n$ $\in$ $\Bbb N$, we have $N$($E_n$) $<$ $\infty$, and that there are infinitely many $n$ such that $N$($E_n$)  $>$ $0$.  3.) Suppose that for all $n$ $\in$ $\Bbb N$, we have $N$($E_n$) $<$ $\infty$ and that there are finitely many $n$ such that $N$($E_n$)  $>$ $0$.


I have a 12 foot length of 14-gauge molybdenum wire that I have measured a resistance of 1.2 ohms. I would like to use it as a small heater coil.  How can I calculate the safe number of volts that I may give it without melting the wire?  Edit: I would like to operate this at a maximum of 1500C. Ideally it will be buried (protected) in refractory.  Edit 2: I read that molybdenum wire can be used as high temperature heating element, but I guess I just want to make sure that is indeed the case. I have variable voltage so I can start out low and raise it as needed.  NOTE: This is not the same low resistance MoSi2 heater elements I posted a question about yesterday - this is pure molybdenum 14 gauge wire.


I want to know if there is any  material. I am thinking of making flying vehicles which are made up of anti-gravity material so that they will not experience any gravity on them and can easily take off and be more fuel efficient. Is there any such thing? Or any workaround?


Is there any matrix $2\times 2$ such that $A\neq I$ but $ A^3=I$?

Is there any $2 \times 2$ matrix $A \neq I$ such that $A^3=I$?  In my opinion: no. Thank you very much.


If a|b and b|c , (how can I prove) ⇒ a|c?

I understand that if a|b, then amodb=0, thus a = qb (remainder is zero) and b = qc. How can I prove using this that a|c?


What is the difference between using the multiplication rule or using Venn diagram subtraction for probability?

Take two problems:  Andrew is 35, and the probability he will be alive in 10 years is .72. Ellen is 35, for her, .92. Assuming these are independent, what is the probability they both will be alive in 10 years? Answer: .66, Method: Use the multiplication rule .72*.92 = .66  Suppose your street has two traffic lights. The chance that the first light is red is .40, and the second light .30. The chance of them being red at the same time is .10. What is the the probability that neither light is red? Answer: .40, Method: Subtract .1 from .4 and .3, and then subtract all 3 from 1.0 = .4   Why doesn't the multiplication rule work for #2? In other words, why can't I multiply .40 and .30 to get .12? And then furthermore, if .12 is the chance they will both be red at the same time shouldn't (1-.12)=.88 be the chance that neither is on?


How can I check the clicked element has also class x?

Here is my code:  doc.on("click", ".add_your_qora", function(e){      // in here I need to know, has this element also "myclass" class too? })   As I've commented in the code, I need to know, has .add_your_qora element also myclass or not? How can I determine that?


Differentiability of antiderivative and continuity of derivative

Let $a,b\in \mathbb{R}: a<b$. Let $f:[a,b]\to \mathbb{R}$, $f$ is monotone increasing. Let $F:[a,b]\to \mathbb{R}, x \mapsto \int_{[a,x]} f$.  Show that if $F$ is differentiable at $x_0 \in [a,b]$, then $f$ is continuous at $x_0$.  If f was not continuous, then the right and left limits would not match. Because the function jumps, its measure has to jump too, therefore integral would be discontinuous and therefore non differentiable. However I do not know how to formalize this intiuition.


What exactly is a coherent state and why is it interesting?

Please note that I do not have a background in physics, so if possible please refrain from a bunch of $ |x\rangle $ notations, unless clearly specifying what it symbolically means.  So I have been learning about representation theory lately in particular I have studied square integrable irreducible representations, and I'm interested in the applications of these. I have come to understand that given a square integrable irreducible representation $ U $ of a locally compact group $ G $ on a Hilbert space $ \mathcal{H} $ and an admissible vector $ g \in \mathcal{H} $, then the orbit $ \mathscr{O}_g := \{U(x)g\mid x\in G\} $ is a . Furthermore if the group $ G $ is the (Weyl-)Heisenberg-group, then these  are "classical coherent states"(?).  So I understand from this that coherent states can be described by these collections of vectors/functions in a Hilbert space and sometimes they constitute frames and possible wavelets(?). How exactly is such a collection of vectors understood in the context of coherent states? What does a coherent state describe? and why are they interesting?   If you can refer me to articles or literature explaining these questions in terms understandable by someone who has mostly had basic mechanics then it'd be much appreciated.


TV episode with characters similar to the Smash Martians

I am trying to identify a TV show I watched as a child in the UK. It is rather obscure.  The show aired on the ITV network in the late 1970's, I would guess between 1978 to 1973 and definitely shown on a week day afternoon as I recall watching it after school.  It may have been a one off TV special or a very short run of episodes and I only caught the final one because I clearly remember tuning in the follow week and being disappointed it was not being broadcast.  Regarding the show itself, it was a mix of puppets and live action. If memory serves (but it is rather blurry) the main characters were a group of robots or aliens reminiscent of and puppeteered in the same manner as the Smash Martians. For those who don't know, Smash was a brand of instant mashed potatoes and was advertised by puppets meant to be martians. Here is a link to one advert on . I can be sure it was not simply an advert I watched as it was around 25 minutes long. A fairly standard length for a UK children's TV show.  Plot... I cannot recall many details sadly except that one scene involved the hero group of puppets being caught and imprisoned and another with a character who I think was simply a metallic ball with black eyes glued on teleporting into various places in search of something. At one point it surprises a woman in the bath who throws soap suds at it and screams.   It is possible I am conflating one or two different shows, the Children's Film Foundation film "The Glitterball" may account for some scenes but not all.


hey i just wanna ask if its ok to add ww2 weapons, specifically nazi weapons into a game

I'm making a ww2 thing and I'm using Nazi weapons and I'm not sure if I have to ask the company to use them or if its ok to just add them without any problem. I really just wanna know if its ok because I've seen many other games add those types of weapons but I have heard of companies making agreements with gun manufacturers.


Is a creature's reach linked to the reach of its attacks?

This is an issue I've seen coming up with the addition of the Eldritch Claw Tattoo in Tasha's Cauldron of Everything, though there seem like there were possible cases of it before. As far as I can tell, every character starts with a reach of 5 feet. If they are wielding a weapon with the Reach property this explicitly increases the reach of both their attacks, and their reach for the purposes of being able to perform an opportunity attack reaction, by five feet:  This weapon adds 5 feet to your reach when you attack with it, as well as when determining your reach for opportunity attacks with it.  However, an Eldritch Claw Tattoo's Eldritch Maul effect doesn't mention opportunity attacks in the same way, it only mentions the range of your attacks:  As a bonus action, you can empower the tattoo for 1 minute. For the duration, each of your melee attacks with a weapon or an unarmed strike can reach a target up to 15 feet away from you, as inky tendrils launch toward the target.  There is a similar case for the playable Bugbear race from Volo's Guide to Monsters, which has the long-limbed trait:  Long-Limbed. When you make a melee attack on your turn, your reach for it is 5 feet greater than normal.  In both cases it sounds like the additional reach only applies when you actually attack; it's unclear whether your reach is also increased for triggering an attack of opportunity or not. I think the tricky point is that the reach that determines whether you can make an opportunity attack, occurs before you're actually making any kind of attack roll (i.e- it determines whether you can use your reaction or not), whereas the latter two quotes suggest your reach is only increased when actually attacking (about to make the attack roll). As far as I can tell (though I may have missed it) the rules don't state that your reach is based on your melee attack reach, it just happens to be convention that some effects that increase one, also increase the other. This feels like it might be a bit of a weak distinction, but it also feels very strange that a temporary increase in range should render a character unwilling to strike at an enemy that they would have attacked just a moment before. So my question is, is there anything in RAW that makes clear that Eldritch Maul, Long-limbed and so-on should also apply to reach for the purposes of triggering an opportunity attack, or am I correct in thinking these may be separate?


What should be default value of select (drop down list)?

I'm wondering what is the best practice of designing select / drop down lists. In some projects I've worked in the select on a form was filled with first value from the list. In other project we had always "-- select --" option chosen before user selected something else. I can imagine also empty field.  Is there any guideline about it? What is state of art in this matter?


Show that there exist continuous functions $g(x)\leq f(x) \leq h(x)$ for all $x \in [0,1]$, and $\int_{0}^{1} (h(x)-g(x))dx < \epsilon$.

Let $f:[0,1] \rightarrow \mathbb{R}$ be a Riemann integrable function and let $\epsilon >0$. Show that there exist continuous functions $g,h:[0,1] \rightarrow \mathbb{R}$ such that $g(x)\leq f(x) \leq h(x)$ for all $x \in [0,1]$, and $\int_{0}^{1} (h(x)-g(x))dx < \epsilon$. Since $f$ is a Riemann integrable. For all $\epsilon >0$, there exist a partition $P_{\epsilon}$ of $[0,1]$ such that $U(P_{\epsilon},f)-L(P_{\epsilon},f)<\epsilon$, and $L(P_{\epsilon},f)\leq \int_{0}^{1}fdx\leq U(P_{\epsilon},f)$. Now I want to show that there exist $g,h$ are continuous, I am confused here, how I claim my $g(x)=U(P_{\epsilon},f)$. and it is continuous. Can anyone suggest me some hint for existence of two continuous function here.


Whether the set $A$ is a compact subset of $M_3(\Bbb R)$.

Consider $$X=\Big\{A \in M_3(\Bbb R): \rho_A(x)=x^3-3x^2+2x-1\Big\}$$ where $\rho_A(x)$ is the characteristic polynomial of $A$ and $M_3(\Bbb R)$ is the space of all $3 \times 3$ matrices over $\Bbb R$. Is $X$ compact in $M_3(\Bbb R)$ ?   My try: I confused with only the $2x$ term in $\rho_A(x)$. Because , if the $2x$ term not appear , then $X$ becomes  $$X=\{A \in M_3(\Bbb R): \text{trace}(A)=3,\det A=1\} $$ which is unbounded, since $$(\forall n \in \Bbb N):\begin{pmatrix} 1&0 & n\\0&1&0\\0&0&1 \end{pmatrix} \in X$$ But here the problem is, the appearance of $2$.  I Know  $$2=A_{11}+A_{22}+A_{33}$$ so I think in this case the set becomes bounded and closed Any help?


Ideals of $\mathbb Z/11\mathbb Z \times \mathbb Z/11\mathbb Z $?

How would one go about finding all of the ideals of this ring? (with addition and multiplication defined component-wise)


How to stop Windows 7 from asking to format a disk?

I have this USB flash drive with a Linux partition that I use inside VirtualBox.  Each time I insert it into the USB port, windows keeps asking if it should format it.  Is there anyway to disable Windows from asking that?  Disabling auto-run has not resolved the problem unfortunately. Windows will still check if the disk contains a partition it knows about, and ask to format if it doesn't know it.    Really nice try though, any other ideas?


What do first, second, and third person perspective mean? Why are they so called?

I am aware of the terms first person, second person and third person from grammar, but I have also seen them used in other contexts, in particular first person perspective with regard to video games.  What is the precise meaning of first person perspective? Can the terms second person and third person be applied to perspectives in the same way?  As far as my limited understanding of grammar goes, I know that the first person is written with "I" forms, second with "you" forms, and third with "he/her/it" forms. Is this grammatical meaning related to the meaning with perspectives, and if so, how?


Exclude a list of directories from unix find command

I need to build a list of files present in a directory but also pass in a file containing a list of directories to exclude.  I've seen the below suggestion but I've had no luck with it when it comes to the type flag:  find $dir_name $(printf "! -name %s " $(cat $exclude_file))   Is there a way I can do it or will I need to create the entire list and then work through it removing ones that partially match ones in the exclude directory.


Regular expression to match balanced parentheses

I need a regular expression to select all the text between two outer brackets.  Example: some text(text here(possible text)text(possible text(more text)))end text  Result: (text here(possible text)text(possible text(more text)))


Can Tamron 16-300mm lens fit on a Canon 700D?

I want to buy a new lens that extends my zoom range, because the one came with the camera is 18-55mm with a small zoom range.  The specifications for the Tamron lens look good, with a great zoom range, and also can be used as macro lens, for portraits and travel - I will not have to carry more than one lens & switch lenses. It's within my budget too.  So can anybody help me to know if it can fit my camera?  Is it good enough or I can find something with same specifications & same price range in another brand that's better?


Short story about scientists who discover a way to end the world

I read a short story in the early 1980s, probably from the 1960s or 1970s, that began with a scientist telling his wife that he and several colleagues had figured out how a combination of simple household chemicals and loop of hot wire could destroy the whole Earth (or maybe kill everyone on Earth).  The scientists take this discovery to somebody in the government, but the governmental response to the danger is inconclusive.  Eventually, in order to protect the people of Earth, the protagonist and his wife decide to murder everyone else who might know the secret.  They kill them all without a hitch, and the scientist, tired out, heads to bed.  His wife looks once more at their sleeping infant, then kills her husband as well.  Does anybody know the title and author of this story?


How to convert a string to an javascript array

I am trying to make a string which looks like luis,philip .It having comma in between them but i have to make an array with it.I am trying with json.Parse but it is not working i am posting  my code   var names = 'luis,philip' ; var nameArray = JSON.parse("[" + names +"]");   but it showing error in json parsing ,please somebody help


Can i install Ubuntu on my pen drive, i do not want to install it at my system's drive  I just want whenever i plug the pen drive, run Ubuntu else run my Windows 8  Is it possible if it is possible.. will get my data back after shutdown and restart with Ubuntu.  Pls help me Thanks


In Rails Models, I've seen what I'm assuming are called class methods defined either by   def methodName    #do something end   and   def self.methodName    #do something end   I can't seem to find anywhere that gives a description of the differences between these two, and when you should use one vs the other.   Also not sure if this is specific to Ruby, Rails or other languages as well.  Thanks


Using a component-wise approach (using partial derivatives), show that the gradient of $f$ is given by $\nabla f(x) = \frac{1}{2}(A +A^T)x + b$

Using a component-wise approach (using partial derivatives), show that the gradient  of $f$ is given by te following formulas  \begin{align*} \nabla f(x) &= \frac{1}{2}(A +A^T)x + b\\ \end{align*}  For $A\in \mathbb{R}^{n\times n}$, $b\in \mathbb{R}^n$, $x\in \mathbb{R}^n$ We note $A = (a_{ij})_{\substack{  1\leq i\leq n \\  1\leq j\leq n}}$, $b = (b_i)_{1\leq i \leq n}$, $x = (x_i)_{1\leq i \leq n}$  Then  $$f(x) = \frac{1}{2}\sum_{i=1}^{n}\sum_{j=1}^{n}x_i a_{ij}x_j + \sum_{i=1}^{n}b_i x_i$$  $$ \nabla f(x) = \big(\frac{\partial f}{\partial x_i}(x)\big)_{1\leq i \leq n} $$  \begin{align*} \forall k\leq n: \frac{\partial f}{\partial x_k}(x) &=\frac{1}{2} = \big[\sum_{i\neq k}x_i a_{ik} + \sum_{j\neq k}a_{kj}x_j + 2a_{kk}x_k\big] + b_k \quad (1)\\ &=\frac{1}{2}\big[\sum_{i=1}^{n}x_ia_{ik} + \sum_{j=1}^{n}a_{kj}x_j\big] + b_k \quad (2)\\ x_i  &=\frac{1}{2} \big[\sum_{i=1}^{n}a_{ik} x_i+ \sum_{j=1}^{n}a_{kj}x_j\big] + b_k \\  &=\frac{1}{2}\big[\sum_{i=1}^{n}a_{ik} + a_{kj} x_i\big] + b_k \\  \nabla f(x) &= \frac{1}{2}(A +A^T)x + b\ \end{align*}  Here are my questions - what does exactly the $k$ represent in (1) and why can't it be equal to $i$? - how can we go from (1) to (2) and from $\sum_{i\neq k}$ to $\sum_{i=1}^{n}$


What config file specifies which services load on startup?

I'm using ADB and have full access to the filesystem.  I run ps and see a process running called com.Something.Service. I can kill the process but it restarts most of the time.  It's not a visible app, it's some kind of background service.  I want to stop it from running on startup.  I can't find the setting that causes it to run on startup. What file determines which processes like these run on startup or how can I find it?  I've tried grepping some common directories for the name of the service. I'd hope to find it in /etc/init.d but it's not there.


I have created my account using Gmail and now it's blocked at my workplace. I tried to add another login in "My Logins" but the options shown there are also blocked.  I want to add my work email to login but there is no option to enter custom email.  So   How to add my email to login?   or   Do I need to create new account with my new email and request a merge with older account?


Calculating float and storing to list gives weird value?

So I started building a function with which I aim to correct the first 3  'allocations' which exceed a certain limit.   Below function now returns a list with the exceeded values per value in the passed list.   def correct_wrong_allocations_zw(weight_vect):     temp_weight_vect = list(weight_vect[:3])      limits = [1.00, 0.30, 0.25]     too_much_list = []      too_much = 0.00     for i in range(0, len(temp_weight_vect)):         if temp_weight_vect[i] > limits[i]:             too_much_list.append(temp_weight_vect[i]-limits[i])      return too_much_list  allocations = [0.10, 0.40, 0.50, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00] allocations = correct_wrong_allocations_zw(allocations) print allocations   The difference between allocations[1] and limits[1] is 0.10, yet the result of this program is:  [0.10000000000000003, 0.25]   What is going on?


Prove that any polynomial in $F[x]$ can be written in a unique manner as a product of irreducible polynomials in F[x].

Prove that any polynomial in $F[x]$ can be written in a unique manner as a product of irreducible polynomials in $F[x]$.  $F$ is a field of fractions of a UFD.  Can someone tell me how I can solve this problem. It is one of my lecture note result, but my lecturer did not provide a proof.


I'm currently using Eclipselink, but I know now days most JPA implementations have been pretty standardized. Is there a native way to map a JPA entity to a view? I am not looking to insert/update, but the question is really how to handle the @Id annotation. Every entity in the JPA world must have an ID field, but many of the views I have created do not conform to this. Is there native support for this in the JPA or do I need to use hacks to get it to work? I've searched a lot and found very little information about doing this.


What is the best way to allow a domain user to start and stop services on the machine? The domains user cannot be made admin.


I have a question regarding one proof of the the following statement:  If $A$ is a square matrix such that $AX=XA$ for any square matrix $X$, then $A=cI$ for some $c$. ($I$ is the identity matrix).  I managed to prove this for $n \times n$-matrices when using the hint that I should let $X=E_{ij}$. However, I don´t really understand why that special case helps me prove it for all $n \times n$-matrices $X$.  By letting $X=E_{ij}$, we see that for $AE_{ij}=E_{ij}A$ to be true, we need $a_{ii}=a_{jj}$ and all the other entries at row $i$ and column $j$ to be zero. Since we may choose $i$ and $j$ arbitrary, this proves that $A=cI$.  But how can we now be sure that this holds for any matrix $X$? I understand Why it is a convenient approach to let $X=E_{ij}$ but don´t how it covers all cases? It feels like I´m missing something trivial since associating with $E_{ij}$ surley wasn´t obvious to me, even though it made the problem became "easy" to solve. That is not fine by me though, I really want to understand this.


Correct synonymous to expression "still into you"?

In the USA there is Paramore band. They have wrote nice song  in 2013. In lyrics clear all for me except title. "Still into you" what does it mean in this context?   Context     Yeah after all this time      I'm still into you.   Question:  Please, give me correct analogy. Is it "fall in love" or sort of sex or something other?


How can I serialize anonymous type using DataContractJsonSerializer

Using the code below, how can I use the DataContractJsonSerializer to convert the resultant list to JSON?  ETA: I have seen several extension methods to generically JSON-ize objects, but I'm not sure what type to use, as this is an anonymous type.  <Product> products = GetProductList();  var orderGroups =  from p in products  group p by p.Category into g  select new { Category = g.Key, Products = g };   Thanks!


How can I stream a 50GB large file in perl to execute some regex for each line (or chunk)? I have tried with plain vanilla   for $line (<FH>) {    # do regex }   I have also tried Tie::File and File::Stream, but perl always tries to load the whole file into memory which is simply not possible.  #!/usr/bin/perl  use IO::Handle; use Tie::File; use File::Stream; #tie @array, 'Tie::File', $ARGV[0] or die "could not open file";  STDOUT->autoflush(1);  $file=$ARGV[0]; open(INFO, "< $file") or die("Could not open  file.");  print "opening ... \n"; my $stream = File::Stream->new(<INFO>);  #$out = $ARGV[1]; #open(my $OH, '>', $out) or die "Could not open file '$out' $!"; print "starting ... \n"; while (<$stream>)  {     $line = $_;     $line =~ s/\n/\[!BR!\]/g;     $line =~ s/<page>/\n<page>/g;     $line =~ s/<\/page>/<\/page>\n/g;     print $line;      #STDOUT->flush(); }  close(INFO);


How did Community ♦ post a bounty on a question?

I am baffled by the following question bounty banner:  When is a bounty attributed to Community ♦?


SQL for finding composite key elements with same field

I have a table with a composite key (a,b) wherein I want to return the first key and the count of the second key that have the exact same set. For example if we have:  a | b ------- 01 | 2 01 | 3 02 | 1 02 | 2 02 | 3 03 | 2 04 | 2 04 | 3   Since 01 and 04 have the same second column (2,3) and the others have none we get: 01 | 1 02 | 0 03 | 0 04 | 1   This should apply to any set of composite keys (a,b) and not its not just inclusion but equality we're looking for.


Proving $\sup \{\sin n:n \in \mathbb{N}\} = 1$

Consider the set $$A=\{\sin n:n \in \mathbb{N}\}$$ How should I proceed to prove that $\sup_{n\in \mathbb{N}} A = 1$? Is there a direct proof? Can any argument be provided via reductio ad absurdum?


How does Delta baryon decay conserve angular momentum?

I'm a chemist so bear with me:  I understand the  $\Delta^{+}$ and $\Delta^{0}$ to be in some sense spin (and isospin) quartet states of the proton and neutron. These can decay straight to a proton or neutron through emission of a pion, which is spin-0.  I've been puzzling about the mechanism by which this decay conserves spin. I note via Wikipedia that  into either a lepton pair or a photon pair, for which it's easy to show spin is conserved, however pion production seems to induce a loss of $J=1$.  This seems to suggest momenta of:  $\Delta^{+} (J=\frac{3}{2}) \rightarrow{} p^{+} (J=\frac{1}{2}) + \pi^{0} (J=0)$  Am I missing a boson? Is my understanding of spin flawed? I assume that if this decay exists, similar things turn up everywhere else.


How to search the topics with 2 or more seach tags?

How to search the topics in Stackoverflow by filtering with 2 tags. For Example , I was able to search the questions with single tag like playframework, but if i want to search with tags like playframework, scala, internalization etc,  Can you please suggest me? It will be helpful to me in learning the concepts from stackoverflow


How to limit download/upload speed for specific users?

I want to setup an ubuntu server in which some users are limited to a specific download/upload speed.Is it possible?  I know about Wondershaper, Trickle or similar tools but I don't want to limit programs or an interface bandwidth because the machine will have different kind of users.  A solution for limiting speed for a group or specific users would be great.


Calculate $\int_{-\infty}^\infty \frac{e^{-x^2}}{x^2+a^2}\ dx$.

Let $$F(a)=\int_{-\infty}^\infty \frac{e^{-x^2}}{x^2+a^2}\ dx, \quad a>0.$$ Is it possible to relate $F(a)$ to some known (special) functions?


How does the sys.objects Catalog View pull from itself?

I'm using this stored procedure called . It's helping me wrap my head around the SQL Server system. However, there is one area that I can't yet figure out. On this one table sys.objects, you'll see it pulls from itself.  1> SELECT OBJECT_DEFINITION(OBJECT_ID('sys.objects')) 2> GO  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CREATE VIEW sys.objects AS     SELECT name,        .. stuff.     FROM sys.objects$   Now I'm totally lost how is sys.objects selecting from sys.objects$ what is sys.objects$. Thinking there may be a table of the same name, I first tried to create a table and a view by the same name, but I can't do that. I get (f is the name I picked). You can't do this in any database I've ever used.  Msg 2714, Level 16, State 3, Server x230, Procedure f, Line 1 There is already an object named 'f' in the database.   Microsoft docs , it's not listed as a   The counterpart Catalog View, , and OBJECT_DEFINITION clearly shows that.  My guess is that the SQL here isn't the actually SQL the view is executing, but some kind of comment or description on it: meta-data of sort, and that it's bugged. But, I could be totally off.


In C4D I can control which objects to affect with a light, in the image below only the main object is affected by the light source, the background and other objects are not affected. But I haven't found a way to do this in blender!  Is it possible to specify which objects to affect with a light source?


Problems installing Folding@home (unmet dependencies ... not installable)

I am trying to install  to my Ubuntu 19.10 (Eoan Ermine) though Eddy, but I receive the following error message:  com.github.donadigo.eddy Installation Failed The following packages have unmet dependencies:     fahcontrol: Depends python-gnome2 but it is not installable   The package names are the following:  fahclient_7.5.1_amd64.deb fahcontrol_7.5.1-1_all.deb fahviewer_7.5.1_amd64.deb   I'd like to start contributing to the Covid-19 project, but I don't know what to do next. I hope you can help me out!


Command to delete duplicate files from current directory

I have a directory with several duplicate files, created by a program. The duplicates have the same name (except for a number), but not all files with the same name are duplicates.  What's a simple command to delete the duplicates (ideally a single line limited to GNU coreutils, unlike )?  Example filename:  parra1998.pdf parra1998(1).pdf parra1998(2).pdf


What is the term for a stalemate in Checkers?  What are the official conditions for a "no winner game"?


How to write PIs asking for PhD position?

I have read  that the best way is to keep it simple, be short and ask for meetings, which is a bit generic way to ask for a job. I agree more with the discussion posted  by a student in a similar situation as mine (I still haven't started emailing people but I've already have a long unfinished list).  Speaking with some PhDs and postodcs I know, they told me that the best way is to know somebody in and maybe write them first in order to introduce you to the PI before you send your email. Another advantage of this is that you will know if there is a position available or if it's not a good idea to work there (the people who actually work there might have the best advice about that). Finally, they might also be "more reachable" than the PI who gets thousands of mails. On the other hand, I don't know the people who work where I want to go so it would feel as impersonal as this question feels to you.   Given the fact that I may have to write several (around 20) of these mails I want to have a good strategy. I know it's a debate that mostly depends on the area. My area of research is Neurobiology of Memory and Learning but I might also be interested to change a little bit, maybe to Addiction (Always within neurobiology).  I would also like to add that in order to write a detailed email about the PI's research history and future path one must be able to have the time for:   Read the publications = A large amount of time  Actually come out with an idea that meets with the PI's expectations AND research interest/approach/knowledge AND more important technique capacity   Of course, being a PhD student means that you have to suceed in both of them but not for every research we would be happy to do (if we were accepted) in advance.


Button swapped using AJAX results in ignored listener for new button

I use AJAX to call a PHP script and replace some HTML with the results data so a user can confirm the data.  The initial button is "Fetch Data" and then I swap that out with 2 new buttons "Confirm Data" and "Try Again" (in case the user doesn't want to validate the script result.  HTML button being replaced:
         <button type="button" id="fetch_btn" value="fetch_it" class="btn-btn btn btn-dark border-light center-button mt-2">
                     Fetch Data
         </button>
   Ajax works just fine:       $("#new_case_form").submit(function(e){       e.preventDefault();       var county_name = $("#county_select").val();       var case_number = $("#case_num").val();       // console.log($("#county_select").val());       var the_url = "fetch_case.php?county="+county_name+"&case_number="+case_number;       var response = $.ajax({           url: the_url,           type: "GET",           dataType: "text",           success: function(data){               $("#case-confirm").html(data);               $("#btn-container").html("<button type=\"button\" name=\"confirm_btn\" id=\"confirm_btn\" value=\"confirm\" class=\"btn-btn btn btn-dark border-light center-button mt-2\">
Confirm Case
</button><button type=\"button\" name=\"try_again\" id=\"try_again_btn\" value=\"try again\" class=\"btn-btn btn btn-dark border-light center-button mt-2\">
Try Again
</button>");           }       });   });   Here is the new HTML in a more readable format:  <button type="button" name="confirm_btn" id="confirm_btn" value="confirm" class="btn-btn btn btn-dark border-light center-button mt-2">
         Confirm Case
 </button> <button type="button" name="try_again" id="try_again_btn" value="try again" class="btn-btn btn btn-dark border-light center-button mt-2">
         Try Again
 </button>   This is the jQuery I use in trying to do anything with the Try Again button once it's clicked:    $("#try_again_btn").click(function(e){       console.log('confirm btn clicked');   });   I have also tried    $("#try_again_btn").on("click",function(e){       console.log('confirm btn clicked');   });   I have also used #try_again_btn_text because I nested an HTML tag inside the <button> and thought maybe when the text is clicked it doesn't fire the trigger on the parent button but that didn't work either.


Run terminal command (python command) at start up

New to Ubuntu, but have looked everywhere to get this question answered. Found no solution so far. Basically I need to run two terminal commands on startup, which follow each other directly. This will allow me to open a python script on start up. The script works when opened manually, but I'm at a loss to get it to work on boot. In terminal I type:  cd /directory/with/python/script/ python name.py   The script works, but I'm having trouble getting it to run on boot.


Let $V$ be a finite-dimensional vector space. If $\Delta = \{(\textbf{v},\textbf{v})| \textbf{v} \in V\}$ is the diagonal subspace of $V\times V$, show that dim$\Delta$ = dim$V$.   I'm not really sure how to approach this problem at all. Can someone push me in the right direction please?


how to initialize an array with generics?

I am implementing an interface in Java like this:  public interface Stack <E>{     public int size();     public boolean isEmpty();   the class that implements it:  public class StackArray<E> implements Stack<E>{     private Object list[];     private int top=-1;     public StackArray(int n){         list=new Object[n];     }   this works quite well, so when I called it I do this:  public static void main(String[] args) {         // TODO code application logic here         StackArray<Students> st=new StackArray<>(4);   so how I can implement that, but using generics, I have tried this:  public class StackArray<E> implements Stack<E>{     private E st[];     private int top=-1;     public StackArray(int n){         st=(E[]) Array.newInstance(null, n);     }   but I got a nullPointerException, is there a way to surpase this?


Error with \tableofcontents when using "\(...\)" in section

I want to type math equation in section headers, but I had some error with \tableofcontents command.  When I compile this file  \documentclass{book} \usepackage[utf8]{inputenc} \begin{document}  \chapter{Chapter 1} \section{This is an equation: \(x=1\)}  \tableofcontents  \end{document}   It gives out these error  Bad math environment delimiter. ...ak or <return> to continue without it.}}{1} Extra }, or forgotten $. ...ak or <return> to continue without it.}}{1} Missing $ inserted. ...ak or <return> to continue without it.}}{1} Missing } inserted. \tableofcontents   But this file compile just fine  \documentclass{book} \usepackage[utf8]{inputenc} \begin{document}  \chapter{Chapter 1} \section{This is an equation: $x=1$}  \tableofcontents  \end{document}   So what is the cause of this error? Is there any way to use \(...\) in the section header, or I have to use $...$?


How to get the direct link to an image in my Google Photos?

I want to add an image stored in my Google Photos. How can I get the direct link to an image in my Google Photos? The links I copied are not direct.


I am trying to review, and learn about how to compute and gaussian and mean curvature. Given $\frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1$, how can I compute the gaussian and mean curvatures?  This is what I have so far, $$K(u, v) = \frac{a^2 b^2 c^2}{[c^2 \sin^2(v) (a^2 \sin^2(u)+b^2 \cos^2(u))+a^2 b^2 \cos^2(v)]^2}$$  Please help me out.


Prove inequality using Lagrange's Mean Value Theorem

I'm trying to prove  $1 - \frac{a}{b} \leq \ln\frac{b}{a}\leq\frac{a}{b} - 1$ where $0 < a < b$ using Lagrange's Mean Value Theorem.  Applying the theorem to $\ln x$ results in: $$\exists\epsilon\in(a,b): \ln'(\epsilon)(b-a)=\ln b - \ln a$$ $$\frac{b}{\epsilon}-\frac{a}{\epsilon}=\ln \frac{b}{a}$$  This looks very similar to the target inequality (set $\epsilon=a$ and $\epsilon=b$), but I'm not sure how to get to it.  Edit: Looks like my question is an exact duplicate of , The answer doesn't really explain how to get to the inequalities though.


What causes these streaked rays from light sources?

I recently bought an LG G4, whose camera can shoot in an auto and both manual mode (I can manually set the iso, aperture). I shoot 100% of the time in auto.  It takes better than average photos at night but when in Seville one night the photos it took were a disaster. Please see this example:    I find the background lighting was captured very well, but the light sources totally screwed up the photo.   Why is this happening? The lens was clean.  What can I do to improve the quality of the future photos in this situation?  Attached 2 other photos taken before and after this problematic one (couple of hours distance). They seem fairly in the same conditions (direct light) yet the photos are decent.


C++ help related to Upper and Lower cases

I want the code to search for a word mid sentence and see if its first letter is lower case.   If it is, than it makes it upper case. For example: John hates using c++ daily, and it would change the C in c++ to uppercase.  Here is the code  #include <iostream> #include <string> #include<cstdlib> #include<fstream> using namespace std;  ifstream in_stream; ofstream out_stream;  int main() {     in_stream.open("in.dat");     out_stream.open("out.dat");     char s[256];     in_stream>>s;     s[0] = tolower(s[0]);     out_stream<<s;      in_stream.close();     out_stream.close();     system("Pause");     return 0; }


My hard drive is broken on my Mac, I have a new one, but how can I install OS X?

I couldn't figure out how to properly explain the issue in my title.   Here is the deal: My HDD is broken in my MacBook, every time I boot it up it's freezing. I bought a totally new SSD, but I didn't think before I bought it, so now I am stuck in a bad situation. I cannot download a new OS X, because they are downloaded from the App Store and I can't use my MacBook. I can't use disk utility to format the SSD either, because funnily enough, I also need my MacBook to work to do that.   So what options do I have here? The HDD is not operational at all, I do have a Windows desktop if I can do something here though.   Maybe I should also mention my insane stupidity of not having my installation disk either. I have an external harddrive though, so maybe if I could get the OS X iso and get my external Hard drive to install OS on the new SSD. But right now, I'm deep in the water.


Show that if $a\equiv b \pmod m$, then $\gcd(a,m)=\gcd(b,m)$

I still don't have a clear approach, but this is what I see.  $m \mid b$ and $m \mid a$ or $m\nmid b$ and $m\nmid a$.  I may think that the way is showing $\gcd(a,m)\leq\gcd(b,m)$ and $\gcd(a,m)\geq\gcd(b,m)$


Ubuntu - Windows 10 dual boot problem, can't boot Windows

I wanted to use dual boot, but didn't have enough space on my C: drive to do so. So I  bought an SSD (on Windows E:\) and here as sda2/sda3 and tried to install it there following the guide from this question.    I do not have a GRUB menu screen when starting the computer and second because of that, I cannot boot into my Windows OS.  Medium /dev/sda: 698,7 GiB, 750156374016 Bytes, 1465149168 Sektoren Einheiten: sectors von 1 * 512 = 512 Bytes Sektorengröße (logisch/physisch): 512 Bytes / 512 Bytes I/O Größe (minimal/optimal): 512 Bytes / 512 Bytes Typ der Medienbezeichnung: dos Medienkennung: 0xf9f466ac  Gerät      Boot      Start       Ende   Sektoren  Größe Id Typ /dev/sda1             2048 1338822655 1338820608 638,4G  7 HPFS/NTFS/exFAT /dev/sda2       1338822656 1340092415    1269760   620M ef EFI (FAT-12/16/32) /dev/sda3  *    1340092416 1465147391  125054976  59,6G 83 Linux   Medium /dev/sdb: 931,5 GiB, 1000204886016 Bytes, 1953525168 Sektoren Einheiten: sectors von 1 * 512 = 512 Bytes Sektorengröße (logisch/physisch): 512 Bytes / 4096 Bytes I/O Größe (minimal/optimal): 4096 Bytes / 4096 Bytes Typ der Medienbezeichnung: dos Medienkennung: 0x8599553d  Gerät      Boot Start       Ende   Sektoren  Größe Id Typ /dev/sdb1        2048 1953521663 1953519616 931,5G  7 HPFS/NTFS/exFAT   Medium /dev/sdc: 232,9 GiB, 250059350016 Bytes, 488397168 Sektoren Einheiten: sectors von 1 * 512 = 512 Bytes Sektorengröße (logisch/physisch): 512 Bytes / 512 Bytes I/O Größe (minimal/optimal): 512 Bytes / 512 Bytes Typ der Medienbezeichnung: dos Medienkennung: 0x626f7671  Gerät      Boot     Start      Ende  Sektoren Größe Id Typ /dev/sdc1            2048   1026047   1024000  500M  7 HPFS/NTFS/exFAT /dev/sdc2  *      1026048 487425945 486399898  232G  7 HPFS/NTFS/exFAT /dev/sdc3       487426048 488390655    964608  471M 27 Hidden NTFS WinRE   Is there any way I can add my Windows bootloader to GRUB?  I think I might have found the issue but reading the other post and trying the answers did not help. /dev/sda3/ and /dev/sdc2/ are marked as boot as far as I understood. /dev/sdc2 is my Windows home drive, while /dev/sdc1 is the actual boot loader and for Linux /dev/sda3 is the root folder and /dev/sda2 the supposed to be boot loader.    The first answer of the linked post I have made it work somewhat, but when restarting after having added the custom.cfg to the /boot/grub/ I get the following Error:  no such device:/EFI/Microsoft/Boot/bootmgfw.efi


How can I sort my Download folder without having to do it manually every time

I want my download folder to be ordered in the following way: Top left corner I want the last downloaded file and bottom right corner the oldest. Right now, I always have to right-click inside my download folder and do the following: Clean up by -> date created. This is annoying - how can I have my download folder sorted in such way by default?


How to set default Window position and/or size?

Whenever I start an application like Terminal or Preview, they are always opened as a small window on the top left corner of the screen. Is there any way to set them to open in the center of the screen? Preferably maximized too?


How to Delete a Junction by Using Command Prompt in Windows 7

I believe in Windows Vista, we could use linkd command. However, I cannot find this command in Windows 7. I know I can use Windows Explorer and delete the junction, but I wonder if this can be done in Command Prompt.  I can use mklink command to create a junction from a Command Prompt, so, what is the opposite of it (something like linkd)?


I'm trying to prove the following statement: $$\forall_{a,b\in\Bbb{N^{+}}}\gcd(n^a-1,n^b-1)=n^{\gcd(a,b)}-1$$  As for now I managed to prove that $n^{\gcd(a,b)}-1$ divdes $n^a-1$ and $n^b-1$:  Without loss of generality let $a>b$ (if $a=b$, the result is obvious), $n\neq1$ ($\gcd(0,0)$ makes no sense). Then if we let $a=kd, b=jd, d=\gcd(a,b)$, we see that for $n^{kd}-1$ we have $\frac{(n^d)^k-1}{n^d-1}=1+n^d+...+n^{d(k-1)}=C$ (it's a finite geometric series), so $n^a-1=(n^d-1)C$. Same works for $n^b-1$, so $n^d-1$ divides both of these numbers.  How to prove that $n^d-1$ not only divides both numbers, but is greatest common divisor?


How can I click the "Home Folder" on dash to open another Nautilus explorer when there is one already opened?

I am using Ubuntu 11.10, and really satisfied with the Unity.  But there is one thing annoying me. If I click the Home Folder button on dash, and for example I want to copy some files from one folder to another. Then I click the Home folder again, but it will bring me to the previous folder not open a new Nautilus explorer for me.  And for the terminal, I can always press Ctrl+Alt+T to open a new window. So I'm asking, is there any shortcut or any way to achieve it?


How can I solve the problem of installation of mysql workbench on ubuntu?

I want to install MySQL workbench on ubuntu, but when I run the command sudo apt-get install mysql-workbench it says that this package is unavailable, but some other package makes reference to it. This could be that the package is missing, it is obsolete or it is available from some other source.  I already tried running first   sudo apt update && sudo apt upgrade   and later I ran   sudo apt install mysql-workbench   but I got the same result. Please help.


Show that if $r$ is an nth root of $1$ and $r\ne1$, then $1 + r + r^2 + ... + r^{n-1} = 0$.  I think I can represent all the roots of 1 as follows:  $r = 1^{\frac{1}{n}} ( \frac{\cos{2\pi k}}{n} +  i\frac{\sin{2\pi k}}{n} )$  From there I am not sure how to get to $1 + r + r^2 + ... + r^{n-1} = 0$.


Following illness when Ubuntu part installed on 64 bit AMD system I now do not know my Log In, can this be recovered/changed, or shall I wipe the hard drive and start again?  I have reset the Password, but cannot get past Log In as it always says it is 'Incorrect' - this is meant to be the latest Ubuntu, 14.04 I believe  I am not asking about Password but Log In


Is there some way I can use ConsoleColors as the Ints that they are? Like  Console.ForeGroundColor = 10; //ConsoleColor.Green has the Value of 10   but i can only use  Console.ForeGroundColor = ConsoleColor.Green; //when hovering over "Green" Visual Studio even shows me that Green is 10   I managed to find these Color-Ints in the registry (HKEY_CURRENT_USER/Console) where the Ints have hexCodes of the colors but no where the name (and i was able to change the value of Green to Orange and back to default but that doesn't matter). So why won't C# or Visual Studio let me use the Ints? Or am I doing something Wrong?  Please try to explain it without using refering to enums. I know, these colornames are enums but i just don't understand enum-conversion yet


Is there a similar word to 'twain' but meaning 'three' instead of 'two'?

I would like to split something into three parts. Is there a phrase I can use with similar overtones to "cleave in twain"?


An object is required for the nonstatic field MyMethodAsync

I'm trying to learn about async and await in C#, and have been reading MSDN.  I arrived at  which I've copied into a console app in the hope of using the debugger to see how exceptions are handled asynchronously.  Using the info , I adapted the MS code to run it in the app (perhaps wrongly as a learner).  The error message I get is on this line:  Task<string> theTask = DelayAsync();      CS0120    An object reference is required for the non-static field,   method, or property 'Program.DelayAsync()'   Is this something I've done wrong, or a bug in the MSDN code? Can anyone please explain how to run the DoSomethingAsync() method from a console app so that I can see in the debugger how the exception is returned please?  class Program {     static void Main()     {         DoSomethingAsync().Wait();     }      static async Task DoSomethingAsync()     {         Task<string> theTask = DelayAsync();         try         {             string result = await theTask;             Debug.WriteLine("Result: " + result);         }         catch (Exception ex)         {             Debug.WriteLine("Exception Message: " + ex.Message);         }         Debug.WriteLine("Task IsCanceled: " + theTask.IsCanceled);         Debug.WriteLine("Task IsFaulted:  " + theTask.IsFaulted);         if (theTask.Exception != null)         {             Debug.WriteLine("Task Exception Message: " + theTask.Exception.Message);             Debug.WriteLine("Task Inner Exception Message: " + theTask.Exception.InnerException.Message);         }     }      private async Task<string> DelayAsync()     {         await Task.Delay(100);         //throw new OperationCanceledException("canceled");         //throw new Exception("Something happened.");         return "Done";     } }


Connection to FileZilla FTP server works, but directory listing fails

I am trying to set up a local FTP server in my house. Whenever I connect to the account on the computer that hosts the server, everything works, but when I try connecting on another computer, the directory listing fails even though the account connection is successful. I have allowed port 21 TCP and UDP through the host's firewall and have added FileZilla Server to the list of programs allowed to communicate. How can I solve this?


How to make Table of Contents for a set of PDF files?  Here's my code!  \documentclass{book} \usepackage{pdfpages} \usepackage[pdfauthor={<somename>},pdftitle={<sometitle>},pdftex]{hyperref} \usepackage{fancyhdr} \usepackage{tocloft} \usepackage[margin=0.5in,bottom=0.75in,top=0.75in]{geometry}   \pagestyle{fancy} \renewcommand{\headrulewidth}{0.4pt} \fancyhead[L]{X Y Z} \fancyhead[R]{} \begin{document}  \tableofcontents \newpage  \clearpage \phantomsection \includepdfset{pages=-,pagecommand=\thispagestyle{fancy}} \addcontentsline{toc}{chapter}{SAMPLE PDF 1\\ \textit{description}} \includepdf[pages=-]{template1.pdf}  \clearpage \phantomsection \addcontentsline{toc}{chapter}{SAMPLE PDF 2\\ \textit{description}} \includepdf[pages=-]{template2.pdf}  \clearpage \phantomsection \addcontentsline{toc}{chapter}{SAMPLE PDF 3\\ \textit{description}} \includepdf[pages=-]{template3.pdf}  \clearpage \phantomsection \addcontentsline{toc}{chapter}{SAMPLE PDF 4\\ \textit{description}} \includepdf[pages=-]{template4.pdf}  \clearpage \phantomsection \addcontentsline{toc}{chapter}{SAMPLE PDF 5\\ \textit{description}} \includepdf[pages=-]{template5.pdf}  \end{document}   Here's the output.    My problem is that the page number is not aligned with the title, it is aligned with the description. Also I'd like to put dots.   My desired output looks like this:


My question is about the resistor for termination in a CAN network. From an electrical perspective why should we add this resistor (commonly 120 Ohm) between the CAN_H and CAN_L? Thanks in advance.


Question about deriving posterior distribution from normal prior and likelihood

I am trying to understand how to derive the posterior distribution of a parameter $\mu$ given data vector $z$, $P(\mu|z)$, where  $$ \mu \sim N(0,A) $$  and  $$  z|\mu \sim N(\mu,1). $$  Obviously from Bayes theorem  $$ P(\mu|z) = g(\mu) f(z|\mu) /f(z). $$  where $$ f(z)= \int g(\mu) f(z|\mu) d \mu . $$  I can write $g(\mu) f(z|\mu)$ as a pointwise product of normal densities:  $$  \frac{1}{2 \pi \sqrt{A}} \exp \bigg(-\frac{\mu^2+A(z-\mu)^2}{2A}\bigg) $$  the solution is given in Efron's book on Large Scale Inference, p. 2. :   $$ \mu|z \sim N(zB,B)$$ where $$B=\frac{A}{A+1} $$  I would appreciate advice on how to approach the problem (and the answer to this question is a proof). In particular I do not understand what to do with the integral in the numerator of Bayes theorem.   EDIT Following answer by @Neil_G I took a next approach:  We have:  \begin{align} g(\mu)   &\propto \exp\bigg(- \frac{\mu^2}{2A}\bigg)  \\[8pt] f(z|\mu) &\propto \exp\bigg(z \mu - \frac{1}{2}(z^2+\mu^2)\bigg) \end{align}  so \begin{align} P(\mu|z) &\propto \exp\bigg(- \frac{1}{2A} \mu^2 + z\mu - \frac{1}{2} z^2 - \frac{1}{2} \mu^2\bigg)  \\[8pt]  &= \exp \bigg(-\frac{1}{2B} (\mu^2+Bz^2-2Bz \mu)\bigg)  \\[8pt] &\propto \exp \bigg(-\frac{1}{2B} (\mu^2-2Bz \mu)\bigg)  \\[8pt] &\propto \exp \bigg(-\frac{ (\mu - Bz)^2}{2B}\bigg)  \end{align}  which completes the proof.


Looking for a pre-1975 short story about a space ship carrying male and female clones

A short story of a science fiction collection set on a ship or freighter in space from the captain's point of view. He once refers to his second in command or pilot as "Little One".  The male and female clones (possibly 10 or more) of a single person come aboard. Even though genetically brothers and sisters (or twins), they have sex together and the captain wonders if he can approach one of the women.


Natural numbers can be represented  by defining them to contain every number that is smaller than them. Arithmetic can be performed on them using the . Are there any similar definitions for integers, rationals and reals?  For example, I could define a rational to be an ordered pair of dividend and divisor. But that would leave the two rationals $\frac{1}{2}$ and $\frac{2}{4}$ not equal to each other, and it would be based on ordered things rather than pure sets.


How close to pure math is cryptographic theory?

I'm an undergraduate math student, and I'm thinking about topics for an undergraduate thesis. I have an interest in topological spaces and number theory, but I'm having trouble identifying a relationship between those and cryptographic theory. In On Post-Modern Cryptography, Goldreich talks a lot about rigorous analysis. But it's still not giving me a clear understanding of what type of math a person doing research in theory does in general. Is cryptographic research in the same line as formal mathematical proof? Is there a need for abstract mathematics in modern cryptography? I can program, but application is not really my interest and it would take too long in my degree to add a formal computer science aspect.


How to create a list after every n terms


I'm going to accessing my ubuntu machine remotely from my windows machine through putty. Are there any suggestions for possible ways to get an X server running on my windows machine?  Thanks.


Assuming Windows, is there a way I can detect from within a batch file if it was launched from an open command prompt or by double-clicking?  I'd like to add a pause to the end of the batch process if and only if it was double clicked, so that the window doesn't just disappear along with any useful output it may have produced.  Any clever ways to do this?  I'm looking for solutions I could rely on to work on a machine that was configured more or less with default settings.


Is there any alternative for task manager in Ubuntu?

In Windows, we have the Windows task manager which can be used when the system becomes stuck or any programs become stuck (ie, ctrl+shift+esc). We can close the hung programs using this. I'm not too familiar with Ubuntu, are there any alternatives in Ubuntu for this purpose?


Installed app not showing up in top bar after reboot

Lets start by saying that i am new at Ubuntu i think i have had it installed for about three weeks now.  So if my terminology is off please feel free to correct me as i would like to learn.   I installed this app called Screen cloud i was looking for an app that could take shots of sections of my screen like so    This was the first app i found.  I used the Ubuntu software install app on the left hand side bar     All good   Question  When i reboot in the morning how do i get it so that the app shows up in the top bar     So that i dont have to open the app in     And hit launch   i tried settings for the app i tried right clicking this top bar   I'm not sure how to add something to start up on Linux type system.


Compactness of unit ball in Holder space

I'm trying to prove that the closed unit ball in the Holder space, $B^\alpha=\{ f\in C^\alpha[a,b]:\|f\|_\alpha\leq1\}$, is compact in $(C[a,b],\|\cdot\|_\infty)$. I know I should use Arzela-Ascoli Theorem and show that the ball is bounded, equicontinuous and closed. For the closedness part of the proof, I take a convergent sequence $f_n$ in $B^\alpha$ and want to show that it converges to a point $f$ in the ball. Since the sequence is convergent, for every $\epsilon>0$, there exists an $N$ s.t. $$\epsilon>\|f_n-f\|_\infty\geq |f_n(x)-f(x)|\geq |f(x)|-|f_n(x)|$$ for every $x$ in the domain and $N>n$.  I'm stuck here! How do I proceed?


Simple Noetherian domain which is not a division ring

I need a simple Noetherian domain which is not a division ring.    I do know that this ring must not be Artinian, since otherwise it would be a division ring. Thanks in advance!


$\sin(ωt) + \sin(ωt+\Delta\theta) + \sin(ωt+2\,\Delta\theta) + \cdots + \sin(ωt+\overline{n-1}\,\Delta\theta) ={}$?

How will we add this series?  Any simple process? This is one of the equation derived from the equation to find intesity of ray at any particular point in Fraunhofer diffraction. I think this can be solved using simple series but my teacher told any process involving Imaginary part iota, which I couldn't understand.


Find all ideals of $\mathbb R[x] / \langle x^2-3x+2\rangle$.   I know that $\langle f(x)\rangle \subseteq \langle x^2-3x+2\rangle$ iff $\langle f(x)\rangle$ divides $\langle x^2-3x+2\rangle$. But $\Bbb R[x] / \langle x^2-3x+2\rangle$ is all the combinations $(x^2-3x+2)q(x), q(x)\in \mathbb R[x]$, so isn't the ideals all of the polynomials in $\Bbb R[x]$? Probably not, but what am I missing here?


What does the syntax of pipe and ending dash mean?

Disclaimer. I'm a long-time Windows user and just starting to get my head around the Linux paradigm. While excited by it, I understand that my formulations might be poorly chosen due to ignorance.  I've received , the contents of which included the following line, which I need help interpreting (after a while of googling I've got a pretty good guess but I'd like to make it more reliable).  curl -sL https://blabla | sudo -E bash -   I understand that we first create a web call to the URL blabla and then (here's the pipe magic popping up) execute a command with admin elevated privileges to open a new terminal window instance.  However, when I try to digest the command, I learn that it's equivalent to the following sequence.  curl --silent --location https://blabla sudo -E bash -   Question 1: Is that correctly understood?  Further on, I tried to learn what the switches for the second line are and used the statement as follows.  man bash | sed -n '/-E/,+1p'   However, I can't really see what "-E" is shorthand for (is it --empty or is it -- or maybe --err) and get stuck on the interpretation. Also, I can't figure out what the alone dash character does and I'm not sure how to look it up in the manual using the statement above.  Question 2: How do I look up the verbose syntax for the switches?  Question 3: What is the meaning of the dash character without the switch?


Prove that rank $(g \circ f)\le \min[\operatorname{rank}(f),\operatorname{rank}(g)]$; $g$ and $f$ are linear mappings

Prove that rank $(g \circ f)\le \min[\operatorname{rank}(f),\operatorname{rank}(g)]$, where $g:V \to W$ and $f:U \to V$ are linear mappings and $U,V,W$ are vector spaces. I do not understand how it can be less than? Can someone explain the proof to me.


When should I use the new keyword in C++?

I've been using C++ for a short while, and I've been wondering about the new keyword. Simply, should I be using it, or not?  1) With the new keyword...  MyClass* myClass = new MyClass(); myClass->MyField = "Hello world!";   2) Without the new keyword...  MyClass myClass; myClass.MyField = "Hello world!";   From an implementation perspective, they don't seem that different (but I'm sure they are)... However, my primary language is C#, and of course the 1st method is what I'm used to.  The difficulty seems to be that method 1 is harder to use with the std C++ classes.  Which method should I use?  Update 1:  I recently used the new keyword for heap memory (or free store) for a large array which was going out of scope (i.e. being returned from a function). Where before I was using the stack, which caused half of the elements to be corrupt outside of scope, switching to heap usage ensured that the elements were in tact. Yay!  Update 2:  A friend of mine recently told me there's a simple rule for using the new keyword; every time you type new, type delete.  Foobar *foobar = new Foobar(); delete foobar; // TODO: Move this to the right place.   This helps to prevent memory leaks, as you always have to put the delete somewhere (i.e. when you cut and paste it to either a destructor or otherwise).


bash shell - ssh remote script capture output and exit code?

I wish to use shell to invoke a script on a remote server. I would like to capture the output of that script (its logging messages) and the exit code it returns.   If I do this:  ssh user@server /usr/local/scripts/test_ping.sh echo "$?"   I get the exit code but can't capture the remote logging messages .  If I do this:  local RESULTS=$(ssh user@server /usr/local/scripts/test_ping.sh) echo "$?"  LOG "${RESULTS}";   I get to log my output using my LOG function but can't seem to get a correct exit code, I assume the code I get is the code from the varianble assignment.   I would like to continue to use my LOG function to capture all output as it formats and sends things to a file, syslog, and the screen for me.   How can I capture results in a var AND get the correct exit code from the remote script?


Are there any counterexamples which show that $E(XY) = E(X)E(Y)$ cannot imply $X,Y$ is not necessarily independent?

I know that if $X,Y$ are independent, then $E(XY) = E(X)E(Y)$ holds. But the reverse is not true. I'd like to know that are there any examples to show the fact?


Need help understanding the difference between RGB and CMYK

I am a web developer that fancies myself on being graphically savvy, but I am far from a graphical designer — everything I need is able to be done in raw HTML and CSS. The marketing director at our company has been consolidating branding company-wide. Now, when it comes to apparel, the public site, and almost everything else, this is crucial. But with our private in-house web software (which is my domain), aesthetics is everyone's last concern compared to bug fixing, features, etc. I am, however, trying to get our web app at least a little more brand-compliant. So when the marketing director distributed an up-to-date color guide PDF to me, I was ecstatic! I quickly became confused, however. Here's a sample from the color guide:    I know that CMYK is primarily for printing and not the web, which is about all I know about it. However, you'll notice that the RGB and Hex values provided visually produce different colors that what are appearing. Take, for instance, the black. It says that the RGB equivalent of CMYK 0,0,0,100 is 0,0,0. It's easy to tell though that this isn't a "true" black (at least on my display), and comparing it to an RGB of 0,0,0 I generated in Paint (is using Windows a faux pas around here? :D ) confirms this. If I take a screenshot of the color guide PDF and then use Paint to grab the color, it tells me that its RGB is 35,31,32.  So what am I missing here? If I use the RGB/Hex values the marketing director provided, my site's colors will not look the same as they do when I view this PDF, and my attempts to explain this in web design terms to him went over his head.  Does anybody have some guidance on how I should proceed, and how I should implement these colors on the web?


Is there an expression to indicate the strategy of wearing someone down with numerous small irritations?

I would use rope-a-dope, but it's got connotations of pretending to lose that I don't need. I'm trying to describe the behavior of someone who sends twenty detailed emails a day about various projects, and the recipient of his emails has finally gotten tired of trying to parse them, so the recipient just agrees to whatever he proposes. I'd like an expression that evokes both outward earnestness and hidden creepiness, like Uriah Heep, Dickens's "Humble servant" with veiled ambition, who overdoes it with professions of humility until he's in power. Water torture would work, but comes too close to a more racist expression that I'm not comfortable with.


How to set DNS to my IP and port - Atlantic.Net

I'm new to host my ruby on rails application on the server. I have bought a server from Atlantic.Net and running my project on a port let's say port-3001. Now I'm unable to set my domain to my IP and a specified port. Please suggest anyone what and how to do... ?


In a Google account (sync), what is the difference between Contacts and People details?

For a Google account, you are allowed to sync Contacts and People details. What is the difference between these two?


0 helpful flags doesn't mean I haven't flagged at all - please fix it finally?

So before the page redesigns I (and not only me I guess) got problems with being unable to get the flag summary without switching to address bar if I had no flags - the number was shown only if you have some helpful ones.  Since the page redesign the activity tab has a link to your flags which looks like "X helpful flags". But wait, it doesn't appear to be a link if I have some declined, disputed, aged out or active flags, but no helpful. Please make it be a link always.


In Matthew Schwartz's QFT text, he derives the Schrodinger Equation in the low-energy limit.  I got lost on one of the steps.  First he mentions that   $$ \Psi (x) = <x| \Psi>,\tag{2.83}$$  which satisfies  $$i\partial _t\Psi(x)=i\partial_t< 0|\phi (\vec{x},t)|\Psi>=i<0|\partial_t\phi(\vec{x},t)|\Psi>.\tag{2.84}$$  That was all fine and good, but he lost me on the next part, going from the first line (i) to the second (ii).  (i)$$i<0|\partial_t\phi(\vec{x},t)|\Psi>=<0|\int \frac{d^3p}{(2\pi )^3} \frac{\sqrt{\vec{p}^2+m^2}}{\sqrt{2\omega _p}}(a_pe^{-ipx}-a_{p}^{\dagger}e^{ipx})|\Psi>$$ (ii)$$=<0|\sqrt{m^2-\vec{\nabla}^2}\phi_0(\vec{x},t)|\Psi>.\tag{2.85}$$  He apparently uses:  $$\partial _{t}^{2}\phi_0=(\vec{\nabla} ^2-m^2)\phi_0$$  to get the following term  $$\sqrt{m^2-\vec{\nabla}^2}$$  in equation (ii) above, but not quite sure how.  Can anyone help me out?   This is on page 24 for those that have the text.


What happens when you use summability methods on the harmonic series?   I'm quite surprised I haven't been able to find anything on this anywhere, considering that the partial sums of the harmonic series grow at a logarithmic rate, while series whose partial sums grow quadratically are summable.


Windows filter traffic on hosted network

I have set up a hosted wi-fi network bridged to an Ethernet connection by following . The network works, but I want to be able to monitor/block certain traffic going through the hosted network to the Ethernet connection. How can I do this?


Need help understanding math behind Rijndael S-Box

in Rijndael SubBytes() step all bytes of input block are substituted based on a lookup table S-Box. S-Box is initialized by taking all elements of $GF(2^8)$, calculating their multiplicative inverse and then calculating their affine transform. Here is C code which does that as found on wikipedia page. #include <stdint.h>  #define ROTL8(x,shift) ((uint8_t) ((x) << (shift)) | ((x) >> (8 - (shift))))  void initialize_aes_sbox(uint8_t sbox[256]) {     uint8_t p = 1, q = 1;          /* loop invariant: p * q == 1 in the Galois field */     do {         /* multiply p by 3 */         p = p ^ (p << 1) ^ (p & 0x80 ? 0x1B : 0);          /* divide q by 3 (equals multiplication by 0xf6) */         q ^= q << 1;         q ^= q << 2;         q ^= q << 4;         q ^= q & 0x80 ? 0x09 : 0;          /* compute the affine transformation */         uint8_t xformed = q ^ ROTL8(q, 1) ^ ROTL8(q, 2) ^ ROTL8(q, 3) ^ ROTL8(q, 4);          sbox[p] = xformed ^ 0x63;     } while (p != 1);      /* 0 is a special case since it has no inverse */     sbox[0] = 0x63; }  I cant wrap my head around how multiplicative inverse is being calculated here. I assume p here acts as input while q is its inverse. Hence $p*q = 1$. I want to understand how exactly this works because I am trying to implement a function that initializes Rijndael inverse S-Box, where first the inverse affine transform is calculated and then the multiplicative inverse.


How to create a buisness card with an embossed effect?

After I have found this website  it was quite easy for me to generate something similar with my own business card design.  However, it is quite flat. And it would be really cool to have something more like this:    Is it possible to give the a plane with a texture such a "pressed effect"?


I want to differentiate   $x^2 + y^2=1$ with respect to $x$.  The answer is $2x +2yy' = 0$.  Can some explain what is implicit differentiation and from where did $y'$ appear ? I can understand that $2x +2yy' = 0$ is a partial derivative but then it becomes multi calc not single.  This is in a chapter about chain rule so I assume there is some use of the chain rule here but I can't see any composite functions here. We can express y in terms of x but y is not composite.  P.S: I am NOT looking for HOW to solve the problem, I am looking for the WHY as stated above.


Literary device when famous quote altered to change meaning, and still allude to original?

The quote in question is one from Shakespeare's Othello, Iago says “I am not what I am” (I.i.71), it references, but alters the words of God in Exodus 3:14, “I am that/who I am”. Is there a name for this kind of language or a literary device of some kind? Where the author takes a popular or famous quote and alters it change the meaning, while still referencing back to the original?


C++ - class dependency - circular problem

Could you give me advice how should I properly structure my code? I am trying to sort students, and to do it I need access to Database object and also private member of Student - index. Now I get error:      error: ‘Database’ has not been declared            friend void sortStudents(Database db);   but If I reorder classes I will get:     Student’ was not declared in this scope            std::vector  data;   What is the proper solution?  class Student {     private:         int _index {0};     public:         friend void sortStudents(Database db); };  class Database {     private:         std::vector <Student> data;     public:         friend void sortStudents(Database db); };   void sortStudents(Database db) {     std::sort((db.data).begin(), (db.data).end(),               [](const Student& leftSide, const Student& rightSide)              { return leftSide._index < rightSide._index; }              ); }


What is wrong with using inline functions?

While it would be very convenient to use inline functions at some situations,  Are there any drawbacks with inline functions?  Conclusion:  Apparently, There is nothing wrong with using inline functions.  But it is worth noting the following points!   Overuse of inlining can actually make programs slower. Depending on a function's size, inlining it can cause the code size to increase or decrease. Inlining a very small accessor function will usually decrease code size while inlining a very large function can dramatically increase code size. On modern processors smaller code usually runs faster due to better use of the instruction cache.  The speed benefits of inline functions tend to diminish as the function grows in size. At some point the overhead of the function call becomes small compared to the execution of the function body, and the benefit is lost  There are few situations where an inline function may not work:   For a function returning values; if a return statement exists. For a function not returning any values; if a loop, switch or goto statement exists.  If a function is recursive.   The __inline keyword causes a function to be inlined only if you specify the optimize option. If optimize is specified, whether or not __inline is honored depends on the setting of the inline optimizer option. By default, the inline option is in effect whenever the optimizer is run. If you specify optimize , you must also specify the noinline option if you want the __inline keyword to be ignored.


Linear regression question on Idempotent matrix and leverage points

I am considering a linear regression model $Y_i = X_i^T \beta + \epsilon_i, i = 1,2,\dots,n$. where $X_i \in \mathbb{R}^p$. $\epsilon_i$'s are independent copies of random error $\epsilon \in \mathbb{R}^1$ with mean 0 and variance $\sigma^2$. We have the  hat matrix given by  $$ H = X^T (X^TX)^{-1} X$$ I am trying to show $h_{ij}^2 \leq h_{ii} h_{kk}$. I know that $$h_{ij} = X_i^T (X^T X)^{-1} X_j$$ and that $H^2 = H$ because it is idempotent. This gives me $\sum_{k=1}^n h_{ik}^2 = h_{ii}$ but I don't know how to prove $h_{ij}^2 \leq h_{ii} h_{jj}$.


How can I enter my nickname in Pokémon Go when it tells me it is not valid?

How can I enter my nickname in Pokemon Go? I entered my nickname but it is telling me that it's not valid.


Why didn't Ben take Luke to Degobah when he was much younger?

One of Yoda's objections to training Luke was that he was too old.  Also, with the limited time available, by the time Luke first faced Darth Vader he was not ready for it.  Would it not have been a much better plan on the part of Obi-Wan and Yoda to train Luke from a young age and send him in to join the rebellion as a fully trained Jedi knight?


String slicing: ending index specification as -1 seems to be wrong

If there is a string initialized in python:  s="SLICE"   When trying to run this code:  print(s[4::-1])    #Line-1 print(s[4:-1:-1])   #Line2   I thought both are the same thing and give the same output. Instead, Line 1 outputs as expected but Line 2 does not.


Strange symbol in place of full-stop in TexMaker

Writing in texmaker these lines  (the mount heigh is $1200m$). we saw it in \ref{chapter1}. width=6.02099737532808in           (inside tikzpicture environment)   all the dots (fullstop) get replaced by this symbol    When I compile the document then it behaves like a dot, and get rendered as a dot/fullstop. Even if it's not a problem thou, I would like to understand what this symbol means and if it has some reason to exist...  Anyone has a clue?  EDIT:  Compilable version:  \documentclass{book} \begin{document} (the mount heigh is $1200m$). we saw it in \ref{chapter1}. \end{document}


Book about a traveler who helps planets in need

I was recommended an old book (read around 1985, must be older than that) but they didn't remember the title. All I know (might be inaccurate) is:  A traveler finds a spaceship. This spaceship contains "all" knowledge, so he goes around and offers to help planets in need.  One of those planets is a planet plagued by overpopulation. He solves that problem repeatedly with improved nutritional methods until he gives them one last food that makes them infertile.


How can I switch input language with CapsLock on Ubuntu 18.04? For some reason when I try to set CapsLock as a switching key it enables Caps, but doesn't set it as switching language key.  When this window is open and I press Caps, the LED light switches on and off. But the key isn't registered.    Update: As explained in the linked post, you have to use Gnome Tweak Tool to change these settings.  sudo apt install gnome-tweak-tool


Reclaim lost space from Bootcamp Partition

First off, sorry I didn't understand you had to use apples bootcamp software to deal with bootcamp partitions. I wanted to stop using bootcamp, so I deleted the partition through disk manager some time ago. Since then I have been trying to get the 400GB space back.   Today I followed this thread:   And I deleted the partition that showed up. But the result is that it has simply vanished, I can't reclaim it, because it does not even show up on disk manager or diskutil.  I have the 3TB fusion drive, but only 2.7 GB is available. I'm on a late '12 imac with high sierra 10.13.3.          ===== final result ======


Showing $\lim_{x \to \infty}\frac{f(x)}{x}=L$ if $\lim_{x\to\infty} (f(x+1)-f(x))=L$

Let $f:\langle 0,\infty)\to \mathbb{R}$ be a function which is bounded in each bounded interval.      Show that if $\lim_{x\to\infty} (f(x+1)-f(x))=L$ then    $$\lim_{x\to\infty}\frac{f(x)}{x}=L.$$   It looks like that one should use derivatives (I guess) however I got nowhere!  Any suggestions?


Redirect outgoing port 25 to another network

My ISP is blocking outgoing port 25 so i need to redirect only outgoing port 25 via my backup vpn. Is this posible? Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 enp3s0 10.9.0.0        10.9.0.153      255.255.255.0   UG    0      0        0 tun1 10.9.0.153      0.0.0.0         255.255.255.255 UH    0      0        0 tun1  vpn is at tun1 How to make it?


I would like to style my document in such a way that the page is divided into four equal parts and then the text is printed in those pages: it is similar to twocolumn but I also want to have, say two rows. The reason is that I would like to cut the page into four smaller pieces, so it would be very convenient if LaTeX can do this. Thank you in advance for help!


Copy utuntu.iso to pc then intall it by a usb

As the title, how to install ubuntu previously copied in windows7 by a usb booter. Thanks.


When i render an image some if it turns black how do i fix this?

Everytime i render an image some if the render turns a little black is there a fix to this? If so please tell me!


Is it possible to UV mapping to single pixel?

I'm making models that has only used few colors. For instance, if there is a gun with arm, the gun only uses 2~3 colors and the arm only requires one.  First what I did was creating multiple materials and assign them to faces without UV mapping. Note that these models were used for my personal game project with Unity Engine.  But the problem is that each material requires high rendering costs in Unity, so I had to reduce the number of material as I possible.  So I changed my models to have single material with UV mapped, and painted textures from Substance Painter 2. But the problem is that it still only needed a few colors but texture images are too big. I want to make texture as small as possible, but I have no idea how to do.  I think it will be good if I can assign UV map to each pixel has different color. Is there a way to achieve this?


How do I change a disk partition map scheme from MBR to GUID Partitions Table?

I just finished the huge download of Mac OS X Lion, started the installer, and now I have a problem. The installer says that I must have the GUID-Partitions Table Scheme.  The problem is that when I go into the disk utility, I can't change the format anymore, because I have Master Boot Record as type.  Can anyone help me, please?


Suppose that $X$ and $Y$ are independent variables of distribution $N(0,1)$, and $Z=\min(X,Y)$. Show that $Z^2 ∼ χ^2 (1)$

Suppose $X$ and $Y$ are independent of distribution $N(0,1)$, and $Z=\min(X,Y)$. Show that $Z^2 ∼ χ^2 (1)$ (even though it doesn't mean that Z∼N(0,1)) I know that: Fz(t) = P(min(X,Y)≤t) = 1−P(X>t)P(Y>t) =1−(1−P(X≤t))(1−P(Y≤t)) = 1−(1−FX(t))(1−FY(t)) But I get confused at how to make this equation equal to $χ^2 (1)$


I'm repeatedly being asked to download the "Apple Dictionary" when I open the dictionary application.     Dictionary application needs to download dictionary "Apple Dictionary" before use.   This doesn't happen every time I open it. I haven't pinned down specific usage cases where this message appears, but I think it may be every time after I reboot my computer.  Is there anyway for the Dictionary application to remember that I have "Apple Dictionary" permanently? This has only started happening after I upgraded from OS X Mountain Lion to macOS Sierra.


Extra faces appear when I exit edit mode

I'm having this problem where the mesh appears to change whenever I leave edit mode. Some extra faces seem to be there but when I go back to edit mode they just disappear.


Relative speed when approaching the speed of light

According to this chart of the Lorentz factor as a function of speed:     If a spacecraft neared (roughly) 0.85c, would it appear to be traveling at 1.7x the speed of light from the perspective of those on board - i.e. covering 0.85c distance, but in half the time amount of time?


Wireless internet connection does not work properly

My wireless internet conecction disconnect after a couple of minutes of being connected. Then I need either restart the computer or change the wireless device to another port, but only will last little time connected. After trying to connect selecting the network it only says connecting and nothing happens. I tried restarting the service manager sudo systemctl restart NetworkManager and sudo service network-manager restart This is a link with the content after diagnostic:


Suppose you're given two envelopes. Both envelopes have money in them, and you're told that one envelope has twice as much money as the other. Suppose you pick one of the envelopes. Should you switch to the other one?  Intuitively, you don't know anything about either envelope, so it'd be ridiculous to say that you should switch to the other envelope to maximize your expected money.   However, consider this argument. Let $x$ be the amount of money in the envelope you picked. If $y$ is the amount of money in the other envelope, then the expected value equals  $$E(y) = \frac{1}{2}\left(\frac{1}{2}x\right) + \frac{1}{2}\left(2x\right) = \frac{5}{4} x$$  But $5x/4 > x$, so you should switch!    The Wikipedia article says that $x$ stands for two different things, so this reasoning doesn't work. I say this is not a valid resolution.   Consider opening up the envelope that you pick, and finding $\$10$ inside. Then you can run the expected value calculation to get $$E(y) = \frac{1}{2} \cdot \$5+\frac{1}{2} \cdot \$20 = \$12.50$$  This means that if you open one of the envelopes and find $\$10$, you should switch to the other envelope. The $\$10$ doesn't stand for two different things, it literally just means $\$10$.   But you don't have to open up the envelope to run this calculation, you can just imagine what's inside, and run the calculation based on that. This is what "Let $x$ be the amount in the envelope" means. The problem with the argument is not that $x$ stands for two different things.   So what is the problem?    Previous questions on stack exchange have given the resolution that I just said I wasn't satisfied by, so please don't mark this as a duplicate. I want a different resolution, or a more satisfying explanation of why $x$ does stand for two different things.  Apparently there is still research being published about this problem - maybe it isn't so obvious?    I think there's something subtle wrong with the premise. Because there's no uniform probability distribution on $\mathbb{R}$, statements like "random real number" are not well-defined. Likewise, I think "one envelope has twice as much money as the other" assumes some probability distribution on $\mathbb{R}$, and perhaps our expected value calculation assumes that this distribution is uniform, which it cannot be ...


I have a backup device set for my transaction log so the sets are contained in 1 file. I have this set to append, is this correct or should it be overwrite in the plan? After the full backup is taken and then the next log backup, I still see additional sets in the file.  Update  Ok I tested this an over writing loses all other sets. So is there a way to purge this after a full backup has been taken from a plan?


$\int f(x) dx $ is appearing as $\int dx f(x)$. Why?

A few of us over on MITx have noticed that $\int f(x)  dx $ is appearing as $\int dx  f(x)$.  It's not the maths of it that worries me. It's just I recently read a justification (analytical?) of the second form somewhere but can't recall it or where I saw it.  Can anyone give me a reference?


C++ VS2013: overwriting default constructor not working

I have a weird problem in C++. Probably I am just doing something wrong, but I can't figure out, what. I am using Microsoft VS2013 if that is important.  I created a new class with two constructors:  class CtVolume{ public:          CtVolume();                                                  CtVolume(std::string path);                              ...   The first one should overwrite the default constructor. This is the one that does not work as I expected. If I do something like:  CtVolume myVolume();   then I think this should call the default constructor that I defined and execute the code I implemented for it. But it doesn't. The code in my Constructor is not executed. What is even more puzzling is that I can't use the myVolume like an object afterwards. If I attempt to call one of the methods implemented in the class:  myVolume.reconstructVolume();   The compiler does not let me compile my code. It says:     Error 5   error C2228: left of '.reconstructVolume' must have class/struct/union   So as it seems, this way I can't create an object.  Now, if I create the object with the keyword 'new' instead, my constructor code is being executed and everything works as expected. Example:  CtVolume* myVolume = new CtVolume(); myVolume->reconstructVolume();   This works fine.  Now another thing: if I use the other constructor I defined, both ways of creating the object work equally good, meaning this example:  CtVolume myVolume("sourcefiles/data/skullPhantom"); myVolume.reconstructVolume();   compiles and works as expected.  Now I tried to find out what type of myVolume is in the different cases, by calling typeid(myVolume).name(). This returns the type class CtVolume __cdecl(void) in the case that I described, where it "doesn't work" and class CtVolume in the "working" case where I used the other constructor.  Now can anybody tell me, what the __cdecl(void) means and what I did wrong? What also puzzles me is that I think I did that a lot of times before and it always worked for me until now.  Thanks!


The center of the fundamental group of closed surface

$S^g$ is a closed surface with genus $g$, we know that the fundamental group $\pi_1(S^g)=\{a_1,a_2,\dots ,a_g,b_1,\dots,b_g|a_1b_1a_1^{-1}b_1^{-1}\dots a_gb_ga_g^{-1}b_g^{-1}=1\}$, how to calculate the center of $\pi_1(S^g)$? I think the center of $\pi_1(S^g)$ is trivial, if $g\ge 2$, but I cannot prove it.


How can I draw the trefoil knot in 3D co-ordinates in Latex using these parametric equations?

When I use the parametric equations (according to Wikipedia) to plot a trefoil knot: x(t)=sint+2sin2t  y(t)=cost−2cos2t  z(t)=−sin3t  I get a plot that looks very different from the   This is my code: \begin{tikzpicture} \begin{axis} \addplot3[variable=t,mesh,domain=-2*pi:2*pi] ({sin(deg(t))+2*sin(deg(2*t))},{cos(deg(t))-2*cos(deg(2*t))}, {-1*sin(deg(3*t))}); \end{axis} \end{tikzpicture}  How can I create a nice plot of a trefoil knot? Thank you!


Course of action to change fields after a PhD?

A little introduction: I've done some research in interferometry during my MsC, and from then on, my MsC thesis was on optical fiber sensors, then I worked for two companies in sensorization with optical fibers, and now I am enrolling on a PhD on that very subject.  I like photonics, but I feel like I'd want to try something different. I had the option of getting a PhD in quantum optics but decided on this one, in the end (mostly for logistic reasons, and I liked both themes).   Now, I am not sure whether I will have trouble changing fields (within photonics) after specializing so much in one, especially being my research very engineer/application focused and not so much in slightly more fundamental, or even experimental physics.  I've seen similar questions from time to time, but my specific question would be: Have I specialized too much to change my field after a phd, and what course of action should I start taking NOW in order to keep my doors open after a PhD?


Hi Visualforce experts:  Is it possible to dynamically resize a Visualforce Page based on a specific condition?  For example, on my page - warning #2 is displayed only when a condition is met.    If this condition is not met, the warning is not shown.  Warning #1 is always static/does not change.  I would like to essentially resize my page when the condition is not met.    <apex:page standardController="Opportunity" extensions="OpportunityControllerExtension">  <apex:stylesheet value="{!$Resource.alerts}"/> <apex:stylesheet value="{!$Resource.infoIcon}"/>  <warning>   <apex:outputLabel value="Opportunities may be submitted for Approval and/or     Resource Assignment at Stage 3 or later."> </apex:outputLabel>  </warning>  <apex:form rendered="{!Opportunity.Account.NumberOfEmployees == 0}">  <apex:stylesheet value="{!$Resource.alerts}"/> <apex:stylesheet value="{!$Resource.infoIcon}"/>  <warning>   <apex:outputLabel value="Please populate the Number of Employees on the ">{!opportunity.Account.Name}    Account before moving forward. </apex:outputLabel>       </warning>  </apex:form>  </apex:page>


I had something done vs I got something done

I have discovered that when you dont do something yourself but you make someone else to do it, you can say either:  I had my hair cut. OR  I got my hair cut.  I wonder  whether those two have exactly same meaning and usage. Is one form more common than other? More formal? More suitable in some situations?


How do you complete the "Phantom Prospect" assignment?

In my battlelog, it shows the assignment called Phantom Prospect.   The last requirement I need to complete is listed as a '?'...The How do I completed this?


Being a victim of serial-downvoting today I found an odd behavior for   two days before when someone downvoted the post it show as:        and today again it shows:        voting counts show me as:        I am surprised why it is subtracting 4 points on this particular post, for all other posts in serial-downvoting -2 reputation was considered. Is there any specific post or scenario where -4 is considered, or its just a bug?