What wire do I need to change and relocate my thermostat?

Question: I ave a TRANE S9X2 Furnace-2 stage heat and Trane single stage XR 14 ac unit.I wanna move my thermostat and use new wire ...will 18 /6 do the job?
Comment: How is the thermostat connected now? How many wires?
Comment: I was looking at 18/6 on Amazon.Made by Cimple CO. https://www.amazon.com/Thermostat-Wire-Residential-Commercial-Industrial/dp/B07T19567J?th=1
Answer: 18/5 and 18/7 are the most common at the big box stores here.  If you are already set on running new wire, more conductors is always better.  You can always leave one or two unused, but it's very difficult to add more. :)
With 2-stage heat and single cool, you are already at 6 conductors.
I'd go with 18/7.
Answer: Let`s count,
R+C+G+Y+W, that is 5 wires for single stage cooling and heating with no spares.
If you have anything more like dual stage heating (W2) and/or cooling (Y2), or you have humidifier or dehumidifier, you will need more wires.
Recommend would be 18/7
for your situation, since you have 2 stage heating you need R,C,G,Y,W1,W2 = 6 wires cable and not spares left for anything else.
Answer: Use a single multi conductor cable without splices that goes from the furnace to the thermostat. You can use any reasonable wire, if there are extra conductors just ignore them. If there are not enough conductors get a different cable. Most Important is first take pictures of each end and what wire is connected to what noting colors. Then make a sketch showing the ends connected together as it is currently wired. Now take that sketch and mark the new wire color on the sketch using a different colored pen.
At this point you have wiring map as to how it will need to be wired. Run the wire from the stat to the furnace or other direction it does not matter. At this point it is important that power be off until you finished removing the stat and moving it to the new location. If you have not had a lot of experience at this connect one color at each end and check your diagram to be sure it is correct. Continue until all wires are connected. At this point you can turn the power on and it should work flawless if it worked that way before moving it.
Take your time and Take pictures.


Is it possible to have Thick white ink for printers?

Question: Is the White ink that is available in the market are all transparent ink?
I want a a opaque (thick) white ink for printing. is that possible?
Comment: It's possible. But not for home/office use. If you have a commercial press, you can purchase white inks. If you are silk screening, you can purchase white inks.
Answer: There are commercial inks that you would need a business licence and tax form to obtain.  Since you may be using it for home use you would typically be getting a water based ink.  The best option for you may be going to Hobby Lobby.  They do have "do it yourself" home screening kits.  Example here and white here From experience they are typically not transparent BUT you can dilute them to be transparent.
EDIT:
If you are printing on a dark garment, such as black, it is common to make two passes with white for best quality.  Note that if also printing on dark garments its a good practice to lay down your whole design with white so that the colors will pop.  Video explanation.


Number of copies of irreducible unitary representation in $L^2(G)$ for compact group $G$?

Question: Peter-Weyl Theorem is concerned with expressing $L^2(G)$ as closure of direct sum of subspace generated by irreducible unitary representation. Every irreducible representation on a compact group is finite dimensional. Why $L^2(G)$ has exactly subspace with dimension number of copies of corresponding irreducible unitary representation? I have problem with investigating why there are no more copies !!
Answer: If not, consider the restriction of regular representation to the complement of the direct sum of the subspaces corresponding to irreducible representations will have finite dimensional unitary subrepresentation which lead to contradiction.


How can I make a host directory mount with the container directory's contents?

Question: What I am trying to do is set up a docker container for ghost where I can easily modify the theme and other content.  So I am making /opt/ghost/content a volume and mounting that on the host.
It looks like I will have to manually copy the theme into the host directory because when I mount it, it is an empty directory.  So my content directory is totally empty. I am pretty sure I am doing something wrong.
I have tried a few different variations including using ADD with default themes folder, putting VOLUME at the end of the Dockerfile.  I keep ending up with an empty content directory.
Does anyone have a Dockerfile doing something similar that is already working that I can look at?
Or maybe I can use the docker cp command somehow to populate the volume?
I may be missing something obvious or have made a silly mistake in my attempts to achieve this.  But the basic thing is I want to be able to upload a new set of files into the ghost themes directory using a host-mounted volume and also have the casper theme in there by default.
This is what I have in my Dockerfile right now:
FROM ubuntu:12.04
MAINTAINER Jason Livesay "email@example.com"

RUN apt-get install -y python-software-properties
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get -qq update
RUN apt-get install -y sudo curl unzip nodejs=0.10.20-1chl1~precise1
RUN curl -L https://en.ghost.org/zip/ghost-0.3.2.zip > /tmp/ghost.zip
RUN useradd ghost
RUN mkdir -p /opt/ghost
WORKDIR /opt/ghost
RUN unzip /tmp/ghost.zip
RUN npm install --production

# Volumes
RUN mkdir /data

ADD run /usr/local/bin/run
ADD config.js /opt/ghost/config.js
ADD content /opt/ghost/content/
RUN chown -R ghost:ghost /opt/ghost

ENV NODE_ENV production
ENV GHOST_URL http://my-ghost-blog.com
EXPOSE 2368

CMD ["/usr/local/bin/run"]
VOLUME ["/data", "/opt/ghost/content"]

Answer: As far as I know, empty host-mounted (bound) volumes still will not receive contents of directories set up during the build, BUT data containers referenced with --volumes-from WILL.
So now I think the answer is, rather than writing code to work around non-initialized host-mounted volumes, forget host-mounted volumes and instead use data containers.
Data containers use the same image as the one you are trying to persist data for (so they have the same directories etc.).
docker run -d --name myapp_data mystuff/myapp echo Data container for myapp
Note that it will run and then exit, so your data containers for volumes won't stay running.  If you want to keep them running you can use something like sleep infinity instead of echo, although this will obviously take more resources and isn't necessary or useful unless you have some specific reason -- like assuming that all of your relevant containers are still running.
You then use --volumes-from to use the directories from the data container:
docker run -d --name myapp --volumes-from myapp_data
https://docs.docker.com/userguide/dockervolumes/
Answer: You need to place the VOLUME directive before actually adding content to it.
My answer is completely wrong! Look here it seems there is actually a bug. If the VOLUME command happens after the directory already exists in the container, then changes are not persisted.
The Dockerfile should always end with a CMD or an ENTRYPOINT.
UPDATE
My solution would be to ADD files in the container home directory, then use a shell script as an entry point in which I'll copy the file in the shared volume and do all the other tasks.
Comment: Thank you.. I tried that, doesn't seem to make a difference as far as getting my content to appear in my host mounted volume.
Comment: How are you running your container?
Comment: Thanks a lot for the update.  I will try again. I have also been following this https://github.com/dotcloud/docker/issues/1992 because it seems related.
Answer: I've been looking into the same thing. The problem I encountered was that I was using a relative local mount path, something like:
docker run -i -t -v ../data:/opt/data image

Switching to an absolute local path fixed this up for me:
docker run -i -t -v /path/to/my/data:/opt/data image

Can you confirm whether you were doing a relative path, and whether this helps?
Comment: Oh I see, apologies. No, never attempted that. On a side note, I came across this while trying to do something pretty similar to what you mentioned, which is now (basically) working: https://github.com/unwitting/docker_ghost :)
Comment: Nope, not using a relative path, and I think you misunderstood the question.  I am not having trouble using volumes in general.

I am trying to get it to use the contents that I ADDed when my host volume directory is empty or missing.  Are you able to achieve that?
Comment: I believe that if they were starting over now, they might have made it do that, but since it didn't before, it would be a major breaking change.  So it doesn't do that, it just uses whatever is in the host volume directory, if that is blank, it wont initialize it for you with the contents from the container.

Far as I can tell I just have to write a script to copy it manually if its not there as part of my container startup.
Answer: Docker V1.8.1 preserves data in a volume if you mount it with the run command. From the docker docs:
Volumes are initialized when a container is created. If the container's
base image contains data at the specified mount point, that existing
data is copied into the new volume upon volume initialization.

Example: An image defines the
/var/www/html

as a volume and populates it with the data of a web application. Your docker hosts provides a mount directory
/my/host/dir

You start the image by
docker run -v /my/host/dir:/var/www/html image

then you will get all the data from /var/www/html in the hosts /my/host/dir
This data will persist even if you delete the container or the image.
Comment: Is this new in 1.8.1?  Didn't used to do that if I understand you correctly.  If someone can confirm then we need to change the answer.
Comment: The rule you mentioned does not apply to mounting host directory. It's only for Data volumes.
Comment: @Paul: What's the difference? Data volume is seen from the perspective of the docker image, host directory is the target where the data volume is mapped to, isn't it?
Comment: @Jason: I tried it out with a data directory of MySql.
Comment: @Heri open a link your provided and search for "If the container's base image contains data at the specified mount point, that existing data is copied into the new volume upon volume initialization. (Note that this does not apply when mounting a host directory.)".


How to keep a Windows 7 laptop powered on (so I can remote desktop to it)

Question: Ideally I'd like to turn the screen off too to save power!
Answer: Right-click on the Power Icon in the systray and select Power Options.
Look at the available Plans.  Select Change Options for the current Plan.

From here you can set how long the computer waits before it turns off its display and how long it will wait unattended before it hibernates.
Answer: I'm not sure where the setting would be in Windows 7, but on my XP laptop in the power saver settings you can change the behavior when you close the laptop.  Just tell it to stay on when that happens.  I believe it should still turn off the screen, but otherwise it will stay on.
Just make sure you have the laptop plugged in.
Comment: There is a difference between turning the screen off, and closing the laptop. I wouldn't recommend letting a running laptop closed, for heat management issue (and LCD screen's health).


Multiple featured image thumbnails for post types (Multiple Post Thumbnails plugin)

Question: I found a plugin called Multiple Post Thumbnails and followed the directions in getting it set up. Everything shows up correctly in the admin dashboard (i.e. shows two sections to upload two separate thumbnails) but after I set the two thumbnails for each post and view the page which displays those posts, only the first post I set the thumbnails for show up.
This is the code I used in my theme's functions.php:
$thumb = new MultiPostThumbnails(
    array(
    'label' => 'Larger Image',
    'id' => 'image2',
    'post_type' => 'projects'
    )
);

And here is my Projects page which is the page where the posts are displayed:

            <?php
                $c=0;
                $i=1;

                $temp = $wp_query;
                $wp_query = null;
                $wp_query = new WP_Query();
                $wp_query->query('post_type=projects' . '&paged=' . $paged . '&posts_per_page=6');

                while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;
            ?>

            <article class="post<?php if($i%3 == 0) { echo ' right'; }; $i++; ?>" id="post-<?php the_ID(); ?>">

                    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
                        <?php
                            if (class_exists('MultiPostThumbnails')
                            && MultiPostThumbnails::has_post_thumbnail('projects', 'secondary-image')) :
                            MultiPostThumbnails::the_post_thumbnail('projects', 'secondary-image');
                            endif;
                        ?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

                    <time class="post-date" datetime="<?php the_time('c'); ?>"><?php the_time('F j, Y'); ?></time>

            <?php
                endwhile;
                wp_pagenavi();
                $wp_query = null;
                $wp_query = $temp;
                wp_reset_query();
            ?>

            <?php if( $c < 6 ) : for ($dummy= $c; $dummy < 6; $dummy++) : ?>

                <article class="post<?php if($i%3 == 0) { echo ' right'; }; $i++; ?>" id="post-<?php the_ID(); ?>">
                    <img src="<?php bloginfo('template_url'); ?>/images/dummy-post.gif" alt="Post coming soon!" />

                <?php endfor;?>

            <?php endif;?>

            <img src="<?php bloginfo('template_url') ?>/images/interactive-map.jpg" alt="Interactive Map" />

Here is a screenshot of what the page looks like. Note only "Project 6" has the thumbnail showing (Project 6 was the first post I uploaded a second thumbnail to) when I uploaded second thumbnails for each of those posts.

Does anybody have experience with this plugin? Also, would anyone suggest an alternative no-plugin way to achieve the same thing? Basically, I just want to be able to upload two separate thumbnails for each post in the Projects post type so one shows on the home page and another (larger) one shows on the Projects page. An ideal setup would be to have just one large image I upload which gets shown on the Projects page and it would automatically get cropped into a smaller thumbnail which I can then use for the home page. Anyhow, any advice/help would be much appreciated. Thank you for reading this long post!
Comment: i think you must set the **id** on the arguments (See **$thumb** Variable). The id must be have the Post-id, right? i have installed the plugin. Hmm.. The second image will not be displayed..
Answer: Dude, you're doing this the hard way. You can do what you want totally with a single 'featured post thumbnail'. Read the documentation about thumbnail sizes in themes. You can inject custom thumbnail sizes in your themes funcitons.php and then give them as a parameter to the (get_)the_post_thumbnail() function. Please just read the documentation at the Codex  - start with the function reference page for the_post_thumbnail(), maybe - and you'll see. Wordpress does automatically resize and crop the image for you, if only you tell it to do so.
Comment: It was about time someone realizes that. *scnr*
Answer: With Multiple Post Thumbnails you can set 2 or more different images, WordPress's built-in the_post_thumbnail() cannot do that
Answer: I know its an old question but there is a new plugin called Dynamic Featured Image. It will allow you to add multiple featured image using a graphical interface. It will save lot of your development time.

The Plugin dynamically adds multiple featured image (post thumbnail)
  functionality to posts, pages and custom post types.
Comment: Do not post duplicate answers. If you see a question that could be solved by exact the same answer, mark it as duplicate.


is there a masters degree in Mobile development like android?

Question: it's not a programming question, but programmers related.
if yes, please guide me to some colleges that have that program.
thanks.
Comment: I certainly hope not. And if there is, be very, very suspicious.
Comment: I don't see any problem with such specialization, phones are THE most important device nowadays.
Comment: Certificate.. maybe, but master degree !!!!
Comment: If there would be any, I'll tried to attend, it is more practical and useful than current Masers with theoretical old contents.
Answer: As with the other mobile app development platforms, these fields are typically too new for degree programs. You will find other educational opportunities out there, there are classes, books, screencasts in iPhone, PalmOS, Android, Blackberry, etc. development just a google away.
There are things like the Graduate degree program Tisch Interactive Telecommunications Program at NYU. The work produced there often has a mobile spin to it.
Here's a class syllabus for Mobile Me(dia), for example, though I'm not sure if that class is specifically an ITP one.
In California, you could look to Center for Research in Computing and the Arts, which I think has somewhat similar aims.
To look for other schools doing Android development courses, you could try a search like: <code>"android development" site:.edu</code>. Fair number of folks with classes at least: University of California, Carnegie Mellon, Columbia, Temple University, and many others.
Update
A bit of googling finds Master's Degree Programme in Mobile Technology and Business at  University of Jyväskylä in Finland, which seems rather closely related to, if not exactly an answer to your question.
Answer: That's just too specific. You can do a Masters degree in C.S. and take mobile programming classes and do your Masters project or thesis on mobile programming and even work with an adviser and do some research at the Masters level.
Answer: I have found this erasmus mundus programme:
Master's Programme in Security and Mobile Computing.
It is the closest i have found so far. I hope it helps.
Answer: For developing software and especially mobile applications on platforms like Android or iPhone you most likely won't need any degree at all. The documentation and other resources out there on the Internet are a great way to teach it yourself.
At universities you will learn more about the theoretical aspects and concepts of Computer Science, but it's unlikely that you learn how to program. You will of course have some introduction classes to programming, but "learning" programming is more a matter of experience and practice.
Conclusion: a degree might be useful, but for sure not necessary.
Answer: No, you can't get a master's in Mobile development.
Many colleges do have a Software Engineering program, and those that don't will usually at least offer a Computer Science program. Either of these will help get you into development. Of course, the Android platform is open source, so if you want to start learning on your own you can grab a compiler and the SDK and start there.
Comment: I second this. What you want is to do is a master in software engineering and then choose to specialise in mobile development.
Answer: San Diego State University offers an Advanced Certificate in Web and Mobile Applications Development.
The Certificate in Web and Mobile Applications Development provides students with the specialized knowledge that is important in the development of Web and mobile computer applications. Students will study and gain experience with the languages and frameworks that are most commonly used in developing these applications, with the design of user interfaces and software systems, and with associated topics such as networking, hosting infrastructure, and security. They will also learn the fundamental principles on which these topics are based, so that they will be prepared for the new technologies that are constantly being developed.
This is an advanced academic certificate at the postbaccalaureate level. The admission requirement is a Bachelor's degree in Computer Science or a closely related field. Individuals with an equivalent knowledge of the background materials through work or self-study may be accepted into this program at the discretion of the program director. Courses are a blend of face-to-face and online.
The certificate requires completion of at least four courses (12 units). With the approval of the graduate adviser, the courses taken in this certificate program may be applied toward the Master's degree in Computer Science.
For more information, contact the Department of Computer Science www.cs.sdsu.edu.
Answer: Online BS in Mobile Development at a very awesome school...
http://online.fullsail.edu/degrees/mobile-development-bachelors
Answer: I'm attending a Postgraduate Course in Software Development for Mobile Devices at Universidad de Alicante(Spain). The is another one in Universidad Politécnica de Valencia (also Spain). They aren't a Master Degree, but are the Postgraduate Course solution. I don't know where you are, but if you can, but the one I'm attending is very recommended.


How do I make new bookmarks (`bookmark-set`) be added to the end, not the beginning?

Question: How do I make new bookmarks (bookmark-set) be added to the end of the bookmark file, not the beginning?
Comment: Does it matter where it goes? I mean functionally. Or is this just an aesthetic choice on your part?
Comment: You can do what you like, of course. The reasons for the way it's designed are (1) this puts the latest bookmark first for completion and other operations, if no sorting is done, (2) this allows newer bookmarks with the same name to shadow older ones, without deleting the older ones (you can remove newer ones to re-expose older ones.
Comment: What @NickD asked: What's your use case? Maybe this is an [X-Y problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)?
Comment: Anyway, the answer is yes, you're right: `bookmark-store` puts a new bookmark first. And you can instead put it at the end as you did, or you can move it there with a separate operation (outside of `bookmark-store`) that does the same thing.
Comment: @NickD Generally speaking, my older bookmarks are the more high-value targets, and I would manually move new bookmarks if they were high-value. Newer bookmarks are either temporary or not that high value. (After all, most new files I open are low-value, while the files that I use the most remain almost constant.)
Answer: I found a way to do this via monkey patching, and looking at the original code, it doesn't seem like there is any other way to accomplish this. (The changed section is marked by @monkeyPatched.)
(defun bookmark-store (name alist no-overwrite)
  "Store the bookmark NAME with data ALIST.
If NO-OVERWRITE is non-nil and another bookmark of the same name already
exists in `bookmark-alist', record the new bookmark without throwing away the
old one."
  (bookmark-maybe-load-default-file)
  (let ((stripped-name (copy-sequence name)))
    (set-text-properties 0 (length stripped-name) nil stripped-name)
    (if (and (not no-overwrite)
             (bookmark-get-bookmark stripped-name 'noerror))
        ;; Already existing bookmark under that name and
        ;; no prefix arg means just overwrite old bookmark.
        (let ((bm (bookmark-get-bookmark stripped-name)))
          ;; First clean up if previously location was fontified.
          (when bookmark-set-fringe-mark
            (bookmark--remove-fringe-mark bm))
          ;; Modify using the new (NAME . ALIST) format.
          (setcdr bm alist))

      ;; otherwise just cons it onto the front (either the bookmark
      ;; doesn't exist already, or there is no prefix arg.  In either
      ;; case, we want the new bookmark consed onto the alist...)

;;; @monkeyPatched
      ;; (push (cons stripped-name alist) bookmark-alist))
      (setf (cdr (last bookmark-alist))
            (list (cons stripped-name alist))))
;;;

    ;; Added by db
    (setq bookmark-current-bookmark stripped-name)
    (setq bookmark-alist-modification-count
          (1+ bookmark-alist-modification-count))
    (if (bookmark-time-to-save-p)
        (progn (bookmark-save)))

    (setq bookmark-current-bookmark stripped-name)
    (bookmark-bmenu-surreptitiously-rebuild-list)))


