I am trying to understand how an optimal tree length is determined using cost-complexity pruning.  Visit this lecture note screenshot:   In the highlighted equation, I don't understand how C(T) or alpha is calculated. My thought process is that a large tree is grown and then a subtree is created and then they are compared but I don't understand how.  Thanks in advance.

In the following lectures , they describe a tree algorithm for cost complexity pruning on page 21. It says we apply cost complexity pruning to the large tree in order to obtain a sequence of best subtrees, as a function of $\alpha$. My initial thought was that we have a set of $\alpha$ (i.e. $\alpha \in [0.1, 0.2, 0.3])$. And then we compute the K-fold cross-validation for each set $\alpha$ and choose the $\alpha$ corresponding to the lowest K-fold cross validation.  For reference, the K-fold cross-validation that I am referring to is described on slide 15 in the following .  However, after some thinking and reading; I found there is a theorem that the sequence of subtrees went through by weakest link pruning will contain the subtree $T_\alpha$. Where $T_\alpha$ is the subtree that minimizes the cost complexity criterion  $$ C_\alpha (T) = \sum_{m=1}^{|T|} \sum_{i: x_i \in R_m} (y_i - \hat y_{R_m})^2 + \alpha|T| $$ described on slide 19 in the  slides.  Since this theorem exists I thought it might be plausible that you can deduce a neat mapping of each $\alpha \in \mathbb{R}$ to the optimal subtree $T_\alpha$. Or at least we can see that for a certain interval of $\alpha$s it will correspond to a specific subtree. I found this theorem on page 308 of the  of print 4. It would be great if someone could clarify the algorithm and it would help to know if such a mapping exists.


I would like to know if there's a way to do this:  My PC has 1 usb port, if I connect thumbdrive1, it will get drive letter M: (example), then I remove it. I then connect thumbdrive2 and it will get drive letter M:. How can I configure Windows to achieve this behaviour?  So that any usb drive I connect stays in the same letter?

Depending on what's currently connected to a PC, a USB key does not always get the same drive letter.  This is an issue for me because I want to use this key as a backup destination, and I thus have to change the path that's used from time to time.  Is it possible to make sure that a specific key always ends up with the same letter?


the mask is too small but in the movie clip editor its looks good is it because I filmed with an iPhone  I can resize it my self but I want it to be normal

I masked an image in the UV/Image editor masking section. I then used that mask in the compositor for background replacement. However, the mask size seems to be different. Why is that? Here's a screenshot:


suppose I have an ArrayList of 10k employee objects.  how do i find  total memory size of ArrayList?  how do i calculate the usage of ArrayList?

I have an application that reads a CSV file with piles of data rows.  I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause OutOfMemoryErrors.  Each row translates into an object.  Is there an easy way to find out the size of that object programmatically?  Is there a reference that defines how large primitive types and object references are for a VM?  Right now, I have code that says read up to 32,000 rows, but I'd also like to have code that says read as many rows as possible until I've used 32MB of memory.  Maybe that is a different question, but I'd still like to know.


Is this the correct intuition behind the covariant derivative? If not can you please show me how to covariant derivative is related to the directional derivative?  The covariant derivative can be thought of as a generalisation of the directional derivative to non Euclidean spaces. The directional derivative is a mapping which takes as input some tangent vector at a point $p\in \mathbb{R}^n$ and a scalar field $f(x^1, x^2,....,x^n)$ and returns a real number. Since we are working in $\mathbb{R}^n$ we can acknowledge that there exists a map $F: \mathbb{R}^n \to \mathbb{R}^n$ which is to be considered a vector field. Due to the geometry of $\mathbb{R}^n$ we can think of points as vectors and vectors as points and hence the directional derivative acting on scalar fields can naturally be thought of as acting on vector fields. However for a general manifold M, the notion of a derivative acting on vector fields does not arise naturally from that of a derivative which acts on functions, the reason being that we cannot assign to each point $p\in M$ a 'tangent vector in $M$' due to the fact that a vector field in one coordinate chart will not be consistent with a vector field in some other chart. In general the basis of tangent space at $p\in M$ is different to that of $q\in M$, a connection provides a way of relating the two tangent spaces in such a way that permits vector fields to be differentiated in a way that is consistent with notion of the directional derivative on $\mathbb{R}^n$.

I am curious how people picture geometrically how the covariant derivative acts with regards to vector fields. I understand that it is merely an object which has been defined for some use and obeys certain conditions but how would you picture such a thing geometrically? In other words, when someone asks you what the covariant derivative is, how do you explain it in absence of a formal definition?


I want some text to appear as below:    The code I have written for it is :   \begin{landscape} Design Summary (This page shows how to use landscape format in Appendix.)\\ \texttt{---------}\\ Design Summary:\\ Number of errors: 0\\ Number of warnings: 0\\ Logic Utilization:\\ Number of Slice Flip Flops: 3,899 out of 33,280 11\%\\ Number of 4 input LUTs: 3,717 out of 33,280 11\%\\ Logic Distribution:\\ Number of occupied Slices: 2,198 out of 16,640 13\%\\ Number of Slices containing only related logic: 2,198 out of 2,198 100\%\\ Number of Slices containing unrelated logic: 0 out of 2,198 0\%\\ *See NOTES below for an explanation of the effects of unrelated logic.\\ Total Number of 4 input LUTs: 3,890 out of 33,280 11\%\\  \end{landscape}   The output I am getting is as below:    In my output, the word design summary in the 1st line is starting after a couple of spaces. I need it to start from extreme left as can be seen in the 1st picture. Please suggest a solution.

Is it possible to turn off the paragraph indention for a single line? I have the following use case: I open a new section which describes the task of an exercise. Since I use the font size \large for the section I don't want to use the section text for the task description.  Therefore I added the task description after the section. The disadvantage is that an indention is created when starting to write text after the task description.  What are possible solutions to this problem?


I need an English expression ( preferably slang ) to express my willingness and commitment to do something ( e.g I will put my heart and soul into it )

I'm looking for a phrase or an idiom meaning "to get heavily involved in something" or "to become passionate about something" where "something" could be a hobby, lifestyle, a music genre etc.  One possibility would be simply "to get into something" but this doesn't seem to convey being passionate about the thing in question. Another one is "to get sucked into something" but a Google search indicates that this tends to mean "to get involved in something against one's will" which is not what I am after.


I'm extremely confused with the concept of the Unsung Hero badge, since it counts the answers that are both accepted and upvoted. It suggests that the questioner will accept an answer but not upvote it. Don't you think it's a bit schizophrenic behaviour? Or the badge is for people who accept their own answert, unable to upvote it?

Formerly List of all badges with full descriptions.  What are badge name's requirements? Why didn't I get badge name ? Which badges can I earn multiple times?    Jump to:                    Note: Some badges are awarded based on score. The term score means the total number of upvotes minus the total number of downvotes.  Any badge with a *** next to it is one of 20 badges that count towards the  displayed on a moderator candidate in an election. The candidate score is a total of 40 points: the first 20 are awarded based on the user's rep divided by 1000 and rounded down; the second 20 represents the total number of unique badges earned of the 20 that count. Note that if the same badge is earned multiple times, it will only count once towards the candidate score.  Any badge with a "(retired)" next to it is no longer awarded, but is retained by users who previously earned them. See  for more info on what it means for a badge to be retired.       Visit the  of the  on any site to see a complete list of badges that you can filter by earned, unearned, or type.


Evaluate $$I=\int_0^1 \frac{\ln(1-x^2)\arcsin^2 x}{x^2} {\rm d}x.$$  Maybe, we can make a substitution $x=:\sin u, u\in [0,\pi/2]$. Then  $$I=2\int_0^{{\pi}/2}\frac{u^2\cos u\ln\cos u}{\sin^2 u}{\rm d}u.$$ Can we go on from here?

I encountered the integral $$\int_0^1 \frac{\log \left(1-x^2\right) \sin ^{-1}(x)^2}{x^2} \, dx = -0.9393323982...$$ while researching the evaluation of harmonic sums. Mathematica 11 is not able to evaluate this integral, and is not able to evaluate the underlying indefinite integral.  I considered using the Maclaurin series for the expression $\sin ^{-1}(x)^2$ to evaluate this integral. Using this Maclaurin series, it is easily seen that the problem of evaluating the above integral is equivalent to the problem of evaluating the series $$\sum _{n=1}^{\infty } \frac{2^{2 n-1} H_{n-\frac{1}{2}}}{(1-2 n) n^2 \binom{2 n}{n}}=-0.9393323982...$$ which Mathematica 11 is not able to evaluate directly.  I also considered using the Maclaurin series for the expression $\log \left(1-x^2\right)$ to evaluate the above integral. Using this Macluarin series, it is easily seen that this integral is equal to $$\frac{1}{4} \left(16 \pi  C-\pi ^3-\pi ^2 \log (4)\right)+\sum _{n=1}^{\infty } \frac{\, _3F_2\left(\frac{1}{2},\frac{1}{2},1;\frac{3}{2},n+1;1\right)}{n^2-2 n^3}=-0.939332...,$$ but Mathematica is unable to evaluate the above infinite series.  What is a closed-form evaluation of $\int_0^1 \frac{\log \left(1-x^2\right) \sin ^{-1}(x)^2}{x^2} \, dx$? What techniques can be applied to evaluate this definite integral?


I want to prove the following equation : $$ (dm,dn) = d\cdot(m,n)  $$ where  $$ (m,n) = \gcd(m,n) \\ (dm,dn) = \gcd(dm,dn) $$ I tried this : $$ (dm,dn) \rightarrow \exists g_1 \in Z : g_1|dm, g_1|dn \rightarrow g_1|(dm\cdot x+dn\cdot y) \rightarrow g_1|d\cdot (mx+ny) \\ \rightarrow g_1=\frac{d\cdot (mx+ny)}{t} $$ And the same for $ (m,n)$ : $$ g_2=\frac{mx+ny}{t} $$ If i insert $g_1$ and $g_2$ i get : $$ d\cdot\frac{mx+ny}{t}=d\cdot \frac{mx+ny}{t} $$  Is this right?

I need to prove that $z\gcd(a,b)=\gcd(za,zb)$.    I tried a lot, for example, looking at set of common divisors of the two sides, but I can't conclude anything from that. Can you please give me some advice how I can handle this problem? And $a,b,z \in \mathbb{Z}$.


Why do people say "I want it done fast"?  Fast is modifying 'done' which is the past tense of a verb. Verbs are modified by adverbs - which end with 'ly'. They should say "I want it done quickly".  A similar mistake arises about cars (and other the things). It may be a fast car, but you drive it quickly - you do not drive it fast.  I discussed this with a professor of computing who said "It doesn't matter - it's common usage". Common or not, it is wrong. Yes, or no?  Does anyone care anymore? Does anyone know anymore?

