When I need a partially dashed path as below     I have to write two \draw commands:  \documentclass{minimal} \usepackage{tikz} \begin{document}     \begin{tikzpicture}         \draw (0,0)--(1,1);         \draw[dashed] (1,1)--(1,2);     \end{tikzpicture} \end{document}   That is basically OK, but can the job be finished in a single \draw command?  I have tried  %\draw (0,0)--(1,1)[dashed]--(1,2);   % dashes both segments %\draw (0,0)--(1,1){[dashed]--(1,2)}; % no effect %\draw (0,0)--(1,1){[dashed]--}(1,2); % fails   but they either fail or do not work as desired.
Is it possible to change the line style in a tikz figure in the same \draw command?  I am looking for something like:  \documentclass[tikz]{standalone} \begin{document}     \begin{tikzpicture}         \draw[style1] (0,0) -- ++(1,0)  **CHANGE STYLE** -- ++(1,0);     \end{tikzpicture} \end{document}   The main motivation is that I don't want to loose the relative coordinate as I go on with a long \draw command.
The minimum system requirements for 18.04 are "2 GHz dual core processor or better"; would a quad-core at 1.8 GHz meet (or approximate) this requirement? Python and regular expression with Unicode This post has been locked; locked posts can't be voted on Volumes of n-balls: what is so special about n=5? The volume of an $n$-dimensional ball of radius $1$ is given by the classical formula $$V_n=\frac{\pi^{n/2}}{\Gamma(n/2+1)}.$$  For small values of $n$, we have $$V_1=2\qquad$$ $$V_2\approx 3.14$$ $$V_3\approx 4.18$$ $$V_4\approx 4.93$$ $$V_5\approx 5.26$$  $$V_6\approx 5.16$$ $$V_7\approx 4.72$$ It is not difficult to prove that $V_n$ assumes its maximal value when $n=5$.   Question. Is there any non-analytic (i.e. geometric, probabilistic, combinatorial...) demonstration of this fact? What is so special about $n=5$? I also have a similar question concerning the $n$-dimensional volume $S_n$ ("surface area") of a unit $n$-sphere. Why is the maximum of $S_n$ attained at $n=7$ from a geometric point of view?   note: the question has also been  for those curious to other answers. WCF - Faults / Exceptions versus Messages We're currently having a debate whether it's better to throw faults over a WCF channel, versus passing a message indicating the status or the response from a service.  Faults come with built-in support from WCF where by you can use the built-in error handlers and react accordingly. This, however, carries overhead as throwing exceptions in .NET can be quite costly.  Messages can contain the necessary information to determine what happened with your service call without the overhead of throwing an exception. It does however need several lines of repetitive code to analyze the message and determine actions following its contents.  We took a stab at creating a generic message object we could utilize in our services, and this is what we came up with:  public class ReturnItemDTO&lt;T&gt; {     [DataMember]     public bool Success { get; set; }      [DataMember]     public string ErrorMessage { get; set; }      [DataMember]     public T Item { get; set; } }   If all my service calls return this item, I can consistently check the "Success" property to determine if all went well. I then have an error message string in the event indicating something went wrong, and a generic item containing a Dto if needed.  The exception information will have to be logged away to a central logging service and not passed back from the service.  Thoughts? Comments? Ideas? Suggestions?  Some further clarification on my question  An issue I'm having with fault contracts is communicating business rules.  Like, if someone logs in, and their account is locked, how do I communicate that? Their login obviously fails, but it fails due to the reason "Account Locked".  So do I:  A) use a boolean, throw Fault with message account locked  B) return AuthenticatedDTO with relevant information Determining coordinates of a SHP file i have a SHP file of a building converted from a DXF file. This SHP file is unprojected and have no specific coordinates (origin 0,0). I find WGS84 coordinates (lat, long) of this building from Google Maps. My aim is to replace these coordinates to the SHP file on QGIS.  Could you explain the process step by step?  (I read lots of similar questions, about affine transformation. But i don't know the paramaters.)    What i ask is how to make this transformation in QGIS (step by step)?   SHP file coordinates (not projected)  Scale: 1:142.670.713  X1,Y1: 16.70824, 253.74534  X2,Y2: 1.03521,-6.34918  X3,Y3: 244.00248,-7.49189  Target WGS84 coordinates   X1,Y1: 41.047773, 28.896241  X2,Y2: 41.045452, 28.895929   X3,Y3: 41.045436, 28.899039    I need a second vector layer with coordinates. I have just a SHP file of a building converted from a DXF file. That is not projected. I know where this building is, and can find the WGS84 coordinates from Google Maps. My aim is add WGS84 coordinates to this SHP file and export to replace the building on Google Maps.  My Questions are:  1) I think my SHP file has measurements in meters and unprojected. I have WGS84 lat long coordinates from Google Maps. How can i project this SHP file, for being ready to transformation? Right Click -> Set Layer CRS -> Choose WGS84 EPSG: 4326. Is this enough?  2) qgsAffine plugin just need transformation matrix paramaters. But the answer of @Jochen Schwarze is a bit complex for me. Is there a online calculator? (Just give the source XYs and target XYs and calculate the parameters.)    I think, I have a projection problem before affine transformation. I have a DXF file of a building from AutoCAD. I saved this DXF file as a SHP file in QGIS. But this SHP file is converted from a plain DXF file and is not referenced/projected, it is drawn from coordinates 0,0 in AutoCAD in meters. And the drawing has meters, WGS84 has decimal degrees.  When I set Layer CRS as WGS84 in QGIS, the coordinates don't change.  How can I project this SHP file as WGS84 in QGIS? Auto increment filename I have a need to collect some duplicate files and want to avoid name collisions. The problem is that this collection of files might be added to by another execution of my script before the files are cleaned out and just want to continue to increment the number.  I decided on a simple until loop to increment the number like so.  until [[ ! -f ${PWD}/DUPES/${num}-$1 ]]; do num=$((num +1)) done mv --no-clobber $1 ${PWD}/DUPES/${num}-$1   I can't imagine ever exceeding 1k files in an extreme example, so my questions are...  Is this a terribly inefficient way to achieve this? Should I be parsing the existing files to get the highest leading number to start incrementing from there, or is this ok for the extreme example I put forth?  Or is there a better way all together? Prove that a set of connectives is inadequate Calling a function of a module by using its name (a string) What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this. “community wiki” checkbox in new question shows a dialog twice when self-answering Click Answer your own question Check community wiki A dialog box     Are you sure you want to make this post Community Wiki?   will appear, Click OK or Cancel; The same dialog will appear again.   Google Chrome 44.0.2403.107 / Windows8.1 / site rev 2015.7.25.3609 Concatenate all arguments and wrap them with double quotes UILabel truncate tail and skip not complete word Do professors get paid for supervising students? Generalized mean value theorem I know and understand the mean value theorem. But at the moment I don't have the intuition to understand the generalized mean value theorem     If $f$ and $g$ are continuous on the closed interval $[a,b]$ and differentiable on the open interval $(a,b)$, then there exists a point $c\in(a,b)$ where$$[f(b)-f(a)]g'(c)=[g(b)-g(a)]f'(c).$$If $g'$ is never zero on $(a,b)$, then the conclusion can be stated as$$\frac{f'(c)}{g'(c)}=\frac{f(b)-f(a)}{g(b)-g(a)}.$$   What is the intuition? And how can you prove this (generally) ? From  by Richard Brualdi  We have a chess master. He has 11 weeks to prepare for a competition so he decides that he will practice everyday by playing at least 1 game a day. To make sure that he's able to take a couple of breaks, he also decides that he wont play more than 12 games per week.  My question is, how do you prove/dis-prove that there will be a succession of (consecutive) days in which he will play k games, $k \geq  22$?  Specifically, I don't quite understand the use of the pigeonhole principle here.  Thanks in advance! :D  EDIT  I'll try to clarify what I'm asking:  The goal is to prove that for every possible practice schedule that the chess master makes, there will always be a consecutive sequence of days such that he plays exactly k games.  So for example, if k = 22, how do you prove that no matter what his schedule is like, he will always play exactly k games in r days, $1 \leq r\leq  77$.  My main question is: what is the general method for proving different values of k? Are there values of k (from 1 to 132 inclusive) that are impossible to obtain?  Note that he does not necessarily have to play 132 games within 77 days! Also, keep in mind the bounds of k. Find the volume inside the paraboloid $x^2+4z^2+8y=16$ and on the positive side of xz-plane No answer was given for this question, so wanted to confirm my answer. Steps followed for solving:  V=$4\int_0^2\int_0^{\sqrt{16-4z^2}}(2-\frac{x^2}{8}-\frac{z^2}{2})dxdz$  After solving this I got V = $8\pi$. Is this answer correct? How should I print types like off_t and size_t? I seem to have clicked on something that changed my display preferences. The main site is now very minimalistic, with fewer controls and different fonts.  I want to change it back, but where is it? Expressing hourly temporal recurrence What is the most idiomatic way to put into words a situation where a recurring event happens every hour at a certain minute. For example, consider that some event takes place at the tenth minute of each hour: 0:10AM, 1:10AM, 2:10AM, ...  My first ideas were "every hour at the tenth minute" or "every hour at minute 10". Are these options idiomatic and if not, what would be an idiomatic way of expressing this matter? Do mankind and manmade activities/constructions have any effect on the rotation of the Earth? We walk or ride on our vehicles to our destinations daily. Does our movement have any effect on the rotation of the earth according to Newton's law? What will be the effect if we move all the peoples along with their vehicles at their maximum velocity in one line in one direction along the equator? How much effect will it make?