Is there a single word for "accidentally getting a liquid into eye"?

Question: I want to say that I accidentally got paint in my eye in a more formal sounding manner with a single word. Is there a word I can use to express this in a sentence like "Paint ....ed into my eye." to mean "it accidentally entered into/touched"?
Comment: You could use the verb for the mechanism by which paint entered your eye: Paint *squirted* into my eye, paint *dripped* into my eye, I accidentally *rubbed* paint into my eye, the paint *developed malevolent sentience, jumped out of the can and made a beeline* into my eye...whatever fits the situation.
Answer: Native speakers typically express the idea like this:

I got paint in my eye.
Paint got in my eye.

See here, for example.
More formal and more generic ways of expressing the idea don't usually involve a more formal verb:

... foreign body in the eye ... intraocular foreign body ... chemical splash in eye ... intraocular chemical burns ...

but you could say

Paint came in contact with my eye.
Paint contacted the ocular surface.

The latter, with "ocular surface", is something you might find in a medical report. It is so far removed from everyday idiom that it could have a comical effect if the context in which it is used was otherwise informal and conversational.
Answer: Similar to the suggested spatter, there is also the word splatter.
The verb form is is defined as:

Splash with a liquid, typically a thick or viscous one.
Splash (a liquid) over a surface or object.

I usually consider paint a viscous liquid.
The noun form of splatter is defined as:

A spot or trail of a thick or viscous liquid splashed over a surface or object.

So, your sample sentence could be "Paint splattered into my eye."
Answer: I was going to say "no, there is no single word in common use to indicate accidentally getting liquid into eye", but really, got is the word.
Saying "I got paint in my eye" is acceptable (and very common) in all but highly stylized contexts where precision is emphasized, such as a legal affidavit or medical record. It would be assumed to be by accident because you said "I got…" rather than "I put…", but you could certainly say "I accidentally got paint in my eye."
You may be concerned that "I got" is usually considered very informal, but in this specific instance it is considered a very proper way to indicate that this happened without you intending it to happen while still maintaining an active voice.
Answer: The paint intended for a surface that doesn't make it there is commonly called "spatter".
As in: "I was painting the ceiling, and got spatter in my eye." ('On the floor','on my shoes'. etc.)
Most dictionaries will show "spatter" as a noun and a verb: "I thought it would be neater to use a paint roller - but, it spattered the paint everywhere.
Spatter is also often used for a spray of blood. AmE


Where do i enable caching for drupal 7 panels data for Logged in Authenticated users?

Question: For drupal 7 panels where do i set the settings to enable caching for logged in authenticated users?
Comment: Where did you get the idea there is a separate cache for that? (I really wanna know - the same documentation should tell / point to place that tells how.)
Comment: what i meant was for the panels module. was wondering if there was a separate section just to enable cache for panels content or is it just in the same general cache page?
Answer: You can enable Panels caching on a per-panel-pane basis.
Edit the panel pane and set the "Cache" configuration there.

You can also create your own cache plugins via the ctools plugin API.
Comment: There are also a few contrib modules that add new cache strategies for Panels
Comment: where would i find these cache modules for panels?
Comment: A few panels caching modules are mentioned here: http://drupal.stackexchange.com/a/47984/11788


How should I go about DB Conn persisting in Apache when mod_dbd doesnt support my driver?

Question: I am working with the ODBTP interface to SQL Server from a Linux Apache 2.x host. mod_dbm does not support this and I require being able to move the code to any host that supports Apache.
A note on my environment: I am using the Apache 2.2.17, C++ wrapped in C for Apache, ODBTP 1.14, SQL Server 2008.
I have successfully implemented the ODBTP connections and I am able to fully use the data within the module itself, but i wanted to persist the connections rather continuously connecting, disconnecting, and starting over again for my application that uses local HTTP calls to the retrieve data in a JSON format.
The issue is that I need to deploy this application and module in an environment where I do not trust the security of the plain text written application, to safely guard by the database credentials. When the application connects over HTTP, it provides only encrypted credentials that my module decrypts before sending to the database.
I am currently creating a handle for the database and storing it in a keyed apr_hash_t table in the module definition. Once the application connects, the module looks up the unique per request token that the application specifies in the URL to find the connection for that application. This works but only one time.
The hash key is 32 digit key that is initially a char * created out of the pool, and stored with the ODBTP handle as a row in the hash table. Some how, the key in between calls is being modified and the original key is now a truncated version.
Example:
1) I make 1 call from my application to start a persisted connection. This works.
2) I make 3 back to back calls from my application to execute a sql string.
(/stars/execute_sql/unique/<>/sql/<>) x 3
The first call is perfect and I retrieve the data.
The next call the token saved as the key is truncated and the module can't find the associated key.
The next call the token is in the same truncated state as in attempt 2.
I am not sure if I am overwriting memory or not? I wrote a short loop function to spit out the contents of the hash table so that i could stick the function at every point in my code to find out where the data may have been corrupted, but my findings make no sense. I have to split the uri in order to find data embedded in the uri. I tracked the memory shifting to a line in this function as "raw = apr_psprintf(apache->pool,"%s", subject);" which is in the code below.
<code>void theRequest::get_exploded_str(char *subject, char *delimiter)
{
    // variables
    char *raw, *next, *last;
    // create the split chars database if not created
    loadSDB();
    apr_array_clear(x_split_chars);
    subject = apr_pstrndup(apache->pool, subject, string(subject).length());
    raw = apr_psprintf(apache->pool,"%s", subject);

    next = (char*)apr_strtok(raw, delimiter, &last);

    while (next)
    {
        // add next to array
        *(char **) apr_array_push(x_split_chars) = apr_pstrdup(apache->pool, next);
        // fetch next
        next = (char*)apr_strtok(NULL, delimiter, &last);
    }

    return;
};
</code>
It works perfectly on call 1, but not on call 2, because the key is being shifted somehow.
Any ideas? Or even some thoughts on how I could use APR_RESLIST to accomplish this better?
Thanks in Advance!
Answer: I found that I was unable to directly pool via the application but through the ODBTP library itself. Being that it is a TCP to ODBC bridge it was able to pool the connections to a degree, but not efficiently enough.
I have abandoned this mission though and have move to using SQLite3 for the application database because of a server environment change.


My computer doesnt support Unity?

Question: I was told that my PC doesnt support Unity on install of Ubuntu 11. Its

Intel C2D T9300 2.5 GHz
4GB DDR2
320GB HDD
NVIDIA GeForce 8600MGT

Does it support Unity, if so, how can I enable Unity. Its currently using the Ubuntu 10 theme thingy :) thanks
Answer: Check hardware requirements https://wiki.ubuntu.com/DemystifyingUnityGraphicsHardwareRequirements
Answer: You probably only have to allow the restricted Nvidia driver, check the hardware-card icon in the top right corner.
Answer: The advice above is good and it may solve the problem for you. If you are still unsure about whether Unity will work for you then here is another route you might take.
Download the iso file from the Ubuntu web site for 12.04 Desktop. From there you need to use the downloaded .iso file together with a program such as 'Brasero' or 'GNOME Baker' to burn an 'image' to a disk (on Windows use Nero).
Once you have made the disk then put it into your computer's DVD drive as the computer is booting and it should boot off the disk. Don't worry, this will not cause any problems with your computer. Eventually, you'll be given the choice, on the screen, of installing Ubuntu or just trying it. Choose 'Try Ubuntu'. This will not do anything to your hard disk. You will be able to see if you can run Unity on your computer. You can try looking for 'Additional Drivers' in th emenu system and see what it says about your computer.
If you are happy that it works then remove the disk and close down. Then boot as normal and  back-up all your important files from your hard disk. Then you can install the latest version of Ubuntu, should you wish, from the disk. 12.04 is supported for 5 years. Remember that Ubuntu 11.xx are not long term support so you'll have to upgrade somehow eventually.
If you find that your computer doesn't work the way you wish with Ubuntu 12.04 you could try installing Xubuntu 12.04 which is a lighter desktop. That has a nice panel at the bottom of the screen. If you prefer something else, to the panel, then you can install the 'Avant Windows Navigator', Cairo Dock, 'GNOME Do' or other docks which are alternatives to Unity.
Hope this helps!

My computer doesnt support Unity?


Instantaneous acceleration vector toward the concave side of a curved path

Question: Why does the instantaneous acceleration vector of a moving particle always point toward the concave side of a curved path? My college textbooks mention this as something obvious, without further discussion.
Answer: Because the non-tangential component of the acceleration always points toward the concave side. This is a mathematical result, with the proofs given, but to provide physical intuiton consider the non-tangential component of acceleration. This component doesn't affect the magntitude of the velocity vector, but changes its direction in a circular fashion. Hence, at an instant, you can approximate how the velocity vector changes by considering it to be in a circle of radius of curvature. Now, the non-tangential component of the acceleration vector obviously points towards the center of the circle, or to the concave side. Hence, the final acceleration vector is angled from the tangential towards the concave side.
For a little of the math (fully shown in the link),

Now, since the velocity squared and the curvature functions are both positive, the non-tangential component of the acceleration is in the same direction as the normal vector, which by definition points towards the concave side of the function. Hence, the net acceleration function is angled from the tangent towards the concave side.
Comment: Your very welcome @Berni.
Answer: Cicero gave you the math; let me give you the picture.
Looking at this:

The blue blob is an object initially moving horizontally to the right. At point B I give it a push upwards; it will then follow a new trajectory.
You probably have no difficulty determining that the mass had to accelerate vertically to get its new direction.
Now make the steps smaller, and get lots of them. Instead of a single jump, the object will make many tiny jumps. In the limit, the jumps become a smooth curve. But still, the object gets greater vertical velocity - it is accelerating. And the direction of the acceleration is up - away from the convex side (towards the concave side) of the curve.

