Can I tell who used iTunes on my iMac to sync while I was away?

Question: Is there any way to see who used iTunes from my iMac with USB connection? Actually i want to see iTunes logs when someone get connected, synchronized or used my books?
Comment: Might be easier to change your password actually. USB syncing is logged but only on a technical level (device connected and disconnected), you won't even see the name of the connected device.
Answer: One way to tell if a device has connected to your iTunes is to check the preferences and see if there is a device backup.  When you can connect a device to iTunes it creates a backup of the device (if you are syncing stuff to and from it).  In your case it sounds like you wanna find out if your books have been syncing to another device.
Open iTunes Preferences:

Windows: Choose Edit > Preferences
Mac: Choose iTunes > Preferences

There will be no way for you to see what specifically was sycned, this will only tell you if a device has synced, and when.
Comment: thank you. it seems that there is not any alternative to look at whether taking backup or not.
Answer: As far as I know, iTunes maintains no log file of devices that have come to sync and that pairing is stored on each device as opposed to each computer.
For instance, if you connect an iPod touch to iMac A and sync contacts - the iPod remembers the hidden/internal ID of that iTunes library so that it knows to sync again next time it sees that library file (and not even that Mac).
Then if you connect the same iPod touch to another MacBook and sync music (and choose automatically sync rather than manual sync), the iPod remembers that its music came from a different library file. Again - the touch doest know the MacBook per-se but just the library file that was open in iTunes at the time it synced.
Thus way you can have one device sync different parts of its data with different users on the same computer and/or different libraries on different computers. The tracking is done on the iOS side of things and not on the computer end from what I've experienced.
The only edge case is if your devices are not set up to back up to iCloud in which case, iTunes may try to back up the device before starting a sync. I would start there, but it's not a guarantee that each synced device would have a backup (or even if there was a backup, it can be easily deleted).
You'd need some other tool to track things if you want to have a log of each sync event and/or catalog attached devices if you want to know what happens when you leave a computer unattended. It's far easier to inspect the contents on a device to see if it matches the content on a particular library (especially if DRM and/or personalized assets are transferred).


Holography versus Young's double slit

Question: In order to see interference fringes in double slit one needs the two slits to be very close (1-2 wavelengths) even using highly coherent laser. But in Holography this condition apparently does not play role. There is interference when the object is very far from the reference beam. Why is this?
Answer: Unfortunately, the condition you mention is not true. The simple truth is that interference is observed when highly coherent waves interact which each other. the source of the waves (be it slits, mirrors, or any other object) does not matter, as long as the interaction happens within the coherence length because only then the waves are correlated enough to each other to produce the interference.
A typical red laser has a coherence length of ~20cm. This means that if you illuminate a  Michealson interferometer with a red laser (let's say HeNe laser), the optical path difference between the two mirrors (which act like duplicate laser sources) can be as large as ~20cm, and you will still see interference patterns.
In holography, you also combine laser light from two sources: a reference beam and light scattered from the object you wish to image. Like the above example, in the optical path difference is within the coherence length (which it must be to achieve holography:), you will see interference.
Comment: Do you mean that interference can be seen with He-Ne when the slits are 20 cm away after the beam is b.e. split by a beam splitter to be headed in the slits? Or when the planar wave is converted to a spherical by a pinhole? If true why can I see such experiment  made somewhere? Secondly I don't think you are talking about two lasers in the last part of the answer, do you?
Comment: 1. When I say the coherence length is 20cm, I don't mean that the slits can be 20cm apart. What I meant was that the path DIFFERENCE between the two beams of laser can be as far as 20cm, and still you will see interference.

2. In the last section I was definitely talking about two lasers: the general technique of holography is that you take a laser source, split it into two beams, illuminate a reference mirror with one beam, illuminate your object with the second beam, and then recombine the beams to get the interferogram, which is actualy the hologam.
Comment: 1. I dont really understand!!! If the slits are 20 cm apart, so would be the difference in the paths (even less expecially for 0,1,2,3 maximums), the difference can get close to 20 in infinity left or right on the screen (maximmum N 100 if not more). So can you be conclusive - will there be itfr when the slits are 20 cm apart. 2. So not two lasers - but one slit with BS. I have seen a paper of Mandel who insisted for interference from two lasers, but the condition were so that you can not be sure if it  is not selfinterference. Thank you anyway!
Answer: You are wrong about that condition. For example, in his original experiment, using just Sunlight, Young divided a light ray with a card about one thirtieth of an inch thick. In a setup with two slits, that would be equivalent to a distance between the slits three orders of magnitude larger than the wavelength. I think you confuse with the width of each slit which has to be of the order of the wavelength for diffraction to happen.
Comment: Ok maybe more -2-3 mm in fact what I wanted to write. But in holography the object can be many meters away. So that does not answer but just corrects the question a bit.
Comment: The first half of the answer is that the spacing between dark bands in Young experiment is $\Delta=\lambda l/d$ where $\lambda$ is the wavelength, $l$ is the distance from the slits to the screen where the fringes are observed, and $d$ is the separation of the slits. So if you plug in $\lambda\approx500\text{ nm}$ and $l$ of the order of the meter, to get $\Delta$ of the order of the millimeter, so that the fringers can be observed with the naked eye, we need $d$ of the order of 1/2 millimeter.
Comment: For the holography "side" of the answer, you would need to describe what kind of setup you have in mind.
Answer: First, you can't directly compare both experiments. In holography, interference patterns are created by overlaying a reference beam with the object beam. In off-axis holography, overlaying the beams is done with beam splitters and mirrors; in in-line holography, objects are small and often transparent, and since reference beam and object beam stem from the same light source, they will interfere.
In Young's double slit experiment, parallel light is shone through two slits, creating two (theoretically) identical beams that interfere with each other. They are parallel though, so all interference is caused by the parts diffracted to the left or right side when passing the slit. In terms of intensity, the diffracted part is only a small part of each beam, and the further you place the slits apart, the less the two beams can overlap and interfere with each other. In theory, interference will happen no matter how far the slits are apart, but not in practice because the light is not perfectly parallel or perfectly monochrome, the slits aren't cut perfectly straight, light is absorbed and scattered in the atmosphere etc, and you'd need a perfect detector to see the interference pattern.
Answer: The spacing of the slits and the wavelength of the light, together, determine the fringe spacing in Young's experiment.  The farther apart the slits, the closer together the fringe spacing (assuming that the fringes are viewed/recorded a fixed distance from the slits).  This is because the angle between the light coming from the two slits at any point on the recording plane is larger when the slits are farther apart, and the fringe spacing depends inversely on that angle.
In Young's double slit experiment, there will be interference regardless of the distance between the slits if the path from the light source to a slit, then to a point on the recording plane, is the same for both slits.  If the light has a relatively long coherence length (such as is provided by a laser), there will still be interference whenever the difference between those two distances is less than the coherence length of the light.
The reason the two slits are close together in Young's original experiment is that the coherence length of this light was very short, and his optical setup was very simple.  However, it's entirely possible to repeat Young's experiment by scaling everything up larger: put the point source a long distance away so the light spreads over a wide area that can cover two slits separated by a wide distance.  Far downstream, light that makes its way through the slits will spread enough to overlap, and will interfere to form widely spaced fringes.
It is also possible to modify Young's experiment to obtain very closely spaced fringes: spread the slits relatively far apart and use a pair of prisms or mirrors to tilt the beams toward each other so they overlap sooner and at a wider angle.
Bottom line:  Young's experiment is actually a very, very simple holography setup.  Just substitute a laser for the light source and add a few optical elements so the beam geometry can be controlled, and Young's experiment morphs into a modern holography setup.  If Young had realized (and pointed out) that a recording of the fringe pattern could be used to reconstruct one of the beams from the other, he might have been given credit instead of Gabor, for inventing holography.

Holography versus Young's double slit


Superconduction current due to diamagnetism and induction

Question: If we cool a superconductor S below it's critical temperature while a magnet is resting on top of it, an electric current I1 will develop on it's surface to expel de magnetic field. Now let us suppose we first cool S then approach the magnet.
My reasoning tells me that this time there will be an induced current too, because of the motion of the magnet in the neigbhorhood of S. So S will not only have to counter the field (diamagnetism) but it will also have to counter it's increase (induction, Lenz's law). So it seems to me that this time the current I2 will be greater than I1. Is this reasoning correct ?
Answer: In short, yes. The superconductor resists the change in both directions, this can be seen when people have mobius strips with superconductors, or simply when flipping a unit of magnet+sc together
Comment: As I understand, if by flipping a "magnet on top + sc" both still hod, it is because of flux pinning... So that doesn't really solve my problem


calculating $\sin x$ in floating point arithmetic

Question: I would like some help in the following exercise:
In floating point arithmetic we want to calculate $\sin 30$ using the type $$\sin x=\sum_{k=0}^{N}t_{k}$$ where $t_{0}=x,t_{k}=-t_{k-1}\frac{x^2}{(2k+2)(2k+3)}$.
For $N\ge 40$ the result remains the same $ -0.204857 \cdot 10^5$.
Now I am asked to explain this phenomenon.
I thought that this is happening because $t_{40},t_{41},...$ are too small in comparison to the sum till $k=39$, but how do I prove it in a formal way?
Comment: $30^\circ$ and $30$ radians are very different things. Which one?
Comment: So, $\pi/6$? What happens if you plug that into your expression?
Comment: just 30, not radians
Comment: Your recursive formula is wrong: you have $t_1=-x^3/20$ but it should be $-x^3/6$. Your denominator should be $(2k)(2k+1)$ instead.
Answer: You are wrong, the terms are not too small but to large. Actually you
compute the Taylor series of $\sin(x)$ for $x=30$. The largest term is for
$k=14$ and is about $7.762\times 10^{11}.$
To actually compute the sum with say double-precision floating point
arithmetic, all your large terms must cancel to give a value $\approx
-0.99.$
This is almost impossible because your terms are not computed exactly
and there will be truncation errors of order at least $10^{12}$ machine
epsilons.
Comment: There are two different things occurring: 1. the earlier terms are too large and of opposite sign, so you have catastrophic cancellation; 2. the later terms are too small to have any numerical impact on the earlier terms. The second one explains why the answer doesn't change when you ramp up $N$ past a certain point. The first one explains part of why the answer is so horribly wrong. (The other major part is that the formula for the summands is wrong.)


