How to get the "no man left behind" achievement

Question: Just did the Act III quest with the catapults, all recruits stayed alive, but didn't get the achievment. What is needed to get it?
Answer: I did this on Nightmare with a Monk, and one thing that I noticed was that I didn't get the achievement until after I'd raised the third catapult, even though there's no recruits that can get killed past the second catapult raising.
The recruits can also be killed before they start to raise the catapults, so it's possible they died offscreen before getting to the winches.  It's also rather hectic during the mission, so it's possible you missed someone dying in all the unrelated slaughter.
Once the recruits have finished raising the catapult, they'll follow you around for a while.  It doesn't matter if they die past this point.  They've got crazy health though, compared to how easy they go down during the event.  I once watched one tank an arcane enchanted plagued champion pack for longer than my Templar...
Since you're likely to have to attempt this again, I'll give some general pointers:

Before talking to the NPCs near each catapult, completely clear the area and scout a short ways ahead, in order to avoid missing any enemies that spawn before the event starts.  A couple of times, especially at the second catapult, I've come across an elite or champion pack that tends to get pulled into the fray.  This can really ruin your chances.
Make sure you maintain aggro - hit new enemies, and don't remove yourself from play by using skills like Spirit Walk, for instance.
Bring as many pets, followers, or other players as possible.  It's really a matter of distracting the enemies - they will only tend to hit the soldiers when there's no other target.
I found it easiest as a melee class to stand near the recruit on the middle winch - this gives you flexibility to aggro incoming enemies from either of the two sides.

Clearly, being able to do significant damage quickly makes this easier, so dropping the difficulty and getting good DPS weapons is a plus.
At the second catapult raising, try to kill the monster spawners that are in the lower right of the screen quickly, as they tend to appear and drop enemies a few seconds before the ones in the upper right.  I found that frequently I could take them out before they even spawned a single wave of enemies.
Don't abandon your post at the middle winch to take out the other two until the catapult is raised, however.  Prioritizing these spawners when there's active monsters about is a sure way to lose.
Comment: This is obvious but also try to aggro new spawns so they go after you instead, throw a few orbs/punches/arrows on them esp. if they're near the recruits. I actually got this achievement w/o knowing what it was, kept thinking it was to save the guys who are dying in the middle of the battlefield.
Comment: I did all that, all 6 recruits survived the waves. Do the recruits also need to survive after the catapult is raised and they go around the wall looking for fights? Because after the catapult was in place, the recruits from the 1st catapult wandered off into a bunch of very angry fallens.
Comment: @IlyaMelamed, no, I don't believe so.  The recruits will run off and get slaughtered regardless.  I think it only counts their deaths if it happens when the catapult is still being raised.
Answer: I did this one with my Demon Hunter without even trying, mostly through the use of Caltrops with the Jagged Spikes rune.  I placed my Caltrops in the places where monsters were going to spawn before I started the event, then quickly started it before the durations ran out.  On the second catapult, this killed all four of the big Hell Bearer demons before they spawned any demon troopers, which made that event just an exercise in waiting.


Chord naming: "seventh flat ninth *piano* chord"

