How should we understand "…, the ancient heavens … (NIV, NIVUK)" and why is the translation different in other versions like CJB, NABRE?

Question: Psalms 68:33:- "to him who rides across the highest heavens, the ancient heavens, who thunders with mighty voice."
Answer: The confusion results from the fact that CJB and NABRE use a different numbering system for the verses of some psalms. So 68:33 in NIV is 68:34 in NABRE

Who rides the heights of the ancient heavens,
Who sends forth his voice as a mighty voice...

The reason for this is that NABRE and CJB count the inscription ("For the director of music. A psalm of David. A song.") as the first verse.
To the main question: "ancient heavens" may be understood either as the eternal spiritual realms or the physical skies, which are of great antiquity. How one interprets this depends on whether one accepts the idea that Israelite religion once thought of God as as a sky deity - literally a Cloud Rider - similar to pagan high gods. The latter view is supported by Psalm 68:
Psalm 68:5

Sing to God, praise his name; exalt the rider of the clouds.

The idea of the heavens being an eternal spiritual realm, the dwelling place the transcendent God, is supported, for example, by Psalm 89:3

For I said, "My mercy is established forever; my faithfulness will
stand as long as the heavens."

Neither of these verses is conclusive. Of course, modern readers do not think of God as ever being a literal cloud-rider, nor to we understand the "ancient heavens" as referring to sky; but the attitude of ancient Israelites is less certain.
Answer: Let me recommend Jonathan Pennington's excellent ~400-page book, Heaven and Earth in the Gospel of Matthew, which was derived from his PhD thesis on the subject. It's a thorough academic investigation, but not an easy read.
He examines what the Galileans understood as "the heavens" according to their culture, and language. For example, "heavens" is always plural in Aramaic and Hebrew. Their understanding was a plurality of heavens in binary contrast to "the earth." According to Genesis, there are three heavens: the dwelling of birds, of stars, and of God and the angels. In the New testament, the Apostle Paul, an expert in the Tanakh, mentions that he knew a man taken up to the third heaven.
According to Dr. Pennington, "heaven" in Greek is usually singular (except in Matthew where it's translated from the original Aramaic). The concept of heaven (singular) in Greek is that it's the abode of God and the angels.
Psalms contains many poetic structures and theophanies besides the one quoted from Psalm 68, such as in Psalm 18:7-15 ESV

<code>7 Then the earth reeled and rocked;
the foundations also of the mountains trembled
and quaked, because he was angry.

8 Smoke went up from his nostrils,
and devouring fire from his mouth;
glowing coals flamed forth from him.

9 He bowed the heavens and came down;
thick darkness was under his feet.

10 He rode on a cherub and flew;
he came swiftly on the wings of the wind.

11 He made darkness his covering, his canopy around him,
thick clouds dark with water.

12 Out of the brightness before him
hailstones and coals of fire broke through his clouds.

13 The Lord also thundered in the heavens,
and the Most High uttered his voice,
hailstones and coals of fire.

14 And he sent out his arrows and scattered them;
he flashed forth lightnings and routed them.

15 Then the channels of the sea were seen,
and the foundations of the world were laid bare at your rebuke, O Lord,
at the blast of the breath of your nostrils.
</code>

One would be ill-advised to use such a poetic/allegorical description as the foundation of a theological position regarding the physical nature of God. There is evidence that theophanies and poetic structures were indeed shared among ANE writings such as those of the Akkadians.
The Genesis description of the heavens is also not the same as the popular medieval depictions of a flat earth covered by a half-dome containing fixed stars, nor is there evidence that Genesis evolved from other religious texts.
In fact, ancient cosmologies often describe warring gods, dismemberment, and repurposed body parts in their creation stories. The earth is supported on the backs of large animals such as tortoises and elephants. One of the Greek Titans, Atlas, holds up the heavens. The sun and moon are powerful deities. In profound contrast, the Bible contains NO similar stories. According to Genesis, the sun and moon are simply luminaries—lamps, not gods—and the earth is not supported by any giant animals.
Translations often differ from each other depending on the manuscripts used, the style of translation (literal or paraphrase), the size of vocabulary used, doctrinal interpretations, and tradition. I often check with several popular translations (often the ESV, NASB, and NIV), plus the LXX, the literal Greek or Hebrew, and the Dead Sea Scrolls (and, on rare occasions, the Syriac Peshitta).
Hope this helps.
Answer: As Dan Fefferman correctly points out, some Bibles number the verses differently by numbering the superscription as a separate verse.  This means that verse numbering is out by one between some Bibles.
"Ancient Heavens"
Now, to the main question of the OP concerning "ancient heavens".  The verse of Ps 68:33 is composed of two clauses in parallel which I would translate thus (literally)

To Him who rides on the heavens of heavens of antiquity
indeed, He sends out His voice of voice of strength

The trick in translating this verse is to recognize the Hebrew noun chains - each of the above clauses ends with a triple noun chain.

the first clause is בִּשְׁמֵ֣י שְׁמֵי־קֶ֑דֶם = of heavens heaven antiquity; however, this noun chain should be translated as "heavens of heavens of antiquity".  This is presumably another way of expressing "highest heaven" as per Deut 10:14, Neh 9:6, Ps 148:4, etc.  The "heavens of heavens of antiquity" simply means that God's throne (the place of the highest heaven, Job 22:12, Ps 115:16, 148:1, Isa 57:15, 2 Chron 6:18, 1 Kings 8:27, etc) is far above everything and existed before anything else.
similarly, the second clause has a triple noun chain בְּ֝קֹולֹו קֹ֣ול עֹֽז = "of His voice voice strength"; which again must be rendered "of His voice of voice of strength".  "Voice of Voice" is quintessential Hebrew expression meaning, "greatest voice".  This is further emphasized by further redundancy by saying "voice of voice of strength" meaning the greatest possible voice - a suitable epithet for God's voice with creative power as per Ps 33:6, 9, Gen 1.

How should we understand “…, the ancient heavens … (NIV, NIVUK)” and why is the translation different in other versions like CJB, NABRE?


CGI is inefficient, but what is being used that is so different nowaydays?

Question: My understanding is that creating CGI scripts is a thing of a past, and has deemed inefficient because of the way it forks every time its being called. However I don't see what the different is considering when you call a web page with php scripts embeded, it still in some way forks to another process, so why is CGI deemed inefficient?
Answer: There are two "mainstream" ways around forking for every request:

You can load the interpreter directly into your server's process space, and prefork a number of set instances during startup.  mod_php and mod_python take roughly this tactic.
You can create a persistent process for the interpreter, and then either prefork or spawn threads for each request, communicating with the server over sockets.  FastCGI is used this way.

Event-driven servers, while not exactly mainstream, are becoming more common for good reason.  They rely on the knowledge that most websites spend most of their time blocking on I/O, just spinning their metaphorical gears.  Whenever a request needs to do any I/O, the server is free to start handling another request without starting another thread/process by using select() and friends.  This is really the only way to solve the C10k problem.
Comment: I'm not really sure this post is correct. First FCGI doesn't spawn threads in the case of PHP, it still forks. The only change is that the PHP instance it external (via FCGI) from the web-server so the web server can safely run as a single event driven thread. This event driven type of handling the requests allow for much cheaper handling of non-dynamic requests. So that only dynamic requests require a dedicated PHP instance, instead of each connection.
Comment: I confess to not being entirely familiar with how PHP specifically deals with this, but the FastCGI implementations I've seen do work this way.  However, I've updated the answer to generalize a bit.
Answer: CGI forks every request. This means the "weight" of forking/initializing is done every time.
FCGI or mod_php only fork on server start or on load increase. This means setup is only done once per process (but they don't share memory).
Facebook's HipHop doesn't fork (it transforms the PHP into thread-safe C++ code). This allows all the PHP "process" to live in a single multithreaded C++ binary, resulting in a substantial speed up and decrease in memory usage.
Answer: There is FastCGI, when you start some instances of the php binary, and they handle queries one after another, this way those processes do not start over and over again for each request.
Also PHP is typically run as apache module, which has a lifecycle tied to the webserver, so no additional overhead between handling requests, when Apache identifies a file as PHP script it calls mod_php which was started togather with the webserver itself.
Answer: CGI's overhead was mainly from having to fork() the webserver process handling the request, firing up a shell, and then running an external program.
Since the request was an external program, almost everying to do with the request had to be copied into the new shell's environment variables - query string, remote address, authentication data, etc.. POST data was passed to the script via its stdin. All of this took time to copy and configure, adding to the overhead.
This is one reason why query strings had to be length limited. Some operating systems had (and still do) length limits on the name of environment variables, and definitely had limits on how large an individual variable's contents could be. The HTTP spec itself has no limits, but because of the CGI mechanism and underlying OS limits, limited length query strings became the norm.
Answer: Microsoft IIS allows the script to be interpreted in-process by loading a library into its address space. (Newer versions of IIS work more like FastCGI in that the actual script execution is performed in a separate web worker process, although this is subject to the configuration settings for the virtual directory.)


What is the best way to deploy Substrate and EVM based blockchain?

Question: I would like to service users on both Substrate and EVM (Ethereum Virtual Machine) blockchains. But the two systems do some things differently. What would be the best way to deploy a blockchain that supports both Substrate and EVM?
Comment: just to be clear: by default a substrate chain does nothing, you have to add pallets for the protocol, WASM Contracts, EVM contracts, governance, even the token is a pallet. So be careful and make sure your chain has all the bells and whistles you need.
Answer: You can deploy to Moonbeam/Astar or if you fancy having a go yourself you can check out the EVM Pallet
https://paritytech.github.io/frontier/frame/evm.html
Comment: The EVM Pallet seems interesting. Do you have any idea about the stated "customizable conversion functions" used to map Substrate accounts and EVM external accounts?
Answer: You can turn your substrate into being as close as possible to ethereum by adopting ethereum conventions for example changing address types to match. But if you do that, those addresses need a translation step when talking to other parachains (not a problem if you have a solo chain). It's a question of trade offs and finding a happy medium.
There was a fantastic walk-though of how to create a compatible chain at Sub0
(it's intense but an amazing demonstration of the flexibility that the generics gives you).
Remember the other option which may be more appropriate to your use case is rather than doing all the work to build an EVM compatible chain, you could build on one of the existing EVM compatible chain platforms like Moonbeam, Acala or Astar for example that each have chosen different tradeoffs on EVM compatibility.
Answer: Most evm compatible substrate chains uses pallet-evm and pallet-ethereum provided by frontier, for example Moonbeam, ChainX, Edgeware etc.
You can start with the Substrate Frontier Node Template project.
It is a FRAME-based Substrate node with the Ethereum RPC support, ready for hacking.
You can deploy the frontier node the same way you do a substrate node.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Comment: @navigaid: Frontier is the Ethereum compatibility toolkit. To have EVM compatibility alone, you don't need to make your chain Ethereum compatible. You could just use `pallet-evm`.


Multisite - Global CPT - advices?

Question: I have a WP Multisite :
1 main domain not accessible in front-end, and 20 public sub-sites ;
If a visitor query the main domain, a geo-ip resolution redirects him to the most appropriate sub-site.
I have a custom post type which is global : all datas must be displayed on all sub-sites.
Today, I have a sync process which copies all datas (post + postmetas + related taxonomies) to all sub-sites. This process works, but is very slow and consumes a lot of resources ; furthermore, it's stupid to duplicate same datas across all sub-sites so I try to do in an other way.
I think about using the posts_request filter ; I check what object is queried, and if its my global CPT, I replace the table prefix with the prefix of the main domain.
I know it will be complicated to adapt all the queries (for example if several cpt are queried, with tax relation...) ; I know I will need to adapt the search queries. But there is also advantages : No more duplication/synchronization of datas.
For now, my search&replace works as expected and entries of main site are well displayed on the sub-sites (on front & back office).
I have a bug for the edit-link which of course is not valid on sub-sites : redirects to current sub-site, but with post_id of the main-site...
(I didn't decided yet if I disallow this CPT edition on sub-sites or if I change this edit-link to redirect to main-site in case of editing.)
My question is :
With your experience, can this method work? What big bugs could I have?
Answer: OK this is a longshot, but what if These network wide posts had their own subdomain for entry and then you access / display them on sub sites with switch to blog. I personally use this on one of my projects to handle some kinde of pseudo membership for multisite and to display network wide banners.
All in all, this topic interests me also, so I'm looking forward to see other opinions.

Multisite - Global CPT - advices?


Yichud at night, if both of the woman's parents are home

Question: Is it permissible for a man to be at a woman's home at night if both of her parents are at home, but sleeping? What if they are awake?
Comment: see here: http://www.sie.org/library/article_cdo/aid/2312231/jewish/Chapter-5-Shomrim-Which-People-Prevent-Yichud.htm#footnoteRef26a2312231 -- check out the footnotes as well --- it's not an exact answer, since it only discusses if one of the parents are there, not if both are. I didn't look up the footnotes, so I don't know if they discuss it there.
Answer: The laws of yichud are complex, so it is worth CYLOR in specific cases. Nevertheless the answer to the question is yes in both cases (I now checked the reasoning with a rav and talmid hakham)

Yichud is allowed in a room which is open (see SA EH 22:9) (according to some poskim, also if closed but unlocked and people can come in at any time, or if there is a clear view into the room)

R Doniel Neustadt quotes R Moshe Feinstein as allowing a man to be secluded with a woman in the presence of the man's grandmother, mother, daughter, granddaughter or sister. During nighttime sleeping hours, an additional chaperon is required. A man and a woman may remain alone in a home where the parents of one of them are sleeping.

According to R Nissan Dovid Dubov "the presence of a single shomer is effective during the day. However at night, a single shomer is not adequate since the shomer may fall asleep. Therefore, the presence of two shomrim is required at night. Two shomrim are adequate even if both are sleeping, for the man and woman would fear that one shomer might awaken and discover any improper conduct."

See further sources here and there.
Answer: They would have to be in the same room as either the man or woman. In the same house is not enough, since a closed door is effectively a different place. Since you can not see into it from outside. While sleeping only works if the person is easily roused - a deep sleeper is not an effective shomer. And in a different room is certainly not enough while sleeping, even if it may be OK if the person is awake and you expect they might enter unannounced.
A shomer is not a "game" - the person must actually guard, so anything that prevents that (loud noise, closed door, deep sleeper, etc) negates what they do.
This is on top of all the restrictions in what Menachem linked to.
Comment: Citations to sources would vastly increase the value of your answer.
Comment: And who says same house isn't good enough? If they could potentially wake up at any moment and walk in, i don't think that's considered yichud. Locked door would be a different story
Comment: Your choice of words "not a game...must actually guard" I think are a bit unclear. The job of a Shomer is to remove the status of 'alone' from Yichud, not an active role, to the best of my knowledge. Additionally, do you have any sources for 'loud noise' prevents a Shomer (I've heard the other cases brought down)? Does that mean you automatically have Yichud next to a construction site, train station, etc?
Comment: Who says a Shomer is not a "game"? Baalah BaIr "could be"


What is efficient way of updating drupal commerce product prices when your on a product display page?

Question: What are some fast ways of updating the product prices for drupal commerce? Right now i have to go into the product list and search for the items I want to change prices on. I know inline entity form solves the issue, but was wondering what other methods are other people doing?
Answer: You can make a nice edit contextual links with custom_contextual_links module in any view you would like to use this functionality.
Comment: this wont work if you have a select drop down box when selecting item variations. how do you solve that?
Comment: Yeah, I hava a trick for that: You have to add a product_id field first, than add a User field (or Custom field, I don't know exact english translation), label it the way you like, and click in rewrite settings the "Make this field a link" checkbox, next just add a link path like that /admin/commerce/products/[product_id]/edit - you're done!
Comment: do you have a screen shot for that setup? sounds interesting.
Comment: I have changed my answer, see the first screenshot, I hope it's not complicated.
Answer: I would prefer to use Commerce backoffice module to manage product and order in admin.

Provides a better experience for stores using nodes as product
  displays for grouping product variations (commerce_product entities).

The node/add screen is now split into two tabs, "Create content"       (ordinary node types), and "Create product" (product display node
  types).
The products view is now a view of nodes, showing product       displays. Contains special exposed filters for filtering by product
  display type, and product display categories.
Uses the megarow    pattern to provide a "Quick Edit" link in the    view, that shows all    product variations for that product display,
  right underneath the    triggering row. The status and price can be
  modified directly.
Modifies the "Content types" screen by adding additional help text       for understanding product displays, and adds a column to the table
  that indicates whether the node type is a product display node type*.
Disables the Commerce-provided "Product types" UI, and provides a       custom "Product variation types" UI that contains additional help
  text, hides fields that are not used by the Inline Entity Form (help,
  description for each type), and provides the ability to create a
  matching node type for each created product variation type.

It would provide the quick edit product in product display list in admin.


Is Unity a Desktop Environment?

Question: I read somewere that Unity is a DE, is that true or not?
Answer: It depends on definition of desktop environment. But I think Unity is not a DE -- there are no "Unity applications" (Ubuntu mostly uses Gnome applications), window manager is Compiz (not "Unity-specific"), desktop manager is Nautilus (from Gnome) etc.
I think Unity is just of user interfaces for Gnome Desktop Environment.
Comment: I think this answer best reflects how we think about it. Yes, in order to take full advantage of Unity an app needs to consider some Unity-specific API's, but those are showing up in other GNOME distributions not just Ubuntu, and we hope in due course they will become a standard part of GNOME. So Unity is an alternative shell within the broader GNOME universe.
Answer: It's wrong. Unity is a window manager plugin (for Mutter or Compiz) and runs on top of Gnome.
Answer: It depends on how you define a Desktop Environment. One definition is "a graphical user interface that runs on top of a computer operating system". By this then I would argue yes - Unity is a different interface and user experience.
The Unity website describes it as "A powerful desktop and netbook environment things brings consistency and elegance to the Ubuntu experience."
Having said this, whilst GNOME is considered a DE then Unity does not completely replace GNOME by any means - the rest of GNOME will be used by Unity, only the very top layer is changed. (In fact Unity could be quite happily used on top of KDE as well.)
Answer:
No that's not true UNITY is not a Desktop Environment.
It's just an interface.
Desktop Environment is Interface + Program Suite + UI Frame Work + HIG
Have a look at the following links,
http://unity.ubuntu.com/about/
http://www.webupd8.org/2010/05/ubuntu-1010-will-get-unity-ubuntu-light.html

Is Unity a Desktop Environment?


any known universality results of random matrices with non-independent entries?

Question: GUE, GOE, hermitian/symmetric wigner matrices, ... already known with some mild assumptions.
but is there any this kind of results without independent entries condition. thanks a lot.
Comment: as currently stated, the question reads a bit like a "fishing expedition". It might help people give useful answers if you can give some indication of what you've already seen and where you've tried looking.
Comment: I would have thought that even a little searching on this topic would have brought up some examples. For instance, hermitian matrices where the joint density function of the entries is invariant under conjugation by unitaries - doesn't this get discussed in Mehta's book and other sources?
Answer: Another example is the adjacency matrix of a random regular graph. Here the entries are $0,1$ but the row sums and column sums must all be equal. For some properties of this matrix, see
 http://arxiv.org/pdf/1011.6646.pdf
Comment: To add to this:  The largest eigenvalue is governed by the Tracy Widom distribution (GOE).  See http://arxiv.org/PS_cache/arxiv/pdf/0903/0903.4295v5.pdf
Answer: Of course there is:
For example: this paper by Lubinsky describes universality for a special class of tridiginal matrices. For example the condition off-diagonals $\equiv 1$ and entries on the diagonal are in $\ell^1(\mathbb{Z})$ would suffice. So the matrices are
$$
 H_N = \begin{pmatrix} b_1 & 1 &  \\\
 1 & b_2 & 1 & \\\
 & 1 & b_3 &1 &  \\\
 & & \ddots & \ddots & \ddots \\\
 & & & 1 & b_N \end{pmatrix}
$$
with $\sum_{n=1}^{\infty} |b_n| < \infty$.
This can be further generalized see: Avila--Last--Simon. Of course all these results are for special tridiagonal matrices (Jacobi operators).
Last, there is also the work by Deift et al. See the book.
Answer: the classic example is Dyson's circular ensemble of random unitary matrices (distributed uniformly with respect to the Haar measure); in the limit of large matrix size the correlation function of the eigenvalues tends to a universal limit.
Answer: There are results on  symmetric Gaussian matrices where  the entries are dependent but the depedencies become weaker  and weaker as  the  size of the matrix grows.
See e.g. http://arxiv.org/pdf/0707.2333.pdf and the references therein.


If $A= 2 \cdot \pi/7$ then show that $ \sec A+ \sec 2A+ \sec 4A=-4$

Question: If $A= 2 \times \pi/7$ then how to show,
$$\sec A+ \sec 2A+ \sec 4A=-4$$ I have tried using formula for $\cos 2A$ but I failed.
Answer: The equation: $\displaystyle \large \cos{4\theta} = \cos{3\theta}$
has distinct roots $\displaystyle \large \theta = 0,\frac{2\pi}{7},\frac{4\pi}{7},\frac{8\pi}{7}$
Expanding the equation into a polynomial in terms of $\displaystyle \large c = \cos{\theta}$, using multiple angle identities, the equation becomes:
$\displaystyle \large 8c^4 - 4c^3 + 3c + 1 = 0$
By inspection, or otherwise, the irreducible factorisation of the polynomial is:
$\displaystyle \large (8c^3 + 4c^2 - 4c - 1)(c-1) = 0$
We only focus on the cubic, as the linear factor provides no meaningful information to this problem.
If the roots of the cubic are $\displaystyle \large \alpha, \beta, \gamma$, the roots we are after are $\displaystyle \large \frac{1}{\alpha}, \frac{1}{\beta}, \frac{1}{\gamma}$
By simple transformation of the cubic through an invertible substitution, the polynomial equation with the desired roots is:
$\displaystyle \large c^3 + 4c^2 - 4c - 8 = 0$
Hence, by Vieta's Formulae for Sums and Products of roots, the value of the desired sum is $\displaystyle \large -4$
Comment: Very neat, @Jack Lam. I'm wondering whether one can do in the same way the corresponding result for $31=32-1$ in place of $7=8-1$.
Comment: I think the relationship is derived from the number of distinct, non-trivial roots of the generalised trigonometric equation $\displaystyle \large \cos{m\theta} = \cos{n\theta}$ for distinct $\displaystyle \large m,n$...

And of course, the exact form of said roots.....
Comment: Yes @Jack. I myself would have done it via Demoivre, which I guess the OP doesn't know, and it's reasonably easy to get (in the case here) the cubic satisfied by the three cosines without remembering any multiple angle formulas. It seemed to me that your way somehow captured the same info.
Answer: $$\frac1{\cos a}+\frac1{\cos2a}+\frac1{\cos4a}=\frac{\cos2a\cos4a+\cos a\cos4a+\cos a\cos2a}{\cos a\cos2a\cos4a}=$$
$$=\frac12\frac{\cos6a+\cos2a+\cos5a+\cos3a+\cos3a+\cos a}{\frac12\left[\cos a+\cos3a\right]\cos4a}=$$
$$2\frac{\cos a+\cos2a+2\cos3a+\cos5a+\cos6a}{\cos5a+\cos3a+\cos7a+\cos a}\;(*)$$
But $\;\cos6a=\cos a\,,\,\,\cos5a=\cos2a\,,\,\,\cos7a=1\;$ , so
$$(*)=2\frac{2\left(\cos a+\cos 2a+\cos3a\right)}{1+\cos a+\cos2a+\cos3a}\;(***)$$
And
$$\sum_{n=1}^N\cos nt=-\frac12+\frac{\sin\left(N+\frac12\right)t}{2\sin\frac t2}\implies\cos a+\cos 2a+\cos3a=-\frac12+\frac{\sin\frac72a}{2\sin\frac a2}=$$$${}$$
$$=-\frac12+\frac{0}{2\sin\frac\pi7}=-\frac12$$
so finally
$$(***)=4\frac{-\frac12}{1-\frac12}=-4$$
Comment: Can it be solved without using that summation formula? Or can you explain that part?
Comment: The easiest way to prove that summation formula is by means of Euler's Formula for complex numbers and geometric series.
Answer: $$\sec\frac{2\pi}{7}+\sec\frac{4\pi}{7}+\sec\frac{8\pi}{7}=\frac{1}{\cos\frac{2\pi}{7}}+\frac{1}{\cos\frac{4\pi}{7}}+\frac{1}{\cos\frac{8\pi}{7}}=$$
$$=\frac{\cos\frac{2\pi}{7}\cos\frac{4\pi}{7}+\cos\frac{2\pi}{7}\cos\frac{8\pi}{7}+\cos\frac{4\pi}{7}\cos\frac{8\pi}{7}}{\cos\frac{2\pi}{7}\cos\frac{4\pi}{7}\cos\frac{8\pi}{7}}=$$
$$=\frac{\cos\frac{6\pi}{7}+\cos\frac{2\pi}{7}+\cos\frac{4\pi}{7}+\cos\frac{6\pi}{7}+\cos\frac{2\pi}{7}+\cos\frac{4\pi}{7}}{2\cos\frac{2\pi}{7}\cos\frac{4\pi}{7}\cos\frac{8\pi}{7}}=$$
$$=\frac{\cos\frac{2\pi}{7}+\cos\frac{4\pi}{7}+\cos\frac{6\pi}{7}}{\cos\frac{2\pi}{7}\cos\frac{4\pi}{7}\cos\frac{8\pi}{7}}=\frac{2\sin\frac{\pi}{7}\left(\cos\frac{2\pi}{7}+\cos\frac{4\pi}{7}+\cos\frac{6\pi}{7}\right)\cdot8\cos\frac{\pi}{7}}{8\sin\frac{2\pi}{7}\cos\frac{2\pi}{7}\cos\frac{4\pi}{7}\cos\frac{8\pi}{7}}=$$
$$=\frac{\left(\sin\frac{3\pi}{7}-\sin\frac{\pi}{7}+\sin\frac{5\pi}{7}-\sin\frac{3\pi}{7}+\sin\frac{7\pi}{7}-\sin\frac{5\pi}{7}\right)\cdot8\cos\frac{\pi}{7}}{\sin\frac{16\pi}{7}}=$$
$$=\frac{-\sin\frac{\pi}{7}\cdot8\cos\frac{\pi}{7}}{\sin\frac{2\pi}{7}}=-4.$$
Done!
Comment: Hi. I'm confused about the third line how does exactly $\cos\frac{2\pi}{7}\cos\frac{8\pi}{7}=\cos\frac{4\pi}{7}+\cos\frac{6\pi}{7}$? Shouldn't be $\cos\frac{2\pi}{7}\cos\frac{8\pi}{7}=\cos\frac{10\pi}{7}+\cos\frac{6\pi}{7}$? Perhaps can you offer some clarification?
Comment: @Chris Steinbeck Bell I think you missed $2$ in the denominator. I used $\cos{x}\cos{y}=\frac{1}{2}(\cos(x+y)+\cos(x-y)).$
Comment: I missed in my earlier comment that I ommited $2$ for brevity I could notice that it was a prosthaphaeresis formula.
Comment: But I could not find a way to transform $\cos\frac{10\pi}{7}=\cos\frac{4\pi}{7}$. My best guess was that to ''obtain'' that desired angle in two adjacent quadrants for a cosine you must subtract $\pi$ from that angle. I did obtained that from obtaining the 'distance' between $\frac{3\pi}{2}$ and $\frac{10\pi}{7}$ and sum that to $\frac{\pi}{2}$ which will yield $\frac{\pi}{2}+\left(\frac{3\pi}{2}-\frac{10\pi}{7}\right)=\frac{4\pi}{2}-\frac{10\pi}{7}=\frac{28-20}{14}$. And this will become into $\frac{8\pi}{14}=\frac{4\pi}{7}$. I couldn't find an easier method though.
Comment: The method which I described above I could replicate it for the sine function but again. Does it exist an easier method?.
Comment: @Chris Steinbeck Bell I think it's better to use  the following. $\cos(\pi-x)=\cos(\pi+x).$
Answer: Let us consider $\Phi_7(x)=\frac{x^7-1}{x-1}$. It is a palyndromic polynomial, hence $\frac{\Phi_7(x)}{x^3}$ can be written as a polynomial of $x+\frac{1}{x}$. Given that $\Phi_7(x)$ vanishes at the primitive seventh roots of unity, we get a polynomial that vanishes at $\left\{\cos\frac{2\pi}{7},\cos\frac{4\pi}{7},\cos\frac{6\pi}{7}\right\}=\left\{\cos\frac{2\pi}{7},\cos\frac{4\pi}{7},\cos\frac{8\pi}{7}\right\}=A$:
$$ f(x)=8x^3+4x^2-4x-1 = 8\prod_{\zeta\in A}(x-\zeta) \tag{1}$$
from which:
$$ \frac{f'(x)}{f(x)} = \frac{d}{dx}\log f(x) =\sum_{\zeta\in A}\frac{1}{x-\zeta}\tag{2}$$
and:
$$ \sum_{\zeta\in A}\frac{1}{\zeta} = -\frac{f'(0)}{f(0)} = -\frac{-4}{-1} = \color{red}{-4} \tag{3}$$
as wanted.
Answer: First of all we can write your equation as $$1/cosA + 1/cos2A + 1/ cos4A$$
Using basic mathematics we can write $$\frac{cosA cos2A + cos2A cos 4A + cos4A cosA}{cosAcos2Acos4A}$$ We will further try to tackle with the denominator using the trig identity $$cosA \cdot cos2A \cdot cos4A \cdot......cos2^{n-1}A = \frac{sin(2^nA)}{2^n(sinA)}$$ which in your case becomes $$\Rightarrow \frac{sin(2^3A)}{2^3(sinA)}$$ $$\rightarrow \frac{sin(16 \pi/7 )}{2^3(sin2\pi/7)}$$
We can further write $sin(16 \pi/7)=sin(2 \pi+ 2\pi/7)=sin2\pi/7$
Thus finally $$\rightarrow \frac{sin(16 \pi/7 )}{2^3(sin2\pi/7)}= 1/8$$
Again rewriting your function $$8(cosA cos2A + cos2A cos 4A + cos4A cosA)$$
Factioring out "4"  we can write $$4(2cosA cos2A + 2cos2A cos 4A + 2cos4A cosA)$$
Now you must be aware of the product-sum trig identity$$2cosx \cdot cosy=cos(x+y)+cos(x-y)$$
Similary writing our expression through this idenitity can yield
$$4(cos3A + cos A+ cos6 A+ cos 2A+ cos 5A+ cos3 A)$$
Rewriting them with the value of $A$
$$4(cos6 \pi /7 + cos 2\pi /7+ cos12 \pi /7 + cos 4\pi /7+ cos 10\pi /7+ cos6 \pi /7)$$
Now see we can have complete symmetry up here if one of the $cos6\pi /7 $ 's is replaced by $cos8\pi /7$ and fortunnately we have $$cos(\pi -\pi /7)=-cos(\pi /7)=cos(\pi +\pi /7)$$
Thus our expression becomes
$$4(cos 2\pi /7+cos 4\pi /7+cos6 \pi /7 +cos 8\pi /7 +cos 10\pi /7+cos12 \pi /7)$$
Now comes the role of another trig identity
$$\cos(\alpha) + \cos(\alpha + \beta) + \cos(\alpha + 2\beta) + \dots + \cos[\alpha + (n-1)\beta] = \frac{\cos(\alpha + \frac{n-1}{2}\beta) \cdot \sin\frac{n\beta}{2}}{\sin\frac{\beta}{2}}$$
Realize the fact that here $\alpha = 2 \pi/7$ and $\beta$ also corresponds to the same value. You have $n=6$
I hope you can complete this last step, just put in values and don't forget to cancel the sines in denominator and numerator by correctly changing the angles as sum or difference from $\pi$.
Comment: Write \cos x , \sin x  so that the names of the trigonometric functions will appear nicely.


How to best optimize an Oracle database for writes?

Question: How can I maximize the write performance without impacting reads?
Answer: From a don't-want-to-touch-the-config POV - check your indexes. if you are writing to tables that are heavily indexed, remember that each time you write a row, the indexes are being changed. Fewer indexes, less physical IO.
This will - obviously - have an impact on reads.
If you have the time & capacity, I have found separating commonly written tables into specific tablespaces and making sure that/those tablespaces are stored on a separate RAID channel also helps, but this depends on the hardware you are using and adds a bunch of other considerations.
If you really do have time to ponder this, then buy & read Cary Millsaps 'Optimizing Oracle Performance' - it's dated (all depending on what version of oracle you are using) but a classic.
Answer: A good start is to follow Oracle's SAME methodology - Stripe and Mirror Everything. This gives you a good base from which you can add further more specific improvements.
The SAME methodology is in the following PDF:
http://www.oracle.com/technology/deploy/availability/pdf/oow2000_sane.pdf
There's a good discussion on Ask Tom:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4433784236146
One of the main drivers for SAME is the ease of administration. It passes on a lot of the performance considerations to the OS and the underlying storage layer. The idea is that your tablespace files are already spread across a zillion disks in the storage array so any fiddling around you do on top of this doesn't help much. However, as ever, the devil's in the detail. It's tempting to treat the storage layer as a black box but you really do need to understand what's going on and know what sits under each of your tablespace files.
Answer: Set it up in a cluster and have your applications point to a specific node for writes; then read from the cluster itself.
Answer: Implementing SAME - Striping And Mirroring Everything as suggested in a previous answer - is a good default strategy.  In particular if you are concerned about write performance avoids RAID5 at all costs - it creates a 4x write overhead while maintaining parity information. A RAID5 array with a large memory cache might hide that overhead for a while, but for prolonged writes the RAID 5 penalty will eventually be felt.
There's a lot of things to consider in optimizing write IO, but here are a few more things to consider:

Make sure there are enough disk devices in the stripe to support the IO rate.  You need to place enough disks in the stripe to support the total IOs per second required, not just the number of GB to be stored.    Disk provide better response time when only partly full of data – the outer parts of the disk can deliver data faster than the inner parts.  So in general you want to have sparsely populated disks in your stripe.
It's better to avoid IO than to optimize IO. The biggest source of avoidable write IO is temporary segment IO for sorts and hash operations.  Correctly sizing the PGA Aggregate Target is the best way to avoid this.
Make sure all your indexes are serving a valid purpose - to speed up a query or to enforce primary or foreign keys.  Index maintenance is often the biggest source of write IO, so don't have any superfluous indexes.
Create large and numerous redo logs.  This helps avoid log switch overhead and database stalls that can occur when logs cycle before data file checkpoints complete.  You might also want to put your redo logs on dedicated devices or a dedicated finely grained stripe.
Use asynchronous IO.  If your datafiles are on file systems (e.g. not RAW or ASM) then set FILESYSTEMIO_OPTIONS to AYNCH or SETALL.  SETALL implements direct IO as well as async IO which usually helps writes but may slow down reads.
If you are prepared to take a risk with your COMMITs, you can change COMMIT_WRITE (10g) or COMMIT_WAIT and COMMIT_LOGGING to delay or batch the IO that occurs when you issue a commit.  Make sure you understand the implications, though; you could lose some transactions in the event of a database failure if you do this.
If you have access to the application code, make sure that array inserts are being used and - maybe – use direct path inserts using the APPEND hint.


How to cache images in GeckoFX

Question: I use GeckoFX to render some web application's GUI. There are many repetitive small 16x16 images here and there injected into single HTML page by javascript.
All these IMG instances are downloaded one by one from the web server and I couldn't optimize this behavior using cache-control or expires headers or by using javascript Image(). So rendering is ultra slow and dirty comparing to Chrome or IE.
How can I make GeckoFX to cache or preload a couple of small images?
Answer: It's done by replacing all images with spans. Those spans are now using css classes with background-image and floating.

How to cache images in GeckoFX


How does Blowfish avoid successful cryptanalysis?

Question: I have researched the Blowfish algorithm and am curious as to why there  exists no effective cryptanalysis for this algorithm as of yet. What basic principles or features allow Blowfish to achieve this?
Comment: What do you mean with "effective cryptoanalysis"? You mean why it hasn't been broken? There has certainly been cryptoanalysis on Blowfish, and there seem to be results that make it less suitable for specific solutions. Nowadays you should try and use 128 bit or higher block ciphers.
Comment: The blowfish key schedule is quite computation intensive (compared to other block ciphers). That might make it stronger than other ciphers with similar key and block size. But the block size of blowfish is too small for most usages today.
Comment: thank you for answering i appreciate it, [this paper](https://drive.google.com/file/d/0B_bJ726OySNuVXBHRWhabG5kdnc/edit?usp=sharing) was what brought me to the question. All the proposed attacks in Section 3, "Cryptanalysis of Blowfish" never use the full 16 rounds. what part of the architecture prevents this?
Comment: @owlstead: Can you give reference? I am not aware of attacks on the Blowfish algorithm (rather than: implementations thereof) which would represent a sizable threat in any semi-realistic use case. For example, I can't imagine an attacker exploiting Orhun Kara and Cevat Manap's [_A New Class of Weak Keys for Blowfish_](http://link.springer.com/chapter/10.1007%2F978-3-540-74619-5_11) (in proceedings of FSE 2007). I'm rather on the impression that Blowfish is a rather fine cipher except for having a 64-bit block, lack of key agility, relatively high RAM usage, and significant hardware footprint.
Comment: @fgrieu No I did assume a bit too much there in relation to the the weak keys...
Answer: The same way other ciphers, basically, only it does it better than some. From the Blowfish paper these were the relevant building blocks "demonstrated to produce strong ciphers" in previous designs:

"Large S-boxes. Larger S-boxes are more resistant to differential cryptanalysis."
"Key-dependent S-boxes. While fixed S-boxes must be designed to be resistant to differential and linear cryptanalysis, key-dependent S-boxes are much more resistant to these attacks."
"Combining operations from different algebraic groups." (Blowfish uses XOR and  addition modulo $2^{32}$.)
"Key-dependent permutations. The fixed initial and final permutations of DES have been long regarded as cryptographically worthless."

The basic structure is a Feistel network, which has also been shown to produce secure ciphers provided the round function is good.
Of course, it's not a perfect cipher. For one, its 64-bit block size puts some restrictions on how we can use it securely. Its key setup is rather slow. There's also a class of weak keys for up to 14/16 rounds, which is quite close even if it allows no attacks. Schneier himself has been quoted as recommending people move to e.g. Twofish instead.


Degrees of subvarieties of projective space

Question: I've always thought of the degree of a subvariety of projective space as the degree of the divisor that defines the (given) embedding into projective space. It's been pointed out to me that this works only for curves. Now I'm confused: is there a similar characterization of the degree of a general subvariety of some projective space?
Comment: Maybe the reason for your confusion is that on a curve the degree of a divisor is intrinsically defined, whereas in general the notion of degree of a divisor depends on the projective embedding of the variety.  Nevertheless, as Allen says below, the relationship still holds in higher dimensions.
Answer: If $X\subset \mathbb P^n$ is a subvariety of dimension $m$ embedded by a linear system $V \subset H^0(X,\mathcal O_X(D))$ then the degree of $X$ is equal to $D^m$.
Comment: To elaborate on jvp's point slightly, you can't even define the degree of a divisor on a variety that isn't a curve.  On a curve, you count the points.  But what about on a surface? You would need the degrees of curves, which are less obvious.  However, the self-intersection of a curve is well defined and gives the right answer.
Answer: See the section about intersection of chapter I of hartshorne.  Intuitively degree is the number of intersection of the dimension r subvariety and the GENERIC dimension n-r linear subspace if they are both in P^n.  A rigorous definition was given in that section by the leading coefficient of the Hilbert polynomial.
Answer: I disagree with "this works only for curves". Say we've already defined degree for schemes up to dimension $n$. Then use your rule to define it for schemes of dimension $n+1$. Dr. "This works only for curves" is unwilling to go beyond the $n=0$ case, for some reason.


Jquery Supersized 3.1 captions

Question: I'm using the jquery Supersized 3.1.3 plugin, which all works well, and I was wondering if it was possible to add html to the images' title attribute/slide captions? The code snippet below includes html in the title - found on a featured site - but I'm not sure how to re-encode it in the slidecaption div as html. Any help greatly appreciated, S.
The code (partial) which defines the image/s:
slides  :   [       //Slideshow Images
            {
            image : 'images/temp-image.jpg',
            title : '<a href=/About/News/International_Innovation.aspx><h4>Building Bridges for International Innovation</h4> <p>Does studying art and design translate into creative business practices?  RISD + Morisawa team up to find out. </a></p>',
            url : 'http://www.nonsensesociety.com/2011/02/larissa/'
            }
        ]

The slide captions are displayed in the following div:

Comment: Have you tried putting it in as straight HTML?
Comment: Doh! Am going to delete this question! Many thanks for your help, s.
Comment: No, don't delete!  Let me add this as an answer! ;-)
Answer: It should work if you use regular HTML in the title:.

Jquery Supersized 3.1 captions


How to get to level 200 as a Bowmaster in Maplestory?

Question: I have a Bowmaster level 120 and I am trying to figure out the best ways to train my bowmaster so that he can become level 200, lately PQs are not doing it for me and I know quest can be long and tiresome is there another way I only have 1 1/2 hours to play a day!
Comment: "1 1/2 hours to play a day!" be prepared to either spend alot of money on 2x cards. also, knowing your _current level_ would help, and level of funding I suppose.
Comment: You said either but didn't write my other option... My character is level 120 and my budget would probably be about $40 a week @KevinL
Answer: The easiest way would be to delete it & wait for a burning event & create a new character, which will level 3 times as fast - plus, you get the Frozen equips set which should last you until 5th job.
If you don't want to do that, then Monster Park is the way to go. I generally use it from about level 120 to 180 or more. With 2 free runs a day, you can expect to average one level a day (more at level 120, fewer at higher levels).
Don't forget x2 - events in weekends, reward for Inferno Wold Den, Fairy brothers (+ Spirit Pendant), even cash shop if you are willing to pay.
Plus, the quickest way to get your Bowmaster to 200 might actually be to ignore it for  a while & burn a Mercedes for the Link Skill. It can give any other character +10/15/20% EXP at level 70/120/210. It's easy to burn one to level 150 in a full day, 190/200 in a week, but might tale a month to get to 210. However, you can give the link skill to another character & can change which one you give it o.
Comment: OP asked 7 years ago and hasn't signed on since the day after they asked. I highly doubt they will return to let you know how it goes. Who knows if they even still play Maple Story...
Comment: Yes (+1), I noticed that after I posted. Still, we know how it turns out for me, if not for him. And, since I am a casual player, this is prolly how it would turn out for most people  these days. Two days to get to level 200 (some people do it in one). Maple has changed a ***looooot*** in 7 years :-/
Comment: We are currently having the Neo event, with Tera Burning, which is 3 levels for every 1 until level 200. I made a Bowmaster in two days, for the great combination of link skill & legion skill. The event is still running, and will have two episodes where you can x3 burn 2 chars until 150 and 1 until 200. That's lot of great link & legion skills. If you don't aim for 210, then stop at 140 (120 for link, 140 for legion, with the next stops at 210 & 200). Please let us know how it tuns out.


In Drupal, I want to have two (or more) views_embed_view on a page

Question: I have a view that will display the four most recent blog posts from a blog using views_embed_view and an argument. I've also specified the theme info. In a block I am using:
print views_embed_view('NAME', 'DISPLAY', 'ARG');

In my case, using ('blog_view', 'default', 'Blog 1'). I would like to embed this a second time, replacing Blog 1 with Blog 2.
Blog 1 displays perfectly (first node has title and description, next three are a list of the node titles). When I display Blog 2, all it does is display the title linking to the node (for all four, not using any styling defined in the template file).
Can I display two views using views_embed_view? Is there another way?
Answer: Another way would be to create two separate block views and place those blocks in the page itself.


Approval process - action

Question: Currently Approve/ Reject actions are available in approval process. We have a requirement where user wants another option, like Escalate. Is it possible to add custom actions to approval process? if not is there any workaround for this?
Answer: How do you want Escalate to be implemented? If you're asking to override the standard Approve/Reject options, as far as I know that's not possible - however, you can create Approval Actions through the basic UI and associate them with steps in the Approval Processe, but it's limited to things like field updates (which could meet your requirement), Task creation, etc. Go to the Approval Process and select Add New action.
See more here.
Approvals are also exposed via Apex, so if you wanted Escalate to be implemented in a different way, it would certainly be achievable.
Comment: Thanks Brian..    Escalate should directly assign it to another user.  Add New action, adds action within approve/reject  process. My requirement is to add one more option along with approve/reject.
Answer: Out of box it is currently not possible and here is the link to the idea.Please vote for it.
Comment: Its a must option!!  Anyways now I voted for the idea..

Approval process - action


Can we stack the strong learners?

Question: Stacking is done with combining all the weak learners. What will happen if we do it with strong learners? A case of overfitting?
Comment: No, stacking is typically done with strong learners.  Bagging or boosting is usually done with weak learners.
Answer: You can combine any models and usually it will improve the quality of the predictions (this is done by most of the teams winning the Kaggle competitions). By combining multiple models you wouldn't rather make the solution prone to overfitting, since you will be using the joint oppinion of different models, you will benefit from the wisdom of the crowds. Different models will have, more or less, different oppinions on different cases and and they will be "averaged out". The idea of stacking weak learners is that weak learners are fast to learn, so you can easily train huge amounts of such models. It appears that a huge crowd of weak learners works remarkedly well and good enough not to waste resources on combining the computationally demanding models.

Can we stack the strong learners?


how do I build a 7 to 9 inch high water dam?

Question: how do I build a 7 to 9 inch high water dam? In wet weather, water gets into my house. I need to create a berm of earth that will be grass covered, and it should also have a water barrier to keep the soil from washing away. How can I build such a dam? It will be about 40 feet long.
Comment: What happens when rain collets on the other side of the berm?  Usually the solution to this problem is proper grading and water runoff management - eaves, etc.
Comment: Instead of a berm, you likely want a ditch to direct the water away. Consider a surface drainage system or a french drain (covered in gravel).
Comment: Damming it up just means a larger volume of water to do damage when the next bigger storm comes along.
Answer: If you need help with gardening-related tasks, you probably want to ask on Gardening & Landscaping Stack Exchange.
The answer to your question is to not build a dam, but instead prevent this scenario from occurring.  Probably the biggest issue I can think of with a dam is water on the wrong side of it - you've essentially built a mini-pool against your foundation and this will just make the problem worse.
Grading
The ground surface around your house should be sloped away from the foundation. If this is not the case, you can build as large of a dam as you want and water will eventually find its way in.  If you go look at a new development, you will see that all of the lots slope towards each other and in the middle there is low point that serves as a drainage path that will lead towards the street in order to direct rainwater away.
Runoff Management
There are a couple things you can do here.  The first and probably most important is to make sure that your gutters are free of debris and properly collect water from your roof.  When it rains, is there a sheet of water pouring down from your roof? This is a sure sign that your gutters are blocked. Assuming your gutters are not blocked, you need to identify where they discharge water to.  In older homes, the gutter downspouts might be hooked directly to a storm sewer, but in newer areas they will usually discharge water on your property.  You should ensure that they discharge water far enough way from your foundation. If they do not, you can add an extension to satisfy this.  This also relates to grading as I discussed above.
If this alone does not solve the problem you might consider a drainage cannel to direct the water away from your house. This might be as simple as a gravel-filled trench, or a bit more elaborate with  an embedded drain tile (pipe with holes in it), wrapped with landscaping fabric (to keep dirt and debris out) that is in a gravel filled ditch.  A gravel-only ditch might eventually clog up from roots and debris.  Of course you need to ensure that the slope of this ditch is away from your foundation.
A ditch will probably be required if you have either highly compacted soil or soil with a high clay content that doesn't readily absorb water.  If water pools on your lot with light rain, this might be the case.
Comment: Are you using the terms "eaves" and "gutters" interchangeably? In the USA "gutters" are the channels that collect runoff water and "eaves" are the portion of a roof that overhangs the exterior wall.
Comment: @HenryJackson yes I was, I've updated the answer to use gutters only.


Interruption of stay in Germany with EU Blue card

Question: I have a query regarding validity of blue card inspite of a period of absence from Germany. Due to a medical emergency I have to stay in India for next 6 7 months. Will my blue card remain valid if I leave my employment and deregister from the city? I emailed foreign office they replied it is valid for 1 year even if I am outside EU, but under conditions. I am not sure about the condition part. If anyone can shed light on the matter, it would be great. Thanks in advance.
Comment: @Debaditya Roy what happened next ?
Comment: Well my company deputed me to India allowing me to keep the job. I am earning an d paying my taxes in Germany by signing an Indo German social security agreement, that was procured by the insurance firm on discussion with my company.
Answer: The foriegn office is quoting §51 (10) (1) AufenthG: 12 months

which overrides §51 (1) (7) AufenthG : 6 months

this goes on to say, any longer period must be cleared with the local Arbeitsamt.
(This is the only other condition in that paragraph, so I assume that is what they mean)
To be save, report the situation to the Arbeitsamt (case manager Sachbearbeiter) and in case of any delays inform them of the delay which they should confirm in writing.


If everyone uses replicator, why do tailors still exist?

Question: In Star Trek, Starfleet uniforms and other clothing is made by replicator patterns. Not only does this suggest a standard pattern as well as standard sizing considering the variety of body types that we see. So why are tailors like Garak even a thing? What can Garak do that a replicator can't?
Comment: Maybe it's less effort to have a tailor do slight alterations to an individual's whims and preferences than to try and program all possible permutations that differ from the standard sizing algorithm?
Comment: @amaranth Garek worked in days, not minutes.
Answer: Tailors exist in Star Trek for the same reason tailors exist in real life.
Both replicated clothing and real world clothing are made from patterns. Bodies, however, are not made from patterns.1
Custom tailored clothing is more comfortable because it's adjusted to fit the individual. It can be designed in such a way as to minimize or enhance the appearance of certain physical traits - a well tailored suit can make a person look slimmer and more fit. Clothing based on patterns has to make assumptions about the wearer's shape that custom-tailored garments do not.
There's also a certain amount of prestige in owning custom tailored items - they're custom after all, that means more time, money, or expertise went into making them.
Garak appears to do most of his work by hand, cutting and sewing raw cloth. It is entirely possible that some "tailors" work digitally, taking a scan of the customer and using that to rework the baseline replicator pattern to something more suited to the specific customer.
1Transporter "patterns" don't count. They're made uniquely each time and only used once.
Comment: Why can't Star Trek replicators scan individual bodies for perfect fit like Transmetroplitan makers do?
Comment: @2540625 Body shape isn't really constant across the day, and it can change enough that "perfect fit" isn't really a thing; something that fits perfectly in the morning won't fit perfectly by evening. Having a little slack in clothing is a good thing for that reason.

Also replicators are just fancy transporters with prerecorded patterns, modifying a pattern on the fly like that would probably be pretty complicated.
Answer: First, if you have watched Deep Space Nine thoroughly, you know that Garak is much more than a simple tailor.
But that said, you are right: In theory, you can program a replicator to make the exact clothing you want. But as some people prefer "real" food over replicator products, some people probably want real clothing made from real cloth. The reasons for this often are subjective and irrational.
I also presume that a lot of people lack the replicator programming skills to make clothing as convenient as a professional tailor could do. This brings to mind the Star Trek Voyager episode "Shattered", in which Kathryn Janeway failed to program her replicator to make a proper pot roast.
Tailors usually also have a sense for contemporary fashion, which replicators don't.
And maybe there are some rare fabrics which just cannot be replicated for technical reasons, so you would need a tailor to acquire and process them.

The following is non-canon, but it looks like the producers of DS9 assumed that the dilemma tailor vs. replicator isn't completely solved in the 24th century:

A deleted part of dialogue from the episode "Move Along Home" says
  that Bashir wanted Garak to make him a new dress uniform. Dax
  responded that a replicator would be better than a Cardassian tailor.

Source: Memory Alpha
Comment: I'm kind of glad that dialog was deleted, it is either racist or dismissive of personal skill, neither of which suits Dax's personality.
Comment: @T.J.L.: Dax is pretty blunt at times; if replicators actually produce better (as in more consistent and possibly more durable) results, I could see her recommending a replicator over a tailor. As for "a Cardassian tailor", that's the one species I could see her denigrating like that due to the ongoing animosity between the Federation and Cardassia, or, since we don't know the context, the intent could have been to emphasize "a Cardassian *tailor*" to emphasize sarcastically the fact that virtually all Federation officers believed he was a spy for the Cardassians, not really a tailor.
Answer: It's likely that the replicators can produce perfectly fitting clothes for anyone. We have seen in Star Trek that people tend to have few personal possessions, probably because most things they need can be replicated at zero cost, or at lower cost than transporting their stuff around.
The thing they do keep tend to have personal meaning and sentimental value. They are antiques or gifts, things which can be copied exactly but which they wish to keep the original of.
Tailors can repair and adjust clothing that a person may wish to keep, rather than replacing.


When does a keli not require immersion?

Question: So I have been told on a few occasions that a keli that can hold a certain large amount of water does not require immersion before use. What is the minimal amount in gallons that would make t'vila unnecessary?
Comment: I've never heard of such a rule.
Answer: What you were told on many occasions is incorrect.
The Binas Adam (85/66) says specifically that holding a large amount such as 40 sa'ah is not a good reason to negate the need for tevila. (There is a discussion there concerning vessels which are attached to the ground.)
The Chachmas Adam there (klal 73:13) is discussing large vessels and he rules they should get tevila.
His words are brought in the first Pischei Teshuva in Yoreh Deah siman 120.
The limud zchus for people who did not immerse the beer vats, which were the center of the discussion, was to assume the opinion that since there was still much prep needed to make the beer drinkable after removing the beer from the vats, tevila was not needed. But the preferable option is to drill a hole in the vat to make it unusable and have a Jewish person fix it.
Comment: when you say beer vats what does that mean? Are we talking about the vessels in which the liquid that becomes beer(the wort) is heated in, the fermenting vessels, or both?
Comment: He didn't specify but since he mentioned boiling, I'm assuming he is talking about boiling the wort for two reasons. Fermentation is not done at a boiling temperature and by the time it's fermented it's not missing any large process in order to drink.
Comment: I don't see boiling in the answer, fermentation is done in cold temperatures with a few exceptions but even then doesn't go above 80 df, after fermentation the beer still goes through additional changes when it is either bottled or kegged. The final product that is drunk is often very different from how it is coming out of the fermenter.  The primary cause for this being a resting period in which the beer conditions in the bottles or kegs.
Comment: also if a change in the vessel is all that is needed. wouldn't attaching the valves , sight glass and other connections for transferring wort and hot water be sufficient?
Comment: I didn't mention boiling in the answer as that wasn't the main point. See the link to Chayei Adam provided. The change after fermentation is not a BIG change. It doesn't change it from inedible to edible. Attaching any piece which plugs up a hole which if left open would render the device useless would suffice.

When does a keli not require immersion?


Transfer WhatsApp chat from iOS to Android

Question: I want to transfer my WhatsApp chats from my iPhone 6 with iOS 8.4 to my new Samsung Galaxy S6e, is there an easy way to do that?
Answer: As far as I am aware, as the iOS system has a built-in restriction that stops one accessing its filesystem, you cannot get access to the conversation history backup files.
Even if you managed to obtain read/write access through a jailbreak of some sort, the iOS messages dump might not even be of a compatible format to be displayed on Android.
In short, there is no easy/safe way to transfer your WhatsApp conversation history between iOS and Android. Android to Android, however, is a different matter.


How can I manually copy over files like LXDE and other apps?

Question: I have a really old laptop which I have recently installed Lucid 10.04.4 Server on because it would not support newer versions. Instead of an ethernet cable it has an internal modem with a phone line connection on the outside. It was designed for Windows 98! I cannot work out how to fix my wifi adaptor in terminal. I really want to have a desktop enviroment or at least a window manager with which to manually launch my apps on. How can I carry over files from my internet connected ubuntu 13.10 laptop to this old one and get them working?
Thanks for ur help!
Answer: Download, burn and install Lubuntu from an alternate install disk. You will find all the information needed here: https://help.ubuntu.com/community/Lubuntu/Alternate_ISO
Answer: I have found that you can simply carry over the .deb files on a usb and use dpkg -i to install them. This worked perfectly for me!


What is the difference between UTF-8 and ISO-8859-1?

Question: What is the difference between UTF-8 and ISO-8859-1?
Answer: UTF-8 is a multibyte encoding that can represent any Unicode character. ISO 8859-1 is a single-byte encoding that can represent the first 256 Unicode characters. Both encode ASCII exactly the same way.
Comment: One thing to note that ASCII extends from 0 to 127 only. The MSB is always 0.
Comment: @RohanBhale Don't use the phrase Extended ASCII; it'll only cause confusion.
Comment: When code points above 127 are defined, the encoding system is a version of Extended ASCII.
Comment: But extended ascii might be the correct term. I read it on multiple resources
Comment: I always heard it as *High ASCII*.
Comment: In over 30 years of MsDos, windows, *nix, and the internet I've never heard "high" ASCII ever mentioned. Its always been "Extended ASCII"
Answer: Wikipedia explains both reasonably well: UTF-8 vs Latin-1 (ISO-8859-1). Former is a variable-length encoding, latter single-byte fixed length encoding.
Latin-1 encodes just the first 256 code points of the Unicode character set, whereas UTF-8 can be used to encode all code points. At physical encoding level, only codepoints 0 - 127 get encoded identically; code points 128 - 255 differ by becoming 2-byte sequence with UTF-8 whereas they are single bytes with Latin-1.
Comment: Your clarification works for me and "ambiguous" would have been a better word choice than "incorrect".
Comment: @mu maybe my statement was ambiguous, but it is not incorrect -- I was not talking about encoded byte sequences, but rather character sets being encoded; meaning that ISO-8859-1 is used to encode first 256 code points of the Unicode character set.
Answer: UTF
UTF is a family of multi-byte encoding schemes that can represent Unicode code points which can be representative of up to 2^31 [roughly 2 billion] characters. UTF-8 is a flexible encoding system that uses between 1 and 4 bytes to represent the first 2^21 [roughly 2 million] code points.
Long story short: any character with a code point/ordinal representation below 127, aka 7-bit-safe ASCII is represented by the same 1-byte sequence as most other single-byte encodings. Any character with a code point above 127 is represented by a sequence of two or more bytes, with the particulars of the encoding best explained here.
ISO-8859
ISO-8859 is a family of single-byte encoding schemes used to represent alphabets that can be represented within the range of 127 to 255. These various alphabets are defined as "parts" in the format ISO-8859-n, the most familiar of these likely being ISO-8859-1 aka 'Latin-1'. As with UTF-8, 7-bit-safe ASCII remains unaffected regardless of the encoding family used.
The drawback to this encoding scheme is its inability to accommodate languages comprised of more than 128 symbols, or to safely display more than one family of symbols at one time. As well, ISO-8859 encodings have fallen out of favor with the rise of UTF. The ISO "Working Group" in charge of it having disbanded in 2004, leaving maintenance up to its parent subcommittee.
Windows Code Pages
It's worth mentioning that Microsoft also maintains a set of character encodings with limited compatibility with ISO-8859, usually denoted as "cp####". MS seems to have a push to move their recent product releases to using Unicode in one form or another, but for legacy and/or interoperability reasons you're still likely to run into them.
For example, cp1252 is a superset of the ISO-8859-1, containing additional printable characters in the 0x80-0x9F range, notably the Euro symbol € and the much maligned "smart quotes" "". This frequently leads to a mismatch where 8859-1 can be displayed as 1252 perfectly fine, and 1252 may seem to display fine as 8859-1, but will misbehave when one of those extra symbols shows up.
Aside from cp1252, the Turkish cp1254 is a similar superset of ISO-8859-9, but all other Windows Code Pages have at least some fundamental conflicts, if not differing entirely from their 8859 equivalent.
Comment: +1 for answering the question but going beyond and offering info about related encodings. Re: code points for UTF-8, according to https://stackoverflow.com/a/38488358/3353984, UTF-8 supports 2^21 code points. Is that an error, or might a fix be needed here?
Comment: Unicode is actually 17 planes of 2^16 code points. 0x00_0000 to 0x1F_FFFF. The 17 planes can accommodate 1,114,112 code points. Of these, 2,048 are surrogates, 66 are non-characters, and 137,468 are reserved for private use, leaving 974,530 for public assignment.about 1 million. See [How many characters can UTF-8 encode?](https://stackoverflow.com/a/45042566/5535245).
Answer:
ASCII: 7 bits. 128 code points.
ISO-8859-1: 8 bits. 256 code points.
UTF-8: 8-32 bits (1-4 bytes). 1,112,064 code points.

Both ISO-8859-1 and UTF-8 are backwards compatible with ASCII, but UTF-8 is not backwards compatible with ISO-8859-1:
#!/usr/bin/env python3

c = chr(0xa9)
print(c)
print(c.encode('utf-8'))
print(c.encode('iso-8859-1'))

Output:
©
b'\xc2\xa9'
b'\xa9'

Answer: ISO-8859-1 is a legacy standards from back in 1980s. It can only represent 256 characters so only suitable for some languages in western world. Even for many supported languages, some characters are missing. If you create a text file in this encoding and try copy/paste some Chinese characters, you will see weird results. So in other words, don't use it. Unicode has taken over the world and UTF-8 is pretty much the standards these days unless you have some legacy reasons (like HTTP headers which needs to compatible with everything).
Comment: Umlaut's are represented as two characters in utf8.   They convert fine and work well.

The problem comes from programs that expect 1 byte per character.   For these legacy programs, ISO-8859-1 has 1-byte umlaut's.
Comment: "So in other words, don't use it." I wouldn's say so, because there are use cases where ISO-8859-1 suits much better then UTF-8 because single byte and 256 chars can be sufficient, resulting in faster processing and less payload.
Comment: I had seen where Umlaut's are not supposedly converted with UTF8.  We saw examples of this and in searching we found the ISO-8859-1 and it seems to work.  We have a lot of German Scientist we work with.
Comment: Just as an example of where single byte encoding is preferred, SMS messages have a limit of 140 bytes and primarily use single-byte encoding. If you were a business that sends automated SMS messages, you don't want to double your cost just to not use a legacy standard.
Comment: @CalebMcNevin Unless you're sending t̸̡̧̢̬̼͈̯̰͎̫̯̖̻͎͖̱͉̠̟̪͈͓̫̥͉̞̠̠̮͎͒́ḣ̶̡̢̢̛͍͖̺̘̫̻͚̦͚̯̬͖̗̫̗̄̚ͅí̷͕̪̤͊̀̀͌̅́̄̈́̅̈́̊͂̓͂̇͐͒̈́̀̕s̶̛͕̹̞̦͔͚̠̟͈̳͇̪̓̒̀̋̎̒͌̋̀̍̊̿̄͛̿͛͂̌̐̕͜ or čřž it would still be 1 byte per character in UTF-8.
Comment: @OleMorud Actually it's easier than you'd think. At my last job my manager would write sms message templates in word, and send them to us like that. Some strange stuff would happen, like with quotation marks - Word is "smart" and uses a different character than the default. " & " instead of ", very hard to spot. Literally doubled the cost for the first run when we copy pasted directly. We had to make a whole process to clean all the weird Word idiosyncrocies out of the text.
Answer: One more important thing to realise: if you see iso-8859-1, it probably refers to Windows-1252 rather than ISO/IEC 8859-1. They differ in the range 0x80–0x9F, where ISO 8859-1 has the C1 control codes, and Windows-1252 has useful visible characters instead.
For example, ISO 8859-1 has 0x85 as a control character (in Unicode, U+0085, ``), while Windows-1252 has a horizontal ellipsis (in Unicode, U+2026 HORIZONTAL ELLIPSIS, …).
The WHATWG Encoding spec (as used by HTML) expressly declares iso-8859-1 to be a label for windows-1252, and web browsers do not support ISO 8859-1 in any way: the HTML spec says that all encodings in the Encoding spec must be supported, and no more.
Also of interest, HTML numeric character references essentially use Windows-1252 for 8-bit values rather than Unicode code points; per https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state, … will produce U+2026 rather than U+0085.
Answer: From another perspective, files that both unicode and ascii encodings fail to read because they have a byte 0xc0 in them, seem to get read by iso-8859-1 properly. The caveat is that the file shouldn't have unicode characters in it of course.
Answer: My reason for researching this question was from the perspective, is in what way are they compatible. Latin1 charset (iso-8859) is 100% compatible to be stored in a utf8 datastore. All ascii & extended-ascii chars will be stored as single-byte.
Going the other way, from utf8 to Latin1 charset may or may not work. If there are any 2-byte chars (chars beyond extended-ascii 255) they will not store in a Latin1 datastore.
Comment: Latin-1, or iso-8859-1 is not 100% compatible to be stored in utf8.  Any Latin-n or iso-8859-n character above 127 will not be translated to a single byte utf-8 character.  However, for values 1-127, they will translate exactly.
Comment: This answer is a bit confusing in its use of the term "extended ascii", which just is a term to refer to any character encoding that is not ASCII. UTF-8 and latin-1 are examples of extended-ASCII encodings. But, non-ascii latin-1 characters (ie. code points above 127) cannot be encoded as a single byte in UTF-8.
Comment: Helpful, but I think you meant 127 instead of 255 in extended-ascii 255?
Comment: In UTF-8 2 byte encodings begin at 128.  However there are matching characters in both, so it is possible to go: ISO 8859-1 -> UTF-8 -> ISO 8859-1 losslessly but if there are any characters in a UTF-8 document greater than 255 then it cannot be converted losslessly.


Build-time GLSL syntax validation

Question: Is there a way to validate GLSL syntax build-time instead of run-time? My application takes a long time to start and I want to know at the earliest possible stage that my shaders are ok. I'm using Visual Studio/Xcode. The solution probably involves running a tool as a part of build process, but I'm looking for such a tool.
Answer: NVIDIA's Cg Toolkit should be able to compile (or translate) shaders offline and spit errors. Another option is to create a tiny executable yourself that takes in a shader file and tries to compile it with your GPU driver's compiler (or perhaps such a compiler is already provided for you by the vendor). Though I think at least in the latter cases many compilers are too forgiving to catch all errors.
Related question:
Multiplatform GLSL shader validator?
Comment: Writing your own command line EXE to test during the build process is a great idea.
Answer: This is a pretty late reply, but some new options have shown up recently to address this.
Khronos released a reference compiler called glslangValidator that can perform syntax validation (and more) on GLSL shader files.  If there are any issues with your shader, it will print them out with line number information.
You can set up a custom pre build step or the like in Visual Studio or XCode to run this tool on your shader files.
I also wrote a Property Sheet for Visual Studio that makes use of glslangValidator to do build time validation of shader files. You can find it here.

Build-time GLSL syntax validation


Solving computing time problem when grid size element increases in flood model?

Question: I want to create high resolution and high accuracy "area of inundation" map using FLO-2D Model. I have high resolution Digital Elevation Model (DEM) and I must show small topographic details on my maps. To avoid the loss of these details, I need to use small grid size nearly 30 centimeters. If I select small grid size, grid number increases. So, my insufficient computer doesn't solve numerical schema of flood/rainfall modelling.
Do I divide study area some segments?
Or what can I solve this problem?
Answer: Depending on your problem and the nature of the details you want to keep, you might want to :

Use a channel with cross sections in Flo-2D to have a close approach of the river bed
Use coarser elements outside this area, if the precision there is less critical.

In Flo-2D, you might also want to check the water depth and increase the roughness if the depth is too low. Check the TIME.out file to find the elements.
More details about that can be found in the documentation (folder flo-help)


Shimura datum of family of fake elliptic curves

Question: Suppose we have a PEL type $(H,\phi ,*;T,O,V)$  where H is a rational nonsplit quaternion algebra, $\phi$is an embedding of Q-algebra $\phi : H-->M(2,R)$, and * is a positive anti involution of H; O is the maximal order of H , and V level structure . Associate these datum a shimura curve parametric  fake elliptic curves in a standar way.
My question is :what is the group for the shimura datum ,is it the group H*, the invertible element of H ? And since this family parametirc abelian two folds , what is the map from this group to $\mathrm{GSP}(4,\mathbb{Q})$?
Comment: You should look at the paper of Goresky and Tai, "Anti-holomorphic multiplication and a real algebraic modular variety",
J. Differential Geom. vol. 65 no. 3.
Answer: Actually, fake elliptic curves are discussed in Chapter 9 of Lang's Introduction to algebraic and abelian functions.
In order to describe the map to $GSP(4,Q)$, recall that there is the standard antiinvolution $x\to x'$   on the quaternion $Q$-algebra $H$ such that both $tr(x)=x+x'$ and $Norm(x)=xx'=x'x$ are rational numbers for all $x\in H$. Every positive antiinvolution of $H$ is of the form $x \to \gamma^{-1}x'\gamma$ where  $\gamma$ is a fixed nonzero (invertible) element of $H$ such that $\gamma^2$ is a negative rational number and therefore $\gamma'=-\gamma$. This gives rise to the alternating nondegenerate $Q$-bilinear form
$$E: H \times H \to Q, x,y  \mapsto tr(\gamma x  y').$$
Now let us consider the following faithful action of the multiplicative group $G$ of $H$ on the  $Q$-vector space $V=H$:
$$u(x)=x u'$$ for $x \in V=H$ and $u \in G$. Then
$$E(u(x),u(y))=tr(\gamma x u'u y')=(u'u)tr(\gamma x y'),$$
which means that
$$E(u(x),u(y))=Norm(u) E(x,y).$$
This gives us the embedding  $G \to GSP(V,E)\cong GSP(4.Q)$.
The same construction over arbitrary commutative $Q$-algebras $R$ gives us the desired embedding of the corresponding $Q$-algebraic groups.
Answer: Question 1(what is the group for the Shimura datum):
Well, remember that $H^\times$ is just a bare group. A Shimura datum requires an algebraic group over $\mathbf{Q}$: that is, a functor from $\mathbf{Q}$-schemes to groups. Assuming you mean the group whose $\mathbf{Q}$ points, yes and you can see this in example 5.24 of http://www.jmilne.org/math/xnotes/svi.pdf although you can also use the algebraic group whose $\mathbf{Q}$ points are the norm one units of $H$ if you were interested in the connected Shimura datum (which is another example in milne's notes).
Question 2(what is the map from this group to the symplectic group):
I don't know. Is it even clear that a forgetful map of coarse moduli spaces which happen to be Shimura varieties induces a morphism of Shimura data? Either way your question sounds strongly related to the work of Victor Rotger's thesis which asks about the irreducibility of the quaternionic locus in $\mathcal{A}_2$.
Comment: @stankewicz: Regarding 2: as you can see from Professor Zarhin's answer, this is true in this case (and the use of additional endomorphisms to construct a Riemann form works in other situations as well, as he says).  As a matter of general philosophy, I would say that *yes*, naturally defined morphisms between Shimura varieties do tend to be induced by homomorphisms of the Shimura data.
Comment: I think that if you use the norm one units of $H$ than you get a "connected Shimura variety" rather than a Shimura variety proper,
since the norm one units don't have enough room to accept a map from
all of $Res^{\mathbb C}_{\mathbb R} \mathbb G_m$ (as is necessary for a Shimura datum); they can only accept a map from the norm one part,
which gives a connected Shimura datum.


Find the best components and ICs

Question: How do a newbie find the best components ? is there site or something ? the part number is not exactly user friendly. I know there are the classics, that I suppose improve over the years, but there are also modern alternatives...
Comment: "*How do a newbie find the best components?*" Best for what?  "*Is there site or something?*" Yes, component suppliers have websites. "*The part number is not exactly user friendly.*" What are you hoping for? "*I know there are the classics, that I suppose improve over the years, ...*" No, they stay the same over the years otherwise you couldn't replace one in a repair. "*... but there are also modern alternatives.*" Yes there are. You have to read the datasheets to compare the important parameters for your application.
Comment: what is `or something`? .... what is a user friendly part number?
Comment: Experience, mostly.  For something generic (op amps, logic) I'll search a distributor website (Digikey, Mouser, Arrow...).  For something more specialized, I'll search a specific manufacturer I've had good luck with in the past for similar ICs.
Comment: @jsotola something could be a pdf. A user friendly part number could be ST4AUDIOOPAMPS10W2018 lol, but i that you cant search if not specific.
Comment: @Transistor "No, they stay the same over the years otherwise you couldn't replace one in a repair" that make my question even more important.
Comment: "ST4AUDIOOPAMPS10W2018" = user friendly?  What's next, error 502?
Answer: it depends vastly on what you are trying to accomplish.
the best component is one which can do the job you want it to do, for as long as you want to do it, where you want to do it, so as to speak. There are some components, particularly aerospace-type microcontrollers come to mind here, that are extremely expensive. this is mainly due to the testing and additional radiation hardening involved, but there is no way you would use one in a completely unrelated application, like a TV remote or some such.
The best approach is to define a full and comprehensive specification for what you want to do, and then select components based on that. This can go out the window a little bit in industry, as some companies have huge stocks of some components they just want used, so you can see micros lurking in some devices that are definitely overspec for what they are doing.
after that, find a good online shop like digikey, mouser, element14 or RS, and use their parametric filters to select the right component.
some things like capacitors perform best at certain frequency ranges, for example electrolytics are only really suited to lower frequency, such as ripple blanking on power supplies, whereas ceramics are used for high frequency applications, such as removing DC bias from some AC signal, such as audio. carbon film resistors also tend to add noise, and wirewound have an inductance all of their own...
I hope this helps, otherwise perhaps consider re-phrasing your question.
Comment: yeah I guess that sites like mouser are the best option... Thanks for the generic information too!
Comment: @Jackt Well places like Mouser or Digikey or whomever are not entirely the best place for manufacturing recommendations. Contact your manufacturer and ask them to recommend you a good place to get this product.

Find the best components and ICs


Can I do some some action before app will be updated?

Question: I would like to do some clean action in my application before it will be updated from Goole Play. Eg. delete some files from previous app version.
There's any way to do this in Android?
Answer: There is no API call for this, or any unofficial method either. However, you could have your app check a file on a server everytime it runs. You could store the latest version code in that and check it against the installed app's version code. If the version code is higher, then there is an update available. You can then do your clean up operation, and  prompt the user to update the app. However, sometimes users don't update apps, so you should make sure that either the data being cleaned up is non-essential to functionality, or you force users to update the app by not letting them get past the update prompt until they have updated it.
Answer: Can't you do this at the time your app starts for the first time after update? Looks a lot easier. Just store last updated app version in user preferences or in a file and verify it every time app starts.


Paypal Subscription setting date

Question: I have a paypal merchants account and I am trying to set up a monthly subscription service.
I have been using the merchants tool to try and create a subscribe button. This is no problem however, I don't know anything of the technical side and codes.
What I would like to do is to set up a monthly subscription service charging $22 every month.
I want the $22 to come out of peoples account on the 1st of every month.
If they sign up during the 1st to the 10th I would like to charge them the $22 immediately and then on the 1st of every month after that.
If they sign up on the 11th till the end of the month first payment will be on the 1st of the next month.
Do you think this is possible with paypal?
Thanks for taking the time to read my post and I hope the information is clear.
Answer:
Do you think this is possible with paypal?

Yes.

Paypal Subscription setting date


I would like to change the membership type

Question: I have a member who signed up under the incorrect membership type. Can I change this? What if the member has already made her membership fee?
Answer: Yes you can change the membership type by visiting the contact and editing membership under membership tab. If the membership amount you want to change to has higher amount than you can ask the member to do balance payment or take offline payment and update the contribution to correct amount associated with membership.
You may need to take care if the user has purchased a membership that will auto renew automatically, if so than you will also need to update the amount at the payment processor gateway so that next time during renewal it charges the correct amount.


eyedropper tool working incorrectly

Question: By default when sampling colors in Photoshop with the eyedropper the color selected shows up as the foreground color, currently when i try sampling a color it sets it as the background color -how can i fix this error? (any clues how this change occurred?)
Comment: Is your Alt or Option key stuck?  If not, reset the preferences.
Comment: @Scott no everything is the way it should be-that was the first think i checked when this behavior started
Comment: @Scott I am reluctant to reset all preferences & thats why im asking this question
Comment: Well, there's no substitute for resetting prefs. If something isn't operating as expected that's the first line of troubleshooting. You can always **move** preferences files and restart the app to see if that corrects the issue.
Answer: You need to left-click on Foreground colour swatch in your Color panel. The tricky part is to determine if Foreground or Background colour swatch is selected.
This is probably what you have now:

And this is how it should look like:

eyedropper tool working incorrectly


using EMC branded disk array with Dell/EMC branded CX3-20 head unit

Question: Are there any problems or gotchas with using an EMC branded DAE3P with a Dell/EMC branded Clariion SAN? Obviously getting support for the array would be problematic, but other than that is there anything I should know?
Answer: If I were you I'd simply ask Dell what their support position would be. If you have one of their branded CX series arrays then you should have Mission Critical support and my experience with Dell's Clariion support has been that they will be quite clear with you one way or the other if you just ask them. From a technical point of view there is absolutely no good reason for them to object, Dell don't do anything to the Clariion kit apart from changing the badge.
Comment: I confirmed with Dell that there is no technical reason that the EMC branded DAE could not be used with Dell/EMC branded equipment. They will also continue to support the rest of the san, no problem there. I installed it, no problems.


Basic Custom Property Cannot Be Animated

Question: I must be doing something horribly wrong, and am hoping someone can help!
I am trying to write a basic panel that allows for some access to NLA Strip params (namely use strip time and strip time) as well as some new custom properties I plan to to script, which is like a new implementation for action speed I call "smart speed".
I've gotten as far as creating the extra parameters and they show up on the panel fine. However, the "Smart Speed" property I created is not animatable, despite being a FloatProperty that I explicitly set as animatable.
<code>import bpy
from bpy.props import FloatProperty, BoolProperty
from bpy.types import PropertyGroup, Action

class SpeedPanel(bpy.types.Panel):
    bl_idname = 'VIEW3D_PT_speed_panel'
    bl_label = 'Time Controller'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'

    def draw(self, context):
        obj = context.object
        col = self.layout.column()
        row = col.row()

        for t in obj.animation_data.nla_tracks:
            for s in t.strips:
                row = col.row()
                row.prop(s, 'name')

                row = col.row()
                row.prop(s, 'use_animated_time')

                row = col.row()
                row.prop(s, 'strip_time')
                row.enabled = s.use_animated_time

                row = col.row()
                row.prop(s.action, 'use_smart_speed')
                row = col.row()
                row.prop(s.action, 'smart_speed')
                row.enabled = s.action.use_smart_speed

                row = col.row()
                row.label(text='')

PROPS = [
    ('smart_speed', bpy.props.FloatProperty(name='Smart Speed', default=1.0, options={'ANIMATABLE'})),
    ('use_smart_speed', bpy.props.BoolProperty(name='Use Smart Speed', default=False)),
]

if __name__ == '__main__':
    for (prop_name, prop_value) in PROPS:
        setattr(bpy.types.Action, prop_name, prop_value)

    bpy.utils.register_class(SpeedPanel)
</code>
When going to keyframe the property, it simply blocks with the warning 'smart_speed property cannot be animated`.
Thank you for reading!
Answer: I have come to the conclusion that Property objects which are registered to the "Action" type can not be animatable.
I am not sure that I understand why, as NLA strips and other non-object data types and Blender can receive animations on properties. But for now, I have redesigned my add-on to work on scene properties instead, which accept animations.


Metric over a Lie algebra $\mathfrak{u}(n)$

Question: Let $\mathfrak{u}(n)$ be the Lie algebra of the Lie group $U(n)$. I can define a positive-definite inner product over $\mathfrak{u}(n)$ in this way: if $A,B \in \mathfrak{u}(n)$ I define $\langle A,B \rangle := \Re(\operatorname{Tr}(AB^*))$, where by $\Re$ I denote the real part and by $B^*$ the conjugate transpose of $B$. Why does this inner product over $\mathfrak{u}(n)$ define the unique left-invariant metric on the Lie group $U(n)$?
Comment: For calibration: You're aware that $\langle A, B\rangle$ is (essentially) the Euclidean inner product on $\mathfrak{u}(n)$, and that left multiplication in a Lie group uniquely extends multilinear functions on the Lie algebra to global tensor fields?
Comment: @AndrewD.Hwang Could you specific you comment... I don't understand, sorry.
Answer: Let $A$ and $B$ be complex $n \times n$ matrices with respective $(j, k)$ entries $A_{jk}$ and $B_{jk}$, and note that $B^*$ (the conjugate transpose) has $(j, k)$ entry $\bar{B}_{kj}$. By definition,
$$
\langle A, B\rangle
  = \Re\bigl(\text{Tr}(AB^*)\bigr)
  = \Re \sum_{j,k=1}^n A_{jk} \bar{B}_{jk},$$
which is precisely the Euclidean inner product of $A$ and $B$ if these matrices are identified with complex vectors in $\mathbf{C}^{n^2}$. The resulting pairing on $\mathfrak{u}(n)$ is the restriction of this inner product.
Generally, if $G$ is a Lie group and $g \in G$, then the left multiplication map $\ell_g:G \to G$ is a diffeomorphism sending $e$ to $g$, so the push-forward $(\ell_g)_*:\mathfrak{g} \to T_gG$ is an isomorphism of vector spaces. An inner product on $\mathfrak{g}$ thereby determines an inner product on each tangent space $T_gG$, and since multiplication is smooth (as a function of $g$) these inner products constitute a Riemannian metric on $G$.
(In case it matters, this left-invariant metric is only "unique" in the sense that it is completely determined by the choice of inner product on $\mathfrak{g}$.)
Answer: Because Tr(AB*) is invariant under transformations of the orthogonal base of the algebra u(n). That's why define invariant metric on group U(n) and is left because B are tensors and must respect the sequence of < A,B >.
Comment: I'm sorry... but can you be more explicit?


When a battery is your power source, what is ground?

Question: For the sake of not incorrectly connecting my power supply and damaging my board I'm going to ask a relatively dumb question. Is ground on my board the negative terminal on my battery? Explicitly should I connect the ground to the negative terminal of the battery?
Comment: You can pick *any* point in a circuit and call it ground.  It's just a label.  Did someone else design the circuit?  Did they label a point ground?  Did they show how the battery or batteries are connected to it?
Comment: FYI, in case you ever need a split supply (e.g. +/- 4.5V supply for an op-amp powered by a 9V battery), here are some circuits for a buffered, low-impedance VGND at half the battery voltage: http://tangentsoft.net/elec/vgrounds.html
Comment: A shared ground/(-) terminal is especially important when 2 or more electronic devices are communicating with one another.
Answer: Yes - just remember that your ground in that case will only be relative to the battery.  If you go to connect this to another device (serial interface, etc) you need to link the ground lines so they're a common ground.
So long as it is isolated, you're fine.
Comment: As a bonus, if you have 2 batteries in series, you can use the middle terminal as ground and have a positive and negative supply from the 2 other battery terminals.
Comment: @Agos - The potential is relative. Ground is an arbitrary designation. In a situation with split rails, as long as the voltage between the rails is fixed, the overall potential of the entire circuit can move up and down without any negative effects.
Comment: @Robert wouldn't that put the ground at non-zero potential? Is that ok?
Answer: The ground pin on the microcontroller is two things: (1) a voltage reference, and (2) a current return.
Voltage Reference: Voltages don't really exist at single points, voltages are differences between points. This means that to speak sensibly about some single point in a circuit being at a given voltage, it has to be relative to some other point in the circuit. The common convention is to pick one node in the circuit and call it 'ground', and then all voltages are specified relative to that. With a microcontroller, the ground pin is the reference against which the inputs are 'measured' to determine whether they are high or low.
Current Return: All the current that flows into a micro-controller has to flow back out again somewhere. You're certainly aware that current flows into the +5V pin. Note that some current will flow out various pins as signal outputs, but then some outputs will actually admit current into the chip. Input pins can also source or sink current. Regardless, whatever current is left over is expected to flow out the ground pin of the micro-controller. In essence, the supply current is returned to the supply through the ground connection.
So when your power supply is a battery, it makes perfect sense to connect the (-) side of the battery to your system's ground pin. Notice that this isn't just a voltage reference though; it is also the supply return. In practical terms, what this means that the wire you use to connect (-) to the board's ground should be at the same size as the wire you use to connect (+) to the board's power input.
Comment: You tried to explain, not just state the answer. "current...has to flow back out again somewhere". Yes, by common notation current is flow of positive ions. But as humanity found out it is electrons that usually flow, we have not started to connect ground to positive. Why?
Answer:
The potential is relative. Ground is an arbitrary designation.
  —Fake Name

This is something I worked out recently, only then realising why the hydraulic analogy was causing me cognitive dissonance. If a "voltage supply" was a waterfall, the image of a 12m top-to-bottom waterfall stuck in the middle of the sky, somewhere above my 5m waterfall which started 5m above the "ground" just didn't make any sense.
And then I tied the negative pin on my Arduino (powered by a 12V wall wart) to the drain on the transistors I was using to switch current to my LED strips and the circuit worked.