High Sierra macOS Installation Error (com.apple.DiskManagement error 0)

Question: After downloading the new macOS for my MacBook pro (mid-2012) with HDD, the computer restarted but continues to fail during the installation. The error I keep getting is com.apple.DiskManagement error 0. I completed a disk repair but no errors popped up there, so I assume nothing is wrong with the drive. I tried to reinstall macOS from recovery mode, but I continue getting this same error. Does anybody know how to fix this problem?
Comment: I am having this issue too!! Anyone else have any success getting it to work?
Comment: I had the same issue installing the GM last week. After a couple of days trying to fix I gave up and rolled back to Sierra to wait for the "final" version (I guess the GM became the final version).
Answer: yes, i had the same problem with a macbookpro8.2 early 2011. i finally installed it with a bootable usbstick. And i formated the ssd with the old os. here is a workaround from apple https://support.apple.com/en-us/HT201372
Comment: Has there been any explanation why this happens? If I create a disk image from Disk Utility before reformatting the drive, will I be able to restore those files and settings to High Sierra later on? Also my Mac Pro uses a HDD, not SSD -- which means I'm unable to use the new Apple File System.
Comment: 1. you need good skillz and the migration assistant, to transfare your apps from an ol os to the new one. Didn't work in my case,2. the APFS is not supported for non flashdrives. 3. you can make a backup with timemaschine, filevault and if you only need the files, just dragdrop the complete system on an external drive and you are save, but i would not uprgade again, maybe you perfomance is much better with an older os like 10.8 or 10.9.
Comment: I don't care so much about the apps, but I would like to have my files. Is it possible to open the image file (located on external drive) and drag/drop the files, just like files on a flash drive, after new OS is installed?
Comment: that depends on the image typ, but what is the main thing you want to do? you have a old hdd with data right? you want to browse you old files?
Answer: Ok here is how I fixed it,

Start in recovery with ALT+CMD+R
Go to disk utility
Convert the volume to APFS
Restart the installation

The install was really slow like 2/3h but in the end it worked without anything lost.
Comment: ALT+CMD+R is used to start internet recovery, which might not be available on a 2012 MBP
Answer: I had the same issue. It was two long days for me, but the solution was always there.

You have to go to internet recovery mode with Alt + CMD + Shift + R (all of them).
You reinstall the OS that came with your Mac (you won't lose your data)
After you have installed the OS, delete everything related to the previous install (I had to go to the root folder and delete and installation folder)
Download again Mac OS High Sierra and continue with the steps for the installation.

It took a couple of hours (I have a 10 mb bandwidth connection)
Hope it will help for some of you.
Comment: I reinstalled the original OS using this method. After downloading High Sierra again, my Mac doesn't restart to begin the installation process. It says High Sierra is installed, but there is not request to reboot. This has been such a pain. Apple is falling apart before our eyes.
Comment: To fix the restart issue I had to delete the "install macOS High Sierra" app from the Applications folder. After that, I downloaded HS from the App Store. Once again, my Mac restarted, began the installation process, and stopped halfway through saying it could not be installed, please restart. Apparently it doesn't matter which OS I am using, Sierra or Mountain Lion, to install HS. At this point, I'm really not sure what to do other than creating a bootable drive of Sierra and saying the heck with High Sierra.


How do I uninstall Studio 3T on Ubuntu 18.04

Question: I installed Studio 3T on Ubuntu 18.04 using the shell script provided by the vendor. Now, I want to uninstall it and have no idea how to. It does not show up as installed applications in Ubuntu's own package manager.
What do I do?
Comment: Have you check with vendor if install script can act as uninstall script? Or if vendor provide uninstall script/procedure?
Comment: I could not find anything on their Web page. Will try to contact them as well.
Comment: Have you check if its installed in `/opt`?
Answer: To uninstall Studio 3T open terminal in its installation directory (/opt/studio3t) and type these commands:
sudo chmod +x uninstall
sudo ./uninstall

Uninstaller will appear in separate GUI window.
I think the more recent versions of Studio 3T will not require to uninstall previous versions manually.
Answer: The solution is simple.
Run the uninstall script from the folder in which the application is installed.
Typically, Studio 3T installs in the /home/studio3t folder by default. If not present at this path,
If there is a shortcut to launch "Studio 3T" on your desktop, just right-click on it and select "Properties". You should see the installation path mentioned in the dialog box.
Answer: Simply go to the installation directory, named like studio3t, and you can find the uninstall script file studio3t/uninstall.
Open a terminal in that folder and run ./uninstall and press Enter.
It will open the uninstall window. Then press Enter to continue and it will uninstall and redirect to MongoDB website from where you installed the software.
It worked for me.


Cannot create password for account without one.

Question: I have a standard account with no password, then in the terminal it aksed for my password to install a program, I tried just ENTER and the adminstrators password but none worked, then I tried to create a password but I can't cause it says that the current password is wrong, but I haven't made a password yet! what's going on? Any ideas?
Answer: I hope you must have entered a password during installation for sure, if you dont remember and you have access to any other user account with administrator privileges, you can set password for this user from that account. For that you can use terminal,
Login to other account
ctrl+alt+t brings terminal screen type
sudo passwd rohith
here instead of rohith give user name of locked account for which you have lost password.
now you have to enter current user password and then you can enter new password for the other user. and then login to that account with that password.
Second method is by logging into debug mode from grub, and following same command as above
Comment: just tried that but also doesn't work. terminal says password for Jo Rijo doesn't exist. which is correct.
Answer: From my reading of your question it appears that you already have an administrator user on the machine, and you do know that user's password. From that administrator's account you added another user account, without setting a password for it. Now, when you log in as that second non-admin user, you can't install programs because it asks you for a password and you can't give it the password because you haven't set it. Is that right?
If I understood you right, then you need to do the following steps:

log in as your original administartor user.
in console, type
sudo passwd myotheruser

to give the myotheruser account permissions to install software, you can add it to admin group (again, while logged in as the original administrator user):
sudo usermod -G admin myotheruser

After that your myotheruser account will be able to use sudo commands, install software and will have essentially the same privileges as your original administrator account.
Comment: now when I type sudo passwd myotheruser it says that myotheruser doesn't exist.?!?
Comment: Do you literally type "myotheruser" or do you substitute it with the actual username of your other non-admin user account (the one which has no password)? Then you must be making a typo somewhere. To see what the actual username is, type `ls /home` - it'll give you the list of user's home directories which names by default match usernames.
Comment: it was lower case instead of the upper case that the login shows, thx @Sergey. now it seems I have a password and can change it in my account but it still doesn't seem to have an effect. it still doesn't ask me a password to login. + now I don't remember what I wanted to install from the terminal anymore anyway I can use the admin account to do that, so I personally don't have a problem anymore given that I don't want a password to login but it is still a problem for who does I suppose. anyway thx
Comment: @JoRijo: "automatic" login without a password is controlled by a setting in the control panel. You can have a password and still be able to login automatically. In fact, having NO password set would not allow you to log in at all.
Comment: automatic login is not the same as login without need to give password. I have automatic login off always but now that I have a password it still doesn't ask me for it to login.
Answer: It seems that the root (administrator) user doesn't have a password. Just open a Terminal (Dash >> Terminal) and enter the following command:
sudo passwd root

And then enter the password twice. If it doesn't work (sudo shouldn't work if root hasn't a password) try logging in as root on a separated TTY. Please, read all the answer before continuing! Press CTRL+ALT+F2 and enter root. When it asks you for a password, just press enter. Then enter the following command:
passwd root

And enter the password twice. Maybe it'll work!
For going back to the graphical interface (the desktop) just press CTRL+ALT+F7 or CTRL+ALT+F8.
Comment: Enabling password for the root account is not recommended. Also, the idea that you can log in as root by providing an empty password is... err... funny :)
Comment: And how do you login as root without password?


How to display terminal using Ctrl + ~