Why does my app return NaN as the speed in my gps based app

Question: I am writing an app for Windows Phone 7 that uses the GPS to track how far and how fast the user is going. Using the Haversine formula according to Dr. Math.            http://mathforum.org/library/drmath/view/51879.html I can figure out how far this device has moved since the GPS was started. I am trying to display the speed that the user is traveling in a textblock in miles per hour by using this code here This code is fired when the position is changed.
<code>tblSpeed.Text == (((watcher.Position.Location.Speed * 60) * 60) / 1609.344).ToString()
</code>
When I run the app in the emulator and using the GPS emulator recipe found on the WP7 blog I only get 'NaN' in my speed text block. I have a timer that is timing how long the gps has been tracking and I have tried this code there too with the same result. Any ideas on what I could do to resolve this.
Answer: It seems that the GPS Recipe doesn't transmit the speed properly. However, check a comment by Morten Nielsen on the blog page as he explains how to manually calculate the speed.


How to keep stroke size unchanged when changing brush in Affinity Designer?

Question: Every time I switch brush type in Affinity Designer, the stroke size changes as well. How do I prevent this behaviour, keeping the same brush size when changing the brush type?.
Answer: Double-click a brush in the Brushes palette. You get an editing dialog for brush properties. One of them is the default width.
Making a brushset with proper defaul widths is your only option, there's not available such option as "use previous brush width" or "set the brush width for the painting tool". Unfortunate, but true.
Comment: I found the option you are referring to, but I was hoping for a better alternative. It's a shame that is the only way though. I suppose I could ask for a feature request to the Affinity team. Thanks for the answer.
Answer: Hold down the Option key (Mac) or ALT (PC) when choosing a different brush. Size will remain unchanged (Affinity 1.7). This might be new since this question was posted.