I hope the pictures help your intuition.
Comment: Insightful answer. Nice pictures!
Comment: Upon reflection, you use an argument eerily identical to one contained in the Principia Mathematica by Isaac Newton to prove Kepler's second law @Floris.
Answer: All the answers presented here have a strong influence of intuition that comes from physics, or they use the concept of curvature. And that makes them quite clear. But I think there is an answer that comes only from geometry and differential calculus that is distinguished by its simplicity and crystalline mathematical clarity. It is as follows:
Let $\phi(t)$ be the angle from the positive $x$-axis to $\mathbf{T}(t)$, and let $\mathbf{n}(t)$ be the unit vector that results when $\mathbf{T}(t)$ is rotated counter-clockwise through an angle of $\pi/2$. Since $\mathbf{T}(t)$ and $\mathbf{n}(t)$ are unit vectors, they can be expressed as
$$
\mathbf{T}(t)=\cos\phi(t)\mathbf{i}+\sin\phi(t)\mathbf{j},
$$
and
$$
\mathbf{n}(t)=\cos\left(\phi(t)+\pi/2\right)\mathbf{i}+\sin\left(\phi(t)+\pi/2\right)\mathbf{j}=-\sin\phi(t)\mathbf{i}+\cos\phi(t)\mathbf{j}
$$
Note that in the intervals where $\phi(t)$ is increasing, the vector $\mathbf{n}(t)$ points toward the concave side of the curve (Fig. 1), and in the intervals where $\phi(t)$ is decreasing, it points in the opposite direction to the concave side (Fig 2.).
Now we derive $\mathbf T(t)$:
$$
\frac{d\mathbf{T}}{dt}=\frac{d\mathbf{T}}{d\phi}\,\frac{d\phi}{dt}=(-\sin\phi\,\mathbf{i}+\cos\phi\,\mathbf{j})\frac{d\phi}{dt}=\mathbf{n}\frac{d\phi}{dt}.
$$
But
$$
\text{$\frac{d\phi}{dt}> 0$ on intervals where $\phi(t)$ is increasing, and }
$$
$$
\text{$\frac{d\phi}{dt} < 0$ on intervals where $\phi(t)$ is decreasing.}
$$
Thus, $\frac{d\mathbf{T}}{dt}$ has the same direction as $\mathbf{n}(t)$ on intervals where $\phi(t)$ is increasing and the opposite direction on intervals where $\phi(t)$ is decreasing. Therefore, $\frac{d\mathbf{T}}{dt}$ points "inward" toward the concave side of the curve in all cases, and hence so does $\mathbf{N}(t)=\mathbf{T}'(t)/|\mathbf{T}'(t)|$. For this reason, $\mathbf{N}(t)$ is also called the inward unit normal when applied to curves in 2-space.

The images were handcrafted with geogebra: https://www.geogebra.org/m/knptsh5m
The reference is at https://www.uoanbar.edu.iq/eStoreImages/Bank/4541.pdf
Answer: Intuitively,
You need a tension towards the center of curvature (if you image a weigtless rope connected to the particle instead of following a path). The same reason when you turn in a bike you mostly lean in the curve. Otherwise you would be flung out and not be turning the way you want.
It actually helps to think about it the other way. When a moving body has a perpendicular force applied (and hence acceleration) it forces the body to curve in the direction of the force. If that force is constant and remains perpendicular the resulting curve is a circle (think of a mary-go-round). If that force is constant, with also constant direction the resulting curve is a parabola (think gravity). An inverse square law force results in an ellipse (or hyperbola) for a curve (think planets and comets).
For the math see https://physics.stackexchange.com/a/83592/392

When a particle follows a path then at any instant there is tangential vector $\vec{e}$ and a normal vector $\vec{n}$  allowing for the velocity to be defined as
  $$\vec{v} = v \vec{e}$$
  and the acceleration
  $$\vec{a} = \dot{v} \vec{e} + \frac{v^2}{\rho} \vec{n}$$
  where $\rho$ is the radius of curvature of the path.

So your question is why does $\vec{a}_N =\frac{v^2}{\rho}\vec{n}$ always points towards the inside of the curve? In the post I show that for a function $y=f(x)$ the radius of curvature is

