Coordinate system in aircraft. Question about step between lines

Question: Good day! Can you help me? I doing a restoration of the plane's geometry. I want to do restoration use a theory. But I have not information about step (size) between B.L. (W.L.) lines. As example - this picture with bulkhead on which are B.L.4.,8.,12...
Comment: Given the general size of what you're restoring, is it more reasonable that the dimensions are shown in **inches** or in **centimeters**? The overall height seems to be about 68 units (i.e. 27.47 of them above the waterline, and 40.53 of them below the waterline), and the max width about 53 units (i.e. 26.66 of them to either side of the centerline). The lines themselves seem to be 4 units apart, both laterally and vertically. So if you can tell us if this is all in inches or centimeters (or something else, possibly) we can discuss everything else with specifics.
Comment: @RalphJ. In this blueprint are inches
Answer: The Vertical Centerline, BL4, BL8, BL12, and BL16 lines are each 4 inches apart; the WL20, WL16, WL12, and so on down to the Horizontal Centerline, aka the Waterline, are also all 4 inches apart.
So if you picture an X-Y axis with the origin of 0,0 at the point where the Vertical Centerline and the Horizontal Centerline meet...

The top center point would be at 0,27.47" (0 because it's on centerline, and 27.47 from the dimension showing the max height -- to the left of the drawing)
The next point on the outline, working clockwise, would be at 4, 27.159 (4 because the BL4 is 4 inches from the vertical centerline, and 27.159 because that's what's shown under BL4)
The next points would be 8,26.204 then 12, 24.530 then 16,21.973

After that, the points are no longer every 4 inches horizontally, but every 4 inches vertically:

18.275, 20 (using the distance from the Vertical CL on the WL20 line)
then 21.671, 16 then 23.982,12

and so on until reaching the Horizontal CL

26.660, 0 is the point on the horizontal CL

After that, the X values start to decrease, and the Y values become increasingly negative:

26.530,-4
26.136, -8

And so on down to the last WL line at -32 inches:

16.362, -32

Now the lines go back to every 4 inches horizontally:

16, -32.42 (very close to the prior point)
12, -36.192
8, -38.662
4, -40.071

And finally, the point at the bottom on centerline:

0, -40.530

And those are the points that the diagram provides for you.


Does the equation of continuity hold for turbulent flows?

Question: My textbook mainly deals with laminar flows. The book derives the equation of continuity, which states that the cross-sectional area times the velocity of a flow is always constant. But nowhere in the derivation does the textbook explicitly assumes that the flow is laminar. So, does the equation hold for turbulent flows too?
Answer:
The book derives the equation of continuity, which states that the cross-sectional area times the velocity of a flow is always constant. But nowhere in the derivation does the textbook explicitly assumes that the flow is laminar. So, does the equation hold for turbulent flows too?

That is only a special case of the equation of continuity for situation where density is regarded constant and velocity is constant across the cross-section of the pipe. In general, equation of continuity is $\partial_t \rho + \nabla\cdot(\rho \mathbf v) = 0$ and holds true even for turbulent flows if the mass of the fluid is locally conserved.
Answer: Continuity is just the principle of conservation of mass in differential form.
The full continuity equation is (in index notation):
$\frac{\partial \rho}{\partial t} = -\frac{\partial }{\partial x_i}(\rho u_i)$
For example, consider an infinitesimal control volume (CV). The equation says that the local $\rho$ (inside the CV) will decrease in time if the flux divergence term $\frac{\partial }{\partial x_i}(\rho u_i)$ is positive. The flux divergence term transports quantities from one region to another in a manner that the net contribution to the system remains fixed whereby if integrated over the domain and there are no sources at the boundaries, their contribution is zero.
This is a very fundamental conservation law, if we assume incompressible flow and that the density of individual fluid particles does not change but each particle may have different densities - you arrive at the form in your book. This is derived from first principles so any flow within these parameters, including turbulent flows, no matter how disorganized, follow the same mass conservation law.
Answer: In order to have such a relation, your flow needs to be be stationary, which is never the case for turbulent flows.
The conservation of the mass gives you the local continuity equation.
$$\partial_t \rho+ \nabla . (\rho \vec{v})=0 $$
For a stationary problem without sources, Ostrogradsky's theorem allows you to reach:
$$ \oint_S \vec{v}.d\vec{S}=0 $$
But this last step is not possible for turbulent flows.
Comment: Why is the last step not possible for turbulent flows?
Comment: Because the problem is never stationary.
Comment: Are you talking about a steady flow? The continuity equation for incompressible fluids (which is OPs question) doesn't care about time because the local density of the fluid does not change (although each particle may have different densities).
Comment: Hence, $D\rho/Dt = 0$, where D is the total/material derivative. Combining this with your 1st eq., it implies that $\nabla \cdot\mathbf{u} = 0$ (which is the same form for continuity as OPs question).


Detect and Erase specific pixels from an image

Question: Is it possible to detect (dynamically) the white pixels of an image and delete them? Actually i have some images that i load on stage but they are square without the actual image be a square sized.  So i want to make the  hit area exactly the shape of the image and not the whit border they have.
ps: In actionscript :)
Answer: You could do it by looping through the pixels, 1 at a time starting from top-left, and bottom-right till you find a non-white pixel.  Sort of like this...
First use getPixel
var j:Number = 0;
var i:Number = 0;
var tl_corner:Point; // top left corner
var br_corner:Point; // bottom right corner

for (j = 0; j < imageBitmapData.height; j++) {
    for (i = 0; i < imageBitmapData.width; i++) {
        if (imageBitmapData.getPixel(i, j) != 0xFFFFFF) {
            tl_corner = new Point(i, j)
        }
    }
}

for (j = imageBitmapData.height - 1; j >= 0; j--) {
    for (i = imageBitmapData.width - 1; i >= 0; i--) {
        if (imageBitmapData.getPixel(i, j) != 0xFFFFFF) {
            br_corner = new Point(i, j)
        }
    }
}

Now you have the top left and bottom right corners of the actual image, without the white.
Now use copyPixels
var bmd:BitmapData = new BitmapData(br_corner.x - tl_corner.x, br_corner.y - tl_corner.y, false, 0x00000000);
bmd.copyPixels(imageBitmapData, new Rectangle(tl_corner.x, tl_corner.y, (br_corner.x - tl_corder.y), (br_corner.y - tl_corner.y)), new Point(0, 0));

Now you have a BitmapData object with only the pixels you want.  Do with it as you please, maybe:
var s:Sprite = new Sprite();
var bmp:Bitmap = new Bitmap(bmd);
s.addChild(bmp);

Comment: This solution doesn't cater for images which are non-square within the area, for example if you use a circle on white as an example, then the top left point will be selected as the top middle of the circle, and the bottom right point will be selected as the bottom middle of the circle. Resulting in a zero or one pixel slice down the middle of the circle rather than the whole circle.
Answer: You can loop through the bitmap data, check each pixel and see if its colour matches the white border but may run into trouble if there are other white pixels in the image, unless you only check certain positions on the image and really this is starting to sound very messy.
EDIT:
From what I understand you have images with white borders along the outside and you do not want the borders to be part of the hitarea. What I propose is that you edit the images (externally in photoshop) and remove the white borders.
Then instead recreate these white borders as a seperate image with ActionScript. It would not be too hard to check the size of the actual image and then create a sprite a bit bigger and fill it with white. Then place the actual image on top of it and centered. So now it looks like the image has a border. You can place both the white fill image and the actual image in a container to make it easy to move them as one. You can also easily set the image to be the hitarea and not the border.
Comment: Sorry Allan can you restate the question, i can't figure out what you propose.


Can a hotel kick you out if you let an unregistered guest share a room with you?