Can iPad be upgraded to iOS8 if desktop is running lion?

Question: Question: Current hardware is a 2007 Mac mini running Lion. From what I read, I cannot upgrade to Yosemite (if incorrect, please let me know) but the question is that I also have an iPad 2 and will I be able to upgrade to iOS8 if only have Lion on the desktop/mac mini?
Answer: Per Apple's iTunes 12.0.1 support article, OS X v10.7.5 (last version of Lion) is the minimum requirement for iTunes 12, which in turn is required to sync a device that is running iOS 8.
Based on this, it can be done. Not sure if I'd want to (performance may be horrendous in iTunes on hardware that is closing in on a decade old, and that wasn't particularly powerful even in its time) but it's possible.
You're probably safe til next September/October when iOS 9 (will presumably) be released - it will probably align with iTunes 13 that would almost certainly drop Lion support.


Will domain name with keyword "Android" makes any legal problem?

Question: I am planning to buy a domain with keyword "Android" to my website. But i am worried about having any legal problem doing this. If i am buying what all things i have to look forward?
Comment: As it is, this is really too broad and opinion-based to answer specifically. In brief, you should search the trademark databases in the countries that your website will target. If you're intending to focus on the same areas as the trademark was granted for, then it's unwise to buy a domain under which you'll have a legal risk in using.
Comment: As long as you are creating a site that is positive and not android sucks, then you generally should be okay. Brands only go after those who detract from their brand and not those who advance the brand. As well, you cannot confuse the brand so that users think you are the brand or have a relationship to the brand. If you are clearly a support site, for example, then you should have no problems. Trademark and copyright law are fairly clear and simple.
Answer: Based on this text https://developer.android.com/legal.html it seems that you can't use the Android name in any way that goes 'beyond describing it as being intended to use with the Android platform' (which I agree is sort of vague).
I suppose, therefore, that it depends on how you are planning to use the name.


Give user-creation privileges to a user

Question: In MySQL, how do you allow another user to create other users? In turn, those users should only be able to  view some tables.
Answer: From MySQL's privileges documentation, the CREATE USER privilege is the one you want:
GRANT CREATE USER ON *.* TO 'username'@'host'

For other privileges, read MySQL's GRANT documentation.
Note, I've linked to MySQL 5.0 documentation.  GRANT hasn't changed much over the years, so any newer versions should also use the same syntax.
Comment: Sorry, that should be `*.*` (star dot star). Stackoverflow ate my asterisks.
Comment: Thanks. To make it work, I had to specify GRANT CREATE USER ON *.* TO 'username'@'host'...
Comment: I'll edit the answer.
Answer: I think the answer is this:
GRANT INSERT on mysql.* to 'username';
GRANT RELOAD on *.* TO 'username'@'%';

Plus setting grant access on the relevant tables.
Comment: Or...I'm totally wrong. I got that from here: http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

Give user-creation privileges to a user


Do labor laws in the US forbid firing striking union members and hiring strikebreakers?

Question: I'm particularly interested in the context of current WGA/SAG-AFTRA strike in the US, but this is a general question. If some business amid a union strike would terminate its agreement with a union, can it lay off the striking union members and hire non-union workers in their place? Are there any legal reasons they can't do that?
Comment: Union contracts generally block strikes in their terms. The WGA/SAG-AFTRA and potential UPS strike are because the contracts have expired and negotiations for a new contract have failed. Therefore, the employers aren't subject to union agreements at this point.
Answer: It depends on the nature of the strike. If a strike is "protected" (allowed under the NLRA), you cannot be fired but if the strike is illegal, you can be. If the strike is legal and was at least in part over an unfair labor practice, you must be immediately reinstated after the strike ends. If the strike is over economic issues, you might have been replaced with a permanent employee so you are placed on a preferential hiring list. However this right to reinstatement can be lost if you engage in serious misconduct in connection with the strike or picketing.
Comment: Just to be clear, the National Labor Relations Act is the law that governs almost all private sector union-management relationships in the U.S. (except for a few in the interstate transportation industry).
Answer: A business cannot unilaterally terminate a collective bargaining agreement (the "Contract"), nor terminate a union's representation of its members.
A business may hire non-union employees to work during a work stoppage ("strike"), or may have exempt (management) employees perform the duties of the striking employees.  The union employees must be re-hired after a legal strike is over.  Caterpillar famously employed these tactics during a 17 month strike in the 1990s that was disastrous to the striking workers, who were forced to agree to significant concessions to end the strike.
Comment: Which particular legal norms forbid unilaterally terminating labor agreement or unilaterally terminating contract with the union? Are these some NLRA clauses?
Comment: @ambidexter2017 I assume it's NLRA, this is base level management training when dealing with unions in the US, which I have done.


Relative import issue while testing brownie

Question: I am using brownie to interact with my Ethereum smart contracts. The scripts and tests are located in parallel scripts/ and test/ folders. How can I access the functions from scripts/ in test/ files?

Unfortunately relative imports do not work.
from ..scripts.helper import get_account
from ..scripts.deploy_fund_me import deploy_fund_me

def test_stake_and_withdraw():
    account = get_account()
    fund_me = deploy_fund_me()
    entry_fee = fund_me.getEntryFee()
    tx = fund_me.stake({"from": account, "value": entry_fee})
    tx.wait(1)
    assert (
        fund_me.fundsByStaker(account.address) == entry_fee
    ), f"{account.address}'s staking failed!"

The tests are run using the brownie test command from the brownie_demo/ project's location. Using from scripts.helper import get_account does not work as well.
Answer: Add a __init__.py file in your scripts folder.
For reference on python modules


Is there a way to make a render animation take its information from texture mode?