$$\rho(x) = \frac{\left(1+{f'(x)}^2\right)^\frac{3}{2}}{f''(x)}$$

and since the numerator is always positive, a positive radius of curvature corresponds to a positive 2nd derivative $f''(x)$. This happens to be up, for a cup shape ( $\cup$ ) and down for a cap shape ( $\cap$ ).
Answer: In order to move through a concave path, an agent has to impart force to otherwise a linearly-moving object. The object , by virtue of its motion, under the absence of any external force, always travels or tends to travel in the direction of the velocity vector at the concerned instant.
So, when the object has to transverse a curve trajectory, the main requisite is the introduction of a force that manipulates the direction of velocity such that the resultant locus is the required curvilinear path, otherwise the object would travel straight.

Now,the million-dollar question: what should be the direction of the force?
The direction of the force is evidently the direction of the acceleration or the limit of change of velocity with respect to time. So, to find the direction, let's think of an infinitesimal situation.
Let for a short amount of time $\Delta t$, the distance traveled is $v(t)\Delta t$ along a circular arc of radius $r$. The angle transversed is then $$\Delta\theta = \dfrac{v(t) \Delta t}{r}$$.
Imagine the bisector of the angle. Now, consider the changes in velocity parallel & perpendicular to this bisector. Initially the velocity has a component $v\sin(\frac{\Delta\theta}{2})$ away from the center & $v\cos(\frac{\Delta\theta}{2})$ transversely.Afterwards, it has a component $v\sin(\frac{\Delta\theta}{2})$ toward the center & $v\cos(\frac{\Delta\theta}{2})$ transversely as before. Thus the change of velocity is of magnitude $2v\sin(\frac{\Delta\theta}{2})$ toward the center of the arc.
As $\Delta\theta$ is vanishingly small, $\sin(\frac{\Delta\theta}{2})$ becomes indistinguishable as $\dfrac{\Delta\theta}{2}$. Thus, we can put $$|\Delta v(t)| = v^2 \dfrac{\Delta\theta}{r}$$. And the direction is towards the center. Thus the force is rotating the position vector along the curved trajectory and the change is radially inward regardless of whether it is traced clockwise or counter-clockwise.

The picture becomes more vivid if we calculate using polar co-ordinate.
First, we write the position vector as $\mathbf{r} = r\cdot e_r$ . Now consider the change of $\mathbf{r}$ with time.  Its change during $\Delta t$ is $r\Delta\theta \cdot e_{\theta}$. $e_r \quad \& \quad e_{\theta}$ are mutually perpendicular, the first being outward radially from the center . Therefore velocity is $$v = \dfrac{d\mathbf{r}}{dt} = r\dfrac{d\theta}{dt}\cdot e_{\theta} = \omega r \cdot e_{\theta}$$.
By putting $r = 1$, we get $$\dfrac{d}{dt} (e_r) = \omega e_{\theta}$$.
Similarly, a change of $\theta$ implies a change of $e_{\theta}$.It can be seen that $$\dfrac{d}{dt} (e_{\theta}) = -\omega \cdot e_r$$. Now we differentiate the velocity, $$\mathbf{a} = \omega r \dfrac{d}{dt} (e_{\theta}) = -{\omega}^2 r\cdot e_r $$. . This result falls down automatically with the correct direction which is opposite of $e_r$ i.e. toward the center radially.


jQuery: Cross Domain AJAX Call Results in "Access to restricted URI denied" (Code 1012)

Question: What I am trying to do is to have a page on the HTTP protocol sending an AJAX call to the same Web server but using HTTPS. Both the requesting page and the AJAX handler are on the same server, having the same domain and port. (I.e., only difference is the protocol.) To illustrate,
From
  http://www.example.com/index.php
Triggers a jQuery AJAX call to
  https://www.example.com/authenticate.php?user=123&password=456
(I am hoping to pass the password through HTTPS to make it encrypted over the Internet. Due to some design constraints I must use AJAX call instead of redirecting the page.)
I understand that there is a CORS issue here and thus I researched a bit and found that I could actually make use of the Access-Control-Allow-Origin header to help. I then set the following in my Apache's configuration file,
Header set Access-Control-Allow-Origin *
Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
Header set Access-Control-Allow-Headers "content-type, accept"
Header set Access-Control-Max-Age 1000

I can see that when the browser requests the resources from the server, the headers can be seen. Request:
Accept  */*
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Authorization   Basic Y2FzZXRhZ3JhbWRldjpwYXNzd29yZGRldiE=
Cache-Control   no-cache
Connection  keep-alive
Cookie  __utma=99230732.2019724749.1337107099.1337849971.1337856946.9; __utmz=99230732.1337107099.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=217650581.954519005.1337107174.1337772401.1337777327.5; __utmz=217650581.1337107174.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=99230732; PHPSESSID=m8lnqhqv2qa6f884a8um413n81
Host    www.example.com
Pragma  no-cache
Referer http://www.example.com/index.php
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0

The response is like,
Accept-Ranges   bytes
Access-Control-Allow-Head...    content-type, accept
Access-Control-Allow-Meth...    GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Orig...    *
Access-Control-Max-Age  1000
Connection  close
Content-Length  16599
Content-Type    application/x-javascript
Date    Thu, 24 May 2012 14:48:17 GMT
Etag    "48157-40d7-4c0c938b220c0"
Last-Modified   Thu, 24 May 2012 14:39:39 GMT
Server  Apache/2.2.3 (CentOS)

So it looks like the header part is fulfilled. (Am I right?)
Then when I tried to call the follow jQuery AJAX code in JavaScript,
$.ajax({
    // Use HTTPS as there is password transferred
  url : "https://www.example.com/authentication.php",
  type : 'POST',
  dataType : 'json',
  async : false,
  data : ajaxData,
  beforeSend : function(xhr, opt) {},
  error : function(error) {
    console.log("Ajax error: unable to login user: ");
    console.log(error);
  },
  success : function(status) {
    if(status==USER_AUTH_AUTHENTICATE_USER_SUCCESS) {
      console.log("User login succeeded!");
    } else {
      console.log("User login failed.");
    }
  }
});

The browser (FireFox 12) will just return an object,
readyState 0
status 0
statusText "[Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js Line: 8240"]"

Is there something that I missed out?
In fact I had already tried a lot of suggestions from forums and blogs trying to get this done but still I am unsuccessful. I also tried using JSONP and it works fine on FireFox but failed on Chrome/Safari with no readable error message but just throwing an error from jQuery code "head.insertBefore( script, head.firstChild );".
Appreciate much if someone can give me a clue on what is wrong with my code/settings.
Thanks!
Edited on 2012-05-25 20:29 (UTC +08:00)
As suggested I read this reference case (http://stackoverflow.com/questions/5750696/how-to-get-a-cross-origin-resource-sharing-cors-post-request-working) and I found that it linked to this case (http://stackoverflow.com/questions/5584923/a-cors-post-request-works-from-plain-javascript-but-why-not-with-jquery) as well which is related. I tried the sample XHR code there,
var request = new XMLHttpRequest();
var params = "action=something";
request.open('POST', 'https://www.example.com/controllers/Authentication.php', true);
request.onreadystatechange = function() {if (request.readyState==4) alert("It worked!");};
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.send(params);

The code is called from a page with HTTP protocol. Once the code is executed, the error below is thrown right away,

Access to restricted URI denied...test_xhr.php Line 11

(If I change the HTTPS in JavaScript HTTP, the script works right away and so there should not be any syntax problem or so.)
The request and response headers of the page itself are as follows. Request is,
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Authorization   Basic Y2FzZXRhZ3JhbWRldjpwYXNzd29yZGRldiE=
Cache-Control   no-cache
Connection  keep-alive
Cookie  __utma=99230732.2019724749.1337107099.1337856946.1337921578.10; __utmz=99230732.1337107099.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=217650581.954519005.1337107174.1337772401.1337777327.5; __utmz=217650581.1337107174.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=99230732; PHPSESSID=ktd6anojfi40ohemlujosdmhi4
Host    www.example.com
Pragma  no-cache
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0

The response is,
Access-Control-Allow-Head...    content-type, accept
Access-Control-Allow-Meth...    GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Orig...    *
Access-Control-Max-Age  1000
Connection  close
Content-Length  590
Content-Type    text/html; charset=UTF-8
Date    Fri, 25 May 2012 12:24:44 GMT
Server  Apache/2.2.3 (CentOS)
X-Powered-By    PHP/5.1.6

So I am just thinking something is fundamentally wrong with my setup but not jQuery as native XHR does not work as well. :(
Comment: See if this helps: http://stackoverflow.com/questions/5750696/how-to-get-a-cross-origin-resource-sharing-cors-post-request-working
Comment: Thanks for getting back Epascarello. I tried to add the x-requested-with header but yet still no luck.

Let me edit the question above for an additional testing that I did. Please have a look at the above.
Answer: You have two issues:
1) Access-Control-Allow-Origin "*" is not working with authenticated calls, instead of * reflect the calls Access-Control-Request-Origin or Origin header fields.
2) You'll need Access-Control-Allow-Credentials: true in the response.
Other things that might help: setting authorization header manually, assembling name and password with base64. This is the surest way to have working. Its advantage is its drawback: setting authorization header manually activates the OPTIONS header based CORS handshake. (All your requests are preceded with an OPTIONS request that you have to also handle) This one seems to have a coherent implementation across all modern browsers (IE9 of course is an exception, IE10 however works allegedly).
HTH


Can I use CC BY-ND font in company logo?

Question: I own a one-person business and want to use it's name written in font licensed CC BY-ND as logo on papers send to my clients. Is it possible? Would I need to include a license
Comment: Rights around typefaces/fonts are *complex*, and depend massively on jurisdiction. There's a good chance that only the font software is covered by this license, but not the typeface or the text that was typeset with this font.
Comment: Amon's right; it'd be a lot easier to answer this if you were to link to the font in question, and perhaps also tell us your jurisdiction.
Comment: @amon Could you kindly share a link which supports the claim that the use of fonts under a CC license is dependent on the jurisdiction? I have never come across a case like that.
Comment: @Martin_in_AUT My argument would be: typically, typefaces are not subject to copyright, and typeset text is not a derivative of the font. The CC license only applies to the font and doesn't restrict using it for typesetting (only sharing and modification). However, if the typeface were highly decorative it might be eligible for copyright, and the typeset text could then be a derivative, which would be disallowed by the ND terms. [Wikipedia has an overview of international differences](https://en.wikipedia.org/wiki/Intellectual_property_protection_of_typefaces), note in particular USA↔Israel.
Comment: @amon Thx for the link, I had not seen the page before. After reading it I am convinced that there is no reason in that page to change my answer below.
Comment: @amon The font I was thinking about:
https://fontsarena.com/chappa-by-lucas-mercado/
Comment: @HubertBossy That font looks fairly normal, so I think the license is irrelevant when using the font to typeset text.
Answer: CC BY-ND is not commonly used for fonts, as there are specific open licenses for fonts, such as the SIL Open Font License (OFL).
Nevertheless, you should not be afraid of using this font for creating a logo or typesetting your name, because a document, even if completely written using a specific font, can never be a derivative work of that font. A derivative work would be if you take the font and use it to create another font, or if you take the font and convert it into another graphics format or font format.
There is a similar question in Law SE which you might be interested to read. It supports my rationale.
As you are not distributing the work (the font) itself, nor distributing a derivative work (as explained above), you also do not have to include any attribution language (the name of the person who created the font) nor a link to the license language.
Edit:
If you are planning to use the font not just in your logo (i.e. a graphics file type), but also in the text of your documents, then there are cases where this will actually result in distribution of the font itself. In such a case you will have to comply with the requirements as listed in section 4 of the license.
An obvious example for this would be your website, where special fonts need to be provided on the server and will be downloaded by the browser. Less obvious is the document embedding that happens with popular file formats. See: Microsoft Word, Libre Office or Adobe PDF.
Answer: The following is specific to US law. If you are not in the US, you should consult your own country's law to determine the copyright status of typefaces.
Under US law, typefaces are not subject to copyright protection (37 CFR 202.1(e)), but the font files may be subject to copyright (see Eltra Corp. v. Ringer, this document, and this one) to the extent that they are vector font files (OpenType, TrueType, etc.) rather than raster (bitmap) font files.
It is important to emphasize that this protection is extremely narrow. It does not cover the appearance or design of the font at all. It only covers the specific choice of control points or other vector instructions which are used to create the desired shape. If these control points etc. are not copied into your work in some way, then it is very unlikely that you have infringed the copyright of the font. Here are some ways that might happen:

You embed an OpenType or TrueType version of the font into a document, using the relevant "embed fonts" option in your word processor's settings.
You use Web Fonts to distribute copies of the OpenType etc. version of the font.
You create a vector image (e.g. an SVG or EPS file) which contains text in that font, and use "text to path" on that text - which has the effect of directly embedding the font's control points into your image file.
You make your own version of the font by directly modifying the existing font. Note that converting it to bitmap and then manually tracing it will (probably!) eliminate the copyright infringement, but (if applicable) you might still violate the typeface's design patent (see below).

If don't do any of the above, then you probably haven't violated the copyright on the font, regardless of its license.
A couple of important caveats: Fonts and typefaces may be subject to design patent, which does protect the general appearance or design of the typeface. However, design patents have various limitations compared to copyright that makes them less appealing to designers (most importantly, they have much shorter terms and you have to explicitly apply for them). As a result, your font may or may not actually be patented, and if it is, that may or may not matter (in practice, I do not think this is likely to matter unless you are creating a similar font, but I'm not an expert). Additionally, if a font is used in a trademarked logo, the trademark on the logo may also restrict the use of that font for other logos - you can't use the Microsoft font to make a lookalike of the Microsoft logo, for example.


Why gravitational mass and inertial mass being same was a problem before Einstein solved it?

Question: Why is it so that Einstein is credited with telling us the reason for the equivalence of inertial and gravitational mass of an object? Did Newton ever make a distinction between the two masses? What was the problem in accepting the fact of a single mass being an inherent property?
Comment: Maybe useful - https://physics.stackexchange.com/a/427246/133418
Answer: The equivalency of gravitational and inertial mass was known by Newton and others before Einstein, as Einstein himself acknowledged. In Einstein's words "It is true that this important law had hitherto been recorded in mechanics, but it had not
been interpreted" (Einstein book: Relativity. The Special and the General Theory).
It was Einstein who extended the principle using his famous elevator thought experiments. A person in a windowless elevator in free fall in the earth's gravitational field experiences weightless. The person would have no way of knowing if the person and elevator were in outer space in the absence of a gravitational field or in free fall in a gravitational field.
If the same person and  elevator were in outer space and an external force is applied at the top of the elevator ( top meaning the surface of the elevator adjacent to the head of the person) giving the elevator an "upward" acceleration of $g$, the person would have no way of knowing that the person is standing on the floor of the elevator on earth or being accelerated in outer space.
These thought experiments helped lead him to the general theory of relativity.
In response to your follow up questions:
So, exactly why did two different terms for mass arise?
The two different terms for mass arose because the term "gravitational mass" described the unique property of mass that was determined from Newton's universal law of gravity, whereas the term "inertial mass" described the property of mass in which mass resists a change in motion in response to a net external force. Experiments by Galileo and Newton, and experiments many times since, demonstrated that gravitational mass equals inertial mass. But, as  @garyp stated, there was no reason why they should be the same.
Bottom line: Gravitational mass is defined by the force of gravitation. Inertial mass is defined by Newton's second law.
Why there is a need for a statement on equivalence when you can easily define only one term?
Since "gravitational mass" equals "inertial mass", in my opinion I see no reason to use two terms. One can simply use the term "mass". But the statement on equivalency is crucial to the general theory of relativity.  The elevator thought experiments discussed above are the basis of Einstein's idea that the force of gravity as felt locally while standing on a massive body is the same as the pseudo-force experienced by a person in a non-inertial frame of reference, such as the forces experienced in the accelerating elevator in space, or the forces experienced in an accelerating car.
Hope this helps.
Comment: So, exactly why did two different terms for mass arise? Why there is a need for a statement on equivalence when you can easily define only one term?
Comment: @GarimanSingh See my revised answer in response to your follow up questions.
Answer: The problem was that there was no reason why they should be the same.
The two masses appear in phenomena that seemingly had nothing to do with one another.  I apply a force to an object, measure the acceleration, and divide.   A principle of dynamics.   Why should it have any relationship at all to the nature-provided force that holds the Moon to the Earth?
Answer: In Newton, the application of a force is required to overcome the masses inertia.  In Einstein, it is curved space that overcomes the inertia with no force directly applied to the object of mass.  An object in orbit experiences both kinds simultaneously. An object in direct free-fall has its inertial mass force set to zero.  Once an object has been accelerated and is now moving with constant velocity and direction, it is itself in a state of free-fall.  If we now bend Newtons first law around a gravitating body, the object will remain in free-fall but will follow a curved path called a geodesic.
Answer: It's worth noticing that it's perfectly consistent to imagine a physical theory in which the inertial and gravitational masses of an object are distinct quantities. Indeed, such a strange phenomenon actually exists in our universe: all particles carry an "electromagnetic mass" (aka charge) that dictates the "electromagnetic gravitational force" (aka Coulomb force) acting on the particle, according to the Coulomb force law
$$
F = \frac{k q_1 q_2}{r^2},
$$
the analogue of Newton's universal gravitation law. And in this example the electromagnetic mass is decidedly not equal to the inertial mass, since different particles can carry positive, negative, or zero charge.
This example shows that the fact that gravitational and inertial masses are equal is not self-evident. In both Newtonian and Einsteinian physics it plays the role of a postulate. However, in Einsteinian physics it is a much more fundamental postulate, since it is essentially equivalent to the principle that all objects fall with the same acceleration in the presence of a gravitating body, which is a version of the equivalence principle of general relativity, a cornerstone of the entire theory (this Wikipedia page has a good explanation of how these principles relate to each other). In Newtonian physics it's more a case of "yeah, this is an assumption that is simple and natural and fits our observations of how the world behaves, so let's adopt it as a postulate." Einstein's approach simply makes it seem that much more natural.


Accessing P&T Assets files from WYGWAM

Question: I just uploaded P&T Assets. Shouldn't I be able to access my Assets directories from a WYGWAM? I don't have any folder listed in the WYGWAM settings. What am I doing wrong?
Answer: Go into Add-Ons -> Fieldtypes and click on Settings next to your WYGWAM fieldtype. In there, click on the Settings button. There's a setting called "File Browser". Choose Assets instead of the EE File Manager. Click Submit.
Now, when you're in a WYGWAM field, click on the image icon like usual to add an image, then click "Browse Server". This will bring up the Assets panel.

Accessing P&T Assets files from WYGWAM


Why do two of three bulbs burn out in my light fixtures?

Question: I have two inexpensive 3 bulb light fixtures in my bathroom. The same bulb (on the end) kept burning out in each fixture. When we finally quit replacing it, the middle bulbs in each fixture eventually burned out. Now one end bulb in each fixture is, and had been working fine. Is it due to internal wiring of the fixture? Seems logical to me but I'm having a problem finding anyone to agree lol
Comment: The enemy of most light bulbs is **heat**. Unless you have associated blinking or other problems, it is hard to see a likely wiring based failure mode where a bulb would work for a while but burn out prematurely. Are you using incandescent, CFL or LED bulbs? Can you upload a picture of the fixture?
Answer: I may not agree with others but many times it is the connection to the lamp that is the problem. The center conductor getting folded down a little more than the others and the lamp arcs until it no longer makes a connection.
I would try (with the power off) to lift the center tab a little. These tabs are many times brass and they do have some spring to them.
A kitchen knife to lift it up a little like 1/4" so it makes a solid connection may be the fix you need to have lamps that last closer to the same life time.
Comment: That's a great fix and has worked many times for me. I've had bulbs last longer that are close to AC vents  and last shorter that were close to outside venting.
Answer: I have had this problem in the past. I agree with @Ed Beal's Answer (socket)  and @manassehkatz comment (heat).

When I have had this problem, I noticed that sometimes it was simply a cheap light bulb. (Not always, but sometimes. And, I have had cheap bulbs die in one socket but not the other).
Sometimes, it was the wiring. (Note, this is not just the wires themselves, but also the connections and locations of the wires). Is it Aluminum wire or copper wire? (Copper is better).
Does the wire seem thin/brittle or is it firm/sturdy? Is the wire solid or stranded? (Sometimes it's solid wire in the wall and stranded in the fixture. That makes the interconnection easy to mess up.)
Are the wires all jammed into the J-Box, or is there some extra room? Jammed wires can easily "wiggle" while (re-)installing the fixture.
Are the wire nuts the right size? Are they connected properly? (Can you pull them off without twisting them?)
Are all 3 sockets wired individually to the load (causing 4 black wires in the J-box: 1 for the load and 1 for each bulb), or are they connected internally and only 1 connection to the load (causing 2 black wires in the J-box). More wires on 1 connection => more potential issues.
Are the wires pinched when the fixture is attached to the wall?
Is there a ground wire in the fixture? If so, is it connected properly?
Are there other fixtures connected to this one?

Being an engineer, I "doinked" with all of these. Probably 3/4 of the time, Checking these things (magically) fixed the problem. If this did not fix the problem, I would replace the fixture with a different one -- unless, of course, the Mrs. really liked it, then I re-wired it with sturdy copper wire, quality sockets and good bulbs.
In one particular case, I had a 6-bulb hanging lamp and the bulbs lasted about 2 months. After re-wiring it, I hadn't replaced a single bulb in over 4 years (then I moved).

$0.02


Chances of encountering a charged creeper?

Question: I've seen images of charged creepers but I would like to know what the chances are of just stumbling upon one. Or how often you would find one if you were looking for one.
Comment: Chances vary, I believe.  As the old adage goes, Location, Location, Location.
Answer: This is not easily answerable and depends on a number of factors.
First, I'm going to assume that you're playing unmodded, vanilla, single-player Minecraft. It doesn't matter if you're playing in creative or survival mode. I'm also going to assume a 90 degree FOV and normal render distance, just to make the numbers easier. If you increase or decrease either, the chances of seeing a charged Creeper will increase or decrease as well.
Then, there are the requirements:

You must be playing on Easy or higher.
Creepers must have spawned (i.e., at least one night cycle must have started where Creepers spawned)
The Creepers must be on the surface (lightning can't strike underground)
At least one rain cycle must have started after Creepers have spawned.

If any of these conditions aren't met, the chance of encountering a charged Creeper is zero.
So assuming the conditions are met, let's look at the probabilities.
One Creeper, one chunk
Creepers, like all mobs, immediately despawn if they leave a 128-block radius area centered around the player. So if there's a Creeper around, it's somewhere in that area.
Now, if you deobfuscate Minecraft 1.2.5 using MCP 6.2, World::tickBlocksAndAmbiance() indicates Lightning has a 1:100,000 chance of hitting one block in any specific chunk. And if lightning does hit a specific chunk, the game randomly selects one block within that chunk to get the lightning entity.
A chunk contains 162 (or 256) blocks so given any specific block, there's a 1:25,600,000 chance of a lightning strike. Since Creepers only take up one block and—once spawned—have no block restrictions, there's a 1:25,600,000 chance of a Creeper getting charged.
One Creeper, all loaded chunks
Since lightning is calculated independently per chunk, we need to account for all loaded chunks. At a normal render distance, a radius of 16 chunks are loaded, for a total of 206. Given the probability of a chunk getting hit by lightning is 1:100,000, that means the probability of at least one chunk getting hit by lightning is 1:485. Multiply that by the chance the Creeper is in that chunk (1:206) and the block the Creeper is on is hit (1:256), the probability of the Creeper being hit by lightning is 1:25,626,249.
One Creeper, all chunks, over time
This is only after one lightning strike, and lightning strikes are calculated once per tick. A tick is 1/20 a second, and according to World::updateWeather(), lightning storms can last for 3,600–15,600 ticks or 3–13 minutes.
So, over time, the probability of that Creeper getting struck by lightning is 1:7,118 at 3 minutes and 1:1,643 at 13 minutes.
Encountering the charged Creeper
But you want to know what the chances are of encountering a charged Creeper are, not the chances of whether one will exist. Since encounter can mean a lot of things, I'm going to use the most liberal definition, which is seeing a charged Creeper. At a normal render distance, you can see 128 blocks out, which corresponds nicely to the allowable radius of the Creeper. And at a 90 degree FOV, you should be able to see 1/4 of the possible render area. If a Creeper is on the surface, you have a 1/4 chance of actually looking in the right direction to see said Creeper.
It's way too complex to try and figure out what happens if the Creeper moves and you move or you're not looking in the right direction, so I'm going to ignore that and assume you and the Creeper aren't moving, but you're actively looking for it by rotating your field of view 360 degrees. Thus, the probability of encountering a charged Creeper should be the same as the Creeper existing.
More Creepers, more fun
Now, if there are more Creepers on the field, you have a better chance of finding a charged Creeper. There are way too many different combinations and scenarios to list out, but here are two idealized scenarios:

There's a Creeper in every block. After one tick, the chances of finding a charged Creeper is 1:485. After 3,600 ticks, there's a ~99.93% chance of encountering a charged Creeper. After 15,600 ticks, the probability is effectively 100%.
There's exactly one Creeper in every chunk. After one tick, the chances of finding a charged Creeper is 1:124,399. After 3,600 ticks, it's 1:35. After 15,600 ticks, it's 1:8.5.
Comment: Just a note: the difference between the figure for 1 creeper, 1 chunk, and 1 creeper, all loaded chunks is just a little bit of calculation error. That's because a creeper is only ever in one chunk, and the chance of that chunk being hit by lightning is 1:100,000 independently of other chunks. So the number of chunks loaded does not effect the probability of a single creeper being hit by lightning.
Answer: Edit: See Mark Trapp's answer for the chance of seeing one with the proper conditions met
I would imagine a slim to none chance if you don't improve your chances of seeing one by the means of: going out into an open area outside at night where creepers can spawn while there is a thunderstorm.
As shown  in this post, mobs despawn when you unload or leave a certain chunk of land.  That being said, if you don't stay in an area for a long time and the creepers don't despawn.... You would have a slight chance BUT creepers only get charged by being struck by lightning.  (therefore you would need a storm as well)
If you are really interested in seeing a creeper BECOMING CHARGED, try using theBukkit  mod to spawn mobs.  So,  go into a [creative] world and use the console command:
    /spawnmob creeper 1

That should spawn one creeper per the syntax shown here.
For weather type:
    /weather storm <time>
    /lighting <true/false>
    /thunder <true/false>

Or you can just spawn a charged creeper with this command with the Bukkit mod:
    /spawnmob creeper electric

Keep in mind you need Operator privileges to use the Bukkit mod
Also keep in mind charged creepers do a lot more damage then normal creepers.  If you are not in creative mode, keep your distance if you want to survive!


max folders I can store inside a folder in a linux server

Question: Is there a logical limit as to how many folders I can store inside a single folder in a hosting server (linux)? I`m talking about tens of thousands of folders.
Comment: 32000 on ext3 [64000 or even more on ext4](http://en.wikipedia.org/wiki/Ext4)
Comment: Try using a DBMS
Comment: it depends entirely on the filesystem you use. note: using many folders is not good from performance perspective...
Comment: ReiserFS wins with up to 1,200,000 files per dir limited by r5 hash as to 3.6 version.
Comment: then how to deal with the situation that you have tens of thousands of repeating data that are all of the same category? how to store them on the server in a good way?
Answer:
Is there a logical limit as to how many folders I can store inside a single folder in a hosting server (linux)?

Yes, there is a limit. You have a limit with everything inside the computer, because each computer is of limited resources. Especially with hard-drives, they have a limited amount of space. As each directory consumes space for it's name at least, this will be always limited by the space of the drive.
Next to that, the file-system itself has limits in the way how it organizes the data. This depends on the type and version of file-system you're using then.
Comment: I have no problem with the disk size. my concern is if it is ok to store 30000+ subfolder in a folder
Comment: Your concern is right, 30000+ might be over the maximum logical limit the device and it's software abstraction layer is able to offer you. You should first of all tell what is the absolute maximum number of folders you want to support (not a + at the end, but the real maximum, real in the sense of sepcification, that and no more *must* be supported). Then you should address which file-system you're using.
Answer: Every file and directory in POSIX file systems are represented by an Inode.
A number of Inodes are assigned at the time of the creation of the filesystem as a fraction of the total filesystem size. This is normally done automatically but it can also be specified manually (mkfs.ext4 -N). To see how many Inodes you have available use the df -i command:
<code>nimblex:~# df -i
Filesystem       Inodes   IUsed    IFree IUse% Mounted on
rootfs          2048273   28976  2019297    2% /
</code>
In this case, where I have a 16G filesystem, you can see that I can create over 2 million files and directories. On another 300GB filesystem ext4 formatted I have ~20 million Inodes available.


APL and Java Interface

Question: Are you aware of a good way to connect a java based webapp with an APL implementation? I read about a wrapper component that can do it, by exposing implementations as web services. Besides that - is there anything else out there?
Thanks.
Answer: Sorry for delay in answering but I've not notification of your post from StackOverflow.
Dyalog APL has not a tight integration with Java as IBM APL2.
Unfortunately the Java APL2 inteface is not portable to Dyalog APL that has, instead, a strong integration in the Microsoft .NET architecture.
Maybe you should make a wrapper to pass data to/from a java piece of code but, in my experience, I would not recommend this approach especially if you are developing software for a client.
Finally could be that using Microsoft Java programming languages (Visual J# or J++) you can found some "bridge" among .NET and JVM architectures (e.g. parameters passing).
Answer: Just to give you another insight, APL2 make available four Java interface classes:
Apl2interp Make APL2 interpreter requests (to give commands to APL2)
Apl2object Manage APL2 workspace objects (to move arrays from Java to APL2 and vice-versa)
Apl2exception Indicate and detect APL2 errors
Apl2cdr Convert between workspace and CDR formats
Answer: Regard APL it's necessary to address the right product, like IBM APL2, Dyalog APL and so on.
I can answer that Yes, it is possible with IBM APL2. The Java-APL2 interface is well documented in the APL2 User's Guide (http://publibfp.boulder.ibm.com/epubs/pdf/c187021i.pdf) You can directly go to page (pdf) 582.
Comment: Mario, Thanks for the response. The APL version that I need is Dyalog APL. Also, the java interface classes that you mentioned below - are they scalable?
Answer: java environment includes a number of development tools,classes and methods. the development kit are the part of system known as Java Development kit(JDK)and the class and methods are part of the java Standard Library(JCL),also known as the Application Progaramming Interface
Comment: This doesn't seem to answer the question.

APL and Java Interface


How to regrind coffee in electric grinder

Question: Similar to another post I saw earlier, I was gifted a bag of coarse-ground coffee which sadly comes out too weak for my cone pour-over preparation. I know there are risks with using a burr grinder when regrinding, I'm just asking about the setting I should use. Do I use the coarsest setting, since it is already partially ground, or go straight for the grind I usually prefer (medium)? Thanks!
Comment: I've never had this (interesting) problem, so I can offer mostly encouragement for you to experiment with a small amount of the coffee.  My intuition is that you should go for the grind (medium) that you prefer.  (I make espresso grind that is not the finest, so in that small respect I feel we have a common goal.)
Answer: The burrs in a burr grinder are held at a fixed distance. This distance is determined by the grind selector mechanism. In theory, this distance determines the size of grind particles, regardless of the size of input particles (whole beans, half beans, broken beans, pre-ground beans). That's why burr grinders are superior to propeller-type coffee mills which makes all particles ever smaller by bashing everything.
So (in theory) you should be able to set the grind you want and run the course "gift" grind through.
I've done this, regrinding "French Press" into espresso. It worked well. It came out a bit finer than I'd planned, but perfectly usable.


Modelling how much cadmium a cell will be able to chelate with phytochelatins

Question: I am involved in a synthetic biology project where I have to do modelling with ODEs. The biological process I want to model is the chelation of Cd2+ with phytochelatins, to know how much can be chelated. I know the basics of ODEs and I already did other modelling tasks, but I never studied anything related to chelation (I am a computer scientist) so any hint about how these kind of biochemical reactions are modelled would be helpful to get started.
Comment: If you know the stoichiometry and dissociation constant of the binding interaction this should a straightforward task. If the aim is to discover the stoichiometry via modelling, it's unclear to me how that could work. I'm probably missing something - maybe you could expand your question, and/or make it more specific?
Comment: would this be more suited for the chemistry stack exchange? Chelation is a wide field, and there may be existing models based on EDTA, siderophores, and others that could serve as decent starting points.
Answer: One of the best ways that I have found for modeling reaction pathways is to set up a boolean network for that specific pathway. The boolean will give you an idea of the possible different states in that pathway (dependencies) and while not really necessary I find it helps orient you to the system.
The next step once you have yourself oriented is to set up Michaelis-Menten equations which you can then use to run you ODEs. Here is a great primer on how to set up these equations: http://depts.washington.edu/wmatkins/kinetics/michaelis-menten.html
The subsequent modules provided in that link are also helpful in explaining how to set-up quadratic velocity equations and do different sequential models.
Also, I'm sure you know this but, it bears saying: these are all steady-state kinetics. If you are looking for a more accurate model of what is occurring in that reaction you are going to have to set-up stochastic models of your system.
Hopefully, that answers you question. Good luck!
EDIT
I have found a paper that seems to relavent to the process you are trying to model. It goes into a bit more detail than I think you are looking for but the basics seems sound. Mendoza-Cozatl and Moreno-Sanchez, 2006
Comment: would michailis-menton really apply here? phytochelatin is a polymer that chelates metal ions and gets transported to the vacoule. I guess you could treat it like 2 enzymatic reactions, with chelation as step 1, and transport to vacoule as step 2. But you might get complex cooperativity as more metal ions bind to the phytochelatin.
Comment: Michaelis-Menton is only relevant to a simplified system that only has explicitly two variables. It seems from the original posting that this is the case. The original poster appears to be only trying to observe chelation and not transport to vacoule which makes this method a valid option. You are correct that you can treat the pathway as individual reactions but those reactions you mention must be considered independently for the Michaelis-Menton approximation to work. Additionally, cooperativity can be identified by a sigmoidal curve as in the classic case of hemoglobin.


Commuting permutations

Question: I saw the following statement in a book: If $\sigma, \tau\in S_n$ such that $\sigma\tau=\tau\sigma$, then the order of $\phi=\sigma\tau$ is the least common multiple of the orders of the permutations $\sigma$ and $\tau$. Is the statement true?
A similar result which I have proved holds for a permutation written as a product of disjoint cycles: if a permutation is written as a product of disjoint cycles, then the order of the permutation is the least common multiple of the orders of the cycles.
There is no condition for the permutations $\sigma$ and $\tau$ here.
Thank you!
Comment: If $\tau =\sigma$ has order $2$, then $\phi $ has order $1$
Answer: If $\sigma\tau = \tau\sigma$, then $$(\sigma\tau)^k = \sigma^k \tau^k$$ for any $k \in \mathbb N$. Therefore we can say that the order of $\phi = \sigma\tau$ divides the lowest common multiple of the orders of $\sigma$ and $\tau$.
However, it is false in general the the order of $\phi$ will equal this lowest common multiple.
For example, if $\sigma \in \langle \tau \rangle$, then $\tau$ and $\sigma$ will always commute, but the order of $\sigma\tau$ could be less than the lowest common multiple. In $S_3$, $(123)$ and $(132)$ both commute and have order $3$, but their product is $e$ which has order $1$.
Answer: This is not true in general. $\tau = \sigma^{-1}$ has the same order as $\sigma$.
Also suppose $\sigma$ has order $9$, then if $\tau = \sigma^2$ then $\tau$ has order $9$, but $\sigma \tau$ has order $3$.

Commuting permutations


How is charge distributed across an object (something like an oil droplet)?

Question: I came across a question a while back. It stated that a oil droplet was suspended vertically within an electric field. The man who suspended it had left to eat a very LONG lunch, and came back to see that it was splattered on the top plate (nothing with the setup had changed), and the question asked us to state a physical reason for such an event. I thought it was because of a transfer of momentum from electrons moving from the negative plate on the bottom to the positive plate on top, which just so happened to collide with the oil droplet. Someone else answered saying that the droplet evaporated slightly, which caused it's mass to decrease and so the force acting upon it managed to accelerate it more than that of gravity, causing it to move upwards slowly. That was the correct solution, but I'm just a bit confused, since wouldn't it lose some charge when it evaporates as well? So overall the q/m ratio would still be the same? They said it was unlikely that it evaporated some of its charge, so I'm just wondering how the charge within an object is distributed. Is it distributed evenly throughout, or is it more concentrated in some areas?
Answer: You have to consider Gauss's law which says that the electric flux out of any closed surface is proportional to the charge enclosed by the surface regardless of the charge distribution.
Without more information, it sounds like in this case it is implied that volatility of the oil is sufficient to overcome any effect of the electric field or charge.  As such, if the oil drop is able to expel molecules of oil, then those molecules would likely carry neutral charge.
Millikan used a similar set up in his oil drop experiment to determine the charge of the electron.  His experiment was very sensitive to the mass of the oil which made him choose one with a low vapor pressure in order pass through the vacuum with minimal loss of mass due to evaporation.


I can't see my spotlight in the final render, I'm new to this, btw

Question: Basically I'm starting out in Blender, doing some bouncing ball in 2D and a moving 3D cube, nothing fancy. In the final render I can't figure out why in the world I can't see the light source, could it be because of my hardware? (Macbook pro mid 2014, 2,5 GHz Intel Core i7, 16gb ram, NVIDIA GeForce GT 750M 2 GB Intel Iris Pro 1536 MB). I've tried for render engines Eevee, cycles and workbench, but none appear to work, although an object with emission is visible. I'll post some pictures of blender and the renders.
.
Comment: show us your blend file
Comment: https://we.tl/t-x0h0yxsJGS I have no ideea if I can just post it onto the form itself. Is a wetransfer link ok? Thanks!
Comment: it works, but normally you should use https://blend-exchange.com/ ... ;) just follow the instructions. for now this is ok. ;)
Answer: you made nearly everything right, just change the render engine to Cycles and then you get:

and by the way: i rendered it on a macbook too...so it just works ;)
Comment: Thank you very much, Chris!
Comment: you are welcome. it would be nice if you could check my answer as "correct" ;)
Comment: Hopefully I did it this time. The checkmarker on the left, right?
Comment: yes, perfect! Thank you!


Homotopy type of non-Cohen-Macaulay complexes

Question: Most interestingly defined (pure) simplicial complexes that occur in topological combinatorics are Cohen-Macualay. Some of these are even shellable (or have the homotopy type of a wedge of spheres; of same dimension).
I would like to know examples of pure simplicial complexes (whose simplices are combinatorially defined) that are not shellable.
Moreover, can anybody point out papers in which author(s) deal with simplcial complexes that do not have homotopy type of a wedge spheres?
Answer: In a recent article Minimal Cohen-Macaulay Simplicial Complexes by Dao, Doolittle, and Lyle many examples of CM complexes (which happen to be minimal by their definition) are listed in Section 5. For example, included in the list are triangulations of $\mathbb{RP}^{2n}$ or the dunce hat. Some other interesting examples are A non-partitionable Cohen-Macaulay simplicial complex and A balanced non-partitionable Cohen-Macaulay complex which are recent counterexamples to the "partionability conjecture."
Edit: Since the question asks about both shellablitly and CM-ness it is perhaps worth noting that shellablity depends of the particular simplicial complex and not just the geometric realization. So, all spheres and balls are CM, but there are non-shellable examples of each.
Answer: An interesting class of pure complexes which are not Cohen-Macaulay are the chessboard complexes. See http://www.math.miami.edu/~wachs/papers/tmc.pdf. Another interesting class of non-Cohen-Macaulay complexes are the $h$-complexes of Edelman and Reiner. See https://arxiv.org/pdf/math/0311271.pdf.
Answer: The order complex of a poset is the simplicial complex whose faces are the chains in the poset.  So order complexes of combinatorially-defined posets are of the combinatorial flavor that you want, and the resulting complex is pure if and only if the poset is graded.  But there are all kinds of examples of non-Cohen-Macaulay posets with natural definitions.
One typical kind of bad example is by subword or pattern containment.  A particular instance of this is:
Sagan, Bruce E.; Vatter, Vincent, The Möbius function of a composition poset, J. Algebr. Comb. 24, No. 2, 117-136 (2006). ZBL1099.68081.
In this paper they look at all words of integers, ordered by subword containment.  I guess that's graded by word length.  Although the poset is infinite, intervals are finite, and typically are not Cohen-Macaulay.
Similar study has been made of permutation pattern containment by Peter McNamara, Jason Smith, Einar Steingrímsson and others.  And here too, intervals often fail to be Cohen-Macaulay.
Answer: Every finite simplicial complex has the homotopy type of a triangulable manifold with boundary, and triangulated manifolds are pure.  So the condition `pure' doesn't restrict the possible homotopy types for finite simplicial complexes.
Comment: The pureness requirement is relevant for the shellability question, though.
Comment: Since every shellable complex is homotopy equivalent to a wedge of spheres, if we start with any finite simplicial complex that is not homotopy equivalent to a wedge of spheres (e.g., any complex with a non-trivial cup product in its cohomology) then we can replace it by a triangulated manifold that is pure but not shellable.
Comment: yes but I think the original question asker was most interested in an example where the faces correspond to some reasonable combinatorial objects and containment is some easily described relationship between these objects. This situation often arises in algebraic combinatorics, and often the "goal" is to prove shellability/Cohen-Macaulayness.
Comment: I see your point; I'm not a combinatoricist algebraic or otherwise, so I was paying less attention to that part of the question.
Answer: Here are some examples:
There are many papers that deal with topological properties of these complexes and they are rarely Cohen-Macaulay.
1) Triangulated manifolds are very interesting combinatorial objects, and usually, unless the manifold is a sphere or a ball they are not Cohen-Macaulay. Many aspects of the enumerative theory of face numbers of spheres have interesting generalization to manifolds. There is also rich examples of triangulations of specific manifolds with few vertices.
2) Within triangulations of manifolds there is a special role to $d/2+1$ neighborly manifolds when $d$ is even. Their existence for $d=2$ is the Heawood conjecture. For larger values of $d$ only a few examples are known like the Kuhnel 9-vertex triangulation of $CP^2$.
3) Triangulated pseudomanifolds (every co-dimension 1 face is included in two maximal faces + some connectivity assumption) can also be fascinating combinatorial objects.
Here are three more interesting examples.
4) Triangulations of algebraic varieties (with singularity) are very interesting combinatorial objects.
5) Quotients of buildings.
6) High dimensional expanders.


Can I send my new book to many publishers at the same time?

Question: Can I send my new book to many publishers at the same time? If I did what will happen if two of them accepted the work?
Answer: Read their submission guidelines, not only for this but for many other details.
In particular, many will decree, No simultaneous submissions.  This is because they do not want to get caught having put in the effort to decide to buy a work, and discover they lost it to another publishing house.
Comment: Interesting. I've never even heard of a publisher that demands no simultaneous submissions before today. Where I'm from (small market) it's accepted that authors submit to more than one publisher and the ones that get a bidding war going are considered extra lucky. Reading up on this in English though seems to suggest bidding wars aren't even on the radar (quoting a backside of simultaneous submissions being to have to withdraw the piece from other publishers...) Although maybe it differs between novels and articles.


JavaScript authentication with c# sdk. What happens on server?

Question: I have made a JS authentication on local server, and it also went fluently on server side. As I understood the sdk cached up with the JS auth and all went well. But When I have uploaded this on server, the IsAuthorized method returned false after the JS auth. Why could that happend? And how does the sdk handle the JS auth?
Answer: Check your website url in the facebook app configuration page. Maybe the domain is now different?


Is WASP-12 a F-type star or a G-type star?

Question: I saw in Wikipedia that WASP-12 is a star with spectral type of G0V while they said its temperature is 6360 K. Does that mean it must be a star with spectral type of F7V or F6V? Its size is not like a normal G-type star should have.
Comment: Basing his analysis on the Gaia, PARSEC and PASTEL catalogues, Valeri Makarov arrived at the values Teff = 6310 K, age = 2.08 Gyr, and M = 1.36 M_{sun}, see https://www.mdpi.com/2218-1997/8/4/211  For details, you may want to write to Valeri directly, using his e-mail shown there. He may be able to help.
Comment: Use proper punctuation and pay attention to capitalization.
Answer: There is actual variation in the literature.
The WASP team announcement of the discovery of a planet states "the host star is a supersolar metallicity ([M/H] = 0.3+0.05–0.15), late-F (Teff= 6300+200–100 K) star which is evolving off the zero-age main sequence."
Simbad, which is a "catalog of catalogues" lists the star as G0V, and cites Bergfors et.al. "Stellar companions to exoplanet host stars" Which indeed stats G0 V as the spectral type.
Finally Wikipedia cites Collins et al "Transit time measurements of WASP-12b..." to get the temperature of 6360+130-140 K.
There is an inconsistency between the papers. Part of this may be due to WASP-12 being an evolved star and moving away from the zero age main sequence.  Also its metallicity will have an effect on its effective temperature. But part of the variation may simply be different scientists working with different data.


Basis of the polynomial vector space

Question: I don't understand how to find a basis for a polynomial vector space.
Can someone help me with an example?
Answer: A basis for a polynomial vector space $P=\{ p_1,p_2,\ldots,p_n \}$ is a set of vectors (polynomials in this case) that spans the space, and is linearly independent. Take for example,
$$S=\{ 1,x,x^2 \}.$$
This spans the set of all polynomials ($P_2$) of the form
$$ax^2+bx+c,$$
and one vector in $S$ cannot be written as a multiple of the other two.
The vector space $\{ 1,x,x^2,x^2+1 \}$ on the other hand spans the space, but the 4th vector can be written as a multiple of the first and third (not linearly independent), thus it is not a basis.
Comment: great explanation!
Answer: The simplest possible basis is the monomial basis: $\{1,x,x^2,x^3,\ldots,x^n\}$.
Recall the definition of a basis. The key property is that some linear combination of basis vectors can represent any vector in the space.
If, instead of thinking of vectors as tuples such as $[1\ 2\ 4]$, you think of them as polynomials in and of themselves, then you see that you can make any real-valued polynomial of degree less than or equal to $n$ out of the monomial basis listed above.
You don't have to take the monomial basis. For example, you could have $\{1, x^2-4, x^3+x\}$ as a basis. But you cannot make every possible polynomial of degree $\le 3$ out of this basis!
Comment: But can you prove it is really a basis, namely they are independent
Comment: @Userkkr: Yes! Just create a matrix representation of Emily's suggestion. You will find the matrix is identity matrix.
Answer: For an example take the vector subspace of $\mathbb{R}[x]$ of all polynomials with real coefficients of degree at most 3.  The elements in there will all look like $a_0+a_1x+a_2x^2+a_3x^3$, where the coefficients $a_i \in \mathbb{R}$ can be thought of as coordinates with respect to the set of vectors $(1,x,x^2,x^3)$.  You can check that these are linearly independent and span the space, so that you have a 4 dimensional vector space over $\mathbb{R}$.  The distinct powers of $x$ act as independent placeholders with their coefficients being coordinates.
Answer: Polynomial vector spaces are easier to work with if you forget that they're polynomials and just focus on the coefficients. Then it becomes mostly notational. Let me show you what I mean.
Lets write the canonical basis vectors as $x_0=(1,0,0),x_1=(0,1,0),x_2=(0,0,1) \in \mathbb{R}^3$. This means I can write any vector $(a,b,c)$ as $ax_0 + bx_1 + cx_2$. But what if we used superscripts instead of subscripts to index them? This would give us $ax^0+bx^1+cx^2$. Now all we have to do is remember that they're polynomials again to get $a+bx+cx^2$. That gives us three ways of writing exactly the same thing: $$(a,b,c)\\ax_0 + bx_1 + cx_2 \\a+bx+cx^2$$
Notice that the polynomial being backwards is immaterial. Left, right, up, down, or stacking them in a matrix they're just placeholders for coefficients. We can just read off the canonical basis in our alternate notation as $1,x,x^2$. If I had used different basis vectors other than the canonical ones I would get different polynomials.
Comment: Is this concept can be applied to starting point for the construction of Regularity structure? If so how can I add a noise basis into it?

Basis of the polynomial vector space


Ethernet device works on certain ports on Ethernet switch but not on others

Question: I have a small and inexpensive ethernet switch which is giving me some headache. For some reason some devices only work when I plug them into specific ports. The ports are not broken, as other devices work on the same ports. Also, if I just take the cable from one of the ports that doesn't work and plug it into another port, it works fine.
When I say the devices don't work, they actually show activity on the LEDs such as LINK and ACT, but I can't ping them, but I have no explanation. I also tried to restart the switch, computer, flush ARP cache etc.
I read that some switches have automatic MAC address aging and learning. Could that be related?
They reason why I am asking is because soon I will undergo a massive operation where we have to connect hundreds of these devices to the network, and we plan to buy 48 port switches for this purpose. If they start playing strange games like this, I am absolutely unsure what is going on.
Could this be a problem with the switch, is this expected, or do you believe it is rather a computer problem or router problem (the switch is connected to a router), but I am not using a gateway on these devices or the computer (and as said, as soon as I plugin the devices on a different port, they start working).
Comment: What uptime does that switch has? It might be stuck and stop learning new MAC addresses. I would try to restart it and redo the tests.
Comment: "inexpensive" (aka consumer) switch... I'd start by fixing that problem first.
Comment: does the switch have any port settings like speed/duplex set , and does all the ports settings match ?
Comment: Is this a "dumb" switch - Does it have a management interface accessible via Telnet or HTTP for example?
Comment: It's a dumb switch. Restarting also doesn't help. Same thing happens if I change to a new unit of the same make/model, so it seems some "design" problem or maybe some fundamental Ethernet thing that I don't understand. I am using identical standard LAN cables (2ft or 3ft at this time) and identical devices at the end (with a MicroChip Ethernet Controller).
Comment: What is the other end? Some possible causes - try same hard code port parameters like duplex speed and negotiations
Comment: Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: Just because some devices will link doesn't mean the switch isn't still bad.  Some NICs will be more tolerant of marginal signaling and/or timing.
Personal example... I have a Nortel ERS with a damaged clock circuit (power outage killed it.) I've verified with a scope that the clock for the second half of the switch is noisy and marginally out of spec.  As a result, some network cards will link, and actually function. However, most, including the other half of the switch and every other switch I have, won't.  10M works fine, because the PHYs generate their own clock. 100M only works with "loose" NICs. 1000M won't even link with itself -- that signal is pure noise.
Cheap switches are cheap for a reason.  I'm not going to say how many sub-50$ "hubs" I've thrown away.
Comment: I have the same issues on identical new switches, so I don't think that it's a damaged clock circuit. Sometimes only power cycling ALL attached network equipment solves the problem, and it happens no matter what is connected (also computers etc).
Answer: One problem that I have experienced with cheap switches is that many don't have good Auto MDI/MDIX support. This means that the switch cannot detect the difference between crossover or straight-trough wiring and cannot adjust to the current wiring situation. The most common setup that I've seen is switches with some of each. Usually, the port marked 'uplink' is wired for crossover connections to other switches/routers, and other ports are setup for straight-through connections to client devices. I've also seen some switches that have a hardware toggle to change the wiring scheme of a port.
What I would suggest is to experiment with crossover and straight-through cables and see if that fixes the issue for those ports. In the long term, inexpensive consumer hardware is just not equipped to deal with many use cases and you may want to look into upgrading as some commenters suggested.
Comment: try a crossover cable
Comment: I am using identical brand new shielded straight through cables. They all work well.
Answer: As your switch doesn't support MDX so use appropriate cable type, if other end is also switch then use cross cable
Comment: Also don't post duplicate , kindly refer to the Q/A section as  significant time has been spend making is user friendly.
Comment: Acknowledged.It was not deliberately.
Also There is some solutions as well in my previous reply ( What is the other end?
Some possible causes - try same hard code port parameters like duplex speed and negotiations)
Answer: "Small and inexpensive" sounds to me that it's not a managed switch - so deactivated ports or ones configured to an incompatible mode can be ruled out.
The most likely issue is the cables you're using. Some cable connectors are rather short and some ports are rather deep, so when these two come together they don't link - or rather, they link only when the connector is pushed deep into the port and held that way.
Higher quality equipment has less tolerance and works more reliably.


How to sum value of a field in Stimulsoft Reports

Question: I am using Stimulsoft Reports. How can I get the sum value of a field in a table on the page, not all reported?
Answer: It is very simple to calculate totals of a container or a page. For this it is necessary to add before the name of an aggregate function the Latin letter 'c' in lowercase. For example:
<code>{cCount(DataBand1)}
</code>
This expression will return the number of rows of one page.
Notice. A page is a container too. Therefore, calculation of totals of a page goes the same way as calculation of totals of a container.
When calculation of totals of a panel or of a page it is necessary specify the Data band by what the aggregate function will be calculated. It is necessary because more than one Data band can be placed on one page.
Any number of aggregate functions can be used on one page or a panel. Stimulsoft Reports has no limit in it. It is possible to combine totals of a page with a condition. For example:
<code>{CountIf(DataBand1, Products.UnitsInStock = 0)}
</code>
The expression will return the number of elements equal zero on this page.
In Stimulsoft Reports calculation of totals can be produced in another way - instantly.
You should use the special Totals prefix. Calculation of totals occurs where the function is called, in contrast to standard results, calculations are performed while report rendering.
Consider the calculation of totals in a report by the example of a report with grouping.
Calculate the ratio of entries in the group to entries in the report and show the total in per cent. To do this, add a text component in the GroupFooterBand with the following
<code>{Count(DataBand1) / (double)Totals.Count(DataBand1)}
</code>
expression, where the Count(DataBand1) function will count the number of rows in the group, and the Totals.Count(DataBand1) function will calculate the number of rows in the report. To show the total value in per cent, you should to set the Text Format property of the text component to Percentage.
Answer: Dictionary->Functions->Totals-> SUM()..


PHP ZipArchive isn't creating a gs:// zip file in Google AppEngine, Warning: filesize(): stat failed for gs://

Question: I'm able to directly write and read files in Google Storage, but when I try to use ZipArchive to create a file, it fails. Google says that the zip extension is enabled in the GAE.
$tmpdirectory .= 'gs://#default#/tmp/user-'.$uid;
$uniqueid = uniqid() . time();
$user_visible_filename = 'export.zip';
$output_path = sprintf("%s/export.%s.zip", $tmpdirectory, $uniqueid);

$zip = new ZipArchive;
$res = $zip->open($output_path, ZipArchive::CREATE);
if ($res === true) {
    foreach ($data as $datatype => $records) {
        $filename = sprintf("%s/%s.csv", $tmpdirectory, $datatype);
        write_csv_to_filename($records, $filename);
        $localname = basename($filename);
        $fileresult = $zip->addFromString($localname, file_get_contents($filename));
        print "adding $localname... num files in zip: ".($fileresult ? "true" : "false")." -> ".$zip->numFiles."
\n";
    }
}

$closeresult = $zip->close();
print "user_visible_filename: $user_visible_filename
\n";
print "zip filename: $output_path
\n";
print "file size: ".filesize($output_path)."
\n";

header('Content-Type: application/zip');
header('Content-Length: '.filesize($output_path));
header('Content-Disposition: attachment; filename=' . $user_visible_filename);

The above code writes some csv files and I want to bundle them together in a zip file and have their browser download it. I know that the above headers() won't work because I'm printing stuff about before them; I'm going printing the stuff out to debug what's going wrong.
I am able to write each of the CSVs to gs:// and I'm able to access their correct filesize and read their contents back after writing them.
However, when I try to read the filesize() of the zip file (gs://#default#/tmp/user-152/export.5b4565bda18481531274685.zip) it craps out with a big warning message (cannot stat file) and stack trace as if the file doesn't exist.
$zip->close(); returns false which means there was a failure, but I have no idea why it failed.
Comment: What error are you seeing? Are you using standard or flex?
Comment: Another thing, what is the output of `$zip->close();`?
Comment: @FedericoPanunzio The error I'm getting is that `filesize()` cannot stat the file, because it does not exist. `->close()` returns `false`.
Answer: I found an alternative solution that worked: TbsZip
require_once '../inc/tbszip.php';
$tmpfile = tempnam('/tmp', 'export');
$zip = new clsTbsZip();
$zip->CreateNew($tmpfile);

foreach ($data as $datatype => $records) {
    $filename = sprintf("%s/%s.csv", $tmpdirectory, $datatype);
    write_csv_to_filename($records, $filename);

    $localname = basename($filename);
    //$fileresult = $zip->addFile($filename, $localname);
    $zip->FileAdd($localname, file_get_contents($filename), TBSZIP_STRING);
}

// Flush() will send all the required headers for downloading the file.
$zip->Flush(TBSZIP_DOWNLOAD, $user_visible_filename, 'application/zip');
$zip->Close();


Stress in negative words and flap "d" in "don't"

Question: I've learned that negative words like can't or don't are stressed in sentences. However, I've heard native speakers pronouncing phrases like I don't understand what's going on here, where don't is pronounced very fast and lightly, like a flap d. Is this so?
Answer: Yes, it happens.  Auxiliaries, including "do", are function words, and so can be unstressed, and before an unstressed vowel, intervocalic [d] can be flapped.  So after a vowel or diphthong, the [d] of "do[n't]" can be flapped.
Answer: In casual register under little-understood conditions, /n/ flaps as well as /t/ and /d/. In American English, this can lead to the impossibility of distinguishing "I can understand" and "I can't understand".


Optimization of psql querys called from perl

Question: I have been struggling for a while trying to optimize the time and resources consumed by a couple of querys Im calling from a perl script. The problem is as follows:
Expected behavior:
There is a table with over 4 millions registers, one of the fields (I'll call it f_path from now on) of this table is a string that stands for directory path that may or may not (most do)contain a substring in a date format. The behavior expected from the script is to take a sub-set of these registers, filter it using the date-like substrings from the f_path and store them in a local file to perform some operations on them and use the data in some graphic-generating functions. The filter is to work as follows: To get all the records with a correspoding date substring in the f_path, that are in a user defined date range. The user defines this range providing a last date (the newest date to be fetched) and a number that represent how many dates to fetch from the last date backwards. The dates follow a somewhat sequential pattern but that can't be counted on (there may be gaps). All the dates that comply with filter parameters provided by the user are to be stored in a variable in perl, in a file, or both, since they are to be used by other scripts later, and are also used to control the graph functions mentioned prevously.
Current behavior:
There is no filtering. The current query fetches all the 4 million+ registers and stores them in a file locally, then it runs yet another query on the same table that fetches all the distinct values for the f_path (a couple of values with the same date substring may be picked since the directory path may be differente even if the date is the same) and stores them in a local variable in perl, where later a regex is applied to fetch the date-like substrings and store them in a file. Problem: This is utterly inefficient since it is querying the whole table twice and recovering lots of data that isn't going to be used.
Fixes attempted:
Everything I have tried has, sadly, ended up being even slower than the current script:

Create a temp table from a select operation to the table with all the data, using the substring function, a regex, and the filter parameters provided by the user to obtain the set of dates (not the whole directory path that is the value f_path) to be used as a filter. Then make a join between this table and the table with the required data, on the f_path field (that is actually called proj_base), applying the substring function to get the date-like substring and verify if it matches with any of the values in the temp table. This approach has the added disadvantage that as with the current script, I will have to query the table again later in the script to get the set of dates that act as a filter. I might be able to use the temp table I created previosuly, but I'm not sure if it will still be around when I query again for the dates, havent tried that. It looks like this:

psql -U postgres -c "CREATE TEMP TABLE temp_filter_trees AS SELECT DISTINCT substring(proj_base, '[0-9]{4}_[0-9]{2}_[0-9]{2}') AS "TREE" FROM testcase ORDER BY TREE DESC LIMIT 30; SELECT mem_tot_size, mem_size_inc_pct, tot_sim_time, duration, cpu_util_pct, cpu_tot_time, result,
    test_host, proj_base, topology FROM testcase, temp_filter_trees WHERE substring(proj_base, '[0-9]{4}_[0-9]{2}_[0-9]{2}') = temp_filter_trees.TREE  " $proj > $dir/log_file;

Query the table for all the dates that comply with the filter parameters, using the substring function and regex and storing them in a list variable. Then loop applying a regex to the fields of this list variable to assertain that it only contains dates, and to build a regex with all of the dates to be used as a filter parameter in the query for al the data. Use the pattern obtained from the loop as a filter parameter in the query that fetches all the data. It looks like this:

@data = psql -U postgres -c "SELECT DISTINCT substring(proj_base, '[0-9]{4}_[0-9]{2}_[0-9]{2}') AS "TREE" FROM testcase ORDER BY TREE DESC LIMIT 30" $proj;
foreach(@data)
{
next unless m/(\d{4}\w{1}\d{2}\w{1}\d{2})$/;
if(defined $psqlpattern){
$psqlpattern = $psqlpattern ."|$1";
}
else{
$psqlpattern = "'" . $1;
}
push @trees, $1;

}
$psqlpattern = $psqlpattern . "'";
psql -U postgres -c "SELECT mem_tot_size, mem_size_inc_pct, tot_sim_time, duration, cpu_util_pct, cpu_tot_time, result,
    test_host, proj_base, topology FROM testcase WHERE proj_base ~ $psqlpattern" $proj > $dir/log_file;
Other Ideas: I also thought about just using the substring query on the f_path field in the query that fetches all the data, to check if the date-like substring is in the range specified by the user by just asking if it is older than the the last date and newer than the older date in the filter, that must have been previously fetched anyway. I haven't tried this but seemed that could be a t least a little more efficient that the other things I have tried.
Any insight or help you can provide will be greatly appreciated. Thanks for your time!
Answer: The perl i/o operations to read up the records is expensive, especially for 4M records. So the general approach I would recommend is to do as much work as you can within the database, and to concentrate on tuning the database queries. I would also try to achieve this with a single pass and to avoid copying the records to a temp table.
So as a starting point, perhaps see if you can achieve what you want with a single query that uses psql's SIMILAR TO operator, or possibly the regexp_matches function. Then add another condition to filter based on the date.


How can detect an 'end-of-file' error, using code, when using readLAS?

Question: While looping through my list of LAS files in a directory (I'm using readLAS to record warnings and errors for each file), at least one file gives an error message in the console window (i.e. ERROR: 'end-of-file' after 3355392 of 25918554 points). The error doesn't interrupt the loop but that file will be invalid. Is it possible to catch this in the code on the fly while reading the LAS file? Or does it have to be done after the loop finishes by reviewing message outputs in the console?
Answer: Your file is corrupted. The error is thrown from the LASlib library and is not strictly an error programmatically speaking. This is why no error or warning is thrown at the R level. It is printed in the standard R output so I guess the message can be captured with capture.output(). But anyway you should fix your file with e.g. las2las from LAStools.
Comment: thanks I'll go with the 'capture.output()'. Note, I tried the las2las tool from LAStools; but, while it allowed for further processing, it had truncated the data at the end-of-file part of the file. (this file I found out will be redelivered anyway).
Comment: If las2las truncates the file then `lidR` will likely truncate the file as well