Question: We are going to an event and because of this event all hotels are fully booked. Now a friend wants to join us, but can't find accommodation. We are okay with him crashing in our hotel room, either on the couch or on a self-inflatable mattress. We have done this in the past where we secretly sneaked the "guest" in.
It is not that we don't want to pay the tourist tax, it is that when ask and the hotel says no, we can't sneak him in, because we drew attention to ourself. In many hotels you can just order another bed, but there are also a lot that don't have that service.
I don't have any ethical problems with my behavior of secretly hosting a guest. I did pay for the room. I don't like being sneaky about it, since again I do pay for the hotel room. Also if I have to choose between sneaking someone in the room to crash on the couch or let him/her sleep on bench in the park. I opt for the first.
Am I just worrying to much and will being honest about it in the end be acceptable to most if not all hotels?
Comment: @andra When you book a room in a hotel, you are agreeing to a contract with certain terms and expectations on both parties. If you violate the terms of the contract, then the hotel is free to withdraw the services it agreed to provide you as stipulated in the contract and in applicable law.
Comment: You could also just call to ask if it's at all possible without mentioning your current booking, possibly pretending to plan another trip. Nobody is going to cross-check your name or phone number. Or have your friend call and explain the situation, in the unlikely event the conversation somehow goes badly and you want to take your chances, the hotel wouldn't know who to watch and you can still try it.
Comment: Your post implies that you can EITHER sneak them into a room OR let them sleep rough.  If you do not want your friend sleeping on a bench in the park, you can get them a room in another hotel. Or tell them not to come.  Nobody is FORCING you to act fraudulently! It's a contrived  rationalisation.
Comment: I've seen contracts that forbid unregistered guests after a certain time of night. Since you've done this before on the sly, you are probably aware that you are breaching the contract. If you don't invite them down to the free breakfast you'll probably get away with it, especially if you leave a good tip for the cleaners. The guest will consume more hot water, more toiletries etc. so you can't say what you are doing is completely honest.
Comment: I think it can vary a lot by country (rules, fire codes, average room size, taxes etc) - are you hoping for a general answer, or one specific to a particular country?
Comment: @choster The hotel might be free to withdraw the services it agreed to provide… or not, indeed as stipulated in the contract (which we don't know) and in applicable law (which we don't know either as the OP did not even specify a country). As a rule, if you violate the terms of a contract, you are still bound by it. You *might* be liable for damages and there *might* be any number of other consequences specified in the contract itself but it is certainly not automatically voided.
Comment: It is worth mentioning that God forbid there is a fire or other such evacuation, then maximum occupancy issues and liability on the hotel comes into play. It is not always a matter of extra fees.
Comment: @choster But my point is that we don't know the contract or applicable law. Following this logic, I could just as well write the exact opposite and it would be equally true.
Comment: @choster agreed. But is the number of particpants part of the terms and general conditions? I have specifically checked on two occasions and nothing was said about the number of occupants. Actually if you don't say so, you usually pay double toursits tax on booking.com booking, even if only details of one visitor is giving. So given this behavior by hotels, my behavior is just reciprocity.
Comment: @Annoyed We're in agreeement; I didn't say the contract was void, I said the hotel was *free to withdraw services... as stipulated in the contract and in applicable law*.
Comment: Some hotel are charge base on single occupancy(to be competitive) and the rate will reflect on number of occupancy and normal maximum allow is 4 person on double bed, for example: base rate is $99.00 with single occupancy add 2nd person is $15.00 more and the 3rd person is $25.00 also add 4th person is $25.00 more so the total 4 adult cost's:$164.00 plus applicable tax, but if you 2 adult and 2 children you only pay for 2 adult which is $99.00 + $15 =$114.00 plus tax.If more than 4 person hotel may not allow or may charge an extra fee for the fifth person, this is hotel discretion....
Comment: VTC as too broad since, like all legal questions, it is locale-dependent.
Comment: Related: 1) [Why do hotel booking sites ask for the number of people? Does it matter how many I say?](https://travel.stackexchange.com/questions/21347/why-do-hotel-booking-sites-ask-for-the-number-of-people-does-it-matter-how-many), 2) [Can I have an unregistered guest come over at a hotel?](https://travel.stackexchange.com/questions/60327/can-i-have-an-unregistered-guest-come-over-at-a-hotel)
Answer: The answer will vary from country to country and from hotel to hotel, but in general you're not allowed to do this and if the hotel finds it out, they can kick you out or charge you a fine.
In some countries they can even  throw you in prison (worst case). For example in the USA there is the Defrauding an innkeeper law:

A person who, with intent to defraud, procures food, drink or
  accommodations at a public establishment without paying in accordance
  with his agreement with the public establishment is guilty of:

A felony punishable by imprisonment for not more than ten (10)
  years, a fine of not more than ten thousand dollars ($10,000.00), or
  both, if the value of the food, drink or accommodations is one
  thousand dollars ($1,000.00) or more; or
Repealed by Laws 1984, ch. 44, 3.
A misdemeanor punishable by imprisonment for not more than six
  (6) months, a fine of not more than seven hundred fifty dollars
  ($750.00), or both, if the value of the food, drink or accommodations
  is less than one thousand dollars ($1,000.00).

I think in the most cases you will have to pay an extra fee.
Comment: A) Assuming they pay in accordance with the contract (and don't give false statements), that law doesn't apply. B) "in the USA" is misrepresenting the extent of the jurisdiction in which that law applies. This law is only in Wyoming. Saying "in the USA" for that law is roughly equivalent to saying "in the EU" for a law that only exists in Greece. C) OTOH, what's defined in the law you quote is covered under general fraud laws in most/all US states, and most countries (assumed). Other jurisdiction just don't explicitly define special conditions for types of fraud involving innkeepers.
Answer: As far as my experience is concerned, it is the registered guest's prerogative as to whether to entertain guests in their room.  If this were not the case then romantic rendezvous in hotels would not be permissible.  I've never had a hotel decline this privilege and in many cases I have requested additional room keys for my guests.  Of course, the maximum occupancy of the room must be observed.
Comment: As a rule of thumb, if a hotel has different prices depending on how many people book the same room, they almost certainly *do* care how many people turn up. If they don't, they probably don't, a room is a room. It also varies a lot from country to country - Japanese 'love hotels' have specially designed discreet entrances so the neighbours can't see who your secret guest is (or how many secret guests you bring!), while in various strict theocracies (e.g. UAE), if you and your romantic guest aren't married, it might be a criminal offence.
Comment: Some hotels do frown upon romantic rendezvous (not sure how far they can or would go to fight it though).
Comment: @user3712539, you are saying that they let unmarried couples share a hotel room in Texas? O tempora o mores!
Comment: I'm sure the class of hotel makes a difference.  The Four Seasons in San Francisco and Denver were always accommodating.  The Super 8 may not be so much.
Comment: @user3712539 The thing is, no one at a Super 8 is paid enough to care.


How i can translate uppercase to lowercase letters in a rewrite rule in nginx web server?

Question: I need to translate the address:
www.example.com/TEST  in ---> www.example.com/test
Answer: Yes, you are going to need perl.
If you are using Ubuntu, instead of apt-get install nginx-full, use apt-get install nginx-extras, which will have the embedded perl module.
Then, in your configuration file:
  http {
  ...
    # Include the perl module
    perl_modules perl/lib;
    ...
    # Define this function
    perl_set $uri_lowercase 'sub {
      my $r = shift;
      my $uri = $r->uri;
      $uri = lc($uri);
      return $uri;
    }';
    ...
    server {
    ...
      # As your first location entry, tell nginx to rewrite your uri,
      # if the path contains uppercase characters
      location ~ [A-Z] {
        rewrite ^(.*)$ $scheme://$host$uri_lowercase;
      }
    ...

Comment: Works well, although my query params do get stripped.
Comment: Also made a gist for anyone who actually uses those. https://gist.github.com/KalobTaulien/eb5851ee42343aac614ab6e6cfe90245 It's basically the same code, but the way I explained in the comment above — a little more newbie friendly
Comment: This is brilliant, I was looking for something else and this fits perfectly. Kudos to you sir!
Comment: nginx-extras on ubuntu 22.04 does not have perl
Comment: This worked for me. On ubuntu I needed to `apt-get install nginx-extras`. And the `location ~ [A-Z] {...` code I put inside a specific nginx conf file (for servers that have multiple sites on them)
Answer: location /dupa/ {
    set_by_lua $request_uri_low "return ngx.arg[1]:lower()" $request_uri;
    rewrite ^ https://$host$request_uri_low;
}

Comment: you might want to use a 301 instead of 302 for SEO purposes like: `rewrite ^ https://$host$request_uri_low permanent;`
Comment: ...and `return`: `return  301  $request_url_low`.
Comment: Nginx config failes to reload, how to instal lua support?
Answer: i managed to achieve the goal using embedded perl:
location ~ [A-Z] {
  perl 'sub { my $r = shift; $r->internal_redirect(lc($r->uri)); }';
}

Comment: It may solve the posted issue, but "ignoring case" AND "lowering case" are two completely different things.
Comment: This way compatible if you want to not rewrite address and answer true page with any case in address field.
Thaks for additional way to resolve the issue.
Answer: location ~*^/test/ {
  return 301 http://www.example.com/test;
}

A location can either be defined by a prefix string, or by a regular expression. Regular expressions are specified with the preceding "~*" modifier (for case-insensitive matching), or the "~" modifier (for case-sensitive matching).
Soruce: http://nginx.org/en/docs/http/ngx_http_core_module.html#location
Answer: Based on Adam's answer, I ended up using lua, as it's available on my server.
set_by_lua $request_uri_low "return ngx.arg[1]:lower()" $request_uri;
if ($request_uri_low != $request_uri) {
   set $redirect_to_lower 1;
}
if (!-f $request_uri) {
    set $redirect_to_lower "${redirect_to_lower}1";
}
if ($redirect_to_lower = 11) {
    rewrite . https://$host$request_uri_low permanent;
}

Comment: Be careful with this answer. If is evil: https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/
Comment: @MacroMan It can be unsafe only if used in the `location` context and depends on what is following this configuration fragment. For the most cases this one should be completely safe.
Answer: I would like to point out that most of Perl answers are vulnerable to CRLF injection.
You should never use nginx's $uri variable in a HTTP redirection. $uri variable is subject to normalization (more info), including:

URL encoded characters are decoded
Removal of the ? and query string
Consecutive / characters are replace by a single /

URL decoding is the reason of CRLF injection vulnerability. The following example url would add a malicious header into your redirect, if you used $uri variable in the redirection.
https://example.org/%0ASet-Cookie:MaliciousHeader:Injected
%0A is decoded to \n\r and nginx will add into headers the following lines:
Location: https://example.org
set-cookie: maliciousheader:injected

The secure Perl redirection requires to replace all newline characters.
perl_set $uri_lowercase 'sub {
    my $r = shift;
    my $uri = $r->uri;
    $uri =~ s/\R//; # replace all newline characters
    $uri = lc($uri);
    return $uri;
}';

Answer: Redirect with LUA module.
load_module /usr/lib/nginx/modules/ndk_http_module.so;
load_module /usr/lib/nginx/modules/ngx_http_lua_module.so;

set_by_lua $uri_lowercase "return string.lower(ngx.var.uri)";
location ~[A-Z] {
  return 301 $scheme://$http_host$uri_lowercase$is_args$args;
}

Answer: I've seen this code all over the internet, and it does work. However, it uses the host name that the nginx server receives. In the case of a Kubernetes infrastructure, this may not be the same as what the client uses so the redirect will not only fail but give away private information about the cluster naming scheme.
This code works for me and is slightly faster because it uses internal redirection
sub {
    my $r = shift;
    my $uri = $r->uri;
    $uri =~ s/\R//; # replace all newline characters
    $uri = lc($uri);
    $r -> internal_redirect($uri)
}

It might be used in an nginx configuration file like this:
user        nginx; # Not important for this answer, use any user you want
                   # but nginx is a sensible default.

# Load the Perl module
load_module /usr/lib/nginx/modules/ngx_http_perl_module.so;

...

http {
    server {
        # Given any location that contains an upper-case letter
        location ~ [A-Z] {
            # Lowercase it and redirect internally
            perl 'sub {
                my $r = shift;
                my $uri = $r->uri;
                $uri =~ s/\R//; # replace all newline characters
                $uri = lc($uri);
                $r -> internal_redirect($uri)
            }';
        }

        # This can be any set of rules, below is a simple one that hosts
        # static content. It will receive the lower-cased location and
        # serve it.
        location / {
            root  /usr/share/nginx/html;
            index index.html;
        }
    }
}

My Dockerfile starts with this line and doesn't require additional packages:
FROM nginx:1.23.4-perl

In this example you will want to copy your static site to /usr/share/nginx/html for example:
COPY nginx.conf /etc/nginx/nginx.conf
COPY src/ /usr/share/nginx/html


How prevent Pixel 2 from sleeping while dictating?

Question: I just dictated a long email message, but several times during the dictation, my Pixel 2 went into sleep mode, so I had to unlock it to continue dictating. Is there a setting I have to modify to keep it from doing this?
Answer: I saw a reviewer talking about that and i believe there is no fix in settings for that but I can recommend you an app called caffeine that keeps your phone awake for a set amount of time


Star Trek book with a battle (ongoing in the story) that is so large it looks like a sun