Question: Page 164 of Pilhofer and Day, Music Theory for Dummies, 3rd Edition, John Wiley & Sons, Inc., 2015 describes a "seventh flat ninth piano chord". Why is the name of an instrument, "piano", part of the name of the chord? I do not see any name of an instrument in the name of any other chord in the book. Does it mean the chord is particularly well suited for the piano? The book also later refers to it as just the "seventh flat ninth chord".
Comment: Is it by any chance referring to a particular piece, and that particular chord is played at a  piano dynamic level?
Comment: Just a wild assumption here, but maybe it's because the book isn't very good. (I have the German translation, which is based on the 2nd edition, and tried to check how they translated that bit. Seems like they didn't, the entire section is missing, so I assume it was added for the 3rd edition.)
Comment: a piano is a keyboard and the image of the pattern 135b7b9 is very plausible not only for dummies (there aren't many other instruments apart the guitar and keyboards like the church organ that are able to play b7b9 chords - as far as I know ;)
Comment: Maybe the writer prefers to play this chord *quietly*..?
Comment: @Richard No the relevant pages do not refer to any particular piece of music.
Comment: @AlbrechtHügli Is this chord in particular only suited for keyboards among all chords? The book, in the surrounding pages, discusses a wide range of chords, but none of the rest is named after an instrument. Are there other chords that are also mainly only suited for keyboards (or certain subset of instruments)? If yes, how come they are not named after an instrument?
Comment: @Tim Huh, didn't think of it that way. But I feel it would be weird for authors to inject their personal preference in performing music into the generic definition of a chord in an introduction to music theory.
Answer:
...or take a C7 chord and add a diminished ninth to it...

A diminished ninth is actually enharmonically equal to an octave. So adding a diminished ninth actually just results in the same chord C7.
Obviously they mean add a minor ninth to a dominant seventh chord. You can call that a dominant seventh, flat nine chord and it gets the symbol 7♭9.
The word "piano" in the heading just means to play it on piano. You can play a 7♭9 chord on any chord instrument or ensemble, so this type of chord isn't particular to the piano. (The book may present particular piano voicings of the chords.)
For what it's work there is a diminished ninth chord. It would be a fully diminished seventh chord with an added major ninth. Rooted on C is would be C E♭ G♭ B D labeled Co9.

...when you take the first ...of the major scale...

The "first" of a scale? That's called the tonic. More importantly when talking about chord intervals you general refer to a root, especially when the context is generic like this defining of a single chord type. If you describe chords built on specific scale degrees, I would expect there to be some harmonic context with other chords or some concern about the chord within a key.
Personally, I would get a different book. This level of sloppy terminology in a published book is not acceptable.
Comment: Kostka/Payne, Tonal Harmony is well known.
Comment: 'The word "piano" in the heading just means to play it on piano. You can play a 7♭9 chord on any chord instrument or ensemble, so this type of chord isn't particular to the piano.' Then why is only this chord named after an instrument, the piano, but not any other chord (in the book) (which presumably can generally be played on a piano too)?
Comment: @FangJing, look at my last sentence. I suspect the book is not well written and you should get something better. Some "For Dummies..." books are good, at least as introductions. They are pragmatic over technically detailed. Your question is entire about how _this particular book is worded_. Get a music theory book for college students. Compare the wording.
Comment: I see. Yes that seems to be the case. Is there any that you have used and recommend?
Answer:
I was able to google the book (see the image), but this doesn't help me to understand it. Perhaps it's a mistake, or they refer to the X7b9 chord symbol?
Anyway, it X7b9 is a popular chord that can be played basically on any instrument capable of playing chords. Also the chord symbol is universal, nothing specific to piano about it.
Later in the book (Appendix B) they refer to "piano chords" as to diagrams on keyboard. Interestingly, in the pages I was able to access at books.google I couldn't find an example of X7b9 chord.
The chord consists of major third, perfect fifth (frequently omitted), minor seventh and minor ninth. For example C7b9 is: C-E-G-Bb-Db. If you omit the root of the chord (note C) what is left is a diminished seventh chord, frequently used as a substitute.
Answer: It is a poorly written passage. Some texts will take care to suggest specific voicings (different arrangements of notes in any given chord) for keyboard textures because realizing harmony on a keyboard has been such a big part of learning music. The other texture and usually the primary one harmony texts address is choral, but then one person cannot play the harmonies by themselves. Get a better book.
Answer: Interesting! you mention a flat ninth and the image copied by user 1079505 shows a diminished ninth: This is really confusing in a book for dummies! ;)
But to me this case  is absolutely clear that they mean if you "diminish" a major ninth adding a flat you get a minor 7th.
Now, this is not your problem.

Then why is only this chord named after an instrument, the piano, but not any other chord (in the book) (which presumably can generally be played on a piano too.

You ask why they mention here a piano chord. All chords are piano chords or guitar chords and as an other answer says it can be played on any other string instrument or keyboard. So the word piano is fully obsolet and we are happy that we have not other problems with theory and practice.
I just think a dummie won't struggle about this note. :)


Installing 2.77 for LInux

Question: I just download the 2.77 tarball for Linux but I don't see a way to install the program. I can navigate to the extracted directory and run Blender via ./blender or ./blender-softwaregl but I don't see an install script. Am I missing something?
Comment: You needn't install it. Just run it from where you extracted it. If you want to run it by typing `blender` from anywhere, include the directory in the `PATH` environment variable.
Answer: No, you don't miss anything. The tarball for Linux as well as the zipped version for Windows has no installation routine whatsoever. Extract the archive to whatever directory you like, create a link and you're set. If it runs fine, there are no drawbacks besides of manual updates.
I started using the tarball version years ago after running into downgrades during system updates quite frequently. I always extract it into /home/username/bin/ and also create my link in /home/username/bin/
Alternatively you can use /usr/local/bin/ which would be the correct directory for packages that aren't managed by the system's package manager.
If you want to use an installed version, search the repo of your Linux Distribution.
Comment: Thanks for your help. I ended using the To install blender from PPA: option found here http://tipsonubuntu.com/2015/04/03/install-blender-2-74-ubuntu-14-04linux-mint-17/
but I will remember you advice and I might just start trying to go that route. I prefer not to add unknowns to my repositories.
Comment: You're welcome. Sometimes certain packages are just easier to manage outside of the Distribution's repo lists. I use openSUSE and while things got a lot better there, I feel much safer now to have more control over my main working tools.
Comment: @user344658 I'd go with `/usr/local`, as any `bin` should be reserved for actual executables. Coming from multiuser environments, I tend to avoid `/home` for these things. Whether you symlink the blender executable to `/usr/local/bin` or append to the `PATH` variable, as I suggested, is merely a matter of taste.

Installing 2.77 for LInux


Queries are performing bad after SQL Server 2008 SP4 upgrade

Question: We had SQL Server 2008 SP2 and Microsoft told us to upgrade it to SP4 if we wanted any support from them. Now that Microsoft has warned us, my path to go to SQL Server 2016 SP1 is clear. Going back to my question, I upgraded our production servers on Saturday to SQL Server 2008 SP4. But stored procedures which were performing fast (this is a relative term) are running way too slow on Monday. I don't see any blocking. Users are not Memory pressure seems normal. I see Available as well as Free Memory when I open task manager. CPU is a bit high. But not pegged at 100%. My guess is, plan cache was flushed after rebooting servers post upgrade and queries are taking hit today. All index maintenance jobs were successful prior to upgrade. Should I have run full index maintenance after the upgrade? I ran DBCC CHECKDB after upgrade and it was clear. Replications are in sync. Modified Stats are updated daily. Let me know if you need any more information. Any insight will be a great help. Thank you.
Comment: Did you updated the stats with full scan after the upgrade for all the databases. So when it is slow did you checked the actual query plan and tried finding out what is possible cause
Comment: Sounds like you've started to look at all the basics. That said, there isn't a lot of detail to go on. Any chance you have a performance baseline to compare the current "bad" status to a known "good" status? You might try to zero in on your slowest, most painful query and try to identify it's bottlenecks, and hope that it leads to am more general solution.
Comment: We have a table called ProcessingLog that logs time it took for each important part of the stored procedure to complete. The only variable in the equation is, SP4 upgrade and reboot. There may be parameter sniffing going on. @Shanky I use Ola's code suggested by Brent Ozar to update only modified stats. https://www.brentozar.com/archive/2016/04/updating-statistics-ola-hallengrens-scripts/
Answer: We opened a support ticket with Microsoft and they gave us a tool to run to gather metrics when issue was in progress. I couldn't run the tool during business hours since I didn't want it cause problems for working processes. Then in the evening, update statistics job ran for almost twice long than before. Probably that produced better query plans for queries running on next morning i.e. on Tuesday. It was way better than Monday. I observed the performance today. It's back to normal. I didn't have to use Microsoft tool at all. Go figure! Thank you.


Lead bullet vs a Rubber bullet?

Question: Our teacher says that rubber bullet is more effective than a lead bullet for knocking down a bear/human/whatever. He says that change in momentum for rubber bullet is greater than that for lead bullet. So more force is exerted by rubber bullet. But I don't get him and I don't think he is right too. Can you get this straight for me?
Comment: Think about the difference in the two collisions. Which one transfers more momentum to the human?
Comment: Something rebounding transfers, by conservation of momentum, *more* momentum than something that is simply stopped.
Comment: I am trying to get what you are saying, point me out if I am wrong,  in ideal case, lead bullet transfers large amount of momentum to the target but in case pf rubber one, the rubber bullet just bounces back with same velocity, i.e. no momentum is tranferred?
Comment: HOw??????It's a bit confusing
Comment: Ok I got it anyway
Comment: Totally depends on what you're wearing. A lead bullet would impart far more momentum toward knocking someone over than a rubber bullet, iff....they're wearing something akin to kevlar or whatnot.
Answer: Your target may not stop a very dense, compact bullet: It may exit, departing with some (possibly large) fraction of its initial momentum. If your bullet does not penetrate a target as well, as a less dense rubber bullet might (depening on circumstances including its speed and properties of the target), it might be stopped completely (either stuck in the target or dropping down in front of it), or even recoil after impact. Then its entire momentum (and in case of a recoil even more than that) will be transferred onto the target. This may be what your teacher is trying to get at.
Note that this argument may not be very relevant in practice: The penetrating bullet will injure or kill with greater likelihood and in that sense impart more stopping power. It is also likely to be fired with more kinetic energy, have a higher mass, and possibly carry a lot more momentum than a rubber bullet likely designed to be "less lethal," the primary reason to use these otherwise less effective (less damaging) bullets in the first place.
Answer: First, momentum $p$ is conserved in the system during a collision:
$$\sum p_{before} =\sum p_{after} $$
So, the lost momentum of the bullet must be transfered to the body (since there is nothing else to absorb it).
Second, force is the change of momentum over time (Newton's 2nd law):
$$F=\frac{\Delta p}{\Delta t}$$
So, the larger the moment transfer (the larger the change in momentum), the bigger the force.
And remember how momentum is calculated:
$$p=mv$$
Now, let's consider the two bullets:

Lead: It penetrates, so it looses some speed and continues with less speed. It goes from a start speed $v_1$ to a smaller speed after impact, $v_2$. Momentum change is $$\Delta p=p_2-p_1=mv_2-mv_1=m(v_2-v_1)$$
Rubber: It bounces back, so it looses all it's forward speed and gains backwards speed to move backwards. The start speed is still $v_1$ but the final speed is negative (in the opposite direction), $-v_2$. Momentum change is $$\Delta p=p_2-p_1=m(-v_2)-mv_1=m(-v_2-v_1)=-m(v_2+v_1)$$

Now which momentum change $\Delta p$ was bigger (disregard the sign, because we don't care about the direction)? The rubber bullet's! It had it's speed changed from positive to negative, which (since they had same start speed) must be more than a speed change from positive to just less positive.
Sorry @Saad, your teacher was right.

You might object, though, and claim that the rubber bullet must exert less force since it doesn't penetrate, while the lead bullet does.
But remember then, that penetration is not about force, but pressure.

If I slap you with my hand, you might get a blue mark, but if I slap you with a nail in my hand with the same force, the nail will go through and penetrate.

In the same way, the rubber bullets might indeed hit harder, but they are usually rounded and deforms elastically at impact so that the contact area is much larger. The pressure, which is force per area, is then still smaller and tolerable of the skin.
The lead bullet with the sharp pointing nose, hits with its whole force at this tiny area at the nose tip, like a needle picking straight through.

Lead bullet vs a Rubber bullet?


How to install CherryTree on Ubuntu 20.04 Focal Fossa?

Question: How do I install CherryTree, my favorite note taking app on Ubuntu 20.04? I tried to install from github, but none of the dependencies are available on Ubuntu 20.04
Comment: CherryTree is in the `Software` Store as a flatpak, and it works fine.
Comment: Here's how to install snap if `sudo apt install snapd` does not work: https://unix.stackexchange.com/questions/593366/how-to-enable-snaps-support-on-linux-mint-20
Answer: You can now install cherrytree without snap:
https://www.giuspen.com/cherrytree/#downl
sudo add-apt-repository ppa:giuspen/ppa    # add the repo
sudo apt update                            # update package lists
sudo apt install cherrytree                # install

Answer: As mentionned on the download page of the developper, there are currently no .deb packages available for Ubuntu. The developper recommends to use the snap or flatpak packages.
By far the easiest way to install is by snap. You will find Cherrytree in the Snap store, or you can install it with the command
snap install cherrytree

If you want to access removable media, connect to the removable-media interface:
snap connect cherrytree:removable-media

It is also available as a flatpak. Both snap and flatpak are at the time of writing the latest stable version. Flatpak is by default not enabled on Ubuntu. You can enable it on your system with a few commands.
Manually installing on Ubuntu 20.04 is not recommended for typical users: it requires to install Python 2, which is now deprecated.
Comment: Snap didn't work for me: `Package snapd is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or
is only available from another source`
Comment: CherryTree is in the `Software` Store as a flatpak, and it works fine.
Comment: Then your computer is malconfigured. I tested and it installs and runs fine. @heynnema only if you enabled flatpak on your system *and*, in 20.04, installed the regular software center instead of the snap store, *and* installed the gnome software plugin for flatpak .
Comment: @vanadium On my system, I have both `Software` store and `Snap Store`, and I can run snaps or flatpak apps. Not malconfigured. Configured to have more choices. The snap version of this app has some pretty bad reviews, while the flatpak reviews are pretty good. I'm running the flatpak version and it works fine :-)
Comment: @heynnema, the first part of my comment was not directed to you obviously ;) Comment of OP suggests that snap is not properly configured on his system.
Comment: @vanadium Ah, I misunderstood your comment. It's all good.
Answer: First you need Python 2 pip which was strangely missing:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python2 get-pip.py

More dependencies. Python gtk2-dev is available from this user's repository: https://askubuntu.com/a/1235347/951756
sudo add-apt-repository ppa:nrbrtx/python2-stuff
sudo apt update
sudo apt install git libenchant1c2a
pip install pyenchant
sudo apt install python2 python-gtk2-dev p7zip-full python-dbus python-chardet

The easiest way to get python-gtksourceview is the older ubuntu debs: https://packages.ubuntu.com/eoan/python-gtksourceview2
After all that, Hopefully you should be able to run cherrytree directly from the source code:
git clone https://github.com/giuspen/cherrytree
cherrytree/cherrytree

Comment: Python 2 is now EOL. Thanks for using my PPA. Also I have e-mailed to giuspen [who packaged](https://launchpad.net/~giuspen/+archive/ubuntu/ppa/+packages?field.name_filter=cherrytree&field.status_filter=published&field.series_filter=) CherryTree for previous Ubuntu versions.
Comment: @N0rbert  CherryTree is in the `Software` Store as a flatpak, and it works fine.
Comment: @heynnema, oh, right I see - [FlatPak and Snap](https://i.stack.imgur.com/JwIXN.png).
Comment: @N0rbert What is "App Outlet"?
Comment: @heynnema It is a [fresh project](https://app-outlet.github.io/). I have reviewed it [here](https://askubuntu.com/a/1248843/66509)


How to accurately quantify forecast uncertainty in a special case of robust linear regression?

Question: If I'm using OLS linear regression, and I want to know the uncertainty of my forecasts I can quantify it using residuals (MSE, median absolute deviation, etc). But if I'm using robust linear regression that down-weighs some observations as outliers and I don't have access to those weights, how can I accurately quantity the forecast uncertainty?
Answer: I don't think you will get reasonable results with the model you use.
Why?  There is no real way to distinguish between the uncertainty of the model and the error of the model, because it's not explicitly trained. Unless if you are absolutely sure that you are using the right model, you cannot tell whether your model is wrong or if the error corresponds to uncertainty.
(If you know that your model is right, that is of course different...)
Maybe you should resort to some method that models uncertainty. E.g. Gaussian processes or mixture density networks.
Another options is the following.
Robust linear regression (as I know it) gives you the maximum likelihood solution under the assumption that your targets are distributed according to a Laplace distribution with constant scale for each sample $(x_i, z_i)$:
$$argmin_W \prod_i \frac{1}{2}\exp (|z_i - Wx_i|)$$
Why don't you attempt to regress on that scale as well?
$$argmin_{W,W'} \prod_i \frac{1}{2W'x_i}\exp (\frac{|z_i - Wx_i|}{W'x_i})$$
Procedure should be straightforward: take the log, take the derivative, use an optimizer to find a minimu. Make sure that the scale has to be positive, so maybe you want to use $\exp(W'x_i)$ as a model instead.
Answer: Why not just take the loss function used in robust linear regression, and plug in your forecasts with the corresponding actuals for a hold-out sample? (where "forecasts" are calculated using backtesting for that hold-out sample).
For example, if Huber loss function is used in the regression then just use that functional form to calculate average value of the loss function on a hold-out sample.


Car just started blowing cold air

Question: I have a 2010 ford fusion. After letting the car heat up, I went to the store and the heat was working fine. I get back home while parking I noticed the car was blowing cold air. I cut it off and then back on and the same thing; it didn't get hot again. It was fine last night and a few minutes ago. What could of happen that quick? Since I tried cutting it off and letting it get cold again, then warming it up, I still get the same results. The heat is blowing cold. Any ideas on what I could do?
Comment: I had a similar problem with my Ford, and was told it was just the ECU detecting a fault and choosing to shut off the system. I was told there are many things that can trigger the ECU doing that and the price quoted to investigate was more than I was willing to pay, so I just ignored it. It was an old car and I gave it to the wreckers soon after.
Answer: There are two possibilities here as I see it. First, it could be that the thermostat is bad and stuck in the closed position, not allowing hot coolant to flow into heater core. You could easily check to see if this happening by first finding the heater hoses which route from the engine through the firewall of the engine compartment. With the engine warmed up, check both hoses to see how warm they are. If they are not very warm, this is probably your problem. If both are very warm, the blend door which routes the air through the heater core inside of you cabin is probably stuck in the "cold" position. You'd have to tear the underside of the dash apart to get to this.
Comment: Because the OP doesn't complain that the engine's overheating, the cause is not the thermostat sticking closed. This is either inconsistent flows through a clogged heater matrix, or a blend door problem. The latter IMO is more likely.

Car just started blowing cold air


Should I tune my piano?

Question: I bought a new piano today and now have it at my home. Obviously it's out of tune. Should I attempt to tune it myself? I have watched a video on how to tune pianos and it seems pretty easy, but atill not certain. And if I can tune it myself, how often should I tune it?
Comment: Everything I know about piano tuning leads me to think it's actually extremely difficult. Yeah you can just turn the keys to change the pitches but it's not easy to get the right pitches.
Comment: Depends.  I tune pianos occasionally, but for myself and friends- it's hard to do well and you can get into trouble easily, as the answers below indicate.  On the other hand, if you are careful, patient, have lots of time, and are willing to risk it, it can be interesting.  But a professional will do a better job.
Comment: If I were you, I'd look for a pro to do it. Not sure where you live, but in Los Angeles, there are some really talented folks who can make it sound awesome for a reasonable cost.
Answer: If "new piano" you really means a brand new piano, the dealer should have checked it over and tuned it, either at the dealership or your house depending on the how the effects of transportation and differences in climate might  affect the tuning, and other mechanical aspects of the piano action. In some situations it could be better to wait a few weeks till the piano has acclimatized itself to the new conditions, otherwise the tuning and regulating might have to be done twice.
If it's a "pre-owned" piano, be aware that (1) learning to tune a piano "from zero" may leave you with a piano that is unplayably out-of-tune for several weeks while you are learning, and (2) it is easy to do long term irreversible damage to the wrest plank that holds the tuning pins if you "do it wrong".
Problems like accidentally breaking strings (it's easy for beginners to get confused and keep turning the wrong tuning peg, while imagining that the pitch of a different note is changing) are not "irrersible damage," but of course if you do that, you then have the delay of getting the correct replacement parts and learning how to fit them correctly. Repairs like that may need some special tools, since ordinary household pliers and wire-cutters probably won't handle piano wire, not to mention the risk of sticking the cut end of a wire (which can be as sharp as a razor blade) into your finger, or worse, in your eye!
Personally, I wouldn't go there - just pay a professional to do it for you.
(Full disclosure - I do tune my own early keyboard instruments, which is of course a necessity since they may need the tuning "touched up" once a week or more, and also my own piano - but that doesn't change my advice!)
Answer: It can take a lot of time to learn, and a lot of time to do well. See here for a related discussion: How long would it take to learn to tune a piano?
Personally, I would get it done professionally the first time at least, so I could enjoy my new piano's early days.
Answer: The give away is that you need to ask the question! If you were experienced, you wouldn't be asking. So, I guess you're not. Do you have the tools? Do you know how to use them properly? I have a scalpel, but draw the line at brain surgery - and before!
Seriously, especially if it is a new piano, there should have been something built in to the deal whereby a tuner arrives in a few weeks time to check it over. If it's a pre-loved, then naturally it will need tweaking after a move - the moving itself is often enough to detune it, let alone being in a different environment.
It's the nature of the beast that it will need tuning, once or twice a year is normal, depending on where it is, what use it gets, what level of player is expecting perfect tuning, etc. Concert grands get tuned during one concert!
Also, to consider. If it's an older piano, with no iron frame, it'll need a lot more tlc than one blessed with.
Short and to the point: get a pro in. Pay for the privilege and enjoy.
Answer: You can use a computer program to tell you where to put the pitch of each string, but the most difficult skill is to get the pitch to stay. The most common technique is to go sharp a bit and ease the pitch back down. This tends to set the pin so it doesn't move. With practice you get to feel when you've set the string as well so it doesn't move. Playing the note very hard will tell you if the string is set and won't move.
I'm a professional Registered Piano Technician (RPT) with the Piano Technicians Guild (PTG). Look them up.
Answer: I'm a piano tuner; I became friends with the tuners at my university (NYC 1980!) and got them to teach me,  so I can mention a few facts, and suggestions.
For your inquiry I would bear in mind two things,

Tuning is somewhat an art itself. There is no "in tune" -- doesn't exist.  It's a mess of making choices of where to put the notes to sound good. Has to do with physics, ancient Greece, and Bach. I'll explain below.
Pianos go out of tune most from environmental/temperature changes, or from moving heavy loud playing. Not from moving.

You can try to tune it only if you plan on becoming a piano tuner. Without some apprenticeship, or lessons, you would need a high quality stretch strobe tuning machine, like a Peterson ST. They are nearly $1000. Phone apps are not accurate enough. A strobe tuner will help you set the equal temperament. This is the equal spacing of notes within an octave, usually F3-F4 or C3-C4.  (First used by Bach's "The Well Tempered Clavia" in his 24 preludes and fugues, two in each key in a to showcase one instruments tuning can sound fine in all keys by splitting up the inherent mathematical problems, making each key equally out of tune. Before, the tunings were pure, so in one key your 4ths and 5ths are perfect in that key only, and in other keys it is un-playably out.
After your equal Temp is set, octaves are tuned outward and depending on the size of piano/string length) octaves are made MORE out of tune for smaller strings. (in other words, tuned wide, or sharp)  I think it is called the Pythagorean theorem that says the string would have to be 40 feet long to not have to make octs wide.  (Making sense that the smaller the piano, the wider the oct, till you find a 40 foot piano, (that's two great white Jaws sharks end to end, or a four story building, all very large and expensive!). Enharmonicity is also a factor where all instruments vary and certain harmonics of the string or not in tune with the fundamental, and a tuner has to use his ear to find where it sounds best, which is generally a factor inside of all this technical BS I'm spewing!!
Beside the Pythagorean Theorem, Plato wrote a chapter in his book "The Republic," which explains the
There is a lot of technique involved. When you pull the string up in pitch from the tuning peg, it twists in the pin block. It will sound in tune, but will quickly re-set down after some use. That why you have to pull it a hair more, and then do a "test blow" where you strike the note very hard a few times to settle it to where the pin will twist back to.
One thing I would suggest is get a little tuning app on your phone, and check a dozen different notes across the piano, (not too high or low) This way you will know if it just needs one tuning, or two -- first to bring it back up to pitch, then another to fine tune.
Piano tuners will tell you it needs time between tuning, but the fact is it's just a lot more work in one sitting. It can be done, but most do not, and that's fair enough. It's still over two tunings (some cases three), as if it's way low in pitch, as you bring up the other side the sheer force of the strings pulling the harp will throw the other side out of where it was put.
I hope this helps you. If you are in Miami, I'll tune it, or bring it here, remember what I said: keep it the same temperature in transport!!
What I'm saying is, hire a piano tuner and enjoy your instrument, unless you find learning how to tune a fun challenge, maybe one day become a piano tuner!! But be sure its A LOT of work to acquire that skillset. Hire a pianist and enjoy your tuning!!
Interested to know how you do, and how many people tell how wrong I am!!
Also remember: you can tune a piano but you can't tuna shark!
Comment: Many of the better iPhone apps will allow you to calibrate against WWV and, after that calibration, are more accurate and precise than any mechanical device (e.g. will vary less with temperature, etc.)
Comment: You can't "tuna fish."

Should I tune my piano?


"Proposed Method" in Academic Paper

Question: Is it okay to use the term "proposed method" in academic paper if I already done implementing the method? Or what phrase I can replace to this?
Answer: No. If the experiment is already completed, you would list what you did under the Materials and Methods part of your paper. You may editorialize at the end of the section, but it is best to propose detailed changes in the Discussion section. If your completed experiment did not offer the conclusion you were hoping for, that's where (Conclusion) you could add what you would do next time to make it better, in brief.
Answer: Yes, it's okay because it's a method that you are proposing to the readers. So you can write

The method proposed in this paper allows [...]

or

We have therefore shown that the proposed method yields [...]

"Proposed Method" in Academic Paper


Question about "would": Present Simple or Past simple?

Question: Recently I was doing some english quiz and was totally knocked out with the folowing phrase:
"Would you like a glass of water?"
In that quiz I had to determine the tense of this phrase.
And was completely lost between Present Simple and Past simple.
So what tense is it?
Comment: A present simple. It's a polite way of asking if you like to have a glass of water.
Comment: @Man_From_India Although you're right, you should really post an answer instead of an answer as a comment. I'm only saying this because as a new user, I'm seeing a lot of questions answered by short or even extensive comments. The answer box is for answers :) Also, although the meaning might be simple to you, having understanding of it, remember you're talking to someone who doesn't understand it.
Comment: Thank you @TechnikEmpire. I cant write in answer only what I wrote in comment. I need to elaborate the idea, for the OP. But right now I don't have anything to add. I will again come back later. But I am sure by then you will find better answers here :-) (oh the comments here are as helpful as answers. I learned a lot from them too)
Answer: It is present tense. If the question had said "Would you have liked a glass of water?" then it would be past.
Answer: "Would you like" is neither a present nor a past tense, it is conditional  (mood), here not for irreality, but for polite questions as in Would you help me, please?
No one would have any problems if English conjugation tables were in this form:
Pr I do
Pt I did
F1 I will do
C1 I would do
For the sake of simplicity I have given only the I-form.
Pr present tense
Pt past tense
F1 future 1 ( simple tense)
C1 conditional 1 ( simple mood)
But English grammars have conjugation tables only with present/past/future tense. Conditional, which is rather frequent, is hidden somewhere, either in the chapter mood or in the chapter modals.
The perfect tenses should be
Pf I have done (done is v3, the verb form 3 of the base forms)
PP I had done
F2 I will have done ( have done is infinitive perfect)
C2 I would have done
Answer: I would argue that "Would you like..." is past tense, but "present tense" is perhaps a defensible answer.  In reality, the question isn't entirely a sensible one, so in practice, the correct answer would be whatever answer the examiner is expecting or whatever answer you have been taught as part of your course.
What is tense?
Tense is grammatical and primarily inflectional.  Tense is not the same thing as time.  "I fly to Paris next week" is present tense, but refers to future time.  "Every time I see him, I feel angry" is present tense but refers to a repetitive event which is most likely not happening at this moment.  "I'm leaving next Sunday" is present tense.  In "If I caught you, you would be in trouble", "caught" is past tense, but has nothing to do with past time.
In "Would you like a glass of water?", the reference is to present time.  We are asking whether our addressee would like a glass of water now.  But, because tense is grammatical and not semantic, the fact that we are asking what they want now is irrelevant to the question about what tense is being used.
How many tenses?
Traditional grammarians and many EFL/ESL courses enumerate a dozen or more tenses.  But modern grammar holds that there is no such tense as (for example) "the present perfect".  (To be clear, the present perfect exists, but is a construction, not a separate tense in its own right.) The present perfect is, rather, a combination of the present tense with the perfect aspect (according to some) or a combination of the present tense in the primary tense system with the perfect tense in the secondary tense system (according to others); both schools of thought agree that the progressive is a question of aspect, rather than tense.  Either way, then, English has two primary (inflectional) tenses, the present and the past (or the present and the preterite, or the nonpast and the past).  There is no future, just the use of the modal verb "will" or occasionally "shall" (which are themselves in the present tense or the nonpast tense) followed by infinitives.
Some traditional grammarians would class "I would [+infinitive]" as the "conditional tense" or "conditional mood".  Thomson & Martinet's Practical English Grammar (1960) called it the "present conditional tense".  This terminology isn't used by modern grammarians.  And while it neatly solves the problem of assigning a tense to "would" (see below), it doesn't explain what tense other modals have (for instance, what tense is used in "I might like" or "I must like"?).
The tense of modal verbs
Some people see "could", "should", "would", "might" as the past tenses of "can", "shall", "will", "may".  Others prefer to see "could" etc as modal verbs in their own right, at least some of the time.  The difficulty is that in many cases the "past" tense modals refer to present time, and the difference between "could" and "can" often has nothing to do with a distinction between present/past.  The relationship between "might" and "may" is so weak that some native speakers may be unaware of it.
Then again, as I've argued, tense is a grammatical feature and does not necessarily reflect semantics.  If "could" and "would" are treated as verbs in their own right, then they have no meaningful present/past distinction and the question about the tense of "Would you like" becomes irrelevant due to modals lacking tense - whereas if they are treated as the past of "can" and "will", clearly they are in the past tense.
Note: it has been argued that the past tense of "I would like" is "I would have liked".  This is fallacious.  "I would have liked" combines the modal "would" with a perfect infinitive ("[to] have liked").  We often use these modal plus perfect infinitive combinations to discuss the past, but they are not grammatically the past tense, any more than the present perfect is.  Moreover, we don't use these perfect constructions every time a modal is used to discuss the past.  For example, in the sentence "He asked me if I would like a cup of tea", it is entirely correct that we have written "would like", not "would have liked".  We would only use "would have liked" here if he had been asking about a past liking - not if we were recounting a past event in which he asked what we wanted at the time.
Comment: The following may be worth a look: https://www.ucl.ac.uk/internet-grammar/verbs/tense.htm ; https://www.cs.bham.ac.uk/~pxc/nlp/Eng-Verbs.html ; https://learnenglish.britishcouncil.org/english-grammar-reference/present-tense ; Biber, Conrad & Leech, *Longman Student Grammar of Spoken and Written English*.
Comment: The view of the perfect as a secondary tense system is put forward by Huddleston & Pullum in their comprehensive grammar as well as in *A Student's Introduction to English Grammar*.  It's summarised here: http://www.glottopedia.org/index.php/Huddleston_and_Pullum%27s_(2002)_analysis_of_tense
Comment: Thank you very much for a superb answer. This supplements the comment about _aspect and tense_ you made earlier on very nicely. Could you please suggest further material (books, online material, etc.) on _verbs and tense?_ @rjpond.
Comment: Thank you very much, @rjpond.


Throwing a stone from satellite toward a planet

Question: If I'm in a satellite which is moving in circular orbit of radius $r$ around a planet which has no atmosphere, means no air friction. And if I throw a stone from satellite toward planet then it's obvious that it will land on its surface, same as probe landing. But here is some calculation- $$$$ If mass of planet is $M$ then orbital velocity of satellite will be $$v=\sqrt{\frac{GM}{r}}$$ which will be the velocity of stone also in the orbit. $$$$ Let's say the stone came to the radius $r/2$ Then according to law of conservation of angular momentum the orbital velocity of stone become double i.e. $v'=2v$.             $$v'=2 \sqrt{\frac{GM}{r}}$$ To make the stone come further down toward planet the $v'$ should be less than the velocity which overcome the centripetal force i.e. $v'< \sqrt{\frac{GM}{(r/2)}}$ but it's not. This means that the stone will not come down. Then how the probe land on planets with no atmosphere like moon?
Comment: I should have say that.
Comment: You decrease your orbital velocity with forward a rocket burn - which reduces your orbital height.
Comment: Is this what astronomers do to land a probe?
Comment: NASA are on the case. http://www.nasa.gov/ames/nasa-deploys-satellite-designed-to-re-enter-atmosphere-using-revamped-drag-device
Answer:
If I'm in a satellite which is moving in circular orbit of radius $r$ around a planet which has no atmosphere, means no air friction. And if I throw a stone from satellite toward planet then it's obvious that it will land on its surface, same as probe landing.

This is not the case. What you have done by throwing the stone toward the planet is to put the stone into a slightly elliptical orbit, one with an orbital period slightly greater than that of the satellite. In fact, if you had thrown the stone away from the planet with the same relative speed, the stone would have an identically shaped orbit.
The best way to land a probe released from a vehicle in a circular orbit about a planet is to have the $\Delta v$ supplied to the probe be directed against the vehicle's orbital velocity vector such that the resulting elliptical orbit just barely intersects the planet at periapsis. This was the approach used during the Apollo moon landings and other lunar landers.
The lander separated from the Apollo vehicle and then thrusted against the velocity vector so as to put the lander in a elliptical orbit that just barely intersected the Moon. Following this trajectory all the way to the Moon's surface would have resulted in a 1700 meter/second collision (mostly horizontally). The lander followed this free-fall trajectory until about 500 kilometers from what otherwise would have been a nasty impact, at which point it performed a breaking burn that killed most of the horizontal component of velocity. The lander then had to kill the vertical component of velocity so as to land gently on the Moon.
Answer: To get out of orbit and land on an object you need to reduce your orbital height - ultimately to the planets radius. To do this you need to reduce the orbital speed. Orbital height only depends on speed.
One way to do this is to fire a rocket motor toward the direction you are travelling in - to slow you down. The problem with this is you have to carry a large rocket motor and its fuel. But it is the only option on an airless planet.
An alternative to get out of Earth orbit ( or any other planet with an atmosphere) is to slightly change speed and get into a more eliptical orbit, one part of which goes into the atmosphere. The friction with the atmosphere will reduce your speed, and so your height, which means more atmosphere and more friction, and so more speed loss - until you can land
Comment: Orbital height of a circular orbit depends only on speed.   Of a more general (elliptic) orbit, the eccentricity matters.


ExpressionEngine (CMS) with SQLite

Question: Has anyone out there hacked up ExpressionEngine (CMS) to work with SQLite?  If so, any good tips or guides on how to do so?
Comment: do you mean a **regular** expression engine?
Answer: I don't know of any Expression Engine 1.6 that has been modified to support SQLite; however, the next version (2.0) is based on the CodeIgniter framework which has a DAL which supports many databases. Here is a post from an Ellis Labs employee confirming this.
Answer: Given that it's proprietary software under copyright and not available (so far as I can tell) under an F/OSS license, tightly tied to MySQL (no other dbs supported and you can't run MySQL in strict mode, meaning they rely on nonstandard extensions) I don't think you're going to find what you are looking for.
Even if someone had done it for their own use it would look an awful lot like a derivative work (though I suppose you could try to claim it was a parody) and distributing it would be a copyright violation.
Why don't you contact the vendor and offer to shell out some $$?  Or look into a F/OSS alternative?  There are (*cough*) several of them out there.
-- MarkusQ
Comment: I'll always use a F/OSS package over a paid one for my own personal use.  This, however, was for a client paying to use EE.

ExpressionEngine (CMS) with SQLite


Log transformation for percentages or proportion in regression

Question: I am doing a study understanding impact of vehicle registration fee on vehicle miles travelled. I am using linear regression and figured out that log transformation of dependent variable and some of the control variables improves the R2 and reduces standard error. I have a few control variables that are in percentages / proportions. I checked them for normality and their are normally distributed, but I still have to log transform them as R2 improves by it as compared to when they are not log transformed. Can someobody explain me why this happens?
Comment: Adding to gel_b's answer, after nonlinearly transforming the R2 will be on another scale, so not directly comparable.
Answer: There's no requirement for the control variables to have any particular distribution. Indeed, the marginal distribution of the IVs or even the DV is not even an issue -- you're checking something that is not related to any regression assumption whatever. (Many posts on site discuss regression assumptions in detail.)
There's also no reason to expect that a transformation of an IV that makes the relationship more linear would not make the distributional shape of an IV less normal. Since the distributional shape of an IV is not of any consequence doing the first at the expense of the second should not worry you in and of itself.
However, if you're trying transformations and choosing one with higher $R^2$ and then using the same data for hypothesis tests or confidence intervals or prediction intervals among other things (i.e. using the same data on which you chose a model to evaluate the model or predict from it) then the statistical procedures don't have the properties they're intended to -- among other things, p-values are too low, standard errors are too small.


What is the role of gills in terrestrial Crustaceans?

Question: Why do Crustaceans that live on land have maintained their gills? In aquatic species, the gills play a pivotal role in respiration, but terrestrial crustaceans have tracheal lungs. So why do they have gills?
Answer: Short answer
Gills in terrestrial crabs serve a role in water storage and ion homeostasis.
Background
Crustaceans are a huge group of species within the phylum of arthropods, including crabs, lobsters, crayfish, shrimp, krill and barnacles. Because of the huge variety of species within the crustaceans, I'll focus this answer on terrestrial crabs.
Air-breathing crabs have universally retained gills, but have also developed accessory breathing organs, usually lungs formed from the inner lining of the gill chamber. Aquatic crabs generally have large gills with very thin closely packed lamellae. Land crabs feature lungs that are well vascularized, have short blood-gas diffusion distances and often have adaptations to increase surface area, all of which greatly increase the diffusing capacity of the respiratory
system (Farreley & Greenaway, 1994).
In contrast, the gills in land crabs  are reduced in size and in surface area. The epithelium is usually modified for ion transport as indicated by the presence of densely packed mitochondria and relatively long blood/gas diffusion distances. Hence, the gills in land crabs are thought to primarily serve an osmoregulatory role, rather than a gas-exchange function (Farreley & Greenaway, 1994). The gills are thought to be involved in salt and water uptake. Their spongy structure is thought to aid in their function as water storage areas in periods of molting (Edney, 1977).  However, the gills in many species are still capable of gas exchange, although less efficiently than the lungs (Farreley & Greenaway, 1994).
References
- Edney, Water Balance in Land Arthropods, Zoophys & Ecology, Springer, New York (1977); 9
- Farreley & Greenaway, J Exp Biol (1994); 187: 113–30


Gestalt Principles of Perception

Question: I have studied that Gestalt Principles are principles/laws of human perception that describe how humans group similar elements, recognize patterns, and simplify complex images when we perceive objects. But can you give me real-life examples where this is applicable in day-to-day life not just looking at some patterns in the textbook.
Comment: While reading this comment, you could say the Gestalt principle of proximity is at play when you recognize a sentence as groups of words.
Comment: It's still a toy example, but one you can try out right now, in the real world. If you take two pens, hold one over the other perpendicularly, your brain will perceive two straight pens, instead of some weird pen shaped like a cross, or two bent pens. This is the Gestalt principle of good continuation at play.
Answer: Perhaps seeing where it fails will help with understanding.
Consider Forced-Perspective Photography, where the gestalt effect causes your brain to see a false vision of what is actually there.
Answer: One area where Gestalt principles are widely applied is in graphic design: for instance, for logo design. Moving to a field that's a bit bigger, Gestalt principles are also used to guide web design processes.
If you're asking not about utilitarian, "artificial" applications of Gestalt theory, but about examples of where it comes into play during day-to-day life, Gestalt principles improve the correctness of how we interpret visual information. For instance, the principle of good continuation dictates that when you see a car partly covered by a tree so that you see two distinct fragments of it, your brain still perceives it as one car and not just two separate car fragments.

Gestalt Principles of Perception


How to create our own portlet in liferay

Question: Please describe me in brief how to create portlets using eclipse ide and to add these in liferay.
Answer: You can install the Liferay IDE (which comes as a plugin) in Eclipse, can download it from here.
And then create a Liferay project the same way as you create a normal Eclipse project by going to File --> New --> Liferay Project --> A window will open which will ask you about what kind of project you need to create in liferay (portlet, hooks, theme, ext, layout etc).
Some more links to get you started with Liferay IDE:

Installation guide for Liferay IDE
Getting started with Liferay IDE

Hope this helps.
Answer: File->New->Liferay project->
Enter the name

click ok
It will show project
and then goto  docroot/WEB-INF/src
create a portlet here
Answer: Very simply, see the screencast:


How to sample songs in my headphones without it playing through speakers/monitors?

Question: Basically I'm trying to get an output to my headphones WHILE A SONG IS PLAYING THROUGH THE MONITORS but without it going to both outputs. I'm supposed to be doing a DJ gig and this problem came up which doesn't let me mix on the fly. I mean I could probably just create a mix at home but what if the party goes on for longer than I predicted? Any help on this would be super, thanks in advance to anyone who knows how to do this.
Comment: 2 distinct outputs, listen & broadcast; & software that can recognise those concepts.
Comment: What is your setup? Do you have a mixer? An audio interface with more than 1 stereo output? It's probably a good idea to do more research and practice, so you know how everything works, and more importantly, you know what you're doing, before doing a gig.
Comment: Its just a laptop and a huge speaker for now. Think you could point me in the right direction in terms of hardware?
Answer: What you need (in terms of hardware) is an interface that has multiple outputs, and DJ software that allows you to bus to these multiple outputs. A laptop generally has a single stereo audio output and thus you can only bus a single mix to it. An interface with multiple outputs will allow you to bus the master mix to the speakers and a cue mix to your headphones. Keep in mind that what ever interface you chose needs either 2 stereo outputs or 4 mono outputs to make a setup like this work as properly. Most interfaces have at least a stereo output and a headphone output however you cannot always independently bus to the headphone output some older interfaces have the headphone output always mirror the main output. Just make sure that you can independently bus to the main out and the headphone out before purchasing a unit.


What is a Gufujo and how is it different from a Kafejo?

Question: Esperanto events often have a place named "Gufujo". What is a "Gufujo"? How does a "Gufujo" compare to a traditional "Kafejo"?
Comment: There is a nice documentary on YouTube about the Gufujo, and it now has subtitles in English, German and Esperanto on Amara http://amara.org/en/videos/yMXZhx1TXIL0/info/la-gufujo/
Answer: A gufujo is a room at an international Esperanto (usually youth) meeting, in which various teas are served in a calm atmosphere during the evening and at night. It was invented as an alternative to a bar, strictly without smoking or alcohol. The usage of candles contributes to the calm atmosphere. There is usually either no music or only calm music in the gufujo. Sometimes some literature reading or a concert with calm music takes place in the gufujo. The first gufujo took place at the Internacia Seminario 1995/96 in Wetzlar, Germany, and quickly spread to other Esperanto youth events after being well-received by the participants.
A kafejo is just a café, so there are multiple differences between a gufujo and a kafejo/café:

A gufujo is always at an Esperanto event. The word kafejo is not strictly linked to Esperanto events, so you can go to a kafejo down the street.
A gufujo usually doesn't serve any coffee, and usually has less of a choice of cookies and cakes than a café. To make up for it, a gufujo has a huge variety of teas, including many herbal teas.
The gufujo usually functions only during the evening and at night, whereas a café usually works at least throughout the whole afternoon.
Comment: The gufujo also seems to be quite a common place to play board games or card games, which is quite a popular activity in Esperanto events.
Answer: A Gufujo is:

a non-alcoholic, non-smoking makeshift European café-type situation (extremely similar to a fika) that takes place in the evening or at night. Esperanto speakers meet at a location, either a rented space or someone's house, and enjoy live music or reading aloud while having tea, coffee, pastries etc. There may be payment with real money expected, as in a real café. It's supposed to be a calm affair, in direct contrast to the wild parties that other Esperanto speakers might be having elsewhere at the same time. The lighting is usually dim and candles are usually lit, which is the custom in European cafés in the evening. Gufujoj were originally intended for people who dislike crowd noise and partying.

Gufujo means more an event than a place where to drink. As described, it is a kind of party.
Comment: Just to clarify, a _gufujo_ is typically part of the evening program at Esperanto youth meetings. Usually there is a bar, a place to dance and the tea lounge (a.k.a. _gufujo_). It's quite common to drink until you feel like dancing, dance until you're tired and then chill in the tea lounge until you want a beer, etc...
Comment: This description from the English Wikipedia is somewhat misleading. A Gufujo is always a room at an international Esperanto gathering, and this is not clear from the description you cited. The description in the Esperanto Wikipedia is much more accurate. I will write an answer based on that.


On the use of Lagrange multipliers in deriving the Lagrange eqn. in classical mechanics

Question: Can one derive the Lagrange eqn based on the methods of Lagrange multipliers? That is, we need to minimize the action with respect to the trajectory keeping the net energy of the body in motion constant. The conservation of energy will impose suitable constraint. Now if we consider the action to be function of position and momenta the equating the differential of the Lagrangian (in sense of minimizing) with respect to the same to zero, can we obtain a suitable expression for action?
Answer: Comments to the post (v2):

For a system with only holonomic (and semi-holonomic) constraints it is possible to derive Lagrange equations from Newton's laws, cf. e.g.  Herbert Goldstein, Classical Mechanics, chapter 1 & 2; this & this Phys.SE posts.
Total energy conservation alone only directly implies EOM for a system with 1 DOF.


What is the purpose of an AND gate with the same signal on both inputs?

Question: If this is a buffer, why use an AND gate, aside from better availability of that gate in a single package? This is on an Analog Devices SHARC eval board.
Answer: This is a buffer.  Two gates means twice the output current.  But why use AND gates instead of buffers, you might ask?  I was originally going to say that they probably used one or two AND gates elsewhere in the circuit and just popped down a single quad AND gate chip, using two of the AND gates as buffers instead of calling for an actual buffer to save board space and parts count.  However, it seems they are the single gate variety.  So I presume they had a lot of AND gate chips on hand for whatever reason - perhaps they are used elsewhere in the circuit, or in other designs manufactured on the same production line - and they didn't want to pay for another line item/part feeder on the pick and place machine, so they just specified more AND gates instead of some AND gates and some buffers.
One thing to note about using two AND gates (or another two input logic gate) in this way instead of buffers (or inverters) is that there are twice as many input pins, so the input capacitance will be double.  This probably won't be an issue in most cases.  If it could possibly be an issue, tie one input high (or low, depending on the gate) instead of connecting both to the input signal.
Edit: looks like one of them is marked DNP, and hence may be an empty footprint on the board. I presume this was done just in case one gate couldn't provide sufficient drive strength, they could add a second without having to re-spin the board.
Comment: Assuming they pull in the same direction, then they would not fight each other. They're both CMOS, the output transistors will essentially just be in be in parallel. Good point about the DNP annotation, though. I presume they put two footprints on there just in case they needed more drive strength than one could provide.
Comment: Regarding *two gates means twice the output current*, that's incorrect. There aren't actually two AND gates in the circuit.  The *schematic and PCB* allow either to be used, but only U9 is fitted, and U10 is marked as "DNP" (Do Not Place).  Typically this would be done for testing, or to have a backup device available in case there are problems getting hold of the U9 device.  If you actually connected the outputs of two devices together, the result would be that they'd burn out trying to fight each other, not that you'd get twice the output current.
Comment: Fair point on them being CMOS - you can parallel FETs/MOSFETS to get more current, so that would work.  TTL certainly wouldn't, because BJTs don't work that way.  Although I still wouldn't recommend it, because the switching times won't be exactly the same, and that *will* give brief but huge current spikes for the short periods where they aren't both in the same state.  Not enough to kill anything immediately, but it won't help lifespan, and those current spikes will create real problems with EMC.
Comment: @Graham: Having both inputs of an "AND" gate tied to a signal source would likely nearly double the loading on that source with having one input tied to that source and the other strapped high.
Comment: @supercat That's true, but not really relevant to what I was saying about both *outputs* of the two separate "AND" gates.   Still, it's another possible improvement to the circuit.
Answer: The designers have probably chosen the AND gates because of availability or some other such convenience.  Maybe they had the AND gates on the bill of materials for that board already.
The gates are used as a buffer for driving the cable.  The two gates can output more current than the part which generates the signal initially.
There are ICs that do just buffering without logic functions (SN74LVC2G34, for example.)
Comment: "_because of availability or some other such convenience_"... They call that "Design For Manufacturing" (DFM), but who knew anyone really did that?  Probably a new-hire's 6-Sigma project came up with that (final) board design... I like it, mostly :)
Answer: SPDIF is designed to drive 1Vp-p from 75 ohm source into a 75 ohm load.
Having worked out the current required from the driver, presumably the designers decided that was the cheapest way (or smallest in terms of PCB space, or otherwise optimal in their design) way to supply it.


Ola Hallengren maintenance script - how can I tell a backup file is still being written to?

Question: My question is whether there is a way to identify a backup file that is still being written to. I want to copy the completed backup files to another place. By reading the backup extension, I can't differentiate completed backup files from backup files that are still being written to. Any suggestions?
Answer: You could use POWERSHELL and the COPY-ITEM cmdlet.
It will skip over files that are currently in use.
$ErrorActionPreference = 'SilentlyContinue' prevents errors from being displayed due to locked files.
powershell.exe "$ErrorActionPreference = 'SilentlyContinue';Copy-Item 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\*.bak' c:\TestOut

Answer: I think you can use procedure sp_whoisactive written by Mr. Adam Machanic, this procedure clearly shows what command is currently being executed in sql text column. if you have set of databases to be backed up, you can see which one is currently running and since you are following Ola Hallengren's script for taking backup, back ups are taking in alphabetical order meaning if DBA_Maintenance backup is currently running means database1 is already completed.
Alternatively you can use below script to get the details on percent completed and ETA completion time as below:
SELECT r.session_id,r.command,CONVERT(NUMERIC(6,2),r.percent_complete)
AS [Percent Complete],CONVERT(VARCHAR(20),DATEADD(ms,r.estimated_completion_time,GetDate()),20) AS [ETA Completion Time],
CONVERT(NUMERIC(10,2),r.total_elapsed_time/1000.0/60.0) AS [Elapsed Min],
CONVERT(NUMERIC(10,2),r.estimated_completion_time/1000.0/60.0) AS [ETA Min],
CONVERT(NUMERIC(10,2),r.estimated_completion_time/1000.0/60.0/60.0) AS [ETA Hours],
CONVERT(VARCHAR(1000),(SELECT SUBSTRING(text,r.statement_start_offset/2,
CASE WHEN r.statement_end_offset = -1 THEN 1000 ELSE (r.statement_end_offset-r.statement_start_offset)/2 END)
FROM sys.dm_exec_sql_text(sql_handle)))
FROM sys.dm_exec_requests r WHERE command IN ('RESTORE DATABASE','BACKUP DATABASE')

Same is explained on this link.
You may also refer Mr. Pinal Dave's page in this regard.
Hope this helps.


ACS Federation question

Question: I'm building an Azure-hosted WCF service that I'd like to secure with ACS using credentials stored in an SQL Server database. I've looked at a bunch of ADFS2 examples but have yet to figure out how to do this.  I'm sure I'm missing something obvious here so any advice would be greatly appreciated.  Thanks...
Answer: You should be able to create your own STS, like this:
http://dotnet.dzone.com/news/5-minutes-wif-make-your-aspnet
Just add in the code to look your user up.
This post discusses how to create the federation metadata required to add the STS to the Azure Access Control Service:
WIF manually generate federationmetadata.xml
In your original project, you should then be able to add the Access Control Service as the STS, and if everything is set up correctly, you'll see your new STS.
Answer: If you want to use ACS (not clear in your post why you need it though), you need to have your WCF service trust ACS and then configure ACS to trust an STS that can authenticate users agaist SQL. You cannot use ADFS for that as it currently only supports authentication with AD.
Your options are varied, but the simplest would be to create your own STS as Richard mentions, or use one that already does that like StarterSTS or the more moder Identity Server in CodePlex (both open source and contributed by Dominick Baier from Thinktecture).
The question though remains: why you need ACS? The simplest solution would be to have your WCF service trust the (SQL backed) STS directly.
Here are some examples of when ACS would be useful:

You need to trust eventually more than 1 Identity provider
The claims your service expects are not supplied by the identity provider (you need transformation/augmentation of claims).
You need token translation (e.g. SWT -> SAML)

ACS Federation question


How do I turn a select list into a radio button?

Question: I have a list text field that I want to display as a series of radio buttons instead of a select (dropdown) list.  In Drupal 7, I could change this on Manage fields.  How can I do that in Drupal 8?
Answer: step 1 : choose the field type is  "list(text)".
step 2 : change the "Allowed number of values" as limited in Field settings
step 3 : change the "field widget" as Check boxes/radio buttons in Manage form display
Answer: This option moved.  It is now under Manage form display, which is next to Manage fields.
You will also need the Options module (included in core) enabled.


Can I use a router to connect and transfer data between devices?

Question: I'm thinking of a solution in which you can use a router (that does not have a current ISP) and use it to transfer data between devices. I know that routers are not normally setting up with the right code to be an end point in a file transfer, so it would require special work. What solution exists that can solve/remedy the problem? Any recommendation would be appreciated.
Answer: Yes, a router can be used to connect and transfer data between devices. But actually, what you need is not a router, is  the cable which makes the data transfer process simple. For instance, you can connect two of your computers with simple UTP cross cable (a cable with crossed IN and OUT data pair - can be bought with no issues) and you can transfer data like that without any additional device.
Answer: If you just get a new router and connect 2 devices like notebook, PC, anything with LAN cable to it, the devices will be assigned IP addresses and you will be able to transfer files between them. If you need to use wireless, you may have to configure the wireless part in the routers interface if a wireless network is not enabled by default.
Note that ISP connection and routing will be irrelevant in this case.
Answer: Yes you can, but once you set it up you may find it simpler to throw away the router and just take the Ethernet cables that you used to connect each device to the router and instead plug one of the cables into both devices. Modern Ethernet ports and Cat5e cables are bidirectional and allow two devices directly connected to form their own network. Of course, all the other answers that actually use a router or switch will also work.


When will the API/X11 be completed?

Question: Okay, before I get into the guts of it, I'm vastly aware that Gtk and Qt are marvelous frameworks from which to work with. In fact, I have no qualms with either.
That being said, does anyone know of any ongoing projects by which X11/Xlib are to be completed libraries? Sadly, I ask this is a former Windows-Only Developer. In Win32 API, everything from the basic window to dialog boxes are covered in same API level. Whereas, under Linux basic windows, anti-alias fonts, hardware interaction are all independent libraries. Dialog boxes are still, by and large, self constructed.
And if there are no projects looking to complete X11, does anyone know of any resources by which a person could understand the fundamentals to embark on such a project?
Answer: I'd have to say the answer to your question is "No". By their underlying philosophy and design, Xlib will never attempt to provide everything under one API. So in that sense Xlib is "complete", in that it does what it's supposed to do, and it leaves other higher-level concerns up to other layers.
The Windows approach where "everything from the basic window to dialog boxes are covered in same API level" is not necessarily the best one, and the one taken on Linux is just different, stemming from the architectural and design choices made for the X Window system. I've read a lot about the Windows API being very complex and inconsistent, so it looks like unifying things under one API may not be the best solution. And indeed, it detracts from the flexibility you have if libraries and APIs each have well-delimited concerns and functionalities. What if I want hardware interaction in a non-GUI program? What if I need to render antialiased images and fonts to a file without having a graphical environment running? Having independent libraries enables this sort of thing.
You could read Linux is Not Windows for a much better rationale on why you shouldn't expect Linux to mimic Windows, and the X Window System Overview HOWTO for a slightly outdated but still quite valid explanation on the philosophy behind X and the toolkits. libraries and desktop environments that work atop it.
Comment: Actually, I think you misinterpreted my question. Mayhap that was my fault. Though, I did find the answer I was looking for in Wayland.

When will the API/X11 be completed?


How to find a $c \in \mathbb [a, b]$ such that $f(c) = [f(x_1) + f(x_2) + ... + f(x_n)] / n$?

Question: So suppose I have a continuous function on, say, $[a,b]$ with $x_1, x_2, ..., x_n \in [a, b]$. I want to prove that there exists a $c \in [a, b]$ such that $f(c) = [f(x_1) + f(x_2) + ... + f(x_n)] / n$. I thought about using mathematical induction at first for n. In this case, $n = 1$ is trivial since $f(x_1) = f(x_1)$. But then I need to begin with $n = 2$, as in finding a $c \in [a, b]$ such that $f(c) = [f(x_1) + f(x_2)]/n$. However, all the theorems I've tried so far don't seem to work. For instance, the Bolzano Intermediate Value Theorem doesn't work since there is a possibility that $f(b) \lt [f(x_1) + f(x_2)]/n$ or $[f(x_1) + f(x_2)]/n \lt f(a)$. I'm very stuck on this and I'm not sure where to begin. Any help would be much appreciated.
Comment: $[f(x_1)+f(x_2)]/2$ should be between $f(x_1)$ and $f(x_2)$. So if $f$ is continuous, the intermediate value theorem should apply. The intermediate value theorem just says that this particular $c$ will be in the smaller interval between $x_1$ and $x_2$ (instead of between $a$ and $b$).
Comment: Are the square brackets to be interpreted simply as brackets? Seems to be so from your inductive step, just want to make sure.
Answer: The key points are that $f$ is continuous, $[a,b]$ is compact and connected, and continuous functions on compact connected sets attain extreme values, as well as all values between those extreme values on compact connected sets.
Somewhat more formally:
Since $f$ is continuous, and $[a,b]$ is compact, it follows that there exist $x_{m},x_{M} \in [a,b]$ such that for all $x \in [a,b]$, $f(x_{m}) \leq f(x) \leq f(x_{M})$. Now, let $\lbrace x_{1}, \ldots, x_{n} \rbrace \subset [a,b]$, then $nf(x_{m}) \leq \sum_{j=1}^{n}f(x_{j}) \leq nf(x_{M})$. Since $f$ is continuous, and $[a,b]$ is connected, it follows that $\frac{1}{n}\sum_{j=1}^{n}f(x_{j}) \in f([a,b])$ (this is nothing more than the intermediate value theorem!); that is, there exists $c \in [a,b]$ such that $f(c) = \frac{1}{n}\sum_{j=1}^{n}f(x_{j})$.
Hope this helps!
Comment: I get most of it, but how did you use the intermediate value theorem to deduce what you stated? The intermediate value theorem has to involve $f(x_m)$ and $f(x_M)$ having opposite signs, doesn't it?
Comment: no, the IVT says that for two given $x$s, the function takes every value between their images for all $x$ between said $x$s provided it is continuous in that interval.
Answer: Hint:

Just consider $g(x) = f(x)-\frac{1}{n}\sum_{k=1}^nf(x_k)$ on $[a,b]$ and evaluate $g$ at the points where $f$ attains its minimum and maximum, resp.
Since $g$ is continuous on [a,b], this gives a point $c \in [a,b]$ with $g(c) = 0$. So, you found your $c$.


How do I convert ms/line to ppm

Question: I'm looking at buying a scanner with a document feeder.  The feeder can feed in 30 ppm, but the scanner can only can at 12 ms/line.  So how fast is the scanner scanning?  Is having such a fast document feeder useless?
Comment: i imagine "12 ms per line" means the scanning speed depends on what resolutions you scan at (and what resolutions the scanner is capable of).  lower resolutions mean fewer lines per page mean faster scanning.  higher resolutions mean more lines per page mean slower scanning.
Comment: Absolutely.  What I need are some solid numbers. If it depends on dpi, then I need @dpi x, y pages per minute will be achieved.
Answer: Well an A4 page (I live in the UK) has about 50 lines of text on it, so to do an A4 page it would take 12 x 50msec = 600msec or a little more than half a second. A 30 ppm sheet feeder would feed one every two seconds leaving you with a reasonable margin for error.
I would suggest you only use the numbers as a guideline, see if you can find a review or some real world tests. Find out what people actually think about it, Amazon.com is quite good for user reviews of consumer products.
Answer: I believe the way to calculate the time (in seconds) a scanner takes to scan a page is as follows:
<code>(Scanner DPI) x (Length of page in inches) x (scanner speed in msec/line) / 1000 =
</code>
eg: For a scanner which scans at a speed of 12 msec/line at 1200 DPI (dots per inch) to scan a Letter size page (8.5 x 11 inches) it would take:
<code>1200 (DPI) x 11 (inches) x 12 (msec/line) / 1000 = 158.4 seconds

So approximately = 160 seconds
</code>
Notes and assumptions:

I believe "line" in msec/line refers to a line of pixels so at 12msec/line the scanner's sensor array can acquire 1 line of pixels in 12 milliseconds where the length of the line is the length of the scanner's sensor array, which is typically the width of the largest page that can be scanned (see next point).
It is assumed that the scanner's sensor array move along the length of the page (this is typical for most commercial flat-bed scanners). If it move along the width then use the width in the calculation above instead.
It is assumed that the warm up time, time for data transfer to the PC and any other time associated with the process of scanning is negligible when compared to the time taken by the sensor array to acquire the picture of the physical medium. Thus time calculated is approximate at best and likely slightly less then the total time required to scan the page.
Scanner may have different scan speeds at different DPIs and the scaling may not be linear. eg: Scanner which scans at 10 msec/line at 600 DPI may not be able to scan at 5 msec/line at 300 DPI.
Answer: A4 = 5833 pixel line
scan speed 12msec/line
so time = 12msec/line * 5833 line = 69996msec or about 70seconds.
Comment: Where do you get that A4 = 5833 pixel line?

How do I convert ms/line to ppm


How to detect Snort on the network?

Question: Does anyone know how to fingerprint an IPS ? is there any tool available to do the job?
I want to detect snort in my network .
Would appreciate any kind of help.
Comment: If it is running in listening-only mode you might not be able to detect it.
Answer: Configured properly, you shouldn't be able to detect snort.  "Properly" means on an unconfigured/no-address-assigned port in promiscuous mode.  As PTW-105 mentioned, if snort is configured to send resets then maybe you can detect it, but more likely, you'd detect that something was blocking you.  The same holds true if it's in inline mode.
Two things I can think of if you really wanted to know it was snort (as opposed to some other IDS/IPS) would be if 1) snort was configured to do logging to some other host and you were able to see that traffic or 2) you could send packets that you know would match snort's ruleset and if you have enough hits, especially for nonstandard stuff or if your packets were so specific that it would probably only drop on snort's detection, you could know that way.  But it would be noisy since you were intentionally setting off alarms and if snort was not configured in any sort of active blocking mode I don't know of any way of knowing other than a system that dumped alert data back on the wire in a place you were able to see.
Thanks,
~Patrick
Answer: I'm not super familiar with snort, but have experience with other IPS products.
As @edvinas.me mentioned, if snort's running in IDS only mode, it's likely that you will not be able to fingerprint it.  Some IDS products such as FireEye are sold as an IDS only product when run off a SPAN port, but are capable of doing connection resets if configured as such. This may be one way to actively discover an IDS/IPS product.
Many products that are full-blown IPS products will do a DROP on a connection by default, rather than a DENY on an incoming connection, thus making it difficult to discover and fingerprint.
I don't have it in front of me, but I think the Kali linux distro has some canned tools for fingerprinting IDS/IPS, firewall, WAF, and some other things.  May be worth giving a shot at these if you're playing around in your own environment.

How to detect Snort on the network?


Google showing places I haven't been

Question: I am shown on google that I have visited Liverpool and Cornwall both of which are 100's of miles away from where I live.  Any ideas why?
My Facebook was hacked could this be the same thing?
Comment: Unlikely... We see this sometimes as well when GPS signal isn't available and Google is attempting your location by WiFi names, IP address, and cell tower ID's... We can occasionally appear to be hundreds and even thousands of miles away from our actual location when looking in location history. It's not super common, but it definitely happens. That said, you should do a Google Security Checkup and make sure nothing looks out of place. https://myaccount.google.com/intro/security-checkup
Answer: No. Your location history is never completely exact. It is because GPS location is often bad, particularly in these cases:

If you are inside reinforced concrete buildings or trains. It is because the metal in wall (of the building) or the case of the train shadows the signal of the GPS satellites.
If there is no GPS signal, google maps tries to use the MAC address of the available Wifi APs what your mobile can see - and compare it to the GPS signal of other google users, whose GPS at that position worked. It works in many cases, sometimes it does not (for example, the Wifi AP is actually another telephone of another Google Maps user who shares its mobile network with it).

If you see your position history (timeline) on the google, it shows you all the cities what the google thinks, you visited.
If the Wifi-based localization worked 10000 times in your life correctly, and 3 times badly, then you will see 3 cities where you never were. It does not matter that it worked correctly 9997 times, the first what you will think that you were never in Zürich or Philadelphia.
Your position timeline overweights the mistakes of the google localization. You can see these false points, many of them are airports or train stations.
Probably there are some option to change your google maps timeline retroactively.

Google showing places I haven't been


External monitor resolution on Macbook Pro is not permanent, reverts to original when lightdm is restarted

Question: I can set up a screen resolution on both the laptop screen and the external monitor using xrandr and everything works fine, but my displays go back to normal when I restart lightdm. How can I make the changes permanent? I tried going through the monitors.xml file, but it isn't being updated. The Displays item in system settings isn't of much use...
Answer: I had pretty much the same problem with display on an external monitor - display was fitted badly; I hardly could see wingpanel or plank.
I solved it with changing config file in /boot/ directory.
In this file you need to find disable_overscan and change it's value to 1.
Then a bit further down you'll find
overscan_bottom=48
overscan_left=48
overscan_right=48
overscan_top=48

you can change these values to fit your display into monitor.
Then save it  and restart computer. It should be fine after few times. :)
Comment: Overscan is such a legacy curse! Some systems can't enable / disable it, and some monitors can't enable / disable it. And it isn't even really relevant anymore - so I wish they'd just burn it completely and stop building devices that ever use it!


Phasor vs Vector vs Space Vector

Question: I wonder what is the difference between a Phasor, a Vector and a Space Vector? A phasor is also a rotating vector in space then it means that a space vector is same as a phasor? Also by definition a vector has magnitude and direction in 2D-space.. so then a vector and space vector both are the same things. Please correct me if I am wrong in this understanding.
Comment: Its 'Space-Vector' as in SVPWM.
Answer: A vector is a mathematical entity that we all know and love; it's a \$1 \times N\$ matrix of numbers that indicates a position in \$N\$ dimensional space.
A phasor, as @ThePhoton pointed out, isn't really a vector.  It's a lot like a vector, but it's really a complex number denoting a sinusoidal current or voltage at some reference frequency that's had the reference frequency component removed.  Thus, you can do arithmetic on it using complex number rules, not vector rules.
When you say "space vector" I believe you're talking about "space vector modulation".  I'm really not sure where the space vector is in space vector modulation, but I suspect that for the time being, you'll confuse yourself by thinking too hard about the "vector" part.
Comment: Explaining where the space vector is would take a long time and an understanding of how AC electric machines work, I think. It's simultaneously a contorted physical space and a state space.
Answer: A space vector results from a mathematical transform of a three-phase system, which results in a vector in the complex plane. As time progresses, the vector moves around and draws its trajectory in the complex plane.
Example for a three-phase voltage system:
\$\underline{a} = e^{\frac{2 \pi}{3} j}\$
\$\underline{u}(t) = \frac{2}{3} \cdot [u_R(t) + \underline{a} \cdot u_S(t) + \underline{a}^2 \cdot u_T(t)]\$
If \$u_R(t)\$, \$u_S(t)\$ and \$u_T(t)\$ describe a pure sinusoidal system, the resulting space vector \$\underline{u}(t)\$, which is a time-dependent complex number, will rotate in the complex plane, and draw a circle there. Every deviation from the circle (e.g. current ripple if one looks at the space vector of inverter current) is related to a distortion in the time domain.
Space vector calculus allows optimization of PWM switching patterns, and allows visualization of complex modulation patterns.
Comment: Can there be a 'Space Phasor' also?
Comment: I am not aware of something like this.
Answer: Key difference: When we multiply two phasors, we get a result that is another phasor in the same 2-dimensional space. When we multiply two vectors we can either do a scalar product and get a scalar result, or a cross product and get a vector that's orthogonal to both the original vectors

A phasor is also a rotating vector

Because we don't use vector operations on a phasor, I think it's misleading to call a phasor a vector.
I don't know how a space vector is defined (and it doesn't seem to be a common enough concept for Wikipedia to have an article on it) so I can't address that part of your question.
Comment: I'm guessing the "space vector" of space vector modulation, a type of VFD modulation scheme.
Answer: a vector has two elements usually a direction and magnitude. Normally it points to a position in an N dimension space from another point, most of the time this other point is the origin so it just points to a position.
a phasor is a convenient way to express an imaginary number pair R+jX where R and X are the real and imaginary components respectively and j is \$ sqrt{-1}\$ as a module and an angle related to the origin.
now space vectors is not like a phasor or a vector even, it is a convenient way of showing an inverter scheme(make AC voltage from DC) for three phase systems. You got three rows of where you have DC voltage so you have you can call them ABC, you can connect each as plus or minus with switches so you got \$A_+
B_+ C_+\$   and  \$A_- B_- C_-\$ now the vectors just indicate who is on and who is off as a state, but ultimately you are talking about multiple DC voltages being turned on and off, there are some rules to it.

simulate this circuit – Schematic created using CircuitLab
So no, a phasor and space vector(modulation) are not the same thing but they can be closely related.
Comment: A vector does not have a point of origin. It's purely a direction and a magnitude. Your explanation of SVM is unclear and rambles a bit, you might want to clean that up.
Comment: alright will edit accordingly

Phasor vs Vector vs Space Vector


Hatcher Proposition 1.31

Question: For the past two days, I have been stuck on the last sentence of the proof below:

I cannot think of any reason why a loop that is the image of $p_{*}$ must be homotopic to a loop whose lift is a loop as well.
Answer: If $[\gamma] = p_*[\delta]$, then $\delta$ is (up to homotopy) a lift of $\gamma$, therefore it is the unique such lift, therefore any lift of $\gamma$ starting at $\tilde{x_0}$ is homotopic to $\delta$, which is a loop, therefore any such lift is also a loop.
Answer: If $[f]\in\pi_1(X,x_0)$ is of the form $[f]=p_*[g]$ for some $[g]\in\pi_1(\tilde X,\tilde x_0)$, then $f$ is homotopic to $p\circ g$, which lifts to $g$, which is a loop at $\tilde x_0$.

Hatcher Proposition 1.31


iOS Calendar is stuck

Question: One of my calendars is stuck on my iPhone. I tried to double-click the home button, but the Calendar app is not one of the icons showing in the task bar, so I can't close it manually. Can you assist?
Comment: What do you mean by "stuck"?
Comment: One point to note, you can't kill the app you're currently in.  You have to return to the home screen before bringing up the task bar, then you can kill the app.
Answer: Try restarting the phone.  This will close all apps.
Hold the lock button (on top of the phone) for 4 seconds, then swipe the red bar to turn it off.  When the spinning icon disappears, hold the lock button for 1 second, and an Apple logo will appear.  Try using your calendar again.

iOS Calendar is stuck


Android app (with felix) crashes with LinearAlloc exceeded capacity

Question: I am running apache felix and an osgi app on android (3.2). This works pretty well so far, but I have rather large chunks of data to load into the application (osgi bundles). The problem with that is that when I load the biggest chunk of data I get

LinearAlloc exceeded capacity

The error seems to come from
LinearAlloc.c
<code>\#define DEFAULT_MAX_LENGTH  (4*1024*1024)

 if (nextOffset > pHdr->mapLength) {
    /*
     * We don't have to abort here.  We could fall back on the system
     * malloc(), and have our "free" call figure out what to do.  Only
     * works if the users of these functions actually free everything
     * they allocate.
     */
    LOGE("LinearAlloc exceeded capacity, last=%d\n", (int) size);
    dvmAbort();
}
</code>
afaik in 3.2/4.x it is even 8*1024*1024, but I still hit that limit. I'm looking to get better insight on what causes this problem and how I might possibly be able to fix it. Any help would be appreciated.
Comment: Please report a bug here: http://code.google.com/p/android/issues/entry  If you can include a small test case to reproduce, that will make it easier for the Androids to fix your bug.
Answer: It's a limitation in Dalvik triggered on unusually complex interface hierarchies.
http://code.google.com/p/android/issues/detail?id=22586
See the details for ideas on working around. Simple answer might be to try using different libraries that are less complex.
A fix has been merged into Android AOSP.
https://android-review.googlesource.com/#/c/30900/


Rigged figure in one Blender file - when append to another Blender file, it shows Armature but cannot animate

Question: First off, I have appended a number of other rigged objects via 'Collections' to Blender files before and they worked as expected. I fact, this human figure was appended before. But, during the course of editing it in project appended into, I made a mess in a variety of ways, including not being about to unhide the armature. So deleted it and appended the figure again. Basically, I am in the same situation as before in that I see in the Outliner the armature, but cannot select it.
Comment: I see now that two other figures that I appended to this project file, these though had their cyclic animation done previous to appending, also don't allow me to see/select the bones.

I opened an old version of the project file and appended the figure with no problems.

It appears that it's a project file issue/setting and not the figure itself or the process of appending it.

Any ideas what setting is causing this global elimination of access to bones?
Comment: Are you certain you appended it and didn't link it?
Comment: I am sure. I did try linking and had a similar result.
Answer: In the end, it was simply that the Bones box wasn't checked in the Viewport Overlay.
At least it wasn't something truly disastrous... just a simple oversight.


Let's assume that gradle code snippets are written in Groovy

Question: Code snippets in gradle-tagged questions are most likely to be written in groovy, so I suggest to make groovy default code language for syntax highlighting in this case. Based on discussion related to this question.
Comment: 9602 of 10255 are only tagged with the library, not the language...
Comment: @Deduplicator yes, this is exactly why I'm requesting this - practically all gradle code is groovy.
Answer: Since gradle is the default build system for Android, you may see quite a few tagged (or mis-tagged) with gradle and Java code from their Android app.  And I'd expect them to use Java over groovy in the build system as well, because all the devs know Java and really nobody knows groovy.  Do you have any statistics to back up groovy being used more?  Because I don't think I've ever heard of groovy actually being used for anything anywhere.


Search Raster Files from Folder that Have Same Spatial Coordinates Using Python

Question: I have approximately 700 raster files in a single folder and I need to find files that have the same spatial extent and copy to a different folder. The raster files measure daily snow cover and therefore have the exact same spatial extent.
Comment: Do you have any code assembled? Any particular package you want to use, such as ArcGIS/arcpy, GDAL, etc.?
Comment: I don't have code assembled.  I'm not sure where to start as I'm fairly new to using python.
Answer: One possible solution using GDAL.
The first trick is get a list of rasters into Python. For argument's sake we'll assume they are all TIFF files, meaning we can use glob to parse the directory:
import glob
raster_list = glob.glob("path_to_folder/*.tif")

I'm going to assume that you don't know what the size is, so you want different folders for each set of rasters with the same size. We'll use the GDAL's RasterXSize, RasterYSize dataset attributes and the GetGeoTransform() method to compare Rasters (see Week 4 slides here for examples of how these work), storing the results in a dictionary.
import shutil
import os
from osgeo import gdal
gdal.AllRegister() #Registers data formats

i = 0 #We'll start with folder zero
extents = {}

for r in raster_list:
    ds = gdal.Open(r, GA_ReadOnly) #GA_ReadOnly is the GDAL Access level
    gt = ds.GetGeoTransform()
    top_left_x = gt[0]
    top_left_y = gt[3]
    bottom_right_x = top_left_x + ds.RasterXSize * gt[1] #x cell size
    bottom_right_y = top_left_y - ds.RasterYSize * gt[4] #y cell size
    #we use a tuple of the extent to store the destination folder
    if (top_left_x, top_left_y, bottom_right_x, bottom_right_y) not in extents:
        f_name = "extent" + str(i) #new folder name
        i += 1
        os.mkdir(f_name)
        extents[(top_left_x, top_left_y, bottom_right_x, bottom_right_y)] = f_name
    #regardless, we copy the file
    shutil.copyfile(r, extents[(top_left_x, top_left_y, bottom_right_x, bottom_right_y)])

Note you could perform an almost identical operation with arcpy.ListDatasets("*", "Raster") and arcpy.Describe(raster).extent if you have ArcGIS (see here and here for docs).
Comment: Hmmm, slight misswording on what I was asking (6 a.m. posts are not recommended). What I have are rasters that are immediatly adjacent to one another (think of it as a square that was divided into four smaller squares.) now I need to find all rasters with the same spatial coordinates. Extent will not work as all 700 rasters have the same size. Is it possible to generate four polygons that cover each of the four different coordinates and search for rasters using those polygons?
Comment: I can see why just number of cells wouldn't work if the rasters are the same size, but shouldn't you get four different sets of extents based on which quarter the raster is in (in projection units)? I could be reading this wrong though.
Comment: Good idea, I didn't of using the projection units for the extent parameters.  Thanks for the suggestion.
Comment: No worries. If it helps, the example above the x origin (`top_left_x`) and the x cell size are in projection units. The `RasterXSize` is the actual cell count. Likewise for y. So in theory it does use the projected extent to calculate overlap. Good luck!