Question: How do I set the shortcut to display the current terminal that is open?(Let's say I am navigating Facebook and then I press Ctrl + ~ my terminal would immediately display)
Answer: For simplicity I would install Guake from the distro. It is a terminal that once started will run invisible and when you press f12 it will drop down from the top of the screen .. press f12 again or click off of it and it will hide. Go on working and anytime you need to access the terminal just press f12
I think this may be what you are looking for
Answer: Open System Settings. Go to keyboard and select shortcuts. Select terminal and the current shortcut will be replaced by "New accelerator…" Hold down the desired shortcut. Enjoy! (Note: If you ever want to clear a shortcut, simply press backspace)
Answer: you can install
sudo apt-get install nautilus-open-terminal

and see more details click here and its added to ubuntu 15.10 for that see this

How to display terminal using Ctrl + ~


Does a single atom vibrate?

Question: Thermal vibration looks impossible, but does a single atom in vacuum vibrate due to the electrons' or subatomic particles' actions? If yes, how much is that vibration and is there a way to stop it?
Comment: Atomic nuclii do vibrate. "Nuclear energy states", "nuclear energy levels", and "nuclear resonance" would be useful search terms. I'm not sure what the classical physics interpretation would be, or whether or not the vibration of the nucleus corresponds to a vibration of the electron shells.
Answer:
Vibration is a mechanical phenomenon whereby oscillations occur about an equilibrium point. The word comes from Latin vibrationem ("shaking, brandishing"). The oscillations may be periodic, such as the motion of a pendulum—or random, such as the movement of a tire on a gravel road.

Vibration is a classical mechanics phenomenon. Atoms may be considered classical mechanics points when in bulk and a model with mechanical vibrations used, but a single atom can only be described quantum mechanically about its center of mass.
The quantum mechanical wavefunction has electrons in orbitals and nuclei within  the nucleus  in energy levels depending on the quantum mechanical model used. All the periodic functions describing the atom have to do with the probability of measurement, which means many atoms must be measured in order to see the phase space of the possible positions, and any periodic function has to do with the frequencies displayed in the probability distributions, not space distributions for one atom.
Within the envelope of the Heisenberg uncertainty, one cannot know exactly the position of the single atom, because then the uncertainty in its momentum would be very large, but that does not mean it vibrates, it just means that the probability of its location and momentum are correlated.
Comment: So, I get it like *the center of mass of a single atom in vacuum does not change its position due to random vibrations, but -while measuring- there is some uncertainty (due to HUP) which resembles vibration*. Right?
Comment: right, except the vibrations are in probability space, it needs a lot of measurements under the same boundary conditions to see them.

Does a single atom vibrate?


Can we say that even a large angular displacement is a vector quantity in 2D space?

Question: I searched on net for the question, " why are only small angular displacements considered vectors but not large angular displacement? " I saw an video where the reason was given that, this was because large angular displacements did'nt follow commutative property of vector addition but small angular displacements did follow the commutative property of vector addition. It was explained by giving an practical demonstartion how this was true, but in that demonstartion they used 3D space and as per their demonstation I think that in 2D space even large angular displacements follow commutative property of vector addition. So can we say that, even large angular displacement is a vector quantity in 2D space?
Comment: A planar rotation is a fixed vector out of the plane. Since the direction of the vector does not change, then yes, standard vector algebra applies.
Answer: I wouldn't call this a vector quantity. The reason for why small displacements are sometimes described as "vector quantities" (especially in introductory books and courses) is because of their relation with (Lie) group theory:
Rotations in $n$ dimensions form the Lie group SO$(n)$. Small angular displacements are approximately given by infinitesimal rotations. These infinitesimal transformations are given by the Lie algebra $\mathfrak{so}(n)$ (which is in particular a vector space). It can be shown that this Lie algebra is isomorphic to $\mathbb{R}^3$ with the cross product as multiplication. This explains why we often say that small rotations in 3D are "vector quantities".
Your example of 2 dimensions is also an interesting one. It can be shown that the Lie group SO$(2)$ of rotations in the plane is an Abelian group. This means that all rotations in the plane commute (as you said). However this does not mean that these rotations are described by vectors, this is again only the case for small rotations.
Comment: angular displacements , may it be large or small in 2-D space have both magnitude , in terms of radian and direction , either clockwise or anticlockwise , then why are they not considered vectors ? Please explain with some example .
Comment: You could indeed use 1D vectors the way you describe. This is a consequence of the fact that you can relate the circle with the interval $[0, 2\pi[$ (or when using vectors, the real line $\mathbb{R}$) using the exponential function.

However this does not give you a useful technique to find out where points in the plane will go to under a rotation. (As was the case in 3D). How would you compose two rotations in the plane using these 1D vectors?
Comment: related https://physics.stackexchange.com/questions/146897/if-angular-velocity-angular-acceleration-are-vectors-why-not-angular-displace  However, in a 2D (Clifford) space angular position is a bivector e.g. https://arxiv.org/pdf/gr-qc/9608052.pdf
Answer: the criteria for the angular displacement to be a vector it must fulfill this equation.
$$\vec{\omega}=\vec{\dot{\phi}}\tag 1$$
where $\vec{\omega}$ is the angular velocity.
to obtain the angular velocity , you use this equation:
$$\dot{R}=R\,\tilde{\omega}\tag 2$$
where R is the rotation matrix and is function of the angular displacement $\phi=\phi_x,\phi_y,\phi_z$
only if you linearized equation (2) you get equation(1)
with: $\phi=\Delta\phi$ small angles
$$R\mapsto I_3+\Delta\phi\quad,\dot{R}\mapsto \dot{\Delta\phi} $$
$ \Rightarrow$
$$\widetilde{\dot{\Delta\phi}}=\tilde{\omega}\quad,\vec{\omega}=\frac{d}{dt}\vec{\Delta\phi} $$
equation (1) is fulfill thus $\Delta\phi$ is a vector with the components
 $\Delta\phi_x\,,\Delta\phi_y\,,\Delta\phi_z$
2D case
$$R= \begin{bmatrix}
   \cos(\phi_z) & -\sin(\phi_z) & 0 \\
   \sin(\phi_z) & \cos(\phi_z) & 0 \\
   0 & 0 & 1 \\
 \end{bmatrix}$$
you get
$$\vec{\omega}=\begin{bmatrix}
  0 \\
  0 \\
  \omega_z \\
\end{bmatrix}=\vec{\dot{\phi}}=\begin{bmatrix}
  0 \\
  0 \\
  \dot{\phi}_z \\
\end{bmatrix}$$
thus equation (1) is even for large angular displacement
$\phi_z$ fulfill, your statement is correct!

$$\tilde{a}= \begin{bmatrix}
    0 & -a_z & a_y \\
    a_z & 0 & -a_x \\
    -a_y & a_x & 0 \\
  \end{bmatrix}$$


MapReduce implementation in Scala

Question: I'd like to find out good and robust MapReduce framework, to be utilized from Scala.
Answer: To add to the answer on Hadoop: there are at least two Scala wrappers that make working with Hadoop more palatable.
Scala Map Reduce (SMR): http://scala-blogs.org/2008/09/scalable-language-and-scalable.html
SHadoop: http://jonhnny-weslley.blogspot.com/2008/05/shadoop.html
UPD 5 oct. 11
There is also Scoobi framework, that has awesome expressiveness.
Comment: SHadoop is quite old--it uses the old MR framework.  I updated the implicits at some point: https://github.com/schmmd/Hadoop-Scala-Commons
Answer: http://hadoop.apache.org/ is language agnostic.
Comment: the boilerplate does not need to be written in java.
Comment: Write a ScalaHadoopAdapter which takes care of all the boilerplate and publish it as free/open-source?
Comment: I'm sorry but I didn't ask for Java implementation.  Indeed, Hadoop can be plugged into Scala but the boilerplate code have to be written in Java.
Answer: Personally, I've become a big fan of Spark
http://spark-project.org/
You have the ability to do in-memory cluster computing, significantly reducing the overhead you would experience from disk-intensive mapreduce operations.
Answer: You may be interested in scouchdb, a Scala interface to using CouchDB.
Another idea is to use GridGain.  ScalaDudes have an example of using GridGain with Scala.  And here is another example.
Answer: A while back, I ran into exactly this problem and ended up writing a little infrastructure to make it easy to use Hadoop from Scala.  I used it on my own for a while, but I finally got around to putting it on the web.  It's named (very originally) ScalaHadoop.
Answer: For a scala API on top of hadoop check out Scoobi, it is still in heavy development but shows a lot of promise. There is also some effort to implement distributed collections on top of hadoop in the Scala incubator, but that effort is not usable yet.
There is also a new scala wrapper for cascading from Twitter, called Scalding.
After looking very briefly over the documentation for Scalding it seems
that while it makes the integration with cascading smoother it still does
not solve what I see as the main problem with cascading: type safety.
Every operation in cascading operates on cascading's tuples (basically a
list of field values with or without a separate schema), which means that
type errors, I.e. Joining a key as a String and key as a Long leads
to run-time failures.
Comment: Scalding does have a type-safe API: https://github.com/twitter/scalding/wiki/Type-safe-api-reference and in the Fields API (which you are mentioning), joining a string to a long doesn't cause run-time exceptions (if they are both numbers). Of course, in the type-safe API such a join is prohibited by the compiler.
Answer: to further jshen's point:
hadoop streaming simply uses sockets. using unix streams, your code (any language) simply has to be able to read from stdin and output tab delimited streams. implement a mapper and if needed, a reducer (and if relevant, configure that as the combiner).
Answer: I've added MapReduce implementation using Hadoop on Github with few test cases here: https://github.com/sauravsahu02/MapReduceUsingScala.
Hope that helps. Note that the application is already tested.

MapReduce implementation in Scala


How to upgrade SharePoint-hosted app without losing data

Question: I create a SharePoint-hosted app but when this app is redeploy then Data should be Lost.
Answer: For avoiding to lose exist data in SharePoint Add-ins (SharePoint-hosted) there is two way to do that :

If you did a modification just in your scripts or css you can use
   SPFastDeploy
I prefere you to use this way is to map Network drive with your App web
Follow this link replace master page path with your App Web path.

Note : If you modify list or content type or site column
  or Workflow so you need to redeploy.


Run Excel macros in multiple files and paths

Question: I need assistance to enhance the method I've implemented. Here are the details.
I have multiple excel spreadsheets (xls, originally written on Excel 2007 or 2010) that have 3 main macros that I want to automate to run sequentially.
I have one file for each one of our remote locations, each remote locations is divided in three main areas
so I have all those files saved on a shared drive as follows:
Area A (folder)
  Office/Plant A.xls
  Office/Plant B.xls

  Office/Plant C.xls
Area B
  Office/Plant D.xls
  Office/Plant X.xls

I have created a unique VBS per each xls file and then execute all the scripts from a bat file.
The code for each VBS file is basically the same but I have "hard coded" the paths and the file names...
is there a way I can provide the three paths and the names of all the files as variables so the same code can loop through the list of files and execute the three macros in sequence? (the names of the macros are always the same)
This is the code I am currently using: (the files are protected)
Dim xlApp
Dim xlWkb

Set xlApp = CreateObject("excel.application")

Set xlWkb = xlApp.Workbooks.Open("P:\Area A\Office/Plant A.xls")
'xlWkb.RunAutoMacros 1 'xlautoopen ???
xlApp.Run ("unprotect_spreadsheets")
xlApp.Run ("Download_Data")
xlWkb.Save
xlApp.Run ("Protect_SpreadSheets")
xlWkb.Save
xlWkb.Close false

Set xlWkb = Nothing
xlApp.Quit
Set xlApp = Nothing

WScript.Echo "Finished: Office/Plant A.xls"

Can you suggest something? I want to start initializing a list of variables and paths because not all the XLS files on the selected directories are valid entries for the script...
Thoughts?
Answer: VBS is rather inflexible and abstracted from the task at hand, so rather than use it to manage things why not just have a control workbook that triggers and controls the process? The error handling and audit could then be a lot more elegant and informative, and the fact that the objects are native makes things an awful lot easier.


Can I dispute Visa charges beyond 60 days?

Question: I recently noticed some charges on my Visa check card that were made in another state and were not authorized by me.  I filled out and sent in my bank's Visa dispute form, but they told me that it couldn't be processed since it was beyond the 60-day window.  Do I have any way to recover that money?
Comment: check local consumer protection laws. What country are you talking about?
Answer: At this point your only option is to contact the merchant and ask for a refund.
I personally keep a separate ledger (using GnuCash) and balance my statements to it every month; doing so will alert you to unauthorized transactions within the timeframe where you can still dispute them.


Mentioning my clinical depression in a statement of purpose

Question: I have been struggling with clinical depression for over an year now and that has affected my grades. Is it a good idea to mention that in a statement of purpose while applying to a university (for a M.Sc+Ph.D programme)?
Comment: NO and again No
Answer: No. It is not a good idea. These statements are to show your positives and potential. You are not cheating any one if you did not mention that. But no one asked you about your medical history.


Is there a right to keep and bear ammunition?

Question: The Second Amendment protects the right to keep and bear arms. Does this include ammunition?
Answer: This is not definitively decided. A number of states forbid large capacity ammunition magazines, and the law in California was overturned as unconstitutional. In one challenge, a federal judge ruled that the law violated the second amendment and the 3-judge panel upheld that decision, but the full court overturned the decision, so it is not a violation of the 2nd amendment, in the 9th Circuit. New Jersey has a similar law, which has been challenged at the level of the Supreme Court. We don't know for sure, at this point.
Comment: There'd be a lot less question if the laws being contested banned all possession of magazines whatsoever.
Answer: The right to bear arms wouldn't even make sense without the right to also possess ammunition, so any conscionable interpretation of 2A must include both.
As evidence, consider that if it were constitutional to ban all ammunition, a bunch of jurisdictions would already have done so. But even the most draconian of laws don't go that far.
Comment: It's not helped that compared to manufacturing firearms, it's way cheaper to make your own bullets.  Prohibition would be easier to enforce.


Why is the use of Maybe/Option not so pervasive in Clojure?

Question: Why does Clojure, despite such an emphasis on functional paradigm, not use the Maybe/ Option monad to represent optional values? The use of Option is quite pervasive in Scala, a functional programming language I use regularly.
Comment: I am going to point to Daniel's excellent answer on why Scala uses Option[T]; maybe the answers should read it first. - http://stackoverflow.com/questions/2079170/why-optiont/2079758#2079758
Comment: This talk by Rich Hickey might give the most definitive answer: https://www.youtube.com/watch?v=YR5WdGrpoug. The talk is titled "Maybe Not" and Rich discusses the reasons why `Maybe` or `Option` don't make the most semantic sense as they are implemented in Haskell, for instance.
Answer: Clojure is not statically typed, so doesn't need the strict this/that/whatever type declarations that are necessary in haskell (and, I gather, Scala). If you want to return a string, you return a string; if you return nil instead, that's okay too.
"Functional" does not correspond exactly to "strict compile-time typing". They are orthogonal concepts, and Clojure chooses dynamic typing. In fact, for quite some time I couldn't imagine how you could implement many of the higher-order functions like map and still preserve static typing. Now that I have a little (very little) experience with Haskell, I can see that it's possible, and indeed often quite elegant. I suspect that if you play with Clojure for a while, you will have the opposite experience: you'll realize the type declarations aren't necessary to give you the kind of power you're used to having in a functional language.
Comment: @missingfaktor: No, I think amalloy has a point—dynamically typed languages often use some value (such as `nil`) to represent "no such thing", but this value is of a different type (in Scheme, it's a list; in Ruby, it's the only instance of `NilClass`; I've never used Clojure, but I imagine it's like Scheme in this regard).  Without the static type system, there's no need to lift the result into `Maybe`; that's implicit, so to speak.  I personally tend to prefer the way Haskell/Scala does it, but there's nothing wrong with the other approach in a dynamically typed language.
Comment: You probably didn't get my question. My question has absolutely nothing to do with type declarations.
Comment: In my experience, `Maybe`/`Option` is useful regardless of whether the language in question is statically typed or dynamically typed.
Comment: Clojure has a focus on atomic pieces of usefulness, having just read up on that the kinds of things that Maybe/Option provide, it seems to me that there are many concerns to be addressed with Maybe/Option that get more specific treatments in Clojure.
Comment: @Antal - Clojure is less like Scheme and more like Common Lisp in the sense that is uses nil for "no such thing"
Comment: You can very helpfully use the Maybe monad in Javascript, it has nothing to do with static typing: https://jrsinclair.com/articles/2016/marvellously-mysterious-javascript-maybe-monad/
Comment: @Nowhereman realize this is a couple of years old but... no. Not really. There is no Maybe monad in Javascript. Monads are a *type-level concept*, they don't really have a term-level reification. You can't even really do the Maybe monad in *Typescript*, because the language lacks proper sum types. That's not to say that JS or TS are *bad*, or that sum types are *good*, just that the concepts don't totally transpose. The article you link does as good a job as it's possible to do in JS a la fantasyland, but it isn't really the same thing.
Comment: @JaredSmith what exactly can't be done in TypeScript? I've seen monad libraries in JS and in some I didn't spot anything missing in the features that make a monad.
Answer: In Clojure, nil punning provides most of the functionality that Scala & Haskell get from Option & Maybe.
**Scala**                **Clojure**
Some(1) map (2+_)        (if-let [a 1] (+ 2 a))

Some(1) match {          (if-let [a 1]
  case Some(x) => 2+x      (+ 2 a)
  case None    => 4        4)
}

Scala's Option & Haskell's Maybe are both instances of Applicative.  This means that you can use values of these types in comprehensions.  For example, Scala supports:
for { a <- Some(1)
      b <- Some(2)
} yield a + b

Clojure's for macro provides comprehensions over seq.  Unlike monadic comprehensions, this implementation allows mixing instance types.
Though Clojure's for can't be used for composing functions over multiple possible nil values, it's functionality that's trivial to implement.
(defn appun [f & ms]
  (when (every? some? ms)
    (apply f ms)))

And calling it:
(appun + 1 2 3)    #_=> 6
(appun + 1 2 nil)  #_=> nil

Comment: The Maybe monad makes the nil punning outside functions, which makes you free to write and use functions that presume they received valid arguments. So nil punning in itself is very far from providing most of the functionality of the Maybe monad.
Answer: It is important to remember that the Monad concept is not about types! Type systems help you enforce the rules (but even Haskell cannot enforce all of the rules, since some of them (the Monad Laws) are cannot be fully expressed by a type system.
Monads are about composition, which is a very important thing that we all do every day in every programming language. In all cases, the Monad tracks some "extra context" about what is going on...think of it like a box that holds onto the current value. Functions can be applied to this value, and the extra context can evolve as an orthogonal concern.
The Maybe type is about chaining long sequences of computation together while not having to say anything at all about failure (which is the "extra context"). It is a pattern that moves the "error handling" out of the computation and into the Monad. You can string a sequence of computations on a Maybe and as soon as one fails, the rest are ignored and the final result is "nothing". If they all succeed, then your final result is the monad holding the result value.
This allows you to write code that is much less entangled.
Clojure supports Monads, as @deterb pointed out.
Comment: Finally, an explanation of Monads without having to first understand category theory.  This is truly what Monads are all about.  It's a shame most attempts at explanation obfuscate this with arcane mathematics.
Comment: Your point about Maybe being primarily about error handling uncovers another thought.  Perhaps the reason why the Maybe type is not as ubiquitous as in other functional languages is because Clojure doesn't eschew throwing Exceptions as a form of error handling, which often accomplishes the same result as chaining a bunch of Mondads together.
Answer: Maybe/Option is a type. It has nothing to do with functional programming. Yes, some languages (Scala, haskell, ocaml) besides being functional also provide a very powerful type system. People even say about haskell that it is a programming WITH TYPES.
Others (clojure, lisp) do not provide much in terms of types even though they are fully capable functional languages. Their emphasis is different, and Maybe/Option type does not fit in. It simply does not give you much in dynamic language. For example many clojure functions operating on sequences (lists, vectors, maps) will perfectly accept null (nil) and treat it as empty structure.
(count nil) will give you 0. Just like (count [])
Clojure cannot be called a "programming with types" and thus Maybe type does not make much sense in it.
Answer: Well there is a Maybe monad but it uses nil as Nothing, capturing only the abstraction of computation (if input=nil return nil else calc whatever with input)to avoid null pointers errors but it doesnt have the static compile-time safety. There is fnil too that have a similar mission, patching nil with default values and a -?>. I think the clojure way is more oriented to return default values that raise errors or nil.
Answer: Going with @amalloy and comments that Clojure, as a language, doesn't have a need for an optional return value.
I haven't done much with Scala, but Clojure doesn't need to know the strict details about the return type to be able to work with a value.  It's almost as if a Maybe monad was embedded and made a part of normal Clojure evaluation, as many of the operations, if performed on nil, return nil.
I took a quick look at the Clojure-Contrib library, and they have a monad package which you may want to look at.  Another item which really clued me into how one would make use of Monads in Clojure, is Cosmin's tutorial on Monads in Clojure.  It was this that help me connect how the functionality that is stated more explicitly in Scala is handled as part of the dynamic Clojure language.
Answer: There is some-> and some->> available since Clojure 1.5
(let [input {:a 1 :b 2 :c {:d 4 :e 5 :f {:h 7}}}]
  (some-> input :c :f :h inc))
user> 8

(let [input {:a 1 :b 2 :c {:d 4 :e 5 :f {:h 7}}}]
  (some-> input :c :z :h inc))

user> nil

(let [input {:a 1 :b 2 :c {:d 4 :e 5 :f {:h 7}}}]
  (-> input :c :z :h inc))

user> NullPointerException   clojure.lang.Numbers.ops (Numbers.java:1013)

The some-> function is providing the Option[T].
Comment: Your answer could be improved by giving a little blurb about what some-> and some->> do, and perhaps what clojure 'pattern' they replace.


700ccx28 rims with 25 tread and 28/32 tube does it work?

Question: So I have a pure fix, first problem, I replaced the rim strip and the tubes popped far less. I only replaced them a couple times from a nail and too much weight. I needed new tread, the shop owner put on the 25's and the tubes are 28/32 kendas. The tubes popped each time in the same place, near the stem. 3 different tubes. Is this a tube size issue or rim issue?
Comment: Probably your tire pressure is too low, or you are mounting the tires incorrectly.  When you mount the tire, make sure the tube is "sorta" inflated before you insert it, and make sure the stem is square to the rim before inflating the tire.  And use a proper tire pump with pressure gauge when inflating -- you can't go by "feel".
Answer: I think you need to find a new shop.
Your typical Velox rim strip should last on the order of decades unless a spoke goes through them or something (and that should be fixed, not just putting a new rim strip), so I'm not sure why it was replaced (or if it was done properly -- right size tape, covering all the spoke holes, aligned with the valve hole which is clean).
The tube size shouldn't be a problem. My suspicion is that you're not running high enough pressure, or aren't installing the tube properly (having the valve free and straight). I'm not sure why the shop owner didn't put a 25c tube in though, considering they're probably the most common size to have on hand.
As for tire wear, using brakes rather than skid stopping reduces tire wear. But, increased tire wear does come with the fixie territory, I suppose. Skidding wears the tire unequally depending on the chainring and cog size.


'Select as default' not working - Juno

Question: I am unable to set default application for images and text. I have to open files using 'open with' every time. E.g. Sublime is set as default for text files in settings, yet it asks for default application.
Comment: Please wait for the updated (fixed) version. Voting to close down as it can't be solved here by answers.
Answer: Looks like a known bug and probably will be fixed soon
https://github.com/elementary/files/issues/836

'Select as default' not working - Juno


Why does Earth have two kinds of crusts?

Question: Why does Earth have two clearly differentiated kinds of crusts, namely continental and oceanic? How did they differentiate initially and why don't they get mixed up over time?
Comment: Such a simple question, with such a hard and complicated answer. It is still one of the heavily debated topics in geology.
Comment: I think an intrusive vs extrusive answer could be made, but as geology isn't my subject, I'd prefer that someone not be me.    http://www2.nau.edu/~gaud/RiodeFlag/ignsrck.htm
Answer: First they do get slowly mixed at the plate boundaries but the mixing is minimal compared to the amount of crust there is. They do not mix easily since they have different densities, they tend to separate out when melted so most mixing is done in their solid states.
An easy way to think of it is there is not enough continental crust to cover the entire planet so oceanic crust is filling in the gaps. A better analogy is to think of continental crust as scum on pond (or foam in a tub). The uppermost portion of the mantle and oceanic crust are basically the same thing, oceanic crust is just colder, while continental crust is different in composition it is lighter and floats on top but as I said there is not enough of it to cover the entire planet so like scum on a pond it forms clumps and gets pushed around by the underlying currents. And just like pond scum they separate out because they have different densities than the "water" so they collect on the surface.
Comment: I'm sorry, but this is a terrible answer! As a geo-enthusiast, I'm also slightly embarrassed by our community's inability to flag such answers as outright wrong.
Comment: @KnobScratcher we do, its called voting and comments.
Answer: Before earth had water on it's surface, two main types of rocks formed to create continental plates.
basaltic rock

and Granitic rock

Continental crustal material is just sligtly less dense than basaltic rock because when heavier basaltic rock is subducted under the continents and melts once again, the lighter such elements like aluminum and silicon on the otherhand tend to move upward and the heavier elements and minerals like Iron migrate down. That makes for the iron-rich portions on the other hand are being recycled back into the mantle and the silicon rich rocks ascending to the surface. Volcanic eruptions that occur above the ocean may deposit new basaltic rock in turn weighing down continental plates but it's continuous activity however granite's higher melting point means more weight must be contributed
Comment: Suggest maybe a reread of some of the grammar, as it's pretty tough to understand.
Comment: "when heavier basaltic rock is subducted under the continents and melts once again": while there are some occurrences of oceanic plate melting (see adakites), it is generally not how subduction works. It's the mantle wedge above the subducting plate (the slab) that melts due to the release of fluids from the slab, which lowers the melting point of peridotite (a process called metasomatism).


Do I need root to install xposed modules?

Question: Is it necessary to root my phone to install any xposed module?
Answer: You don't need root to install xposed modules and you can avoid using root to install the framework if you have a working recovery that can install unsigned zip files.
Comment: I think a distinction should be made here. The Android doesn't have to be rooted to install a module, but a custom recovery still uses root access within its environment to install those modules. So root access is indeed needed, just not necessarily in Android OS though.
Answer: Root is a requirement to install the Xposed Framework, any additional modules can be installed (may not explicitly state root requirement) but need the Xposed framework to function, so in short yes root is needed.
Comment: As the other answer states, root is a requirement only if you're using the framework installer.
Comment: The "conventional" way of installing a recovery usually requires an unlocked bootloader (no root required). Furthermore, for many recent devices, only after installing a custom recovery can you flash a SU package and therefore achieve root.
Comment: @AndyYan Thanks for mentioning that important point which I had overlooked! (I was used to installing Xposed framework without zip, so completely forgot about this other method:)) But one question. I am not an expert when it comes working with recovery, but doesn't installing a custom recovery require root also?
Comment: @Andy Thanks for putting this up, perhaps OP can accept, the second answer. I am not really used to flashing zips though but thanks for the information


Poynting vector in a simple DC circuit

Question:
This image
I took from Wikipedia shows the directions of E(red) and B(green) and poynting vectors(blue) at different locations on the circuit. I don't seem to understand why the E fields(red) are pointing from up to down in that manner in between the circuit at plane P. Is it because the wire on the upper part is connected to the positive terminal and hence must E field lines must emanate from every part of the wire?
Answer: Suppose the wire was made out of copper with a diameter of 2 mm, and the + and - wires are distanced 10 cm from each other. Also let's assume the voltage was 1 V and the resistor was 100 Ohms, thus the current is 10 mA. We ignore the loss inside the battery and suppose it was an ideal voltage source.
The conductivity k of copper is ~ 6E7 S/m, thus the current density is ~ 3.18 kA/m². The strength of the electric field along the wire E = J/k is around 0.54 µV/m. The maximal field strength between the + and - wire is E = V/d = 1 V/10 cm 10 V/m for the shortest path, thus the electric field outside the wires (shown in this picture) is approx. 2 million times stronger than the field inside the wires (not shown).
What about the magnetic field? Applying ampere's law to the infinite wire tells us that the magnetic field is proportional inside the wire, and falls off by ~ 1/r outside of the wire. The maximum magnetic field strength is thus closest to the surface of the wire, around 1.6 A/m. Only 5 cm away from the wire it drops off to 32 mA/m - 50 times weaker.
Suppose the resistor is 6.8 mm long and has a diameter of 2.5 mm (taken from a data sheet). The maximum strength of the electric field E_max along the resistor will be approx. 1V/6.8mm = 150 V/m. The maximum poynting vector is E_max*H_max = 16 W/m². If you only take the poynting vector along the surface, the dissipated power is around 12.5 mW, for a more careful consideration you would need to perform integration over the entire volume of the divergence of the poyinting vector.
A more simple calculation that comes fairly close is P = U * I = 10 mW.
So yes - the power flows along the blue field lines, but most of it in very close proximity to the wire, so it does not really matter and we might just aswell say "power flows along the wires".
Comment: Should be 53uV/m (100x more electric field)
Answer: There is a downward electric field in the P plane because the upper wire is at higher voltage than the lower wire.  So there is in effect more positive charge on the upper wire than the lower one.
Answer: Short answer: There is a potential difference between wires, so there must be an electric field between those wires, going from positive to negative. The electric field inside the conductor is very, very weak, and ideally (in a perfect conductor) it doesn't exist at all.
More detail:
The concepts of voltage (electric potential) and electric field strength cannot be separated. One cannot have a potential difference between two points in space without an electric field existing between those two points. Voltage is a description of electric force between two points just the same as the electric field is a description of the electric force at a point. The difference is voltage is actually the electric potential energy per charge between two points i.e. how much energy is required to move a charge from one point to the other. This is directly related to the electric force on the charge, and thus the electric field in the region between the points.
The electric field between two conductors with a potential difference (a voltage) between them will point from the positive wire to the negative wire, i.e. from the point of higher potential to the point of lower potential, because a charge in this area would be forced towards the lower potential. The closer two wires are with a given voltage between them, the stronger the electric field. The electric field will depend on the geometry of the circuit because of this.
This is the reason for the familiar phenomenon of static shock occurring when you get closer to a doorknob. There's a potential difference between your hand and the doorknob, and the electric field gets stronger as you get closer to the doorknob, until you're so close it causes electrons to be stripped from air molecules (ionization of the air) and a rapid movement of charge.
The electric field inside a conductor is only required for overcoming the resistance of a wire. Charge will not flow perfectly in a non-ideal conductor, so we need some non-zero force to keep charges flowing. In a superconductor, once a current is started, it can continue forever, with no electric field existing inside the conductor. There is only zero electric field in a conductor that is lossless.
Answer: No. There is no electric field in the space enclosed by the current loop. The wires aren't oppositely charged, and the potential is the same everywhere inside the space enclosed. So there is no gradient of potential, and there is no electric field in the space between the wires. You aren't powering the circuit with a discharging capacitor. This misconception is everywhere, and it took me awhile to figure out. A lot of Physics people don't get batteries, and Chemistry-types don't explain Physics well. Batteries create an electric field in the circuit only. I also wonder about the field shown inside the battery in the first picture. Does it point in the wrong direction? The top of the battery isn't positively charged, and positive ions must flow up in the battery (or negative ions would flow down) across a porous material within the cell to ensure that no net charge accumulates anywhere. That suggests the electric field in the battery might point up, not down. But then again, if the field points up, then it would take work to move the positive ions up, and you could say that this is the work the battery does.
Comment: It's hard to back up my downvote with constructive criticism as I consider basically every sentence flawed or wrong. Trolling ?
Comment: Nope, I'm just trying to understand circuits better and thought I'd put my thoughts out there to engage in potentially educational discussion.

Poynting vector in a simple DC circuit


Blocking users from downloading files on mobile devices

Question: I'm currently researching ways to restrict users from being able to download files on mobile devices, that are not managed by my company. I'm aware that Microsoft offers an easy solution for this, but unfortunately this requires an upgrade of our license to Enterprise Mobility + Security.
Is there another way to achieve restricting downloads to mobile devices? I've looked into working with the Sharepoint online managment shell but without any success.
Any help is greatly appreciated.
Answer: You will need to use Conditional Access Policies in Azure AD which will require licensing.
Comment: Thank you for your answer! Is there no way to do this with the sharepoint shell? The documentation provided by Microsoft is quite vague.


Perpetual Motion Machines

Question: If you go on YouTube, you will find a large number of machines that work for almost forever. But why do all of them stop working after some time?
Which Law (Other than Conservation of Energy) prevents a machine from running till eternity?
Comment: How do you define eternity?
Comment: Depends on the machine. Different machines exhibit conservation of energy in different ways.
Comment: But "Almost" Perpetual Machines are high energy efficient, right ?
Comment: Maybe it could be grabbed by some entropy thing.
Answer: Most don't work due to the laws of thermodynamics, usually the first law which states that energy can neither be created or destroyed as you mentioned in your question . This stops the opportunity for many perpetual motion machines as most lose heat (and therefore energy) in the process. Without putting more energy in the total energy of the system will run out.
Aside from conservation of energy there is the second law of thermodynamics, which states that the entropy of any isolated system always increases (entropy is defined as the measure of a system's thermal energy per unit of temperature that is unavailable for doing useful work). This means that over time less of the systems energy will be able to do the work, and the machine will eventually stop.
The ones that contain magnets and objects rolling up ramps, dropping down and rolling up again etc. don't work because eventually the magnets will stop being magnetised.
Other's I've heard of are things such as capillary action by water going up a tube and dropping down. The problem with ones such as that is that if the water's gone up against gravity, it's not going to drop out without external force.
Hope this answers your question - commennt other supposedly perpetual motion machines if you're not sure of their problems and I'll see if i can find one :)
Comment: @Countto10 But to influence the system local or not 'something' has to enter the system surely, regardless of locality. And in my mind a perpetual motion machine just isn't if it isn't an isolated system. Maybe I'm just misunderstanding your comment?
Comment: Conservation of energy is a local law, and appealing to the laws of thermodynamics leaves a  probabilistic loophole. I know that we both know they are not perpetual, but I personally wouldn't argue based on  those laws.
Comment: Sorry Cooper, I definitely don't want this to veer away from conventional  physics. This question is bound to return again and I will be better informed to expressed myself more clearly in future. I rushed this a bit, frankly but I  learnt a lot. Regards.
Comment: Hey Cooper,what about perpetual motion machines which work due to the center of load being unbalanced ?
Comment: Do you mean something like this: https://www.lhup.edu/~dsimanek/museum/overbal1.gif? Say this is on an axle. To my knowledge all this would do is change the centre of mass downwards. With a low centre of mass this causes the wheel to swing back and forth until it eventually stops.
Answer:
Which Law (Other than Conservation of Energy) prevents a machine from running till eternity

Why is the law of energy conservation not fulfulling for you to answer that? There is always energy conservation, and that is the sole reason that you can't draw more energy out of a machine than is put in.
That the output is always even less than that is a result of efficiency considerations (the Carnot limit e.g.)
So, drawing energy from a machine will cause it to eventually stop. But if you don't draw energy from a motion, then theoretically it will continue running forever. A rolling wheel will in theory never stop rolling if nothing stops it. A space ship drifting in space will never stop drifting but forever have constant velocity, until something stops it. But here on Earth we never see anything lasting forever. There is always friction, deformations in materials, air resistances etc. even in the smoothest gears, and all that cause small energy losses. Nothing is ideal; everything will stop eventually.
Comment: Hi https://physics.stackexchange.com/questions/333489/conservation-of-energy-in-general-relativity implies that on a global scale, energy is not conserved. So thinking, really really big, (total thought experiment, PM machine), the law of conservation may not be the barrier usually accepted for local systems. I not sure either of us  wants to get away from practical physics, but if I could harness the expansion of the universe in some way, well......:)

Perpetual Motion Machines


How does one count time within a smart contract

Question: Imagine there is a bidding smart contract and i have a maximum time limit set for it. How would i count time within this smart contract in cardano ? Can i get the slotIds and use that as proxy count of time or is there any other way to read time within cardano blockchain ?
Answer: You can use either slots or regular time, see https://playground.plutus.iohkdev.io/doc/haddock/plutus-contract/html/Plutus-Contract.html#g:2


Chebyshev's inequality to compute the premium income

Question: This is a problem 9.7 from Anderson "Introduction to probability"

A car insurance company has $2,500$ policy holders. The expected claim
  paid to a policy holder during a year is $1,000$ with a standard
  deviation of $900$. What premium should the company charge each policy
  holder to assure that with probability $0.999$ the premium income will
  cover the cost of the claims? Compute the answer with both Chebyshev's inequality
  and CLT.

Assuming each claim is independent, then the aggregate claims $S = \sum_{i=1}^{2500} X_i$ where $X_i$ is the annual claim size for policyholder $i$, then $$\operatorname{E}[S] = 2500 * \operatorname{E}[X_i] = 2500 * 1000 = 2500000,$$ and variance $$\operatorname{Var}[S] = 2500 \operatorname{Var}[X_i] =2500 * 900^2.$$
We want to fins s (the premium income), such that $P(S\leq s)=0.999.$ This is equivalent to $P(S\geq s)=0.001.$ By Chebyshev's inequality
$$P(S\geq s) = P(S-\operatorname{E}[S]\geq s- \operatorname{E}[S])\leq P(|S-\operatorname{E}[S]|\geq s-\operatorname{E}[S])\leq \frac{\operatorname{Var}[S]}{(s-\operatorname{E}[S])^2}$$
My question is how do we get the desired equality from this inequality? Thanks
Answer: I guess that the answer consists in solving the inequality:
$$\frac{\operatorname{Var}[S]}{(s-\operatorname{E}[S])^2} \leq 0.001,$$
which solution is:
$$s \geq \sqrt{\frac{\operatorname{Var}[S]}{0.001}} + \operatorname{E}[S]$$
or
$$s \leq \sqrt{\frac{\operatorname{Var}[S]}{0.001}} - \operatorname{E}[S].$$
So the solution is $ \sqrt{\frac{\operatorname{Var}[S]}{0.001}} + \operatorname{E}[S]$.


Switching basemap automatically in QGIS?

Question: I want to know if there is a way to switch basemaps if some basemaps are not able to show any imagery while creating an atlas in QGIS. I understand it is possible to do it individually but when you have an atlas with hundreds of maps it would be great if this is automated.
Comment: There's no way for QGIS to auto-detect that map data isn't available for an area. This means you need to figure out which areas don't have map data in a given base layer, and specify for the atlas to use a different base layer for those pages. Dmitry suggested one way of doing this using scale-based visibility, because usually basemap data availability is scale-dependent. If that's not the case for your atlas, you add it as an attribute to the atlas feature, and use that attribute to choose the basemap.
Answer: You can add several basemaps and setup scale dependent visibility for each. Check that scale ranges adjoin or overlaps.
Comment: I understand that but even if I setup the visibility ranges using different basemaps it still wont solve the problem of imagery not showing due to the basemap not being able to produce the imagery for that area. So if the imagery is not produced for a area as shown the next basemap that I have setup within the next range wont matter because it still is within the previous basemaps range but its just not showing for some reason.
Comment: You need manually set right scales where basemap data are present. And out of scale range the basemap layer will not shown and another basemap layer will. Just do it for the whole project and it will work in any atlas page. For spatial filter of basemap you can set vector area where raster data are present and mask it. Please update your question that you mean not scale range but spatial filter.


Why is audio so often out of sync when the actors are filmed from behind?

Question: I've noticed that in almost every TV show or movie I've ever seen, the audio does not sync up with the actor's jaw/mouth movements when the actor is being filmed from behind. It looks as if the actor is saying something completely different than the audio I hear. It's shocking how universal it is - pick any live-action content and you'll see it at least 90% of the time. Reality shows, comedies, action, it doesn't seem to matter, they're all affected. It's worst in quick cuts. Why is this?
Comment: This seems like a completely valid question. People have to start learning at some point, and this could be someone's jumping-off point.
Comment: Without specific examples this is for sure going to get VTCed. However, I do know what you're talking about and whenever I encounter this I always chalk it up to cheap/quick editing. Maybe there was something wrong with the original shot that wasn't noticed at first so they just strip the audio and use a different angle, one that doesn't include the speaker's mouth.
Comment: Yeah I'm confused about this being on hold. As someone who has done some audio post work, I can say there is a definite, objective answer to this. Abdnit seems to be on topic.
Comment: So you are saying that if 2 actors are having a conversation with one facing the camera and one looking away from the camera, the audio seems to be in sync with the actor facing the camera but out of sync with the person facing away?
Comment: Yes - but it's less egregious in extended dialogue scenes than it is in quick cuts.
Comment: Agreed. This question is absolutely on-topic. VTC is being abused more and more on these sites, but especially on the M&T Stack. A 24-hour block on VTC or placing on-hold should be put into place (unless the question is just absolutely vulgar), to give readers a chance to decide whether or not it actually is off-topic or outside of guidelines.
Answer: Because the sequences are edited. You may be watching an edit assembled from several takes and entire lines of dialogue may be omitted at the editing stage.
On some shoots, there may only be one camera. This means the scene has to be shot from one angle, performed multiple times, then the reverse shot set up, performed multiple times and an edit assembled, usually from the preferred performances, but sometimes combining different takes if there are any problems.
The use of cutaways and "noddies" - nodding interviewers - is a telltale sign of editing in interviews that most people don't notice, but once you're aware of how video is put together, you notice it all the time.
Comment: I agree completely.  And perhaps more to the point, when editing, the editors are focused more on syncing audio to the lips of people facing towards the camera than syncing it to the jaw movements of the people facing away, since the latter is less likely to be noticed (although some people, like OP obviously, will notice it.)
Comment: Not sure, but might also mention that in some of those over the shoulder shots, the back of the head we see is often a stand-in for the actual actor.
Comment: Also, often when shooting over someone's shoulder, they are asked to not to face directly person whose face is in shot, but slightly to one side of them. Otherwise the side of their face is not it shot, just the back of their head, which looks odd.


What is the significance of a processors bit capacity?

Question: I'm learning about how processors send an address to ram through the address bus, and receive and send data from ram through the data bus. In the videos I have watched, the processor was an 8 bit processor that had 8 wires coming out for the data bus, and 8 wires coming out for the address bus, where each wire carried one bit of information, either off or on. That got me wondering. Does a 32 bit processor basically work the same way, but it can send more bits through the address/data bus at one time. What about a 64 bit processor. I haven't learned about registers yet, but I'm getting there. Does it have something to do with the size of the registry? I understand the parts of a processor, but I don't understand what people mean when they classify a processor by its bit capacity.
Answer: There are several components in a microprocessor that may all have their individual size: data bus, address bus, registers, and ALU (arithmetic logic unit). Modern CPUs also have caches, memory management units, floating point and single instruction multiple data (SIMD) units. (Also nowadays you have multiple CPU cores in one CPU.)
All those units may have their own bit size. E.g. the 68000 had a 16 bit data bus, 24 bit address bus, 32 bit registers and a 16 bit ALU (and none of the modern stuff).
Historically, the processor classification in bits (8, 16, 32, 64 and so on) gives the size of the ALU. This means that an 8 bit processor can handle 8 bit of data in one cycle, a 16 bit processor 16 bit data and so on. This does not mean that they can't handle larger data, it just takes longer. E.g. the 68000 required two cycles to add two 32 bit values.
Answer: A 64 bit processor has a datapath and memory address width of 64 bit. The integer size is also 64 bits. In addition the registers, address bus and data bus is 64 bits wide.
Likewise in a 32 bit processor the datapath, memory address width, integer size, register size, etc are 32 bits wide.
Also the free online embedded systems course from University of Texas on edx.org that might interest you. This topic is covered and there are like minded student you can bounce back questions.
References:

64-bit computing
32-bit computing
Embedded Systems - Shape The World


lightroom for video

Question: I shot an event for a client. The client did not want me to make an after-movie, and they just wanted footage for promotion the following year. So I am supposed to deliver the video files.
I want to be able to trim off the fat from some clips, and perhaps even do some basic cc. It would be a horrible amount of work if I imported all files into Premiere and did this on a per clip basis then export/transcode in batches. I've thought of Catalyst Browse but it doesn't support my file type (ProRes .mov), and Prelude does not seem to be designed for this either, nor do I see a color correction panel (which I can live without).
Any suggestions for a windows computer? I was thinking of a sort of lightroom for video.
Answer: Did you tried Blackmagic DaVinci Resolve 12?
How I understand, it should work fine with multiple files, but you shall check, if it will accept your ProRes files.

lightroom for video


Accessing Time Machine backup from Windows/Linux laptops

Question: I'm wondering if I can access my time machine backup from Windows or Linux computers... I'm just wondering what'll happen if my computer fails and I don't have enough money to buy a new mac...
Comment: iiegn has a [python script](http://iiegn.blogspot.com/2009/11/how-to-access-time-machine-files-from.html) that tries to automate the restoring process. I didn't try it yet though.
Answer: It CAN be read from linux (By using Ubuntu for example) but it is a tough nut to crack. Windows can't do it at all.

The following commands need to be executed as a privileged user. To gain the necessary rights do
$ sudo su

You should then be prompted with the root shell.

The following came from http://hints.macworld.com/article.php?story=20080623213342356

It turns out Apple does a couple slick
  things with the file system to make
  incremental backups work, including
  hard linking to directories, which
  isn't allowed in Linux. So for anyone
  that needs to access their Time
  Machine from something other than its
  associated Mac, here's how you do
  it...
1 - Mount the drive. On linux, it should automount if you have
  gnome-volume-manager installed. If you
  don't see it in /media, then run
  nautilus and check the desktop. Still
  don't see it? Read man mount. And then
  don't forget the -t hfsplus flag.
2 - Change directory. My mount point is /media/Time Machine/. Within that
  path, I find the directory
  Backups.backupdb. This represents the
  directory layout of your backup
  system. Inside that directory is the
  name of your disk. Inside that are
  folders labeled with dates
  corresponding to each incremental
  backup that was made. Pick the one you
  want, or choose the Latest symlink.
  For example, my path is now:

/media/Time Machine/Backups.backupdb/Drive 1/2008-06-05-073745

3 - Find your file's folder. Within that path is a complete representation
  of your filesystem. Navigate to the
  location of your file. If it's not too
  big or nested too deep, it may be
  plainly visible. However, there's a
  good chance that its parent directory
  doesn't exist. Instead you'll see a
  zero-byte file for the parent that
  takes its name and acts as a pointer.
  Run ls -l and take note of the first
  numbered column. Example:

...
-r--r--r-- 2155704 root 5791966       0 2007-06-25 02:54 Wallpaper
-r--r--r-- 2155725 root 5791967       0 2007-06-25 02:54 Web-Identity
-r--r--r-- 5441953 root 5791968       0 2007-06-25 02:54 Windows
-r--r--r-- 5511926 root 5791969       0 2007-06-25 02:54 Work

After the permissions, you'll see the
  directory number that typically refers
  to the number of directories within
  that folder. For a file, it should
  always be 1, but here it is not. What
  Apple has done is adjust the
  information in this file's inode to
  use it as a pointer to the directory
  that contains the actual file. That
  way, multiple revisions of the same
  drive can coexist without duplicating
  data.
4 - Find the data. In my case, I want to grab something out of the Wallpaper
  folder. First I made a note of the
  directory number, 2155704, and then
  did cd /media/Time Machine/.HFS+
  Private Directory Data -- this is
  where the data really lives. From
  there, I just did cd dir_2155704, and
  voilà !
Comment: It is the way to go. you saved my day! I managed to recover some documents from an old time machine backup five years ago. Thanks you so much
Answer: I found another script, that creates a read-only FUSE Overlay to implement the TM hardlinking mechanism:
https://github.com/isnotajoke/fuse-time-machine
Answer: I've written a script to automate this pain. Find it here: https://gist.github.com/vjt/5183305
Answer: Besides the FUSE file system for Time Machine backups mentioned by strfry and written by Kevan Carstensen, there exists an implementation by Ron Pedde. In my case the implementation by Carstensen could not properly resolve all links. The one by Pedde worked flawlessly including accessing older versions of the backed up files. Both implementations require you to install python-fuse. For Debian-based Linux distributions the following should do:
sudo apt-get install python-fuse

Then assuming your backup disk got automounted to /media/jonesdoe/backup-disk you should be able to mount it using tmfuse.py like so:
cd ~jonesdoe
wget https://raw.githubusercontent.com/rpedde/tmfuse/master/tmfuse.py
mkdir mybackup
python tmfuse.py /media/jonesdoe/backup-disk mybackup/
cd mybackup/somehostname/Latest/Macintosh HD

As for Windows, superuser QA: Opening Time-Machine OSX backup files on Windows 7? seems to answer the question.
Answer: I recently put together the rpedde/tmfuse solution with torarnv/sparsebundlefs in a docker container with some scripts. It is available here: https://github.com/taborkelly/timemasheen
Comment: Really useful to bundle everything in a docker! I didn't need the sparsebundlefs, so the scripts only worked as an example, but still, this was really useful!
Answer: I found that I needed to mount the .sparsebundle file found on the network drive first.
On Unix:

Follow all the instructions in https://github.com/torarnv/sparsebundlefs the README (read all the subsections, will likely need to follow the steps in the permissions and partition offset sections).
Read and follow the steps in the answer by @Pylsa, or use https://github.com/abique/tmfs (again read and follow all instructions).

The complete apt dependencies that I needed to build these 2 repos from source were:
sudo apt install libfuse-dev fuse cmake build-essential git curl

On Windows:

Untested, but the above procedure may work with Windows Subsystem for Linux 2 (WSL2).


Available Maven Profiles

Question: Is there an easy way to figure out, preferably from the command line, what profiles are available for a particular project. I've got a big, multi-module project I'm trying to figure out.
Answer: leeand00 set me on the correct path. What I was looking for is help:all-profiles
Answer: http://maven.apache.org/guides/introduction/introduction-to-profiles.html
Look at the heading:
How can I tell which profiles are in effect during a build?
Another way to do it is to use grep or XPath to search for all of the  nodes.
In xpath it would be [code]\profile\id[/code]
In grep it gets a little more dicey since you have to assume that the  tag is on the line following the  tag.

Available Maven Profiles


Comparison between Android Life Cycle & iOS Life Cycle

Question: Both android callback methods & iOS life cycle stages have similarities and differences.
For example If application in background , Android has onStop() callback method and iOS has
background stage?
I need to know differences and similarities between following iOS life cycle stages and Android life cycle.

Not Running
Inactive
Active
Background
Suspended
Answer:
Not Running — Either the application has not started yet or was running and has been terminated by the system.
Inactive — An application is running in the Foreground but is not receiving any events. This could happen in case a Call or Message is received. An application could also stay in this state while in transition to a different state. In this State, we can not interact with app's UI.
Active — An application is running in the Foreground and receiving the events. This is the normal mode for the Foreground apps. The only way to go to or from the Active state is through the Inactive state. User normally interacts with UI, and can see the response/result for user actions.
Background — An application is running in the background and executing the code. Freshly launching apps directly enter into In-Active state and then to Active state. Apps that are suspended, will come back to this background state, and then transition to In-Active → Active states. In addition, an application being launched directly into the background enters this state instead of the inactive state.
Suspended — An application is in the background but is not executing the code. The system moves the application to this state automatically and does not notify. In case of low memory, the system may purge suspended application without notice to make free space for the foreground application. Usually after 5 secs spent in the background, apps will transition to Suspend state, but we can extend the time if app needs.
Source: This website


How can I make sure there is only one direct descendant over a thousand years

Question: Long story short, a thousand years ago a man killed himself halfway through a ritual, which stopped it in half (think Jumanji). In order to complete the ritual, the bad guys need the direct descendant of the original (his wife and kids survived). How can I make sure that there is only one direct descendant after 1000 years?
Comment: You should probably ask either on WorldBuilding, Biology, or Genealogy. https://biology.stackexchange.com/ https://genealogy.stackexchange.com/ We can help you figure out the symbolism of the ritual, or how to develop the language which is used to cast it, but begats aren't our division.
Comment: Have closed as a question asking what to write, but please consider asking this on Worldbuilding; they've expressed some interest in having this question there.
Comment: The simplest thing i can think of is - Maybe the ritual put a curse on the man's lineage, since it was half finished, that he would only be able to sire a single son and none else until the ritual is completed, as a way to get itself completed....you may need to work out some other details but this should work for your scenario...
Comment: Relevant: https://english.stackexchange.com/questions/61559/meaning-of-direct-descendant-as-opposed-to-indirect-descendant
Comment: I think this is probably going to be closed, since questions asking what to write are off-topic here. But as per @LaurenIpsum's comment above, have asked if any other sites feel it's on-topic for them.
Comment: If anybody was interested, they did [ask](https://worldbuilding.stackexchange.com/questions/79629/how-can-i-make-sure-there-is-only-one-direct-descendent-over-a-thousand-years) on worldbuilding and it was well received.
Answer: John does the ritual. He has several kids.
Maybe most or all them die before having any children of their own.
Even if they do, heck, they can can all die off, even three or four generations in. It CAN just happen to shake out that way.
Certainly possible. Absolutely. But narratively, there isn't any real reason to go into the hows and whys of the fact that there's just one person left in the world that is his direct descendant, unless it adds something to the story.
I would say, that if you do want to get crunchy with it, or you have to absolutely know the mechanics behind it, you should follow other poster's suggestions and ask another board. Don't mention it's for a story, just ask the question: "Is it possible for a man born 1000 years ago to have just one descendant living, given that the man had 5 [or however many] children? Are there people walking around right now who are, so to speak, genetically unique in this respect? I know things can get exponential with generations and just wanted to see if this was plausible in any way, and how it might work?"
It's an interesting question.
Answer: Don't even worry about it. Just mention that "Doe was the only direct descendant of Smith." No reason for the reader to do any math.
Comment: I'm into genealogy. It's amazing how you can go back to medieval times and see a thriving medieval family with lots of children only for, a century later, wars, plagues, economic alliances (marrying cousins and nephews to keep properties together will put a damper on your reproductive ability eventually) or just bad luck will take the old nobleman's lineage into a male dead end. Or plain dead end, if they can't even pull off daughters. To end up with only one direct male descendant is not very difficult. Although it is much easier to end up without none.
Comment: @SaraCosta Indeed. And I should mention that "direct" descendant implies more than just merely being in the reproductive line. It implies legal (or community) recognition that someone in each generation is some kind of inheritor of rights from the previous generation. Not necessarily sole heir, but still, some kind of general recognition of the link is expected.
Answer: This is a rather complex answer. Since you did not specify how prevalent magic is, so I'll assume fairly low magic.
If you look for paternal descendants, then having mostly daughters will solve your problem. If the descendant needed can be of either gender, then the BBEG could have been trimming parts of the family over the years. Over centuries, humans spread out across the land. Think back to your own family a thousand years ago... heck even a century ago... Where did they live? What about their own siblings?
Since magic can be factor, perhaps the family have a mark that passes from one generation to the next, perhaps they have a special hair or eye color?
How does the BBEG keep track could provide help. Was he watching over the family from afar? From nearby?
Not a definitive answer for sure, but hopefully some avenues of thought for you to investigate...
Answer: The family gets religious, of some sort, which states that you can only have one child, and if it is twins the weaker must be killed.


In Illustrator, how do I cut off a protruding end of a path through a shape?

Question: How do I cut or trim off the protruding line drawn using a pen tool so that it confirms the shape of the rectangle?
Comment: Look up how to use [clipping masks](https://helpx.adobe.com/illustrator/using/clipping-masks.html)
Comment: You cannot use the pen tool to cut a diagonal stroke to fit a 90º direction. Use the answer of @Dodie Eslava or the Billy Kerr comment.
Answer: Select the two layer then ude divide tool.
Make sure the given line is not stroke. If the line is stronke expand it first.

Select the unwanted path then delete.
Comment: That's not the best way, and it's not exactly what's being asked... There are other ways to do it without having to transform the path in a shape.
Comment: Why dont you give your own answer then. There are many options to do it and i just give what i have. Give yours also if you want.  You're good only in commenting and yet you offer no solution.
Comment: Chill out, I'm not personally attacking you here. There is one other answer (which I upvoted) and a comment with a different solution, I don't need to add another one just to say the same thing.
Answer:
Select both the rectangle and inner shape
Grab the Shape Builder Tool
Hold down the Option/Alt key
Click-drag across the part of the line you want to remove.


Show the year while listing files in the current directory

Question: I am working on a Red Hat server. The commands ls -l or ll giving me the date and time in format +"%b %-d %H:%M".
I want to list the files in a way where the year when each was file created would appear within the date.
How is that possible?
Answer: You can use man ls and here you can find --time-style parameter. Or you can use:
ls --full-time.
Comment: Example for time style `ls -l --time-style=+%F`
Comment: For those who has already `ll` set as `ls -la` or something else, `ll --full-time` also work.
Comment: ls -l --time-style=long-iso shows cleaner output since doesn't print seconds/miliseconds
Answer: ls -l will display month, day and year - since, according to BSD man page:
If the modification time of the file is more than 6 months in the past or future, then the year of the last modification is displayed in place of the hour and minute fields.
So, to make sure that year will always be shown, use:
ls -l --time-style=long-iso (GNU/Linux)
ls -lT will display complete time information in BSD (MacOS)
Comment: Your GNU/Linux variant should work on any GNU system, not only the one with Linux: `ls` comes from GNU coreutils there.
Comment: I think so, but not tested with another operating systems using GNU utils, only Linux :)
Comment: "If the modification time of the file is more than 6 months in the past or future, then the year of the last modification is displayed". This is what I was looking for!
Answer: In addition to Jan Marek's answer.... I've noticed you can get away with just:

ls --full or ls --fu

which will do the same thing as ls --full-time as he described. Thanks Stéphane Chazelas. Now I type ls --fu everywhere. :)
Answer: Since you asked for the year, ls -lac is an easy one to remember if, like me, you use ls -la all the time. The c gives you ctime which will display a year if it's not the current year or the hour and minute if it is.
Comment: `ls -l` displays date and time for dates that are in the past six months, and date and year for other dates.  ctime can be in the past six months just as much as mtime (modification date) can, so `ls -lac` can display times (instead of years) just as much as `ls -la` can.  Besides, as Mateen Ulhaq points out, `ls -lac` does not display the same dates that ``ls -la`` does. This answer is wrong.
Comment: This seems to change the behavior of `ls` to **date changed** rather than the default **date modified**.
Comment: I like this. A lot less noise in the output and only one letter to remember in the future.
Comment: This `-c` is actually a modifier for `-l` and `-t`. It changes the display style for the former, and sorting criteria for the latter. According to manual:
`−c  Use time of last modification of the file status information instead of last modification of the file itself for sorting (−t) or writing (−l).`
Answer: As an alternative to --full-time and its iso-format you can also use the --time-style parameter appending the values you need:
ls . -l --time-style=+%Y/%m/%d
or +%y-%m-%d, maybe listing with -al instead (hidden files too)... That depends on your requirements.
Answer: If you're using busybox (embedded distros, e.g. OpenWRT, LEDE), the switch you're looking for is -e for versions up to 1.26.2 and --full-time for 1.27.0 and above (see the commit that changed it).
Comment: `-e` also works with Solaris `ls` and ast-open's, so it's actually closer to a standard than GNU's `--full-time`. A shame that busybox removed it in newer versions.
Comment: @StéphaneChazelas didn't know that! Thanks for the edit
Answer: This will work on macOS Catalina and later:
ls -altT /path/to/some/dir


How to check if a utility function represents locally non-satiated preferences?

Question: I understand the distant definition of LNS but I don't get how to actually apply it to given utility functions like u=x1/x2 or u=x1-x2 or of any form? Is there structured math-y way to check if they represent LNS preferences? I digged the internet whole day but couldn't find how to solve these kind of questions. Any help would be highly appreciated. thank you!
Answer: You apply the definition.
There might be multiple ways for a utility function to represent LNS preferences. A surefire case is when there is a strictly monotonic term in a single good. For example, $u(\mathbf{x}) = f(\mathbf{x}_{-i}) + x_i$ (does this form ring any bell?) where $f$ is a horrendously complicated function of all goods except good $i$ is always LNS because of the linear term in $x_i$: whatever might happen with the other goods, the agent is always happier if you add just a bit of good $i$, or using the definition:
$$\forall \mathbf{x} \in X, \varepsilon > 0, \exists \mathbf{x}' : \|\mathbf{x} - \mathbf{x}'\| \leq \varepsilon \land \mathbf{x}' \succ \mathbf{x}$$
In this case, $\mathbf{x}' = \mathbf{x} + \varepsilon e_i$, where $e_i = (0, ..., 1, ..., 0)$ i.e. it is only 1 in position $i$.
I am sure some user will be delighted in pointing out an exception, but let's say this is true for all reasonably horrendous $f$. (It might be true for any $f$, I did not take the time to check.)
Another way of ensuring LNS is to check that the function has no local maxima or plateaus. This is easy to define and check in the univariate case, but becomes less trivial when dealing with multiple goods. There may be satiation for a single good, while not violating LNS: $u(x, y) = (x-2)^2 + \log(y)$.
So is there a "mathy" way? You apply the definition. Math is not always calculation-y. Unfortunately or fortunately, depends on how you see it.
Comment: $x'_{-i}=x_{-i}$, so exceptions to this should not be expected.


Spivak's Calculus 1-19 Schwarz Inequality

Question: Problem
There's a question in the third edition of Spivak's Calculus on the Schwarz inequality. It is presented as:
$$x_1y_1+x_2y_2 \leq \sqrt{x_1^2+x_2^2}\sqrt{y_1^2+y_2^2}$$
Part (a) asks: (i) to prove that if $x_1=\lambda y_1$ and $x_2=\lambda y_2$ then equality holds, (ii) proving equality for $y_1=y_2=0$, and (iii) to prove the inequality given $$0 < (\lambda y_1-x_1)^2 + (\lambda y_2-x_2)^2 = \lambda^2(y_1^2+y_2^2) - 2\lambda(x_1y_1 + x_2y_2) + (x_1^2 + x_2^2) \tag{*}\label{*}$$
and using Problem 18 (which relates to proving the quadratic formula, $b^2-4c$, minimum of $ax^2 + bx + c$, etc.)
Part (a)(i)
I went about part (i) by multiplying out the RHS and then squaring both sides to give $$\lambda^2y_1^4+2\lambda^2y_1^2y_2^2+\lambda^2y_2^4=\lambda^2y_1^4+2\lambda^2y_1^2y_2^2+\lambda^2y_2^4$$
Part (a)(ii)
For part (ii) I substituted $0$ for $y_1$ and $y_2$ and ended with $0=0$ by way of $0+0=\sqrt{x_1^2+x_2^2}\sqrt{0^2+0^2}$ although something didn't feel right about this so I'm not sure if it is correct.
Part (a)(iii)
Part (iii) I struggled with and is the main reason I am asking this question (I understand it has been asked many times before but trying to solve it has made me realize there are quite a few things I don't understand).
I noticed that \ref{*} is equivalent to $ax^2 + bx + c > 0$ so (because of Problem 18) went about trying to show that $b^2-4c<0$ but it became clear that this wasn't true. I assume it's because this only works when $a=1$?
By completing the square I got $$(y_1^2+y_2^2)^2(\lambda+\frac{x_1y_1+x_2y_2}{y_1^2+y_2^2})^2 + x_1^2+x_2^2-\frac{x_1y_1+x_2y_2}{2}>0$$
I then decided to deal with it on a case by case basis of finding the minimum. First, where $y_1^2+y_2^2=0$, giving zero in the first set of brackets. This case was covered earlier but gives $x_1^2+x_2^2-\frac{x_1(0)+x_2(0)}{2}>0$. This seems to contradict my earlier result of $0=0$ as any case where $x_1 \ne 0$ or $x_2 \ne 0$ would give an answer $> 0$.
For the second case, where the second set of brackets equals zero, I came up with the condition that $\frac{x_1y_1+x_2y_2}{y_1^2+y_2^2}$ = $-\lambda$ and so $c=\frac{\lambda}{2}(y_1^2+y_2^2)$, proving the inequality so long as $\lambda > 0$.
Part (b)
This asks for a proof of the Schwarz inequality using $2xy \le x^2 + y^2$ with $$x=\frac{x_i}{\sqrt{x_1^2+x_2^2}}, y=\frac{y_i}{\sqrt{y_1^2+y_2^2}}$$ for $i =1$ and $i = 2$.
I think I am being very naive about this but my instinct wants to say that since $2xy \le x^2 + y^2$ is derived from $(x - y)^2 \ge 0$ it must automatically be true, but part of me thinks this would only work because $x$ and $y$ have been defined as given. Maybe someone could shed a little more light on this?
Questions
I will try to highlight here some key questions.

Are parts (a)(i)-(iii) correct?
Am I right in saying that $ax^2 + bx + c > 0$ for all $x$ when $b^2
    - 4c < 0$ iff $a=1$?
Is it true that (a)(iii) should only work when $\lambda > 0$ or have I made a mistake?
My naive assumption (and possible reason for why it isn't) in part (b) for the Schwarz inequality being "automatically" true because of $(x-y)^2 \ge 0$.

Finally, thank you very much for reading this and any help (especially in terms of my thinking) would be greatly appreciated. I am new to this, but enjoying it, so the techniques and ways of thinking are taking some time to set in but hopefully good practice will solve that!
Comment: Specific your inequality we can prove much more easier.
Comment: @MichaelRozenberg Sorry, I don't quite understand. The Schwarz inequality is listed at the top of the post, but I am mostly asking about a number of problems I came across in trying to prove it through a few textbook questions that are a result of my misunderstandings. Thanks for your reply and I hope my question is clearer now.
Answer: For starters, consider factoring in the first part of (a). The second part of (a) also seems right. In a set of problems such as this, something that seems fairly straightforward will usually be very helpful in some surprising manner in later non-trivial parts of the problem. Now, for Part iii you did not mention that there is no number  such that $x_1$ = $y_1$ and $x_2$ = $y_2$, which is important (otherwise, it wouldn't have been mentioned). It should be somewhat easier to go from here but keep trying.


Use productivity tools in presentations

Question: I was wondering how people think about using productivity tools like Coderush or Resharper in live demos. Is it a don't and should someone only use the most default settings of the IDE? Or is it ok to speed things up a little during the demo? Also, should you explain you are using this tool during the demo?
Answer: It really depends on what you want to demonstrate. This kind of productivity tool are usefull even for demos in order to avoid loosing time on basic technical problems. You may also take advantages of such demos to introduce the features of these tools...
Answer: I've seen a lot of presentations where people use these tools and personally I don't mind.
Make sure you tell people that are going to be using the tool and then announce the action that you are about to take. e.g. "I'll use Resharper to extract this method into the Foo class"
Answer: I tend to use DevExpress Refactor! Pro, and GhostDoc, when I do code-related presentations. I try to make sure the audience knows what I'm doing by saying out loud what I'm going to do, but I have also built my own custom tool for this, which you can find a beta of here: LVK.ScreenKeys.
Basically the tool will pop up, in the upper right corner of the screen, yellow tooltip/toast-like windows showing the key stroke/sequence I invoked, and also a textual description of what it means, depending on the software it was invoked in.
Before I started using such a tool, I invariably had questions like "what did you do now", and if you don't want to use such a tool (there are others besides mine), I would consider not using more than a few functions of such tools.

Use productivity tools in presentations


open node-reference links title in popup

Question: I want in my node view pages, node reference links open in popup window or lightbox window.
Does anyone have a solution?
Answer: You can use a theme_preprocess() function to add attributes to that link, or you can create a custom field template that adds classes or specifies a target.
For a new window/tab, you'd add target="_blank" or if you want to use an overlay you would add classes as specified in the module that provides that functionality, such as Lightbox or Colorbox.


sudo add-apt-repository ppa: problem!

Question: I have UBUNTU 16.04.05 LTS X64 and when I try to add any repositories I'm having the following error!
for example I have used: sudo add-apt-repository ppa:noobslab/apps and the result is:
    This PPA Contains Applications for Ubuntu/Linux Mint from different sources but debianized by http://www.NoobsLab.com
 More info: https://launchpad.net/~noobslab/+archive/ubuntu/apps
Press [ENTER] to continue or ctrl-c to cancel adding it

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 168, in <module>
    if not sp.add_source_from_shortcut(shortcut, options.enable_source):
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 768, in add_source_from_shortcut
    self.set_modified_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 492, in set_modified_sourceslist
    self.save_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 658, in save_sourceslist
    self.sourceslist.save()
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 413, in save
    files[source.file] = open(source.file, "w")
FileNotFoundError: [Errno 2] No such file or directory: '/etc/apt/sources.list.d/noobslab-ubuntu-apps-xenial.list'
gpg: keyring `/tmp/tmph_0b92bg/secring.gpg' created
gpg: keyring `/tmp/tmph_0b92bg/pubring.gpg' created
gpg: requesting key F59EAE4D from hkp server keyserver.ubuntu.com
gpg: /tmp/tmph_0b92bg/trustdb.gpg: trustdb created
gpg: key F59EAE4D: public key "Launchpad PPA for NoobsLab" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
gpg: keyblock resource `/etc/apt/trusted.gpg.d/noobslab_ubuntu_apps.gpg': file open error
gpg: no writable keyring found: eof
gpg: error reading `/tmp/tmph_0b92bg/pubring.gpg': general error
gpg: import from `/tmp/tmph_0b92bg/pubring.gpg' failed: general error

it always gives me this error with any sort of repositories that I try to add.
I have tried many solutions I'm going to list them below:
Error : Running add-apt repository ppa:
How to install certificates for command line
Permission denied: '/etc/apt/sources.list.d/google-earth.list'

and many many other solutions given to related problems.
no one worked for me.
is there any solutions here?
regards

#

output of file /etc/apt/sources.list is shown below:
/etc/apt/sources.list: ASCII text
Comment: Please, edit your question to post the output of `file /etc/apt/sources.list`.
Answer: I have found the solution on my own.
In /etc/apt just create the following directories:
apt.conf.d, preferences.d, sources.list.d, trusted.gpg.d
or sudo mkdir apt.conf.d sources.list.d trusted.gpg.d
It will do the job.
Regards

sudo add-apt-repository ppa: problem!


How to Export/Extract any 3D model from Google Earth or Google Earth Pro?

Question: Hello im a french student so excuse my use of english.
I would like to know if there is a way to export any 3D models from Google Earth except the ones that are available on the 3D Warehouse. I've done my research and found a bunch of tools and software who were created a while ago but now they seem to be inefficient.
Exemples: 3D Ripper X, Open GLX Tractor, OGLE (The OpenGLExtractor)...
Those softwares where able at the time to capture 3d rendering and datas from google earth and other 3d generator that you could import into 3d modeling programs.
My purpose is to import them into a 3D modeling software (sketchup or others) and export them as .stl or .obj to try to 3D print some of these models.
I looked on many forums and videos over the web but none were able to answer my question. Generally people will speak about the 3D Warehouse from Sketchup to download buildings and others models who are created by users but nobody is actually able today to extract any model generated by Google Earth. Google Earth offers the possibility of extracting kml. data but when you go into sketchup (i didn't try on any other 3d software) and import the file you get an error message: "failed to import". Maybe the final answer would like to code a proper software but im not a programmer and my knowledge in informatics is near from 0.
I also tried to downgrade versions of each software but either on Google Earth or Sketchup it wont work.
I know that when these software were actually working a bunch of people used them in geographical or architectural purposes like in this video : https://www.youtube.com/watch?v=18QbZyuy2JY.
The thing is im using a mac (no bootcamp or anything like that) so I can't see if this is still actually possible on 3ds max. However I do have the possibility to use a PC running windows (not my computer).
I tried with someone to use the 3D Ripper DX while running Google Earth but it didnt even showed the capture option on the top left corner and when pressing the capture key nothing was to be found in the output directory.
I also realised i was focusing mainly on G.Earth but maybe other 3d earth modeling software allow you to capture their models but I don't think they are as complete as Google Earth is.
So i'm wondering if there is a way to capture and extract the generated 3d of Google Earth except from these software.
Thank you
Answer: 3D Ripper DX still works. I just used it today using the required things. I made a thread about it... You need a certain version of Google Earth, 3dsmax 2009 worked for me. I was able to extract models still.
http://community.simtropolis.com/forums/topic/69935-tutorial-on-how-to-extract-3d-models-from-google-earth-to-get-dimensionsproportions-of-building/


Is it possible to turn off the trackpad low battery notification?

Question: Generally speaking I like to change the battery once the battery is completely used up, but the system will kept notifying me once the percentage dropped below 20%. Is there a way to turn it off (or make the notification only comes up once it dropped below 5%)?
Comment: It is a very annoying alert... My batteries still work for weeks past the 20% mark. Here's hoping Apple will allow us to disable it in the near future.
Comment: would this work for you http://apple.stackexchange.com/a/57427/46541
Comment: @Buscar웃 no it doesn't turn off the alerts. It just replaces the icons.
Comment: That alert is probably there for the Lion batteries which should not be discharged below 20%. I do not know how to turn it off.
Answer:
I don't mind the alert or warning, but I do mind the weeks of having a blinking icon in my Menubar.  Here's what I did in Terminal:
$ cd /System/Library/CoreServices/Menu\ Extras/Bluetooth.menu/Contents/Resources/
$ sudo cp lowbatt.pdf lowbatt.backup.pdf
$ sudo cp BlueTooth_Connected.pdf lowbatt.pdf

This replaces the low battery icon with the same connected icon.  I assume the icon is still "blinking" in that it's switching one for the other, but since they're now the same, you don't notice.
Now I get the 20%, 10%, 5% alerts, but no annoying blink.
This is in Lion.  It's likely that system updates and perhaps even Mountain Lion will undo this, but it can probably be reapplied after updates are performed.

For Mountain Lion, the relevant files are named:

Bluetooth_Low_Battery.pdf
Bluetooth_Connected.pdf

How can you disable the low battery warnings for bluetooth devices? by seanhussey