Question: I am trying to find a Star Trek book where a battle is occurring. The battle is so big that it looks like the sun. The battle occurs at the end of the book
Comment: This is nowhere near enough information for anyone to figure it out for you. We'll need a lot more than one sentence. When did you read it, was the book new at the time, what era of *Star Trek* was it, any characters who were in the book, what the cover looked like, etc.. Anything you can remember can help.
Comment: Especially the era and characters.  Another thing would be the races involved and the names of any ships.
Answer: The Voyager novel Ragnarok is about two races locked in combat - their weapons were underdeveloped compared to their shield technology, so the battle consisted of millions of ships pressing against one another until a ship's shields failed and it was crushed.
Voyager approached, mistaking it for a strange star based on the energy output, I believe.
After trying to determine the cause of the battle, of which both sides do not remember how it started, Voyager somehow gets involved (naturally) and finds a way to shift the frequency of their phasers to slice through the ships, destroying many on both sides of the conflict.
In the end, both sides agree to a cease fire to fight their new enemy, the Federation. The only problem is that their top speed was warp 1 or 2, so they won't be in Federation space for a thousand years.
Comment: "Voyager... finds a way to shift the frequency of their phasers to slice through the ships, destroying many on both sides of the conflict" — yikes! Doesn't sound very Federation-y.
Comment: Which book is this?
Comment: Yup sure sounds like the Voyager novel Ragnarok.  I have read it and own it.  The above answer is more or less a direct excerpt from that novel.
Comment: I believe it was Ragnarok.
https://www.amazon.com/Ragnarok-Star-Trek-Voyager-No/dp/067152044X
Answer: Are you talking about the novelization of Star Trek: Insurrection?
Chapter 13, page 279:

Picard closed his eyes, but for a blazing milli-second, it was like staring wide-eyed at a daytime sun...then the brightness dimmed....

It's not really that big of a battle though; this was just a struggle between Picard and Ru'afo.


How can I share my clipboard between two Macs?

Question: Is there an easy way I could send clipboard data from one Mac on the LAN to another?
Answer: You can't do this with built-in methods, of course. I've researched a bit and here are the results I could find:
Simple clipboard sharing for OS X
There are a couple of simple tools that claim to do this.

ClipCommControl is freeware and has support for 10.4 and 10.5, 10.6 and above untested.
Stuf is a Windows/Mac clipboard manager that also synchronizes between machines. It offers a free 30 day trial. Seems like a more recent app that is also under active development.
ClipboardSharing is rather old, and was written at the time of OS X 10.3. However, it seems to run and install on 10.6 too. It's freeware.
ClipboardMultiSharer is Java based, therefore works on a few platforms, but isn't that pretty. It's also free.

Here is an article from 2009 that mentions a couple clipboard managers for OS X, of which only Stuf is mentioned as having the capabilities you look for.
Synergy
If you're up to something more sophisticated, a program like Synergy, free and open source. It allows you to switch between different machines at the same time, and as a bonus, it also shares your clipboard with those.
Might be a bit over the top for just clipboard sharing, but it's something worth taking a look at if you control multiple machines at the same time.
Comment: an anonymous user provided this info: I tried ClipCommControl on 10.6.8 as a standard user and it won't get past the splash screen .    ClipCommControl  10.6 doesn't work (at least if you are not an admin on your mac) 10.7/10.8 untested, but unlikely to work if 10.6 doesn't.
Answer: Teleport, a virtual KVM switch, includes an option to synchronize the clipboards.  It installs as a pref-pane on each computer.  I use it regularly between an iMac and a Macbook.
Comment: Very cool. Is a great replacement for VNC also.
Answer: Clipboard sharing is built into the OS X screen sharing application.
Answer: Synergy 2 allows for keyboard/mouse sharing across multiple platforms
http://synergy-foss.org/
Answer: Command-C is another app via AppStore. Actually this app is to share clipboards with iOS (to and from iOS devices) on the same network, but in the FAQ page the developper writes you can share clipboards with another Mac as well.


Determining if a context-free grammar produces even-length strings

Question: Given a context-free grammar, is there an algorithm to determine if the CFG will ever produce an even length string? Or is this undecidable?
Answer: There is an algorithm:
Recall that given a CFL $L$ and a regular language $K$, the language $L\cap K$ is also CFL (and a CFG for it is computable given a CFG for $L$ and a DFA for $K$).
Now, observe that the language $K=\{w: |w| \text{ is even}\}$ is regular.
From this we conclude that given a CFG $G$, we can construct a CFG for the language $\{w: |w|\text{ is even and }w\in L(G)\}$, and we observe that this language is nonempty iff $G$ generates a word of even length.
Since checking emptiness of CFG can be done in polynomial time, we can solve the problem in polynomial time.
Comment: Regarding polynomial total time, it should be noted that intersecting $L$ and $K$ is also possible in that time. Do we need a DFA for that step?
Comment: Note that $K$ here is constant, so we don't really need the DFA, as the construction is fixed. We also don't *really* need the fact that the runtime is polynomial, but rather that is is polynomial in $L$. Thanks.
Answer:
The language of all even-length strings is regular, and you can construct a DFA that recognizes it.
The intersection of a regular language and a context-free language is context-free, and you can construct a CFG for it.
Given a CFG, it's decidable whether the language it generates is empty.
The language from (2) is empty as in (3) iff your context-free language generates no even-length strings.

See this for details.
Answer: Of course there is a meta-algorithm via automata and intersection constructions. Here is an algorithm that works out of the box, no tools needed.
We mark any variable in the grammar as "even" and/or "odd". Variables can have either no, one or zero marks. For simplicity we assume the grammar is in Chomsky normal form, but the trick can be reformulated for general grammars.

For any $A\to a$ mark $A$ as "odd"

Repeat as long as variables get new marks:

For $A\to BC$, if $B$ and $C$ are marked, carry the mark over to $A$ according to parity ("odd"+"odd"="even", etc.)

Yes, I know that is an implementation of "CFG emptiness" and "intersection with even length strings" merged, but still I like it.
Comment: Then, I would determine if the grammar produces an even string if S is ever marked even. Because a variable can be marked as both even or odd at different times.


An orbiting space ship visible from earth

Question: How large does an orbiting space ship have to be in order for it to be visible from earth? I'm assuming I could crunch out some numbers to determine this, but I can see the calculations getting quite complicated. I also understand that its visibility might be effected by day light, so if it can only be discernible at night that's ok.
Comment: Obviously the visibility (I assume with the naked eye?) depends on how much light it emits or reflects. Could you perhaps state how reflective it is (sometimes called albedo) or if there are any light sources? How far away is it supposed to be? Please also see https://en.wikipedia.org/wiki/Satellite_flare
Comment: What qualifies as "visible" here? A faint point of light? or does it have to be large enough in the sky to see its shape?
Answer: You can see hundreds of satellites with the naked eye.
Exact conditions for visibility will be dependent upon altitude, size, and reflectivity. As reported most of the visible ones are typically 20 feet or larger across.
With just the right angle, solar panels could be considerably smaller as they are very flat surfaces that reflect some light like a mirror.
Sputnik-1 was barely visible to the naked eye, magnitude 6. A sphere 23 inches in diameter and highly polished. This is about as small as possible, unless you consider something smaller that focuses the reflected sunlight to the observer (like a solar panel).
An active light emitter such as a small cluster of LED bulbs could be smaller yet and be visible as long as the total lumens would result in a 6th magnitude source.
Perhaps you actually intended to consider the resolving power of the human eye instead. What it the difference? Thousands of stars are visible, but only the sun has a visible diameter. I.e. of all the stars, only the sun can be resolved by the naked eye.
Generally, 20/20 vision is considered to have a resolution of about 1 arc-minute, which would require something about the size of the ISS (100 meters) when under optimal viewing conditions.
Answer: Not. You can see the ISS with binoculars if the light is right.
Comment: You don't even need binoculars. I've seen it a couple of times, using only my eyes. If you are looking in the right direction at the right time, it looks like a bright star moving through the sky. It's quite easy to see.
Comment: This has ended up in the low-quality queue, so there's a chance it will be removed. Try expanding it and adding some more details.


Is there a creature half dragon and half horse?

Question: Is there a specific such creature, with a name for it and description, in any lore or game?
Comment: I'm voting to close this question because it is not about a role-playing game.
Answer: In D&D 3/3.5e there is a creature called a Dragonnel (p.151-152 of the Draconomicon).  While not strictly a half-horse/half-dragon it serves the purpose being essentially a winged steed that very much looks like a scaly horse with dragon wings.  It also has a little bit more background then the templates below.
Both D&D 3.x and Pathfinder have the half-dragon template which entirely applies to horses D20SRD/Pathfinder SRD.
Pathfinder Bestiary 2 also has a creature called a Dragon Horse however this is not a draconic creature but merely a horse that flies.  The Dragon Horse is also in the Tome of Horrors (Complete for Pathfinder rules, Revised(p.167) for D&D rules).  It looks like the Bestiary 2 version is probably based partially off of this and the original Gary Gygax version.
In Dragon Magic, there is another dragon/horse hybrid that might work: the Drakkensteed.  Best link I could find talking about it is here.
Comment: Here's a link to a wiki containing an Dragonnel image: http://kahdnd.pbworks.com/w/page/5588862/Dragonnel
Answer: The Qilin or Kirin is a creature of Chinese mythology that has been described in various ways, one of which is a half-dragon, half-horse or half-deer.
The "Ki-rin" appears in the (A)D&D monster manuals as early as 1st edition AD&D's Monster Manual (1977), where it is depicted as a scaled, Chinese-dragon-headed, hoofed equine that flies but is wingless (much like Chinese dragons). In D&D they are very rare and very intelligent, and as likely to serve as mounts as Western unicorns, i.e., not very often at all.
Answer: sounds like something out of Gamma world O_O
Though, from some checks around... there is at least a drawing someone made based on... apparently, the same topic that popped up for a discussion.  You can see the image here if you want something to start with.  Also, from another page talking about a person who rides a half-dragon/half-horse
If the Valor d10 game was out, that could most likely be accomplished within 5 min for a monster make.
But I do agree from most people's perspective... how would that happen?


What is "empirical regression"?