How to define the colorbar of my plot manually

Question: Let's say I have an arbitrary plot, for example a plot of a finite points that I colored them by my own taste independent of any formula like $f(x,y)$ or density etc. Or I have several plots and then I use the Show command to display them in the same plot. Now I want to add a colorbar, of course I have to use the BarLegend option. But now here is what I couldn't get from the help pages of Mathematica. How can I tell Mathematica that I want my colorbar starts from a specific color and ends to a specific color and varies in between the way I specify. For example I want to force it to be defined by RGBColor[i,0,1-i] where i is varying from 0 to 1 and then I also want to have different numbers than 0 and 1 as minimum and maximum numbers in the colorbar. My main problem is to tell colorbar to vary according to RGBColor[i,0,1-i]. In the help pages they refer to each other, BarLegend to ColorFunction and from there to some others and it is confusing to me. The examples listed there also use predefined color gradients such as visible, hue, etc. What about I just simply want to have a function like i->RGBColor[i,0,1-i] or maybe later a piecewise defined function that varies the same way I described but between several colors. I guess it shouldn't be something complicated, but anyway the help pages made me more confused. Thanks for any help.
Comment: does something like `minmax = {.3, .9};
BarLegend[{RGBColor[#, 0, 1 - #] &, minmax}]`  or `BarLegend[{RGBColor[#, 0, 1 - #] &@Rescale[#, minmax] &, minmax}]` give what you need?
Comment: You may also be interested in `Blend`.
Comment: @C.E. and kglr thanks to both of you, yes both are producing what I want :)
Comment: @C.E.Using `BarLegend[{Blend[{{0, RGBColor[0, 0, 1]}, {0.13, RGBColor[1, 0, 0]}}, #] &, {0, 0.13}}]` alone is working fine, but `ListPlot[{{0, 0}, {1/2, 1}, {1/4, 4/5}, {1, 0}}, PlotStyle -> Directive[RGBColor[1, 0, 1], PointSize[0.02]], AspectRatio -> 1, PlotLegends -> BarLegend[{Blend[{{0, RGBColor[0, 0, 1]}, {0.13, RGBColor[1, 0, 0]}},#] &, {0, 0.13}}]]` has a problem in color scaling. Do you know why?
Comment: @C.E. I also don't get any colorbar when adding the BarLegend in Show for a list of plots, i.e. `Show[plist, PlotLegends -> BarLegend[{Blend[{{0, RGBColor[0, 0, 1]}, {0.13, RGBColor[1, 0, 0]}},#] &, {0, 0.13}}]]` :(
Answer: I'll try to answer the questions in your comments. First question, why the scaling is different when BarLegend is used inside ListPlot and separately. The documentation does not say much about this, other than a very vague remark in the Scope -> PlotLegends section of the BarLegend documentation page:

BarLegend automatically picks up values of ColorFunction and
ColorFunctionScaling