Is it acceptable to say "We'll get back to you as quick as we can"? Is "quick" a flat adverb in this case?


I edit a lot of posts every day. I often run across posts with 'Hi' and 'Thanks' on the top and the bottom of the post respectively. I also run across things like:     --User   Should these items be removed during the editing of the post by an editor?

I recently had a number of my valid answers voted down because people objected to the fact that I added a tagline to the end. The answers were correct for the questions asked and the downvotes were only due to the tagline regarding hiring, which said:     We're hiring! Developers and QA in Washington, DC area (or looking to relocate) should send resumes to careers@example.com.   Are taglines and signatures disallowed?     For more information, see "" in the .


I know this question has been asked before, but I cannot find a solution for Ubuntu 18.04  I have an external hard drive (FAT32) that had a default name with spaces that was making my life hell for scripting. So I manually changed the mount point to  /media/$user/Ext1TB but now I do not have write access to the disk and cannot save or modify the content. It used to work fine.  Things I have tried:  sudo chown -R $USER:$USER path/to/folder gksu nautilus (doesn't work on 18.04?) sudo chmod -R 777 /<folder name or path>   changing permissions through sudo nautilus (works but does not stay like that)  So I am a bit out of ideas. Any other suggestion that doesn't involve formatting?  I have already looked at the following posts:       Edit: Thanks to guiverc I now understand the problem with FAT32 permissions. I have tried the following with no result:  sudo mount /dev/sda1 /media/$USER/Ext1TB   should I add the -w? The help says it is implicit. Can somebody help with the mount call?  From what I understand of the post suggested to make it permanent I have to add or modify a line in fstab similar to this:  UUID=8C52-C1CD /home/storage auto   user,umask=000,utf8,auto  0   0   But I have no idea on how to build the line, find the correct UUID number and set the correct options. Any suggestion with that?

I know there are similar questions but I get some specific problem I can't overcome.  I have:   HDD split into two partitions. /dev/sdb1 and /dev/sdb2.  sdb1 is NTFS and I don't need it. I need sdb2 which is fat32. Ubuntu 12.04.1 LTS (server)   I want:  Ultimately I need a perma-mount /dev/sdb2 to /home/storage with access right (rw) for the user media.  Problems I'm facing:  1) Using manual mount from command line.  If I just use  server# sudo mount /dev/sdb2 /home/storage   It mounts but the /home/storage receives root as owner and group and doesn't allow media user to write there.  If i use mount command without sudo as the user media - i'm not allowed. Says only root can use mount.  If I use mount with options: server# sudo mount /dev/sdb2 /home/storage -o umask=000 I get what I need. A bit overdone of course, since the storage folder becomes writable for everyone. BUT - that is manually mounted - now i need it to remount on every reboot.  2) Remounting on reboot - using fstab  So I thought I'll be fine if I use fstab to mount this partition (/dev/sdb2) every time i reboot. The fstab line I added:  UUID=8C52-C1CD /home/storage auto   user,umask=000,utf8,noauto  0   0  got uuid with blkid. The fs type auto i changed few times...tried vfat too, but always on the reboot ubuntu stops when processing fstab (as i think) with the message (took from the log):  fsck from util-linux 2.20.1 /dev/sda5: clean, 120559/10969088 files, 19960144/43861504 blocks mount: unknown filesystem type 'static' mountall: mount /etc/fstab: [772] terminated with status 32 mountall: Filesystem could not be mounted: /etc/fstab: Skipping /etc/fstab: at user request  And also - sudo mount -a never really does anything.  What am I doing wrong? I do suspect I messed up something:)  UPDATE:  As it seems - fstab should hold only mounts for static drives, not any sort of usb stuff. I'm puzzled how then this works with all the people posting on the net their success stories...  however..if this is not possible - i would like to know how to remount my usb after every reboot...if not with fstab - than how?:)


int i = -5 , m,k=7; m=2*(++i , k-=4); printf("%d %d %d\n",i,m,k);   In this code the output is: [-4 6 3] but, I didn't quite understand where 6 comes from, can anyone help me?


I've been trying to write a script that receives the xyz coordinates of a vertex of a 3D object and returns the xyz coordinates of the vertex in a prespective projection plane, more or less like in the following image:    Example:  get_prespective(3,4,8):      bla...      new_vector = [3,4,0]      return new_vector   Supposedly you need to multiply the vector with a prespective matrix, like this:     Or multiplying the vector by this matrix:    But I'm having some trouble figuring out which matrix to use or how to use it. If somebody has a better idea, that would be great ;)

As asked.   I need a way to get the projection matrix of the active camera, via python.  EDIT: I think this question is different from the one asked , because getting a matrix is different from setting the matrix.  Although, since this question was so quickly marked a duplicate, I guess the answer is the same.


In my field it's very common to square some numbers, operate them together, and take the square root of the result. This is done in pythagorean theorem, and the RMS calculation, for example.  In numpy, I have done the following:  result = numpy.sqrt(numpy.sum(numpy.pow(some_vector, 2)))   And in pure python something like this would be expected:  result = math.sqrt(math.pow(A, 2) + math.pow(B,2)) # example with two dimensions.   However, I have been using this pure python form, since I find it much more compact, import-independent, and seemingly equivalent:  result = (A**2 + B**2)**0.5   # two dimensions result = (A**2 + B**2 + C**2 + D**2)**0.5   I have heard some people argue that the ** operator is sort of a hack, and that squaring a number by exponentiating it by 0.5 is not so readable. But what I'd like to ask is if:  "Is there any COMPUTATIONAL reason to prefer the former two alternatives over the third one(s)?"  Thanks for reading!

I've been wondering this for some time. As the title say, which is faster, the actual function or simply raising to the half power?  UPDATE  This is not a matter of premature optimization. This is simply a question of how the underlying code actually works. What is the theory of how Python code works?  I sent Guido van Rossum an email cause I really wanted to know the differences in these methods.  My email:     There are at least 3 ways to do a square root in Python: math.sqrt, the   '**' operator and pow(x,.5).  I'm just curious as to the differences in   the implementation of each of these.  When it comes to efficiency which   is better?   His response:     pow and ** are equivalent; math.sqrt doesn't work for complex numbers,   and links to the C  sqrt() function. As to which one is   faster, I have no idea...


I'm trying to put a listing and figure side by side. I tried to follow the suggestions in this link  without using caption package but the listing stays below in the figure.  \begin{figure}[htbp]     \begin{minipage}{.5\textwidth}     \centering     \includegraphics[height=0.7in]{figure}     \caption{Figure one.}     \label{fig:fig1}     \end{minipage} \end{figure} \begin{minipage}{.5\textwidth} \begin{lstlisting} #include <stdio.h>   main()  {     printf ("Hello World!\n");  } \end{lstlisting} \end{minipage}