Question: I was asked how much I know of "empirical regression." I have never heard the expression. A web search yielded nothing useful. I suspect it is a term coined by someone to refer to some ad hoc procedure which might be known by other name.
Has anyone have a reference?
Comment: On the contrary, I suspect it's just regular old regression, with an emphasis on empirical use rather than its theoretical properties.
Comment: Context would be helpful: I suspect it's the model that's empirical rather than some special regression technique's being used. An empirical model is one flexibly parametrized to cope well enough with the unknown form of the true relationship between predictors & response (e.g. using polynomials or splines to allow for non-linearity); a theoretical model is one whose form & parameters are determined by theory (e.g. estimating $V_\mathrm{max}$ & $K_\mathrm{M}$ for the Michaelis-Menten kinetic model from substrate concentration & initial rates).
Comment: Could you provide us with a little more context?
Comment: They might mean nonparametric regression, e.g. kernel regression or as others have said, using things like splines. Probably best to respond back to that person, no I haven't heard of it - can you explain what it is in more detail?
Comment: The context does not help. I was being probed on my modeling background. I was given a laundry list of of topics to self-asses my experience with them. One of the items was "Regression (empirical and Bayesian)." I answered I hadn't heard of "empirical regression." When I search for the term I could not find anything. Thanks for the answers.
Answer: Empirical regression is a technique in non-parametric regression. The key idea is to estimate the joint density of X, Y, denotes p(X,Y). From this joint density one can derive conditional p(Y|X), and conditional mean E(Y|X). This E(Y|X) is empirical regression. This empirical regression technique was proposed by Schmerling and Peil (1985).
It is described in Hardle (1990): Applied Nonparametric Regression. Here is a link to the page
Here is the original reference
Comment: Is there an R package which (reliably) implements empirical regression?
Answer: If this was in the context of cognitive psychology or especially psycholinguistics and/or eye-tracking, they may have been talking about linear regression with an emirical logit transformation, which is a way of avoiding having to do logistic regression.
Empirical logit regression involves creating bins of observations and applying a modified logit transformation that adds $\frac1{2n}$ successes to each bin to avoid (negative and positive) infinitity for bins with $0$ successes or $0$ failures, then doing linear regression using a weighted least squares.
This is potentially attractive in some situations where it's hard to fit logistic regression, and there have been some arguments for using it with data where the sample rate exceeds the rate of the phenomenon you're sampling (as with modern eye-trackers, which far exceed human saccade frequency). There are some drawbacks to not actually doing logistic regression though.

What is "empirical regression"?


Time series clustering on large data

Question: I am trying to do K-means clustering on my data which has time series length of 3700 and for (latitude,longitude) points of around 6000 in length. However, timeseries clustering using tslearn package even with joblib capabilities is painstaking slow. I m trying to cluster using dynamic time wrapping method. Can anyone suggest better method to cluster my data.
I have tried all the packages in python without any leads. Please let me know if any implementation of time-series clustering available with dtw metric which works in parallel.
Answer: A good answer has already been given, but here's an alternative method. It is a very simple summary of a paper by Rob Hyndman

Let each time series be $X_i = (X_{i,1}, X_{i,2}, \ldots )$. They do not need to be of equal length or be sampled at the same time points.
Obtain summary statistics of each $X_i$; $\theta_i$ for each time series. Relatively simple models like bin smoothers, splines or low order polynomials might be effective.  You could also experiment with moments of $X_i$. You will need to fit the same type of model/calculate same summaries for each time series for this method to work. The linked paper gives many more details.
Perform clustering on $\theta_i$ using e.g. $k$-means.

In my experience, I have founds this to be much faster than DTW. In a recent example, I clustered ~10s of thousands time series in ~15 minutes using a method based on this approach. The 15 minutes included model selection (number of bins in a bin smoother) as well as simultaneously choosing $k$ for $k$-means. Timing will depend on your machine and chosen language, but DTW could have taken a week or so for my example.
Comment: Dear @jcken, First of all, thank you for your response. Coming from a climate research background I am poor at programming things from scratch. If you can point me to a repository (preferably python) through which I can implement this, It would be a great help. I am working on finding time series clusters for rainfall and identifying major clusters on which I have to further carry out my analysis. Thank you.
Comment: Unfortunately, I'm not a python programmer. I would however imagine that `scikit-learn` has all, or at least most, of the functionality you need for modelling and clustering. Programming is a bit off-topic on CV, I'd take your questions about the programmatic implementation of your methods to stack overflow
Answer:
Instead of DTW, use cDTW, with a constraint of about 5%. That will give a ~20 times speed up

If the data is oversampled (as most data is) you can downsample it before using DTW. Since the time is quadratic in length, if you downsample by say 1 in 3, that would be about nine times faster.

You can combine ideas '1' and '2' to get about 200 times faster...

