I have a python program that makes some prints that I try to execute from the command line. I would like to redirect the output to a file and also see on the shell the prints. I tried cmd &gt; file, cmd &gt;&gt; file and cmd &amp;&gt; file. But with these three commands, the prints are neither in the shell nor in the file. Why?
In bash, calling foo would display any output from that command on the stdout.  Calling foo &gt; output would redirect any output from that command to the file specified (in this case 'output').  Is there a way to redirect output to a file and have it display on stdout?
Calculate intersection of a line with a plane I was reading something about: “Intersection of a line with a plane”. But I don’t fully understand how to calculate it on their way.  The goal is to calculate where the plane and the line will “cross”. These items are given:   The eye is in position: O(0,0,-10)   A point of a 3D-object is P(10,20,30) The screen has the equation z=0   I have a questions about how they calculate this:    This part is clear. That is the location form the eye (vector representation).   They specify the location of the plane, there is nothing strange here (vector representation).   Now they calculate what part of the line will cross, how did they calculate this? How did they know a = 1/4? And b = 10/4?  This is everything that was given. How to import a jar in Eclipse When is $\mathbb{F}_p[x]/(x^2-2)\simeq\mathbb{F}_p[x]/(x^2-3)$ for small primes? I've been considering the rings $R_1=\mathbb{F}_p[x]/(x^2-2)$ and $R_2=\mathbb{F}_p[x]/(x^2-3)$, where $\mathbb{F}_p=\mathbb{Z}/(p)$.   I'm trying to figure out if they're isomorphic (as rings I suppose) or not for primes $p=2,5,11$.   I don't think they are for $p=11$, since $x^2-2$ is irreducible over $\mathbb{F}_{11}$, so $R_1$ is a field. But $x^2-3$ has $x=5,6$ as solution in $\mathbb{F}_{11}$, so $R_2$ is not even a domain.  For $p=5$, both polynomials are irreducible, so both rings are fields with $25$ elements.  I know from my previous studies that any two finite fields of the same order are isomorphic, but I'm curious if there is a simpler way to show the isomorphism in this case, without resorting to that theorem.  For $p=2$, neither ring is even a domain as $x=0$ is a solution of $x^2-2$ and $x=1$ is a solution for $x^2-3$, but I'm not sure how to proceed after that. Thank you for any help. I just installed Ubuntu and it is great.  However, I installed in beside the Windows Vista OS.  I now want to remove Windows in an effort to improve performance.  What is the easiest way to do this? What does "in spades" mean? What does "in spades" mean, for example in the following sentence:     demand and love are both there in spades ...   I guess "in spades" means "on cards" or "on the table" or exist? How do you empty the buffers and cache on a Linux system? Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache?    Note that this is mostly useful for benchmarking. Emptying the buffers and cache reduces performance! If you're here because you thought that freeing buffers and cache was a positive thing, go and read . The short story: free memory is unused memory is wasted memory. This happens pretty much every time I try to bake normal maps. It's quite a broad error message and I still don't know exactly what the problems I'm having are, only that if I keep clicking things for half an hour eventually it sometimes just works.  My understanding of the things needed:   A "Generated" blender Image that the normals are written to (In UV/Image Editor, click Image->New)   Tell blender that this is the bake output, below (this is the really confusing bit which blender seems to try to guess and fails)  A UV Map for the low poly model (you only need the geometry of the high poly and it doesn't need a UV map) Under Bake, in the rendering tab:   Bake Mode = Normals Normal Space = Tangent Selected to Active = ✓ (for the next bit)  Select the high rez object first, then the low poly object With the two objects selected, click Bake (you may have to move the mouse to see the error pops up)   Now, from what I can tell the only  (with regard to the setup and apart from the internals of baking) is how blender finds the output image:   Cycles  Have a material using an ImageTexture node which points to your normal map output. Then  says the node must be selected, but  doesn't mention selecting. Blender Render  Have a texture attached to the material that uses the image.  is pretty vague on assigning the output image. Sometimes I've found hitting tab to go to edit mode and selecting the normal map image in the UV editor to help, or at least it seemed to.   I would like to know the exact details of what blender goes looking for when you hit Bake, rather than have to guess by following tutorials. For example, it seems to look for the high and low poly objects in your selection and based off the order you select them. How does it find the normal map/image to write to for both cycles and blender render? Does the Texture need to Influence Normals or does it just need to reference the Image? etc... Bluetooth Broadcom 43142 isn't working Bluetooth is on but can't find or be found by any other devices.  Output of sudo service bluetooth status:  ● bluetooth.service - Bluetooth service    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)    Active: active (running) since ხუთ 2015-06-04 22:33:18 GET; 13min ago  Main PID: 26678 (bluetoothd)    CGroup: /system.slice/bluetooth.service            └─26678 /usr/sbin/bluetoothd -n  ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled   Output of lsusb:  Bus 003 Device 005: ID 0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0   How can I fix it? Suppose $f$ is a continuous single-variable function, prove that:  $$2\int_a^b \int_a^x f(x)f(y) \, dy \, dx = \left[ \int_a^b f(x) \, dx \right]^2$$  This question was just on my Calculus III final exam and I couldn't figure it out, could someone provide some insight, please? How to upload a file to a WCF Service? I've build a WCF Service to accept a file and write it to disk. The front-end consists of a page with SWFUpload which is handling the upload on the client side. Apparently, SWFUpload posts the data with a Content Type of: multipart/form-data.  I would think this ok but on the Service side I get an error. The error is "ProtocolException" expecting text/xml. I've tried different message encodings in the bindings but nothing seems to work.  How can I get this file uploaded using multipart/form-data? How do I attach events to dynamic HTML elements with jQuery? rent a car, rent out a car, hire a car Which one should be used?      To me, it makes no difference, but I'm not really sure why.   vs     For me, it makes no difference, but I'm not really sure why. This question is related to  and explores an apparent inconsistency, given only the Harry Potter movies as source material.  The Hogwarts Express line seems to have an inconsistent existence between magical (invisible to ordinary humans aka muggles) and non-magical (muggle) realms; platform 9-3/4 is clearly hidden from muggles, but in Chamber of Secrets, when Harry and Ron take the car (in the muggle world) to catch up to the train, they make no explicit crossing into a magical realm, suggesting that the train is traveling the muggle world despite its departure from a magical platform.  In which realm (magical or muggle) does the Hogwarts Express exist? How is this apparent inconsistency resolved? My MWE:  \documentclass{report}  \usepackage{amsmath}  \begin{document}  \begin{align} y &amp;= a \\ =&amp; -2c_1\bar{z}_1^2 + 2\bar{z}_1\bar{z}_2 + 2\bar{z}_2 \left ( -\bar{z}_1 -c_2z_2 - \frac{3\epsilon}{2}\bar{z}_2 -\sigma_{2,1}\cos(x_1)\Delta x_1 \notag \right. \\ \left. &amp;- \sigma_{2,2}\Delta x_2 -\sigma_{2,3} \Delta u +c_2 \chi_2 \vphantom{\frac{1}{1}} \right ) - 2\gamma \sigma_{2,1}^2\cos^2(x_1) \Delta x_1^2 - \gamma \sigma_{2,2}^2 \Delta x_2^2   - 2\gamma \sigma_{2,3}^2 \Delta u^2 \end{align}  \end{document}   The error I get:  Extra }, or forgotten \right.   The expected result: How can I rotate about an arbitrary point in 3D (instead of the origin)? I have some models that I want to rotate using quaternions in the normal manner, except instead of rotation about the origin, I want it to be offset slightly. I know that you don't say, in 3d space, that you rotate about a point; you say you rotate about an axis. So I'm visualizing it as rotating about a vector whose tail is positioned not at the local origin.  All affine transformations in my rendering / physics engine are stored using SQT (scale, quaternion, translation; an idea borrowed from the book Game Engine Architecture.) So I build a matrix each frame from these components and pass it to the vertex shader. In this system, translation is applied, then scale, then rotation.  In one specific case, I need to translate an object in world space, scale it, and rotate it about a vertex not centered at the object's local origin.  Question: Given the constraints of my current system described above, how can I achieve a local rotation centered about a point other than the origin? Automatic upvote to anyone who can describe how to do this using only matrices as well :) In the Law of Reflection, the angle of incidence is equal to angle of reflection. Why is this true? This is clearly true experimentally, but how does one prove this true mathematically? 3-manifold examples of homomorphisms between fundamental groups that are not induced by continuous maps I'm not sure if this is possible architecturally, but when judging whether to set a bounty and how much it should be, it would be nice to see the impact based on our previous questions. If you're not visiting the site throughout the day, there is no way to tell how effective that bounty might be--particularly for increasing traffic. There is a similar question with adding and removing tags that increase the visibility in the right places, and the effect on views that may have. Can you add new statements to Python's syntax? Can you add new statements (like print, raise, with) to Python's syntax?  Say, to allow..  mystatement "Something"   Or,  new_if True:     print "example"   Not so much if you should, but rather if it's possible (short of modifying the python interpreters code)