How to do versioning of shared library?

Question: Windows provides the resource file for version information for an application and DLL. The resource file includes information like version, copyright and manufacturer.
We have a shared library and would like to add version information.
How can we do it on Linux with a shared library?
Answer: The short version is that you do this via the soname of the library. Read chapter 3 at http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html as well as chapter 3.3 ABI Versioning at http://www.akkadia.org/drepper/dsohowto.pdf
Comment: Thanks for your answer, I was redirected from [here](http://stackoverflow.com/questions/42314722/multiple-versions-of-same-the-same-library-in-ld-library-path) but I still don't understand how one program can understand which library version to use. I want that one program use one version and another the new version.
Comment: One comment on the [Program-Library-HOWTO](http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html): if you are writting receipt for install in makefile, you should do nothing other than generating & copying files into destination dir. so do not call ldconfig in receipt, just create symbolic link file with soname to realname (for your bin-package) and create linkname to soname (for your dev-package), and installer can call ldconfig by themselves after "make install" if they install the library into non-standard location. because "make install" may be invoked for cross-compiling
Answer: The best way to handle this is using libtool, which does the versioning for you.
Essentially, version information is not (or not primarily, don't know from my head) encoded in the library itself, but rather in its filename. Version numbers are normally given in three-dot format, with the major number increasing for each break in downward ABI compatibility, the middle for breaks in upward ABI compatibility, and the minor for patches that did not change the ABI.
Like qdot noted, symlinks in the lib directory provide the essential versioning. There is a symlink without a version number (libfoo.so) for the currently installed development headers, a symlink with a major number for each installed major version (libfoo.so.1) and a real file with the full version number. Normally, programs are linked to use libfoo.so.1 at runtime so that multiple major versions may coexist.
Comment: I agree that the libtool scheme seems to be the best. Your answer seems to be wrong on the order of digits. The correct order is `current[:revision[:age]]`. So the middle is for patches, the last one is the degree of backward compatibility. [libtools docs](https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html)
Comment: You can play with the effects of `-version-info C:R:A` live at https://verbump.de/ .
Answer: Linux uses the following strategy - you (the system maintainer) provide symlinks from a 'specific' shared library file, like this:
<code>lrwxrwxrwx 1 root root    16 2011-09-22 14:36 libieee1284.so -> libieee1284.so.3
lrwxrwxrwx 1 root root    20 2011-09-22 14:36 libieee1284.so.3 -> libieee1284.so.3.2.2
-rw-r--r-- 1 root root 46576 2011-07-27 13:08 libieee1284.so.3.2.2
</code>
This way, developers can link either against -lieee1284 (any version ABI), or libieee1284.so.3 or even to the specific release and patch version (3.2.2)
Comment: Note that  "-lieee1284" links to whatever the libieee1284.so points to at linking time, not runtime. libieee1284.so likely has a soname of libieee1284.so.3 , and that's the name that will be embedded in the executable, and searched for during runtime.

How to do versioning of shared library?


How do i make Pydev + jython to startup faster when running a script?

Question: i'm working with pydev + jython.great ide , but quite slow when i try to run a jython program.
this is probably something due to libraries load time.
What can i do to speed it up ?
Thanks ,
yaniv
Answer: Jython startup time is slow ... there's a lot to bootup!
Everytime you run a Jython script from scratch, it will incur the same Jython startup time cost.
Hence, the reason Jython, Java, and Python are not great for CGI invocations. Hence, the reason for mod_python in Apache.
The key is to start-up Jython once and reuse it. But this is not always possible especially during development because your modules are always changing and Jython does not recognize these changes automatically.
Jython needs a way to know which modules have changed for automatic reloads. This is not built into Jython and you'll have to rely on some other third party library to help with this. The concept is to remove from 'sys.modules' the modules which have changed. A simple solution is to just clear all the modules from sys.modules - which will cause all modules to be reloaded. This is obviously, not the most efficient solution.
Another tip is to only import modules that your module needs at the time that it 'really' needs them. If you import every module at the top of your modules, that will increase your module import cost. So, refactor imports to within methods/functions where they are needed and where it 'makes sense'. Of course, if your method/function is computation heavy and is used frequently, it does not make sence to import modules within that method/function.
Hopefully, that helps you out!
Answer: If you have a machine with more than one processor you could try starting eclipse/pydev with the options <code>-vmargs -XX:+UseParallelGC</code> You could also try different JVMs to see if any of them give better performance.


Someone is stalking my profile, how do I report it?

Question: Someone is stalking my profile and serial upvoting my old posts. How do I report it?
Comment: The script doesn't care which way the votes are, it just looks for serial voting and corrects it. Serial upvoting is actually worse for the system than serial downvoting
Comment: Stalking your profile?
Comment: How does 3 questions getting upvotes mean you are being stalked?
Comment: Three (now four) upvotes within 5-6 minutes. @JJJ. How could it mean anything different?
Comment: Several different people saw your questions and upvoted?
Comment: If someone is serial voting on your posts the system has a script that runs daily that will fix it.
Comment: Because everything on stack exchange runs based on on your reputation and serial upvoting increases your reputation. If you get a large reputation increase from serial upvoting you will have privileges and access that you did not earn and do not deserve and they can be used to harm the site.
Comment: Honestly most people won't complain about gaining rep which is why you don't see threads asking about serial upvotes.
Comment: @JoeW yes. Serial upvoting of 3 questions which are tagged different and not being pinged by the community user means stalking.
Comment: @JoeW probable but unlikely.
Comment: Mostly this happens when people have a grudge against someone and start to downvote a number of their posts. There's a script that looks at serial voting and it may overturn such patterns based on parameters that I don't know specifically. See also the answer at [Who is serial downvoting me on my Politics.SE birthday?](https://politics.meta.stackexchange.com/q/2832). Of course it may also be a coincidence if different people happen to stumble upon some of your posts at the same time.
Comment: @JoeW thanks that answers my question.
Comment: @JJJ this is about serial upvoting though. I see number of reasons why someone may do so
Comment: @JoeW yes, it is worse. Why according to you?
Comment: @JoeW So I am being extra-cuatious. I don't vote. I don't close vote. I understand I am not as eligible. I am a responsible person. I agree with you.
Answer: There is nothing to report, because the person "stalking" your profile didn't do anything worth reporting.
Your Stack Exchange profile is public information. People are allowed to look at it as much as they want. And if they choose to go through some of your older posts, find them useful and upvote them, that's their right.
What's forbidden on Stack Exchange is systematically upvoting or downvoting all posts of a user without even reading the content. The motive behind that is usually to artificially inflate or deflate the reputation of an account, which is detrimental to the Stack Exchange system.
But with just 3 upvotes in a day we can hardly call that serial upvoting. Also, the votes I believe you are talking about were several minutes apart, so it doesn't look like they voted without reading. (this is all public information, by the way)
However, should you do become the victim of actual serial voting in the future, you can report that by flagging any of your own posts as "in need of moderator intervention" and explain the situation in the free text field.
Comment: *Also, the votes I believe you are talking about were several minutes apart* [those weren't](https://postimg.cc/LYdYXq0H). If it was one person they voted without reading. I just wanted to report, because some of the moderators (not you) might blame me. I had been a victim of cynicism.
Comment: I was cautious, you know? I appreciate your answer here. I want to thank you for responding.
Comment: @Gary2 Those are not even 3 upvotes. That's one actual upvote and one upvote which was undone immediately.
Comment: You are right, the one I was talking about earlier were [several minutes apart](https://postimg.cc/zbBg4mMh). Anyways, I thought something was fishy. Sincerely, I didn't notice and didn't know that it was possible to see the time. Thanks Philipp.


Does the Rubik's Cube increase mental ability?

Question: Does becoming efficient in the cube help build your brain to be able to do other tasks better? What tasks and how?
Answer: Don't know of any research on the Rubik's Cube specifically. I did find this (https://arxiv.org/abs/1505.00750) but it looks like it was a presentation given by a mathematician at a mathematics conference, and it doesn't look like any actual experiment was performed to test the things that are being claimed. So I wouldn't take it seriously.
However, I would be surprised if practicing Rubick's Cubes actually did improve general cognitive function. Improving at specific tasks like brain-training apps usually doesn't improve general cognitive function (although evidence is still somewhat mixed), it makes you better at those tasks. Arguably, the mixed results can be explained by the fact that participants' performance will look look like an improvement in general cognitive function if you measure it in a task similar to the one that was practiced.
So in short, my expectation would be that it would generalize to very similar tasks, if anything at all. However, no one's actually done it, so if you try it and get results it'd be publishable, and if you want to form your own opinion the literature to look at would be cognitive training.
Answer: See this new work by Valerie et al found some benefits:
https://repository.isls.org/handle/1/6719
Quoting from the paper:

Middle school students participated in four sessions of Rubik's Cube
training designed by the lead researcher and a partner middle school
teacher. Results indicate that students improved in their ability to
execute two and three- dimensional mental rotation tests.

Valerie, J., Aylward, G., & Varma, K. (2020). I Solved it! Using the Rubik's Cube to Support Mental Rotation in a Middle School Science Classroom.
Comment: I added a few details given the reference does seem relevant to the question, even if I'm generally skeptical of transfer from these kinds of itnerventions.
Comment: P.S: If you are working towards testing a hypothesis on this please let me know.


Transfer of astronauts from CSM to LM

Question: Did the astronauts "remove" the docking probe, the drogue of the LM, and related mechanisms from the CSM to enter the LM of Apollo 11?
Answer: After docking both the probe and the drogue were removed, extracted from the tunnel and stored somewhere. Here is the transcript from Apollo 11. Some excerpts:

055:19:49 Duke: Apollo 11, Houston. It's a pretty good show here. It looks like you almost got the probe out.
055:19:54 Collins: Yeah, it's loose now.
[...]
055:22:14 Duke: We can see the probe now. Correction, the drogue.
055:22:22 Armstrong: Roger. [Long pause.]
055:23:04 Armstrong: Okay. Drogue removal's coming next.
[...]
055:24:07 Duke: 11, Houston. Now it's a good view of the storage area under the couch. [Long pause.]

The pictures AS11-36-5382, 5383, and 5384 were taken shortly thereafter showing them both in the LM. As mentioned in the transcript they were stitched together by  Jon Hancock to this:
Comment: A brief description of the process, and some photos, can be found here: http://heroicrelics.org/stafford/apollo-probe-and-drogue/
Comment: @ Davin Gremlin. Thanks a lot Davin, I appreciate your feedback. I have seen these photos and read the article, how ever I could not understand CSM and LM mating - "while pulling out the LM from adopter, while separation of LM from CSM while entering lunar orbit, and while reuniting for home coming. I am wondering if the "Drogue" and the "Probe" assemblies in respective vehicles were hinged to their vehicle body, or they had been completely removed. Will try to see Apollo 13 movie clip as suggested. Thanks.
Comment: The components were completely removeable, as pictured in the answer post

Transfer of astronauts from CSM to LM


Is it bad/dangerous/inappropriate to put arbitrary backups in /var/backups?

Question: There's a system-created /var/backups directory on Debian-based systems. I need a place to store backups of several git repositories (the primaries are on bitbucket). If I store them in /var/backup/git will that break apt-get, or will they get automatically deleted at inopportune times? Is there any reason I shouldn't use /var/backup? If there is, what is a reasonable alternative?
Comment: It is not dangerous to do so.
Answer: /var/backups is specific to Debian. It is not specified in the FHS, and its use is not documented in Debian policy (See Debian Bug report logs - #122038). The behavior is described in http://ubuntuforums.org/showthread.php?t=1232703.
While I agree with @fpmurphy that there is little danger of Debian ever removing your backup files in /var/backup, I think that it is not good policy to use a directory that is so Debian-specific. For one, Debian might change its policy and break things. For another, the user community already has specific expectations about what the directory is for. And finally, because it is not "portable" in the sense that it is not clear where this directory would be in a non-Debian distribution.
If my understanding of the FHS is correct, it would be appropriate to put clones of Git repositories in /opt/<project_name>/.git or in /usr/local/src/<project_name/.git. My personal inclination would be to use the former because it leaves the door open to backup project resources that are not source files and therefore not in Git.
If you really want to emphasis the backup nature of these repositories, you could put them in /backups, or even /home/backups, two directory names that are often used as mount points for external storage.
Comment: `/var/backups` actually _is_ mentioned in FHS. It says that the directory is "reserved", but not much else: http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#REQUIREMENTS12
Comment: `/opt` and `/usr` aren't really meant to be modified outside of software installation or other administrative activities, so anywhere inside those isn't really a great candidate. Something in `/var` would really be ideal, such as `/var/local/gitbackup` or even just `/var/git`.
Comment: Further to Ajedi32's comment, the FHS says that reserved directories "must not be used arbitrarily by some new application, since they would conflict with historical and/or local practice". My reading of this is that they say it's inappropriate to put arbitrary backups in /var/backups.
Answer: Nowadays, it seems the FHS suggests you can freely create whatever subdirectory under /srv, e.g. /srv/archives/bitbucket.
What I don't find really clear with the FHS definition is that backups aren't files "served by the system". Anyway, /srv is a free namespace.
Comment: the fhs [gives](https://askubuntu.com/a/1166559/52041) examples of data expected to be there, such as FTP and www data. in the /srv section, they comment: "If the directory and file structure of the data is not exposed to consumers, it should go in /var/lib". That seems to apply to backups.
Answer: The best way to backup git repositories is to have a (bare) clone of the repository. git is quite frugal in its space usage, there will be almost no gain in compressing anything there. And a clone can easily be kept up to date (unless upstream does stupid pranks like wholesale history rewriting, nothing can be lost).
Comment: A git clone is a mirror, not a backup. Backup must preserve history. Although a version controller repository is itself designed to store history, as you wrote, it is not completely immune to failures/mistakes. See http://www.taobackup.com/history.html


Have something happen

Question: As in "I had that happen before." Why is this correct? Does this mean that something has happened to someone or that you made/let something happen?
Comment: Do you think it is correct?
Comment: In *most* contexts, *I had that happen before* simply means *I underwent that situation/experience before*, but in certain contexts it could carry the implication *I **caused** that to happen before*. I don't think there are any contexts where it could imply *I **let/allowed** that to happen before*.
Answer:
I had that happen before

In this sentence, that is referring to the thing or event that happened. It's not specified what caused the event, or who or what it happened to. It just happened.
The person is saying, in effect, I have had previous experience of this event, and the assumption is that the person he or she is speaking to understands the subject under discussion.

Have something happen


What music genre is Tron: Legacy by Daft Punk?

Question: The album is categorized as soundtrack. The Band is officially French-House style. The album is a mixture of orchestral sound with electro elements (hybrid). There are also electro beats in there. It reminds me of "Stranger Things", "Thor: Ragnarok" and so on. I created something similar (Hip-Hop based) and want to publish it on Spotify. Therefore, I need to know: does there exist a special genre name for this style? I googled a lot but without success.
Answer: It is often not possible to pin down a single genre to an album.
This review by Heather Phares identifies electronic and orchestral elements as mentioned by the OP:

Working with the London Orchestra, Bangalter and de Homem-Christo fuse electronic and orchestral motifs seamlessly and strikingly.

The reviewer also notes that

for most of Tron: Legacy, they're concerned with pushing boundaries.

followed by

It's not until the score's second half that the duo's more typical sound emerges on "Derezzed"'s filter-disco and on "End of the Line," where witty 8-bit sounds evoke '80s video games.

(all emphasis mine)
The infobox on the same site also mentions Club/Dance, Progressive House and Left-Field House as styles for the album.
When listening to the soundtrack here, the electro-orchestral elements seem to stand out for me, with influences of the House style (as best as I understand it, I haven't heard a lot of music from this genre).

Long story short, there is no single genre name to describe this album (or even most music, in general).
Answer: At this point they have long abandoned French House and are working more with Electro House. There are typical orchestral elements in the album, as it is common with soundtracks. The more slow and ambient-y that aren't orchestral, are definitely Progressive Electronic in the likes of Vangelis, Klaus Schulze etc.
Tip: it's always a good thing to have a look at RateYourMusic, as genres there are relatively correct and can bring to you a starting point: https://rateyourmusic.com/release/album/daft-punk/tron-legacy-1/


Odd java assignment rules for final

Question: I've come across some odd behavior in assignment of final variables. You can assign a final varible in a constructor to initialize it, which makes sense. However you can't do the same in a subclass, even if the final variable is a member of the subclass -
public class FinalTest {
    public final String name;

    public FinalTest()
    {
        name = "FinalTest";
    }

    public static class FinalTestSubclass extends FinalTest {
        public FinalTestSubclass()
        {
            name = "FinalTestSubclass"; //<---- this won't compile, assignment to final variable.
        }
    }
}

Can someone think of a good reason why this should/would work this way?
Comment: Never mind, reassignment in the 2nd constructor, didn't see it.
Answer: Every constructor of a subclass must invoke a constructor of the superclass as its first operation. Every final member variable must be initialized before a constructor completes. A final variable can be assigned only once. Given those rules, it is impossible for a subclass constructor to directly assign a value to a final superclass' member.
Making exceptions would increase complexity and create "gotchas" in exchange for limited additional utility.
A practical solution is to provide a superclass constructor that takes a value to be assigned to the final member. This can be protected or package-private if desired. If the superclass is outside of your control, there's a good chance that allowing derived classes to break its assumptions about the finality of its members would cause other problems.
Answer: If you were allowed to assign a value to name in FinalTestSubClass it would mean that the value assigned in FinalTest was not actually the final value.
If your example was valid, then this would mean that name could have different values (based upon which class was instantiated), making the final modifier pretty much redundant.
A better question is, why should the behavior you desire be allowed?
Comment: In fact, for an instance of FinalTestSubclass, the field would have different values at different times: It would first be assigned "FinalTest" in the super class constructor, and then assigned "FinalTestSubclass" in the subclass constructor.
Comment: Addendum: It is perfectly okay for a non-static final field to have different values in different objects.
Answer: informally, final fields should have been initialized when the constructor is finished.
in your subclass constructor, super() has been called implicitly, the constructor of the super class is finished, the final fields in the super class should not be modified.
you may want this instead:
class A
    final String s;
    A(String s){ this.s = s; }
    A() { this("default"); }

class B extends A
    B(){ super("B's default"); }

Answer: This is standard behavior in Java
The key word final can by used in multiple way, for class close the possibility to inherite from it, for method to override it, for variable allow to be assigned only once in simply words.
For your case this variable is allready assigned in super class,
what You can do is
public class FinalTest {
    public final String  name = "FinalTest";

    public FinalTest()
    {

    }

    public static class FinalTestSubclass extends FinalTest {

        public final String  name = "FinalTestSubclass";

        public FinalTestSubclass()
        {

        }
    }
}

Read more about final variables
Answer: In reply to your comment to matt's answer; you can achieve determining the constant in the subclass by passing it in the constructor:
public class FinalTest {
    public final String name;

    public FinalTest()
    {
        this("FinalTest");
    }

    protected FinalTest(String nameConstant)
    {
        name = nameConstant;
    }

    public static class FinalTestSubclass extends FinalTest {
        public FinalTestSubclass()
        {
            super("FinalTestSubclass");
        }
    }
}

Odd java assignment rules for final


What is the different between chrome web app and web app?

Question: I check out the google web app, it seems that this is only a page for hosting web page/ application... What make it so different? Thank you.
Answer: The difference is that google chrome web browser allows you install Extensions e.g. apps or utilities. Safari 5 allows extensions however, these are usually like tool bars or website enhancers.
EDIT: I also forgot to add, this is kind of like the App store apple has. Google will use this for there upcoming O/S: Chrome OS. Because Chrome OS is web based, many of it's apps will involve it being written in html and javascript.
Answer: A google chrome web app = normal web app + access/use of Google Chrome extension API.


How to set groups "Recommended by the admins" in a Facebook group?

Question: I found a Facebook group showing groups "Recommended by the admins". I would like to use it, but I do not understand how.
Answer: Click on "Link existing group" in the dropdown you posted a screenshot of above. When you link your group, it will show in the "Recommended by the Admins" section.
Answer: To quote the Facebook Help Center:

If you're a group admin, you can recommend other groups by linking
  them to your group. You can only link groups you admin.
To link a group:

Go to your group and click  below the cover photo.
Select Link Existing Group to link a group you already admin, or select Create New Linked Group.
Search for the group's name then click Link. If you create a new linked group, choose a group name and privacy setting and then
  click Create.
After the group is linked, you'll have the option to write a post about it.
Comment: When I posted the question, this was not available for my 3000 members group. Now the feature is available.
Answer: Group should have at least 5000 members before you can have that function. Cheers
Comment: People who downvoted: can you explain me why?
Answer: It appears this feature was removed.
Comment: You're wrong about your answer, it still exists. And it would be better for next time if you'll improve your answers and add references when needed.


What is the entropy change due to work?

Question: The equation $dS=\frac{dQ}{T}$ tells us the entropy change due to heat transfer. Likewise, the equation $dS=\frac{P}{T}dV$ tells us the entropy change due to a volume change. However, I am not sure how entropy of a system would change when work is done on it. Since work involves both a change in volume and an energy transfer, the entropy change due to work should have two terms: (1) entropy change due to energy transferred via work (2) entropy change due to volume change. (1) is where I am getting stuck. $dS=\frac{dQ}{T}$ only applies to energy transfer via heat transfer, not work. How would one calculate the entropy change due to work when there is no formula that tells you how a system's entropy change due to energy transferred by work?
Answer: Your equation for entropy change applies only to a reversible path.  It gives the wrong answer for an irreversible path.  To get the entropy change for any change in thermodynamic state, you devise (dream up) a reversible path between the same two end states, and evaluate the integral of dQ/T for that reversible path.  It doesn't matter whether work is done or not.
Comment: Thanks for the answer. Since I can choose any path to calculate the entropy change between two states, can I treat a work process (which involves change in both energy and volume) as two separate processes with one being a pure heat transfer and the other being a pure volume change and calculate the total entropy change by just adding the entropy  changes of the two separate processes?
Comment: You can't choose any path; you can choose any **reversible** path to calculate the entropy change.  All reversible paths (and there are an infinite number of these, give exactly the value for the integral of dQ/T.  The work processes for these paths can be whatever they turn out to be.  But, you certainly don't need to use a direct path, and you can break the overall path into separate reversible sub-paths.
Comment: I have no idea what your are saying.  Give me a specific example of two (well-defined) end states, and I will illustrate how to get the entropy change.

What is the entropy change due to work?


Is there a way to create new desktop spaces from keyboard only?

Question: We all know there is a way to to switch between desktops using keyboard shortcuts,
but can we create new ones using only the keyboard?
Answer: You can do it with some AppleScript. This will create a new desktop every time you run it:
<code>tell application "System Events"
    do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control"
    tell process "Dock"
        set countDesktops to count buttons of list 1 of group 1
        --new desktop
        click button 1 of group 1
        --switch to new desktop
        repeat until (count buttons of list 1 of group 1) = (countDesktops + 1)
        end repeat
        click button (countDesktops + 1) of list 1 of group 1
    end tell
end tell
</code>
You can save this as a Universal Service you can assign a globally-available shortcut key combination to call it.
Credit where credit is due.
Comment: Something that easy is not fair ;-)
Comment: @klanomath you got an upvote from me for even attempting to do it without touching AppleScript! :D
Comment: ;-) I upvoted you also, presenting a really clean and easy Apple Script answer
Answer: It is possible to create a new desktop space with the keyboard, but it's really cumbersome:

enable Mouse Key toggle (5 times alt) in System Preferences > Accesibility > Mouse & Trackpad > Options > enable "Press the Option key..."
hit F3
hit alt 5 times
move the cursor with the respective keys and navigate near the right upper corner
hit either i or 5 (depending on your keyboard)
hit alt 5 times
hit F3 and switch to the new space "with a keyboard shortcut".
Answer: No, there isn't a way to create a new space with only the keyboard. You'd still need to use the mouse/trackpad to drag a window to the (+) desktop thumbnail in the top-right corner (or just click on it) to create a new space.


Using the logic analyser in Keil uVision5 with an STM32 nucleo F030R8

Question: As the title says, I'm attempting to use the logic analyser that is built-in in the uVision5 with the above development board.
The debugger that I am using is the on-board ST-Link Debugger. When I am on the trace tab, most options are greyed out. I select "trace enable" and then attempt to run the debugger but I get the error "HW not present". I have seen tutorials that have the trace events available to select, and they are using the same debugger (but a different development board).
I can get everything up and running as I like if I use a simulator, so it's something hardware or configuration related.
Comment: Maybe the ST-Link Debugger doesn't support HW trace? Or perhaps the processor itself does not support HW trace?
Comment: I assumed that maybe that would be the case but all the examples that I've seen have used the ST-Link debugger. How can I find out if the processor itself is not supported? Obviously the data sheet won't tell you what it doesn't do.
Answer: I found the answer and thought that i might as well add it here in case someone else has a similar question. Any devices with a Cortex M0 or M0+ will not be able to support this function despite the debugger itself supporting it. If this function is required it is recommended to avoid M0 based development boards and go for M4 development boards. For example I have replaced the Nucleo F030R8 with a Nucleo F411RE and now have no problems.


Appropriate projection for US distances?

Question: I am generating distances between crash sites (points) and urban areas (shapes) and am wondering what the best projection is to use for this task.  The area of interest is limited to the U.S. (Alaska and Hawaii) included.  I could do Alaska and Hawaii separately to be more accurate if need be.
Answer: If you have to deal with the whole United States, you should use one of the Contiguos projections:
<code>ESRI:102003 USA_Contiguous_Albers_Equal_Area_Conic

ESRI:102004 USA_Contiguous_Lambert_Conformal_Conic

ESRI:102005 USA_Contiguous_Equidistant_Conic
</code>
Alaska and Hawaii should then be treated separately.
Comment: Don't be fooled by the term "equidistant": on Equidistant_Conic only distances along meridians (N-S) and along two standard parallels (E-W) will be true to scale.


Is "BEGIN PGP SIGNED MESSAGE" optional to include in an armored message?

Question: Although it's probably nitpicking, it doesn't look very cosmetically pleasing to put the BEGIN PGP SIGNED MESSAGE at the top of an email, is that header really required to parse the message and verify the signature below it? Can most clients just verify it without including it?
Comment: try it and see instead of waiting for strangers.
Answer: You refer to the marker of a cleartext signed message. If you use cleartext signatures instead of MIME then this marker is needed for the software to find out where the signed message starts. But again, this is only needed if you use cleartext signing.
For more information see Signature Handling in Emails which describes both ways of signing in more detail. GPG Signing: Traditional vs. PGP/Mime contains useful information too including information support for the various kinds of signing in mail clients.


Regional omission of "to be."

Question: I've noticed that people from the Washington, Oregon area tend to omit "to be" when describing something that needs to be completed.  For example, just today one of my consulting engineers sent me an update on a construction project wherein he stated, "The raw water line still needs tested."  He did not make a typo.  Is this just a grammatical form used by folks in this area?
Comment: It's not just the Northwest: http://english.stackexchange.com/q/5407/24489
Comment: Middle Tennessee as well. My ex-wife and all her family habitually omitted "to be".
Comment: Washingtonian here. This is news to me -- I've always, always known it as a Midwest construction! Where in Washington/Oregon might it occur?
Answer: Being former military, I've lived in several states throughout the Midwest, South of the Mason Dixon line and west of the Mississippi. I've come across the omission of "to be" in each state I lived. Although It does seem to creep up it certain circles more than others.
I think, and this is only an opinion, that the omission is more of an endeavor to be succinct.

Regional omission of "to be."


What is the difference between a Morph in Morphic and a NSView in Cocoa?

Question: I'd like to know about the things that make Morphic special.
Answer: Morphic is much more than NSView or any other graphics class that simply allow the re-implementation of a limited set of features. Morphic is an extremely malleable UI construction kit. Some design ideas behind Morphic makes this intention clear:

A comprehensive hierarchy of 2D coordinate systems is included. They are not restricted to Cartesian or linear. Useful nonlinear coordinate systems include polar, logarithmic,hyperbolic and geographic (map like) projections.
Separation of the handling of coordinate systems from the morphs themselves. A morph should only need to select its preferred coordinate system, instead of needing to convert every point it draws to World coordinates by itself. Its <code>#drawOn:</code> method and the location of its sub-morphs are expressed in its own coordinate system.
Complete independency of Display properties such as size or resolution. There is no concept of pixel. The GUI is thought at a higher level. All the GUI is independent of pixel resolution. All the rendering is anti aliased.
Separating the coordinate system eases the moving, zooming and rotation of morphs.
All coordinates are Float numbers. This is good for allowing completely arbitrary scales without significant rounding errors.
The Morph hierarchy is not a hierarchy of shapes. Morphs don't have a concept of a border or color. There is no general concept of submorph aligning. A particular morph may implement these in any way that makes sense for itself.
Morphic event handling is flexible and allows you to send events to arbitrary objects. That object need not subclass Morph.
Answer: Warning: Smalltalk's live dynamic environment is a red pill.  Static, frozen languages will never be the same for you ;-)
In a nutshell: Morphic is a virtual world where you can directly explore live objects (just like the real world).  Did you ever look at a UI and...

wonder "wow, that's really cool!  How did they do that?"
kvetch "I wish they had done X instead!"

While these thoughts would lead to pain and frustration in any other environment, not so in Morphic.
If you want to blow your mind, become a god in a Morphic world:

Launch a Pharo image, and click on the background (which is actually the "World") to bring up the world menu:

Bring up the "halos" on one of the menu options (shift-alt-click on my Mac):

Drag the "Pick Up" halo (top-middle) and drop it somewhere in the world:

Enjoy your menu item which is now available wherever you want it:

Seriously, click it and watch the Browser open!!
Ever have an option you always use that a vendor has buried three-menu-levels deep?  Could this be useful?!  This is a glimpse of the power of a live direct GUI environment like Morphic.
If you're intrigued, read John Maloney & Randall Smith's paper Directness and Liveness in the Morphic User Interface Construction Environment
Comment: Try googling "morphic self". The Self language is where Morphic was invented (Squeak/Pharo/LievelyKernel's Morphic are ports). I only really understood the principles (if I do now ha ha) when I studied the works of the original authors.
Comment: Thanks for the answer and the link. There is not a lot online about Morphic. The little that I have found just gushes how it is awesome, without a reference to back it up (Wikipedia no less).
Comment: Morphic is perfect for live coding. That is a mapping such that when code is changed the output on screen change and if morphs on screen is changed the values in the code is changed.
Answer: The title do not map your question, so I answer your question and not the title.
I have read about Morphic the last two days and conclude with what I think makes morphic special.
Morphic is perfect for live coding. That is a direct mapping such that when code is changed the output on the screen change. And/or if morphs on screen is changed (draged) the values in the code is changed. That is cool in art performance!
But Morphic aims for higher abstractions than that. The properties of the morphs is abstracted away from the code. Do the SoC to a file or fetch a server-side database.
I suppose WebStorage and JavaScript file is a good option to store the liveness state of the Morph properties changed interactively. You see - programming is done through each Morph. Then the code need only to handle events from click and drag.
The aim for research has even abstracted the code away. Coding can be done through the Morph to define what happen with click or drag. Morphs can be puzzle pieces as in Scratch.
A program has to be backed up into a file somewhere. I don't consider to do coding on a cloud as safe. So a JS-file is the only alternative (if not setting up a server is an option), because datafiles is not allowed locally, not even in same folder as the web app. The Same Origin policy means same server - not same folder.
When the app starts the Javascript file (or Web Storage in first place) will set up the world of morphs. User interacts with that world. The new state can be stored in WebStorage and bacuped by a download.
You can use Lively Kernel as the language in the file or store the morph data in an object or whatever you find simplest to generate as a file to download.
So what is special with this? I am not repeat the accepted answer, but this is my conclusion:

Everything you see on the Morphic screen is a morph.
The tree of morphs is called a world.
The coordinate, dimension and properties of each morph is abstracted away from the code into the tree.
The research aims for abstract away the code too.


editor account in wordpress for content

Question: Is that possible we can give client editor account for the user in admin dashboard without all the functionality? In which client can only change content not moreover that.
I appreciate it if someone helps me through this guys.
Answer: You can do that easily using a plugin like: https://wordpress.org/plugins/user-role-editor/

editor account in wordpress for content


Using cat output in osascript in terminal

Question: I want to display a notification using osascript in terminal, but the text I want to display is stored in a text file. How can I display that text in the notification?
Answer: Basically you need to read the file content into a variable first. There are several ways to do this, one is
text=$(< TEXTFILE)
osascript ... "$text"

Comment: so there's no way to do it in a one-liner?
Comment: Sure, just replace the variable with the `$(...)` construct
Answer: In the Bash shell, you can read in the text of the file using cat and shove it into a substitution.
Something like:
osascript -e "display notification \"$(cat /tmp/foo.txt)\" with title \"hello\""
(Obviously put something in /tmp/foo.txt first, like echo "Hello world" > /tmp/foo.txt)
Answer: Here is the complete soloution to my initial question I posted about:
set listOfCommand to (read POSIX file "path-to/command.txt")
  tell application "Terminal"
    do script listOfCommand
    delay 1
    quit
  end tell
set listOfShows to (read POSIX file "path-to/dump.txt")
 tell application "Safari"
    display notification listOfShows with title "Downloads:"
 end tell


Ftrace time duration

Question: I echoed 1 to tracing_on in /sys/kernel/debug/tracing directory and echoed 0 again after a second. However, the timestamp of the first entry is 216.852 and that of the last entry is 234.136 giving me a total time span of the run of about 18 seconds. How is that possible? And I've tried this many times, on different computers; yet I get an unusual time span. Am I going wrong somewhere?
Comment: Can you show show us the commands you used to set up this particular trace?
Answer: Without knowing the exact reason, I do know that Linux is not a real time OS, so operations are not guaranteed to work in a give time. Also, given that tracing on/off operations are fairly low priority, chances are that the kernel is waiting for an appropriate time to action your request, and this is the delay you are experiencing.
If the operation is asynchronous, then when you write to the file, the write command will return immediately, storing the request within the kernel - but the kernel will read and act on the change sometime later.
Comment: But it didn't wait for that much time; I mean it executed the command instantaneously; yet it gives such an output
Comment: I've edited the answer to hopefully explain this behaviour

Ftrace time duration


Number of Real Solutions of $\frac{7^{1+\cos(\pi x)}}{3}+3^{x^2-2}+9^{\frac{1}{2}-|x|}=1$

Question:
Find the number of real solutions of the equation $$\frac{7^{1+\cos(\pi x)}}{3}+3^{x^2-2}+9^{\frac{1}{2}-|x|}=1\,.$$

By hit and trial i got the solution at $x=\pm 1$ but i am not able to solve it as it involves power of 7
Answer: Note that $1+\cos(\pi x)\geq 0$ for all $x\in\mathbb{R}$.  Therefore,
$$1-\frac{7^{1+\cos(\pi x)}}{3}\leq 1-\frac{1}{3}=\frac{2}{3}\,.$$
Thus, if $x$ is a real solution of the required equation, then
$$3^{x^2-1}+3^{2\big(1-|x|\big)}=3\,\left(3^{x^2-2}+9^{\frac12-|x|}\right)=3\,\left(1-\frac{7^{1+\cos(\pi x)}}{3}\right)\leq 2\,.$$
By the AM-GM Inequality,
$$3^{x^2-1}+3^{2\big(1-|x|\big)}\geq 2\,\sqrt{3^{x^2-1}\cdot3^{2\big(1-|x|\big)}}=2\cdot3^{\frac{\big(|x|-1\big)^2}{2}}\geq 2\,.$$
Therefore, the inequality above must be an equality, which means $x^2-1=2\big(1-|x|\big)$ and $\big(|x|-1\big)^2=0$.  This shows that $|x|=1$, or $x=\pm1$.
Comment: Ingenious!  +1!  =)
Answer: Note that $\frac{7^{1+cos\pi x}}{3}+3^{x^2-2}+9^{\frac{1}{2}-|x|}$ is an even function. So it's enough to consider $x\ge 0$.
Let $$f(x) = \frac{7^{1+cos\pi x}}{3}+3^{x^2-2}+9^{\frac{1}{2}-x}$$
If $x \gt \sqrt{2} \ $ then $3^{x^2 - 2}\gt 1$ and also $\frac{7^{1+cos\pi x}}{3} \gt 0 \ \ , \ 9^{\frac{1}{2}-x} \gt 0$. Therefore $f(x) \gt 1$ and there is no root in this case. In the interval $0\le x \le 1$ we will show $\frac{7^{1+cos\pi x}}{3}$ is a decreasing function and also $3^{x^2-2}+9^{\frac{1}{2}-x}$. So there sum will be decreasing and the only root occurs when $x = 1$. When $1\lt x \le \sqrt{2}$ we have to compute the derivative $$f'(x) = -\frac{7\pi\ln 7}{3}\times7^{\cos \pi x} \sin{\pi x} + (2x)(\ln 3) 3^{x^2 -2} + (-2)(\ln 3)3^{1-2x}$$
In the mentioned interval $-\sin \pi x$ and $\cos \pi x$ are increasing so $-\frac{7\pi\ln 7}{3}\times7^{\cos \pi x} \sin{\pi x}$ is increasing. In the similar manner we can show two other functions are increasing, so $f'(x)$ is increasing when $1\lt x \le \sqrt{2}$. So we have $f'(x) \gt f'(1) = 0$. We can conclude there is no root in $1\lt x \le \sqrt{2}$.
Let $0\le x \le 1$ then $$g(x) = \frac{7^{1+cos\pi x}}{3} \implies g'(x) = -\frac{7\pi\ln 7}{3}\times7^{\cos \pi x} \sin{\pi x} \le 0$$
And $$h(x) = 3^{x^2-2}+9^{\frac{1}{2}-x} \implies h'(x) = (2x)(\ln 3) 3^{x^2 -2} + (-2)(\ln 3)3^{1-2x} = 2\ln 3(x\times 3^{x^2 - 2} - 3^{1 - 2x}) \le 0$$
Because $$x\times 3^{x^2 - 2} - 3^{1 - 2x} \le 0 \iff \log_{3} (x\times 3^{x^2 - 2}) \le \log_{3} (3^{1 - 2x}) \iff \log_{3} (x) + x^2 - 2 \le 1 -2x \iff \log_{3} (x) \le -x^2 -2x + 3 \le 3$$
Clearly this answer shows how much Batominovski's solution is elegant!


Whether there is any relationship between the frequency of an input signal and the frequency of it's fourier transform?

Question: Whether there is any relationship between the frequency of an input signal and the frequency of it's fourier transform? For example, suppose I gave a 100Hz signal, whether my FFT frquency will also be 100 Hz?
Comment: What do you mean by "FFT frequency"? FFT converts between time or space domain and frequency domain.
Answer: Whether a 100 Hz input signal will show up as exactly 100 Hz in the FFT actually depends on the sampling frequency of your input, because the FFT is a discrete transform that operates on a finite number of samples. Because of this, the frequencies that appear in the FFT are necessarily multiples of the fundamental frequency $f_0$ which is
$$f_0 = \frac{1}{Nt_s}$$
where $N$ is the number of samples, and $t_s$ is the sample interval.
So if you take 1000 samples per second, and you sample for 1 second, the size of a frequency bin will be 1 Hz and the 100 Hz signal will fall exactly in a bin (bin # 101 - bin 0 is DC, bin 1 is 1 Hz, etc).
But if your sampling frequency is 1024 samples per second, a frequency bin will have a width of fundamental frequency will be 0.977 Hz and the 100 Hz signal will not fall exactly in one bin. Instead it will be spread over a number of adjacent bins (exactly how, depends on the windowing function you use).
So in general, the answer is "not necessarily". Although if you know the windowing function and you have the entire FFT spectrum, you can actually determine the frequency of the incoming signal - especially if you know that it is a single tone.
But the finite sampling of the FFT means that there is some uncertainty - and this is what you see most clearly when the sampling frequency is not a multiple of the source frequency.
Here is a simple demonstration (written in Python):
<code>import numpy as np
import math
import matplotlib.pyplot as plt

Ns = 1024.0                 # number of samples
fs = 1000.0                 # sampling frequency
f = 100.0                   # "input" frequency
t = np.arange(0,Ns)/fs      # time when signal is sampled
fa = np.arange(0,Ns)*fs/Ns  # frequency bins
x = np.sin(2*f*math.pi*t)   # signal

f = np.fft.fft(x)           # perform FFT

plt.figure()
plt.plot(fa,np.abs(f))      # plot curve
plt.xlabel('frequency')     # label axes
plt.ylabel('abs(fft)')
plt.xlim((90,110))          # zoom in a bit
plt.show()
</code>
When I run this script the graph I get looks like this:

So even though the input was "exactly" 100 Hz, the output does not show a peak at 100 Hz. Instead, the spectral power has been spread among several bins of the FFT.
A helpful post on the topic on the EE.SE
Link to the DSP stackexchange
Comment: Infact I saved my results in a pendrive from my oscilloscope and when i opened it I could see something like sample rate 625000. Are you talking about this rate? How can I get my set of frequencies from this? Actually Iam new to signal processing and I don't know much about these stuff. Can you kindly explain?
Comment: @Rian - see my example code (written before I saw your comment). It might help - but "signal processing" is a pretty big topic with an entire Stackexchange site devoted to it...


Is there an algorithm for a Joystick class that happens to be engine/framework independent?

Question: I need to be able to get the given input's distance inside the joystick, bounded within -100% and 100% and an unbounded version of it, get the position of where the mouse's position projects to the joystick's ring and get the angle from the joystick to the given input that also wouldn't need unit conversion since all of the inputs would always be in within terms of a given unit.
Answer: I happen to have written an algorithm that does exactly that!
import kotlin.math.*

/**
 * As long as all your input is in X units, you shouldn't need any kind of conversion
 *
 * If you don't want the joystick to gravitate towards its origin position after some time,
 * use the UI viewport's units instead of game viewport's units (as the UI viewport's camera doesnt move/gravitate)
 */
data class Joystick (var initialX: Float, var initialY: Float, var radius: Float = 1f){
    var active = false
    var x = 0f; var y = 0f; var degree = 0f; var stickDistPercentageX = 0f; var stickDistPercentageY = 0f
    var distanceX = 0f; var distanceY = 0f; var realStickDistPercentageX = 0f; var realStickDistPercentageY = 0f
    var cachedValues = Array(9){1f}.apply {
        this[0] = x
        this[1] = y
        this[2] = degree
        this[3] = stickDistPercentageX
        this[4] = stickDistPercentageY
        this[5] = distanceX
        this[6] = distanceY
        this[7] = realStickDistPercentageX
        this[8] = realStickDistPercentageY
    }

    fun updateValues(mouseX: Float, mouseY: Float) : Array<Float>
    {
        var distanceY = mouseY - initialY
        var distanceX = mouseX - initialX
        if(distanceX == 0f || distanceY == 0f) return cachedValues
        // not sure if I should keep this check, the atan2 function seems to function normally despite such inputs anyway.
        var degree = atan2(distanceY,distanceX)

        var outerCircleHalfR = sqrt(distanceX*distanceX+distanceY*distanceY)

        var realStickDistPercentageX = cos(degree) *  abs(outerCircleHalfR/radius)
        var realStickDistPercentageY = sin(degree) *  abs(outerCircleHalfR/radius)
        var stickDistPercentageX = cos(degree) *  abs(outerCircleHalfR/radius).coerceIn(-1f, 1f)
        var stickDistPercentageY = sin(degree) *  abs(outerCircleHalfR/radius).coerceIn(-1f, 1f)

        var x = cos(degree) * radius
        var y = sin(degree) * radius

        this.x = x
        this.y = y
        this.degree = degree
        this.stickDistPercentageX = stickDistPercentageX
        this.stickDistPercentageY = stickDistPercentageY
        this.distanceX = distanceX
        this.distanceY = distanceY
        this.realStickDistPercentageX = realStickDistPercentageX
        this.realStickDistPercentageY = realStickDistPercentageY

        return cachedValues
    }
}

and an example usage:
if(joystick.active) {
    run joy@
    {
        joystick.updateValues(unProjectMouse.x, unProjectMouse.y)
        viewport.camera.position.add(
            joystick.stickDistPercentageX * delta * IMV * 10,
            joystick.stickDistPercentageY * delta * IMV * 10, 0f)
        if(!DEBUG) return@joy
        uiDebug.begin(ShapeRenderer.ShapeType.Line)
        uiDebug.color = Color.YELLOW
        uiDebug.circle(joystick.initialX, joystick.initialY, joystick.radius, 50)
        uiDebug.end();uiDebug.begin(ShapeRenderer.ShapeType.Filled)
        uiDebug.color = Color.WHITE
        uiDebug.circle(joystick.initialX + (joystick.stickDistPercentageX * joystick.radius),
                       joystick.initialY + (joystick.stickDistPercentageY * joystick.radius), joystick.radius/3, 50)
        uiDebug.color = Color.CYAN
        uiDebug.circle(joystick.initialX + joystick.x, joystick.initialY + joystick.y, joystick.radius/5, 50)
    }
}

override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
    centralScreen.joystick.initialX = centralScreen.unProjectMouse.x
    centralScreen.joystick.initialY = centralScreen.unProjectMouse.y
    centralScreen.joystick.active = true
    return false
}

override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
    centralScreen.joystick.active = false
    return false
}

A screenshot of an illustration of the algorithm:

Also if you input a negative number for the radius, luckily, nothing breaks, and the only side effect (as far as I observed)
is that the stick and the dot of the joystick happens to be in the direction opposite to the direction of the mouse
Now I'm sure that a lot of this code needs some explanation, so there we go.
First of all we call the updateValues function
with the unprojected positions of the mouse to the viewport (The units of the InitialX, InitialY, radius, and the arguments
of the updateValues function need to be consistent).
For those that don't know what Unproject is, (Non-LibGDX users I mean) | If you know it, skip this part.
Say the "screen" is 100PX wide and 100 PX tall and the camera in the program has a worldWidth of 5, which means that 1 unit
equals 20 Pixels on the screen. and say, the camera is at the position, x,y: 5,5, the unproject function first converts the
mouse positions into the internal units of the camera (the viewport), then adds the camera offset (how far away from the origin
is it, AKA the position) and there you have your unprojected value!
The stickDistPercentage value of the joystick is how far away it is from the radius in percentages, the value ranges from
-1 (-100%) to +1 (100%). Since it is within -1 to +1, you can directly use it in multiplicative operations without any further
conversion of it. The realStickDistPercentage is the same as this, just that it is not in the bounds of -100% to 100%
The IMV stands for InverseMouseMovement (just realized that I named it mouse movement); either -1 or 1, pull or push basically.
Line 11 draws the maximum bounds of the joystick. 50 stands for how circle-y it should look, it is outside our topic.
Line 14 draws the "stick" of the joystick that has a radius of Joystick.radius/3
Line 17 draws the dot on the ring itself.
The x, y is the dot in the ring of the circle, it isn't necessarily mandatory for a joystick but I kept it here because it might be useful in different cases.
The degree variable is the degree between the initial position and the given input position basically,
don't know how to further describe it.
The distance is the distance between the initial position and the given input position
Comment: Please use Stack Exchange's built in image posting/hosting instead of third party image links. Over time, third party links tend to break. Refer to the bottom of the [formatting help page](https://gamedev.stackexchange.com/help/formatting) for more info on how to post images here.


Excel Web Access issue

Question: I embedded an Excel sheet into SharePoint using the excel web access web part. It works great, the only problem is that it continues to display the Excel sheet on refresh where it was last saved. I set up a macro so that when Excel opens it opens to a default page, but the macro does not seem to be applying on the initial display of the sheet in SharePoint. Does anyone know how to make SharePoint always displays the part of the workbook that I want it to, regardless of where I am at at the time that I save the workbook? Any help would be much appreciated.
Answer: Name the section of excel you want consistently displayed (within excel, go to formulas > name manager).
Reference your named section within the excel web app to consistently show that area.
Answer: I figured it out just had to put Worksheets("Dashboard").Activate on the before save macro.

Excel Web Access issue


Converting oven time and temp from convection to conventional

Question: I watched a British recipe that instructed for it to be baked at 180 fan. I live in the states and use a conventional oven. What do I set it at. Also, would the baking time change?
Comment: This question (on an international forum) is about converting from/to oven types in different countries - that means it would be really helpful if you describe what a *conventional oven* is ;-)
Comment: @Stephie It is not. Gas ovens e.g.
Comment: @Stephie most ovens in the US don't use upper elements except when broiling.
Comment: @JanDoggen I might be wrong, but that is one of the very few things which I thought to be fairly consistent? An conventional oven has a top and bottom heating element and transfers heat slower than a fan oven that moves the hot air around?
Comment: yeah i though side elements were the standard
Answer: 180 fan is equal to 200 oC= (400 oF).
I attached a chart I didn't create I use for reference.
Answer: 180 fan is 180 degrees Centigrade with the fan on. The general advice when converting from a fan to a non fan oven is increase temperature 15-20 degrees, so the range you are looking for is between 383 and 392 degrees Fahrenheit. If you have a digital stove I'd say set it for 390, if it's a dial you'll need to eyeball it.


How to put your GPS track in a video?

Question: I am about to start a channel on YouTube.
There will be occasions that I will drive while recording my path with an indoor (inside car) camera.  I thought that it could be great if I put a tiny square on the corner of the video with the GPS tracking corresponding to my car path.
Is it possible? What do I need to do it?
Answer: I personally use RaceRender, however, there is also DashWare.
Both can edit video and add GPS position overlays.
Bare in mind, neither of them can add the actual "map" like one from Google Maps, just a line showing your path and a marker showing the current location.
Again, my personal preference is to use RR or DW to produce a video with a magenta background so I can Chroma Key it in my editor (Magix Vegas).
I find the built-in editors in both programs a bit fiddly, so the use of a proper editor is recommended but they're fine if you just want to load a video, apply the overlay and render it out.
Answer: If I was doing this for a video production, I would use After Effects, and import the GPX track from a GPS device into a mapping plugin like GeoLayers:
https://aescripts.com/learn/1-min-tut-use-geolayers-with-a-gpx-track/

How to put your GPS track in a video?


Taxonomy term view - show node fields in the view?

Question: Ive enabled the default view 'Taxonomy term' which overrides taxonomy term pages. How can I add fields for my nodes? Currently it says 'The selected style or row format does not utilize fields.' Thanks
Answer: Right above "Fields" that you can't change is "Format".  It's set to "Show: Content" by default.  Change that to "Show: Fields".
Answer: It depends on what kind of Views "Format" you are using. For example if you have JSON data document/ Table / etc., you can change its "Field output" to Normal (if you have "Raw" it will echo only correspond id)


QGIS: I can barely see the labels in layer panel

Question: So, I finally bit the bullet and upgraded to QGIS 3.2.3 Bonn.  However, for layers that are not turned on the font is a super light grey in the layer panel and I can barely read it.  How can I change what this looks like so I won't need to get glasses in 6 months?
Answer: This question about changing the background color of the layer panel may help. They recommend the Load QSS - US Themes plugin. Try the  themes "dark" and "wombat." The other themes actually make it harder to read deactivated layer names.
You can also create your own UI theme using the examples that come with the Load QSS plugin as templates. The qss files for these examples are available on GitHub: https://github.com/All4Gis/Load-QSS/tree/master/examples

Or you can change some display settings in the Options dialog (Settings menu > Options > General). Unfortunately you can't change the font color, but the night mapping* UI theme may help, or enlarging the font.

*There's a bug in QGIS 3.0 where switching to night mapping mode might cause QGIS to crash. https://issues.qgis.org/issues/18669
*There's a bug in QGIS 3.2 where you can't turn on night mapping mode. https://issues.qgis.org/issues/19944

Here's a rather silly workaround. Put every layer in its own group with the same name as the layer. When a group is disabled, the group name is still displayed in black.
Comment: Nice.  I like the idea of tweaking the UI via QSS.  Not really in love with any of the defaults provided.  I am fine tweaking the code but I can't seem to figure out where the files are or where to put the tweaked file on my computer.  I can't seem to find them anywhere.  Ideas?
Comment: The night mapping QSS file is here: QGIS 3.2\apps\qgis\resources\themes\Night Mapping. I couldn't find the QSS files for the themes that come with the Load QSS plugin on my computer. That's why I included the github link. You can use the ones on github as a template to create your own theme. Then save the QSS file anywhere and load it through the plugin.
Comment: Well...so I think I am stuck with one of the templates until QGIS realizes the new look is dumb.  I can't find any background color that works better than the templates which I still don't really like.  Wish I knew more about coding so I could just add a line in to change the font color.  It doesn't look like there are any lines in the QSS that address the font color, just backgrounds.  Thanks for the help, and if anyone figures this out please let me know!
Comment: You could make a feature request. https://issues.qgis.org


If you were to write a song, how would you use dissonance and consonance?

Question: im still a newbie to this so i kinda need an answer to this
Comment: I know you are new and all but this is not really an answerable question.  Way too broad.
Answer: I would use dissonance the same way I use spices when I'm cooking. You wouldn't eat them pure, but the food would taste totally bland without them
Answer: This is a very broad question, but I think there are a few basic ideas for you to be aware of. The following won't be a formula to write a song, but rather an suggested approach for thinking about dissonance.

Dissonance/Consonance can be expressed as a ratio between two pitch frequencies where simple ratios are consonant and complex ratios dissonant. Like 1:1 for a unison which would be the consonance end of the spectrum, and 16:15 for a minor second near the dissonant end of the spectrum.
Other than the ratio method shown above there is no objective measure of dissonance/consonance. It depends on culture or a particular school of composition. A perfect fourth is considered dissonant in strict, Church style counterpoint, but to many modern listeners it's consonant. Keep this in mind when reading about dissonance. Many 'rules' about dissonance are specific to particular composing methods, mostly in strict classical style, but jazz has some concepts about avoid notes too relating to dissonance.
Consonance is considered stable, dissonance unstable, and that has a basic connection with meter. At a very basic level, meter confirming music will put consonances on strong beats. Dissonances would happen on weak beats, for example before a barline a dissonance on beat 4 to a consonance on beat 1 of the next bar. Or, dissonances may happen between beats like with passing tones. The ebb and flow of dissonance/consonance in this metrical way helps create a forward impulse in music.
Dissonance can be used deliberately for expressive purposes. There is a type of non-chord tone called an appoggiatura which is dissonant, but can be accented on a strong beat to create a kind of expressive tension. Another example is the dissonant diminished seventh chord which can be used to express surprise or fear, etc.

Notice in the last two points how dissonance can sometimes be sort of hidden and unaccentuated, but then at other times deliberately accentuated for expressive purpose. This is what makes dissonance a tricky topic. It isn't bad per se, but requires careful control and depends a lot of style.


Expected number of turns for a rook to move to top right-most corner?

Question: Suppose a rook starts on the lower left-most square of a standard $8 \times 8$ chess board. The board contains no other pieces.
The rook randomly makes a legal chess move with every turn (directly vertical or horizontal). The rook cannot remain stationary during a turn. What is the expected number of moves for the rook to land on the upper right-most square?
I understand the rook has 14 possible moves for every turn. The problem seems to fit the concept of Markov chains, as the probability distribution of any given move does not depend on the previous. However, I do not understand how to approach this calculation.
Answer: Label the board as $\{1,2,\cdots,8\}\times\{1,2,\cdots,8\}$. A key remark is that the number of coordinates of the position of the rook which are equal to $8$ performs a Markov chain, and, obviously, the upper rightmost square is the only square on the board such that this number is $2$. Thus, one asks for the mean hitting time of $2$ by a Markov chain on $\{0,1,2\}$ starting from $0$ with transition probabilities as follows:

Transition $0\to0$: probability $\frac67$
Transition $0\to1$: probability $\frac17$
Transition $1\to0$: probability $\frac12$
Transition $1\to1$: probability $\frac37$
Transition $1\to2$: probability $\frac1{14}$

Then the usual approach works: one considers the mean hitting time $t_k$ starting from state $k$, then $t_2=0$ and, conditioning on the first step of the Markov chain, one gets $$t_0=1+\tfrac67\cdot t_0+\tfrac17\cdot t_1,\qquad t_1=1+\tfrac12\cdot t_0+\tfrac37\cdot t_1+\tfrac1{14}\cdot0,$$ hence the desired expected time is $$t_0=70.$$ Perhaps surprisingly, starting from the square G7 it takes exactly as many steps to reach the (apparent) neighbour square H8 than starting from the (apparent) farthest square A1.
More generally, for a board of size $n\times n$, $$t_0=n^2+n-2.$$
Comment: @paw88789 Which answer was that?
Comment: The fact that the move is to move to a random square in the same column or row - i. e. change one coordinate uniformly at random - explains why G7 is no closer to H8 than A1 is.
Answer: You can simplify this problem quite a bit by noting that we can classify squares on the board as being in one of three sets: Set $A$ is the set of $49$ squares that are not in the row or column of the target square; set $B$ is the set of $14$ squares that are in the row or column of the target square, but not the target square itself; and set $C$ is the set of the target square.
If the rook is (on a square) in $A$, it has transition probabilities of $P(A\to A)=\frac{12}{14}=\frac{6}{7}$, and $P(A\to B)=\frac{2}{14}=\frac17$.  If the rook is in set $B$, the transition probabilities are $P(B\to A)=\frac12$, $P(B\to B)=\frac37$, and $P(B\to C)=\frac1{14}$.
If we let $E_A$ be the expected number of moves to get from $A$ to $C$ and $E_B$ be the expected number of moves from $B$ to $C$, we can set up the following equations:
$E_B=\frac{1}{14}\cdot 1+\frac{3}{7}(E_B+1)+\frac{1}{2}(E_A+1)$ and
$E_A=\frac17(E_B+1)+\frac67(E_A+1)$.
You should be able to solve this system for $E_A$ and $E_B$ to finish off the problem.
Comment: For the impatient, you can see the results at http://www.wolframalpha.com/input/?i=x%3D1%2F14%2B3%2F7%28x%2B1%29%2B1%2F2%28y%2B1%29%2C+y%3D1%2F7%28x%2B1%29%2B6%2F7%28y%2B1%29.
Answer: Lets keep it simple. Wherever you are on the board, there are 14 possible moves. Therefore, every calculation will be considered in a fraction of 14. As we only need the likely amount of moves, we'll treat every chance as absolute.
If you are on one of the two edges that can reach the destination in one move, there is a 1/14 chance of reaching it. That means that it takes 14 moves on the edge to reach the destination.
There is a 7/14, or a 1/2, chance of moving away from the edge, back to where you need two moves to reach the destination. Since you need to be on the edge 14 times before reaching the destination, 14/2 is 7. You'll move away from the edge 7 times.
When away from the edge, it takes a 2/14, or a 1/7, chance of returning to a proper edge. That means 7 moves before reaching it. When combined with the previous short paragraph, we can multiply 7 by 7 to reach 49 moves. That is how many times it takes to reach 14 moves on the edge.
So, we get 49+14 = 63. But wait! We don't start on the edge, we start on the opposing square. So we need another 7 moves to reach a proper edge. 63+7 = 70.
It takes 70 moves to reach the destination, starting from the opposing corner.


He told me he plays table tennis well. Why didn't he use played

Question: He told me he plays table tennis well. Why didn't he use played?
Answer: The simple present is used for general statements. They might be specific to the time of speaking, or they might be much broader. If I say "I speak French" (though I don't, at least not very well), I am not saying that I am speaking French at that moment. I am saying that I have the ability to speak French, or that I may speak French from time to time. If I say "I speak French poorly", I am saying that, on those occasions that I speak French, I do so poorly.
"I spoke French poorly" would be used if either I no longer speak French, but when I did I spoke it poorly, or in reference to a particular occasion or point in my life.
"I play table tennis well" fits this same pattern. It would mean that, on those occasions when I play table tennis, I play it well. "I played table tennis well" would indicate that I used to play it well, but I do not play it any more, or that on some particular occasion in the past (made clear in context) I had played it well.
Comment: He told me he plays table tennis well. This sentence tell us that he play and played  table tennis well in the past and now. Is this right?
Comment: And expects to in the future, without saying anything about whether he is actually play**ing** right now. That is what is meant by saying it is a "general statement".
Comment: Okay, I know now.
Answer:
[1] I play table tennis well.  [original utterance]
[2] He told me he plays / played table tennis well. [indirect reported speech]

He could have used "played".
This is all about something called 'backshift'. Backshift with verbs of reporting that are in the preterite is perfectly normal.
The use of a non-backshifted report ("plays") is possible but subject to the condition that it must be reasonable to assume that the original utterance is still applicable and relevant.
Only if this condition is satisfied are both backshifted and non-backshifted versions in principal possible.
Thus in your example, which uses "plays", we have to assume that he still plays tennis well.


Python Django - unsupported operand type(s) for -: 'float' and 'NoneType'

Question: I'm a beginner to python and Django, I tried to do searching but I can't find my answer to this. Can anybody help me with this please.
code from my html:

{{ schedule.count_available|floatformat:0|intcomma }}

my model:
class Schedule(models.Model):
    code = models.CharField(max_length=100)
    vessel = models.ForeignKey(Vessel,on_delete=models.CASCADE)
    depart = models.ForeignKey(Location,on_delete=models.CASCADE, related_name='depart_location')
    destination = models.ForeignKey(Location,on_delete=models.CASCADE, related_name='destination')
    schedule= models.DateTimeField()
    fare= models.FloatField()
    status = models.CharField(max_length=2, choices=(('1','Active'),('2','Cancelled')), default=1)
    date_created = models.DateTimeField(default=timezone.now)
    date_updated = models.DateTimeField(auto_now=True)

    def __str__(self):
        return str(self.code + ' - ' + self.vessel.vessel_number)

    def count_available(self):
        booked = Booking.objects.filter(schedule=self).aggregate(Sum('seats'))['seats__sum']
        return self.vessel.seats - booked

error:
error image
Answer: The error appear when booked value is None.
You should debug your code.
Is your query Booking.objects.filter(schedule=self) have at least one value
Comment: I have two data saved in schedules, but when I tried to do float is appears this type of error.
Answer: The error occur when django encounter schedule object that have no booking, and in such case
booked = Booking.objects.filter(schedule=self).aggregate(Sum('seats'))['seats__sum']
evaluates to None and raise the error
To solve this, update your count_available method as follows
def count_available(self):
    booked = Booking.objects.filter(schedule=self).aggregate(Sum('seats'))['seats__sum']
    if booked:
        return self.vessel.seat - booked
    return self.vessel.seats

This will only do the substraction when bookings for that schedule is available, otherwise returns the total number of seats for the schedule


Script to check for read only filesystem

Question: How can I check a bunch of systems to find any filesystem that are mounted read-only? Possibly via a script?
Comment: What systems? What issue?
Comment: Your Question is not clear. Please rephrase it.
Comment: They are RHEL4 and RHEL5 systems.  The filesystem (eg /var, /tmp , /) are mounted as read only. I want to find/list which sytems have such read only issue.
Answer: awk '$4~/(^|,)ro($|,)/' /proc/mounts

Comment: I understand the awk, but not the 'nosuid' part.  Can you please explain a bit more?
Comment: @user11496: I meant "ro" - I mis-pasted my test code.  I fixed my answer.
Answer: I've used the following in the past
grep ' ro ' /proc/mounts

In some instances you may want to skip any remote mounts which may be RO by design
grep ' ro ' /proc/mounts | grep -v ':'

You also may want to skip things that are mounted via automount
grep ' ro ' /proc/mounts | egrep -v 'automount|autofs'

Answer: If you intent is to find filesystems with problems (i.e. the mounting status has been changed to READ-ONLY due to a filesystem error), then I'd do the following (assumming ext* filesystems):
 tune2fs -e panic [raw-disk-partition-name]

EX:
 tune2fs -e panic /dev/sda1

What this does is panic the system, thus rebooting the server, possibly invoking a fsck on the problem filesystem to fix it.  Thus a serious filesystem problem is handled by having the system fix it automatically, instead of dumping it into Read-ONLY mode which I have not found very helpful.  Besides I'd rather panic a problem filesystem, fixing it than attempting to run with it damaged which as time goes on might cause more damage.
Comment: This doesn't address the question. The poster isn't asking how to fix file systems, they are asking how to find read-only file systems.

Additionally, making the system panic is a really bad way to go about fixing a corrupt file system.
Comment: Unfortunately, read-only filesystems due to panic, are *not* marked as "ro" by the mount utility. So this is at least a valuable pointer in a helpful direction.
Answer: cat /proc/mounts|sort|awk '{print $1 "\011" toupper(substr($4,0,2))}'

Produces tab delimited output with mount name and mode.
Answer: As other answers suggest, you can parse /proc/mounts with grep or awk, for example you can list the read-only mounts:
$ grep "\sro[\s,]" /proc/mounts

or
$ awk '$4~/(^|,)ro($|,)/' /proc/mounts

An alternative to parsing the content of /proc/mounts that you could try is
$  grep '^ro$' /proc/fs/*/<device>/options

where <device> is the filesystem's device node name under /dev. For example
$ grep '^ro$' /proc/fs/*/sdc1/options

would return ro if /dev/sdc1 is mounted read-only.
If you want to check for a read-only block device (instead of a mounted filesystem) you can use
$ cat /sys/block/<device>/ro

which returns 1 if the filesystem is read-only or 0 if read-write.
Note that <device> above refers to the real device node. If you want to check a symlink device (such as those created by device-mapper or by-uuid references) then you can use basename and readlink to get the device node name. Like these examples:
$ grep '^ro$' /proc/fs/*/$(basename $(readlink -f /dev/mapper/foo)/options
$ cat /sys/block/$(basename $(readlink -f /dev/mapper/foo)/ro

Answer: An approach that works even for remote file systems (which can be mounted rw even if they're exported ro, resulting in a read only file system) is to simply create a test file on each file system and test the return code of that command.
But if this is something that happens regularly you need to look into the cause rather than trying to keep up fixing the symptoms.
Answer: I'm a little late but this is how I handle it.
#!/bin/bash

FILE=/tmp/test.txt

# Check health of LXD host machine
touch ${FILE}

if [ -f ${FILE} ];
then
   rm ${FILE}
   echo "File System is Good!"
else
   message="File System is R/O !"
   echo ${message} >> /var/log/lxd/health.log >&2
   send_twilio "${TWILIO_ACCOUNT_SID}" "${TWILIO_ACCOUNT_TOKEN}" "${TWILIO_NUMBER}" "${to_twilio}" "${HOST}" "${message}"

Comment: /tmp could be on a different block device than /  ... even in ram (tmpfs)
Answer: Just look for the ro mount option.
Comment: That miscatches any line with "ro" in it, including anything with the "errors=remount-ro" option.
Comment: So then use a more sophisticated regex.


Is it possible to invert the colors in Kile's live preview?

Question: I like to use a dark theme for Kile, but the live PDF preview window (which is a great feature) is very bright.  Is there any way to make it dark, or set the background black, or invert the colors, or soemthing like that?
Comment: You can adjust the colors of every theme in kile... So yes it is possible I suppose... If you don't find the way in the settings I will check later in another pc of mine with kile installed... I haven't live PDF window there... but it doesn't matter if you adjust the colors you want one by one in the theme you like the live PDF colors I suppose
Comment: Just for clarification: Do you want to change the viewer's background or the viewer to invert PDF colors?
Answer: I found on my PC that colors can be changed like this

Settings -> Configure kile -> Editor ->Fonts & colors

If you adjust them from that section while you are still using the theme that fits your live PDF needs (the lighter), I suppose you will not have the specific problem (because the theme will remain light but the colors of the real output in the editing window will be adjusted to darker colors).
Possible in the new version there is a menu

Settings -> Configure kile -> PDF Viewer ->Fonts & colors

and in this case may be thinks are even simpler
PS: I used that to have a lighter color between brackets (bracket highlight) than the text area and the line color and it was a nice feature because you can see where your brackets are closing... Do this at least if you don't find my answer useful otherwise (I have no live PDF viewer)
Comment: @TeXnician, does it mean that the menu is different, or that is the same but changing the background font will change live PDF preview font too? I only can imagine these two options. If so, please confirm to delete my answer.
Comment: Unfortunately, I did not understand your comment. But I reread the OP and it's not very clear what is actually referred to, hence I did leave a comment asking for what the OP tries to achieve. So you should not delete until we have a reaction by the OP.
Comment: @TeXnician, you made me find out what possibly was not clear in my answer and edited the answer... May be you will get it now.
Answer: The PDF output can easily be inverted by changing Configure Viewer > Accessibility > Change colours > Colour Mode > Invert colours, However the question says live preview window which is controlled by
Settings > Configure Kile > Tools > Preview > Quick Preview in Bottom Bar Background colour > Basic colors = anything you like
You can also change dpi for larger/smaller and change it for Selection, Environment or Maths
The only setting is background so I don't think you could invert unless you set the text to white, which could cause issues with down stream PDF generation, so I would suggest a grey tone whilst previewing. there was a similar request discussed here
On further testing Quick preview can call up Okular which also has Accessibility > Change colours > colour Mode > Invert colours so I guess its down to which window your using to preview.


PTIJ:When can you study Greek philosophy?

Question: The Talmud [Menachot 99b] tells us that someone asked Rabbi Ishmael, "May one such as myself, who have studied the entire Torah, learn Greek philosophy [chochmat yevanit]?"  The rabbi noted that the Tanach says that you must meditate on the Torah day and night [Joshua 1:8]. So he concluded: "Therefore, go and find a time that is neither day nor night, and at that time you may study Greek philosophy!"
Obviously, he was telling him to take a spaceship and go far, far from the solar system, where there is no day and no night, and there, in the middle of nowhere, he could study Greek philosophy to his heart's content.  My halachic question is: How far must he be from the nearest star?
This question is Purim Torah and is not intended to be taken completely seriously. See the Purim Torah policy.
Comment: It seems clear he is talking about bein hashemashos
Comment: @SAH No problem. I take umbrage that you didn't view it as my generosity to you.
Comment: @SAH Anything celestial or meteorological is fascinating. IY"H, I'll have a look. Thank you.
Comment: @SAH I thought of this too, but, I can post just one idea. Make yours an answer.
Comment: I think  ben hashmashot is definitely either day or night, but which it is is a matter of dispute.
Comment: @DanF I take umbrage at this arbitrary limitation on your creativity
Comment: @DanF Sorry, but I don't know enough about Bein Hashemashos to write it
Comment: @SAH This is Purim Torah.. You don't have to know much. Here's a suggestion - *Bein Hashmashot* means, literally "between the two suns". Google a bit, and I am sure you'll find a reference to some galaxy that has two suns.
Answer: To understand when Greek Philosophy may be studied we must figure out what was meant by day and night. There is a very early Scriptural source that tells us what day and night are.

וַיִּקְרָא אֱלֹהִים לָאוֹר יוֹם וְלַחֹשֶׁךְ קָרָא לָיְלָה וַיְהִי
  עֶרֶב וַיְהִי בֹקֶר יוֹם אֶחָד
And God called the light Day, and the darkness He called Night. And
  there was evening and there was morning, one day. (Mechon Mamre)

Thus, what R. Yishmael meant was that one can study philosophy at a time when there is neither light nor darkness. Now this brings us to the old philosophical debate about whether darkness is the opposite of light, or merely the absence of light. If the former, there could conceivably be a time at which there is no light and no darkness. According to the latter view, though, there can not exist such a time because a lack of light is automatically darkness.
The textual evidence in the Talmud does not indicate which school of thought R. Yishmael belonged to. If he belonged to the "opposite" camp then he was possibly allowing philosophy at certain times. If he belonged to the "absence" camp then he must have been saying that philosophy is never allowed.
Although the Talmud remains vague, we have a direct ruling from one of the earliest post-Talmudic sources. R. Saadia Gaon in Emunos V'deios Treatise I writes as follows:

Yet I cannot remain content at this point with all that I have
  mentioned until I have made it clear that this thing to which these
  proponents of dualism adhere so firmly – I mean [what they call the
  principle of] darkness – is not a principle opposed to that of
  light, but merely the absence of light. (Rosenblatt translation p. 64)

In Treatise II he states this again:

Ignorance, on the other hand, has no such source from which it is
  derived, being merely the absence of knowledge, as we explained in the
  matter of darkness that it constitutes the absence of light and not
  its opposite. (Rosenblatt translation p. 89)

Thus, we have a clear ruling from R. Saadia Gaon that there can be no such time where there is neither light nor darkness. As such, one is never permitted to study Greek Philosophy (which probably includes parts of the very Emunos V'deios from which this ruling is derived).
Comment: Does a downvote on a Purim Torah answer mean that it is not sufficiently "Purim Torah"? Or does it indicate that there is an actual flaw in the answer?
Comment: Who knows around here... +1
Comment: Way to go R. Saadia Gaon for coming down on the same side as modern physics!
Comment: The answer is seriously flawed. You conclude that one is never permitted to study philosophy, and yet you start your question with an "old philosophical debate" (+1)
Answer: Let us take a closer look at the actual Talmudic text.

צא ובדוק שעה שאינה לא מן היום ולא מן הלילה ולמוד בה חכמת יונית
Go and search for a time that is not not of the day and not of the
  night, and learn in it Greek Philosophy.

The double negative clearly indicates that R. Yishmael is saying to find a time that is either day or night and learn philosophy. I.e. philosophy can be learned at any time.
Comment: @רבותמחשבות  It depends on order of operations. Is the first "not" modifying "not of the day", or is it modifying "not of the day and not of the night"? My answer maintains the latter.
Comment: Actually, ~(~A&~B) <--> A v B so you can pick at least either night or day for study. See Reb Demorgan's responsa for details
Comment: Good read, but your conclusion does not follow logically:  "not not of the day and not of the night" means only day, and not night!
Comment: then I think you should bold the second not, and perhaps put "not of the day" and "not of the night" in quotes
Comment: @DoubleAA What does "v" represent?
Comment: @alex in formal logic v from the Latin vel means logical disjunction
Comment: @DoubleAA @ רבות מחשבות  You guys are making things complicated with all the symbols. - (-2 -2) = 4. - (-2) - 2 = 0.
Answer: I am taking issue with your quotation where you said,  "Therefore, go and find a time that is neither day nor night, and at that time you may study Greek philosophy!" Rabbi Yishma'el is talking about a time, whereas your question is asking about a place. That contradicts what Rabbi Yishma'el was saying.
So, I will answer regarding when that time is. He is clearly referring to the Mashiach, of which Zacharia 14:7 says that this will be a day which is neither day nor night. At that time, he can study Greek philosophy.
Comment: "this will be a **day** which is **neither day nor night**" anyone else find that funny?
Comment: @רבותמחשבות It may not offer a huge chuckle, FWIW. But, maybe look at my last sentence. I don't think one cares to study Greek philos0phy, then. Here, the word day, refers to a time period, not light.
Comment: I get the joke.  I also realize that the Passuk says that ( a day which is neither day nor night).


Is it possible to use the Playstation 4 camera on Raspberry Pi?

Question: I want to use a stereo/depth camera with my RPi 4.
The Playstation 4 camera appears to be a stereo camera, and is significantly cheaper at $40 (on amazon) than any others like Intel RealSense, Mynt Eye, Microsoft Kinect, StereoPi, etc.
A cursory search didnt return any hits on RPis and PS4 cameras (though some results for other PlayStation peripherals on RPi 3).
I'm still new to hardware and embedded stuff. Don't really know much about depth sensor hardware. Basically I want to be receiving a stream of RGBD images from 10-30hz video with minimal hacking, and open to suggestions.
Amazon link to ps4 cam: https://www.amazon.com/PlayStation-4-Camera/dp/B01LW1OM63
UPDATE:
I managed to find some work on integrating the PS4 camera in Linux, following @jsotola's suggestion.
The project does not appear to be maintained any longer, but PS4eye appears to be a best-effort attempt at support for PS4 camera on linux.
I found the project from a blog post https://orientalrobotics.blogspot.com/2014/12/playstattion4ros.html (note: Japanese),  with more detailed description of the process and more recent development at the author's fork https://github.com/longjie/ps4eye.
It looks good, but still experimental. I'm probably just going to get the intel realsense.
Comment: `didnt return any hits on RPis and PS4 cameras` ... wrong search ... search `linux ps4 camera`
Comment: @jsotola not sure why I didn't think of this. Thanks for the tip!
Answer: If the camera streams its images over USB or wifi, Yes.  Otherwise, No.


Many to many relationship between Account and contract

Question: Can we create Many to many relationship between Account and Contract? I have done this with junction object but i have one doubt as Contract have lookup relationship with Account which is required on page layout. So if i create one account "Acc1" then i want to create one contract for this Account as "Contract1" which i can create from its related list. Now, Same contract i want to link to another account say "Acc2". For this, i will add data into junction object to link Contract1 to Acc2. This is working fine. But as contract have lookup filed with Account, that contract will be displayed under COntract related list as well and at the same time, i need to add same contract in junction object. Is this right approach?
Please help.
Answer: Short answer: it depends.

Long answer:
The standard contract, as intendend by Salesforce has a 1-to-many relationship on salesforce. It means, that you company just have a contract with another company.
There are many approaches for you case and it'll depend mostly on why you need a many-to-many relationship.
If your company indeed have multi-party contracts and all Accounts have the same "participation" on the contract, you can simply hide the Contract related list and always use the junction object.
If the second company is just an auxiliary, then you can use the Account field for the main account and the junction object for the accounts of interest (maybe add a field to represent their role on this contract).
Also, you may consider dropping the contract and using a custom object to represent exactly what you want it to represent.


Interaction Studio APIs

Question: I'm looking for Interaction Studio API documentation. What I'm trying to achieve is to create an email which will call API to get the next best actions recommended by Interaction Studio. Thank you for any reference or suggestions.
Answer: Here are the steps to make this happen:

Create a Touchpoint for email interaction
Configure NBA in interaction studio under that TouchPpint
Call interaction API from email to retrieve the NBA image using POST (as per documentation below)
Interaction studio will return NBA based on eligibility and priority rules

The Interaction Studio API documentation can be found here: https://na5.thunderhead.com/one/help/interaction-studio/technical-documents/one-api/one_api_interaction/
The request body would look like this:
{
"customerKey": "firstname.lastname@example.com",
"customerKeyName": "customerkey",
"properties": [],
"uri": "assisted://salesforcecore/nba"
}
The optimisation point should be called "nba" in IS for this to work correctly.
Comment: Thank you @c-carswell. This is exactly what I'm after.
Answer: There is not much documentation for Interaction Studio API. You can start here: Interaction Studio.
It sounds like what you're trying to achieve can be done through the Journey Builder API by Admitting Contacts via API which is essentially using the API entry event within Journey Builder.
Comment: Hi Jackson, thank you for the response. I'm actually looking for something bit different. IS can change content on your website for each user based on their behavior. What I'm trying to achieve is to get the same recommended content via API and use it in emails so the users have constant experience across all channels.

Interaction Studio APIs


Is Attila The Hun's Throne actually located in The Veneto?

Question: Torcello Island is a small island approximately 5 miles East of Venice. The island's "claim to fame" is a small ancient stone chair which has been nicknamed, "Attila's Throne"-(named after, Attila "The Hun").  Now, the historical evidence suggests that this ancient stone chair was the actual Seat of Power for the Island's Bishop beginning in the mid 500's AD/CE-(and the ancient stone chair may have also been The Seat of Power for the island's earliest Governor).  The legend, however, suggests that Attila "The Hun" was actually enthroned on Torcello Island. Does anyone believe that this ancient stone chair on a remote Italian island, was the actual Seat of Power for the Father and King of the Huns?
Comment: Somewhat off topic, but for anyone interested in some of the legends of old Venice who isn't too picky about what may or may not be accurate, the [alternate history](https://en.wikipedia.org/wiki/Alternate_history)/historical fantasy novel [Shadow of the Lion](https://en.wikipedia.org/wiki/The_Shadow_of_the_Lion) is one of my favorite books ever.
Comment: "Does anyone believe ..." may not be the best way to phrase the question. I'm quite sure that someone, somewhere does believe it (people believe all sorts of strange things!). However, that doesn't make the legends true.
Comment: ...more on-topic, the Wikipedia page for [the throne](https://en.wikipedia.org/wiki/Attila%27s_Throne) baldly asserts otherwise, but with absolutely no references (and is marked as needing them).
Comment: If it was really Attila's throne, you'd think they'd move it inside...
Answer: No
This Venetian tourist site asserts not:

In reality the Hun [sic] never arrived in Torcello as their descent into North Eastern Italy was halted at Aquileia (UD) and being pastoralist people, they would have never reached an island from the sea.

Aquileia is at the head of the Adriatic, but on the mainland, and closer to Trieste than Venice. Actually, Attilla's next target was Padua, but in 452 Pope Leo I somehow persuaded him to stop.
Recall that the islands in the Veneto were settled by by people fleeing the various Gothic, Hunnic, and Lombard invasions near the end of the Western Roman Empire. Attilla was likely more interested in richer prizes (such as Rome) than pursuing a few soggy refugees into a swamp.
Answer: Of the parts of the legend mentioned in your question, one part is probably false while the other is almost certainly false.
Is the stone chair Attila the Hun's throne? As T.E.D. noted in his comment, Wikipedia's page Attila's Throne asserts it isn't. The source for this seems to be this article (which also gives no sources). Wikipedia says the stone is most likely a podesta or bishop's chair.
Was Attila the Hun actually enthroned on Torcello Island? This is almost certainly false as the evidence suggests Attila never visted the island. John Man, in 'Attila the Hun' states that

Aquileia's surviving inhabitants fled
  from the Huns to found Venice, which was supposedly a secure haven because the Huns dared not
  ride their horses into the surrounding mud.

Similarly, Bonnie Harvey in 'Attila the Hun' says

Like Aquileia, Padua suffered great
  losses under the Huns. Many of Padua's citizens fled before
  the approaching army. These 500 people later founded the
  city of Venice. The Roman historian Cassiodorus reported
  that "Many families of Aquileia, Padua, and the adjacent
  towns . . . found a safe, though obscure, refuge in the
  neighbouring islands [near present-day Venice]. . . .

As these fleeing inhabitants lived to tell the tale, it is fair to assume that Attila was not enthroned in what was their new home.