So there is an interplay between BarLegend and plotting functions, although it isn't clearly described exactly how it works.
In any case, this example shows what is happening:
BarLegend[{
  Blend[{
     {0, RGBColor[0, 0, 1]},
     {0.13^2, RGBColor[1, 0, 0]}
     }, #] &,
  {0, 0.13}
  }]

This output matches what the bar legend looks like inside ListPlot. Consequently, what is happening is that when you first say that the domain of the bar legend is [0, 0.13] and then also say that the color function should blend between 0 and 0.13, the result is that the color is blended over [0, 0.13^2].
A simple way to avoid this is to not specify the scaling both in BarLegend and in Blend:
pts = {{0, 0}, {1/2, 1}, {1/4, 4/5}, {1, 0}};
cf = Blend[{
     RGBColor[0, 0, 1],
     RGBColor[1, 0, 0]
     }, #] &;
ListPlot[
 pts,
 PlotStyle -> PointSize[Large],
 AspectRatio -> 1,
 PlotLegends -> BarLegend[{cf, {0, 0.13}}]
 ]

Another way is to set ColorFunctionScaling -> False because then it seems that the independence of BarLegend against ListPlot is regained:
cf = Blend[{
     {0, RGBColor[0, 0, 1]},
     {0.13, RGBColor[1, 0, 0]}
     }, #] &;
ListPlot[
 pts,
 PlotStyle -> PointSize[Large],
 AspectRatio -> 1,
 ColorFunctionScaling -> False,
 PlotLegends -> BarLegend[{cf, {0, 0.13}}]
 ]

As for the example with PlotLegends in Show, I'm not sure that this is supported. The arguments acceptable to Show are, at least generally speaking, those acceptable to Graphics, and I don't see PlotLegends among the options in the documentation for Graphics. Furthermore, it might be that since the plot range, image padding, image margins etc. are determined by the argument of Show, any subsequently added plot legend might appear out of view. However, I tried playing with those options and so far as I can tell this is not the case. The best solution is probably to stick your plot legend into a plot.
Comment: Thanks for your complete and nice explanation. For the second part, Adding the colorbar to only one of the plots in the list and then using Show will provide what I want (adding to show doesn't work, adding to each plot will create many colorbars to the result of Show, but adding to only one of them, will give the expected result). Thanks again for your help.:)


Cutting image in half using line with specified slope

Question: Is there a way to use single line with specified slope to slice image in half and delete selected half of the image?
(I have been looking for the solution but found only solutions with specifying x and y in rectangle selection while it is important for me to set specific angle of the slicing line and x,y coordinates for its (this line) center)
Answer: You can't do it with a single line. You'd need to make a selection.
You can use trigonometry to specify an angle and if you know the width or height, then you can work out the other dimension, so you can crop it to that size, so when you make your selection from corner to corner and delete it, it will be at the required angle.
Use the Free Select Tool (Lasso) F, to make a polygonal selection from corner to corner, forming a triangle.  Then delete it.

You can also use the Measure tool to measure angles if needs be. You can also click and drag guides if you need to mark the position, then use the Free Select tool as above.
For example
Answer: Try this:

Mark the point of the line with two intersecting H and V guides
Increase the canvas size (Image>Canvas size) by 1.5x or even 2x and center the initial image in it
Make a rectangle selection that covers the part of the canvas on one side of one of the guides. It is important that this selection is along one of the guides.

Start the Rotate tool and put it in "Transform: Selection" mode (the red square icon at the top of the Tool options.
Click on the rotation center mark and drag it to the intersection of the guides. The side of the selection should also move to the intersection of the guides.
Rotate the selection (or enter the required angle in the dialog)

Edit>Clear to delete the selected part.
Image>Fit canvas to layers to restore the canvas size.


Keyframed animation into path animation

Question: I have got an animated object that is an opening door. I keyframed the movements; not rig there. Now I want to get rid of the keyframes and create an animation path that does just the same but without the keyframes. Is that even possible? I am not that skilled with animation nor do I know what is possible and what not. Hope someone can clearify this for me. I want to use this created path for the BGE and apply it (on the relative movement from the local space on) to more doors later on, so that I can use it in a python command later on (to toggle the door opening). I know this might be an advanced question, but I thought why not ask. If it's too demanding I will ask out of this forum, though, so that I don't bother anyone with almost doing a tutorial for this.
Thanks for helping.
Answer: Your demand sounds a bit strange considering the fact the BGE does not support paths.
You already have an animation. You can simply play it. To play rotation or location animations at different locations ensure the animating parts of the door are parented to a not animating object, such as a static empty.
Sample structure:

base (fixed)

frame (fixed)

wing left (animated)
wing right (animated)

You can align the door by moving and rotating the base object. (Indeed the frame can act as base too).

Keyframed animation into path animation


how to create channel websocket in node js server

Question: I want to create a channel in a websocket server using node js and to send message to the subscribers.
I need a simple code to start.
Thank you for your help.
Comment: Google 'node websockets' and 'socket.io'. There are plenty of resources that'll teach you how to do this, if you do a little research of your own.
Comment: I found many examples of creating  a server node js but  not how to create a channel. I'm working with node js and javascript for the first time.
Answer: Using socket.io, you can easily create channels to differentiate subscribers to different groups. Socket.io calls the channels Rooms and you can read the documentation for details.
In essence, when clients connect to the socket, you have them join a specific room:
io.on('connection', function(socket){
  socket.join('some room');
});

Whenever you emit an event (sending messages in your case), you can send it to clients in that room:
io.to('some room').emit('some event');


Can't get my secondary monitor to power on in X11

Question: I have an ATI HD5770, connected to 2 monitors(DVI and DisplayPort).
When booting up ArchLinux the TTY display is duplicated between the two monitors as excepted, but when starting the X server(Awesome WM) I'm stuck with only one monitor, while the other one is going to power save mode(black screen).
xrandr output:
<code>Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 8192 x 8192
DisplayPort-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      60.00*
   800x600       60.32    56.25
   848x480       60.00
   640x480       59.94
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 disconnected (normal left inverted right x axis y axis)
DVI-1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050     59.95*+
   1280x1024     75.02    60.02
   1440x900      74.98    59.89
   1024x768      75.08    70.07    60.00
   800x600       72.19    75.00    60.32
   640x480       75.00    72.81    60.00
   720x400       70.08
</code>
The resolutions on the DisplayPort are also incorrect.
I've tried so many xrandr command combinations, nothing changed the fact that the DisplayPort connected monitor is inactive.
It's probably worth mentioning that I'm using xf86-video-ati and on Windows(dual boot) I've got no problem with the monitors.
Before that I've also needed to disable Fast Boot from the UEFI configuration tool to be able to actually see the TTY on both monitors.
Answer: Installing fglrx(catalyst-total from the AUR) fixed the problem, probably the xf86 driver had some problems with the graphic card DisplayPort.


Does Angular Momentum from the engine of a car affect said cars ability to corner?

Question: Coming from the NE Dirt Modified world, we are always looking to reduce the amount of friction that our tires need to withstand. This friction causes heat and wear in the tires. Our engines are longitudinally mounted, with the crankshaft lying parallel to the frame rails. The crankshaft rotates in a standard fashion, clockwise when viewed from the front. I have observed in the past that the setup changes needed from one car to another vary based upon what engine is in the car. A car with a high speed large cubic inch engine requires a more aggressive suspension change than one with a low speed, smaller engine. My background in Mechanical engineering leads me to think that the larger moment of inertia in the larger engine, coupled with the higher engine speed and therefore higher angular frequency, means that the engine of the car has higher angular momentum. Could this cause the engine to induce a force on the car which counteracts or couples with the force of friction from the tires?
Answer: When you say "higher moment of inertia" or "higher angular momentum" I assume you are referring to a rotating rigid object correct? This might be the fly wheel or torque converter (correct me as to what since my knowledge about cars is minimal). It seems to me that you should be using the idea of torque then asking how varying this will vary other things.
Torque is the product of the moment of inertia and angular acceleration (of the rotating object being referred to). And angular acceleration is a change in angular velocity and if angular velocity increases, angular momentum increases.
Having said that, because the friction on a tire is the force that resists its rotation when driving, this frictional force is equal to the normal force on the tire (that is, the weight of the tire and the weight of the engine and everything else that pushes down on the tire) multiplied by the coefficient of (Kinetic) friction. This coefficient depends mainly on the nature of the tire/ground surfaces. And the other factors you mentioned do not. However if things like torque, angular momentum and moment of inertia cause an additional downward force on the tires,  then yes, the friction force will increase.
Comment: Not sure what the OP was getting at, but there's also the sort-of-gyroscopic effect when the car enters a curve and the rotating parts of the drive train resist this delta (vector) angular momentum
Comment: This gyroscopic effect is what im getting at, whether the rotation of the crankshaft and subsequent driveline components causes a force to be imparted about the vertical axis of the car. I believe with the rotation of the crankshaft, as well as the desired rotation of the car turning left, that the gyroscopic effect resists the force of friction.
Comment: I'm not sure about cars, but this can be a significant effect when tirning aircraft- especcialy ww prop driven fighter aircraft with powerful engines.


How to export each Excel sheet to each page on PDF?

Question: I want to export specified Excel sheet to specified page on PDF. For example, Sheet1 from Excel to Page1 on PDF. Sheet2 from Excel to Page2 on PDF...so on. I know how to export whole Excel book to PDF but I can't specify which sheet needs to be exported to which page. Does anybody have any idea?
Comment: What program are you using to export to pdf?  When I use pdfcreator to export, and I select entire workbook, it automatically puts each worksheet on its own page in the pdf.  If the worksheet is otside the print margins, you highlight the area, and choose page layout - print area - set print area and convert the workbook to pdf and the worksheet will all fit on one page.
Comment: Too late for me to edit my initial comment, but this method also works with Adobe.
Answer: Assuming you have no commercial PDF writers installed: If you're using a virtual pdf printer driver such as FoxIt PDF, CutePDF writer or Microsoft own "Print to PDF" (in Windows 10 only), you could print each excel sheet to separate PDF files. And you can third-party freeware (like this)to combine PDF and paginate accordingly.


How can I recover 'iTunes Library (Damaged)'?

Question: My iTunes library has disappeared and looking in the Music/iTunes folder, I see an 'iTunes Library (Damaged)' file. All of the music appears to still be there, so I am guessing it is just the database that is damaged. Is there a way to recover the library, like from the xml file? There is also a folder with Previous iTunes Libraries that are a couple months old. Can I just copy and rename one of those files?
Comment: ok, once the recovery is done I suggest you to opt for a more robust way to store ratings, see http://tunecrux.com/resilient-id3-embedded-ratings (blog post of mine). For playcounts, Lastfm has the advantage to work with many music players.
Comment: what specific information do you want to recover ? playcounts and ratings ?
Comment: Yes... playlists, ratings, playcounts.
Answer: Apple's documentation on recreating your iTunes library if it is corrupt:
iTunes: How to re-create your iTunes library and playlists
Last Modified: April 07, 2011
Comment: This mentions that the xml file doesn't contain all the data in the database. What information is missing? Would it be better to use one of the Previous iTunes Libraries even though it is a bit out of date?
Comment: I don't have specifics but I believe you might lose your custom playlists, for instance, and might need to manually recreate them. All the ID3 tags are stored in the individual sound files themselves, so those should be preserved. And I would also guess that after a rebuild you would need to log into the iTunes Store and run the menu command to look for album artwork and download some of the artwork all over again.
Comment: Unfortunately this link is now dead.
Comment: Here's the archive of this link, for posterity: http://web.archive.org/web/20141024180525/http://support.apple.com/kb/HT1451
Answer: I just copied one of the backup files from the 'Previous iTunes Libraries' folders and renamed it to iTunes Library which was quick and easy. I imagine the effectiveness of this solution depends on how old these files are as they are meant to be a backup for upgrading iTunes rather than a timely backup. It worked well for me though and I didn't have to re-create playlists or download album artwork.


How to have number of chosen Lookup field in another list?

Question: I am working on SharePoint 2013 Enterprise. I am looking for a functionality so I can sum item chosen in a list.
As an example I have a list call Bus which is the parent list.

The second list is the number of passengers which have a lookup column from the Parent or the Bus list.

The functionality that I am looking for is to set #Passenger in parent List depend on passengers belong to that bus. For instant in the example the #Passenger of Bus number 1 should be 3 because 3 people belong this bus.
Answer: One way you could do this is to open up SharePoint Designer and create an item workflow in passenger list(triggered on Create or Modified) for the passenger list. Create a parameter in the workflow for each bus type and for add a value to the correct parameter based on some if statements.
Once you have those parameters you could loop through the items on the bus list and update their bus items. Use the Update Item action.
I'll leave you to work out the actual logic on this one, I suspect there is an easier and more elegant method. Certainly, you could also achieve this with some javascript customisation following a similar logic.
Another way, would be to run the workflow and just target the bus item and add or subtract when item is added/updated/deleted.
There may also be a way to do this using calcultated columns, I'm sure that's worth researching.
Comment: No problem, other than calculated columns, workflows and javascript are pretty much your only options client side. If you can write javascript then you can easily write a script to handle this, just go back through your logic and see if you can find another approach. Good luck!
Comment: Thanks for your answer! Actually I already tried workflow or JavaScript but I believe always there is a better but hidden way in SharePoint! For sure I will try your solution and researching.


Market for novellas and/or novelettes

Question: Does anybody know anything about the current market or demand for novellas or novelettes? I'm in the beginning stages of my writing career and it looks like, so far, I struggle with being concise enough for short stories but, also, I have yet to put down enough words for a full-on book. I'm curious if pieces in the 25,000 to 45,000 word count range have any place in modern literature. Please say yes.
Comment: You can do it like David Mitchell and write a novel that consist on many interconnected novellas/novelettes.
Comment: Throwing away a novella is not necessary and a shame. There are markets for novellas, maybe not as many as for novels and short stories, but there are some. You can look online and find them. Another option is to put together a book of short stories, with the novella the first and title story.
Comment: Sorry, I meant "...that consist **of** many...".
Comment: @ Alexandro Chen you can always Copy, Delete  and then re- Add Comment in order to edit your comment…
Comment: You might get a clearer answer if you specified the genre in which you're writing. Erotica does well with novellas, as I understand it, and there's a market for Romance novellas as well. What are you writing?
Comment: Sci-fi, fantasy, ghost stories. I have the first draft of a 30k word implied-supernatural story that I'm not sure I should continue on with if there's no market.
Answer: Check out Duotrope.com or Ralan.com for novella or novelette markets. There are about four to eight market buyers per genre.
Comment: Why on earth was this voted down? It appears to be the first one that gives a direct answer.
Answer: If you're planning to self-publish, then you would probably have a much better chance of selling your work. Having said that, whether or not you truly find success will depend on how well you write, how ell you promote yourself, and what genre you choose to write in. Some genres, such as romance or erotica, tend to sell a lot of novellas. Some writers have even found success with genres such as mystery/suspense or paranormal. Regardless of your genre, if you write enough of them, and they are written well, then you could find your own level of success.
One of the strategies that I have seen work well for some authors is to write novellas in a series. They will then offer the first book in the series as a freebie or drastically reduced to get readers. If they can get the reader hooked, then the follow-on sales from the other stories in the series can generate some income.
Another strategy is to make one book free or cheap, and then make your profits off of collections. This may be more beneficial if you have more than a couple of stories that are not necessarily part of a series, but at least follow the same specific genre and might appeal to the same readers.
As long as you aren't trying to sell your short work at too high a price then you shouldn't have any problems. I would strongly recommend that your book description include the word count and that you point out that it is a novella or short novel. It is not uncommon for some people to give bad reviews if they were expecting an epic novel but only got a novella.
Answer: Novellas don't seem to attract as large of an audience as novels, but they definitely have a place in the market. But if novellas are what you're interested in, definitely go for it! There are several well-known novellas out there, including (but not limited to) The Little Prince, Animal Farm, Three Blind Mice, etc.
Answer: There is, unfortunately, no real market for that size. You should either expand it to novel length, or discard it as a writing learning experience.
In your writing career, you'll probably have to "throw away" many writing pieces.
Comment: Why 'throw away' a completed novella? That seems like a pretty defeatist attitude.

Market for novellas and/or novelettes


How can I reduce the glare when recording the occupant of a vehicle driving towards the camera?

Question: A scene in this video for school necessitates a shot of someone driving towards the camera under varying light conditions. How can I reduce the glare on the windshield? It's very hard to get a clear shot, especially if the headlights are on.
Answer: Use a polarizing filter on your lens. That will help in daylight (if you rotate the filter to minimize glare). It probably won't do anything for the headlights though.
Comment: **For use only in a controlled driving situation, not on public roads**, polarizers may be placed on headlights as well as on camera lenses. All will need to be rotated to find the minimum glare.
Answer: Besides the polarizing option you can iluminate the driver, probably having his window open and some difuse ligh to him.
Take all precautions necesary please.
Answer: In the really serious world of make-believe, the actors, vehicle, camera, and crew would all be sitting on a flat-bed truck body driven by professionals on a road blocked to all traffic by the police who have been trained, briefed, and rehearsed with the full location personnel. The location has been reserved and used for multiple takes to get the optimal take.
Please Note: Any less preparation than the above may involve significant physical and monetary risk for personnel and property.
That said, this answer deals with the practical lighting problems alone.
There is an order of things to do to control two different lighting situations in the shot.
Start with the windscreen reflections. It's a harder problem to solve than the headlight glare/flare.
To control the reflections on the windscreen, you will need to experiment with a polarizing filter to find the best position. The reflections best limited in this way will be from sources above the vehicle such as the sky and overhead street lighting. Either a normal "linear" or a "circular" polarizing filter will help with this lighting problem. A linear polarizer will have to be aligned for optimal results in each situation.
Removing the windscreen for the shot may be a possibility to consider.
Either way, some attention must be devoted to bringing the interior light level on the car occupants up to the level of the scene to avoid over exposing the car exterior levels.
After you have found the ideal solution for the windscreen, work on the headlights.
Alternative 1. Headlights can be attenuated with a linear polarizer covering the entire lens of each of the headlights in combination with a polarizer on the camera lens (as above). Align the angle of the headlight polarizing filters to get the illumination effect you wish in the viewfinder without changing the camera lens polarizer. This will cut the intensity of the headlights somewhat. The headlight polarizing layer angle is variable. Adjust the headlight polarizing screen until the strived-for effect is achieved.
Alternative 2. Headlights can be attenuated with appropriate neutral density filter covering the lens for the effect you wish.
Alternative 3. Headlights can be dimmed with a rheostat (dimmer) for a DC circuit.
Alternative 4. Remove and substitute different lower intensity lighting for the headlights.
Alternative 5. Do not illuminate the headlights and choose a different time of day for the scene to make the headlight illumination less evident.
For more control of the camera shake, lacking a gyroscopic camera mount, shoot the scene static if you can. Frame each shot so that lack of motion of the background is less evident. Edit the scene so that cut-aways help with the illusion of being shot in motion. Locations will have to be carefully chosen.
Does your school have any green-screen capability to fix the continuity in "post" production?


What is the difference between "precise" and "accurate"?

Question: I often use these two words when I try to describe my experimental results. I wonder whether they can be used in the same situation. I searched these two words with WikiDiff, but still cannot get a clear explanation.
Comment: @EdwinAshworth OP wrote "when I try to describe my experimental results".
Comment: Easily [found here](https://labwrite.ncsu.edu/Experimental%20Design/accuracyprecision.htm).
Comment: Forget about WikiDiff. Look up one or both words (accurate, precise) in professionally-compiled dictionaries (Oxford, Cambridge, Merriam-Webster, American Heritage, etc) and see what the usage notes are.
Comment: But  the distinction made in Weather Vane's article is register-specific. I remember coming across it in school science. In the language in general, they're much more closely synonymous (easily found in respected dictionaries).
Comment: Consider the two weather forecasts "it will be cloudy today" and "there will be stratus cloud today". The second is more precise but less likely to be accurate.
Comment: Precise is "Donald Trump weighs 236 pounds." Accurate is "Donald Trump's weight has been estimated at about 255 pounds."
Comment: @Weather Vane OP wrote 'What is the difference between "precise" and "accurate"?' and didn't add a 'science' tag. Or doesn't precision really matter on ELU?
Answer: If you imagine the target to be made up of many squares, I've understood precision to be the size of each square, and accuracy to be how close you got to the desired square. This is based on the practice of precision being specified to a certain number of significant figures in scientific measurements.
However, Wikipedia notes that ISO 5725 provides the following definition:

According to ISO 5725-1, the general term "accuracy" is used to describe the closeness of a measurement to the true value. When the term is applied to sets of measurements of the same measurand, it involves a component of random error and a component of systematic error. In this case trueness is the closeness of the mean of a set of measurement results to the actual (true) value and precision is the closeness of agreement among a set of results.
Answer: Precise is "my watch says it is 10:35:06". But is this accurate? Maybe, maybe not. It depends on how carefully your watch was last set. You can get a precise experimental result, which is not at all accurate because someone bumped into the equipment and misaligned something or loosened a connection
Following is a recent, famous example of a (fairly) precise result of the speed of neutrinos which turned out to be wildly inaccurate. From Science:

Enough already. Five different teams of physicists have now
  independently verified that elusive subatomic particles called
  neutrinos do not travel faster than light. New results, announced
  today in Japan, contradict those announced last September by a
  170-member crew working with the OPERA particle detector in Italy's
  subterranean Gran Sasso National Laboratory. The OPERA team made
  headlines after they  suggested neutrinos traveled 0.002% faster than
  light, thus violating Einstein's theory of special relativity. The
  OPERA results were debunked months ago, however. So instead of the
  nail in the coffin of faster-than-light neutrinos, the new suite of
  results is more like the sod planted atop their grave.
The OPERA team had timed neutrinos fired through Earth from the
  European particle physics laboratory, CERN, near Geneva, Switzerland,
  and found that they made the 730-kilometer trip to Gran Sasso 60
  nanosecond faster than they would traveling at light speed. But in
  February, the OPERA team also discovered that  a loose fiber optic
  cable had introduced a delay in their timing system that explained the
  effect.  (Emphasis added.)

This result is famous, but things like this happen all the time in labs.  That is one reason why results need to be independently confirmed.
Answer: In 1923 Theophilus Shickel Painter, 1889 - 1969, an eminent cytologist, reported that there were precisely 48 human chromosomes. This was published in a respected scientific journal and was accepted in the scientific community for a period of 33 years.
In 1956, Tijo and Levan published their work and were puzzled to discover they could only find precisely 46 chromosomes.
Not until Ford and Harrison also published their findings of 46 chromosomes, again in 1956, did it dawn on everyone that Painter's original data was inaccurate.

The difference between precision and accuracy is that the first is a matter of what is expressed, and the second is a matter of what is executed.

OED-3. . .  (subscription required)

Precise : Characterized by definiteness or exactness of expression

OED-3 . . (subscription required)
Accurate : Executed with care; careful.


Making an app window smaller on a mac

Question: When I open some apps, the window for the app is huge.  I know I can resize the window by going to bottom right and corner and using mouse. I was just wondering is there some quicker way using keys etc?
Comment: No the mouse is quicker and if well written the app will store that size to ope the next new window
Comment: Let's decide if you are looking for third party software solutions to window management or if you want to know if the OS itself has some built in features for this.
Answer: Well, there are some tricks in OS X Lion and above.
Since OS X Lion you can use any window edge for resizing.
If you hold down the option key, you can also resize a window by expanding or decreasing opposite sides of a window at the same time.
If you hold down the shift key while you expand or contract a window, the window will maintain its original aspect ratio.
Also you can combine option and shift.
If you want keyboard shortcuts (not built-in there) you can use 3rd party software like http://www.macupdate.com/info.php/id/26411/mercurymover.
Answer: If you don't mind using an add-on, take a look at ShiftIt.  It allows you to use keys to move the window to left side, right side, top, bottom, lower left, upper right, etc.
https://github.com/fikovnik/ShiftIt
From the dev's website:
Answer: If the window is not in fullscreen mode (i.e. where the yellow "minimize" button is greyed out) you can double click the header bar of the window. That will resize it to be the full width of the screen minus the computer's top bar. Then, when you double click it again, it will shrink to the size it was before you first double clicked it.
This way you can, say, have a window occupying one half of the screen, then double click to enlarge it to full, then double click again to go back to the same half.

Making an app window smaller on a mac


How do I get a standalone (no install necessary) JDK 8 for Java coding on Mac?

Question: I am using a public computer and I want to do some Java coding on it*. I was able to download IntelliJ and I was able to copy it to my desktop and run it (see here), but I was not able to install the JDK due to lack of administrator privileges (see here).
How do I get a standalone (no install necessary) JDK 8 to use with IntelliJ on Mac?
*Note: The exact reason is I do not have a working computer and I have a coding interview (with Triplebyte, see here) that involves finding and fixing bugs in a Maven Project.
Answer: Download a Zulu build. They come as a zip file for MacOS.
https://www.azul.com/downloads/zulu/zulu-mac/


Two types of LEDs, series - parallel combination

Question: I am trying to design small DIY grow light for Chilli Peppers. I found ideal to use a combination of Samsung LM301H (https://www.samsung.com/led/lighting/mid-power-leds/3030-leds/lm301h/) and LM351H V2 (https://www.samsung.com/led/lighting/high-power-leds/3535-leds/lh351h-deep-red/). Now I am not sure what is the best series-parallel combination of these two types of LEDs together. I want to use a Constant Current source. For LM301H(Uf=2,75) I want to use 65 mA and 350 mA for LM351H(Uf=2.2). Is it a great idea to put 6 LM301H together in parallel, series to 1 LM351H? Then I will have a block that will have a voltage drop of 5V and driven with a constant current of 350 mA. Is this correct design, or am I missing something?
 Thanks! :)
Answer: I would be concerned with manufacturing variances in the devices causing 1 or 2 of the 6 LEDs to flow more current than the others, heating up more, flowing more current still, and creating a vicious cycle.
That could be at least contained by putting a resistor in series with each LED.
Comment: Adding a resistor seems mad for me. Samsung sorts this type of LEDs by Luminous Flux with constant amperage to some groups. So I suppose the difference between individual LEDs from the same group or reel  should be that high. But maybe I am wrong. If I take a look onto some professional boards with these LEDs directly from Samsung I don't see any current limiting resistor (https://www.samsung.com/led/lighting/led-modules/industrial-light-module/horticulture-linear/). How they design work then? Thanks :)
Comment: @VojtaErmis Are we looking at the same thing?  Look at the last page. I see a repeated pattern, 6 LEDs and a little dot.  What's the dot? **A resistor**.  Specs say 21.5V nominal, sounds to me like 6 LEDs in series with a resistor.  Do you grasp series and parallel?  Do you understand LEDs are constant current and that means you series-wire them where able?
Comment: You mean this https://imgur.com/a/Sy5eH1T? Its LM351H I think.
Comment: Meh, the 21.5V doesn't make sense then.  Maybe it's 7 LEDs in series, but still we're talking series-parallel ladders, not what you plan. With 7-series strings it'll tend to even out manufacturing irregularities.   Unless you think it's exactly the ladder you propose up top, four of them in series to get 21.5V?? There are 8 groups per unit.
Comment: So connection like this is OK? I suppose that's is exactly what Samsung uses. Then is 700 mA (not 1.4A I made mistake on drawing) and around 21,5V nominalhttps://imgur.com/a/5XDdrPo
Answer:
I found ideal to use a combination of Samsung LM301H(https://www.samsung.com/led/lighting/mid-power-leds/3030-leds/lm301h/) and LM351H V2 (https://www.samsung.com/led/lighting/high-power-leds/3535-leds/lh351h-deep-red/).

The efficiency of the red diodes is no better than the whites.  You could get similar results just using white LEDs of the color temperature you want, at least assuming those exist.

Is it a great idea to put 6 LM301H together in parallel, series to 1 LM351H?

You'd have to look at the spec sheet to get an idea of the variation in forward voltage, but in general, no I wouldn't prefer that.  Instead I would try to have a few in series so that the variation in individual units averages out and the current is more uniform. Plus the voltage is probably too low to make sense for something like a growlight where you want many watts of power.
Typical grow lights put 10-30 lights in series, and then build parallel strings from that.  This way the current is more reasonable.  Unless you have a very small grow light, usually you want to be working at somewhat higher voltages to reduce wiring losses.
Comment: It's hard to get quality "white" LEDs with this spectrum. I meant I can then stack these blocks together, so like 4 blocks in series and 4 in parallel. Then I would have around 20 V with  1400 mA totally, this seems like a good light source. Isn't it?
Comment: You're risking damaging the diodes if you get an odd white diode with a low forward voltage, so I wouldn't do it. Put a couple more white diodes in series behind each red and the problem goes away.
Comment: @Vojta Emris Why is that spectrum important? The reason I said color temperature and not spectrum is that the ratio of red to blue is often important, but the exact spectrum is not. Alternatively the efficiency on the red diodes you have picked is poor. Buying better diodes would save you some electric bill.
Comment: I already designed an array like this https://imgur.com/a/5XDdrPo with suggestions bellow. Is it better in your opinion? Btw. current is not 1.4 A but 0.7 A on the image.
Comment: @Vojta Ermis I think it is a bad design for the reasons outlined above.
Comment: you mean because of the low efficiency of red diodes? Or because I didn't put white diodes before red diode? If I should put white diodes in front of the red LED how can I power red diode with 350 mA and white diodes with 65 mA if there is only series connection?
Comment: @Vojta Ermis instead of putting 4 series groups of 6 parallel white diodes, put 6 parallel groups of 4 series white diodes. Then put the red diodes in series with everything. And yes, you should look for better red diodes.
Answer: This looks like a reasonable shared current balance for up to 350 mA if you have adequate heat transfer in the design for each part with shared temperature for each parallel LED ( most critical without a series R equivalent for each White LED equal to its ESR of 2 Ohms. ) However, this is a fixed design of < 2 watts.
Always start from the system specs design for radiated power at each wavelength in PPF or PE then design according to the range of system application requirements rather than a potential array and see what it can do or if it works.
Also learn about thermal runaway and thermal balancing and ESR of each part = incremental R=V/I and tolerances.  Samsung will have lower tolerances than no-name brands.
https://www.samsung.com/led/about-us/news-events/news/news-detail-49/
Comment: Samsung uses really tight sorting. By thermal balancing, you mean putting LEDs with characteristics into the same series connection to minimize non-constant dividing of current? I was thinking that If manufacturers sort LEDs into groups by their parameters I don't need to worry then about this.

PPF and PE I am not sure what is ideal for my plants, so It's more experimental.

For good heat transfer, I am planning to use aluminum core PCBs, not FR-4 with copper. Single-sided with large cooling pads. The PCB will be mounted to a passive Al radiator with thermal grease.
Comment: Since Vf change affects current sharing , not only nearly matched at room temp but all temps.  If in doubt, verify the parts on each batch or added 1 Ohm.


Contract's transaction count in a certain period

Question: I want to determine the number of transactions of a contract in a certain period. My question is that in the transaction receipt, if we want to say that contract A has x number of transactions will these be only the transactions sent from this contract or they will be also the one sent to it, i.e. the sum of transaction numbers having this contract address in the to and from fields in the transaction receipt.
Comment: you can use etherscan io api
Comment: I dont want to find the total number of transactions of a contract, rather want to find them in a certain period for which i am utilizing getting transaction information from individual blocks.
Comment: you can use nonce for that
Comment: I dont think you are understanding my question
Comment: you want the number of transactions 'from' the contract or 'to' the contract?
Comment: to the contract
Comment: I guess I'm confused in deciding whether 'to' determines the contract's transactions or 'from'
Comment: If a transaction came from a certain address say B, will this transaction count in the transactions of B as well as in the transactions of the receiver that's what I am asking
Comment: lets make this simple, do you want the transactions where the receiver of the transaction is the contract?
Answer: If the contract is emiting logs for each transaction received then you just need to look for the logs emitted by the contract.
You can do this with etherescan: https://etherscan.io/apis#logs
For instance:
https://api.etherscan.io/api?module=logs&action=getLogs
&fromBlock=379224
&toBlock=latest
&address=0x33990122638b9132ca29c723bdf037f1a891a70c
&apikey=YourApiKeyToken
will return a list of all the logs generated by the contract (presume a single event per transaction)
Notice that you can decide what from what interval (in blocks) to look for.
The only caveats possible are:

The contract do not generate an event for every transaction.
The contract generates more than one event per transaction.
Answer: This depends on what do you mean by "transaction" and what do you mean by "transaction of a contract".
For transaction there could be at least two meanings:

Real Ethereum transaction included into a block with separate hash, receipt etc.
So called "internal" transaction, initiated by a smart contract, that does not have hash nor receipt.

For "transaction of a contract" possible meanings are:

Transaction sent to this contract.
Transaction sent by this contract (internal transaction).
Transaction that created this contract.
Transaction that destroyed this contract.
Transaction that destroyed some other contracts sending remaining ether from the balance of destroyed contract to this contract without executing this contract's byte code.
Transaction that accessed this contract without executing its byte code, i.e. read ether balance of this contract or byte code of it.
Transaction that performed delegate call to this contract.

You need to use different approaches to detect and count different kinds of transaction related to the contract in different ways.  In some cases Web3 API will be enough, but in the other cases, you will need to trace transactions all use etherescan.io API.
Answer: If you have a geth node running; you can use this script to calculate the number of transaction of a contract in a given block range.
function countNumberOfContractTxs(contractAddress, blockStart, blockEnd) {
  var incominngCount = 0;
  var outgoingCount = 0;
  contractAddress = contractAddress.toLowerCase()
  if(!blockEnd) blockEnd = eth.getBlock('latest').number
  for(var blockNum=blockStart; blockNum<blockEnd; blockNum++) {
    var txs = eth.getBlock(blockNum).transactions;
    if(!txs.length) continue;
    for(var j=0; j<txs.length; j++) {
      var tx = txs[j]
      var txDetail = eth.getTransactionReceipt(tx)
      if(txDetail.status == '0x0') continue;
      if(txDetail.from.toLowerCase() == contractAddress) outgoingCount++
      if(txDetail.to.toLowerCase() == contractAddress) incominngCount++
    }
  }
  console.log(incominngCount, outgoingCount)
}

Just paste this function in geth console and call this like a nornal contract function. Last param is optional and the script checks only for successful txs.
countNumberOfContractTxs(<contractAddress>, startBlock, endBlock)


Compute Line Integral $\int_{\Gamma}(x+y)dS$

Question: Given
$$\int_{\gamma}(x+y)dS$$ where $\gamma$ is defined as triangle connecting points $(0,0)$, $(0,1)$, $(1,0)$
I'm having some issues transforming this integral to normal Riemann form.
My try:
$$\int_{\gamma}(x+y)dS=\int_{0}^{1}(x+0)\sqrt{1+0}dx+\int_{0}^{1}(0+y)\sqrt{0+1}dy+{\color{Red} {2\int_{0}^{0.5}(x-x)dx} } = 1 + {\color{Red} 0 }$$
I marked red the incorrect one (incorrect for me). Maybe a stupid question, but how should I transform it to not get zero? And I'm not looking for geometrical solution, I'm new in line integrals and still want to learn the concept behind it.
Comment: I find your picture confusing: your line integral should be in the $xy$ plane, what's going on in 3 dimensions?
Comment: I think you're right, this picture is wrong, I'll better remove it.
Answer: A note on notation: it is good taste to write line integrals as $\int f dr$, and reserve the notation $\int f dS$ for surface integrals.
To compute the integral $$\int_{\gamma} (x + y) dr$$ along the triangle with vertices at $(0,0)$, $(0,1)$, $(1,0)$, first draw a picture of $\gamma$:
If orientation is not explicitly stated, it is common to assume that the integral goes anticlockwise. The direction of the integral of course matters only up to a sign. Split your integral into the three lines that make up your triangle, $$\int_{\gamma} (x+y) dr = \int_{\rightarrow} (x+y) dr + \int_{\nwarrow} (x+y) dr + \int_{\downarrow} (x+y) dr.$$ The tricky one is the slanting side, so let's do that last. The other two sides are $$\int_{\rightarrow} (x+y) dr = \int_0^1 (x + 0) dx = \left[ \frac{1}{2} x^2 \right]_0^1 = \frac{1}{2}$$ and $$\int_{\downarrow} (x+y) dr = \int_1^0 (0 +y) dy = \left[ -\frac{1}{2} y^2 \right]^1_0 = - \frac{1}{2}.$$ Observe that I didn't need to use any fancy machinery to compute these two - that's because these happen to lie along your coordinate axes. That's why in the first one my element is $dx$, i.e. the integral goes along the x axis (on which $y=0$, so I've set $y=0$ in the integrand), and similarly in the second one my element is $dy$. However here I integrate downwards, and to convey that I have to integrate from 1 to 0, as opposed to from 0 to 1 (recall that we are going anticlockwise).
To deal with the hypotenuse, parametrize it by $$\textbf{r}(t) = \left(x(t), y(t)\right) = \left(1-t, t\right).$$ Then I want to use this parameter $t$ to convert my integral along a line in two dimensions into a familiar integral in one dimension. Recall that by definition, $$\int_{\gamma} f dr = \int_a^b f(\textbf{r}(t))|\textbf{r}'(t)| dt. $$ In our case $a=0$ and $b=1$, and $$\left|\textbf{r}'(t)\right| = \left|\left(-1, 1\right)\right|  = \sqrt{2},$$ so $$\int_{\nwarrow} (x+y) dr = \int_0^1 (1-t + t) \sqrt{2} dt = \sqrt{2}.$$ It remains to add the three parts, $$\int_{\gamma} (x+y) dr = \frac{1}{2} - \frac{1}{2} + \sqrt{2} = \sqrt{2}.$$
Comment: @onemoonlessnight Perhaps the whole issue of clockwise versus counterclockwise is only relevant when dealing with line integrals of vector functions. Since $f$ is a scalar function we should be taking the absolute values of the integrals yielding an answer of $1+\sqrt 2$, which would accurately reproduce the area of the surface between the triangle and the plane.
Comment: Any chance of justifying the sign here - if we went clockwise the final answer should be $-\sqrt 2$ with the entire contribution coming from the diagonal. I'm having a hard time visualizing why upward to the left gives a positive result and downward to the right gives a negative result.
Comment: It's convention. Along the diagonal $x+y$ always takes the value $1$, so the *area* under the curve $x+y$ is simply its value times the length of the curve, in this case $\sqrt{2}$. The direction in which we integrate doesn't change the area, of course, but it is useful to have a sense of direction for consistency.
Comment: You can compare this to the familiar case of something like $$\int_0^1 x dx = \frac{1}{2}. $$ Obviously the area under the graph of $y(x) = x$ from $0$ to $1$ is $\frac{1}{2}$ in whichever direction we "add the infinitesimal rectangles", if that makes sense. But we need to have a sense of "doubling back on ourselves", so that if I integrate from $0$ to $1$ and then integrate backwards from $1$ to $\frac{1}{2}$, I should end up with an integral from $0$ to $\frac{1}{2}$. So my integration backwards should have a negative contribution; this is the essence behind $$\int_a^b = - \int_b^a.$$


Listing all apps that updated at once

Question: When multiple apps update in one batch they trigger a single system notification saying X apps updated and listing about two of them. Then it takes one to Google Play app where "recent" updates are listed - but this list includes multiple last update batches so even more than X apps are listed. Is there a way i can see the real X app names that updated in the  very last batch only?
Answer: There is no way to do it via the play store, but there are other ways to do it.
You can use something like AppMonster or Titanium Backup (if rooted) to display the list of apps ordered by last update date. This will show you the order in which all apps were last updated, as well as the date of the update. To me this a lot more useful than the recently updated list in the play store.
It's not a perfect solution, but it gets the job done :)
Answer: Actually there is a way to do this, but it must be done before applying latest batch of updates, so maybe it will not be as practical as one might expect, as you'll find out below:

Go to the app drawer and drag up the Play Store icon, to App info.
Tap the button Clear data and confirm
Next time you start Play Store app, it will greet you asking you to accept the TOS again, do it.
Now the list of recently updated apps will be merged with earlier ones, and next update batch, when done, will show on top of the list.

To be honest, I don't recommend you this procedure because of potential collateral effects derived from clearing app data too frequently. I'm posting this answer only for informative purposes, but I'd rather go with the answer given by @Krampus

Listing all apps that updated at once


Can a single SQL Server instance have multiple names?

Question: It's pretty much all in the title.  I expect the answer to be no, but wanted to ask to make sure.  Basically, can a single SQL Server instance be referred to by multiple names.  I know you can set the DNS to resolve multiple names to the same IP/server, but how would this affect connecting to SQL Server?
Answer: The SERVER part of the SERVER/INSTANCE can be any name that resolves to the correct address, either an extra A record or a CNAME or a name from a HOSTS file.
The only caution here is that the fake name may break Kerberos authentication.  SQL with Kerberos is a funny beast, the SQL Client does a reverse DNS lookup on the address and then uses the name it gets to build the SPN so it should work so long as the reverse lookup gets the original host name of the server.  Also SQL will fall back to NTLM so this will only cause a problem if you require Kerberos for some reason, like you are using delegation.
You can't make SQL respond to more than one INSTANCE name though.  You can however define an alias in the CLIENT configuration.
When you connect to SQL Server, the instance name you specify is sent to the SQL Browser service on the server, the browser service responds with the TCP Port that the requested instance is listening on.  It is possible to specify this port number either in the connection string, or in an alias.  I have just created an alias called NEW that points to mysqlserver port 1966 which has a named instance listening on it.  I was then able to connect to the named instance by simply specifying a server name of NEW.
There are two disadvantages of this method.  First is that the configuration is needed on each client, I don't know if there is any way to push that configuration.  The second is that a SQL Instance normally uses a dynamic port.  If you want to define aliases then you need to change the server so that it listens on a fixed port number that the clients can then be configured to connect to.
Answer: SQL Server doesn't give a damn about the DNS name you are connecting to, unless you are using SQL Server over SSL.  The name of the instance can't be played with unless you are connecting to a specific TCP port number.
Comment: This is just plain wrong. Sure the instance can be played with, under SQLServerManager14.msc => SQL-Native Client => Aliases (be sure to enter the 32 bit version to, for SSMS). The hostname can be played with using the hosts file (C:\Windows\System32\drivers\etc\hosts) or by adding the server name to your internal DNS-server. You need to forward the alias to the proper server and port (instance), 1433 by default. e.g. localhost\SQLEXPRESS =>localhost,1433. You probably need to enable TCP/IP under network configuration for this to work (SQLServerManager14.msc).
Comment: An alias can only be used on the computer that they are created on. Here's the Microsoft documentation on them. https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/create-or-delete-a-server-alias-for-use-by-a-client?view=sql-server-2017 There's nothing in the SQL Server connection protocol that allows for an alias to be stored on the server. How would the client get this information? Where would the client get this information from? The Op asked if the server can be connected to with multiple DNS names. That answer is yes, SQL doesn't care. This isn't exactly controversial.
Comment: Nope my answer is still correct. Adding aliases doesn't change the name of the instance, and as you pointed out you can chance the host name all you want, which is the same thing I said. So thanks for agreeing with me.
Comment: Yes it doesn't change the name of the instance, but it makes the installed instance accessible under another instance name, which is as if it were another instance. For example I can alias localhost/SQLEXPRESS to localhost, and then I can use SSRS projects together with other users that have SQLEXPRESS without having to change the connection string in the SSRS project. And they don't have to change it back as well every time they pull the latest version. One less bothersome merge-conflict. And this also works when connecting from remote computers.
Comment: Argh, you're right, I ended up here via google searching for how to change the instance name. I only read the title, not the actual question. Damn my vote is locked. I can't undo.
Answer: I find it easier to create Aliases in the SQL Server Configuration manger that point to the same sql server.
Comment: For management studio, be sure to also enter the alias to the 32-Bit native client, not just the 64 bit one. SQLServerManager14.msc or SQLServerManager.msc respectively.
Answer: I ran a simple test by adding an entry to my HOSTS file, and it would seem that SQL Server doesn't care about the name used in the connection string.  I always thought that part mattered, but it would seem it doesn't.
In this case, I'm not connecting to a named instance, just the default instance.  I would assume that as long as the server part of SERVER\INSTANCE matches, you'd be able to do this with a named instance as well.  I don't have any named instances to test with, though.
Answer: Well Tim in my experience, you can give the server many DNS entries and you should not run into an issue with reaching the default SQL instance (or any instance) on the server.
The instances themselves are differentiated on the server with the SQL Browser Service which has to run so that the named instances can be seen.  If not, usually (99 times out of 100) the only instance that can be seen when this service is not running is the default instance.
I hope I helped you in some way :)


Can you broadcast a very low power nav vor signal in air?

Question: Are there any FCC restrictions on broadcasting a test nav signal on 108.0 in the air? Or perhaps on other nav frequencies that can be received within the navigation band?
Comment: What kind of transmitter are you talking about, certified equipment or experimental?
Comment: "*Are there any FCC restrictions*". The restriction is you need to ask for permission, and be delivered a license for operation, or a temporary permission. Conditions will be associated with the license/permission.
Answer: The use of radio transmitters is strictly controlled almost everywhere in the world. FCC would be the authority in charge if you are asking for the USA.
The International Telecommunications Union (ITU) is in charge of allocating frequency bands for different applications in the radio spectrum. You are only allowed to transmit if you have a frequency assignment, if your equipment is certified, and you are holding the required radio license.
There are use cases where non-certified equipment may be used (e.g. amateur aka HAM radio), or no license is required (e.g. wireless consumer devices like cell phones, remote controls, etc).
108.0 MHz is at the upper edge of the frequency band allocated to FM radio broadcasting, and the lower edge of civil aviation frequencies. Therefore 108.0 MHz is not available for experimental navigation signals. Your usage would be illegal. The same will be the case for any other frequency that can be used with certified navigation receivers.
Comment: +1, but you should explain how harmonic attenuation is handled too, else I can use a 27 MHz transmitter (legal without license) to create a 108 MHz signal (4th order harmonic) which is illegal without a license. By the way, all transmitters (all oscillators and heterodyne mixers) create byproducts, so everyone is actually transmitting in many bands not allocated, but at very small power.
Comment: @mins, thanks for the input, but as long as the OP doesn't bother to tell us if his equipment would be experimental or certified, I do not feel motivated enough to expand my answer.
Answer: The answer is yes with the caveat that there are limits. The hard part in dealing with aviation radio systems is that there are multiple agencies with some overlapping regulatory authority.
As bogl points out, the ITU is the international forum for radio spectrum. The NTIA is the US agency that is the US representative to the ITU. The NTIA has general oversight of radio spectrum. Actual management of radio spectrum is delegated to various government organizations.
The FCC is the primary US manager of spectrum, but not the only one. The FAA and the military both have significant pieces of spectrum that they manage. For the FAA, these include the aeronautical radio navigation bands and the aeronautical radio communication bands. The VOR/ILS are within the VHF radio-navigation band of 108.00 to 117.95 MHz.
The FAA controls transmitting of navigation signals. They do allow for low power transmissions for the purpose of testing avionics. But you just can't build your own transmitter unless you're willing to go through a ridiculously lengthy approval process that includes both the FAA and the FCC. The FCC is involved because any transmitter has to comply with Part 15 for non-interference.
So, if you are using an approved piece test equipment you can use it for short periods of time to test avionics. The use of nav/comm ramp testers such as the IFR-4000 is quite common.
Comment: The NTIA is responsible for the [Federal government's](http://www.arrl.org/the-other-fcc-the-ntia) (including DoD, FAA, etc) use of the radio spectrum. The FCC is responsible for everybody else. Both work with the ITU with regards to their specific interests, but given the ITU is part of the UN, the ultimate representative is the [State Department](https://www.ntia.doc.gov/legacy/osmhome/wrc99pre/process.html).


WPF tooltip virtualization

Question: Is there any way to virtualize tooltip in WPF? I have many dataitems displayed on map. When i'm changing template, for example, it takes a lot of time to generate UI for tooltips that are invisible. Maybe wpf supports something for such cind of virtualization?
Thanks in advance.
Answer: The way in which I've done this before is to generate a tooltip that is very simple, with a container item as the root and a simple single textblock inside, and then hook into the loaded event on the textblock, to detect when the tooltip is trying to be shown.
At that point, I then generate the full tooptip on the fly and replace the contents of the container, removing the textblock placeholder in the process.

WPF tooltip virtualization


What is the protocol for adding a new module dependency to a module that has only had a dev release?

Question: I created a module a while ago and it has only had a 7.x-1.x-dev release on Drupal.org for the last month or so. There are a number of reported downloads and installs already for this module so I want to make sure that the handful of users that already are using this module are still considered in the next dev release I need to make. The new release will have a new module dependency that is from another project (i.e. not included as a submodule of mine). While I would normally create a 2.x version if the module had a stable release, it has only been in dev. Do I just go ahead and add the new dependency in the 1.x-dev or create a 2.x-dev?
Comment: create a doc for upgrade
Comment: I already plan to use the changelog and upgrade doc to make note of this. This is not the issue. As one would hope users would read this info before updating, many do not. The module is in dev, so therefore people should expect that it will break their site, but I want to make sure there is protocol for this before proceeding.
Answer: There's no sanctioned protocol for such a case. All I think of is to minimize the impact.
Consider that even if you create a new branch, users may update and neither realize there's a new dependency, and your module may end up silently disabled because of unmet dependencies. This happened to the update of views from 6.x-2.x to 6.x-3.x where a dependency on ctools was added. In that case, the impact was low because ctools usually is present.
On documentation, in addition to changelog or upgrade doc in the project page, I suggest to add it to the release notes. Since they can be read easily when updating with drush.
Last, if the dependency you're introducing is a popular module, you can alleviate the impact by enabling the new dependency in hook_update_N or raising an error if not available. Here's some untested code:
<?php
function MODULENAME_update_7001() {
  $enabled = module_enable(array('foo', 'bar'));
  if (!$enabled) {
    throw new DrupalUpdateException('foo required.');
  }
}

Answer: Apart from what @jonhattan has mentioned, I would suggest one more method to do it.
Add those dependency in the mymodule.info file. Lets assume you want to add new dependency to link, email and addressfield.
dependencies[] = link
dependencies[] = email
dependencies[] = addressfield

Now in hook_requirments try to enable the modules automatically if present. Please note that since we have added dependencies in info file, those would be enabled if its a first time install. But otherwise they would appear "locked". In this case we would have to enable them automatically. Now as @jonhattan have answered you could try to do it in hook_update_N and throw an exception when it fails.
But the problem with the above method is the user experience. You cannot output "links" in the exception message. Another is it could be easily be avoided by letting the user know right before an update is attempted. For such case we have hook_requirements.
I will provide an example how to use hook_requirements for the example case i have mentioned.
/**
 * Implements hook_requirements.
 */
function mymodule_requirements($phase) {
  $requirements = array();
  if ($phase == 'update') {
    $enabled = module_enable(array('link', 'email', 'addressfield'));
    if( !$enabled ) {
      $t = get_t();
      $requirements['mymodule_migrate'] = array(
        'title' => $t('Mymodule Migrate Issues'),
        'value' => $t('One or more of the required modules cannot be enabled.
          If you download the modules from Drupal.org those would be enabled automatically when update script is run.
          So Please make sure following modules are present: !link, !email & !addressfield',
          array(
            '!link' => l('link', 'https://drupal.org/project/link'),
            '!email' => l('email', 'https://drupal.org/project/email'),
            '!addressfield' => l('addressfield', 'https://drupal.org/project/addressfield'),
          )
        ),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}

Now it is also possible to try to enable each module individually and craft the message properly so that only those modules that are absent are shown in the message.


Best library java to write dxf file

Question: I am looking for the best library to write a dxf file in java
Before trying to convert png image to dxf but I can't, so now I want to write the image directly
My need is a library that can draw lines and rotate them at an angle.
Answer: You could try jdxf: https://jsevy.com/wordpress/index.php/java-and-android/jdxf-java-dxf-library/
You use standard AWT Graphics drawing commands on an instance of the DXFGraphics subclass just as you do for regular Graphics drawing. DXFGraphics generates a DXF file corresponding to the drawing operations. There's example code at the link above.

Best library java to write dxf file


Yet another Community Wiki oddity

Question: https://superuser.com/questions/16972/what-single-piece-of-software-do-you-most-admire-and-why/16990#16990
If my math is correct, (and I hope it is), if there are 3 people, each with one revision, then (1 / 3) * 100 = 33.333...%, not 36%. I guess it's not a huge problem, but a bug nonetheless.
Answer: There's a style to how you should interpret the numbers on a community wiki post.
Our example:

3 revs, 2 users 36%
  T Pops

There have been three revisions to the post.
Of those, they were made by two users in total (the first user in this case is excluded, having been deleted).
Of those, 36% of the bulk of editing/revisions has been done by the user T Pops.
Comment: +1 - It's based on the quantity of changes (characters added/deleted) and not how many edits there have been, I think is what @random is saying
Comment: Ah, so it's the *estimated* contribution, not the number of edits.

Yet another Community Wiki oddity


Can I recycle plastics at home by melting and molding?

Question: I would like to know if it is possible to recycle plastic at home by melting and molding.
Is it at all possible? What technique or technology do I need? Can it be done with any plastic? Are there health hazards associated to this activity?
Comment: _Are there health hazards associated to this activity?_ -->Inhalation of toxic fumes comes to mind. Other than that, you're probably golden.
Comment: @elssar: is it true of all plastics? Are fumes systematically present during melting?
Comment: [This idea](http://www.youtube.com/watch?v=qGGabrorRS8) of converting plastic into oil is also quite cool. If you're going to use oil anyway, you might as well use it and get rid of a big pile of plastic at the same time...
Comment: I think so, yes. All plastics will produce some toxic fumes when melted/burned, some more than others. But googling around, it seems that it isn't as bad as I first thought.
Comment: [This may be what you are looking for. Its not melting and remolding so much as joining & fusing. Its called "Plastic Welding".](http://www.youtube.com/watch?v=HvV9a3lEe2g)
Comment: Wow this would be neat to do if all hazards were removed. One thing that I do to with some plastics, you can reuse or repurpose them for another function in life. For example the slats http://i.stack.imgur.com/uX9vV.jpg of a miniblind can be made into markers for the garden. With some thought many things are reusable and are sure to reduce one carbon foot print. See my plant name tag in the photo.
Comment: @JimBo as this is a question & answer site, rather than a discussion forum, answers really do need to address the exact question asked. In this case I've converted your answer to a comment. This is likely to happen to several of your other answers as well. Please do check that you're answering the question as asked, rather than discussing the question or another answer.
Answer:
I would like to know if it is possible to recycle plastic at home by melting and molding.

Yes it is possible. One guy makes chairs out of melted plastic. There are several guides on melting plastic that show up when you search google for it. This one, on ehow shows how to melt plastic in a toaster oven. Basically, wash the bottles, cut 'em into small manageable chunks and pop them in a metal container and into the oven at 350F. It should take a few minutes for the plastic to melt.
As for molding them, I found a few guides -

Molding plastics at home
How to produce small plastic parts at home
A list of molding projects on a crafts site

But remember, melting plastics will produce fumes which can be harmful if inhaled. Make sure to melt them in a well ventilated area. And if you're doing it in a room, it would be nice to have an exhaust fan in there. Also, check out this guide on what the different rating numbers on the bottom of plastic bottles mean, specifically, what kinds of plastic a number refers to and whether or not it is safe to melt that plastic.
Comment: Are the fumes only toxic for health? I "thought" they were very polluting as well.
Comment: This also does not address whether All types of plastics can be melted safely or what kinds of plastics are worth melting.
Answer: To contribute to the options offered by Elssar's answer, here is an interesting thing I read about just a few days ago:
Filabot is a project of compact 3D printer that directly recycles plastic objects at home to create new shapes. It was launched for funding on the 19th of December 2011 on Kickstarter and tripled its goal by the 23rd of January 2012.
Here is the homepage of the project: http://filabot.com/
They apparently shipped the devices to at least some of the project backers during 2013.
Answer: Even when melted/burned in a place with lots of ventilation, plastics can produce many toxic chemicals. These are then breathed in or attach themselves to soil, where they can stay for years and years. Therefore, I really wouldn't suggest trying to reuse plastics at home by melting or heating them, as the health implications can be really dangerous and damaging in the long run.
Comment: Is this true for all types of plastic? Are you able to provide a link to some more information about this? Thanks!
Comment: @HighlyIrregular It certainly depends on the plastic, but for example fumes from ABS are highly iritating to eyes etc. This, I know from experience with 3D printing.
Comment: Why are those impurities in plastics in the first place then? or on the other hand, what use is the plastic after these impurities have been released?
Answer: It depends on the plastic you're using. Plastics often come in the thermoplastic and thermosetting categories.
If the plastic is a thermosetting plastic then it is not able to melted (Most, if not all thermosetting plastics burn rather than melt).
However, a thermoplastic plastic can be melted and remoulded as much as you want (quality of plastic is likely to degrade after each phase melting and remoulding however).
Comment: What about melting plastic anaerobically to avoid burning?
Answer: Depending on the type of reshaping you are interested in, you can do basic crafts with the right kind of plastic by simply using a hairblower to heat them up and bending them into shape.


Risk involved with using PPA from old release?

Question: I have some PPA's in my update sources that don't maintain active builds for oneiric. Is it safe to continue receiving updates from these PPA's using builds for prior releases like Natty or Maverick? Thanks.
Comment: we can perhaps give you a better answer if you list the PPAs in your question.
Comment: If a PPA has no Oneiric, you most likely not receive any updates from it. PPAs usually have different packages for different releases.
Answer: In general installing a package from a different distribution isn't recommended as explained in the pinning how to wiki page.
However, you can still try to:

Fetch the source package
Generate the binary packages in your machine
Install them using dpkg -i.

If your sources are correctly configured this this can be done with:
$ apt-get source --compile <source_package>
$ dpkg -i <binary_packages>

All this is explained in the recommended alternative to pinning section in the how to. Please note, that the assumption of the how to is that you try to install packages from a new distribution in an old one, not the other way around; but I think most of the contents there is still valid to your case.
Finally, for some particular cases, like applications that don't try to modify your system, written in an interpreted language, then probably you're safe to install the software directly from the PPA.


Word for the way a leaf falls

Question: What is a single word that describes the back and forth way a leaf falls to the ground? I don't think float or flutter quite capture the movement. Does 'sway' or 'oscillate' convey the image?
Comment: *Flutter* is good enough for Wodehouse, among others "On the terrace in front of the club-house an occasional withered leaf fluttered down on the table where the Oldest Member sat" Why don't you like *float* or *flutter*?
Comment: You might need to add a modifier to flutter, for example..."the leaf fluttered down, twisting this way and that in its lazy descent."
Comment: @Roger   I think you will find that 'fluttering' is a common word for light objects falling irregularly.  Here is the Learner's Dictionary:  https://mobile-dictionary.reverso.net/english-cobuild/flutter%20to%20the%20ground.
Comment: Note that this [Lexico definition](https://www.lexico.com/en/definition/flutter) specifically gives this definition and example: *Move or fall with a light irregular or trembling motion. **the remaining petals fluttered to the ground.***
Comment: Hi Andrew. Thanks. Float suggests being pushed up or held aloft, as a cork by water. Fluttering is flapping, such as a butterfly fluttering on summer's breeze. Sway gives the image of back and forth motion, but doesn't convey descent. There might not be a single word, but I was hoping for one to use as a category.
Comment: I appreciate that, Jim. I've also checked out the use of 'flutter' on poetry.net and, while flutter and sway are adequate, I was hoping for something that conveyed descent.
Comment: Dwindle? Twirling? Swirling?
Answer: I have often found myself in situations where I've felt the dire need of a word that describes this leaf-like motion. The words sway and oscillate are synonymous to words which describe a motion which can be predefined, or carries itself in a steady, predictive way.
A typical example of sway that many poets use is for branches, which sway back and forth with the wind, with [almost] definitive movements, which isn't the case of falling leaves.
And an epitome of oscillation can be found in an ECG. But the movement in an oscillation has sharp, jagged corners, which is unlike the smooth descension that a leaf would take.
That leaves me to expound one word that I think limns the movement the most accurately out of the other two: waver. It is synonymous to sway, but also satisfies the element of how unsteady the movement can be.

2a : to weave or sway unsteadily to and fro : REEL, TOTTER
b : QUIVER, FLICKER
//wavering flames
Comment: So you would advise writing something such as *The leaf wavered to the ground.* ?  Methinks not.
Comment: @HighPerformanceMark If 'flutter' can be used, whose usage is common with the way butterflies move (in ascension), why can't 'waver'?

Word for the way a leaf falls


Trouble trying to implement Gazebo's plowing model

Question: I am currently working on my thesis which is focused on the mobility systems of 4 wheeled and 6 wheeled rovers, with a focus on the wheel-ground interaction. Because of this I really wanted to find a way to reproduce the deformability of the terrain on Gazebo (classic). I'm currently using the LeoRover Gazebo simulations having installed Gazebo through ROS (noetic). I really wanted to add to this simulation the wheel plowing modifications I found here https://github.com/gazebosim/gazebo-classic/pull/3164, but I really can't get it working. I've downloaded Gazebo-classic on github and tried to start the .world tests for the plowing, they start up just fine (after adding the models to my ros gazebo model directory) but I do not notice any difference between the two tricycles. I'm not sure why that is happening, I believe that maybe the Gazebo I originally installed through ROS interferes with the simulation, I tried to compare the two gazebos and they have very different structures, the gazebo directory I dowloaded from github has .cc and CMakeLists files that the other doesn't have. I was only able to add the models and change the Collision.hh file. As you may notice I'm not really sure what I'm doing, any help at all would be immensely appreciated.
Comment: Are you using Gazebo Classic or Gazebo Sim (Ignition / 'new Gazebo')?
Answer: The plowing effect is currently only supported in gazebo-classic starting with version 11.12; it is not yet supported in gz-sim. Can you confirm that the version of gazebo you are using is at or newer than 11.12, either through running gazebo --version or confirming the version number in your package manager?
I would use the following to run the example world:
# from root of gazebo-classic source tree
export GAZEBO_MODEL_PATH=$PWD/test/models:$GAZEBO_MODEL_PATH
gazebo --verbose test/worlds/plowing_effect_tricycle_demo.world -u

This should start the simulation in a paused state. Once the world is loaded, click View -> Contacts and View -> Transparent from the gzclient window in order to see the contact point and normal directions. If you zoom in on the plowing_effect_trisphere_cycle, you should see the contact normal directions incline slightly after unpausing the simulation.
Comment: I noticed I was using Gazebo 11.11.0 so I tried to do sudo apt upgrade gazebo11, and it started updating, though at the end it said gazebo11 is already the newest version (11.11.0-1~focal). Could it be a compatoibility issue with my ubuntu version (Ubuntu 20.04.6)?
Comment: I managed to install Ubuntu 14.0.0 and through trial and error now the two tricycles have very different velocities! Thank you so much
Comment: On Ubuntu 20.04, you can try following the installation instructions that add packages.osrfoundation.org as an apt source: https://classic.gazebosim.org/tutorials?tut=install_ubuntu&cat=install


Filter high pitched sounds in real time on Linux

Question: I want to filter high pitched sounds in real time on Linux. So for example when watching a movie, if there is a big old TV or something and it has a high frequency sound that makes the ears ring, I would like to filter only those high frequencies if possible.
Answer: What you want is technically called a low-pass filter.
You can tell MPV (arguably the most efficient and best quality media player for linux) to apply a low-pass filter like this:
<code>mpv --af=lowpass=f=3200 Titanic.mp4
</code>
Alternatively you can configure Pulseaudio (an audio layer coomonly used on linux desktops) to apply a LADSPA low-pass filter to all audio.  This is described in detail here for Debian-based systems.
Comment: This is good enough, although I was thinking of something system wide.
Comment: I suggest you update the question to clarify that you prefer system-wide solutions.  Also helpful if you mention more detailed what you mean by "system-wide" - i.e. do your perception of "system" include _all_ access to audio then you will prefer a filter for ALSA, if only common desktop-oriented access to audio then Pulseaudio filtering is more suitable - or perhaps you will be interest in modern desktop audio via Pipewire...


Can a GFCI be used as a disconnect?

Question: New garage; the garage door lights go on every time you cross the beam, the outlets that power up the garage door lights are GFCI protected. Can I use the test button as a disconnect during the daytime hours on a daily basis?
Comment: Are they labeled "TEST/RESET" or "ON/OFF"?  Is this a breaker, deadfront, or receptacle type GFCI?
Comment: As a disconnect or a way to turn power off to the opener? Just to turn the power off it would work If a true disconnect is needed the GFCI would need to be listed for that what is the brand model?
Comment: This is a TEST/RESET receptacle type GFCI, I believe Leviton may sell a  type of GFCI  receptacle that has a switch incorporated in the upper part of it. It has to be 20 amp. I believe everything in a garage is suppose to be GFCI protected. Does a GFCI receptacle protect a light if it does not have a ground wire?
Answer: A GFCI needs to be labeled as a disconnecting means to be used as one
A normal receptacle or deadfront GFCI is not labeled or listed for disconnecting use -- it won't kill you for abusing it that way, but it could lead to some premature wear on the GFCI's contacts, shortening its lifespan.
There are deadfront GFCIs that are listed and labeled for this task, but they are uncommon, and will have "ON" and "OFF" labeled on/near the buttons in addition to "RESET" and "TEST", as depicted below:

GFCI breakers are a different story though
However, a breaker-type GFCI is also a perfectly cromulent circuit breaker, and thus is considered a disconnecting means under the NEC even if it is not listed/labeled for SWD (Switching Duty) service.  (I know of no circumstance under the NEC where an appropriately rated circuit breaker, whether SWD listed/labeled or not, is not a legal disconnecting means.)
Answer: Yes, if the GFCI is designed for that use, and listed for that use.  I was forced to amend this answer when I discovered one that actually was!

Can a GFCI be used as a disconnect?