Question: I have created a scene in cycles render mode.  I have followed the instructions on how to bake all the objects, and everything looks great in texture mode.  I can smoothly move through the scene.  However, when I am starting to render it, it is taking the information from render mode, and not from texture mode.  This is very slow. Did I do something wrong? Is there a way to make the render animation take its information from texture mode?
Comment: Welcome to Blender.SE eitan!  Please don't type your posts in all caps though, it just makes it annoying to read.
Answer: You can trigger what is called an OpenGL Render in any of the Viewport Shading modes (solid, textured, wire, matcap,...). Switch to the mode you want first (in your case Textured Mode, make sure the output settings in the render panel are set correctly, and use the Render OpenGL Animation or Render OpenGL Image button from the 3D Viewport:

That should only take a few seconds to complete on short animations. If you need to tweak the quality, you can use the menu in the Info header bar:

You can set Anti-Aliasing and the background transparency directly from there.
Answer: Rendering, is the process of making something that looks most realistic.
All photons are calculated, reflections, materials glossiness etc.
Cycles has a lot of complex materials just look here
http://www.blenderguru.com/articles/cycles-shader-encyclopedia/
And the fun thing those can even be combined and become even more complex.
It can render life like animations, as if taken by a camcorder, in fact its even possible to combine video and rendering. (creating a life like walking dinosaur in your street that's possible).
Besides Cycles there is also Blender Internal (top of your screen) it has a different way of creating materials, and its slightly faster but less realistic.
As for a quick texture preview render option, you might go into the top of your screen when using cycles, top menu under render go for OPENGL render, its more texture a like, but by default you''l see some wires as well. It can be used to render a preview of your animation more quickly. for example if you want to do a fight scene and just make sure all movements are smooth, try that.
This does render the viewpannel, note that there are some extra options hidden in the normal 3d view, several options can be enabled for better openGL rendering, like options for shading and mesh display  (to have depth blur ), and to remove edge lines (which normally for edit mode you would like to see but not for a demo movie. Those options are on the right side of the 3d pannel itself, find the + symbol to expand it.
Comment: So how does the fact that i baked the scene helped to render the animation if the blender is still treating it as normal objects with textures?
Comment: Well I supose now that you've baked it you could use the resulting texture as a texture on those object, and do openGL rendering of the viewport with those textures (instead of their original textures)..


About an inequality with central binomial coefficients ${2N \choose N }<2^N {N \choose N/2 }<2 {2N \choose N }$.

Question: For every even positive number $N$ we have:

$${2N \choose N }<2^N {N \choose N/2 }<2 {2N \choose N }$$

(Furthermore, $\frac{2^N {N \choose N/2 }}{{2N \choose N }} \to \sqrt{2} $ for large $N$; i.e., the middle expression tends to the geometric mean of those lower-upper bounds)
I'm interested in some simple proof (perhaps some visual/combinatorial one, perhaps counting paths?) of that pair of inequalities.
Answer: For the first one, note that choosing $n$ elements of $\{1,\dots, 2n\}$ is equivalent to taking a subset of $\{1, \dots, n\}$, and then choosing enough elements from $\{n+1, \dots, 2n\}$ to get exactly $n$. At the first step we have $2^n$ choices, and at the second step we have at most ${n \choose \lfloor n/2 \rfloor}$ choices, hence ${2n \choose n} <2^n{n \choose \lfloor n/2 \rfloor}$.
In formulas, this reads:
$${2n \choose n} = \sum_{k=0}^n{n\choose k}^2 \leq {n\choose \lfloor n/2 \rfloor}\sum_{k=0}^n {n\choose k} = 2^n {n\choose \lfloor n/2 \rfloor}.$$
I'm not immediately sure how to get the second part of the inequality in a similar fashion.
Answer: Here is another approach to the easy problem (the left inequality). It is tempting to divide by $2^{2N}$. We then are trying to prove that
$$\frac{1}{2^{2N}}\binom{2N}{N} <\frac{1}{2^N} \binom{N}{N/2},$$
(or is this where the problem came from?)
So we are trying to prove that if we toss a fair coin $2N$ times, the probability of a tie between heads and tails is less than the probability of a tie if we toss the coin $N$ times.  This is intuitively clear. And if it is clear, it must be easy to prove.
Indeed something much stronger is true. If we toss a fair coin $2n$ times, the probability of a tie is less than the probability of a tie if we toss the coin $2n-2$ times. Then start with $n=2N$, conclude that the probability of a tie is less than with $n=2N-2$, which is less than the probability with $n=2N-4$, and so on down to $n=N$.
So now we show that the probability of a tie with $2n$ tosses is less than the probability of a tie with $2n-2$ tosses. This is an easy calculation. If we don't want to calculate, note that we have a tie after $2n$ tosses if (i) we have a tie after $n-2$ tosses and the next two tosses split between heads and tails, or if (ii) after $2n-2$ tosses we have two extra heads, and finally get tail, tail, or if  (iii) after $2n-2$ tosses  we have two extra tails, and finally get head, head.
Since the central binomial coefficient is always the biggest, the sum of the probabilities of (ii) and (iii) is less than the probability of (i). This gives the desired result.
Unfortunately, it seems harder to find a quick intuitive justification for the inequality on the right.
Answer: It seems that nobody else has proved the upper inequality, so I'll give a couple (nonvisual, noncombinatorial, debatably simple) proofs.  In both
 I'll prove the slightly stronger inequality
$$ 2^n \binom{n}{n/2} < \binom{2n+1}{n} $$
which implies the desired one because $\binom{2n+1}{n} = \frac{2n+1}{n+1}\binom{2n}{n} < 2\binom{2n}{n}$.
First proof: This proof actually gives both inequalities at once.  First note that
$$\begin{aligned}
&(n+1)(n+2)(n+3)(n+4)\dotsm (n+n-1)(n+n) \\
&< (n+2)(n+2)(n+4)(n+4)\dotsm (n+n)(n+n) \\
&< (n+2)(n+3)(n+4)(n+5)\dotsm (n+n)(n+n+1)
\end{aligned}$$
In other words,
$$ \frac{(2n)!}{n!} < 2^n \left(\frac{n!}{\frac n2!}\right)^2 <\frac{(2n+1)!}{(n+1)!} $$
Dividing by $n!$ yields
$$ \binom{2n}{n} < 2^n \binom{n}{n/2} < \binom{2n+1}{n} $$
(That proof is, I think, the "standard" one.  If you take logs in those initial inequalities and try to estimate the resulting sums by integrals, you're on the road to proving Stirling's formula and Wallis's product and all that.  See Gowers' blog, for example.)
Second proof: This one is a little silly.  By the AM/GM inequality, if $0<t<1$ then
$$ \sqrt{t(1-t)} \le \frac12 $$
and so
$$ 2t(1-t) \le t^{1/2} (1-t)^{1/2} $$
Raising both sides to the power $n$ and integrating over $[0,1]$ yields
$$ 2^n B(n+1,n+1) \le B(\tfrac n2+1,\tfrac n2+1) $$
where $B(\cdot,\cdot)$ is the Beta function.  In other words,
$$ \frac{2^n}{(2n+1)\binom{2n}{n}} \le \frac{1}{(n+1)\binom{n}{n/2}} $$
Rearranging yields the desired inequality.
Answer: This is not quite simple, but here is my approach for the asymptotic formula. It's too long as a comment so I've posted it as an answer, but it is not complete. Perhaps someone can shed light on how to finish this.
$$\frac{2^{n} {N\choose\lfloor\frac{N}{2}\rfloor}}{{2N\choose N}}=2^n\frac{N!}{\lfloor\frac{N}{2}\rfloor!\left(N-\lfloor\frac{N}{2}\rfloor\right)!}\cdot\frac{N!N!}{\left(2N\right)!}$$
$$=2^N\cdot\frac{\left(N\cdot N-1\cdots \lfloor\frac{N}{2}\rfloor+1\right)\left(N\cdot N-1\cdots \lceil\frac{N}{2}\rceil+1\right)}{(2N)\cdot (2N-1)\cdots (N+1)}$$
we can split off this product, but we have to do so a bit differently for $N$ even and $N$ odd. Suppose first $N$ is even, then this expression becomes
$$=2^N\cdot\frac{(N)\cdot (N-1)\cdots(\frac{N}{2}+1)}{(2N)\cdot (2N-2)\cdots (N+2)}\cdot\frac{(N)\cdot (N-1)\cdots(\frac{N}{2}+1)}{(2N-1)\cdot (2N-3) \cdots (N+1)}$$
$$=2^N\cdot\frac{1}{2^{\frac{N}{2}}}\cdot\frac{1}{2^{\frac{N}{2}}}\prod^{N}_{k=\frac{N}{2}+1}\left(1 - \frac{1}{2k}\right)^{-1}$$
$$=\prod^{N}_{k=\frac{N}{2}+1}\left(1 - \frac{1}{2k}\right)^{-1}$$
analogously for odd $N$, we end up with
$$=\prod_{k=\frac{N+1}{2}+1}^{N}\left(1 - \frac{1}{2k}\right)^{-1}$$
In particular, if anyone can find a closed form solution for
$$P=\prod_{k=1}^{n}\left(1 - \frac{1}{2k}\right)$$
then we can prove the asymptotic bound. I am not sure if such an expression exists or not, but I am unsure of how to proceed as of now.
Comment: Tools from a traditional proof of Stirling's formula yield $4^n/\sqrt{\pi(n+1/2)} \le \binom{2n}{n} \le 4^n/\sqrt{\pi n}$ (e.g., Prop 6 [here](http://www.amotlpaa.org/math/sinepower.pdf)); applying that for $n$ and $n/2$ yields $\sqrt{2-\frac{2}{n+1}}\binom{2n}{n}\le 2^n\binom{n}{n/2}\le \sqrt{2+\frac1n}\binom{2n}{n}$.


What is the significance of Alara's gift to Capt. Mercer?

Question: In the third episode of season 2 of The Orville, Alara gets a gift for Capt Mercer as a goodbye present. The gift isn't revealed until the end of the episode. Capt Mercer opens the box and pulls out a jar of pickles and smiles. What is the significance of pickles? I must have missed or am not remembering some kind of inside joke.
Comment: is this Season 2? because 3rd episode of Season 1 is about Bortus's child being born a girl and a debate on forcing a sex change operation while Season 2 Episode 3 starts with Isaac breaking Alara's arm and her being told she has to return to her home planet (didn't get to see the entire episode but the next episode suggests she ended up staying)
Comment: Yes season 2. Forgot to add that.
Comment: I believe this was a reference to season 1 where he occasionally would ask her to open a jar of pickles (stuck doors, etc).
Answer: Essentially, Alara is the strongest member of the Orville's crew but, initially, rather than concentrate on her duties as Security Chief the emphasis on her character was based on her strength to open stuck doors etc. and, on at least one occasion, open a jar of pickles.
In the very first episode, Mercer asks her.

"Alara. You want to open this jar of pickles for me?"

She makes this look easy and he then says

" I loosened it for you."

..to make it seem as though he didn't really need her help.


"All" missing from favorites bar in mail on Mavericks

Question: I used to have a choice "All" on the favorites bar in Mail on Mavericks. (This is on an iMac). It has disappeared.  Is there a way to get it back?
Answer: You can try dragging all mail from the sidebar up to the favourites bar:
Comment: I don't have an "All Mail" but I do have an "Archive" in the same spot as you have All Mail. Dragging it to the bar worked for me. You might have to click the "Show" button on the left side of the favorites bar.
Answer: "All" appears when you search. When not searching, "Inbox" will display all of your received messages.


The relation of a schizophrenia drug side effect and caffeine intake

Question: I am listening to the book Surviving Schizophrenia and in the book, it is mentioned that drugs like Clozapine increases in blood level if the patient takes Caffeine, and can have side effects due to elevated levels. In case the patient takes Caffeine, can't just less amount of Clozapine work since it'll be significant enough to help the patient and cause less side effects too? I am not from a medical background, sorry if these things are pretty obvious in medical community
Comment: Welcome to Biology.SE! Please take the [tour] and then go through the help pages starting with [Ask] questions effectively on this site and [edit] or delete your question accordingly. In particular note that personal medical questions are **not** appropriate for this site. No matter how good your (and our) intentions are, relying on health information from people who aren't medical professionals is unwise and could be **extremely** dangerous. Thanks!
Comment: In general, since everyone metabolizes caffeine and clozapine differently, it would be extremely hard to make sure that the patient got the right dose.  It's easier to say "stop using caffeine while on this".  Grapefruit juice does much the same thing; makes it harder to break down drugs, doctors do not say "drink grapefruit juice and we'll halve your dose".  They say "avoid grapefruit juice".
Comment: The place to ask about medical topics is SE Medical Sciences. Here the focus is on defined biological mechanisms, rather than complex diseases and the varying effects of drugs.
Answer: I used Google Scholar with the search terms of clozapine, caffeine.
I only found small scale studies, but they agree that it is likely that Clozapine levels are affected by caffeine intake.
To really understand the implications of this it would be necessary to research what the range of Clozapine levels actually are in patients and what the effective level is, as well as the levels that give side-effects.
Only then can the changes due to caffeine be seen to be significant or not
Example paper studying 12 volunteers below (full text available)
Hägg, S., Spigset, O., Mjörndal, T. and Dahlqvist, R. (2000), Effect of caffeine on clozapine pharmacokinetics in healthy volunteers. British Journal of Clinical Pharmacology, 49: 59-63.
https://doi.org/10.1046/j.1365-2125.2000.00111.x
Available at:
https://bpspubs.onlinelibrary.wiley.com/doi/full/10.1046/j.1365-2125.2000.00111.x
Comment: Your DOI link is incomplete.


Why probability of detection by performing unambiguous quantum measurement is less than random guess in mesoscopic quantum regime?

Question: In mesoscopic quantum regime (mean photon number 10000) and non-orthogonal coherent state(number of non-orthogonal coherent state 2000), why probability of detection by performing quantum unambiguous measurement is less than random guess(1/2000). My question is that, if probability of detection is less than random guess following any particular quantum measurement process, then it will be better to follow random-guess(no-measurement).
Comment: The citation is given below (page-7)-Quantum Unambiguous measurement: http://arxiv.org/pdf/quant-ph/0507043v1.pdf
Answer: The title of the paper is "Optimum Unambiguous Discrimination Between Linearly Independent Symmetric States".
Random guessing is an ambiguous discrimination procedure. It can return the wrong answer without telling you that it failed.
More generally, unambiguous discrimination procedures are less likely to succeed because removing any chance of accidental failure also sacrifices any chance of accidental success. You don't get the free $+1/n$ boost that ambiguous procedures get from falling back to random guessing when all else fails. They start from zero, and when the states are really close and have trace distance $<< 1/n$ that makes quite a big difference.


how to fix weird bumps that were added by cloud texture

Question: I've been trying to model this little claypot, I'm kind of a newbie here, and whilst making a clay texture I added this cloud type texture, which happened to add little weird lumps on top ring of the pot, and i also seem unable to make the outer ring a bit thicker too :( Would appreciate if someone told me how to fix it. Also, got problems with the mesh made by using a grease pencil, it gets insside of the pot when applying scale, which also makes lumps weirder.

link for a file
https://drive.google.com/file/d/1QDcW5W3o1dQyU9gXVwXATvE7mE25CDik/view?usp=sharing
Comment: Hit the wrench icon, you have a displace modifier on the object that is producing the lumpiness based on the cloud texture.
Comment: @AllenSimpson questioner already acknowledges this.  Or maybe he edited to include this fact.  What do you think about my answer using V-groups or Weight-Painting?  Perhaps there's even better?
Comment: @james_t Ah, missed that.  I live in the shader editor, but it seems like a fine solution to me.
Answer: There may be other precise methods, as this one eliminates some of the "artisan imprecision" (displacement, distortion) you would be looking for around the top.   Assign most of the vertices to a vertex group:

And then use this group in the Vertex Group field so that these edges aren't included in the Texture displacement:

I think this is at least better than a half solution.  You can try either of 2 V-groups. Also, you may find that Weight Painting or weighting LT 1.0 as you assign vertices closer to the top, may improve the subtle result you are hoping for.
Here is my solution
Comment: oh my god thank you so much!
Comment: any ideas on how to make the grease drawing wrap around the pot?..
Comment: @bathroomenjoyer I missed this as you asked a 2-part Q and should probably post this as a separate Q as this is a common problem with multi-part Qs.  I'm not a grease user so cannot help you on that one.  If you could use the Check-mark at the top of my answer my reputation increases, thanks.


UX Facebook "Like" Page before the Good Stuff

Question: If you took a questionnaire online with the idea that when you finish you will get training, and after you finish the questionnaire you are presented with a popup box asking you to "Like" the questionnaire page on Facebook before you get your training, would you press "Like"?
Comment: Are you asking if *we* would press Like or whether users are likely to (pun not intended)?
Comment: If we would press Like, also are curious what you think about other users.
Comment: Okay. I think asking people here for their opinions on the Like button is off-topic, but asking for data on what users think (given that there are references/evidence) is okay. What does everyone else think?
Answer: I wouldn't click "Like" because clicking like signs you up for spam:

Facebook sometimes makes very curious decisions with respect to user privacy. Recently, one of them came to my attention, and it is so comprehensively wrong that I had to put up a public service announcement about it.
You've seen the Facebook "Like" buttons all over the Internet, right? Liking anything lets the owner spam you. No, really. If you doubt me, click the Like button on this page: you'll find a message from me on your News feed (the big list where you see updates from your friends) within 5 minutes, unless Facebook has shut down this tech demo since publication.
Answer: The only way to get a valid answer is to test it, count the number of users who get that popup and the number of users that click like and continue to the training - now you have the exact percent of your users from your specific audience that don't want to like you and you can make the decision how many users you are willing to lose to be liked on facebook.
And I wouldn't click like because I don't have a facebook account! (I know, facebook has more users than there are atoms in the universe but people like me exists and if you want me to use your site (or buy from you) you have to respect that).
Answer: I wouldn't press "Like" either - not before seeing what kind of training I would be getting.  When you Like something on Facebook, it's a sort of endorsement - an advertisement to your friends and I wouldn't endorse something unless I find it worth while.  Also, I personally am very wary when a webpage tries to make you Like something before you see the content.
I would suggest you let your users browse the training pages, and popup your question after a certain amount of time.  If you give your users great content, they'll be more inclined to "Like" your page without you having to force them to do it right off the bat.

UX Facebook “Like” Page before the Good Stuff


What are notable uses of the phrase "living hand to mouth"

Question: I would like to use the phrase "living hand to mouth" as a title of an art piece. However, just looking for the phrase mostly results in uses where the origin is explained. What are notable uses of the phrase "living hand to mouth"? Are there other major literary of art uses of the phrase, and if so what are they?
Comment: Everybody eats hand to mouth. The idiom is ***living** hand-to-mouth**.
Comment: @JohnLawler derp. corrected. re-searched, got better origins, fewer errant misappropriations
Comment: One question: why are you asking if the idiom has already been used in literary contexts? As a name of a work of art it sounds nice..
Answer: The original form of the phrase appears to have been "to live from hand to mouth." The 1756 edition of Johnson's Dictionary of the English Language notes the phrase "hand to mouth," and cites an example from Roger L'Estrange. A later edition of the dictionary repeats the L'Estrange citation and adds two earlier ones.  From Samuel Johnson & Henry Todd, A Dictionary of the English Language with Numerous Corrections and With the Addition of Several Thousand Words (1818):

HAND to mouth. As want requires.
In matter of learning, many of us are fain to be day-labourers and to live from hand to mouth, being not able to lay up any thing. B[isho]p [Edward] Reynolds [A Treatise] of the Passions [and Faculties of the Soul of Man], ch. 37. [1640]
They, good people, live but from hand to mouth. Beaum[ont] and Fl[etcher] Mad Lover. [1647]
I can get bread from hand to mouth, and make even at the year's end. [Roger] L'Estrange. [by 1704]

An even earlier instance of the phrase appears in John Florio's 1603 translation of Montaigne, "Of three Commerces or Societies," in The Essayes of Montaigne, Volume 5 (1603):

If any say to mee, It is a kinde of vilifying the Muses, to use them onely for sporte and recreation, he wots not as I doe, what worth, pleasure, sporte, and pass-time is of: I had well nigh termed all other ends ridiculous. I live from hand to mouth, and with reverence bee it spoken, I live but to my selfe : there end all my designes. Being young I studied for ostentation ; then a little to enable my selfe and become wiser ; now for delight and recreation ; never for gaine.

The phrase also comes up significantly in Malthus's Essay on the Principle of Population and in William Hazlitt's rejoinder to that work. From Thomas Malthus, An Essay on the Principle of Population, or, A View of Its Past and Present Effects on Human Happiness, new and enlarged edition (1803):

The labouring poor, to use a vulgar expression, seem always to live from hand to mouth. Their present wants employ their whole attention; and they seldom think of the future. Even when they have an opportunity of saving, they seldom exercise it ; but all that they earn beyond their present necessities, goes, generally speaking, to the alehouse. The poor laws may, therefore, be said to diminish both the power, and the will, to save, among the common people, and thus to weaken one of the strongest incentives to sobriety and industry, and consequently to happiness.

An from William Hazlitt, A Reply to the Essay on Population, by the Rev. T.R. Malthus" (1807):

Mr. Malthus proposes to remove this dazzling object [the work-house] out of their [the poor's] way ; to make them indulge in larger views of things by setting before them the prospect of their wives and children starving, in case of any accident to themselves, and to stimulate their industry by lowering their wages. The poor live from hand to mouth, because, in general, they have no hopes of living in any other way. They seldom think of the future, because they are afraid to think of it. Their present wants employ their whole attention. This is their misfortune. … If what they earn beyond their immediate necessities goes to the ale-house, it is because the severe labour they undergo requires some relaxation, because they are willing to forget the work-house, their old age, and the prospect of their wives and children starving, and to drown care in a mug of ale, in noise, and mirth, and laughter, and old ditties, and coarse jokes, and hot disputes ; and in that sense of short-lived comfort, independence and good-fellowship, which is necessary to relieve the hurt mind and jaded body.

The phrase "living from hand to mouth" turns up in a 1641 translation of Guillaume Du Bartas, "The Handie-Crafts," in Du Bartas, His Diuine Weekes and Workes (1641):

If they desire a Medler for their food,
They must goe seek it through a fearfull wood ;
Or a brown Mulbery, then the ragged Bramble
With thousand scratches doth their skin bescramble.
Wherefore (as yet) more led by th' appetite
Of th' hungry belly then the tastes delight,
Living from hand to mouth, soon satisfi'd,
To earn their supper th' afternoon they ply'd.
Unstor'd of dinner till the morrow-day :
Pleas'd with an Apple, or some lesser prey.

Here is a typical later occurrence, from Henry Wood, Mrs. Halliburton's Troubles (1798):

The Crosses, turned from their home, their furniture sold, had found lodgings ; two rooms. Improvident as ever were they. They did no attempt to rise, even to their former condition ; but groveled on, living from hand to mouth.

Instances of the phrase without from occur much later. The first two instances that a Google Books search finds are from 1912 and 1919, but the shorter form begins to appear frequently only after World War II. From a series of "Cards and postcards" copyrighted on April 15, 1912:

When love and youth live hand to mouth.—To you.

And from The Peanut Promoter (March 1919):

Our business was never better and we are consuming large quantities of peanuts. On account of the uncertainty of lifting the embargo [on peanuts from Asia], we think everyone is living "hand-to-mouth." and we firmly believe that the market will strengthen up in the near future. Stocks, of course, are getting less every day, and it was advised last month that peanut butter manufacturers on the coast will eventually have to get peanuts in the South if the embargo remains on the imported nuts.

On area where "hand to mouth" goes a bit farther back involves the expression "a hand-to-mouth existence." The first Google Books match for this phrase is from Edward Bellamy, Equality (1897):

[T]welve per cent of the whole nation, including the very rich and the well-to-do, monopolized eighty-seven per cent of the total wealth of the country, leaving but thirteen per cent of that wealth to be shared among the remaining eighty-eight per cent of the nation. This eighty-eight per cent of the nation was subdivided into the poor and the very poor. The last, constituting fifty per cent out of the eighty-eight, or half the entire nation, had too little wealth to be estimated at all, apparently living a hand-to-mouth existence.

Another early user of this expression was Edith Wharton, The Custom of the Country (1913):

She saw the mistake she had made in taking money from him [Van Degen], and understood that if she drifted into repeating that mistake her future would be irretrievably compromised. What she wanted was not a hand-to-mouth existence of precarious intrigue: to one with her gifts the privileges of life should come openly.

The precise phrase "living hand to mouth" has appeared in published works for only about 100 years, and I don't find any instances of its use that match the historical resonance of the use by Malthus and Hazlitt of "live from hand to mouth."


General price lowering and debt hypothetical

Question: Assume for a moment that the CPI accurately encompasses all prices. Also assume that I have $100 of outstanding debt. Let's now say that the CPI decreases by 25%. In real terms, this change in CPI effectively makes my debt now $133, correct? This is from a lecture I was watching. I understand there is a 33% jump between 75% of original CPI and 100%, but I would like to understand more clearly why it is not $125. Can someone please tell me the right way to think about this?
Comment: We would need more context from the lecture to answer this. I think there is some missing info in this question.
Answer: The CPI is dollars per goods/services. The value of a dollar is how much goods/services you can get per dollar. So that is the reciprocal; to get the value of a dollar, you divide by the CPI.
Suppose apples start out costing $1 a pound. Then your $100 debt corresponds to 100 pounds of apples. If the cost of apples decreases by 25%, the new price will be $0.75 a pound. This corresponds to 133 pounds of apples. So measured in past dollars, you debt is now $133.
When you subtract from the denominator, that's not the same as adding to the numerator. 1/(1-x) is not equal to 1+x. The more you subtract from the numerator, the greater further subtraction are relative to what's left; if you subtract one from 100, you're decreasing it by 1%, but once the numerator gets down to 50, subtracting one is subtracting 2%. because of this, subtracting from the denominator has more of an effect than adding to the numerator, and the effect is more pronounced the more you subtract. If the CPI decreased 99%, then your debt would be worth $10,000 in past dollars.


How and why does downsampling reduces resolution in time

Question: in my Course we talked about filter banks and the prof said that we get reduced resolution in time because of the downsampling after the band-pass filters. Is this because we now have fewer sample points per second to look at the narrowband signals?
Answer: Anytime you take away "actual" data samples away by donwsampling, yes, you are loosing on finer granular data in time domain and hence reducing resolution. However, consider, the following case, an input signal is first up sampled by 2(interpolation) and then down sampled by 2, does it decrease resolution of actual data, not quite, because the upsampled new data points were anyways interpolated versions of the original data. So you have in total not lost any resolution of the actual data. So when we talk about resolution we should always be referring to resolution with reference to the actual signal data points
It's always helpful to keep in mind what happened before the down sampling.
Almost all the time in a system, a downsampling would be happening on an "oversampled signal"(for noise reduction purposes) or preceded by upsampling for rate conversion. In both cases, the data points that would be throwing off were in any case "not required" for processing.
In summary, yes, any time you throw away actual samples of the signal you do loose on information in time domain, but as illustrated above its important to keep in mind that what is being down sampled are actual or artificial data.
Side note on Frequency Domain: Any time we down-sample a signal, we are essentially limiting the signal bandwidth that can be represented unambiguously
Answer: Yes, you are right. By downsampling we are reducing sample points per second (basically lowering the sampling rate). The time gap between adjacent samples increases as a result, hence degrading the resolution in time.
Imagine, your original sampling frequency was $\text{100kHz}$. Your time interval between samples was $\text{1/100k}$ = $\text{10us}$. If you down sample by $2$, the time difference between adjacent samples becomes $\text{20us}$. So the corresponding sampling rate is $\text{50kHz}$, which is half of the original rate.
Answer: Down sampling usually requires filtering to prevent aliasing (unless the signal was already suitably bandlimited for the lower rate).
A low pass filter removes high frequency components.  Part of the shape and location of signal transition edges in the time domain is represented by high frequency components in the frequency domain.  Removing those high frequency components can not only distort the shape of a transition edge, but also move the exact location of zero-crossings, peaks, etc.  Thus distorting or reducing time resolution of those events.


Accessing localhost from outside

Question: I have looked for some way to run node.js server on my android device. I found some good article describing it :  https://medium.freecodecamp.com/building-a-node-js-application-on-android-part-1-termux-vim-and-node-js-dfa90c28958f#.xrh3v0du1.   I have followed the tutorial and installed linux vm  on my device and installed node.js. I have successed to run my node.js script and access it from android browser. But I can't find any way to open this page outside my android device by ip address.
Comment: Have you found the ip-address of your android device? What happens when you try to access that with the correct port?
Comment: yes, on whatismyip.com.    nothing, can't find
Comment: How do you connect to the internet. If you are on wifi you probably have an internal ip, given by your router. http://android.stackexchange.com/questions/2984/how-can-i-see-what-ip-address-my-android-phone-has
Comment: I have tried 2 ways : by wifi & by 3G. it's same, nothing
Comment: When you use 3G your telco could block the port. By wifi you probably have an internal IP that you will not get from whatsmyip. You need to list it on your device. What port are you running on?
Answer: You can access your localhost android running your Node, if your TelCo allow, following the below steps. Note: this is only valid when your mobile is connected using your phone data-plan (2-3-4-5... G data), and not when it's using a wi-fi connection. To be clear: your app, on your mobile, only serves content, by the below method, if this mobile is not using wi-fi data.
1 - setup an account in a dynamic dns provider website (good plans are always paid). There you will configure an URL like http://muhlinin.mydyndns.com which will be pointing to a dynamic IP number;
2 - install the respective dynamic dns app into your mobile, this app will forward your current IP number to your dynamic dns account, something that assures every request to http://muhlinin.mydyndns.com always will find your mobile to respond to that request, whatever IP your mobile has at the request time;
3 - on your android, running (for example) Termux and Node, make your .js server script listen to a not default port (cause the default, 80, may be closed by your TelCo), for example, 8000, on the dynamic url you got following itens 1 and 2 showed above. Something like this: http://muhlinin.mydyndns.com:8000
Of course, if your mobile turns off, or the respective dyn dns app is closed or not started, or your Node server is closed or not started, every call to http://muhlinin.mydyndns.com:8000 will result in error. So, in order to have everything working, you have to have the previous 3 steps done correctly and
 all opened and started on your mobile server:
1 - dyn dns app;
2 - Node.js runtime;
3 - your serverscript.js (which you will start by doing a simple 'node serverscript.js' on Termux.
Answer: Try running ifconfig in the terminal and look at the wlan0 entry for the inet addr: field to find your ip on your wifi.
Comment: Ipconfig for wlan0 returns me 192.168.1.11

Accessing localhost from outside


Exclude particular IP address from Postfix log

Question: I have a postfix relay system that uses HAProxy to check to make sure Postfix is responding as it should. There is a front-end load balancer which connects using an internal IP to the backend servers. Is there any way I can exclude this particular IP address from filling up the logs? I need HAProxy to run regular checks to make sure the server is up and running but I don't want this being logged every time.
Thanks in advance,
Chris.
Answer: I'm not clear which logs you are talking about exactly. You might be interested in the following HAProxy option log-health-checks:
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4.2-option%20log-health-checks
However, more generally you might consider investigating filtering options in rsyslogd. Assuming you whatever log you referring to is syslog traffic, rsyslogd can do all sorts of manipulations to that log data before logging it. See rsyslog filters for examples.
Answer: rsyslog filter is easiest.
I assume you have a good network health where you register rDNS Records
Add this line before mail.*
:msg, contains, "from haproxyhostname" ~

Answer: In addition of the answer of Jacob Evans, the IP can be added to the Postfix parameter smtpd_client_event_limit_exceptions to avoid the IP is taken into account in the statistics by anvil. In this parameter you will probably want to keep the value from $mynetworks also.
I used these two mechanisms to avoid the monitoring pollutes the Postfix log each minute.


What is the minimum distance from city that allow to see Milky Way plane?

Question: The light pollution fades the starlight coming from the Sky and this dont let people to see the Milky Way disc. Is there any study about this?
Comment: Light pollution varies per city. You'll have to specify a metropolitan area.
Comment: Drive about 1 hour away from the city and light pollution will get a lot better. Even a 30 minutes drive at freeway speeds, counting from the outer edge of the city, will give you a much darker sky. Of course, don't drive towards another city nearby, as that would be pointless. :)
Comment: 10 miles, straight up, would vastly improve the seeing, wherever you are.
Answer: The premise is certainly true. An exact distance isn't possible to determine since it would depend on how much light pollution is coming from the city, and how much haze (water droplets and particulates) is in the air. You could also be a "short" distance away but on a mountain with much greater elevation than the city.
Answer: The biggest factor defining the minimum distance is light pollution from the particular city you are talking about. You can find light pollution maps here and here. You can also find charts here that describe the quality of viewing based on a combination of cloud cover, haze, turbulence and wind, temperature, light pollution, and other factors. They look like this:


How does the government shutdown affect treasury bills?

Question: I'm investing in treasury bills directly through the treasury and was wondering how the government shutdown affects those bills. Will they still be auctioned? Has a government shutdown in the past affected the yields?
Comment: Given that issuing treasury bonds results in net revenue, it would be quite odd for them to be shut down for lack of funds.
Comment: @Acccumulation: the shutdowns aren't due to lack of actual money, they are due to lack of legal authority to _spend_ (technically, obligate) money, called appropriations. It is the debt limit, an entirely different problem which also pops up from time to time, that represents actual lack of cash. Welcome to the world of government accounting.
Comment: @dave_thompson_085 The shutdown of government functions is due to those government functions not having money. You do have a point that government functions not having money is due to the government not allocating money to those functions, rather than the government not having money to give to them. And the debt limit doesn't prevent obligating money, it just prevents fulfilling those obligations.Spending bills and bills that raise the debt limit are separate. And if issuing treasury bonds were shut down, that would effectively set the debt limit at zero.
Answer: Treasury bonds will probably still be issued, as the departments in charge of that sort of thing will be deemed essential and will not have funding completely cut. I can't find any resources that say this explicitly, but it is was I would expect.
A government shutdown will effect the yields. Through my research it appears they will rise, but the likelihood of the US being downgraded from a AAA credit rating (and thus yields jumping a lot) is close to zero.
This article from CNBC talks about the rise in yields on T-Bonds as the government tries to solve the issue.
Another article from CNBC covers the potential credit rating downgrade.
Finally, this article from Fortune covers the shutdown more broadly and talks about some of the consequences of the shutdown.
Hope this helps!


Exporting Fbx from maya to Unity makes the model deformed

Question: So I have a female avatar model and I have attached cloth model to it by binding it to skeleton rig. After that copying weights from avatar to the cloth model. Now when i export it as an fbx and open it in unity, it converts the whole model into a deformed shape. I have removed the errors related to scale compensation as well by running the (ScaleCompenstationOff ) mel script in Maya but still no success. Kindly let me know if you guys know of any solution to this problem !!!
Answer: I might come a bit too late. I had the same issue, what I did to fix this was to copy and paste the following code and paste it on the MEL box:
<code>{
string $selected[] = `ls -type joint`;
select -r $selected;
}

string $sel[] = `ls -sl`;
string $singleJnt;
for ($singleJnt in $sel)
{
setAttr ($singleJnt + ".segmentScaleCompensate") 0;
}
</code>
You have to do it everytime you make a new joint.
Source
Answer: I've had this problem as well. What solved it for me was deleting non-deformer history for the model. (edit -> delete all by type -> non deformer history)


How to easily start a fire in a charcoal for grilling without using gas?

Question: Are there any life hacks for starting a fire in a pack of charcoal for grilling without using gas? I do have access to matches, lighters, etc.
Comment: hm... would a fire piston work?
Comment: This is the best way to light charcoal https://www.youtube.com/watch?v=XoRGGLahuVU&t=3s
Answer: I really like to use the "chimney starter" that came with my Weber Kettle for this. I really don't want to advertise for Weber but those things are good! You may find something comparable or can build one yourself.
Instead of just placing the charcoals in your grill, place your chimney starter in the grill and fill that with charcoals. Then just stuff some ring shaped newspaper underneath it, make sure air supply is ensured and light it.
Your charcoal is ready whey you see  orange color deep inside the chimney starter. Make sure to wear heat-resistant gloves and pour the charcoals into your grill.
The below image uses paraffin cubes instead of newspaper. You can basically use any kind of firelighters, but you'll usually already have some newspaper laying around.

Text- & image-source:
The Virtual Weber Bullet - How To Use A Chimney Starter
Comment: These things are excelent, and if you're careful/sensible then you don't need heat resistant gloves. They also work for small amounts of wood, or lumpwood charcoal as well as briquettes.
Comment: We have one of these, excellent thing. You could make one yourself from a big tin (paint or sauerkraut or so) with the top and bottom cut out, and holes punched for air. You'd have to invent a handle though, they get really hot. The hard part is where to put it once your grill is lit. We put it on a stone slab on the wooden deck. If fact the grill-expert used to light it on there too, and at the end of summer there was a big burn mark under the stone.
Comment: and has the added benefit of being ready faster than just a pile of charcoal.
Answer: Toilet paper and cooking oil:

Make 4-5 cones of toilet paper by wrapping it round 3 fingers about 6 times.
Drizzle cooking oil into each cone, about a teaspoon in each (it can get messy, do this over the charcoal)
Spread the cones evenly through the charcoal and sort of bury them in so the top of the cones are at the same level as the top of the bed, standing vertically.
Place a few pieces of charcoal around the top edges of the cones, but not covering them completely.
Carefully light each cone and watch it all take place

Make sure the cones are big enough and saturated enough that they don't burn out too quickly. You may need to shuffle the charcoal around a bit to make sure they are getting enough flames on them.
This method is as effective as using firelighters (and cheaper, and probably cleaner!).
Answer: Paper and cooking oil. You can make a bed of scrunched up paper (newspaper is probably about the best) under the charcoal. Paper burns up quickly so you need a lot of it. You can drizzle cooking oil on the charcoal. Cooking oil won't set light easily but the burning paper will get it hot enough and give the flames enough intesity and longevity to get the coals smouldering. I'm assuming this is for a barbecue. When getting it started, you want it sheltered from the wind (but not smothered with a lid). Once the flames have died down, you want to get airflow to the coals, by moving it if safe.
Comment: Funny enough, I use a similar method, but put the cooking oil on the paper and not the charcoal. It prevents the paper from burning quickly and provides a secondary fuel for the paper to burn.
Answer: I've used different techniques with more or less success :

simple plain Zip barbecue starters (or similar) : not very efficient used alone
zip + paper : slightly more efficient, not much, paper won't last long
paper + kindling : like this method, but can be a bit slow and do a lot of smoke, you also need kindling...
zip + kindling : a bit less smoke and ashes than previous method

basically, I love using kindling, but there are also other solutions like the one proposed by Alex. I've already seen it in action and indeed it was quite impressive. You don't need to go Weber for this, other brands have this kind of tool, the idea being to avoid charcoal to spread and concentrate it right above the fire. Air circulation is also very good. Some barbecue actually include this "chimney" under the barbecue self. But that's a tool more that you need...
Answer: I used an electric coil BBQ starter. It's a heating element like you would find at the bottom of your dishwasher, but small with a handle and a cord. You stack the charcol briquetes in a pyrimid on top of it and plug it in. In a few minutes the coal will start with a small flame. Take the coil out so not to damage it and wha-la a fire with out gas, starter or oil.
Answer: Get a old ice cube tray or two, I use six at a time. Get a old sauce pan, melt wax and pour. "Hint" Garage sales for old candles or buy some its cheap. Some people use old egg cartons and do away with standard charcoal use hard wood charcoal.
Comment: Welcome to Lifehacks SE. I'm not sure I understand what your answer is trying to say. You mention ice cube trays, sauce pans, and egg cartons, but I'm not really sure what you're answer actually is. Could you clear this up?


jQuery and PHP suggested answers

Question: Hey guys, there is a form where the user select some of his friends and I'm curious on how I can implement a list that searches simultaneously while the user is typing a friend's name and when he selects the name the name is written in the text box(jQuery). And if the user wants to select more than one friend, when I'm inserting the names in the database, how can I separate the names that are written in one input field?
Answer: Are you looking to write your own plugin or would you like to use an existing one?
If you want something ready made, here are a few examples
if you want something extremely light, only 6kb packed, this one would be the best choice
Autosuggest jQuery Plugin
Older one but still good
Tokenizing Autocomplete
Answer: You should take a look at the jquery auto-complete plugin:
http://docs.jquery.com/Plugins/autocomplete
Also, you could separate the names using commas.
Answer: This what already asked here on this site.
Facebook style JQuery autocomplete plugin
The accepted answer cited this jQuery code.
https://github.com/loopj/jQuery-Tokenizing-Autocomplete-Plugin
Answer: http://jqueryui.com/demos/autocomplete/
Although think twice about including the whole jquery ui library for this one plugin
Answer: I've implemented this a couple of times, it is not that difficult to achieve decent results and the basic idea that I used was...
1) create an input box.
2) create a div positioned directly underneath the input box.
3) create a jquery keypress handler. if there are more than x characters typed, ajax request.
4) loop through the results, and if they exist, append result divs to the result box.
5) show the result box.
I can dig up some example code if you would like. Not sure what you are talking about with the select multiple, but you could keep a variable of selected, and change the color of the result div when it is clicked on, this way many results can be selected and then processed later.

jQuery and PHP suggested answers


Using Entity Framework with Telerik's Controls

Question: I have worked with products of Telerik about two week,and  in my opinion the Entity Framework is better than the Open Access(ORM), But i wonder that other Products of Telerik(EXP:GridView or ....) hasn't any problem with Entity Framework? I want to start a Project with Entity Framework and Telerik's Controls
Answer: You shouldn't run into any problems. Entity Framework and the Telerik Tools are compatible with one another, in fact I have used EF and Telerik together in a number of projects.
Comment: which control do you  suggestion to use with Entity Framework?
Comment: I typically use Code First Entity Framework as it produces cleaner code rather than using the EDMX file.  Not a big fan of EDMX at all.  Just keep in mind that the Telerik grids and combobox controls all require IEnumerable or IQueryable in their data source.
Answer: We use the EntityFramework in conjunction with Telerik's controls extensively, and have not had any issues or problems.  Telerik's controls seem to always behave as expected when binding to individual objects or lists.
Good luck!
Answer: To take the classical 3 tier approach...
Are you asking if your data access layer (i.e. EF) is compatible with your UI (i.e. Telerik controls)?
The answer is kind of up to you as you should provide the middle layer (i.e. the business/service layer).
If you are finding direct dependencies between the two then I would advise looking at the architecture of the application.  They shouldn't be connected directly.
Comment: thanks for your answer. i want to implement business layer. i dont want to connect Open Access with Telerik controlo directly


What are the reasons to use a dust cover protector in a full concert piano while performing?

Question: In the Liszt Piano Concerto no. 2 by L'Orchester de Paris with Khatia Buniatishvili as the soloist, they covered the top of that beautiful Steinway although they had public and were recording ... I would think perhaps that it was the solution to deal with some light reflection undesired in the recording but I wonder if there are common reasons to do this, as long as the aesthetics of the piano could be (subjectively speaking maybe) affected.
Answer: The dust cover is not really a dust cover, but is really a piece of sound absorbing material to control reverbations from the rest of the orchestra.  Lots of clever acoustic engineering goes into these concerts.
Comment: It would be to stop sound reflection rather than reverberation.
Comment: Where were the mikes placed?  if outside the cover, then probably the cover also served to balance the amplitude of the piano against the orchestra.


frequencies of light

Question: Why are available frequency of light continuous ? I keep hearing that atoms absorb (and emit ) photons of particular frequency which correspond to their energy levels of their electron. Where do all other colours come from ?
Comment: @JavierBadia: Spectral lines are so because electrons inside atoms have quantized energy levels, but thermal radiation (that of a black body) is caused by kinetic interations between atoms, and that energies are not so quantized. Hence, the thermal spectrum is very smooth, save the occasional emission or absorption line.
Comment: The Doppler effect and the expansion of space are two things that are responsible for changing wavelengths.
Comment: @jhobbie I understand what you are talking but how to link it by giving logical proof
Comment: @jhobbie: And maybe more importantly, the black body radiation is continuous.
Comment: What do you mean?
Comment: @rodrigo: But surely black body radiation should come from the contributions of all the atoms in the black body?
Answer: I think I see two questions in your post.
Each frequency of light will produce a color response in the brain.  However, the brain is capable of perceiving colors that do not correspond to pure frequencies, for example pink, cyan, and brown.  These are produced by combinations of frequencies which the brain boils down to a single color.
The statement that atoms absorb and emit single frequencies is only approximately true.  If you could completely isolate an atom from any other interaction, and be made to be stationary (and isolation can very nearly be accomplished experimentally) it absorbs and emits light at very nearly a single frequency.  In fact, even an ideally isolated and stationary atom will absorb and emit light in a range of frequencies, although that range is very very small for the isolated atom.
But atoms are rarely isolated.  They find themselves in environments with lots of neighboring atoms.  In a solid there are atoms nearby which distort the energy levels of the isolated atom, causing the frequencies of absorption and emission to broaden enormously.  In a gas, atoms are not stationary, causing Doppler shifts as @jhobbie mentioned.  Furthermore, they are constantly colliding with other atoms, which also leads to distortions and broadening of frequencies.  In effect, in such cases, we have a situation where each individual atom finds itself in its own particular environment, and can absorb and emit at it's own peculiar frequency ... and there is an enormous range of such environments, so there can be an enormous range of frequencies.
Additionally, most materials when heated emit a continuous spectrum of frequencies due to the random collisions and vibrations of their atoms and electrons.  The incandescent light bulb is a perfect example of that.  It emits light at all visible frequencies.
There are several mechanisms that lead to random shifting and broadening of spectral "lines", so that in practice, all frequencies are available to form colors.
Comment: Mechanism is much the same.  As you heat things up there's more and more kinetic energy around which can be transferred to electronic (and vibrational) levels of the molecules.  The lines are additionally broadened by Doppler shifts at higher speeds.  But the visible light comes from transition between states.  Diamond has no states, vibrational nor electronic, that emit in the visible, so at temperatures that make tungsten glow white, diamond remains dark and transparent.
Comment: Is the photon emission of heated objects happening via a different mechanism than the quantized electron-level jumping that causes discrete emission lines, or is the heating just broadening the effect of the kinetic energy and Doppler shifts?

frequencies of light


Fast orthogonal projection of vectors onto other vectors numpy

Question: I have two large equal size 2D numpy arrays of cartesian vectors:
A = [[ax1, ay1, az1], [a2], [a3], ...] where a1 = [ax1, ay1, az1]
B = [[bx1, by1, bz1], [b2], [b3], ...] where b1 = [bx1, by1, bz1]

I need to orthogonally project each vector in A onto its respective vector in B and output it to an array of vectors C. The vectors in B are unique. If I were to use a for-loop I could use:
c1 = (np.dot(a1, b1) / np.dot(b1, b1)) * b1

And store c1, c2, c3, etc. in a 2D output array C.
However in reality A and B each contain about 50 million vectors so using Python for-loops is painfully slow.
I tried simply replacing the individual vectors with the 2D arrays in the equation above hoping that numpy would automatically broadcast it. It didn't unfortunately. I tried using the modifier [:,None] on array B hoping that that would help numpy understand I want it to work along the vertical axis of my arrays and orthogonally project the individual vectors in A onto those in B but no luck. I've tried googling for an anwser to this but so far no luck. Anyone any ideas how to do this more quickly than a for-loop, preferrably entirely in numpy?
Comment: I think this needs a [mcve] ( not the 50 million vectors :) ), and some actual code.  For example the loop to demonstrate what values you expect, and one or more of the failed 'broadcasting' cases with error messages.  Are you aware the `@/np.matmul` does a `broadcasted` `dot`?  Have you read its docs?
Answer: The pseudocode looks clear enough to me, so I'll go ahead and answer with an example in which we have 50 (instead of 50 million) pairs of vectors to project in a 3-dimensional (corresponding with the x, y, and z in the pseudocode) space:
import numpy as np
rng = np.random.default_rng(842945689356)
A, B = rng.random((2, 50, 3))

# Method 1
dot_ai_bi = (A * B).sum(axis=-1, keepdims=True)
dot_bi_bi = (B * B).sum(axis=-1, keepdims=True)  # or square `norm`
C = dot_ai_bi / dot_bi_bi * B

# Method 2 (faster in my tests)
# inspired by an non-accepted answer of
# https://stackoverflow.com/questions/62500584/vector-dot-product-of-corresponding-rows-using-numpy
# Forgive me for answering if this question would be considered a duplicate,
# but I think it's a slight extension
dot_ai_bi2 = np.einsum('ij,ij->i', A, B)
dot_bi_bi2 = np.einsum('ij,ij->i', B, B)
C2 = (dot_ai_bi2 / dot_bi_bi2)[:, np.newaxis] * B

# Check results against looping over rows
for ai, bi, ci, ci2 in zip(A, B, C, C2):
    ref = (ai @ bi) / (bi @ bi) * bi
    np.testing.assert_allclose(ci, ref)
    np.testing.assert_allclose(ci2, ref)

In short, dot and matmul want to do regular matrix multiplicatation, whereas you want a reducing operation like dot with an axis argument. You can get that behavior by implementing the inner product yourself (since sum has an axis argument), or you can use einsum. (Perhaps there is some clever way of doing what you want with dot or matmul by taking advantage of their N-D array rules, but I suspect either of the solutions above would be just as performant and more natural.)
Comment: A `matmul` version of your `C2` is `res=(A[:,None]@B[:,:,None])[...,0]/(B[:,None]@B[:,:,None])[...,0] * B`.  This expands `A` and `B` to 3d, with `50` being the batched dimension.
Comment: Good to know! Surprising that `einsum` is still substantially faster (in my experiments).
Comment: Thank so much! The einsum solution works wonderful! I'd upvote the accepted answer but I don't have the karma to do so apparently.


Changing Network Adapter in KVM

Question: I'm building a server to be deployed on a KVM host in the near future. I'm building the machine on my personal laptop in KVM using the virt-manager GUI for KVM. To begin with I kept most of the default values including using a NAT adapter creating it's own network for host/guest communication. If I change this setting to a bridged adapter, the Ubuntu Server guest fails to configure the network on boot and I get the "Waiting up to 60 more seconds for network configuration" message. What would be the best way to get the guest to work with the bridged adapter?
Answer: When I build my VMs in KVM, I use VMM (Virtual Machine Manager) it is in the Ubuntu software app, you connect to the VMhost via SSH, the only gotchas are you will want to also install Ask Pass as well, anyway, after running through all the configurations Disk size, memory etc, right before you start the VM for the first time there is a check-box that allows you to configure more settings, and below that there is a drop down for the network, I choose bridged from there.
The one gotcha to Bridged Networks and this is documented all over is that it does not work with Wireless network cards.
That being said if you are building your VMs on your laptop, are you using a wired connection or wireless.  here is a link discussing the issue:
https://help.ubuntu.com/community/KVM/Networking
I hope this helps.  Chris
Comment: Thanks, I was trying to bridge the adapter to wlan0. It works fine when I use eth0.

Changing Network Adapter in KVM


Data testing for multiple rows of table using Robot Framework

Question: Below is the web table under testing. Some time rows would be 5 OR some time 25 or more.
Currently I am able to test for 1 or 2 rows with my script shown below.
I want to make it dynamic so it could test all the rows and return proper result.

There are two scenarios which I need to autoamte.
1. I want to check every row one by one and get results till the last rowThen I need click on Process when it returns row with the value Good OR Excellent.
My Current code to Process 1 row
<code>${rows1} =  get element count   xpath=//*[@id="MonthlyReport"]/tbody/tr
sleep  2
log to console   Total Rows= ${rows1}
${ProductID}    Get Text    xpath=//*[@id="MonthlyReport"]/tbody/tr[${rows1}]/td[1]
log to console  CBID is ${ProductID}

${Status} =   Get Text    xpath=//*[@id="MonthlyReport"]/tbody/tr[${rows1}]/td[9]
Log to Console The ${ProductID} is with ${Status}
${Remarks} =   Get Text    xpath=//*[@id="tableChargebacks"]/tbody/tr[${rows1}]/td[10]
Log to Console The ${ProductID} is with ${Remarks}
Click Element  xpath=//*[@id="Process"]
</code>
2. In another case I need to search all these products id by entering id in search field and then verify if searched productid is in table.
Currently I am doing this but it not dynamic. I want to test through all the products and verify its returning the row of searched Product ID.
My Current code to search 1 row
<code>${ProductID1}    Get Text    xpath=//*[@id="MonthlyReportSearch"]/tbody/tr[${rows1}]/td[1]
log to console  CBID is ${ProductID}
#Click on Search tab
Input Text  //input[@placeholder='Search ...']    ${ProductID}
sleep   5
Should Be Equal    ${ProductID}    ${ProductID1}
IF    ${ProductID} == ${ProductID1}
Log To Console    Search Result is correct.
END
</code>
Answer: I tried this and working as expected.
<code>FOR    ${rowno}    IN RANGE    1    ${rows}+1
${Status} =    Get Text    xpath=//*[@id="monthlyreport"]/tbody/tr[${rowno}]/td[1]
Log To Console    Status is ${Status}
</code>


Merging strategy for access 2007 database

Question: I have a Windows application with access 2007 database which is deployed at 2 different locations - Sales office/Factory. Every day both the locations need to sync up the database so orders are propagated to the factory and order status/invoices/production updates are propagated to the sales office. The schema for both the db copies is identical and most tables have autonumber primary keys. Client would like to be able to ftp drop/email the accdb files across and run a program that syncs the database. I googled upon a utility for older version of access (mdb) but nothing for 2007 version. Is there anything out there that can help me achieve this or will i have to look for a homegrown solution? What would be your solution? Migrating to SQL is not an option :)
Answer: This is an extremely complex topic, particularly in the multi-master scenario where both dbs are being updated.
The simple answer is to eliminate the need for two copies of the database by providing access to the same database from both locations. The simplest way to do this is to host the app on Windows Terminal Server. If full-time Internet access is not possible, then other solutions, like Sharepoint, become more viable. Programming the synchronization is an exercise in real punishment, as the issues with multi-master editing are pretty severe.