Valgrind cannot attach on OSX Lion

Question: When I run valgrind with the options --tool=memcheck --db-attach=yes and then try to attach when an error pops up i get: valgrind: m_debugger.c:235 (ptrace_setregs): Assertion 'Unimplemented functionality' failed. It seems odd to me that this would not be implemented as it is such a core feature to valgrind. Is there a workaround?
Answer: You can upgrade to Valgrind 3.7.0 and use the embedded gdbserver.
See Valgrind 3.7.0 user manual for more details

Valgrind cannot attach on OSX Lion


ojspc always returns 0 on errors

Question: In my Ant build.xml file, I am trying to compile JSPs using ojspc.  The files are being compiled, however, the build process is still running to completion when the JSP compilation has errors.
This is part of my build.xml:
<java fork="true" jar="${env.ORACLE_HOME}\j2ee\home\ojspc.jar" resultproperty="result">
  <jvmarg value="-Djava.compiler=NONE"/>
  <arg value="-extend"/>
  <arg value="com.orionserver.http.OrionHttpJspPage"/>
  <arg value="-batchMask"/>
  <arg value="*.jsp"/>
  <arg value="${target-directory}/build/target/ear/${module-dir-name}-jsp.war"/>
</java>
<echo level="info">Result Property: ${result}</echo>

I have tried setting the property failonerror="true" but that does not change anything.
I receive the following output:
 [java] Detected archive, now processing contents of ../build/target/ear/web-module-jsp.war...
 [java] Setting up temp area...
 [java] Expanding archive in temp area...
 [java] C:\DOCUME~1\MMCCOR~1\LOCALS~1\Temp\tmp12940\_web_2d_inf\_jsp\_password.java:60: cannot resolve symbol
 [java] symbol  : variable reqvst
 [java] location: class _web_2d_inf._jsp._password
 [java]       out.print(reqvst.getAttribute("test"));
 [java]                 ^
 [java] 1 error
 [java] Creating D:\eclipse-workspace\jdw\build\..\build\target\ear\web-module-jsp.war ...
 [java] Removing temp area...
 [echo] Result Property: 0

...(more commands)
BUILD SUCCESSFUL

In the password.jsp file, I intentionally introduced an error to test.
How can I get the build to fail on an error?
At the Ant Java page, I am confused by:

By default the return code of a
  is ignored. Alternatively, you can set
  resultproperty to the name of a
  property and have it assigned to the
  result code (barring immutability, of
  course). When you set
  failonerror="true", the only possible
  value for resultproperty is 0. Any
  non-zero response is treated as an
  error and would mean the build exits.
Answer: If you're using the OC4J implementation of Ant, you could use the oracle:compileJsp Ant task, which I believe would work how you want.
Details for doing this are here:
http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b28961/ojspc.htm#sthref219

ojspc always returns 0 on errors


Angle between two points on a sphere

Question: Suppose I am standing at point $A$ on Earth (a 3D sphere of a known radius) and suppose $B$ is another point a few miles away. The longitude and latitude of points $A$ and $B$ are $(\lambda_1,\varphi_1)$ and $(\lambda_2,\varphi_2)$ respectively. What is the angle from $A$ to $B$? In other words, If I was holding a compass whose needle points north while standing at point $A$, at what angle will point $B$ be?
Comment: What have you attempted towards solving the problem?
Comment: To do this correctly, you need to use the trigonometry of spherical triangles. If the cities are very close to each other, however, you can ignore the curvature of the Earth and do plane geometry. But never forget that a degree of latitude and a degree of longitude are equal only at the equator: towards the poles, a degree of longitude is smaller.
Comment: @Lubin You can use the Mercator projection to solve this also.
Comment: @ParclyTaxel, that's not right at all: consider two cities at the same latitude, but moderately far from each other. You see that the great-circle path heads towards the pole, in other words, the angle between due North and the "line" towards the other city will always be acute. But Mercator tells you to head due East (or West).
Answer: There are two laws of cosines for spherical triangles:
$$\begin{align}\cos a&=\cos b\cos c+\sin b\sin c\cos A\\
\cos A&=-\cos B\cos C+\sin B\sin C\cos a\end{align}$$
Where $A$, $B$, and $C$ are the angles of the spherical triangle and $a$, $b$, and $c$ are the opposite side. Here you know one angle and two sides of the spherical triangle with vertices at the cities and the north pole:
$$\begin{align}b=\frac{\pi}2-\phi_1,&&c=\frac{\pi}2-\phi_2,&&\text{and}\quad A=\lambda_2-\lambda_1\end{align}$$
So you can apply the first of the two laws to get
$$\cos a=\sin\phi_1\sin\phi_2+\cos\phi_1\cos\phi_2\cos(\lambda_2-\lambda_1)$$
Then the distance between the two cities is $Ra$, where $R$ is the radius of the earth and $a$ is the angle we just computed in radians. Oh, but you wanted the bearing. There is also a law of sines:
$$\frac{\sin A}{\sin a}=\frac{\sin B}{\sin b}=\frac{\sin C}{\sin c}$$
So we can now get
$$\sin C=\frac{\sin A\sin c}{\sin a}$$
And $C$ is the bearing from city $1$ to city $2$ measured east of north.
Comment: Yes, perfect response. The moral of the story, of course, is that navigation is nowhere near being easy!

Angle between two points on a sphere


Why is "Meryl Streep" always holding oranges in "The Strike"?

Question: The Comic Strip Presents...The Strike is about a screenwriter who attempts to pitch a film about a failed miner's strike, only to discover that American film executives are rewriting it into a bizarre, cliché-filled "Hollywood" movie. The lead actress is played by "Meryl Streep", and her character has a few scenes where she holds oranges (which "Al Pacino"'s character knocks out of her hands).

At first, I thought that this was just some strange quirk of her character. But later while watching dailies of the footage they filmed, "Meryl Streep" is shown peeling an orange.

Why is this? Was the real Meryl Streep known for a love of oranges? Is this just a random character trait invented for the short film?
Answer: Apparently, it was based on something Jennifer Saunders read...

Saunders: 'So many weird layers. The peeling of the orange when I was playing Meryl Streep playing Mrs Scargill was based on something I read about Streep, that she had this knack for pulling focus, even when she didn't have a line in the scene.
Source
Answer: If an actor is eating an orange, it is a way of upstaging and taking the focus off the main actor in the scene. Oranges are very evocative fruit - if you see one being peeled, you know how it will taste and smell, sometimes your mouth will start watering in anticipation. It's hard to ignore an orange.
In the Comic Strip Presents...The Strike, Jennifer Saunders was playing "Meryl Streep" as an actress who has to have all the attention, even if she wasn't the main character. Peeling an orange is a way to focus attention on herself, while not overtly upstaging the main character in that scene. This is played as a quirk of the actress, not the character, as shown by the dailies-watching scene where she is still peeling oranges. (Also it is unlikely that a poor miner would have a bowl of oranges on the table!)
This is a caricature of Meryl Streep, so minor traits are exaggerated.
Answer: When thinking about movies and oranges, Francis Ford Coppola comes to mind (Were oranges an intentional use of symbolism by filmmakers?).
It is argued that the use of oranges in scenes forshadows imminent death or desasters.
Some directors (such as Guy Richie) like to give a nod to FFC by placing oranges in some of their movies.
Maybe this is one of those cases. But given the time, it might just be a coincidence.


Assign mirrored existing weights from bone_L to bone_R vertex group

Question: I have already painted bone_L weights over my mesh. How can I assign the mirrored weights of bone_L vertex group to the bone_R vertex group?
Sub-question: is there a way to do so for multiple selected bones at once?
Comment: I don't know if you can do it with one click but here is the method so far: https://blender.stackexchange.com/questions/44882/how-to-mirror-copy-existing-vertex-weights/44884#44884
Answer: Method 1: Ensuring that you will always get mirrored weights from the very start of your project.
While in Weight Paint Mode, look in the Properties Shelf to the right of your viewport (press n to bring it up) and select the Tools tab. There is a Symmetry section, as well as an Options section. Do not activate anything under the Symmetry section, as it will not do what you want. If any Axis buttons are activated under the Symmetry section, press them to deactivate them. What this does is add whatever weight value you are painting to the other side of the mesh, but only for the current vertex group, not its mirrored partner.  Instead, you want to make sure that X Mirror is checked under the Options section. This will ensure that whatever weighting you add on one side is mirrored to the corresponding vertex group on the other side. Provided that this other vertex group exists, of course.