PS, DTW is not a metric, it is a measure
https://www.cs.unm.edu/~mueen/DTW.pdf
Comment: Dear @Eamonn, I followed your work and humbled by your response. Thanks much for your quick reply and help. 1. I will definitely try that (https://github.com/halachkin/cdtw): Please confirm that this link is the same cDTW that you are speaking about. I am a climate researcher with elementary programming skills. 2. I am trying to cluster my rainfall time series (1 day time resolution) undersampling meaning may be I can take monthly averages and then use cDTW? I appreciate your help. this greatly helps my research work. PS: Tq for the powerpoint presentation

Time series clustering on large data


How Do I Convert an Integer to a String in Excel VBA?

Question: How do I convert the integer value "45" into the string value "45" in Excel VBA?
Answer: CStr(45) is all you need (the Convert String function)
Comment: this will not work for e+ converted numbers! i.e 7.7685099559e+11 will be shown as "7.7685099559e+11" not as expected: "776850995590"
So I rather to say this will be more generic one:`CStr(CDbl(***))`
Comment: It may answer the question's needs, but it's also incomplete and insufficient in some circumstances. Often (e.g. for file-naming purposes) you might want to create zero-prefixed numbers, such that `7` becomes `007`.  You may also want to specify the number of decimals or include thousand separators. If these details are important to you: https://www.excelfunctions.net/vba-format-function.html
Answer: Try the CStr() function
Dim myVal as String
Dim myNum as Integer

myVal = "My number is:"
myVal = myVal & CStr(myNum)

Answer: Most times, you won't need to "convert"; VBA will do safe implicit type conversion for you, without the use of converters like  CStr.
The below code works without any issues, because the variable is of Type String, and implicit type conversion is done for you automatically!
Dim myVal As String
Dim myNum As Integer

myVal = "My number is: "
myVal = myVal & myNum

Result:

"My number is: 0"

You don't even have to get that fancy, this works too:
Dim myString as String
myString = 77

"77"

The only time you WILL need to convert is when the variable Type is ambiguous (e.g., Type Variant, or a Cell's Value (which is Variant)).
Even then, you won't have to use CStr function if you're compounding with another String variable or constant. Like this:
Sheet1.Range("A1").Value = "My favorite number is " & 7

"My favorite number is 7"

So, really, the only rare case is when you really want to store an integer value, into a variant or Cell value, when not also compounding with another string (which is a pretty rare side case, I might add):
Dim i as Integer
i = 7
Sheet1.Range("A1").Value = i

7

Dim i as Integer
i = 7
Sheet1.Range("A1").Value = CStr(i)

"7"
Comment: I don't understand why this answer doesn't have more votes, given it is true. It is worth noting that type conversion is not *always* carried out, it depends on the operator in use. For example the + operation will not always widen an integer to a string.
Comment: @MarkCh I know this is old, but... perhaps because VBA's obnoxious implicit conversions and default member calls are what makes so much VBA code frail, surprising and bug-prone? There wouldn't be half as many VBA questions on SO if it wasn't of implicit conversions, implicit accessibility, implicit default member access, implicit 1-based arrays with `Option Base 1`, implicit typing with `Def[Type]` (boy that's EVIL!), implicit... you get it - the only good implicit thing in VBA is the implicit call syntax that made the explicit `Call` obsolete.
Answer: In my case, the function CString was not found.
But adding an empty string to the value works, too.
Dim Test As Integer, Test2 As Variant
Test = 10
Test2 = Test & ""
//Test2 is now "10" not 10

Comment: Nobody talked about `CString`, which is a VB.NET function. Concatenating an empty string literal to make a string is a pretty lame conversion method. Use `CStr` for explicit type conversions - this is an implicit type conversion and raises eyebrows of anyone reading that code. Sorry I found this answer so late after it was posted, I wish I could have downvoted it much earlier.
Answer: The shortest way without declaring the variable is with Type Hints :
s$ =  123   ' s = "123"
i% = "123"  ' i =  123

This will not compile with Option Explicit.  The types will not be Variant but String and Integer
Answer: If the string you're pulling in happens to be a hex number such as E01, then Excel will translate it as 0 even if you use the CStr function, and even if you first deposit it in a String variable type.  One way around the issue is to append ' to the beginning of the value.
For example, when pulling values out of a Word table, and bringing them to Excel:
strWr = "'" & WorksheetFunction.Clean(.cell(iRow, iCol).Range.Text)

Answer:
    Sub NumToText(ByRef sRng As String, Optional ByVal WS As Worksheet)
    '---Converting visible range form Numbers to Text
        Dim Temp As Double
        Dim vRng As Range
        Dim Cel As Object

        If WS Is Nothing Then Set WS = ActiveSheet
            Set vRng = WS.Range(sRng).SpecialCells(xlCellTypeVisible)
            For Each Cel In vRng
                If Not IsEmpty(Cel.Value) And IsNumeric(Cel.Value) Then
                    Temp = Cel.Value
                    Cel.ClearContents
                    Cel.NumberFormat = "@"
                    Cel.Value = CStr(Temp)
                End If
            Next Cel
    End Sub

    Sub Macro1()
        Call NumToText("A2:A100", ActiveSheet)
    End Sub

Reffer: MrExcel.com – Convert numbers to text with VBA
Answer: The accepted answer is good for smaller numbers, most importantly while you are taking data from excel sheets. as the bigger numbers will automatically converted to scientific numbers i.e. e+10.
So I think this will give you more general answer. I didn't check if it have any downfall or not.
CStr(CDbl(#yourNumber#))

this will work for e+ converted numbers! as the just CStr(7.7685099559e+11) will be shown as "7.7685099559e+11" not as expected: "776850995590" So I rather to say my answer will be more generic result.
Regards,
M
Answer: Another way to do it is to splice two parsed sections of the numerical value together:
Cells(RowNum, ColumnNum).Value = Mid(varNumber,1,1) & Mid(varNumber,2,Len(varNumber))

I have found better success with this than CStr() because CStr() doesn't seem to convert decimal numbers that came from variants in my experience.
Answer: If you have a valid integer value and your requirement is to compare values, you can simply go ahead with the comparison as seen below.
Sub t()

Dim i As Integer
Dim s  As String

' pass
i = 65
s = "65"
If i = s Then
MsgBox i
End If

' fail - Type Mismatch
i = 65
s = "A"
If i = s Then
MsgBox i
End If
End Sub

Answer: It might be worth adding a trim to your conversion too, as integers convert with a leading space for inferred (positive sign) and applied (negative sign) values.
For comparison:
1/
lsDogsAge = "Barker is " & Cstr(liAgeInteger) & "years old"

2/
lsDogsAge = "Barker is " & Trim(Cstr(liAgeInteger)) & "years old"

1/ Barker is__7
2/ Barker is_7
Ironically this forum's software automatically truncates double spaces, so I've use underscores


I have 4 GB RAM in both of the available slots; can I upgrade one of them to 8 GB?

Question: Does having unequal size RAM affect performance?
I want to make this upgrade because I run out of RAM while playing games and doing other resource-intensive stuff. My PC is a Dell 7577.
Will it run in single channel or dual channel after the upgrade?
Answer: Yes you can.
See the specs:

Per slot: 4 GB, 8 GB, 16 GB
Total memory: 4 GB, 8 GB, 12 GB, 16 GB en 32 GB

You can only get to 12GB with one 4GB and one 8GB module. But they don't say 20GB or 24GB.
Answer: After the upgrade it may run in single channel, fully or partly.
For full dual channel, both RAM sticks must be totally identical in all respects.
Otherwise, with 4GB+8GB, and if your motherboard supports it, you will be
running in
Flex Mode,
where only the lower 4GB of both sticks run in dual channel mode.
However, dual channel is unlikely to have any impact on the performance,
so isn't an important consideration here.
Comment: To add on that last line, the difference between running Single Channel and Dual Channel is barely a 1% difference, based on a series of testing between different RAM configurations running different games: https://techguided.com/single-channel-vs-dual-channel-vs-quad-channel/
Answer: Most motherboards will drop to single channel if the channels have unequal memory sizes. While this is a significant effect on synthetic benchmarks, it's a very minimal effect in the real world. In any event, the benefits of having more RAM (such as additional caching) will drastically exceed the penalty of losing dual-channel when looking at overall system performance.
Comment: I saw several comaparisions in youtube between single and dual channel for gaming. There's more than 10% difference in the fps


Can we define a function with 0 argument in ocaml?

Question: In other languages, we can have a function which takes no arguments. Can we have 0 argument function in ocaml?
Answer: Functions in OCaml have exactly one argument (ignoring complications due to optional arguments). So, you can't have a function with no arguments.
As @alfa64 says, you could consider a simple value as a function with no arguments. But it will always have the same value (which, in fact, makes it similar to a pure function).
If you want to write a function that doesn't actually require any arguments (one that has side effects, presumably), it is traditional to use () as its argument:
# let p () = Printf.printf "hello, world\n";;
val p : unit -> unit = <fun>
# p ();;
hello, world
- : unit = ()
#

Answer: In OCaml functions always have an arguments. Therefore, we might wonder how to translate the following say_hello C function in OCaml:
void
say_hello()
{
    printf("Hello, world!\n");
}

There is a special type unit in OCaml which has only one value, written as (). While it might look odd and useless, it adds regularity to the language: a function not needing a specific argument can just take an argument of type unit, a function not returning a useful value usually returns a value of type unit. Here is how to translate the above say_hello function to OCaml:
# let say_hello () = print_endline "Hello, world!";;
val say_hello : unit -> unit = <fun>

Incidentally, template based meta-programming would be much easier in C++ if there were no type void but a similar unit type instead. It is quite common to treat separately functions having no arguments in template specialisations.

Object methods, while being similar to functions, do not require an argument.
# class example =
object
  method a =
    print_endline "This demonstrates a call to method a of class example"
end;;
        class example : object method a : unit end
# let x = new example;;
val x : example = <obj>
# x # a ;;
This demonstrates a call to method a of class example
- : unit = ()

Comment: The fact is standing rock solid: every function takes one argument. Methods without arguments "being called" or evaluated just don't fit here, there must be some quite different working behind it. Or "how can it be that a method does not need a single argument"?
Comment: @Str. I am still not sure what you are asking. If you are wondering about the apparent inconsistency in language design (why functions need an argument while methods do not), methods not requiring an argument is useful when building aggregates: it is nicer to write `obj # member # action` than `obj # member () # action ()`.
Comment: Could you expand on the object method case? I just wrote a parameterless serial number method, but I am wondering how does it fit into the picture?
Comment: @Str. I am not sure what you are interested in. Could you be more specific?
Answer: Instead of
let foo n = 55

You just
let foo = 55

And then call foo wherever.
Comment: Also, that's clearly value-typed, not function-typed. Assuming the right hand side is any kind of effectful expression, the side-effects will be applied at the time of declaration, not at the time of the evaluation of references of `foo`.
Comment: Type of first 'foo' is function while type of second one is 'int'. I would like to know if there can be a function which takes no argument.


Removing personal information from Google when being cyberstalked

Question: I would like to make a request to the search engines to remove personal information based on the ground of being stalked and that putting personal information can lead to more stalking. Is there any court cases regarding this issue?
Answer: Generally, search engines are not required to comply with this request, and will not do so, in the United States. There are narrow circumstances when the E.U. will order search engines to suppress information.


What, if any, is the resource penalty for using System.Diagnostics.Stopwatch?

Question: For example
foo() //Some operation bound by an external resource. db,I/O, whatever.

vs.
var watch = new Stopwatch();
watch.Start();
foo()
var time = watch.ElapsedMilliseconds
watch.Stop();

Answer: I believe Stopwatch is built on top of QueryPerformanceCounter, so each call results in a kernel transition.  If foo() is very brief, the QPC overhead will dwarf it.
If you're using Stopwatch to measure short tasks, you should run foo() many times (like thousands), and use Stopwatch around the whole batch.  Divide the total time by the number of runs to get average time for the task.
Comment: @Michael another thing that should be mentioned is that it will fallback to tickcount if QPC is not available
Answer: This sounds like a recursive answer but the only way to truly know the penalty of Stopwatch is to measure it.  Measuring managed code usually involves Stopwatch instances.
Stopwatch is only meant for diagnostic purposes though and should not be used in a retail application.  Unless of course you are in a diagnostic mode.  Hence this really shouldn't be an issue for non-diagnostic code.  Can you provide some insight into your scenario so that we can give a better answer?
Stopwatch instances are built (usually) on top of a QueryPerformanceCounter call.  These are not free but they're not terribly expensive either.  Anything that's worth measuring with a Stopwatch will be a long enough running task that the cost of the task will make the QueryPerformanceCounter call insignificant.  Otherwise, why are you measuring it?
Answer: In my experience, there is some noticeable overhead when using the Stopwatch class. Certainly much more than using Environment.TickCount or such to measure time, but still not too great. However, this may or may not be a big problem for you. If the time period being measured is typically a very short one (as should usually be the case when using Stopwatch, given that other methods are just as good for timing longer periods), then performance shouldn't be affected perceptably, I'd imagine. Also, the end of this page has a bit to say about the cost of running a Stopwatch in your program. (Not sure I would take the advice on using it for constant program monitoring however.)
Comment: The link is broken or some thing! i just get a xml document saying access denied!


Wave Einstein Analytics filter relative dates in dataflow with filter node

Question: I need to filter opportunities in my dataflow that have a date 'last month' to 'end of current year'. I cannot use filters in the sfdcDigest node as I am doing a couple of calculations later that need values - otherwise the dataflow gives an error because fields are empty ( In the beginning I have a revenue field for each month and when I filter before performing the calculation a couple of the fields are completely empty). I checked the help page regarding the expressions and parameters for filter nodes but could not figure out how to express my requirement. Does anyone have an idea?
Answer: You should be able to add the filter after the calculation node(s), and set the source of the filter node to the final calculation node (or whichever calculation node works in your situation).


tomiki-aikido tag

Question: Tomiki named his "style" (in as much as he named it) Shodokan -- References here and here.  So, I suggest we add a couple of synonymous tags: tomiki-aikido, sports-aikido, and shodokan-aikido.  Or should we have them as aikido-xxx?
Answer: Until we have a problematically large set of aikido questions with a substantial subset of Tomiki questions, I think overoptimizing is unnecessary.
Answer: Why do we need aikido-shodokan when the question can simply be tagged as aikidoshodokan?
IOW it doesn't bother me that two tags are used, which negates the need for a specific tag to be created. The tag aikido-whateverstyle would also look a bit disjointed unless there were enough variants to make it look normal.
Comment: Shodokan just means !open way" … [Does it makes sense to have it as a tag?](https://martialarts.meta.stackexchange.com/q/496/82)
Answer: I shudder at Aikido-XXX, which sounds like a porn movie. Pardon me while I go and try to bleach away the images produced by that tag.
There is a part of me that does not want to emphasize the distinction between aikido and shodokan aikido; I don't perceive what I received from my Yoshinkan school as essentially distinct from what I receive from my current Tomiki instructor.  I would treat them all as synonyms I recognize that there are many who perceive them as fundamentally distinct.  I would prefer to use the aikido for all aikido, and reserve shodokan-aikido for material that is specific to the Tomiki lineage.
I'm not entirely sure we have enough relevant discussion to justify the number of synonyms, but in a spirit of hope, I suppose I can endorse the idea.
Comment: **Rule 34**: There are **no** exceptions.  [Aikido is like S&M](http://www.aikidofaq.com/humor/top10/index.html)
Comment: Now I need to go find another bottle of bleach and immerse my brain. By the rules on that page, I must now thank you.
Comment: You are most welcome.

tomiki-aikido tag


The one to (verb) vs the one who (verb)

Question: I hope someone can help me figure it out. I get so confused while trying to explain or understand the use of the phrases above. I've seen this "I'm tired of always being the one to text first" but as to what I know, it must be " I'm tired of always being the one who texts first". Which one is correct? Or are they both correct?  Thanks in advance.
Comment: Both are correct.
Answer:

I'm tired of always being the one who texts first.

I'm tired of always being the one to text first.

These are both grammatical, and in this context mean the same thing. The first uses a regular relative clause with a tensed verb. The second uses a non-finite relative clause. This relative clause has to be non-finite because the Subject of the clause is missing. Notice that because of this it has no past or present tense. We infer the time period referred to from the verb in the matrix clause (the main clause) and from the context.
Answer: They're both widely used and accepted to be correct. I can't think of a case where they're not interchangeable. Can you?
Except:
References to past incidents will mostly use 'the one who'. For example: "Oh! Is she the one who called the police at your last party?"

The one to (verb) vs the one who (verb)


How do scales actually help a person play in a different key?

Question: I've recently started the piano, and I want to learn all my scales so I know them, but I just can't seem to grasp how these scales actually help when I have a different key signature, sure I know the sharps and flats, bit that doesn't mean I'll recognize them just staring at notes on the page, I don't feel as kf just because I learned thr scale means I'll be able to read In that scale, this is a little demotavting as I really want to learn the piano but I feel like it will take an incredible amount of time to read anything
Comment: See also: [Why learn scales? What are they for?](https://music.stackexchange.com/a/4375/70803) and [Why is it necessary to learn scales?](https://music.stackexchange.com/q/80844/70803). Though ostensibly guitar questions, the answers apply to piano as well.
Answer:
Knowing scales eventually does help with sight reading. When fully internalized, knowing instinctively which notes are sharp or flat makes reading easier and helps identify when a piece is changing key. However, this can be a lengthy process and may require great patience.
Scales also help one encounter different configurations of notes and fingerings that commonly show up in music, even if the literal scale isn't present. Thumb turns, in particular, are an essential piano technique, and scales are an efficient way to practice them. This, too, helps again in sight reading by making it easier to identify particular patterns of notes and the fingerings and/or techniques to execute them.
Answer: Each key therefore scale, has its own dedicated set of notes, as you already know.
So, knowing what key a piece is in will help a lot in going 'automatically' to the correct notes on the page. You may see an A note, for example, and knowing the key/scale of the piece is E♭, understand that the A is going to be A♭. Knowing the key/scale is actually B, then that A note will become A♯. It also works in other keys - knowing the key/scale is D, then that same written A will automatically be, in that piece, A♮!
Before sight-reading a new piece, my students need to play the scale it's in. That puts them 'in the zone', and means they're more likely to play diatonic notes correctly. It also highlights the accidentals, which are all the altered notes that don't usually belong in that key.
I disagree somewhat with Aaron's last reason, though, as it's rare that there is more than a snippet of a scale run in a piece, so knowing the fingering for a particular scale, and trying to apply it for a short run, may well need the 'wrong' fingers for those notes in that piece.. However, scales do need thumb action to be fluid, so learning how to get that will be facilitated by learning it in scales.
Comment: I can't help thinking of the end of Chopin's first Ballade and the scale run in his Ab Polonaise. But yes, I'd be cherry picking if I were arguing against what you say.


Compute monthly realized variance from daily data

Question: I am confused about the correct formula to compute monthly realized variance from daily data. What is the first sigma in the picture: sum or average? I mean, after subtracting each observation from monthly mean and then squaring each difference, should I just take the sum for each month or take the average?
Comment: This formula hurts my eyes every time I happen upon it on this page.  Who writes summations like that?
Comment: if you get the average that will give you the daily realized variance, whereas if you get the sum, as in the above formula, that will give you the monthly realized variance. Hence when you want to rescale the volatility you will have to multiply by sqrt(n) or sqrt(1/n)
Answer: You should take the sum:
The non-standard definition of realized variance in the paper of Moreira, A., & Muir, T. (2017), is an attempt to avoid an excessive amount of "infill" mathematical notation otherwise found in standard high-frequency econometrical literature. In essence, the entire paper is void of mathematical notation and only seek to define statistical models/methods where absolute necessary.

Reformulation:
Let $X_t$ be the log-price process, $t \geq 0$ denote the $t$'th month in your dataset and define $n$ as the "intramonth periods" (the authors assume $n=22$ days for each month).  We can then define a sequence of partitions between each month $t-1=t_0 < t_1 < \cdots < t_n = t$ such that $\sup_i t_i - t_{i-1} \rightarrow 0$ for $n \rightarrow \infty$. This just implies that, as $n$ increases the distance between each intramonth timepoint converges to 0.
Furthermore,  under the assumption of equidistant time-spacing of the intramonth periods, $t_i = \frac{i}{n}$ for $i=1,\ldots,n$, we can redefine the realized variance between $t-1$ and $t$ as follows:$\;^{1}$
\begin{align*}
RV_t &= \sum_{i=1}^n \left( \left(X_{\frac{i}{n}} - X_{\frac{(i-1)}{n}}\right)- \frac{1}{n} \sum_{i=1}^n \left(X_{\frac{i}{n}} - X_{\frac{(i-1)}{n}}\right) \right)^2\\
&= \sum_{i=1}^n \left( R_{i,t}- \frac{1}{n} \sum_{i=1}^n R_{i,t} \right)^2\\
&= \sum_{i=1}^n \left( R_{i,t}- \bar{R}_{t} \right)^2\\
&\overset{\star}{=} \sum_{i=1}^n R_{i,t}^2
\end{align*}
where $\bar{R}_{t} =  \frac{1}{n} \sum_{i=1}^n R_{i,t}$. The second equality is analogous to the definition of RV in the aforementioned paper and the last equality is standard for high-frequency econometrical papers dealing with intraday sampling frequencies.
Conclusively, after subtracting the monthly average ($\bar{R}_t$) from the intramonth periods ($R_{i,t}$) and then squaring the difference, you need to sum the squared differences.

1  The time-spacing between each intramonth period is then, $\Delta_i = t_i - t_{i-1} = \frac{i}{n} - \frac{i-1}{n}=\frac{1}{n} = \frac{1}{22}$, which is where the $\frac{1}{22}$ in the sum comes from.
$\star$  Very often high-frequency econometrical papers deal with intraday periods of different sizes. Between each day the effect of the estimated mean ($\bar{R}_t$) on realized variance/volatility, is very small and often negligible. As such it's safe to ignore (See this answer for details). However, this can not be said for intramonth periods.
Comment: @NedaFathi Hey. I see that you have posted a question on this forum (and have already received a response) which is the proper way of asking for help :-). I am currently busy so I cannot give you a detailed answer. As such, review the answer you've received to your question, see if it makes sense and then accept + upvote it, if the answer helps you. Good luck!


Missed calls log not showing in Lenovo A7000

Question: My mobile is Lenovo A7000 with Android lolipop
Recently I the missed call logs not showing, sometimes for one or the other number it shows, it might be stored contact or new but the log is not happening, I also cleared the logs and cleared cache memory of call logs, but not fixed.
I tried updating firmware too but no use.
Please suggest me, thanks.
Answer: Today I was checking my phone for call log but didn't find anything, but after while I open securezone from statusbar on home screen all call logs are visible. So turn on secure zone.
Comment: Considering that you have not mentioned your device and this "securezone" feature is not a core Android feature but is device-specific, I'm flagging this post for deletion as it may confuse other people who need a legitimate solution.


How can I find out if I'm owed royalty payments on additional editions of my book?

Question: I wrote Morris and the Kingdom of Knoll by T.L. Hill. It was published in 1996 jointly by J. Paul Getty and Children's Library Press.  An advance towards royalties in the amount of $10,000 was split 3 ways between myself, artist Jeff Colson, and Children's Library Press. I've received nothing after that. Now, many years later, I noticed it has two ISBN numbers: ISBN 10089236341X and ISBN 139780892363414. Also a different publisher, Oxford University. I wonder if I'm owed additional royalties. I tried looking up how many copies have been sold, but that can't be done. How do I find out if I should have received more money?
Comment: Instead of punching the seller, the author should have carried away the books.
Comment: Heh heh. Harlan Ellison gave a talk at a science fiction convention I was at once. He explained at the end that he was probably going to jail immediately after the talk, because he noticed a guy in the dealer's room selling story collections with one of his stories that he knew for a fact nobody had bought the rights. Turned out Ellison was correct and did indeed get arrested for punching the guy in the face. And the guy was indeed stealing the story.
Comment: @BenVoigt Sorry, I forgot part. The seller was also the publisher. It was a "vanity press" type thing where a guy printed and sold stuff.
Comment: https://www.amazon.com/Morris-Kingdom-Knoll-T-Hill/dp/089236341X  The OP's book is available on Amazon. But only used.
Answer:
You can inquire sales figures of your publisher.

You can sue your publisher and demand an audit.

You can use Nielsen BookScan to get the best possible estimate.

You can calculate your own rough estimate by sales rank in popular online book stores following formulas posted on the internet.

The "new" ISBN is just the new format. ISBN numbers have been converted from a 10 digit to a 13 digit format in 2007. The ISBNs of your book are:

ISBN-10  :  089236341X
ISBN-13  :  978-0892363414

You can see that the difference lies in the 978 added to the beginning and, therefore, a different check digit at the end (4 vs X).
For some reason your formatting has the 10 and 13 added to the beginning of the ISBNs. They don't belong there.

I don't think that your book has been republished. I assume that the Getty / Children's Library Press imprint has been acquired by Oxford University Press. All books from that imprint are now listed as published by Oxford University Press, and other publications of the J. Paul Getty Museum are as well. Ask Oxford University Press or your original publisher if you want to know what has happened.
Also, look at your contract to understand what happens to your rights when your publisher is sold or dissolved or when the book hasn't been in print for some time. The publishing rights might have fallen back to you and your co-author, and you might be able to resell the rights or republish the book yourself.


How to use Android modem without using PC

Question: I have rooted my mobile. I wanted to use modem of Android phone without connecting to PC. How to give AT commands without connecting to PC, because in http://atinout.sourceforge.net/, it is suggesting to use '/dev/ttyACM0' file which is not present in Android device.
I am not sure, but it seems ttyACM0 is related with USB, how to use same command in Android mobile, if I have rooted my mobile successfully.
Comment: Have you checked if kernel's Android USB gadget support does include *ACM serial support*, *generic serial function driver* and finally *modem support in generic serial function driver*?
Comment: @t0mm13b Can you please suggest how to check this? I am new to Linux world.
Comment: Did anybody ever "stepped by stepped" detailed how you could solve this issue ? ... I'm tryna do the same thing (or possibly embed it in my Java apk...)
Answer: Some devices would have the kernel compiled with ACM serial support (this is dependent on manufacturer/board/kernel) so that it could be used as a dial-up modem from a PC via USB cable, that is the functionality behind /dev/ttyACM n where n is a digit as allocated by the kernel.
To check for that, look in /proc/config.gz which is the kernel configuration file used, this is a gzipped file detailing the configuration of how the kernel was built, the ones you are looking for is, need to search for it:

CONFIG_USB_ANDROID_ACM=y
CONFIG_USB_F_SERIAL=y
CONFIG_MODEM_SUPPORT=y

again, its dependent, some elect to not include it, others will omit it
So basing my comment above, I think you're using the wrong device file name, the real modem device file is /dev/smd0 which is used in conjunction with /dev/socket/rild (See my answer on StackOverflow explaining about that).
/dev/smd0 sits in front of /dev/socket/rild, rild daemon reads from that device and relays it to /dev/socket/rild which is then handled by the android layer in both directions.
Try using either of the device filenames, with atinout program referenced on sourceforge, to see what outcome you will get.
Disclaimer: I am not responsible for messing up your telephony stuff if you carry it out as per on the sourceforge site, if it gets messed, reboot!
Answer: As I said in my answer to your first question:

Be warned that the device file you need to use is different for each model of phone, so you'll have to examine /dev on each device to find out which file to use.

If you can't find a report from someone else who has got it working on the same phone, you'll need to use a little trial and error to find the right device file.


FMOD on non-playing audio

Question:
Hey, is there any way to get the audio spectrum of a section of a song using FMOD if it is not playing?
Can I render a full song waveform using FMOD (+opengl/openframeworks/etc.) before the song is playing?
Answer:
Yes.
Yes but you will have to do the your own spectrum analysis on the time domain wavedata.

You can get the wave data from the FMOD::Sound using Sound::lock. To do this you would have to create the sound as FMOD_SAMPLE which means the entire song will be decompressed into memory. You can render the waveform using this data and also conduct your spectrum analysis. FMOD's inbuilt 'getSpectrum' function will only work with snapshots of the playing data in a Channel or ChannelGroup.

FMOD on non-playing audio


Summarizing survey data with small sample size

Question: I have to summarize survey data for smaller samples(n<100). In order to find the correct measure of central tendency for summarizing(mean/median), currently I see the histogram distribution for the data. I want to do this selection between mean and median mathematically rather than visually. Is there a cutoff for variance/ any other statistical measure, which I can roughly use to decide whether to choose mean or median for summarizing?
Answer: You could use formal tests for normality. Shapiro–Wilk test being preferred.
But the simplest is to use the skew measure.
If abs(skewness(x))<0.8 then according to Dr. Parzen from Harvard University, the data is essentially normal shaped and it is safe to use the mean.
Something to consider, outliers have strong leverage on the mean. Winsorization (clipping) may condition the mean enough for you. What Winsorization does is replace values beneath 0.5 percentile with the 0.5 percentile value and likewise anything above for 99.5 percentile.


What is the difference between lossless and lossy formats?

Question: What exactly are the differences between lossless and lossy codecs? And is one better format better than the other or is it mostly relative?
Answer: If you imagine you have a video signal, and you want to capture all of it.. Let's say it is 1920x1080 at 25fps. You can store all the information about every pixel at full colour depth on every frame.  This would be lossless - you could full recreate the signal upon playback, and it would be identical to the original that you captured.
The downside of this process is that the files would be extremely large, and you may require relatively powerful hardware to successfully playback the signal successfully without dropping any frames.
So you may compress the signal or file instead in a number of different ways:  You might look at each frame, and try to spot areas where there isn't much detail (such as in an out-of-foucus background).  Instead of storing every pixel in this area of the frame, you could say "these twenty pixels are all about the same shade of blue).  The frame you have stored would take up less space on your computer, but when you come to recreate the frame upon playback, it would no longer be identical to the original.
Now you could also do this over time - this is called inter-frame compression.  So you can look at a number of frames over time, and spot where there is little variation in the image - and only record information where there is a significant change.
All of this involves working from a model of "perception" - what can the eye-brain combination see?  How clearly can it tell when something has been data reduced?
Lossy formats can store the same video at much smaller file sizes.  Or - another way to look at it - with a given amount of bandwidth, you can transmit a much higher quality video if it is compressed than if it was transmitted as a lossless format.
Recreating video from a lossy format also has performance overheads. So for a given system, you may find a codec that plays back well on one system performs very badly on another.
In general, most video files delivered on the internet to consumers are lossy.  This is for the reason mentioned earlier - you can deliver a perceptably "better" looking file using a lossy codec faster, than you could if the file was lossless.  So final deliveries to website such as YouTube etc are usually in a lossy format such as h264.
During the production process, this is not the case. If your camera can export it, and you have a fast enough computer, with enough storage space, you may want to use lossless formats for editing, or at least formats which don't use any inter-frame compression.  This is so that your computer doesn't need to "rebuild" frames that don't exist when you are scrubbing through your edit.  Each frame in a format like ProRes is fully described, even though there is still some data compression in the way the colour of each pixel is described.
Lossless and lossy formats both have their place. They're both useful tools when used in the right part of the production process.
Answer: Just to add a little detail to t @tomh's excelent answer: a 1920×1080 image comprises 2,073,600 pixels. To capture this in a way that includes all the visual information that you could see with your naked eye would require at least 14 stops of dynamic range, which translates to 3 channels of 14-bit colour (the three channels are the RGB components, or more usually the YUV components, and since an ƒ-stop is a doubling of the light levels, and because each bit you add to the end a binary number doubles it, 14 stops = 14 bits). So that's 42 bits of colour information, per pixel, per frame, or 2,073,600×42 = 87,091,200 bits per frame or roughly 10 Mb. Multiply that by the number of frames per second, e.g. 25 and you need ≈ 250 Mb/s to represent the image. Every minute will require 15Gb of storage. It's pretty easy to see that compression is going to be necessary.
There are lossless compression codecs that work by removing redundancy in the bits recorded, similar to the way you can zip a file on your computer to reduce the size, but still get back an identical copy when you unzip it. Most lossless compression uses this kind of compression scheme, particularly because a video stream usually has a lot of redundancy. They're nowhere near as efficient as lossy algorithms, but what you get out will be exactly the same as what you put in.
Whether any codec is better than another depends on a few factors, including:

fidelity—how accurate the output is compared to the input
data rate and efficiency—how much data it requires to record the video
speed—how quick it is to encode / decode frames
complexity—how much processing power is required to encode / decode the codec
robustness—how well the codec deals with missing or corrupted data during transmission, e.g. digital terrestrial television broadcast
availability—whether the codec is commonly available, whether it is free to use, also whether the format is open or closed source
compatibility—with container formats—some codecs only work in quicktime .mov or .avi containers, and with playback technology, e.g. does it play in browsers


DNS setup on a VPS. Should I change something on the domaine registrar?

Question: I installed a DNS server on my VPS running Windows 2012 server. I created ns1.mydomain.com and ns2.mydomain.com pointing to the vps ip address.
Now do I have to change something on the  domain registrar ?
Answer: Yes, you need to contact the registrar and tell them to list ns1.mydomain.com and ns2.mydomain.com as the nameservers for your domain (mydomain.com)
That said, I would advise against having all of your nameservers pointing to the same VPS. If anything happens to that VPS, your entire domain will go down. You should at the very least get a second VPS hosted in a different datacenter for ns2.mydomain.com if you need any sort of redundancy; If you're just trying to set something up to play around with and experiement with the DNS system and how it works, by all means just have fun with your VPS :)
Comment: In the registrar website there is a place where I can change the ns records. For now I'am setting a testing environment...but yes a redundancy is something I am gonna setup eventually. Thanks
Comment: For the redundancy, my vps is my dns also, and if the vps is down the dns also is down...I guess I should have the dns server outside of my vps ?


Sobolev space with a 1-dim domain.

Question: Let $U\subset \mathbb{R}^n$ be a bounded open subset and $W^{1,p}(U)$ be the Sobolev space. Is it true that functions in $W^{1,p}(U)$ are automatically continuous when $n=1$? Could anyone kindly tell me why? I think this is not true in general.
Answer: I suggest you take a look at the chapter 5 in Evans'PDE. More details as follows:
DEFINITION. We say $u^*$ is a version of a given function $u$ provided $$u=u^*\quad a.e.$$
THEOREM. Let $n<p\leq\infty$, $\partial U$ is $C^1$,$u\in W^{1,p}(U)$. Then $u$ has a version $u^*\in C^{0,\alpha}(\bar U)$, for $\alpha=1-\frac{n}{p}$.
In your question, when $n=1$, we can see that if $p>1$, then $\forall u\in W^{1,p}(U)$ has a Holder continuous (of course continuous) version $u^*$.
Answer: Let $I$ be a open interval in $\mathbb{R}$.
Lemma $1$. Let $f\in L_{loc}^1(I)$ be such that $$\int f\phi'=0,\ \forall\ \phi\in C_c^1(I)$$
Then, there exists a constant $C$ such that $f=C$ a.e. on $I$.
Lemma $2$. Let $g\in L_{loc}^1(I)$. Fo4 $y_0$ fixed in $I$, set $$v(x)=\int_{y_0}^x g(t)dt,\ x\in I$$
Then $v\in C(I)$ and $$\int_I v\phi'=-\int _I g\phi,\ \phi\ \in C_c^1(I)$$
$\bf{\mbox{Proof that every function in $W^{1,p}(I)$ is continuous }}$: Fix $y_0\in I$ and set $\overline{u}(x)=\int _{y_0}^x u'(t)dt$. By Lemma $2$, we have that $$\int_I \overline{u}\phi'=-\int _I u'\phi,\ \phi\ \in C_c^1(I)$$
Therefore, $\int_I (u-\overline{u})\phi'=0$, $\phi\ \in C_c^1(I)$ . It follows from Lemma $1$ that $u-\overline{u}=C$ a.e. on $I$, hence, $u=\overline{u}+C$ and you can redefine $u$ in a set of zero measure in such a way that $u$ is continuous.
Remark 1: The demonstrations of all this results can be found in Brezis book on the pages $204-206$.
Remark 2: Note that Lemma $1$ is an version of du Bois-Reymond lemma with derivatives.
Comment: Thanks for remark 1, I really like how this book is written.

Sobolev space with a 1-dim domain.


Where can I get the BIP39 file?

Question: I would like to leave a copy of the BIP39 words with a person of my trust.
Where is the safest place I can download the BIP39 file?
Answer: The list of the word lists is included in BIP39, this is used directly in Yoroi as part of the BIP39 JavaScript module.
It appears, Daedalus is using its own wordlist.
Comment: The Daedalus wordlist is defined in a different place, but that seems unrelated to the wordlist itself. They're both 2048 words and, on inspection, look identical.
Answer: Having digital copies of your mnemonic set is always discouraged due to security issues.
However, if you really want to give a digital copy of your recovery phrase to a person I'd personally suggest to take a picture of the recovery phrase, encrypt the picture, compress the encrypted picture and finally encrypt the compressed file again.
Please take this suggestion with caution since I'm not a security expert.
Answer: Found it! It's in IOG's cardano-crypto repository. Have a look:
https://github.com/input-output-hk/cardano-crypto/blob/develop/src/Crypto/Encoding/BIP39/English.hs
Answer: You can download this website to a folder https://iancoleman.io/bip39/
and generate a BIP39 code on a clean computer not connected to the internet.
With that site, you can generate as much as you want.
or just buy a nano ledger x. Far easier.
Answer: Here's BIP39 english wordlist and a detailed instruction how to generate a seed phrase from it.
You can store BIP39-wordlist anywhere you like. But the seed phrase generated with these 2048 words should be kept away from strangers.

Where can I get the BIP39 file?


How to hide The list is empty. Add tiles from the All Promoted Links view

Question: I am using the promoted links web part.  Each item on the list is security trimmed.  As normal reader of the site you can not see the links.  How can I hide this message to avoid confusion?
Answer: You could use the audience targeting feature and only show the webpart to the audiences that are allowed to view the content:
On the "advanced" section of the web part tool pane you can specify a target audience. Make sure to include any groups that have access to the underlying content in your promoted links list. With this feature configured, the webpart will not appear on the page for users that are not part of the "target audiences"

Target Audiences
An audience can be identified by using a SharePoint group, a distribution list, a security group, or a global audience. The Web Part appears only to the people who are members of the audiences that you specify here.

https://support.office.com/en-us/article/Target-a-Web-Part-to-a-specific-audience-d4076339-dc25-48be-9a2b-ffafdf33e9d8
(article for SharePoint Server 2007, but feature works the same way in 2013 and O365)
Comment: I did try an audience but still got the message, i will try again.
Comment: Weird.  I added the groups again and republished the page and it work :-)


The hardness of generating an instance of a problem that is harder than the complexity of the resulting problem

Question:
In the movie Inception  Cobb asks a asks Ariadne to design a maze that takes twice as much time to design. This lends itself to a generalized problem where we have an situation where we are resource limited by some amount and whoever will verify that this problem is in the given complexity class that either will take more time and or space to solve. Is this a novel problem?
Comment: how do you represent the problems?
Comment: Sorry, I do not understand the question:
 "design a maze that takes twice as much time to design" still doesn't make sense.  Do you mean "design a maze that takes twice as much time to solve as it does to design", or "design a maze that takes twice as much time to design as it does to solve"?
Comment: @Kaveh: Maybe the way to formalize this is that the problem is fixed and the task is to generate hard instances in polynomial time? E.g., the problem depicted in the picture is a search problem, the input is a solvable maze, and the output is a valid path through the maze.
Comment: 1. "takes twice as much time as it is to design" - what does that mean?  "as it is"?  Is there a typo or some missing words somewhere in that sentence?  I'm having a hard time parsing it. 2. "whoever will verify that this problem is in the given complexity class that either will take more time and or space to solve." - I'm having difficulty parsing this, too.  What is the verb in that phrase? "(whoever will verify that this problem is in the given complexity class)" will what?
Answer: This situation comes up frequently in crypto, where you want to generate hard problem instances along with their solutions. For example, there is the work of Eric Bach (and later, Adam Kalai) on efficiently generating random integers with their prime factorizations.
One of many interesting observations of Impagliazzo and Wigderson (Randomness vs time: derandomization under a uniform assumption. J. Comput. Syst. Sci., 63:672–688, 2001) is that one can efficiently generate uniform random matrices modulo p along with their permanents. (Think about it... use self-reducibility of permanent....) Moreover, we know that the permanent is random self-reducible. So this is an example of a very hard problem for which we can efficiently generate solved instances.
Comment: Another classical reference along these lines: [Generating hard instances of lattice problems](http://eccc.hpi-web.de/eccc-reports/1996/TR96-007/)
Answer: First, I don't think the Arthur-Merlin protocol has to enter the model -- it sounds from the motivation like you just want to produce problem instances quickly so that any algorithm for solving them is slow. In other words, if we could prove that Arthur can produce a hard problem, then there seems to be no need for Merlin to verify that the problem produced is hard.
Very related is this question: Can we generate in polynomial time a language that is not decidable in polynomial time? The answer turns out to be yes iff unary P is not equal to unary NP.
That was for deterministically generating an instance. For randomly generating one, if one-way functions $f$ exist, then we can just pick a uniformly random $x$ and present the problem "here is $f$ and $f(x)$, find $x$".
Hmm, actually, if we are not constrained, we can generate very hard problems: For a problem of size $n$, we ask whether the $n$th Turing Machine halts on a blank input. Or if we have randomness, we pick a number $i$ in $\{1,\dots,n\}$ uniformly at random and ask whether the $i$th Turing Machine halts. So perhaps it makes sense to limit the kinds of problems we want to generate to only be so hard, e.g. in NP.
Comment: I think you mean "unary P not equal to unary NP"


When creating an SVM, if the training set is too large, can we use partial set of landmarks?

Question: When creating an SVM, if the training set is too large, can we use partial set of landmarks? For example, if the training set is 1,000,000, it may be too computationally hard to use SVM, since there would now be 1,000,000 new features for the SVM. Could we do something like use a random 1% of the features? We could use a random 1% of the training set instead to get 10,000 features, but why not just use a random 1% for the landmarks and train with all 1,000,000 training samples?
Answer: The random feature you select may be very much correlated, which will not be useful for learning new features of the training data.
If you want to select some features out of all for training I would suggest you should do the Principle component analysis(PCA), to select the best features with least covariance between them so as to maximize the information present in the training data.


Would a fluid with zero viscosity reach an equilibrium

Question: My hunch is yes, but I can't think how to prove it.
An argument against this is you have a box with a divider in the middle, one side is filled up higher than the other. The divider is removed, you will get waves in the fluid, when the viscosity is lower the waves will continue for longer, so when the viscosity is zero nothing will stop the waves so they will never stop, ignoring friction with the sides of the box. Is this right?
Comment: No viscosity $\Rightarrow$ energy conservation. So it wouldn't reach equilibrium. Check the "Euler equations" at wikipedia.
Comment: If there was irregularity in the container, wouldn't turbulence be generated? And wouldn't that turbulence (due to entropy) become more and more subdivided and distributed over time, right? What would the end point be?
Answer: Viscosity is the only dissipating mechanism in a fluid absent outside forces (gravity, magnetic/electric fields if the fluid responds to those, etc.). So if there are no outside forces, it will continue moving forever.
Of course, this is only academic because a truly zero-viscosity fluid doesn't exist (well -- superfluid helium is a thing, but it would require constant energy removal for it to stay in that state, otherwise perpetual motion would be possible).
But, this all hinges on how you define "equilibrium". For example, would a stationary vortex be in equilibrium? It would be time-invariant, so I would call that an equilibrium but maybe you don't. It's hard to say without being more precise. However, it is possible to find many time-invariant solutions to the Euler equations (ie. the equations that govern a fluid when viscosity is neglected) so it boils down to definitions.
Comment: Why would the superfluid helium need energy removal; is it that the surrounding environment would inevitably be warmer?
Comment: In my example by equilibrium I ment the fluid in the box becoming level, I should have been clearer. What about a gas with uneven concentrations, would the pressure act as a limiting force, causing the concentration to become even?
Comment: @DanOc004 I am not sure what you mean by "pressure act as a limiting force." However, to your question about gas mixing -- that has absolutely nothing to do with viscosity. Viscosity comes from velocity non-equilibrium and species diffusion comes from species non-equilibrium. So it all comes back to how you want to define your terms -- when you say "zero viscosity" are you also removing the species diffusion from the equations? Because some people do that when they say inviscid. Others do not.
Comment: You are accumulating close votes for being unclear and I think it's because you aren't being very precise in the case you are considering, the assumptions you are making, and what the motivation behind the question is (it seems like you may be asking an X-Y problem -- you ask about X, but you really want to know about Y; you just don't know that yet).
Comment: Sorry my question is badly written, should I delete it or let it get closed.


Problems blocking URLs

Question: I took over as WM for our website a while ago. The old website was produced using html code, new 1 using proprietary software. I've tried blocking old URLs in Google (ending in .htm) but not completely successful. Instead it appears some of my current pages (ending .html) have been blocked from searching (403 codes)!
There are no robots. Also get messages: "no structured data ...", "duplicate title tags" (all old .htm pages).
When I do google search I get the usual result (index page then 6 sub pages) but 3 of the 6 are old website pages.
At a loss to what to do. As an amateur any advice appreciated.
Comment: How did you try to block old URLs?
Answer: What to try:
Set 301 redirects, basically 301 redirect will tell google that this page is moved permanently and redirect robots and visitors to your new page address.
If you have the same content on both the old and new pages, you can always go for rel="canonical" on your old pages pointing to your new pages, but I recommend 301 redirect.
Resubmit sitemap.xml file in Google Console (Webmaster Tools), and make a request for reindex of your site.
Error code 403
In theory: A web server may return a 403 Forbidden HTTP status code in response to a request from a client for a web page or resource to indicate that the server can be reached and understood the request, but refuses to take any further action. Status code 403 responses are the result of the web server being configured to deny access, for some reason, to the requested resource by the client.
Actions you can take
You should add index.php file in every directory of your website if it's lacking, (It can also be empty). You should add a robots.txt file, you should disallow admin, login and search modules and other modules you want to hide from the search engine. It could be a server side problem or file permission problem it would be usefull if you can send a list of the file permissions on your site in a perfect universe your content that should be displayed to both users and google should have a 755 code which means you can read-write-execute , while group and world can read and execute your files.But not all of your files should have 755 permissions, if you need a list of files you need to change I can provide you one.
Comment: Why "add index.php file in every directory"? Generally, _files_ should _not_ have the execute bit set (directories should), so 644 would be more appropriate.
Comment: Adding index.php in sub-directories of your site is essential because then when you try to open /includes for example you will end up in a blank page, and the part with the permissions I already said that you don't need them on most of the files with 755, but there are some you need to ensure 755 permission is set.
Comment: w3dk: Tried google delete urls - denied. Tried temporary delete - failed. Google search still brings up some old pages (over1 year old). Bing search brings up correct pages.
Comment: knif3r: problem is I no longer have access to the 'old' pages - they went over a year ago. Is it possible they're still sitting on the hosting service's server somewhere?
Comment: If you can view the old pages, they exist.
Comment: Called the host's help desk: very helpful advice - download open source FTP programme, login and delete unwanted files. Very easy. All done and old pages no longer appear in searches.

Problems blocking URLs