I am writing a document using the memoir class where I want to place listings (with the listings package) and figures side by side. My first approach was to save the listing in a box and use subbottom to place both elements side by side:  \documentclass[12pt,oneside,a4paper]{memoir}  \usepackage{graphicx} \usepackage{listings} \usepackage{color} \usepackage{calc} \usepackage{caption}  \newsubfloat{figure} \definecolor{lgrey}{RGB}{223,223,223,0} \lstset{     basicstyle=\footnotesize\ttfamily,     frame=lines,                                    % environment border     rulecolor=\color[cmyk]{0.43, 0.35, 0.35, 0.01}, % top rule color     xleftmargin=17pt,                               % left margin     framexleftmargin=17pt,                          % frame left margin     framextopmargin=2pt,                            % frame top margin     backgroundcolor=\color{lgrey},                  % background color     showstringspaces=false                          % show spaces in strings }  \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}     {\colorbox[cmyk]{0.43, 0.35, 0.35, 0.01}     {\parbox{\textwidth-6pt}{\hspace{15pt}#1#2#3}}} \captionsetup[lstlisting]{     format=listing,     labelfont=white,     textfont=white,     font={sf,bf,footnotesize}}   \begin{document}  % Example that does not work as intended % -------------------------------------- \newsavebox{\firstlisting} \begin{lrbox}{\firstlisting} \begin{lstlisting}[linewidth=0.45\textwidth,caption=Hello,language=python] echo("Hello World!") \end{lstlisting} \end{lrbox}  \begin{figure}[htbp]     \centering     \subbottom{         \usebox{\firstlisting}}     \subbottom{         \includegraphics[width=0.45\textwidth]{philosoraptor}         \label{fig:c}}     \caption{Example} \end{figure}  % How the listing environment normally looks like % ----------------------------------------------- \begin{lstlisting}[caption=Hello,language=python] echo("Hello World!") \end{lstlisting}  \end{document}   However, this messes up the placement, as I have formated my listings environment to look like this:   Here is how it looks in the document:     I also tried two minipages in a figure environment but this results in cryptic error messages.  Is there a best practice for placing different environments like listings and figures side by side in the memoir class?


I thought both measure the amount of time? But they return very different numbers and I don't understand what the documentation is saying. Can anyone elaborate?

Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?  for example:  start = time.clock() ... do something elapsed = (time.clock() - start)   vs.  start = time.time() ... do something elapsed = (time.time() - start)


Winter Bash 2018 took place from December 12th through January 1st. Do all Winter Bash competitions take place at this date range? Where can I look it up?

On the  page I read that Winter Bash will end on January 2nd:     the hats get put back in their boxes on January 2nd!   Earlier years Winter Bash has ended on :     the hats get put back in their boxes on January 4th!   How is the end date for Winter Bash chosen?


I'm looking for a way to quickly transform simple lines into wavy, zigzag lines and so on in QGIS.  I already tried to use the method reported by @christoph in a question posted in this forum () but I can't make it work.  In ArcGIS this is a default option, I would like to make it so easy to apply it to my projects as well.  the results I'd like to achieve are these:

Is there a QGIS function or plugin to draw wiggly line?   I have used Spline Tool to manually draw some waves, but it is time consuming.  If possible, I would like to draw something like:    Inkscape Function Plotter ( sin(x) curve).


Example:   (1) Hello John. (2) Hello, John?   (3) How are you today John? (4) How are you today, John?   (5) I wish I could John. (6) I wish I could, John.   Must there always be a comma before someone's name?

Here's an example:        Chocolate lovers rejoice!   Chocolate lovers, rejoice!      To my understanding, the first one says that chocolate lovers are rejoicing and in the second one, we are asking the chocolate lovers to rejoice.  Am I correct? Or is it fine to use both 1 and 2 interchangeably?   Also, if am wrong about the second one, then how do you convey to chocolate lovers that they should rejoice?


There is a combinatorics problem that need some Number Theory background: How many numbers there are such that is divisible by 30 and have exactly 30 divisors? I need some idea how to solve this problem.

Find the highest natural number which is divisible by $30$ and have exactly $30$ different positive divisors.  What I Tried: I am not sure about any specific approach to this problem. Of course as the number is divisible by $30$ , some of the factors of the number would be $1,2,3,5,6,10,20,30$ , but that only makes $8$ divisors and there will be $12$ more which I have no idea of . Can anyone help me?


I wasn't active on Stack Overflow for a long time. When I wanted to vote or to post for some question or to leave a comment I found that I have a low reputation. Unfortunately I didn't research a way except to ask questions. Is there any way to increase my reputation?

How do users on the new Stack Exchange sites get started? Each user starts with 1 rep, and can't upvote until they have 15 rep.  It struck me that this creates a bit of a deadlock. If a new user asks a question and a new user answers, neither can upvote the other.  Are we relying solely on existing SE users to join these exchange sites (with their bonus 100 rep) so that they can get started?


I imported shapefiles into my PostgreSQL database with PostGIS extension and created a REST API using Django which has a GET response like this: [ {     "objectid": 1,     "id_field": 5543,     "county_nam": "B1",     "const_code": 288,     "constituen": "KAM",     "county_cod": 47,     "shape_leng": 1.55978672217,     "shape_area": 0.057422949 }, {     "objectid": 2,     "id_field": 6634,     "county_nam": "B2",     "const_code": 3,     "constituen": "KIS",     "county_cod": 1,     "shape_leng": 0.88558616055,     "shape_area": 0.02332510618 }, {     "objectid": 3,     "id_field": 6600,     "county_nam": "B3",     "const_code": 10,     "constituen": "KIN",     "county_cod": 2,     "shape_leng": 4.28418177601,     "shape_area": 0.75826601303 }, {     "objectid": 4,     "id_field": 6731,     "county_nam": "B4",     "const_code": 13,     "constituen": "KAL",     "county_cod": 3,     "shape_leng": 5.33308007101,     "shape_area": 1.02533838151 }, ...  How do I display this response into a React Leaflet?    async componentDidMount() {     const rawcurrentuser = JSON.parse(localStorage.getItem("currentUser"));      await axios.get('/api/gis/counties/')       .then((response) => {         this.setState({ county: response.data });       })       .catch(function (error) {         console.log(error);       });   }  When I display as below, the data is not displayed. <Map center={position} zoom={7} ref={this.mapRef}>  {this.state.county && (         <GeoJSON           data={this.state.county}         />       )}  </Map>  Displaying with Django view works fine using onEachFeature: myLayer = new L.geoJson(data, {   onEachFeature: function (feature, layer) {           layer.bindPopup('<font size="4">' + feature.properties.county_nam)         },         style: countStyle  }).addTo(count).addTo(map);  How do I use the same concept in my current React scenario?

I have a working Django REST API which can query all the counties in a country. //My model class kenya_counties(models.Model):   objectid = models.BigIntegerField()   id_field = models.BigIntegerField()   county_nam = models.CharField(max_length=80)   const_code = models.BigIntegerField()   constituen = models.CharField(max_length=80)   county_cod = models.BigIntegerField()   shape_leng = models.FloatField()   shape_area = models.FloatField()   geom = models.MultiPolygonField(srid=4326)    def __str__(self):       return self.county_nam  //My Serializer class CountiesSerializer(serializers.ModelSerializer):   class Meta:      model = kenya_counties      fields = ('objectid', 'id_field', 'county_nam', 'const_code', 'constituen', 'county_nam', 'county_cod', 'shape_leng', 'shape_area')  //My view @api_view(['GET', 'POST']) def counties(request):    if request.method == 'GET':        data = kenya_counties.objects.all()         serializer = CountiesSerializer(data, context={'request': request}, many=True)         return Response(serializer.data)     elif request.method == 'POST':        serializer = CountiesSerializer(data=request.data)        if serializer.is_valid():            serializer.save()            return Response(status=status.HTTP_201_CREATED)                 return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)  //My url     re_path(r'^api/gis/counties/$', views.counties),  I get . How can I query just one county and display it on a react-leaflet map as shown below? <MapContainer center={position} zoom={13} scrollWheelZoom={false}>     <TileLayer       attribution='&copy; OpenStreetMap contributors'       url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"     /> </MapContainer>


The set $\Bbb R-\Bbb Q$ is open, closed or neither? And how would one prove it?  I tried to prove that $\Bbb Q$ is open, so $\Bbb R-\Bbb Q$ would be closed, but I am not sure that $\Bbb Q$ is open.

I have a feeling they are neither closed nor open as the $\mathbb{R} \setminus \mathbb{Q}$ cannot be open or closed either...


does anyone know if it is possible to resume a water simulation from a specific frame? I already baked the water falling and I forget to add an effector at the bottom, and I wanna rebake but not the whole thing since I already have the first part that is not affected by the effector. I backed the water sim from frame 0 to 400, and I wanna resume the bake from frame 300 is it possible?

It happens sometimes that after finishing bake (e.g., for fluid simulation) we wish we could continue the simulation for two more seconds :(    How to use the cached bake to continue the simulation?  We played with the settings, but with no success.


Primitive data types such as char, bool and int have some memory. Suppose char, which has 1 byte of memory. When we use a char variable in our code, then the variable must require 1 byte of memory. Why don't we allocate memory in this case. And as we never allocate memory for it, how does it use the memory ,i.e. Is the CPU allocate memory for it in this case.Also I read somewhere that the primitive data types are put on stack and removed when the work is done for it. What kind of stack? How does the stack comes into picture in this case?

Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear explanation of this.  I understand what a stack is. But,    Where and what are they (physically in a real computer's memory)? To what extent are they controlled by the OS or language run-time? What is their scope? What determines the size of each of them? What makes one faster?


I run 10.12.6 and I'm wondering how I can rename a Bluetooth device. The function Bluetooth Preferences > Right click > Rename seems to be a no-op, see below gif.    Is there a configuration file that I can edit manually with a text editor? I don't mind getting my hands dirty in .plist files and stuff.

I have MBP 2015. I am running Mac OSX Sierra.  I go to my bluetooth preferences and right click and rename a device.  The window for rename comes up. I enter the new text and press rename.  And nothing happens the name of the device just does not change.   No errors ... no warnings.    And the final result (no name change)


I want to input Unicode string in String.Format() method.  This is my code:  string filename = String.Format("Това трябва да е уникод {0}_{1}.doc", wayBillNum, DateTime.Now.ToShortDateString());  //File name for the exported word document HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=" + filename);   How to do this?

Web applications that want to force a resource to be downloaded rather than directly rendered in a Web browser issue a Content-Disposition header in the HTTP response of the form:  Content-Disposition: attachment; filename=FILENAME  The filename parameter can be used to suggest a name for the file into which the resource is downloaded by the browser.  (Content-Disposition), however, states in  (The Filename Parameter) that the file name can only use US-ASCII characters:     Current [RFC 2045] grammar restricts   parameter values (and hence   Content-Disposition filenames) to   US-ASCII.  We recognize the great   desirability of allowing arbitrary   character sets in filenames, but it is   beyond the scope of this document to   define the necessary mechanisms.   There is empirical evidence, nevertheless, that most popular Web browsers today seem to permit non-US-ASCII characters yet (for the lack of a standard) disagree on the encoding scheme and character set specification of the file name. Question is then, what are the various schemes and encodings employed by the popular browsers if the file name “naïvefile” (without quotes and where the third letter is U+00EF) needed to be encoded into the Content-Disposition header?  For the purpose of this question, popular browsers being:   Firefox  Internet Explorer  Safari Google Chrome  Opera


I had an old presentation in beamer that I wanted to update.  It worked previously, but now, when I run it, I get an error:  !Undefined control sequence. 1.1 \beamer@endinputifotherversion   Here is a minimal example  \documentclass{beamer} {   \mode<presentation> {   %\usetheme{Goettingen}   % or ...    \setbeamercovered{transparent}   % or whatever (possibly just delete it)   \usecolortheme{albatross}   \usecolortheme{sidebartab} }  \usepackage{natbib} \usepackage[english]{babel} % or whatever  \usepackage[latin1]{inputenc} % or whatever  \usepackage{booktabs} \usepackage{listings} \usepackage{times} \usepackage[T1]{fontenc} % Or whatever. Note that the encoding and the font should match. If T1 % does not look nice, try deleting the line with the fontenc.  \usepackage{listings} \usepackage{url} \lstloadlanguages{SAS} \lstset{language = SAS}   \setbeamercolor{navigation symbols}{fg = white, bg = white} \setbeamercolor{sectionintoc}{fg = white}  \title[PROC LOGISTIC: Traps for the unwary] % (optional, use only with long paper titles) {PROC LOGISTIC: Traps for the unwary}   \author{Peter L. Flom} % - Use the \inst{?} command only if the authors have different %   affiliation.  \institute[Peter Flom Consulting] % (optional, but mostly needed) {Peter Flom Consulting}  \date[Short Occasion] % (optional) {NESUG\\ September, 2008}  \subject{Talks} % This is only inserted into the PDF information catalog. Can be left % out.  \AtBeginSection[] {  \begin{frame}<beamer>     \frametitle{Outline}     \tableofcontents[currentsection]   \end{frame}  }   % If you wish to uncover everything in a step-wise fashion, uncomment % the following command:  %\beamerdefaultoverlayspecification{<+->}   \begin{document} \begin{frame}   \titlepage \end{frame}  \begin{frame}   \frametitle{Outline}   \tableofcontents[pausesections]   % You might wish to add the option [pausesections] \end{frame}   \section{Introduction} \begin{frame} \frametitle{Introduction - 1} \begin{itemize} \item  This paper covers some `gotchas' in SAS\textsuperscript\textregistered\ PROC LOGISTIC. \item  A `gotcha' is a mistake where the program runs, there may be a note or a warning, but no errors. \item  Output appears. But it's the wrong output. \item  Not a primer on PROC LOGISTIC, nor on logistic regression. \end{itemize} \end{frame}  \begin{frame} \frametitle{Introduction - 2} Each section has several subsections. \begin{enumerate} \item The `gotcha'. \item An example. \item Evidence you have that it occurs. \item How to fix it  --- sometimes with references \item Explanation (where needed) \end{enumerate} \end{frame}  \end{document}   I have no clue what is wrong here.

I have downloaded MiKTeX (on Windows 10). The .tex files for papers and posters compile well but beamer does not work.  Here is the header of my .tex file:  \documentclass[10pt]{beamer} % \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{fancybox} \usepackage{amssymb}  %   MATH \usepackage{amsmath}  %   MATH \usepackage{latexsym} %   MATH \usepackage{amsthm}   %   MATH \usepackage[italian,english]{babel} \usepackage{bm}         % per scrivere in grassetto i caratteri matematici \usepackage{indentfirst} \usepackage{color} \usepackage{booktabs} \usepackage{graphicx} \usepackage{multimedia} \usepackage{eurosym} \usepackage{tikz}   I receive the following error message:  ! Undefined control sequence.  l.1 \beamer@endinputifotherversion                                    {3.26pt}   How can this problem be fixed?  Joab Winkler


I'm using ruby-head and Debian wheezy x64. When I run a multithreaded ruby script, htop shows that it's using multiple cores visually with the bars at the top, and that it's using 100% CPU on the process list but it's only using 100% of the capacity of one core. I assume it's possible to have multiple cores running at 100% and this number seems too convenient to be bottle-necked by either the program logic or another hardware aspect. Is the OS limiting the amount of available instructions I'm using, if so how do I stop this?  EDIT more info:  When I mean visually using multiple cores e.g.: 47% core 1, 29% core 2, and 24% core 3. These percentages are constantly shifting up and down and to different sets of cores, but always collectively add up to 100%-102%. More than 3(/8 total) cores are being used, but any cores other than the three most burdened only utilize 2% or less capacity. I guess I should also mention this is a linode VPS.  EDIT:  Well it looks like I was reading promises that 2.0 would feature true parallel threads, and not actual release information. Time to switch to Jruby...

I know about the "cooperative" threading of ruby using . How can I create real "OS-level" threads in my application in order to make use of multiple cpu cores for processing?


"She works in the paper business." "She works in paper business."

In the following dialog, both      ‘the people who we don’t know’ and   ‘Ø people who we don’t know’    might mean either      ‘all the people who we don’t know’ or   ‘some of the people who we don’t know.’    ‘The people who ...’ sounds more like ‘all’ than just ‘Ø people who ...’ according to some native speakers. However, it is IMPLIED/ FELT/ PERCEIVED. In fact, some native speakers say ‘the people who we don’t know’ sounds no more than just ‘some.’ ‘All or some’ shouldn’t be the determinant.  What do you think is the determinant, then? Any and all insights would be welcome. What do you think is the determinant for deciding you should use ‘the’ or not in the following example? Some people feel you mean ‘all the people’ with ‘the,’ but it’s not the primary determinant, many people think. Would it be your mind that wants to emphasize the meaning of the relative pronouns that places ‘the’ there?     (Suppose there is no context, explicit or implicit, that brings on the   definite article in front of ‘people’ and ‘ones’ other than, possibly, the   relative noun clauses ‘who we don’t know’ and ‘who we know.’)      Tom: Although the/Ø people who we don’t know from our Sendai factory   came to the party, the/Ø ones who we know didn’t.      Sam: Oh, I didn’t even know you have a factory in Sendai.      (I wrote this dialog, thinking ‘we’ are Tom and some of his co-workers, and   that it doesn’t include Sam. Sam is from outside Tom’s company)


The series $\sum_{n=1}^\infty \left[\frac{1}{n^s}+\frac{1}{s-1} \left\{ \frac{1}{{(n+1)}^{s-1}}-\frac{1}{n^{s-1}}\right\}\right]$ is said to converge when $0<s<1,$ which seems impossible, for $s-1<0,$ $\frac{1}{{(n+1)}^{s-1}}-\frac{1}{n^{s-1}}<0$, and so $$\sum_{n=1}^\infty \left[\frac{1}{n^s}+\frac{1}{s-1} \left\{ \frac{1}{{(n+1)}^{s-1}}-\frac{1}{n^{s-1}}\right\} \right]>\sum_{n=1}^\infty \frac{1}{n^s} \quad (>0),$$ which diverges. So is the series really convergent? PS: I would prefer a method without using integral. And this series is an example of a series whose ratio of nearby items tends to 1.

Show that $\frac{1}{s-1}+\sum_{n=1}^{\infty}\left[\frac{1}{n^s}+\frac{1}{s-1}\left(\frac{1}{(n+1)^{s-1}} - \frac{1}{n^{s-1}}\right)\right]$ converges when $0<s<1$.  Note that this series is equivalent to $\sum_{n=1}^{\infty}\frac{1}{n^s}$. It might seem counterintuitive that the series converges if $0<s<1$.


On my fresh ubuntu 20.04 desktop, im trying to set the language input switch using left alt-shift, but for some reason, the window bellow accepts other things then alt-shift... Any idea? Thanks

Can I use Ctrl+Shift for changing languages? I can't set this hotkey for changing keyboard languages.  At this moment Alt+Shift switch languages, but I can't see this hotkey in keyboard hotkeys list or in   gsettings list-recursively  org.gnome.desktop.wm.keybindings | sort | more   output.


There was a novel I read back in the day about a boy who travels back and forth between a mirror-image of our universe.  I am afraid I cannot recall much about the plot, except that mirrored food is inedible and when mirrored ketchup packets were brought back from the other universe they taste like chocolate and mess you up.  Could someone help me identify this book?  After going through organic chemistry back in college, I think it should be required reading for any writer who has a story where the characters land on alien planets and find everything to be edible.

I read a book about 10-15 years ago about a boy and a girl who find a mirror. What made the mirror special was, they were able to enter the reflection and be a part of the reverse image world. They end up going to school and when asked to write something on the board, it ends up being backwards, but to them looks normal.  Later, the two end up in a world with 4 dimensions. With the added dimension they can't see as they normally could. If one moved a certain way the other would see their insides. Eventually a native of that dimension made some type of device that lets them see regularly.  Other than that my memory is blank. If I remember anything else I will be sure to edit it in.


I have this function called by clicking a button:  $("#pulsanteNuovaCategoria").on('click', function(event) {    event.preventDefault();    var categoria = new FormData();   categoria.append("nome", $("#nomeNuovaCategoria").val());   categoria.append("descrizione", $("#descrizioneNuovaCategoria").val());    $.ajax({       url: '../php/model.php?az=nuovaCategoria',       data: categoria,       processData: false,       contentType: false,       type: 'POST',       dataType: 'json'     })     .done(function(data) {       $('.archi').append("

" + data.num + "

" + data.archivio_nome + "

" + data.archivio_descrizione + "

");       $("#nomeNuovaCategoria").val("");       $("#descrizioneNuovaCategoria").val("");       $("#modaleNuovaCat").modal('hide');     })     .fail(function() {       alert("Qualcosa è andato storto.");     }); });   This function create dynamically an entire snippet of html with an edit button completed with data-id, class and id. The important element is class='editaCat'.  Now in the same session, I want to click in this dynamic edit button and call a second function linked with class='editaCat' this:  $(".editaCat").on('click', function(event) {    event.preventDefault();   var idCat = this.getAttribute('data-id');    $.ajax({       url: '../php/model.php?az=editCategoria&id=' + idCat,       processData: false,       contentType: false,       type: 'POST',       dataType: 'json'     })     .done(function(data) {       $("#editaNomeCategoria").val(data.archivio_nome);       $("#editaDescrizioneCategoria").val(data.archivio_descrizione);       $("#pulsanteEditaCategoria").attr("data-id", data.archivio_id);     })     .fail(function() {       alert("Qualcosa è andato storto.");     }); });   but it doesn't work.  Help!

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


My bike's quick release seat has been slipping down recently. I noticed when my (pro) biker friend remarked how low down the seat on my bike was, and helpfully readjusted it for me. Biking became easier. Yesterday, while biking, I noticed that biking was difficult again, so dismounted and checked the seat -- it was way down again. So I fixed it.....but what can I do to make sure it doesn't happen again?

I got a , with the seatpost made with aluminium carbon-wrapped.  The problem is that the seatpost tends to slide downwards, even if I squeeze a lot the snap ring; if the ground is uneven the seatpost slips completely.  Is there a way to solve this problem?  Many thanks.


I don't know what the hell I did I just want to get back to modelling

I cannot find any menu or keys that return blender to the view that you see when you start blender. Using save close and then open again but it must be easier than that?  How do you change the view from side or front, or back to the view that is enabled by default at start?


I breathe alot of soldering fumes and i don't have anything that is used to remove this fumes while soldering, is it really bad for my health? How it affects the brain and other organs?

I do a fair bit of soldering (lead-free). Is breathing in solder/flux/paste fumes actually going to harm me?  Are cheap fume extractors worth buying?


I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I have a function that take list of rule object and make List> Here is my code:  public static List<Func<T, bool>> CompileRule<T>(List<Rule> rules)     {         var compiledRules = new List<Func<T, bool>>();          // Loop through the rules and compile them against the properties of the supplied shallow object          rules.ForEach(rule =>         {             var genericType = Expression.Parameter(typeof(T));             var key = Expression.Property(genericType, rule.ComparisonPredicate);             var propertyType = typeof(T).GetProperty(rule.ComparisonPredicate).PropertyType;             var value = Expression.Constant(Convert.ChangeType(rule.ComparisonValue, propertyType));             var binaryExpression = Expression.MakeBinary(rule.ComparisonOperator, key, value);             compiledRules.Add(Expression.Lambda<Func<T, bool>>(binaryExpression, genericType).Compile());         });          // Return the compiled rules to the caller         return compiledRules;     }   I want to change the function to return Func that make from compiled function and(&&) between all Funcs and return Func<T, bool>.  the rule class look like this:   public class Rule {     ///     /// Denotes the rules predictate (e.g. Name); comparison operator(e.g. ExpressionType.GreaterThan); value (e.g. "Cole")     ///      public string ComparisonPredicate { get; set; }     public ExpressionType ComparisonOperator { get; set; }     public string ComparisonValue { get; set; }      ///      /// The rule method that      ///      public Rule(string comparisonPredicate, ExpressionType comparisonOperator, string comparisonValue)     {         ComparisonPredicate = comparisonPredicate;//property name         ComparisonOperator = comparisonOperator;//operation         ComparisonValue = comparisonValue;//target value     } }

I have two expressions of type Expression<Func<T, bool>> and I want to take to OR, AND or NOT of these and get a new expression of the same type  Expression<Func<T, bool>> expr1; Expression<Func<T, bool>> expr2;  ...  //how to do this (the code below will obviously not work) Expression<Func<T, bool>> andExpression = expr AND expr2


I use the nautilus-open-terminal package. Before upgrading from 13.10 to 14.04, nautilus used to have a settings button on the top right panal where you can click something like "open in terminal " to open the terminal here. After upgrading to 14.04, the settings icon is gone and I have to return to the parent folder and right click on the folder to open terminal here. (Because in list view the folder might have many files so that there is no white space I can right click to show the "Open in terminal" menu.)  The solution mentioned here:  doesn' t seem to work for me.

How can I create a keyboard shortcut so that when I press F12 in nautilus (or desktop), I get a terminal in the current directory?


If I have two dates (ex. 19960104 and 19960314), what is the best way to get the number of days between these two dates? Actually I have to calculate many dates in my dataframe. I use the code:   `for j in range(datenumbers[i]):     date_format = "%Y%m%d"     a = datetime.strptime(str(df_first_day.date[j]), date_format)     b = datetime.strptime(str(df_first_day.exdate[j]), date_format)     delta = (b - a).days     df_first_day.days_to_expire[j] = delta`   I need to put every difference between two dates in one of column of my dataframe. I wonder if there is a better way to do as not using for loop

If I have two dates (ex. '8/18/2008' and '9/26/2008'), what is the best way to get the number of days between these two dates?


Though we can achieve the same result when we put right table in left and use left outer join. Then what is the significance of Right Outer Join?

states:  "In practice, explicit right outer joins are rarely used, since they can always be replaced with left outer joins and provide no additional functionality."  Can anyone provide a situation where they have preferred to use the RIGHT notation, and why? I can't think of a reason to ever use it. To me, it wouldn't ever make things more clear.  Edit: I'm an Oracle veteran making the New Year's Resolution to wean myself from the (+) syntax. I want to do it right


I grew up hearing phrases like, "X can stop on a dime," meaning that X, presumably at the controls of some kind of vehicle, can bring that vehicle to a stop in as short a distance as the diameter of a U.S.A. 10 cent piece (a dime, a very small coin little more than a centimeter in diameter). When and where does this phrase come from? As far as I can tell, other questions on this site refer to other uses of the word dime, or they mention this phrase in passing without explaining its origin.

In American English, for a long time we've had the idiom "to stop on a dime." It means to stop abruptly and completely. It came to be used as a description for something agile or nimble. Etymonline says  Phrase stop on a dime attested by 1954 (a dime being the physically smallest unit of U.S. currency).  But for the past several decades I've heard the expression get off the dime being used to mean "get started" or "get going" and is used in the same circumstances as the idiom "get a move on." It seems obvious to me that this must be a transposition of "stop on a dime" (a metaphorical one, at least). [N.B.: This supposition is no longer obvious and appears to be nothing more than my own folk etymology, given that all the answers point to a different derivation.] I'm curious if anyone can show a link between "stop on a dime" and "get off the dime," or if there is some other explanation that might turn my bit of intuition into folk etymology.


I’m struggling with the following problem in my textbook     Let $f,g\colon\mathbb R\to\mathbb R$, where $g(x)=1-x+x^2$ and $f(x) = ax+b$. If $(g\circ f)(x) = 9x^2-9x+3$, determine $a$, $b$.   What I’ve tried:  So I know $(g\circ f)(x) = g(f(x))$ and if I substitute the functions I get $1-(ax+b)+(ax+b)^2$ and I also know that that equals to $9x^2-9x+3$.  Now this is where I get stuck  I’m not sure how to isolate a and b to find there values,I’ve tried rearranging $1-(ax+b)+(ax+b)^2 = 9x^2-9x+3$ into multiple different expressions to get something that I might be able to solve but after a few hours I didn’t get anywhere.

Let $f,g:$ $R \rightarrow R$ where $g(x)$ $=$ $1$ $-$ $x$ $+$ $x^2$ and $f(x)$ $=$ $ax$ $+$ $b$  If $g(f(x))$ $=$ $9x^2$ $-$ $9x$ $+$ $3$, determine $a$ and $b$.  So far, I have "fit" $f(x)$ into $g(x)$ as follows: $g(f(x))$ $=$ $(ax + b)^2$ $-$ $(ax+b)$ $+$ $1$  Is there a relationship between compositions and inverse functions I should be using to isolate $a$ and $b$? How does one extract those variables in order to determine their value?  Thank you!


Prove that for any positive integers $a,b,c$ we have $\operatorname{lcm}(a,b,c)=\dfrac{abc \operatorname{gcd}(a,b,c)} {\operatorname{gcd}(a,b)\operatorname{gcd}(b,c)\operatorname{gcd}(c,a)}$  To prove this, I used this: for two positive integers $a,b$ is $\operatorname{lcm}(a,b)=\frac{ab}{\gcd(a,b)}$ but I could do nothing, can you help?

I may be wrong, but I was thinking of:  $\operatorname{lcm}(a, b)$ as $\min(a, b)$ and $\gcd (a, b)$ as $\max(a, b)$ and $a <b <c$   I know I'm wrong, but I think I can do it


Frequently I’ll have to do some digging around to figure out what I’m doing on linux, involving quite a bit of ‘’, ‘ls -la’, ‘cd’, ‘cat’, and ‘vim’  Is there any way to quickly reuse the file/target of the previous command?  e.g. I have to look around for a file, say with ls, and when I’ve found it I’ll need to use it with a program like cat or vim. So let’s say I’ve got ‘ls -la /some/path/SomeName’ and hit , say I’ve drilled down to where this is the file I was looking for.  What I’d like to do is some kind of ‘!!’ Like when you forget to use sudo; Say I really want to use ‘cat’ but had been searching around with ‘ls’ and ‘’ - or I’ve been searching around with ‘cat’, up-arrow and continuing to refine my ‘cat /file/path/‘ and then when I’ve found what I’m looking for I’ll want to edit that file  I’d like to be able to do something like ‘cat !!’ or ‘vim !!’

I'm following through a tutorial and it mentions to run this command:  sudo chmod 700 !$   I'm not familiar with !$. What does it mean?


The following identities are true for a matrix $A$. \begin{align} \dim \mathrm{row}\, A &= \mathrm{rank}\,A \\ \dim \mathrm{Im}\, A &= \mathrm{rank}\, A \\ \dim \mathrm{row}\, A &= \dim \mathrm{Im}\, A^\mathrm{T} \end{align} Does this mean that $\dim \mathrm{Im}\, A^\mathrm{T} = \dim \mathrm{Im}\, A = \mathrm{rank}\,A$? How come?

I am looking for an intuitive explanation as to why/how row rank of a matrix = column rank. I've read the proof at  and I understand the proof, but I don't "get it". Can someone help me out with this ?   I find it hard to wrap my head around the idea of how the column space and the row space is related at a fundamental level.


I was reading a research paper, where I came to see the following the function definition and set definition. So what is 2^(R^n) here and what is the set X. Can somebody please provide examples also. Any thoughts will be very much helpful for me. Thank you in advance. Here are the images:  and

Let $ D = 2^\mathbb{N} $, i.e., D is the set of all sets of natural numbers.   What's the meaning of this definition? Intuitively, I would suggest that $ D = \{1,2,4,...\} $ but the explanation "set of all sets" leads me to the guess that this is wrong.


This loop does not work as expected. It prints all 4 elements (expected 3) guj = ["बळींचाी", "आठ़वले", "मोठय़ा", "धाांची"]  for y in guj:     for i in y:         x = i.encode("raw_unicode_escape")         if x[:5][-3:] not in [b"090", b"091", b"092", b"093", b"094"]:             break     print(y)  The third word should not be printed because it contains a character having 095 series that is invalid. # "य़".encode("raw_unicode_escape") # b'\\u095f'  output.txt बळींचाी आठ़वले मोठय़ा धाांची  expected.txt बळींचाी आठ़वले धाांची

Given the following code (that doesn't work):  while True:     #snip: print out current state     while True:         ok = get_input("Is this ok? (y/n)")         if ok.lower() == "y": break 2 #this doesn't work :(         if ok.lower() == "n": break     #do more processing with menus and stuff   Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?


I need to write an MSc thesis proposal, and I can't seem to find any good templates for such. Do you guys know of any good templates? It's urgent :)

Aside from CTAN, what are good resources/repositories for Latex templates? In particular, I'm looking for some pretty Thesis templates (I'm familiar with classicthesis)


Let’s say that two objects collide and reproduce a sound with a given frequency or frequencies, what properties of these two solids determine the frequency or frequencies produced ?

When two objects collide and undergo a partially inelastic collision (so every one we experience in every-day life), they rebound to a certain degree, but kinetic energy is not conserved. Thus, the energy of motion must be converted to another type of energy. Thus, when two object collide, the most common forms of energy that kinetic energy is converted to are sound energy and thermal energy.   Some collisions are louder than others just because they cause a bigger local variation of pressure (which then propagates through air until finally gets heard). So, why some objects, even if the velocity before and after the collision seems to be the same, are louder than others? I mean, how do the different material properties enter in the phenomenon?  How and why, by means of solid and fluid mechanics or with an heuristical microscopical reasoning, can this process be explained?


Very simple question. I've been looking at JSpot documentation.   What does T stand for?  When it says it wants a list of type T I don't understand what T is?

I thought I'd offer this softball to whomever would like to hit it out of the park. What are generics, what are the advantages of generics, why, where, how should I use them? Please keep it fairly basic. Thanks.


In the movie Arrival, the main character has dream-like premonitions of events that happen later.  She also has what is apparently a premonition in which she meets the Chinese general at a formal state function, and he tells her his private phone number. Then after waking from this premonition, she is able to recall the number, even though the general has not actually told her it yet.  Overall, if I recall correctly, all her other premonitions ended up happening -- so did the moment when the general tells his number also happen? (I ask because the conversation about the number would seem unnecessary once she had learned the number from her premonition)

I once asked a question about the time line of an incredibly complex time travel movie on this site and received some incredibly elegant explanations. I'm wondering if you guys can explain Arrival too.   She learns an alien language which allows her to think in such a way that she knows the future. In the future, an important leader tells her at a world convention that he remembers when she called him on his personal number and got his attention by telling him his wifes dying words.  He then proceeds to give her his cell number and tells her his wife's dying words. In the "past", as she "sees" this "memory" of the future conversation, she uses this number to call him and tells him those words.   How does that work? Mind blown. Is there even a logical way to explain this?


I have a large table (with many columns), so that I decide to set its width = \paperwidth. I tried the following:  \documentclass{article} \usepackage{graphicx}  \begin{document}     \begin{table}[htb]         \caption{something}\label{t:something}         \centering           \noindent\resizebox{\paperwidth}{!}         {         \begin{tabular}{ccc}             1 & 2 & 3 \\             4 & 5 & 6          \end{tabular}         }     \end{table} \end{document}   The problem is, the table is shifted to the right (portion to the left is empty, whereas part of the table at right side is cropped). My question is, how to set it to center?

I have a figure that is wider than the \textwidth of my document. (I don't want to change the \textwidth.) As a result, the leftmost part of the figure is flush with the left margin, while the rightmost part spills into the right margin too much. I'd like to center the figure, so that it will exceed the \textwidth equally on both sides.


I want to create a bock template for a certain region & a certain module. Drupal 8 does not offer these hook suggestions. In Drupal 7 it was .  I want to create block--[region]--[module].html.twig. How can I add this theme suggestion?

Since Drupal 8 it is not possible with template naming conventions to load a specific block template according to the region it is placed in (). But I need to have different html for blocks if placed in a certain region. How do I accomplish this?   I've thought about using MYMODULE_theme_suggestions_block_alter but I don't know how to get the current region.


I am in a directory in which I have two text files:  $ touch test1.txt $ touch test2.txt   When I try to list the files (with Bash) using some pattern it works:  $ ls test?.txt test1.txt  test2.txt $ ls test{1,2}.txt test1.txt  test2.txt   However, when a pattern is produced by a command enclosed in $(), only one of patterns work:  $ ls $(echo 'test?.txt') test1.txt  test2.txt $ ls $(echo 'test{1,2}.txt') ls: cannot access test{1,2}.txt: No such file or directory   What's going on here? Why the pattern {1,2} does not work?

I want to create a simple bash-script that checks whether a directory contains all the files whose names contain numbers from 1 to N.  # Creating some files for testing $ cd /tmp/ $ mkdir test $ touch test/a01x.dat $ touch test/b02y.dat  # Display dir contents $ ls test/*{01,02}* test/a01x.dat  test/b02y.dat   But using seq command to generate numbers results in the following:  $ ls test/*{$(seq -s , -f "%02g" 1 2)}* ls: cannot access 'test/*{01,02}*': No such file or directory   I understand that running the command by surrounding the path with single quotation marks must lead to the error because the wildcards don't expand  $ ls 'test/*{01,02}*'   But I didn't use them. What is the problem?


I am trying to understand exactly what Python is doing to import statements and install packages. I really want to know the "path" that python follows to accomplish this so I can try and follow along to see how people who have created well known packages have accomplished it.   I created a venv called FlaskVE in a folder. Directory structure (Windows) as follows:  c:\users\me\documents\FlaskVE      \Include      \Lib      \Scripts   I activated the virtual environment and installed flask using pip  $ cd c:\users\me\documents\FlaskVE\Scripts $ activate <-current prompt (FlaskVE) c:\users\me\documents\FlaskVE\Scripts $ pip install flask $ python $ from flask import Flask   At this point, python looks along my PATH for python packages, since I am in a venv, the PATH points to the current folder I am in. Within \FlaskVE\Lib\site-packages\flask there is not a Flask.py folder. How does Python find the Flask  class? I can see within the init.py file within \FlaskVE\Lib\site-packages\flask there is a command "from .app import Flask, Request, Response" and within the app.py file in that directory there is a class called Flask. Is this the one it is importing and if so, does the "from flask" call start the init.py file automatically?

What is __init__.py for in a Python source directory?


Let G be the additive group of all polynomials in $x$ with integer coefficients. Show that G is isomorphic to the group $\mathbb{Q}$* of all positive rationals (under multiplication).  This question is from my abstract algebra assignment and I am unable to  prove it. I am not able to deduce what should I map   $a_0 +a_1 x + a_2 x^2 +...+ a_n x^n $ to so not able to proceed. Can you please give a hint?

The question (from my exam) quoted verbatim:  Show that the additive group of $\mathbb{Z}[x]$ is isomorphic to the group of positive rational numbers under multiplication.  First of all, is this $\mathbb{Z}[x]$ the same as $\mathbb{Z}_x$ (addition modulo $x$)? Secondly, how do I still get the isomorphism? Thanks


Please clarify should I write group's subsidiary or group subsidiary? what is the correct way to write this? Could you please also clarify the rule?  I see, there are a lot of similar situations, for example, management representation or management's representation, management report or management's report

In the following is it better to use a possessive noun with an apostrophe or an attributive noun without an apostrophe?     The following list details the assumptions that have been made in   conjunction with the Dell Company’s staff.   Or      The following list details the assumptions that have been made in   conjunction with the Dell Company staff.   Assume Company is the name of a company, such as Dell.


Supposing that I have the following two classes:  #ifndef CLASS1_H #define CLASS1_H  #include <QDebug>  class Class1 { public:     Class1(){}      void printName()     {         qDebug() << "Class1";     } };  #endif // CLASS1_H   and   #ifndef CLASS2_H #define CLASS2_H  #include "class1.h"  class Class2 { public:     Class2(Class1 *pointerToClass1)     {         this->pointerToClass1 = pointerToClass1;     }      void doSomething()     {         this->pointerToClass1->printName();     }  private:     Class1 *pointerToClass1; };  #endif // CLASS2_H   And the main function looks like this:  #include <QCoreApplication>  #include "class1.h" #include "class2.h"  void func1() {     Class1 class1;      Class2 *class2_1 = new Class2(&class1);     Class2 class2_2(&class1);      class2_1->doSomething();     class2_2.doSomething();      delete class2_1;     class2_1 = NULL; }  int main(int argc, char *argv[]) {     QCoreApplication a(argc, argv);      func1();      return a.exec(); }   What is the main difference of creating an object in the heap (e.g. Class2 *class2_1 = new Class2(&class1);) and just create the object on the stack (e.g. Class2 class2_2(&class1);)?  As far as I know, it is preferred to create the object on the stack when it is declared locally and has a short life. Also, the data is lost when the object exits the stack and in the heap, we need to call delete to free the memory. Is that correct?  Therefore, there is some advantage in using one or another?

Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear explanation of this.  I understand what a stack is. But,    Where and what are they (physically in a real computer's memory)? To what extent are they controlled by the OS or language run-time? What is their scope? What determines the size of each of them? What makes one faster?


How to find the multiplicative inverse of $4x+3$ in the ring $ \mathbb Z_{11}[x]/(x^2+1)$?    I understand that any element belonging to the ring $ \mathbb Z_{11}[x]/(x^2+1)$ is of the form $ax+b$ where $a,b \in \mathbb Z_{11}$. How to proceed?

So I am finding a polynomial $px+q$ ($p,q \in \Bbb F_{11}$) which is multiplicative inverse of $4x+3$ in $\frac {\Bbb F_{11}[x]}{\langle x^2+1 \rangle}$.  i.e. $[(4x+3)+\langle x^2+1 \rangle][(px+q)+\langle x^2+1 \rangle]=1+\langle x^2+1 \rangle$   $\Rightarrow$  $(4x+3)(px+q)+\langle x^2+1 \rangle=1+\langle x^2+1 \rangle$  $\Rightarrow$  $4px^2+(4q+3p)x+3q+\langle x^2+1 \rangle=1+\langle x^2+1 \rangle$.  We see that the remainder,when $(4x+3)(px+q)$ is divided by $x^2+1$, is $1$. So by Division algorithm,  $$ \require{enclose} \begin{array}{r} 4p \\[-3pt] x^2+1 \enclose{longdiv}{4px^2+(4q+3p)x+3q} \\[-3pt] \underline{4px^2+4p} \\[-3pt] (4q+3p)x+(3q-4p) \\[-3pt] \end{array} $$    So I equate $(4q+3p)x+(3q-4p)=1$ and solve the simultaneous linear equations  $4q+3p=0, 3q-4p=1$. I get $p=6,q=1$  Hence $6x+1$ is the required inverse.  I am pretty sure that the answer is correct but is the method to achieve it right?


I was just testing out the Java Script for...in ( just a newbie :P :D ).  I tried the following code:  var arr=[]; arr['n1']='name1'; arr['n2']='name2'; arr['n3']='name3'; arr['n4']='name4';  var i,j;  for(i in arr) {     for(j in i)         document.writeln(j+"-"); }   and the output was:   0- 1- 0- 1- 0- 1- 0- 1-   I was wondering why am I getting an output like this.  The for...in loop if tried to output the 'i' instead of 'j' I'm getting the index names.  When I checked the typeof 'j' I got it as String.  Please help me understand the output.

I've been told not to use for...in with arrays in JavaScript. Why not?


I want to know if there is a way to detect if my Visualforce page which implements a custom publisher action, is running inside Salesforce1 or inside a desktop browser.  I need this since when I run my visualforce on Salesforce1 it is framed automatically by a "Cancel" and "Submit" button, however when running on the desktop I get none of these buttons so I need to add a specific button to actually save the data.

What is the best option to implement visualforce page with view for desktop and mobile at the same place. Can this be handled automatically with modern  javascript frameworks like backbone.js, angular.js, etc. For example there is Vf page and this page automatically calculates which view template to use(mobile or desktop), which model to use(mobile and desktop). Actually the mobile and desktop content and behaviour are the same but ui will be reorganized responsively within mobile.


I'm trying to get different build subfolder using cmake that has the same name as the current branch (on windows 10). I've tried this  set branch=git rev-parse --abbrev-ref HEAD cmake --build build\%branch% --config Release   but it doesn't evaluate before usage in cmake, it just dumps it there. This makes the whole approach futile because the following is not a valid cmake command:  cmake --build build\git rev-parse --abbrev-ref HEAD --config Release   Error info:  C:\Users\...\repos\proj_name>cmake --build build\%branch% --config Release Unknown argument rev-parse Unknown argument --abbrev-ref Unknown argument HEAD Usage: cmake --build <dir> [options] [-- [native-options]]   Is there another way to do this? I'm trying to avoid writing a script - which is the proposed solution linked as duplicate - because I need a oneliner. Switch branch and run the build in such a way that the build folder follows this structure build/branch-name/. Maybe cmake can do this internally, detect the git branch name and then specify the build folder?

I'm looking to get the result of a command as a variable in a Windows batch script (see  for the bash scripting equivalent).  A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome.


How can I label each of these equations separately so that I can refer to each of them later on?  \[   \begin{cases}   u_t+uu_x=-p_x, \\   H_t+(uH)_x=0,    \end{cases} \]

As much as I have tried, it doesn't seem possible to use separate labels when using a casesconstruction (from the amsmath package).  Ideally, I would like to be able to write something like  \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} f(x)=\begin{cases}   1&x\geq0\label{positive}\\   0&x<0\label{negative} \end{cases} \end{equation} \end{document}   and later refer to both cases at different places. What would be the best way to achieve this result?


I am trying to download in Virtual Box and getting wrong kernal. It states I should use I86-cpu. Am I downloading the wrong program?

I would like to know if anyone can help me with installing Ubuntu on VirtualBox


Why we cannot write something like that:  Func<int, int> operation = i == 1      ? (int a, int b) => a + b      : (int a, int b) => a * b;      Type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and 'lambda expression'

Generally, when using the conditional operator, here's the syntax:  int x = 6; int y = x == 6 ? 5 : 9;   Nothing fancy, pretty straight forward.  Now, let's try to use this when assigning a Lambda to a Func type. Let me explain:  Func<Order, bool> predicate = id == null     ? p => p.EmployeeID == null     : p => p.EmployeeID == id;   That's the same syntax, and should work? Right? For some reason that doesn't. The compiler gives this nice cryptic message:     Error  1   Type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and 'lambda expression'   I then went ahead and changed the syntax and this way it did work:  Func<Order, bool> predicate = id == null     ? predicate = p => p.EmployeeID == null     : predicate = p => p.EmployeeID == id;   I'm just curious as to why it doesn't work the first way?  (Side note: I ended up not needing this code, as I found out that when comparing an int value against null, you just use object.Equals)


So recently i had to move my windows from one hard drive to another one, i was not worried about oem license because i was just moving it from one hard drive on the same laptop to another drive on the same laptop, now i was wondering if someone want to do this with two laptops, is it possible to re-register the moved windows to the new on using the latests activation key? (located in properties of my computer)

We get a lot of questions on Super User about Windows activation and licensing. This question is an attempt to answer the most common questions in one place with a .   When reinstalling Windows, the following questions often come up:   Can I transfer the copy of Windows from my old computer to a new one? Does the license key on the sticker on my computer work on any computer? If I have a 32-bit version, can I install a 64-bit version? I have an OEM version of Windows, but only a retail disk. Can I still use it? I want to install Windows with a different language. Do I need a new license in that language? I changed some hardware. Will I be able to reactivate my computer? Can I back up my activation before doing a reinstall? How many computers can I install my license on? Do I have to deactivate my old installation before transferring a license? If so, how? How does licensing work in Windows ? What are the restrictions on transferring, reinstalling, and changing versions of Windows?


Currently in our game we use a 4 directional movement. Some abilities are triggered on mouse click and "fired" in the direction the player has clicked. For this, I have split the screen in 4 sectors (like 2 diagonal cuts) to determine in which general direction the player has clicked.  Back then, I found a short helper class for this:  public static class Triangle {     private static Vector2 topLeft = new Vector2(0, 0);     private static Vector2 topRight = new Vector2(Orbs.graphics.PreferredBackBufferWidth, 0);     private static Vector2 bottomRight = new Vector2(Orbs.graphics.PreferredBackBufferWidth, Orbs.graphics.PreferredBackBufferHeight);     private static Vector2 bottomLeft = new Vector2(0, Orbs.graphics.PreferredBackBufferHeight);      //Return true if p1 and p2 are on the same side of BA     private static bool SameSide(Vector2 p1, Vector2 p2, Vector2 A, Vector2 B)     {         // Convert points to Vector3 for use the Cross product, which is Vector3-only         Vector3 cp1 = Vector3.Cross(new Vector3(B - A, 0), new Vector3(p1 - A, 0));         Vector3 cp2 = Vector3.Cross(new Vector3(B - A, 0), new Vector3(p2 - A, 0));         return Vector3.Dot(cp1, cp2) >= 0;     }      //Return true if the point p is in the triangle ABC     private static bool PointInTriangle(Vector2 p, Vector2 A, Vector2 B, Vector2 C)     {         return SameSide(p, A, B, C) && SameSide(p, B, A, C) && SameSide(p, C, A, B);     }      public static string GetAndSetPlayerOrientationByClickedSector()     {         Vector2 playerCenter = new Vector2(//getPlayerCenter);         Vector2 mouseWindowPos = Microsoft.Xna.Framework.Input.Mouse.GetState().Position.ToVector2();          if (PointInTriangle(mouseWindowPos, topLeft, playerCenter, topRight))             return "North";          if (PointInTriangle(mouseWindowPos, topRight, playerCenter, bottomRight))             return "East";          if (PointInTriangle(mouseWindowPos, bottomRight, playerCenter, bottomLeft))             return "South";          if (PointInTriangle(mouseWindowPos, topLeft, playerCenter, bottomLeft))             return "West";          return "";     } }   Now, we are extending our movement in eight directions and therefore I need to extend this helper class to return the diagonal directions (SouthEast and so on) as well.  I am not even sure if this is doable properly with this approach, but I guess I only need to define the points of the additional triangles. Any suggestions on how to solve this are welcome.

If you have a 2D vector expressed as x and y, what's a good way of transforming that into the closest compass direction?  e.g.  x:+1,  y:+1 => NE x:0,   y:+3 => N x:+10, y:-2 => E   // closest compass direction


I am planning to store a cooked meal of halloumi + couscous in the refrigerator. How long can it be stored safely?

How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.


I have made a columnar layout that works fairly well for my needs, but I am experiencing an issue with the height of one column. I have prepared a jsBin that demonstrates the problem;    Basically, when you scroll down - eventually you start seeing white on the left side. Is there any way to force this to stretch all the way down indefinitely?  This is not using a flex-box layout. It is simply achieved using :before, and :after pseudo-selectors.

I am working on a web application where I want the content to fill the height of the entire screen.  The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.  I have a header div and a content div. At the moment I am using a table for the layout like so:  CSS and HTML    #page {     height: 100%; width: 100% }  #tdcontent {     height: 100%; }  #content {     overflow: auto; /* or overflow: hidden; */ }

...

...

     The entire height of the page is filled, and no scrolling is required.  For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work.  Is there a way to achieve the same effect without using the table?  Update:  Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%.  Update 2:  For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.


Where do I find the statistics of how many games I played per race?

How to find out how many games I have won with a specific race on ladder 1v1?  The profile screen just gives me the total wins and losses but I play with all three races and I would like to know my stats per race.  Thanks.  PS: I have been playing Starcraft from the release date but I don't have the old replays as I format my computer often.


I have a couple of dwellers with maxed out stats by now. When they go out to level up, they will not take red radiation damage for several days. The maximum I have so far managed was around five days without needing a radaway.   However, when I send the same dwellers out the second time when they are already 50, they get radiation damage. It's slow and not enough for them to use a radaway on two days, but there is red damage.  I assumed with Endurance on 10 that would not happen at all. Why are they not immune to radiation?

Besides its workplace uses, like Charisma in Living Quarters, Strength in Power Generators, Agility in Diners.   Do we know if Endurance increases HP in the Dwellers, or that strength helps in melee damage / survivability in the wastelands? And Perception?


The rational numbers are exactly those numbers whose decimal representations either terminate (i.e. all digits are 0 from some point onwards) or repeat.  How can I prove this statement? Any help would be appreciated.Thank you!

I am trying to figure out how to prove that all rational numbers are either terminating decimal or repeating decimal numerals, but I am having a great difficulty in doing so. Any help will be greatly appreciated.


As homework, I need to find all the prime ideals of $\mathbb Z[\frac 1n]$.  For starters, I needed to prove that given any two rational numbers $q_1,q_2$, there exists a natural number satisfying $\mathbb Z[q_1,q_2]=\mathbb Z[\frac 1n]$. I did this by writing $q_i=\frac{a_i}{b_i}$ and taking $n=b_1b_2$. Unfortunately, I don't really see how this helps me find all the primes ideals at all.

I started studying about localization of rings and i am stuck at a question about $Spec(R_{S})$ where $R$ is a commutative ring and $S$ a multiplicatively closed set, so $R_{S}$ is also known as localization.   So, have to specify how the prime ideals of a certain $R_{S}$ look like. Given is the ring $R = \mathbb{Z}$, some $k\in \mathbb{Z}$, the localization is $\mathbb{Z}_{k}$. Our multiplicatively closed set is $S=\left \{ 1, k, k^{2}, \dots \right \}$ and $\mathbb{Z}_{k} = \left \{ \frac{r}{k^{n}} : r\in \mathbb{Z}, n\in \mathbb{N}  \right \}$.  How to find the prime ideals of $\mathbb{Z}_{k}$? Can anybody help me, please? Thank you very much!


I was trying to find maximum and minimum of given numbers with this code     double a[50], max, min; long int k,i,j,n;     cout<<"How many numbers you want to examine with";     cin>>n;     cout<<"type the numbers you want to know maximum and minimum of";     i = 0;     while (i<n)     {       cin>>a[i];       i++;      }      max = a[0];     for (j=0; j<n; j++){         if (a[j] >= max) {             max = a[j];         }      }     cout<<"Maximum of given numbers is "<<max <<"\n";     min = a[0];     for (k=0; k<n; k++){         if (a[k]<=min){             min = a[k];         }     }     cout<<"Minimum of given numbers is "<< min;  Then I gave input values as n = 3 & three values to be 34543.54, -6.543467, 0. But I got answers which are rounded off like this Maximum of given numbers is 34543.5 Minimum of given numbers is -6.54347   I didn't use and round off functions, also I'm using double for array, max and min then why am I getting rounding off values. Is there any way to avoid it?

In my  I was printing a double using cout that got rounded when I wasn't expecting it.  How can I make cout print a double using full precision?


I was checking specification of Canon SX520HS and this is what i found regarding focal length:  Focal Length    4.3 – 180.6 mm (35 mm equivalent: 24 – 1008 mm)   Now to get 35mm equivalent focal length, we generally multiple with factor of 1.6 for Canon but here multiplication factor of 5.5 has been used.  Can someone please explain why this difference in multiply factor or this description is misleading?

The Samsung WB250F has 4.0mm-72.0mm printed on its lens, and its 35mm equivalent focal length range is 24mm-432mm.    Does that mean it has a 6x crop factor?


In this sentence: "when he's massaging me, I'm wondering about you."  Is the "when" correct or instead of "when" should I use "while"? Or are both correct for the context?

He left the house _ I was still sleeping   Would this sentence be better completed with when or with while?


Merge conflict after these steps:   Feature branch created from develop branch. Commit A created on feature branch. Few commits merged to develop branch from other feature branches. Develop branch merged to feature branch - creating a merge commit. Until step 4, changes are made either in remote/local repository and pulled/pushed. Now, some more changes happened on remote develop branch which caused merge conflict (seen on web interface), for pull request from feature branch to develop branch.    Merge conflict resolution steps:   Revert commit A in feature branch in local repository. Take latest changes from develop to local repository and merge to feature branch. This merge step doesn't cause any merge conflict as the changes on feature branch are reverted above step. Cherry pick the commit A onto feature branch, which presents merge conflict. Resolve the merge conflict. It is easy to resolve this merge conflict, as you'll be looking at the changes you intended to put in the feature branch.   Resolutions steps 1-3 are performed in local repository and pushed to remote.  Question: Merge conflict resolution steps work fine, if merge from develop to feature (merge commit - step 4) is not performed. Do these resolution steps present any issues, given after commit A, merge commits are performed on feature branch.  The query is not regarding how to resolve merge conflict. This is regarding the steps mentioned give any trouble, given after commit A, merge commit is also performed on feature branch.  Update - Answer: The above process works without any problem. In the question, after commit on feature branch(step 2), merge commit from develop branch to feature branch is done(step 4). The merge conflict resolution steps work fine, given, in the merge commit done on step 4, there are no merge conflicts resolved.   If there are merge conflicts resolved on step 4, changes meant for feature branch are in commit A as well as in merge commit(step 4). In this scenario, the merge conflict resolution steps(1-3) below are not sufficient. The merge resolution steps (1-3) should be followed from the beginning (from the time feature branch is created), if any merge conflict happen on the feature branch.

I want to resolve merge conflicts in my Git repository. How to do that ?


I am experimenting with Django develpment in virtualenv. It is rather anyoing that each time I should type commands like:  python manage.py runserver   I am wondering what should I do to run the same command without 'python', i.e. just:  manage.py runserver

Trying to learn how to run my scripts through Ubuntu's terminal regularly.  That being said I am familiar with bash, wget, and awk being called but how do I call python files to run in the terminal?  I would like to learn this but I am unsure on where to research it.  I have a .pyw file that references several .py files in a folder.


I would like to make unit tests for my C++ application.  What is the correct form to test private members of a class? Make a friend class which will test the private members, use a derived class, or some other trick?  Which technique does the testing APIs use?

How do I unit test (using xUnit) a class that has internal private methods, fields or nested classes? Or a function that is made private by having  (static in C/C++) or is in a private () namespace?  It seems bad to change the access modifier for a method or function just to be able to run a test.


Keep in mind I'm fairly new to GNU/Linux and I've decided to try out Debian for it's history. I've been able to set the screen resolution to 1600x900 (which is what I need), however I haven't been able to find a way to save those settings. For example, I don't have "xorg.conf" nor "xorg.conf.d", I can't even configure it because it says I'm already running X server. I'm pretty sure there is other ways to do this, but most info I find seems vague as to how-to things.  Edit: I'm now able to set the resolution to "1600x900_60.00" each time I get into Debian but manually. I've created a new "xorg.conf" file manually, adding a "naked" screen section, but it seems that it didn't work so I also checked the "/var/log/Xorg.0.log"  file to see what went wrong and this is the output:     [  2969.964] _XSERVTransSocketUNIXCreateListener:   ...SocketCreateListener() failed[  2969.964]   _XSERVTransMakeAllCOTSServerListeners: server already running[  2969.964] (EE)  Fatal server error:[  2969.964] (EE) Cannot establish any listening sockets - Make sure an X server isn't already   running(EE)[  2969.964] (EE)  Please consult the The X.Org   Foundation support     at   for help.[  2969.964]   (EE) Please also check the log file at "/var/log/Xorg.0.log" for   additional information.[  2969.964] (EE)[  2969.964] (EE) Server   terminated with error (1). Closing log file.   I still gotta try the ".xinitrc" method.

I run this command to allow me to move windows between screens:  xrandr --auto  This magic command fixes my screen for me (before I run this my 2nd monitor is just an empty space where I can move my mouse). How can I make whatever this command does stick when I reboot? I'm more interested in fixing my configuration than just re-running this command, but I'm clueless as to how to make this happen.  I have 2 monitors, DFP 5 and DFP 6. Running xrandr results in this:  DFP1 disconnected (normal left inverted right x axis y axis) DFP2 disconnected (normal left inverted right x axis y axis) DFP3 disconnected (normal left inverted right x axis y axis) DFP4 disconnected (normal left inverted right x axis y axis) DFP5 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 474mm x 296mm    1680x1050      60.0*+    1400x1050      60.0      1280x1024      75.0     60.0      1440x900       60.0      1280x960       75.0     60.0      1280x800       75.0     60.0      1152x864       60.0     75.0      1280x768       75.0     60.0      1280x720       75.0     60.0      1024x768       75.0     60.0      800x600        75.0     60.3      640x480        75.0     59.9   DFP6 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm    1680x1050      60.0*+    1400x1050      60.0      1280x1024      75.0     60.0      1440x900       60.0      1280x960       75.0     60.0      1280x800       75.0     60.0      1152x864       60.0     75.0      1280x768       75.0     60.0      1280x720       75.0     60.0      1024x768       75.0     60.0      800x600        75.0     60.3      640x480        75.0     59.9   CRT1 disconnected (normal left inverted right x axis y axis)   I have already set up DFP 6 to be right of DFP 5 using the Displays menu in debian. Here is my xorg.conf file:  Section "ServerLayout"         Identifier     "aticonfig Layout"         Screen      0  "aticonfig-Screen[0]-0" 0 0 EndSection  Section "Module" EndSection  Section "Monitor"         Identifier   "aticonfig-Monitor[0]-0"         Option      "VendorName" "ATI Proprietary Driver"         Option      "ModelName" "Generic Autodetecting Monitor"         Option      "DPMS" "true" EndSection  Section "Device"         Identifier  "aticonfig-Device[0]-0"         Driver      "fglrx"         BusID       "PCI:4:0:0" EndSection  Section "Screen"         Identifier "aticonfig-Screen[0]-0"         Device     "aticonfig-Device[0]-0"         Monitor    "aticonfig-Monitor[0]-0"         DefaultDepth     24         SubSection "Display"                 Viewport   0 0                 Depth     24                 virtual 3360 1050         EndSubSection EndSection   It seems to be configured for everything to be one screen, and xrandr --auto somehow fixes it. Is there some way of taking a peek at what this command is doing to save the result to xorg.conf? How do you normally use xrandr to get the results to persist?   If I search for this I either get told to modify my xorg.conf file (which I don't know how to do because I don't know what xrandr --auto is actually doing) or instructions on how to run xrandr on startup, which I'm guessing isn't necessary, but I may be wrong.


I tried looking for this but I honestly could not find anything for my particular issue.  I am designing a poster in LaTeX and I sometimes use custom list items. The thing is, as these get wider, they take up space to the left instead of the right as I would like them to.   Minimal working example:  \documentclass{article} \usepackage[utf8]{inputenc}  \begin{document}  \begin{enumerate}     \item This is a normal item     \item[Blablablabla]{This is a large item}  \end{enumerate}  \end{document}

Which is the right way to do something like 'description' list but with customizable and fixed-width labels? I.e. something like this:  Label:         Text text text text text text                text text text text. Longer label:  Text text text text text text                Text text text text.   The way I see it to use two-column table (first columt for labels and second column for descriptions), but this solution seems ugly. Is there any other way?


In my new Qt application, I used QML items. But in minus operator, javascript function does not subtract correctly.  When running this code:  console.log( "4.1 - 4 ==> " + (4.1 - 4))   the result is like this:  qml: 4.1 - 4 ==>0.09999999999999964

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


Prove that $n^4 + 4^n$ is not a prime for all $n > 1$ and $n \in \mathbb{N}$.  This question appeared in the undergrad entrance exam of  the Indian Statistical institute.  When $n$ is even the proof is simple.  For $n = 2m+1$ I am utterly stuck.

My coach said that for all positive integers $n$, $n^4+4^n$ is never a prime number.  So we memorized this for future use in math competition.  But I don't understand why is it?


I have a power supply (AC --> DC) powering an microcontroller and DC electric motors. I also have the same AC powering a speed controller, which feeds to an AC motor.   Should I be connecting the ground from the DC power supply, to the earth ground on the AC?  Thank you!

In an AC-DC power supply, how is earth ground typically used?  Take a common PC power supply as an example, does the earth ground connect to the metal chassis? Does it connect to the DC ground on the outputs? What about ground loops?


$ A $ is a commutative ring, $ \mathfrak{p} \in \mathrm{Spec} A $, $ A_{\mathfrak{p}} = ( A \backslash \mathfrak{p} )^{-1} A $, $ \mathrm{Frac} ( A / \mathfrak{p} )$ is the field of fractions of $ A / \mathfrak{p} $.      I would like to know why is  $ \mathrm{Frac} ( A / \mathfrak{p} ) = A_{\mathfrak{p}} / \mathfrak{p} A_{\mathfrak{p}} $ ?    Thanks a lot.

Let $A$ be a commutative ring. Let $P$ be a prime ideal of $A$. Let $I$ be an ideal of $A$ such that $I \subset P$. Let $\bar A = A/I$. Let $\bar P = P/I$. Is $\bar A_{\bar P}$ isomorphic to $A_P/IA_P$?


Does anyone know how I can download mac os 11.3 to an external USB seems like the most basic thing but I can't find out how every time I google it I just get articles about making a bootable USB which isn't what I'm interested it.

Sometimes it's hard to search for older versions of macOS & OS X  on the App Store.  This is an attempt to provide the canonical QA for this issue, as per the Meta QA -  I expect it to be modified over time to hopefully become a complete information resource.  How can I get any older version of a Mac OS to be able to run as a VM, or to reinstall on my Mac?


I was thinking about the reserved character in $\LaTeX$, but I don't know the real function of ~ neither I've use it before. Then, what is its real function in general.  For math mode I found this . But in text mode?

As title, what is the difference between a   and ~?  I see no differences after the compilation.  MWE:  \documentclass[a4paper]{article}  \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{graphicx} \usepackage[colorinlistoftodos]{todonotes}  \title{Your Paper}  \author{You}  \date{\today}  \begin{document} \maketitle  I am cool.  I~am~cool.  \end{document}


Which should I choose: The factory roof or the roof of the factory?  Are there some grammar/rules about the difference? What case should I use the first sentence in? What case should I use the second sentence in?   Thanks in advance

I would be very grateful for some advice on how to decide whether to use an attributive noun or the "of genitive" (periphrastic genitive).  It seems to me that an attributive noun is generally preferable, except when it leads to ambiguity, often due to the combination of several modifiers with mixed dependent relationships.  Additionally, the of-genitive, when used stand-alone, seems to impart a more formal tone, a higher register.  Simple examples (preferred first, less-preferred second):  The department secretary vs. the secretary of the department.  But:  The excellent secretary of the department vs. the excellent department secretary.  Any additional guidelines would be most welcome.


I'm trying to make a quarry, as in some quarries I've seen you can pull items with a device which is upstairs.  I've read about the dropper elevator, but that one has the redstone circuits downstairs for working, I want the device working UPSTAIRS.

Is there a way to transport items upwards from, say, a monster trap? Water flow works fine downwards.


The person at the desk next to me is writing his Ph.D. thesis, and is trying to decide how to lay out some tables. He has too much data for one table, but is not a fan of rotated tables. So we were talking and had the idea that he could make two tables, and place them on adjacent pages so you could see them at once. However, you'd have to make sure they didn't wind up on the front/back of a single page.  Is there a way to do that, or is this sheer madness?

I have two sideways tables that I want on two facing pages so the reader can turn the entire book and read them both in one turn. For the moment I keep moving them around to keep them on facing pages. Is there a way I can make the first one float until it's on a left page and then place the other one right after? Or perhaps some similar way to automatically get them on the same spread?


@misc{rotgdo30j2012agdo31j2012,     author = {{Central Electricity Regulatory Commission}},     title = {{Report on the grid disturbance on {30^{th}} July 2012 and grid disturbance on {31^{st}} July 2012}},     howpublished = {\url{http://www.cercind.gov.in/2012/orders/Final_Report_Grid_Disturbance.pdf}},     year = {2012},     month = {August} }   I am unable to get the superscripts "30^{th}" and "31^{st}" in my bibliography. How can this be achieved?  I am using  \bibliographystyle{ieeetr}

What is the easiest way to superscript text outside of math mode?  For example, let's say I want to write the $n^{th}$ element, but without the math mode's automatic italicization of the th.  And what if I still want the n to be in math mode, but the th outside?