Method 2: Mirroring existing weights after they've already been created.
Go into the Object Data tab of the Properties Panel with your mesh selected in Object Mode. Press the Plus Sign to the right of the Vertex Group section to create a new vertex group. Even though you only want to mirror a vertex group, you must create a new one first, and assign weights to it from selected vertices. It seems like you should be able to mirror vertex groups without beginning with a creation step, but mirroring without creating a new vertex group first will actually remove the old weights from the old group and replace them with mirrored versions of those same weights,now on the opposite side of the mesh, which is not what you want. Note that creating a new vertex group first doesn't alter this behavior, but it does ensure that the weight reassignment takes place only for the newly created vertex group, while leaving the old one alone. The end result is that you will now have two vertex groups with mirrored weights. It's just that you needed to manually create the new vertex group before mirroring, to avoid losing the original weights in the old group. So understand that the Mirror Vertex Group option creates no new vertex groups, but merely reassigns existing ones.
Give the new vertex group a name, and end it with either a .L or .R suffix, based on which side you will want it on. Switch back to Edit Mode and select the vertices that will be assigned to this group and hit the Assign button. Make sure the blue Weight bar under the Vertex Groups section is set to a value greater than zero, or the assignment will have no effect (it's usually at 1 by default, meaning full influence).
Now go back to Weight Paint mode so that you can see the effect of what happens next. In the Object Data tab once again, make sure your new vertex group is still selected under the Vertex Group section, go to the Vertex Group Specials pulldown (1) and choose Copy Vertex Group (2). The new one will be given the same name as the old, except it will either have a "_copy" or ".001" suffix, which is not what you want. Rename it to have a '.R' or '.L' suffix, whichever is the opposite of the one you first created.
Now that you have two groups, instead of one, you can mirror the new one. As explained earlier, mirroring will remove existing weights from the selected vertex group, but that is okay, because you still have the original vertex group's weights in tact. From the same Vertex Group Specials pulldown, with your new vertex group selected, choose Mirror Vertex Weights (3). You should see in your viewport that weights have appeared on the opposite side of the mesh.


Twitter 'Offline' Access for Developers?

Question: I've been working closely with social integrations and the oauth framework for authorization.  I know that, like Facebook, Twitter implements an oauth hook for its applications.  My question is, is there a way to keep an access token active forever? Much like Facebook has its offline access permission, I would like to be able to only request that the user validate my app once (this is simply for an ease-of-use purpose).
Answer: When you implement OAuth for Twitter, you receive two tokens called OAuthToken and OAuthTokenSecret.  You store these values in a settings file or a cookie or a database (or whatever) and then you use those tokens when submitting API requests in the future.  This removes the need for the user to authorize the application every time.
Now, if the user revokes your application's permissions, then the tokens will no longer work.
Comment: Awesome! That helps a lot, I wasn't sure if they expired after a certain time period.  Doesn't sound like it.  Thanks for the help!
Comment: when you say `then you use those tokens when submitting API requests in the future`. how do you do that?
Comment: You store them in a cookie or a settings file or a resource file and retrieve them when you need them.


Should global costmap have an obstacle layer?

Question: I recently started using the NAV2 stack and I am still trying to understand basic concepts. As I understand it, obstacle avoidance and therefore local path re-planning should be done by the controller which theoretically works at higher frequencies that the planner. I was therefore wondering why one would add the obstacle layer in the global costmap. I understand that based on the configuration of the controller sometimes local re-planning is not possible (e.g., if a Regulated Pure Pursuit controller is used). Still, however, I cannot comprehend the intuition behind using an obstacle layer in the global costmap (i.e., why would someone completely avoid doing local re-planning and go directly to global re-planning). Similar questions to mine did not give any valuable insights in the intuition behind this choice:
StackExchangeLink
Answer: Your StackExchange link is talking about a very specific case: slam. The optimizations and metrics for building a map (slam) and for efficiently navigating an existing map are not necessarily the same.
Here is an example. Imagine there are two long hallways that both lead to the goal, which is far away and not visible to the robot's sensors. The global planner has to choose one hallway, so it is useful to have the information that one hallway is obstructed. Of course, the system also needs some mechanism that eventually clears obstacles from the global costmap.
Comment: Thank you for the answer Mike. In your example the (global) planner selects one of the two hallways, and the controller performs (local) obstacle avoidance. However, by defining an obstacle layer in the global costmap, the global path will already take into account **both** the local and far away obstacles and therefore we have no need for an obstacle layer in the local costmap (i.e., obstacle avoidance for local objects is also done by the global planner). Isn't in that scenario redundant to add an obstacle layer in the local costmap as well?
Comment: No, not redundant because the local costmap is assumed to include dynamic obstacles e.g. people or carts moving around.
Comment: Your explanation makes sense Mike! However, the way the obstacle layers are defined in the NAV2 stack, there is no differentiation between a static and a dynamic obstacle and therefore the dynamic obstacles can be avoided by the (global) planner i.e., my Planner will adapt the global path regardless of the type of my obstacle (dynamic - static). Even if I want the global planner to only account for static obstacles, this is not possible!
Comment: Historically the global planning is done only once, at the start of planning. The global path is meant to provide advice/guidance for the local planner on the assumption that it has higher-level information than what is available to the local planner. On the other hand, the local planner is assumed to have very recent nearby obstacle data (i.e. 10's of milliseconds old.) Do you have to do it this way? No. But it is my understanding that this is the canonical "reference design" for a path planning architecture.
Comment: Alright thank you Mike!


How could Bester be cheated by Talia Winters when she helped the rogue telepaths to escape, given that a sleeper or "spy" was hiding inside her?

Question: In the episode "A Race Through Dark Places", Talia Winters joined hands with the rogue telepaths to cheat Bester and gave him the illusion that he had the rogue telepaths taken care of. How could Bester be cheated, given that there is a sleeper or spy implanted by the Psi Corp into Talia Winters (See episode "Divided Loyalties"? Even if this sleeper allowed Winters to commit her treacherous act against the Psi Corp, this "spy" within would surely have reported her treachery to Psi Corp. How could Bester not know?
Comment: The job of the "Sleeper" is to remain latent until activated.  Not to activate themselves.  A sleeper is not a spy, a sleeper is a resource being husbanded for future deployment at the discretion - and explicit action - of the handler.
Comment: A sleeper who reports back is per definition no longer a sleeper but an active spy. The trick of a sleeper agent is that they don't do anything that could raise suspicion. Reporting back would increase the risk to be detected. The sleeper implanted in Talia was - iirc - programmed to activate on a certain code phrase and not under other circumstances. Of course, that's always a strategic decision: It's more safe that way, but it also prevents the sleeper from taking initiative in a critical situation. But perhaps it was just simpler this way (one phrase against a whole set of possibilities).
Comment: I'm thinking that the "Sleeper" personality was literally that - it had to be "activated" or woken up if you will. I'm speaking from memory though and have no evidence to back that up. Out of universe, it was a plot device to allow for Andrea Thompson's unexpected departure from the show.
Comment: Dupe of https://scifi.stackexchange.com/questions/148614/how-could-talia-winters-help-the-rogue-telepaths-against-bester ?
Comment: The job of the "Sleeper" is to be a spy. It is not logical to have a spy who cannot report on secret activities seen until woken up. Yes, it can be dormant and hidden but the spy reporting should be regular. Otherwise, it doesn't make sense to plant a spy.
I guess it was a plot device to allow for the actress unexpected departure to explain this inconsistency.
Comment: @Kitkat, No dupe. That question asks how can Winters help the rogue telepaths despite the spy within. My questions asks how can Bester not know he was cheated by Winters despite the spy within.
Comment: Long story short - Bester wasn't betrayed by Control, he was betrayed by Talia.
Comment: Other potential dupe here, I kinda thought this topic has been beaten out before - https://scifi.stackexchange.com/questions/154955/did-bester-know-talia-winters-had-a-lurker-before-the-episode-divided-loyalties
Answer: Bester is high up in the Psi Corps, but he's not at the top. We get a little better view of his position within the Corps in the episode "The Corps is Mother, The Corps is Father". While we are never shown all the roles he plays in the Corps, most of what we see of him shows that he's a highly competent field agent.
The Corps may be small compared to the population of humanity at large, but it's large enough to for there to be different projects run by different groups that don't all talk to each other about everything. Some reasons for the separation might well include practicality (no one can know everything going on in an organization), and deniability (what one doesn't know, another can't find out).
From the JMS speaks portion of the Lurker's Guide page for "Divided Loyalties":

[Question:] Did Bester try to befriend Talia because she was Control? (cf. "A Race Through Dark Places")
[JMS:] You're assuming Bester knows everything. Also, Bester's interest may have been more...carnal than PsiCorp oriented.

We also see in the episode "Epiphanies" that he's not let in on the entire plan that he's being involved in. As shown in the episode "Ship of Tears", he never knew what the Corps did with the 'Blips' like Carolyn they had.
This doesn't show that Bester definitely wouldn't know if Talia's sleeper personality reported back to the Psi Corps, but it should show that he's not in a position to know everything that goes on. If Talia's sleeper personality reported back, he simply may not have been told. Also, even if he knew, there's no reason for him to act on the information (and therefore show us that he knew), because it would compromise a valuable information-gathering asset.
This also depends on the sleeper personality reporting back. It's certainly possible that it did, as in "Divided Loyalties" Lyta identifies the personality as Control, who did play a part in "A Spider in the Web". It's also possible that Talia's sleeper personality simply remained quiet and bided its time, while Talia became more involved in resistance activities. We're never given any indication either way.
Comment: Besides, most secret organizations, even governmental funded secret services try to keep vital information on a need to know basis (hence "Top Secret" classification) so that it wouldn't corrupt the entire organization if one project fails or one agent gets captured. Thus it is perfectly reasonable that even as a very high ranking PSI cop, Bester wouldn't have knowledge of projects outside his direct line of work.
Answer: We shouldn't assume that the split personality aspect was in play then at all. It was a justification to get her off the show when the actor wanted out.
Comment: While this is true, I am guessing the author is looking for a "Watsonian" rather than "Doylist" reason...
Comment: You get extra points for the Watsonian/Doylist distinction. I think it was unclear enough that a Doylist response was warranted in this situation.


Installing crontab file on Solaris?

Question: Typically we use crontab -u   in our recipes. However we have a few Solaris 10 boxen where the flavor of crontab won't support the -u flag. Is there a way to deploy an existing crontab file using Solaris' crontab command? How?
Answer: This should be equivalent to crontab -u user filename :
su user -c "'crontab filename'"

Answer: I have used this trick before to solve the Solaris problem:
EDITOR="cat $file >" VISUAL="cat $file >" crontab -e "$user"

Installing crontab file on Solaris?


Testing association in meta analysis

Question: I am doing a meta-analysis where I have the baseline and 2 months post-intervention measurement of a continuous variable (say a) for two groups (control and intervention). I also have measurements for another continuous variable (say b) at post-intervention. The idea is if (a) increases after the intervention, (b) should also be higher in the intervention group. Note that all measurements are in average (since this is a meta-analysis and each average belongs to one study). Is there any idea how could I test the association that an increment in (a) after the intervention will also increase (b)? Thank you so much in advance.
Answer: If you have the necessary information to do a meta-analysis on your b variable then you could presumably do a meta-regression to see if the increase in a is a moderator variable. You will need estimates of variability in order to be able to do any of these analyses and that may be an issue depending on what the primary studies have published.
If what you are proposing can be expressed as $y = b_i - b_c$ where $i$ is intervention and $c$ control then you have some choices. You could as you suggest in the comments fit
$$
y = \beta ((a_{i1} - a_{i0}) - ((a_{c1} - a_{c0}))
$$
where the subscripts 0 and 1 refer to the two time points and I am ignoring error terms for simplicity.
Or
$$
y = \beta (a_{i1} - a_{c1}) + \gamma (a_{i0} - a_{c0})
$$
which would be more flexible as the first one subtracts the baseline values whereas the second allows for them to have their own coefficient.
Comment: Thank you so much for your response. So this is what I was thinking to set up the meta-regression: b (response)= constant + beta_1*(difference in "a" between baseline and 2 months) + beta_2*group (group is a dummy variable, 0= control, 1=intervention) + beta_3* (difference in "a" * group) + error. As long as the interaction term is significant, I could tell the intervention has significant contribution (in whatever direction given the sign of the coefficient). Please let me know if I got it right. Thank you so much once again!
Comment: Can you edit that into your question so it is easier for subsequent readers?
Comment: I think what you suggest should work but you are proposing, I think, to to do this per arm rather than per study in which case you need to take into account that the pairs of arms belong each to one study.
Comment: I think this might work, define y= b_int - b_cont, x= ((a_post.int) - (a_baseline))_int - ((a_post.int) - (a_baseline))_cont. So y is basically difference and x is difference in differences. Then run a meta regression like y=a+beta*x +e. What is your thought about it?
Comment: Thank you so much for your suggestion. Surely, with mathematical notation, it looks way simpler to understand. I really appreciate your input, now I have a direction to work with.

Testing association in meta analysis


How large is the seed in an encryption algorithm such as stream cipher?

Question: The stream cipher is an encryption algorithm that was designed to approximate an idealized cipher, known as the One-Time Pad. It's crucial for a stream cipher to remain secure is to have a pseudorandom generator that hard to predictable and a seed that was never used. For this to be achieved, I assume we need to have a really large seed that the most powerful computer can't predict, but I can't approximate how large the number is.
Comment: https://en.wikipedia.org/wiki/Key_size
Answer: The seed of a pseudorandom generator that is used as a stream cipher is called a key.
The most common key sizes are 128 bits and 256 bits. (That's symmetric keys, where there's no cheaper way to break than brute force. Asymmetric cryptography typically relies on keys having certain mathematical properties that make the algorithm work, but also enable better attacks than brute force.)
To understand how hard it is to break a 128-bit key, meaning that you have to try $p \cdot 2^{128}$ possibilities for a chance of success $p$, consider these orders of magnitude:

A fast processor might be able to try about one billion keys per second (1GHz).
A powerful attacker might be able to afford one billion processors.
The universe is about 1 billion billion seconds old (a little over 30 billion years).
1 billion is slightly less than $2^{30}$ ($2^{30} = (2^{10})^3 = 1024^3 \gtrsim (10^3)^3 = 10^9$).

So if you're extremely rich and willing to wait until the universe is twice as old, you can enumerate about $2^{120}$ keys. If you're only willing to wait 30 years, you can only enumerate about $2^{90}$ keys, giving you a chance of breaking any particular key of less than one in 250 billion. Conclusion: a 128-bit key is sufficient for security against brute force.
A 256-bit key provides a security margin that can cover:

Hypothetical advances in cryptanalysis that make the algorithm slightly easier to break.
Hypothetical advances in computation, such as quantum computers, which effectively halve the key size.
A very powerful adversary who tries to break basically every encrypted communication, and is interested in even succeeding for a tiny fraction.
A very powerful adversary who records basically every encrypted communication, and would detect if the same key is used twice, which could then let them discover the key by non-cryptographic means (exploiting a bug, demanding it at gunpoint, a subpoena, …). Due to the "birthday paradox", there's a macroscopic chance that two instances will generate the same random key if the number of instances is at least about the square root of the number of possible keys, so 8 billion people using a billion different keys each (about $2^{63}$ keys in total) would be around the threshold for 128-bit keys.

In practice, key size just isn't an issue except in legacy software and protocols that are at least 2 decades out of date (keys shorter than 128 bits became obsolete when AES became the de facto standard in the early 2000s). Cryptography gets broken by non-cryptographic means or due to implementation weaknesses such as side channels, or gets circumvented altogether due to non-cryptography-related security vulnerabilities (binary exploits, escaping exploits, misconfigured controls, phishing, …). Cryptographic algorithms are usually the strongest part of information security.
Answer: The seed is called the key and to be secure it really depends on the usage and known computing powers. The most powerful collective power (known) is currently the bitcoin miners that they have reached $\approx 2^{93}$ SHA256 calculations per year in this year.
Therefore, the effective key size must be larger than $2^{93}$ and the NIST  requires a minimum of 112 bits. The miners need $2^{19}$ years to achieve $2^{112}$. This may true for the single target. The attackers, however, may use batch attack (multi-target attack) so that even the key size is 128-bit they can find the first target key with $2^{70}$ work with billion targets (See in Has AES-128 been fully broken?).
Therefore we prefer the golden standard as the 256-bit key sizes. The ChaCha20 can use a 256-bit key size or one can use AES-256 in CTR mode to achieve a stream cipher.
In addition to the key, the modern stream ciphers also using IV/nonce to use the key more than one encryption and this is also a countermeasure to batch attack. One must be careful about the (key,nonce) re-use issue that can at least remove the confidentiality. To mitigate this one can use XChaCha20 that uses 192-bit nonces or can use a non-misuse resistant scheme that is going to be the next standard in the future.
Of course, we don't use the stream cipher alone, we prefer Authenticated Encryption modes like ChaCha20-Poly1305 to achieve confidentiality, integrity, and authentication.
Answer: It depends on the exact encryption method you are using.
128-bit is theoretically sufficient against normal computers and 256-bit against quantum computers, as per previous answers, but you should always follow the best practice standard of the exact type of encryption you are using.  This is because no encryption algorithms has perfect entropy, or in layman's terms, no encryption algorithm is perfectly random.
Because no key is perfectly random, it means that methods exist for predicting keys that do not require you to check every single possible key combination. So, while symmetric encryption like AES has very close to perfect randomness making 256-bit sufficient for all known use cases, many common asymmetric algorithms such as RSA suggest key lengths up to 4096-bit due to known methods existing against them that are more efficient than brute force.
That said, it is not really your key-length that is most important.  The most important part of a symmetric encryption is the padding.  This is a randomized string that is appended to the front of your plain-text string and then dropped.  RC4 with a max length (2048 bit) key is actually quite easy to break, but RC4-drop512 with only a 512-bit key is much harder to break despite the shorter key because it does more to obscure the deterministic part of of the stream cipher making cracking it require something much closer to a brute force attack.
Comment: The difference isn't between AES and RSA, but rather between symmetric and asymmetric encryption. For asymmetric encryption, it should be difficult to generate the private key given only the public key. There are no such issues with symmetric encryption.
Comment: Yes, AES was perhaps not the best example without further elaboration.  I've added the clarification about it being asymmetric encryption, as well as a better explanation of what sets different symmetric encryption methods apart from one another.


Initial value problem for Poisson-Darboux equation

Question: This is a question from 'Introduction to Partial Differential Equations' by Peter J. Olver.
The Poisson-Dabroux equation is $$u_{tt}-u_{xx}-\frac{2}{x}u_{x}=0$$
Solve the initial value problem $u(0,x)=0 , u_{t}(0,x)=g(x)$ where $g(x)=g(-x)$. Hint: Set $w=xu$
I used the hint to get the following
$$ w_{xx}= xu_{xx}+2u_{x}$$
$$w_{tt}=xu_{tt}$$
$$w_{t}=xu_{t}$$
Using the given equation to get $$xu_{tt}-xu_{xx}-2u_{x}=0$$
Using the w values obtained before and plugging them into the above equation gives:
$$w_{tt}=w_{xx}$$
Using D'Alembert's formula for a general solution:
$$w(t,x)=\int_{x-t}^{x+t} s g(s) ds$$
Now this is where I'm stuck. I tried using integration by parts but I ended up with a more complicated integral. Also, I reckon the fact that $g$ is even is used somewhere in the calculation of this integral but I can't figure out where either. The solution to this question is not in the solution manual either. Any help appreciated. Thank you!
Answer: You're already done. There's nothing wrong with having the solution as an integral. There's no indication that you need to solve it
$$ u(x,t) = \frac{1}{x} \int_{x-t}^{x+t}sg(s) ds $$
Comment: Thank you! I assumed I had to solve it as I hadn't used the fact that g is even anywhere. Is there any way of solving it without knowing g?


How do you easily copy a block from the terrain into your inventory in creative mode?

Question: I was watching some Grian videos and I saw in one of his videos he sort of copies a block and it puts the block into his hand instantly. How exactly does he do this? (by the way he is in creative and he also is not in his inventory).
Comment: Can you link the video here so we can see what you are talking about?
Answer: As long as you're in creative mode you can middle-click to copy the block you're currently looking at. You have to be close enough to the block that you could interact with it, and it creates a copy of the block type rather than a true copy (copying a chest doesn't copy the contents of the chest).
You can also do CTRL + Middle click to copy contents of container objects. This includes chests, dispensers, hoppers, command blocks and others.
You can also do it in survival mode, but rather than creating a copy of the block it will just take it from your inventory instead (as long as you're actually carrying that type of block).
Comment: Don't use the Middle click, use the PICK BLOCK button with CTRL
Comment: @RookieTEC9 I don't think that that's the default key combination.
Comment: No I mean use the PICK BLOCK button to be more specific since middle click is only the default so it may be a bit confusing


BufferedReader not receiving message over socket

Question: The situation is that there are 4 'Helper' threads, each with a connection to all helpers (including itself). I am indeed autoflushing. Below, this.id is an int used to identify the helper running the code. In debugging, I've watched helper 0 send a message to itself (by sending over all connections), but when it should receive the message (over connection 0), it acts like its BufferedReader has an empty buffer.
SOLVED: Woops I had a design flaw. I made sure each helper kept only one socket per helper that it needs to communicate with, but this is incorrect when a helper connects to itself. In this case, keeping only one socket means the other endpoint of communication (with itself) is lost.
My program spins forever in here (must be empty buffer):
<code>        boolean clientStreamReady = false;
        boolean helperStreamReady = false;
        while (!(clientStreamReady || helperStreamReady)) {
            clientStreamReady = this.inFromClient.ready();
            helperStreamReady = this.helperIns.get(this.id).ready();

            if (clientStreamReady) {
                message = this.inFromClient.readLine();
            }
            else if (helperStreamReady){
                message = this.helperIns.get(this.id).readLine();
            }
        }
</code>
The message is "broadcast" here:
<code>    for (PrintWriter out : this.helperOuts) {
        out.println(this.id + "," + kind + "," + this.clock.getTime());
    }
</code>
The IO from the sockets, set up prior to the above, is done here:
<code>    for (Socket socket : this.helperSockets) {
            PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
            BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));

            this.helperOuts.add(out);
            this.helperIns.add(in);
    }
</code>
If the socket setup code is needed tell me and I'll add it.
Answer: Do your PrintWriters have automatic flushing enabled? If not, a simple out.flush() at the end of your broadcast loop might already do the trick.
Comment: Yes I do. Good suggestion though, not setting auto flush got me a couple times before.


The Use of superlatives at the end of the phrase

Question: I have heard this phrase below from a native speaker

"Italians appreciate Team sports the most."

Is it correct? Why "the most" was put at the end of the sentence?
Answer: Superlatives in English are generally understood to be adjectives modifying something. You can see their use as adjectives when the noun they modify is shown in the sentence.
1. John is the shortest man.
2. Picasso seems to be the best artist.

Because they act as adjectives on the direct object, they have to come after the verb.
But in sentences where there's already a direct object for the verb, superlatives encounter a problem:
 1. (BAD) I love him the most love in the world.
 2. (BAD) He punches his opponents the fastest punch out of all boxers.
 3. (BAD) Italians appreciate team sports the most appreciation.

English doesn't like having two direct objects for a verb being said in the same sentence. So instead, it removes the noun so that the sentence sounds correct.
1. I love him the most in the world.
2. He punches his opponents the fastest out of all boxers.
3. Italians appreciate team sports the most.

This view where the noun is dropped is supported in this very complicated paper on the use of superlatives in several languages.
Note that putting the superlative after the verb sometimes sounds awkward when the overt direct object can take the superlative instead.
1.  (OK) He plays chess the fastest.
         He plays the fastest chess.
         He plays the fastest chess in the world.
  (BAD?) He plays chess the fastest in the world.
2. (OK) Maria sings opera the loudest.
        Maria sings the loudest opera.
        Maria sings the loudest opera in the world.
 (BAD?) Maria sings opera the loudest in the world

Comment: And how is it explained with intransitive verbs?  *When you have a headache, aspirin helps (the) most.*
Comment: When the verb is intransitive, by definition it doesn't take direct objects. Thus the noun must be squashed as to retain grammaticality. However, while in this case "help" is intransitive, it's more often transitive: "I helped him."
Comment: I'm not sure what **squashed** means in this context.


some sites are not opening in our network

Question: We have five PC in our network, with internet connection(i.e same ISP). But some sites are not opening in our network. Like some sites which works outside our network, don't open. I have reset the router, switch but not working. Is it a problem of Router or with the ISP.
Comment: Can you access the problematic sites by IP address?
Comment: yes! i can, but cant by domain name.
Comment: Some DNS servers block certain IP addresses. Some let you control this, like OpenDNS, others -- like your ISP's -- probably give you no control.
Comment: @martineau what the solution for that...i have run ipconfig /flushdns, then also not working..
Comment: Switch to OpenDNS. How to set it up depends on your OS, although it's sometimes possible to put it into your router's config. The [OpenDNS website](http://www.opendns.com) has good information and instructions (and it's free).
Answer: Now that we know you can get at them via IP it's (probably) a DNS resolution issue.
If the router is providing local DNS resolution try setting it to use another (free) DNS service like OpenDNS.com.
Perhaps contact your ISP to find out why those names are not resolving properly.
Hope that helps...
Comment: ok @techie007, i will try that and let you know.
Comment: Contact the site's ISP also.  I've helped two companies with the same problem and it ended up the site's ISP had blacklisted the companies' IPs.  Former malware incidents but both companies on some ISPs' blacklist.
Answer: If it's not a DNS issue, it could be MTU.
On one client, try setting its MTU to 1400 or even 1000 and see if the problem goes away. If it does, then try to find the highest MTU setting you can use without having the problem of sites not opening.
If your router does NAT, see if your NAT has an MSS-clamping feature. If it's not enabled, enable it.  If your router has a firewall, make sure it is set to allow ICMP messages (especially ICMP "destination unreachable -- fragmentation required but 'don't fragment' bit set" messages) to pass through.


Problem about Chrome Extension

Question: I try to write an extension and i saw the very restricted policy security.
I should create an extension that allows me to listen and download podcast from web. It is possible?
I use Chrome OS with VMWare, this OS has additional Api than Google Chrome Browser?
Thanks
Answer: Yes it is possible to have a content scripts that executes on every page looking for specific media content.  The content page could send a request back to the extension to indicate it has found a media file and using the URL you could play it in an  tag inside the extension.

Problem about Chrome Extension


What are the benefits of quick weight loss?

Question: Although slow and steady weight loss is better than quick weight loss, are there any benefits of losing weight fast? This could include penetrating yourself in the gym or possibly going into a fad diet that "supposedly" helps you to lose weight faster.
Comment: Your premise is incorrect based upon a study of weight loss rates
Answer:
Better sleep: Research shows that losing 5 percent of your body weight can help you sleep better and longer throughout the night.
Better hormonal balance: When you rid your body of excess fat, your hormones steady and as a result it's easier for you to maintain or even further your weight loss.
Improved sex drive: According to experts, weight loss has been linked to boosted testosterone levels and an increased libido, and dropping just 10 pounds is enough to stimulate sex hormones
Increased sexual performance: Between the energy boost you get from loosing weight and the uptick in stamina from hours spent at the gym, if you really wanted to go all night, you could. Increased physical fitness has been associated with greater satisfaction in the bedroom, according to Smith.
Better mood: Working out releases feel good chemicals called endorphins. Endorphins are responsible for that high you feel post workout. They interact with the receptors in your brain, reducing your perception of pain and deliver a positive feeling in the body similar to that of morphine.

http://www.mensfitness.com/weight-loss/burn-fat-fast/25-surprising-benefits-weight-loss
Comment: These are all benefits of weight loss but there's nothing there about rapid weight loss, which is the question.


Interprocess communication between metro app and desktop app

Question: We have a metro app that is already developed and ready to be deployed. But we are still not satisfied with the tests we have made so far. We are aiming to write some inline test code within the app code with an aim to expose certain key events in the app, (By generating some events which a test code can wait on) and waiting for events generated by the test code.This way we can generate more scenarios.
For example if there are four components running as background threads A,B,C and D And we want that A executes then signals to test code an event and wait(on background thread only while UI thread keeps running). The test code then simulates some user actions and signals the app on which the app proceeds to do action B and C and then again waits when test code again runs some test cases on the UI while the background thread is still suspended.
So this way we achieved a scenario
    BackgroundThread A-> User event x-> Background Thread B -> Background Thread C -> user event y -> Background thread D
We hope to find more sync issues that may occur because of the background threads.
The driving force behind this approach is that we have no control on when a thread will go out of context.So we want to simulate such scenarios to check for areas of contention. I have tried all basic IPC mechanisms but apparently they don't work between metro apps and desktop apps due to metro app sandboxing.
Answer: I'm looking for a good solution too. Until now I found two, but both are not the kind I'm looking for. Maybe one's okay for you:

On your test machine you can disable the network isolation and use network communication with the machine your app is running on.
Or you use a StorageFile in KnownFolders.DocumentsLibrary and write / look for files in "My documents".


Optimality condition for strongly convex function under sparsity constraint

Question: Let $f: \mathbb{R}^p \to \mathbb{R}$ be a $2s$-sparse strongly smooth, $2s$-sparse strongly convex and twice differentiable function. In other words, there exists positive constants $\alpha, L >0$ such that
$$
\alpha \le v^\top \nabla^2 f(\theta) v  \le L,
$$
for all unit vectors $v \in \mathbb{R}^p$ with $\Vert v \Vert_0 \le 2s$. Consider the set of sparse vectors $D_s := \{v : \Vert v \Vert_0 \le s\}$ and define
$$
\theta_0 := \arg\min_{\theta \in D_s} f(\theta).
$$
Then I want to show that $\nabla f(\theta_0)^\top (\theta - \theta_0) \ge 0$ for any choice of $\theta \in D_s$. (I am not sure whether this statement is true or not.)
First approach:
Let $P_s$ be the hard thresholding operator on the vector, i.e., $P_s(x):= \arg\min_{y \in D_s} \Vert y - x \Vert_2$. Thus, $P_s(x)$ only retains the top-$s$ elements of the vector $x$ in absolute value and sets everything else to 0. For example, $P_2((-2, 3, 1)^\top ) = (-2, 3, 0)^\top$.
Let $S = \text{support}(\theta_0)$. Now We look at the limiting quotient
$$
\lim_{t \to 0^+}\frac{f(P_s(\theta_0 + t(\theta - \theta_0))) - f(\theta_0)}{t}.
$$
Note that for small enough choice of $t$, we will have $\text{support}(\theta_0 + t(\theta - \theta_0)) = \text{support}(\theta_0) = S$. Then, it follows that $\nabla f(\theta_{0,S})^\top (\theta_S - \theta_{0,S})\ge 0$. Here, the vector $\theta_S$ is defined as follows : $(\theta_S)_j = \theta_j \mathbb{1}(j \in S)$ for all $j \in [p]$. Therefore, we have $\nabla f(\theta_{0})^\top (\theta_S - \theta_{0})\ge 0$. But this is not enough as $\theta_S$ may not be $\theta$ due to a potential mismatch in support.
Second approach
I. am trying to prove this by contradiction. Assume that $\nabla f(\theta_{0})^\top (\theta - \theta_{0})< -c$, where $c>0$.  Let $v = -(\theta - \theta_0)/\Vert \theta - \theta_0\Vert_2$. Let $\theta_1 = P_s(\theta_0 - (\eta/L) v)$. Then by simple Taylor's expansion, we have
$$
f(\theta_1)\le f(\theta_0) + \nabla f(\theta_0)^\top (\theta_1 - \theta_0) + \frac{L}{2} \Vert \theta_1 - \theta_0\Vert_2^2.
$$
My goal is to find an $\eta>0$ such that $ \nabla f(\theta_0)^\top (\theta_1 - \theta_0) + \frac{L}{2} \Vert \theta_1 - \theta_0\Vert_2^2<0$. This would directly contradict that $\theta_0$ is the minimizer.
I am trying to replicate a similar kind of analysis shown in the proof of Theorem 1 in this paper. However, tracking the support sets is becoming hard.
I would appreciate any kind of help or reference pointers. Thank you.
Update: The statement may not hold in general. Consider the function $f(\theta) = (\theta_1-1)^2 + (\theta_2-1)^2/2$, and consider the optimization problem
$$
\min_{\Vert \theta\Vert_0 \le 1} f(\theta).
$$
In this case, the minimizer is $\theta_0 = (1,0)$ and $\nabla f(\theta_0) = (0, -1)^\top$. Let $\theta = (0,1)^\top$. Then, $\nabla f(\theta_0)^\top (\theta - \theta_0) = -1<0$.
Answer: I don't think that this is true. Let us take $p = 2$, $s = 1$ and $f(x) = \frac12 \|x - (1,1)\|^2$. Then, $\theta_0 = (1,0)$ is a minimizer, but with $\theta = (0,1)$ we get
$$
\nabla f(\theta_0)^\top (\theta - \theta_0) = (0,-1)\cdot(-1,1) = -1 < 0.
$$


Completely remove Google Backup and Sync from my Mac

Question: I'm running macOS High Sierra and sometime ago I uninstalled Google Drive from my machine. OR so I thought. Today I see the Backup and Sync app in my Applications folder and when I try and delete it I see the following error.

I went to my Library folder and deleted the Google folder from there. I also deleted anything that sounded like Google from Library/Application Support.
However, I still get the same message when I try and move the application to Trash.
How do I get rid of this completely?
Comment: +1 for Tetsujin, did you check under Applications in Finder and make sure Back up and Sync does not exist there?
Answer: Moving of the Backup and Sync from Google app to the Trash and emptying it only removes the application bundle. It doesn't uninstall the Finder Sync Extension, application script,
 APFS container, preferences, etc.
You'd also want to remove the following & reboot:
~/Library/Application\ Scripts/com.google.GoogleDrive.FinderSyncAPIExtension
~/Library/Caches/com.google.GoogleDrive
~/Library/Containers/com.google.GoogleDrive.FinderSyncAPIExtension
~/Library/Cookies/com.google.GoogleDrive.binarycookies
~/Library/Group\ Containers/google_drive
~/Library/Preferences/com.google.GoogleDrive.plist

Comment: I could locate and delete some of the above, but others did not work because the exact name had changed.  In those cases I listed the root directory followed by a grep for google e.g. ```ls ~/Library/Preferences/com.google.GoogleDrive.plist | grep google```. I then just deleted those directories or files.
Answer: From Google Support - Stop syncing Google Drive files with Backup and Sync
It doesn't specify exactly, but I'd guess you need to disable/dosconnect it first before you can uninstall it...

Disconnect your account
To stop syncing completely, you can sign out of your account.

On your computer, click Backup and Sync .
Click More ⋮ > Preferences.
Click Settings.
Click Disconnect account.
Click Disconnect.

Pause or resume Backup and Sync
To temporarily stop syncing, you can pause the app.

On your computer, click Backup and Sync .
Click More ⋮.
Click Pause or Resume.

Uninstall Backup and Sync
Mac
After you uninstall Backup and Sync, you can still find your files at
drive.google.com.

Open Finder and click Applications.
Drag the "Backup and Sync" app into the Trash on your dock.
In the top left of your screen, click Finder > Empty Trash.
Comment: While you do have to disconnect before moving it to trash, simply deleting it does not fully uninstall the application. The answer below is an extension to yours.
Answer: You can't put the Backup and Sync from Google app in the trash because it registers itself to startup at login. Consequently, the app is running - even though you can't Command+Tab switch to it. Neither can you Force Quit.
Open System Preferences, Users and Groups, and select the Login Items tab. Remove Backup and Sync from this list. Restart your system, then throw the app in the trash.
Answer: Open a Terminal. Enter
killall "Backup and Sync"

Once Backup and Sync is closed, delete it from your Application folder by dragging it into the Trash.
Optionally remove the GoogleDrive stuff listed in Craig Stodolenak's answer, then reboot.
Answer: macbook air 2015, high sierra
It was slowing down system, but wouldn't even 'open' when clicked to follow any suggested fixes for disabling.

it was taking over 30% of cpu -
eventually, I went to:

activity monitor/select item/force quit
This did the job of disabling and I had my system back to usual speed
Comment: That just stops it now. It will be back after you reboot
Comment: I had added an edit to complete my findings but it's not showing up.Having done the above, I then went to delete the app but system wouldn't let me.Message was: The item can't be moved to the Trash because some of its plugins are in use.From JWMS1985 in discussions.apple.com I found below relating to dropbox but it worked for this too.Level 1 Answer:A: Fixed it by doing the following:control-click on app in finderselect 'show package contents'open folderdelete plugins folderopen finder windownavigate to folder containing app and send to trash
It has worked for me


Advanced navigation mesh?

Question: Hey if an enemy AI is following you on a nav mesh, he will stop if you get off of it. How could I make the nav mesh be everywhere, and where the AI could keep running even if I get off.
Comment: Could you add a little more explanation to this question? It's really hard to tell what you're asking.
Comment: also a picture or .blend would be great
Comment: A picture? I just need info, there is no need of a picture of my map or anything, it is just a simple map with a nav mesh.
Comment: But where isn't the navmesh wanting to go?  Is it something fixable by adjusting the options when you create the navmesh, or is it someone else?
Answer: I assume you're needing to handle when the player goes off-mesh for something like... elevated platforms or other unreachable areas.
The key is notifying the AI when the player is no longer on the navigation mesh.  Here's one way to go about it:

Duplicate the nav mesh
Set the physics type to static, ghost, invisible, and give it a unique property
Put a downward ray sensor on the player that sends an onmesh/offmesh message to the AI
Have the AI switch states from path following to [insert desired behavior] depending on the message.

Here's an example where the AI runs straight at the player when you leave the navigation mesh.
The main problem with this method is that your AI could get stuck if the player goes offmesh without having line of sight.
For better results, I imagine you will need a very case-specific Python script that manipulates navmesh.findPath
http://www.blender.org/api/blender_python_api_2_72_1/bge.types.KX_NavMeshObject.html
Comment: A great attempt, not exactly what I am looking for though. I just want the AI to keep chasing as if there was a nav mesh on every surface.
Comment: I suspect this will be one of those case-specific scenarios.  If you want, post a screenshot showing the map, nav mesh, and location of the player.  I can try to come up with something more specific.  Or would this be solvable by actually covering every surface with the navmesh?
Comment: Probably making everything have a nav mesh, because it would be weird for an enemy to use tracking when he is 1 floor below you.

Advanced navigation mesh?


New radio plays quiet

Question: I have a Pontiac G6, and the factory CD player stopped working. My sister bought a JVC system with a kit and adapter. When she installed it, the audio was quiet. Everything seemed to be wired correctly. What could be wrong?
Comment: I take it, the new system powers up, but no sound comes out? Is there a factory amp which is not getting powered on when the stereo is powered?
Comment: How can I determine if the amp is/isn't getting power?
Comment: I guess you'd have to find the amp (if it exists) first. Then check the wires to ensure it's getting power. There is probably a separate wire in the harness which is not being attached to anything. Your new stereo should have a separate wire (which is not getting used at this time) which is there to energize amps if present. It's going to take some troubleshooting to figure it out.
Answer: I was wrong about the wiring. The speakers were wired to subwoofer outputs instead of the mains.

New radio plays quiet


How large would a nucleus have to be for the gravitational force overcome the electrical repulsion?

Question: As a nucleus get larger, the electrical repulsion between protons grows, eventually overcoming the weak nuclear force. My question is, how large would a nucleus have to be for the gravitational attraction to overcome the electrical repulsion?
Comment: think neutron star
Comment: @annav that isn't an answer, I mean the minimum size
Comment: look at the coupling constants 1/137  electromagnetic  and 6x10^-39 gravity.http://hyperphysics.phy-astr.gsu.edu/hbase/Forces/funfor.html Neutron stars happen when the electrostatic repulsion is overcome by the large gravitationally attracted mass.. order of magnitude should be ok
Comment: @annav There are positive and negative charges collapsing in a neutron star. This is different from the OP's question about a nucleus with only positive charges. If we enlarge a nucleus, I don't think gravity would ever overcome the electrical repulsion.
Answer: Since the EM force is much larger than the gravitational than we can safely assume that the size would be large (roughly of astronomical order).
Suppose the giant nucleas has $n_p$ protons and $n_n$ neutrons.
The gravitational self energy of the spherical atom would be
$$U_G = -\frac{3}{5}\frac{GM}{R}$$  where $R$ is the radius of the "Megatom". Its mass is $M = n_p m_p + n_n m_n \approx (n_p+n_n)m_p$.
The repulsive EM self energy of the Megatom is
$$U_E =  -\frac{3}{5}\frac{kQ}{R}$$ where $k = \frac{1}{4\pi \epsilon_0}$ and $Q = n_p e$.
For them to be of the same order we need to have
$$G(n_p + n_n)m_p \approx k n_p e$$
We see that the $R$ cancels out. And the above equality gives a proton fraction of $$\frac{n_p}{n_p + n_n} \approx 10^{-40}$$
So if you want to have an atom of this form you need to have it filled nearly entirely with neutrons.
This is what happens in a Neutron star.
Comment: The above seems to imply that size doesn't matter


Translation of "Hosanna" (ὡσαννά)

Question: What does "Hosanna" (ὡσαννά) mean (as it appears in the Gospels)? What is its etymology/derivation from Hebrew/Aramaic?
Answer: The Hebrew phrase in Psalms 118:25 from which the Greek Hosanna (ὡσαννά) derives is actually two words:  הוֹשִׁ֨יעָ֥ה נָּ֑א (hoshi'ah na):

הוֹשִׁ֨יעָ֥ה (hôšîâ) is Hiphil imperative masculine singular fromישׁע` (ysh'), which means to help, save, rescue.
נָּ֑א (na) is a particle which indicates urgency or sincerity, and takes different meanings based on context.

In the context of Psalms 118:25, the meaning is literally, "save now" (so KJV, NKJ).

Psalm 118:25 (KJV)
25  Save now, I beseech thee, O Lord: O Lord, I beseech thee, send now prosperity.

Given the other OT quotations used by the crowd at the Triumphal Entry in the Gospel record, I think it is likely that the term was used there in a very literal sense. The people cheering Jesus' entry were calling on Him to enact the salvation of Israel, and to do so now. (Of course, their conception of the salvation that Jesus came to accomplish differed significantly from His and leads to a disillusioned mob that shouts "crucify Him" instead.)
Comment: The key point here being that it is a transliteration into the Greek from a Semitic word. (+1, by the way)
Answer: During the Intertestamental period, Judas the Maccabee (the Hammer) led a major revolt in Israel.  This is the Hasmonean revolt (beginning in 167 BC).  After Judah and the other Hasmoneans led the people to victory in a major battle, the people had a celebration.  They cut off palm branches, waved them in the air, and shouted "Hosanna!"
Judah was killed in 160 BC, but his brothers carried on the revolt and eventually drove the Seleucids out.  They set up a dynasty that lasted, with various amounts of independence, from 140 to 37 BC.  From 110 to 63, the Hasmoneans enjoyed full independence from foreign powers.  In 63, they were annexed by the Romans but allowed to remain on the throne.  In 37, Herod the Idumaean (supported by Anthony) defeated the last Hasmonean ruler and took Jerusalem.
When Jesus enters the city, they are calling on him to be like the Hasmonean kings and free the people from foreign oppression.  In this case, the Romans.
Comment: Thanks for putting the pieces together.  That makes Jesus' entry into Jerusalem that much more significant.
Answer: The Wikipedia article Hosanna makes a reference to the Bauer Lexicon, explaining the etymology of the Greek word ὡσαννά:

derived from Aramaic (הושע נא) from Hebrew (הושיעה נא) (Psalm 118:25, הוֹשִׁיעָהנָּא), meaning "help" or "save, I pray", "an appeal that became a liturgical formula; as part of the Hallel... familiar to everyone in Israel."

So by the time Jesus rode into Jerusalem and the people shouted Hosanna*, it had become "a liturgical formula". Hosanna had originally been a cry for help, but it had become, as Strong's concordance puts it, a cry of happiness.
*The people probably shouted this in Aramaic, which was transliterated to Greek. But I'm no expert.
Answer: Below are a few different entries for the Greek word ὡσαννά (copied from BibleWorks 8):
Friberg Lexicon

29106  ὡσαννά a particle transliterated from the Aramaic; strictly, a cry expressing an appeal for divine help save! help, we pray! in a liturgical usage, a shout of praise and worship hosanna, we praise you (MT 21.9)

Louw-Nida Lexicon

33.364  ὡσαννά: (an Aramaic expression meaning 'help, I pray' or 'save, I pray,' but which had become a strictly liturgical formula of praise) a shout of praise or adoration - 'hosanna.' ὡσαννά εὐλογημένος ὁ ἐρχόμενος ἐν ὀνόματι κυρίου 'hosanna; blessed is the one who comes in the name of the Lord' Mk 11.9; ὡσαννὰ ἐν τοῖς ὑψίστοις 'hosanna in the highest'  Mk 11.10; ὡσαννὰ τῷ υἱῷ Δαυίδ 'hosanna to the Son of David' Mt 21.9 . In Mt 21.9 ὡσαννὰ τῷ υἱῷ Δαυίδ may also be rendered as 'praise to you, Son of David' or 'we praise you who are the Son of David' or '... a descendant of David.'
Though for many early Christians, and especially those of Jewish background, ὡσαννά would be known from its Aramaic background as meaning 'help' or 'save,' nevertheless, its association with liturgical expressions involving praise and exaltation resulted in the expression acquiring quite a different significance; hence, a phrase such as 'hosanna in the highest' became equivalent to 'praise be to God.' For growing numbers of Christians without Jewish background, ὡσαννά probably acquired much the same meaning as it now has in English.

VGNT Dictionary

4754  ὡσαννά orig. a cry for help (Ps 118:25), but as used by the Evangelists a shout of praise (Mt 21:9, Mk 11:9 ff.): see Dalman Words of Jesus, p. 220 ff. It is because of Luke's omission of ὡσαννά in 19:38 that Jerome calls him "inter omnes evangelistas Graeci sermonis eruditissimus" (Ep. 20. 4 to Pope Damasus). For a discussion of the cry Hosanna, see F. C. Burkitt in JTS xvii. (1916), p. 139 ff., and cf. Preuschen-Bauer, Wörterb. s.v.
Answer: There is no evidence whatsoever in the Gospels that those who welcomed Jesus were the ones who called for his crucifixion.  For some decades there were disciples and admirers of Jesus in Jerusalem.  When a high priest took advantage of the absence of a governor to have the brother of Jesus (Jacob/James, leader of the earliest Jesus community) killed, there was such strong opposition in Jerusalem to his action among the people that the incoming governor dismissed the high priest from his office.
Comment: Welcome to BHSX.  Thanks for your contribution.  Please remember to take the tour (link below) to better understand how this site works.  How does your answer actually address the question - the two appear unrelated.

Translation of "Hosanna" (ὡσαννά)


Upgrading Gnome Shell Extensions

Question: I recently upgraded to Ubuntu 12.04, and all the gnome shell extensions listed by the Gnome Tweak tool are disabled. What's the easiest way to fix/upgrade them? Do I need to manually delete, re-download and install them?
Answer: Go to extensions.gnome.org with Firefox or Epiphany, then to "Installed extensions". Some may me grayed out, that means that they aren't available in Gnome 3.4, but others probably have a green icon on the left with which you can update the extension.
Comment: Is there some other way? The site extensions.gnome.org is incredibly buggy. I have a dozen extensions installed, but every page on that site is blank...
Comment: There is no other way yet. But it probably doesn't work if you installed them in /usr/share/... Try reinstalling them through the website and make sure you have scripts activated.
Comment: It's a buggy site. I get a JS error for the code: `$.ajaxSettings.headers['X-CSRFToken'] = $.cookie('csrftoken');` main.js line 13.
Comment: For me, it works just fine. Try epiphany ("Web Browser") if you used FF before.
Answer: There's also a webupd8 extension for updating all extensions.
Note, the install instructions in the article are wrong, and should actually be:
<code>sudo apt-get install git-core gnome-common
git clone git://github.com/eonpatapon/gnome-shell-extension-updater.git
cd gnome-shell-extension-updater
./autogen.sh
make
sudo make install
</code>

Upgrading Gnome Shell Extensions


GridBagLayout with fixed number of columns

Question: I just want a GridLayout which has the change to merge cells. So I found the GridBagLayout. It seems that this layout is very flexible. I don't need this flexibility. Is there a way to tell the GridBagLayout that it should use, for example, 20 columns and 10 rows over the whole width and height?? It should look like a GridLayout, but with merging cells.
Thx
Answer: As far as I know, you can use the same height and width for more than one JComponent. But you'll have to change them, where you want a merged cell.
Here is an example from how to use GridBagLayout
protected void makebutton(String name,
                          GridBagLayout gridbag,
                          GridBagConstraints c) {
    Button button = new Button(name);
    gridbag.setConstraints(button, c);
    add(button);
}

public void init() {
    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    setFont(new Font("SansSerif", Font.PLAIN, 14));
    setLayout(gridbag);
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1.0;
    makebutton("Button1", gridbag, c);
    makebutton("Button2", gridbag, c);
    makebutton("Button3", gridbag, c);
    c.gridwidth = GridBagConstraints.REMAINDER; //end row
    makebutton("Button4", gridbag, c);

    c.weightx = 0.0;                //reset to the default
    makebutton("Button5", gridbag, c); //another row
    .........
}

So you don't need to specify the height and width all the time.
Answer: I wish that this was possible, as it would make my project much easier. However, this is the answer:

GridBagLayout offers no methods to explicitly define the number of rows or columns in the grid, nor does it have methods to define the size of each cell in the grid. Instead, GridBagLayout calculates the number of rows and columns in a grid by the number of Components placed on the screen. If a container has five Components lined up horizontally, then the grid consists of five columns and one row. If the Container has five Components lined up vertically, then the grid consists of one column and five rows.

I got it from: http://www2.sys-con.com/itsg/virtualcd/java/archives/0304/tabbone/index.html
For my project, I'm thinking of creating the top row and left column of my GridBagLayout with x and y number of 1 pixel by 1 pixel transparent panels to manually create an excel-like grid and put objects within that grid structure, using gridwidth and gridheight to merge the cells as desired. This should allow me an easy way to create my complicated layout and have everything resize correctly (knock on wood).


Special skew-symmetric matrices

Question: A skew symmetric matrix $J$ is "special" if for any matrix $X$ with determinant equal to one, it satisfies $$ XJX^{-1}=XX^TJ.$$
For $2 \times 2$ matrices one can easily verify that any multiple of the matrix $$J=\begin{vmatrix} 0 & -1\\1 & 0 \end{vmatrix}$$ is special. Are there any nonzero $n \times n$ matrices satisfying this condition?
Comment: Certainly the zero matrix does.
Comment: It is not true that $\det X=1$ implies $X^{-1}JX=XX^tJ$. It doesn't work for $X=\pmatrix{1&1\cr0&1}$, nor for $X=\pmatrix{2&0\cr0&1/2\cr}$, for example.
Comment: @Gerry  Sorry I meant $XJX^{-1}=XX^TJ$...thanks for catching that up
Comment: OK, then, since $X$ is invertible, you can cancel it to get to the simpler equation $JX^{-1}=X^tJ$. How hard can that be? [I don't know]
Comment: It's easy to show that, for $n=2$, only scalar multiples of your $J$ work.
Answer: The given condition implies that $J=X^TJX$ for every $X$ with determinant $1$. In particular, if $X$ is a diagonal matrix, this would mean $J_{ij}=x_ix_jJ_{ij}$. So, if $x_ix_j\ne1$ for every $i$ and every $j$, then $J$ has to be zero. Now, when $n\ge3$, such an $X$ does exist: just pick any $x>1$ and let $X=\operatorname{diag}(x,x^2,x^3,\ldots,x^{n-1},x^{-\frac{n(n-1)}2})$.

Special skew-symmetric matrices


Django Final/Landing Page

Question: I am working on a Django based server and i take some attachments from the user and process it in this function
<code>def get_request(request):
    df = pd.DataFrame()
    flag = 0
    # if this is a POST request we need to process the form data
    if request.method == 'POST':
            #Processing and generating results
            return render(request, 'result.html', {'data': to_send, 'file': df, 'flag': flag})
</code>
Initially, I wanted to render the results HTML page as above but instead I decided to send an email containing the results and send it to the user. I am able to send the results but I want to render a final page with some text while the results generate(might take some time depending on the size of the input). How can I do so without waiting for the processing to end and let it be in the background even if the user closes the tab?
Comment: Threads or an external process.
Answer: It sounds like you might want to introduce a task queue to carry out the task on a separate thread and handle it separately.
I would recommend looking into Celery and Redis (as a message broker).
The way it would work is that once you have the data that you want to process, you sent a task to the task queue to perform and you immediately provide the user with a response.
Celery would then handle that task and carry out whatever it needs to in the background.
I followed this guide to do something similar for my company site:
https://www.youtube.com/watch?v=fBfzE0yk97k&list=PLOLrQ9Pn6caz-6WpcBYxV84g9gwptoN20&ab_channel=VeryAcademy

Django Final/Landing Page


new samsung tab s3 connectivity

Question: I've pre ordered one of the new samsung tab s3's. Since placing the order, I can't find any mention of a sim card slot or 4g.
Do any of you folks out there know if its wifi only, please?
Answer: Totally depends on what you purchased.
This device follows the simple naming convention of many Samsung devices:

Ending with 0 means WiFi
Ending with 1 means 3G (mostly deprecated)
Ending with 5/5Y means global LTE
Ending with 7 means carrier-based LTE, with the carrier indicator letter right behind it (A for AT&T, T for T-Mobile, etc.)

Find a model number (SM-Txxx) from your order, then see the above rules to find out.

new samsung tab s3 connectivity


Correcting for multiple tests over time

Question: I am measuring degradation of RNA over time with a control and a treatment. I have % RNA remaining (relative to time 0 for control and treatment) and 5 time points. I would like to test if the % remaining is different for control vs. treatment at each time point. I think that I need to correct for multiple comparisons, but unsure of exactly what test to use. I think I need to first do some kind of anova and then a post hoc test such as a t test with a Holm-Bonferroni correction, but this situation looked a bit different from most of the examples I saw where they are testing multiple comparisons within one time point.
Thanks
Answer: You probably shouldn't test for a statistical difference between the control and treatment time-courses at each time point. Are you thinking of hypotheses such as "there is a difference at time point 1 but not time point 3"? No. Look at the experiment as providing estimates of the degradation rate.
The first thing (always) in data analysis is to inspect the data graphically. My expectation is that RNA is pretty unstable and should degrade with an approximately exponential time-course, but you should know more about it and your data have the last say. Plot the amount remaining at the time points using a logarithmic amount scale. You might find a linear decline that is very easily characterised. You might even find that the difference is substantial enough that the graph is sufficiently persuasive without further analysis.
If you do want a more statistical analysis then I suggest fitting a model to the data to determine time-constants. The model to use depend on the form of the data and details of your analytic objectives, but I suggest you look at this question about linear and non-linear regression as a starting point.

Correcting for multiple tests over time


Reducing the memory address bus by adding banks

Question: If you are trying to control memory from a CPU, then if you use two banks instead of one, you can remove the first address line. If you use four banks, then you can also remove the second as well. Why is this?
Comment: You need some more details; are you talking about 32-bit processors?  Parallel addressed RAM?  8 bits/address?
Answer: I'm going to assume that you're talking about parallel memory, and that when you say "use two banks instead of one" you are using two chips that have the same total memory, but each are half as large.
Here's the thing: you can't actually remove that address line from your CPU. It might not go directly to the memory chip, but if you remove it there is no way to distinguish between the two chips. The missing ingredient is the "chip select" function. Most memory chips will have a pin or set of pins that are used to basically tell that particular memory chip that the processor want to talk to only that chip.
Lets consider a simple example: 256 words of memory. This results in an 8-bit address bus.

One chip with 256 words: then we are always using only one chip, and it has an 8-bit address.
Two chips with 128 words each: Only one memory can be active at the same time, so we will be using the "chip select" pin. The MSB (Most Significant Bit) of the 8-bit address bus will go to the chip select pin on each chip, and the rest of the 7 bits will go to the 7-bit address bus on both chips.
Four chips with 64 words each: Only one memory can be active at the same time, so we will be using the "chip select" pin. Some memory chips have multiple chip select pins, but for this example we will assume there is only one. In order to generate the chip select signals for all four chips, we will need a 2-to-4 decoder (also known as a $n\mbox{ }to\mbox{ } 2^{n}$ decoder, row decoder, address decoder - all the same things). This decoder takes the first two MSB from the address bus, and determines which chip select signal should be active. The lower 6 bits of the address go to the 6-bit address bus of all 4 memory chips.

This is a really simple example, but it scales fine. This is basically the procedure for making multiple memory chips work together to increase the address space.
Comment: Don't you mean that the LSB is used for the chip select?
Comment: No, you  use the MSB's. That way you're not switching chips every time you increment the address. This makes it much easier to use ROM chips, partially filled address spaces, and devices with a memory bus interface.
Comment: If you look at page 13 on here the LSB is being used. http://www.ece.cmu.edu/~ece548/handouts/13m_arch.pdf
Comment: If you want to switch chips every read, then you can use the LSB as CS. You can even use a combination of MSB and LSB or any bits in the address, and it will still work. If you are trying to interleave your chips to get a performance advantage, your system must be able to take advantage of that.
Answer: I think W5VO's reply is a great description of a modern memory system but does not really describe Bank Switching.
You want bank switching when you have a narrow address bus (like 8- or 16-bit) and you want to add more memory. You can then use separate GPIO lines to switch memory chips just like W5VO wrote. You have to be careful because all your pointers are still 8-bit and the switching is manual so you can easily cause a mess.
This technique was/is popular in small micros, but also in 16-bit DOS (it was born on the 80286) and kind of in modern 32-bit  processors to address more than 4GB of memory (but here the trick is done invisibly by the kernel and one program can still only see 4GB).
Comment: @200ok404notfound: Yes, your description of interleaved memory is valid -- I hesitate to say it is "right" only because bank switching is just as valid.

You are describing [interleaved memory](http://en.wikipedia.org/wiki/interleaved_memory).

W5VO and jpc and supercat are describing [bank switching](http://en.wikipedia.org/wiki/bank_switching).

The Sojourner Mars rover and some TRS-80 Model 100 computers use bank switching between the 16 address pins of the 80C85 and the RAM; they never used interleaved memory.

Both techniques have their place.
Comment: But how does that reduce the number of address lines?
Comment: @2000k404notfound It does allows you to expand beyond the address bus width that is available. I think I do not fully understand your question. If you want to address 4k memory you will need 12 bits of address lines *somewhere*. The only question is where do you stuff them.
Comment: There are two ways to reduce the number of address lines. One is to divide the memory into rows and columns and latch the row address. Truly random access then requires at least 2 clock cycles but columns inside a row can be accessed quickly. This is how DRAM works. The other method is to have a 32-bit data bus, throw away 2 low-order address bits and only access whole words at once.
Comment: I think it has to do with the last bit of the address. If you have two banks, then you can assign all the even addresses to one line, and all the odd addresses to the other. The last bit tells you if the address is odd or even, but if you use the CS line to select lines, then you don't need it. Does this sound right?
Answer: If one has a half-egabyte of byte-addressable memory, there has to be a way of generating a 19-bit address.  One nice easy approach is to have a CPU whose address bus has 19 or more address lines (e.g. an 8088).  Another approach is to have some of the address lines generated by something other than the CPU's address bus.  For example, suppose one has a CPU with a 16-bit address bus and one wants to construct a system with 32K of RAM and ~512KB of ROM.  One could use a 13-input AND to detect an access to address 0xFFF0-0xFFFF (one input of the AND would be tied to an 'address valid' signal), and a 4-bit latch to grab the bottom 4 bits of such an address.  Fifteen of the ROM address bits would be attached to the CPU's address bus; the other four bits would be connected to latch outputs.  The net effect would be that the ROM would be divided into sixteen banks of 32KB each, all of which would be accessed from 0x8000-0xFFEF.
Note that such a system wouldn't quite have 512KB of usable ROM, since accessing any of the last 16 bytes of each 32K bank would switch to one particular 32K bank.  Thus, 0xFFF0 would only be available on bank 0, 0xFFF1 from bank 1, etc.  Further, in many cases, one would end up having to duplicate some code in different banks.  Still, such a system would be quite practical and is in fact very close to what was done in many things like 1980's arcade games.
Comment: That's a pretty quirky bank-switching method. Do you know of any particular systems where this exact method was used? (The bank-switching methods I am familiar with are slightly different from and perhaps even more quirky than this method -- usually the external latch grabbed bits from the data bus rather than the address bus).
Comment: @davidcary: I don't know the exact details of how arcade games were built, but having 32K of bankable memory was a common pattern.  As for using address instead of data, that was a very common technique for Atari 2600 cartridges (which did not have access to a read-write signal) and for Apple II hardware.  The Atari 2600 cartridge port includes D0-D7, A0-A12, VDD, VSS, and nothing else.  No clocks, read-write controls, or anything.  The internal hardware on the 2600 is enabled when A12 is low (regardless of other address bits), so cartridges have 4K of address space.
Comment: @davidcary: Of the cartridges larger than 4K, about 99% of them use addresses 1FF8-1FF9 to switch between two banks (if 8K), or 1FF6-$1FF9 to switch among four (if 16K). Some cartridges have internal RAM, which normally uses different addresses for reading and writing (most such carts 1000-107F for writing and 1080-10FF for reading). I designed a cart for the 2600 which supports reading and writing at the same address; it also allowed hires pixel-plotting to be done in 3 instructions. I built a few prototypes, but someone else came up with a much cheaper way to add RAM to a 2600 cart.
Comment: @davidcary: The approach of using addresses to control functions and ignore the data lines was also popular in Apple II hardware.  If one decodes addresses 7Cxx to strobe a latch which grabs 8 bits off the data bus, setting the latches will require two instructions (one to load the data into a register, and one to store it).  If one has the latching circuit grab from A0-A7, one can set the latches with one instruction (simply read the address and ignore the result).  Alternatively, one can use an 8-bit addressable latch chip and have 16 addresses which set or clear one bit each.


How do I query the CrystalReports CMS database?

Question: Is it possible to query the Crystal CMS database and get meaningful data back?  The data appears to be encrypted.
I am running Business Objects Crystal Report Server version 11.5
Answer: Actually what I discovered I needed to do was use the administration tools available from the Administration Launchpad.  I was not responsible for installing Crystal and did not even realise this existed.  The query builder and also the "Report Datasources" feature that were available from here was exactly what I needed.
Answer: Use the Query Builder tool to query the CMS: http://[server]/businessobjects/enterprise115/WebTools/websamples/query/.  For more information about the query language, see http://devlibrary.businessobjects.com/businessobjectsxi/en/en/BOE_SDK/boesdk_dotNet_doc/doc/boesdk_net_doc/html/QueryLanguageReference.html#2146566.
The properties that are returned by this query are store in a serialized state (I'm guessing binary and encrypted) in the Properties field in the infoobject database table (I can't remember the actual name of the table).
Comment: I was not aware of the Query builder, and the API.  The only thing I dont like now knowing this, is its another thing to add to my already long task list :)
Answer: I had a similar problem on my workstation at the office.  It sounds like you need to reinstall (that's what worked for me). This is a known bug according BussinessObjects (I had to call them and use our maintenance support).  Hopefully you can find more information by searching for, 'Crystal Business query corruption' instead of calling them if the reinstall doesn't work for you.
They told me the data is not encrypted, but occasionally components don't install correctly and the queries come back in a binary form that is all garbled.
Good luck!
Answer: There are also several third party solutions out there that naturally layer "on top of" the CMS or Central Management Server to abstract the proprietary storage format into human-readable form.  We develop a native database driver to the CMS which can be found at http://www.infolytik.com/products.
full disclosure: I'm the main developer and founder of Infolytik.
Answer: My experience is that the data is not encrypted but that it is not really readable.  Your best option is to use the Auditor Universes to build you some reports.  You can also check out the SQL that the auditor Universes are uses as a baseline for constructing additional reporting.


Guitar string not in tune with itself

Question: I have a knock-off telecaster made by Stadium.  The strings on it refuse to be in tune with themselves (the G and B strings especially).  I hooked it up to a tuner and tested the intonation.  The G string when open reads as G, at the 12th fret it also reads as G, The 12th fret harmonic reads G as well.  When playing any other fret on that string however it is not an exact note.  The notes are off by close to a quarter tone (50 cents) at some places, the 2nd and 3rd frets are particularly bad.  I'm at a loss to what is wrong here.
Comment: While the answers here are all valid, i would be inclined to first blame the strings as well. Do they look dull or corroded. Do they feel tacky or slow? Sorry, but this is kind of the "have you tried turning it off and on" test.
Comment: Old strings can have non-uniform weight distribution, which causes all kinds of problems. The intonation at the bridge isn't likely to have an effect at the 2nd and 3rd frets; but there can be intonation issues at the nut which do show up there. Are the strings not seating well in the nut? e.g, a wound G on a nut cut for an unwound may not sit properly. The string should be supported at the edge of the nut (closet to the bridge); if, for some reason, it's being supported at a point back from that edge, it can cause problems like this.
Comment: I don't have a true answer, but if it was my guitar I would probably try making a huge bridge saddle adjustment on the string and see if it improves or gets worse, eventually homing in on the best bridge adjustment. Telecasters typically have two-string saddles on the bridge IIRC, so you might need to compromise a little.
Comment: When did you last change strings? The older the string, the harder to tune.
Comment: To some extent, if the bridge is very high, the stretch of the string will cause detuning at lower frets when the 12th fret fingered matches the open harmonic.  Even less helpful: switch to fretless like us bowed instrument players :-)
Comment: If the harmonics do not align up the nut bridge distance can be wrong for some of the strings. If the frets do not align up I am less sure what the issue is.
Answer: If it's an exceedingly low-quality product, it could just be that the fretboard is badly designed enough that the notes are just not in the right place, but realistically, all guitars exhibit tuning issues with fretted notes. Equal temperament is a compromise to begin with, and the guitar itself even more so.
Assuming it's not actually a manufacturing defect, guitarists have over the years tried to mitigate the problem. If I'm not mistaken, Eddie Van Halen liked to tune his B string slightly flat so that the major chords he played sounded better in tune.
(Relatedly, this is one reason power chords are so prevalent in guitar music -- aside from being easier to play, they also use few enough notes that tuning issues don't arise.)
The only real answer to this whole issue has arisen relatively recently thanks to advances in fretboard craftsmanship. The True Temperament system provides you with a neck built specifically for your instrument that moves the fret location for each note so that it is best in tune. Steve Vai in particular has taken a liking to them.
Comment: Whole tone = G-A. Half step (i.e. semitone) = G# - A. Quarter-tone = 1/2 of a semitone (or the distance from G# to halfway between G# and A).
Comment: @Dudewithaproblem Actually, a ["half step"](https://en.wikipedia.org/wiki/Half_step) is the distance between two consecutive notes—so G# to A is one half step.
Comment: I have never used a tuner across the fretboard like the OP, but his claim of "half step" off is probably farther than the sort of temperament compromises you mention.
Comment: A half step is exactly between two notes.  i.e: halfway between A and G#.
Comment: i bought a Glarry acoustic recently and two of the frets were in the wrong place, but that'a what you get for £20 :(
Answer: I don't know if this is the case here, but my first bass was an extremely cheap build, and I had something similar to this happening.
What I think may be happening is that you're fretting on your lower fret (Lets say 12 for sake of argument), and it may be playing the tone that should be heard at 13, or 14 or 15, etc... as if you were fretting that note. What causes that is often that there is a height difference between each fret, and the string is fretting itself on the higher of the two frets, this usually only affects a range of one to two frets before that fret, and on VERY rare occasions, 3 frets.
By (VERY CAREFULLY) filing the higher fret down slightly, you may be able to alleviate the problem without spending a ton of money on a (possibly) cheap guitar. If you're not comfortable doing this yourself, or you just plain don't know how to, find a instrument repair shop, and have them do it, you can try asking if you can sit in while the repair is done, but the answer will vary from shop to shop. Basically, it comes down to your skill level and budget.
Again, this may be completely off, but I had to make this modification myself when I first started, and your situation sounds similar to what I dealt with.
Comment: This seems fairly extreme - you'd be able to tell for sure though - if your 3rd fret is so high that it comes into play when you use the 2nd fret, then you'd see no difference in the 2nd and 3rd fret notes. Also, when you use the 2nd fret you should be able to easily slide paper under the string at the 3rd; if not, it's likely a problem as you say.
Comment: this could also just mean the action is too low, not that the frets are too high.
Answer: It's usually a combination of two issues: one that is easily repairable and one that is not. The latter is that your knockoff telecaster probably wasn't crafted by hand or to a very high standard or with very high quality materials, and the frets aren't set precisely.
The good news is, the intonation of most cheap guitars can be greatly improved with a few simple adjustments. Chances are, your guitar hasn't been set up properly. This includes adjustment of the tension in the truss rod, and fine tuning the bridge to get the intonation as good as possible given the gauges of strings you are using.
I learned to do this stuff myself and usually check the intonation on a guitar whenever I change the strings, especially if I'm changing gauges. It takes practice to get good at it, however. If you understandably don't want to use this as an opportunity to start learning, you can take it to a guitar shop and get a professional opinion, I believe they generally charge around $40 for a proper intonation. They will also know how to set the action up so your guitar might end up easier to play in addition to better in tune.
Good luck!
Answer: I'm going to assume you have a good string on there- if you haven't changed the string(s), do that first.
You said that the 2nd and 3rd frets are especially bad.  If the 1st fret is also bad, this indicates to me that there may be an issue with the nut.  If these notes are substantially sharp, the nut slot may be too high.  If you're inclined, you can attempt to fix this yourself by filing it deeper, but you have to be very careful not to file it wider.  Most guitars won't let you adjust the nut's forward-backward placement, but that would also have an effect.
Your primary adjustment for fretted notes is the intonation adjustment at the bridge, but this has very little effect up at the first few frets, hence why I suspect a nut issue.  You will have to adjust both to get the intonation correct, though.
The last consideration is technique- if you mash the strings down hard enough, they will always go sharp.  If you're fretting too far behind the fret, you will have to push the string sharp to get a clear tone.  Use a lighter touch if possible and fret right behind the fret.
Between these two adjustments and proper technique, if you cannot get all the frets within, say, 10 cents of each other, then it may just be poor craftsmanship.  Also, I would not attempt to adjust any frets yourself.  The height of each fret has a large effect on playability but very little effect on tuning, and it is very difficult to get that right if you're not experienced.

Guitar string not in tune with itself


Using the prefix "be-"?

Question: I read somewhere that the prefix be- can be used as a causative and this got me thinking. Does this mean that because means to cause to cause or to make cause?
Comment: [Here's](http://wiki.answers.com/Q/What_is_the_definition_of_the_prefix_be) a good summary of the main different meanings of **be-** as a prefix. 1) thoroughly *(bespeckled)*, 2) to cause to seem *(belittle)*, 3) to provide with *(beloved)*. But as the answers indicate, *because* doesn't use this prefix - it's **by-**.
Answer: From OED (the other one):
because

c.1300, bi cause "by cause," modeled on Fr. par cause. Originally a
  phrase, often followed by a subordinate clause introduced by that or
  why. One word from c.1400. As an adverb from late 14c.
Comment: Thankyou very much for this. I have also just thought of the words 'bemoan' and 'befall'. do these therefore their meanings as by moan(ing) or by fall(ing) have?
Comment: [_bemoan_](http://www.etymonline.com/index.php?allowed_in_frame=0&search=bemoan&searchmode=none) comes from Old English 'to bemoan, wail, lament'.

[_befall_](http://www.etymonline.com/index.php?allowed_in_frame=0&search=befall&searchmode=none) comes from Old English 'to deprive of; fall to, be assigned to' but also from from befall, and befall from be- "by, about" + feallan (see fall).
Answer: The word 'because' originated from 'bi cause' or 'by cause' and not be-cause. So because does not mean to cause to cause.

Using the prefix "be-"?


What Deep Learning model to use in this spectroscopy task?

Question: I have a task to be solved. There are energy measurements over the square area 40x40. One measurement consists of values : x, y and the energy. The all area is almost whole covered with data (a few percent of cells are empty, we can consider them to have 0 energy). Many (thousands) measurements build one output state (a mask 40x40). We have 15000 of such outputs and their observations (measurements) - - that's a training set. The outcome should be a multi-value mask, also 40x40. It should be telling whether there is a matter and what type matter (different values of the mask). The mask can consist of a few figures, rectangularish, sometimes the figures are connected, they are all in the centre area of the output. Mask can have values 0-20, they are labels. Some sort of other specific information of the materials is given (density and radiation length). So instead of the labels we can use them (real numbers) to obtain resulting matter type. What DL model should I use?
Answer: I think you need a deep learning model that can perform both image segmentation and image classification. Image segmentation is the process of dividing an image into regions or pixels that share some common characteristics, such as color, intensity, or texture. Image classification is the process of assigning a label or class to each region or pixel, such as the type of matter.
One possible deep learning model that can do both tasks is a modified U-Net. A U-Net is a type of convolutional neural network that consists of an encoder and a decoder. The encoder extracts features from the input image, while the decoder reconstructs the output image with the desired labels.
This tutorial focuses on the task of image segmentation, using a modified U-Net.


All users can log into SharePoint 2010 site even though I removed Domain users from all groups

Question: I have a SharePoint 2010 site that had Domain users in a group with read permissions. I did not want to allow all users in AD to be able to log into this SharePoint site so I removed Domain users from that group but I find all users can still login. I made sure Domain users was not set in any other group. Is there some other place I missing that could have Domain users set?
Comment: did you 'check permissions' for 'Domain Users'? site settings - site permissions - check permissions. what does it say?
Comment: There are other ways they could be accessing the site. Do you have anonymous access disabled? Are you using authenticated users anywhere? Find an account that you don't want to have access and check permissions to see how they're able to get to the site.
Answer: If you checked all the SharePoint Groups for your domain group an then there could be at least three additional ways these users could have access:

You have the Authenticated Users group in one of your SharePoint Groups
You have Anonymous Access configured
You have an AD group configured for access in the Web Application's Permission Policies